UNPKG

@atlas-kitchen/adyen-web

Version:
3 lines (2 loc) 2.06 kB
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/MultibancoVoucherResult/MultibancoVoucherResult.js";import{CoreProvider as o}from"../../core/Context/CoreProvider.js";import n from"../internal/RedirectButton/RedirectButton.js";import{TxVariants as s}from"../tx-variants.js";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(e){i(t,e,r[e])}))}return t}function c(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}class a extends e{get isValid(){return!0}formatProps(t){return c(p({},t),{name:t.name||"Multibanco"})}formatData(){return{paymentMethod:{type:this.props.type||a.type}}}render(){return this.props.reference?t(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(r,c(p({ref:this.handleRef},this.props),{onActionHandled:this.onActionHandled}))):this.props.showPayButton?t(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{showPayButton:this.props.showPayButton,name:this.displayName,amount:this.props.amount,payButton:this.payButton,onSubmit:this.submit,ref:t=>{this.componentRef=t}})):null}constructor(...t){super(...t),i(this,"handleRef",(t=>{this.componentRef=t}))}}i(a,"type",s.multibanco);export{a as MultibancoElement,a as default}; //# sourceMappingURL=Multibanco.js.map