@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 2.13 kB
JavaScript
import{createElement as t}from"../../external/preact/dist/preact.js";import o from"../../utils/isMobile.js";import e from"../helpers/IssuerListContainer/IssuerListContainer.js";import{QRLoader as r}from"../internal/QRLoader/QRLoader.js";import"../../core/Context/CoreProvider.js";import"../../external/preact/hooks/dist/hooks.js";import"../../core/Errors/AdyenCheckoutError.js";import"../../core/Errors/SRPanelContext.js";import"../internal/Button/Button.js";import"../internal/QRLoader/QRLoaderDetailsProvider.js";import{TxVariants as s}from"../tx-variants.js";import n from"./components/IrisComponent.js";import{IrisQrCodeInstructions as i}from"./components/IrisQrCodeInstructions.js";import{IrisMode as p}from"./types.js";import{DEFAULT_IRIS_COUNTDOWN_TIME as a}from"./constants.js";function d(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}class m extends e{renderIssuerList(){return super.componentToRender()}formatData(){return this.mode===p.BANK_LIST?{paymentMethod:{type:this.type,issuer:this.state?.data?.issuer}}:{paymentMethod:{type:this.type}}}formatProps(t){return{...super.formatProps(t),countdownTime:t.countdownTime??a}}get isValid(){return this.mode!==p.BANK_LIST||super.isValid}componentToRender(){return"qrCode"===this.props.type?t(r,{type:s.iris,brandLogo:this.icon,clientKey:this.props.clientKey,qrCodeData:this.props.qrCodeData?encodeURIComponent(this.props.qrCodeData):null,countdownTime:this.props.countdownTime,paymentData:this.props.paymentData,delay:this.props.delay,onActionHandled:this.onActionHandled,onError:this.props.onError,onComplete:this.onComplete,introduction:i,showAmount:!0,copyBtn:!1}):t(n,{setComponentRef:this.setComponentRef,defaultMode:this.mode,onUpdateMode:this.onUpdateMode,issuerListUI:this.renderIssuerList(),showPayButton:this.props.showPayButton,payButton:this.payButton,issuers:this.props.issuers})}constructor(t,e){super(t,e),d(this,"mode",void 0),d(this,"onUpdateMode",t=>{this.mode=t}),this.mode=o()?p.BANK_LIST:p.QR_CODE}}d(m,"type",s.iris);export{m as Iris,m as default};
//# sourceMappingURL=Iris.js.map