PageSourceSearch

https://pagos.usek.cl/_nuxt/b073474e/BA2jl4mA.js

js usek.cl collected 2026-09-24 22:59:10 UTC 73,257 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Dz3woPHT.js","./BOH5IRVW.js","./entry.Dt8r7k2l.css","./wNSGIzw6.js","./e-2vJSxi.js","./DEHv7peM.js","./TSkeleton.BplFGOQo.css","./gW4ofI-w.js","./BhZZGsyC.js","./_WlVQju8.js","./CClg45q6.js","./BaseCheckoutNew.BkiUiswu.css","./AtoaAccountSelection.CybPIVi3.css","./Cf1Axgv4.js","./AtoaTwoFactorSelection.DVXf5fru.css","./CkB_j30L.js","./CCUBYAuH.js","./CIBoYGTF.js","./DCgFvPl5.js","./DQREW9Z4.js","./B6Gm-V1Q.js","./BInpqRcV.js","./CheckoutTitle.DLl1maSO.css","./DZu6Ti2i.js","./D9l6fa8S.js","./DHC-KhyU.js","./Bh4JC3Tu.js","./DetailsBoxRow.DQRcpoxw.css","./DSgjzqlK.js","./CheckoutSeparator.Di6qJT4-.css","./CheckoutDetailsBox.C-H8C92R.css","./BVtj2nyh.js","./CqkleIqs.js","./LvjpH1vl.js","./Hix0Qm4e.js","./BMm6t3u4.js","./B_m_5JoQ.js","./TermsAndConditionsCheckbox.BgXUBkMR.css","./DWOlbzUf.js","./DRfsxepS.js","./CFn6kVO4.js","./KlJH24p3.js","./CQfBR3YH.js","./l3QDY6Xh.js","./CheckoutError.Dsk7qmSL.css","./BFXqLExF.js","./IPAC.CWjfRqtz.css","./Dg7-iWIj.js","./TransferBankAppNotice.CsJhfhWo.css","./AtoaTwoFactorInput.CtIg4xGx.css"])))=>i.map(i=>d[i]);
2import{_ as Pt}from"./BInpqRcV.js";import{_ as gt,y as ht,g as ue,z as qe,e as de,u as Ue,h as me,B as ze,M as Ge,t as We}from"./e-2vJSxi.js";import{_ as Ke}from"./KlJH24p3.js";import{d as tt,h as J,e as Zt,c as w,l as Gt,t as B,n as _,z as c,x as o,q as p,b as t,Z as yt,A as D,B as k,$ as H,m as L,M as ot,I as st,a as Bt,J as Et,b3 as Te,X as kt,v as z,R as ft,_ as re,L as _t,r as A,ao as pt,u as bt,a3 as He,j as wt,E as rt,aC as Jt,aJ as Q,c9 as je,bC as Ve,K as _e,b7 as Ie,ay as Pe,ai as Rt,Q as Qt,aY as Ye,w as vt,au as Ee,bJ as Qe,aH as Ze,p as zt,as as Je,aU as Xe,bF as tn,bL as en,N as Se,y as xe,c$ as nn,C as an,aF as Mt,aM as pe,aI as Le,b9 as It,bY as se,bN as ie,F as on,bZ as sn,b8 as rn,S as cn,b_ as ln,aG as un,b2 as Oe,bf as dn,b4 as fe,aK as mn}from"./BOH5IRVW.js";import{g as _n}from"./Hc49PKlK.js";import{f as ce,a as pn}from"./DCgFvPl5.js";import{a as $e,b as vn,I as fn,t as Re,_ as gn,u as Me,c as hn,e as ge,A as he,T as ye,B as Be,d as yn}from"./CIBoYGTF.js";import{u as Xt}from"./LvjpH1vl.js";import{u as Wt}from"./DQREW9Z4.js";import{u as te}from"./BhZZGsyC.js";import{_ as kn}from"./BFXqLExF.js";import{u as Kt}from"./DBExxKTR.js";import{C as ee}from"./wNSGIzw6.js";import{s as Ne}from"./gW4ofI-w.js";import{u as Nt,A as Dt}from"./DwinCXLI.js";import{_ as bn}from"./DEHv7peM.js";import{_ as wn}from"./DSgjzqlK.js";import{_ as Cn}from"./Bh4JC3Tu.js";import{a as An}from"./DHC-KhyU.js";import{u as Tn}from"./BcFYqWGL.js";import{u as In,c as Pn}from"./BcV--AFU.js";import{e as ke}from"./B6Gm-V1Q.js";import{b as be,p as En}from"./CCUBYAuH.js";import{T as Sn}from"./Dg7-iWIj.js";import{c as xn}from"./CjQGSEbz.js";import{u as Ln}from"./CQfBR3YH.js";import{u as On}from"./DRfsxepS.js";import"./_WlVQju8.js";import"./CClg45q6.js";import"./CFn6kVO4.js";import"./D9l6fa8S.js";import"./DZu6Ti2i.js";import"./BVtj2nyh.js";import"./CqkleIqs.js";import"./BMm6t3u4.js";import"./B_m_5JoQ.js";import"./DWOlbzUf.js";import"./Hix0Qm4e.js";import"./DwDNgv4f.js";import"./l3QDY6Xh.js";const $n={class:"digital-manadate-explanation__header"},Rn=tt({__name:"DigitalMandateExplanation",emits:["continue"],setup(e,{emit:u}){const a=u,{t:g}=J(),{data:n}=Zt(),l=w(()=>{const m=n.value?.texts?.digitalMandateExplanationDescription;return typeof m=="string"&&m.trim()?m.trim():null});return(m,v)=>{const P=Pt,s=Gt("i18n-t"),d=gt;return _(),B(d,{"hide-details-box":"","hide-go-back-to-commerce":"","cta-text":m.$t("common.continue"),onCta:v[0]||(v[0]=f=>a("continue"))},{main:c(()=>[o("section",null,[o("div",$n,[p(t(yt),{icon:"building-library",size:"extra-large"}),p(P,{class:"digital-manadate-explanation__title"},{default:c(()=>[D(k(t(g)("digitalMandate.digitalMandateExplanation.title")),1)]),_:1})]),v[1]||(v[1]=o("hr",null,null,-1)),p(t(H),{variant:"b3",class:"digital-manadate-explanation__description"},{default:c(()=>[t(l)?(_(),L(ot,{key:0},[D(k(t(l)),1)],64)):(_(),B(s,{key:1,keypath:"digitalMandate.digitalMandateExplanation.description",scope:"global"},{descriptionAmount:c(()=>[o("strong",null,k(m.$t("digitalMandate.digitalMandateExplanation.highAmount")),1)]),descriptionTime:c(()=>[o("strong",null,k(m.$t("digitalMandate.digitalMandateExplanation.timeToWait")),1)]),_:1}))]),_:1})])]),_:1},8,["cta-text"])}}}),Mn=Object.assign(st(Rn,[["__scopeId","data-v-f073a68b"]]),{__name:"DigitalMandateExplanation"}),Bn={class:"digital-mandate-selection__header"},Nn={class:"digital-mandate-selection__details-container"},Dn={class:"digital-mandate-selection__details-list"},Fn={class:"digital-mandate-selection__detail"},qn={class:"digital-mandate-selection__detail-value"},Un=["alt"],zn={key:0},Gn={class:"digital-mandate-selection__disclaimer-text"},Wn={class:"digital-mandate-selection__disclaimer-text"},Kn=tt({__name:"DigitalMandateSelection",props:{mandate:{},amount:{},isLoading:{type:Boolean}},emits:["use-another-account","use-mandate"],setup(e,{emit:u}){Bt(d=>({v30b0e280:t(n).colors.info}));const a=e,g=u,n=Et(),{t:l}=J(),m=Te(),v=_n(a.mandate.institution,"default-bank"),P=`${m.public.paymentPortalAssetsUrl}/payment-method-cards/${v}.svg`,s=[{label:l("digitalMandate.existingDigitalMandate.institution"),value:a.mandate.institution_name},{label:l("digitalMandate.existingDigitalMandate.account"),type:"paymentMethod",value:a.mandate.account,showInstitutionLogo:!0},{label:l("digitalMandate.existingDigitalMandate.holderId"),value:ce(a.mandate.holder_id),dividerAfter:!0},{label:l("digitalMandate.existingDigitalMandate.transactionAmount"),type:"total",value:a.amount}];return(d,f)=>{const C=Pt,O=Gt("i18n-t"),h=gt;return _(),B(h,{"hide-details-box":"","hide-go-back-to-commerce":""},{main:c(()=>[o("section",null,[o("div",Bn,[p(t(yt),{icon:"building-library",size:"extra-large"}),p(C,{class:"digital-mandate-selection__title"},{default:c(()=>[D(k(t(l)("digitalMandate.existingDigitalMandate.title")),1)]),_:1})]),f[2]||(f[2]=o("hr",null,null,-1)),o("div",null,[p(t(H),{variant:"b3",class:"digital-mandate-selection__description"},{default:c(()=>[D(k(t(l)("digitalMandate.existingDigitalMandate.description")),1)]),_:1}),o("div",Nn,[o("dl",Dn,[(_(),L(ot,null,ft(s,(i,I)=>o("div",{key:I},[o("div",Fn,[p(t(H),{variant:"b2","font-weight":"semibold"},{default:c(()=>[D(k(i.label),1)]),_:2},1024),o("div",qn,[i?.showInstitutionLogo?(_(),L("img",{key:0,width:32,height:20,src:P,alt:`${e.mandate.institution}-logo`},null,8,Un)):z("",!0),p(t(H),{variant:"b3"},{default:c(()=>[D(k(i.value),1)]),_:2},1024)])]),i.dividerAfter?(_(),L("hr",zn)):z("",!0)])),64))])]),e.mandate.pending_payments?(_(),B(t(re),{key:0,"full-width":"",variant:"info",icon:"information-circle-solid",class:"digital-mandate-selection__disclaimer"},{default:c(()=>[p(t(H),{variant:"b3",class:"digital-mandate-selection__disclaimer-text"},{default:c(()=>[p(O,{keypath:"digitalMandate.existingDigitalMandate.paymentInProgress",scope:"global",plural:e.mandate.pending_payments},{pendingPayments:c(()=>[o("strong",Gn,k(e.mandate.pending_payments),1)]),pendingAmount:c(()=>[o("strong",Wn,k(`${("CLP"in d?d.CLP:t(ht))(e.mandate.pending_amount)}`),1)]),_:1},8,["plural"])]),_:1})]),_:1})):z("",!0)])])]),footer:c(()=>[p(t(kt),{loading:e.isLoading,"full-width":"",class:"digital-mandate-selection__use-mandate",onClick:f[0]||(f[0]=i=>g("use-mandate"))},{default:c(()=>[D(k(d.$t("digitalMandate.existingDigitalMandate.useMandate")),1)]),_:1},8,["loading"]),o("button",{class:"digital-mandate-selection__use-another-account",type:"button",onClick:f[1]||(f[1]=i=>g("use-another-account"))},k(d.$t("digitalMandate.existingDigitalMandate.useAnotherAccount")),1)]),_:1})}}}),Hn=Object.assign(st(Kn,[["__scopeId","data-v-8c56ee27"]]),{__name:"DigitalMandateSelection"}),jn=tt({__name:"DigitalMandate",props:{institutionId:{},tokuProduct:{},handleDismiss:{type:Function}},setup(e){const u=_t(),a=e,g=A(),n=A(!1),l=A(!1),m=A(),v=A("explanation"),{t:P}=J(),{session:s}=pt(),d=ue(),{$portalGatewayApi:f}=bt(),C=Xt(),O=$e(),h=Wt(),i=te(),I=A(a.tokuProduct),{selectInstitution:r}=vn(I.value),{selectedInstitution:b}=He(O),{setStepIndex:N}=O,x=w(()=>i.value.map(E=>E.id_invoice)),{amount:T}=qe({}),S=async()=>{try{const E=await f("/payment-method/high-value-transfer",{params:{customer:d.value,account:h.value,institution_id:b.value}});E.message==="ok"&&(m.value=E.data,g.value=E.data.id_payment_method)}catch{await r(a.institutionId)}finally{n.value=!0}},F=async()=>{l.value=!0;try{if(d.value){const E={customer:d.value,invoices:x.value,total:T.value,gateway:"toku_pac",additional:{payment_method:g.value},customer_action_metadata:C.value,toku_product:I.value};await f("/one_time/start",{method:"POST",body:E}),await rt({path:`/checkout/operation-receipt/${g.value}`,query:Jt(u,s.value?.id_checkout_session)})}}catch{throw l.value=!1,Q({title:P("common.unexpectedError.title"),message:P("common.unexpectedError.message")})}},$=()=>{m.value?v.value="existing":v.value="inscription"},G=async()=>{l.value=!0,await r(a.institutionId),v.value="inscription",l.value=!1},R=()=>!n.value||l.value;return wt(async()=>{N(1),await S()}),(E,V)=>{const it=Mn,X=Hn;return _(),L(ot,null,[t(v)==="explanation"?(_(),B(it,{key:0,onContinue:$})):z("",!0),t(v)==="existing"&&t(m)?(_(),B(X,{key:1,amount:("CLP"in E?E.CLP:t(ht))(t(T)),mandate:t(m),"is-loading":t(l),onUseMandate:F,onUseAnotherAccount:G},null,8,["amount","mandate","is-loading"])):z("",!0),t(v)==="inscription"?(_(),B(fn,{key:"pac","override-loading-state":R(),"override-toku-product":t(I),"data-testid":"pac"},null,8,["override-loading-state","override-toku-product"])):z("",!0)],64)}}}),Vn=Object.assign(jn,{__name:"DigitalMandate"}),De=()=>{const e=Xt(),u=je(),{emitIframeEvent:a}=Ve(),g=Kt(),n=A(!1),l=A(""),m=A(()=>{}),v=A(!0),P=A(null),s=_t(),d=de(),f=async(i,I,r,b={})=>await O({toku_product:r,institution_id:i,gateway:I,is_high_value_transfer:typeof b.is_high_value_transfer=="boolean"?b.is_high_value_transfer:void 0,partial_payment:typeof b.partial_payment=="string"?b.partial_payment:void 0,access_source:e.value?.access_source??"",sent_by:e.value?.sent_by??"",flow_name:d.value??"",is_multiple_payment:typeof b.is_multiple_payment=="boolean"?b.is_multiple_payment:void 0,redirect:s.query.redirection??"",partial_payment_amount:typeof b.total=="number"?b.total:void 0}),C=async i=>{const I=i.provider_request_details.url;if(l.value=i.transaction_id??"",n.value=i.provider_request_details.integration_type==="pop_up",i.provider_request_details.integration_type==="window")u.value?a({operationType:"REDIRECTION",data:{redirectUrl:I}}):window.location.href=I;else{const{width:r,height:b}=i.provider_request_details.details;m.value=()=>{v.value=!0,u.value&&!i.is_demo?a({operationType:"POPUP",data:{url:I,target:"PagoBanco",features:`scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=${r},height=${b},left=100,top=100`,method:i.provider_request_details.method,paymentIntentResponse:{providerRequestDetails:{url:i.provider_request_details.url,payload:i.provider_request_details.payload}}}}):(P.value=open(I,"PagoBanco",`scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=${r},height=${b},left=100,top=100`),i.provider_request_details.method==="POST"&&h(P.value,i))},m.value(),v.value=!1}};async function O(i){return await g({tokuProduct:i.toku_product,selectedInstitutionId:i.institution_id,gateway:i.gateway,partialPayment:i.partial_payment,accessSource:i.access_source,sentBy:i.sent_by,isHighValueTransfer:i.is_high_value_transfer,flowName:i.flow_name,isMultiplePayment:i.is_multiple_payment,redirect:i.redirect,partialPaymentAmount:i.partial_payment_amount})}const h=(i,I)=>
2{if(!i)return;const r=i.document,b=r.createElement("form");b.id="postForm",b.method="POST",b.action=`${I.provider_request_details.url}`,Object.entries(I.provider_request_details.payload??{}).forEach(([x,T])=>{const S=r.createElement("input");S.type="hidden",S.name=x,S.value=String(T),b.appendChild(S)});const N=r.createElement("input");N.type="submit",N.value="Submit",N.style.display="none",b.appendChild(N),r.body.appendChild(b),b.submit()};return{preStart:f,start:C,popUpWindow:P,usesPopUp:n,loadingBankButtonConfig:v,transactionId:l,handleRetryPopUp:m}},Yn={key:0},Qn={class:"payment-button__title"},Zn={class:"payment-button__message-bold"},Jn={key:0},Xn={key:1},ta={key:2},ea=tt({__name:"PaymentButton",props:{institutionId:{},gateway:{},tokuProduct:{}},emits:["open-pop-up"],setup(e){const u=e;let a=null;const g=Et(),{t:n}=J(),l=w(()=>g.value.colors.gray.dark3),{isMobile:m}=_e(),{preStart:v,start:P,popUpWindow:s,usesPopUp:d,loadingBankButtonConfig:f,handleRetryPopUp:C}=De(),O=()=>{a&&(clearInterval(a),a=null)};return wt(async()=>{const h=await v(u.institutionId,u.gateway,u.tokuProduct);await P(h),s.value&&(console.log("Payment button mounted"),a=Ne(()=>{console.log("Payment button popup closed interval",s.value?.closed),s.value?.closed&&console.log("Payment button popup closed!")},1e3),h.is_demo&&window.addEventListener("message",i=>{console.log("Received message:",i.data),i.data?.redirectUrl&&(console.log("Redirecting to",i.data.redirectUrl),window.location.href=i.data.redirectUrl)}))}),Ie(()=>{O()}),(h,i)=>{const I=Pt,r=gt;return _(),B(r,{"hide-details-box":""},Pe({title:c(()=>[t(m)?(_(),L("br",Yn)):z("",!0),p(t(yt),{icon:"information-circle",color:"rgb(23, 80, 173)",size:"huge",class:"payment-button__title-icon"}),p(I,null,{default:c(()=>[o("h1",Qn,k(t(d)?t(n)("dashboard.transferCL.paymentButton.popUpTitle"):t(n)("dashboard.transferCL.paymentButton.redirectMessage")),1)]),_:1})]),_:2},[t(d)?{name:"main",fn:c(()=>[p(ee,null,{default:c(()=>[o("div",{class:"payment-button__message subtitle",style:Rt({color:t(l)})},[o("span",null,k(t(n)("dashboard.transferCL.paymentButton.popUpMessageStart")),1),o("span",Zn,k(t(n)("dashboard.transferCL.paymentButton.popUpMessageMiddle")),1),o("span",null,k(t(n)("dashboard.transferCL.paymentButton.popUpMessageEnd")),1)],4),p(t(kt),{disabled:t(f)||t(s)!==null,onClick:t(C)},{default:c(()=>[t(f)?(_(),L("span",Jn,k(t(n)("dashboard.transferCL.paymentButton.popUpRetryButton.loading")),1)):t(s)===null?(_(),L("span",Xn,k(t(n)("dashboard.transferCL.paymentButton.popUpRetryButton.retry")),1)):(_(),L("span",ta,k(t(n)("dashboard.transferCL.paymentButton.popUpRetryButton.opened")),1))]),_:1},8,["disabled","onClick"])]),_:1})]),key:"0"}:void 0]),1024)}}}),na=Object.assign(st(ea,[["__scopeId","data-v-23701a9d"]]),{__name:"PaymentButton"}),aa={class:"option-entry__full-width"},oa={class:"option-entry__text-container"},sa={class:"option-entry__checkbox"},ia={key:0,class:"option-entry__tag"},ra={key:0,class:"option-entry__description"},ca={class:"option-entry__description-text"},la=tt({__name:"OptionEntry",props:{id:{},iconName:{},title:{},subtitle:{},tagText:{default:void 0},tagColorVariant:{default:"neutral"},descriptionTranslationPaths:{default:()=>[]},isCheckboxSelected:{type:Boolean},isDisabled:{type:Boolean}},emits:["on-click-checkbox"],setup(e,{emit:u}){Bt(f=>({v24dfb784:t(s),v0abaa03d:t(d),v329844c4:t(l)}));const a=e,g=u,n=Et(),l=n.value.colors.info,{isMobile:m}=_e(),v=()=>{a.isDisabled||g("on-click-checkbox",a.id)},P=w(()=>a.isDisabled?"option-entry__disabled":"option-entry__clickable"),s=w(()=>{switch(a.tagColorVariant){case"neutral":return n.value.colors.gray.light3;case"error":return n.value.colors.error+"29";default:return n.value.colors.gray.light3}}),d=w(()=>{switch(a.tagColorVariant){case"neutral":return n.value.colors.gray.dark2;case"error":return n.value.colors.error;default:return n.value.colors.gray.dark2}});return(f,C)=>{const O=Gt("i18n-t");return _(),L("div",aa,[o("div",{role:"radio",class:Qt(["option-entry__card",t(P)]),onClick:v},[p(t(yt),{icon:e.iconName,class:"option-entry__icon"},null,8,["icon"]),o("div",oa,[p(t(H),{variant:t(m)?"s4":"s3","font-weight":"semibold"},{default:c(()=>
2[D(k(e.title),1)]),_:1},8,["variant"]),p(t(H),{variant:t(m)?"b4":"b3","font-weight":"regular"},{default:c(()=>[D(k(e.subtitle),1)]),_:1},8,["variant"])]),o("div",sa,[e.tagText?(_(),L("div",ia,[p(t(H),{variant:"b4","font-weight":"semibold",class:"option-entry__tag-text"},{default:c(()=>[D(k(e.tagText),1)]),_:1})])):z("",!0),p(t(Ye),{id:"checkbox",value:e.isCheckboxSelected,class:"option-entry__checkbox",disabled:e.isDisabled},null,8,["value","disabled"])])],2),e.descriptionTranslationPaths&&e.descriptionTranslationPaths.length>0?(_(),L("ul",ra,[(_(!0),L(ot,null,ft(e.descriptionTranslationPaths,h=>(_(),L("li",{key:h},[p(t(H),{variant:"b4",class:"option-entry__description-text"},{default:c(()=>[p(O,{keypath:`${h}.description`,scope:"global"},{strong:c(()=>[o("strong",ca,k(`• ${f.$t(`${h}.title`)}`),1)]),_:2},1032,["keypath"])]),_:2},1024)]))),128))])):z("",!0)])}}}),ua=Object.assign(st(la,[["__scopeId","data-v-59f5c38f"]]),{__name:"MultiplePaymentButtonOptionEntry"}),da={class:"base-transfer-cl__header-info-message-container"},ma={class:"partial-transfer__payments-container"},_a={class:"base-transfer-cl__footer-info-message-container"},pa=tt({__name:"MultiplePaymentButton",props:{selectedInstitution:{},gateway:{},tokuProduct:{}},setup(e){const u=e,a=te(),{preStart:g,start:n,popUpWindow:l,usesPopUp:m,loadingBankButtonConfig:v,handleRetryPopUp:P}=De();v.value=!1;const{t:s}=J(),d=_t(),f=Wt(),C=A([]),O=A(),h=w(()=>C.value.length>0&&C.value.every(q=>q.status==="PAID")),i=A(0),{abortInitializedPaymentIntentsAndTransactions:I}=Nt(),r=A(null),b=A(!1),N=A(null),x=A(null),{session:T}=pt(),S=A(!1),{formatMoney:F}=Ue(),{$portalGatewayApi:$}=bt(),G=w(()=>(console.log("continueEnabled",i.value!==-1,C.value[i.value]?.status!=="PAID",h.value),i.value!==-1&&C.value[i.value]?.status!=="PAID"||h.value)),R=w(()=>C.value[i.value]),E=w(()=>h.value?s("common.back"):R.value?R.value.status==="FAILED"?s("directDebitOnetimeClPst.multipleTransfer.retryTransfer"):l.value===null&&r.value?s("directDebitOnetimeClPst.multipleTransfer.openPopUp"):l.value&&r.value?s("directDebitOnetimeClPst.multipleTransfer.popUpOpen"):`${s("directDebitOnetimeClPst.multipleTransfer.pay")} ${F(R.value.amount)}`:s("directDebitOnetimeClPst.multipleTransfer.pay")),V=async()=>{await I(Dt.MultiplePaymentButton);try{const q=await $("/payments/partial-payments",{method:"POST",body:{invoices:a.value.map(nt=>nt.id_invoice),account:f.value,institution_id:u.selectedInstitution,toku_product:u.tokuProduct,gateway:u.gateway,checkout_session_id:T.value?.id_checkout_session??null}});C.value=q}catch(q){throw console.error(q),Q({title:s("common.unexpectedError.title"),message:s("common.unexpectedError.message")})}},it=q=>{q!==i.value&&(r.value=null,l.value&&l.value.close(),l.value=null,i.value=q)},X=q=>{switch(C.value[q]?.status){case"PAID":return{text:s("directDebitOnetimeClPst.multipleTransfer.paid"),colorVariant:"neutral",isDisabled:!0};case"FAILED":return{text:s("directDebitOnetimeClPst.multipleTransfer.failed"),colorVariant:"error",isDisabled:!1};default:return{text:"",colorVariant:"",isDisabled:!1}}},ut=()=>{x.value&&(clearInterval(x.value),x.value=null)},et=async()=>{O.value=R.value,b.value=!1;const q={invoices:JSON.stringify([R.value?.id_invoice]),total:R.value.amount,is_high_value_transfer:!0,is_multiple_payment:!0,partial_payment:R.value.id},nt=await g(u.selectedInstitution,u.gateway,u.tokuProduct,q);await n(nt),r.value=P.value,r.value(),console.log("Multiple payment button popup window",m.value),l.value&&(console.log("Multiple payment button mounted"),N.value=Ne(()=>{l.value?.closed&&(N.value&&clearInterval(N.value),b.value=!0,v.value=!1)},1e3)),nt.is_demo&&window.addEventListener("message",Y=>{console.log("Received message:",Y.data),Y.data?.redirectUrl&&(console.log("Redirecting to",Y.data.redirectUrl),v.value=!1,window.location.href=Y.data.redirectUrl)})},ct=()=>{r.value?r.value():et()};return vt(b,async q=>{q&&(console.log("Payment button popup closed!"),l.value=null,r.value=null,console.log("calling getPartialPayments after popup closed"),await V())},{immediate:!0,deep:!0}),vt(h,async q=>{if(q){console.log("All partial payments paid!");const Y=await $(`/transaction/invoice/${a.value[0].id_invoice}`);
2console.log("Redirecting to receipt with transaction ID:",Y),rt({path:`/checkout/operation-receipt/${Y}`,query:{checkoutSession:T.value?.id_checkout_session,nextPath:d.path,nextQuery:JSON.stringify(d.query)}})}}),wt(async()=>{S.value=!0,await V(),S.value=!1}),Ie(()=>{N.value&&clearInterval(N.value),ut()}),(q,nt)=>{const Y=Pt,dt=gt;return _(),B(dt,{"hide-go-back-to-commerce":""},{title:c(()=>[p(Y,null,{default:c(()=>[D(k(q.$t("directDebitOnetimeClPst.multipleTransfer.title")),1)]),_:1})]),main:c(()=>[o("div",da,[p(t(H),{variant:"b3","font-weight":"regular"},{default:c(()=>[D(k(q.$t("directDebitOnetimeClPst.multipleTransfer.headerInfoMessage")),1)]),_:1})]),o("div",ma,[(_(!0),L(ot,null,ft(t(C),(lt,Z)=>(_(),B(ua,{id:Z,key:Z,"is-checkbox-selected":lt.status==="PAID"||t(i)===Z,"is-disabled":X(Z).isDisabled,"icon-name":"arrows-right-left",title:q.$t("directDebitOnetimeClPst.partialPaymentNumber",{number:Z+1}),subtitle:t(F)(lt.amount),"tag-text":X(Z).text,"tag-color-variant":X(Z).colorVariant,onOnClickCheckbox:it},null,8,["id","is-checkbox-selected","is-disabled","title","subtitle","tag-text","tag-color-variant"]))),128))]),p(ee,null,{default:c(()=>[o("div",_a,[p(t(yt),{icon:"information-circle",color:"rgb(23, 80, 173)",size:"medium",class:"base-transfer-cl__footer-info-message-icon"}),o("span",null,k(q.$t("directDebitOnetimeClPst.multipleTransfer.footerInfoMessage")),1)]),p(t(kt),{"full-width":"",color:"primary",variant:"primary",disabled:!t(G)||t(v)||!!t(l),onClick:ct},{default:c(()=>[D(k(t(E)),1)]),_:1},8,["disabled"])]),_:1})]),_:1})}}}),va=Object.assign(st(pa,[["__scopeId","data-v-8dc15902"]]),{__name:"MultiplePaymentButton"}),fa={class:"checkout-total-row"},ga=tt({__name:"CheckoutTotalRow",props:{amount:{}},setup(e){Bt(m=>({caa995aa:t(u).colors.gray.light4}));const u=Et(),{finalAmount:a}=me(),{country:g}=Tn(),n=w(()=>{switch(g.value){case"MX":return Ge(a.value);case"BR":return ze(a.value);default:return ht(a.value)}}),l=w(()=>e.amount?ht(e.amount):n.value);return(m,v)=>(_(),L("div",fa,[p(t(H),{variant:"b3"},{default:c(()=>[D(k(m.$t("checkoutDetails.labels.totalPayable")),1)]),_:1}),p(t(H),{variant:"b3","font-weight":"semibold"},{default:c(()=>[D(k(t(l)),1)]),_:1})]))}}),ne=Object.assign(st(ga,[["__scopeId","data-v-4950bebd"]]),{__name:"CheckoutDetailsBoxCheckoutTotalRow"}),ha=()=>{const e=ue(),{$portalGatewayApi:u}=bt();return Ee({queryKey:["walletCustomerAccount",e],enabled:()=>!!e.value,queryFn:()=>u("/wallet/customer-account",{query:{id_customer:e.value}})})},ya=tt({__name:"TransferCLWalletCheckout",props:{activationAmount:{},activationTime:{},isWalletActivationNeeded:{type:Boolean}},setup(e){Bt(S=>({v7e4e7304:t(l).colors.gray.medium2}));const u={cl_banco_consorcio:"Banco Consorcio",cl_banco_internacional:"Banco Internacional"},a={checking_account:"transferCLWallet.accountTypes.checkingAccount",rut_account:"transferCLWallet.accountTypes.rutAccount",sight_account:"transferCLWallet.accountTypes.sightAccount"},g=e,{t:n}=J(),l=Et(),{data:m,isLoading:v}=In(),{data:P,isLoading:s,status:d}=ha(),{session:f,isFetching:C}=pt(),{finalAmount:O}=me(),h=w(()=>m.value?.organization_name??"");Qe(d,S=>
2{if(S==="error")throw Q({title:n("common.unexpectedError.title"),message:n("common.unexpectedError.message")})});const i=w(()=>v.value||s.value||!f.value&&C.value),I=w(()=>{const S=P.value?.institution_id;return S?u[S]??S:""}),r=w(()=>{const S=P.value?.account_type;if(!S)return"";const F=a[S];return F?n(F):S}),b=w(()=>[{testId:"transfer-cl-wallet-beneficiary",label:n("transferCLWallet.labels.beneficiary"),value:h.value},{testId:"transfer-cl-wallet-government-id",label:n("transferCLWallet.labels.governmentId"),value:ce(P.value?.account_government_id??"")},{testId:"transfer-cl-wallet-bank",label:n("transferCLWallet.labels.bank"),value:I.value},{testId:"transfer-cl-wallet-account-type",label:n("transferCLWallet.labels.accountType"),value:r.value},{testId:"transfer-cl-wallet-account-number",label:n("transferCLWallet.labels.accountNumber"),value:P.value?.account_number??""}]),N=w(()=>!i.value&&g.isWalletActivationNeeded===!0&&g.activationAmount!=null&&g.activationTime!=null),x=w(()=>{const{activationAmount:S,activationTime:F}=g;return S==null||F==null?"":n("transferCLWallet.activation.disclaimer",{amount:ht(O.value),activationAmount:ht(S),activationTime:F})}),T=async()=>{await Pn([h.value,ce(P.value?.account_government_id??""),r.value,P.value?.account_number??"",I.value].join(`
3`))};return(S,F)=>{const $=bn,G=Pt,R=wn,E=Cn,V=An,it=gt;return _(),B(it,{"hide-go-back-to-commerce":""},{detailsBox:c(()=>[t(i)?(_(),B($,{key:0,height:"3.25rem"})):(_(),B(ne,{key:1}))]),title:c(()=>[p(G,null,{default:c(()=>[D(k(S.$t("transferCLWallet.title")),1)]),_:1})]),main:c(()=>[t(N)?(_(),B(t(re),{key:0,variant:"info",icon:"exclamation-circle-solid","full-width":"","data-testid":"transfer-cl-wallet-activation-disclaimer"},{default:c(()=>[D(k(t(x)),1)]),_:1})):z("",!0),p(V,{class:"transfer-cl-wallet__container"},{default:c(()=>[(_(!0),L(ot,null,ft(t(b),(X,ut)=>(_(),L(ot,{key:X.testId},[ut>0?(_(),B(R,{key:0})):z("",!0),t(i)?(_(),B($,{key:1,height:"2rem"})):(_(),B(E,{key:2},{default:c(()=>[p(t(H),{variant:"b4"},{default:c(()=>[D(k(X.label),1)]),_:2},1024),p(t(H),{variant:"b4","font-weight":"semibold","data-testid":X.testId},{default:c(()=>[D(k(X.value),1)]),_:2},1032,["data-testid"])]),_:2},1024))],64))),128))]),_:1}),p(t(re),{variant:"warning",icon:"exclamation-circle-solid","full-width":"","data-testid":"transfer-cl-wallet-warning"},{default:c(()=>[o("b",null,k(S.$t("transferCLWallet.warning.title")),1),D(" "+k(S.$t("transferCLWallet.warning.description")),1)]),_:1}),p(ee,null,{default:c(()=>[p(t(Ze),{class:"transfer-cl-wallet__copy-tooltip",label:S.$t("transferCLWallet.messages.copied!"),position:"top",size:"small",trigger:"click"},{default:c(()=>[p(t(kt),{"full-width":"","font-weight":"semibold",disabled:t(i),"data-testid":"transfer-cl-wallet-copy-button",onClick:T},{default:c(()=>[D(k(S.$t("transferCLWallet.copyButton")),1)]),_:1},8,["disabled"])]),_:1},8,["label"])]),_:1})]),_:1})}}}),ka=Object.assign(st(ya,[["__scopeId","data-v-17e2a3b4"]]),{__name:"TransferCLWalletCheckout"}),ba=tt({__name:"ActivationStepsText",props:{keypath:{},organizationName:{}},setup(e){return(u,a)=>{const g=Gt("i18n-t");return _(),B(t(H),{as:"span",variant:"b4","font-weight":"regular"},{default:c(()=>[p(g,{keypath:e.keypath,tag:"p",scope:"global"},{step1Url:c(()=>[...a[0]||(a[0]=[o("a",{href:"https://login.portalempresas.bancochile.cl/bancochile-web/empresa/login/index.html#/login",target:"_blank"},"Banconexión",-1)])]),organizationName:c(()=>[o("strong",null,k(e.organizationName),1)]),step2Bold:c(()=>[...a[1]||(a[1]=[o("strong",null,"Pagos y Transferencias",-1)])]),step3Bold:c(()=>[...a[2]||(a[2]=[o("strong",null,"Pagos en Otros Sitios",-1)])]),step4Bold1:c(()=>[...a[3]||(a[3]=[o("strong",null,"Comercios",-1)])]),step4Bold2:c(()=>[...a[4]||(a[4]=[o("strong",null,"Administración de Comercios",-1)])]),_:1},8,["keypath"])]),_:1})}}}),we=Object.assign(ba,{__name:"PaymentButtonActivationStepsText"}),wa={key:0},Ca={class:"external-bank__title"},Aa={class:"external-bank__message"},Ta={class:"external-bank__merchant-btn"},Ia={key:0,class:"external-bank__carousel"},Pa={class:"external-bank__step-title"},Ea=["src"],Sa={class:"external-bank__carousel-arrows"},xa=["disabled"],La={class:"external-bank__carousel-indicators"},Oa=["disabled"],$a={class:"external-bank-modal-content external-bank-modal-carousel"},Ra={class:"external-bank__carousel external-bank-carousel-modal"},Ma={class:"external-bank__carousel-item"},Ba={class:"external-bank__step-title"},Na=["src"],Da={class:"external-bank__carousel-arrows"},Fa=["disabled"],qa={class:"external-bank__carousel-indicators"},Ua=["disabled"],za={key:2,class:"external-bank__line"},Ga=tt({__name:"ExternalBankActivation",props:{tokuProduct:{}},emits:["continue"],setup(e,{emit:u}){Bt(x=>({fac82ac4:t(P).colors.gray.dark3,v4218324c:t(P).colors.gray.light1,v42183246:t(P).colors.gray.light4}));const a=e,g=u,{data:n}=Zt(),l=w(()=>a.tokuProduct.toLowerCase().includes("psp")),m=w(()=>l.value?"dashboard.transferCL.externalBankActivation.message.PSP":"dashboard.transferCL.externalBankActivation.message.PST"),v=w(()=>l.value?"Toku SPA":n.value?.organization.name),P=Et(),{t:s}=J(),{isMobile:d}=_e(),f=w(()=>{const x=[];for(let T=1;T<=8;T++)x.push({title:`dashboard.transferCL.externalBankActivation.carousel.step${T}`,image:`/external_bank_activation/cl_banco_de_chile/step${T}.png`});return x}),C=A(0),O=()=>{C.value>0&&C.value--},h=()=>{C.value<f.value.length-1&&C.value++},i=()=>{console.log("onClickContinue"),g("continue")},I=A(!1),r=()=>{I.value=!0},b=()=>{I.value=!1},N=x=>
3{let T=x.target;for(;T;){if(T.tagName==="A")return;T=T.parentElement}r()};return(x,T)=>{const S=Gt("i18n-t"),F=gt;return _(),B(F,{class:"external-bank__container","hide-details-box":""},{title:c(()=>[t(d)?(_(),L("br",wa)):z("",!0),p(t(yt),{icon:"information-circle",color:"rgb(23, 80, 173)",size:"huge",class:"external-bank__title-icon"}),o("h1",Ca,k(t(s)("dashboard.transferCL.externalBankActivation.title")),1)]),main:c(()=>[T[4]||(T[4]=o("hr",{class:"external-bank__line"},null,-1)),o("div",Aa,[p(t(H),{variant:"b3","font-weight":"regular",class:"external-bank__message"},{default:c(()=>[p(S,{keypath:t(m),tag:"p",scope:"global"},{organizationName:c(()=>[o("strong",null,k(t(n)?.organization.name),1)]),_:1},8,["keypath"])]),_:1})]),o("div",Ta,[p(t(H),{variant:"b3","font-weight":"semibold"},{default:c(()=>[D(k(t(s)("dashboard.transferCL.externalBankActivation.merchant",{name:t(v)})),1)]),_:1})]),!t(I)||t(d)?(_(),L("div",Ia,[o("div",{class:"external-bank__carousel-item",onClick:N},[o("div",Pa,[p(t(H),{as:"span",variant:"b4","font-weight":"bold"},{default:c(()=>[D(k(t(C)+1)+". ",1)]),_:1}),p(we,{keypath:t(f)[t(C)]?.title??"","organization-name":t(l)?"Toku SPA":t(n)?.organization.name??""},null,8,["keypath","organization-name"])]),o("img",{src:t(f)[t(C)]?.image,alt:"bank_button",class:"external-bank__step-image"},null,8,Ea)]),o("div",Sa,[o("button",{class:"external-bank__carousel-arrow",disabled:t(C)===0,"aria-label":"Anterior",onClick:zt(O,["stop"])},[...T[0]||(T[0]=[o("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("polyline",{points:"20 8 12 16 20 24",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,xa),o("div",La,[(_(!0),L(ot,null,ft(t(f),($,G)=>(_(),L("span",{key:G,class:Qt(["external-bank__carousel-indicator",{active:G===t(C)}])},null,2))),128))]),o("button",{class:"external-bank__carousel-arrow",disabled:t(C)===t(f).length-1,"aria-label":"Siguiente",onClick:zt(h,["stop"])},[...T[1]||(T[1]=[o("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("polyline",{points:"12 8 20 16 12 24",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Oa)])])):z("",!0),t(I)&&!t(d)?(_(),L("div",{key:1,class:"external-bank-modal-overlay",onClick:zt(b,["self"])},[o("div",$a,[o("button",{class:"external-bank-modal-close","aria-label":"Cerrar",onClick:b}," × "),o("div",Ra,[o("div",Ma,[o("div",Ba,[p(t(H),{as:"span",variant:"b4","font-weight":"bold"},{default:c(()=>[D(k(t(C)+1)+". ",1)]),_:1}),p(we,{keypath:t(f)[t(C)]?.title??"","organization-name":t(l)?"Toku SPA":t(n)?.organization.name??""},null,8,["keypath","organization-name"])]),o("img",{src:t(f)[t(C)]?.image,alt:"bank_button_large",class:"external-bank__step-image external-bank-modal-image"},null,8,Na)]),o("div",Da,[o("button",{class:"external-bank__carousel-arrow",disabled:t(C)===0,"aria-label":"Anterior",onClick:zt(O,["stop"])},[...T[2]||(T[2]=[o("svg",{width:"48",height:"48",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("polyline",{points:"20 8 12 16 20 24",stroke:"currentColor","stroke-width":"3.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Fa),o("div",qa,[(_(!0),L(ot,null,ft(t(f),($,G)=>(_(),L("span",{key:G,class:Qt(["external-bank__carousel-indicator",{active:G===t(C)}])},null,2))),128))]),o("button",{class:"external-bank__carousel-arrow",disabled:t(C)===t(f).length-1,"aria-label":"Siguiente",onClick:zt(h,["stop"])},[...T[3]||(T[3]=[o("svg",{width:"48",height:"48",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("polyline",{points:"12 8 20 16 12 24",stroke:"currentColor","stroke-width":"3.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Ua)])])])])):z("",!0),p(ee,null,{default:c(()=>[p(t(kt),{onClick:i},{default:c(()=>[D(k(t(s)("dashboard.transferCL.externalBankActivation.continue")),1)]),_:1})]),_:1}),t(d)?(_(),L("hr",za)):z("",!0)]),_:1})}}}),Wa=Object.assign(st(Ga,[["__scopeId","data-v-96417554"]]),{__name:"PaymentButtonExternalBankActivation"}),Ka={class:"payment-in-process-modal__header"},Ha={class:"payment-in-process-modal__title-row"},ja={class:"payment-in-process-modal__body"},Va=tt({__name:"TransferCLPaymentInProcessModal",props:{open:{type:Boolean},formattedAmount:{}},emits:["close","confirm"],setup(e,{emit:u}){const a=e,g=u;return(n,l)=>(_(),B(t(Je),{open:a.open,onClose:l[3]||(l[3]=m=>g("close")),size:"medium",featured:""},{header:c(()=>[o("div",Ka,[o("div",Ha,[p(t(yt),{icon:"exclamation-circle",variant:"solid",size:"large",color:"warning",class:"payment-in-process-modal__icon"}),p(t(H),{"font-weight":"semibold",variant:"s3",color:"#373737",class:"payment-in-process-modal__title"},{default:c(()=>[D(k(n.$t("dashboard.transferCL.paymentInProcessModal.title")),1)]),_:1})]),p(t(yt),{icon:"close",size:"medium",class:"payment-in-process-modal__close",onClick:l[0]||(l[0]=m=>g("close"))})])]),footer:c(()=>[p(t(kt),{variant:"secondary",size:"medium",onClick:l[1]||(l[1]=m=>g("confirm"))},{default:c(()=>[D(k(n.$t("dashboard.transferCL.paymentInProcessModal.continue")),1)]),_:1}),p(t(kt),{size:"medium",onClick:l[2]||(l[2]=m=>g("close"))},{default:c(()=>[D(k(n.$t("dashboard.transferCL.paymentInProcessModal.goBack")),1)]),_:1})]),default:c(()=>[o("section",ja,[p(t(H),{color:"#373737",variant:"b2",class:"payment-in-process-modal__paragraph"},{default:c(()=>[D(k(n.$t("dashboard.transferCL.paymentInProcessModal.body1",{monto:e.formattedAmount})),1)]),_:1}),p(t(H),{color:"#373737",variant:"b2",class:"payment-in-process-modal__paragraph"},{default:c(()=>[D(k(n.$t("dashboard.transferCL.paymentInProcessModal.body2")),1)]),_:1})])]),_:1},8,["open"]))}}),Ya=Object.assign(st(Va,[["__scopeId","data-v-fb3e7dcc"]]),{__name:"TransferCLPaymentInProcessModal"}),Qa=Xe("/icons/close_icon.svg"),Za={class:"activation-modal__header"},Ja={class:"activation-modal__title-container"},Xa=["src","alt"],to={key:0,class:"activation-modal__title-text"},eo={key:1,class:"activation-modal__title-text"},no=["alt"],ao={key:0,class:"activation-modal__content"},oo={key:1,class:"activation-modal__content"},so={class:"activation-modal__step"},io={class:"activation-modal__step"},ro={class:"activation-modal__step"},co={class:"activation-modal__footer"},lo=tt({__name:"TransferCLCheckoutActivationModal",props:{activationModalState:{},activationTime:{},activationRefund:{},activationAmount:{}},emits:["activationModalAction"],setup(e,{emit:u}){const a=e,g=u,n=A(null),l=w(()=>ht(a.activationAmount)),m=()=>{const h=w(()=>a.activationModalState.type==="activation_required");return{close:()=>{g("activationModalAction","close")},confirm:()=>{g("activationModalAction","confirm")},isModalActivation:h}},{close:v,confirm:P,isModalActivation:s}=m(),d=h=>{h.preventDefault(),v()};vt(()=>a.activationModalState.show,h=>{if(h)n.value?.showModal();else{n.value?.classList.add("hide");const i=()=>{n.value?.classList.remove("hide"),n.value?.close(),n.value?.removeEventListener("animationend",i)};n.value?.addEventListener("animationend",i)}}),wt(()=>{a.activationModalState.show&&n.value?.showModal()});const f=w(()=>"#7F00B2"),C=w(()=>({backgroundColor:f.value})),O=w(()=>({color:f.value,borderColor:f.value}));
3return(h,i)=>(_(),L("dialog",{ref_key:"dialog",ref:n,class:"activation-modal",onKeydown:tn(d,["esc"])},[o("div",Za,[o("div",Ja,[o("img",{class:"activation-modal__title-icon",src:t(s)?"/icons/transfer-cl/information_icon.svg":"/icons/transfer-cl/pending_icon.svg",alt:h.$t("transferCL.transferActivation.information.icons.bank")},null,8,Xa),t(s)?z("",!0):(_(),L("div",to,k(h.$t("transferCL.transferActivation.pendingActivation.title")),1)),t(s)?(_(),L("div",eo,k(h.$t("transferCL.transferActivation.notActivated.title")),1)):z("",!0)]),o("img",{src:Qa,alt:h.$t("transferCL.transferActivation.information.icons.bank"),class:"activation-modal__close-icon",onClick:i[0]||(i[0]=(...I)=>t(v)&&t(v)(...I))},null,8,no)]),t(s)?z("",!0):(_(),L("div",ao,[o("h1",null,k(h.$t("transferCL.transferActivation.pendingActivation.subTitle")),1),o("p",null,k(h.$t("transferCL.transferActivation.pendingActivation.content",{activationTime:e.activationTime})),1)])),t(s)?(_(),L("div",oo,[o("h1",null,k(h.$t("transferCL.transferActivation.notActivated.subTitleMain")),1),o("p",null,k(h.$t("transferCL.transferActivation.notActivated.contentMain")),1),i[4]||(i[4]=o("br",null,null,-1)),o("h1",null,k(h.$t("transferCL.transferActivation.notActivated.subTitleSecondary")),1),o("div",so,[o("p",null,k(h.$t("transferCL.transferActivation.notActivated.steps.1")),1),o("p",null,k(h.$t("transferCL.transferActivation.notActivated.content.1",{formatActivationAmount:l.value,activationRefund:e.activationRefund})),1)]),o("div",io,[o("p",null,k(h.$t("transferCL.transferActivation.notActivated.steps.2")),1),o("p",null,k(h.$t("transferCL.transferActivation.notActivated.content.2",{activationTime:e.activationTime})),1)]),o("div",ro,[o("p",null,k(h.$t("transferCL.transferActivation.notActivated.steps.3")),1),o("p",null,k(h.$t("transferCL.transferActivation.notActivated.content.3")),1)])])):z("",!0),o("div",co,[t(s)?(_(),L("div",{key:0,class:"activation-modal__button-secondary",style:Rt(O.value),onClick:i[1]||(i[1]=(...I)=>t(v)&&t(v)(...I))},k(h.$t("transferCL.transferActivation.notActivated.options.back")),5)):z("",!0),t(s)?(_(),L("div",{key:1,class:"activation-modal__button",style:Rt(C.value),onClick:i[2]||(i[2]=(...I)=>t(P)&&t(P)(...I))},k(h.$t("transferCL.transferActivation.notActivated.options.activate")),5)):z("",!0),t(s)?z("",!0):(_(),L("div",{key:2,class:"activation-modal__button",style:Rt(C.value),onClick:i[3]||(i[3]=(...I)=>t(v)&&t(v)(...I))},k(h.$t("transferCL.transferActivation.pendingActivation.options.accept")),5))])],544))}}),uo=Object.assign(st(lo,[["__scopeId","data-v-203882bc"]]),{__name:"TransferCLCheckoutActivationModal"});var Yt=(e=>(e.Available="available",e.AwaitingActivation="awaiting_activation",e.ActivationRequired="activation_required",e.Unavailable="unavailable",e.Disabled="disabled",e))(Yt||{});const Ce="transfer_cl_psp_wallet";var $t=(e=>(e.PERSONAL_ACCOUNT="PERSONAL_ACCOUNT",e.ENTERPRISE_ACCOUNT="ENTERPRISE_ACCOUNT",e))($t||{});function mo(){const{customer:e,amount:u,backendPaymentEngine:a,session:g}=pt(),n=Wt(),l=te(),m=de(),{$portalGatewayApi:v}=bt();return{atoaOnetimeInstitutionsRequest:async()=>g.value?.state==="completed"?{institutions:{},show_activation_button:!1,use_new_ui:!1}:await v("/atoa-onetime-institutions",{method:"POST",body:{invoices:l.value?.length>0?l.value.map(s=>s.id_invoice):[],account:n.value,customer:e.value?.id_customer||null,id_portal:m.value,amount:u.value,payment_engine:a.value,checkout_session_id:g.value?.id_checkout_session??null}})}}const _o={class:"transfer-cl-checkout__search-wrap"},po=["placeholder"],vo={class:"transfer-cl-checkout"},fo={key:0,class:"transfer-cl-checkout__sender-category-toggle"},go=["onClick"],ho={class:"transfer-cl-checkout__container"},yo=tt({__name:"TransferCLCheckout",props:{paymentIntentAtoaOnetimeInstitutionsResponse:{},isGatewayLoading:{type:Boolean},showActivationModal:{}},emits:["institutionSelected","activationModalAction"],setup(e,{emit:u}){Bt(x=>({v7b1a518d:t(g),v94d7e944:t(a).colors.gray.medium1,v18478cca:t(a).colors.gray.light3,v18478cce:t(a).colors.gray.light1}));const a=Et(),g=w(()=>a.value.colors.primary.main),n=Object.freeze({[$t.PERSONAL_ACCOUNT]:"i-heroicons-user",[$t.ENTERPRISE_ACCOUNT]:"i-heroicons-building-office-2"}),l=Object.values($t),m=e,v=A(""),P=w(()=>{const x=m.paymentIntentAtoaOnetimeInstitutionsResponse.institutions;let T=Object.entries(x);if(m.paymentIntentAtoaOnetimeInstitutionsResponse.show_categories_switch){const S=b.value;T=T.filter(([F,$])=>$.sender_bank_account_category?$.sender_bank_account_category.toLowerCase()===S.toLowerCase():!0)}if(v.value.trim()){const S=v.value.trim().toLowerCase();T=T.filter(([F])=>Re(F).toLowerCase().includes(S))}return Object.fromEntries(T)}),s=A(24),d=A(1e3),f=u,C=(x,T)=>{T.payable&&(d.value=T.activation_amount??d.value,s.value=T.activation_time??s.value),f("institutionSelected",x,T)},O=x=>{f("activationModalAction",x)},{t:h}=J(),{customer:i}=pt(),I=w(()=>{const x=i.value?.government_id;return x&&pn(x)?$t.ENTERPRISE_ACCOUNT:$t.PERSONAL_ACCOUNT}),r=A(null),b=w(()=>r.value??I.value),N=x=>{r.value=x};return(x,T)=>{const S=uo,F=en,$=gn,G=gt;return _(),L(ot,null,[p(S,{"activation-modal-state":e.showActivationModal,"activation-time":t(s),"activation-refund":72,"activation-amount":t(d),onActivationModalAction:O},null,8,["activation-modal-state","activation-time","activation-amount"]),p(G,{"hide-go-back-to-commerce":"","hide-details-box":"",stepper:{stepLabel:x.$t("checkoutStepper.stepLabel",{step:1}),title:x.$t("tokuTransfer.stepper.loginAndGetAccounts"),progressPercent:25}},{top:c(()=>[p(ne),o("div",_o,[p(F,{name:"i-heroicons-magnifying-glass",class:"transfer-cl-c
3heckout__search-icon","aria-hidden":"true"}),xe(o("input",{"onUpdate:modelValue":T[0]||(T[0]=R=>an(v)?v.value=R:null),type:"text",class:"transfer-cl-checkout__search-input",placeholder:x.$t("transferCL.searchBankPlaceholder")},null,8,po),[[nn,t(v)]])])]),main:c(()=>[o("div",vo,[e.paymentIntentAtoaOnetimeInstitutionsResponse.show_categories_switch?(_(),L("div",fo,[(_(!0),L(ot,null,ft(t(l),R=>(_(),L("button",{key:R,type:"button",class:Qt(["transfer-cl-checkout__sender-category-option",{"transfer-cl-checkout__sender-category-option--active":t(b)===R}]),onClick:E=>N(R)},[p(F,{name:t(n)[R],class:"transfer-cl-checkout__sender-category-icon","aria-hidden":"true"},null,8,["name"]),p(t(H),{variant:"b3","font-weight":"semibold",class:"transfer-cl-checkout__sender-category-label"},{default:c(()=>[D(k(t(h)(`dashboard.transferCL.senderBankAccountCategory.${R}`)),1)]),_:2},1024)],10,go))),128))])):z("",!0),o("div",ho,[o("div",{class:"transfer-cl-checkout__bank-list",style:Rt({visibility:e.isGatewayLoading?"hidden":"visible"})},[(_(!0),L(ot,null,ft(t(P),(R,E)=>(_(),L(ot,{key:E},[R.payable?(_(),B($,{key:0,"institution-id":E,onSelect:V=>C(E,R)},null,8,["institution-id","onSelect"])):R.status==="disabled"?(_(),B($,{key:1,"institution-id":E,disabled:""},null,8,["institution-id"])):z("",!0)],64))),128))],4),o("div",{class:"transfer-cl-checkout__spinner-container",style:Rt({visibility:e.isGatewayLoading?"visible":"hidden"})},[p(t(Se),{message:x.$t("common.loading.contactingBank"),hint:x.$t("common.loading.hint")},null,8,["message","hint"])],4)])])]),_:1},8,["stepper"])],64)}}}),ko=Object.assign(st(yo,[["__scopeId","data-v-5f870dd6"]]),{__name:"TransferCLCheckout"});var M=(e=>(e.LOGIN="login",e.LOGIN_WITH_SECOND_KEY="loginWithSecondKey",e.ACCOUNT_CONFIRMATION="accountConfirmation",e.TWO_FACTOR_SELECTION="twoFactorSelection",e.ASKING_AUTHORIZATION="askingAuthorization",e.ADDING_RECIPIENT="addingRecipient",e.WAIT_FOR_ACTION="waitForAction",e.VALIDATING_TRANSFER="validatingTransfer",e.SUCCESS="success",e.ERROR="error",e))(M||{}),le=(e=>(e.ENFORCED_PASSWORD_CHANGE="enforcedPasswordChange",e))(le||{});function bo(e){const u=_t(),{$portalGatewayApi:a}=bt(),g=Kt(),{t:n}=J(),{session:l}=pt(),{isTokuProductDemo:m}=Me(),v=Wt(),P=w(()=>m(v.value||"",["transfer_cl"])),s=w(()=>e.selectedInstitutionId),d=A({idTransaction:"",activationIdentifier:"",amount:0}),f=A(""),C=A(!1),O=A(null),h=A(!1),i=async(y,U)=>{try{return await a(y,U)}catch{throw Q({title:n("common.unexpectedError.title"),message:n("common.unexpectedError.message")})}},I=w(()=>({status:M.LOGIN,institutionId:s.value,idTransaction:d.value.idTransaction,activationIdentifier:d.value.activationIdentifier,amount:d.value.amount})),r=Mt("tokuTransferNew/documentStatus",()=>I.value),b=y=>{r.value=y},N=w(()=>r.value.status),x=w(()=>r.value.errorData),T=w(()=>!(r.value.status===M.ERROR&&(r.value.errorData?.type!==ke.temporalErrorCode||r.value.errorData?.transferError===le.ENFORCED_PASSWORD_CHANGE&&s.value===be.CL_BANCO_ESTADO))),S=w(()=>({institutionAccounts:r.value.holderAccounts,isTokuTransfer:!0,holderName:r.value.holderName??""})),F=w(()=>({availableTwoFactors:r.value.availableTwoFactors,title:n("tokuTransfer.selectTwoFactorTypeTokuTransfer")})),$=w(()=>({twoFactorRequirements:r.value.twoFactorRequirements,selectedHolderAccount:r.value.selectedHolderAccount,institutionId:s.value,isTokuTransfer:!0,isAddingRecipient:!1,isLoading:!1})),G=w(()=>({twoFactorRequirements:r.value.recipientCodeRequirements,selectedHolderAccount:r.value.selectedHolderAccount,institutionId:s.value,isTokuTransfer:!0,isAddingRecipient:!0,isLoading:!1})),R=w(()=>({twoFactorRequirements:r.value.loginRequirements,selectedHolderAccount:r.value.selectedHolderAccount,institutionId:s.value,isTokuTransfer:!0,isLoginSecondKey:!0,isLoading:!1})),E=w(()=>{const y=r.value;return y.status!==M.WAIT_FOR_ACTION?n("tokuTransfer.statusMessages.defaultMessage"):y.selectedHolderAccount&&!y.availableTwoFactors?.length?n("tokuTransfer.statusMessages.gettingTwoFactorTypes"):y.selectedTwoFactor&&!y.twoFactorRequirements?n("tokuTransfer.statusMessages.gettingTwoFactorRequirements"):y.twoFactorRequirements?n("tokuTransfer.statusMessages.makeTransfer"):n("tokuTransfer.statusMessages.loggingInToBank")});hn({listenerUrl:`/transfer-cl/${s.value}/ux-event`,sessionId:w(()=>r.value.sessionId??"")});const V=async()=>{try{return await a(`/transfer-cl/${s.value}/status`,{method:"POST",body:{sessionId:r.value.sessionId}})}catch(y){return{requestError:y}}},it=Ee({queryKey:["toku-transfer-session",r.value.sessionId],queryFn:()=>V(),enabled:()=>!h.value&&![M.ERROR,M.SUCCESS,M.LOGIN].includes(r.value.status),refetchInterval:2e3}),X=w(()=>it.data.value);vt(X,y=>{if("requestError"in y){b(y.requestError.data);return}b(y)});const ut=async()=>{C.value=!1;const y={idAccount:v.value||"",use_new_ui:!0,...l.value?.id_checkout_session&&{checkoutSessionId:l.value.id_checkout_session},...l.value?.flow_name&&{flowName:l.value.flow_name}};d.value.idTransaction?y.idTransaction=d.value.idTransaction:y.activationIdentifier=d.value.activationIdentifier;const U=await i(`/transfer-cl/${s.value}/initialize`,{method:"POST",body:y}
3);f.value=U.rsaPublicKey,b({...I.value,sessionId:U.sessionId}),C.value=!0},et=async()=>{let y=!1;try{const U=await g({tokuProduct:"transfer_cl",selectedInstitutionId:s.value,gateway:"toku_transfer",isActivation:e.isActivation});d.value={idTransaction:U.id_transaction??"",activationIdentifier:U.transfer_cl_activation_identifier??"",amount:U.amount},await ut(),y=!0}catch{throw Q({title:n("common.unexpectedError.title"),message:n("common.unexpectedError.message")})}return y},ct=async()=>{if(!await et())throw Q({title:n("common.unexpectedError.title"),message:n("common.unexpectedError.message")})},q=Mt("toku-product-gateway",()=>null),nt=async()=>{!e.isActivation&&d.value.idTransaction?(q.value={gateway:"toku_transfer"},await rt({path:`/checkout/operation-receipt/${d.value.idTransaction}`,query:Jt(u,l.value?.id_checkout_session)})):await rt({path:"/checkout/transfer-cl/activation/success",query:{checkoutSession:l.value?.id_checkout_session}})};async function Y(y){if(y?.type!==ke.temporalErrorCode)throw Q({title:y.error??n("common.unexpectedError.title"),message:y.customerMessage??n("common.unexpectedError.message")});if(y?.transferError===le.ENFORCED_PASSWORD_CHANGE&&s.value===be.CL_BANCO_ESTADO){await rt({path:"/checkout/atoa/change-password",query:{checkoutSession:l.value?.id_checkout_session,shell:"new"}});return}O.value=y?.customerMessage??null,await ct()}const dt=async(y,U)=>{O.value=null;const at=await ge(y,f.value),W=await ge(U,f.value),mt=await i(`/transfer-cl/${s.value}/login`,{method:"POST",body:{sessionId:r.value.sessionId,username:at,password:W}});b(mt)},lt=async y=>{const U=await i(`/transfer-cl/${s.value}/select-account`,{method:"POST",body:{id:y,sessionId:r.value.sessionId}});b(U)},Z=async y=>{const U=await i(`/transfer-cl/${s.value}/select-two-factor`,{method:"POST",body:{twoFactor:y,sessionId:r.value.sessionId}});b(U)},St=async()=>{h.value=!0;try{await a(`/transfer-cl/${s.value}/abort`,{method:"POST",body:{sessionId:r.value.sessionId}})}catch{}},Ct=async y=>{const U={sessionId:r.value.sessionId,twoFactorInput:""};"coordinate1"in y?U.twoFactorInput=y.coordinate1+y.coordinate2+y.coordinate3:U.twoFactorInput=y.email??y.tokenDevicePasscode??"",y.selectedCard&&(U.selectedCard=y.selectedCard);const at=await i(`/transfer-cl/${s.value}/send-two-factor`,{method:"POST",body:U});b(at)},xt=async y=>{const U="coordinate1"in y?y.coordinate1+y.coordinate2+y.coordinate3:y.email??y.tokenDevicePasscode,at=await i(`/transfer-cl/${s.value}/submit-recipient-code`,{method:"POST",body:{sessionId:r.value.sessionId,recipientCodeInput:U}});b(at)},Ft=async y=>{const U="coordinate1"in y?y.coordinate1+y.coordinate2+y.coordinate3:y.email??y.tokenDevicePasscode,at=await i(`/transfer-cl/${s.value}/submit-login-second-key`,{method:"POST",body:{sessionId:r.value.sessionId,loginSecondKeyInput:U}});b(at)};return vt(()=>r.value.status,async y=>{y===M.SUCCESS&&await nt(),y===M.ERROR&&await Y(r.value.errorData)},{immediate:!0}),wt(async()=>{await ct()}),pe(()=>{b(I.value)}),{documentStatus:N,documentErrorData:x,persistedErrorMessage:O,tokuTransferResponse:d,isTokuTransferDemo:P,institutionToSend:s,isSessionReady:C,shouldShowErrorComponent:T,selectedAccountProps:S,selectedTwoFactorProps:F,selectedTwoFactorInputProps:$,selectedRecipientCodeProps:G,selectedLoginSecondKeyProps:R,waitingSubtitle:E,login:dt,selectAccount:lt,selectTwoFactor:Z,twoFactorInput:Ct,submitRecipientCode:xt,submitLoginSecondKey:Ft,abortTransfer:St}}const wo=4;function Co(e,u){switch(e){case M.LOGIN:case M.LOGIN_WITH_SECOND_KEY:case M.ERROR:return 1;case M.ACCOUNT_CONFIRMATION:return 2;case M.TWO_FACTOR_SELECTION:return 3;case M.ASKING_AUTHORIZATION:case M.ADDING_RECIPIENT:case M.VALIDATING_TRANSFER:return 4;case M.WAIT_FOR_ACTION:return u.hasTwoFactorRequirements?4:u.hasSelectedAccount?3:u.hasAccounts?2:1;default:return 1}}function Ao(e,u,a){const{t:g}=J();return{stepIndicator:w(()=>{const l=e.value,m={hasAccounts:!!u.value.institutionAccounts?.length,hasSelectedAccount:!!a.value.selectedHolderAccount,hasTwoFactorRequirements:!!a.value.twoFactorRequirements},v=Co(l,m);return{visible:!0,stepLabel:g("checkoutStepper.stepLabel",{step:v}
3),title:To(v,a.value.twoFactorRequirements?.requiresAdditionalTwoFactor??!1,g),progressPercent:v/wo*100}})}}function To(e,u,a){return a(e===4?u?"tokuTransfer.stepper.additionalTwoFactor":"tokuTransfer.stepper.makeTransfer":e===3?"tokuTransfer.stepper.getTwoFactorRequirements":e===2?"tokuTransfer.stepper.getTwoFactorTypes":"tokuTransfer.stepper.loginAndGetAccounts")}const Io={class:"steps__container"},Po=tt({__name:"TokuTransferNew",props:{isActivation:{type:Boolean},selectedInstitutionId:{},activationAmount:{}},setup(e){const u=e,{t:a}=J(),g=Le(),n=_t(),{abortInitializedPaymentIntentsAndTransactions:l}=Nt(),{documentStatus:m,documentErrorData:v,persistedErrorMessage:P,tokuTransferResponse:s,isTokuTransferDemo:d,institutionToSend:f,isSessionReady:C,shouldShowErrorComponent:O,selectedAccountProps:h,selectedTwoFactorProps:i,selectedTwoFactorInputProps:I,selectedRecipientCodeProps:r,selectedLoginSecondKeyProps:b,waitingSubtitle:N,login:x,selectAccount:T,selectTwoFactor:S,twoFactorInput:F,submitRecipientCode:$,submitLoginSecondKey:G,abortTransfer:R}=bo(u),E=w(()=>s.value.amount||(u.isActivation?u.activationAmount:void 0)),{stepIndicator:V}=Ao(m,h,I),it=w(()=>{const W=m.value;return W===M.WAIT_FOR_ACTION&&!h.value.institutionAccounts?.length||[M.LOGIN,M.LOGIN_WITH_SECOND_KEY,M.ERROR].includes(W)?a("tokuTransfer.bankConnectedHeader.loggingIn"):W===M.ACCOUNT_CONFIRMATION?a("tokuTransfer.bankConnectedHeader.connected"):a("tokuTransfer.bankConnectedHeader.authorizing")}),{data:X}=Zt(),ut=w(()=>!!X.value?.lock_transfer_username),et=A(!1),ct=()=>{et.value=!1},q=A(!1),nt=async(W,mt)=>{q.value=!0,await x(W,mt)};function Y(){if(q.value)return()=>{et.value=!0}}async function dt(){await R(),ct(),await l(Dt.TokuTransfer);const W=un(n.query);W?window.location.href=W:g.go(-1)}const lt=Mt("tokuTransferNew/loginDraft",()=>({governmentId:"",password:""}));pe(()=>{lt.value={governmentId:"",password:""}});const Z=()=>ie(()=>import("./Dz3woPHT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url),St=()=>ie(()=>import("./Cf1Axgv4.js"),__vite__mapDeps([13,1,2,14]),import.meta.url),Ct=()=>ie(()=>import("./CkB_j30L.js"),__vite__mapDeps([15,16,1,2,3,17,4,5,6,7,8,9,10,11,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]),import.meta.url),xt=It(se({loader:Z})),Ft=It(se({loader:St})),y=It(se({loader:Ct}));vt(()=>m.value,W=>{W===M.LOGIN&&Z(),W===M.LOGIN_WITH_SECOND_KEY&&Ct(),W===M.ACCOUNT_CONFIRMATION&&St(),W===M.TWO_FACTOR_SELECTION&&Ct()},{immediate:!0});const U={[M.LOGIN]:{component:It(he),props:()=>({institutionId:f.value,disabled:!C.value,errorMessage:P.value,lockGovernmentId:ut.value}),events:{input:nt}},[M.LOGIN_WITH_SECOND_KEY]:{component:y,props:()=>b.value,events:{twoFactorInput:G}},[M.ACCOUNT_CONFIRMATION]:{component:xt,props:()=>h.value,events:{selectAccount:T}},[M.TWO_FACTOR_SELECTION]:{component:Ft,props:()=>i.value,events:{selectTwoFactor:S}},[M.ASKING_AUTHORIZATION]:{component:y,props:()=>I.value,events:{twoFactorInput:F}},[M.ADDING_RECIPIENT]:{component:y,props:()=>r.value,events:{twoFactorInput:$}},[M.WAIT_FOR_ACTION]:{component:It(ye),props:()=>({subtitle:N.value}),events:{}},[M.VALIDATING_TRANSFER]:{component:It(ye),props:()=>({subtitle:a("tokuTransfer.statusMessages.finalizingTransfer")}),events:{}},[M.ERROR]:{component:It(he),props:()=>({institutionId:f.value,errorMessage:v.value?.customerMessage,disabled:!C.value,lockGovernmentId:ut.value}),events:{input:nt}}},at=w(W=>{if(!O.value)return W;const mt=m.value;if(mt===M.SUCCESS)return W;const At=U[mt];return{component:At.component,props:At.props(),events:At.events}});return(W,mt)=>{const At=Pt,K=gt;return _(),B(K,{"hide-details-box":"","hide-back-button":t(et),"hide-step-cta":t(et),"on-go-back":Y(),stepper:t(V).visible?t(V):void 0},Pe({main:c(()=>[t(et)?(_(),B(yn,{key:0})):z("",!0),xe(o("div",Io,[(_(),B(sn,null,{default:c(()=>[(_(),B(rn(t(at)?.component),cn({key:t(m)+"-"+t(at)?.component},t(at)?.props,ln(t(at)?.events)),null,16))]),_:1}))],512),[[on,!t(et)]])]),_:2},[t(et)?void 0:{name:"top",fn:c(()=>[t(d)?(_(),B(At,{key:0},{default:c(()=>[D(k(W.$t("transferCL.demoTitle")),1)]),_:1})):z("",!0),p(ne,{amount:t(E)},null,8,["amount"]),p(Be,{"institution-id":e.selectedInstitutionId,caption:t(it)},null,8,["institution-id","caption"])]),key:"0"},t(et)?{name:"footer",fn:c(()=>[p(t(kt),{class:"steps__abort-stay",onClick:ct},{default:c(()=>[D(k(W.$t("transferCl.backButtonModal.cancel")),1)]),_:1}),o("button",{class:"steps__abort-leave",type:"button",onClick:dt},k(W.$t("transferCl.backButtonModal.accept")),1)]),key:"1"}:void 0]),1032,["hide-back-button","hide-step-cta","on-go-back","stepper"])}}}),Eo=Object.assign(st(Po,[["__scopeId","data-v-fc7eaaeb"]]),{__name:"TokuTransferNew"}),So={class:"activation-intro"},xo={class:"activation-intro__steps"},Lo=tt({__name:"TransferActivationIntro",props:{institutionId:{},activationHours:{}},emits:["activate","back"],setup(e,{emit:u}){const a=e,g=u,{t:n}=J(),l=w(()=>Re(a.institutionId)),m=w(()=>[n("tokuTransfer.activationIntro.step1"),n("tokuTransfer.activationIntro.step2",{hours:a.activationHours??24}),n("tokuTransfer.activationIntro.step3")]),v=w(()=>({stepLabel:n("checkoutStepper.stepLabel",{step:1}),title:n("tokuTransfer.activationIntro.stepTitle"),progressPercent:25}));return(P,s)=>(_(),B(gt,{"hide-details-box":"",stepper:t(v),"on-go-back":()=>g("back"),"cta-text":t(n)("tokuTransfer.activationIntro.cta"),onCta:s[0]||(s[0]=d=>g("activate"))},{top:c(()=>[p(ne),p(Be,{"institution-id":e.institutionId,caption:t(n)("tokuTransfer.bankConnectedHeader.loggingIn")},null,8,["institution-id","caption"])]),main:c(()=>[o("div",So,[p(Sn,{title:t(n)("tokuTransfer.activationIntro.noticeTitle",{bank:t(l)}),subtitle:t(n)("tokuTransfer.activationIntro.noticeSubtitle")},null,8,["title","subtitle"]),o("ol",xo,[(_(!0),L(ot,null,ft(t(m),(d,f)=>(_(),L("li",{key:f},[p(t(H),{variant:"b3"},{default:c(()=>[D(k(d),1)]),_:2},1024)]))),128))])])]),_:1},8,["stepper","on-go-back","cta-text"]))}}),Oo=Object.assign(st(Lo,[["__scopeId","data-v-b8382790"]]),{__name:"TokuTransferNewTransferActivationIntro"}),$o=()=>{const e=_t(),u=de(),a=A(!1),{$portalGatewayApi:g}=bt(),n=ue(),l=Wt(),m=async s=>{console.log("calling checkBankButtonActivationForBancoDeChile with params",s);const d=s.cl_banco_de_chile||s.cl_banco_de_chile_enterprise;"gateway"in d&&d.payable&&d.gateway==="pb_transfer_cl_banco_de_chile"&&(console.log("calling getBankButtonActivation with params",d.toku_product,d.gateway),a.value=await v(d.toku_product,d.gateway),console.log("calling getBankButtonActivation done",a.value))},v=async(s,d)=>(await g("/payment_button/activation_status",{params:{customer_id:n.value,account_id:l.value,toku_product:s,gateway:d,flow_name:u.value||e.query.portal||"0"}})).show_bank_button_activation;return{showBankButtonActivation:a,checkBankButtonActivationForBancoDeChile:m,handleExternalBankContinue:()=>{a.value=!1}}};function Ro(e,u,a){const{t:g}=J(),n=_t(),l=Kt(),{session:m}=pt(),v=Xt(),{abortInitializedPaymentIntentsAndTransactions:P}=Nt(),s=A(null),d=A(null);
3wt(async()=>{console.log("Loading Floid external script"),Oe("https://storage.googleapis.com/external-frontend-scripts/floid-modal-20260320.js")});const f=()=>{d.value?.close(),window.removeEventListener("message",O),document.getElementById("myModal")?.remove(),d.value=null};pe(()=>{f()});const C=Mt("toku-product-gateway",()=>null),O=async I=>{const r=async()=>{f(),await P(Dt.TransferCLFloid)},b=async()=>{f(),C.value={gateway:"floid_transfer"},!u.value&&s.value?.id_transaction?await rt({path:`/checkout/operation-receipt/${s.value.id_transaction}`,query:Jt(n,m.value?.id_checkout_session)}):await rt({path:"/checkout/transfer-cl/activation/success",query:{checkoutSession:m.value?.id_checkout_session,...n.query.redirection&&{redirection:n.query.redirection}}})};if(!I.data)return;const{status:N}=I.data;N==="PAYMENT_CLOSED"?await r():N==="SUCCESS"&&await b()},h=()=>{d.value=FloidModal(s.value.payment_token),d.value.open(),window.addEventListener("message",O)};return{startPaymentProcess:async()=>{try{a.value=!0,s.value=await l({tokuProduct:"transfer_cl",selectedInstitutionId:e.value??"",gateway:"floid_transfer",accessSource:v.value?.access_source??"",sentBy:v.value?.sent_by??"",isHighValueTransfer:!!u.value,isActivation:u.value}),await h()}catch{throw Q({title:g("common.unexpectedError.title"),message:g("common.unexpectedError.message")})}finally{a.value=!1}}}}const Fe="https://js.fintoc.com/v1",Mo=/^https:\/\/js\.fintoc\.com\/v1\/?(\?.*)?$/,Bo=()=>{const e=document.querySelectorAll(`script[src^="${Fe}"]`);return Array.from(e).find(u=>Mo.test(u.src))||null},No=()=>{const e=document.createElement("script");e.src=Fe;const u=document.head||document.body;if(!u)throw new Error("Expected document.head or document.body not to be null.");return u.appendChild(e),e};let Vt=null;const Do=()=>(Vt!==null||(Vt=new Promise((e,u)=>{if(typeof window>"u"){e(null);return}if(window.Fintoc){e(window.Fintoc);return}try{let a=Bo();a||(a=No()),a.addEventListener("load",()=>{window.Fintoc?e(window.Fintoc):u(new Error("Fintoc.js is not available"))}),a.addEventListener("error",()=>{u(new Error("Failed to load Fintoc.js"))})}catch(a){u(a)}})),Vt);function Fo(e,u,a){const{t:g}=J(),n=_t(),l=Te(),{data:m}=Zt(),v=Kt(),{customer:P,session:s}=pt(),d=Xt(),{abortInitializedPaymentIntentsAndTransactions:f}=Nt(),C=A(null),O=A(null),h=w(()=>m.value?.lock_transfer_username),i=w(()=>!(h.value===!0&&P.value?.government_id)),I=async()=>{const b=C.value?.is_checkout_session||!1,N=C.value?.widget_token,x=C.value?.is_demo||!1,T=async()=>{console.log("Fintoc modal closed prematurely, aborting..."),await f(Dt.TransferCLFintoc),O.value?.destroy(),O.value=null,a.value=!1},S=async()=>{!u.value&&C.value?.id_transaction?await rt({path:`/checkout/operation-receipt/${C.value.id_transaction}`,query:Jt(n,s.value?.id_checkout_session)}):await rt({path:"/checkout/transfer-cl/activation/success",query:{checkoutSession:s.value?.id_checkout_session,...n.query.redirection&&{redirection:n.query.redirection}}})},F=async $=>{console.log(`Fintoc Modal Event: ${$}`)};try{const $=l.public.env==="development"||l.public.env==="staging"||l.public.env==="local",G=x?"pk_test_TyvzRCFSo3eFVy-P26kDmLMCgfHyiCQd":"pk_live_KQy7ufs1HzYp2Wy9wiwjaMw4s-PbsQvb",R="pk_test_exnyXsSPL6Ah6Z5zDGqx1LqVyPJBk9otdN9sG4FPcyo",E=await Do();O.value=E.create({publicKey:$?R:G,holderType:"individual",product:"payments",institutionId:e.value,...b?{sessionToken:N}:{widgetToken:N},onSuccess:S,onExit:T,onEvent:F,username:{value:P.value?.government_id,editable:i.value}}),O.value.open()}catch($){throw console.error(`An error occured while creating Fintoc modal ${$}`),Q({title:g("common.unexpectedError.title"),message:g("common.unexpectedError.message")})}};return{startPaymentProcess:async()=>{try{if(!e.value)throw new Error("Selected institution ID is required");a.value=!0,C.value=await v({tokuProduct:"transfer_cl",selectedInstitutionId:e.value??"",gateway:"fintoc_transfer",accessSource:d.value?.access_source??"",sentBy:d.value?.sent_by??"",isHighValueTransfer:!!u.value,isActivation:u.value,isGovernmentIdEditable:i.value}),await I()}catch{throw Q({title:g("common.unexpectedError.title"),message:g("common.unexpectedError.message")})}}}}const qo="Este pago requiere autorización de terceros",Ae="khipu_amount_exceeds_bank_limit",Uo=e=>e?.data?.detail?.error?.code;function zo(e,u,a){const g=Kt(),{t:n}=J(),{customer:l,session:m,account:v}=pt(),{finalAmount:P}=me(),s=_t(),d=Le(),{$portalGatewayApi:f}=bt(),C=A(""),O=A(""),h=A(null),i=["USER_CANCELED"],{abortInitializedPaymentIntentsAndTransactions:I}=Nt(),r=A(null),b=Mt("khipu-state",()=>({paymentId:null,customerId:null})),N=Mt("toku-product-gateway",()=>null);dn(()=>
3{if(C.value||O.value)throw Q({title:C.value||n("common.unexpectedError.title"),message:O.value||n("common.unexpectedError.message")})}),wt(async()=>{console.log("Loading Khipu external script"),Oe({src:"https://storage.googleapis.com/external-frontend-scripts/khipu-20260921.js",integrity:"sha256-Lcj/4SkKNsueewwxtdGZl0/e/fyvOPV1gqR9g33Uju4= sha384-10zWafe/fousBGlZBrzGddtwAmjjyE7xvOy84lqwc29UNj4wwm5OUI7M/7prv+HK"})});const x=async()=>{try{a.value=!0;const $=await g({tokuProduct:"transfer_cl",gateway:"khipu_transfer",selectedInstitutionId:e.value??void 0,isActivation:u.value,cancelRoute:window.location.href});if(!$||$.payment_id===void 0)throw Q({title:n("common.unexpectedError.title"),message:n("common.unexpectedError.message")});return b.value.paymentId=$.payment_id,b.value.customerId=l.value?.id_customer??"",$}catch($){throw console.error("Error initializing payment:",$),Uo($)===Ae?Q({code:Ae,title:n("transferCL.khipu.amountExceedsBankLimit.title"),message:n("transferCL.khipu.amountExceedsBankLimit.message"),primaryButtonText:n("transferCL.khipu.amountExceedsBankLimit.button"),onClearError:xn(mn,s,d)}):Q({title:n("common.unexpectedError.title"),message:n("common.unexpectedError.message")})}},T=async($,G,R,E)=>{try{return await f("/khipu/error/report",{method:"POST",body:{buy_order:r.value?.buy_order,error_title:$,error_message:G,event_result:R,failure_reason:E}})}catch{throw Q({title:n("common.unexpectedError.title"),message:n("common.unexpectedError.message")})}},S=()=>{h.value||(h.value=new Khipu);const $={modal:!0,options:{skipExitPage:!0}};let G=!1;const R=async E=>{if(!h.value||G)return;G=!0,console.log("Khipu event:",E);const V=E.result;try{switch(V){case"OK":{!u.value&&r.value?.id_transaction?(N.value={gateway:"khipu_transfer"},await fe(s,r.value.id_transaction,m.value?.id_checkout_session)):await rt({path:"/checkout/transfer-cl/activation/success",query:{checkoutSession:m.value?.id_checkout_session,...s.query.redirection&&{redirection:s.query.redirection}}});break}case"CONTINUE":{await T(E.exitTitle,E.exitMessage,V,E.failureReason),E.exitTitle===qo&&r.value?.id_transaction?await rt({path:`/checkout/pending-multirol/${r.value?.id_transaction}`,query:{checkoutSession:m.value?.id_checkout_session,gateway:"khipu_transfer",institution:e.value??void 0,amount:P.value,recipientName:v.value?.name,date:new Date().toLocaleDateString("en-CA",{timeZone:"America/Santiago"}),time:new Date().toLocaleTimeString("es-CL",{timeZone:"America/Santiago",hour:"2-digit",minute:"2-digit",hour12:!1}),...s.query.redirection&&{redirection:s.query.redirection}}}):E.continueUrl&&window.location.assign(E.continueUrl);break}case"WARNING":await T(E.exitTitle,E.exitMessage,V,E.failureReason),r.value?.id_transaction?(N.value={gateway:"khipu_transfer",transactionResult:"soft_error"},await fe(s,r.value.id_transaction,m.value?.id_checkout_session)):(C.value=E.exitTitle||n("common.unexpectedError.title"),O.value=E.exitMessage||n("common.unexpectedError.message"));break;case"ERROR":default:if(i.includes(E.failureReason||""))await I(Dt.TransferCLKhipu);else{a.value=!0;const it=await T(E.exitTitle,E.exitMessage,V,E.failureReason);a.value=!1,C.value=E.exitTitle||it.error_key||n("common.unexpectedError.title"),O.value=E.exitMessage||n("common.unexpectedError.message")}}}catch{throw Q({title:n("common.unexpectedError.title"),message:n("common.unexpectedError.message")})}finally{h.value?.close()}};h.value.startOperation(r.value?.payment_id,R,$)};return{startPaymentProcess:async()=>{r.value=await x(),S(),a.value=!1}}}function Go(e){const u=A(!1),a=A({show:!1,type:null}),g=A(null),n=A(!1),{startPaymentProcess:l}=Ro(g,u,n),{startPaymentProcess:m}=Fo(g,u,n),{startPaymentProcess:v}=zo(g,u,n),{t:P}=J(),s={floid_transfer:l,fintoc_transfer:m,khipu_transfer:v};return{isActivation:u,isGatewayLoading:n,gatewayToUse:e,selectedInstitutionId:g,activationModalState:a,startPaymentProcess:async()=>{const f=s[e.value];if(!f)throw Q({title:P("common.unexpectedError.title"),message:P("common.unexpectedError.message")});return await f()}}}function Wo(){const e=te(),{$portalGatewayApi:u}=bt();return{showRecentTransferInProcessRequest:async(g,n,l)=>{const v=(l??e.value??[]).map(P=>P.id_invoice);return await u("/show-recent-transfer-in-process",{method:"POST",body:{selected_institution_id:g,gateway:n,invoices:v}})}}}const Ko={class:"transfer-cl"},Ho={class:"transfer-cl__spinner-container"},jo={key:1},Vo=tt({__name:"index",setup(e){const{t:u}=J(),a=_t(),g=$e(),{setSelectedInstitution:n}=g,{setDemoTokuProducts:l}=Me(),m=A(null),{checkBankButtonActivationForBancoDeChile:v,showBankButtonActivation:P,handleExternalBankContinue:s}=$o(),d=A(""),f=A(""),C=A(null),O=A(null),h=A(!1),{isActivation:i,isGatewayLoading:I,selectedInstitutionId:r,activationModalState:b,startPaymentProcess:N}=Go(d),{abortInitializedPaymentIntentsAndTransactions:x}=Nt(),{atoaOnetimeInstitutionsRequest:T}=mo(),{showRecentTransferInProcessRequest:S}=Wo(),F=a.query.institutionId,$=w(()=>["floid_transfer","fintoc_transfer","khipu_transfer"].includes(d.value)),G=w(()=>d.value==="toku_transfer"),R=w(()=>f.value==="direct_debit_cl"),E=w(()=>d.value==="toku_pac"&&f.value!=="direct_debit_cl"),V=w(()=>["bank_button_cl_pst","bank_button_cl_psp"].includes(f.value)),it=w(()=>["bank_button_multiple_cl_pst","bank_button_multiple_cl_psp"].includes(f.value)),X=w(()=>Ce===f.value),ut=w(()=>P.value&&r.value==="cl_banco_de_chile_enterprise"),et=w(()=>En(f.value)),{session:ct,isSuccess:q}=pt(),nt=A(""),Y=A(!1),dt=A(null),lt=A(null),Z=A(""),St=w(()=>{const K=r.value?m.value?.institutions[r.value]:void 0;return K&&"activation_time"in K?K.activation_time??24:24}),Ct=w(()=>{const K=r.value?m.value?.institutions[r.value]:void 0;return K&&"activation_amount"in K?K.activation_amount:void 0}),xt=async()=>
3{q.value&&(await x(Dt.TransferCLPage),m.value=await T(),await Ft())};vt(m,async()=>{console.log("calling watch(atoaAvailableInstitutions)"),m.value&&(console.log("calling checkBankButtonActivationForBancoDeChile with params",m.value.institutions),await v(m.value.institutions),console.log("calling checkBankButtonActivationForBancoDeChile done"))},{once:!0}),vt(q,async()=>{await xt()},{once:!0}),vt([R,ct],async()=>{console.log("isDirectDebitRecurringPayment",R.value),R.value&&ct.value?.id_checkout_session&&await rt({path:"/checkout/pac",query:{checkoutSession:ct.value.id_checkout_session,originalCheckout:"transfer_cl"}})});const Ft=async()=>{if(F){console.log("redirecting to specific institution",F);const K=m.value.institutions[F];await y(F,K)}},y=async(K,j)=>{if(console.log("calling handleInstitutionSelected with params",K,j),n(K),!("gateway"in j))throw Q({title:u("common.unexpectedError.title"),message:u("common.unexpectedError.message")});const qt=j.toku_product===Ce;r.value=K,i.value=!qt&&j.status===Yt.ActivationRequired;const Lt=!qt&&j.status===Yt.AwaitingActivation;f.value=j.toku_product,C.value=j.activation_amount,O.value=j.activation_time,h.value=qt&&j.status===Yt.ActivationRequired;const Ot=j.gateway;let Tt;try{Tt=await S(K,Ot)}catch{Tt={show:!1,amount:0}}nt.value=Tt?.amount!=null?ht(Number(Tt.amount)):"";const Ht=["floid_transfer","fintoc_transfer","khipu_transfer","toku_transfer"].includes(Ot),ae=Tt?.show??!1;if(Ht&&ae){const jt=i.value&&!b.value.show||Lt;dt.value=jt?"activation":"startPayment",Z.value=Ot,jt&&(lt.value=Lt?"awaiting_activation":"activation_required",b.value.show=!1),Y.value=!0;return}i.value&&!b.value.show||Lt?(b.value.show=!0,b.value.type=Lt?"awaiting_activation":"activation_required",d.value=j.gateway):(d.value=j.gateway,$.value&&await N())},U=async()=>{Y.value=!1;const K=dt.value;dt.value=null;const j=lt.value;lt.value=null,d.value=Z.value,Z.value="",K==="activation"?(b.value.type=j??"activation_required",b.value.show=!0):K==="startPayment"&&$.value&&await N()},at=()=>{Y.value=!1,dt.value=null,lt.value=null,Z.value="",d.value="",r.value=null,b.value.show=!1},W=async K=>{K==="close"?(d.value="",b.value.show=!1):K==="confirm"&&(b.value.show=!1,$.value&&await N())},{trackPaymentMethodFormStarted:mt}=Ln(),{rendersInNewCheckoutCard:At}=On();return wt(async()=>{l(),await xt()}),mt(),(K,j)=>{const qt=Pt,Lt=We,Ot=Ke,Tt=Vn,Ht=kn,ae=na,ve=va,jt=ka;return _(),L("div",Ko,[p(Ya,{open:t(Y),"formatted-amount":t(nt),onClose:at,onConfirm:U},null,8,["open","formatted-amount"]),t(m)?(_(),L("div",jo,[t(b).show&&t(b).type==="activation_required"&&t(r)?(_(),B(Oo,{key:0,"institution-id":t(r),"activation-hours":t(St),onActivate:j[0]||(j[0]=Ut=>W("confirm")),onBack:j[1]||(j[1]=Ut=>W("close"))},null,8,["institution-id","activation-hours"])):t(d)===""||t($)||t(b).show?(_(),B(ko,{key:1,"payment-intent-atoa-onetime-institutions-response":t(m),"is-gateway-loading":t(I),"show-activation-modal":t(b),onInstitutionSelected:y,onActivationModalAction:W},null,8,["payment-intent-atoa-onetime-institutions-response","is-gateway-loading","show-activation-modal"])):t(E)?(_(),B(Ht,{key:2},{error:c(({error:Ut,clearError:oe})=>[p(Ot,{"in-card":t(At)("toku_pac"),error:Ut,"clear-error":oe},null,8,["in-card","error","clear-error"])]),default:c(()=>[p(Tt,{"institution-id":t(r),"handle-dismiss":()=>d.value="","toku-product":t(et)},null,8,["institution-id","handle-dismiss","toku-product"])]),_:1})):t(G)?(_(),B(Ht,{key:3},{error:c(({error:Ut,clearError:oe})=>[p(Ot,{"in-card":"",error:Ut,"clear-error":oe},null,8,["error","clear-error"])]),default:c(()=>[p(Eo,{"is-activation":t(i),"selected-institution-id":t(r),"activation-amount":t(Ct)},null,8,["is-activation","selected-institution-id","activation-amount"])]),_:1})):t(ut)?(_(),B(Wa,{key:4,"toku-product":t(f),onContinue:t(s)},null,8,["toku-product","onContinue"])):t(V)?(_(),B(ae,{key:5,"institution-id":t(r),gateway:t(d),"toku-product":t(f)},null,8,["institution-id","gateway","toku-product"])):t(it)?(_(),B(ve,{key:6,"selected-institution":t(r),gateway:t(d),"toku-product":t(f)},null,8,["selected-institution","gateway","toku-product"])):t(X)?(_(),B(jt,{key:7,"activation-amount":t(C),"activation-time":t(O),"is-wallet-activation-needed":t(h)},null,8,["activation-amount","activation-time","is-wallet-activation-needed"])):z("",!0)])):(_(),B(Lt,{key:0,"hide-go-back-to-commerce":""},{title:c(()=>[p(qt,null,{default:c(()=>[D(k(K.$t("dashboard.transferCL.selectInstitution.title")),1)]),_:1})]),main:c(()=>[o("div",Ho,[p(t(Se),{message:K.$t("common.loading.loadingData")},null,8,["message"])])]),_:1}))])}}}),Ms=st(Vo,[["__scopeId","data-v-cffc7439"]]);export{Ms as default};

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.