import{F as x,P as i,Q as t,R as a,Z as N,X as l,T as v,W as B,a0 as n,a2 as b,c3 as S,ag as E,aq as I,_ as f,a1 as M,e as s,a6 as y,a7 as g}from"./vendor-DJC-2VPc.js";import{d as D,e as F,cN as T,g as Q,cD as R,b1 as z}from"./index-BZco6cza.js";import{u as A}from"./useSkyflowCards-ZBR5w7MM.js";/* empty css                                                         */const X={class:"credit-card__number"},q={key:0,class:"credit-card__expire"},G={class:"credit-card__expiration-date"},L=x({__name:"credit-card",props:{cardNumber:{},cardExpiration:{},cardActive:{type:Boolean}},emits:["remove"],setup(_){return(e,o)=>{const m=i("VcIcon"),c=i("VcButton");return a(),t("div",{class:N(["credit-card",{"credit-card--disabled":!e.cardActive}])},[l(m,{class:"credit-card__icon",name:"credit-card"}),v("div",X,n(e.cardNumber),1),l(c,{class:"credit-card__remove","aria-label":e.$t("common.buttons.remove_credit_card"),color:"neutral",size:"xs",variant:"no-background",icon:"delete-thin",onClick:o[0]||(o[0]=p=>e.$emit("remove"))},null,8,["aria-label"]),e.cardExpiration?(a(),t("div",q,[b(n(e.$t("common.prefixes.expires"))+" ",1),v("span",G,n(e.cardExpiration),1)])):B("",!0)],2)}}}),O={},P={class:"flex flex-col border-y bg-additional-50 pb-4 pt-4.5 shadow-sm md:flex-row md:items-center md:rounded md:border-x md:py-0"};function W(_,e){return a(),t("div",P,[...e[0]||(e[0]=[S('<div class="grow px-6 text-lg md:py-5 md:text-base"><div class="w-8/12 bg-neutral-100"> </div></div><div class="mt-1.5 shrink-0 px-6 text-sm md:mt-0 md:text-base"><div class="w-32 bg-neutral-100"> </div></div><div class="hidden shrink-0 px-6 md:flex"><div class="h-7 w-16 bg-neutral-100"> </div></div>',3)])])}const Z=D(O,[["render",W]]),j={key:0,class:"flex flex-col divide-y lg:space-y-3 lg:divide-none"},H={key:1,class:"space-y-3 md:space-y-2.5"},ae=x({__name:"saved-credit-cards",setup(_){const{t:e}=E(),{openModal:o}=F(),{loading:m,skyflowCards:c,fetchSkyflowCards:p}=A(),{mutate:k}=I(T,{refetchQueries:[z.Query.GetSkyflowCards]}),{storeId:h}=Q;function w(d){const u=o({component:"VcConfirmationModal",props:{variant:"danger",title:e("pages.account.saved_credit_cards.delete_credit_card_modal.title"),text:e("pages.account.saved_credit_cards.delete_credit_card_modal.message"),async onConfirm(){u(),await k({command:{skyflowId:d,storeId:h}})}}})}return p(),(d,u)=>{const V=i("VcTypography"),C=i("VcEmptyView");return a(),t("div",null,[l(V,{tag:"h1"},{default:M(()=>[b(n(d.$t("shared.account.navigation.links.saved_credit_cards")),1)]),_:1}),s(m)?(a(),t("div",j,[(a(),t(y,null,g(3,r=>l(s(Z),{key:r})),64))])):s(c)?.length?(a(),t("div",H,[(a(!0),t(y,null,g(s(c),(r,$)=>(a(),f(s(L),{key:$,"card-number":s(R)(r.cardNumber),"card-expiration":r.cardExpiration,"card-active":r.active,onRemove:J=>w(r.skyflowId)},null,8,["card-number","card-expiration","card-active","onRemove"]))),128))])):(a(),f(C,{key:2,text:d.$t("pages.account.saved_credit_cards.no_cards"),icon:"credit-card"},null,8,["text"]))])}}});export{ae as default};
//# sourceMappingURL=saved-credit-cards-Cn5v5Ul_.js.map
