import{r as t,h as r}from"./p-890a2f7e.js";import{d as a}from"./p-c5e6713f.js";import{a as e}from"./p-be8a42cb.js";import{p as i}from"./p-dc46d6c3.js";import{p as o}from"./p-da3bdb97.js";const s=class{constructor(r){t(this,r),this.created=!1}async getPayment(t,r){var a,i;let o;if(this.option&&t.items&&t.currency){const r=await this.cardInput.submit(null!==(i=null===(a=t.payment)||void 0===a?void 0:a.card)&&void 0!==i?i:void 0);this.created||(this.created=e.is(r)),o=e.is(r)?{type:"card",card:r,client:this.getClientData()}:void 0}return o}async confirmPayment(t,r,a,i){let o;if(t.items&&t.currency){const t=await this.cardInput.submit("card"in r?r.card:void 0,i);o=e.is(t)?{type:"card",card:t,client:this.getClientData()}:void 0}return o}getClientData(){return{browser:{colorDepth:screen.colorDepth,resolution:[screen.width,screen.height],java:navigator.javaEnabled(),javascript:!0,locale:a.Locale.is(navigator.language)?navigator.language:"en-GB",timezone:(new Date).getTimezoneOffset(),parent:window.location.origin}}}render(){return this.option?r("intergiro-card-input",{"api-key":this.option.apiKey,ref:t=>this.cardInput=t,cosmetic:this.cosmetic}):[]}};o("card",((t,a)=>{const e={type:"card",name:"Card",brand:t.service,component:r("ig-card-details",{option:i(t)?t:void 0,cosmetic:a,ref:t=>e.element=t})};return e})),s.style=":host{display:block}:host[hidden]{display:none}:host{display:-ms-flexbox;display:flex;-ms-flex-flow:row;flex-flow:row;-ms-flex-wrap:wrap;flex-wrap:wrap}";export{s as I}