widget-web-component 1.0.60 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -56,7 +56,7 @@
56
56
  const observer = new MutationObserver(() => injectStyles());
57
57
  observer.observe(document.documentElement, { childList: true, subtree: true });
58
58
  })();
59
- "use strict";if((self.webpackChunkvex=self.webpackChunkvex||[]).push([[163],{4163:(e,t,n)=>{n.r(t),n.d(t,{ClientCertModule:()=>Zt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),y=n(9391),v=n(1572),w=n(182),x=n(4144),C=n(7367),k=n(9602),T=n(3238),M=n(5895),S=n(6257),I=n(1948),O=n(4246),L=n(9299),P=n(6e3),A=n(5861),E=n(7582),D=n(9549),N=n(9933),Y=n(8259),q=n(2340),R=n(1363),F=n(4650),Z=n(5089),U=n(8460),H=n(529),j=n(6554);let z=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(q.N.baseUrl+"/requests/client-certificate",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}addSignedFile(e){return new Promise(((t,n)=>{this.localFetch.postFile(q.N.baseUrl+"/requests/client-certificate/upload-file-signed",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}addFiles(e){return new Promise(((t,n)=>{this.localFetch.postFile(q.N.baseUrl+"/requests/client-certificate/upload-files",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(q.N.baseUrl+"/requests/client-certificate/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOtp(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(q.N.baseUrl+"/requests/client-certificate/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(q.N.baseUrl+"/requests/client-certificate/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}preRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(q.N.baseUrl+"/pre-request/client-certificate",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let i="/requests/client-certificate/otp";q.N.scraperMock&&(i="/mockscrapper/requests/client-certificate/otp"),this.localFetch.postFetchWhitoutToken(q.N.baseUrl+i,e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(F.LFG(Z.F),F.LFG(H.eN),F.LFG(j.r))},e.ɵprov=F.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var B=n(5412),J=n(833),V=n(4302),Q=n(6830),W=n(3731);function G(e,t){if(1&e&&(F.TgZ(0,"span"),F._uU(1),F.qZA()),2&e){const e=F.oxw(3);F.xp6(1),F.hij("¿No has recibido el código? Solicítalo de nuevo en ",e.secsCount," segundos")}}function $(e,t){if(1&e&&(F.TgZ(0,"span"),F._uU(1),F.qZA()),2&e){const e=F.oxw(3);F.xp6(1),F.AsE("¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? Solicítalo de nuevo en ",e.secsCount," segundos")}}const K=function(e,t,n){return{color:e,border:t,background:n}};function X(e,t){if(1&e&&(F.ynx(0),F.TgZ(1,"small",13),F.YNc(2,G,2,1,"span",7),F.YNc(3,$,2,2,"span",7),F.qZA(),F.BQk()),2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("ngStyle",F.kEZ(3,K,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),F.xp6(1),F.Q6J("ngIf",!e.lastNumberPhone),F.xp6(1),F.Q6J("ngIf",e.lastNumberPhone)}}function ee(e,t){1&e&&(F.TgZ(0,"span"),F._uU(1," ¿No has recibido el código en tu teléfono? "),F.qZA())}function te(e,t){if(1&e&&(F.TgZ(0,"span"),F._uU(1),F.qZA()),2&e){const e=F.oxw(3);F.xp6(1),F.hij(" ¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? ")}}const ne=function(e,t){return{color:e,background:t}};function ie(e,t){if(1&e){const e=F.EpF();F.ynx(0),F.TgZ(1,"small",13),F.YNc(2,ee,2,0,"span",7),F.YNc(3,te,2,1,"span",7),F.TgZ(4,"a",14),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw(2);return F.KtG(t.resendOTP())})),F._uU(5,"Reenviar"),F.qZA()(),F.BQk()}if(2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("ngStyle",F.kEZ(4,K,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),F.xp6(1),F.Q6J("ngIf",!e.lastNumberPhone),F.xp6(1),F.Q6J("ngIf",e.lastNumberPhone),F.xp6(1),F.Q6J("ngStyle",F.WLB(8,ne,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor))}}function se(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",2)(1,"div",3),F._UZ(2,"div",4)(3,"div",5),F.ALo(4,"safeHtml"),F.TgZ(5,"div",6),F.YNc(6,X,4,7,"ng-container",7),F.YNc(7,ie,6,11,"ng-container",7),F.qZA(),F.TgZ(8,"div",8)(9,"mat-form-field",9)(10,"mat-label"),F._uU(11," Código OTP "),F.qZA(),F.TgZ(12,"input",10),F.NdJ("change",(function(t){F.CHM(e);const n=F.oxw();return F.KtG(n.capturePasteEvent(t))}))("keyup",(function(t){F.CHM(e);const n=F.oxw();return F.KtG(n.setInputEvent(t))})),F.qZA()()()(),F.TgZ(13,"div",11)(14,"button",12),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(15,"Siguiente"),F.qZA()()()}if(2&e){const e=F.oxw();F.Q6J("formGroup",e.form),F.xp6(2),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.otp.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,18,e.texts.otp.description||""),F.oJD),F.xp6(3),F.Q6J("ngIf",e.secsCount&&e.secsCount>0),F.xp6(1),F.Q6J("ngIf",!e.secsCount||e.secsCount<=0),F.xp6(7),F.Udp("color",e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",e.form.invalid)}}function re(e,t){if(1&e&&(F.TgZ(0,"div",15),F._UZ(1,"mat-progress-spinner",16),F.TgZ(2,"p",17),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.Oqu(e.loading)}}let oe=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new F.vpe(null),this.errPhone=new F.vpe(null),this.resendO=new F.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,A.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?Y(e.target).next().focus():"Backspace"==e.code&&Y(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.QS),F.Y36(Z.F),F.Y36(_.M),F.Y36(L.gz))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",loading:"loading"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",3,"formGroup",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,se,16,20,"form",0),F.YNc(1,re,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.O5,i.PC,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,v.Ou,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var ae=n(342);function le(e,t){if(1&e&&(F.TgZ(0,"div",3),F._UZ(1,"div",4)(2,"div",5),F.ALo(3,"safeHtml"),F.qZA()),2&e){const e=F.oxw();F.xp6(1),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.success.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(3,8,e.texts.success.description||""),F.oJD)}}function ce(e,t){if(1&e&&F._UZ(0,"widget-documents",6),2&e){const e=F.oxw();F.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function de(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",7)(1,"button",8),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.gotoRedirect())})),F._uU(2),F.qZA()()}if(2&e){const e=F.oxw();F.xp6(1),F.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.xp6(1),F.hij(" ",e.data.ClientCertificate.btnTextCallBack||"Haga click aquí para finalizar"," ")}}let ue=(()=>{class e{constructor(e){this.utils=e,this.showDocuments=!1}ngOnInit(){this.data.ClientCertificate.enableUrlCallBack&&this.data.ClientCertificate.automaticRedirectCallBack&&this.data.ClientCertificate.callBackUrl?setTimeout((()=>{location.assign(this.data.ClientCertificate.callBackUrl)}),2e3):this.data.ClientCertificate.showDocumentsOnSuccess&&(this.showDocuments=!0)}gotoRedirect(){this.data.ClientCertificate.enableUrlCallBack&&this.data.ClientCertificate.callBackUrl&&location.assign(this.data.ClientCertificate.callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(Z.F))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",loading:"loading",packId:"packId",requestID:"requestID",userId:"userId"},decls:3,vars:3,consts:[["class","pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[3,"userId","packId","requestID",4,"ngIf"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(F.YNc(0,le,4,10,"div",0),F.YNc(1,ce,1,3,"widget-documents",1),F.YNc(2,de,3,7,"div",2)),2&e&&(F.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),F.xp6(1),F.Q6J("ngIf",t.showDocuments),F.xp6(1),F.Q6J("ngIf",t.data.ClientCertificate.enableUrlCallBack))},dependencies:[i.O5,u.lW,ae.A,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function he(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",5)(1,"button",6),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.retry())})),F._uU(2,"Intentarlo nuevamente"),F.qZA()()}if(2&e){const e=F.oxw();F.xp6(1),F.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function pe(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",5)(1,"button",6),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.newRequest())})),F._uU(2,"Crear nueva solicitud"),F.qZA()()}if(2&e){const e=F.oxw();F.xp6(1),F.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}let me=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new F.vpe(null),this.newReq=new F.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.QS),F.Y36(Z.F),F.Y36(_.M),F.Y36(y.o),F.Y36(M.T))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",loading:"loading",solicitud:"solicitud"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:7,vars:8,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(F.TgZ(0,"div",0)(1,"div",1),F._UZ(2,"div",2)(3,"div",3),F.ALo(4,"safeHtml"),F.qZA(),F.YNc(5,he,3,6,"div",4),F.YNc(6,pe,3,6,"div",4),F.qZA()),2&e&&(F.xp6(2),F.Q6J("innerHTML",t.texts.fail.title,F.oJD),F.xp6(1),F.Udp("color",t.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,6,t.texts.fail.description),F.oJD),F.xp6(2),F.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),F.xp6(1),F.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function fe(e,t){if(1&e&&(F.TgZ(0,"span",7),F._uU(1),F.qZA()),2&e){const e=F.oxw();F.xp6(1),F.hij("El archivo no puede pesar mas de ",e.max/1e3,"MB")}}function ge(e,t){if(1&e&&(F.TgZ(0,"span"),F._uU(1),F.qZA()),2&e){const e=F.oxw();F.xp6(1),F.AsE("",e.fileName," ",e.fileSize?"("+e.fileSize+"Kb)":"","")}}n(6866);const _e=function(e,t){return{"bg-red-500/20":e,"bg-slate-100/80":t}};let be=(()=>{class e{constructor(e){this.formBuilder=e,this.file=null,this.fileName="No se ha seleccionado ningun archivo",this.fileSize=0,this.acceptFiles="image/jpeg, image/jpg, application/pdf",this.max=1e4,this.newItemEvent=new F.vpe(null),this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.uploadForm=this.formBuilder.group({file:[""]})}fileChange(e){const t=e.target.files[0];this.uploadForm.patchValue({file:t}),this.uploadForm.get("file").updateValueAndValidity();const n=new FormData;let i=this.uploadForm.get("file").value;this.fileName=i.name,this.fileSize=+(+i.size/1e3).toFixed(1),n.append("file",i),console.warn(this.uploadForm.get("file").value),console.error(t),t.size<=3e6&&this.newItemEvent.emit({file:t}),this.newItemEvent.emit(n)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.qu))},e.ɵcmp=F.Xpm({type:e,selectors:[["app-upload-file"]],inputs:{label:"label",acceptFiles:"acceptFiles",max:"max"},outputs:{newItemEvent:"change"},decls:11,vars:9,consts:[[1,"flex","flex-col","items-start","input-file-wrapper","my-1",3,"formGroup","ngClass"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"flex","items-center","justify-start","mt-3"],["mat-flat-button","","color","accent",1,"btn-file",3,"click"],["class","text-red-500",4,"ngIf"],[4,"ngIf"],[1,"text-red-500"]],template:function(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",0)(1,"mat-label"),F._uU(2),F.qZA(),F.TgZ(3,"input",1,2),F.NdJ("change",(function(e){return t.fileChange(e)})),F.qZA(),F.TgZ(5,"div",3)(6,"button",4),F.NdJ("click",(function(){F.CHM(e);const t=F.MAs(4);return F.KtG(t.click())})),F._uU(7,"Seleccionar archivo"),F.qZA(),F._uU(8,"     "),F.YNc(9,fe,2,1,"span",5),F.YNc(10,ge,2,2,"span",6),F.qZA()()}2&e&&(F.Q6J("formGroup",t.uploadForm)("ngClass",F.WLB(6,_e,!t.fileName||t.fileSize>3e3,t.fileName&&t.fileSize<=3e3)),F.xp6(2),F.Oqu(t.label),F.xp6(1),F.Q6J("accept",t.acceptFiles),F.xp6(6),F.Q6J("ngIf",t.fileSize>t.max),F.xp6(1),F.Q6J("ngIf",t.fileSize<=t.max))},dependencies:[i.mk,i.O5,p._Y,p.JL,p.sg,D.hX,u.lW],styles:["button[aria-pressed=true][_ngcontent-%COMP%]{color:red!important}.btn-file[_ngcontent-%COMP%]{max-width:200px}.input-file-wrapper[_ngcontent-%COMP%]{padding:.7rem .5rem .7rem 1rem;border-radius:5px;border:2px dashed rgba(0,0,0,.1)}"]}),e})();function ye(e,t){if(1&e&&(F.TgZ(0,"mat-hint",21),F._uU(1),F.qZA()),2&e){const e=F.oxw(2);F.xp6(1),F.Oqu(e.errorDNI)}}function ve(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",2)(1,"div",3),F._UZ(2,"div",4)(3,"div",5),F.ALo(4,"safeHtml"),F.qZA(),F.TgZ(5,"div",6)(6,"mat-form-field",7)(7,"mat-label"),F._uU(8,"Nombre de la persona responsable"),F.qZA(),F._UZ(9,"input",8),F.qZA(),F.TgZ(10,"mat-form-field",7)(11,"mat-label"),F._uU(12,"Primer apellido de la persona responsable"),F.qZA(),F._UZ(13,"input",9),F.qZA(),F.TgZ(14,"mat-form-field",7)(15,"mat-label"),F._uU(16,"Segundo apellido de la persona responsable"),F.qZA(),F._UZ(17,"input",10),F.qZA(),F.TgZ(18,"mat-form-field",7)(19,"mat-label"),F._uU(20,"Email"),F.qZA(),F._UZ(21,"input",11),F.qZA(),F.TgZ(22,"mat-form-field",7)(23,"mat-label"),F._uU(24,"Teléfono"),F.qZA(),F._UZ(25,"input",12),F.qZA(),F.TgZ(26,"mat-form-field",7)(27,"mat-label"),F._uU(28,"Número de documento de identificación"),F.qZA(),F._UZ(29,"input",13),F.YNc(30,ye,2,1,"mat-hint",14),F.qZA(),F.TgZ(31,"mat-form-field",7)(32,"mat-label"),F._uU(33,"Razón social"),F.qZA(),F._UZ(34,"input",15),F.qZA(),F.TgZ(35,"mat-form-field",7)(36,"mat-label"),F._uU(37,"CIF"),F.qZA(),F._UZ(38,"input",16),F.qZA(),F.TgZ(39,"app-upload-file",17),F.NdJ("change",(function(t){F.CHM(e);const n=F.oxw();return F.KtG(n.setAnvers(t))})),F.qZA(),F.TgZ(40,"app-upload-file",18),F.NdJ("change",(function(t){F.CHM(e);const n=F.oxw();return F.KtG(n.setRevers(t))})),F.qZA()(),F.TgZ(41,"div",19)(42,"button",20),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(43," Siguiente "),F.qZA()()()}if(2&e){const e=F.oxw();F.Q6J("formGroup",e.form),F.xp6(2),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.form.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,51,e.texts.form.description||""),F.oJD),F.xp6(3),F.Gre("",e.disabledInputs.name?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.name?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.lastname?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.lastname?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.secondlastname?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.secondlastname?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.email?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.phone?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.phone?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.dni?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.dni?-1:1),F.xp6(1),F.Q6J("ngIf",e.errorDNI),F.xp6(1),F.Gre("",e.disabledInputs.razon?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.razon?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.cif?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.cif?-1:1),F.xp6(1),F.Q6J("max",2e3),F.xp6(1),F.Q6J("max",2e3),F.xp6(2),F.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",e.form.invalid)}}function we(e,t){if(1&e&&(F.TgZ(0,"div",22),F._UZ(1,"mat-progress-spinner",23),F.TgZ(2,"p",24),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.hij(" ",e.loading," ")}}const xe={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Ce=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.cd=n,this.next=new F.vpe(null),this.disabledInputs={dni:!1,name:!1,lastname:!1,secondlastname:!1,phone:!1,email:!1,razon:!1,cif:!1,type:!1}}ngOnInit(){this.setForm(this.solicitud?this.solicitud:null)}setForm(e){let t=e&&e.person_name?e.person_name:null,n=e&&(e.email||e.email_copy)?e.email||e.email_copy:null,i=e&&e.person_last_name?e.person_last_name:null,s=e&&e.person_last_name2?e.person_last_name2:null,r=e?e.person_document_number||e.document_number:null,o=e&&e.razon_social?e.razon_social:null,a=e&&e.cif?e.cif:null,l=e&&e.phone?e.phone:null;this.form=this.fb.group({name:[t||null,[p.kI.required]],lastname:[i||null,[p.kI.required]],lastname2:[s||null],dni:[r||null,[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9),this.regexDNI()]],razon:[o||null,[p.kI.required]],email:[n,[p.kI.required,p.kI.email]],phone:[l,[p.kI.required]],cif:[a||null,[p.kI.required,p.kI.minLength(9),p.kI.maxLength(9)]],document_front:[null,[p.kI.required]],document_back:[null,[p.kI.required]]}),this.requestIDFromURL&&this.disableEnableInputs(!1,t,i,s,n,l,r,o,a),this.cd.markForCheck()}disableEnableInputs(e,t,n,i,s,r,o,a,l){this.disabledInputs={name:t||!1,lastname:n||!1,secondlastname:i||!1,email:s||!1,phone:r||!1,dni:o||!1,razon:a||!1,cif:l||!1,type:e||!1}}if(e){this.setRegex(e)}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}setRegex(e){e&&(this.isDni=!!e.toUpperCase().match(/^(\d{8})([A-Z])$/),this.isNie=!!e.toUpperCase().match(/^[XYZ]\d{7,8}[A-Z]$/),console.warn(this.isDni,this.isNie),this.errorDNI=this.isDni||this.isNie?null:"Debes ingresar un DNI o NIE válido!",this.cd.markForCheck())}setAnvers(e){e&&e.file&&this.form.patchValue({document_front:e.file})}setRevers(e){e&&e.file&&this.form.patchValue({document_back:e.file})}nextStep(){let e={name:this.form.get("name").value,lastname:this.form.get("lastname").value,lastname2:this.form.get("lastname2").value,dni:this.form.get("dni").value,company_name:this.form.get("razon").value,cif:this.form.get("cif").value,document_front:this.form.get("document_front").value,document_back:this.form.get("document_back").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("lastname2").value,email_copy:this.form.get("email").value,phone:this.form.get("phone").value,document_number:this.form.get("dni").value,check_legal:!0,type:"LEGAL",rmc_validation:!0,validation_id:!0};this.data.config.activatePower&&(e.power_activate=1),this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.QS),F.Y36(Z.F),F.Y36(F.sBO))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-form-step"]],inputs:{data:"data",flowName:"flowName",texts:"texts",solicitud:"solicitud",loading:"loading",requestIDFromURL:"requestIDFromURL"},outputs:{next:"nextStep"},features:[F._Bn([{provide:T.sG,useValue:xe},{provide:F.soG,useValue:"es-ES"}])],decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",3,"formGroup",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline"],["formControlName","name","matInput","",3,"tabindex"],["formControlName","lastname","matInput","",3,"tabindex"],["formControlName","lastname2","matInput","",3,"tabindex"],["formControlName","email","matInput","",3,"tabindex"],["formControlName","phone","maxlength","9","matInput","",3,"tabindex"],["formControlName","dni","maxlength","9","placeholder","Ej: 12345678R","matInput","",3,"tabindex"],["class","text-xs text-red-500",4,"ngIf"],["formControlName","razon","placeholder","Ej: Mi Empresa","type","text","matInput","",3,"tabindex"],["formControlName","cif","maxlength","9","placeholder","Ej: B12345678","type","text","matInput","",3,"tabindex"],["label","Anverso documento de identificación (Max 2MB)",1,"w-full",3,"max","change"],["label","Reverso documento de identificación (Max 2MB)",1,"w-full",3,"max","change"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-xs","text-red-500"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,ve,44,53,"form",0),F.YNc(1,we,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.O5,u.lW,D.KE,D.bx,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.nD,p.sg,p.u,v.Ou,be,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),ke=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts",loading:"loading"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(F.TgZ(0,"form",0)(1,"div",1),F._UZ(2,"div",2)(3,"div",3),F.ALo(4,"safeHtml"),F.qZA()()),2&e&&(F.xp6(2),F.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),F.Q6J("innerHTML",t.texts.noService.title,F.oJD),F.xp6(1),F.Udp("color",t.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,8,t.texts.noService.description),F.oJD))},dependencies:[p._Y,p.JL,p.F,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Te=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new F.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return"Abandonado después de esperar OTP de Seguridad Social";case"abandoned_after_invalid_otp_seguridad_social":return"Abandonado despues de OTP inválido en Seguridad Social";case"abandoned_after_invalid_otp_aeat":return"Abandonado despues de OTP inválido en AEAT";case"abandoned_after_waiting_otp_aeat":return"Abandonado después de esperar OTP de AEAT";default:return this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.QS),F.Y36(Z.F),F.Y36(_.M),F.Y36(y.o),F.Y36(M.T))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",loading:"loading",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:10,vars:17,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-md","mb-2","mt-2"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(F.TgZ(0,"div",0)(1,"div",1),F._UZ(2,"div",2)(3,"div",3),F.ALo(4,"safeHtml"),F.TgZ(5,"div",4),F._uU(6),F.qZA()(),F.TgZ(7,"div",5)(8,"button",6),F.NdJ("click",(function(){return t.retry()})),F._uU(9,"Intentarlo nuevamente"),F.qZA()()()),2&e&&(F.xp6(2),F.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),F.Q6J("innerHTML",t.texts.abandoned.title,F.oJD),F.xp6(1),F.Udp("color",t.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,15,t.texts.abandoned.description),F.oJD),F.xp6(3),F.hij(" Estado: ",t.getTextStatus()," "),F.xp6(2),F.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Me(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function Se(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," La contraseña es requerida "),F.qZA())}function Ie(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," La contraseña debe tener al menos 8 carácteres "),F.qZA())}function Oe(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," Es necesario repetir la contraseña "),F.qZA())}function Le(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," Las contraseñas deben coincidir "),F.qZA())}function Pe(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," La contraseña debe tener al menos 8 carácteres "),F.qZA())}function Ae(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",2)(1,"div",3),F._UZ(2,"div",4)(3,"div",5),F.ALo(4,"safeHtml"),F.qZA(),F.TgZ(5,"div",6)(6,"mat-form-field",7)(7,"mat-label"),F._uU(8,"Contraseña"),F.qZA(),F._UZ(9,"input",8),F.YNc(10,Se,2,0,"mat-hint",9),F.YNc(11,Ie,2,0,"mat-hint",9),F.qZA(),F.TgZ(12,"mat-form-field",10)(13,"mat-label"),F._uU(14,"Repite Contraseña"),F.qZA(),F._UZ(15,"input",11),F.YNc(16,Oe,2,0,"mat-hint",9),F.YNc(17,Le,2,0,"mat-hint",9),F.YNc(18,Pe,2,0,"mat-hint",9),F.qZA()(),F.TgZ(19,"div",12)(20,"button",13),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(21," Guardar "),F.qZA()()()}if(2&e){const e=F.oxw();F.Q6J("formGroup",e.form),F.xp6(2),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.password.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,21,e.texts.password.description),F.oJD),F.xp6(7),F.Q6J("ngIf",e.f.password.touched&&e.f.password.invalid&&e.f.password.errors.required),F.xp6(1),F.Q6J("ngIf",e.f.password.invalid&&e.f.password.errors.minlength),F.xp6(5),F.Q6J("ngIf",e.f.confirm_password.touched&&e.f.confirm_password.touched&&e.f.confirm_password.invalid&&e.f.confirm_password.errors.required),F.xp6(1),F.Q6J("ngIf",e.f.confirm_password.touched&&e.f.confirm_password.touched&&e.f.confirm_password.invalid&&e.f.confirm_password.errors.confirmedValidator),F.xp6(1),F.Q6J("ngIf",e.f.confirm_password.invalid&&e.f.confirm_password.errors.minlength),F.xp6(2),F.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",e.form.invalid)}}function Ee(e,t){if(1&e&&(F.TgZ(0,"div",15),F._UZ(1,"mat-progress-spinner",16),F.TgZ(2,"p",17),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.hij(" ",e.loading," ")}}const De={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Ne=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.form=new p.cw({}),this.next=new F.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Me("password","confirm_password")})}nextStep(){this.next.emit(this.form.get("password").value)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.qu),F.Y36(Z.F))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",loading:"loading"},outputs:{next:"nextStep"},features:[F._Bn([{provide:T.sG,useValue:De},{provide:F.soG,useValue:"es-ES"}])],decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",3,"formGroup",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,Ae,22,23,"form",0),F.YNc(1,Ee,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.O5,u.lW,D.KE,D.bx,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,v.Ou,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ye=n(1763),qe=n(5696);function Re(e,t){1&e&&F._UZ(0,"mat-icon",14)}function Fe(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div")(1,"belender-checkbox",11),F.NdJ("changeCheckbox",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.setTerms(t))})),F.TgZ(2,"belender-terms-and-policy-links",12),F.NdJ("goToTerms",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.gotoTermsAndConditions(t))})),F.qZA()(),F.YNc(3,Re,1,0,"mat-icon",13),F.qZA()}if(2&e){const e=F.oxw(2);F.Gre("mt-8 flex justify-between items-center w-full flex-100 ",e.errorType.termsRead||e.errorType.acceptTerms?"bg-orange-500/10 ":""," pr-4 rounded-sm"),F.xp6(1),F.Q6J("color",e.data.styles.colors.title),F.xp6(1),F.Q6J("userId",e.userId)("showPolicyLink",null==e.data?null:e.data.config.showPolicyLink),F.xp6(1),F.Q6J("ngIf",e.errorType.termsRead||e.errorType.acceptTerms)}}function Ze(e,t){1&e&&F._UZ(0,"mat-icon",14)}function Ue(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div")(1,"belender-checkbox",11),F.NdJ("changeCheckbox",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.setPower(t))})),F._uU(2," Consiento expresamente a la activación de un poder digital según las condiciones que pueden verse "),F.TgZ(3,"a",15),F.NdJ("click",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.gotoPowerConditions(t))})),F.TgZ(4,"u"),F._uU(5,"aquí"),F.qZA()()(),F.YNc(6,Ze,1,0,"mat-icon",13),F.qZA()}if(2&e){const e=F.oxw(2);F.Gre("flex justify-between items-center w-full flex-100 ",e.errorType.termsRead||e.errorType.powerAccept?"bg-orange-500/10 ":"",""),F.xp6(1),F.Q6J("color",e.data.styles.colors.title),F.xp6(5),F.Q6J("ngIf",e.errorType.powerAccept)}}function He(e,t){1&e&&F._UZ(0,"mat-icon",14)}function je(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div")(1,"belender-checkbox",11),F.NdJ("changeCheckbox",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.setAssignment(t))})),F._UZ(2,"div",16),F.qZA(),F.YNc(3,He,1,0,"mat-icon",13),F.qZA()}if(2&e){const e=F.oxw(2);F.Gre("flex justify-between items-center w-full flex-100 ",e.errorType.assignment?"bg-orange-500/10 ":""," pr-4 rounded-sm"),F.xp6(1),F.Q6J("color",e.data.styles.colors.title),F.xp6(1),F.Q6J("innerHTML",null==e.data?null:e.data.config.dataAssignmentText,F.oJD),F.xp6(1),F.Q6J("ngIf",e.errorType.assignment)}}function ze(e,t){if(1&e&&(F.TgZ(0,"div",19),F._UZ(1,"mat-icon",20),F._uU(2),F.qZA()),2&e){const e=F.oxw().$implicit;F.xp6(2),F.hij(" ",e," ")}}function Be(e,t){if(1&e&&(F.ynx(0),F.YNc(1,ze,3,1,"div",18),F.BQk()),2&e){const e=t.index;F.xp6(1),F.Q6J("ngIf",e<3)}}function Je(e,t){if(1&e&&(F.ynx(0),F.YNc(1,Be,2,1,"ng-container",17),F.BQk()),2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("ngForOf",e.errors)}}function Ve(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",2)(1,"div",3),F._UZ(2,"div",4)(3,"div",5),F.ALo(4,"safeHtml"),F.qZA(),F.TgZ(5,"div",6),F.YNc(6,Fe,4,7,"div",7),F.YNc(7,Ue,7,5,"div",7),F.YNc(8,je,4,6,"div",7),F.qZA(),F.YNc(9,Je,2,1,"ng-container",8),F.TgZ(10,"div",9)(11,"button",10),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(12,"Siguiente"),F.qZA()()()}if(2&e){const e=F.oxw();F.xp6(2),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.tyc.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,19,e.texts.tyc.description||""),F.oJD),F.xp6(3),F.Q6J("ngIf",!e.data.config.hideCheckLegal),F.xp6(1),F.Q6J("ngIf",e.requestID?null==e.solicitud?null:e.solicitud.power_activate:null==e.data?null:e.data.config.activatePower),F.xp6(1),F.Q6J("ngIf",null==e.data?null:e.data.config.dataAssignmentCheck),F.xp6(1),F.Q6J("ngIf",e.errors&&e.errors.length),F.xp6(2),F.Udp("color",e.getErrorValidation()?"":e.data.styles.colors.btnText)("background",e.getErrorValidation()?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",e.getErrorValidation())}}function Qe(e,t){if(1&e&&(F.TgZ(0,"div",21),F._UZ(1,"mat-progress-spinner",22),F.TgZ(2,"p",23),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.Oqu(e.loading)}}let We=(()=>{class e{constructor(e){this.utils=e,this.requestID=null,this.powerAccepted=!1,this.next=new F.vpe(null),this.goTerms=new F.vpe(null),this.goTermsCert=new F.vpe(null),this.gotoPower=new F.vpe(null),this.acceptTerms=!1,this.acceptTerms2=!0,this.powerActivate=!1,this.termsReaded=!1,this.terms2Readed=!0,this.assignment=!1,this.errors=[],this.errorType={termsRead:!1,terms2Read:!1,powerRead:!1,powerAccept:!1,acceptTerms:!1,acceptTerms2:!1,assignment:!1,acceptPower:!1}}ngOnInit(){}nextStep(){this.next.emit(this.powerActivate)}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(e){e.preventDefault(),e.stopPropagation(),this.terms2Readed=!0,this.goTermsCert.emit(!0)}gotoPowerConditions(e){e.preventDefault(),e.stopPropagation(),this.gotoPower.emit(!0)}setAssignment(e){this.assignment=e}setPower(e){this.powerActivate=e}setTerms(e){this.acceptTerms=e}setTerms2(e){this.acceptTerms2=e}getErrorValidation(){this.errors=[],this.errorType={termsRead:!1,terms2Read:!1,powerRead:!1,powerAccept:!1,acceptTerms:!1,acceptTerms2:!1,assignment:!1,acceptPower:!1};let e=!1;return this.data.config.forceChecks&&(!this.termsReaded&&!this.data.config.hideCheckLegal&&(this.errors.push("Debe leer los términos y condiciones del servicio"),this.errorType.termsRead=!0,e=!0),this.terms2Readed||(this.errors.push("Debe leer los términos y condiciones para la emisión de certificado"),this.errorType.terms2Read=!0,e=!0)),!this.acceptTerms&&!this.data.config.hideCheckLegal&&(this.errors.push("Debe aceptar los términos y condiciones del servicio"),this.errorType.acceptTerms=!0,e=!0),this.acceptTerms2||(this.errors.push("Debe aceptar los términos y condiciones para la emisión de certificado"),this.errorType.acceptTerms2=!0,e=!0),this.data.config.dataAssignmentCheck&&!this.assignment&&(this.errors.push("Debe consentir la activación de un poder digital registrado en el REA"),this.errorType.assignment=!0,e=!0),(this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&(this.powerActivate||(this.errors.push("Debe consentir la activación de un poder digital registrado en el REA"),this.errorType.powerAccept=!0,e=!0)),e}}return e.ɵfac=function(t){return new(t||e)(F.Y36(Z.F))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-terms-step"]],inputs:{userId:"userId",requestID:"requestID",data:"data",texts:"texts",solicitud:"solicitud",loading:"loading",powerAccepted:"powerAccepted"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",gotoPower:"gotoPowerConditions"},decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],[3,"class",4,"ngIf"],[4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"color","changeCheckbox"],[3,"userId","showPolicyLink","goToTerms"],["class","text-xs w-4 h-4 text-orange-500","svgIcon","mat:warning",4,"ngIf"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4","text-orange-500"],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],[1,"custom-html",3,"innerHTML"],[4,"ngFor","ngForOf"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500 ",4,"ngIf"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,Ve,13,21,"div",0),F.YNc(1,Qe,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.sg,i.O5,d.Hw,u.lW,v.Ou,Ye.b,qe.T,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ge=n(4468);function $e(e,t){1&e&&(F.TgZ(0,"div",12),F._UZ(1,"mat-icon",13),F._uU(2," Archivo firmado cargado "),F.qZA())}function Ke(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"button",14),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw(2);return F.KtG(t.onClickAutofirma())})),F._uU(1,"Firmar certificado"),F.qZA()}if(2&e){const e=F.oxw(2);F.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function Xe(e,t){1&e&&(F.TgZ(0,"div",15),F._UZ(1,"mat-progress-spinner",16),F.TgZ(2,"span",17),F._uU(3,"Esperando autofirma..."),F.qZA()())}function et(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",2)(1,"div",3)(2,"h1",4),F._uU(3,"HOJA DE ACEPTACIÓN DE CERTIFICADO ELECTRONICO CUALIFICADO RÉGIMEN OBLIGATORIO DE USO DEL CERTIFICADO ELECTRONICO: “CERTIFICADO DE PERSONA FÍSICA REPRESENTANTE DE EMPRESA EMITIDO EN SOFTWARE”"),F.qZA(),F.TgZ(4,"p"),F._uU(5," a) Que existen unas condiciones generales del servicio incorporadas en el texto de divulgación del certificado o PDS, y una declaración de prácticas de certificación, que regulan la emisión y utilización del certificado electrónico emitido porvinCAsign, cuyo texto íntegro se puede consultar en la dirección de Internet, https://policy.vincasign.net. "),F.qZA(),F.TgZ(6,"p"),F._uU(7," b) Que el certificado electrónico emitido y el resto de los elementos que forman parte de la identificación electrónica son únicos para cada usuario. El certificado debe ser protegido por un código secreto (PIN), que sólo conoce el titular y que le será entregado en el momento de la emisión del certificado. Para utilizar el certificado es imprescindible conocer este código. "),F.qZA(),F.TgZ(8,"p"),F._uU(9," c) Que este certificado permite al titular del certificado generar firmas electrónicas e identificarse de forma electrónica en aquellos sistemas de información que soporten este tipo de autenticación. "),F.qZA(),F.TgZ(10,"p"),F._uU(11," d) Que el FIRMANTE debe custodiar, de forma diligente, el PIN que permite utilizarlo, para evitar que otras personas puedan suplantar su identidad y firmar documentos en su nombre, o acceder a mensajes confidenciales o sistemas de información de acceso restringido. "),F.qZA(),F.TgZ(12,"p"),F._uU(13," e) Que, si el FIRMANTE detecta cualquier indicio de que su identificación electrónica ha podido ser utilizada por otras personas, tendrá que suspender el uso del certificado y notificarlo inmediatamente al responsable del servicio de certificación del SUSCRIPTOR, o a vinCAsign, para pedir la revocación del certificado y, en su caso, la emisión de uno nuevo. "),F.qZA(),F.TgZ(14,"p"),F._uU(15," f) Que ante cualquier necesidad de información adicional, respecto de la utilización de los certificados emitidos en nombre de vinCAsign, el FIRMANTE se podrá dirigir al SUSCRIPTOR, al responsable del servicio de certificación del SUSCRIPTOR, y/o a VINTEGRIS. "),F.qZA(),F.TgZ(16,"p"),F._uU(17," g) Que con el fin de obtener los correspondientes certificados, y dentro del marco del Reglamento (UE) 2016/679 del Parlamento Europeo y del Consejo de 27 de abril de 2016 relativo a la protección de las personas físicas en lo que respecta al tratamiento de datos personales y a la libre circulación de estos datos y por el que se deroga la Directiva 95/46/CE (Reglamento general de protección de datos), el SUSCRIPTOR ha comunicado a vinCAsign los datos identificativos del FIRMANTE con el fin de emitir y gestionar el certificado corporativo de persona física emitido en software, en el ámbito de la relación de trabajo entre dicho FIRMANTE y el SUSCRIPTOR, todo ello a los efectos de lo previsto en el artículo 28 del Reglamento general de protección de datos. "),F.qZA(),F.TgZ(18,"p"),F._uU(19," h) Que sabe que, en cumplimiento de lo establecido en los artículos 24.2 y 28 del Reglamento (UE) 910/2014 del Parlamento Europeo y del Consejo de 23 de julio de 2014, los datos contenidos en el certificado corporativo de persona física emitido en software están publicados en la página web de vinCAsign a efectos del Registro de Certificados y de las listas de revocación, toda vez que ha prestado su consentimiento durante el proceso de solicitud. "),F.qZA(),F.TgZ(20,"h1",5),F._uU(21," ACTO DE ACEPTACIÓN DEL CERTIFICADO ELECTRÓNICO "),F.qZA(),F.TgZ(22,"p"),F._uU(23," Firmo el presente documento para dejar constancia: "),F.qZA(),F.TgZ(24,"p"),F._uU(25," Que ha sido informado del contenido del texto de divulgación del certificado o PDS, en el que se incluyen las condiciones generales del servicio aplicable al certificado corporativo de persona física emitido en software. "),F.qZA(),F.TgZ(26,"p"),F._uU(27," Que ha sido informado del régimen obligatorio de uso del certificado emitido, sus condiciones de uso y sus responsabilidades. "),F.qZA(),F.TgZ(28,"p"),F._uU(29," Que ha sido informado de las circunstancias relativas al tratamiento de sus datos personales para la correcta emisión y gestión del certificado que se emite. "),F.qZA(),F.TgZ(30,"p"),F._uU(31," Firma de conformidad, en virtud de la cual ha leído y entiende las obligaciones y responsabilidades que asume. "),F.qZA(),F.TgZ(32,"div",6),F.YNc(33,$e,3,0,"div",7),F.YNc(34,Ke,2,6,"button",8),F.YNc(35,Xe,4,0,"div",9),F.qZA()(),F.TgZ(36,"div",10)(37,"button",11),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(38,"Completar"),F.qZA()()()}if(2&e){const e=F.oxw();F.Q6J("formGroup",e.form),F.xp6(33),F.Q6J("ngIf",e.signedFile&&!e.loadingAutofirma),F.xp6(1),F.Q6J("ngIf",!e.signedFile&&!e.loadingAutofirma),F.xp6(1),F.Q6J("ngIf",e.loadingAutofirma),F.xp6(2),F.Udp("color",e.signedFile?e.data.styles.colors.btnText:"")("background",e.signedFile?e.data.styles.colors.btnBg:"")("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",!e.signedFile)}}function tt(e,t){if(1&e&&(F.TgZ(0,"div",18),F._UZ(1,"mat-progress-spinner",19),F.TgZ(2,"p",20),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.Oqu(e.loading)}}let nt=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.notis=t,this.utils=n,this._autofirma=i,this.form=new p.cw({}),this.next=new F.vpe(null),this.loadingAutofirma=!1}ngOnInit(){this.setForm(),this.blobFile=this.base64ToBlob(this.pdfFile64,"application/pdf");const e=URL.createObjectURL(this.blobFile);this.pdfHtml="<iframe width='100%' height='100%' src='"+e+"'></iframe>",this.pdfHtml+=`<img style="width: 100%; min-heigth: 300px" src="${e}" />`}base64ToBlob(e,t="application/octet-stream"){const n=atob(e),i=n.length,s=new Uint8Array(i);for(let e=0;e<i;e++)s[e]=n.charCodeAt(e);return new Blob([s],{type:t})}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({file_signed:["",[p.kI.required]]})}nextStep(){this.next.emit({file_signed:this.signedFile})}onChangeFile(e){const t=e.target;!t||!t.files||(this.file=t.files[0])}blobToFile(e,t){return e.lastModifiedDate=new Date,e.name=t,e}onClickAutofirma(){var e=this;return(0,A.Z)((function*(){e.loadingAutofirma=!0;let t,n="signed_document";e.file=e.blobToFile(e.blobFile,n),e._autofirma.requestPDFSignature(e.file,{headless:!0,filters:{"issuer.rfc2254":"(CN=AC Representa*)"}}).then((i=>{t=i,e.loadingAutofirma=!1;let s=new File([t],n+"_signed.pdf",{type:e.file.type});e.signedFile=s,e.nextStep()})).catch((t=>{t?.message?.includes("ApplicationNotFoundException")?e.notis.showAlert("No se encuentra AutoFirma","No se ha encontrado el programa de autofirma instalado en su computador, por favor descarguelo en el siguiente link y vuelva a intentarlo.","info",{cancelButtonLabel:"Ir a Autofirma",okButtonLabel:"Cerrar",cancelAction:function(){window.open("https://firmaelectronica.gob.es/Home/Descargas.html","_blank")}}):e.notis.showAlert("Error desconocido","Ha ocurrido un error: "+t)}))}))()}fileToUrl(e){return new Promise(((t,n)=>{const i=new FileReader;i.onloadend=()=>{t(i.result)},i.readAsDataURL(e)}))}setAnvers(e){e&&e.file&&this.form.patchValue({document_front:e.file})}setRevers(e){e&&e.file&&this.form.patchValue({document_back:e.file})}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.qu),F.Y36(M.T),F.Y36(Z.F),F.Y36(Ge.Kj))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-autofirma-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",loading:"loading",pdfFile64:"pdfFile64"},outputs:{next:"nextStep"},decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",3,"formGroup",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"my-3","bg-slate-50","p-2","rounded-md","flex","max-h-[300px]","overflow-y-auto","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],[1,"font-bold"],[1,"pt-3","font-bold"],[1,"flex","w-full","items-center","justify-end","gap-2","p-4"],["class","flex gap-1 text-green-500 items-center justify-end w-full",4,"ngIf"],["class","px-8","mat-flat-button","","type","button",3,"color","background","border-radius","click",4,"ngIf"],["class","flex items-center gap-2",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"flex","gap-1","text-green-500","items-center","justify-end","w-full"],["svgIcon","mat:check_circle"],["mat-flat-button","","type","button",1,"px-8",3,"click"],[1,"flex","items-center","gap-2"],["color","accent","diameter","20","value","0","mode","indeterminate",1,"spinner"],[1,"text-black"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,et,39,11,"form",0),F.YNc(1,tt,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.O5,d.Hw,u.lW,p._Y,p.JL,p.sg,v.Ou],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),it=(()=>{class e{constructor(){this.next=new F.vpe(null)}ngOnInit(){}nextStep(){this.next.emit(!0)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-requisites-step"]],inputs:{data:"data",texts:"texts",loading:"loading"},outputs:{next:"nextStep"},decls:15,vars:18,consts:[[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"py-4"],["href","https://firmaelectronica.gob.es/Home/Descargas.html","target","_blank",1,"text-blue-500","font-bold","underline"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(F.TgZ(0,"div",0),F._UZ(1,"div",1)(2,"div",2),F.ALo(3,"safeHtml"),F.TgZ(4,"div",3),F._uU(5," Si no tiene "),F.TgZ(6,"strong"),F._uU(7,"Autofirma"),F.qZA(),F._uU(8," instalado, antes de continuar, puedes instalarlo siguiendo este "),F.TgZ(9,"a",4),F._uU(10,"link"),F.qZA(),F._uU(11,". "),F.qZA(),F.TgZ(12,"div",5)(13,"button",6),F.NdJ("click",(function(){return t.nextStep()})),F._uU(14,"Siguiente"),F.qZA()()()),2&e&&(F.xp6(1),F.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),F.Q6J("innerHTML",null==t.texts||null==t.texts.requisites?null:t.texts.requisites.title,F.oJD),F.xp6(1),F.Udp("color",t.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(3,16,null==t.texts||null==t.texts.requisites?null:t.texts.requisites.description),F.oJD),F.xp6(2),F.Udp("color",t.data.styles.colors.text),F.xp6(9),F.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function st(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"vex-power-cert",4),F.NdJ("accept",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.acceptPowerCert())})),F.qZA()}if(2&e){const e=F.oxw();F.Q6J("hideButtons",!1)("flow","ClientCertificate")("userId",e.userId)}}function rt(e,t){if(1&e&&(F.TgZ(0,"div",10),F._UZ(1,"img",11),F.qZA()),2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("src",e.data.styles.logoUrl,F.LSH)}}function ot(e,t){1&e&&(F.TgZ(0,"div",12),F._UZ(1,"mat-progress-spinner",13),F.qZA()),2&e&&(F.xp6(1),F.Q6J("value",0))}function at(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-form-step",25),F.NdJ("gotoPowerConditions",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.gotoPowerConditions())}))("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.sendFormData(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("flowName",e.flowName)("loading",e.loading)("requestIDFromURL",e.requestIDFromURL)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function lt(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-requisites-step",26),F.NdJ("nextStep",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.showRequisitesPage=!1)})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)}}function ct(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-terms-step",27),F.NdJ("goToTerms",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.gotoTermsAndConditions())}))("gotoPowerConditions",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.acceptTerms(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("userId",e.userId)("requestID",e.requestID)("data",e.data)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)("loading",e.loading)}}function dt(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-password-step",28),F.NdJ("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.sendPassword(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function ut(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-autofirma-step",29),F.NdJ("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.sendDocument(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("pdfFile64",e.pdfFile64)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function ht(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-otp-step",30),F.NdJ("resendOTP",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.resendOTP(t))}))("errorPhone",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.requestOTP(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function pt(e,t){if(1&e&&F._UZ(0,"belender-success-step",31),2&e){const e=F.oxw(3);F.Q6J("data",e.data)("packId",e.packId)("userId",e.userId)("requestID",e.requestID)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)}}function mt(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-fail-step",32),F.NdJ("retry",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.retryRequest(t))}))("newRequest",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.newRequest(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function ft(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-abandoned-step",33),F.NdJ("retry",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.retryRequest(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("solicitud",e.solicitud)("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)}}function gt(e,t){if(1&e&&F._UZ(0,"belender-no-service-step",34),2&e){const e=F.oxw(3);F.Q6J("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("data",e.data)}}function _t(e,t){if(1&e&&(F.TgZ(0,"div",35)(1,"div",36)(2,"h1",37),F._uU(3,"No existe la solicitud"),F.qZA()(),F.TgZ(4,"div",38),F._uU(5," No existen solicitudes activas con el código requerido "),F.qZA()()),2&e){const e=F.oxw(3);F.xp6(4),F.Udp("color",e.data.styles.colors.text)}}function bt(e,t){if(1&e&&(F.ynx(0),F.YNc(1,at,1,6,"belender-form-step",14),F.YNc(2,lt,1,3,"belender-requisites-step",15),F.YNc(3,ct,1,6,"belender-terms-step",16),F.YNc(4,dt,1,4,"belender-password-step",17),F.YNc(5,ut,1,5,"belender-autofirma-step",18),F.YNc(6,ht,1,4,"belender-otp-step",19),F.YNc(7,pt,1,6,"belender-success-step",20),F.YNc(8,mt,1,4,"belender-fail-step",21),F.YNc(9,ft,1,4,"belender-abandoned-step",22),F.YNc(10,gt,1,3,"belender-no-service-step",23),F.YNc(11,_t,6,2,"div",24),F.BQk()),2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("ngIf",e.data&&"form"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","autofirma"==e.getStatus()&&e.showRequisitesPage),F.xp6(1),F.Q6J("ngIf","terms"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","password"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","autofirma"==e.getStatus()&&e.pdfFile64&&!e.showRequisitesPage),F.xp6(1),F.Q6J("ngIf","otp"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","success"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","failed"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","abandoned"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","no-service"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","no-exist"==e.getStatus())}}function yt(e,t){1&e&&F._UZ(0,"belender-disabled-url")}function vt(e,t){if(1&e&&(F.TgZ(0,"div",39),F._UZ(1,"mat-progress-spinner",40),F.TgZ(2,"p",41),F._uU(3),F.qZA()()),2&e){const e=F.oxw(2);F.xp6(3),F.hij(" ",e.loading," ")}}function wt(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",42)(1,"div",35)(2,"div",43),F._uU(3,"Error!"),F.qZA(),F._UZ(4,"div",44),F.qZA(),F.TgZ(5,"div",45)(6,"button",46),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw(2);return F.KtG(t.error=!1)})),F._uU(7," Ingresar manualmente "),F.qZA()()()}if(2&e){const e=F.oxw(2);F.xp6(4),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",e.error,F.oJD)}}function xt(e,t){if(1&e&&(F.TgZ(0,"div",5)(1,"div"),F.YNc(2,rt,2,1,"div",6),F.YNc(3,ot,2,1,"div",7),F.YNc(4,bt,12,11,"ng-container",3),F.YNc(5,yt,1,0,"belender-disabled-url",3),F.YNc(6,vt,4,1,"div",8),F.YNc(7,wt,8,3,"div",9),F.qZA()()),2&e){const e=F.oxw();F.xp6(1),F.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),F.Udp("background",e.data.styles.colors.background),F.xp6(1),F.Q6J("ngIf",e.data.styles.withLogo&&"loading"!=e.getStatus()),F.xp6(1),F.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"==e.getStatus()),F.xp6(1),F.Q6J("ngIf",!e.error),F.xp6(1),F.Q6J("ngIf",!e.error&&e.disableURL),F.xp6(1),F.Q6J("ngIf",e.loading),F.xp6(1),F.Q6J("ngIf",!e.loading&&e.error)}}function Ct(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"vex-terms",47),F.NdJ("accepted",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.handleTermsResponse(!1))})),F.qZA()}if(2&e){const e=F.oxw();F.Q6J("flow","certificate")("requestStatus",e.solicitud?e.solicitud.status_code:"")}}function kt(e,t){if(1&e&&(F.ynx(0),F.TgZ(1,"div",48),F._uU(2),F.qZA(),F.BQk()),2&e){const e=F.oxw();F.xp6(2),F.hij(" TestMode ",e.testMode?"ON":"OFF"," ")}}let Tt=class{constructor(e,t,n,i,s,r,o,a,l){this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.certificateService=a,this.dialog=l,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.showRequisitesPage=!0,this.requestCreated=!1,this.requestIDFromURL=!1,this.flowName="ClientCertificate",this.showTermsDialog=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.userId?this.setInitialData(this.userId):this.loading=null,"pro"!=q.N.env&&(Y(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),Y(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){}setInitialData(e){var t=this;return(0,A.Z)((function*(){const n=yield t.getFlow(e);if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},!t.data.config||!t.data.config.funder_id)return t.notis.showAlert("Error!","No se ha configurado la customización del widget para este usuario","error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,A.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}sendPreRequest(){this.certificateService.preRequest({user_id:this.userId,package_id:this.packId}).then((e=>{e&&e.data&&(this.requestID=e.data.request_id),this.loading=!1})).catch((e=>{console.error(e),this.loading=!1}))}setParamsToRequest(e){this.requestIDFromURL=!0,this.solicitud||(this.solicitud={status_code:"form"}),e.document&&!this.solicitud.person_document_number&&(this.solicitud.person_document_number=e.document),e.birthday&&!this.solicitud.birth_date&&(this.solicitud.birth_date=e.birthday),e.expiration&&!this.solicitud.document_expiration_date&&(this.solicitud.document_expiration_date=e.expiration),e.type&&!this.solicitud.person_type&&(this.solicitud.person_type=e.type),e.phone&&!this.solicitud.phone&&(this.solicitud.phone=e.phone),e.email&&!this.solicitud.email&&(this.solicitud.email=e.email),e.cif&&!this.solicitud.cif&&(this.solicitud.cif=e.cif),e.razon&&!this.solicitud.razon_social&&(this.solicitud.razon_social=e.razon),e.name&&!this.solicitud.person_name&&(this.solicitud.person_name=e.name),e.lastname&&!this.solicitud.person_last_name&&(this.solicitud.person_last_name=e.lastname),e.second_lastname&&!this.solicitud.person_last_name2&&(this.solicitud.person_last_name2=e.second_lastname)}sendMessageToParent(e){window.top.postMessage(e,"*")}validateRequestIdInUrl(){const e=this;this.Activatedroute.queryParams.subscribe((t=>{t&&this.setParamsToRequest(t),t&&t.acceptTerms&&(this.autoAcceptTerms=!0),t&&t.request_id?(this.disableURL=!1,e.requestID=t.request_id,this.setFormFromVcCode(t.request_id)):(e.sendPreRequest(),console.error("con paramas"))}),(e=>{this.loading=!1,console.error("sin paramas")}))}setFormFromVcCode(e){var t=this;return(0,A.Z)((function*(){t.loading="Obteniendo datos de la solicitud...",t.solicitudesService.getSolicitudByCode(e).then((e=>{e&&e.data?(t.solicitud=e.data,t.pdfFile64=t.solicitud.file,t.setSubscriptionOfRequest(),t.loading=!1,t.skipCreationOfRequest=!0,t.autoAcceptTerms&&t.acceptTerms(!0)):t.loading=!1})).catch((e=>{t.loading=!1}))}))()}setSubscriptionOfRequest(){const e=this;if(e.socket)return;let t="wss://notifications.dev.belender.net";"qa"==q.N.env&&(t="wss://notifications.qa.belender.net"),"pro"==q.N.env&&(t="wss://notifications.belender.net"),q.N.notificationsBaseUrl&&(t=q.N.notificationsBaseUrl),this.socket=new WebSocket(`${t}?requests_id=${e.requestID}&user_id=${e.userId}`),this.socket.onopen=function(n){console.log("Conexión establecida: ",`${t}?requests_id=${e.requestID}&user_id=${e.userId}`)},this.socket.onmessage=function(t){let n=JSON.parse(t.data);console.warn("message from ws:",n),e.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}handlePusherNotification(e){this.dataFromFirebase=e,this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,this.sendMessageToParent({type:"websocket",data:e}),"invalid_otp_seguridad_social"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),"terms_and_conditions"!=this.solicitud.status_code&&setTimeout((()=>{this.loading=!1,this.cd.markForCheck()}),500))}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}sendNewData(e){this.loading="Enviando información..",this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e),this.loading=!1):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse("Validando nuevos datos, espere por favor.."),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}showAlert(e,t){this.loading=!1,this.notis.showAlert(e,t)}sendFormData(e){this.requestID&&(e.request_id=this.requestID),e.user_id=this.userId,e.package_id=this.packId,e.validation_id=0;const t=new FormData;let n=Object.keys(e);for(const i of n)t.append(i,e[i]);this.loading="Subiendo documentación...",this.addRequest(t).then((e=>{e&&e.length&&this.setSubscriptionOfRequest(),this.loading=null})).catch((e=>{console.error("promise error: ",e),this.loading=null}))}uploadFiles(e){return new Promise(((t,n)=>{this.certificateService.addSignedFile(e).then((e=>{e&&e.status&&"error"==e.status?(e.message&&(this.showAlert("Error!",400==e.code&&"Does not have Known client service"==e.message?"El usuario no tiene servicio PIN habilitado!":400==e.code&&"Incorrect date"==e.message?"Fecha incorrecta!":e.message),n(e.message)),n(e),this.loading=null,this.cd.markForCheck()):e&&e.status&&"success"==e.status?t(!0):(this.showAlert("Error!","Error desconocido: "+e),n(e),this.loading=null,this.cd.markForCheck())})).catch((e=>{n(e),e&&e.errorMessage&&this.showAlert("Error!",e.errorMessage),this.loading=null,this.cd.markForCheck()}))}))}addRequest(e){return new Promise(((t,n)=>{this.certificateService.addSolicitud(e).then((e=>{e&&e.status&&"error"==e.status?(e.message&&(this.showAlert("Error!",400==e.code&&"Does not have Known client service"==e.message?"El usuario no tiene servicio PIN habilitado!":400==e.code&&"Incorrect date"==e.message?"Fecha incorrecta!":e.message),n(e.message)),this.loading=null,this.cd.markForCheck(),n(e)):e&&e.status&&"success"==e.status?(this.solicitud=e.data,this.setSubscriptionOfRequest(),this.loading=null,this.cd.markForCheck(),t(e.data)):(this.showAlert("Error!","Error desconocido: "+e),n(e))})).catch((e=>{console.error("respuesta desde pin service: ",e),e&&e.errorMessage&&this.showAlert("Error!",e.errorMessage),this.loading=null,this.cd.markForCheck(),n(e)}))}))}acceptTerms(e){this.loading="Iniciando el proceso de emisión de certificado..";let t={request_id:this.solicitud.request_id,terms_and_conditions_service:!0,terms_and_conditions_certificate_emition:!0};(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e?1:0),this.certificateService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?this.showAlert("Error!",e.message?e.message:e):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}sendPassword(e){this.loading="Enviando información..",this.certificateService.sendPassword({request_id:this.solicitud.request_id,password:e}).then((e=>{e.status&&"error"==e.status?this.showAlert("Error!",e.message?e.message:e):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.pdfFile64=e.file,this.cd.markForCheck()),this.loading=null})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}sendDocument(e){e.request_id=this.requestID;const t=new FormData;let n=Object.keys(e);for(const i of n)t.append(i,e[i]);this.loading="Subiendo documentación...",this.uploadFiles(t).then((e=>{e&&(this.solicitud.status_code="consent_process_completed")})).catch((e=>{console.error(e)}))}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}requestOTP(e){let t={otp:e.code,request_id:this.solicitud.request_id};this.loading="Enviando código OTP ..",this.certificateService.sendOtp(t).then((e=>{e.status&&"error"==e.status?this.showAlert("Error!",e.message?e.message:e):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.cd.markForCheck()),this.loading=!1})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}askToBack(){this.solicitudesService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.requestCreated=!0,this.requestIDFromURL=!0,this.solicitud=e.data,this.loading=!1):this.loading=!1})).catch((e=>{this.loading=!1}))}gotoErrorPhone(){}setRequestStatus(e){this.solicitud.status_code=e}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading="Reintentando enviar la solicitud...",this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}newRequest(e){this.solicitud.status_code="created"}disconnectWebsocket(){console.log("intentando desconectar ws..."),this.socket&&this.socket.close()}getStatus(){return!this.solicitud||this.solicitud&&("created"==this.solicitud.status_code||"form"==this.solicitud.status_code)?"form":this.solicitud&&"terms_and_conditions"==this.solicitud.status_code?"terms":this.solicitud&&"waiting_acceptance_file_signed"==this.solicitud.status_code?(console.log("returning autofirma"),"autofirma"):!this.solicitud||"waiting_login_seguridad_social"!=this.solicitud.status_code&&"saved_otp"!=this.solicitud.status_code?!this.solicitud||"waiting_otp_seguridad_social"!=this.solicitud.status_code&&"waiting_otp"!=this.solicitud.status_code&&"invalid_otp_seguridad_social"!=this.solicitud.status_code?!this.solicitud||"waiting_password"!=this.solicitud.status_code&&"approved_terms_digital_power"!=this.solicitud.status_code&&"declined_terms_digital_power"!=this.solicitud.status_code?!this.solicitud||"abandoned_after_bad_phone"!=this.solicitud.status_code&&"abandoned_after_invalid_otp_seguridad_social"!=this.solicitud.status_code&&"abandoned_after_terms_and_conditions"!=this.solicitud.status_code&&"abandoned_after_waiting_otp_seguridad_social"!=this.solicitud.status_code?!this.solicitud||"all_documents_downloaded"!=this.solicitud.status_code&&"partial_documents_downloaded"!=this.solicitud.status_code&&"consent_process_completed"!=this.solicitud.status_code&&"waiting_certificate"!=this.solicitud.status_code&&"waiting_documents"!=this.solicitud.status_code?!this.solicitud||"bad_phone"!=this.solicitud.status_code&&"phone_not_exist_otp"!=this.solicitud.status_code?!this.solicitud||"failed_with_retry"!=this.solicitud.status_code&&"failed_without_retry"!=this.solicitud.status_code&&"failed_documents_downloaded"!=this.solicitud.status_code?this.solicitud&&"no_service"==this.solicitud.status_code?"no-service":"no-exist":"failed":"error-data":(this.disconnectWebsocket(),this.data.config&&this.data.config.infiniteLoopInCompleted?"loading":"success"):"abandoned":"password":"otp":(this.loading="Estamos procesando su solicitud. Espere un momento por favor","loading")}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1}gotoTermsAndConditionsCertificate(){this.dialog.open(R.v,{panelClass:"fullscreen-dialog",data:{flow:"certificate"}})}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}};Tt.ɵfac=function(e){return new(e||Tt)(F.Y36(F.sBO),F.Y36(L.gz),F.Y36(Z.F),F.Y36(_.M),F.Y36(C.w),F.Y36(U.r),F.Y36(M.T),F.Y36(z),F.Y36(B.uw))},Tt.ɵcmp=F.Xpm({type:Tt,selectors:[["belender-widget-client-cert"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[F._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:4,vars:4,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","requestStatus","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px]",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"data","flowName","loading","requestIDFromURL","texts","solicitud","gotoPowerConditions","nextStep",4,"ngIf"],[3,"data","loading","texts","nextStep",4,"ngIf"],[3,"userId","requestID","data","texts","solicitud","loading","goToTerms","gotoPowerConditions","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","loading","texts","solicitud","nextStep",4,"ngIf"],[3,"data","pdfFile64","loading","texts","solicitud","nextStep",4,"ngIf"],[3,"data","loading","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","packId","userId","requestID","loading","texts",4,"ngIf"],[3,"data","loading","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","loading","texts","retry",4,"ngIf"],[3,"loading","texts","data",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"data","flowName","loading","requestIDFromURL","texts","solicitud","gotoPowerConditions","nextStep"],[3,"data","loading","texts","nextStep"],[3,"userId","requestID","data","texts","solicitud","loading","goToTerms","gotoPowerConditions","goToTermsCertificate","nextStep"],[3,"data","loading","texts","solicitud","nextStep"],[3,"data","pdfFile64","loading","texts","solicitud","nextStep"],[3,"data","loading","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","packId","userId","requestID","loading","texts"],[3,"data","loading","texts","solicitud","retry","newRequest"],[3,"solicitud","data","loading","texts","retry"],[3,"loading","texts","data"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","requestStatus","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(F.YNc(0,st,1,3,"vex-power-cert",0),F.YNc(1,xt,8,11,"div",1),F.YNc(2,Ct,1,2,"vex-terms",2),F.YNc(3,kt,3,1,"ng-container",3)),2&e&&(F.Q6J("ngIf",t.viewPowerTerms),F.xp6(1),F.Q6J("ngIf",t.data),F.xp6(1),F.Q6J("ngIf",t.showTermsDialog),F.xp6(1),F.Q6J("ngIf",t.testMode))},dependencies:[i.O5,u.lW,v.Ou,J.L,V.q,Q.L,oe,ue,me,Ce,ke,Te,Ne,We,nt,it],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),Tt=(0,E.gn)([(0,N.c)()],Tt);const Mt=[{path:":idUser",component:Tt},{path:":idUser/:packID",component:Tt}];let St=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=F.oAB({type:e}),e.ɵinj=F.cJS({imports:[L.Bz.forChild(Mt),L.Bz,P.d8]}),e})();var It=n(6981),Ot=n(3848),Lt=n(1129),Pt=n(969),At=n(7009);let Et=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=F.oAB({type:e}),e.ɵinj=F.cJS({imports:[i.ez,At.ZX,d.Ps,p.UX,x.c,u.ot]}),e})();var Dt=n(1145),Nt=n(2266),Yt=n(3300),qt=n(865),Rt=n(3033),Ft=n(3295);let Zt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=F.oAB({type:e}),e.ɵinj=F.cJS({providers:[_.M,y.o,C.w,w.t,M.T,O.t,z,{provide:T.Ad,useValue:"es-ES"}],imports:[St,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,v.Cq,k.FA,T.XK,S.T5,I.Fk,It.x,Ot.Nh,c.p9,Lt.n,Pt.O,Et,Dt.j,Nt.L,Yt.C,qt.q,Rt.d,Ft.g]}),e})()}}]),(self.webpackChunkvex=self.webpackChunkvex||[]).push([[244],{667:(e,t,n)=>{n.d(t,{$:()=>s});var i=n(7340);const s=(r=400,(0,i.X$)("fadeInUp",[(0,i.eR)(":enter",[(0,i.oB)({transform:"translateY(20px)",opacity:0}),(0,i.jt)(`${r}ms cubic-bezier(0.35, 0, 0.25, 1)`,(0,i.oB)({transform:"translateY(0)",opacity:1}))])]));var r},5592:(e,t,n)=>{n.d(t,{J:()=>a});var i=n(6895),s=n(9299),r=n(7392),o=n(4650);let a=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({imports:[i.ez,s.Bz,r.Ps]}),e})()},1763:(e,t,n)=>{n.d(t,{b:()=>c});var i=n(4650),s=n(6895),r=n(7392);function o(e,t){1&e&&i._UZ(0,"mat-icon",3)}const a=function(e,t){return{background:e,"border-color":t}},l=["*"];let c=(()=>{class e{constructor(){this.text="",this.color="rgb(14, 197, 151)",this.ccb=new i.vpe,this.checked=!1}ngOnInit(){}emitChange(){this.checked=!this.checked,this.ccb.emit(this.checked)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-checkbox"]],inputs:{text:"text",color:"color",checked:"checked"},outputs:{ccb:"changeCheckbox"},ngContentSelectors:l,decls:5,vars:5,consts:[[1,"flex","items-start","gap-2","justify-start","w-fit","hover:bg-slate-700/10","py-2","rounded-sm","cursor-pointer",3,"click"],[1,"check-wrapper","w-5","h-5","border","mr-1","rounded-sm","flex","justify-center","items-center","p-0",3,"ngStyle"],["style","font-size: 5px","class","m-0 p-0 text-white","svgIcon","mat:check",4,"ngIf"],["svgIcon","mat:check",1,"m-0","p-0","text-white",2,"font-size","5px"]],template:function(e,t){1&e&&(i.F$t(),i.TgZ(0,"div",0),i.NdJ("click",(function(){return t.emitChange()})),i.TgZ(1,"div",1),i.YNc(2,o,1,0,"mat-icon",2),i.qZA(),i.TgZ(3,"div"),i.Hsn(4),i.qZA()()),2&e&&(i.xp6(1),i.Q6J("ngStyle",i.WLB(2,a,t.checked?t.color:"transparent",t.checked?t.color:"rgba(0,0,0,.7)")),i.xp6(1),i.Q6J("ngIf",t.checked))},dependencies:[s.O5,s.PC,r.Hw],styles:[".check-wrapper[_ngcontent-%COMP%]{transition:all .3s ease;min-width:1.25rem}"]}),e})()},1129:(e,t,n)=>{n.d(t,{n:()=>c});var i=n(6895),s=n(4006),r=n(9549),o=n(9101),a=n(7392),l=n(4650);let c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=l.oAB({type:e}),e.ɵinj=l.cJS({imports:[i.ez,s.u5,s.UX,r.lN,o.ot,a.Ps]}),e})()},8008:(e,t,n)=>{n.d(t,{O:()=>o});var i=n(4650),s=n(6895);function r(e,t){if(1&e&&(i.O4$(),i.kcU(),i.TgZ(0,"p",4),i._uU(1),i.qZA()),2&e){const e=i.oxw();i.xp6(1),i.Oqu(e.text)}}let o=(()=>{class e{constructor(){this.text="",this.color="rgb(14, 197, 151)",this.zoom=1}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-spinner"]],inputs:{text:"text",color:"color",zoom:"zoom"},decls:4,vars:7,consts:[[1,"flex","w-full","justify-center","items-center","flex-col","gap-4"],["width","65px","height","65px","viewBox","0 0 66 66","xmlns","http://www.w3.org/2000/svg",1,"spinner"],["fill","none","stroke-width","6","stroke-linecap","round","cx","33","cy","33","r","30",1,"path"],["class","text-center",4,"ngIf"],[1,"text-center"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0),i.O4$(),i.TgZ(1,"svg",1),i._UZ(2,"circle",2),i.qZA(),i.YNc(3,r,2,1,"p",3),i.qZA()),2&e&&(i.xp6(1),i.Jzz("zoom: ",t.zoom,"; "),i.xp6(1),i.Jzz("stroke: ",t.color,""),i.xp6(1),i.Q6J("ngIf",t.text))},dependencies:[s.O5],styles:[".spinner[_ngcontent-%COMP%]{animation:rotator 1.4s linear infinite}@keyframes rotator{0%{transform:rotate(0)}to{transform:rotate(270deg)}}.path[_ngcontent-%COMP%]{stroke-dasharray:187;stroke-dashoffset:0;transform-origin:center;animation:dash 1.4s ease-in-out infinite}@keyframes dash{0%{stroke-dashoffset:187}50%{stroke-dashoffset:46.75;transform:rotate(135deg)}to{stroke-dashoffset:187;transform:rotate(450deg)}}"]}),e})()},9476:(e,t,n)=>{n.d(t,{F:()=>c});var i=n(6895),s=n(4006),r=n(9549),o=n(9101),a=n(7392),l=n(4650);let c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=l.oAB({type:e}),e.ɵinj=l.cJS({imports:[i.ez,s.u5,s.UX,r.lN,o.ot,a.Ps]}),e})()},833:(e,t,n)=>{n.d(t,{L:()=>d});var i=n(4650),s=n(9299),r=n(7367),o=n(8460),a=n(6895),l=n(9101);function c(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",5)(1,"button",6),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.accept())})),i._uU(2,"Cerrar"),i.qZA()()}if(2&e){const e=i.oxw();i.xp6(1),i.Udp("color",e.funderStyles.colors.btnText)("background",e.funderStyles.colors.btnBg)("border-radius",e.funderStyles.btnRound+"px")}}let d=(()=>{class e{constructor(e,t,n){this.Activatedroute=e,this.customizationService=t,this.customizationStoreService=n,this.loading=!0,this.hideButtons=!0,this.acceptTerms=new i.vpe(null),this.cancelTerms=new i.vpe(null)}ngOnInit(){this.loading=!0,this.userId&&this.flow?(this.userID=this.userId,this.flowName=this.flow,this.customizationStoreService.getFunderStyles().subscribe((e=>{this.funderStyles=e})),this.customizationService.getCustomizationByFlow(this.userID,this.flowName).then((e=>{this.flowConfig=e,this.terms_and_conditions=this.flowConfig&&this.flowConfig.terms_and_conditions?this.flowConfig.terms_and_conditions:`\n <div class="px-10 py-6 rounded-md text-center bg-orange-500/20 text-orange-600">\n <p>No hay términos y condiciones para el flujo <b>${this.flowName}</b></p> \n </div>`,this.loading=!1})).catch((e=>{this.loading=!1}))):this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userID=e.idUser,this.flowName=this.getParsedFlowName(e.flow),this.userID?this.customizationService.getCustomizationByFlow(this.userID,this.flowName).then((e=>{this.flowConfig=e,this.terms_and_conditions=this.flowConfig&&this.flowConfig.terms_and_conditions?this.flowConfig.terms_and_conditions:'\n <div class="px-10 py-6 rounded-md text-center bg-orange-500/20 text-orange-600">\n <p>No hay términos y condiciones para este flujo</p> \n </div>',this.loading=!1})).catch((e=>{this.loading=!1})):this.loading=!1):this.loading=!1}),(e=>{this.loading=!1}))}getParsedFlowName(e){switch(e){case"sms":case"Sms":return"SMS";case"clavepin":case"ClavePin":case"CLAVEPIN":return"ClavePin";case"videoid":return"VideoID";case"personal":case"presencial":case"client-cert":return"KnownClient";default:return e}}accept(){this.acceptTerms.emit(!0)}cancel(){this.cancelTerms.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.gz),i.Y36(r.w),i.Y36(o.r))},e.ɵcmp=i.Xpm({type:e,selectors:[["vex-power-cert"]],inputs:{flow:"flow",userId:"userId",hideButtons:"hideButtons"},outputs:{acceptTerms:"accept",cancelTerms:"cancel"},decls:33,vars:1,consts:[[1,"py-12","flex","flex-col","items-center","overflow-auto","max-h-[96vh]","terms-page"],[1,"max-w-xl","overflow-y-auto"],[1,"font-bold"],[1,"pt-6","font-bold"],["class","w-full max-w-xl flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"w-full","max-w-xl","flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0)(1,"div",1)(2,"h1",2),i._uU(3,"HOJA DE ACEPTACIÓN DE CERTIFICADO ELECTRONICO CUALIFICADO RÉGIMEN OBLIGATORIO DE USO DEL CERTIFICADO ELECTRONICO: “CERTIFICADO DE PERSONA FÍSICA REPRESENTANTE DE EMPRESA EMITIDO EN SOFTWARE”"),i.qZA(),i.TgZ(4,"p"),i._uU(5," a) Que existen unas condiciones generales del servicio incorporadas en el texto de divulgación del certificado o PDS, y una declaración de prácticas de certificación, que regulan la emisión y utilización del certificado electrónico emitido porvinCAsign, cuyo texto íntegro se puede consultar en la dirección de Internet, https://policy.vincasign.net. "),i.qZA(),i.TgZ(6,"p"),i._uU(7," b) Que el certificado electrónico emitido y el resto de los elementos que forman parte de la identificación electrónica son únicos para cada usuario. El certificado debe ser protegido por un código secreto (PIN), que sólo conoce el titular y que le será entregado en el momento de la emisión del certificado. Para utilizar el certificado es imprescindible conocer este código. "),i.qZA(),i.TgZ(8,"p"),i._uU(9," c) Que este certificado permite al titular del certificado generar firmas electrónicas e identificarse de forma electrónica en aquellos sistemas de información que soporten este tipo de autenticación. "),i.qZA(),i.TgZ(10,"p"),i._uU(11," d) Que el FIRMANTE debe custodiar, de forma diligente, el PIN que permite utilizarlo, para evitar que otras personas puedan suplantar su identidad y firmar documentos en su nombre, o acceder a mensajes confidenciales o sistemas de información de acceso restringido. "),i.qZA(),i.TgZ(12,"p"),i._uU(13," e) Que, si el FIRMANTE detecta cualquier indicio de que su identificación electrónica ha podido ser utilizada por otras personas, tendrá que suspender el uso del certificado y notificarlo inmediatamente al responsable del servicio de certificación del SUSCRIPTOR, o a vinCAsign, para pedir la revocación del certificado y, en su caso, la emisión de uno nuevo. "),i.qZA(),i.TgZ(14,"p"),i._uU(15," f) Que ante cualquier necesidad de información adicional, respecto de la utilización de los certificados emitidos en nombre de vinCAsign, el FIRMANTE se podrá dirigir al SUSCRIPTOR, al responsable del servicio de certificación del SUSCRIPTOR, y/o a VINTEGRIS. "),i.qZA(),i.TgZ(16,"p"),i._uU(17," g) Que con el fin de obtener los correspondientes certificados, y dentro del marco del Reglamento (UE) 2016/679 del Parlamento Europeo y del Consejo de 27 de abril de 2016 relativo a la protección de las personas físicas en lo que respecta al tratamiento de datos personales y a la libre circulación de estos datos y por el que se deroga la Directiva 95/46/CE (Reglamento general de protección de datos), el SUSCRIPTOR ha comunicado a vinCAsign los datos identificativos del FIRMANTE con el fin de emitir y gestionar el certificado corporativo de persona física emitido en software, en el ámbito de la relación de trabajo entre dicho FIRMANTE y el SUSCRIPTOR, todo ello a los efectos de lo previsto en el artículo 28 del Reglamento general de protección de datos. "),i.qZA(),i.TgZ(18,"p"),i._uU(19," h) Que sabe que, en cumplimiento de lo establecido en los artículos 24.2 y 28 del Reglamento (UE) 910/2014 del Parlamento Europeo y del Consejo de 23 de julio de 2014, los datos contenidos en el certificado corporativo de persona física emitido en software están publicados en la página web de vinCAsign a efectos del Registro de Certificados y de las listas de revocación, toda vez que ha prestado su consentimiento durante el proceso de solicitud. "),i.qZA(),i.TgZ(20,"h1",3),i._uU(21," ACTO DE ACEPTACIÓN DEL CERTIFICADO ELECTRÓNICO "),i.qZA(),i.TgZ(22,"p"),i._uU(23," Firmo el presente documento para dejar constancia: "),i.qZA(),i.TgZ(24,"p"),i._uU(25," Que ha sido informado del contenido del texto de divulgación del certificado o PDS, en el que se incluyen las condiciones generales del servicio aplicable al certificado corporativo de persona física emitido en software. "),i.qZA(),i.TgZ(26,"p"),i._uU(27," Que ha sido informado del régimen obligatorio de uso del certificado emitido, sus condiciones de uso y sus responsabilidades. "),i.qZA(),i.TgZ(28,"p"),i._uU(29," Que ha sido informado de las circunstancias relativas al tratamiento de sus datos personales para la correcta emisión y gestión del certificado que se emite. "),i.qZA(),i.TgZ(30,"p"),i._uU(31," Firma de conformidad, en virtud de la cual ha leído y entiende las obligaciones y responsabilidades que asume. "),i.qZA()(),i.YNc(32,c,3,6,"div",4),i.qZA()),2&e&&(i.xp6(32),i.Q6J("ngIf",t.funderStyles&&!t.hideButtons))},dependencies:[a.O5,l.lW],styles:["h1[_ngcontent-%COMP%]{font-size:20px!important;font-weight:700}h2[_ngcontent-%COMP%]{font-size:20px!important;font-weight:700;line-height:25px;margin:15px 0}p[_ngcontent-%COMP%]{margin:10px 0}.terms-page[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100vw;background:white;z-index:9999999!important;height:100vh;max-height:100vh}"]}),e})()},2266:(e,t,n)=>{n.d(t,{L:()=>g});var i=n(9299),s=n(833),r=n(6e3),o=n(4650);const a=[{path:":flow",component:s.L},{path:":flow/:idUser",component:s.L}];let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({imports:[i.Bz.forChild(a),i.Bz,r.d8]}),e})();var c=n(7533),d=n(1572),u=n(7367),h=n(6383),p=n(6895),m=n(4006),f=n(9101);let g=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({providers:[u.w],imports:[l,c.q,d.Cq,h.G,p.ez,m.u5,f.ot]}),e})()},1145:(e,t,n)=>{n.d(t,{j:()=>l});var i=n(4650),s=n(6895);let r=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=i.oAB({type:e}),e.ɵinj=i.cJS({imports:[[s.ez]]}),e})();var o=n(7392),a=n(4006);let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=i.oAB({type:e}),e.ɵinj=i.cJS({imports:[s.ez,a.u5,r,o.Ps]}),e})()},4302:(e,t,n)=>{n.d(t,{q:()=>a});var i=n(7582),s=n(9933),r=n(667),o=n(4650);let a=class{constructor(){}};a.ɵfac=function(e){return new(e||a)},a.ɵcmp=o.Xpm({type:a,selectors:[["belender-disabled-url"]],decls:6,vars:1,consts:[[1,"p-2","w-full","flex","justify-start","flex-wrap"],[1,"py-4","px-6","w-full","rounded-md","bg-red-500/10","text-red-600","flex","flex-col","gap-3"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0)(1,"div",1)(2,"h2"),o._uU(3,"Servicio desactivado"),o.qZA(),o.TgZ(4,"p"),o._uU(5,"El servicio que intenta acceder está desactivado. "),o.qZA()()()),2&e&&o.Q6J("@fadeInUp",void 0)},data:{animation:[r.$]}}),a=(0,i.gn)([(0,s.c)()],a)},3300:(e,t,n)=>{n.d(t,{C:()=>o});var i=n(6895),s=n(4006),r=n(4650);let o=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=r.oAB({type:e}),e.ɵinj=r.cJS({imports:[i.ez,s.u5]}),e})()},342:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(2340),s=n(4650),r=n(4006),o=n(5089),a=n(5601),l=n(9617),c=n(6895),d=n(7392),u=n(1572);function h(e,t){if(1&e&&(s.TgZ(0,"span",11),s._uU(1),s._UZ(2,"mat-progress-spinner",12),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij(" ",e.document_name," ")}}function p(e,t){if(1&e&&(s.TgZ(0,"span",13),s._uU(1),s._UZ(2,"mat-icon",14),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij(" ",e.document_name," ")}}function m(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span",15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,n=s.MAs(5);return s.oxw().setDocumentName(t.document_name),s.KtG(n.click())})),s._uU(1),s._UZ(2,"mat-icon",16),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij(" ",e.document_name," ")}}function f(e,t){if(1&e){const e=s.EpF();s.ynx(0),s.YNc(1,h,3,1,"span",6),s.YNc(2,p,3,1,"span",7),s.YNc(3,m,3,1,"span",8),s.TgZ(4,"input",9,10),s.NdJ("change",(function(t){s.CHM(e);const n=s.oxw();return s.KtG(n.fileChange(t))})),s.qZA(),s.BQk()}if(2&e){const e=t.$implicit,n=s.oxw();s.xp6(1),s.Q6J("ngIf",!e.document_status_code),s.xp6(1),s.Q6J("ngIf",e.document_status_code&&"downloaded"===e.document_status_code&&!n.loadingDocs),s.xp6(1),s.Q6J("ngIf",e.document_status_code&&"failed_download"===e.document_status_code&&!n.loadingDocs),s.xp6(1),s.Q6J("accept",n.acceptFiles)}}let g=(()=>{class e{constructor(e,t,n,i,s){this.formBuilder=e,this.utils=t,this.solicitudesService=n,this.packsS=i,this.cd=s,this.totalDocuments=[],this.totalDownloaded=0,this.totalNotDownloaded=0,this.file=null,this.fileName="No se ha seleccionado ningun archivo",this.fileSize=0,this.acceptFiles="image/jpeg, image/jpg, application/pdf",this.loadingDocs=!0,this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.loadingDocs=!0,this.uploadForm=this.formBuilder.group({file:[""]}),this.setPacksAndDocuments(),this.initIntervalDocs()}initIntervalDocs(){this.intDocs=setInterval((()=>{this.setDocumentsFromPack()}),4e3)}setPacksAndDocuments(){this.packsS.getPacksByPackId(this.packId).then((e=>{this.totalDocuments=this.parseDocumentsFromPack(e.data.documents),this.setDocumentsFromPack()}))}setDocumentsFromPack(){this.solicitudesService.getDocumentsIds(this.requestID).then((e=>{e.data&&this.setDocumentsReports(e.data),this.loadingDocs=!1})).catch((()=>{this.loadingDocs=!1}))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==i.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==i.N.env&&(e="wss://notifications.belender.net"),i.N.notificationsBaseUrl&&(e=i.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),n&&t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}handlePusherNotification(e){this.totalDocuments&&this.totalDocuments.forEach((t=>{t.document_name===e.document_name&&(t.document_status_code=e.document_status_code)})),this.cd.markForCheck()}parseDocumentsFromPack(e){let t=[];return e&&e.length&&e.forEach((e=>{t.push({document_name:e,document_status_code:null})})),t}setDocumentsReports(e){e&&e.length&&e.forEach((e=>{this.totalDocuments.forEach((t=>{t.document_name===e.document_name&&(t.document_status_code=e.document_status_code)}))})),this.checkIfAllReported(),this.cd.markForCheck()}checkIfAllReported(){this.totalDocuments.find((e=>!e.document_status_code||"downloaded"!=e.document_status_code))||this.intDocs&&clearInterval(this.intDocs)}fileChange(e){e.preventDefault(),e.stopPropagation();let t=e.target.files[0];const n=new FormData;n.append("file",t),n.append("request_id",this.requestID),n.append("document_name",this.docName),this.loadingDocs=!0,this.solicitudesService.uploadFileFromWidget(n).then((e=>{console.log("success"),this.setPacksAndDocuments()})).catch((e=>{console.error(e),this.setPacksAndDocuments()}))}setDocumentName(e){this.docName=e}}return e.ɵfac=function(t){return new(t||e)(s.Y36(r.qu),s.Y36(o.F),s.Y36(a.M),s.Y36(l.U),s.Y36(s.sBO))},e.ɵcmp=s.Xpm({type:e,selectors:[["widget-documents"]],inputs:{packId:"packId",requestID:"requestID",userId:"userId",acceptFiles:"acceptFiles"},decls:7,vars:1,consts:[[1,"px-4","py-3","bg-slate-300/10","rounded-md"],[1,"w-full","flex","mb-4","justify-between","items-center"],[1,"text-xl","font-bold"],[1,"flex","justify-end","items-center"],[1,"flex","gap-1","flex-wrap","items-start","justify-start","w-full","flex-col"],[4,"ngFor","ngForOf"],["class","bg-black/10 items-center w-full h-8 gap-2 pr-4 pl-3 py-1 rounded-sm flex text-xs justify-between",4,"ngIf"],["class","bg-green-500/10 items-center text-green-500 w-full justify-between border border-green-500 gap-2 h-8 font-bold pr-4 pl-3 py-1 rounded-sm flex text-xs ",4,"ngIf"],["class","bg-red-500/10 items-center text-red-500 border border-red-500 gap-2 h-8 font-bold pr-4 pl-3 py-1 rounded-sm flex text-xs justify-between w-full cursor-pointer hover:bg-red-500 hover:text-red-50",3,"click",4,"ngIf"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"bg-black/10","items-center","w-full","h-8","gap-2","pr-4","pl-3","py-1","rounded-sm","flex","text-xs","justify-between"],["color","accent","diameter","12","value","0","mode","indeterminate",1,"spinner"],[1,"bg-green-500/10","items-center","text-green-500","w-full","justify-between","border","border-green-500","gap-2","h-8","font-bold","pr-4","pl-3","py-1","rounded-sm","flex","text-xs"],["svgIcon","mat:check",1,"w-4"],[1,"bg-red-500/10","items-center","text-red-500","border","border-red-500","gap-2","h-8","font-bold","pr-4","pl-3","py-1","rounded-sm","flex","text-xs","justify-between","w-full","cursor-pointer","hover:bg-red-500","hover:text-red-50",3,"click"],["svgIcon","mat:upload",1,"w-4"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0)(1,"div",1)(2,"p",2),s._uU(3,"Documentos: "),s.qZA(),s._UZ(4,"div",3),s.qZA(),s.TgZ(5,"div",4),s.YNc(6,f,6,4,"ng-container",5),s.qZA()()),2&e&&(s.xp6(6),s.Q6J("ngForOf",t.totalDocuments))},dependencies:[c.sg,c.O5,d.Hw,u.Ou]}),e})()},3033:(e,t,n)=>{n.d(t,{d:()=>l});var i=n(6895),s=n(4006),r=n(7392),o=n(1572),a=n(4650);let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=a.oAB({type:e}),e.ɵinj=a.cJS({imports:[i.ez,r.Ps,s.UX,o.Cq]}),e})()},1406:(e,t,n)=>{n.d(t,{Y:()=>a});var i=n(4650),s=n(4006),r=n(9549),o=n(9101);let a=(()=>{class e{constructor(e){this.formBuilder=e,this.file=null,this.fileName="No se ha seleccionado ningun archivo",this.acceptFiles="image/png, image/jpeg, image/jpg, .pdf",this.newItemEvent=new i.vpe(null),this.uploadFile=new i.vpe(null),this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.uploadForm=this.formBuilder.group({file:[""]})}fileChange(e){this.uploadForm.patchValue({file:e.target.files[0]}),this.uploadForm.get("file").updateValueAndValidity();const t=new FormData;let n=this.uploadForm.get("file").value;this.fileName=n.name,this.fileSize=+(+n.size/1e3).toFixed(1),t.append("file",n),console.warn(this.uploadForm.get("file").value),this.newItemEvent.emit({file:t}),this.uploadFile.emit(n)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.qu))},e.ɵcmp=i.Xpm({type:e,selectors:[["app-file-upload"]],inputs:{label:"label",acceptFiles:"acceptFiles"},outputs:{newItemEvent:"change",uploadFile:"fileUpload"},decls:11,vars:5,consts:[[1,"flex","flex-col","w-full","items-start","input-file-wrapper","my-1",3,"formGroup"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"flex","items-center","justify-start","mt-3"],["mat-flat-button","","color","accent",1,"btn-file",3,"click"]],template:function(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",0)(1,"mat-label"),i._uU(2),i.qZA(),i.TgZ(3,"input",1,2),i.NdJ("change",(function(e){return t.fileChange(e)})),i.qZA(),i.TgZ(5,"div",3)(6,"button",4),i.NdJ("click",(function(){i.CHM(e);const t=i.MAs(4);return i.KtG(t.click())})),i._uU(7,"Seleccionar archivo"),i.qZA(),i._uU(8,"     "),i.TgZ(9,"span"),i._uU(10),i.qZA()()()}2&e&&(i.Q6J("formGroup",t.uploadForm),i.xp6(2),i.Oqu(t.label),i.xp6(1),i.Q6J("accept",t.acceptFiles),i.xp6(7),i.AsE("",t.fileName," ",t.fileSize?"("+t.fileSize+"Kb)":"",""))},dependencies:[s._Y,s.JL,s.sg,r.hX,o.lW],styles:["button[aria-pressed=true][_ngcontent-%COMP%]{color:red!important}.btn-file[_ngcontent-%COMP%]{max-width:200px}.input-file-wrapper[_ngcontent-%COMP%]{background:rgba(0,0,0,.0117647059);padding:.7rem .5rem .7rem 1rem;border-radius:5px;border:2px dashed rgba(0,0,0,.1)}"]}),e})()},969:(e,t,n)=>{n.d(t,{O:()=>d});var i=n(6895),s=n(4006),r=n(9101),o=n(7392),a=n(4144),l=n(7009),c=n(4650);let d=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=c.oAB({type:e}),e.ɵinj=c.cJS({imports:[i.ez,l.ZX,o.Ps,s.UX,a.c,r.ot]}),e})()},4246:(e,t,n)=>{n.d(t,{t:()=>s});var i=n(4650);let s=(()=>{class e{constructor(){this.DNI_REGEX=/^(\d{8})([A-Z])$/,this.CIF_REGEX=/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/,this.NIE_REGEX=/^[XYZ]\d{7,8}[A-Z]$/}convertObjectArrayToArray(e){return Object.keys(e).map((t=>{const n=e[t];return n.key=t,n}))}ValidateIDType(e){e=e.toUpperCase().replace(/\s/,"");var t=!1,n=this.spainIdType(e);switch(n){case"dni":t=this.validDNI(e);break;case"nie":t=this.validNIE(e)}return{type:n,valid:t}}spainIdType(e){return e.match(this.DNI_REGEX)?"dni":e.match(this.NIE_REGEX)?"nie":void 0}validDNI(e){return"TRWAGMYFPDXBNJZSQVHLCKE".charAt(parseInt(e,10)%23)==e.charAt(8)}validNIE(e){var t=e.charAt(0);switch(t){case"X":t=0;break;case"Y":t=1;break;case"Z":t=2}return this.validDNI(t+e.substr(1))}}return e.ɵfac=function(t){return new(t||e)},e.ɵprov=i.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},3364:(e,t,n)=>{n.d(t,{R:()=>l});var i=n(4650),s=(n(6866),n(5089)),r=n(9299),o=n(9101),a=n(3731);let l=(()=>{class e{constructor(e,t){this.utils=e,this.Activatedroute=t,this.goFlow=new i.vpe(null),this.goManual=new i.vpe(null)}ngOnInit(){console.error("data: ",this.data)}gotoFlow(){this.goFlow.emit(!0)}gotoManual(){this.goManual.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.F),i.Y36(r.gz))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-intro-step"]],inputs:{data:"data",solicitud:"solicitud",flowName:"flowName"},outputs:{goFlow:"gotoFlow",goManual:"gotoManual"},decls:10,vars:18,consts:[[1,"flex","flex-col","justify-between","h-full","fixed-content"],[1,"flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-2"],["mat-flat-button","","type","button",1,"px-8","bg-slate-100","hover:bg-slate-200","text-slate-900",3,"click"],["mat-flat-button","","type","button",1,"px-8","hover:opacity-90",3,"click"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0)(1,"div",1),i._UZ(2,"div",2)(3,"div",3),i.ALo(4,"safeHtml"),i.qZA(),i.TgZ(5,"div",4)(6,"button",5),i.NdJ("click",(function(){return t.gotoManual()})),i._uU(7,"Subida manual"),i.qZA(),i.TgZ(8,"button",6),i.NdJ("click",(function(){return t.gotoFlow()})),i._uU(9,"Subida automatica"),i.qZA()()()),2&e&&(i.xp6(2),i.Udp("color",t.data.styles.colors.title)("font-size",t.data.intro?t.data.intro.titleSize+"px":"30px"),i.Q6J("innerHTML",t.data.intro?t.data.intro.title:"Intro de descripción",i.oJD),i.xp6(1),i.Udp("color",t.data.styles.colors.text),i.Q6J("innerHTML",t.data.intro?t.data.intro.description:i.lcZ(4,16,"Descripcion de la intro"),i.oJD),i.xp6(3),i.Udp("border-radius",t.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[o.lW,a.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})()},8962:(e,t,n)=>{n.d(t,{A:()=>k});var i=n(6895),s=n(9101),r=n(1561),o=n(4006),a=n(5601),l=n(3798),c=n(9391),d=n(1572),u=n(182),h=n(4144),p=n(7367),m=n(9602),f=n(3238),g=n(5895),_=n(6257),b=n(1948),y=n(4246),v=n(6981),w=n(1129),x=n(9476),C=n(4650);let k=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=C.oAB({type:e}),e.ɵinj=C.cJS({providers:[a.M,c.o,p.w,u.t,g.T,y.t],imports:[i.ez,s.ot,r.Tx,h.c,o.u5,o.UX,l.a,d.Cq,m.FA,f.XK,_.T5,b.Fk,v.x,w.n,x.F]}),e})()},1760:(e,t,n)=>{n.d(t,{u:()=>x});var i=n(4650),s=(n(6866),n(4006)),r=n(5089),o=n(9391),a=n(9299),l=n(9617),c=n(5895),d=n(6895),u=n(9101),h=n(9549),p=n(4144),m=n(8008),f=n(1406),g=n(3731);function _(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",1)(1,"div",2),i._UZ(2,"div",3)(3,"div",4),i.ALo(4,"safeHtml"),i.qZA(),i.TgZ(5,"div",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),i._uU(9,"DNI / NIE"),i.qZA(),i._UZ(10,"input",8),i.qZA()()(),i.TgZ(11,"div",9)(12,"button",10),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.goBack())})),i._uU(13," Volver "),i.qZA(),i.TgZ(14,"button",11),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.gotoStep2())})),i._uU(15," Siguiente "),i.qZA()()()}if(2&e){const e=i.oxw();i.Q6J("formGroup",e.formDni),i.xp6(2),i.Udp("color",e.data.styles.colors.title)("font-size",e.data.Manual?e.data.Manual.titleSize+"px":"30px"),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.title:"Manual de descripción",i.oJD),i.xp6(1),i.Udp("color",e.data.styles.colors.text),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.description:i.lcZ(4,18,"Descripcion de la subida manual"),i.oJD),i.xp6(9),i.Udp("border-radius",e.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",e.formDni.invalid?"":e.data.styles.colors.btnText)("background",e.formDni.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),i.Q6J("disabled",e.formDni.invalid)}}function b(e,t){if(1&e){const e=i.EpF();i.ynx(0),i.TgZ(1,"app-file-upload",15),i.NdJ("fileUpload",(function(t){const n=i.CHM(e).$implicit,s=i.oxw(3);return i.KtG(s.setFile(n,t))})),i.qZA(),i.BQk()}if(2&e){const e=t.$implicit;i.xp6(1),i.s9C("label",e)}}function y(e,t){if(1&e&&(i.TgZ(0,"div",5),i.YNc(1,b,2,1,"ng-container",14),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.Q6J("ngForOf",e.pack.documents)}}function v(e,t){1&e&&(i.TgZ(0,"div",16),i._UZ(1,"belender-spinner",17),i.qZA()),2&e&&(i.xp6(1),i.Q6J("zoom",.6))}function w(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",1)(1,"div",2),i._UZ(2,"div",3)(3,"div",4),i.ALo(4,"safeHtml"),i.qZA(),i.YNc(5,y,2,1,"div",12),i.YNc(6,v,2,1,"div",13),i.TgZ(7,"div",9)(8,"button",10),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.goBack())})),i._uU(9," Volver "),i.qZA(),i.TgZ(10,"button",11),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.uploadFiles())})),i._uU(11," Subir archivos "),i.qZA()()()}if(2&e){const e=i.oxw();i.Q6J("formGroup",e.form),i.xp6(2),i.Udp("color",e.data.styles.colors.title)("font-size",e.data.Manual?e.data.Manual.titleSize+"px":"30px"),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.title:"Manual de descripción",i.oJD),i.xp6(1),i.Udp("color",e.data.styles.colors.text),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.description:i.lcZ(4,20,"Descripcion de la subida manual"),i.oJD),i.xp6(2),i.Q6J("ngIf",e.pack&&!e.loadingPack),i.xp6(1),i.Q6J("ngIf",e.loadingPack),i.xp6(2),i.Udp("border-radius",e.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),i.Q6J("disabled",e.form.invalid)}}let x=(()=>{class e{constructor(e,t,n,s,r,o){this.fb=e,this.utils=t,this.attachmentsS=n,this.ar=s,this.packsS=r,this.notis=o,this.upload=new i.vpe(null),this.back=new i.vpe(null),this.sendDNI=new i.vpe(null),this.loadingPack=!1,this.step=1}ngOnInit(){this.form=this.fb.group({}),console.warn("data: ",this.data),this.loadingPack=!0,this.packsS.getPackagesByUserID(this.userId).then((e=>{console.warn(e),e&&e.data?this.setPack(e.data):this.loadingPack=!1})).catch((e=>{console.error(e),this.loadingPack=!1})),this.formDni=this.fb.group({dni:[null,[s.kI.required,s.kI.maxLength(9)]]}),console.error(this.solicitud),this.solicitud&&this.solicitud.request_id&&(this.step=2)}setRequestStep(){}gotoStep2(){this.sendDNI.emit(this.formDni.get("dni").value)}setPack(e){this.pack=e.find((e=>e.id==this.packId)),this.loadingPack=!1,this.setForm()}setForm(){this.pack&&this.pack.documents&&this.pack.documents.forEach((e=>{this.form.addControl(e,new s.NI("",s.kI.required))}))}uploadFiles(){this.upload.emit(!0)}goBack(){this.back.emit(!0)}fileChange(e){e.preventDefault(),e.stopPropagation()}setFile(e,t){const n=new FormData;n.append("file",t),n.append("request_id",this.solicitud.request_id),n.append("document_name",e),this.notis.showToast("Subiendo documento: "+e,6e3,"info"),this.attachmentsS.uploadFile(n).then((n=>{n&&n.status&&"error"!=n.status?(this.form.get(e).setValue(t),this.notis.showToast("Documento "+e+" subido correctamente",4e3,"success")):n&&n.status&&"error"==n.status&&this.notis.showToast("El documento "+e+" no se ha podido subir: "+n.message,4e3,"error")})).catch((t=>{console.error(t),this.notis.showToast("El documento "+e+" no se ha podido subir: "+t,4e3,"error")}))}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.QS),i.Y36(r.F),i.Y36(o.o),i.Y36(a.gz),i.Y36(l.U),i.Y36(c.T))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-manual-step"]],inputs:{data:"data",solicitud:"solicitud",flowName:"flowName",packId:"packId",userId:"userId"},outputs:{upload:"uploadFiles",back:"goBack",sendDNI:"dniChange"},decls:2,vars:2,consts:[["class","flex flex-col justify-between h-full fixed-content",3,"formGroup",4,"ngIf"],[1,"flex","flex-col","justify-between","h-full","fixed-content",3,"formGroup"],[1,"flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"py-4"],[1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["maxlength","9","formControlName","dni","type","text","placeholder","Ingresa tu DNI o NIE","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-2"],["mat-flat-button","","type","button",1,"px-8","bg-slate-100","hover:bg-slate-200","text-slate-900",3,"click"],["mat-flat-button","","type","button",1,"px-8","hover:opacity-90",3,"disabled","click"],["class","py-4",4,"ngIf"],["class","py-10 px-4",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"label","fileUpload"],[1,"py-10","px-4"],["text","Cargando documentos",3,"zoom"]],template:function(e,t){1&e&&(i.YNc(0,_,16,20,"form",0),i.YNc(1,w,12,22,"form",0)),2&e&&(i.Q6J("ngIf",1==t.step),i.xp6(1),i.Q6J("ngIf",2==t.step))},dependencies:[d.sg,d.O5,u.lW,h.KE,h.hX,p.Nt,s._Y,s.Fj,s.JJ,s.JL,s.nD,s.sg,s.u,m.O,f.Y,g.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})()},3468:(e,t,n)=>{n.d(t,{f:()=>T});var i=n(6895),s=n(9101),r=n(1561),o=n(4006),a=n(5601),l=n(3798),c=n(9391),d=n(1572),u=n(182),h=n(4144),p=n(7367),m=n(9602),f=n(3238),g=n(5895),_=n(6257),b=n(1948),y=n(4246),v=n(6981),w=n(1129),x=n(9476),C=n(969),k=n(4650);let T=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=k.oAB({type:e}),e.ɵinj=k.cJS({providers:[a.M,c.o,p.w,u.t,g.T,y.t],imports:[i.ez,s.ot,r.Tx,h.c,o.u5,o.UX,l.a,d.Cq,m.FA,f.XK,_.T5,b.Fk,v.x,w.n,x.F,C.O]}),e})()},8526:(e,t,n)=>{n.r(t),n.d(t,{PersonalModule:()=>pt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),y=n(9391),v=n(1572),w=n(182),x=n(4144),C=n(7367),k=n(9602),T=n(3238),M=n(5895),S=n(6257),I=n(1948),O=n(4246),L=n(9299),P=n(6e3),A=n(5861),E=n(7582),D=n(9549),N=n(9933),Y=n(5762),q=n(8259),R=n(2340),F=n(1363),Z=n(4650),U=n(5089),H=n(8460),j=n(529),z=n(6554);let B=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(R.N.baseUrl+"/requests/known-client",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}addFiles(e){return new Promise(((t,n)=>{this.localFetch.postFile(R.N.baseUrl+"/requests/known-client/upload-files",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/known-client/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOtp(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/known-client/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/known-client/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}preRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/pre-request/known-client",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let i="/requests/known-client/otp";R.N.scraperMock&&(i="/mockscrapper/requests/known-client/otp"),this.localFetch.postFetchWhitoutToken(R.N.baseUrl+i,e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(Z.LFG(U.F),Z.LFG(j.eN),Z.LFG(z.r))},e.ɵprov=Z.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var J=n(5412),V=n(6830),Q=n(833),W=n(4302),G=n(3731);function $(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij("¿No has recibido el código? Solicítalo de nuevo en ",e.secsCount," segundos")}}function K(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.AsE("¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? Solicítalo de nuevo en ",e.secsCount," segundos")}}function X(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij("¿No has recibido el código en tu teléfono? Solicítalo de nuevo en ",e.secsCount," segundos")}}const ee=function(e,t,n){return{color:e,border:t,background:n}};function te(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"small",11),Z.YNc(2,$,2,1,"span",5),Z.YNc(3,K,2,2,"span",5),Z.YNc(4,X,2,1,"span",5),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(4,ee,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&e.data.config.noRetryInBadPhone)}}function ne(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1," ¿No has recibido el código en tu teléfono? "),Z.qZA())}function ie(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? ")}}function se(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1," ¿No has recibido el código en el teléfono? "),Z.qZA())}const re=function(e,t){return{color:e,background:t}};function oe(e,t){if(1&e){const e=Z.EpF();Z.ynx(0),Z.TgZ(1,"small",11),Z.YNc(2,ne,2,0,"span",5),Z.YNc(3,ie,2,1,"span",5),Z.YNc(4,se,2,0,"span",5),Z.TgZ(5,"a",12),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.resendOTP())})),Z._uU(6,"Reenviar"),Z.qZA()(),Z.BQk()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(5,ee,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngIf",e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngStyle",Z.WLB(9,re,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor))}}let ae=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new Z.vpe(null),this.errPhone=new Z.vpe(null),this.resendO=new Z.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,A.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?q(e.target).next().focus():"Backspace"==e.code&&q(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:16,vars:20,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.TgZ(5,"div",4),Z.YNc(6,te,5,8,"ng-container",5),Z.YNc(7,oe,7,12,"ng-container",5),Z.qZA(),Z.TgZ(8,"div",6)(9,"mat-form-field",7)(10,"mat-label"),Z._uU(11," Código OTP "),Z.qZA(),Z.TgZ(12,"input",8),Z.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),Z.qZA()()()(),Z.TgZ(13,"div",9)(14,"button",10),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(15,"Siguiente"),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.otp.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,18,t.texts.otp.description||""),Z.oJD),Z.xp6(3),Z.Q6J("ngIf",t.secsCount&&t.secsCount>0),Z.xp6(1),Z.Q6J("ngIf",!t.secsCount||t.secsCount<=0),Z.xp6(7),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,i.PC,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function le(e,t){if(1&e&&(Z.TgZ(0,"div",1),Z._UZ(1,"div",2)(2,"div",3),Z.ALo(3,"safeHtml"),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),Z.Q6J("innerHTML",e.texts.success.title,Z.oJD),Z.xp6(1),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(3,8,e.texts.success.description||""),Z.oJD)}}let ce=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s}ngOnInit(){}save(){}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(y.o),Z.Y36(M.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts"},decls:1,vars:1,consts:[["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&Z.YNc(0,le,4,10,"div",0),2&e&&Z.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted)},dependencies:[i.O5,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function de(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",6),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.retry())})),Z._uU(2,"Intentarlo nuevamente"),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function ue(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.newRequest())})),Z._uU(2,"Crear nueva solicitud"),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}let he=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new Z.vpe(null),this.newReq=new Z.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(y.o),Z.Y36(M.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:7,vars:8,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.YNc(5,de,3,6,"div",4),Z.YNc(6,ue,3,6,"div",4),Z.qZA()),2&e&&(Z.xp6(2),Z.Q6J("innerHTML",t.texts.fail.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,6,t.texts.fail.description),Z.oJD),Z.xp6(2),Z.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),Z.xp6(1),Z.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var pe=n(1763),me=n(5696);const fe=["termsCheckbox"],ge=["termsCertCheckbox"],_e=["assignmentCheckbox"];function be(e,t){1&e&&(Z.TgZ(0,"div",15)(1,"mat-form-field",16)(2,"mat-label"),Z._uU(3,"Email"),Z.qZA(),Z._UZ(4,"input",17),Z.qZA()())}function ye(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",18)(1,"belender-checkbox",19,20),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setTerms(t))})),Z.TgZ(3,"belender-terms-and-policy-links",21),Z.NdJ("goToTerms",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.gotoTermsAndConditions(t))})),Z.qZA()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("userId",e.userId)("showPolicyLink",null==e.data?null:e.data.config.showPolicyLink)("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function ve(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",22)(1,"belender-checkbox",9),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setPower(t))})),Z._uU(2," Consiento expresamente a la activación de un poder digital según las condiciones que pueden verse "),Z.TgZ(3,"a",11),Z.NdJ("click",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.gotoPowerConditions(t))})),Z.TgZ(4,"u"),Z._uU(5,"aquí"),Z.qZA()()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title)}}function we(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",18)(1,"belender-checkbox",9,23),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setAssignment(t))})),Z._UZ(3,"div",24),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("innerHTML",null==e.data?null:e.data.config.dataAssignmentText,Z.oJD)}}function xe(e,t){1&e&&(Z.TgZ(0,"div",25),Z._UZ(1,"mat-icon",26),Z._uU(2," Debes leer los términos y condiciones para poder continuar "),Z.qZA())}const Ce={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let ke=(()=>{class e{constructor(e,t){this.utils=e,this.fb=t,this.requestID=null,this.next=new Z.vpe(null),this.goTerms=new Z.vpe(null),this.goTermsCert=new Z.vpe(null),this.goPower=new Z.vpe(null),this.acceptTerms=!1,this.acceptTerms2=!1,this.termsReaded=!1,this.terms2Readed=!1,this.step=0,this.assignment=!1,this.powerActivate=!1}ngOnInit(){this.setForm(this.solicitud?this.solicitud:null)}tabChanged(e){this.step=e,this.setForm(null)}setForm(e){let t=e?e.person_email||e.email:null;this.form=this.fb.group(this.data.config.followMail?{email:[t,[p.kI.required,p.kI.email]]}:{email:[t]})}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setTerms2Check(e){this.certCheckComponent.checked=e,this.acceptTerms2=e}setAssignmentCheck(e){this.assignmentCheckComponent.checked=e,this.assignment=e}setTerms(e){this.acceptTerms=e}setTerms2(e){this.acceptTerms2=e}setAssignment(e){this.assignment=e}nextStep(){let e={terms_and_conditions_service:this.acceptTerms,terms_and_conditions_certificate_emition:this.acceptTerms2,request_id:this.solicitud.request_id};this.data&&this.data.config&&this.data.config.followMail&&(e.email_copy=this.form.get("email").value),(this.data.config.activatePower||this.solicitud?.power_activate)&&(e.power_activate=!0,e.terms_and_conditions_power=this.powerActivate?1:0),this.next.emit(e)}gotoTermsAndConditions(e){this.termsReaded=!0,e.preventDefault(),e.stopPropagation(),this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(e){this.terms2Readed=!0,e.preventDefault(),e.stopPropagation(),this.goTermsCert.emit(!0)}getIfValid(){return!((this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&!this.powerActivate)&&this.getAssignmentValidation()}getAssignmentValidation(){return!!(!this.data.config.forceChecks||this.termsReaded&&this.terms2Readed)&&(this.data.config.hideCheckLegal&&(this.acceptTerms=!0),this.data.config.dataAssignmentCheck?this.acceptTerms&&this.acceptTerms2&&this.assignment:this.acceptTerms&&this.acceptTerms2)}gotoPowerConditions(e){this.goPower.emit(!0)}setPower(e){this.powerActivate=e}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(U.F),Z.Y36(p.QS))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(Z.Gf(fe,5),Z.Gf(ge,5),Z.Gf(_e,5)),2&e){let e;Z.iGM(e=Z.CRH())&&(t.checkComponent=e.first),Z.iGM(e=Z.CRH())&&(t.certCheckComponent=e.first),Z.iGM(e=Z.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{userId:"userId",flowName:"flowName",requestID:"requestID",data:"data",texts:"texts",solicitud:"solicitud",acceptTerms:"acceptTerms",acceptTerms2:"acceptTerms2",termsReaded:"termsReaded",terms2Readed:"terms2Readed"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",goPower:"goToPower"},features:[Z._Bn([{provide:T.sG,useValue:Ce},{provide:Z.soG,useValue:"es-ES"}])],decls:22,vars:24,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","w-full",4,"ngIf"],["class","mt-6 flex justify-start items-center w-full flex-100",4,"ngIf"],["class","flex justify-between items-center w-full flex-100",4,"ngIf"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["termsCertCheckbox",""],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","email","type","email","placeholder","Ingresa tu email","matInput",""],[1,"mt-6","flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","showPolicyLink","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],[1,"flex","justify-between","items-center","w-full","flex-100"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.TgZ(5,"div",4),Z.YNc(6,be,5,0,"div",5),Z.YNc(7,ye,4,9,"div",6),Z.YNc(8,ve,6,1,"div",7),Z.TgZ(9,"div",8)(10,"belender-checkbox",9,10),Z.NdJ("changeCheckbox",(function(e){return t.setTerms2(e)})),Z._uU(12," He leído y acepto los "),Z.TgZ(13,"a",11),Z.NdJ("click",(function(e){return t.gotoTermsAndConditionsCertificate(e)})),Z.TgZ(14,"u"),Z._uU(15,"términos y condiciones"),Z.qZA()(),Z._uU(16," para la emisión del certificado "),Z.qZA()(),Z.YNc(17,we,4,2,"div",6),Z.YNc(18,xe,3,0,"div",12),Z.qZA(),Z.TgZ(19,"div",13)(20,"button",14),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(21," Siguiente "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.form.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,22,t.texts.form.description||""),Z.oJD),Z.xp6(3),Z.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.followMail),Z.xp6(1),Z.Q6J("ngIf",!t.data.config.hideCheckLegal),Z.xp6(1),Z.Q6J("ngIf",t.requestID?null==t.solicitud?null:t.solicitud.power_activate:null==t.data?null:t.data.config.activatePower),Z.xp6(2),Z.Q6J("color",t.data.styles.colors.title),Z.xp6(7),Z.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),Z.xp6(1),Z.Q6J("ngIf",t.data.config.forceChecks&&(!t.termsReaded||!t.terms2Readed)),Z.xp6(2),Z.Udp("color",t.form.invalid||!t.getIfValid()?"":t.data.styles.colors.btnText)("background",t.form.invalid||!t.getIfValid()?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid||!t.getIfValid()))},dependencies:[i.O5,d.Hw,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,pe.b,me.T,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Te=n(5145);let Me=(()=>{class e{constructor(e){this.utils=e,this.status="",this.label="Cargando datos.."}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":Te.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)}))}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(U.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"mat-progress-spinner"),Z.TgZ(3,"p"),Z._uU(4),Z.qZA()()()),2&e&&(Z.xp6(4),Z.Oqu(t.label))},dependencies:[v.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Se=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA()()),2&e&&(Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.noService.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,8,t.texts.noService.description),Z.oJD))},dependencies:[p._Y,p.JL,p.F,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Ie=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new Z.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return"Abandonado después de esperar OTP de Seguridad Social";case"abandoned_after_invalid_otp_seguridad_social":return"Abandonado despues de OTP inválido en Seguridad Social";case"abandoned_after_invalid_otp_aeat":return"Abandonado despues de OTP inválido en AEAT";case"abandoned_after_waiting_otp_aeat":return"Abandonado después de esperar OTP de AEAT";default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(y.o),Z.Y36(M.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:10,vars:17,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.TgZ(5,"div",4),Z._uU(6),Z.qZA()(),Z.TgZ(7,"div",5)(8,"button",6),Z.NdJ("click",(function(){return t.retry()})),Z._uU(9,"Intentarlo nuevamente"),Z.qZA()()()),2&e&&(Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.abandoned.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,15,t.texts.abandoned.description),Z.oJD),Z.xp6(3),Z.hij(" ",t.getTextStatus()," "),Z.xp6(2),Z.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Oe(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function Le(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña es requerida "),Z.qZA())}function Pe(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña debe tener al menos 8 carácteres "),Z.qZA())}function Ae(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," Es necesario repetir la contraseña "),Z.qZA())}function Ee(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," Las contraseñas deben coincidir "),Z.qZA())}function De(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña debe tener al menos 8 carácteres "),Z.qZA())}const Ne={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Ye=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.form=new p.cw({}),this.next=new Z.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Oe("password","confirm_password")})}nextStep(){let e={set_password_certificate:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.qu),Z.Y36(U.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep"},features:[Z._Bn([{provide:T.sG,useValue:Ne},{provide:Z.soG,useValue:"es-ES"}])],decls:22,vars:23,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.TgZ(5,"div",4)(6,"mat-form-field",5)(7,"mat-label"),Z._uU(8,"Contraseña"),Z.qZA(),Z._UZ(9,"input",6),Z.YNc(10,Le,2,0,"mat-hint",7),Z.YNc(11,Pe,2,0,"mat-hint",7),Z.qZA(),Z.TgZ(12,"mat-form-field",8)(13,"mat-label"),Z._uU(14,"Repite Contraseña"),Z.qZA(),Z._UZ(15,"input",9),Z.YNc(16,Ae,2,0,"mat-hint",7),Z.YNc(17,Ee,2,0,"mat-hint",7),Z.YNc(18,De,2,0,"mat-hint",7),Z.qZA()(),Z.TgZ(19,"div",10)(20,"button",11),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(21," Guardar "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.password.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,21,t.texts.password.description),Z.oJD),Z.xp6(7),Z.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),Z.xp6(5),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.confirmedValidator),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.invalid&&t.f.confirm_password.errors.minlength),Z.xp6(2),Z.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,u.lW,D.KE,D.bx,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const qe=["formStep"];function Re(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-power-cert",4),Z.NdJ("accept",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.acceptPowerCert())})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("hideButtons",!1)("flow","KnownClient")("userId",e.userId)}}function Fe(e,t){if(1&e&&(Z.TgZ(0,"div",9),Z._UZ(1,"img",10),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("src",e.data.styles.logoUrl,Z.LSH)}}function Ze(e,t){if(1&e&&Z._UZ(0,"belender-loading-step",20),2&e){const e=Z.oxw(3);Z.Q6J("status",null==e.solicitud?null:e.solicitud.status_code)("data",e.data)}}function Ue(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-form-step",21,22),Z.NdJ("goToTerms",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.gotoTermsAndConditions())}))("goToPower",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.gotoPassword(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("userId",e.userId)("requestID",e.requestID)("data",e.data)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function He(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-password-step",23),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.sendPassword(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function je(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-otp-step",24),Z.NdJ("resendOTP",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.resendOTP(t))}))("errorPhone",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.requestOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function ze(e,t){if(1&e&&Z._UZ(0,"belender-success-step",25),2&e){const e=Z.oxw(3);Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Be(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-fail-step",26),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.retryRequest(t))}))("newRequest",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.newRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Je(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-abandoned-step",27),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.retryRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("solicitud",e.solicitud)("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Ve(e,t){if(1&e&&Z._UZ(0,"belender-no-service-step",28),2&e){const e=Z.oxw(3);Z.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)}}function Qe(e,t){if(1&e&&(Z.TgZ(0,"div",29)(1,"div",30)(2,"h1",31),Z._uU(3,"No existe la solicitud"),Z.qZA()(),Z.TgZ(4,"div",32),Z._uU(5,"No existen solicitudes activas con el código requerido"),Z.qZA()()),2&e){const e=Z.oxw(3);Z.xp6(4),Z.Udp("color",e.data.styles.colors.text)}}function We(e,t){if(1&e&&(Z.ynx(0),Z.YNc(1,Ze,1,2,"belender-loading-step",11),Z.YNc(2,Ue,2,6,"belender-form-step",12),Z.YNc(3,He,1,3,"belender-password-step",13),Z.YNc(4,je,1,3,"belender-otp-step",14),Z.YNc(5,ze,1,2,"belender-success-step",15),Z.YNc(6,Be,1,3,"belender-fail-step",16),Z.YNc(7,Je,1,3,"belender-abandoned-step",17),Z.YNc(8,Ve,1,2,"belender-no-service-step",18),Z.YNc(9,Qe,6,2,"div",19),Z.BQk()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("ngIf","loading"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","form"==e.getStatus()&&!e.loading),Z.xp6(1),Z.Q6J("ngIf","password"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","otp"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","success"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","failed"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","abandoned"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","no-service"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","no-exist"==e.getStatus())}}function Ge(e,t){1&e&&Z._UZ(0,"belender-disabled-url")}function $e(e,t){if(1&e&&(Z.TgZ(0,"div",33),Z._UZ(1,"mat-progress-spinner",34),Z.TgZ(2,"p",35),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function Ke(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",36)(1,"div",29)(2,"div",37),Z._uU(3,"Error!"),Z.qZA(),Z._UZ(4,"div",38),Z.qZA(),Z.TgZ(5,"div",39)(6,"button",40),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw(2);return Z.KtG(t.error=!1)})),Z._uU(7,"Ingresar manualmente"),Z.qZA()()()}if(2&e){const e=Z.oxw(2);Z.xp6(4),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",e.error,Z.oJD)}}function Xe(e,t){if(1&e&&(Z.TgZ(0,"div",5)(1,"div"),Z.YNc(2,Fe,2,1,"div",6),Z.YNc(3,We,10,9,"ng-container",3),Z.YNc(4,Ge,1,0,"belender-disabled-url",3),Z.YNc(5,$e,4,3,"div",7),Z.YNc(6,Ke,8,3,"div",8),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.styles.withLogo&&"loading"!=e.getStatus()),Z.xp6(1),Z.Q6J("ngIf",!e.error&&!e.disableURL),Z.xp6(1),Z.Q6J("ngIf",!e.error&&e.disableURL),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error),Z.xp6(1),Z.Q6J("ngIf",!e.loading&&e.error)}}function et(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-terms",41),Z.NdJ("accepted",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!1))})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("flow","presencial")("requestStatus",e.solicitud?e.solicitud.status_code:"")}}function tt(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"div",42),Z._uU(2),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(2),Z.hij("TestMode ",e.testMode?"ON":"OFF","")}}let nt=class{constructor(e,t,n,i,s,r,o,a,l,c){this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.webhooksService=a,this.knownService=l,this.dialog=c,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.flowName="KnownClient",this.showTermsDialog=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.userId?this.setInitialData(this.userId):this.loading=null,"pro"!=R.N.env&&(q(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),q(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){}setInitialData(e){var t=this;return(0,A.Z)((function*(){const n=yield t.getFlow(e);if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},!t.data.config||!t.data.config.funder_id)return t.notis.showAlert("Error!","No se ha configurado la customización del widget para este usuario","error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,A.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}sendMessageToParent(e){window.top.postMessage(e,"*")}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):this.loading=!1}),(e=>{this.loading=!1}))}setFormFromVcCode(e){var t=this;return(0,A.Z)((function*(){t.loading="Obteniendo datos de la solicitud...",t.solicitudesService.getSolicitudByCode(e).then((e=>{console.warn("solicitud: ",e.data),e&&e.data?(t.solicitud=e.data,t.setSubscriptionOfRequest(),t.loading=!1,t.skipCreationOfRequest=t.solicitud&&t.solicitud.status_code&&"prerequest"!=t.solicitud.status_code,t.autoAcceptTerms&&t.gotoOTP()):t.loading=!1})).catch((e=>{t.loading=!1}))}))()}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==R.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==R.N.env&&(e="wss://notifications.belender.net"),R.N.notificationsBaseUrl&&(e=R.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),t.setSubscriptionOfRequestOld()},this.socket.onclose=function(e){console.log("Conexión cerrada"),t.setSubscriptionOfRequestOld()}}handlePusherNotification(e){this.dataFromFirebase=e,this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,this.sendMessageToParent({type:"websocket",data:e}),"invalid_otp"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),"terms_and_conditions"!=this.solicitud.status_code&&setTimeout((()=>{this.loading=!1,this.cd.markForCheck()}),500))}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}gotoTerms(e){this.loading="Enviando datos..",e.package_id=this.packId,e.user_id=this.userId,this.testMode?setTimeout((()=>{this.solicitud=new Y.l,this.solicitud.status_code="waiting_otp",this.loading=!1}),4e3):this.skipCreationOfRequest?(this.gotoOTP(),this.setSubscriptionOfRequest()):this.solicitudesService.addSolicitud(e,this.packId,this.userId).then((t=>{t&&t.status&&"error"==t.status?(this.solicitud=e,t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha de nacimiento incorrecta")):(this.solicitud.status_code="no_service",this.loading=!1):(this.solicitud.status_code="form",this.showAlert("Error!",t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,this.sendMessageToParent({type:"response",data:t.data||t}),this.gotoOTP()):this.showAlert("Error!","Error desconocido: "+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=!1})))}sendNewData(e){this.loading="Enviando información..",this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e),this.loading=!1):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse("Validando nuevos datos, espere por favor.."),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}showAlert(e,t){this.loading=!1,this.notis.showAlert(e,t)}gotoPassword(e){this.loading="Iniciando el proceso de emisión de certificado..";let t=e;(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e.terms_and_conditions_power),this.knownService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?(this.showAlert("Error!",e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((e=>{t&&t.error&&this.showAlert("Error!",t.error),this.loading=!1}))}gotoOTP(e){let t=e;t.request_id=this.requestID,t.user_id=this.userId,this.initWaitingForResponse("Iniciando el proceso de emisión de certificado.."),setTimeout((()=>{this.solicitud=new Y.l,this.loading=!1,this.solicitud.status_code="waiting_otp"}),2e3)}requestOTP(e){let t={otp:e.code,request_id:this.solicitud.request_id};this.loading="Enviando código OTP ..",this.knownService.sendOtp(t).then((e=>{e.status&&"error"==e.status?(this.showAlert("Error!",e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}sendPassword(e){let t={password:e.set_password_certificate,request_id:this.solicitud.request_id};this.loading="Enviando contraseña..",this.knownService.sendPassword(t).then((e=>{e.status&&"error"==e.status?(this.showAlert("Error!",e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((t=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.solicitudesService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=!1):this.loading=!1})).catch((e=>{this.loading=!1}))}gotoErrorPhone(){}setRequestStatus(e){this.solicitud.status_code=e}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading="Reintentando enviar la solicitud...",this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}newRequest(e){this.solicitud.status_code="created"}getStatus(){return!this.solicitud||this.solicitud&&("created"==this.solicitud.status_code||"form"==this.solicitud.status_code||"terms_and_conditions"==this.solicitud.status_code)?"form":!this.solicitud||"waiting_login"!=this.solicitud.status_code&&"saved_otp"!=this.solicitud.status_code?!this.solicitud||"waiting_otp"!=this.solicitud.status_code&&"invalid_otp"!=this.solicitud.status_code&&"waiting_otp_seguridad_social"!=this.solicitud.status_code&&"invalid_otp_seguridad_social"!=this.solicitud.status_code?!this.solicitud||"waiting_password"!=this.solicitud.status_code&&"approved_terms_digital_power"!=this.solicitud.status_code&&"declined_terms_digital_power"!=this.solicitud.status_code?!this.solicitud||"abandoned_after_bad_phone"!=this.solicitud.status_code&&"abandoned_after_invalid_otp"!=this.solicitud.status_code&&"abandoned_after_terms_and_conditions"!=this.solicitud.status_code&&"abandoned_after_waiting_otp"!=this.solicitud.status_code?!this.solicitud||"all_documents_downloaded"!=this.solicitud.status_code&&"certificate_created"!=this.solicitud.status_code&&"partial_documents_downloaded"!=this.solicitud.status_code&&"waiting_certificate"!=this.solicitud.status_code&&"consent_process_completed"!=this.solicitud.status_code&&"success_otp"!=this.solicitud.status_code&&"otp_success"!=this.solicitud.status_code&&"waiting_documents"!=this.solicitud.status_code?!this.solicitud||"bad_phone"!=this.solicitud.status_code&&"phone_not_exist_otp"!=this.solicitud.status_code?!this.solicitud||"failed_with_retry"!=this.solicitud.status_code&&"failed_without_retry"!=this.solicitud.status_code&&"failed_documents_downloaded"!=this.solicitud.status_code?this.solicitud&&"no_service"==this.solicitud.status_code?"no-service":"no-exist":"failed":this.data.config.noRetryInBadPhone?"otp":"error-data":this.data.config&&this.data.config.infiniteLoopInCompleted?"loading":"success":"abandoned":"password":"otp":(this.loading="Estamos procesando su solicitud. Espere un momento por favor","loading")}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,e&&this.formComponent.setTermsCheck(!0)}gotoTermsAndConditionsCertificate(){this.dialog.open(F.v,{panelClass:"fullscreen-dialog",data:{flow:"presencial"}}).afterClosed().subscribe((e=>{e&&this.formComponent.setTerms2Check(!0)}))}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}};nt.ɵfac=function(e){return new(e||nt)(Z.Y36(Z.sBO),Z.Y36(L.gz),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(C.w),Z.Y36(H.r),Z.Y36(M.T),Z.Y36(w.t),Z.Y36(B),Z.Y36(J.uw))},nt.ɵcmp=Z.Xpm({type:nt,selectors:[["belender-widget-personal"]],viewQuery:function(e,t){if(1&e&&Z.Gf(qe,5),2&e){let e;Z.iGM(e=Z.CRH())&&(t.formComponent=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[Z._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:4,vars:4,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","requestStatus","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[3,"status","data",4,"ngIf"],[3,"userId","requestID","data","flowName","texts","solicitud","goToTerms","goToPower","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","texts","solicitud","nextStep",4,"ngIf"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","texts",4,"ngIf"],[3,"data","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","texts","retry",4,"ngIf"],[3,"texts","data",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"status","data"],[3,"userId","requestID","data","flowName","texts","solicitud","goToTerms","goToPower","goToTermsCertificate","nextStep"],["formStep",""],[3,"data","texts","solicitud","nextStep"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","texts"],[3,"data","texts","solicitud","retry","newRequest"],[3,"solicitud","data","texts","retry"],[3,"texts","data"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","requestStatus","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(Z.YNc(0,Re,1,3,"vex-power-cert",0),Z.YNc(1,Xe,7,10,"div",1),Z.YNc(2,et,1,2,"vex-terms",2),Z.YNc(3,tt,3,1,"ng-container",3)),2&e&&(Z.Q6J("ngIf",t.viewPowerTerms),Z.xp6(1),Z.Q6J("ngIf",t.data),Z.xp6(1),Z.Q6J("ngIf",t.showTermsDialog),Z.xp6(1),Z.Q6J("ngIf",t.testMode))},dependencies:[i.O5,u.lW,v.Ou,V.L,Q.L,W.q,ae,ce,he,ke,Me,Se,Ie,Ye],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),nt=(0,E.gn)([(0,N.c)()],nt);const it=[{path:":idUser",component:nt},{path:":idUser/:packID",component:nt}];let st=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({imports:[L.Bz.forChild(it),L.Bz,P.d8]}),e})();var rt=n(6981),ot=n(3848),at=n(1129),lt=n(3295),ct=n(1258),dt=n(2266),ut=n(3300),ht=n(865);let pt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({providers:[_.M,y.o,C.w,w.t,M.T,O.t,B,{provide:T.Ad,useValue:"es-ES"}],imports:[st,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,v.Cq,k.FA,T.XK,S.T5,I.Fk,rt.x,ot.Nh,at.n,lt.g,ct.H,dt.L,ut.C,ht.q]}),e})()},920:(e,t,n)=>{n.d(t,{n:()=>wt});var i=n(5861),s=n(7582),r=n(9549),o=n(9933),a=n(5762),l=n(8259),c=n(2340),d=n(667),u=n(3842);const h={created:"form",form:"form",prerequest:"form",terms_and_conditions:"form",waiting_otp_seguridad_social:"otp_ss",waiting_login_seguridad_social:"otp_ss",invalid_otp_seguridad_social:"otp_ss",waiting_otp_carpeta_ciudadana:"otp_ss",waiting_login_carpeta_ciudadana:"otp_ss",invalid_otp_carpeta_ciudadana:"otp_ss",waiting_otp_aeat:"otp_aeat",waiting_login_aeat:"otp_aeat",invalid_otp_aeat:"otp_aeat",waiting_login_bde:"otp_bde",waiting_otp_bde:"otp_bde",invalid_otp_bde:"otp_bde",abandoned_after_bad_phone:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",abandoned_after_invalid_otp_aeat:"abandoned",abandoned_after_waiting_otp_aeat:"abandoned",abandoned_after_waiting_otp_bde:"abandoned",abandoned_after_invalid_otp_bde:"abandoned",abandond_after_waiting_otp_carpeta_ciudadana:"abandoned",abandond_after_invalid_otp_carpeta_ciudadana:"abandoned",all_documents_downloaded:"success",partial_documents_downloaded:"success",consent_process_completed:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",failed_with_retry:"failed",failed_without_retry:"failed",failed_documents_downloaded:"failed",consent_process_canceled:"failed",failed_job_task_cirbe:"failed",no_service:"no-service",no_clave_pin_service:"no-service",no_cirbe_cp_service:"no-service",no_sms_service:"no-service",stand_by:"standby","no-phone":"no-phone","no-more-phone":"no-phone",bad_phone:"bad-phone",error_expiration_date:"error-expiration-date",error_birth_date:"error-birth-date",error_support_number:"error-support-number",duplicated:"duplicated"};var p=n(1931),m=n(4650),f=n(9299),g=n(5089),_=n(7489),b=n(5895),y=n(182),v=n(5206),w=n(8460),x=n(9045),C=n(7367),k=n(5412),T=n(7308),M=n(3687),S=n(6895),I=n(6830),O=n(4302),L=n(9112),P=n(9382),A=n(7392),E=n(9101),D=n(1572),N=n(4006),Y=n(5601),q=n(9617),R=n(3046),F=n(342),Z=n(3731);function U(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",3),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.success.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function H(e,t){if(1&e&&m._UZ(0,"widget-documents",8),2&e){const e=m.oxw(2);m.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function j(e,t){if(1&e&&(m.TgZ(0,"div",4),m._UZ(1,"div",5)(2,"div",6),m.ALo(3,"safeHtml"),m.YNc(4,H,1,3,"widget-documents",7),m.qZA()),2&e){const e=m.oxw();m.xp6(1),m.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),m.Q6J("innerHTML",e.texts.success.title,m.oJD),m.xp6(1),m.Udp("color",e.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(3,9,e.texts.success.description||""),m.oJD),m.xp6(2),m.Q6J("ngIf",e.showDocuments)}}const z=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function B(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",9)(1,"button",10),m.NdJ("click",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.gotoRedirect())})),m._uU(2),m.qZA()()}if(2&e){const e=m.oxw();m.Q6J("ngClass",m.kEZ(8,z,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),m.xp6(1),m.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let J=(()=>{class e{constructor(e,t,n,i,s){this.formBuilder=e,this.utils=t,this.solicitudesService=n,this.packsS=i,this.cd=s,this.showDocuments=!1}ngOnInit(){this.uploadForm=this.formBuilder.group({file:[""]}),this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].automaticRedirectCallBack&&this.data[this.flowName].callBackUrl?setTimeout((()=>{location.assign(this.data[this.flowName].callBackUrl)}),2e3):this.data&&this.data[this.flowName]&&this.data[this.flowName].showDocumentsOnSuccess&&(this.showDocuments=!0)}save(){}gotoRedirect(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}getIfShowLogo(){return!this.data?.config?.infiniteLoopInCompleted&&this.data?.styles?.withLogo}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.qu),m.Y36(g.F),m.Y36(Y.M),m.Y36(q.U),m.Y36(m.sBO))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",packId:"packId",requestID:"requestID",userId:"userId",flowName:"flowName",labels:"labels"},decls:3,vars:3,consts:[[3,"firstOption","logoUrl",4,"ngIf"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],["class","flex items-center gap-2 py-4 flex-col md:flex-row",3,"ngClass",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID",4,"ngIf"],[3,"userId","packId","requestID"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(m.YNc(0,U,1,2,"belender-widget-logo",0),m.YNc(1,j,5,11,"div",1),m.YNc(2,B,3,12,"div",2)),2&e&&(m.Q6J("ngIf",t.getIfShowLogo()),m.xp6(1),m.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),m.xp6(1),m.Q6J("ngIf",t.data&&t.data[t.flowName]&&t.data[t.flowName].enableUrlCallBack&&!t.data[t.flowName].automaticRedirectCallBack))},dependencies:[S.mk,S.O5,R.X,F.A,E.lW,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var V=n(9391);function Q(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",7),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.fail.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const W=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function G(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",8)(1,"button",9),m.NdJ("click",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.retry())})),m._uU(2),m.qZA()()}if(2&e){const e=m.oxw();m.Q6J("ngClass",m.kEZ(8,W,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),m.xp6(1),m.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",null==e.labels||null==e.labels.actions?null:e.labels.actions.retry," ")}}function $(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",8)(1,"button",10),m.NdJ("click",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.newRequest())})),m._uU(2),m.qZA()()}if(2&e){const e=m.oxw();m.Q6J("ngClass",m.kEZ(8,W,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),m.xp6(1),m.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",null==e.labels||null==e.labels.actions?null:e.labels.actions.newRequest," ")}}let K=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryR=new m.vpe(null),this.newR=new m.vpe(null)}ngOnInit(){}save(){}retry(){this.retryR.emit(this.solicitud.request_id)}newRequest(){this.newR.emit(this.solicitud.request_id)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F),m.Y36(Y.M),m.Y36(V.o),m.Y36(b.T))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{retryR:"retryRequest",newR:"newRequest"},decls:8,vars:9,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"px-2","py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(m.YNc(0,Q,1,2,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2),m._UZ(3,"div",3)(4,"div",4),m.ALo(5,"safeHtml"),m.qZA(),m.YNc(6,G,3,12,"div",5),m.YNc(7,$,3,12,"div",6),m.qZA()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Q6J("innerHTML",t.texts.fail.title,m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(5,7,t.texts.fail.description),m.oJD),m.xp6(2),m.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),m.xp6(1),m.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[S.mk,S.O5,R.X,E.lW,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var X=n(3238),ee=n(5439),te=n.n(ee),ne=n(3755),ie=n(3746),se=n(2932),re=n(4246),oe=n(1763),ae=n(5696),le=n(1094),ce=n(4144);const de=["termsCheckbox"],ue=["assignmentCheckbox"];function he(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",17),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.form.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function pe(e,t){if(1&e&&(m.TgZ(0,"mat-error"),m._uU(1),m.qZA()),2&e){const e=m.oxw();m.xp6(1),m.hij(" ",e.labels.warnings.invalidNieOrDni," ")}}function me(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"mat-hint")(1,"a",19),m.NdJ("click",(function(t){m.CHM(e);const n=m.oxw(2);return m.KtG(n.gotoExpirationDate(t))})),m.TgZ(2,"u"),m._uU(3),m.qZA()()()}if(2&e){const e=m.oxw(2);m.xp6(3),m.Oqu(e.labels.findExpiration)}}function fe(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," El formato debe ser DD/MM/AAAA "),m.qZA())}function ge(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," Fecha inválida "),m.qZA())}function _e(e,t){if(1&e&&(m.TgZ(0,"mat-form-field",7)(1,"mat-label"),m._uU(2),m.qZA(),m._UZ(3,"input",18),m.YNc(4,me,4,1,"mat-hint",9),m.YNc(5,fe,2,0,"mat-error",9),m.YNc(6,ge,2,0,"mat-error",9),m.qZA()),2&e){const e=m.oxw();let t,n;m.Gre("",e.disabledInputs.expiration?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(e.labels.expiration),m.xp6(1),m.s9C("tabindex",e.disabledInputs.expiration?-1:1),m.xp6(1),m.Q6J("ngIf",e.isDni),m.xp6(1),m.Q6J("ngIf",null==(t=e.form.get("expired_date"))?null:t.hasError("invalidFormat")),m.xp6(1),m.Q6J("ngIf",null==(n=e.form.get("expired_date"))?null:n.hasError("invalidDate"))}}function be(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," El formato debe ser DD/MM/AAAA "),m.qZA())}function ye(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," Fecha inválida "),m.qZA())}function ve(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," Debe ser mayor de 18 años "),m.qZA())}function we(e,t){if(1&e&&(m.TgZ(0,"mat-form-field",7)(1,"mat-label"),m._uU(2),m.qZA(),m._UZ(3,"input",20),m.YNc(4,be,2,0,"mat-error",9),m.YNc(5,ye,2,0,"mat-error",9),m.YNc(6,ve,2,0,"mat-error",9),m.qZA()),2&e){const e=m.oxw();let t,n,i;m.Gre("",e.disabledInputs.birthday?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(e.labels.birthday),m.xp6(1),m.s9C("tabindex",e.disabledInputs.birthday?-1:1),m.xp6(1),m.Q6J("ngIf",null==(t=e.form.get("expired_date"))?null:t.hasError("invalidFormat")),m.xp6(1),m.Q6J("ngIf",null==(n=e.form.get("expired_date"))?null:n.hasError("invalidDate")),m.xp6(1),m.Q6J("ngIf",null==(i=e.form.get("expired_date"))?null:i.hasError("underAge"))}}function xe(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"mat-form-field",7)(1,"mat-label"),m._uU(2),m.qZA(),m._UZ(3,"input",21),m.TgZ(4,"mat-hint")(5,"a",19),m.NdJ("click",(function(t){m.CHM(e);const n=m.oxw();return m.KtG(n.gotoSupportAclaration(t))})),m.TgZ(6,"u"),m._uU(7),m.qZA()()()()}if(2&e){const e=m.oxw();m.Gre("",e.disabledInputs.supportNumber?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(e.labels.support),m.xp6(1),m.s9C("tabindex",e.disabledInputs.supportNumber?-1:1),m.xp6(4),m.Oqu(e.labels.findExpiration)}}function Ce(e,t){if(1&e&&(m.TgZ(0,"div",22)(1,"mat-form-field",7)(2,"mat-label"),m._uU(3),m.qZA(),m._UZ(4,"input",23),m.qZA()()),2&e){const e=m.oxw();m.xp6(1),m.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(e.labels.email),m.xp6(1),m.s9C("tabindex",e.disabledInputs.email?-1:1)}}function ke(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",24)(1,"belender-checkbox",25,26),m.NdJ("changeCheckbox",(function(t){m.CHM(e);const n=m.oxw();return m.KtG(n.setTerms(t))})),m.TgZ(3,"belender-terms-and-policy-links",27),m.NdJ("goToTerms",(function(t){m.CHM(e);const n=m.oxw();return m.KtG(n.gotoTermsAndConditions(t))})),m.qZA()()()}if(2&e){const e=m.oxw();m.xp6(1),m.Q6J("color",e.data.styles.colors.title),m.xp6(2),m.Q6J("userId",e.userId)("lang",e.lang)("flowName",e.flowName)("data",e.data)("showPolicyLink",null==e.data?null:e.data.config.showPolicyLink)("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Te(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",24)(1,"belender-checkbox",28,29),m.NdJ("changeCheckbox",(function(t){m.CHM(e);const n=m.oxw();return m.KtG(n.setAssignment(t))})),m._UZ(3,"div",30),m.qZA()()}if(2&e){const e=m.oxw();m.xp6(1),m.Q6J("color",e.data.styles.colors.title),m.xp6(2),m.Q6J("innerHTML",e.data[e.flowName]&&e.data[e.flowName].texts&&e.data[e.flowName].texts.dataAssignmentText?e.data[e.flowName].texts.dataAssignmentText:null==e.data?null:e.data.config.dataAssignmentText,m.oJD)}}function Me(e,t){if(1&e&&(m.TgZ(0,"div",31),m._UZ(1,"mat-icon",32),m._uU(2),m.qZA()),2&e){const e=m.oxw();m.xp6(2),m.hij(" ",e.labels.warnings.haveToReadTerms," ")}}function Se(e,t){if(1&e&&(m.TgZ(0,"div",33),m._UZ(1,"mat-icon",32),m._uU(2),m.qZA()),2&e){const e=m.oxw();m.xp6(2),m.hij(" ",e.errorDNI," ")}}const Ie=function(e){return{"dont-show-data":e}},Oe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}},Le={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Pe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.cd=n,this.widgetUtils=i,this.dialog=s,this.lang="",this.next=new m.vpe(null),this.esDNI=new m.vpe(null),this.goTerms=new m.vpe(null),this.acceptTerms=!1,this.step=0,this.assignment=!1,this.termsReaded=!1,this.isDni=!1,this.isNie=!1,this.disabledInputs={dni:!1,birthday:!1,supportNumber:!1,email:!1,expiration:!1},this.noValidate=!1}ngOnInit(){this.solicitud?(this.setBaseForm(this.solicitud),this.noValidate="terms_and_conditions"==this.solicitud.status_code):this.setBaseForm(null)}sendPestana(){window.parent.open("www.google.com","_blank")}setRegex(e){if(!e)return;let t=this.widgetUtils.ValidateIDType(e);t&&t.type?("dni"===t.type?(this.isDni=!0,this.errorDNI=t.valid?null:this.labels.warnings.invalidDni):this.isDni=!1,"nie"===t.type?(this.isNie=!0,this.errorDNI=t.valid?null:this.labels.warnings.invalidNie):this.isNie=!1):(this.isDni=!1,this.isNie=!1,this.errorDNI=this.labels.warnings.invalidNieOrDni),this.form?.get("expired_date").setValidators([(0,se.s)({checkFormat:!0,checkDate:!0,checkAge:!this.isDni})]),this.cd.markForCheck()}setBaseForm(e){let t=e?e.person_document_number||e.dni||e.document_number:null,n=e&&e.birth_date?te()(e.birth_date).format("DD/MM/YYYY"):null,i=e&&e.person_document_expiration_date?te()(e.person_document_expiration_date).format("DD/MM/YYYY"):null,s=e&&e.document_support?e.document_support:null,r=e&&e.person_birth_date?te()(e.person_birth_date).format("DD/MM/YYYY"):n,o=i,a=e?e.person_email||e.email||e.email_copy:null,l=e&&e.person_document_support?e.person_document_support:s;t&&this.setRegex(t),this.form=this.fb.group(this.isDni?this.data.config.followMail?{dni:[t,this.noValidate?[]:[N.kI.required,N.kI.maxLength(9),this.regexDNI()]],email:[a],document_type:["dni"],expired_date:[o,[(0,se.s)({checkFormat:!0,checkDate:!0})]],support_number:[null],person_phone:[]}:{dni:[t,this.noValidate?[]:[N.kI.required,N.kI.maxLength(9),this.regexDNI()]],document_type:["dni"],expired_date:[o,[(0,se.s)({checkFormat:!0,checkDate:!0})]],support_number:[null]}:this.data.config.followMail?{dni:[t,[N.kI.required,N.kI.maxLength(9),this.regexDNI()]],expired_date:[r],document_type:["nie"],support_number:[l],email:[a]}:{dni:[t,[N.kI.required,N.kI.maxLength(9),this.regexDNI()]],expired_date:[r],document_type:["nie"],support_number:[l]}),this.form.get("expired_date").setValidators([(0,se.s)({checkFormat:!0,checkDate:!0,checkAge:!this.isDni})]),this.form.markAsUntouched(),this.form.updateValueAndValidity(),this.requestIDFromURL&&this.disableEnableInputs(t,n||r,i,s||l,a)}forceEnableDisableInputs(e,t,n,i,s){let r=t?t.value:this.disabledInputs.birthday,o=i?i.value:this.disabledInputs.supportNumber;this.isNie&&r&&!r.value&&(o={value:!1}),this.disableEnableInputs(e?e.value:this.disabledInputs.dni,r,n?n.value:this.disabledInputs.expiration,o,s?s.value:this.disabledInputs.email)}disableEnableInputs(e,t,n,i,s){this.disabledInputs={dni:e||!1,birthday:t||!1,supportNumber:i||!1,email:!!s,expiration:n||!1},this.cd.markForCheck()}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}nextStep(){let e;this.isDni?(e={document_number:this.form.get("dni").value.toUpperCase(),check_legal:!0,document_expiration_date:this.utils.formatDate(this.form.get("expired_date").value)},this.solicitud.person_document_number=e.document_number,this.solicitud.person_document_expiration_date=e.document_expiration_date):(e={document_number:this.form.get("dni").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("expired_date").value),check_legal:!0,document_support:this.form.get("support_number").value},this.solicitud.person_document_number=e.document_number,this.solicitud.person_birth_date=e.birth_date,this.solicitud.person_document_support=e.document_support),this.data&&this.data.config&&this.data.config.followMail&&(e.email_copy=this.form.get("email")?this.form.get("email").value:""),e.document_type=this.isDni?"dni":"nie",this.esDNI.emit(this.isDni),this.next.emit(e)}getHTML(e){return'\n <div style="color: red !important">\n Taitooo\n </div>\n '}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ne.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ie.R,{panelClass:"fullscreen-dialog"})}setTerms(e){this.acceptTerms=e}setAssignment(e){this.assignment=e}getFormsValid(){if(!this.form)return!1;let e=!this.form.invalid;if(!e)return!1;let t=this.form&&this.form.get("support_number")?this.form.get("support_number").value:null;this.data.config.dontShowDataInTerms&&this.solicitud&&this.solicitud.status_code&&"terms_and_conditions"===this.solicitud.status_code&&(e=!0);let n=this.form.get("dni").value;return n?this.setRegex(n):e=!1,this.isNie&&(!t||""==t)&&(e=!1),!this.isDni&&!this.isNie&&(this.disabledInputs.dni=!1,e=!1),this.errorDNI&&(e=!1),e}getIfValid(){if(this.data.config.dontShowDataInTerms&&this.solicitud&&this.solicitud.status_code&&"terms_and_conditions"===this.solicitud.status_code&&(this.acceptTerms=!0),this.isDni||this.isNie)return this.errorDNI=null,!!this.data.config.hideCheckLegal||this.acceptTerms;this.errorDNI=this.labels.warnings.invalidNieOrDni}getAssignmentValidation(){return!(this.data.config.forceChecks&&!this.termsReaded)&&(!this.data.config.dataAssignmentCheck||this.assignment)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F),m.Y36(m.sBO),m.Y36(re.t),m.Y36(k.uw))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(m.Gf(de,5),m.Gf(ue,5)),2&e){let e;m.iGM(e=m.CRH())&&(t.checkComponent=e.first),m.iGM(e=m.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{userId:"userId",flowName:"flowName",data:"data",texts:"texts",solicitud:"solicitud",requestIDFromURL:"requestIDFromURL",labels:"labels",lang:"lang"},outputs:{next:"nextStep",esDNI:"isDni",goTerms:"goToTerms"},features:[m._Bn([{provide:X.sG,useValue:Le},{provide:m.soG,useValue:"es-ES"}])],decls:24,vars:42,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[3,"ngClass"],[1,"mb-3","pt-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline"],["id","dniInput","formControlName","dni","maxlength","9","matInput","",3,"tabindex"],[4,"ngIf"],["appearance","outline",3,"class",4,"ngIf"],["class","w-full",4,"ngIf"],["class","mt-6 flex justify-start items-center w-full flex-100",4,"ngIf"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","pl-3 pr-4 w-fit flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","sendBtn","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"firstOption","logoUrl"],["id","dniExpireInput","required","","formControlName","expired_date","type","text","mask","00/00/0000","matInput","",3,"tabindex"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["id","dniExpireInput","required","","formControlName","expired_date","type","text","matInput","","mask","d0/M0/0000",3,"tabindex"],["id","supportNumberInput","maxlength","9","minlength","6","required","","formControlName","support_number","matInput","",3,"tabindex"],[1,"w-full"],["id","emailInput","formControlName","email","required","","type","email","placeholder","Ingresa tu email","matInput","",3,"tabindex"],[1,"mt-6","flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","lang","flowName","data","showPolicyLink","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],[3,"color","changeCheckbox"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"pl-3","pr-4","w-fit","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"]],template:function(e,t){1&e&&(m.YNc(0,he,1,2,"belender-widget-logo",0),m.TgZ(1,"form",1)(2,"div",2),m._UZ(3,"div",3)(4,"div",4),m.ALo(5,"safeHtml"),m.qZA(),m.TgZ(6,"div",5)(7,"div",6)(8,"mat-form-field",7)(9,"mat-label"),m._uU(10),m.qZA(),m._UZ(11,"input",8),m.YNc(12,pe,2,1,"mat-error",9),m.qZA(),m.YNc(13,_e,7,8,"mat-form-field",10),m.YNc(14,we,7,8,"mat-form-field",10),m.YNc(15,xe,8,6,"mat-form-field",10),m.YNc(16,Ce,5,5,"div",11),m.qZA()(),m.YNc(17,ke,4,12,"div",12),m.YNc(18,Te,4,2,"div",12),m.YNc(19,Me,3,1,"div",13),m.YNc(20,Se,3,1,"div",14),m.TgZ(21,"div",15)(22,"button",16),m.NdJ("click",(function(){return t.nextStep()})),m._uU(23),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(1),m.Q6J("formGroup",t.form),m.xp6(2),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.Q6J("innerHTML",t.texts.form.title,m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(5,34,t.texts.form.description||""),m.oJD),m.xp6(2),m.Q6J("ngClass",m.VKq(36,Ie,t.data.config.dontShowDataInTerms&&t.solicitud&&t.solicitud.status_code&&"terms_and_conditions"===t.solicitud.status_code)),m.xp6(2),m.Gre("",t.disabledInputs.dni?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),m.xp6(1),m.s9C("tabindex",t.disabledInputs.dni?-1:1),m.xp6(1),m.Q6J("ngIf",!t.isNie&&!t.isDni),m.xp6(1),m.Q6J("ngIf",t.isDni),m.xp6(1),m.Q6J("ngIf",t.isNie),m.xp6(1),m.Q6J("ngIf",t.isNie),m.xp6(1),m.Q6J("ngIf",(null==t.data||null==t.data.config?null:t.data.config.followMail)&&(t.isDni||t.isNie)),m.xp6(1),m.Q6J("ngIf",!t.data.config.hideCheckLegal),m.xp6(1),m.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),m.xp6(1),m.Q6J("ngIf",t.data.config.forceChecks&&!t.termsReaded),m.xp6(1),m.Q6J("ngIf",t.errorDNI),m.xp6(1),m.Q6J("ngClass",m.kEZ(38,Oe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.getFormsValid()&&t.getIfValid()&&t.getAssignmentValidation()?t.data.styles.colors.btnText:"")("background",t.getFormsValid()&&t.getIfValid()&&t.getAssignmentValidation()?t.data.styles.colors.btnBg:"")("border-radius",t.data.styles.btnRound+"px"),m.Q6J("disabled",!t.getFormsValid()||!t.getIfValid()||!t.getAssignmentValidation()),m.xp6(1),m.hij(" ",t.labels.actions.continue," "))},dependencies:[S.mk,S.O5,N._Y,N.Fj,N.JJ,N.JL,N.Q7,N.wO,N.nD,N.sg,N.u,oe.b,R.X,ae.T,le.Z6,A.Hw,E.lW,r.TO,r.KE,r.bx,r.hX,ce.Nt,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}.hiden-input[_ngcontent-%COMP%]{height:0!important;max-height:0px!important;overflow:hidden!important;opacity:0!important}"]}),e})();function Ae(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",5),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.noService.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}let Ee=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts"},decls:6,vars:11,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,Ae,1,2,"belender-widget-logo",0),m.TgZ(1,"form",1)(2,"div",2),m._UZ(3,"div",3)(4,"div",4),m.ALo(5,"safeHtml"),m.qZA()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.Q6J("innerHTML",t.texts.noService.title,m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(5,9,t.texts.noService.description),m.oJD))},dependencies:[S.O5,N._Y,N.JL,N.F,R.X,Z.z]}),e})();function De(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",8),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.abandoned.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const Ne=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Ye=(()=>{class e{constructor(e){this.utils=e,this.retryR=new m.vpe(null)}ngOnInit(){}save(){}retry(){this.retryR.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(m.Y36(g.F))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{data:"data",solicitud:"solicitud",labels:"labels",texts:"texts"},outputs:{retryR:"retryRequest"},decls:11,vars:24,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,De,1,2,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2),m._UZ(3,"div",3)(4,"div",4),m.ALo(5,"safeHtml"),m.TgZ(6,"div",5),m._uU(7),m.qZA()(),m.TgZ(8,"div",6)(9,"button",7),m.NdJ("click",(function(){return t.retry()})),m._uU(10),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.Q6J("innerHTML",t.texts.abandoned.title,m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(5,18,t.texts.abandoned.description),m.oJD),m.xp6(3),m.hij(" ",t.getTextStatus()," "),m.xp6(1),m.Q6J("ngClass",m.kEZ(20,Ne,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",null==t.labels.actions?null:t.labels.actions.retry," "))},dependencies:[S.mk,S.O5,R.X,E.lW,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var qe=n(5145);const Re=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Fe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.nr=new m.vpe(null)}ngOnInit(){}newRequest(){this.nr.emit(!0)}gotoRequest(){location.assign(this.currentRequest.widget_url_boxed)}getStatus(){let e=qe.Z.find((e=>e.text==this.currentRequest.status_code));return e?e.label:"Estado desconocido"}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F),m.Y36(Y.M),m.Y36(V.o),m.Y36(b.T))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-duplicated-request-step"]],inputs:{currentRequest:"currentRequest",data:"data",texts:"texts",labels:"labels"},outputs:{nr:"newRequest"},decls:15,vars:25,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"flex","gap-2","justify-start","items-center","py-2"],[1,"w-fit","p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(m.TgZ(0,"div",0)(1,"div",1)(2,"div",2),m._uU(3),m.qZA(),m.TgZ(4,"div",3),m._uU(5),m.qZA(),m.TgZ(6,"div",4),m._uU(7),m.TgZ(8,"div",5),m._uU(9),m.qZA()()(),m.TgZ(10,"div",6)(11,"button",7),m.NdJ("click",(function(){return t.newRequest()})),m._uU(12),m.qZA(),m.TgZ(13,"button",8),m.NdJ("click",(function(){return t.gotoRequest()})),m._uU(14),m.qZA()()()),2&e&&(m.xp6(2),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.xp6(1),m.hij(" ",t.labels.warnings.duplicatedRequest," "),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.xp6(1),m.hij(" ",t.labels.warnings.alreadyHaveRequest," "),m.xp6(2),m.hij(" ",t.labels.warnings.currentRequestStatus," "),m.xp6(2),m.hij(" ",t.getStatus()," "),m.xp6(1),m.Q6J("ngClass",m.kEZ(21,Re,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("border-radius",t.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",t.labels.actions.newRequest," "),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",t.labels.actions.gotoCurrentRequest," "))},dependencies:[S.mk,E.lW],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Ze=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-standby-step"]],inputs:{data:"data",texts:"texts"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(m.TgZ(0,"form",0)(1,"div",1),m._UZ(2,"div",2)(3,"div",3),m.ALo(4,"safeHtml"),m.qZA()()),2&e&&(m.xp6(2),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.standby?t.texts.standby.titleSize+"px":"20px"),m.Q6J("innerHTML",t.texts.standby?t.texts.standby.title:"Solicitud en Stand By",m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",t.texts.standby?t.texts.standby.description:m.lcZ(4,8,"Descripcion del estado Stand By"),m.oJD))},dependencies:[N._Y,N.JL,N.F,Z.z]}),e})();function Ue(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",10),2&e){const e=m.oxw();m.Q6J("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const He=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let je=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new m.vpe(null)}ngOnInit(){this.form=this.fb.group({document_expiration_date:[null,[N.kI.required]]})}next(){this.nextStep.emit(this.form.get("document_expiration_date").value)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-error-expiration-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:17,vars:24,consts:[[3,"logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","date","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration_date","matInput",""],[1,"flex","items-center","justify-end","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,Ue,1,1,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2)(3,"div",3),m._uU(4),m.qZA(),m.TgZ(5,"div",4),m._uU(6),m.qZA(),m.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),m._uU(10),m.qZA(),m._UZ(11,"input",7),m.TgZ(12,"mat-hint"),m._uU(13,"DD/MM/YYYY"),m.qZA()()()(),m.TgZ(14,"div",8)(15,"button",9),m.NdJ("click",(function(){return t.next()})),m._uU(16),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.wrongExpiration," "),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.inputExpiration," "),m.xp6(1),m.Q6J("formGroup",t.form),m.xp6(3),m.Oqu(null==t.labels?null:t.labels.expiration),m.xp6(4),m.Q6J("ngClass",m.kEZ(20,He,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.Q6J("disabled",t.form.invalid),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.actions?null:t.labels.actions.send," "))},dependencies:[S.mk,S.O5,N._Y,N.Fj,N.JJ,N.JL,N.Q7,N.sg,N.u,R.X,E.lW,r.KE,r.bx,r.hX,ce.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ze(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",10),2&e){const e=m.oxw();m.Q6J("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const Be=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Je=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new m.vpe(null)}ngOnInit(){this.form=this.fb.group({support_number:[null,[N.kI.required]]})}next(){this.nextStep.emit(this.form.get("support_number").value)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-error-support-number-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:15,vars:24,consts:[[3,"logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","number","placeholder","Ej: 1233443","required","","formControlName","support_number","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,ze,1,1,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2)(3,"div",3),m._uU(4),m.qZA(),m.TgZ(5,"div",4),m._uU(6),m.qZA(),m.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),m._uU(10),m.qZA(),m._UZ(11,"input",7),m.qZA()()(),m.TgZ(12,"div",8)(13,"button",9),m.NdJ("click",(function(){return t.next()})),m._uU(14),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.wrongSupport," "),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.inputSupport," "),m.xp6(1),m.Q6J("formGroup",t.form),m.xp6(3),m.Oqu(null==t.labels||null==t.labels.warnings?null:t.labels.warnings.support),m.xp6(2),m.Q6J("ngClass",m.kEZ(20,Be,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.Q6J("disabled",t.form.invalid),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.actions?null:t.labels.actions.send," "))},dependencies:[S.mk,S.O5,N._Y,N.Fj,N.wV,N.JJ,N.JL,N.Q7,N.sg,N.u,R.X,E.lW,r.KE,r.hX,ce.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ve(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",10),2&e){const e=m.oxw();m.Q6J("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const Qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let We=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new m.vpe(null)}ngOnInit(){this.form=this.fb.group({birth_date:[null,[N.kI.required]]})}next(){this.nextStep.emit(this.form.get("birth_date").value)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-error-birthday-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:17,vars:24,consts:[[3,"logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","belender-form-field"],["type","text","required","","formControlName","birth_date","matInput","","mask","d0/M0/0000"],[1,"flex","items-center","justify-end","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,Ve,1,1,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2)(3,"div",3),m._uU(4),m.qZA(),m.TgZ(5,"div",4),m._uU(6),m.qZA(),m.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),m._uU(10),m.qZA(),m._UZ(11,"input",7),m.TgZ(12,"mat-hint"),m._uU(13,"DD/MM/YYYY"),m.qZA()()()(),m.TgZ(14,"div",8)(15,"button",9),m.NdJ("click",(function(){return t.next()})),m._uU(16),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.xp6(1),m.hij(" ",t.labels.warnings.wrongBirthday," "),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.xp6(1),m.hij(" ",t.labels.warnings.inputBirthDay," "),m.xp6(1),m.Q6J("formGroup",t.form),m.xp6(3),m.hij(" ",t.labels.warnings.birthday," "),m.xp6(4),m.Q6J("ngClass",m.kEZ(20,Qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.Q6J("disabled",t.form.invalid),m.xp6(1),m.hij(" ",t.labels.actions.send," "))},dependencies:[S.mk,S.O5,N._Y,N.Fj,N.JJ,N.JL,N.Q7,N.sg,N.u,R.X,le.Z6,E.lW,r.KE,r.bx,r.hX,ce.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const Ge=["formStep"],$e=["otpStep"];function Ke(e,t){if(1&e&&(m.TgZ(0,"div",8),m._UZ(1,"mat-icon",9),m._uU(2),m.qZA()),2&e){const e=m.oxw(2);m.Q6J("@fadeInUp",void 0),m.xp6(2),m.hij(" ",e.warningAlert," ")}}function Xe(e,t){1&e&&(m.TgZ(0,"div",10),m._UZ(1,"mat-progress-spinner",11),m.qZA()),2&e&&(m.xp6(1),m.Q6J("value",0))}function et(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-form-step",23,24),m.NdJ("goToTerms",(function(){m.CHM(e);const t=m.oxw(3);return m.KtG(t.gotoTermsAndConditions())}))("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.validateRequest(t))}))("isDni",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setIsDni(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("userId",e.userId)("flowName",e.flowName)("lang",e.currentLang)("requestIDFromURL",e.requestIDFromURL)("texts",e.data[e.flowName].texts)("data",e.data)("labels",e.labels)("lang",e.currentLang)("solicitud",e.solicitud)}}function tt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-shared-otp-step",25,26),m.NdJ("resendOTP",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.resendOTP(t))}))("errorPhone",(function(){m.CHM(e);const t=m.oxw(3);return m.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.requestOTP(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("otpType",e.getOtpType(e.requestStatus))("flowType",e.flowName)("data",e.data)("labels",e.labels)("solicitud",e.solicitud)("minLength",e.getOTPMinLength())("lastThreeNumbersPhone",e.lastThreeNumbersPhone)("texts",e.data[e.flowName].texts)}}function nt(e,t){if(1&e&&m._UZ(0,"belender-success-step",27),2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("flowName",e.flowName)("packId",e.packId)("userId",e.userId)("requestID",e.requestID)("texts",e.data[e.flowName].texts)}}function it(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-duplicated-request-step",28),m.NdJ("newRequest",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.newRequest(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("currentRequest",e.currentRequest)}}function st(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-error-birthday-step",29),m.NdJ("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setBirthDate(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function rt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-error-expiration-step",29),m.NdJ("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setExpiration(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function ot(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-error-support-number-step",29),m.NdJ("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setSupportNumber(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function at(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-fail-step",30),m.NdJ("retryRequest",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.retryRequest(t))}))("newRequest",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.newRequest(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("solicitud",e.solicitud)("texts",e.data[e.flowName].texts)}}function lt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-abandoned-step",31),m.NdJ("retryRequest",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.retryRequest(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)("solicitud",e.solicitud)}}function ct(e,t){if(1&e&&m._UZ(0,"belender-no-service-step",32),2&e){const e=m.oxw(3);m.Q6J("texts",e.data[e.flowName].texts)("data",e.data)}}function dt(e,t){if(1&e&&m._UZ(0,"belender-standby-step",32),2&e){const e=m.oxw(3);m.Q6J("texts",e.data[e.flowName].texts)("data",e.data)}}function ut(e,t){if(1&e&&(m.TgZ(0,"div",33)(1,"div",34)(2,"h1",35),m._uU(3,"No existe la solicitud"),m.qZA()(),m.TgZ(4,"div",36),m._uU(5," No existen solicitudes activas con el código requerido "),m.qZA()()),2&e){const e=m.oxw(3);m.xp6(4),m.Udp("color",e.data.styles.colors.text)}}function ht(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-cancel-request",37),m.NdJ("updateStatusCode",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setCancel(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("flowType",e.flowName)("data",e.data)("request_id",e.requestID)("labels",e.labels)("user_id",e.userId)("textColor",e.data.styles.colors.text)("customText",e.data.config.cancelRequestText)}}function pt(e,t){if(1&e&&(m._UZ(0,"div",38),m.ALo(1,"safeHtml")),2&e){const e=m.oxw(3);m.Udp("color",e.data.styles.colors.text),m.Q6J("innerHTML",e.data[e.flowName]&&e.data[e.flowName].texts&&e.data[e.flowName].texts.form&&e.data[e.flowName].texts.form.aditionalDescription?m.lcZ(1,3,(null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.aditionalDescription)||""):"",m.oJD)}}function mt(e,t){if(1&e&&(m.ynx(0),m.YNc(1,et,2,9,"belender-form-step",12),m.YNc(2,tt,2,8,"belender-shared-otp-step",13),m.YNc(3,nt,1,7,"belender-success-step",14),m.YNc(4,it,1,3,"belender-duplicated-request-step",15),m.YNc(5,st,1,3,"belender-error-birthday-step",16),m.YNc(6,rt,1,3,"belender-error-expiration-step",16),m.YNc(7,ot,1,3,"belender-error-support-number-step",16),m.YNc(8,at,1,4,"belender-fail-step",17),m.YNc(9,lt,1,4,"belender-abandoned-step",18),m.YNc(10,ct,1,2,"belender-no-service-step",19),m.YNc(11,dt,1,2,"belender-standby-step",19),m.YNc(12,ut,6,2,"div",20),m.YNc(13,ht,1,7,"belender-cancel-request",21),m.YNc(14,pt,2,5,"div",22),m.BQk()),2&e){const e=m.oxw(2);m.xp6(1),m.Q6J("ngIf","form"===e.requestStatus),m.xp6(1),m.Q6J("ngIf","otp_ss"==e.requestStatus||"otp_aeat"==e.requestStatus||"otp_bde"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","success"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","duplicated"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","error-birth-date"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","error-expiration-date"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","error-support-number"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","failed"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","abandoned"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","no-service"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","standby"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","created"!=e.step),m.xp6(1),m.Q6J("ngIf",e.showCancelRequest&&e.data.config.cancelRequest),m.xp6(1),m.Q6J("ngIf","form"===e.requestStatus&&!e.loadingRequestData&&e.data[e.flowName]&&(null==e.data[e.flowName]?null:e.data[e.flowName].showAditionalDescription))}}function ft(e,t){1&e&&m._UZ(0,"belender-disabled-url")}function gt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",39)(1,"div",33)(2,"div",40),m._uU(3,"Error!"),m.qZA(),m._UZ(4,"div",41),m.qZA(),m.TgZ(5,"div",42)(6,"button",43),m.NdJ("click",(function(){m.CHM(e);const t=m.oxw(2);return m.KtG(t.error=!1)})),m._uU(7," Ingresar manualmente "),m.qZA()()()}if(2&e){const e=m.oxw(2);m.xp6(4),m.Udp("color",e.data.styles.colors.text),m.Q6J("innerHTML",e.error,m.oJD)}}function _t(e,t){if(1&e&&(m.TgZ(0,"div",4)(1,"div"),m.YNc(2,Ke,3,2,"div",5),m.YNc(3,Xe,2,1,"div",6),m.YNc(4,mt,15,14,"ng-container",3),m.YNc(5,ft,1,0,"belender-disabled-url",3),m.YNc(6,gt,8,3,"div",7),m.qZA()()),2&e){const e=m.oxw();m.xp6(1),m.Gre("h-full w-full relative flex-auto p-0 md:p-3 ",null==e.data||null==e.data.styles?null:e.data.styles.typography,""),m.Udp("background",null==e.data||null==e.data.styles||null==e.data.styles.colors?null:e.data.styles.colors.background),m.xp6(1),m.Q6J("ngIf",e.warningAlert&&"success"!=e.requestStatus),m.xp6(1),m.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"success"===e.requestStatus),m.xp6(1),m.Q6J("ngIf",!e.error&&!e.disableURL),m.xp6(1),m.Q6J("ngIf",!e.error&&e.disableURL),m.xp6(1),m.Q6J("ngIf",!e.loading&&e.error)}}function bt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"vex-terms",44),m.NdJ("accepted",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.handleTermsResponse(!1))})),m.qZA()}if(2&e){const e=m.oxw();m.Q6J("flow",e.flowName)("lang",e.currentLang)("requestID",e.requestID)("requestStatus",e.solicitud?e.solicitud.status_code:"")("allData",e.data)}}function yt(e,t){if(1&e&&(m.TgZ(0,"div",45),m._UZ(1,"mat-progress-spinner",46),m.TgZ(2,"p",47),m._uU(3),m.qZA()()),2&e){const e=m.oxw();m.xp6(3),m.hij(" ",e.loading," ")}}function vt(e,t){if(1&e&&(m.ynx(0),m.TgZ(1,"div",48),m._uU(2),m.qZA(),m.BQk()),2&e){const e=m.oxw();m.xp6(2),m.hij(" TestMode ",e.testMode?"ON":"OFF"," ")}}let wt=class{constructor(e,t,n,i,s,r,o,a,l,d,u,h,m){this.cd=e,this.Activatedroute=t,this.utils=n,this.pinService=i,this.notis=s,this.webhooksService=r,this.flowsS=o,this.customizationStoreService=a,this.deviceInfoService=l,this.customizationService=d,this.dialog=u,this.translationService=h,this.scrollService=m,this.data=null,this.disableActions=!1,this.step="created",this.clientEnviroment="belender",this.showCancelRequest=!1,this._loading=null,this.error=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.lastThreeNumbersPhone=null,this.requestIDFromURL=!1,this.paramsSetted=!1,this.stopPropagationOfSuccess=!1,this.picturesTaken=[],this.disableURL=!1,this.selectedLanguage="es",this.isDni=!0,this.loadingRequestData=!1,this.env=c.N,this.intervalToAskBack=null,this.requestedFromDetail=!1,this.intervalCount=0,this.requestStatus="",this.currentHeight=0,this.isScaled=!1,this.termsOpened=!1,this.flowName="ClavePin",this.labels=p.S.es,this.currentLang="",this.acceptCirbe=!1,this.showTermsDialog=!1,localStorage.getItem("belender-language")&&(this.selectedLanguage=localStorage.getItem("belender-language")),this.deviceInfoDetails$=this.deviceInfoService.deviceInfo$.subscribe((e=>{Object.keys(e).length>0&&(this.deviceInfoDetails=e)}))}ngOnInit(){this.getWindowsScreenOrientation();const e=this;e.setWarningPortals(),this.loading="Obteniendo información de la solicitud",this.checkClientUrl(),this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.initFunctions(),"pro"!=c.N.env&&(l(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),l(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewChecked(){this.getWidgetCardHeight()}get loading(){return this._loading}set loading(e){this._loading=e,null!==e&&this.onLoadingChanged(e)}onLoadingChanged(e){this.scrollUpContent()}initFunctions(){var e=this;return(0,i.Z)((function*(){var t;e.Activatedroute.queryParams.subscribe((t=(0,i.Z)((function*(t){t&&t.request_id&&(e.requestID=t.request_id,console.warn(e.requestID)),t.lang?(e.currentLang=t.lang,e.loading=e.translationService.getFirstLoading(e.currentLang),e.setTranslation()):e.loading=e.labels.loadings.gettingData,e.userId?e.setInitialData(e.userId):e.loading=null})),function(e){return t.apply(this,arguments)}))}))()}setTranslation(){let e=this.translationService.getLabelsTranslated(this.currentLang);e&&(this.labels=e)}getWindowsScreenOrientation(){window.screen&&window.screen.orientation?(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler)):console.warn("Screen Orientation API not supported.")}getWidgetCardHeight(){let e=l("#widget-wrapper").height()||0;this.isScaled$=this.deviceInfoService.isScaled$.subscribe((t=>{this.isScaled=t,this.isScaled&&(e*=1.5)})),this.sendMessageToParent({type:"widgetHeight",data:e})}getOtpType(e){switch(e){case"otp_ss":default:return"otpSS";case"otp_aeat":return"otpAEAT";case"otp_bde":return"otpBDE"}}setRequestStatus(e){if(this.solicitud)this.solicitud.status_code=e;else{let t=new a.l;t.status_code=e,this.solicitud=t}this.setStatus()}checkClientUrl(){const e=window.location.href;this.clientEnviroment=this.getClientFromUrl(e)}getOTPMinLength(){return this.env?"dev"===this.env.env&&"belender"===this.clientEnviroment?6:"qa"===this.env.env||"dev"===this.env.env&&"opendata"===this.clientEnviroment?3:6:6}getClientFromUrl(e){return e.includes("opendata")?"opendata":"belender"}setWarningPortals(){this.flowsS.getFlows().then((e=>{if(e&&e.data&&e.data.length){let t=e.data.find((e=>e.name==this.flowName));t&&t.status&&"OCCASIONAL_FAIL"==t.status&&(this.warningAlert=this.labels.warnings.ocassionalError)}})).catch((e=>{console.error(e)}))}setInitialData(e){var t=this;return(0,i.Z)((function*(){if(yield t.validateRequestIdInUrl(),t.flowConfig=yield t.getFlow(e),t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.funderStyles=t.customizationStoreService.FUNDER_STYLES,t.data={config:t.funderConfig,styles:t.funderStyles,[t.flowName]:t.flowConfig},!t.data.config||!t.data.config.funder_id)return t.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.loading=null,t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.currentLang,t.requestID,t.solicitud?t.solicitud.status_code:"").then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}validateRequestIdInUrl(){var e=this;return(0,i.Z)((function*(){return new Promise((t=>{var n;e.Activatedroute.queryParams.subscribe({next:(n=(0,i.Z)((function*(n){if(n&&n.acceptTerms&&(e.autoAcceptTerms=!0),n&&n.request_id){e.disableURL=!1,e.requestID=n.request_id;let i=yield e.setFormFromVcCode(n.request_id,n);e.requestIDFromURL=!0,t(i)}else n?(e.setParamsToRequest(n),t(null)):(e.loading=null,t(null))})),function(e){return n.apply(this,arguments)}),error:()=>{e.loading=null,t(null)}})}))}))()}setParamsToRequest(e){this.solicitud||this.setRequestStatus("form"),e.success&&(this.stopPropagationOfSuccess=!0),e.accept_cirbe&&(this.acceptCirbe=!0),(e.document_number||e.document)&&!this.solicitud.person_document_number&&(this.solicitud.person_document_number=e.document_number||e.document,this.requestIDFromURL=!0),(e.birth_date||e.birthday)&&!this.solicitud.birth_date&&(this.solicitud.birth_date=e.birth_date||e.birthday,this.requestIDFromURL=!0),(e.document_expiration_date||e.expiration)&&!this.solicitud.person_document_expiration_date&&(this.solicitud.person_document_expiration_date=e.document_expiration_date||e.expiration,this.requestIDFromURL=!0),(e.document_support||e.supportNumber)&&!this.solicitud.document_support&&(this.solicitud.document_support=e.document_support||e.supportNumber,this.requestIDFromURL=!0),e.email&&!this.solicitud.email&&(this.solicitud.email=e.email,this.requestIDFromURL=!0,this.paramsSetted=!0),this.paramsSetted=!0}setFormFromVcCode(e,t){var n=this;return(0,i.Z)((function*(){return n.loading=n.labels.loadings.gettingData,n.loadingRequestData=!0,new Promise((i=>{n.testMode?setTimeout((()=>{n.solicitud=u.VU.data,n.setRequestStatus(n.solicitud.status_code),n.setSubscriptionOfRequest(),n.loading=null,n.loadingRequestData=!1,n.skipCreationOfRequest=!0,n.autoAcceptTerms?n.acceptTerms():n.setParamsToRequest(t),i(n.solicitud)}),4e3):n.pinService.getSolicitudByCode(e).then((e=>{e&&e.data?(n.solicitud=e.data,n.setRequestStatus(n.solicitud.status_code),n.setSubscriptionOfRequest(),n.loading=null,n.skipCreationOfRequest=n.solicitud&&n.solicitud.status_code&&"prerequest"!=n.solicitud.status_code,n.autoAcceptTerms?n.acceptTerms():n.setParamsToRequest(t)):n.loading=null,n.loadingRequestData=!1,i(n.solicitud||null)})).catch((e=>{n.loading=null,n.loadingRequestData=!1,i(null)}))}))}))()}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e,this.currentHeight),window.top.postMessage(e,"*")}handlePusherNotification(e){if(e){if(this.sendMessageToParent({type:"websocket",data:e}),this.dataFromFirebase=e,e&&e.widget_url&&(this.widgetUrl=e.widget_url),e&&e.widget_url_boxed&&(this.widgetUrlBoxed=e.widget_url_boxed),this.dataFromFirebase){if(this.dataFromFirebase.hasOwnProperty("match_phone")&&!this.dataFromFirebase.match_phone)return void this.handleBadPhone();this.dataFromFirebase.person_last_three_phone_number&&(this.lastThreeNumbersPhone=this.dataFromFirebase.person_last_three_phone_number),this.dataFromFirebase.status_code&&(("consent_process_completed"===this.dataFromFirebase.status_code||"waiting_login_bde"===this.dataFromFirebase.status_code||"waiting_otp_bde"===this.dataFromFirebase.status_code)&&this.disconnectWebsocket(),this.setRequestStatus(this.dataFromFirebase.status_code))}this.loading=null}}handleBadPhone(){this.disconnectWebsocket(),this.loading=this.labels.loadings.validatingData,this.pinService.noMatchPhone({request_id:this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID,user_id:this.userId}).then((e=>{setTimeout((()=>{this.solicitud||(this.solicitud=new a.l,this.setRequestStatus(this.solicitud.status_code)),e&&e.data&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code)),this.loading=null}),3e3)})).catch((e=>{this.showAlert("Error!",e),setTimeout((()=>{this.solicitud||(this.solicitud=new a.l,this.setRequestStatus(this.solicitud.status_code)),this.setRequestStatus("failed_without_retry"),this.loading=null}),1e3)}))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==c.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==c.N.env&&(e="wss://notifications.belender.net"),c.N.notificationsBaseUrl&&(e=c.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),n&&t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}setIsDni(e){this.isDni=e}setSubscriptionOfRequestOld(){}sendNewData(e){this.loading=this.labels.loadings.sendingData,this.pinService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e,"error"),this.loading=null):e&&"success"==e.status&&(this.loading=this.labels.loadings.validatingData,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error,"error")}))}testNoti(e){this.showAlert("Titleeee","messsaggeee",e)}showAlert(e,t,n){this.loading=null;let i=this.getFunderIconType(n);this.notis.showAlert(e,t,i)}getFunderIconType(e){if(!e||!this.funderStyles)return"error";switch(e){case"error":return this.funderStyles.errorIcon||e;case"success":return this.funderStyles.successIcon||e;case"warning":return this.funderStyles.warningIcon||e;case"info":return this.funderStyles.infoIcon||e;default:return e}}setNoService(e){this.loading=this.labels.loadings.validatingData,e.user_id=this.userId,e.package_id=this.packId,this.requestID&&(e.request_id=this.requestID),this.pinService.addSolicitud(e).then((e=>{e.data&&(this.requestID=e.data.request_id),this.pinService.setNoService({request_id:this.requestID}).then((()=>{this.setRequestStatus("no_service"),this.loading=null,this.cd.markForCheck()})).catch((e=>{this.setRequestStatus("no_service"),this.loading=null,this.cd.markForCheck()}))}))}validateRequest(e){e.user_id=this.userId,e.package_id=this.packId,this.loading=this.labels.loadings.validatingData,this.formComponent&&this.formComponent.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0},{value:!0}),this.pinService.checkService(e).then((t=>{if(t&&t.status&&"success"==t.status)this.gotoTerms(e);else if(t.message){let n=this.parseErrorResponse(t.message);"no-service"==n.title?this.setNoService(e):(this.notis.showAlert(n.title,n.description),this.loading=null),console.log("handle code: ",n.code),this.handleDisableInputs(n.code)}else this.setNoService(e)})).catch((t=>{if(console.error(t),t.message){let n=this.parseErrorResponse(t.message);"no-service"!=n.title?(this.notis.showAlert(n.title,n.description),this.loading=null):(this.pinService.addSolicitud(e).then((e=>{e.data&&(this.requestID=e.data.request_id),this.pinService.setNoService({request_id:this.requestID}).then((()=>{this.setRequestStatus("no_service"),this.loading=null})).catch((e=>{this.setRequestStatus("no_service"),this.loading=null}))})),this.loading=null,this.cd.markForCheck()),console.log("handle code: ",n.code),this.handleDisableInputs(n.code)}else this.notis.showAlert("Error indefinido!",t),this.loading=null,this.cd.markForCheck()}))}handleDisableInputs(e){!e||setTimeout((()=>{"venc"===e&&this.formComponent&&this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),"sop"===e&&this.formComponent&&this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),"nac"===e&&this.formComponent&&this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),this.cd.markForCheck()}),1e3)}parseErrorResponse(e){if(Array.isArray(e)){let t="";return e.forEach((e=>{t+=e+" "})),{title:this.labels.warnings.errorSomeData,description:t}}return"does not have pin service"==e.toLowerCase()||"does not have clave pin service"==e.toLowerCase()?{title:"no-service",description:this.labels.warnings.noPinService}:"document number invalid."==e.toLowerCase()?{title:this.labels.warnings.wrongDni,description:this.labels.warnings.wrongDniDesc}:"Incorrect support number"==e.toLowerCase()?{title:this.labels.warnings.error,code:"sop",description:this.labels.warnings.wrongSupport}:"incorrect date"==e.toLowerCase()?this.isDni?{title:this.labels.warnings.wrongDate,code:"venc",description:this.labels.warnings.wrongDateDesc}:{title:this.labels.warnings.wrongDate,code:"nac",description:this.labels.warnings.wrongDateDesc}:{title:"Error!",description:e}}gotoTerms(e){e.user_id=this.userId,e.package_id=this.packId,this.acceptCirbe&&(e.add_cirbe=!0),this.requestID&&(e.request_id=this.requestID),this.loading=this.labels.loadings.sendingData,this.testMode?setTimeout((()=>{this.solicitud=new a.l,this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=null}),4e3):this.skipCreationOfRequest?(this.acceptTerms(),this.setSubscriptionOfRequest()):this.pinService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?t.message&&(this.solicitud=e,400==t.code&&"Does not have Pin service"==t.message?(t.data&&(this.requestID=t.data.request_id),this.pinService.setNoService({request_id:this.requestID}).then((()=>{this.setRequestStatus("no_service"),this.loading=null})).catch((e=>{this.setRequestStatus("no_service"),this.loading=null}))):400==t.code&&"Incorrect support number"==t.message?(this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongSupport),this.setRequestStatus("form")):400==t.code&&"Incorrect date"==t.message?(this.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc),this.setRequestStatus("form")):(this.setRequestStatus("form"),this.showAlert("Error!",t.message))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,t.data?.detail&&this.setSteps(t.data.detail),this.setRequestStatus(this.solicitud.status_code),this.setSubscriptionOfRequest(),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.errorMessage&&this.showAlert(this.labels.warnings.error,e.errorMessage)}))}setSteps(e){if(this.steps){let e=this.steps.findIndex((e=>e.isCurrent));this.steps[e].isCompleted=!0,this.steps[e].isCurrent=!1,this.steps[e+1]&&(this.steps[e+1].isCurrent=!0)}else e&&(this.steps=JSON.parse(JSON.stringify(e)),this.steps.forEach((e=>{e.isCompleted=!1,e.isCurrent=!1})),this.steps[0].isCurrent=!0);this.cd.markForCheck()}acceptTerms(e=!0){let t={user_id:this.userId,request_id:this.requestID,terms_and_conditions:!0,opening:this.termsOpened?1:0};Object.keys(this.deviceInfoDetails).length>0&&(t={...t,ip:this.deviceInfoDetails.ip,device:this.deviceInfoDetails.device,os:`${this.deviceInfoDetails.os} ${this.deviceInfoDetails.os_version}`,resolution:this.deviceInfoDetails.screen}),e&&(this.loading=this.labels.loadings.validatingData),this.pinService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?e.message&&"You have a request in progress"==e.message?location.pathname.indexOf("widget-boxed")>-1?location.assign(e.response.widget_url_boxed):location.assign(e.response.widget_url):e.message&&"Invalid request status: stand_by"==e.message?this.setRequestStatus("stand_by"):this.showAlert("Error!",e.message?e.message:e):e&&"success"==e.status&&(this.setSubscriptionOfRequest(),e.data&&e.data.next_step_detail&&e.data.next_step_detail.portal&&"Seguridad Social"===e.data.next_step_detail.portal?this.setRequestStatus("waiting_otp_seguridad_social"):e.data&&e.data.next_step_detail&&e.data.next_step_detail.portal&&"AEAT"===e.data.next_step_detail.portal?this.setRequestStatus("waiting_otp_aeat"):e.data&&e.data.next_step_detail&&e.data.next_step_detail[0]&&e.data.next_step_detail[0].portal&&"Seguridad Social"===e.data.next_step_detail[0].portal?this.setRequestStatus("waiting_otp_seguridad_social"):e.data&&e.data.next_step_detail&&e.data.next_step_detail[0]&&e.data.next_step_detail[0].portal&&"AEAT"===e.data.next_step_detail[0].portal?this.setRequestStatus("waiting_otp_aeat"):e.data&&e.data.next_step_detail&&e.data.next_step_detail.portal&&"Banco de España"===e.data.next_step_detail.portal?(this.setRequestStatus("waiting_otp_bde"),this.disconnectWebsocket()):this.setRequestStatus(e.data.status_code),this.loading=null,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}isBdeStatus(){let e=this.solicitud?this.solicitud.status_code:null;return!!e&&("waiting_otp_bde"===e||"waiting_login_bde"===e||"invalid_otp_bde"===e)}sendOtpToBde(e){this.disconnectWebsocket(),this.pinService.sendOTPToBde(e,"qa"===c.N.env).then((e=>{e.status&&"error"==e.status?(e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.showAlert(this.labels.warnings.error,this.labels.warnings.noOtp):this.showAlert("Error!",e.message?e.message:e),this.loading=null):e?(console.warn("handle success!"),e.data?e.data.consent_process_completed=!0:e.consent_process_completed=!0,this.handleRequestStatus(e.data?e.data:e),this.cd.markForCheck()):this.loading=null})).catch((e=>{this.showAlert("Error!",e&&e.error?e.error:e),this.loading=null}))}requestOTP(e){this.loading="Enviando información..";let t={user_id:this.userId,request_id:this.requestID,code:e.code};this.isBdeStatus()?this.sendOtpToBde(t):this.pinService.sendOTP(t,"qa"===c.N.env).then((e=>{e.status&&"error"==e.status?(e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.showAlert(this.labels.warnings.error,this.labels.warnings.noOtp):this.showAlert("Error!",e.message?e.message:e),this.loading=null):e&&"success"==e.status?(this.handleRequestStatus(e.data?e.data:e),this.setSteps(),this.cd.markForCheck()):this.loading=null})).catch((e=>{this.showAlert("Error!",e&&e.error?e.error:e),this.loading=null}))}handleRequestStatus(e){let t=new a.l;this.solicitud&&(t=this.solicitud),e&&e.consent_process_completed?(this.requestedFromDetail=!0,t.status_code="consent_process_completed",this.solicitud=t,this.sendMessageToParent({type:"response",data:t}),setTimeout((()=>{this.disconnectWebsocket()}),3e3),this.data[this.flowName].showDocumentsOnSuccess&&!this.intervalToAskBack&&this.initIntervalToAskBack()):(this.otpComponent&&this.otpComponent.resetOtpNumber(),e.otp_status||e.next_step_detail?e.otp_status&&"VALID"===e.otp_status?Array.isArray(e.next_step_detail)?"Seguridad Social"===e.next_step_detail[0].portal?t.status_code="waiting_otp_seguridad_social":"AEAT"===e.next_step_detail[0].portal?t.status_code="waiting_otp_aeat":"Banco de España"===e.next_step_detail[0].portal?(this.disconnectWebsocket(),t.status_code="waiting_otp_bde"):t.status_code=e.status_code:Array.isArray(e.next_step_detail)||("Seguridad Social"===e.next_step_detail.portal?t.status_code="waiting_otp_seguridad_social":"AEAT"===e.next_step_detail.portal?t.status_code="waiting_otp_aeat":"Banco de España"===e.next_step_detail.portal?(this.disconnectWebsocket(),t.status_code="waiting_otp_bde"):t.status_code=e.status_code):e.otp_status&&"INVALID"===e.otp_status&&(t.status_code=e.status_code,this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)):e.otp_status&&"INVALID"===e.otp_status&&this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)),this.solicitud=t,this.setRequestStatus(this.solicitud.status_code),this.loading=null}askToBack(){this.pinService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code),this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}gotoErrorPhone(){}setBirthDate(e){}setExpiration(e){}setSupportNumber(e){}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.pinService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}retryRequest(e){let t={request_id:(this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID)||e,user_id:this.userId};this.loading=this.labels.loadings.resendingRequest,this.setSubscriptionOfRequest(),this.pinService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}newRequest(e){this.setRequestStatus("created")}disconnectWebsocket(){this.socket&&this.socket.close()}initIntervalToAskBack(){!this.solicitud||!this.solicitud.request_id||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(this.solicitud.request_id),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack)}askDetailToBack(e){let t=JSON.parse(JSON.stringify(this.solicitud.status_code));e||this.requestID?this.pinService.getSolicitudByCode(e).then((e=>{e&&e.data&&t!=e.data.status_code&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code))})).catch((e=>{this.loading=null,this.loadingRequestData=!1})):this.stopInterval()}setStatus(){if(this.showCancelRequest=!0,this.solicitud){if(this.solicitud){let e=this.solicitud.status_code;if("waiting_documents"===e||"saved_otp"===e)return void(this.loading=" ");let t=h[e];t&&("success"===t&&this.funderConfig&&this.funderConfig.infiniteLoopInCompleted&&(this.loading=" "),("abandoned"===t||"failed"===t)&&(this.showCancelRequest=!1),this.requestStatus=t,this.scrollUpContent())}}else this.requestStatus="form";this.cd.markForCheck()}scrollUpContent(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),300)}sendRetry(){}setCancel(e){this.setRequestStatus(e)}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,e&&(this.termsOpened=!0,this.formComponent.setTermsCheck(!0))}pictureTaken(e){this.picturesTaken.push(e._imageAsDataUrl)}getIfShowLogo(){return("loading"!=this.requestStatus&&"success"!=this.requestStatus&&!this.loading||!this.funderConfig?.infiniteLoopInCompleted)&&this.funderStyles?.withLogo}};wt.ɵfac=function(e){return new(e||wt)(m.Y36(m.sBO),m.Y36(f.gz),m.Y36(g.F),m.Y36(_.v),m.Y36(b.T),m.Y36(y.t),m.Y36(v.s),m.Y36(w.r),m.Y36(x.H),m.Y36(C.w),m.Y36(k.uw),m.Y36(T.D),m.Y36(M.a))},wt.ɵcmp=m.Xpm({type:wt,selectors:[["belender-widget-pin"]],viewQuery:function(e,t){if(1&e&&(m.Gf(Ge,5),m.Gf($e,5),m.Gf(Ge,5)),2&e){let e;m.iGM(e=m.CRH())&&(t.formComponent=e.first),m.iGM(e=m.CRH())&&(t.otpComponent=e.first),m.iGM(e=m.CRH())&&(t.theDiv=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[m._Bn([{provide:r.o2,useValue:{appearance:"standard"}}])],decls:4,vars:4,consts:[["id","widget-wrapper","class","h-full widget-belender",4,"ngIf"],[3,"flow","lang","requestID","requestStatus","allData","accepted","cancelled",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[4,"ngIf"],["id","widget-wrapper",1,"h-full","widget-belender"],["class","flex justify-start px-4 py-3 items-center font-bold gap-3 text-md bg-amber-500/20 rounded-sm border border-amber-500 text-amber-500",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"flex","justify-start","px-4","py-3","items-center","font-bold","gap-3","text-md","bg-amber-500/20","rounded-sm","border","border-amber-500","text-amber-500"],["svgIcon","mat:warning"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"userId","flowName","lang","requestIDFromURL","texts","data","labels","solicitud","goToTerms","nextStep","isDni",4,"ngIf"],[3,"otpType","flowType","data","labels","solicitud","minLength","lastThreeNumbersPhone","texts","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","flowName","packId","userId","requestID","texts",4,"ngIf"],[3,"data","labels","currentRequest","newRequest",4,"ngIf"],[3,"data","labels","texts","nextStep",4,"ngIf"],[3,"data","labels","solicitud","texts","retryRequest","newRequest",4,"ngIf"],[3,"data","labels","texts","solicitud","retryRequest",4,"ngIf"],[3,"texts","data",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"flowType","data","request_id","labels","user_id","textColor","customText","updateStatusCode",4,"ngIf"],["class","subheading-1 p-4 custom-html",3,"color","innerHTML",4,"ngIf"],[3,"userId","flowName","lang","requestIDFromURL","texts","data","labels","solicitud","goToTerms","nextStep","isDni"],["formStep",""],[3,"otpType","flowType","data","labels","solicitud","minLength","lastThreeNumbersPhone","texts","resendOTP","errorPhone","nextStep"],["otpStep",""],[3,"data","labels","flowName","packId","userId","requestID","texts"],[3,"data","labels","currentRequest","newRequest"],[3,"data","labels","texts","nextStep"],[3,"data","labels","solicitud","texts","retryRequest","newRequest"],[3,"data","labels","texts","solicitud","retryRequest"],[3,"texts","data"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[3,"flowType","data","request_id","labels","user_id","textColor","customText","updateStatusCode"],[1,"subheading-1","p-4","custom-html",3,"innerHTML"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","lang","requestID","requestStatus","allData","accepted","cancelled"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(m.YNc(0,_t,7,10,"div",0),m.YNc(1,bt,1,5,"vex-terms",1),m.YNc(2,yt,4,1,"div",2),m.YNc(3,vt,3,1,"ng-container",3)),2&e&&(m.Q6J("ngIf",t.data&&t.data.styles&&t.data.styles.colors&&!t.loading),m.xp6(1),m.Q6J("ngIf",t.showTermsDialog),m.xp6(1),m.Q6J("ngIf",(t.loading||"loading"===t.requestStatus)&&!t.error),m.xp6(1),m.Q6J("ngIf",t.testMode))},dependencies:[S.O5,I.L,O.q,L.y,P.i,A.Hw,E.lW,D.Ou,J,K,Pe,Ee,Ye,Fe,Ze,je,Je,We,Z.z],styles:[".widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.card[_ngcontent-%COMP%]{transition:all .2s ease;overflow:hidden;width:500px;max-width:100%;margin:0 auto}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}.webcam-wrapper[_ngcontent-%COMP%]{position:relative}.webcam-overlay[_ngcontent-%COMP%]{position:absolute;z-index:99;width:500px;top:0;left:0;width:100%;height:100%;justify-content:center}.webcam-overlay[_ngcontent-%COMP%] .overlay[_ngcontent-%COMP%]{background:url(/assets/img/exclude.png);width:100%;height:100%;background-repeat:no-repeat;background-size:cover;opacity:.7;max-width:500px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;top:0;left:0;background:#fff}"],data:{animation:[d.$]}}),wt=(0,s.gn)([(0,o.c)()],wt)},1916:(e,t,n)=>{n.r(t),n.d(t,{PinModule:()=>L});var i=n(6895),s=n(6383),r=n(5592),o=n(4006),a=n(3798),l=n(9391),c=n(182),d=n(7367),u=n(3238),h=n(5895),p=n(4246),m=n(9299),f=n(6e3),g=n(920),_=n(4650);const b=[{path:":idUser",component:g.n},{path:":idUser/:packID",component:g.n}];let y=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=_.oAB({type:e}),e.ɵinj=_.cJS({imports:[m.Bz.forChild(b),m.Bz,f.d8]}),e})();var v=n(7489),w=n(6981),x=n(1129),C=n(9476),k=n(3295),T=n(1145),M=n(3300),S=n(865),I=n(3033),O=n(5028);let L=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=_.oAB({type:e}),e.ɵinj=_.cJS({providers:[v.v,l.o,d.w,c.t,h.T,p.t,{provide:u.Ad,useValue:"es-ES"}],imports:[y,i.ez,s.G,r.J,o.u5,o.UX,a.a,w.x,x.n,C.F,k.g,T.j,M.C,S.q,I.d,O.q]}),e})()},8364:(e,t,n)=>{n.d(t,{T:()=>Gt});var i=n(5861),s=n(7582),r=n(9549),o=n(9933),a=n(5762),l=n(8259),c=n(2340),d=n(667);const u={created:"form",form:"form",terms_and_conditions:"form",waiting_otp_seguridad_social:"otp",waiting_login_seguridad_social:"otp",invalid_otp_seguridad_social:"otp",abandoned_after_bad_phone:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",all_documents_downloaded:"success",partial_documents_downloaded:"success",consent_process_completed:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",waiting_documents:"success",failed_with_retry:"failed",failed_without_retry:"failed",failed_documents_downloaded:"failed",consent_process_canceled:"failed",no_service:"no-service",no_sms_service:"no-service",no_clave_pin_service:"no-service",stand_by:"standby","no-phone":"no-phone",no_phone:"no-phone","no-more-phone":"no-phone",no_more_phone:"no-phone",bad_phone:"bad-phone",error_expiration_date:"error-expiration-date",error_birth_date:"error-birth-date",error_support_number:"error-support-number",duplicated:"duplicated"};var h=n(1931),p=n(4650),m=n(9299),f=n(5089),g=n(5601),_=n(7367),b=n(8460),y=n(5895),v=n(5206),w=n(7489),x=n(9045),C=n(5412),k=n(7308),T=n(3687),M=n(6895),S=n(7392),I=n(9101),O=n(1572),L=n(3364),P=n(1760),A=n(6830),E=n(4302),D=n(9112),N=n(9382),Y=n(4006),q=n(9391),R=n(3046),F=n(342),Z=n(3731);function U(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",5),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.success.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function H(e,t){if(1&e&&(p.TgZ(0,"div",6),p._UZ(1,"div",7)(2,"div",8),p.ALo(3,"safeHtml"),p.qZA()),2&e){const e=p.oxw();p.xp6(1),p.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),p.Q6J("innerHTML",e.texts.success.title,p.oJD),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(3,8,e.texts.success.description||""),p.oJD)}}function j(e,t){if(1&e&&p._UZ(0,"widget-documents",9),2&e){const e=p.oxw();p.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function z(e,t){if(1&e&&(p.TgZ(0,"div",10),p._UZ(1,"mat-progress-spinner",11),p.TgZ(2,"p",12),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Q6J("value",0),p.xp6(2),p.Oqu(e.loading)}}const B=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function J(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",13)(1,"button",14),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.gotoRedirect())})),p._uU(2),p.qZA()()}if(2&e){const e=p.oxw();p.Q6J("ngClass",p.kEZ(8,B,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),p.xp6(1),p.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let V=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.loading=null,this.showDocuments=!1}ngOnInit(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].automaticRedirectCallBack&&this.data[this.flowName].callBackUrl?setTimeout((()=>{location.assign(this.data[this.flowName].callBackUrl)}),2e3):this.data&&this.data[this.flowName]&&this.data[this.flowName].showDocumentsOnSuccess&&(this.showDocuments=!0)}save(){}gotoRedirect(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(g.M),p.Y36(q.o),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",loading:"loading",requestID:"requestID",packId:"packId",userId:"userId",flowName:"flowName",labels:"labels"},decls:5,vars:5,consts:[[3,"firstOption","logoUrl",4,"ngIf"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[3,"userId","packId","requestID",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],["class","flex items-center gap-2 py-4 flex-col md:flex-row",3,"ngClass",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(p.YNc(0,U,1,2,"belender-widget-logo",0),p.YNc(1,H,4,10,"div",1),p.YNc(2,j,1,3,"widget-documents",2),p.YNc(3,z,4,2,"div",3),p.YNc(4,J,3,12,"div",4)),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(1),p.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted&&!t.loading),p.xp6(1),p.Q6J("ngIf",t.showDocuments),p.xp6(1),p.Q6J("ngIf",t.loading),p.xp6(1),p.Q6J("ngIf",t.data&&t.data[t.flowName]&&t.data[t.flowName].enableUrlCallBack&&!t.data[t.flowName].automaticRedirectCallBack))},dependencies:[M.mk,M.O5,I.lW,O.Ou,R.X,F.A,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Q=n(4144);function W(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",7),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.errorPhone.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function G(e,t){if(1&e&&(p.TgZ(0,"form",8)(1,"mat-form-field",9)(2,"mat-label"),p._uU(3),p.qZA(),p._UZ(4,"input",10),p.qZA()()),2&e){const e=p.oxw();p.Q6J("formGroup",e.form),p.xp6(3),p.Oqu(e.labels.phone)}}const $=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function K(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",11)(1,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.no())})),p._uU(2),p.qZA(),p.TgZ(3,"button",13),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.next())})),p._uU(4),p.qZA()()}if(2&e){const e=p.oxw();p.Q6J("ngClass",p.kEZ(12,$,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),p.xp6(1),p.Udp("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",e.labels.warnings.dontHavePhone," "),p.xp6(1),p.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.Q6J("disabled",e.form.invalid),p.xp6(1),p.hij(" ",e.labels.actions.next," ")}}let X=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.cd=n,this.notifications=i,this.loading=null,this.noPhone=new p.vpe(null),this.nextStep=new p.vpe(null)}ngOnInit(){this.form=this.fb.group({phone:[null,[Y.kI.required,Y.kI.maxLength(9),Y.kI.minLength(9)]]})}next(){this.nextStep.emit(this.form.get("phone").value)}no(){this.noPhone.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(p.sBO),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-phone-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{noPhone:"noPhone",nextStep:"nextStep"},decls:9,vars:13,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","w-full",3,"formGroup",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"mb-4","w-full","md:max-w-[500px]"],["maxlength","9","formControlName","phone","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"bg-red-500","text-red-50","px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"click"],["mat-flat-button","","type","button",1,"px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(p.YNc(0,W,1,2,"belender-widget-logo",0),p.TgZ(1,"div",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p._UZ(6,"br"),p.YNc(7,G,5,2,"form",5),p.qZA(),p.YNc(8,K,5,16,"div",6),p.qZA()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.Q6J("innerHTML",t.texts.errorPhone.title,p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(5,11,t.texts.errorPhone.description),p.oJD),p.xp6(3),p.Q6J("ngIf",!t.data.config.noRetryInBadPhone),p.xp6(1),p.Q6J("ngIf",!t.data.config.noRetryInBadPhone))},dependencies:[M.mk,M.O5,I.lW,r.KE,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.nD,Y.sg,Y.u,R.X,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ee(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",3),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.fail.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function te(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",10)(1,"button",11),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.retry())})),p._uU(2),p.qZA()()}if(2&e){const e=p.oxw(2);p.xp6(1),p.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",e.labels.actions.retry," ")}}const ne=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function ie(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",12)(1,"button",11),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.newRequest())})),p._uU(2),p.qZA()()}if(2&e){const e=p.oxw(2);p.Q6J("ngClass",p.kEZ(8,ne,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),p.xp6(1),p.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.Oqu(e.labels.actions.newRequest)}}function se(e,t){if(1&e&&(p.TgZ(0,"div",4)(1,"div",5),p._UZ(2,"div",6)(3,"div",7),p.ALo(4,"safeHtml"),p.qZA(),p.YNc(5,te,3,7,"div",8),p.YNc(6,ie,3,12,"div",9),p.qZA()),2&e){const e=p.oxw();p.xp6(2),p.Q6J("innerHTML",e.texts.fail.title,p.oJD),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(4,6,e.texts.fail.description),p.oJD),p.xp6(2),p.Q6J("ngIf",e.solicitud&&"failed_with_retry"==e.solicitud.status_code),p.xp6(1),p.Q6J("ngIf",e.solicitud&&"failed_documents_downloaded"==e.solicitud.status_code)}}function re(e,t){if(1&e&&(p.TgZ(0,"div",13),p._UZ(1,"mat-progress-spinner",14),p.TgZ(2,"p",15),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Q6J("value",0),p.xp6(2),p.Oqu(e.loading)}}let oe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.loading=null,this.retryOp=new p.vpe(null),this.newReq=new p.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(g.M),p.Y36(q.o),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",loading:"loading",labels:"labels"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:3,vars:3,consts:[[3,"firstOption","logoUrl",4,"ngIf"],["class","animated fadeIn fixed-content",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"animated","fadeIn","fixed-content"],[1,"px-2","py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(p.YNc(0,ee,1,2,"belender-widget-logo",0),p.YNc(1,se,7,8,"div",1),p.YNc(2,re,4,2,"div",2)),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(1),p.Q6J("ngIf",!t.loading),p.xp6(1),p.Q6J("ngIf",t.loading))},dependencies:[M.mk,M.O5,I.lW,O.Ou,R.X,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var ae=n(5439),le=n.n(ae),ce=(n(6866),n(3238)),de=n(3755),ue=n(3746),he=n(2932),pe=n(4246),me=n(1763),fe=n(5696),ge=n(1094);const _e=["termsCheckbox"],be=["assignmentCheckbox"];function ye(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",22),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.form.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function ve(e,t){if(1&e&&(p.TgZ(0,"mat-error"),p._uU(1),p.qZA()),2&e){const e=p.oxw();p.xp6(1),p.hij(" ",e.errorDNI," ")}}function we(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," El formato debe ser DD/MM/AAAA "),p.qZA())}function xe(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," Fecha inválida "),p.qZA())}function Ce(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," Debe ser mayor de 18 años "),p.qZA())}function ke(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," El formato debe ser DD/MM/AAAA "),p.qZA())}function Te(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," Fecha inválida "),p.qZA())}function Me(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," Debe ser mayor de 18 años "),p.qZA())}function Se(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"mat-form-field",23)(1,"mat-label"),p._uU(2),p.qZA(),p._UZ(3,"input",24),p.TgZ(4,"mat-hint")(5,"a",25),p.NdJ("click",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.gotoExpirationDate(t))})),p.TgZ(6,"u"),p._uU(7),p.qZA()()(),p.YNc(8,ke,2,0,"mat-error",8),p.YNc(9,Te,2,0,"mat-error",8),p.YNc(10,Me,2,0,"mat-error",8),p.qZA()}if(2&e){const e=p.oxw();let t,n,i;p.xp6(2),p.Oqu(e.labels.expiration),p.xp6(5),p.Oqu(e.labels.findExpiration),p.xp6(1),p.Q6J("ngIf",null==(t=e.form.get("document_expiration"))?null:t.hasError("invalidFormat")),p.xp6(1),p.Q6J("ngIf",null==(n=e.form.get("document_expiration"))?null:n.hasError("invalidDate")),p.xp6(1),p.Q6J("ngIf",null==(i=e.form.get("document_expiration"))?null:i.hasError("underAge"))}}function Ie(e,t){if(1&e&&(p.TgZ(0,"mat-form-field",23)(1,"mat-label"),p._uU(2),p.qZA(),p._UZ(3,"input",26),p.qZA()),2&e){const e=p.oxw();p.xp6(2),p.Oqu(e.labels.support)}}function Oe(e,t){if(1&e&&(p.TgZ(0,"div",27)(1,"mat-form-field",6)(2,"mat-label"),p._uU(3),p.qZA(),p._UZ(4,"input",28),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),p.xp6(2),p.Oqu(e.labels.email),p.xp6(1),p.s9C("tabindex",e.disabledInputs.email?-1:1),p.s9C("placeholder",e.labels.inputEmail)}}function Le(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",29)(1,"belender-checkbox",30,31),p.NdJ("changeCheckbox",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.setTerms(t))})),p.TgZ(3,"belender-terms-and-policy-links",32),p.NdJ("goToTerms",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.gotoTermsAndConditions(t))})),p.qZA()()()}if(2&e){const e=p.oxw();p.xp6(1),p.Q6J("color",e.data.styles.colors.title),p.xp6(2),p.Q6J("userId",e.userId)("lang",e.lang)("flowName",e.flowName)("data",e.data)("showPolicyLink",null==e.data?null:e.data.config.showPolicyLink)("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Pe(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",33)(1,"belender-checkbox",34,35),p.NdJ("changeCheckbox",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.setAssignment(t))})),p._UZ(3,"div",36),p.qZA()()}if(2&e){const e=p.oxw();p.xp6(1),p.Q6J("color",e.data.styles.colors.title),p.xp6(2),p.Q6J("innerHTML",e.data[e.flowName]&&e.data[e.flowName].texts&&e.data[e.flowName].texts.dataAssignmentText?e.data[e.flowName].texts.dataAssignmentText:null==e.data?null:e.data.config.dataAssignmentText,p.oJD)}}function Ae(e,t){if(1&e&&(p.TgZ(0,"div",37),p._UZ(1,"mat-icon",38),p._uU(2),p.qZA()),2&e){const e=p.oxw();p.xp6(2),p.hij(" ",e.labels.warnings.haveToReadTerms," ")}}function Ee(e,t){if(1&e&&(p.TgZ(0,"div",39),p._UZ(1,"mat-icon",38),p._uU(2),p.qZA()),2&e){const e=p.oxw();p.xp6(2),p.hij(" ",e.errorDNI," ")}}function De(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",40),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.goBack())})),p._uU(1),p.qZA()}if(2&e){const e=p.oxw();p.Udp("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",e.labels.actions.back," ")}}function Ne(e,t){if(1&e&&(p.TgZ(0,"div",41),p._UZ(1,"mat-progress-spinner",42),p.TgZ(2,"p",43),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Q6J("value",0),p.xp6(2),p.hij(" ",e.loading," ")}}const Ye=function(e){return{"dont-show-data":e}},qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Re=(()=>{class e{constructor(e,t,n,i,s,r){this.fb=e,this.utils=t,this.cd=n,this.widgetUtils=i,this.dialog=s,this.customService=r,this.next=new p.vpe(null),this.goTerms=new p.vpe(null),this.goIntro=new p.vpe(null),this.acceptTerms=!1,this.assignment=!1,this.termsReaded=!1,this.isDni=!1,this.isNie=!1,this.errorDNI=null,this.disabledInputs={document_number:!1,birth_date:!1,email:!1,phone:!1},this.noValidate=!1,this.testMode=!0,this.lang=""}ngOnInit(){this.solicitud?(this.noValidate="terms_and_conditions"==this.solicitud.status_code,this.setForm(this.solicitud)):this.setForm(null)}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setForm(e){console.warn("setForm");let t=e?e.person_document_number||e.dni||e.document_number:null,n=e&&e.person_birth_date?le()(e.person_birth_date).format("DD/MM/YYYY"):null,i=e&&e.birth_date?le()(e.birth_date).format("DD/MM/YYYY"):n,s=e?e.person_phone||e.phone:null,r=e?e.person_email||e.email:null;t&&this.setRegex(t);const o=this;o.form=o.fb.group(o.data&&o.data.config&&o.data.config.followMail?{document_number:[t||null,o.noValidate?[]:[Y.kI.required,Y.kI.maxLength(9),o.regexDNI()]],birth_date:[i||null,o.noValidate?[]:[Y.kI.required,(0,he.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],type:["DNI"],phone:[s||"",o.noValidate?[]:[Y.kI.required,Y.kI.maxLength(9),Y.kI.minLength(9)]],email:[r||null,o.noValidate?[]:[Y.kI.required,Y.kI.email]],document_expiration:[null,[(0,he.s)({checkFormat:!0,checkDate:!0})]],support_number:[null]}:{document_number:[t||null,o.noValidate?[]:[Y.kI.required,Y.kI.maxLength(9),o.regexDNI()]],birth_date:[i||null,o.noValidate?[]:[Y.kI.required,(0,he.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],type:["DNI"],phone:[s||"",o.noValidate?[]:[Y.kI.required,Y.kI.maxLength(9),Y.kI.minLength(9)]],email:[r||null],document_expiration:[null,[(0,he.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],support_number:[null]}),this.form.markAsUntouched(),this.form.updateValueAndValidity(),o.requestIDFromURL&&o.disableEnableInputs(t,n,s,r)}forceEnableDisableInputs(e,t,n,i){this.disableEnableInputs(e?e.value:this.disabledInputs.document_number,t?t.value:this.disabledInputs.birth_date,n?n.value:this.disabledInputs.phone,i?i.value:this.disabledInputs.email)}disableEnableInputs(e,t,n,i){this.disabledInputs={document_number:e||!1,birth_date:t||!1,email:i||!1,phone:n||!1},console.warn("this.disabledInputs",this.disabledInputs)}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}setRegex(e){if(!e)return;let t=this.widgetUtils.ValidateIDType(e);t&&t.type?("dni"===t.type?(this.isDni=!0,this.errorDNI=t.valid?null:"Debes ingresar un DNI válido!"):this.isDni=!1,"nie"===t.type?(this.isNie=!0,this.errorDNI=t.valid?null:"Debes ingresar un NIE válido!"):this.isNie=!1):(this.isDni=!1,this.isNie=!1,this.errorDNI="Debes ingresar un DNI o NIE válido!"),this.cd.markForCheck()}setTerms(e){this.acceptTerms=e}setAssignment(e){this.assignment=e}getIfValid(){return!!this.data.config.hideCheckLegal||this.acceptTerms}getFormsValid(){let e=!this.form.invalid,t=this.form.get("document_number").value;return t?this.setRegex(t):e=!1,!this.isDni&&!this.isNie&&(this.disabledInputs.document_number=!1,e=!1),this.errorDNI&&(e=!1),this.cd.markForCheck(),e}nextStep(){let e;e=this.data&&this.data.config&&this.data.config.followMail?{document_number:this.form.get("document_number").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("birth_date").value),type:this.form.get("type").value,phone:this.form.get("phone").value,email_copy:this.form.get("email").value,check_legal:!0,document_expiration_date:this.form.get("document_expiration")?this.utils.formatDate(this.form.get("document_expiration").value):"2029-04-11"}:{document_number:this.form.get("document_number").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("birth_date").value),type:this.form.get("type").value,phone:this.form.get("phone").value,check_legal:!0,email_copy:"roger.checa@belender.eu",document_expiration_date:this.form.get("document_expiration")?this.utils.formatDate(this.form.get("document_expiration").value):"2029-04-11"},this.next.emit(e)}getAssignmentValidation(){return!(this.data.config.forceChecks&&!this.termsReaded)&&(!this.data.config.dataAssignmentCheck||this.assignment)}goBack(){this.goIntro.emit(!0)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(de.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ue.R,{panelClass:"fullscreen-dialog"})}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(p.sBO),p.Y36(pe.t),p.Y36(C.uw),p.Y36(_.w))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(p.Gf(_e,5),p.Gf(be,5)),2&e){let e;p.iGM(e=p.CRH())&&(t.checkComponent=e.first),p.iGM(e=p.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{userId:"userId",data:"data",flowName:"flowName",texts:"texts",solicitud:"solicitud",pinMode:"pinMode",requestIDFromURL:"requestIDFromURL",labels:"labels",lang:"lang"},outputs:{next:"nextStep",goTerms:"goToTerms",goIntro:"goIntro"},features:[p._Bn([{provide:ce.sG,useValue:{parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}}}])],decls:36,vars:59,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between",3,"ngClass"],["appearance","outline"],["placeholder","Ej: 12312345R","formControlName","document_number","maxlength","9","matInput","",3,"tabindex"],[4,"ngIf"],["type","text","placeholder","Ej: 22/03/1990","formControlName","birth_date","matInput","","mask","d0/M0/0000",3,"tabindex"],["appearance","outline","class","w-full flex-1 belender-form-field",4,"ngIf"],["formControlName","phone","placeholder","Ej: 123123123","maxlength","9","type","text","matInput","",3,"tabindex"],["class","w-full",4,"ngIf"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","mt-6 flex justify-start items-center w-full flex-100",4,"ngIf"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","pl-3 pr-4 flex w-fit items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["class","px-8 py-1 bg-slate-100 hover:bg-slate-200 text-slate-900 w-full max-w-none md:max-w-[220px]","mat-flat-button","","type","button",3,"border-radius","click",4,"ngIf"],["mat-flat-button","","type","button",1,"px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],[3,"firstOption","logoUrl"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","text","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration","matInput","","mask","d0/M0/0000"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["type","text","placeholder","22211134","required","","formControlName","support_number","matInput",""],[1,"w-full"],["formControlName","email","type","email","matInput","",3,"tabindex","placeholder"],[1,"flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","lang","flowName","data","showPolicyLink","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],[1,"mt-6","flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"pl-3","pr-4","flex","w-fit","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["mat-flat-button","","type","button",1,"px-8","py-1","bg-slate-100","hover:bg-slate-200","text-slate-900","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){if(1&e&&(p.YNc(0,ye,1,2,"belender-widget-logo",0),p.TgZ(1,"form",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p.qZA(),p.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",7),p.YNc(11,ve,2,1,"mat-error",8),p.qZA(),p.TgZ(12,"mat-form-field",6)(13,"mat-label"),p._uU(14),p.qZA(),p._UZ(15,"input",9),p.YNc(16,we,2,0,"mat-error",8),p.YNc(17,xe,2,0,"mat-error",8),p.YNc(18,Ce,2,0,"mat-error",8),p.qZA(),p.YNc(19,Se,11,5,"mat-form-field",10),p.YNc(20,Ie,4,1,"mat-form-field",10),p.TgZ(21,"mat-form-field",6)(22,"mat-label"),p._uU(23),p.qZA(),p._UZ(24,"input",11),p.qZA(),p.YNc(25,Oe,5,6,"div",12),p.qZA(),p.TgZ(26,"div",13),p.YNc(27,Le,4,12,"div",14),p.YNc(28,Pe,4,2,"div",15),p.YNc(29,Ae,3,1,"div",16),p.YNc(30,Ee,3,1,"div",17),p.qZA(),p.TgZ(31,"div",18),p.YNc(32,De,2,3,"button",19),p.TgZ(33,"button",20),p.NdJ("click",(function(){return t.nextStep()})),p._uU(34),p.qZA()()(),p.YNc(35,Ne,4,2,"div",21)),2&e){let e,n,i;p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(1),p.Gre("animated ",t.loading?"hide-content":""," fadeIn fixed-content px-2"),p.Q6J("formGroup",t.form),p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.Q6J("innerHTML",t.texts.form.title,p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(5,51,t.texts.form.description||""),p.oJD),p.xp6(2),p.Q6J("ngClass",p.VKq(53,Ye,t.data.config.dontShowDataInTerms&&t.solicitud&&t.solicitud.status_code&&"terms_and_conditions"===t.solicitud.status_code)),p.xp6(1),p.Gre("",t.disabledInputs.document_number?"disabled-input":""," w-full flex-1 belender-form-field"),p.xp6(2),p.Oqu(t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),p.xp6(1),p.s9C("tabindex",t.disabledInputs.document_number?-1:1),p.xp6(1),p.Q6J("ngIf",t.errorDNI),p.xp6(1),p.Gre("",t.disabledInputs.birth_date?"disabled-input":""," w-full flex-1 belender-form-field"),p.xp6(2),p.Oqu(t.labels.birthday),p.xp6(1),p.s9C("tabindex",t.disabledInputs.birth_date?-1:1),p.xp6(1),p.Q6J("ngIf",null==(e=t.form.get("birth_date"))?null:e.hasError("invalidFormat")),p.xp6(1),p.Q6J("ngIf",null==(n=t.form.get("birth_date"))?null:n.hasError("invalidDate")),p.xp6(1),p.Q6J("ngIf",null==(i=t.form.get("birth_date"))?null:i.hasError("underAge")),p.xp6(1),p.Q6J("ngIf",t.pinMode&&!t.isNie),p.xp6(1),p.Q6J("ngIf",t.pinMode&&t.isNie),p.xp6(1),p.Gre("",t.disabledInputs.phone?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),p.xp6(2),p.Oqu(t.labels.phone),p.xp6(1),p.s9C("tabindex",t.disabledInputs.phone?-1:1),p.xp6(1),p.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.followMail),p.xp6(2),p.Q6J("ngIf",!t.data.config.hideCheckLegal),p.xp6(1),p.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),p.xp6(1),p.Q6J("ngIf",t.data.config.forceChecks&&!t.termsReaded),p.xp6(1),p.Q6J("ngIf",t.errorDNI),p.xp6(1),p.Q6J("ngClass",p.kEZ(55,qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Q6J("ngIf",t.data.config.introEnabled),p.xp6(1),p.Udp("color",t.getFormsValid()&&t.getAssignmentValidation()&&t.getIfValid()?t.data.styles.colors.btnText:"")("background",t.getFormsValid()&&t.getAssignmentValidation()&&t.getIfValid()?t.data.styles.colors.btnBg:"")("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",!t.getFormsValid()||!t.getAssignmentValidation()||!t.getIfValid()),p.xp6(1),p.hij(" ",t.labels.actions.continue," "),p.xp6(1),p.Q6J("ngIf",t.loading)}},dependencies:[M.mk,M.O5,S.Hw,I.lW,r.TO,r.KE,r.bx,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.Q7,Y.nD,Y.sg,Y.u,O.Ou,me.b,R.X,fe.T,ge.Z6,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}.hide-content[_ngcontent-%COMP%]{opacity:0!important;max-height:0px!important;overflow:hidden!important;padding:0!important}"]}),e})();const Fe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Ze=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.Activatedroute=n,this.next=new p.vpe(null),this.loading=null,this.accept=!1}ngOnInit(){this.Activatedroute.queryParams.subscribe((e=>{this.setForm(e)}))}nextStep(){let e={phone:this.form.get("phone").value};this.next.emit(e)}setForm(e){this.form=this.fb.group({phone:["",Y.kI.required]}),this.solicitud&&"bad_phone"==this.solicitud.status_code&&this.form.controls.phone.markAsTouched()}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(m.gz))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-form-step"]],inputs:{data:"data",flowName:"flowName",texts:"texts",mode:"mode",solicitud:"solicitud",loading:"loading",labels:"labels"},outputs:{next:"nextStep"},decls:14,vars:23,consts:[[1,"animated","fadeIn","fixed-content",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"mb-4","w-full","flex-1"],["formControlName","phone","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(p.TgZ(0,"form",0)(1,"div",1)(2,"div",2),p._uU(3),p.qZA(),p.TgZ(4,"div",3),p._uU(5),p.qZA()(),p.TgZ(6,"div",4)(7,"mat-form-field",5)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",6),p.qZA()(),p.TgZ(11,"div",7)(12,"button",8),p.NdJ("click",(function(){return t.nextStep()})),p._uU(13),p.qZA()()()),2&e&&(p.Q6J("formGroup",t.form),p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.Oqu(t.labels.warnings.phoneError),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.Oqu(t.labels.warnings.badPhoneSS),p.xp6(4),p.Oqu(t.labels.phone),p.xp6(2),p.Q6J("ngClass",p.kEZ(19,Fe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",t.form.invalid),p.xp6(1),p.Oqu(t.labels.actions.continue))},dependencies:[M.mk,I.lW,r.KE,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.sg,Y.u],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ue(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",5),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.noService.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}let He=(()=>{class e{constructor(){this.loading=null}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},decls:6,vars:11,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(p.YNc(0,Ue,1,2,"belender-widget-logo",0),p.TgZ(1,"form",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p.qZA()()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.Q6J("innerHTML",t.texts.noService.title,p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(5,9,t.texts.noService.description),p.oJD))},dependencies:[M.O5,Y._Y,Y.JL,Y.F,R.X,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function je(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",8),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.abandoned.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const ze=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Be=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new p.vpe(null),this.loading=null}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(g.M),p.Y36(q.o),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",loading:"loading",labels:"labels",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:11,vars:24,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(p.YNc(0,je,1,2,"belender-widget-logo",0),p.TgZ(1,"div",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p.TgZ(6,"div",5),p._uU(7),p.qZA()(),p.TgZ(8,"div",6)(9,"button",7),p.NdJ("click",(function(){return t.retry()})),p._uU(10),p.qZA()()()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.Q6J("innerHTML",t.texts.abandoned.title,p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(5,18,t.texts.abandoned.description),p.oJD),p.xp6(3),p.hij(" ",t.getTextStatus()," "),p.xp6(1),p.Q6J("ngClass",p.kEZ(20,ze,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.xp6(1),p.Oqu(t.labels.actions.retry))},dependencies:[M.mk,M.O5,I.lW,R.X,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Je=n(5145);function Ve(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",10),2&e){const e=p.oxw();p.Q6J("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const Qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let We=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.nr=new p.vpe(null),this.loading=null}ngOnInit(){}newRequest(){this.nr.emit(!0)}gotoRequest(){location.assign(this.currentRequest.widget_url_boxed)}getStatus(){let e=Je.Z.find((e=>e.text==this.currentRequest.status_code));return e?e.label:this.labels.unknownState}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(g.M),p.Y36(q.o),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-duplicated-request-step"]],inputs:{currentRequest:"currentRequest",loading:"loading",data:"data",texts:"texts",labels:"labels"},outputs:{nr:"newRequest"},decls:16,vars:26,consts:[[3,"logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"flex","gap-2","justify-start","items-center","py-2"],[1,"w-fit","p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[3,"logoUrl"]],template:function(e,t){1&e&&(p.YNc(0,Ve,1,1,"belender-widget-logo",0),p.TgZ(1,"div",1)(2,"div",2)(3,"div",3),p._uU(4),p.qZA(),p.TgZ(5,"div",4),p._uU(6),p.qZA(),p.TgZ(7,"div",5),p._uU(8),p.TgZ(9,"div",6),p._uU(10),p.qZA()()(),p.TgZ(11,"div",7)(12,"button",8),p.NdJ("click",(function(){return t.newRequest()})),p._uU(13),p.qZA(),p.TgZ(14,"button",9),p.NdJ("click",(function(){return t.gotoRequest()})),p._uU(15),p.qZA()()()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.hij(" ",t.labels.warnings.duplicatedRequest," "),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.hij(" ",t.labels.warnings.alreadyHaveRequest," "),p.xp6(2),p.hij(" ",t.labels.warnings.currentRequestStatus," "),p.xp6(2),p.hij(" ",t.getStatus()," "),p.xp6(1),p.Q6J("ngClass",p.kEZ(22,Qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("border-radius",t.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",t.labels.actions.newRequest," "),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",t.labels.actions.gotoCurrentRequest," "))},dependencies:[M.mk,M.O5,I.lW,R.X],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ge(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",5),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.standby.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}let $e=(()=>{class e{constructor(){this.loading=null}ngOnInit(){console.error(this.data,this.texts)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-standby-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},decls:6,vars:11,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(p.YNc(0,Ge,1,2,"belender-widget-logo",0),p.TgZ(1,"form",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p.qZA()()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.standby?t.texts.standby.titleSize+"px":"20px"),p.Q6J("innerHTML",t.texts.standby?t.texts.standby.title:"Solicitud en Stand By",p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",t.texts.standby?t.texts.standby.description:p.lcZ(5,9,"Descripcion del estado Stand By"),p.oJD))},dependencies:[M.O5,Y._Y,Y.JL,Y.F,R.X,Z.z]}),e})();const Ke=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Xe=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new p.vpe(null)}ngOnInit(){this.form=this.fb.group({birth_date:[null,[Y.kI.required]]})}next(){this.nextStep.emit(this.form.get("birth_date").value)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-birthday-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:16,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","text","placeholder","Ej: 22/03/1990","required","","formControlName","birth_date","matInput","","mask","d0/M0/0000"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._uU(3),p.qZA(),p.TgZ(4,"div",3),p._uU(5),p.qZA(),p.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",6),p.TgZ(11,"mat-hint"),p._uU(12,"DD/MM/YYYY"),p.qZA()()()(),p.TgZ(13,"div",7)(14,"button",8),p.NdJ("click",(function(){return t.next()})),p._uU(15),p.qZA()()()),2&e&&(p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.hij(" ",t.labels.warnings.wrongBirthday," "),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.hij(" ",t.labels.warnings.inputBirthDay," "),p.xp6(1),p.Q6J("formGroup",t.form),p.xp6(3),p.Oqu(t.labels.birthday),p.xp6(4),p.Q6J("ngClass",p.kEZ(19,Ke,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",t.form.invalid),p.xp6(1),p.hij(" ",t.labels.send," "))},dependencies:[M.mk,I.lW,r.KE,r.bx,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.Q7,Y.sg,Y.u,ge.Z6],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const et=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let tt=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new p.vpe(null)}ngOnInit(){this.form=this.fb.group({support_number:[null,[Y.kI.required]]})}next(){this.nextStep.emit(this.form.get("support_number").value)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-support-number-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:14,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","number","placeholder","Ej: 1233443","required","","formControlName","support_number","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._uU(3),p.qZA(),p.TgZ(4,"div",3),p._uU(5),p.qZA(),p.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",6),p.qZA()()(),p.TgZ(11,"div",7)(12,"button",8),p.NdJ("click",(function(){return t.next()})),p._uU(13),p.qZA()()()),2&e&&(p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.hij(" ",t.labels.warnings.wrongSupport," "),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.hij(" ",t.labels.warnings.inputSupport," "),p.xp6(1),p.Q6J("formGroup",t.form),p.xp6(3),p.Oqu(t.labels.support),p.xp6(2),p.Q6J("ngClass",p.kEZ(19,et,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",t.form.invalid),p.xp6(1),p.hij(" ",t.labels.send," "))},dependencies:[M.mk,I.lW,r.KE,r.hX,Q.Nt,Y._Y,Y.Fj,Y.wV,Y.JJ,Y.JL,Y.Q7,Y.sg,Y.u],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const nt=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let it=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new p.vpe(null)}ngOnInit(){this.form=this.fb.group({document_expiration_date:[null,[Y.kI.required]]})}next(){this.nextStep.emit(this.form.get("document_expiration_date").value)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-expiration-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:16,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","date","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration_date","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8",3,"disabled","click"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._uU(3),p.qZA(),p.TgZ(4,"div",3),p._uU(5),p.qZA(),p.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",6),p.TgZ(11,"mat-hint"),p._uU(12,"DD/MM/YYYY"),p.qZA()()()(),p.TgZ(13,"div",7)(14,"button",8),p.NdJ("click",(function(){return t.next()})),p._uU(15),p.qZA()()()),2&e&&(p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.hij(" ",t.labels.warnings.wrongExpiration," "),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.hij(" ",t.labels.warnings.inputExpiration," "),p.xp6(1),p.Q6J("formGroup",t.form),p.xp6(3),p.Oqu(t.labels.expiration),p.xp6(4),p.Q6J("ngClass",p.kEZ(19,nt,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",t.form.invalid),p.xp6(1),p.Oqu(t.labels.send))},dependencies:[M.mk,I.lW,r.KE,r.bx,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.Q7,Y.sg,Y.u],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function st(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",5),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.noPhone.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function rt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"mat-form-field",12)(1,"mat-label"),p._uU(2),p.qZA(),p._UZ(3,"input",13),p.TgZ(4,"mat-hint")(5,"a",14),p.NdJ("click",(function(t){p.CHM(e);const n=p.oxw(2);return p.KtG(n.gotoExpirationDate(t))})),p.TgZ(6,"u"),p._uU(7),p.qZA()()()()}if(2&e){const e=p.oxw(2);p.xp6(2),p.Oqu(e.labels.expiration),p.xp6(5),p.Oqu(e.labels.findExpiration)}}function ot(e,t){if(1&e&&(p.TgZ(0,"mat-form-field",15)(1,"mat-label"),p._uU(2),p.qZA(),p._UZ(3,"input",16),p.qZA()),2&e){const e=p.oxw(2);p.xp6(2),p.Oqu(e.labels.support)}}function at(e,t){if(1&e&&(p.TgZ(0,"div",6),p._UZ(1,"div",7)(2,"div",8),p.ALo(3,"safeHtml"),p._UZ(4,"br"),p.TgZ(5,"form",9),p.YNc(6,rt,8,2,"mat-form-field",10),p.YNc(7,ot,4,1,"mat-form-field",11),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),p.Q6J("innerHTML",null==e.texts.noPhone?null:e.texts.noPhone.title,p.oJD),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(3,11,e.texts.noPhone.description),p.oJD),p.xp6(3),p.Q6J("formGroup",e.form),p.xp6(1),p.Q6J("ngIf",e.isDni),p.xp6(1),p.Q6J("ngIf",e.isNie)}}const lt=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function ct(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",17)(1,"button",18),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.next())})),p._uU(2),p.qZA()()}if(2&e){const e=p.oxw();p.Q6J("ngClass",p.kEZ(9,lt,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),p.xp6(1),p.Udp("color",e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.Q6J("disabled",e.form.invalid),p.xp6(1),p.hij(" ",e.labels.actions.next," ")}}function dt(e,t){if(1&e&&(p.TgZ(0,"div",19),p._uU(1),p.qZA()),2&e){const e=p.oxw();p.xp6(1),p.hij(" ",e.labels.loadings.gettingData," ")}}let ut=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.cd=n,this.dialog=i,this.loading=null,this.solicitud=null,this.answered=!1,this.nextStep=new p.vpe(null),this.isNie=!1,this.isDni=!1}ngOnInit(){console.warn(this.solicitud),this.loading=!0,this.checkIfDniOrNie(),this.isDni&&(this.form=this.fb.group({document_expiration_date:[null,Y.kI.required]})),this.isNie&&(this.form=this.fb.group({document_support:[null,Y.kI.required]})),this.loading=!1}checkIfDniOrNie(){this.setRegex(this.solicitud.person_document_number)}setRegex(e){e&&(this.isDni=!!e.toUpperCase().match(/^(\d{8})([A-Z])$/),this.isNie=!!e.toUpperCase().match(/^[XYZ]\d{7,8}[A-Z]$/),this.cd.markForCheck())}next(){let e={};this.isDni?e.document_expiration_date=this.utils.formatDate(this.form.get("document_expiration_date").value):this.isNie&&(e.document_support=this.form.get("document_support").value),this.nextStep.emit(e)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(de.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ue.R,{panelClass:"fullscreen-dialog"})}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(p.sBO),p.Y36(C.uw))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-no-phone-step"]],inputs:{data:"data",texts:"texts",loading:"loading",solicitud:"solicitud",labels:"labels"},outputs:{nextStep:"nextStep"},decls:5,vars:4,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],["class","py-4 flex flex-col",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],["class","w-full flex justify-center p-4 items-center",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"w-full",3,"formGroup"],["appearance","outline","class","w-full flex-1 belender-form-field",4,"ngIf"],["appearance","outline","class","mb-4 w-full md:max-w-[500px]",4,"ngIf"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","text","placeholder","Ej: 22/03/2030","formControlName","document_expiration_date","matInput","","mask","d0/M0/0000"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["appearance","outline",1,"mb-4","w-full","md:max-w-[500px]"],["formControlName","document_support","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"w-full","flex","justify-center","p-4","items-center"]],template:function(e,t){1&e&&(p.YNc(0,st,1,2,"belender-widget-logo",0),p.TgZ(1,"div",1),p.YNc(2,at,8,13,"div",2),p.YNc(3,ct,3,13,"div",3),p.YNc(4,dt,2,1,"div",4),p.qZA()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(2),p.Q6J("ngIf",(t.isDni||t.isNie)&&!t.loading),p.xp6(1),p.Q6J("ngIf",(t.isDni||t.isNie)&&!t.loading),p.xp6(1),p.Q6J("ngIf",!t.isDni&&!t.isNie||t.loading))},dependencies:[M.mk,M.O5,I.lW,r.KE,r.bx,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.sg,Y.u,R.X,ge.Z6,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var ht=n(4385);const pt=["formStep"];function mt(e,t){if(1&e&&(p.TgZ(0,"mat-option",8),p._uU(1),p.qZA()),2&e){const e=t.$implicit;p.s9C("value",e),p.xp6(1),p.Oqu(e)}}function ft(e,t){if(1&e){const e=p.EpF();p.ynx(0),p.TgZ(1,"mat-form-field",5)(2,"mat-label"),p._uU(3,"Estado"),p.qZA(),p.TgZ(4,"mat-select",6),p.NdJ("selectionChange",(function(t){const n=p.CHM(e).index,i=p.oxw();return p.KtG(i.setItemSelected(t,n))})),p.YNc(5,mt,2,2,"mat-option",7),p.qZA()(),p.BQk()}if(2&e){const e=t.$implicit,n=t.index,i=p.oxw();p.xp6(1),p.Gre(" w-full ",n===i.triggerObject.index-1?"!border-t-2 border-green-500 ":"",""),p.xp6(3),p.Q6J("value",e),p.xp6(1),p.Q6J("ngForOf",i.items)}}function gt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",9),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.initTrigger())})),p._uU(1,"Empezar"),p.qZA()}}function _t(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",9),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.initTrigger())})),p._uU(1,"Continuar"),p.qZA()}}function bt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",9),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.initTriggerFromZero())})),p._uU(1,"Volver a empezar"),p.qZA()}}let yt=class{constructor(e,t){this.cd=e,this.utils=t,this.sendMessage=new p.vpe,this.requestedToPin=!1,this.items=["created","form","terms_and_conditions","waiting_otp_seguridad_social","waiting_login_seguridad_social","invalid_otp_seguridad_social","abandoned_after_bad_phone","abandoned_after_invalid_otp_seguridad_social","abandoned_after_terms_and_conditions","abandoned_after_waiting_otp_seguridad_social","all_documents_downloaded","partial_documents_downloaded","consent_process_completed","partial_documents_downloaded_and_deleted","all_documents_downloaded_and_deleted","failed_with_retry","failed_without_retry","failed_documents_downloaded","no_service","no_sms_service","stand_by","no-phone","no-more-phone","bad_phone","error_expiration_date","error_birth_date","error_support_number","duplicated"],this.triggerObject={index:0,items:["form","waiting_otp_seguridad_social","all_documents_downloaded"]}}ngOnInit(){}setItemSelected(e,t){console.warn(e,t),this.triggerObject.items[t]=e.value,console.warn(this.triggerObject)}initTrigger(){this.emitMessage(this.triggerObject.items[this.triggerObject.index]),this.triggerObject.index++}initTriggerFromZero(){this.triggerObject.index=0,this.initTrigger()}emitMessage(e){let t={status_code:e};console.log(t),this.sendMessage.emit(t)}closeInterval(){this.int&&clearInterval(this.int),this.triggerObject.index=0}addState(){this.triggerObject.items.push("")}};yt.ɵfac=function(e){return new(e||yt)(p.Y36(p.sBO),p.Y36(f.F))},yt.ɵcmp=p.Xpm({type:yt,selectors:[["belender-tester-sms"]],viewQuery:function(e,t){if(1&e&&p.Gf(pt,5),2&e){let e;p.iGM(e=p.CRH())&&(t.theDiv=e.first)}},outputs:{sendMessage:"sendMessage"},decls:9,vars:4,consts:[[1,"wrapper","flex","flex-col","justify-between","bg-slate-100","w-[200px]","h-full","p-2","gap-0"],[1,"flex","flex-col","h-full","dd-wrapper"],[4,"ngFor","ngForOf"],["mat-button","",1,"w-full","rounded-md",3,"click"],["mat-raised-button","","class","w-full rounded-md bg-blue-500 text-blue-50",3,"click",4,"ngIf"],["appearance","outline"],[1,"border",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["mat-raised-button","",1,"w-full","rounded-md","bg-blue-500","text-blue-50",3,"click"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0)(1,"div",1),p.YNc(2,ft,6,5,"ng-container",2),p.TgZ(3,"button",3),p.NdJ("click",(function(){return t.addState()})),p._uU(4,"Agregar estado"),p.qZA()(),p.TgZ(5,"div"),p.YNc(6,gt,2,0,"button",4),p.YNc(7,_t,2,0,"button",4),p.YNc(8,bt,2,0,"button",4),p.qZA()()),2&e&&(p.xp6(2),p.Q6J("ngForOf",t.triggerObject.items),p.xp6(4),p.Q6J("ngIf",!t.triggerObject.index||0==t.triggerObject.index),p.xp6(1),p.Q6J("ngIf",t.triggerObject.index&&t.triggerObject.index<t.triggerObject.items.length),p.xp6(1),p.Q6J("ngIf",t.triggerObject.index&&t.triggerObject.index>=t.triggerObject.items.length))},dependencies:[M.sg,M.O5,I.lW,r.KE,r.hX,ht.gD,ce.ey],styles:[".wrapper[_ngcontent-%COMP%]{position:fixed;top:0;right:0;box-shadow:-10px 20px 30px #0000004d;z-index:99!important;max-height:100vh}.dd-wrapper[_ngcontent-%COMP%]{max-height:calc(100vh - 70px)!important;overflow:auto}"],data:{animation:[d.$]}}),yt=(0,s.gn)([(0,o.c)()],yt);const vt=["formStep"],wt=["otpStep"];function xt(e,t){if(1&e&&(p.TgZ(0,"div",8),p._UZ(1,"mat-icon",9),p._uU(2),p.qZA()),2&e){const e=p.oxw(2);p.Q6J("@fadeInUp",void 0),p.xp6(2),p.hij(" ",e.warningAlert," ")}}function Ct(e,t){1&e&&(p.TgZ(0,"div",10),p._UZ(1,"mat-progress-spinner",11),p.qZA()),2&e&&(p.xp6(1),p.Q6J("value",0))}function kt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-intro-step",26),p.NdJ("gotoFlow",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.goFlow())}))("gotoManual",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.gotoManual())})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("flowName",e.flowName)}}function Tt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-manual-step",27),p.NdJ("dniChange",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.createRequestFromDNI(t))}))("goBack",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.gotoIntro())})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("flowName",e.flowName)("solicitud",e.solicitud)("packId",e.packId)("userId",e.userId)}}function Mt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-form-step",28,29),p.NdJ("goIntro",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.goIntro())}))("goToTerms",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.gotoTermsAndConditions())}))("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.gotoTerms(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("requestIDFromURL",e.requestIDFromURL)("lang",e.currentLang)("userId",e.userId)("flowName",e.flowName)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)("solicitud",e.solicitud)("pinMode",e.pinMode)}}function St(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-form-step",30),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.sendNewData(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function It(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-birthday-step",31),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setBirthDate(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function Ot(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-expiration-step",31),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setExpiration(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function Lt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-support-number-step",31),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setSupportNumber(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function Pt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-abandoned-step",32),p.NdJ("retry",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.retryRequest(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function At(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-shared-otp-step",33,34),p.NdJ("resendOTP",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.resendOTP(t))}))("errorPhone",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.requestOTP(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("otpType","otpSS")("labels",e.labels)("logoCustom",e.data[e.flowName].texts.otpSS.customImage)("flowType",e.flowName)("data",e.data)("texts",e.data[e.flowName].texts)("solicitud",e.solicitud)("minLength",6)}}function Et(e,t){if(1&e&&p._UZ(0,"belender-success-step",35),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("packId",e.packId)("flowName",e.flowName)("userId",e.userId)("requestID",e.requestID)("texts",e.data[e.flowName].texts)}}function Dt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-duplicated-request-step",36),p.NdJ("newRequest",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.newRequest(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("currentRequest",e.currentRequest)}}function Nt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-no-phone-step",30),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.sendDataToPin(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function Yt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-phone-step",37),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setPhone(t))}))("noPhone",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.setNoPhone())})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function qt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-fail-step",38),p.NdJ("retry",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.retryRequest(t))}))("newRequest",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.newRequest(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Rt(e,t){if(1&e&&p._UZ(0,"belender-no-service-step",39),2&e){const e=p.oxw(3);p.Q6J("texts",e.data[e.flowName].texts)("data",e.data)("labels",e.labels)}}function Ft(e,t){if(1&e&&p._UZ(0,"belender-standby-step",39),2&e){const e=p.oxw(3);p.Q6J("texts",e.data[e.flowName].texts)("data",e.data)("labels",e.labels)}}function Zt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-cancel-request",40),p.NdJ("updateStatusCode",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setCancel(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("flowType",e.flowName)("request_id",e.requestID)("user_id",e.userId)("data",e.data)("labels",e.labels)("textColor",e.data.styles.colors.text)("customText",e.data.config.cancelRequestText)}}function Ut(e,t){if(1&e&&(p._UZ(0,"div",41),p.ALo(1,"safeHtml")),2&e){const e=p.oxw(3);p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(1,3,(null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.aditionalDescription)||""),p.oJD)}}function Ht(e,t){if(1&e&&(p.ynx(0),p.YNc(1,kt,1,2,"belender-intro-step",12),p.YNc(2,Tt,1,5,"belender-manual-step",13),p.YNc(3,Mt,2,9,"belender-form-step",14),p.YNc(4,St,1,4,"belender-error-form-step",15),p.YNc(5,It,1,3,"belender-error-birthday-step",16),p.YNc(6,Ot,1,3,"belender-error-expiration-step",16),p.YNc(7,Lt,1,3,"belender-error-support-number-step",16),p.YNc(8,Pt,1,4,"belender-abandoned-step",17),p.YNc(9,At,2,8,"belender-shared-otp-step",18),p.YNc(10,Et,1,7,"belender-success-step",19),p.YNc(11,Dt,1,3,"belender-duplicated-request-step",20),p.YNc(12,Nt,1,4,"belender-no-phone-step",15),p.YNc(13,Yt,1,3,"belender-error-phone-step",21),p.YNc(14,qt,1,4,"belender-fail-step",22),p.YNc(15,Rt,1,3,"belender-no-service-step",23),p.YNc(16,Ft,1,3,"belender-standby-step",23),p.YNc(17,Zt,1,7,"belender-cancel-request",24),p.YNc(18,Ut,2,5,"div",25),p.BQk()),2&e){const e=p.oxw(2);p.xp6(1),p.Q6J("ngIf","intro"===e.requestStatus),p.xp6(1),p.Q6J("ngIf","manual"===e.requestStatus),p.xp6(1),p.Q6J("ngIf","form"===e.requestStatus&&!e.settingRequestFromBack),p.xp6(1),p.Q6J("ngIf","error-data"===e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-birth-date"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-expiration-date"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-support-number"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","abandoned"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","otp"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","success"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","duplicated"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","no-phone"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","bad-phone"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","failed"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","no-service"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","standby"==e.requestStatus),p.xp6(1),p.Q6J("ngIf",e.showCancelRequest&&e.data.config.cancelRequest&&e.requestIDFromURL),p.xp6(1),p.Q6J("ngIf","form"===e.requestStatus&&!e.loading&&e.data[e.flowName]&&(null==e.data[e.flowName]?null:e.data[e.flowName].showAditionalDescription)&&e.data[e.flowName].texts&&e.data[e.flowName].texts.form&&e.data[e.flowName].texts.form.aditionalDescription)}}function jt(e,t){1&e&&p._UZ(0,"belender-disabled-url")}function zt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div")(1,"div",42)(2,"div",43),p._uU(3,"Error!"),p.qZA(),p._UZ(4,"div",44),p.qZA(),p.TgZ(5,"div",45)(6,"button",46),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.error=!1)})),p._uU(7,"Ingresar manualmente"),p.qZA()()()}if(2&e){const e=p.oxw(2);p.xp6(4),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",e.error,p.oJD)}}function Bt(e,t){if(1&e&&(p.TgZ(0,"div"),p.YNc(1,xt,3,2,"div",6),p.YNc(2,Ct,2,1,"div",7),p.YNc(3,Ht,19,18,"ng-container",4),p.YNc(4,jt,1,0,"belender-disabled-url",4),p.YNc(5,zt,8,3,"div",4),p.qZA()),2&e){const e=p.oxw();p.Gre("h-full w-full flex-auto p-0 md:p-3 ",null==e.data||null==e.data.styles?null:e.data.styles.typography,""),p.Udp("background",null==e.data||null==e.data.styles||null==e.data.styles.colors?null:e.data.styles.colors.background),p.xp6(1),p.Q6J("ngIf",e.warningAlert&&"success"!=e.requestStatus),p.xp6(1),p.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"===e.requestStatus),p.xp6(1),p.Q6J("ngIf",!e.error&&!e.disableURL),p.xp6(1),p.Q6J("ngIf",!e.error&&e.disableURL),p.xp6(1),p.Q6J("ngIf",!e.loading&&e.error&&"loading"!=e.requestStatus)}}function Jt(e,t){if(1&e&&(p.TgZ(0,"div",47),p._UZ(1,"mat-progress-spinner",48),p.TgZ(2,"p",49),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),p.xp6(2),p.Oqu(e.loading)}}function Vt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"vex-terms",50),p.NdJ("accepted",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.handleTermsResponse(!1))})),p.qZA()}if(2&e){const e=p.oxw();p.Q6J("flow",e.flowName)("lang",e.currentLang)("allData",e.data)("requestStatus",e.solicitud?e.solicitud.status_code:"")("requestID",e.requestID)}}function Qt(e,t){if(1&e&&(p.ynx(0),p.TgZ(1,"div",51),p._uU(2),p.qZA(),p.BQk()),2&e){const e=p.oxw();p.xp6(2),p.hij("TestMode ",e.testMode?"ON":"OFF","")}}function Wt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-tester-sms",52),p.NdJ("sendMessage",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.setMessageFromTest(t))})),p.qZA()}}let Gt=class{constructor(e,t,n,i,s,r,o,a,l,d,u,p,m){if(this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.flowsS=a,this.pinService=l,this.deviceInfoService=d,this.dialog=u,this.translationService=p,this.scrollService=m,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this._loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.introEnabled=!1,this.manual=!1,this.pinMode=!1,this.requestIDFromURL=!1,this.warningAlert=null,this.stopPropagationOfSuccess=!1,this.paramsSetted=!1,this.requestStatus="loading",this.disableURL=!1,this.settingRequestFromBack=!1,this.showCancelRequest=!1,this.requestedFromDetail=!1,this.env=c.N,this.intervalToAskBack=null,this.loadingRequestData=!1,this.intervalCount=0,this.requestedToPin=!1,this.currentHeight=0,this.socketOpened=!0,this.isScaled=!1,this.termsOpened=!1,this.flowName="SMS",this.labels=h.S.es,this.currentLang="",this.showTermsDialog=!1,"OTPCredential"in window){const e=new AbortController;navigator.credentials.get({otp:{transport:["sms"]},signal:e.signal}).then((e=>{this.showAlert("otp",e)})).catch((e=>{console.log(e)}))}this.deviceInfoDetails$=this.deviceInfoService.deviceInfo$.subscribe((e=>{Object.keys(e).length>0&&(this.deviceInfoDetails=e)}))}ngOnInit(){this.getWindowsScreenOrientation(),this.setWarningPortals();const e=this;this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.initFunctions(),"pro"!=c.N.env&&(l(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),l(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}get loading(){return this._loading}set loading(e){this._loading=e,null!==e&&this.onLoadingChanged(e)}onLoadingChanged(e){this.scrollUpContent()}initFunctions(){var e=this;return(0,i.Z)((function*(){var t;e.Activatedroute.queryParams.subscribe((t=(0,i.Z)((function*(t){t&&t.request_id&&(e.requestID=t.request_id),t.lang?(e.currentLang=t.lang,e.loading=e.translationService.getFirstLoading(e.currentLang),e.setTranslation()):e.loading=e.labels.loadings.gettingData,e.userId?e.setInitialData(e.userId):e.loading=null})),function(e){return t.apply(this,arguments)}))}))()}testNoti(e){this.showAlert("Titleeee","messsaggeee",e)}setTranslation(){let e=this.translationService.getLabelsTranslated(this.currentLang);e&&(this.labels=e)}testAlert(e){this.showAlert("Error de prueba","Esta es una prueba de un error",e)}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewChecked(){this.getWidgetCardHeight()}getWindowsScreenOrientation(){window.screen&&window.screen.orientation&&(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler))}getWidgetCardHeight(){let e=l("#widget-wrapper").height()||0;this.isScaled$=this.deviceInfoService.isScaled$.subscribe((t=>{this.isScaled=t,this.isScaled&&(e*=1.5)})),this.sendMessageToParent({type:"widgetHeight",data:e})}setWarningPortals(){this.flowsS.getFlows().then((e=>{e&&e.data&&e.data.length&&"OCCASIONAL_FAIL"==e.data.find((e=>e.name==this.flowName)).status&&!this.warningAlert&&(this.warningAlert=this.labels.warnings.ocassionalError)})).catch((e=>{console.error(e)}))}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}window.top.postMessage(e,"*")}setInitialData(e){var t=this;return(0,i.Z)((function*(){yield t.validateRequestIdInUrl();const n=yield t.getFlow(e),i=t.customizationStoreService.FUNDER_CONFIG;if(t.funderStyles=t.customizationStoreService.FUNDER_STYLES,console.warn(t.funderStyles),t.data={config:i,styles:t.funderStyles,[t.flowName]:n},!t.data.config||!t.data.config.funder_id)return t.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.introEnabled=t.data.config.introEnabled,t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.currentLang,t.requestID,t.solicitud?t.solicitud.status_code:"").then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}getConfig(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getFunderConfig(e).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{console.error(e),t.loading=null}))}))}))()}getStyle(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getFunderStyles(e).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{console.error(e),t.loading=null}))}))}))()}validateRequestIdInUrl(){var e=this;return(0,i.Z)((function*(){return new Promise((t=>{var n;e.Activatedroute.queryParams.subscribe((n=(0,i.Z)((function*(n){if(n&&(e.setParamsToRequest(n),e.loading=null),n&&n.acceptTerms&&(e.paramsSetted=!0,e.autoAcceptTerms=!0),n.success&&(e.stopPropagationOfSuccess=!0,e.paramsSetted=!0),n&&n.request_id){e.requestID=n.request_id,e.disableURL=!1;let i=yield e.setFormFromVcCode(n.request_id,n);e.requestIDFromURL=!0,e.paramsSetted=!0,t(i)}else e.loading=null,t(null)})),function(e){return n.apply(this,arguments)}),(n=>{e.loading=null,t(null)}))}))}))()}setParamsToRequest(e){this.solicitud||this.setRequestStatus("form"),(e.document_number||e.document)&&!this.solicitud.person_document_number&&(this.solicitud.person_document_number=e.document_number||e.document,this.requestIDFromURL=!0,this.paramsSetted=!0),(e.birth_date||e.birthday)&&!this.solicitud.person_birth_date&&(this.solicitud.person_birth_date=e.birth_date||e.birthday,this.requestIDFromURL=!0,this.paramsSetted=!0),e.phone&&!this.solicitud.person_phone&&(this.solicitud.person_phone=e.phone,this.requestIDFromURL=!0,this.paramsSetted=!0),e.email&&!this.solicitud.email&&(this.solicitud.email=e.email,this.requestIDFromURL=!0,this.paramsSetted=!0)}setFormFromVcCode(e,t){var n=this;return(0,i.Z)((function*(){return n.loading=n.labels.loadings.gettingData,n.settingRequestFromBack=!0,new Promise((i=>{n.solicitudesService.getSolicitudByCode(e).then((e=>{e&&e.data?(n.solicitud=e.data,n.setStatus(),n.setSubscriptionOfRequest(),n.loading=null,n.skipCreationOfRequest=n.solicitud&&n.solicitud.status_code&&"prerequest"!=n.solicitud.status_code,n.autoAcceptTerms?n.acceptTerms():n.setParamsToRequest(t)):n.loading=null,n.settingRequestFromBack=!1,i(n.solicitud||null)})).catch((e=>{n.loading=null,n.settingRequestFromBack=!1,i(null)}))}))}))()}setMessageFromTest(e){this.handlePusherNotification(e)}handlePusherNotification(e){this.dataFromFirebase=e,e&&e.widget_url&&(this.widgetUrl=e.widget_url),e&&e.widget_url_boxed&&(this.widgetUrlBoxed=e.widget_url_boxed),this.sendMessageToParent({type:"websocket",data:e}),this.dataFromFirebase&&this.dataFromFirebase.status_code&&("consent_process_completed"===this.dataFromFirebase.status_code&&this.disconnectWebsocket(),this.setRequestStatus(JSON.parse(JSON.stringify(this.dataFromFirebase.status_code))),"terms_and_conditions"!=this.solicitud.status_code&&"saved_otp"!=this.solicitud.status_code&&setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500))}resendOTP(e){let t={request_id:(this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID)||e,user_id:this.userId};this.loading=this.labels.loadings.resendingOtp,this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data,this.setStatus()),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}gotoTerms(e){this.loading=this.labels.loadings.sendingData,e.package_id=this.packId,e.user_id=this.userId,this.requestID&&(e.request_id=this.requestID),this.testMode?setTimeout((()=>{this.solicitud=new a.l,this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=null}),4e3):this.skipCreationOfRequest?(this.acceptTerms(),this.setSubscriptionOfRequest()):this.checkSmsService(e)}checkSmsService(e){this.formComponent.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0}),this.solicitudesService.checkService(e).then((t=>{t&&t.message&&t.status&&"error"==t.status?t.message.birth_date?(this.loading=null,this.setRequestStatus("form"),this.notis.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate),this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):"string"==typeof t.message&&" fecha de nacimiento incorrecta"==t.message.toLowerCase()?(this.loading=null,this.setRequestStatus("form"),this.notis.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc),this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):"string"==typeof t.message&&"does not have sms service"==t.message.toLowerCase()?(this.loading=this.labels.loadings.creatingRequest,e.user_id=this.userId,e.package_id=this.packId,this.requestID&&(e.request_id=this.requestID),this.solicitudesService.addSolicitud(e).then((e=>{e.data&&(this.requestID=e.data.request_id),this.solicitudesService.setNoService({request_id:this.requestID}).then((()=>{this.loading=null})),this.setRequestStatus("no_service"),this.setStatus()}))):"string"==typeof t.message&&"birthdate incorrect"==t.message.toLowerCase()?(this.loading=null,this.setRequestStatus("form"),this.notis.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc),this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):(this.setRequestStatus("form"),this.setStatus(),this.loading=null):t&&t.status&&"success"==t.status?this.addSolicitudSMS(e):(this.loading=null,this.setRequestStatus("form"),this.setStatus(),this.notis.showAlert("Error:",t.message||t))})).catch((e=>{console.error(e),this.loading=null,e.message&&"birthdate incorrect"==e.message.toLowerCase()&&(this.setRequestStatus("form"),this.notis.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc))}))}addSolicitudPIN(e){this.data[this.flowName]&&this.data[this.flowName].packID&&(e.package_id=this.data[this.flowName].packID),this.formComponent.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0}),this.pinService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?t.message&&(this.solicitud=e,400==t.code&&"Does not have Pin service"==t.message?(this.setRequestStatus("no_service"),this.loading=null):400==t.code&&"Incorrect support number"==t.message?(this.notis.showAlert(this.labels.warnings.error,this.labels.warnings.wrongSupport),this.setRequestStatus("form")):400==t.code&&"Incorrect date"==t.message?(this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate),this.setRequestStatus("form")):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,t.message)),this.setStatus()):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,location.pathname.indexOf("widget-boxed")>-1?location.assign(t.data.widget_url_boxed+"&acceptTerms=true"):location.assign(t.data.widget_url+"&acceptTerms=true"),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.errorMessage&&this.showAlert("Error!",e.errorMessage)}))}addSolicitudSMS(e){this.solicitudesService.addSolicitud(e,this.packId,this.userId).then((t=>{console.warn(t),t&&t.status&&"error"==t.status?(this.solicitud=e,t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc)):"Incorrect date"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("form"),this.showAlert("Error!",t.message)),this.setStatus())):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,this.setStatus(),this.setSubscriptionOfRequest(),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}validateHaveSmsMode(e){this.solicitudesService.checkService(e).then((t=>{t&&t.message&&"does not have sms service"==t.message.toLowerCase()?(this.solicitud=e,this.setRequestStatus("form"),this.pinMode=!0,this.loading=null,this.showAlert(this.labels.warnings.noSms,this.labels.warnings.noSmsDesc)):this.addSolicitudSMS(e)})).catch((e=>{console.error(e)}))}createRequestFromDNI(e){let t={document_number:e,user_id:this.userId,package_id:this.packId,check_legal:!0};this.solicitudesService.addSolicitud(t,this.packId,this.userId).then((e=>{e&&e.status&&"error"==e.status?(this.solicitud=t,e.message&&(400==e.code?"Birthdate incorrect"==e.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc)):"Incorrect date"==e.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("form"),this.showAlert("Error!",e.message))),this.setStatus()):e&&e.status&&"success"==e.status?(this.requestID=e.data.request_id,this.solicitud=e.data,this.setStatus(),this.setSubscriptionOfRequest(),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+e)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}setSubscriptionOfRequest(){if(this.socket)return;const e=this;let t="wss://notifications.dev.belender.net";"qa"==c.N.env&&(t="wss://notifications.qa.belender.net"),"pro"==c.N.env&&(t="wss://notifications.belender.net"),c.N.notificationsBaseUrl&&(t=c.N.notificationsBaseUrl),this.socket=new WebSocket(`${t}?requests_id=${this.requestID}&user_id=${this.userId}`),this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(t){let n=JSON.parse(t.data);console.warn("message from wss: ",n),e.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada"),this.socketOpened=!1}}sendNewData(e){this.loading=this.labels.loadings.sendingData,this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e.message,"error"),this.loading=null):e&&"success"==e.status&&(this.loading=this.labels.loadings.validatingData,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}showAlert(e,t,n){this.loading=null;let i=this.getFunderIconType(n);this.notis.showAlert(e,t,i)}getFunderIconType(e){if(!e||!this.funderStyles)return"error";switch(e){case"error":return this.funderStyles.errorIcon||e;case"success":return this.funderStyles.successIcon||e;case"warning":return this.funderStyles.warningIcon||e;case"info":return this.funderStyles.infoIcon||e;default:return e}}setBirthDate(e){}setExpiration(e){}setSupportNumber(e){}acceptTerms(e=!0){let t={request_id:this.requestID,user_id:this.userId,terms_and_conditions:!0,opening:this.termsOpened?1:0};Object.keys(this.deviceInfoDetails).length>0&&(t={...t,ip:this.deviceInfoDetails.ip,device:this.deviceInfoDetails.device,os:`${this.deviceInfoDetails.os} ${this.deviceInfoDetails.os_version}`,resolution:this.deviceInfoDetails.screen}),e&&(this.loading=this.labels.loadings.validatingAndLoginSS),this.solicitudesService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?(e.message&&"You have a request in progress"==e.message?location.pathname.indexOf("widget-boxed")>-1?location.assign(e.response.widget_url_boxed):location.assign(e.response.widget_url):e.message?"Invalid request status: stand_by"==e.message?this.setRequestStatus("stand_by"):this.showAlert("Error!",e.message):this.showAlert("Error!",e),this.loading=null):e&&"success"==e.status?(this.solicitud=e.data,this.setStatus(),this.setSubscriptionOfRequest(),this.loading=null,this.cd.markForCheck()):this.loading=null})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}requestOTP(e){this.loading=this.labels.loadings.sendingData,this.testMode?setTimeout((()=>{this.solicitud=new a.l,this.setRequestStatus("all_documents_downloaded"),this.setStatus(),this.loading=null}),2e3):this.solicitudesService.sendOTP({request_id:this.requestID,user_id:this.userId,code:e.code}).then((e=>{e.status&&"error"==e.status?(e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.showAlert(this.labels.warnings.error,this.labels.warnings.noOtp):this.showAlert("Error!",e.message?e.message:e),this.loading=null):e&&"success"==e.status&&(this.handleRequestStatus(e.data||e),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}askToBack(){this.solicitudesService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.setStatus(),this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}gotoErrorPhone(){}setRequestStatus(e){if(this.solicitud)this.solicitud.status_code=e;else{let t=new a.l;t.status_code=e,this.solicitud=t}this.setStatus()}retryRequest(e){let t={request_id:(this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID)||e,user_id:this.userId};this.loading=this.labels.loadings.resendingRequest,this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data,this.setStatus()),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}newRequest(e){this.setRequestStatus("created")}gotoManual(){this.manual=!0,this.cd.markForCheck()}gotoIntro(){this.manual=!1}goFlow(){this.introEnabled=!1}goIntro(){this.manual=!1,this.introEnabled=!0}disconnectWebsocket(){this.socket&&this.socket.close()}gotoPin(){this.requestedToPin=!0;let e={request_id:this.solicitud.request_id};this.loading=this.labels.loadings.smsToPin,this.solicitudesService.noPhone(e).then((e=>{this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}gotoClavePinUrl(e){location.href.indexOf("widget-boxed")>-1?location.assign(e.widget_url_boxed):location.assign(e.widget_url)}setPhone(e){this.loading=this.labels.loadings.sendingNewPhone,this.solicitudesService.setPhone({phone:e},this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID)}setNoPhone(){this.loading=this.labels.loadings.validatingData,this.solicitudesService.noPhone({request_id:this.solicitud.request_id})}sendDataToPin(e){e.request_id=this.solicitud.request_id,this.loading=this.labels.loadings.sendingData,this.solicitudesService.smsToPin(e).then((e=>{e&&e.status&&"success"===e.status&&this.gotoClavePinUrl(e.data),e&&e.status&&"error"===e.status&&(e.message?"Does not have Pin service"==e.message?this.setRequestStatus("no-service"):this.showAlert("Error!",e.message):this.showAlert("Error!",e),this.loading=null)})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}requestStatusFromDetail(){this.requestedFromDetail=!0,this.loading=this.labels.loadings.validatingRequest,this.solicitudesService.getSolicitudByCode(this.solicitud.request_id).then((e=>{e&&e.consent_process_completed&&this.setRequestStatus("consent_process_completed"),this.loading=null})).catch((e=>{this.loading=null,this.setRequestStatus("failed")}))}handleRequestStatus(e){let t=new a.l;e.consent_process_completed?(this.requestedFromDetail=!0,t.status_code="consent_process_completed",this.solicitud=t,setTimeout((()=>{this.disconnectWebsocket()}),3e3),this.setStatus(),this.data[this.flowName].showDocumentsOnSuccess&&!this.intervalToAskBack&&this.initIntervalToAskBack()):(this.otpComponent&&this.otpComponent.resetOtpNumber(),e.otp_status?"VALID"===e.otp_status?e.nex_step_detail&&"Seguridad Social"===e.nex_step_detail.portal&&(t.status_code="waiting_otp_seguridad_social",this.solicitud=t,this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)):"INVALID"===e.otp_status&&(t.status_code=e.status_code,this.solicitud=t,this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)):(t.status_code="failed",this.solicitud=t,this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp))),this.loading=null}initIntervalToAskBack(){!this.solicitud||!this.solicitud.request_id||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(this.solicitud.request_id),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack)}askDetailToBack(e){if(!e&&!this.requestID)return void this.stopInterval();let t=JSON.parse(JSON.stringify(this.solicitud.status_code));this.pinService.getSolicitudByCode(e).then((e=>{e&&e.data&&t!=e.data.status_code&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code))})).catch((e=>{this.loading=null,this.loadingRequestData=!1}))}handleBadPhone(){this.disconnectWebsocket(),this.loading=this.labels.loadings.validatingData,setTimeout((()=>{this.solicitud||(this.solicitud=new a.l),this.setRequestStatus("failed_without_retry"),this.setStatus(),this.loading=null}),3e3)}setCancel(e){this.setRequestStatus(e),this.setStatus()}setStatus(){if(this.showCancelRequest=!0,this.manual)this.requestStatus="manual";else if(this.introEnabled)this.requestStatus="intro";else if(this.solicitud){if(this.solicitud){let e=u[this.solicitud.status_code];if(e){if("success"===e&&this.data.config&&this.data.config.infiniteLoopInCompleted)return void(this.requestStatus="loading");if(("abandoned"===e||"failed"===e)&&(this.showCancelRequest=!1),"phone_not_exist_otp"===e)return void(this.data&&this.data.config&&this.data.config.tryPinWithoutSMS?(this.showCancelRequest=!1,this.gotoPin(),this.requestStatus="loading"):this.requestStatus=this.data.config.noRetryInBadPhone?"otp":"error-data");if("no-service"===e&&(this.requestStatus=e,this.data&&this.data.config&&this.data.config.tryPinWithoutSMS))return void(!this.requestedToPin&&this.gotoPin());if("bad-phone"===e&&this.data&&this.data.config&&this.data.config.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone");if("no-phone"===e){if(this.data&&this.data.config&&!this.data.config.tryPinWithoutSMS)return void(this.requestStatus="no-service");if(this.data&&this.data.config&&this.data.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone")}this.requestStatus=e,this.scrollUpContent()}}}else this.requestStatus="form"}scrollUpContent(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),300)}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,e&&(this.termsOpened=!0,this.formComponent.setTermsCheck(!0))}};Gt.ɵfac=function(e){return new(e||Gt)(p.Y36(p.sBO),p.Y36(m.gz),p.Y36(f.F),p.Y36(g.M),p.Y36(_.w),p.Y36(b.r),p.Y36(y.T),p.Y36(v.s),p.Y36(w.v),p.Y36(x.H),p.Y36(C.uw),p.Y36(k.D),p.Y36(T.a))},Gt.ɵcmp=p.Xpm({type:Gt,selectors:[["belender-widget-sms"]],viewQuery:function(e,t){if(1&e&&(p.Gf(vt,5),p.Gf(wt,5),p.Gf(vt,5)),2&e){let e;p.iGM(e=p.CRH())&&(t.formComponent=e.first),p.iGM(e=p.CRH())&&(t.otpComponent=e.first),p.iGM(e=p.CRH())&&(t.theDiv=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[p._Bn([{provide:r.o2,useValue:{appearance:"standard"}}])],decls:6,vars:5,consts:[[1,"h-full","widget-belender"],[3,"class","background",4,"ngIf"],["class","loading-wrapper",4,"ngIf"],[3,"flow","lang","allData","requestStatus","requestID","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"sendMessage",4,"ngIf"],["class","flex justify-start px-4 py-3 items-center font-bold gap-3 text-md bg-amber-500/20 rounded-sm border border-amber-500 text-amber-500",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],[1,"flex","justify-start","px-4","py-3","items-center","font-bold","gap-3","text-md","bg-amber-500/20","rounded-sm","border","border-amber-500","text-amber-500"],["svgIcon","mat:warning"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],["class","h-full ",3,"data","flowName","gotoFlow","gotoManual",4,"ngIf"],["class","h-full ",3,"data","flowName","solicitud","packId","userId","dniChange","goBack",4,"ngIf"],[3,"requestIDFromURL","lang","userId","flowName","data","labels","texts","solicitud","pinMode","goIntro","goToTerms","nextStep",4,"ngIf"],[3,"solicitud","data","labels","texts","nextStep",4,"ngIf"],[3,"data","labels","texts","nextStep",4,"ngIf"],[3,"solicitud","data","labels","texts","retry",4,"ngIf"],[3,"otpType","labels","logoCustom","flowType","data","texts","solicitud","minLength","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","packId","flowName","userId","requestID","texts",4,"ngIf"],[3,"data","labels","currentRequest","newRequest",4,"ngIf"],[3,"data","labels","texts","nextStep","noPhone",4,"ngIf"],[3,"data","labels","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"texts","data","labels",4,"ngIf"],[3,"flowType","request_id","user_id","data","labels","textColor","customText","updateStatusCode",4,"ngIf"],["class","subheading-1 p-4 custom-html",3,"color","innerHTML",4,"ngIf"],[1,"h-full",3,"data","flowName","gotoFlow","gotoManual"],[1,"h-full",3,"data","flowName","solicitud","packId","userId","dniChange","goBack"],[3,"requestIDFromURL","lang","userId","flowName","data","labels","texts","solicitud","pinMode","goIntro","goToTerms","nextStep"],["formStep",""],[3,"solicitud","data","labels","texts","nextStep"],[3,"data","labels","texts","nextStep"],[3,"solicitud","data","labels","texts","retry"],[3,"otpType","labels","logoCustom","flowType","data","texts","solicitud","minLength","resendOTP","errorPhone","nextStep"],["otpStep",""],[3,"data","labels","packId","flowName","userId","requestID","texts"],[3,"data","labels","currentRequest","newRequest"],[3,"data","labels","texts","nextStep","noPhone"],[3,"data","labels","texts","solicitud","retry","newRequest"],[3,"texts","data","labels"],[3,"flowType","request_id","user_id","data","labels","textColor","customText","updateStatusCode"],[1,"subheading-1","p-4","custom-html",3,"innerHTML"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[1,"loading-wrapper"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[3,"flow","lang","allData","requestStatus","requestID","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"],[3,"sendMessage"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0),p.YNc(1,Bt,6,10,"div",1),p.YNc(2,Jt,4,3,"div",2),p.qZA(),p.YNc(3,Vt,1,5,"vex-terms",3),p.YNc(4,Qt,3,1,"ng-container",4),p.YNc(5,Wt,1,0,"belender-tester-sms",5)),2&e&&(p.xp6(1),p.Q6J("ngIf",t.data&&t.data.styles&&t.data.styles.colors),p.xp6(1),p.Q6J("ngIf",t.loading&&!t.error),p.xp6(1),p.Q6J("ngIf",t.showTermsDialog),p.xp6(1),p.Q6J("ngIf",t.testMode),p.xp6(1),p.Q6J("ngIf",t.testMode))},dependencies:[M.O5,S.Hw,I.lW,O.Ou,L.R,P.u,A.L,E.q,D.y,N.i,V,X,oe,Re,Ze,He,Be,We,$e,Xe,tt,it,ut,yt,Z.z],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative;min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"],data:{animation:[d.$]}}),Gt=(0,s.gn)([(0,o.c)()],Gt)},3006:(e,t,n)=>{n.r(t),n.d(t,{SmsModule:()=>B});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),y=n(9391),v=n(1572),w=n(182),x=n(4144),C=n(7367),k=n(9602),T=n(3238),M=n(5895),S=n(6257),I=n(1948),O=n(4246),L=n(9299),P=n(6e3),A=n(8364),E=n(4650);const D=[{path:":idUser",component:A.T},{path:":idUser/:packID",component:A.T}];let N=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=E.oAB({type:e}),e.ɵinj=E.cJS({imports:[L.Bz.forChild(D),L.Bz,P.d8]}),e})();var Y=n(6981),q=n(1129),R=n(9476),F=n(8962),Z=n(3468),U=n(3295),H=n(3300),j=n(865),z=n(3033);let B=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=E.oAB({type:e}),e.ɵinj=E.cJS({providers:[_.M,y.o,C.w,w.t,M.T,O.t,{provide:T.Ad,useValue:"es-ES"}],imports:[N,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,v.Cq,k.FA,T.XK,S.T5,I.Fk,Y.x,q.n,R.F,F.A,Z.f,U.g,H.C,j.q,z.d]}),e})()},1724:(e,t,n)=>{n.r(t),n.d(t,{VideoIdModule:()=>kt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),y=n(9391),v=n(1572),w=n(182),x=n(4144),C=n(7367),k=n(9602),T=n(3238),M=n(5895),S=n(6257),I=n(1948),O=n(4246),L=n(9299),P=n(6e3),A=n(5861),E=n(7582),D=n(9549),N=n(9933),Y=n(5762),q=n(8259),R=n(2340),F=n(1363),Z=n(4650),U=n(5089),H=n(529),j=n(6554);let z=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}getSolicitudes(){return this.localFetch.getFetch(R.N.baseUrl+"/requests")}getSolicitudByCode(e){return this.localFetch.freeGetFetch(R.N.baseUrl+"/requests/"+e)}setState(e,t){let n={request_id:e,status:t};return new Promise(((e,t)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid/status",n).then((n=>{n?e(n):t(n)})).catch((e=>{console.error("addSolicitud",e),t(e)}))}))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid",e).then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/sms/check-service",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/sms/retry",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/sms/resend-otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${R.N.baseUrl}/requests/${e}/person`,t).then((e=>{e?n(e):i(e)})).catch((e=>{i(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(`${R.N.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?n(e):i(e)})).catch((e=>{i(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(Z.LFG(U.F),Z.LFG(H.eN),Z.LFG(j.r))},e.ɵprov=Z.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var B=n(8460),J=n(5412),V=n(6830),Q=n(833),W=n(4302),G=n(3731);function $(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij("¿No has recibido el código? Solicítalo de nuevo en ",e.secsCount," segundos")}}function K(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.AsE("¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? Solicítalo de nuevo en ",e.secsCount," segundos")}}function X(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij("¿No has recibido el código en tu teléfono? Solicítalo de nuevo en ",e.secsCount," segundos")}}const ee=function(e,t,n){return{color:e,border:t,background:n}};function te(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"small",11),Z.YNc(2,$,2,1,"span",5),Z.YNc(3,K,2,2,"span",5),Z.YNc(4,X,2,1,"span",5),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(4,ee,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&e.data.config.noRetryInBadPhone)}}function ne(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1," ¿No has recibido el código en tu teléfono? "),Z.qZA())}function ie(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? ")}}function se(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1," ¿No has recibido el código en el teléfono? "),Z.qZA())}const re=function(e,t){return{color:e,background:t}};function oe(e,t){if(1&e){const e=Z.EpF();Z.ynx(0),Z.TgZ(1,"small",11),Z.YNc(2,ne,2,0,"span",5),Z.YNc(3,ie,2,1,"span",5),Z.YNc(4,se,2,0,"span",5),Z.TgZ(5,"a",12),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.resendOTP())})),Z._uU(6,"Reenviar"),Z.qZA()(),Z.BQk()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(5,ee,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngIf",e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngStyle",Z.WLB(9,re,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor))}}let ae=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new Z.vpe(null),this.errPhone=new Z.vpe(null),this.resendO=new Z.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,A.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?q(e.target).next().focus():"Backspace"==e.code&&q(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:16,vars:20,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.TgZ(5,"div",4),Z.YNc(6,te,5,8,"ng-container",5),Z.YNc(7,oe,7,12,"ng-container",5),Z.qZA(),Z.TgZ(8,"div",6)(9,"mat-form-field",7)(10,"mat-label"),Z._uU(11," Código OTP "),Z.qZA(),Z.TgZ(12,"input",8),Z.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),Z.qZA()()()(),Z.TgZ(13,"div",9)(14,"button",10),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(15,"Siguiente"),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.otp.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,18,t.texts.otp.description||""),Z.oJD),Z.xp6(3),Z.Q6J("ngIf",t.secsCount&&t.secsCount>0),Z.xp6(1),Z.Q6J("ngIf",!t.secsCount||t.secsCount<=0),Z.xp6(7),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,i.PC,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function le(e,t){if(1&e&&(Z.TgZ(0,"div",2),Z._UZ(1,"div",3)(2,"div",4),Z.ALo(3,"safeHtml"),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),Z.Q6J("innerHTML",e.texts.success.title,Z.oJD),Z.xp6(1),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(3,8,e.texts.success.description||""),Z.oJD)}}function ce(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",6),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.gotoRedirect())})),Z._uU(2),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),Z.xp6(1),Z.hij(" ",e.data[e.flowName].btnTextCallBack||"Haga click aquí para finalizar"," ")}}let de=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.videoS=n,this.route=i}ngOnInit(){this.route.queryParams.subscribe((e=>{e.request_id&&(this.requestID=e.request_id,this.videoS.setState(this.requestID,"success").then((e=>{console.log("Se ha seteado el status success correctamente")})).catch((e=>{console.error("No se ha seteado el status success. Error: ",e)})))}))}save(){}gotoRedirect(){this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(z),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",packId:"packId",requestID:"requestID",userId:"userId",flowName:"flowName"},decls:2,vars:2,consts:[["class","pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.YNc(0,le,4,10,"div",0),Z.YNc(1,ce,3,7,"div",1)),2&e&&(Z.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),Z.xp6(1),Z.Q6J("ngIf",t.data[t.flowName].enableUrlCallBack))},dependencies:[i.O5,u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ue(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",6),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.retry())})),Z._uU(2,"Intentarlo nuevamente"),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function he(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.newRequest())})),Z._uU(2,"Crear nueva solicitud"),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}let pe=(()=>{class e{constructor(e,t,n){this.utils=e,this.videoS=t,this.route=n,this.retryOp=new Z.vpe(null),this.newReq=new Z.vpe(null)}ngOnInit(){this.route.queryParams.subscribe((e=>{e.request_id&&(this.requestID=e.request_id,this.videoS.setState(this.requestID,"failed").then((e=>{console.log("Se ha seteado el status failed correctamente")})).catch((e=>{console.error("No se ha seteado el status failed. Error: ",e)})))}))}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(U.F),Z.Y36(z),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:7,vars:8,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.YNc(5,ue,3,6,"div",4),Z.YNc(6,he,3,6,"div",4),Z.qZA()),2&e&&(Z.xp6(2),Z.Q6J("innerHTML",t.texts.fail.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,6,t.texts.fail.description),Z.oJD),Z.xp6(2),Z.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),Z.xp6(1),Z.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var me=n(1763),fe=n(5696);const ge=["termsCheckbox"],_e=["termsCertCheckbox"],be=["assignmentCheckbox"];function ye(e,t){if(1&e&&(Z.TgZ(0,"mat-form-field",5)(1,"mat-label"),Z._uU(2,"Razón social"),Z.qZA(),Z._UZ(3,"input",28),Z.qZA()),2&e){const e=Z.oxw();Z.Gre("",e.disabledInputs.razon?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",e.disabledInputs.razon?-1:1)}}function ve(e,t){if(1&e&&(Z.TgZ(0,"mat-form-field",5)(1,"mat-label"),Z._uU(2,"CIF"),Z.qZA(),Z._UZ(3,"input",29),Z.qZA()),2&e){const e=Z.oxw();Z.Gre("",e.disabledInputs.cif?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",e.disabledInputs.cif?-1:1)}}function we(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",30)(1,"belender-checkbox",22),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setPower(t))})),Z._uU(2," Consiento expresamente a la activación de un poder digital según las condiciones que pueden verse "),Z.TgZ(3,"a",24),Z.NdJ("click",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.gotoPowerConditions(t))})),Z.TgZ(4,"u"),Z._uU(5,"aquí"),Z.qZA()()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title)}}function xe(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",21)(1,"belender-checkbox",22,31),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setAssignment(t))})),Z._UZ(3,"div",32),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("innerHTML",null==e.data?null:e.data.config.dataAssignmentText,Z.oJD)}}const Ce=function(e){return{"dont-show-data":e}},ke={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Te=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.cd=n,this.requestID=null,this.next=new Z.vpe(null),this.goTerms=new Z.vpe(null),this.goTermsCert=new Z.vpe(null),this.goPower=new Z.vpe(null),this.acceptTerms=!1,this.acceptTerms2=!1,this.step=0,this.assignment=!1,this.disabledInputs={dni:!1,name:!1,lastname:!1,secondlastname:!1,phone:!1,email:!1,razon:!1,cif:!1,type:!1},this.requestAux={phone:null,email:null,razon:null,cif:null,name:null,lastname:null,secondLastname:null,dni:null,type:"NATURAL"},this.noValidate=!1,this.powerActivate=!1}ngOnInit(){this.solicitud?(this.noValidate="terms_and_conditions"==this.solicitud.status_code,this.setForm(this.solicitud)):this.setForm(null)}tabChanged(e){this.requestAux.type=e.value,this.setForm(this.requestAux)}setForm(e){this.requestAux.phone=e?e.person_phone||e.phone:null,this.requestAux.email=e?e.person_email||e.email||e.email_copy:null,this.requestAux.razon=e&&e.razon_social?e.razon_social:null,this.requestAux.cif=e&&e.cif?e.cif:null,this.requestAux.name=e?e.person_name||e.name:null,this.requestAux.lastname=e?e.person_first_surname||e.first_surname:null,this.requestAux.secondLastname=e?e.person_second_surname||e.second_surname:null,this.requestAux.dni=e&&e.document_number?e.document_number:e&&e.person_document_number?e.person_document_number:null,this.requestAux.type=e&&e.person_type?e.person_type:this.requestAux.type,this.form=this.fb.group("NATURAL"==this.requestAux.type?{type:[this.requestAux.type],name:[this.requestAux.name||null,this.noValidate?[]:[p.kI.required]],lastname:[this.requestAux.lastname||null,this.noValidate?[]:[p.kI.required]],secondLastname:[this.requestAux.secondLastname||null],email:[this.requestAux.email||null,this.noValidate?[]:[p.kI.required,p.kI.email]],phone:[this.requestAux.phone||"",this.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],dni:[this.requestAux.dni||null,this.noValidate?[]:[p.kI.required]]}:{type:[this.requestAux.type],name:[this.requestAux.name||null,this.noValidate?[]:[p.kI.required]],lastname:[this.requestAux.lastname||null,this.noValidate?[]:[p.kI.required]],secondLastname:[this.requestAux.secondLastname||null],email:[this.requestAux.email||null,this.noValidate?[]:[p.kI.required,p.kI.email]],dni:[this.requestAux.dni||null,this.noValidate?[]:[p.kI.required]],phone:[this.requestAux.phone||"",this.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],razon:[this.requestAux.razon||null,this.noValidate?[]:[p.kI.required]],cif:[this.requestAux.cif||null,this.noValidate?[]:[p.kI.required]]}),this.requestIDFromURL&&this.disableEnableInputs(this.requestAux.type,this.requestAux.name,this.requestAux.lastname,this.requestAux.secondLastname,this.requestAux.email,this.requestAux.phone,this.requestAux.dni,this.requestAux.razon,this.requestAux.cif),this.cd.markForCheck()}disableEnableInputs(e,t,n,i,s,r,o,a,l){this.disabledInputs={name:t||!1,lastname:n||!1,secondlastname:i||!1,email:s||!1,phone:r||!1,dni:o||!1,razon:a||!1,cif:l||!1,type:e||!1}}enableInput(e){this.disabledInputs[e]=!1,this.cd.markForCheck()}nextStep(){let e;e="NATURAL"==this.requestAux.type?{email_copy:this.form.get("email").value,phone:this.form.get("phone").value,name:this.form.get("name").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("secondLastname").value,document_number:this.form.get("dni").value,type:"Natural"}:{email_copy:this.form.get("email").value,phone:this.form.get("phone").value,name:this.form.get("name").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("secondLastname").value,document_number:this.form.get("dni").value,company_name:this.form.get("razon").value,cif:this.form.get("cif").value,type:"Legal",rmc_validation:this.userId},(this.data.config.activatePower||this.solicitud?.power_activate)&&(e.power_activate=1,e.terms_and_conditions_power=1),this.next.emit(e)}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(e){e.preventDefault(),e.stopPropagation(),this.goTermsCert.emit(!0)}setAssignment(e){this.assignment=e}getAssignmentValidation(){return!this.data.config.dataAssignmentCheck||this.assignment}setTerms2(e){this.acceptTerms2=e}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setTerms2Check(e){this.certCheckComponent.checked=e,this.acceptTerms2=e}setAssignmentCheck(e){this.assignmentCheckComponent.checked=e,this.assignment=e}setTerms(e){this.acceptTerms=e}getIfValid(){let e=this.form.invalid;return this.noValidate&&(e=!1),!((this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&!this.powerActivate)&&!e&&this.acceptTerms&&this.acceptTerms2&&this.getAssignmentValidation()}setPower(e){this.powerActivate=e}gotoPowerConditions(e){this.goPower.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(Z.sBO))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(Z.Gf(ge,5),Z.Gf(_e,5),Z.Gf(be,5)),2&e){let e;Z.iGM(e=Z.CRH())&&(t.checkComponent=e.first),Z.iGM(e=Z.CRH())&&(t.certCheckComponent=e.first),Z.iGM(e=Z.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{requestID:"requestID",flowName:"flowName",data:"data",texts:"texts",solicitud:"solicitud",userId:"userId",requestIDFromURL:"requestIDFromURL"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",goPower:"goToPower"},features:[Z._Bn([{provide:T.sG,useValue:ke},{provide:Z.soG,useValue:"es-ES"}])],decls:57,vars:63,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-1","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between",3,"ngClass"],["appearance","outline"],["formControlName","type",3,"tabindex","selectionChange"],["value","NATURAL"],["value","LEGAL"],["formControlName","name","matInput","",3,"tabindex"],["formControlName","lastname","matInput","",3,"tabindex"],["formControlName","secondLastname","matInput","",3,"tabindex"],["formControlName","email","placeholder","Ej: mi_email@dominio.com","type","email","matInput","",3,"tabindex"],["formControlName","phone","placeholder","Ej: 123123123","maxlength","9","type","text","matInput","",3,"tabindex"],["formControlName","dni","maxlength","9","minlength","9","placeholder","Ej: 2222221R","type","text","matInput","",3,"tabindex"],["appearance","outline",3,"class",4,"ngIf"],[1,"mt-8","flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","showPolicyLink","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["class","flex justify-between items-center w-full flex-100",4,"ngIf"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["termsCertCheckbox",""],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],["formControlName","razon","placeholder","Ej: Mi Empresa","type","text","matInput","",3,"tabindex"],["formControlName","cif","placeholder","Ej: 123123123","type","text","matInput","",3,"tabindex"],[1,"flex","justify-between","items-center","w-full","flex-100"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.TgZ(5,"div",4)(6,"mat-form-field",5)(7,"mat-label"),Z._uU(8,"Tipo de persona"),Z.qZA(),Z.TgZ(9,"mat-select",6),Z.NdJ("selectionChange",(function(e){return t.tabChanged(e)})),Z.TgZ(10,"mat-option",7),Z._uU(11,"Natural"),Z.qZA(),Z.TgZ(12,"mat-option",8),Z._uU(13,"Legal"),Z.qZA()()(),Z.TgZ(14,"mat-form-field",5)(15,"mat-label"),Z._uU(16,"Nombre"),Z.qZA(),Z._UZ(17,"input",9),Z.qZA(),Z.TgZ(18,"mat-form-field",5)(19,"mat-label"),Z._uU(20,"Primer apellido"),Z.qZA(),Z._UZ(21,"input",10),Z.qZA(),Z.TgZ(22,"mat-form-field",5)(23,"mat-label"),Z._uU(24,"Segundo apellido"),Z.qZA(),Z._UZ(25,"input",11),Z.qZA(),Z.TgZ(26,"mat-form-field",5)(27,"mat-label"),Z._uU(28,"Email"),Z.qZA(),Z._UZ(29,"input",12),Z.qZA(),Z.TgZ(30,"mat-form-field",5)(31,"mat-label"),Z._uU(32,"Teléfono"),Z.qZA(),Z._UZ(33,"input",13),Z.qZA(),Z.TgZ(34,"mat-form-field",5)(35,"mat-label"),Z._uU(36,"DNI"),Z.qZA(),Z._UZ(37,"input",14),Z.qZA(),Z.YNc(38,ye,4,4,"mat-form-field",15),Z.YNc(39,ve,4,4,"mat-form-field",15),Z.qZA(),Z.TgZ(40,"div",16)(41,"belender-checkbox",17,18),Z.NdJ("changeCheckbox",(function(e){return t.setTerms2(e)})),Z.TgZ(43,"belender-terms-and-policy-links",19),Z.NdJ("goToTerms",(function(e){return t.gotoTermsAndConditions(e)})),Z.qZA()()(),Z.YNc(44,we,6,1,"div",20),Z.TgZ(45,"div",21)(46,"belender-checkbox",22,23),Z.NdJ("changeCheckbox",(function(e){return t.setTerms(e)})),Z._uU(48," He leído y acepto los "),Z.TgZ(49,"a",24),Z.NdJ("click",(function(e){return t.gotoTermsAndConditionsCertificate(e)})),Z.TgZ(50,"u"),Z._uU(51,"términos y condiciones"),Z.qZA()(),Z._uU(52," para la emisión del certificado "),Z.qZA()(),Z.YNc(53,xe,4,2,"div",25),Z.TgZ(54,"div",26)(55,"button",27),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(56," Continuar "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.form.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,59,t.texts.form.description||""),Z.oJD),Z.xp6(2),Z.Q6J("ngClass",Z.VKq(61,Ce,t.data.config.dontShowDataInTerms&&t.solicitud&&t.solicitud.status_code&&"terms_and_conditions"===t.solicitud.status_code)),Z.xp6(1),Z.Gre("",t.disabledInputs.type?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.type?-1:1),Z.xp6(5),Z.Gre("",t.disabledInputs.name?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.name?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.lastname?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.lastname?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.secondlastname?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.secondlastname?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.email?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.email?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.phone?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.phone?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.dni?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.dni?-1:1),Z.xp6(1),Z.Q6J("ngIf","LEGAL"==t.requestAux.type),Z.xp6(1),Z.Q6J("ngIf","LEGAL"==t.requestAux.type),Z.xp6(2),Z.Q6J("color",t.data.styles.colors.title),Z.xp6(2),Z.Q6J("userId",t.userId)("showPolicyLink",null==t.data?null:t.data.config.showPolicyLink)("firstSentence",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.firstSentence)("secondSentence",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.secondSentence)("thirdSentence",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.thirdSentence)("policyActionText",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.policyActionText)("termsActionText",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.termsActionText)("customTerms",t.data[t.flowName].customTerms),Z.xp6(1),Z.Q6J("ngIf",t.requestID?null==t.solicitud?null:t.solicitud.power_activate:null==t.data?null:t.data.config.activatePower),Z.xp6(2),Z.Q6J("color",t.data.styles.colors.title),Z.xp6(7),Z.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),Z.xp6(2),Z.Udp("color",t.getIfValid()?t.data.styles.colors.btnText:"")("background",t.getIfValid()?t.data.styles.colors.btnBg:"")("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",!t.getIfValid()))},dependencies:[i.mk,i.O5,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,f.gD,T.ey,me.b,fe.T,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})(),Me=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.Activatedroute=n,this.next=new Z.vpe(null),this.accept=!1}ngOnInit(){this.Activatedroute.queryParams.subscribe((e=>{this.setForm(e)}))}nextStep(){let e={phone:this.form.get("phone").value};this.next.emit(e)}setForm(e){this.form=this.fb.group({phone:["",p.kI.required]}),this.solicitud&&"bad_phone"==this.solicitud.status_code&&this.form.controls.phone.markAsTouched()}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-error-form-step"]],inputs:{data:"data",flowName:"flowName",texts:"texts",mode:"mode",solicitud:"solicitud"},outputs:{next:"nextStep"},decls:14,vars:14,consts:[[1,"animated","fadeIn","fixed-content",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","phone","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1)(2,"div",2),Z._uU(3," Error con el teléfono "),Z.qZA(),Z.TgZ(4,"div",3),Z._uU(5," El teléfono ingresado no coincide con registrado en la Seguridad Social, por favor ingrese otro "),Z.qZA()(),Z.TgZ(6,"div",4)(7,"mat-form-field",5)(8,"mat-label"),Z._uU(9,"Teléfono"),Z.qZA(),Z._UZ(10,"input",6),Z.qZA()(),Z.TgZ(11,"div",7)(12,"button",8),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(13," Continuar "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.xp6(2),Z.Udp("color",t.data.styles.colors.text),Z.xp6(8),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Se=n(5145);let Ie=(()=>{class e{constructor(e){this.utils=e,this.status="",this.label="Cargando datos.."}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":Se.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)}))}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(U.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"mat-progress-spinner"),Z.TgZ(3,"p"),Z._uU(4),Z.qZA()()()),2&e&&(Z.xp6(4),Z.Oqu(t.label))},dependencies:[v.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Oe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new Z.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return"Abandonado después de esperar OTP de Seguridad Social";case"abandoned_after_invalid_otp_seguridad_social":return"Abandonado despues de OTP inválido en Seguridad Social";case"abandoned_after_invalid_otp_aeat":return"Abandonado despues de OTP inválido en AEAT";case"abandoned_after_waiting_otp_aeat":return"Abandonado después de esperar OTP de AEAT";default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(y.o),Z.Y36(M.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:10,vars:17,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.TgZ(5,"div",4),Z._uU(6),Z.qZA()(),Z.TgZ(7,"div",5)(8,"button",6),Z.NdJ("click",(function(){return t.retry()})),Z._uU(9,"Intentarlo nuevamente"),Z.qZA()()()),2&e&&(Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.abandoned.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,15,t.texts.abandoned.description),Z.oJD),Z.xp6(3),Z.hij(" ",t.getTextStatus()," "),Z.xp6(2),Z.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Le(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function Pe(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña es requerida "),Z.qZA())}function Ae(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña debe tener al menos 8 carácteres "),Z.qZA())}function Ee(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," Es necesario repetir la contraseña "),Z.qZA())}function De(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," Las contraseñas deben coincidir "),Z.qZA())}function Ne(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña debe tener al menos 8 carácteres "),Z.qZA())}const Ye={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let qe=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.form=new p.cw({}),this.next=new Z.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Le("password","confirm_password")})}nextStep(){let e={password:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.qu),Z.Y36(U.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep"},features:[Z._Bn([{provide:T.sG,useValue:Ye},{provide:Z.soG,useValue:"es-ES"}])],decls:22,vars:23,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.TgZ(5,"div",4)(6,"mat-form-field",5)(7,"mat-label"),Z._uU(8,"Contraseña"),Z.qZA(),Z._UZ(9,"input",6),Z.YNc(10,Pe,2,0,"mat-hint",7),Z.YNc(11,Ae,2,0,"mat-hint",7),Z.qZA(),Z.TgZ(12,"mat-form-field",8)(13,"mat-label"),Z._uU(14,"Repite Contraseña"),Z.qZA(),Z._UZ(15,"input",9),Z.YNc(16,Ee,2,0,"mat-hint",7),Z.YNc(17,De,2,0,"mat-hint",7),Z.YNc(18,Ne,2,0,"mat-hint",7),Z.qZA()(),Z.TgZ(19,"div",10)(20,"button",11),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(21," Guardar "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.password.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,21,t.texts.password.description),Z.oJD),Z.xp6(7),Z.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),Z.xp6(5),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.confirmedValidator),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.invalid&&t.f.confirm_password.errors.minlength),Z.xp6(2),Z.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,u.lW,D.KE,D.bx,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const Re=["formStep"];function Fe(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-power-cert",3),Z.NdJ("accept",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.acceptPowerCert())})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("hideButtons",!1)("flow","VideoID")("userId",e.userId)}}function Ze(e,t){if(1&e&&(Z.TgZ(0,"div",10),Z._UZ(1,"img",11),Z.qZA()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("src",e.data.styles.logoUrl,Z.LSH)}}function Ue(e,t){1&e&&(Z.TgZ(0,"div",12),Z._UZ(1,"mat-progress-spinner",13),Z.qZA()),2&e&&(Z.xp6(1),Z.Q6J("value",0))}function He(e,t){if(1&e&&Z._UZ(0,"belender-loading-step",23),2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("status",null==e.solicitud?null:e.solicitud.status_code)}}function je(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-form-step",24,25),Z.NdJ("goToTerms",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoTermsAndConditions())}))("goToPower",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.gotoOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("flowName",e.flowName)("requestID",e.requestID)("requestIDFromURL",e.requestIDFromURL)("userId",e.userId)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function ze(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-otp-step",26),Z.NdJ("resendOTP",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.resendOTP(t))}))("errorPhone",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.requestOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Be(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-password-step",27),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.sendPassword(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Je(e,t){if(1&e&&Z._UZ(0,"belender-success-step",28),2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("flowName",e.flowName)("packId",e.packId)("userId",e.userId)("requestID",e.requestID)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Ve(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-fail-step",29),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.retryRequest(t))}))("newRequest",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.newRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Qe(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-error-form-step",30),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.sendNewData(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("solicitud",e.solicitud)("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function We(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-abandoned-step",31),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.retryRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("solicitud",e.solicitud)("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Ge(e,t){if(1&e&&(Z.TgZ(0,"div",32)(1,"div",33)(2,"h1",34),Z._uU(3,"No existe la solicitud"),Z.qZA()(),Z.TgZ(4,"div",35),Z._uU(5," No existen solicitudes activas con el código requerido "),Z.qZA()()),2&e){const e=Z.oxw(4);Z.xp6(4),Z.Udp("color",e.data.styles.colors.text)}}function $e(e,t){if(1&e&&(Z.ynx(0),Z.YNc(1,He,1,2,"belender-loading-step",14),Z.YNc(2,je,2,7,"belender-form-step",15),Z.YNc(3,ze,1,3,"belender-otp-step",16),Z.YNc(4,Be,1,3,"belender-password-step",17),Z.YNc(5,Je,1,6,"belender-success-step",18),Z.YNc(6,Ve,1,3,"belender-fail-step",19),Z.YNc(7,Qe,1,3,"belender-error-form-step",20),Z.YNc(8,We,1,3,"belender-abandoned-step",21),Z.YNc(9,Ge,6,2,"div",22),Z.BQk()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("ngIf","loading"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","form"==e.getStatus()&&!e.loading),Z.xp6(1),Z.Q6J("ngIf","otp"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","password"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","success"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","failed"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","error-data"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","abandoned"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","no-exist"==e.getStatus())}}function Ke(e,t){1&e&&Z._UZ(0,"belender-disabled-url")}function Xe(e,t){if(1&e&&(Z.TgZ(0,"div",36),Z._UZ(1,"mat-progress-spinner",37),Z.TgZ(2,"p",38),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.hij(" ",e.loading," ")}}function et(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",39)(1,"div",32)(2,"div",40),Z._uU(3,"Error!"),Z.qZA(),Z._UZ(4,"div",41),Z.qZA(),Z.TgZ(5,"div",42)(6,"button",43),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.error=!1)})),Z._uU(7," Ingresar manualmente "),Z.qZA()()()}if(2&e){const e=Z.oxw(3);Z.xp6(4),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",e.error,Z.oJD)}}function tt(e,t){if(1&e&&(Z.TgZ(0,"div",4)(1,"div"),Z.YNc(2,Ze,2,1,"div",6),Z.YNc(3,Ue,2,1,"div",7),Z.YNc(4,$e,10,9,"ng-container",5),Z.YNc(5,Ke,1,0,"belender-disabled-url",5),Z.YNc(6,Xe,4,3,"div",8),Z.YNc(7,et,8,3,"div",9),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.styles.withLogo&&"loading"!=e.getStatus()),Z.xp6(1),Z.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf",!e.error&&!e.disableURL),Z.xp6(1),Z.Q6J("ngIf",!e.error&&e.disableURL),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error),Z.xp6(1),Z.Q6J("ngIf",!e.loading&&e.error)}}function nt(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"div",44),Z._uU(2),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw(2);Z.xp6(2),Z.hij(" TestMode ",e.testMode?"ON":"OFF"," ")}}function it(e,t){if(1&e&&(Z.TgZ(0,"div",4),Z.YNc(1,tt,8,11,"div",1),Z.YNc(2,nt,3,1,"ng-container",5),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngIf",e.data),Z.xp6(1),Z.Q6J("ngIf",e.testMode)}}function st(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-terms",45),Z.NdJ("accepted",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!1))})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("flow","videoid")("requestStatus",e.solicitud?e.solicitud.status_code:"")}}let rt=class{constructor(e,t,n,i,s,r,o,a,l){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.webhooksService=a,this.dialog=l,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.requestIDFromURL=!1,this.requestCreated=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.flowName="VideoID",this.showTermsDialog=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.userId?this.setInitialData(this.userId):this.loading=null,"pro"!=R.N.env&&(q(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),q(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)}))),this.utils.setLoading(!1)}ngOnDestroy(){}sendMessageToParent(e){window.top.postMessage(e,"*")}setInitialData(e){var t=this;return(0,A.Z)((function*(){const n=yield t.getFlow(e);if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},!t.data.config||!t.data.config.funder_id)return t.notis.showAlert("Error!","No se ha configurado la customización del widget para este usuario","error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,A.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e&&this.setParamsToRequest(e),e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):this.loading=null}),(e=>{this.loading=null}))}setFormFromVcCode(e){var t=this;return(0,A.Z)((function*(){t.loading="Obteniendo datos de la solicitud...",t.videoIDService.getSolicitudByCode(e).then((e=>{e&&e.data?(t.solicitud=e.data,t.requestCreated=!0,t.requestIDFromURL=!0,t.setSubscriptionOfRequest(),t.loading=null,t.solicitud.status_code&&"waiting_video"===t.solicitud.status_code&&t.solicitud.url_video_id&&location.assign(t.solicitud.url_video_id),t.skipCreationOfRequest=t.solicitud&&t.solicitud.status_code&&"prerequest"!=t.solicitud.status_code,t.autoAcceptTerms&&t.gotoOTP()):t.loading=null})).catch((e=>{t.loading=null}))}))()}setParamsToRequest(e){this.requestIDFromURL=!0,this.solicitud||(this.solicitud={status_code:"form"}),e.document&&!this.solicitud.person_document_number&&(this.solicitud.document_number=e.document),e.birthday&&!this.solicitud.birth_date&&(this.solicitud.birth_date=e.birthday),e.expiration&&!this.solicitud.document_expiration_date&&(this.solicitud.document_expiration_date=e.expiration),e.type&&!this.solicitud.person_type&&(this.solicitud.person_type=e.type),e.phone&&!this.solicitud.person_phone&&(this.solicitud.person_phone=e.phone),e.email&&!this.solicitud.person_email&&(this.solicitud.person_email=e.email),e.cif&&!this.solicitud.cif&&(this.solicitud.cif=e.cif),e.razon&&!this.solicitud.razon_social&&(this.solicitud.razon_social=e.razon),e.name&&!this.solicitud.person_name&&(this.solicitud.person_name=e.name),e.lastname&&!this.solicitud.person_first_surname&&(this.solicitud.person_first_surname=e.lastname),e.second_lastname&&!this.solicitud.person_second_surname&&(this.solicitud.person_second_surname=e.second_lastname)}handlePusherNotification(e){this.dataFromFirebase=e,this.sendMessageToParent({type:"websocket",data:e}),this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,"invalid_otp_seguridad_social"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500))}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.videoIDService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}gotoTerms(e){this.loading="Enviando datos..",e.package_id=this.packId,e.user_id=this.userId,this.requestID&&(e.request_id=this.requestID),this.testMode?setTimeout((()=>{this.solicitud=new Y.l,this.solicitud.status_code="waiting_otp_seguridad_social",this.loading=null}),4e3):this.skipCreationOfRequest?(this.gotoOTP(),this.setSubscriptionOfRequest()):this.videoIDService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.solicitud=e,t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha de nacimiento incorrecta")):"Incorrect date"==t.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha incorrecta")):(this.solicitud.status_code="no_service",this.loading=null):(this.solicitud.status_code="form",this.showAlert("Error!",t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,this.sendMessageToParent({type:"response",data:t.data||t}),this.gotoOTP()):this.showAlert("Error!","Error desconocido: "+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==R.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==R.N.env&&(e="wss://notifications.belender.net"),R.N.notificationsBaseUrl&&(e=R.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=null})))}sendNewData(e){this.loading="Enviando información..",this.videoIDService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e),this.loading=null):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse("Validando nuevos datos, espere por favor.."),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}gotoOTP(e){let t=e;t.user_id=this.userId,t.package_id=this.packId,this.requestCreated?this.setTerms(e):(this.initWaitingForResponse("Iniciando el proceso de emisión de certificado.."),this.videoIDService.addSolicitud(t).then((n=>{n.status&&"error"==n.status?(console.error("error en el then",n),this.solicitud=t,this.solicitud.status_code="form",n.message?(this.showAlert("Error!",n.message),n.message&&" Teléfono incorrecto"===n.message&&setTimeout((()=>{this.formComponent.enableInput("phone")}),1e3)):this.showAlert("Error!",n)):n&&"success"==n.status&&(this.sendMessageToParent({type:"response",data:n.data||n}),this.solicitud=n.data,this.requestID=n.data.request_id,this.setSubscriptionOfRequest(),this.cd.markForCheck(),this.setTerms(e))})).catch((e=>{console.error("errooooooorrrrr",e),e&&e.error&&this.showAlert("Error!",e.error),this.loading=null})))}setTerms(e){this.loading="Enviando datos..";let t={request_id:this.solicitud.request_id,terms_and_conditions_service:!0,terms_and_conditions_certificate_emition:!0};(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e.terms_and_conditions_power),this.testMode?setTimeout((()=>{this.solicitud=new Y.l,this.solicitud.status_code="waiting_otp_seguridad_social",this.loading=null}),4e3):this.videoIDService.acceptTerms(t).then((e=>{e&&e.status&&"error"==e.status?(this.solicitud=t,e.message&&(400==e.code?"Birthdate incorrect"==e.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha de nacimiento incorrecta")):"Incorrect date"==e.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha incorrecta!")):(this.solicitud.status_code="no_service",this.loading=null):(this.solicitud.status_code="form",this.showAlert("Error!",e.message)))):e&&e.status&&"success"==e.status?(this.solicitud.status_code="waiting_password",this.sendMessageToParent({type:"response",data:e.data||e}),this.loading=null):this.showAlert("Error!","Error desconocido: "+e)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}sendPassword(e){this.loading="Enviando password..",console.error("password: ",e),e.request_id=this.requestID,this.videoIDService.sendPassword(e).then((e=>{e&&e.status&&"error"==e.status?e.message&&(400==e.code?(this.solicitud.status_code="no_service",this.loading=null):(this.solicitud.status_code="waiting_password",this.showAlert("Error!",e.message))):e&&e.status&&"success"==e.status?(this.solicitud.status_code="waiting_otp",this.sendMessageToParent({type:"response",data:e.data||e})):this.showAlert("Error!","Error desconocido: "+e)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}requestOTP(e){this.loading="Enviando OTP..",this.testMode?setTimeout((()=>{this.solicitud=new Y.l,this.solicitud.status_code="all_documents_downloaded",this.loading=null}),2e3):this.videoIDService.sendOTP({request_id:this.requestID,otp:e.code}).then((e=>{e.status&&"error"==e.status?(this.showAlert("Error!",e.message?"invalid_otp"==e.message?"El código introducido no es correcto. Por favor, inténtelo de nuevo":e.message:e),this.loading=!1):e&&"success"==e.status&&(this.loading="Redirigiendo a Vintegris, aguarde por favor...",this.solicitud.status_code="loading",this.sendMessageToParent({type:"response",data:e.data||e}),this.cd.markForCheck(),location.assign(e.message))})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}gotoErrorPhone(){}setRequestStatus(e){this.solicitud.status_code=e}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading="Reintentando enviar la solicitud...",this.setSubscriptionOfRequest(),this.videoIDService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}newRequest(e){this.solicitud.status_code="created"}getStatus(){return!this.solicitud||this.solicitud&&("created"==this.solicitud.status_code||"terms_and_conditions"==this.solicitud.status_code||"form"==this.solicitud.status_code)?"form":!this.solicitud||"waiting_login_seguridad_social"!=this.solicitud.status_code&&"loading"!=this.solicitud.status_code&&"saved_otp"!=this.solicitud.status_code?!this.solicitud||"waiting_otp"!=this.solicitud.status_code&&"invalid_otp"!=this.solicitud.status_code?!this.solicitud||"waiting_password"!=this.solicitud.status_code&&"approved_terms_digital_power"!=this.solicitud.status_code&&"declined_terms_digital_power"!=this.solicitud.status_code?!this.solicitud||"abandoned_after_bad_phone"!=this.solicitud.status_code&&"abandoned_after_invalid_otp_seguridad_social"!=this.solicitud.status_code&&"abandoned_after_terms_and_conditions"!=this.solicitud.status_code&&"abandoned_after_waiting_otp_seguridad_social"!=this.solicitud.status_code?!this.solicitud||"certificate_created"!=this.solicitud.status_code&&"waiting_certificate"!=this.solicitud.status_code&&"all_documents_downloaded"!=this.solicitud.status_code&&"partial_documents_downloaded"!=this.solicitud.status_code&&"waiting_video"!=this.solicitud.status_code&&"consent_process_completed"!=this.solicitud.status_code&&"waiting_documents"!=this.solicitud.status_code?!this.solicitud||"bad_phone"!=this.solicitud.status_code&&"phone_not_exist_otp"!=this.solicitud.status_code?!this.solicitud||"failed_with_retry"!=this.solicitud.status_code&&"failed_without_retry"!=this.solicitud.status_code&&"rejected_identity"!=this.solicitud.status_code&&"failed_documents_downloaded"!=this.solicitud.status_code?this.solicitud&&"no_service"==this.solicitud.status_code?"no-service":"no-exist":"failed":this.data.config.noRetryInBadPhone?"otp":"error-data":this.data.infiniteLoopInCompleted||"waiting_video"==this.solicitud.status_code?(this.loading="Aguardando validación por Video ID","loading"):"success":"abandoned":"password":"otp":(this.loading="Estamos procesando su solicitud. Espere un momento por favor","loading")}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,e&&this.formComponent.setTermsCheck(!0)}gotoTermsAndConditionsCertificate(){this.dialog.open(F.v,{panelClass:"fullscreen-dialog",data:{flow:"videoid"}}).afterClosed().subscribe((e=>{e&&this.formComponent.setTerms2Check(!0)}))}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}};function ot(e,t){if(1&e&&(Z.TgZ(0,"div",6),Z._UZ(1,"img",7),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("src",e.data.styles.logoUrl,Z.LSH)}}function at(e,t){if(1&e&&(Z.TgZ(0,"div",8),Z._UZ(1,"mat-progress-spinner",9),Z.TgZ(2,"p",10),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function lt(e,t){if(1&e&&(Z.TgZ(0,"div",1)(1,"div",2),Z.YNc(2,ot,2,1,"div",3),Z._UZ(3,"belender-success-step",4),Z.YNc(4,at,4,3,"div",5),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.styles.withLogo),Z.xp6(1),Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error)}}rt.ɵfac=function(e){return new(e||rt)(Z.Y36(Z.sBO),Z.Y36(L.gz),Z.Y36(U.F),Z.Y36(z),Z.Y36(C.w),Z.Y36(B.r),Z.Y36(M.T),Z.Y36(w.t),Z.Y36(J.uw))},rt.ɵcmp=Z.Xpm({type:rt,selectors:[["belender-widget-videoid"]],viewQuery:function(e,t){if(1&e&&Z.Gf(Re,5),2&e){let e;Z.iGM(e=Z.CRH())&&(t.formComponent=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[Z._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:3,vars:3,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","requestStatus","accepted","cancelled",4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],[4,"ngIf"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"data","status",4,"ngIf"],[3,"data","flowName","requestID","requestIDFromURL","userId","texts","solicitud","goToTerms","goToPower","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","texts","solicitud","nextStep",4,"ngIf"],[3,"data","flowName","packId","userId","requestID","texts",4,"ngIf"],[3,"data","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","texts","nextStep",4,"ngIf"],[3,"solicitud","data","texts","retry",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"data","status"],[3,"data","flowName","requestID","requestIDFromURL","userId","texts","solicitud","goToTerms","goToPower","goToTermsCertificate","nextStep"],["formStep",""],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","texts","solicitud","nextStep"],[3,"data","flowName","packId","userId","requestID","texts"],[3,"data","texts","solicitud","retry","newRequest"],[3,"solicitud","data","texts","nextStep"],[3,"solicitud","data","texts","retry"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"],[3,"flow","requestStatus","accepted","cancelled"]],template:function(e,t){1&e&&(Z.YNc(0,Fe,1,3,"vex-power-cert",0),Z.YNc(1,it,3,2,"div",1),Z.YNc(2,st,1,2,"vex-terms",2)),2&e&&(Z.Q6J("ngIf",t.viewPowerTerms),Z.xp6(1),Z.Q6J("ngIf",t.data),Z.xp6(1),Z.Q6J("ngIf",t.showTermsDialog))},dependencies:[i.O5,u.lW,v.Ou,V.L,Q.L,W.q,ae,de,pe,Te,Me,Ie,Oe,qe],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),rt=(0,E.gn)([(0,N.c)()],rt);let ct=class{constructor(e,t,n,i,s,r,o){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.notis=r,this.webhooksService=o,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=null,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=null})),"pro"!=R.N.env&&(q(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),q(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)}))),this.utils.setLoading(!1)}ngOnDestroy(){}setInitialData(e){this.customizationService.getCustomization(e).then((e=>{e&&(this.data=e,this.financiadorID=e.funder_id||"",this.cd.markForCheck()),this.loading=null}),(e=>{console.error(e),this.loading=null}))}handlePusherNotification(e){this.dataFromFirebase=e,this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,"invalid_otp_seguridad_social"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==R.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==R.N.env&&(e="wss://notifications.belender.net"),R.N.notificationsBaseUrl&&(e=R.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=null})))}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}setRequestStatus(e){this.solicitud.status_code=e}};function dt(e,t){if(1&e&&(Z.TgZ(0,"div",6),Z._UZ(1,"img",7),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("src",e.data.styles.logoUrl,Z.LSH)}}function ut(e,t){if(1&e&&(Z.TgZ(0,"div",8),Z._UZ(1,"mat-progress-spinner",9),Z.TgZ(2,"p",10),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function ht(e,t){if(1&e&&(Z.TgZ(0,"div",1)(1,"div",2),Z.YNc(2,dt,2,1,"div",3),Z._UZ(3,"belender-fail-step",4),Z.YNc(4,ut,4,3,"div",5),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.styles.withLogo),Z.xp6(1),Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error)}}ct.ɵfac=function(e){return new(e||ct)(Z.Y36(Z.sBO),Z.Y36(L.gz),Z.Y36(U.F),Z.Y36(z),Z.Y36(C.w),Z.Y36(M.T),Z.Y36(w.t))},ct.ɵcmp=Z.Xpm({type:ct,selectors:[["belender-widget-videoid-success"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud",flowName:"flowName"},features:[Z._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:1,vars:1,consts:[["class","h-full widget-belender",4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],[3,"data","texts"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&Z.YNc(0,lt,5,6,"div",0),2&e&&Z.Q6J("ngIf",t.data)},dependencies:[i.O5,v.Ou,de],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),ct=(0,E.gn)([(0,N.c)()],ct);let pt=class{constructor(e,t,n,i,s,r,o){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.notis=r,this.webhooksService=o,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=null,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=null})),"pro"!=R.N.env&&(q(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),q(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)}))),this.utils.setLoading(!1)}ngOnDestroy(){}setInitialData(e){this.customizationService.getCustomization(e).then((e=>{e&&(this.data=e,this.financiadorID=e.funder_id||"",this.cd.markForCheck()),this.loading=null}),(e=>{console.error(e),this.loading=null}))}handlePusherNotification(e){this.dataFromFirebase=e,this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,"invalid_otp_seguridad_social"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==R.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==R.N.env&&(e="wss://notifications.belender.net"),R.N.notificationsBaseUrl&&(e=R.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=null})))}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}setRequestStatus(e){this.solicitud.status_code=e}};pt.ɵfac=function(e){return new(e||pt)(Z.Y36(Z.sBO),Z.Y36(L.gz),Z.Y36(U.F),Z.Y36(z),Z.Y36(C.w),Z.Y36(M.T),Z.Y36(w.t))},pt.ɵcmp=Z.Xpm({type:pt,selectors:[["belender-widget-videoid-fail"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud",flowName:"flowName"},features:[Z._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:1,vars:1,consts:[["class","h-full widget-belender",4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],[3,"data","texts","solicitud"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&Z.YNc(0,ht,5,7,"div",0),2&e&&Z.Q6J("ngIf",t.data)},dependencies:[i.O5,v.Ou,pe],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),pt=(0,E.gn)([(0,N.c)()],pt);const mt=[{path:":idUser",component:rt},{path:":idUser/:packID",component:rt},{path:":idUser/:packID/success",component:ct},{path:":idUser/:packID/fail",component:pt}];let ft=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({imports:[L.Bz.forChild(mt),L.Bz,P.d8]}),e})();var gt=n(6981),_t=n(3848),bt=n(1129),yt=n(1258),vt=n(3295),wt=n(2266),xt=n(3300),Ct=n(865);let kt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({providers:[_.M,y.o,C.w,w.t,M.T,O.t,{provide:T.Ad,useValue:"es-ES"}],imports:[ft,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,v.Cq,k.FA,T.XK,S.T5,I.Fk,gt.x,_t.Nh,bt.n,yt.H,vt.g,wt.L,xt.C,Ct.q]}),e})()},5469:(e,t,n)=>{n.d(t,{B:()=>b});var i=n(7582),s=n(9933),r=n(8259),o=n(4650),a=n(5089),l=n(7367),c=n(8460),d=n(9299),u=n(9045),h=n(6895),p=n(2237),m=n(9199);const f=["widgetCard"];function g(e,t){1&e&&(o.ynx(0),o._UZ(1,"router-outlet"),o.BQk())}const _=function(e){return{"margin-top":e}};let b=class{constructor(e,t,n,i,s){this.utils=e,this.customizationService=t,this.customizationStoreService=n,this.router=i,this.deviceInfoService=s,this.type="",this.widgetHeight=0,this.warningsSpace=0,this.isScaled=!1,this.funderConfigLoaded=!1,this.funderStylesLoaded=!1}ngOnInit(){this.getWindowsScreenOrientation(),this.utils.getWarningsSpaces().subscribe((e=>{this.warningsSpace=e}));let e=this.router.url.split("/");this.userId=e.length&&e.some((e=>"smspin"===e))?e&&e.length&&e[e.length-3]?e[e.length-3]:"":e&&e.length&&e[e.length-2]?e[e.length-2]:"",this.packId=e.length&&e.some((e=>"smspin"===e))?e&&e.length&&e[e.length-2]?e[e.length-2]:"":e&&e.length&&e[e.length-1]?e[e.length-1]:"";let t=this.packId.split("?");t&&t.length&&(this.packId=t[0]),console.error("packId",this.packId),this.userId&&(this.customizationStoreService.setUserID(this.userId),this.setCustomization()),this.packId&&this.customizationStoreService.setPackID(this.packId)}ngDoCheck(){this.getWidgetCardHeight()}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewInit(){r("body").css("background","transparent"),r("body").css("background-color","transparent")}getWindowsScreenOrientation(){window.addEventListener("resize",(()=>{this.widgetHeight=this.widgetCard.nativeElement.offsetHeight,this.isScaled&&(this.widgetHeight=1.5*this.widgetHeight),this.sendMessageToParent({type:"widgetHeight",data:this.widgetHeight})})),window.screen&&window.screen.orientation?(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler)):console.warn("Screen Orientation API not supported.")}getWidgetCardHeight(){this.widgetCard&&this.widgetHeight!=this.widgetCard.nativeElement.offsetHeight&&(this.widgetHeight=this.widgetCard.nativeElement.offsetHeight,this.isScaled$=this.deviceInfoService.isScaled$.subscribe((e=>{this.isScaled=e,this.isScaled&&(this.widgetHeight=1.5*this.widgetHeight)})),this.sendMessageToParent({type:"widgetHeight",data:this.widgetHeight}))}sendMessageToParent(e){window.top.postMessage(e,"*")}setCustomization(){this.customizationService.getFunderConfig(this.userId).then((e=>{this.customizationStoreService.setFunderConfig(e.data),this.funderConfigLoaded=!0})).catch((e=>{console.log("🚀 ~ WidgetComponent ~ this.customizationService.getCustomization ~ e:",e)})),this.customizationService.getFunderStyles(this.userId).then((e=>{this.customizationStoreService.setFunderStyles(e.data),this.funderStylesLoaded=!0})).catch((e=>{console.log("🚀 ~ WidgetComponent ~ this.customizationService.getCustomization ~ e:",e)}))}};b.ɵfac=function(e){return new(e||b)(o.Y36(a.F),o.Y36(l.w),o.Y36(c.r),o.Y36(d.F0),o.Y36(u.H))},b.ɵcmp=o.Xpm({type:b,selectors:[["belender-widget"]],viewQuery:function(e,t){if(1&e&&o.Gf(f,5),2&e){let e;o.iGM(e=o.CRH())&&(t.widgetCard=e.first)}},inputs:{type:"type"},decls:4,vars:4,consts:[[1,"belender-page-layout","h-auto","p-0","md:p-4","overflow-y-visible",3,"ngStyle"],[1,"h-auto","overflow-y-visible","content-layout","overflow-x-hidden","content-widget","p-0","md:p-3"],["widgetCard",""],[4,"ngIf"]],template:function(e,t){1&e&&(o.TgZ(0,"vex-page-layout",0)(1,"vex-page-layout-content",1,2),o.YNc(3,g,2,0,"ng-container",3),o.qZA()()),2&e&&(o.Q6J("ngStyle",o.VKq(2,_,t.warningsSpace+"px")),o.xp6(3),o.Q6J("ngIf",t.funderConfigLoaded&&t.funderStylesLoaded))},dependencies:[h.O5,h.PC,d.lC,p.w,m.d],styles:[".badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.card[_ngcontent-%COMP%]{margin:0 auto;max-width:440px}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.content-layout[_ngcontent-%COMP%]{max-height:none;max-height:initial;overflow-y:auto;padding:0!important}.belender-page-layout[_ngcontent-%COMP%]{padding:0!important}"]}),b=(0,i.gn)([(0,s.c)()],b)},2932:(e,t,n)=>{function i(e={}){return t=>{const n=t.value;if(!n)return null;const i=n.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(e.checkFormat&&!i)return{invalidFormat:!0};if(!i)return null;const s=parseInt(i[1],10),r=parseInt(i[2],10)-1,o=parseInt(i[3],10),a=new Date(o,r,s);if(e.checkDate&&(a.getFullYear()!==o||a.getMonth()!==r||a.getDate()!==s))return{invalidDate:!0};if(e.checkAge){const e=new Date;let t=e.getFullYear()-o;const n=e.getMonth()-r;if((n<0||0===n&&e.getDate()<s)&&t--,t<18)return{underAge:!0}}return null}}n.d(t,{s:()=>i})},3842:(e,t,n)=>{n.d(t,{VU:()=>i});const i={status:"success",data:{request_id:"a29879d5-1f42-400a-bcb5-caa69ab31402",user_id:"f2216861-9119-4f74-94ff-677a8926b77c",user_name:"Roger BackOffice",person_id:"fc02a51d-7782-4cb3-882d-cad847e5d9b5",person_name:"Roger",person_phone:"666666666",person_document_number:"44011547N",person_document_expiration_date:"2032-10-24",person_document_support:"",person_birth_date:"1981-08-12",person_email:"test@gmail.com",flow_id:"d73a6c00-3ab9-46c4-9a85-471c14ec361d",flow_name:"ClavePin",funder_id:"5468ba73-7d05-4c9c-a81f-748fe7dafaba",funder_name:"Belender",status_code:"terms_and_conditions",status_message:"La solicitud se encuentra en estado de espera de terminos y condiciones",package_id:"2e0cc952-1b98-41fe-9b86-a3e4a8dcafa7",widget_url:"https://widget.dev.belender.net/widget/clavepin/f2216861-9119-4f74-94ff-677a8926b77c/2e0cc952-1b98-41fe-9b86-a3e4a8dcafa7?request_id=a29879d5-1f42-400a-bcb5-caa69ab31402",widget_url_boxed:"https://widget.dev.belender.net/widget-boxed/clavepin/f2216861-9119-4f74-94ff-677a8926b77c/2e0cc952-1b98-41fe-9b86-a3e4a8dcafa7?request_id=a29879d5-1f42-400a-bcb5-caa69ab31402",has_documents:!1,created_at:"2025-01-07T20:31:55.000000Z",updated_at:"2025-01-07T20:31:55.000000Z"}}},9382:(e,t,n)=>{n.d(t,{i:()=>h});var i=n(4650),s=n(5601),r=n(5895),o=n(6895),a=n(3731);function l(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",4),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw(2);return i.KtG(t.goToCancelRequest())})),i.ALo(1,"safeHtml"),i.qZA()}if(2&e){const e=i.oxw(2);i.Udp("color",e.textColor),i.Q6J("innerHTML",i.lcZ(1,3,e.customText),i.oJD)}}function c(e,t){if(1&e&&(i.TgZ(0,"div",5),i._uU(1),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.hij(" ",e.labels.loadings.cancelingRequest,"\n")}}const d=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function u(e,t){if(1&e&&(i.TgZ(0,"div",1),i.YNc(1,l,2,5,"div",2),i.YNc(2,c,2,1,"div",3),i.qZA()),2&e){const e=i.oxw();i.Q6J("ngClass",i.kEZ(3,d,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),i.xp6(1),i.Q6J("ngIf",!e.loading),i.xp6(1),i.Q6J("ngIf",e.loading)}}let h=(()=>{class e{constructor(e,t){this.solicitudesService=e,this.notis=t,this.customText="",this.textColor="",this.flowType="SMS",this.updateStatusCode=new i.vpe,this.requestType="sms",this.loading=!1}goToCancelRequest(){this.loading=!0;const e={request_id:this.request_id,user_id:this.user_id};this.requestType="ClavePin"===this.flowType?"clave-pin":"sms",this.solicitudesService.cancelRequest(e,this.requestType).then((e=>{e&&e.data&&this.updateStatusCode.emit("consent_process_canceled"),e.message&&this.showAlert(e.status?this.capitalizeFirstLetter(e.status)+"!":"Aviso!",e.message),setTimeout((()=>{this.loading=!1}),1e3)})).catch((e=>{this.loading=!1,this.showAlert("Error!",e.message||e)}))}capitalizeFirstLetter(e){return"string"!=typeof e||0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}showAlert(e,t){this.notis.showAlert(e,t)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.M),i.Y36(r.T))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-cancel-request"]],inputs:{data:"data",customText:"customText",textColor:"textColor",flowType:"flowType",request_id:"request_id",user_id:"user_id",labels:"labels"},outputs:{updateStatusCode:"updateStatusCode"},decls:1,vars:1,consts:[["class","flex",3,"ngClass",4,"ngIf"],[1,"flex",3,"ngClass"],["class","subheading-1 px-2 text-right underline cursor-pointer custom-html",3,"color","innerHTML","click",4,"ngIf"],["class","subheading-1 px-2 text-right text-orange-500 custom-html",4,"ngIf"],[1,"subheading-1","px-2","text-right","underline","cursor-pointer","custom-html",3,"innerHTML","click"],[1,"subheading-1","px-2","text-right","text-orange-500","custom-html"]],template:function(e,t){1&e&&i.YNc(0,u,3,7,"div",0),2&e&&i.Q6J("ngIf",t.data&&t.data.styles)},dependencies:[o.mk,o.O5,a.z]}),e})()},9112:(e,t,n)=>{n.d(t,{y:()=>P});var i=n(5861),s=n(4650),r=n(4006),o=n(8259),a=n(2340),l=n(5089),c=n(3687),d=n(6895),u=n(9101),h=n(2440),p=n(3046),m=n(3731);function f(e,t){if(1&e&&s._UZ(0,"belender-widget-logo",12),2&e){const e=s.oxw();s.Q6J("firstOption",e.logoCustom)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function g(e,t){if(1&e&&s._UZ(0,"div",13),2&e){const e=s.oxw();s.Udp("color",null==e.data.styles?null:e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),s.Q6J("innerHTML",e.texts[e.otpType].title,s.oJD)}}function _(e,t){if(1&e&&(s._UZ(0,"div",14),s.ALo(1,"safeHtml")),2&e){const e=s.oxw();s.Udp("color",null==e.data.styles?null:e.data.styles.colors.text),s.Q6J("innerHTML",s.lcZ(1,3,null==e.texts[e.otpType]?null:e.texts[e.otpType].description),s.oJD)}}function b(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.requestingOtp:"Estamos solicitando el código. Por favor, espere un momento."," ")}}function y(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.AsE(" ",e.labels?e.labels.otp.otpSentToNumber:"El código ha sido enviado al teléfono acabado en"," ",e.lastThreeNumbersPhone,". ")}}function v(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.requestingCode:"Estamos solicitando el código. Por favor, espere un momento."," ")}}const w=function(e,t,n){return{color:e,border:t,background:n}};function x(e,t){if(1&e&&(s.ynx(0),s.TgZ(1,"small",15),s.YNc(2,b,2,1,"ng-container",6),s.YNc(3,y,2,2,"ng-container",6),s.YNc(4,v,2,1,"ng-container",6),s.qZA(),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngStyle",s.kEZ(4,w,null==e.data.styles?null:e.data.styles.colors.accentColor,"1px solid "+(null==e.data.styles?null:e.data.styles.colors.accentColor),null==e.data.styles?null:e.data.styles.colors.accentBgColor)),s.xp6(1),s.Q6J("ngIf",!e.lastThreeNumbersPhone),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&!(null!=e.data.config&&e.data.config.noRetryInBadPhone)),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&(null==e.data.config?null:e.data.config.noRetryInBadPhone))}}function C(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.noReceivedCode:"¿No has recibido el código en tu teléfono?"," ")}}function k(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.AsE("",e.labels?e.labels.otp.noReceivedCode2:"¿No has recibido el código en el teléfono acabado en"," ",e.lastThreeNumbersPhone,"? ")}}function T(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.noReceivedCode:"¿No has recibido el código en tu teléfono?"," ")}}const M=function(e,t){return{color:e,background:t}};function S(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",18),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.resendOTP())})),s._uU(1),s.qZA()}if(2&e){const e=s.oxw(2);s.Q6J("ngStyle",s.WLB(2,M,null==e.data.styles?null:e.data.styles.colors.dangerTextButtonColor,null==e.data.styles?null:e.data.styles.colors.dangerColor)),s.xp6(1),s.hij(" ",e.labels?e.labels.actions.resend:"Reenviar"," ")}}function I(e,t){if(1&e&&(s.ynx(0),s.TgZ(1,"small",16),s.YNc(2,C,2,1,"span",6),s.YNc(3,k,2,2,"span",6),s.YNc(4,T,2,1,"span",6),s.YNc(5,S,2,5,"a",17),s.qZA(),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngStyle",s.kEZ(5,w,null==e.data.styles?null:e.data.styles.colors.dangerColor,"1px solid "+(null==e.data.styles?null:e.data.styles.colors.dangerColor),null==e.data.styles?null:e.data.styles.colors.dangerBgColor)),s.xp6(1),s.Q6J("ngIf",!e.lastThreeNumbersPhone),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&!(null!=e.data.config&&e.data.config.noRetryInBadPhone)),s.xp6(1),s.Q6J("ngIf",null==e.data.config?null:e.data.config.noRetryInBadPhone),s.xp6(1),s.Q6J("ngIf",!e.secondTry)}}const O=function(e,t){return{length:e,allowNumbersOnly:t}},L=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let P=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.scrollService=n,this.minLength=3,this.logoCustom="",this.next=new s.vpe(null),this.errPhone=new s.vpe(null),this.resendO=new s.vpe(null),this.secsCount=60,this.secondTry=!1,this.timerIsRunning=!1,this.env=a.N.env}ngOnInit(){this.form=this.fb.group({code1:[null,[r.kI.required,r.kI.maxLength(6),r.kI.minLength(this.minLength)]]}),"SMS"==this.flowType&&this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}ngAfterViewInit(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),100)}resetOtpNumber(){this.form.get("code1").setValue("")}ngOnChanges(e){e.otpType&&!e.otpType.previousValue&&(this.secsCount="otpAEAT"==e.otpType?.currentValue||"otpIRS"==e.otpType?.currentValue?300:60,this.initSecsInterval())}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastThreeNumbersPhone=t}initSecsInterval(){this.timerIsRunning||(this.interv=setInterval((()=>{this.timerIsRunning=!0,this.secsCount=this.secsCount-1,this.secsRemaining=this.getRemaining(),this.secsCount<=0&&this.finishSecsInterval()}),1e3))}getRemaining(){let e=Math.floor(this.secsCount/60),t=this.secsCount%60;return this.addZero(e)+":"+this.addZero(t)}addZero(e){return e>=10?e:"0"+e}finishSecsInterval(){this.timerIsRunning=!1,this.interv&&clearInterval(this.interv)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){var t=this;return(0,i.Z)((function*(){console.log(e),t.form.get("code1").setValue(e)}))()}setInputEvent(e){""!=e.target.value?o(e.target).next().focus():"Backspace"==e.code&&o(e.target).prev().focus()}nextStep(){let e={code:this.getCode()};this.next.emit(e)}resendOTP(){this.secondTry=!0,this.initSecsInterval(),this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(s.Y36(r.QS),s.Y36(l.F),s.Y36(c.a))},e.ɵcmp=s.Xpm({type:e,selectors:[["belender-shared-otp-step"]],inputs:{data:"data",texts:"texts",lastThreeNumbersPhone:"lastThreeNumbersPhone",solicitud:"solicitud",otpType:"otpType",minLength:"minLength",flowType:"flowType",logoCustom:"logoCustom",labels:"labels"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},features:[s.TTD],decls:15,vars:26,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-1","flex","flex-col"],["id","otpTitle","class","title m-0",3,"color","font-size","innerHTML",4,"ngIf"],["id","otpDescription","class","subheading-1 pt-4",3,"color","innerHTML",4,"ngIf"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","w-full","flex-col","gap-2","py-2"],[1,"subheading-1","py-1","custom-html"],[3,"config","onInputChange"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"firstOption","logoUrl"],["id","otpTitle",1,"title","m-0",3,"innerHTML"],["id","otpDescription",1,"subheading-1","pt-4",3,"innerHTML"],["id","secsCountContainer",1,"info-time","w-full",3,"ngStyle"],[1,"info-time","w-full",3,"ngStyle"],["id","resendOTPButton","class","ml-4",3,"ngStyle","click",4,"ngIf"],["id","resendOTPButton",1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(s.YNc(0,f,1,2,"belender-widget-logo",0),s.TgZ(1,"form",1)(2,"div",2),s.YNc(3,g,1,5,"div",3),s.YNc(4,_,2,5,"div",4),s.TgZ(5,"div",5),s.YNc(6,x,5,8,"ng-container",6),s.YNc(7,I,6,9,"ng-container",6),s.qZA(),s.TgZ(8,"div",7)(9,"p",8),s._uU(10),s.qZA(),s.TgZ(11,"ng-otp-input",9),s.NdJ("onInputChange",(function(e){return t.capturePasteEvent(e)})),s.qZA()()(),s.TgZ(12,"div",10)(13,"button",11),s.NdJ("click",(function(){return t.nextStep()})),s._uU(14),s.qZA()()()),2&e&&(s.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),s.xp6(1),s.Q6J("formGroup",t.form),s.xp6(2),s.Q6J("ngIf",t.texts&&(null==t.texts[t.otpType]?null:t.texts[t.otpType].title)&&""!=(null==t.texts[t.otpType]?null:t.texts[t.otpType].title)),s.xp6(1),s.Q6J("ngIf",t.texts&&(null==t.texts[t.otpType]?null:t.texts[t.otpType].description)&&""!=(null==t.texts[t.otpType]?null:t.texts[t.otpType].description)),s.xp6(2),s.Q6J("ngIf",t.secsCount&&t.secsCount>0),s.xp6(1),s.Q6J("ngIf",!t.secsCount||t.secsCount<=0),s.xp6(2),s.Udp("color",t.data.styles.colors.text),s.xp6(1),s.hij(" ",t.labels?t.labels.otp.otpCode:"Código OTP (recibido por SMS)"," "),s.xp6(1),s.Q6J("config",s.WLB(19,O,t.minLength,"qa"!=t.env&&"dev"!=t.env)),s.xp6(1),s.Q6J("ngClass",s.kEZ(22,L,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),s.xp6(1),s.Udp("color",null==t.data.styles?null:t.data.styles.colors.btnText)("background",t.form.invalid?"":null==t.data.styles?null:t.data.styles.colors.btnBg)("border-radius",(null==t.data.styles?null:t.data.styles.btnRound)+"px"),s.Q6J("disabled",t.form.invalid),s.xp6(1),s.hij(" ",t.labels?t.labels.actions.next:"Siguiente"," "))},dependencies:[d.mk,d.O5,d.PC,u.lW,r._Y,r.JL,r.sg,h.df,p.X,m.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.code-wrapper[_ngcontent-%COMP%]{padding:5px;height:50px}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:40px;min-width:136px;border-radius:6px;border:1px solid rgba(0,0,0,.1);text-transform:uppercase;text-align:left;font-weight:700;transition:all .3s ease;outline:1px solid transparent;letter-spacing:12px;padding:0 18px}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover{background:#fcfcfc;border:1px solid rgba(0,0,0,.2);transition:all .3s ease}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:1px solid #4e98d0;border:1px solid #4e98d0}.info-time[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:7px 10px;min-height:40px;font-size:14px;line-height:14px;border-radius:5px;border-width:1px;border-style:solid;margin:10px 0}.info-time[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:14px;line-height:24px;padding:0 10px;border-radius:5px;cursor:pointer;transition:all .2s ease}@media (max-width: 576px){.info-time[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:0 20px}}"]}),e})()},5696:(e,t,n)=>{n.d(t,{T:()=>c});var i=n(4650),s=n(7403),r=n(5412),o=n(7308),a=n(6895);function l(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"span"),i._uU(1),i.TgZ(2,"a",0),i.NdJ("click",(function(t){i.CHM(e);const n=i.oxw();return i.KtG(n.gotoLegalDocument(t))})),i.TgZ(3,"u"),i._uU(4),i.qZA()()()}if(2&e){const e=i.oxw();i.xp6(1),i.hij(" ",e.parts.p3," "),i.xp6(3),i.Oqu(e.parts.a2)}}let c=(()=>{class e{constructor(e,t){this.dialog=e,this.translationService=t,this.goTerms=new i.vpe(null),this.customTerms=!1,this.lang="",this.parts={p1:"He leído y acepto los",p2:"del servicio",p3:"y la",a1:"términos y condiciones",a2:"política de privacidad"},this.translatedParts={ca:{p1:"He llegit i accepto els",p2:"del servei",p3:"i la",a1:"termes i condicions",a2:"política de privacitat"},en:{p1:"I have read and accept the",p2:"of the service",p3:"and the",a1:"terms and conditions",a2:"privacy policy"},fr:{p1:"J'ai lu et j'accepte les",p2:"du service",p3:"et la",a1:"conditions générales",a2:"politique de confidentialité"},it:{p1:"Ho letto e accetto i",p2:"del servizio",p3:"e la",a1:"termini e condizioni",a2:"informativa sulla privacy"},pt:{p1:"Li e aceito os",p2:"do serviço",p3:"e a",a1:"termos e condições",a2:"política de privacidade"},de:{p1:"Ich habe die",p2:"des Dienstes gelesen und akzeptiere sie",p3:"sowie die",a1:"Nutzungsbedingungen",a2:"Datenschutzrichtlinie"}}}ngOnInit(){this.parts={p1:this.getPart(this.firstSentence,"p1"),p2:this.getPart(this.secondSentence,"p2"),p3:this.getPart(this.thirdSentence,"p3"),a1:this.getPart(this.termsActionText,"a1"),a2:this.getPart(this.policyActionText,"a2")}}getPart(e,t){return e||(this.data&&this.lang&&this.translatedParts[this.lang]?this.translatedParts[this.lang][t]||this.parts[t]||"":this.parts[t]||"")}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.goTerms.emit(e)}gotoLegalDocument(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(s.N,{panelClass:"fullscreen-dialog",data:{lang:this.lang,allData:this.data,flow:this.flowName}})}}return e.ɵfac=function(t){return new(t||e)(i.Y36(r.uw),i.Y36(o.D))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-terms-and-policy-links"]],inputs:{userId:"userId",showPolicyLink:"showPolicyLink",firstSentence:"firstSentence",secondSentence:"secondSentence",thirdSentence:"thirdSentence",policyActionText:"policyActionText",termsActionText:"termsActionText",customTerms:"customTerms",lang:"lang",data:"data",flowName:"flowName"},outputs:{goTerms:"goToTerms"},decls:6,vars:4,consts:[["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],[4,"ngIf"]],template:function(e,t){1&e&&(i._uU(0),i.TgZ(1,"a",0),i.NdJ("click",(function(e){return t.gotoTermsAndConditions(e)})),i.TgZ(2,"u"),i._uU(3),i.qZA()(),i._uU(4),i.YNc(5,l,5,2,"span",1)),2&e&&(i.hij(" ",t.parts.p1," "),i.xp6(3),i.Oqu(t.parts.a1),i.xp6(1),i.hij(" ",t.parts.p2," "),i.xp6(1),i.Q6J("ngIf",t.showPolicyLink))},dependencies:[a.O5]}),e})()},3046:(e,t,n)=>{n.d(t,{X:()=>a});var i=n(4650),s=n(6895);function r(e,t){1&e&&i._UZ(0,"div",4)}const o=function(e){return{display:e}};let a=(()=>{class e{constructor(){this.logoUrl="",this.firstOption=this.logoUrl,this.logoUrlIsLoaded=!1}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-widget-logo"]],inputs:{logoUrl:"logoUrl",firstOption:"firstOption"},decls:4,vars:5,consts:[[1,"img-wrapper","p-4","flex","justify-center","items-center"],["class","animated-bg h-full w-full",4,"ngIf"],[1,"img-card",3,"src","ngStyle","load"],["img",""],[1,"animated-bg","h-full","w-full"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0),i.YNc(1,r,1,0,"div",1),i.TgZ(2,"img",2,3),i.NdJ("load",(function(){return t.logoUrlIsLoaded=!0})),i.qZA()()),2&e&&(i.xp6(1),i.Q6J("ngIf",!t.logoUrlIsLoaded),i.xp6(1),i.Q6J("src",t.firstOption||t.logoUrl,i.LSH)("ngStyle",i.VKq(3,o,t.logoUrlIsLoaded?"block":"none")))},dependencies:[s.O5,s.PC],styles:[".img-wrapper[_ngcontent-%COMP%]{max-height:240px}.img-wrapper[_ngcontent-%COMP%] .img-card[_ngcontent-%COMP%], .img-wrapper[_ngcontent-%COMP%] .animated-bg[_ngcontent-%COMP%]{max-width:240px;max-height:240px}"]}),e})()},5762:(e,t,n)=>{n.d(t,{l:()=>i});class i{constructor(){}}},3731:(e,t,n)=>{n.d(t,{z:()=>r});var i=n(4650),s=n(1481);let r=(()=>{class e{constructor(e){this.sanitized=e}transform(e){return this.sanitized.bypassSecurityTrustHtml(e)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.H7,16))},e.ɵpipe=i.Yjl({name:"safeHtml",type:e,pure:!0}),e})()},9391:(e,t,n)=>{n.d(t,{o:()=>l});var i=n(7396),s=n(3436),r=n(2340),o=n(4650),a=n(6554);let l=(()=>{class e{constructor(e){this.localFetch=e}getAttachmentsOld(e){return new Promise(((t,n)=>{const r=(0,i.IO)((0,i.hJ)(s.db,"solicitudes"),(0,i.ar)("id","==",e),(0,i.b9)(1));(0,i.cf)(r,(e=>{let n;e.forEach((e=>{n=e.data().attachments})),t(n)}),(e=>{n(e)}))}))}getAttachments(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${r.N.baseUrl}/requests/${e}/documents`).then((e=>{e?t(e):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}uploadFile(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(`${r.N.baseUrl}/documents/upload-files`,e).then((e=>{e?t(e):n("No se pudieron subir los documentos..")})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(o.LFG(a.r))},e.ɵprov=o.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},7489:(e,t,n)=>{n.d(t,{v:()=>l});var i=n(2340),s=n(4650),r=n(5089),o=n(529),a=n(6554);let l=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}getSolicitudes(){return this.localFetch.getFetch(i.N.baseUrl+"/requests")}getSolicitudByCode(e){return this.localFetch.freeGetFetch(i.N.baseUrl+"/requests/"+e)}noMatchPhone(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/cancel",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/check-service",e).then((e=>{this.sendMessageToParent(400===e.code?{type:"response",data:{...e.response,status_code:"no_clave_pin_service"}}:{type:"response",data:e.data||e}),t(e)})).catch((e=>{this.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}setNoService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/no-service",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/terms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/retry",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/resend-otp",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,s)=>{this.localFetch.putFetchWhitoutToken(`${i.N.baseUrl}/requests/${e}/person`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendOTP(e,t){let n="/requests/clave-pin/otp";return(i.N.scraperMock||t)&&(n="/mockscrapper/requests/clave-pin/otp"),new Promise(((t,s)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+n,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):s(e)})).catch((e=>{s(e)}))}))}sendOTPToBde(e,t){let n="/requests/cirbe-cp/otp";return(i.N.scraperMock||t)&&(n="/mockscrapper/requests/cirbe-cp/otp"),new Promise(((t,s)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+n,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):s(e)})).catch((e=>{s(e)}))}))}sendSecondTask(e){let t="/requests/clave-pin/secondTask";return i.N.scraperMock&&(t="/mockscrapper/requests/clave-pin/secondTask"),new Promise(((n,s)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+t,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,s)=>{this.localFetch.postFetch(`${i.N.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendMessageToParent(e){window.top.postMessage(e,"*")}}return e.ɵfac=function(t){return new(t||e)(s.LFG(r.F),s.LFG(o.eN),s.LFG(a.r))},e.ɵprov=s.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5206:(e,t,n)=>{n.d(t,{s:()=>l});var i=n(6197),s=n(2340),r=n(4650),o=n(5089),a=n(6554);let l=(()=>{class e{constructor(e,t){this.utils=e,this.localFetch=t,this.db=(0,i.N8)()}getFlows(){return new Promise(((e,t)=>{this.localFetch.getFetch(s.N.baseUrl+"/flows").then((n=>{n?e(n):t(!1)}),(e=>{t(!1)}))}))}getFlowsByUserID(e){return new Promise(((t,n)=>{const s=(0,i.iH)((0,i.N8)());(0,i.U2)((0,i.iU)(s,`documents/flows/${e}`)).then((e=>{e.exists()?t(e.val()):n("No data!")})).catch((e=>{console.error(e),n("Error!: "+e)}))}))}}return e.ɵfac=function(t){return new(t||e)(r.LFG(o.F),r.LFG(a.r))},e.ɵprov=r.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},9617:(e,t,n)=>{n.d(t,{U:()=>l});var i=n(2340),s=n(4650),r=n(5089),o=n(529),a=n(6554);let l=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}getPackagesByUserID(e){return new Promise(((t,n)=>{this.localFetch.getFetchWhitoutToken(i.N.baseUrl+"/users/"+e+"/pack-documents").then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}getPacksByPackId(e){return new Promise(((t,n)=>{this.localFetch.getFetchWhitoutToken(i.N.baseUrl+"/pack-documents/"+e).then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}getFlowPackagesByUserID(e,t){}}return e.ɵfac=function(t){return new(t||e)(s.LFG(r.F),s.LFG(o.eN),s.LFG(a.r))},e.ɵprov=s.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5601:(e,t,n)=>{n.d(t,{M:()=>l});var i=n(2340),s=n(4650),r=n(5089),o=n(529),a=n(6554);let l=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}getSolicitudes(){return this.localFetch.getFetch(i.N.baseUrl+"/requests")}getSolicitudByCode(e){return this.localFetch.freeGetFetch(i.N.baseUrl+"/requests/"+e)}setPhone(e,t){return new Promise(((n,s)=>{this.localFetch.putFetchWhitoutToken(`${i.N.baseUrl}/requests/${t}/person`,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}noPhone(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/no-phone",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}smsToPin(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms-clave",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}addSolicitud(e,t,n){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}setNoService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/no-service",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/terms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/check-service",e).then((e=>{this.sendMessageToParent(400===e.code?{type:"response",data:{...e.response,status_code:"no_sms_service"}}:{type:"response",data:e.data||e}),t(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/retry",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/resend-otp",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,s)=>{this.localFetch.putFetchWhitoutToken(`${i.N.baseUrl}/requests/${e}/person`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let s="/requests/sms/otp";i.N.scraperMock&&(s="/mockscrapper/requests/sms/otp"),this.localFetch.postFetchWhitoutToken(i.N.baseUrl+s,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}uploadFileFromWidget(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(i.N.baseUrl+"/documents/upload-files-from-widget",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,s)=>{this.localFetch.postFetch(`${i.N.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}getDocuments(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${i.N.baseUrl}/requests/${e}/documents`).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}getDocumentsIds(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${i.N.baseUrl}/requests/${e}/documents-ids-widget`).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}cancelRequest(e,t){return new Promise(((n,s)=>{this.localFetch.postFetch(i.N.baseUrl+`/requests/${t}/cancel`,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendMessageToParent(e){window.top.postMessage(e,"*")}}return e.ɵfac=function(t){return new(t||e)(s.LFG(r.F),s.LFG(o.eN),s.LFG(a.r))},e.ɵprov=s.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5145:(e,t,n)=>{n.d(t,{Z:()=>i});const i=[{id:0,text:"error_clave_pin",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Error con la clave PIN"},{id:1,text:"failed_without_retry",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo sin reintento"},{id:111,text:"failed_with_retry",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo con reintento"},{id:2,text:"bad_phone",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Teléfono erróneo"},{id:3,text:"failed_documents_downloaded",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo al descargar Documentos"},{id:4,text:"invalid_otp_aeat",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"OTP de AEAT inválido"},{id:5,text:"invalid_otp_seguridad_social",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"OTP de Seg. Social inválido"},{id:6,text:"max_entries_otp",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"not_interested",label:"Max intentos OTP"},{id:7,text:"abandoned_after_bad_phone",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"phonelink_erase",label:"Abandonado (bad phone)"},{id:8,text:"abandoned_after_terms",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (términos y condiciones)"},{id:9,text:"abandoned_after_invalid_otp_seguridad_social",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (invalid OTP SS)"},{id:10,text:"abandoned_after_invalid_otp_aeat",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (invalid OTP AEAT)"},{id:11,text:"abandoned_after_waiting_otp_aeat",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (waiting OTP AEAT)"},{id:12,text:"abandoned_after_waiting_otp_seguridad_social",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (waiting OTP SS)"},{id:13,text:"waiting_login_seguridad_social",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando login SS"},{id:14,text:"waiting_login_aeat",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando login AEAT"},{id:15,text:"waiting_otp_aeat",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando OTP AEAT"},{id:16,text:"waiting_otp_seguridad_social",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando OTP SS"},{id:17,text:"saved_otp",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"OTP guardado"},{id:171,text:"picked_up_otp",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"OTP recogido"},{id:18,text:"terms_and_conditions",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"Términos y condiciones"},{id:19,text:"waiting_documents",textClass:"text-cyan",bgClass:"bg-cyan-light",previewClass:"bg-cyan",icon:"hourglass_empty",label:"Esperando documentos"},{id:20,text:"created",textClass:"text-cyan",bgClass:"bg-cyan-light",previewClass:"bg-cyan",icon:"fiber_new",label:"Solicitud creada"},{id:21,text:"all_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Todo los documentos descargados"},{id:22,text:"partial_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Algunos Documentos descargados"},{id:23,text:"parcial_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Algunos Documentos descargados"},{id:24,text:"all_documents_downloaded_and_deleted",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"delete",label:"Todos descargados y eliminados"},{id:25,text:"partial_documents_downloaded_and_deleted",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"delete",label:"Algunos descargados y eliminados"},{id:26,text:"updated_data",textClass:"text-blue-500",bgClass:"bg-blue-500/10",previewClass:"bg-blue-500",icon:"check",label:"Datos del cliente actualizados"},{id:27,text:"resend_otp",textClass:"text-blue-500",bgClass:"bg-blue-500/10",previewClass:"bg-blue-500",icon:"refresh",label:"OTP reenviado"}]},8259:function(e,t){var n,i,s;
59
+ "use strict";if((self.webpackChunkvex=self.webpackChunkvex||[]).push([[163],{4163:(e,t,n)=>{n.r(t),n.d(t,{ClientCertModule:()=>Zt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),y=n(9391),v=n(1572),w=n(182),x=n(4144),C=n(7367),k=n(9602),T=n(3238),M=n(5895),S=n(6257),I=n(1948),O=n(4246),L=n(9299),P=n(6e3),A=n(5861),E=n(7582),D=n(9549),N=n(9933),Y=n(8259),q=n(2340),R=n(1363),F=n(4650),Z=n(5089),U=n(8460),H=n(529),j=n(6554);let z=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(q.N.baseUrl+"/requests/client-certificate",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}addSignedFile(e){return new Promise(((t,n)=>{this.localFetch.postFile(q.N.baseUrl+"/requests/client-certificate/upload-file-signed",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}addFiles(e){return new Promise(((t,n)=>{this.localFetch.postFile(q.N.baseUrl+"/requests/client-certificate/upload-files",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(q.N.baseUrl+"/requests/client-certificate/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOtp(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(q.N.baseUrl+"/requests/client-certificate/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(q.N.baseUrl+"/requests/client-certificate/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}preRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(q.N.baseUrl+"/pre-request/client-certificate",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let i="/requests/client-certificate/otp";q.N.scraperMock&&(i="/mockscrapper/requests/client-certificate/otp"),this.localFetch.postFetchWhitoutToken(q.N.baseUrl+i,e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(F.LFG(Z.F),F.LFG(H.eN),F.LFG(j.r))},e.ɵprov=F.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var B=n(5412),J=n(833),V=n(4302),Q=n(6830),W=n(3731);function G(e,t){if(1&e&&(F.TgZ(0,"span"),F._uU(1),F.qZA()),2&e){const e=F.oxw(3);F.xp6(1),F.hij("¿No has recibido el código? Solicítalo de nuevo en ",e.secsCount," segundos")}}function $(e,t){if(1&e&&(F.TgZ(0,"span"),F._uU(1),F.qZA()),2&e){const e=F.oxw(3);F.xp6(1),F.AsE("¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? Solicítalo de nuevo en ",e.secsCount," segundos")}}const K=function(e,t,n){return{color:e,border:t,background:n}};function X(e,t){if(1&e&&(F.ynx(0),F.TgZ(1,"small",13),F.YNc(2,G,2,1,"span",7),F.YNc(3,$,2,2,"span",7),F.qZA(),F.BQk()),2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("ngStyle",F.kEZ(3,K,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),F.xp6(1),F.Q6J("ngIf",!e.lastNumberPhone),F.xp6(1),F.Q6J("ngIf",e.lastNumberPhone)}}function ee(e,t){1&e&&(F.TgZ(0,"span"),F._uU(1," ¿No has recibido el código en tu teléfono? "),F.qZA())}function te(e,t){if(1&e&&(F.TgZ(0,"span"),F._uU(1),F.qZA()),2&e){const e=F.oxw(3);F.xp6(1),F.hij(" ¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? ")}}const ne=function(e,t){return{color:e,background:t}};function ie(e,t){if(1&e){const e=F.EpF();F.ynx(0),F.TgZ(1,"small",13),F.YNc(2,ee,2,0,"span",7),F.YNc(3,te,2,1,"span",7),F.TgZ(4,"a",14),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw(2);return F.KtG(t.resendOTP())})),F._uU(5,"Reenviar"),F.qZA()(),F.BQk()}if(2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("ngStyle",F.kEZ(4,K,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),F.xp6(1),F.Q6J("ngIf",!e.lastNumberPhone),F.xp6(1),F.Q6J("ngIf",e.lastNumberPhone),F.xp6(1),F.Q6J("ngStyle",F.WLB(8,ne,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor))}}function se(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",2)(1,"div",3),F._UZ(2,"div",4)(3,"div",5),F.ALo(4,"safeHtml"),F.TgZ(5,"div",6),F.YNc(6,X,4,7,"ng-container",7),F.YNc(7,ie,6,11,"ng-container",7),F.qZA(),F.TgZ(8,"div",8)(9,"mat-form-field",9)(10,"mat-label"),F._uU(11," Código OTP "),F.qZA(),F.TgZ(12,"input",10),F.NdJ("change",(function(t){F.CHM(e);const n=F.oxw();return F.KtG(n.capturePasteEvent(t))}))("keyup",(function(t){F.CHM(e);const n=F.oxw();return F.KtG(n.setInputEvent(t))})),F.qZA()()()(),F.TgZ(13,"div",11)(14,"button",12),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(15,"Siguiente"),F.qZA()()()}if(2&e){const e=F.oxw();F.Q6J("formGroup",e.form),F.xp6(2),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.otp.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,18,e.texts.otp.description||""),F.oJD),F.xp6(3),F.Q6J("ngIf",e.secsCount&&e.secsCount>0),F.xp6(1),F.Q6J("ngIf",!e.secsCount||e.secsCount<=0),F.xp6(7),F.Udp("color",e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",e.form.invalid)}}function re(e,t){if(1&e&&(F.TgZ(0,"div",15),F._UZ(1,"mat-progress-spinner",16),F.TgZ(2,"p",17),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.Oqu(e.loading)}}let oe=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new F.vpe(null),this.errPhone=new F.vpe(null),this.resendO=new F.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,A.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?Y(e.target).next().focus():"Backspace"==e.code&&Y(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.QS),F.Y36(Z.F),F.Y36(_.M),F.Y36(L.gz))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",loading:"loading"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",3,"formGroup",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,se,16,20,"form",0),F.YNc(1,re,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.O5,i.PC,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,v.Ou,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var ae=n(342);function le(e,t){if(1&e&&(F.TgZ(0,"div",3),F._UZ(1,"div",4)(2,"div",5),F.ALo(3,"safeHtml"),F.qZA()),2&e){const e=F.oxw();F.xp6(1),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.success.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(3,8,e.texts.success.description||""),F.oJD)}}function ce(e,t){if(1&e&&F._UZ(0,"widget-documents",6),2&e){const e=F.oxw();F.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function de(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",7)(1,"button",8),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.gotoRedirect())})),F._uU(2),F.qZA()()}if(2&e){const e=F.oxw();F.xp6(1),F.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.xp6(1),F.hij(" ",e.data.ClientCertificate.btnTextCallBack||"Haga click aquí para finalizar"," ")}}let ue=(()=>{class e{constructor(e){this.utils=e,this.showDocuments=!1}ngOnInit(){this.data.ClientCertificate.enableUrlCallBack&&this.data.ClientCertificate.automaticRedirectCallBack&&this.data.ClientCertificate.callBackUrl?setTimeout((()=>{location.assign(this.data.ClientCertificate.callBackUrl)}),2e3):this.data.ClientCertificate.showDocumentsOnSuccess&&(this.showDocuments=!0)}gotoRedirect(){this.data.ClientCertificate.enableUrlCallBack&&this.data.ClientCertificate.callBackUrl&&location.assign(this.data.ClientCertificate.callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(Z.F))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",loading:"loading",packId:"packId",requestID:"requestID",userId:"userId"},decls:3,vars:3,consts:[["class","pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[3,"userId","packId","requestID",4,"ngIf"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(F.YNc(0,le,4,10,"div",0),F.YNc(1,ce,1,3,"widget-documents",1),F.YNc(2,de,3,7,"div",2)),2&e&&(F.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),F.xp6(1),F.Q6J("ngIf",t.showDocuments),F.xp6(1),F.Q6J("ngIf",t.data.ClientCertificate.enableUrlCallBack))},dependencies:[i.O5,u.lW,ae.A,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function he(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",5)(1,"button",6),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.retry())})),F._uU(2,"Intentarlo nuevamente"),F.qZA()()}if(2&e){const e=F.oxw();F.xp6(1),F.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function pe(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",5)(1,"button",6),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.newRequest())})),F._uU(2,"Crear nueva solicitud"),F.qZA()()}if(2&e){const e=F.oxw();F.xp6(1),F.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}let me=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new F.vpe(null),this.newReq=new F.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.QS),F.Y36(Z.F),F.Y36(_.M),F.Y36(y.o),F.Y36(M.T))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",loading:"loading",solicitud:"solicitud"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:7,vars:8,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(F.TgZ(0,"div",0)(1,"div",1),F._UZ(2,"div",2)(3,"div",3),F.ALo(4,"safeHtml"),F.qZA(),F.YNc(5,he,3,6,"div",4),F.YNc(6,pe,3,6,"div",4),F.qZA()),2&e&&(F.xp6(2),F.Q6J("innerHTML",t.texts.fail.title,F.oJD),F.xp6(1),F.Udp("color",t.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,6,t.texts.fail.description),F.oJD),F.xp6(2),F.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),F.xp6(1),F.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function fe(e,t){if(1&e&&(F.TgZ(0,"span",7),F._uU(1),F.qZA()),2&e){const e=F.oxw();F.xp6(1),F.hij("El archivo no puede pesar mas de ",e.max/1e3,"MB")}}function ge(e,t){if(1&e&&(F.TgZ(0,"span"),F._uU(1),F.qZA()),2&e){const e=F.oxw();F.xp6(1),F.AsE("",e.fileName," ",e.fileSize?"("+e.fileSize+"Kb)":"","")}}n(6866);const _e=function(e,t){return{"bg-red-500/20":e,"bg-slate-100/80":t}};let be=(()=>{class e{constructor(e){this.formBuilder=e,this.file=null,this.fileName="No se ha seleccionado ningun archivo",this.fileSize=0,this.acceptFiles="image/jpeg, image/jpg, application/pdf",this.max=1e4,this.newItemEvent=new F.vpe(null),this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.uploadForm=this.formBuilder.group({file:[""]})}fileChange(e){const t=e.target.files[0];this.uploadForm.patchValue({file:t}),this.uploadForm.get("file").updateValueAndValidity();const n=new FormData;let i=this.uploadForm.get("file").value;this.fileName=i.name,this.fileSize=+(+i.size/1e3).toFixed(1),n.append("file",i),console.warn(this.uploadForm.get("file").value),console.error(t),t.size<=3e6&&this.newItemEvent.emit({file:t}),this.newItemEvent.emit(n)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.qu))},e.ɵcmp=F.Xpm({type:e,selectors:[["app-upload-file"]],inputs:{label:"label",acceptFiles:"acceptFiles",max:"max"},outputs:{newItemEvent:"change"},decls:11,vars:9,consts:[[1,"flex","flex-col","items-start","input-file-wrapper","my-1",3,"formGroup","ngClass"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"flex","items-center","justify-start","mt-3"],["mat-flat-button","","color","accent",1,"btn-file",3,"click"],["class","text-red-500",4,"ngIf"],[4,"ngIf"],[1,"text-red-500"]],template:function(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",0)(1,"mat-label"),F._uU(2),F.qZA(),F.TgZ(3,"input",1,2),F.NdJ("change",(function(e){return t.fileChange(e)})),F.qZA(),F.TgZ(5,"div",3)(6,"button",4),F.NdJ("click",(function(){F.CHM(e);const t=F.MAs(4);return F.KtG(t.click())})),F._uU(7,"Seleccionar archivo"),F.qZA(),F._uU(8,"     "),F.YNc(9,fe,2,1,"span",5),F.YNc(10,ge,2,2,"span",6),F.qZA()()}2&e&&(F.Q6J("formGroup",t.uploadForm)("ngClass",F.WLB(6,_e,!t.fileName||t.fileSize>3e3,t.fileName&&t.fileSize<=3e3)),F.xp6(2),F.Oqu(t.label),F.xp6(1),F.Q6J("accept",t.acceptFiles),F.xp6(6),F.Q6J("ngIf",t.fileSize>t.max),F.xp6(1),F.Q6J("ngIf",t.fileSize<=t.max))},dependencies:[i.mk,i.O5,p._Y,p.JL,p.sg,D.hX,u.lW],styles:["button[aria-pressed=true][_ngcontent-%COMP%]{color:red!important}.btn-file[_ngcontent-%COMP%]{max-width:200px}.input-file-wrapper[_ngcontent-%COMP%]{padding:.7rem .5rem .7rem 1rem;border-radius:5px;border:2px dashed rgba(0,0,0,.1)}"]}),e})();function ye(e,t){if(1&e&&(F.TgZ(0,"mat-hint",21),F._uU(1),F.qZA()),2&e){const e=F.oxw(2);F.xp6(1),F.Oqu(e.errorDNI)}}function ve(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",2)(1,"div",3),F._UZ(2,"div",4)(3,"div",5),F.ALo(4,"safeHtml"),F.qZA(),F.TgZ(5,"div",6)(6,"mat-form-field",7)(7,"mat-label"),F._uU(8,"Nombre de la persona responsable"),F.qZA(),F._UZ(9,"input",8),F.qZA(),F.TgZ(10,"mat-form-field",7)(11,"mat-label"),F._uU(12,"Primer apellido de la persona responsable"),F.qZA(),F._UZ(13,"input",9),F.qZA(),F.TgZ(14,"mat-form-field",7)(15,"mat-label"),F._uU(16,"Segundo apellido de la persona responsable"),F.qZA(),F._UZ(17,"input",10),F.qZA(),F.TgZ(18,"mat-form-field",7)(19,"mat-label"),F._uU(20,"Email"),F.qZA(),F._UZ(21,"input",11),F.qZA(),F.TgZ(22,"mat-form-field",7)(23,"mat-label"),F._uU(24,"Teléfono"),F.qZA(),F._UZ(25,"input",12),F.qZA(),F.TgZ(26,"mat-form-field",7)(27,"mat-label"),F._uU(28,"Número de documento de identificación"),F.qZA(),F._UZ(29,"input",13),F.YNc(30,ye,2,1,"mat-hint",14),F.qZA(),F.TgZ(31,"mat-form-field",7)(32,"mat-label"),F._uU(33,"Razón social"),F.qZA(),F._UZ(34,"input",15),F.qZA(),F.TgZ(35,"mat-form-field",7)(36,"mat-label"),F._uU(37,"CIF"),F.qZA(),F._UZ(38,"input",16),F.qZA(),F.TgZ(39,"app-upload-file",17),F.NdJ("change",(function(t){F.CHM(e);const n=F.oxw();return F.KtG(n.setAnvers(t))})),F.qZA(),F.TgZ(40,"app-upload-file",18),F.NdJ("change",(function(t){F.CHM(e);const n=F.oxw();return F.KtG(n.setRevers(t))})),F.qZA()(),F.TgZ(41,"div",19)(42,"button",20),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(43," Siguiente "),F.qZA()()()}if(2&e){const e=F.oxw();F.Q6J("formGroup",e.form),F.xp6(2),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.form.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,51,e.texts.form.description||""),F.oJD),F.xp6(3),F.Gre("",e.disabledInputs.name?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.name?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.lastname?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.lastname?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.secondlastname?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.secondlastname?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.email?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.phone?"disabled-input":""," w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.phone?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.dni?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.dni?-1:1),F.xp6(1),F.Q6J("ngIf",e.errorDNI),F.xp6(1),F.Gre("",e.disabledInputs.razon?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.razon?-1:1),F.xp6(1),F.Gre("",e.disabledInputs.cif?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),F.xp6(3),F.s9C("tabindex",e.disabledInputs.cif?-1:1),F.xp6(1),F.Q6J("max",2e3),F.xp6(1),F.Q6J("max",2e3),F.xp6(2),F.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",e.form.invalid)}}function we(e,t){if(1&e&&(F.TgZ(0,"div",22),F._UZ(1,"mat-progress-spinner",23),F.TgZ(2,"p",24),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.hij(" ",e.loading," ")}}const xe={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Ce=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.cd=n,this.next=new F.vpe(null),this.disabledInputs={dni:!1,name:!1,lastname:!1,secondlastname:!1,phone:!1,email:!1,razon:!1,cif:!1,type:!1}}ngOnInit(){this.setForm(this.solicitud?this.solicitud:null)}setForm(e){let t=e&&e.person_name?e.person_name:null,n=e&&(e.email||e.email_copy)?e.email||e.email_copy:null,i=e&&e.person_last_name?e.person_last_name:null,s=e&&e.person_last_name2?e.person_last_name2:null,r=e?e.person_document_number||e.document_number:null,o=e&&e.razon_social?e.razon_social:null,a=e&&e.cif?e.cif:null,l=e&&e.phone?e.phone:null;this.form=this.fb.group({name:[t||null,[p.kI.required]],lastname:[i||null,[p.kI.required]],lastname2:[s||null],dni:[r||null,[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9),this.regexDNI()]],razon:[o||null,[p.kI.required]],email:[n,[p.kI.required,p.kI.email]],phone:[l,[p.kI.required]],cif:[a||null,[p.kI.required,p.kI.minLength(9),p.kI.maxLength(9)]],document_front:[null,[p.kI.required]],document_back:[null,[p.kI.required]]}),this.requestIDFromURL&&this.disableEnableInputs(!1,t,i,s,n,l,r,o,a),this.cd.markForCheck()}disableEnableInputs(e,t,n,i,s,r,o,a,l){this.disabledInputs={name:t||!1,lastname:n||!1,secondlastname:i||!1,email:s||!1,phone:r||!1,dni:o||!1,razon:a||!1,cif:l||!1,type:e||!1}}if(e){this.setRegex(e)}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}setRegex(e){e&&(this.isDni=!!e.toUpperCase().match(/^(\d{8})([A-Z])$/),this.isNie=!!e.toUpperCase().match(/^[XYZ]\d{7,8}[A-Z]$/),console.warn(this.isDni,this.isNie),this.errorDNI=this.isDni||this.isNie?null:"Debes ingresar un DNI o NIE válido!",this.cd.markForCheck())}setAnvers(e){e&&e.file&&this.form.patchValue({document_front:e.file})}setRevers(e){e&&e.file&&this.form.patchValue({document_back:e.file})}nextStep(){let e={name:this.form.get("name").value,lastname:this.form.get("lastname").value,lastname2:this.form.get("lastname2").value,dni:this.form.get("dni").value,company_name:this.form.get("razon").value,cif:this.form.get("cif").value,document_front:this.form.get("document_front").value,document_back:this.form.get("document_back").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("lastname2").value,email_copy:this.form.get("email").value,phone:this.form.get("phone").value,document_number:this.form.get("dni").value,check_legal:!0,type:"LEGAL",rmc_validation:!0,validation_id:!0};this.data.config.activatePower&&(e.power_activate=1),this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.QS),F.Y36(Z.F),F.Y36(F.sBO))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-form-step"]],inputs:{data:"data",flowName:"flowName",texts:"texts",solicitud:"solicitud",loading:"loading",requestIDFromURL:"requestIDFromURL"},outputs:{next:"nextStep"},features:[F._Bn([{provide:T.sG,useValue:xe},{provide:F.soG,useValue:"es-ES"}])],decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",3,"formGroup",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline"],["formControlName","name","matInput","",3,"tabindex"],["formControlName","lastname","matInput","",3,"tabindex"],["formControlName","lastname2","matInput","",3,"tabindex"],["formControlName","email","matInput","",3,"tabindex"],["formControlName","phone","maxlength","9","matInput","",3,"tabindex"],["formControlName","dni","maxlength","9","placeholder","Ej: 12345678R","matInput","",3,"tabindex"],["class","text-xs text-red-500",4,"ngIf"],["formControlName","razon","placeholder","Ej: Mi Empresa","type","text","matInput","",3,"tabindex"],["formControlName","cif","maxlength","9","placeholder","Ej: B12345678","type","text","matInput","",3,"tabindex"],["label","Anverso documento de identificación (Max 2MB)",1,"w-full",3,"max","change"],["label","Reverso documento de identificación (Max 2MB)",1,"w-full",3,"max","change"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-xs","text-red-500"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,ve,44,53,"form",0),F.YNc(1,we,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.O5,u.lW,D.KE,D.bx,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.nD,p.sg,p.u,v.Ou,be,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),ke=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts",loading:"loading"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(F.TgZ(0,"form",0)(1,"div",1),F._UZ(2,"div",2)(3,"div",3),F.ALo(4,"safeHtml"),F.qZA()()),2&e&&(F.xp6(2),F.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),F.Q6J("innerHTML",t.texts.noService.title,F.oJD),F.xp6(1),F.Udp("color",t.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,8,t.texts.noService.description),F.oJD))},dependencies:[p._Y,p.JL,p.F,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Te=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new F.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return"Abandonado después de esperar OTP de Seguridad Social";case"abandoned_after_invalid_otp_seguridad_social":return"Abandonado despues de OTP inválido en Seguridad Social";case"abandoned_after_invalid_otp_aeat":return"Abandonado despues de OTP inválido en AEAT";case"abandoned_after_waiting_otp_aeat":return"Abandonado después de esperar OTP de AEAT";default:return this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.QS),F.Y36(Z.F),F.Y36(_.M),F.Y36(y.o),F.Y36(M.T))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",loading:"loading",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:10,vars:17,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-md","mb-2","mt-2"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(F.TgZ(0,"div",0)(1,"div",1),F._UZ(2,"div",2)(3,"div",3),F.ALo(4,"safeHtml"),F.TgZ(5,"div",4),F._uU(6),F.qZA()(),F.TgZ(7,"div",5)(8,"button",6),F.NdJ("click",(function(){return t.retry()})),F._uU(9,"Intentarlo nuevamente"),F.qZA()()()),2&e&&(F.xp6(2),F.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),F.Q6J("innerHTML",t.texts.abandoned.title,F.oJD),F.xp6(1),F.Udp("color",t.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,15,t.texts.abandoned.description),F.oJD),F.xp6(3),F.hij(" Estado: ",t.getTextStatus()," "),F.xp6(2),F.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Me(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function Se(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," La contraseña es requerida "),F.qZA())}function Ie(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," La contraseña debe tener al menos 8 carácteres "),F.qZA())}function Oe(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," Es necesario repetir la contraseña "),F.qZA())}function Le(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," Las contraseñas deben coincidir "),F.qZA())}function Pe(e,t){1&e&&(F.TgZ(0,"mat-hint",14),F._uU(1," La contraseña debe tener al menos 8 carácteres "),F.qZA())}function Ae(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",2)(1,"div",3),F._UZ(2,"div",4)(3,"div",5),F.ALo(4,"safeHtml"),F.qZA(),F.TgZ(5,"div",6)(6,"mat-form-field",7)(7,"mat-label"),F._uU(8,"Contraseña"),F.qZA(),F._UZ(9,"input",8),F.YNc(10,Se,2,0,"mat-hint",9),F.YNc(11,Ie,2,0,"mat-hint",9),F.qZA(),F.TgZ(12,"mat-form-field",10)(13,"mat-label"),F._uU(14,"Repite Contraseña"),F.qZA(),F._UZ(15,"input",11),F.YNc(16,Oe,2,0,"mat-hint",9),F.YNc(17,Le,2,0,"mat-hint",9),F.YNc(18,Pe,2,0,"mat-hint",9),F.qZA()(),F.TgZ(19,"div",12)(20,"button",13),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(21," Guardar "),F.qZA()()()}if(2&e){const e=F.oxw();F.Q6J("formGroup",e.form),F.xp6(2),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.password.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,21,e.texts.password.description),F.oJD),F.xp6(7),F.Q6J("ngIf",e.f.password.touched&&e.f.password.invalid&&e.f.password.errors.required),F.xp6(1),F.Q6J("ngIf",e.f.password.invalid&&e.f.password.errors.minlength),F.xp6(5),F.Q6J("ngIf",e.f.confirm_password.touched&&e.f.confirm_password.touched&&e.f.confirm_password.invalid&&e.f.confirm_password.errors.required),F.xp6(1),F.Q6J("ngIf",e.f.confirm_password.touched&&e.f.confirm_password.touched&&e.f.confirm_password.invalid&&e.f.confirm_password.errors.confirmedValidator),F.xp6(1),F.Q6J("ngIf",e.f.confirm_password.invalid&&e.f.confirm_password.errors.minlength),F.xp6(2),F.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",e.form.invalid)}}function Ee(e,t){if(1&e&&(F.TgZ(0,"div",15),F._UZ(1,"mat-progress-spinner",16),F.TgZ(2,"p",17),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.hij(" ",e.loading," ")}}const De={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Ne=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.form=new p.cw({}),this.next=new F.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Me("password","confirm_password")})}nextStep(){this.next.emit(this.form.get("password").value)}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.qu),F.Y36(Z.F))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",loading:"loading"},outputs:{next:"nextStep"},features:[F._Bn([{provide:T.sG,useValue:De},{provide:F.soG,useValue:"es-ES"}])],decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",3,"formGroup",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,Ae,22,23,"form",0),F.YNc(1,Ee,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.O5,u.lW,D.KE,D.bx,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,v.Ou,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ye=n(1763),qe=n(5696);function Re(e,t){1&e&&F._UZ(0,"mat-icon",14)}function Fe(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div")(1,"belender-checkbox",11),F.NdJ("changeCheckbox",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.setTerms(t))})),F.TgZ(2,"belender-terms-and-policy-links",12),F.NdJ("goToTerms",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.gotoTermsAndConditions(t))})),F.qZA()(),F.YNc(3,Re,1,0,"mat-icon",13),F.qZA()}if(2&e){const e=F.oxw(2);F.Gre("mt-8 flex justify-between items-center w-full flex-100 ",e.errorType.termsRead||e.errorType.acceptTerms?"bg-orange-500/10 ":""," pr-4 rounded-sm"),F.xp6(1),F.Q6J("color",e.data.styles.colors.title),F.xp6(1),F.Q6J("userId",e.userId)("showPolicyLink",null==e.data?null:e.data.config.showPolicyLink),F.xp6(1),F.Q6J("ngIf",e.errorType.termsRead||e.errorType.acceptTerms)}}function Ze(e,t){1&e&&F._UZ(0,"mat-icon",14)}function Ue(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div")(1,"belender-checkbox",11),F.NdJ("changeCheckbox",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.setPower(t))})),F._uU(2," Consiento expresamente a la activación de un poder digital según las condiciones que pueden verse "),F.TgZ(3,"a",15),F.NdJ("click",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.gotoPowerConditions(t))})),F.TgZ(4,"u"),F._uU(5,"aquí"),F.qZA()()(),F.YNc(6,Ze,1,0,"mat-icon",13),F.qZA()}if(2&e){const e=F.oxw(2);F.Gre("flex justify-between items-center w-full flex-100 ",e.errorType.termsRead||e.errorType.powerAccept?"bg-orange-500/10 ":"",""),F.xp6(1),F.Q6J("color",e.data.styles.colors.title),F.xp6(5),F.Q6J("ngIf",e.errorType.powerAccept)}}function He(e,t){1&e&&F._UZ(0,"mat-icon",14)}function je(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div")(1,"belender-checkbox",11),F.NdJ("changeCheckbox",(function(t){F.CHM(e);const n=F.oxw(2);return F.KtG(n.setAssignment(t))})),F._UZ(2,"div",16),F.qZA(),F.YNc(3,He,1,0,"mat-icon",13),F.qZA()}if(2&e){const e=F.oxw(2);F.Gre("flex justify-between items-center w-full flex-100 ",e.errorType.assignment?"bg-orange-500/10 ":""," pr-4 rounded-sm"),F.xp6(1),F.Q6J("color",e.data.styles.colors.title),F.xp6(1),F.Q6J("innerHTML",null==e.data?null:e.data.config.dataAssignmentText,F.oJD),F.xp6(1),F.Q6J("ngIf",e.errorType.assignment)}}function ze(e,t){if(1&e&&(F.TgZ(0,"div",19),F._UZ(1,"mat-icon",20),F._uU(2),F.qZA()),2&e){const e=F.oxw().$implicit;F.xp6(2),F.hij(" ",e," ")}}function Be(e,t){if(1&e&&(F.ynx(0),F.YNc(1,ze,3,1,"div",18),F.BQk()),2&e){const e=t.index;F.xp6(1),F.Q6J("ngIf",e<3)}}function Je(e,t){if(1&e&&(F.ynx(0),F.YNc(1,Be,2,1,"ng-container",17),F.BQk()),2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("ngForOf",e.errors)}}function Ve(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",2)(1,"div",3),F._UZ(2,"div",4)(3,"div",5),F.ALo(4,"safeHtml"),F.qZA(),F.TgZ(5,"div",6),F.YNc(6,Fe,4,7,"div",7),F.YNc(7,Ue,7,5,"div",7),F.YNc(8,je,4,6,"div",7),F.qZA(),F.YNc(9,Je,2,1,"ng-container",8),F.TgZ(10,"div",9)(11,"button",10),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(12,"Siguiente"),F.qZA()()()}if(2&e){const e=F.oxw();F.xp6(2),F.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),F.Q6J("innerHTML",e.texts.tyc.title,F.oJD),F.xp6(1),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(4,19,e.texts.tyc.description||""),F.oJD),F.xp6(3),F.Q6J("ngIf",!e.data.config.hideCheckLegal),F.xp6(1),F.Q6J("ngIf",e.requestID?null==e.solicitud?null:e.solicitud.power_activate:null==e.data?null:e.data.config.activatePower),F.xp6(1),F.Q6J("ngIf",null==e.data?null:e.data.config.dataAssignmentCheck),F.xp6(1),F.Q6J("ngIf",e.errors&&e.errors.length),F.xp6(2),F.Udp("color",e.getErrorValidation()?"":e.data.styles.colors.btnText)("background",e.getErrorValidation()?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",e.getErrorValidation())}}function Qe(e,t){if(1&e&&(F.TgZ(0,"div",21),F._UZ(1,"mat-progress-spinner",22),F.TgZ(2,"p",23),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.Oqu(e.loading)}}let We=(()=>{class e{constructor(e){this.utils=e,this.requestID=null,this.powerAccepted=!1,this.next=new F.vpe(null),this.goTerms=new F.vpe(null),this.goTermsCert=new F.vpe(null),this.gotoPower=new F.vpe(null),this.acceptTerms=!1,this.acceptTerms2=!0,this.powerActivate=!1,this.termsReaded=!1,this.terms2Readed=!0,this.assignment=!1,this.errors=[],this.errorType={termsRead:!1,terms2Read:!1,powerRead:!1,powerAccept:!1,acceptTerms:!1,acceptTerms2:!1,assignment:!1,acceptPower:!1}}ngOnInit(){}nextStep(){this.next.emit(this.powerActivate)}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(e){e.preventDefault(),e.stopPropagation(),this.terms2Readed=!0,this.goTermsCert.emit(!0)}gotoPowerConditions(e){e.preventDefault(),e.stopPropagation(),this.gotoPower.emit(!0)}setAssignment(e){this.assignment=e}setPower(e){this.powerActivate=e}setTerms(e){this.acceptTerms=e}setTerms2(e){this.acceptTerms2=e}getErrorValidation(){this.errors=[],this.errorType={termsRead:!1,terms2Read:!1,powerRead:!1,powerAccept:!1,acceptTerms:!1,acceptTerms2:!1,assignment:!1,acceptPower:!1};let e=!1;return this.data.config.forceChecks&&(!this.termsReaded&&!this.data.config.hideCheckLegal&&(this.errors.push("Debe leer los términos y condiciones del servicio"),this.errorType.termsRead=!0,e=!0),this.terms2Readed||(this.errors.push("Debe leer los términos y condiciones para la emisión de certificado"),this.errorType.terms2Read=!0,e=!0)),!this.acceptTerms&&!this.data.config.hideCheckLegal&&(this.errors.push("Debe aceptar los términos y condiciones del servicio"),this.errorType.acceptTerms=!0,e=!0),this.acceptTerms2||(this.errors.push("Debe aceptar los términos y condiciones para la emisión de certificado"),this.errorType.acceptTerms2=!0,e=!0),this.data.config.dataAssignmentCheck&&!this.assignment&&(this.errors.push("Debe consentir la activación de un poder digital registrado en el REA"),this.errorType.assignment=!0,e=!0),(this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&(this.powerActivate||(this.errors.push("Debe consentir la activación de un poder digital registrado en el REA"),this.errorType.powerAccept=!0,e=!0)),e}}return e.ɵfac=function(t){return new(t||e)(F.Y36(Z.F))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-terms-step"]],inputs:{userId:"userId",requestID:"requestID",data:"data",texts:"texts",solicitud:"solicitud",loading:"loading",powerAccepted:"powerAccepted"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",gotoPower:"gotoPowerConditions"},decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],[3,"class",4,"ngIf"],[4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"color","changeCheckbox"],[3,"userId","showPolicyLink","goToTerms"],["class","text-xs w-4 h-4 text-orange-500","svgIcon","mat:warning",4,"ngIf"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4","text-orange-500"],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],[1,"custom-html",3,"innerHTML"],[4,"ngFor","ngForOf"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500 ",4,"ngIf"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,Ve,13,21,"div",0),F.YNc(1,Qe,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.sg,i.O5,d.Hw,u.lW,v.Ou,Ye.b,qe.T,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ge=n(4468);function $e(e,t){1&e&&(F.TgZ(0,"div",12),F._UZ(1,"mat-icon",13),F._uU(2," Archivo firmado cargado "),F.qZA())}function Ke(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"button",14),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw(2);return F.KtG(t.onClickAutofirma())})),F._uU(1,"Firmar certificado"),F.qZA()}if(2&e){const e=F.oxw(2);F.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function Xe(e,t){1&e&&(F.TgZ(0,"div",15),F._UZ(1,"mat-progress-spinner",16),F.TgZ(2,"span",17),F._uU(3,"Esperando autofirma..."),F.qZA()())}function et(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"form",2)(1,"div",3)(2,"h1",4),F._uU(3,"HOJA DE ACEPTACIÓN DE CERTIFICADO ELECTRONICO CUALIFICADO RÉGIMEN OBLIGATORIO DE USO DEL CERTIFICADO ELECTRONICO: “CERTIFICADO DE PERSONA FÍSICA REPRESENTANTE DE EMPRESA EMITIDO EN SOFTWARE”"),F.qZA(),F.TgZ(4,"p"),F._uU(5," a) Que existen unas condiciones generales del servicio incorporadas en el texto de divulgación del certificado o PDS, y una declaración de prácticas de certificación, que regulan la emisión y utilización del certificado electrónico emitido porvinCAsign, cuyo texto íntegro se puede consultar en la dirección de Internet, https://policy.vincasign.net. "),F.qZA(),F.TgZ(6,"p"),F._uU(7," b) Que el certificado electrónico emitido y el resto de los elementos que forman parte de la identificación electrónica son únicos para cada usuario. El certificado debe ser protegido por un código secreto (PIN), que sólo conoce el titular y que le será entregado en el momento de la emisión del certificado. Para utilizar el certificado es imprescindible conocer este código. "),F.qZA(),F.TgZ(8,"p"),F._uU(9," c) Que este certificado permite al titular del certificado generar firmas electrónicas e identificarse de forma electrónica en aquellos sistemas de información que soporten este tipo de autenticación. "),F.qZA(),F.TgZ(10,"p"),F._uU(11," d) Que el FIRMANTE debe custodiar, de forma diligente, el PIN que permite utilizarlo, para evitar que otras personas puedan suplantar su identidad y firmar documentos en su nombre, o acceder a mensajes confidenciales o sistemas de información de acceso restringido. "),F.qZA(),F.TgZ(12,"p"),F._uU(13," e) Que, si el FIRMANTE detecta cualquier indicio de que su identificación electrónica ha podido ser utilizada por otras personas, tendrá que suspender el uso del certificado y notificarlo inmediatamente al responsable del servicio de certificación del SUSCRIPTOR, o a vinCAsign, para pedir la revocación del certificado y, en su caso, la emisión de uno nuevo. "),F.qZA(),F.TgZ(14,"p"),F._uU(15," f) Que ante cualquier necesidad de información adicional, respecto de la utilización de los certificados emitidos en nombre de vinCAsign, el FIRMANTE se podrá dirigir al SUSCRIPTOR, al responsable del servicio de certificación del SUSCRIPTOR, y/o a VINTEGRIS. "),F.qZA(),F.TgZ(16,"p"),F._uU(17," g) Que con el fin de obtener los correspondientes certificados, y dentro del marco del Reglamento (UE) 2016/679 del Parlamento Europeo y del Consejo de 27 de abril de 2016 relativo a la protección de las personas físicas en lo que respecta al tratamiento de datos personales y a la libre circulación de estos datos y por el que se deroga la Directiva 95/46/CE (Reglamento general de protección de datos), el SUSCRIPTOR ha comunicado a vinCAsign los datos identificativos del FIRMANTE con el fin de emitir y gestionar el certificado corporativo de persona física emitido en software, en el ámbito de la relación de trabajo entre dicho FIRMANTE y el SUSCRIPTOR, todo ello a los efectos de lo previsto en el artículo 28 del Reglamento general de protección de datos. "),F.qZA(),F.TgZ(18,"p"),F._uU(19," h) Que sabe que, en cumplimiento de lo establecido en los artículos 24.2 y 28 del Reglamento (UE) 910/2014 del Parlamento Europeo y del Consejo de 23 de julio de 2014, los datos contenidos en el certificado corporativo de persona física emitido en software están publicados en la página web de vinCAsign a efectos del Registro de Certificados y de las listas de revocación, toda vez que ha prestado su consentimiento durante el proceso de solicitud. "),F.qZA(),F.TgZ(20,"h1",5),F._uU(21," ACTO DE ACEPTACIÓN DEL CERTIFICADO ELECTRÓNICO "),F.qZA(),F.TgZ(22,"p"),F._uU(23," Firmo el presente documento para dejar constancia: "),F.qZA(),F.TgZ(24,"p"),F._uU(25," Que ha sido informado del contenido del texto de divulgación del certificado o PDS, en el que se incluyen las condiciones generales del servicio aplicable al certificado corporativo de persona física emitido en software. "),F.qZA(),F.TgZ(26,"p"),F._uU(27," Que ha sido informado del régimen obligatorio de uso del certificado emitido, sus condiciones de uso y sus responsabilidades. "),F.qZA(),F.TgZ(28,"p"),F._uU(29," Que ha sido informado de las circunstancias relativas al tratamiento de sus datos personales para la correcta emisión y gestión del certificado que se emite. "),F.qZA(),F.TgZ(30,"p"),F._uU(31," Firma de conformidad, en virtud de la cual ha leído y entiende las obligaciones y responsabilidades que asume. "),F.qZA(),F.TgZ(32,"div",6),F.YNc(33,$e,3,0,"div",7),F.YNc(34,Ke,2,6,"button",8),F.YNc(35,Xe,4,0,"div",9),F.qZA()(),F.TgZ(36,"div",10)(37,"button",11),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.nextStep())})),F._uU(38,"Completar"),F.qZA()()()}if(2&e){const e=F.oxw();F.Q6J("formGroup",e.form),F.xp6(33),F.Q6J("ngIf",e.signedFile&&!e.loadingAutofirma),F.xp6(1),F.Q6J("ngIf",!e.signedFile&&!e.loadingAutofirma),F.xp6(1),F.Q6J("ngIf",e.loadingAutofirma),F.xp6(2),F.Udp("color",e.signedFile?e.data.styles.colors.btnText:"")("background",e.signedFile?e.data.styles.colors.btnBg:"")("border-radius",e.data.styles.btnRound+"px"),F.Q6J("disabled",!e.signedFile)}}function tt(e,t){if(1&e&&(F.TgZ(0,"div",18),F._UZ(1,"mat-progress-spinner",19),F.TgZ(2,"p",20),F._uU(3),F.qZA()()),2&e){const e=F.oxw();F.xp6(3),F.Oqu(e.loading)}}let nt=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.notis=t,this.utils=n,this._autofirma=i,this.form=new p.cw({}),this.next=new F.vpe(null),this.loadingAutofirma=!1}ngOnInit(){this.setForm(),this.blobFile=this.base64ToBlob(this.pdfFile64,"application/pdf");const e=URL.createObjectURL(this.blobFile);this.pdfHtml="<iframe width='100%' height='100%' src='"+e+"'></iframe>",this.pdfHtml+=`<img style="width: 100%; min-heigth: 300px" src="${e}" />`}base64ToBlob(e,t="application/octet-stream"){const n=atob(e),i=n.length,s=new Uint8Array(i);for(let e=0;e<i;e++)s[e]=n.charCodeAt(e);return new Blob([s],{type:t})}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({file_signed:["",[p.kI.required]]})}nextStep(){this.next.emit({file_signed:this.signedFile})}onChangeFile(e){const t=e.target;!t||!t.files||(this.file=t.files[0])}blobToFile(e,t){return e.lastModifiedDate=new Date,e.name=t,e}onClickAutofirma(){var e=this;return(0,A.Z)((function*(){e.loadingAutofirma=!0;let t,n="signed_document";e.file=e.blobToFile(e.blobFile,n),e._autofirma.requestPDFSignature(e.file,{headless:!0,filters:{"issuer.rfc2254":"(CN=AC Representa*)"}}).then((i=>{t=i,e.loadingAutofirma=!1;let s=new File([t],n+"_signed.pdf",{type:e.file.type});e.signedFile=s,e.nextStep()})).catch((t=>{t?.message?.includes("ApplicationNotFoundException")?e.notis.showAlert("No se encuentra AutoFirma","No se ha encontrado el programa de autofirma instalado en su computador, por favor descarguelo en el siguiente link y vuelva a intentarlo.","info",{cancelButtonLabel:"Ir a Autofirma",okButtonLabel:"Cerrar",cancelAction:function(){window.open("https://firmaelectronica.gob.es/Home/Descargas.html","_blank")}}):e.notis.showAlert("Error desconocido","Ha ocurrido un error: "+t)}))}))()}fileToUrl(e){return new Promise(((t,n)=>{const i=new FileReader;i.onloadend=()=>{t(i.result)},i.readAsDataURL(e)}))}setAnvers(e){e&&e.file&&this.form.patchValue({document_front:e.file})}setRevers(e){e&&e.file&&this.form.patchValue({document_back:e.file})}}return e.ɵfac=function(t){return new(t||e)(F.Y36(p.qu),F.Y36(M.T),F.Y36(Z.F),F.Y36(Ge.Kj))},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-autofirma-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",loading:"loading",pdfFile64:"pdfFile64"},outputs:{next:"nextStep"},decls:2,vars:2,consts:[["class","animated fadeIn fixed-content px-2",3,"formGroup",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px] animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"my-3","bg-slate-50","p-2","rounded-md","flex","max-h-[300px]","overflow-y-auto","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],[1,"font-bold"],[1,"pt-3","font-bold"],[1,"flex","w-full","items-center","justify-end","gap-2","p-4"],["class","flex gap-1 text-green-500 items-center justify-end w-full",4,"ngIf"],["class","px-8","mat-flat-button","","type","button",3,"color","background","border-radius","click",4,"ngIf"],["class","flex items-center gap-2",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"flex","gap-1","text-green-500","items-center","justify-end","w-full"],["svgIcon","mat:check_circle"],["mat-flat-button","","type","button",1,"px-8",3,"click"],[1,"flex","items-center","gap-2"],["color","accent","diameter","20","value","0","mode","indeterminate",1,"spinner"],[1,"text-black"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(F.YNc(0,et,39,11,"form",0),F.YNc(1,tt,4,1,"div",1)),2&e&&(F.Q6J("ngIf",!t.loading),F.xp6(1),F.Q6J("ngIf",t.loading))},dependencies:[i.O5,d.Hw,u.lW,p._Y,p.JL,p.sg,v.Ou],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),it=(()=>{class e{constructor(){this.next=new F.vpe(null)}ngOnInit(){}nextStep(){this.next.emit(!0)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=F.Xpm({type:e,selectors:[["belender-requisites-step"]],inputs:{data:"data",texts:"texts",loading:"loading"},outputs:{next:"nextStep"},decls:15,vars:18,consts:[[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"py-4"],["href","https://firmaelectronica.gob.es/Home/Descargas.html","target","_blank",1,"text-blue-500","font-bold","underline"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(F.TgZ(0,"div",0),F._UZ(1,"div",1)(2,"div",2),F.ALo(3,"safeHtml"),F.TgZ(4,"div",3),F._uU(5," Si no tiene "),F.TgZ(6,"strong"),F._uU(7,"Autofirma"),F.qZA(),F._uU(8," instalado, antes de continuar, puedes instalarlo siguiendo este "),F.TgZ(9,"a",4),F._uU(10,"link"),F.qZA(),F._uU(11,". "),F.qZA(),F.TgZ(12,"div",5)(13,"button",6),F.NdJ("click",(function(){return t.nextStep()})),F._uU(14,"Siguiente"),F.qZA()()()),2&e&&(F.xp6(1),F.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),F.Q6J("innerHTML",null==t.texts||null==t.texts.requisites?null:t.texts.requisites.title,F.oJD),F.xp6(1),F.Udp("color",t.data.styles.colors.text),F.Q6J("innerHTML",F.lcZ(3,16,null==t.texts||null==t.texts.requisites?null:t.texts.requisites.description),F.oJD),F.xp6(2),F.Udp("color",t.data.styles.colors.text),F.xp6(9),F.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function st(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"vex-power-cert",4),F.NdJ("accept",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.acceptPowerCert())})),F.qZA()}if(2&e){const e=F.oxw();F.Q6J("hideButtons",!1)("flow","ClientCertificate")("userId",e.userId)}}function rt(e,t){if(1&e&&(F.TgZ(0,"div",10),F._UZ(1,"img",11),F.qZA()),2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("src",e.data.styles.logoUrl,F.LSH)}}function ot(e,t){1&e&&(F.TgZ(0,"div",12),F._UZ(1,"mat-progress-spinner",13),F.qZA()),2&e&&(F.xp6(1),F.Q6J("value",0))}function at(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-form-step",25),F.NdJ("gotoPowerConditions",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.gotoPowerConditions())}))("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.sendFormData(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("flowName",e.flowName)("loading",e.loading)("requestIDFromURL",e.requestIDFromURL)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function lt(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-requisites-step",26),F.NdJ("nextStep",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.showRequisitesPage=!1)})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)}}function ct(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-terms-step",27),F.NdJ("goToTerms",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.gotoTermsAndConditions())}))("gotoPowerConditions",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.acceptTerms(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("userId",e.userId)("requestID",e.requestID)("data",e.data)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)("loading",e.loading)}}function dt(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-password-step",28),F.NdJ("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.sendPassword(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function ut(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-autofirma-step",29),F.NdJ("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.sendDocument(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("pdfFile64",e.pdfFile64)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function ht(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-otp-step",30),F.NdJ("resendOTP",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.resendOTP(t))}))("errorPhone",(function(){F.CHM(e);const t=F.oxw(3);return F.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.requestOTP(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function pt(e,t){if(1&e&&F._UZ(0,"belender-success-step",31),2&e){const e=F.oxw(3);F.Q6J("data",e.data)("packId",e.packId)("userId",e.userId)("requestID",e.requestID)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)}}function mt(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-fail-step",32),F.NdJ("retry",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.retryRequest(t))}))("newRequest",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.newRequest(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("solicitud",e.solicitud)}}function ft(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"belender-abandoned-step",33),F.NdJ("retry",(function(t){F.CHM(e);const n=F.oxw(3);return F.KtG(n.retryRequest(t))})),F.qZA()}if(2&e){const e=F.oxw(3);F.Q6J("solicitud",e.solicitud)("data",e.data)("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)}}function gt(e,t){if(1&e&&F._UZ(0,"belender-no-service-step",34),2&e){const e=F.oxw(3);F.Q6J("loading",e.loading)("texts",null==e.data.ClientCertificate?null:e.data.ClientCertificate.texts)("data",e.data)}}function _t(e,t){if(1&e&&(F.TgZ(0,"div",35)(1,"div",36)(2,"h1",37),F._uU(3,"No existe la solicitud"),F.qZA()(),F.TgZ(4,"div",38),F._uU(5," No existen solicitudes activas con el código requerido "),F.qZA()()),2&e){const e=F.oxw(3);F.xp6(4),F.Udp("color",e.data.styles.colors.text)}}function bt(e,t){if(1&e&&(F.ynx(0),F.YNc(1,at,1,6,"belender-form-step",14),F.YNc(2,lt,1,3,"belender-requisites-step",15),F.YNc(3,ct,1,6,"belender-terms-step",16),F.YNc(4,dt,1,4,"belender-password-step",17),F.YNc(5,ut,1,5,"belender-autofirma-step",18),F.YNc(6,ht,1,4,"belender-otp-step",19),F.YNc(7,pt,1,6,"belender-success-step",20),F.YNc(8,mt,1,4,"belender-fail-step",21),F.YNc(9,ft,1,4,"belender-abandoned-step",22),F.YNc(10,gt,1,3,"belender-no-service-step",23),F.YNc(11,_t,6,2,"div",24),F.BQk()),2&e){const e=F.oxw(2);F.xp6(1),F.Q6J("ngIf",e.data&&"form"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","autofirma"==e.getStatus()&&e.showRequisitesPage),F.xp6(1),F.Q6J("ngIf","terms"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","password"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","autofirma"==e.getStatus()&&e.pdfFile64&&!e.showRequisitesPage),F.xp6(1),F.Q6J("ngIf","otp"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","success"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","failed"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","abandoned"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","no-service"==e.getStatus()),F.xp6(1),F.Q6J("ngIf","no-exist"==e.getStatus())}}function yt(e,t){1&e&&F._UZ(0,"belender-disabled-url")}function vt(e,t){if(1&e&&(F.TgZ(0,"div",39),F._UZ(1,"mat-progress-spinner",40),F.TgZ(2,"p",41),F._uU(3),F.qZA()()),2&e){const e=F.oxw(2);F.xp6(3),F.hij(" ",e.loading," ")}}function wt(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"div",42)(1,"div",35)(2,"div",43),F._uU(3,"Error!"),F.qZA(),F._UZ(4,"div",44),F.qZA(),F.TgZ(5,"div",45)(6,"button",46),F.NdJ("click",(function(){F.CHM(e);const t=F.oxw(2);return F.KtG(t.error=!1)})),F._uU(7," Ingresar manualmente "),F.qZA()()()}if(2&e){const e=F.oxw(2);F.xp6(4),F.Udp("color",e.data.styles.colors.text),F.Q6J("innerHTML",e.error,F.oJD)}}function xt(e,t){if(1&e&&(F.TgZ(0,"div",5)(1,"div"),F.YNc(2,rt,2,1,"div",6),F.YNc(3,ot,2,1,"div",7),F.YNc(4,bt,12,11,"ng-container",3),F.YNc(5,yt,1,0,"belender-disabled-url",3),F.YNc(6,vt,4,1,"div",8),F.YNc(7,wt,8,3,"div",9),F.qZA()()),2&e){const e=F.oxw();F.xp6(1),F.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),F.Udp("background",e.data.styles.colors.background),F.xp6(1),F.Q6J("ngIf",e.data.styles.withLogo&&"loading"!=e.getStatus()),F.xp6(1),F.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"==e.getStatus()),F.xp6(1),F.Q6J("ngIf",!e.error),F.xp6(1),F.Q6J("ngIf",!e.error&&e.disableURL),F.xp6(1),F.Q6J("ngIf",e.loading),F.xp6(1),F.Q6J("ngIf",!e.loading&&e.error)}}function Ct(e,t){if(1&e){const e=F.EpF();F.TgZ(0,"vex-terms",47),F.NdJ("accepted",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){F.CHM(e);const t=F.oxw();return F.KtG(t.handleTermsResponse(!1))})),F.qZA()}if(2&e){const e=F.oxw();F.Q6J("flow","certificate")("requestStatus",e.solicitud?e.solicitud.status_code:"")}}function kt(e,t){if(1&e&&(F.ynx(0),F.TgZ(1,"div",48),F._uU(2),F.qZA(),F.BQk()),2&e){const e=F.oxw();F.xp6(2),F.hij(" TestMode ",e.testMode?"ON":"OFF"," ")}}let Tt=class{constructor(e,t,n,i,s,r,o,a,l){this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.certificateService=a,this.dialog=l,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.showRequisitesPage=!0,this.requestCreated=!1,this.requestIDFromURL=!1,this.flowName="ClientCertificate",this.showTermsDialog=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.userId?this.setInitialData(this.userId):this.loading=null,"pro"!=q.N.env&&(Y(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),Y(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){}setInitialData(e){var t=this;return(0,A.Z)((function*(){const n=yield t.getFlow(e);if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},!t.data.config||!t.data.config.funder_id)return t.notis.showAlert("Error!","No se ha configurado la customización del widget para este usuario","error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,A.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}sendPreRequest(){this.certificateService.preRequest({user_id:this.userId,package_id:this.packId}).then((e=>{e&&e.data&&(this.requestID=e.data.request_id),this.loading=!1})).catch((e=>{console.error(e),this.loading=!1}))}setParamsToRequest(e){this.requestIDFromURL=!0,this.solicitud||(this.solicitud={status_code:"form"}),e.document&&!this.solicitud.person_document_number&&(this.solicitud.person_document_number=e.document),e.birthday&&!this.solicitud.birth_date&&(this.solicitud.birth_date=e.birthday),e.expiration&&!this.solicitud.document_expiration_date&&(this.solicitud.document_expiration_date=e.expiration),e.type&&!this.solicitud.person_type&&(this.solicitud.person_type=e.type),e.phone&&!this.solicitud.phone&&(this.solicitud.phone=e.phone),e.email&&!this.solicitud.email&&(this.solicitud.email=e.email),e.cif&&!this.solicitud.cif&&(this.solicitud.cif=e.cif),e.razon&&!this.solicitud.razon_social&&(this.solicitud.razon_social=e.razon),e.name&&!this.solicitud.person_name&&(this.solicitud.person_name=e.name),e.lastname&&!this.solicitud.person_last_name&&(this.solicitud.person_last_name=e.lastname),e.second_lastname&&!this.solicitud.person_last_name2&&(this.solicitud.person_last_name2=e.second_lastname)}sendMessageToParent(e){window.top.postMessage(e,"*")}validateRequestIdInUrl(){const e=this;this.Activatedroute.queryParams.subscribe((t=>{t&&this.setParamsToRequest(t),t&&t.acceptTerms&&(this.autoAcceptTerms=!0),t&&t.request_id?(this.disableURL=!1,e.requestID=t.request_id,this.setFormFromVcCode(t.request_id)):(e.sendPreRequest(),console.error("con paramas"))}),(e=>{this.loading=!1,console.error("sin paramas")}))}setFormFromVcCode(e){var t=this;return(0,A.Z)((function*(){t.loading="Obteniendo datos de la solicitud...",t.solicitudesService.getSolicitudByCode(e).then((e=>{e&&e.data?(t.solicitud=e.data,t.pdfFile64=t.solicitud.file,t.setSubscriptionOfRequest(),t.loading=!1,t.skipCreationOfRequest=!0,t.autoAcceptTerms&&t.acceptTerms(!0)):t.loading=!1})).catch((e=>{t.loading=!1}))}))()}setSubscriptionOfRequest(){const e=this;if(e.socket)return;let t="wss://notifications.dev.belender.net";"qa"==q.N.env&&(t="wss://notifications.qa.belender.net"),"pro"==q.N.env&&(t="wss://notifications.belender.net"),q.N.notificationsBaseUrl&&(t=q.N.notificationsBaseUrl),this.socket=new WebSocket(`${t}?requests_id=${e.requestID}&user_id=${e.userId}`),this.socket.onopen=function(n){console.log("Conexión establecida: ",`${t}?requests_id=${e.requestID}&user_id=${e.userId}`)},this.socket.onmessage=function(t){let n=JSON.parse(t.data);console.warn("message from ws:",n),e.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}handlePusherNotification(e){this.dataFromFirebase=e,this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,this.sendMessageToParent({type:"websocket",data:e}),"invalid_otp_seguridad_social"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),"terms_and_conditions"!=this.solicitud.status_code&&setTimeout((()=>{this.loading=!1,this.cd.markForCheck()}),500))}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}sendNewData(e){this.loading="Enviando información..",this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e),this.loading=!1):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse("Validando nuevos datos, espere por favor.."),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}showAlert(e,t){this.loading=!1,this.notis.showAlert(e,t)}sendFormData(e){this.requestID&&(e.request_id=this.requestID),e.user_id=this.userId,e.package_id=this.packId,e.validation_id=0;const t=new FormData;let n=Object.keys(e);for(const i of n)t.append(i,e[i]);this.loading="Subiendo documentación...",this.addRequest(t).then((e=>{e&&e.length&&this.setSubscriptionOfRequest(),this.loading=null})).catch((e=>{console.error("promise error: ",e),this.loading=null}))}uploadFiles(e){return new Promise(((t,n)=>{this.certificateService.addSignedFile(e).then((e=>{e&&e.status&&"error"==e.status?(e.message&&(this.showAlert("Error!",400==e.code&&"Does not have Known client service"==e.message?"El usuario no tiene servicio PIN habilitado!":400==e.code&&"Incorrect date"==e.message?"Fecha incorrecta!":e.message),n(e.message)),n(e),this.loading=null,this.cd.markForCheck()):e&&e.status&&"success"==e.status?t(!0):(this.showAlert("Error!","Error desconocido: "+e),n(e),this.loading=null,this.cd.markForCheck())})).catch((e=>{n(e),e&&e.errorMessage&&this.showAlert("Error!",e.errorMessage),this.loading=null,this.cd.markForCheck()}))}))}addRequest(e){return new Promise(((t,n)=>{this.certificateService.addSolicitud(e).then((e=>{e&&e.status&&"error"==e.status?(e.message&&(this.showAlert("Error!",400==e.code&&"Does not have Known client service"==e.message?"El usuario no tiene servicio PIN habilitado!":400==e.code&&"Incorrect date"==e.message?"Fecha incorrecta!":e.message),n(e.message)),this.loading=null,this.cd.markForCheck(),n(e)):e&&e.status&&"success"==e.status?(this.solicitud=e.data,this.setSubscriptionOfRequest(),this.loading=null,this.cd.markForCheck(),t(e.data)):(this.showAlert("Error!","Error desconocido: "+e),n(e))})).catch((e=>{console.error("respuesta desde pin service: ",e),e&&e.errorMessage&&this.showAlert("Error!",e.errorMessage),this.loading=null,this.cd.markForCheck(),n(e)}))}))}acceptTerms(e){this.loading="Iniciando el proceso de emisión de certificado..";let t={request_id:this.solicitud.request_id,terms_and_conditions_service:!0,terms_and_conditions_certificate_emition:!0};(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e?1:0),this.certificateService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?this.showAlert("Error!",e.message?e.message:e):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}sendPassword(e){this.loading="Enviando información..",this.certificateService.sendPassword({request_id:this.solicitud.request_id,password:e}).then((e=>{e.status&&"error"==e.status?this.showAlert("Error!",e.message?e.message:e):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.pdfFile64=e.file,this.cd.markForCheck()),this.loading=null})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}sendDocument(e){e.request_id=this.requestID;const t=new FormData;let n=Object.keys(e);for(const i of n)t.append(i,e[i]);this.loading="Subiendo documentación...",this.uploadFiles(t).then((e=>{e&&(this.solicitud.status_code="consent_process_completed")})).catch((e=>{console.error(e)}))}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}requestOTP(e){let t={otp:e.code,request_id:this.solicitud.request_id};this.loading="Enviando código OTP ..",this.certificateService.sendOtp(t).then((e=>{e.status&&"error"==e.status?this.showAlert("Error!",e.message?e.message:e):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.cd.markForCheck()),this.loading=!1})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}askToBack(){this.solicitudesService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.requestCreated=!0,this.requestIDFromURL=!0,this.solicitud=e.data,this.loading=!1):this.loading=!1})).catch((e=>{this.loading=!1}))}gotoErrorPhone(){}setRequestStatus(e){this.solicitud.status_code=e}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading="Reintentando enviar la solicitud...",this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}newRequest(e){this.solicitud.status_code="created"}disconnectWebsocket(){console.log("intentando desconectar ws..."),this.socket&&this.socket.close()}getStatus(){return!this.solicitud||this.solicitud&&("created"==this.solicitud.status_code||"form"==this.solicitud.status_code)?"form":this.solicitud&&"terms_and_conditions"==this.solicitud.status_code?"terms":this.solicitud&&"waiting_acceptance_file_signed"==this.solicitud.status_code?(console.log("returning autofirma"),"autofirma"):!this.solicitud||"waiting_login_seguridad_social"!=this.solicitud.status_code&&"saved_otp"!=this.solicitud.status_code?!this.solicitud||"waiting_otp_seguridad_social"!=this.solicitud.status_code&&"waiting_otp"!=this.solicitud.status_code&&"invalid_otp_seguridad_social"!=this.solicitud.status_code?!this.solicitud||"waiting_password"!=this.solicitud.status_code&&"approved_terms_digital_power"!=this.solicitud.status_code&&"declined_terms_digital_power"!=this.solicitud.status_code?!this.solicitud||"abandoned_after_bad_phone"!=this.solicitud.status_code&&"abandoned_after_invalid_otp_seguridad_social"!=this.solicitud.status_code&&"abandoned_after_terms_and_conditions"!=this.solicitud.status_code&&"abandoned_after_waiting_otp_seguridad_social"!=this.solicitud.status_code?!this.solicitud||"all_documents_downloaded"!=this.solicitud.status_code&&"partial_documents_downloaded"!=this.solicitud.status_code&&"consent_process_completed"!=this.solicitud.status_code&&"waiting_certificate"!=this.solicitud.status_code&&"waiting_documents"!=this.solicitud.status_code?!this.solicitud||"bad_phone"!=this.solicitud.status_code&&"phone_not_exist_otp"!=this.solicitud.status_code?!this.solicitud||"failed_with_retry"!=this.solicitud.status_code&&"failed_without_retry"!=this.solicitud.status_code&&"failed_documents_downloaded"!=this.solicitud.status_code?this.solicitud&&"no_service"==this.solicitud.status_code?"no-service":"no-exist":"failed":"error-data":(this.disconnectWebsocket(),this.data.config&&this.data.config.infiniteLoopInCompleted?"loading":"success"):"abandoned":"password":"otp":(this.loading="Estamos procesando su solicitud. Espere un momento por favor","loading")}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1}gotoTermsAndConditionsCertificate(){this.dialog.open(R.v,{panelClass:"fullscreen-dialog",data:{flow:"certificate"}})}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}};Tt.ɵfac=function(e){return new(e||Tt)(F.Y36(F.sBO),F.Y36(L.gz),F.Y36(Z.F),F.Y36(_.M),F.Y36(C.w),F.Y36(U.r),F.Y36(M.T),F.Y36(z),F.Y36(B.uw))},Tt.ɵcmp=F.Xpm({type:Tt,selectors:[["belender-widget-client-cert"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[F._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:4,vars:4,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","requestStatus","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","loading-wrapper flex flex-col gap-2 items-center justify-center h-full min-h-[200px]",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"data","flowName","loading","requestIDFromURL","texts","solicitud","gotoPowerConditions","nextStep",4,"ngIf"],[3,"data","loading","texts","nextStep",4,"ngIf"],[3,"userId","requestID","data","texts","solicitud","loading","goToTerms","gotoPowerConditions","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","loading","texts","solicitud","nextStep",4,"ngIf"],[3,"data","pdfFile64","loading","texts","solicitud","nextStep",4,"ngIf"],[3,"data","loading","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","packId","userId","requestID","loading","texts",4,"ngIf"],[3,"data","loading","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","loading","texts","retry",4,"ngIf"],[3,"loading","texts","data",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"data","flowName","loading","requestIDFromURL","texts","solicitud","gotoPowerConditions","nextStep"],[3,"data","loading","texts","nextStep"],[3,"userId","requestID","data","texts","solicitud","loading","goToTerms","gotoPowerConditions","goToTermsCertificate","nextStep"],[3,"data","loading","texts","solicitud","nextStep"],[3,"data","pdfFile64","loading","texts","solicitud","nextStep"],[3,"data","loading","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","packId","userId","requestID","loading","texts"],[3,"data","loading","texts","solicitud","retry","newRequest"],[3,"solicitud","data","loading","texts","retry"],[3,"loading","texts","data"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[1,"loading-wrapper","flex","flex-col","gap-2","items-center","justify-center","h-full","min-h-[200px]"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","requestStatus","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(F.YNc(0,st,1,3,"vex-power-cert",0),F.YNc(1,xt,8,11,"div",1),F.YNc(2,Ct,1,2,"vex-terms",2),F.YNc(3,kt,3,1,"ng-container",3)),2&e&&(F.Q6J("ngIf",t.viewPowerTerms),F.xp6(1),F.Q6J("ngIf",t.data),F.xp6(1),F.Q6J("ngIf",t.showTermsDialog),F.xp6(1),F.Q6J("ngIf",t.testMode))},dependencies:[i.O5,u.lW,v.Ou,J.L,V.q,Q.L,oe,ue,me,Ce,ke,Te,Ne,We,nt,it],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),Tt=(0,E.gn)([(0,N.c)()],Tt);const Mt=[{path:":idUser",component:Tt},{path:":idUser/:packID",component:Tt}];let St=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=F.oAB({type:e}),e.ɵinj=F.cJS({imports:[L.Bz.forChild(Mt),L.Bz,P.d8]}),e})();var It=n(6981),Ot=n(3848),Lt=n(1129),Pt=n(969),At=n(7009);let Et=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=F.oAB({type:e}),e.ɵinj=F.cJS({imports:[i.ez,At.ZX,d.Ps,p.UX,x.c,u.ot]}),e})();var Dt=n(1145),Nt=n(2266),Yt=n(3300),qt=n(865),Rt=n(3033),Ft=n(3295);let Zt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=F.oAB({type:e}),e.ɵinj=F.cJS({providers:[_.M,y.o,C.w,w.t,M.T,O.t,z,{provide:T.Ad,useValue:"es-ES"}],imports:[St,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,v.Cq,k.FA,T.XK,S.T5,I.Fk,It.x,Ot.Nh,c.p9,Lt.n,Pt.O,Et,Dt.j,Nt.L,Yt.C,qt.q,Rt.d,Ft.g]}),e})()}}]),(self.webpackChunkvex=self.webpackChunkvex||[]).push([[244],{667:(e,t,n)=>{n.d(t,{$:()=>s});var i=n(7340);const s=(r=400,(0,i.X$)("fadeInUp",[(0,i.eR)(":enter",[(0,i.oB)({transform:"translateY(20px)",opacity:0}),(0,i.jt)(`${r}ms cubic-bezier(0.35, 0, 0.25, 1)`,(0,i.oB)({transform:"translateY(0)",opacity:1}))])]));var r},5592:(e,t,n)=>{n.d(t,{J:()=>a});var i=n(6895),s=n(9299),r=n(7392),o=n(4650);let a=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({imports:[i.ez,s.Bz,r.Ps]}),e})()},1763:(e,t,n)=>{n.d(t,{b:()=>c});var i=n(4650),s=n(6895),r=n(7392);function o(e,t){1&e&&i._UZ(0,"mat-icon",3)}const a=function(e,t){return{background:e,"border-color":t}},l=["*"];let c=(()=>{class e{constructor(){this.text="",this.color="rgb(14, 197, 151)",this.ccb=new i.vpe,this.checked=!1}ngOnInit(){}emitChange(){this.checked=!this.checked,this.ccb.emit(this.checked)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-checkbox"]],inputs:{text:"text",color:"color",checked:"checked"},outputs:{ccb:"changeCheckbox"},ngContentSelectors:l,decls:5,vars:5,consts:[[1,"flex","items-start","gap-2","justify-start","w-fit","hover:bg-slate-700/10","py-2","rounded-sm","cursor-pointer",3,"click"],[1,"check-wrapper","w-5","h-5","border","mr-1","rounded-sm","flex","justify-center","items-center","p-0",3,"ngStyle"],["style","font-size: 5px","class","m-0 p-0 text-white","svgIcon","mat:check",4,"ngIf"],["svgIcon","mat:check",1,"m-0","p-0","text-white",2,"font-size","5px"]],template:function(e,t){1&e&&(i.F$t(),i.TgZ(0,"div",0),i.NdJ("click",(function(){return t.emitChange()})),i.TgZ(1,"div",1),i.YNc(2,o,1,0,"mat-icon",2),i.qZA(),i.TgZ(3,"div"),i.Hsn(4),i.qZA()()),2&e&&(i.xp6(1),i.Q6J("ngStyle",i.WLB(2,a,t.checked?t.color:"transparent",t.checked?t.color:"rgba(0,0,0,.7)")),i.xp6(1),i.Q6J("ngIf",t.checked))},dependencies:[s.O5,s.PC,r.Hw],styles:[".check-wrapper[_ngcontent-%COMP%]{transition:all .3s ease;min-width:1.25rem}"]}),e})()},1129:(e,t,n)=>{n.d(t,{n:()=>c});var i=n(6895),s=n(4006),r=n(9549),o=n(9101),a=n(7392),l=n(4650);let c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=l.oAB({type:e}),e.ɵinj=l.cJS({imports:[i.ez,s.u5,s.UX,r.lN,o.ot,a.Ps]}),e})()},8008:(e,t,n)=>{n.d(t,{O:()=>o});var i=n(4650),s=n(6895);function r(e,t){if(1&e&&(i.O4$(),i.kcU(),i.TgZ(0,"p",4),i._uU(1),i.qZA()),2&e){const e=i.oxw();i.xp6(1),i.Oqu(e.text)}}let o=(()=>{class e{constructor(){this.text="",this.color="rgb(14, 197, 151)",this.zoom=1}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-spinner"]],inputs:{text:"text",color:"color",zoom:"zoom"},decls:4,vars:7,consts:[[1,"flex","w-full","justify-center","items-center","flex-col","gap-4"],["width","65px","height","65px","viewBox","0 0 66 66","xmlns","http://www.w3.org/2000/svg",1,"spinner"],["fill","none","stroke-width","6","stroke-linecap","round","cx","33","cy","33","r","30",1,"path"],["class","text-center",4,"ngIf"],[1,"text-center"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0),i.O4$(),i.TgZ(1,"svg",1),i._UZ(2,"circle",2),i.qZA(),i.YNc(3,r,2,1,"p",3),i.qZA()),2&e&&(i.xp6(1),i.Jzz("zoom: ",t.zoom,"; "),i.xp6(1),i.Jzz("stroke: ",t.color,""),i.xp6(1),i.Q6J("ngIf",t.text))},dependencies:[s.O5],styles:[".spinner[_ngcontent-%COMP%]{animation:rotator 1.4s linear infinite}@keyframes rotator{0%{transform:rotate(0)}to{transform:rotate(270deg)}}.path[_ngcontent-%COMP%]{stroke-dasharray:187;stroke-dashoffset:0;transform-origin:center;animation:dash 1.4s ease-in-out infinite}@keyframes dash{0%{stroke-dashoffset:187}50%{stroke-dashoffset:46.75;transform:rotate(135deg)}to{stroke-dashoffset:187;transform:rotate(450deg)}}"]}),e})()},9476:(e,t,n)=>{n.d(t,{F:()=>c});var i=n(6895),s=n(4006),r=n(9549),o=n(9101),a=n(7392),l=n(4650);let c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=l.oAB({type:e}),e.ɵinj=l.cJS({imports:[i.ez,s.u5,s.UX,r.lN,o.ot,a.Ps]}),e})()},833:(e,t,n)=>{n.d(t,{L:()=>d});var i=n(4650),s=n(9299),r=n(7367),o=n(8460),a=n(6895),l=n(9101);function c(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",5)(1,"button",6),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.accept())})),i._uU(2,"Cerrar"),i.qZA()()}if(2&e){const e=i.oxw();i.xp6(1),i.Udp("color",e.funderStyles.colors.btnText)("background",e.funderStyles.colors.btnBg)("border-radius",e.funderStyles.btnRound+"px")}}let d=(()=>{class e{constructor(e,t,n){this.Activatedroute=e,this.customizationService=t,this.customizationStoreService=n,this.loading=!0,this.hideButtons=!0,this.acceptTerms=new i.vpe(null),this.cancelTerms=new i.vpe(null)}ngOnInit(){this.loading=!0,this.userId&&this.flow?(this.userID=this.userId,this.flowName=this.flow,this.customizationStoreService.getFunderStyles().subscribe((e=>{this.funderStyles=e})),this.customizationService.getCustomizationByFlow(this.userID,this.flowName).then((e=>{this.flowConfig=e,this.terms_and_conditions=this.flowConfig&&this.flowConfig.terms_and_conditions?this.flowConfig.terms_and_conditions:`\n <div class="px-10 py-6 rounded-md text-center bg-orange-500/20 text-orange-600">\n <p>No hay términos y condiciones para el flujo <b>${this.flowName}</b></p> \n </div>`,this.loading=!1})).catch((e=>{this.loading=!1}))):this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userID=e.idUser,this.flowName=this.getParsedFlowName(e.flow),this.userID?this.customizationService.getCustomizationByFlow(this.userID,this.flowName).then((e=>{this.flowConfig=e,this.terms_and_conditions=this.flowConfig&&this.flowConfig.terms_and_conditions?this.flowConfig.terms_and_conditions:'\n <div class="px-10 py-6 rounded-md text-center bg-orange-500/20 text-orange-600">\n <p>No hay términos y condiciones para este flujo</p> \n </div>',this.loading=!1})).catch((e=>{this.loading=!1})):this.loading=!1):this.loading=!1}),(e=>{this.loading=!1}))}getParsedFlowName(e){switch(e){case"sms":case"Sms":return"SMS";case"clavepin":case"ClavePin":case"CLAVEPIN":return"ClavePin";case"videoid":return"VideoID";case"personal":case"presencial":case"client-cert":return"KnownClient";default:return e}}accept(){this.acceptTerms.emit(!0)}cancel(){this.cancelTerms.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.gz),i.Y36(r.w),i.Y36(o.r))},e.ɵcmp=i.Xpm({type:e,selectors:[["vex-power-cert"]],inputs:{flow:"flow",userId:"userId",hideButtons:"hideButtons"},outputs:{acceptTerms:"accept",cancelTerms:"cancel"},decls:33,vars:1,consts:[[1,"py-12","flex","flex-col","items-center","overflow-auto","max-h-[96vh]","terms-page"],[1,"max-w-xl","overflow-y-auto"],[1,"font-bold"],[1,"pt-6","font-bold"],["class","w-full max-w-xl flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"w-full","max-w-xl","flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0)(1,"div",1)(2,"h1",2),i._uU(3,"HOJA DE ACEPTACIÓN DE CERTIFICADO ELECTRONICO CUALIFICADO RÉGIMEN OBLIGATORIO DE USO DEL CERTIFICADO ELECTRONICO: “CERTIFICADO DE PERSONA FÍSICA REPRESENTANTE DE EMPRESA EMITIDO EN SOFTWARE”"),i.qZA(),i.TgZ(4,"p"),i._uU(5," a) Que existen unas condiciones generales del servicio incorporadas en el texto de divulgación del certificado o PDS, y una declaración de prácticas de certificación, que regulan la emisión y utilización del certificado electrónico emitido porvinCAsign, cuyo texto íntegro se puede consultar en la dirección de Internet, https://policy.vincasign.net. "),i.qZA(),i.TgZ(6,"p"),i._uU(7," b) Que el certificado electrónico emitido y el resto de los elementos que forman parte de la identificación electrónica son únicos para cada usuario. El certificado debe ser protegido por un código secreto (PIN), que sólo conoce el titular y que le será entregado en el momento de la emisión del certificado. Para utilizar el certificado es imprescindible conocer este código. "),i.qZA(),i.TgZ(8,"p"),i._uU(9," c) Que este certificado permite al titular del certificado generar firmas electrónicas e identificarse de forma electrónica en aquellos sistemas de información que soporten este tipo de autenticación. "),i.qZA(),i.TgZ(10,"p"),i._uU(11," d) Que el FIRMANTE debe custodiar, de forma diligente, el PIN que permite utilizarlo, para evitar que otras personas puedan suplantar su identidad y firmar documentos en su nombre, o acceder a mensajes confidenciales o sistemas de información de acceso restringido. "),i.qZA(),i.TgZ(12,"p"),i._uU(13," e) Que, si el FIRMANTE detecta cualquier indicio de que su identificación electrónica ha podido ser utilizada por otras personas, tendrá que suspender el uso del certificado y notificarlo inmediatamente al responsable del servicio de certificación del SUSCRIPTOR, o a vinCAsign, para pedir la revocación del certificado y, en su caso, la emisión de uno nuevo. "),i.qZA(),i.TgZ(14,"p"),i._uU(15," f) Que ante cualquier necesidad de información adicional, respecto de la utilización de los certificados emitidos en nombre de vinCAsign, el FIRMANTE se podrá dirigir al SUSCRIPTOR, al responsable del servicio de certificación del SUSCRIPTOR, y/o a VINTEGRIS. "),i.qZA(),i.TgZ(16,"p"),i._uU(17," g) Que con el fin de obtener los correspondientes certificados, y dentro del marco del Reglamento (UE) 2016/679 del Parlamento Europeo y del Consejo de 27 de abril de 2016 relativo a la protección de las personas físicas en lo que respecta al tratamiento de datos personales y a la libre circulación de estos datos y por el que se deroga la Directiva 95/46/CE (Reglamento general de protección de datos), el SUSCRIPTOR ha comunicado a vinCAsign los datos identificativos del FIRMANTE con el fin de emitir y gestionar el certificado corporativo de persona física emitido en software, en el ámbito de la relación de trabajo entre dicho FIRMANTE y el SUSCRIPTOR, todo ello a los efectos de lo previsto en el artículo 28 del Reglamento general de protección de datos. "),i.qZA(),i.TgZ(18,"p"),i._uU(19," h) Que sabe que, en cumplimiento de lo establecido en los artículos 24.2 y 28 del Reglamento (UE) 910/2014 del Parlamento Europeo y del Consejo de 23 de julio de 2014, los datos contenidos en el certificado corporativo de persona física emitido en software están publicados en la página web de vinCAsign a efectos del Registro de Certificados y de las listas de revocación, toda vez que ha prestado su consentimiento durante el proceso de solicitud. "),i.qZA(),i.TgZ(20,"h1",3),i._uU(21," ACTO DE ACEPTACIÓN DEL CERTIFICADO ELECTRÓNICO "),i.qZA(),i.TgZ(22,"p"),i._uU(23," Firmo el presente documento para dejar constancia: "),i.qZA(),i.TgZ(24,"p"),i._uU(25," Que ha sido informado del contenido del texto de divulgación del certificado o PDS, en el que se incluyen las condiciones generales del servicio aplicable al certificado corporativo de persona física emitido en software. "),i.qZA(),i.TgZ(26,"p"),i._uU(27," Que ha sido informado del régimen obligatorio de uso del certificado emitido, sus condiciones de uso y sus responsabilidades. "),i.qZA(),i.TgZ(28,"p"),i._uU(29," Que ha sido informado de las circunstancias relativas al tratamiento de sus datos personales para la correcta emisión y gestión del certificado que se emite. "),i.qZA(),i.TgZ(30,"p"),i._uU(31," Firma de conformidad, en virtud de la cual ha leído y entiende las obligaciones y responsabilidades que asume. "),i.qZA()(),i.YNc(32,c,3,6,"div",4),i.qZA()),2&e&&(i.xp6(32),i.Q6J("ngIf",t.funderStyles&&!t.hideButtons))},dependencies:[a.O5,l.lW],styles:["h1[_ngcontent-%COMP%]{font-size:20px!important;font-weight:700}h2[_ngcontent-%COMP%]{font-size:20px!important;font-weight:700;line-height:25px;margin:15px 0}p[_ngcontent-%COMP%]{margin:10px 0}.terms-page[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100vw;background:white;z-index:9999999!important;height:100vh;max-height:100vh}"]}),e})()},2266:(e,t,n)=>{n.d(t,{L:()=>g});var i=n(9299),s=n(833),r=n(6e3),o=n(4650);const a=[{path:":flow",component:s.L},{path:":flow/:idUser",component:s.L}];let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({imports:[i.Bz.forChild(a),i.Bz,r.d8]}),e})();var c=n(7533),d=n(1572),u=n(7367),h=n(6383),p=n(6895),m=n(4006),f=n(9101);let g=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({providers:[u.w],imports:[l,c.q,d.Cq,h.G,p.ez,m.u5,f.ot]}),e})()},1145:(e,t,n)=>{n.d(t,{j:()=>l});var i=n(4650),s=n(6895);let r=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=i.oAB({type:e}),e.ɵinj=i.cJS({imports:[[s.ez]]}),e})();var o=n(7392),a=n(4006);let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=i.oAB({type:e}),e.ɵinj=i.cJS({imports:[s.ez,a.u5,r,o.Ps]}),e})()},4302:(e,t,n)=>{n.d(t,{q:()=>a});var i=n(7582),s=n(9933),r=n(667),o=n(4650);let a=class{constructor(){}};a.ɵfac=function(e){return new(e||a)},a.ɵcmp=o.Xpm({type:a,selectors:[["belender-disabled-url"]],decls:6,vars:1,consts:[[1,"p-2","w-full","flex","justify-start","flex-wrap"],[1,"py-4","px-6","w-full","rounded-md","bg-red-500/10","text-red-600","flex","flex-col","gap-3"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0)(1,"div",1)(2,"h2"),o._uU(3,"Servicio desactivado"),o.qZA(),o.TgZ(4,"p"),o._uU(5,"El servicio que intenta acceder está desactivado. "),o.qZA()()()),2&e&&o.Q6J("@fadeInUp",void 0)},data:{animation:[r.$]}}),a=(0,i.gn)([(0,s.c)()],a)},3300:(e,t,n)=>{n.d(t,{C:()=>o});var i=n(6895),s=n(4006),r=n(4650);let o=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=r.oAB({type:e}),e.ɵinj=r.cJS({imports:[i.ez,s.u5]}),e})()},342:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(2340),s=n(4650),r=n(4006),o=n(5089),a=n(5601),l=n(9617),c=n(6895),d=n(7392),u=n(1572);function h(e,t){if(1&e&&(s.TgZ(0,"span",11),s._uU(1),s._UZ(2,"mat-progress-spinner",12),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij(" ",e.document_name," ")}}function p(e,t){if(1&e&&(s.TgZ(0,"span",13),s._uU(1),s._UZ(2,"mat-icon",14),s.qZA()),2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij(" ",e.document_name," ")}}function m(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"span",15),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw().$implicit,n=s.MAs(5);return s.oxw().setDocumentName(t.document_name),s.KtG(n.click())})),s._uU(1),s._UZ(2,"mat-icon",16),s.qZA()}if(2&e){const e=s.oxw().$implicit;s.xp6(1),s.hij(" ",e.document_name," ")}}function f(e,t){if(1&e){const e=s.EpF();s.ynx(0),s.YNc(1,h,3,1,"span",6),s.YNc(2,p,3,1,"span",7),s.YNc(3,m,3,1,"span",8),s.TgZ(4,"input",9,10),s.NdJ("change",(function(t){s.CHM(e);const n=s.oxw();return s.KtG(n.fileChange(t))})),s.qZA(),s.BQk()}if(2&e){const e=t.$implicit,n=s.oxw();s.xp6(1),s.Q6J("ngIf",!e.document_status_code),s.xp6(1),s.Q6J("ngIf",e.document_status_code&&"downloaded"===e.document_status_code&&!n.loadingDocs),s.xp6(1),s.Q6J("ngIf",e.document_status_code&&"failed_download"===e.document_status_code&&!n.loadingDocs),s.xp6(1),s.Q6J("accept",n.acceptFiles)}}let g=(()=>{class e{constructor(e,t,n,i,s){this.formBuilder=e,this.utils=t,this.solicitudesService=n,this.packsS=i,this.cd=s,this.totalDocuments=[],this.totalDownloaded=0,this.totalNotDownloaded=0,this.file=null,this.fileName="No se ha seleccionado ningun archivo",this.fileSize=0,this.acceptFiles="image/jpeg, image/jpg, application/pdf",this.loadingDocs=!0,this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.loadingDocs=!0,this.uploadForm=this.formBuilder.group({file:[""]}),this.setPacksAndDocuments(),this.initIntervalDocs()}initIntervalDocs(){this.intDocs=setInterval((()=>{this.setDocumentsFromPack()}),4e3)}setPacksAndDocuments(){this.packsS.getPacksByPackId(this.packId).then((e=>{this.totalDocuments=this.parseDocumentsFromPack(e.data.documents),this.setDocumentsFromPack()}))}setDocumentsFromPack(){this.solicitudesService.getDocumentsIds(this.requestID).then((e=>{e.data&&this.setDocumentsReports(e.data),this.loadingDocs=!1})).catch((()=>{this.loadingDocs=!1}))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==i.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==i.N.env&&(e="wss://notifications.belender.net"),i.N.notificationsBaseUrl&&(e=i.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),n&&t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}handlePusherNotification(e){this.totalDocuments&&this.totalDocuments.forEach((t=>{t.document_name===e.document_name&&(t.document_status_code=e.document_status_code)})),this.cd.markForCheck()}parseDocumentsFromPack(e){let t=[];return e&&e.length&&e.forEach((e=>{t.push({document_name:e,document_status_code:null})})),t}setDocumentsReports(e){e&&e.length&&e.forEach((e=>{this.totalDocuments.forEach((t=>{t.document_name===e.document_name&&(t.document_status_code=e.document_status_code)}))})),this.checkIfAllReported(),this.cd.markForCheck()}checkIfAllReported(){this.totalDocuments.find((e=>!e.document_status_code||"downloaded"!=e.document_status_code))||this.intDocs&&clearInterval(this.intDocs)}fileChange(e){e.preventDefault(),e.stopPropagation();let t=e.target.files[0];const n=new FormData;n.append("file",t),n.append("request_id",this.requestID),n.append("document_name",this.docName),this.loadingDocs=!0,this.solicitudesService.uploadFileFromWidget(n).then((e=>{console.log("success"),this.setPacksAndDocuments()})).catch((e=>{console.error(e),this.setPacksAndDocuments()}))}setDocumentName(e){this.docName=e}}return e.ɵfac=function(t){return new(t||e)(s.Y36(r.qu),s.Y36(o.F),s.Y36(a.M),s.Y36(l.U),s.Y36(s.sBO))},e.ɵcmp=s.Xpm({type:e,selectors:[["widget-documents"]],inputs:{packId:"packId",requestID:"requestID",userId:"userId",acceptFiles:"acceptFiles"},decls:7,vars:1,consts:[[1,"px-4","py-3","bg-slate-300/10","rounded-md"],[1,"w-full","flex","mb-4","justify-between","items-center"],[1,"text-xl","font-bold"],[1,"flex","justify-end","items-center"],[1,"flex","gap-1","flex-wrap","items-start","justify-start","w-full","flex-col"],[4,"ngFor","ngForOf"],["class","bg-black/10 items-center w-full h-8 gap-2 pr-4 pl-3 py-1 rounded-sm flex text-xs justify-between",4,"ngIf"],["class","bg-green-500/10 items-center text-green-500 w-full justify-between border border-green-500 gap-2 h-8 font-bold pr-4 pl-3 py-1 rounded-sm flex text-xs ",4,"ngIf"],["class","bg-red-500/10 items-center text-red-500 border border-red-500 gap-2 h-8 font-bold pr-4 pl-3 py-1 rounded-sm flex text-xs justify-between w-full cursor-pointer hover:bg-red-500 hover:text-red-50",3,"click",4,"ngIf"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"bg-black/10","items-center","w-full","h-8","gap-2","pr-4","pl-3","py-1","rounded-sm","flex","text-xs","justify-between"],["color","accent","diameter","12","value","0","mode","indeterminate",1,"spinner"],[1,"bg-green-500/10","items-center","text-green-500","w-full","justify-between","border","border-green-500","gap-2","h-8","font-bold","pr-4","pl-3","py-1","rounded-sm","flex","text-xs"],["svgIcon","mat:check",1,"w-4"],[1,"bg-red-500/10","items-center","text-red-500","border","border-red-500","gap-2","h-8","font-bold","pr-4","pl-3","py-1","rounded-sm","flex","text-xs","justify-between","w-full","cursor-pointer","hover:bg-red-500","hover:text-red-50",3,"click"],["svgIcon","mat:upload",1,"w-4"]],template:function(e,t){1&e&&(s.TgZ(0,"div",0)(1,"div",1)(2,"p",2),s._uU(3,"Documentos: "),s.qZA(),s._UZ(4,"div",3),s.qZA(),s.TgZ(5,"div",4),s.YNc(6,f,6,4,"ng-container",5),s.qZA()()),2&e&&(s.xp6(6),s.Q6J("ngForOf",t.totalDocuments))},dependencies:[c.sg,c.O5,d.Hw,u.Ou]}),e})()},3033:(e,t,n)=>{n.d(t,{d:()=>l});var i=n(6895),s=n(4006),r=n(7392),o=n(1572),a=n(4650);let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=a.oAB({type:e}),e.ɵinj=a.cJS({imports:[i.ez,r.Ps,s.UX,o.Cq]}),e})()},1406:(e,t,n)=>{n.d(t,{Y:()=>a});var i=n(4650),s=n(4006),r=n(9549),o=n(9101);let a=(()=>{class e{constructor(e){this.formBuilder=e,this.file=null,this.fileName="No se ha seleccionado ningun archivo",this.acceptFiles="image/png, image/jpeg, image/jpg, .pdf",this.newItemEvent=new i.vpe(null),this.uploadFile=new i.vpe(null),this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.uploadForm=this.formBuilder.group({file:[""]})}fileChange(e){this.uploadForm.patchValue({file:e.target.files[0]}),this.uploadForm.get("file").updateValueAndValidity();const t=new FormData;let n=this.uploadForm.get("file").value;this.fileName=n.name,this.fileSize=+(+n.size/1e3).toFixed(1),t.append("file",n),console.warn(this.uploadForm.get("file").value),this.newItemEvent.emit({file:t}),this.uploadFile.emit(n)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.qu))},e.ɵcmp=i.Xpm({type:e,selectors:[["app-file-upload"]],inputs:{label:"label",acceptFiles:"acceptFiles"},outputs:{newItemEvent:"change",uploadFile:"fileUpload"},decls:11,vars:5,consts:[[1,"flex","flex-col","w-full","items-start","input-file-wrapper","my-1",3,"formGroup"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"flex","items-center","justify-start","mt-3"],["mat-flat-button","","color","accent",1,"btn-file",3,"click"]],template:function(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",0)(1,"mat-label"),i._uU(2),i.qZA(),i.TgZ(3,"input",1,2),i.NdJ("change",(function(e){return t.fileChange(e)})),i.qZA(),i.TgZ(5,"div",3)(6,"button",4),i.NdJ("click",(function(){i.CHM(e);const t=i.MAs(4);return i.KtG(t.click())})),i._uU(7,"Seleccionar archivo"),i.qZA(),i._uU(8,"     "),i.TgZ(9,"span"),i._uU(10),i.qZA()()()}2&e&&(i.Q6J("formGroup",t.uploadForm),i.xp6(2),i.Oqu(t.label),i.xp6(1),i.Q6J("accept",t.acceptFiles),i.xp6(7),i.AsE("",t.fileName," ",t.fileSize?"("+t.fileSize+"Kb)":"",""))},dependencies:[s._Y,s.JL,s.sg,r.hX,o.lW],styles:["button[aria-pressed=true][_ngcontent-%COMP%]{color:red!important}.btn-file[_ngcontent-%COMP%]{max-width:200px}.input-file-wrapper[_ngcontent-%COMP%]{background:rgba(0,0,0,.0117647059);padding:.7rem .5rem .7rem 1rem;border-radius:5px;border:2px dashed rgba(0,0,0,.1)}"]}),e})()},969:(e,t,n)=>{n.d(t,{O:()=>d});var i=n(6895),s=n(4006),r=n(9101),o=n(7392),a=n(4144),l=n(7009),c=n(4650);let d=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=c.oAB({type:e}),e.ɵinj=c.cJS({imports:[i.ez,l.ZX,o.Ps,s.UX,a.c,r.ot]}),e})()},4246:(e,t,n)=>{n.d(t,{t:()=>s});var i=n(4650);let s=(()=>{class e{constructor(){this.DNI_REGEX=/^(\d{8})([A-Z])$/,this.CIF_REGEX=/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/,this.NIE_REGEX=/^[XYZ]\d{7,8}[A-Z]$/}convertObjectArrayToArray(e){return Object.keys(e).map((t=>{const n=e[t];return n.key=t,n}))}ValidateIDType(e){e=e.toUpperCase().replace(/\s/,"");var t=!1,n=this.spainIdType(e);switch(n){case"dni":t=this.validDNI(e);break;case"nie":t=this.validNIE(e)}return{type:n,valid:t}}spainIdType(e){return e.match(this.DNI_REGEX)?"dni":e.match(this.NIE_REGEX)?"nie":void 0}validDNI(e){return"TRWAGMYFPDXBNJZSQVHLCKE".charAt(parseInt(e,10)%23)==e.charAt(8)}validNIE(e){var t=e.charAt(0);switch(t){case"X":t=0;break;case"Y":t=1;break;case"Z":t=2}return this.validDNI(t+e.substr(1))}}return e.ɵfac=function(t){return new(t||e)},e.ɵprov=i.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},3364:(e,t,n)=>{n.d(t,{R:()=>l});var i=n(4650),s=(n(6866),n(5089)),r=n(9299),o=n(9101),a=n(3731);let l=(()=>{class e{constructor(e,t){this.utils=e,this.Activatedroute=t,this.goFlow=new i.vpe(null),this.goManual=new i.vpe(null)}ngOnInit(){console.error("data: ",this.data)}gotoFlow(){this.goFlow.emit(!0)}gotoManual(){this.goManual.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.F),i.Y36(r.gz))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-intro-step"]],inputs:{data:"data",solicitud:"solicitud",flowName:"flowName"},outputs:{goFlow:"gotoFlow",goManual:"gotoManual"},decls:10,vars:18,consts:[[1,"flex","flex-col","justify-between","h-full","fixed-content"],[1,"flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-2"],["mat-flat-button","","type","button",1,"px-8","bg-slate-100","hover:bg-slate-200","text-slate-900",3,"click"],["mat-flat-button","","type","button",1,"px-8","hover:opacity-90",3,"click"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0)(1,"div",1),i._UZ(2,"div",2)(3,"div",3),i.ALo(4,"safeHtml"),i.qZA(),i.TgZ(5,"div",4)(6,"button",5),i.NdJ("click",(function(){return t.gotoManual()})),i._uU(7,"Subida manual"),i.qZA(),i.TgZ(8,"button",6),i.NdJ("click",(function(){return t.gotoFlow()})),i._uU(9,"Subida automatica"),i.qZA()()()),2&e&&(i.xp6(2),i.Udp("color",t.data.styles.colors.title)("font-size",t.data.intro?t.data.intro.titleSize+"px":"30px"),i.Q6J("innerHTML",t.data.intro?t.data.intro.title:"Intro de descripción",i.oJD),i.xp6(1),i.Udp("color",t.data.styles.colors.text),i.Q6J("innerHTML",t.data.intro?t.data.intro.description:i.lcZ(4,16,"Descripcion de la intro"),i.oJD),i.xp6(3),i.Udp("border-radius",t.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[o.lW,a.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})()},8962:(e,t,n)=>{n.d(t,{A:()=>k});var i=n(6895),s=n(9101),r=n(1561),o=n(4006),a=n(5601),l=n(3798),c=n(9391),d=n(1572),u=n(182),h=n(4144),p=n(7367),m=n(9602),f=n(3238),g=n(5895),_=n(6257),b=n(1948),y=n(4246),v=n(6981),w=n(1129),x=n(9476),C=n(4650);let k=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=C.oAB({type:e}),e.ɵinj=C.cJS({providers:[a.M,c.o,p.w,u.t,g.T,y.t],imports:[i.ez,s.ot,r.Tx,h.c,o.u5,o.UX,l.a,d.Cq,m.FA,f.XK,_.T5,b.Fk,v.x,w.n,x.F]}),e})()},1760:(e,t,n)=>{n.d(t,{u:()=>x});var i=n(4650),s=(n(6866),n(4006)),r=n(5089),o=n(9391),a=n(9299),l=n(9617),c=n(5895),d=n(6895),u=n(9101),h=n(9549),p=n(4144),m=n(8008),f=n(1406),g=n(3731);function _(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",1)(1,"div",2),i._UZ(2,"div",3)(3,"div",4),i.ALo(4,"safeHtml"),i.qZA(),i.TgZ(5,"div",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),i._uU(9,"DNI / NIE"),i.qZA(),i._UZ(10,"input",8),i.qZA()()(),i.TgZ(11,"div",9)(12,"button",10),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.goBack())})),i._uU(13," Volver "),i.qZA(),i.TgZ(14,"button",11),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.gotoStep2())})),i._uU(15," Siguiente "),i.qZA()()()}if(2&e){const e=i.oxw();i.Q6J("formGroup",e.formDni),i.xp6(2),i.Udp("color",e.data.styles.colors.title)("font-size",e.data.Manual?e.data.Manual.titleSize+"px":"30px"),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.title:"Manual de descripción",i.oJD),i.xp6(1),i.Udp("color",e.data.styles.colors.text),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.description:i.lcZ(4,18,"Descripcion de la subida manual"),i.oJD),i.xp6(9),i.Udp("border-radius",e.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",e.formDni.invalid?"":e.data.styles.colors.btnText)("background",e.formDni.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),i.Q6J("disabled",e.formDni.invalid)}}function b(e,t){if(1&e){const e=i.EpF();i.ynx(0),i.TgZ(1,"app-file-upload",15),i.NdJ("fileUpload",(function(t){const n=i.CHM(e).$implicit,s=i.oxw(3);return i.KtG(s.setFile(n,t))})),i.qZA(),i.BQk()}if(2&e){const e=t.$implicit;i.xp6(1),i.s9C("label",e)}}function y(e,t){if(1&e&&(i.TgZ(0,"div",5),i.YNc(1,b,2,1,"ng-container",14),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.Q6J("ngForOf",e.pack.documents)}}function v(e,t){1&e&&(i.TgZ(0,"div",16),i._UZ(1,"belender-spinner",17),i.qZA()),2&e&&(i.xp6(1),i.Q6J("zoom",.6))}function w(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",1)(1,"div",2),i._UZ(2,"div",3)(3,"div",4),i.ALo(4,"safeHtml"),i.qZA(),i.YNc(5,y,2,1,"div",12),i.YNc(6,v,2,1,"div",13),i.TgZ(7,"div",9)(8,"button",10),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.goBack())})),i._uU(9," Volver "),i.qZA(),i.TgZ(10,"button",11),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.uploadFiles())})),i._uU(11," Subir archivos "),i.qZA()()()}if(2&e){const e=i.oxw();i.Q6J("formGroup",e.form),i.xp6(2),i.Udp("color",e.data.styles.colors.title)("font-size",e.data.Manual?e.data.Manual.titleSize+"px":"30px"),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.title:"Manual de descripción",i.oJD),i.xp6(1),i.Udp("color",e.data.styles.colors.text),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.description:i.lcZ(4,20,"Descripcion de la subida manual"),i.oJD),i.xp6(2),i.Q6J("ngIf",e.pack&&!e.loadingPack),i.xp6(1),i.Q6J("ngIf",e.loadingPack),i.xp6(2),i.Udp("border-radius",e.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),i.Q6J("disabled",e.form.invalid)}}let x=(()=>{class e{constructor(e,t,n,s,r,o){this.fb=e,this.utils=t,this.attachmentsS=n,this.ar=s,this.packsS=r,this.notis=o,this.upload=new i.vpe(null),this.back=new i.vpe(null),this.sendDNI=new i.vpe(null),this.loadingPack=!1,this.step=1}ngOnInit(){this.form=this.fb.group({}),console.warn("data: ",this.data),this.loadingPack=!0,this.packsS.getPackagesByUserID(this.userId).then((e=>{console.warn(e),e&&e.data?this.setPack(e.data):this.loadingPack=!1})).catch((e=>{console.error(e),this.loadingPack=!1})),this.formDni=this.fb.group({dni:[null,[s.kI.required,s.kI.maxLength(9)]]}),console.error(this.solicitud),this.solicitud&&this.solicitud.request_id&&(this.step=2)}setRequestStep(){}gotoStep2(){this.sendDNI.emit(this.formDni.get("dni").value)}setPack(e){this.pack=e.find((e=>e.id==this.packId)),this.loadingPack=!1,this.setForm()}setForm(){this.pack&&this.pack.documents&&this.pack.documents.forEach((e=>{this.form.addControl(e,new s.NI("",s.kI.required))}))}uploadFiles(){this.upload.emit(!0)}goBack(){this.back.emit(!0)}fileChange(e){e.preventDefault(),e.stopPropagation()}setFile(e,t){const n=new FormData;n.append("file",t),n.append("request_id",this.solicitud.request_id),n.append("document_name",e),this.notis.showToast("Subiendo documento: "+e,6e3,"info"),this.attachmentsS.uploadFile(n).then((n=>{n&&n.status&&"error"!=n.status?(this.form.get(e).setValue(t),this.notis.showToast("Documento "+e+" subido correctamente",4e3,"success")):n&&n.status&&"error"==n.status&&this.notis.showToast("El documento "+e+" no se ha podido subir: "+n.message,4e3,"error")})).catch((t=>{console.error(t),this.notis.showToast("El documento "+e+" no se ha podido subir: "+t,4e3,"error")}))}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.QS),i.Y36(r.F),i.Y36(o.o),i.Y36(a.gz),i.Y36(l.U),i.Y36(c.T))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-manual-step"]],inputs:{data:"data",solicitud:"solicitud",flowName:"flowName",packId:"packId",userId:"userId"},outputs:{upload:"uploadFiles",back:"goBack",sendDNI:"dniChange"},decls:2,vars:2,consts:[["class","flex flex-col justify-between h-full fixed-content",3,"formGroup",4,"ngIf"],[1,"flex","flex-col","justify-between","h-full","fixed-content",3,"formGroup"],[1,"flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"py-4"],[1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["maxlength","9","formControlName","dni","type","text","placeholder","Ingresa tu DNI o NIE","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-2"],["mat-flat-button","","type","button",1,"px-8","bg-slate-100","hover:bg-slate-200","text-slate-900",3,"click"],["mat-flat-button","","type","button",1,"px-8","hover:opacity-90",3,"disabled","click"],["class","py-4",4,"ngIf"],["class","py-10 px-4",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"label","fileUpload"],[1,"py-10","px-4"],["text","Cargando documentos",3,"zoom"]],template:function(e,t){1&e&&(i.YNc(0,_,16,20,"form",0),i.YNc(1,w,12,22,"form",0)),2&e&&(i.Q6J("ngIf",1==t.step),i.xp6(1),i.Q6J("ngIf",2==t.step))},dependencies:[d.sg,d.O5,u.lW,h.KE,h.hX,p.Nt,s._Y,s.Fj,s.JJ,s.JL,s.nD,s.sg,s.u,m.O,f.Y,g.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})()},3468:(e,t,n)=>{n.d(t,{f:()=>T});var i=n(6895),s=n(9101),r=n(1561),o=n(4006),a=n(5601),l=n(3798),c=n(9391),d=n(1572),u=n(182),h=n(4144),p=n(7367),m=n(9602),f=n(3238),g=n(5895),_=n(6257),b=n(1948),y=n(4246),v=n(6981),w=n(1129),x=n(9476),C=n(969),k=n(4650);let T=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=k.oAB({type:e}),e.ɵinj=k.cJS({providers:[a.M,c.o,p.w,u.t,g.T,y.t],imports:[i.ez,s.ot,r.Tx,h.c,o.u5,o.UX,l.a,d.Cq,m.FA,f.XK,_.T5,b.Fk,v.x,w.n,x.F,C.O]}),e})()},8526:(e,t,n)=>{n.r(t),n.d(t,{PersonalModule:()=>pt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),y=n(9391),v=n(1572),w=n(182),x=n(4144),C=n(7367),k=n(9602),T=n(3238),M=n(5895),S=n(6257),I=n(1948),O=n(4246),L=n(9299),P=n(6e3),A=n(5861),E=n(7582),D=n(9549),N=n(9933),Y=n(5762),q=n(8259),R=n(2340),F=n(1363),Z=n(4650),U=n(5089),H=n(8460),j=n(529),z=n(6554);let B=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(R.N.baseUrl+"/requests/known-client",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}addFiles(e){return new Promise(((t,n)=>{this.localFetch.postFile(R.N.baseUrl+"/requests/known-client/upload-files",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/known-client/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOtp(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/known-client/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/known-client/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}preRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/pre-request/known-client",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let i="/requests/known-client/otp";R.N.scraperMock&&(i="/mockscrapper/requests/known-client/otp"),this.localFetch.postFetchWhitoutToken(R.N.baseUrl+i,e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(Z.LFG(U.F),Z.LFG(j.eN),Z.LFG(z.r))},e.ɵprov=Z.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var J=n(5412),V=n(6830),Q=n(833),W=n(4302),G=n(3731);function $(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij("¿No has recibido el código? Solicítalo de nuevo en ",e.secsCount," segundos")}}function K(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.AsE("¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? Solicítalo de nuevo en ",e.secsCount," segundos")}}function X(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij("¿No has recibido el código en tu teléfono? Solicítalo de nuevo en ",e.secsCount," segundos")}}const ee=function(e,t,n){return{color:e,border:t,background:n}};function te(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"small",11),Z.YNc(2,$,2,1,"span",5),Z.YNc(3,K,2,2,"span",5),Z.YNc(4,X,2,1,"span",5),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(4,ee,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&e.data.config.noRetryInBadPhone)}}function ne(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1," ¿No has recibido el código en tu teléfono? "),Z.qZA())}function ie(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? ")}}function se(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1," ¿No has recibido el código en el teléfono? "),Z.qZA())}const re=function(e,t){return{color:e,background:t}};function oe(e,t){if(1&e){const e=Z.EpF();Z.ynx(0),Z.TgZ(1,"small",11),Z.YNc(2,ne,2,0,"span",5),Z.YNc(3,ie,2,1,"span",5),Z.YNc(4,se,2,0,"span",5),Z.TgZ(5,"a",12),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.resendOTP())})),Z._uU(6,"Reenviar"),Z.qZA()(),Z.BQk()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(5,ee,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngIf",e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngStyle",Z.WLB(9,re,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor))}}let ae=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new Z.vpe(null),this.errPhone=new Z.vpe(null),this.resendO=new Z.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,A.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?q(e.target).next().focus():"Backspace"==e.code&&q(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:16,vars:20,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.TgZ(5,"div",4),Z.YNc(6,te,5,8,"ng-container",5),Z.YNc(7,oe,7,12,"ng-container",5),Z.qZA(),Z.TgZ(8,"div",6)(9,"mat-form-field",7)(10,"mat-label"),Z._uU(11," Código OTP "),Z.qZA(),Z.TgZ(12,"input",8),Z.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),Z.qZA()()()(),Z.TgZ(13,"div",9)(14,"button",10),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(15,"Siguiente"),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.otp.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,18,t.texts.otp.description||""),Z.oJD),Z.xp6(3),Z.Q6J("ngIf",t.secsCount&&t.secsCount>0),Z.xp6(1),Z.Q6J("ngIf",!t.secsCount||t.secsCount<=0),Z.xp6(7),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,i.PC,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function le(e,t){if(1&e&&(Z.TgZ(0,"div",1),Z._UZ(1,"div",2)(2,"div",3),Z.ALo(3,"safeHtml"),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),Z.Q6J("innerHTML",e.texts.success.title,Z.oJD),Z.xp6(1),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(3,8,e.texts.success.description||""),Z.oJD)}}let ce=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s}ngOnInit(){}save(){}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(y.o),Z.Y36(M.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts"},decls:1,vars:1,consts:[["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&Z.YNc(0,le,4,10,"div",0),2&e&&Z.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted)},dependencies:[i.O5,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function de(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",6),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.retry())})),Z._uU(2,"Intentarlo nuevamente"),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function ue(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.newRequest())})),Z._uU(2,"Crear nueva solicitud"),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}let he=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new Z.vpe(null),this.newReq=new Z.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(y.o),Z.Y36(M.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:7,vars:8,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.YNc(5,de,3,6,"div",4),Z.YNc(6,ue,3,6,"div",4),Z.qZA()),2&e&&(Z.xp6(2),Z.Q6J("innerHTML",t.texts.fail.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,6,t.texts.fail.description),Z.oJD),Z.xp6(2),Z.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),Z.xp6(1),Z.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var pe=n(1763),me=n(5696);const fe=["termsCheckbox"],ge=["termsCertCheckbox"],_e=["assignmentCheckbox"];function be(e,t){1&e&&(Z.TgZ(0,"div",15)(1,"mat-form-field",16)(2,"mat-label"),Z._uU(3,"Email"),Z.qZA(),Z._UZ(4,"input",17),Z.qZA()())}function ye(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",18)(1,"belender-checkbox",19,20),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setTerms(t))})),Z.TgZ(3,"belender-terms-and-policy-links",21),Z.NdJ("goToTerms",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.gotoTermsAndConditions(t))})),Z.qZA()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("userId",e.userId)("showPolicyLink",null==e.data?null:e.data.config.showPolicyLink)("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function ve(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",22)(1,"belender-checkbox",9),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setPower(t))})),Z._uU(2," Consiento expresamente a la activación de un poder digital según las condiciones que pueden verse "),Z.TgZ(3,"a",11),Z.NdJ("click",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.gotoPowerConditions(t))})),Z.TgZ(4,"u"),Z._uU(5,"aquí"),Z.qZA()()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title)}}function we(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",18)(1,"belender-checkbox",9,23),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setAssignment(t))})),Z._UZ(3,"div",24),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("innerHTML",null==e.data?null:e.data.config.dataAssignmentText,Z.oJD)}}function xe(e,t){1&e&&(Z.TgZ(0,"div",25),Z._UZ(1,"mat-icon",26),Z._uU(2," Debes leer los términos y condiciones para poder continuar "),Z.qZA())}const Ce={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let ke=(()=>{class e{constructor(e,t){this.utils=e,this.fb=t,this.requestID=null,this.next=new Z.vpe(null),this.goTerms=new Z.vpe(null),this.goTermsCert=new Z.vpe(null),this.goPower=new Z.vpe(null),this.acceptTerms=!1,this.acceptTerms2=!1,this.termsReaded=!1,this.terms2Readed=!1,this.step=0,this.assignment=!1,this.powerActivate=!1}ngOnInit(){this.setForm(this.solicitud?this.solicitud:null)}tabChanged(e){this.step=e,this.setForm(null)}setForm(e){let t=e?e.person_email||e.email:null;this.form=this.fb.group(this.data.config.followMail?{email:[t,[p.kI.required,p.kI.email]]}:{email:[t]})}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setTerms2Check(e){this.certCheckComponent.checked=e,this.acceptTerms2=e}setAssignmentCheck(e){this.assignmentCheckComponent.checked=e,this.assignment=e}setTerms(e){this.acceptTerms=e}setTerms2(e){this.acceptTerms2=e}setAssignment(e){this.assignment=e}nextStep(){let e={terms_and_conditions_service:this.acceptTerms,terms_and_conditions_certificate_emition:this.acceptTerms2,request_id:this.solicitud.request_id};this.data&&this.data.config&&this.data.config.followMail&&(e.email_copy=this.form.get("email").value),(this.data.config.activatePower||this.solicitud?.power_activate)&&(e.power_activate=!0,e.terms_and_conditions_power=this.powerActivate?1:0),this.next.emit(e)}gotoTermsAndConditions(e){this.termsReaded=!0,e.preventDefault(),e.stopPropagation(),this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(e){this.terms2Readed=!0,e.preventDefault(),e.stopPropagation(),this.goTermsCert.emit(!0)}getIfValid(){return!((this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&!this.powerActivate)&&this.getAssignmentValidation()}getAssignmentValidation(){return!!(!this.data.config.forceChecks||this.termsReaded&&this.terms2Readed)&&(this.data.config.hideCheckLegal&&(this.acceptTerms=!0),this.data.config.dataAssignmentCheck?this.acceptTerms&&this.acceptTerms2&&this.assignment:this.acceptTerms&&this.acceptTerms2)}gotoPowerConditions(e){this.goPower.emit(!0)}setPower(e){this.powerActivate=e}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(U.F),Z.Y36(p.QS))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(Z.Gf(fe,5),Z.Gf(ge,5),Z.Gf(_e,5)),2&e){let e;Z.iGM(e=Z.CRH())&&(t.checkComponent=e.first),Z.iGM(e=Z.CRH())&&(t.certCheckComponent=e.first),Z.iGM(e=Z.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{userId:"userId",flowName:"flowName",requestID:"requestID",data:"data",texts:"texts",solicitud:"solicitud",acceptTerms:"acceptTerms",acceptTerms2:"acceptTerms2",termsReaded:"termsReaded",terms2Readed:"terms2Readed"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",goPower:"goToPower"},features:[Z._Bn([{provide:T.sG,useValue:Ce},{provide:Z.soG,useValue:"es-ES"}])],decls:22,vars:24,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","w-full",4,"ngIf"],["class","mt-6 flex justify-start items-center w-full flex-100",4,"ngIf"],["class","flex justify-between items-center w-full flex-100",4,"ngIf"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["termsCertCheckbox",""],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","email","type","email","placeholder","Ingresa tu email","matInput",""],[1,"mt-6","flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","showPolicyLink","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],[1,"flex","justify-between","items-center","w-full","flex-100"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.TgZ(5,"div",4),Z.YNc(6,be,5,0,"div",5),Z.YNc(7,ye,4,9,"div",6),Z.YNc(8,ve,6,1,"div",7),Z.TgZ(9,"div",8)(10,"belender-checkbox",9,10),Z.NdJ("changeCheckbox",(function(e){return t.setTerms2(e)})),Z._uU(12," He leído y acepto los "),Z.TgZ(13,"a",11),Z.NdJ("click",(function(e){return t.gotoTermsAndConditionsCertificate(e)})),Z.TgZ(14,"u"),Z._uU(15,"términos y condiciones"),Z.qZA()(),Z._uU(16," para la emisión del certificado "),Z.qZA()(),Z.YNc(17,we,4,2,"div",6),Z.YNc(18,xe,3,0,"div",12),Z.qZA(),Z.TgZ(19,"div",13)(20,"button",14),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(21," Siguiente "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.form.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,22,t.texts.form.description||""),Z.oJD),Z.xp6(3),Z.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.followMail),Z.xp6(1),Z.Q6J("ngIf",!t.data.config.hideCheckLegal),Z.xp6(1),Z.Q6J("ngIf",t.requestID?null==t.solicitud?null:t.solicitud.power_activate:null==t.data?null:t.data.config.activatePower),Z.xp6(2),Z.Q6J("color",t.data.styles.colors.title),Z.xp6(7),Z.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),Z.xp6(1),Z.Q6J("ngIf",t.data.config.forceChecks&&(!t.termsReaded||!t.terms2Readed)),Z.xp6(2),Z.Udp("color",t.form.invalid||!t.getIfValid()?"":t.data.styles.colors.btnText)("background",t.form.invalid||!t.getIfValid()?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid||!t.getIfValid()))},dependencies:[i.O5,d.Hw,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,pe.b,me.T,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Te=n(5145);let Me=(()=>{class e{constructor(e){this.utils=e,this.status="",this.label="Cargando datos.."}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":Te.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)}))}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(U.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"mat-progress-spinner"),Z.TgZ(3,"p"),Z._uU(4),Z.qZA()()()),2&e&&(Z.xp6(4),Z.Oqu(t.label))},dependencies:[v.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Se=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA()()),2&e&&(Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.noService.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,8,t.texts.noService.description),Z.oJD))},dependencies:[p._Y,p.JL,p.F,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Ie=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new Z.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return"Abandonado después de esperar OTP de Seguridad Social";case"abandoned_after_invalid_otp_seguridad_social":return"Abandonado despues de OTP inválido en Seguridad Social";case"abandoned_after_invalid_otp_aeat":return"Abandonado despues de OTP inválido en AEAT";case"abandoned_after_waiting_otp_aeat":return"Abandonado después de esperar OTP de AEAT";default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(y.o),Z.Y36(M.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:10,vars:17,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.TgZ(5,"div",4),Z._uU(6),Z.qZA()(),Z.TgZ(7,"div",5)(8,"button",6),Z.NdJ("click",(function(){return t.retry()})),Z._uU(9,"Intentarlo nuevamente"),Z.qZA()()()),2&e&&(Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.abandoned.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,15,t.texts.abandoned.description),Z.oJD),Z.xp6(3),Z.hij(" ",t.getTextStatus()," "),Z.xp6(2),Z.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Oe(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function Le(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña es requerida "),Z.qZA())}function Pe(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña debe tener al menos 8 carácteres "),Z.qZA())}function Ae(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," Es necesario repetir la contraseña "),Z.qZA())}function Ee(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," Las contraseñas deben coincidir "),Z.qZA())}function De(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña debe tener al menos 8 carácteres "),Z.qZA())}const Ne={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Ye=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.form=new p.cw({}),this.next=new Z.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Oe("password","confirm_password")})}nextStep(){let e={set_password_certificate:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.qu),Z.Y36(U.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep"},features:[Z._Bn([{provide:T.sG,useValue:Ne},{provide:Z.soG,useValue:"es-ES"}])],decls:22,vars:23,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.TgZ(5,"div",4)(6,"mat-form-field",5)(7,"mat-label"),Z._uU(8,"Contraseña"),Z.qZA(),Z._UZ(9,"input",6),Z.YNc(10,Le,2,0,"mat-hint",7),Z.YNc(11,Pe,2,0,"mat-hint",7),Z.qZA(),Z.TgZ(12,"mat-form-field",8)(13,"mat-label"),Z._uU(14,"Repite Contraseña"),Z.qZA(),Z._UZ(15,"input",9),Z.YNc(16,Ae,2,0,"mat-hint",7),Z.YNc(17,Ee,2,0,"mat-hint",7),Z.YNc(18,De,2,0,"mat-hint",7),Z.qZA()(),Z.TgZ(19,"div",10)(20,"button",11),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(21," Guardar "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.password.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,21,t.texts.password.description),Z.oJD),Z.xp6(7),Z.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),Z.xp6(5),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.confirmedValidator),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.invalid&&t.f.confirm_password.errors.minlength),Z.xp6(2),Z.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,u.lW,D.KE,D.bx,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const qe=["formStep"];function Re(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-power-cert",4),Z.NdJ("accept",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.acceptPowerCert())})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("hideButtons",!1)("flow","KnownClient")("userId",e.userId)}}function Fe(e,t){if(1&e&&(Z.TgZ(0,"div",9),Z._UZ(1,"img",10),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("src",e.data.styles.logoUrl,Z.LSH)}}function Ze(e,t){if(1&e&&Z._UZ(0,"belender-loading-step",20),2&e){const e=Z.oxw(3);Z.Q6J("status",null==e.solicitud?null:e.solicitud.status_code)("data",e.data)}}function Ue(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-form-step",21,22),Z.NdJ("goToTerms",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.gotoTermsAndConditions())}))("goToPower",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.gotoPassword(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("userId",e.userId)("requestID",e.requestID)("data",e.data)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function He(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-password-step",23),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.sendPassword(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function je(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-otp-step",24),Z.NdJ("resendOTP",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.resendOTP(t))}))("errorPhone",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.requestOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function ze(e,t){if(1&e&&Z._UZ(0,"belender-success-step",25),2&e){const e=Z.oxw(3);Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Be(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-fail-step",26),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.retryRequest(t))}))("newRequest",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.newRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Je(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-abandoned-step",27),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(3);return Z.KtG(n.retryRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(3);Z.Q6J("solicitud",e.solicitud)("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Ve(e,t){if(1&e&&Z._UZ(0,"belender-no-service-step",28),2&e){const e=Z.oxw(3);Z.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)}}function Qe(e,t){if(1&e&&(Z.TgZ(0,"div",29)(1,"div",30)(2,"h1",31),Z._uU(3,"No existe la solicitud"),Z.qZA()(),Z.TgZ(4,"div",32),Z._uU(5,"No existen solicitudes activas con el código requerido"),Z.qZA()()),2&e){const e=Z.oxw(3);Z.xp6(4),Z.Udp("color",e.data.styles.colors.text)}}function We(e,t){if(1&e&&(Z.ynx(0),Z.YNc(1,Ze,1,2,"belender-loading-step",11),Z.YNc(2,Ue,2,6,"belender-form-step",12),Z.YNc(3,He,1,3,"belender-password-step",13),Z.YNc(4,je,1,3,"belender-otp-step",14),Z.YNc(5,ze,1,2,"belender-success-step",15),Z.YNc(6,Be,1,3,"belender-fail-step",16),Z.YNc(7,Je,1,3,"belender-abandoned-step",17),Z.YNc(8,Ve,1,2,"belender-no-service-step",18),Z.YNc(9,Qe,6,2,"div",19),Z.BQk()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("ngIf","loading"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","form"==e.getStatus()&&!e.loading),Z.xp6(1),Z.Q6J("ngIf","password"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","otp"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","success"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","failed"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","abandoned"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","no-service"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","no-exist"==e.getStatus())}}function Ge(e,t){1&e&&Z._UZ(0,"belender-disabled-url")}function $e(e,t){if(1&e&&(Z.TgZ(0,"div",33),Z._UZ(1,"mat-progress-spinner",34),Z.TgZ(2,"p",35),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function Ke(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",36)(1,"div",29)(2,"div",37),Z._uU(3,"Error!"),Z.qZA(),Z._UZ(4,"div",38),Z.qZA(),Z.TgZ(5,"div",39)(6,"button",40),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw(2);return Z.KtG(t.error=!1)})),Z._uU(7,"Ingresar manualmente"),Z.qZA()()()}if(2&e){const e=Z.oxw(2);Z.xp6(4),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",e.error,Z.oJD)}}function Xe(e,t){if(1&e&&(Z.TgZ(0,"div",5)(1,"div"),Z.YNc(2,Fe,2,1,"div",6),Z.YNc(3,We,10,9,"ng-container",3),Z.YNc(4,Ge,1,0,"belender-disabled-url",3),Z.YNc(5,$e,4,3,"div",7),Z.YNc(6,Ke,8,3,"div",8),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.styles.withLogo&&"loading"!=e.getStatus()),Z.xp6(1),Z.Q6J("ngIf",!e.error&&!e.disableURL),Z.xp6(1),Z.Q6J("ngIf",!e.error&&e.disableURL),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error),Z.xp6(1),Z.Q6J("ngIf",!e.loading&&e.error)}}function et(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-terms",41),Z.NdJ("accepted",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!1))})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("flow","presencial")("requestStatus",e.solicitud?e.solicitud.status_code:"")}}function tt(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"div",42),Z._uU(2),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(2),Z.hij("TestMode ",e.testMode?"ON":"OFF","")}}let nt=class{constructor(e,t,n,i,s,r,o,a,l,c){this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.webhooksService=a,this.knownService=l,this.dialog=c,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.flowName="KnownClient",this.showTermsDialog=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.userId?this.setInitialData(this.userId):this.loading=null,"pro"!=R.N.env&&(q(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),q(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){}setInitialData(e){var t=this;return(0,A.Z)((function*(){const n=yield t.getFlow(e);if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},!t.data.config||!t.data.config.funder_id)return t.notis.showAlert("Error!","No se ha configurado la customización del widget para este usuario","error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,A.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}sendMessageToParent(e){window.top.postMessage(e,"*")}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):this.loading=!1}),(e=>{this.loading=!1}))}setFormFromVcCode(e){var t=this;return(0,A.Z)((function*(){t.loading="Obteniendo datos de la solicitud...",t.solicitudesService.getSolicitudByCode(e).then((e=>{console.warn("solicitud: ",e.data),e&&e.data?(t.solicitud=e.data,t.setSubscriptionOfRequest(),t.loading=!1,t.skipCreationOfRequest=t.solicitud&&t.solicitud.status_code&&"prerequest"!=t.solicitud.status_code,t.autoAcceptTerms&&t.gotoOTP()):t.loading=!1})).catch((e=>{t.loading=!1}))}))()}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==R.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==R.N.env&&(e="wss://notifications.belender.net"),R.N.notificationsBaseUrl&&(e=R.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),t.setSubscriptionOfRequestOld()},this.socket.onclose=function(e){console.log("Conexión cerrada"),t.setSubscriptionOfRequestOld()}}handlePusherNotification(e){this.dataFromFirebase=e,this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,this.sendMessageToParent({type:"websocket",data:e}),"invalid_otp"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),"terms_and_conditions"!=this.solicitud.status_code&&setTimeout((()=>{this.loading=!1,this.cd.markForCheck()}),500))}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}gotoTerms(e){this.loading="Enviando datos..",e.package_id=this.packId,e.user_id=this.userId,this.testMode?setTimeout((()=>{this.solicitud=new Y.l,this.solicitud.status_code="waiting_otp",this.loading=!1}),4e3):this.skipCreationOfRequest?(this.gotoOTP(),this.setSubscriptionOfRequest()):this.solicitudesService.addSolicitud(e,this.packId,this.userId).then((t=>{t&&t.status&&"error"==t.status?(this.solicitud=e,t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha de nacimiento incorrecta")):(this.solicitud.status_code="no_service",this.loading=!1):(this.solicitud.status_code="form",this.showAlert("Error!",t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,this.sendMessageToParent({type:"response",data:t.data||t}),this.gotoOTP()):this.showAlert("Error!","Error desconocido: "+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=!1})))}sendNewData(e){this.loading="Enviando información..",this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e),this.loading=!1):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse("Validando nuevos datos, espere por favor.."),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}showAlert(e,t){this.loading=!1,this.notis.showAlert(e,t)}gotoPassword(e){this.loading="Iniciando el proceso de emisión de certificado..";let t=e;(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e.terms_and_conditions_power),this.knownService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?(this.showAlert("Error!",e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((e=>{t&&t.error&&this.showAlert("Error!",t.error),this.loading=!1}))}gotoOTP(e){let t=e;t.request_id=this.requestID,t.user_id=this.userId,this.initWaitingForResponse("Iniciando el proceso de emisión de certificado.."),setTimeout((()=>{this.solicitud=new Y.l,this.loading=!1,this.solicitud.status_code="waiting_otp"}),2e3)}requestOTP(e){let t={otp:e.code,request_id:this.solicitud.request_id};this.loading="Enviando código OTP ..",this.knownService.sendOtp(t).then((e=>{e.status&&"error"==e.status?(this.showAlert("Error!",e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}sendPassword(e){let t={password:e.set_password_certificate,request_id:this.solicitud.request_id};this.loading="Enviando contraseña..",this.knownService.sendPassword(t).then((e=>{e.status&&"error"==e.status?(this.showAlert("Error!",e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((t=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.solicitudesService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=!1):this.loading=!1})).catch((e=>{this.loading=!1}))}gotoErrorPhone(){}setRequestStatus(e){this.solicitud.status_code=e}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading="Reintentando enviar la solicitud...",this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}newRequest(e){this.solicitud.status_code="created"}getStatus(){return!this.solicitud||this.solicitud&&("created"==this.solicitud.status_code||"form"==this.solicitud.status_code||"terms_and_conditions"==this.solicitud.status_code)?"form":!this.solicitud||"waiting_login"!=this.solicitud.status_code&&"saved_otp"!=this.solicitud.status_code?!this.solicitud||"waiting_otp"!=this.solicitud.status_code&&"invalid_otp"!=this.solicitud.status_code&&"waiting_otp_seguridad_social"!=this.solicitud.status_code&&"invalid_otp_seguridad_social"!=this.solicitud.status_code?!this.solicitud||"waiting_password"!=this.solicitud.status_code&&"approved_terms_digital_power"!=this.solicitud.status_code&&"declined_terms_digital_power"!=this.solicitud.status_code?!this.solicitud||"abandoned_after_bad_phone"!=this.solicitud.status_code&&"abandoned_after_invalid_otp"!=this.solicitud.status_code&&"abandoned_after_terms_and_conditions"!=this.solicitud.status_code&&"abandoned_after_waiting_otp"!=this.solicitud.status_code?!this.solicitud||"all_documents_downloaded"!=this.solicitud.status_code&&"certificate_created"!=this.solicitud.status_code&&"partial_documents_downloaded"!=this.solicitud.status_code&&"waiting_certificate"!=this.solicitud.status_code&&"consent_process_completed"!=this.solicitud.status_code&&"success_otp"!=this.solicitud.status_code&&"otp_success"!=this.solicitud.status_code&&"waiting_documents"!=this.solicitud.status_code?!this.solicitud||"bad_phone"!=this.solicitud.status_code&&"phone_not_exist_otp"!=this.solicitud.status_code?!this.solicitud||"failed_with_retry"!=this.solicitud.status_code&&"failed_without_retry"!=this.solicitud.status_code&&"failed_documents_downloaded"!=this.solicitud.status_code?this.solicitud&&"no_service"==this.solicitud.status_code?"no-service":"no-exist":"failed":this.data.config.noRetryInBadPhone?"otp":"error-data":this.data.config&&this.data.config.infiniteLoopInCompleted?"loading":"success":"abandoned":"password":"otp":(this.loading="Estamos procesando su solicitud. Espere un momento por favor","loading")}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,e&&this.formComponent.setTermsCheck(!0)}gotoTermsAndConditionsCertificate(){this.dialog.open(F.v,{panelClass:"fullscreen-dialog",data:{flow:"presencial"}}).afterClosed().subscribe((e=>{e&&this.formComponent.setTerms2Check(!0)}))}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}};nt.ɵfac=function(e){return new(e||nt)(Z.Y36(Z.sBO),Z.Y36(L.gz),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(C.w),Z.Y36(H.r),Z.Y36(M.T),Z.Y36(w.t),Z.Y36(B),Z.Y36(J.uw))},nt.ɵcmp=Z.Xpm({type:nt,selectors:[["belender-widget-personal"]],viewQuery:function(e,t){if(1&e&&Z.Gf(qe,5),2&e){let e;Z.iGM(e=Z.CRH())&&(t.formComponent=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[Z._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:4,vars:4,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","requestStatus","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[3,"status","data",4,"ngIf"],[3,"userId","requestID","data","flowName","texts","solicitud","goToTerms","goToPower","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","texts","solicitud","nextStep",4,"ngIf"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","texts",4,"ngIf"],[3,"data","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","texts","retry",4,"ngIf"],[3,"texts","data",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"status","data"],[3,"userId","requestID","data","flowName","texts","solicitud","goToTerms","goToPower","goToTermsCertificate","nextStep"],["formStep",""],[3,"data","texts","solicitud","nextStep"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","texts"],[3,"data","texts","solicitud","retry","newRequest"],[3,"solicitud","data","texts","retry"],[3,"texts","data"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","requestStatus","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(Z.YNc(0,Re,1,3,"vex-power-cert",0),Z.YNc(1,Xe,7,10,"div",1),Z.YNc(2,et,1,2,"vex-terms",2),Z.YNc(3,tt,3,1,"ng-container",3)),2&e&&(Z.Q6J("ngIf",t.viewPowerTerms),Z.xp6(1),Z.Q6J("ngIf",t.data),Z.xp6(1),Z.Q6J("ngIf",t.showTermsDialog),Z.xp6(1),Z.Q6J("ngIf",t.testMode))},dependencies:[i.O5,u.lW,v.Ou,V.L,Q.L,W.q,ae,ce,he,ke,Me,Se,Ie,Ye],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),nt=(0,E.gn)([(0,N.c)()],nt);const it=[{path:":idUser",component:nt},{path:":idUser/:packID",component:nt}];let st=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({imports:[L.Bz.forChild(it),L.Bz,P.d8]}),e})();var rt=n(6981),ot=n(3848),at=n(1129),lt=n(3295),ct=n(1258),dt=n(2266),ut=n(3300),ht=n(865);let pt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({providers:[_.M,y.o,C.w,w.t,M.T,O.t,B,{provide:T.Ad,useValue:"es-ES"}],imports:[st,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,v.Cq,k.FA,T.XK,S.T5,I.Fk,rt.x,ot.Nh,at.n,lt.g,ct.H,dt.L,ut.C,ht.q]}),e})()},920:(e,t,n)=>{n.d(t,{n:()=>wt});var i=n(5861),s=n(7582),r=n(9549),o=n(9933),a=n(5762),l=n(8259),c=n(2340),d=n(667),u=n(3842);const h={created:"form",form:"form",prerequest:"form",terms_and_conditions:"form",waiting_otp_seguridad_social:"otp_ss",waiting_login_seguridad_social:"otp_ss",invalid_otp_seguridad_social:"otp_ss",waiting_otp_carpeta_ciudadana:"otp_ss",waiting_login_carpeta_ciudadana:"otp_ss",invalid_otp_carpeta_ciudadana:"otp_ss",waiting_otp_aeat:"otp_aeat",waiting_login_aeat:"otp_aeat",invalid_otp_aeat:"otp_aeat",waiting_login_bde:"otp_bde",waiting_otp_bde:"otp_bde",invalid_otp_bde:"otp_bde",abandoned_after_bad_phone:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",abandoned_after_invalid_otp_aeat:"abandoned",abandoned_after_waiting_otp_aeat:"abandoned",abandoned_after_waiting_otp_bde:"abandoned",abandoned_after_invalid_otp_bde:"abandoned",abandond_after_waiting_otp_carpeta_ciudadana:"abandoned",abandond_after_invalid_otp_carpeta_ciudadana:"abandoned",all_documents_downloaded:"success",partial_documents_downloaded:"success",consent_process_completed:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",failed_with_retry:"failed",failed_without_retry:"failed",failed_documents_downloaded:"failed",consent_process_canceled:"failed",failed_job_task_cirbe:"failed",no_service:"no-service",no_clave_pin_service:"no-service",no_cirbe_cp_service:"no-service",no_sms_service:"no-service",stand_by:"standby","no-phone":"no-phone","no-more-phone":"no-phone",bad_phone:"bad-phone",error_expiration_date:"error-expiration-date",error_birth_date:"error-birth-date",error_support_number:"error-support-number",duplicated:"duplicated"};var p=n(1931),m=n(4650),f=n(9299),g=n(5089),_=n(7489),b=n(5895),y=n(182),v=n(5206),w=n(8460),x=n(9045),C=n(7367),k=n(5412),T=n(7308),M=n(3687),S=n(6895),I=n(6830),O=n(4302),L=n(9112),P=n(9382),A=n(7392),E=n(9101),D=n(1572),N=n(4006),Y=n(5601),q=n(9617),R=n(3046),F=n(342),Z=n(3731);function U(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",3),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.success.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function H(e,t){if(1&e&&m._UZ(0,"widget-documents",8),2&e){const e=m.oxw(2);m.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function j(e,t){if(1&e&&(m.TgZ(0,"div",4),m._UZ(1,"div",5)(2,"div",6),m.ALo(3,"safeHtml"),m.YNc(4,H,1,3,"widget-documents",7),m.qZA()),2&e){const e=m.oxw();m.xp6(1),m.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),m.Q6J("innerHTML",e.texts.success.title,m.oJD),m.xp6(1),m.Udp("color",e.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(3,9,e.texts.success.description||""),m.oJD),m.xp6(2),m.Q6J("ngIf",e.showDocuments)}}const z=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function B(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",9)(1,"button",10),m.NdJ("click",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.gotoRedirect())})),m._uU(2),m.qZA()()}if(2&e){const e=m.oxw();m.Q6J("ngClass",m.kEZ(8,z,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),m.xp6(1),m.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let J=(()=>{class e{constructor(e,t,n,i,s){this.formBuilder=e,this.utils=t,this.solicitudesService=n,this.packsS=i,this.cd=s,this.showDocuments=!1}ngOnInit(){this.uploadForm=this.formBuilder.group({file:[""]}),this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].automaticRedirectCallBack&&this.data[this.flowName].callBackUrl?setTimeout((()=>{location.assign(this.data[this.flowName].callBackUrl)}),2e3):this.data&&this.data[this.flowName]&&this.data[this.flowName].showDocumentsOnSuccess&&(this.showDocuments=!0)}save(){}gotoRedirect(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}getIfShowLogo(){return!this.data?.config?.infiniteLoopInCompleted&&this.data?.styles?.withLogo}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.qu),m.Y36(g.F),m.Y36(Y.M),m.Y36(q.U),m.Y36(m.sBO))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",packId:"packId",requestID:"requestID",userId:"userId",flowName:"flowName",labels:"labels"},decls:3,vars:3,consts:[[3,"firstOption","logoUrl",4,"ngIf"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],["class","flex items-center gap-2 py-4 flex-col md:flex-row",3,"ngClass",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID",4,"ngIf"],[3,"userId","packId","requestID"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(m.YNc(0,U,1,2,"belender-widget-logo",0),m.YNc(1,j,5,11,"div",1),m.YNc(2,B,3,12,"div",2)),2&e&&(m.Q6J("ngIf",t.getIfShowLogo()),m.xp6(1),m.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),m.xp6(1),m.Q6J("ngIf",t.data&&t.data[t.flowName]&&t.data[t.flowName].enableUrlCallBack&&!t.data[t.flowName].automaticRedirectCallBack))},dependencies:[S.mk,S.O5,R.X,F.A,E.lW,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var V=n(9391);function Q(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",7),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.fail.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const W=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function G(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",8)(1,"button",9),m.NdJ("click",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.retry())})),m._uU(2),m.qZA()()}if(2&e){const e=m.oxw();m.Q6J("ngClass",m.kEZ(8,W,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),m.xp6(1),m.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",null==e.labels||null==e.labels.actions?null:e.labels.actions.retry," ")}}function $(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",8)(1,"button",10),m.NdJ("click",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.newRequest())})),m._uU(2),m.qZA()()}if(2&e){const e=m.oxw();m.Q6J("ngClass",m.kEZ(8,W,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),m.xp6(1),m.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",null==e.labels||null==e.labels.actions?null:e.labels.actions.newRequest," ")}}let K=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryR=new m.vpe(null),this.newR=new m.vpe(null)}ngOnInit(){}save(){}retry(){this.retryR.emit(this.solicitud.request_id)}newRequest(){this.newR.emit(this.solicitud.request_id)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F),m.Y36(Y.M),m.Y36(V.o),m.Y36(b.T))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{retryR:"retryRequest",newR:"newRequest"},decls:8,vars:9,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"px-2","py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(m.YNc(0,Q,1,2,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2),m._UZ(3,"div",3)(4,"div",4),m.ALo(5,"safeHtml"),m.qZA(),m.YNc(6,G,3,12,"div",5),m.YNc(7,$,3,12,"div",6),m.qZA()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Q6J("innerHTML",t.texts.fail.title,m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(5,7,t.texts.fail.description),m.oJD),m.xp6(2),m.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),m.xp6(1),m.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[S.mk,S.O5,R.X,E.lW,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var X=n(3238),ee=n(5439),te=n.n(ee),ne=n(3755),ie=n(3746),se=n(2932),re=n(4246),oe=n(1763),ae=n(5696),le=n(1094),ce=n(4144);const de=["termsCheckbox"],ue=["assignmentCheckbox"];function he(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",17),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.form.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function pe(e,t){if(1&e&&(m.TgZ(0,"mat-error"),m._uU(1),m.qZA()),2&e){const e=m.oxw();m.xp6(1),m.hij(" ",e.labels.warnings.invalidNieOrDni," ")}}function me(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"mat-hint")(1,"a",19),m.NdJ("click",(function(t){m.CHM(e);const n=m.oxw(2);return m.KtG(n.gotoExpirationDate(t))})),m.TgZ(2,"u"),m._uU(3),m.qZA()()()}if(2&e){const e=m.oxw(2);m.xp6(3),m.Oqu(e.labels.findExpiration)}}function fe(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," El formato debe ser DD/MM/AAAA "),m.qZA())}function ge(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," Fecha inválida "),m.qZA())}function _e(e,t){if(1&e&&(m.TgZ(0,"mat-form-field",7)(1,"mat-label"),m._uU(2),m.qZA(),m._UZ(3,"input",18),m.YNc(4,me,4,1,"mat-hint",9),m.YNc(5,fe,2,0,"mat-error",9),m.YNc(6,ge,2,0,"mat-error",9),m.qZA()),2&e){const e=m.oxw();let t,n;m.Gre("",e.disabledInputs.expiration?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(e.labels.expiration),m.xp6(1),m.s9C("tabindex",e.disabledInputs.expiration?-1:1),m.xp6(1),m.Q6J("ngIf",e.isDni),m.xp6(1),m.Q6J("ngIf",null==(t=e.form.get("expired_date"))?null:t.hasError("invalidFormat")),m.xp6(1),m.Q6J("ngIf",null==(n=e.form.get("expired_date"))?null:n.hasError("invalidDate"))}}function be(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," El formato debe ser DD/MM/AAAA "),m.qZA())}function ye(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," Fecha inválida "),m.qZA())}function ve(e,t){1&e&&(m.TgZ(0,"mat-error"),m._uU(1," Debe ser mayor de 18 años "),m.qZA())}function we(e,t){if(1&e&&(m.TgZ(0,"mat-form-field",7)(1,"mat-label"),m._uU(2),m.qZA(),m._UZ(3,"input",20),m.YNc(4,be,2,0,"mat-error",9),m.YNc(5,ye,2,0,"mat-error",9),m.YNc(6,ve,2,0,"mat-error",9),m.qZA()),2&e){const e=m.oxw();let t,n,i;m.Gre("",e.disabledInputs.birthday?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(e.labels.birthday),m.xp6(1),m.s9C("tabindex",e.disabledInputs.birthday?-1:1),m.xp6(1),m.Q6J("ngIf",null==(t=e.form.get("expired_date"))?null:t.hasError("invalidFormat")),m.xp6(1),m.Q6J("ngIf",null==(n=e.form.get("expired_date"))?null:n.hasError("invalidDate")),m.xp6(1),m.Q6J("ngIf",null==(i=e.form.get("expired_date"))?null:i.hasError("underAge"))}}function xe(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"mat-form-field",7)(1,"mat-label"),m._uU(2),m.qZA(),m._UZ(3,"input",21),m.TgZ(4,"mat-hint")(5,"a",19),m.NdJ("click",(function(t){m.CHM(e);const n=m.oxw();return m.KtG(n.gotoSupportAclaration(t))})),m.TgZ(6,"u"),m._uU(7),m.qZA()()()()}if(2&e){const e=m.oxw();m.Gre("",e.disabledInputs.supportNumber?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(e.labels.support),m.xp6(1),m.s9C("tabindex",e.disabledInputs.supportNumber?-1:1),m.xp6(4),m.Oqu(e.labels.findExpiration)}}function Ce(e,t){if(1&e&&(m.TgZ(0,"div",22)(1,"mat-form-field",7)(2,"mat-label"),m._uU(3),m.qZA(),m._UZ(4,"input",23),m.qZA()()),2&e){const e=m.oxw();m.xp6(1),m.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(e.labels.email),m.xp6(1),m.s9C("tabindex",e.disabledInputs.email?-1:1)}}function ke(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",24)(1,"belender-checkbox",25,26),m.NdJ("changeCheckbox",(function(t){m.CHM(e);const n=m.oxw();return m.KtG(n.setTerms(t))})),m.TgZ(3,"belender-terms-and-policy-links",27),m.NdJ("goToTerms",(function(t){m.CHM(e);const n=m.oxw();return m.KtG(n.gotoTermsAndConditions(t))})),m.qZA()()()}if(2&e){const e=m.oxw();m.xp6(1),m.Q6J("color",e.data.styles.colors.title),m.xp6(2),m.Q6J("userId",e.userId)("lang",e.lang)("flowName",e.flowName)("data",e.data)("showPolicyLink",null==e.data?null:e.data.config.showPolicyLink)("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Te(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",24)(1,"belender-checkbox",28,29),m.NdJ("changeCheckbox",(function(t){m.CHM(e);const n=m.oxw();return m.KtG(n.setAssignment(t))})),m._UZ(3,"div",30),m.qZA()()}if(2&e){const e=m.oxw();m.xp6(1),m.Q6J("color",e.data.styles.colors.title),m.xp6(2),m.Q6J("innerHTML",e.data[e.flowName]&&e.data[e.flowName].texts&&e.data[e.flowName].texts.dataAssignmentText?e.data[e.flowName].texts.dataAssignmentText:null==e.data?null:e.data.config.dataAssignmentText,m.oJD)}}function Me(e,t){if(1&e&&(m.TgZ(0,"div",31),m._UZ(1,"mat-icon",32),m._uU(2),m.qZA()),2&e){const e=m.oxw();m.xp6(2),m.hij(" ",e.labels.warnings.haveToReadTerms," ")}}function Se(e,t){if(1&e&&(m.TgZ(0,"div",33),m._UZ(1,"mat-icon",32),m._uU(2),m.qZA()),2&e){const e=m.oxw();m.xp6(2),m.hij(" ",e.errorDNI," ")}}const Ie=function(e){return{"dont-show-data":e}},Oe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}},Le={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Pe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.cd=n,this.widgetUtils=i,this.dialog=s,this.lang="",this.next=new m.vpe(null),this.esDNI=new m.vpe(null),this.goTerms=new m.vpe(null),this.acceptTerms=!1,this.step=0,this.assignment=!1,this.termsReaded=!1,this.isDni=!1,this.isNie=!1,this.disabledInputs={dni:!1,birthday:!1,supportNumber:!1,email:!1,expiration:!1},this.noValidate=!1}ngOnInit(){this.solicitud?(this.setBaseForm(this.solicitud),this.noValidate="terms_and_conditions"==this.solicitud.status_code):this.setBaseForm(null)}sendPestana(){window.parent.open("www.google.com","_blank")}setRegex(e){if(!e)return;let t=this.widgetUtils.ValidateIDType(e);t&&t.type?("dni"===t.type?(this.isDni=!0,this.errorDNI=t.valid?null:this.labels.warnings.invalidDni):this.isDni=!1,"nie"===t.type?(this.isNie=!0,this.errorDNI=t.valid?null:this.labels.warnings.invalidNie):this.isNie=!1):(this.isDni=!1,this.isNie=!1,this.errorDNI=this.labels.warnings.invalidNieOrDni),this.form?.get("expired_date").setValidators([(0,se.s)({checkFormat:!0,checkDate:!0,checkAge:!this.isDni})]),this.cd.markForCheck()}setBaseForm(e){let t=e?e.person_document_number||e.dni||e.document_number:null,n=e&&e.birth_date?te()(e.birth_date).format("DD/MM/YYYY"):null,i=e&&e.person_document_expiration_date?te()(e.person_document_expiration_date).format("DD/MM/YYYY"):null,s=e&&e.document_support?e.document_support:null,r=e&&e.person_birth_date?te()(e.person_birth_date).format("DD/MM/YYYY"):n,o=i,a=e?e.person_email||e.email||e.email_copy:null,l=e&&e.person_document_support?e.person_document_support:s;t&&this.setRegex(t),this.form=this.fb.group(this.isDni?this.data.config.followMail?{dni:[t,this.noValidate?[]:[N.kI.required,N.kI.maxLength(9),this.regexDNI()]],email:[a],document_type:["dni"],expired_date:[o,[(0,se.s)({checkFormat:!0,checkDate:!0})]],support_number:[null],person_phone:[]}:{dni:[t,this.noValidate?[]:[N.kI.required,N.kI.maxLength(9),this.regexDNI()]],document_type:["dni"],expired_date:[o,[(0,se.s)({checkFormat:!0,checkDate:!0})]],support_number:[null]}:this.data.config.followMail?{dni:[t,[N.kI.required,N.kI.maxLength(9),this.regexDNI()]],expired_date:[r],document_type:["nie"],support_number:[l],email:[a]}:{dni:[t,[N.kI.required,N.kI.maxLength(9),this.regexDNI()]],expired_date:[r],document_type:["nie"],support_number:[l]}),this.form.get("expired_date").setValidators([(0,se.s)({checkFormat:!0,checkDate:!0,checkAge:!this.isDni})]),this.form.markAsUntouched(),this.form.updateValueAndValidity(),this.requestIDFromURL&&this.disableEnableInputs(t,n||r,i,s||l,a)}forceEnableDisableInputs(e,t,n,i,s){let r=t?t.value:this.disabledInputs.birthday,o=i?i.value:this.disabledInputs.supportNumber;this.isNie&&r&&!r.value&&(o={value:!1}),this.disableEnableInputs(e?e.value:this.disabledInputs.dni,r,n?n.value:this.disabledInputs.expiration,o,s?s.value:this.disabledInputs.email)}disableEnableInputs(e,t,n,i,s){this.disabledInputs={dni:e||!1,birthday:t||!1,supportNumber:i||!1,email:!!s,expiration:n||!1},this.cd.markForCheck()}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}nextStep(){let e;this.isDni?(e={document_number:this.form.get("dni").value.toUpperCase(),check_legal:!0,document_expiration_date:this.utils.formatDate(this.form.get("expired_date").value)},this.solicitud.person_document_number=e.document_number,this.solicitud.person_document_expiration_date=e.document_expiration_date):(e={document_number:this.form.get("dni").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("expired_date").value),check_legal:!0,document_support:this.form.get("support_number").value},this.solicitud.person_document_number=e.document_number,this.solicitud.person_birth_date=e.birth_date,this.solicitud.person_document_support=e.document_support),this.data&&this.data.config&&this.data.config.followMail&&(e.email_copy=this.form.get("email")?this.form.get("email").value:""),e.document_type=this.isDni?"dni":"nie",this.esDNI.emit(this.isDni),this.next.emit(e)}getHTML(e){return'\n <div style="color: red !important">\n Taitooo\n </div>\n '}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ne.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ie.R,{panelClass:"fullscreen-dialog"})}setTerms(e){this.acceptTerms=e}setAssignment(e){this.assignment=e}getFormsValid(){if(!this.form)return!1;let e=!this.form.invalid;if(!e)return!1;let t=this.form&&this.form.get("support_number")?this.form.get("support_number").value:null;this.data.config.dontShowDataInTerms&&this.solicitud&&this.solicitud.status_code&&"terms_and_conditions"===this.solicitud.status_code&&(e=!0);let n=this.form.get("dni").value;return n?this.setRegex(n):e=!1,this.isNie&&(!t||""==t)&&(e=!1),!this.isDni&&!this.isNie&&(this.disabledInputs.dni=!1,e=!1),this.errorDNI&&(e=!1),e}getIfValid(){if(this.data.config.dontShowDataInTerms&&this.solicitud&&this.solicitud.status_code&&"terms_and_conditions"===this.solicitud.status_code&&(this.acceptTerms=!0),this.isDni||this.isNie)return this.errorDNI=null,!!this.data.config.hideCheckLegal||this.acceptTerms;this.errorDNI=this.labels.warnings.invalidNieOrDni}getAssignmentValidation(){return!(this.data.config.forceChecks&&!this.termsReaded)&&(!this.data.config.dataAssignmentCheck||this.assignment)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F),m.Y36(m.sBO),m.Y36(re.t),m.Y36(k.uw))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(m.Gf(de,5),m.Gf(ue,5)),2&e){let e;m.iGM(e=m.CRH())&&(t.checkComponent=e.first),m.iGM(e=m.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{userId:"userId",flowName:"flowName",data:"data",texts:"texts",solicitud:"solicitud",requestIDFromURL:"requestIDFromURL",labels:"labels",lang:"lang"},outputs:{next:"nextStep",esDNI:"isDni",goTerms:"goToTerms"},features:[m._Bn([{provide:X.sG,useValue:Le},{provide:m.soG,useValue:"es-ES"}])],decls:24,vars:42,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[3,"ngClass"],[1,"mb-3","pt-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline"],["id","dniInput","formControlName","dni","maxlength","9","matInput","",3,"tabindex"],[4,"ngIf"],["appearance","outline",3,"class",4,"ngIf"],["class","w-full",4,"ngIf"],["class","mt-6 flex justify-start items-center w-full flex-100",4,"ngIf"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","pl-3 pr-4 w-fit flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","sendBtn","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"firstOption","logoUrl"],["id","dniExpireInput","required","","formControlName","expired_date","type","text","mask","00/00/0000","matInput","",3,"tabindex"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["id","dniExpireInput","required","","formControlName","expired_date","type","text","matInput","","mask","d0/M0/0000",3,"tabindex"],["id","supportNumberInput","maxlength","9","minlength","6","required","","formControlName","support_number","matInput","",3,"tabindex"],[1,"w-full"],["id","emailInput","formControlName","email","required","","type","email","placeholder","Ingresa tu email","matInput","",3,"tabindex"],[1,"mt-6","flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","lang","flowName","data","showPolicyLink","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],[3,"color","changeCheckbox"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"pl-3","pr-4","w-fit","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"]],template:function(e,t){1&e&&(m.YNc(0,he,1,2,"belender-widget-logo",0),m.TgZ(1,"form",1)(2,"div",2),m._UZ(3,"div",3)(4,"div",4),m.ALo(5,"safeHtml"),m.qZA(),m.TgZ(6,"div",5)(7,"div",6)(8,"mat-form-field",7)(9,"mat-label"),m._uU(10),m.qZA(),m._UZ(11,"input",8),m.YNc(12,pe,2,1,"mat-error",9),m.qZA(),m.YNc(13,_e,7,8,"mat-form-field",10),m.YNc(14,we,7,8,"mat-form-field",10),m.YNc(15,xe,8,6,"mat-form-field",10),m.YNc(16,Ce,5,5,"div",11),m.qZA()(),m.YNc(17,ke,4,12,"div",12),m.YNc(18,Te,4,2,"div",12),m.YNc(19,Me,3,1,"div",13),m.YNc(20,Se,3,1,"div",14),m.TgZ(21,"div",15)(22,"button",16),m.NdJ("click",(function(){return t.nextStep()})),m._uU(23),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(1),m.Q6J("formGroup",t.form),m.xp6(2),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.Q6J("innerHTML",t.texts.form.title,m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(5,34,t.texts.form.description||""),m.oJD),m.xp6(2),m.Q6J("ngClass",m.VKq(36,Ie,t.data.config.dontShowDataInTerms&&t.solicitud&&t.solicitud.status_code&&"terms_and_conditions"===t.solicitud.status_code)),m.xp6(2),m.Gre("",t.disabledInputs.dni?"disabled-input":""," w-full flex-1 belender-form-field"),m.xp6(2),m.Oqu(t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),m.xp6(1),m.s9C("tabindex",t.disabledInputs.dni?-1:1),m.xp6(1),m.Q6J("ngIf",!t.isNie&&!t.isDni),m.xp6(1),m.Q6J("ngIf",t.isDni),m.xp6(1),m.Q6J("ngIf",t.isNie),m.xp6(1),m.Q6J("ngIf",t.isNie),m.xp6(1),m.Q6J("ngIf",(null==t.data||null==t.data.config?null:t.data.config.followMail)&&(t.isDni||t.isNie)),m.xp6(1),m.Q6J("ngIf",!t.data.config.hideCheckLegal),m.xp6(1),m.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),m.xp6(1),m.Q6J("ngIf",t.data.config.forceChecks&&!t.termsReaded),m.xp6(1),m.Q6J("ngIf",t.errorDNI),m.xp6(1),m.Q6J("ngClass",m.kEZ(38,Oe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.getFormsValid()&&t.getIfValid()&&t.getAssignmentValidation()?t.data.styles.colors.btnText:"")("background",t.getFormsValid()&&t.getIfValid()&&t.getAssignmentValidation()?t.data.styles.colors.btnBg:"")("border-radius",t.data.styles.btnRound+"px"),m.Q6J("disabled",!t.getFormsValid()||!t.getIfValid()||!t.getAssignmentValidation()),m.xp6(1),m.hij(" ",t.labels.actions.continue," "))},dependencies:[S.mk,S.O5,N._Y,N.Fj,N.JJ,N.JL,N.Q7,N.wO,N.nD,N.sg,N.u,oe.b,R.X,ae.T,le.Z6,A.Hw,E.lW,r.TO,r.KE,r.bx,r.hX,ce.Nt,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}.hiden-input[_ngcontent-%COMP%]{height:0!important;max-height:0px!important;overflow:hidden!important;opacity:0!important}"]}),e})();function Ae(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",5),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.noService.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}let Ee=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts"},decls:6,vars:11,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,Ae,1,2,"belender-widget-logo",0),m.TgZ(1,"form",1)(2,"div",2),m._UZ(3,"div",3)(4,"div",4),m.ALo(5,"safeHtml"),m.qZA()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.Q6J("innerHTML",t.texts.noService.title,m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(5,9,t.texts.noService.description),m.oJD))},dependencies:[S.O5,N._Y,N.JL,N.F,R.X,Z.z]}),e})();function De(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",8),2&e){const e=m.oxw();m.Q6J("firstOption",e.texts.abandoned.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const Ne=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Ye=(()=>{class e{constructor(e){this.utils=e,this.retryR=new m.vpe(null)}ngOnInit(){}save(){}retry(){this.retryR.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(m.Y36(g.F))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{data:"data",solicitud:"solicitud",labels:"labels",texts:"texts"},outputs:{retryR:"retryRequest"},decls:11,vars:24,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,De,1,2,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2),m._UZ(3,"div",3)(4,"div",4),m.ALo(5,"safeHtml"),m.TgZ(6,"div",5),m._uU(7),m.qZA()(),m.TgZ(8,"div",6)(9,"button",7),m.NdJ("click",(function(){return t.retry()})),m._uU(10),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.Q6J("innerHTML",t.texts.abandoned.title,m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",m.lcZ(5,18,t.texts.abandoned.description),m.oJD),m.xp6(3),m.hij(" ",t.getTextStatus()," "),m.xp6(1),m.Q6J("ngClass",m.kEZ(20,Ne,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",null==t.labels.actions?null:t.labels.actions.retry," "))},dependencies:[S.mk,S.O5,R.X,E.lW,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var qe=n(5145);const Re=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Fe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.nr=new m.vpe(null)}ngOnInit(){}newRequest(){this.nr.emit(!0)}gotoRequest(){location.assign(this.currentRequest.widget_url_boxed)}getStatus(){let e=qe.Z.find((e=>e.text==this.currentRequest.status_code));return e?e.label:"Estado desconocido"}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F),m.Y36(Y.M),m.Y36(V.o),m.Y36(b.T))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-duplicated-request-step"]],inputs:{currentRequest:"currentRequest",data:"data",texts:"texts",labels:"labels"},outputs:{nr:"newRequest"},decls:15,vars:25,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"flex","gap-2","justify-start","items-center","py-2"],[1,"w-fit","p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(m.TgZ(0,"div",0)(1,"div",1)(2,"div",2),m._uU(3),m.qZA(),m.TgZ(4,"div",3),m._uU(5),m.qZA(),m.TgZ(6,"div",4),m._uU(7),m.TgZ(8,"div",5),m._uU(9),m.qZA()()(),m.TgZ(10,"div",6)(11,"button",7),m.NdJ("click",(function(){return t.newRequest()})),m._uU(12),m.qZA(),m.TgZ(13,"button",8),m.NdJ("click",(function(){return t.gotoRequest()})),m._uU(14),m.qZA()()()),2&e&&(m.xp6(2),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.xp6(1),m.hij(" ",t.labels.warnings.duplicatedRequest," "),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.xp6(1),m.hij(" ",t.labels.warnings.alreadyHaveRequest," "),m.xp6(2),m.hij(" ",t.labels.warnings.currentRequestStatus," "),m.xp6(2),m.hij(" ",t.getStatus()," "),m.xp6(1),m.Q6J("ngClass",m.kEZ(21,Re,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("border-radius",t.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",t.labels.actions.newRequest," "),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.xp6(1),m.hij(" ",t.labels.actions.gotoCurrentRequest," "))},dependencies:[S.mk,E.lW],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Ze=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-standby-step"]],inputs:{data:"data",texts:"texts"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(m.TgZ(0,"form",0)(1,"div",1),m._UZ(2,"div",2)(3,"div",3),m.ALo(4,"safeHtml"),m.qZA()()),2&e&&(m.xp6(2),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.standby?t.texts.standby.titleSize+"px":"20px"),m.Q6J("innerHTML",t.texts.standby?t.texts.standby.title:"Solicitud en Stand By",m.oJD),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.Q6J("innerHTML",t.texts.standby?t.texts.standby.description:m.lcZ(4,8,"Descripcion del estado Stand By"),m.oJD))},dependencies:[N._Y,N.JL,N.F,Z.z]}),e})();function Ue(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",10),2&e){const e=m.oxw();m.Q6J("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const He=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let je=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new m.vpe(null)}ngOnInit(){this.form=this.fb.group({document_expiration_date:[null,[N.kI.required]]})}next(){this.nextStep.emit(this.form.get("document_expiration_date").value)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-error-expiration-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:17,vars:24,consts:[[3,"logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","date","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration_date","matInput",""],[1,"flex","items-center","justify-end","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,Ue,1,1,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2)(3,"div",3),m._uU(4),m.qZA(),m.TgZ(5,"div",4),m._uU(6),m.qZA(),m.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),m._uU(10),m.qZA(),m._UZ(11,"input",7),m.TgZ(12,"mat-hint"),m._uU(13,"DD/MM/YYYY"),m.qZA()()()(),m.TgZ(14,"div",8)(15,"button",9),m.NdJ("click",(function(){return t.next()})),m._uU(16),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.wrongExpiration," "),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.inputExpiration," "),m.xp6(1),m.Q6J("formGroup",t.form),m.xp6(3),m.Oqu(null==t.labels?null:t.labels.expiration),m.xp6(4),m.Q6J("ngClass",m.kEZ(20,He,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.Q6J("disabled",t.form.invalid),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.actions?null:t.labels.actions.send," "))},dependencies:[S.mk,S.O5,N._Y,N.Fj,N.JJ,N.JL,N.Q7,N.sg,N.u,R.X,E.lW,r.KE,r.bx,r.hX,ce.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ze(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",10),2&e){const e=m.oxw();m.Q6J("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const Be=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Je=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new m.vpe(null)}ngOnInit(){this.form=this.fb.group({support_number:[null,[N.kI.required]]})}next(){this.nextStep.emit(this.form.get("support_number").value)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-error-support-number-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:15,vars:24,consts:[[3,"logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","number","placeholder","Ej: 1233443","required","","formControlName","support_number","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,ze,1,1,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2)(3,"div",3),m._uU(4),m.qZA(),m.TgZ(5,"div",4),m._uU(6),m.qZA(),m.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),m._uU(10),m.qZA(),m._UZ(11,"input",7),m.qZA()()(),m.TgZ(12,"div",8)(13,"button",9),m.NdJ("click",(function(){return t.next()})),m._uU(14),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.wrongSupport," "),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.inputSupport," "),m.xp6(1),m.Q6J("formGroup",t.form),m.xp6(3),m.Oqu(null==t.labels||null==t.labels.warnings?null:t.labels.warnings.support),m.xp6(2),m.Q6J("ngClass",m.kEZ(20,Be,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.Q6J("disabled",t.form.invalid),m.xp6(1),m.hij(" ",null==t.labels||null==t.labels.actions?null:t.labels.actions.send," "))},dependencies:[S.mk,S.O5,N._Y,N.Fj,N.wV,N.JJ,N.JL,N.Q7,N.sg,N.u,R.X,E.lW,r.KE,r.hX,ce.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ve(e,t){if(1&e&&m._UZ(0,"belender-widget-logo",10),2&e){const e=m.oxw();m.Q6J("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const Qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let We=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new m.vpe(null)}ngOnInit(){this.form=this.fb.group({birth_date:[null,[N.kI.required]]})}next(){this.nextStep.emit(this.form.get("birth_date").value)}}return e.ɵfac=function(t){return new(t||e)(m.Y36(N.QS),m.Y36(g.F))},e.ɵcmp=m.Xpm({type:e,selectors:[["belender-error-birthday-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:17,vars:24,consts:[[3,"logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","belender-form-field"],["type","text","required","","formControlName","birth_date","matInput","","mask","d0/M0/0000"],[1,"flex","items-center","justify-end","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"logoUrl"]],template:function(e,t){1&e&&(m.YNc(0,Ve,1,1,"belender-widget-logo",0),m.TgZ(1,"div",1)(2,"div",2)(3,"div",3),m._uU(4),m.qZA(),m.TgZ(5,"div",4),m._uU(6),m.qZA(),m.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),m._uU(10),m.qZA(),m._UZ(11,"input",7),m.TgZ(12,"mat-hint"),m._uU(13,"DD/MM/YYYY"),m.qZA()()()(),m.TgZ(14,"div",8)(15,"button",9),m.NdJ("click",(function(){return t.next()})),m._uU(16),m.qZA()()()),2&e&&(m.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),m.xp6(3),m.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),m.xp6(1),m.hij(" ",t.labels.warnings.wrongBirthday," "),m.xp6(1),m.Udp("color",t.data.styles.colors.text),m.xp6(1),m.hij(" ",t.labels.warnings.inputBirthDay," "),m.xp6(1),m.Q6J("formGroup",t.form),m.xp6(3),m.hij(" ",t.labels.warnings.birthday," "),m.xp6(4),m.Q6J("ngClass",m.kEZ(20,Qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),m.xp6(1),m.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),m.Q6J("disabled",t.form.invalid),m.xp6(1),m.hij(" ",t.labels.actions.send," "))},dependencies:[S.mk,S.O5,N._Y,N.Fj,N.JJ,N.JL,N.Q7,N.sg,N.u,R.X,le.Z6,E.lW,r.KE,r.bx,r.hX,ce.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const Ge=["formStep"],$e=["otpStep"];function Ke(e,t){if(1&e&&(m.TgZ(0,"div",8),m._UZ(1,"mat-icon",9),m._uU(2),m.qZA()),2&e){const e=m.oxw(2);m.Q6J("@fadeInUp",void 0),m.xp6(2),m.hij(" ",e.warningAlert," ")}}function Xe(e,t){1&e&&(m.TgZ(0,"div",10),m._UZ(1,"mat-progress-spinner",11),m.qZA()),2&e&&(m.xp6(1),m.Q6J("value",0))}function et(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-form-step",23,24),m.NdJ("goToTerms",(function(){m.CHM(e);const t=m.oxw(3);return m.KtG(t.gotoTermsAndConditions())}))("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.validateRequest(t))}))("isDni",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setIsDni(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("userId",e.userId)("flowName",e.flowName)("lang",e.currentLang)("requestIDFromURL",e.requestIDFromURL)("texts",e.data[e.flowName].texts)("data",e.data)("labels",e.labels)("lang",e.currentLang)("solicitud",e.solicitud)}}function tt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-shared-otp-step",25,26),m.NdJ("resendOTP",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.resendOTP(t))}))("errorPhone",(function(){m.CHM(e);const t=m.oxw(3);return m.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.requestOTP(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("otpType",e.getOtpType(e.requestStatus))("flowType",e.flowName)("data",e.data)("labels",e.labels)("solicitud",e.solicitud)("minLength",e.getOTPMinLength())("lastThreeNumbersPhone",e.lastThreeNumbersPhone)("texts",e.data[e.flowName].texts)}}function nt(e,t){if(1&e&&m._UZ(0,"belender-success-step",27),2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("flowName",e.flowName)("packId",e.packId)("userId",e.userId)("requestID",e.requestID)("texts",e.data[e.flowName].texts)}}function it(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-duplicated-request-step",28),m.NdJ("newRequest",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.newRequest(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("currentRequest",e.currentRequest)}}function st(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-error-birthday-step",29),m.NdJ("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setBirthDate(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function rt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-error-expiration-step",29),m.NdJ("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setExpiration(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function ot(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-error-support-number-step",29),m.NdJ("nextStep",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setSupportNumber(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function at(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-fail-step",30),m.NdJ("retryRequest",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.retryRequest(t))}))("newRequest",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.newRequest(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("solicitud",e.solicitud)("texts",e.data[e.flowName].texts)}}function lt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-abandoned-step",31),m.NdJ("retryRequest",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.retryRequest(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)("solicitud",e.solicitud)}}function ct(e,t){if(1&e&&m._UZ(0,"belender-no-service-step",32),2&e){const e=m.oxw(3);m.Q6J("texts",e.data[e.flowName].texts)("data",e.data)}}function dt(e,t){if(1&e&&m._UZ(0,"belender-standby-step",32),2&e){const e=m.oxw(3);m.Q6J("texts",e.data[e.flowName].texts)("data",e.data)}}function ut(e,t){if(1&e&&(m.TgZ(0,"div",33)(1,"div",34)(2,"h1",35),m._uU(3,"No existe la solicitud"),m.qZA()(),m.TgZ(4,"div",36),m._uU(5," No existen solicitudes activas con el código requerido "),m.qZA()()),2&e){const e=m.oxw(3);m.xp6(4),m.Udp("color",e.data.styles.colors.text)}}function ht(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"belender-cancel-request",37),m.NdJ("updateStatusCode",(function(t){m.CHM(e);const n=m.oxw(3);return m.KtG(n.setCancel(t))})),m.qZA()}if(2&e){const e=m.oxw(3);m.Q6J("flowType",e.flowName)("data",e.data)("request_id",e.requestID)("labels",e.labels)("user_id",e.userId)("textColor",e.data.styles.colors.text)("customText",e.data.config.cancelRequestText)}}function pt(e,t){if(1&e&&(m._UZ(0,"div",38),m.ALo(1,"safeHtml")),2&e){const e=m.oxw(3);m.Udp("color",e.data.styles.colors.text),m.Q6J("innerHTML",e.data[e.flowName]&&e.data[e.flowName].texts&&e.data[e.flowName].texts.form&&e.data[e.flowName].texts.form.aditionalDescription?m.lcZ(1,3,(null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.aditionalDescription)||""):"",m.oJD)}}function mt(e,t){if(1&e&&(m.ynx(0),m.YNc(1,et,2,9,"belender-form-step",12),m.YNc(2,tt,2,8,"belender-shared-otp-step",13),m.YNc(3,nt,1,7,"belender-success-step",14),m.YNc(4,it,1,3,"belender-duplicated-request-step",15),m.YNc(5,st,1,3,"belender-error-birthday-step",16),m.YNc(6,rt,1,3,"belender-error-expiration-step",16),m.YNc(7,ot,1,3,"belender-error-support-number-step",16),m.YNc(8,at,1,4,"belender-fail-step",17),m.YNc(9,lt,1,4,"belender-abandoned-step",18),m.YNc(10,ct,1,2,"belender-no-service-step",19),m.YNc(11,dt,1,2,"belender-standby-step",19),m.YNc(12,ut,6,2,"div",20),m.YNc(13,ht,1,7,"belender-cancel-request",21),m.YNc(14,pt,2,5,"div",22),m.BQk()),2&e){const e=m.oxw(2);m.xp6(1),m.Q6J("ngIf","form"===e.requestStatus),m.xp6(1),m.Q6J("ngIf","otp_ss"==e.requestStatus||"otp_aeat"==e.requestStatus||"otp_bde"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","success"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","duplicated"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","error-birth-date"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","error-expiration-date"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","error-support-number"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","failed"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","abandoned"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","no-service"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","standby"==e.requestStatus),m.xp6(1),m.Q6J("ngIf","created"!=e.step),m.xp6(1),m.Q6J("ngIf",e.showCancelRequest&&e.data.config.cancelRequest),m.xp6(1),m.Q6J("ngIf","form"===e.requestStatus&&!e.loadingRequestData&&e.data[e.flowName]&&(null==e.data[e.flowName]?null:e.data[e.flowName].showAditionalDescription))}}function ft(e,t){1&e&&m._UZ(0,"belender-disabled-url")}function gt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"div",39)(1,"div",33)(2,"div",40),m._uU(3,"Error!"),m.qZA(),m._UZ(4,"div",41),m.qZA(),m.TgZ(5,"div",42)(6,"button",43),m.NdJ("click",(function(){m.CHM(e);const t=m.oxw(2);return m.KtG(t.error=!1)})),m._uU(7," Ingresar manualmente "),m.qZA()()()}if(2&e){const e=m.oxw(2);m.xp6(4),m.Udp("color",e.data.styles.colors.text),m.Q6J("innerHTML",e.error,m.oJD)}}function _t(e,t){if(1&e&&(m.TgZ(0,"div",4)(1,"div"),m.YNc(2,Ke,3,2,"div",5),m.YNc(3,Xe,2,1,"div",6),m.YNc(4,mt,15,14,"ng-container",3),m.YNc(5,ft,1,0,"belender-disabled-url",3),m.YNc(6,gt,8,3,"div",7),m.qZA()()),2&e){const e=m.oxw();m.xp6(1),m.Gre("h-full w-full relative flex-auto p-0 md:p-3 ",null==e.data||null==e.data.styles?null:e.data.styles.typography,""),m.Udp("background",null==e.data||null==e.data.styles||null==e.data.styles.colors?null:e.data.styles.colors.background),m.xp6(1),m.Q6J("ngIf",e.warningAlert&&"success"!=e.requestStatus),m.xp6(1),m.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"success"===e.requestStatus),m.xp6(1),m.Q6J("ngIf",!e.error&&!e.disableURL),m.xp6(1),m.Q6J("ngIf",!e.error&&e.disableURL),m.xp6(1),m.Q6J("ngIf",!e.loading&&e.error)}}function bt(e,t){if(1&e){const e=m.EpF();m.TgZ(0,"vex-terms",44),m.NdJ("accepted",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){m.CHM(e);const t=m.oxw();return m.KtG(t.handleTermsResponse(!1))})),m.qZA()}if(2&e){const e=m.oxw();m.Q6J("flow",e.flowName)("lang",e.currentLang)("requestID",e.requestID)("requestStatus",e.solicitud?e.solicitud.status_code:"")("allData",e.data)}}function yt(e,t){if(1&e&&(m.TgZ(0,"div",45),m._UZ(1,"mat-progress-spinner",46),m.TgZ(2,"p",47),m._uU(3),m.qZA()()),2&e){const e=m.oxw();m.xp6(3),m.hij(" ",e.loading," ")}}function vt(e,t){if(1&e&&(m.ynx(0),m.TgZ(1,"div",48),m._uU(2),m.qZA(),m.BQk()),2&e){const e=m.oxw();m.xp6(2),m.hij(" TestMode ",e.testMode?"ON":"OFF"," ")}}let wt=class{constructor(e,t,n,i,s,r,o,a,l,d,u,h,m){this.cd=e,this.Activatedroute=t,this.utils=n,this.pinService=i,this.notis=s,this.webhooksService=r,this.flowsS=o,this.customizationStoreService=a,this.deviceInfoService=l,this.customizationService=d,this.dialog=u,this.translationService=h,this.scrollService=m,this.data=null,this.disableActions=!1,this.step="created",this.clientEnviroment="belender",this.showCancelRequest=!1,this._loading=null,this.error=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.lastThreeNumbersPhone=null,this.requestIDFromURL=!1,this.paramsSetted=!1,this.stopPropagationOfSuccess=!1,this.picturesTaken=[],this.disableURL=!1,this.selectedLanguage="es",this.isDni=!0,this.loadingRequestData=!1,this.env=c.N,this.intervalToAskBack=null,this.requestedFromDetail=!1,this.intervalCount=0,this.requestStatus="",this.currentHeight=0,this.isScaled=!1,this.termsOpened=!1,this.flowName="ClavePin",this.labels=p.S.es,this.currentLang="",this.acceptCirbe=!1,this.showTermsDialog=!1,localStorage.getItem("belender-language")&&(this.selectedLanguage=localStorage.getItem("belender-language")),this.deviceInfoDetails$=this.deviceInfoService.deviceInfo$.subscribe((e=>{Object.keys(e).length>0&&(this.deviceInfoDetails=e)}))}ngOnInit(){this.getWindowsScreenOrientation();const e=this;e.setWarningPortals(),this.loading="Obteniendo información de la solicitud",this.checkClientUrl(),this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.initFunctions(),"pro"!=c.N.env&&(l(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),l(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewChecked(){this.getWidgetCardHeight()}get loading(){return this._loading}set loading(e){this._loading=e,null!==e&&this.onLoadingChanged(e)}onLoadingChanged(e){this.scrollUpContent()}initFunctions(){var e=this;return(0,i.Z)((function*(){var t;e.Activatedroute.queryParams.subscribe((t=(0,i.Z)((function*(t){t&&t.request_id&&(e.requestID=t.request_id,console.warn(e.requestID)),t.lang?(e.currentLang=t.lang,e.loading=e.translationService.getFirstLoading(e.currentLang),e.setTranslation()):e.loading=e.labels.loadings.gettingData,e.userId?e.setInitialData(e.userId):e.loading=null})),function(e){return t.apply(this,arguments)}))}))()}setTranslation(){let e=this.translationService.getLabelsTranslated(this.currentLang);e&&(this.labels=e)}getWindowsScreenOrientation(){window.screen&&window.screen.orientation?(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler)):console.warn("Screen Orientation API not supported.")}getWidgetCardHeight(){let e=l("#widget-wrapper").height()||0;this.isScaled$=this.deviceInfoService.isScaled$.subscribe((t=>{this.isScaled=t,this.isScaled&&(e*=1.5)})),this.sendMessageToParent({type:"widgetHeight",data:e})}getOtpType(e){switch(e){case"otp_ss":default:return"otpSS";case"otp_aeat":return"otpAEAT";case"otp_bde":return"otpBDE"}}setRequestStatus(e){if(this.solicitud)this.solicitud.status_code=e;else{let t=new a.l;t.status_code=e,this.solicitud=t}this.setStatus()}checkClientUrl(){const e=window.location.href;this.clientEnviroment=this.getClientFromUrl(e)}getOTPMinLength(){return this.env?"dev"===this.env.env&&"belender"===this.clientEnviroment?6:"qa"===this.env.env||"dev"===this.env.env&&"opendata"===this.clientEnviroment?3:6:6}getClientFromUrl(e){return e.includes("opendata")?"opendata":"belender"}setWarningPortals(){this.flowsS.getFlows().then((e=>{if(e&&e.data&&e.data.length){let t=e.data.find((e=>e.name==this.flowName));t&&t.status&&"OCCASIONAL_FAIL"==t.status&&(this.warningAlert=this.labels.warnings.ocassionalError)}})).catch((e=>{console.error(e)}))}setInitialData(e){var t=this;return(0,i.Z)((function*(){if(yield t.validateRequestIdInUrl(),t.flowConfig=yield t.getFlow(e),t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.funderStyles=t.customizationStoreService.FUNDER_STYLES,t.data={config:t.funderConfig,styles:t.funderStyles,[t.flowName]:t.flowConfig},!t.data.config||!t.data.config.funder_id)return t.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.loading=null,t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.currentLang,t.requestID,t.solicitud?t.solicitud.status_code:"").then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}validateRequestIdInUrl(){var e=this;return(0,i.Z)((function*(){return new Promise((t=>{var n;e.Activatedroute.queryParams.subscribe({next:(n=(0,i.Z)((function*(n){if(n&&n.acceptTerms&&(e.autoAcceptTerms=!0),n&&n.request_id){e.disableURL=!1,e.requestID=n.request_id;let i=yield e.setFormFromVcCode(n.request_id,n);e.requestIDFromURL=!0,t(i)}else n?(e.setParamsToRequest(n),t(null)):(e.loading=null,t(null))})),function(e){return n.apply(this,arguments)}),error:()=>{e.loading=null,t(null)}})}))}))()}setParamsToRequest(e){this.solicitud||this.setRequestStatus("form"),e.success&&(this.stopPropagationOfSuccess=!0),e.accept_cirbe&&(this.acceptCirbe=!0),(e.document_number||e.document)&&!this.solicitud.person_document_number&&(this.solicitud.person_document_number=e.document_number||e.document,this.requestIDFromURL=!0),(e.birth_date||e.birthday)&&!this.solicitud.birth_date&&(this.solicitud.birth_date=e.birth_date||e.birthday,this.requestIDFromURL=!0),(e.document_expiration_date||e.expiration)&&!this.solicitud.person_document_expiration_date&&(this.solicitud.person_document_expiration_date=e.document_expiration_date||e.expiration,this.requestIDFromURL=!0),(e.document_support||e.supportNumber)&&!this.solicitud.document_support&&(this.solicitud.document_support=e.document_support||e.supportNumber,this.requestIDFromURL=!0),e.email&&!this.solicitud.email&&(this.solicitud.email=e.email,this.requestIDFromURL=!0,this.paramsSetted=!0),this.paramsSetted=!0}setFormFromVcCode(e,t){var n=this;return(0,i.Z)((function*(){return n.loading=n.labels.loadings.gettingData,n.loadingRequestData=!0,new Promise((i=>{n.testMode?setTimeout((()=>{n.solicitud=u.VU.data,n.setRequestStatus(n.solicitud.status_code),n.setSubscriptionOfRequest(),n.loading=null,n.loadingRequestData=!1,n.skipCreationOfRequest=!0,n.autoAcceptTerms?n.acceptTerms():n.setParamsToRequest(t),i(n.solicitud)}),4e3):n.pinService.getSolicitudByCode(e).then((e=>{e&&e.data?(n.solicitud=e.data,n.setRequestStatus(n.solicitud.status_code),n.setSubscriptionOfRequest(),n.loading=null,n.skipCreationOfRequest=n.solicitud&&n.solicitud.status_code&&"prerequest"!=n.solicitud.status_code,n.autoAcceptTerms?n.acceptTerms():n.setParamsToRequest(t)):n.loading=null,n.loadingRequestData=!1,i(n.solicitud||null)})).catch((e=>{n.loading=null,n.loadingRequestData=!1,i(null)}))}))}))()}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e,this.currentHeight),window.top.postMessage(e,"*")}handlePusherNotification(e){if(e){if(this.sendMessageToParent({type:"websocket",data:e}),this.dataFromFirebase=e,e&&e.widget_url&&(this.widgetUrl=e.widget_url),e&&e.widget_url_boxed&&(this.widgetUrlBoxed=e.widget_url_boxed),this.dataFromFirebase){if(this.dataFromFirebase.hasOwnProperty("match_phone")&&!this.dataFromFirebase.match_phone)return void this.handleBadPhone();this.dataFromFirebase.person_last_three_phone_number&&(this.lastThreeNumbersPhone=this.dataFromFirebase.person_last_three_phone_number),this.dataFromFirebase.status_code&&(("consent_process_completed"===this.dataFromFirebase.status_code||"waiting_login_bde"===this.dataFromFirebase.status_code||"waiting_otp_bde"===this.dataFromFirebase.status_code)&&this.disconnectWebsocket(),this.setRequestStatus(this.dataFromFirebase.status_code))}this.loading=null}}handleBadPhone(){this.disconnectWebsocket(),this.loading=this.labels.loadings.validatingData,this.pinService.noMatchPhone({request_id:this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID,user_id:this.userId}).then((e=>{setTimeout((()=>{this.solicitud||(this.solicitud=new a.l,this.setRequestStatus(this.solicitud.status_code)),e&&e.data&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code)),this.loading=null}),3e3)})).catch((e=>{this.showAlert("Error!",e),setTimeout((()=>{this.solicitud||(this.solicitud=new a.l,this.setRequestStatus(this.solicitud.status_code)),this.setRequestStatus("failed_without_retry"),this.loading=null}),1e3)}))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==c.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==c.N.env&&(e="wss://notifications.belender.net"),c.N.notificationsBaseUrl&&(e=c.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),n&&t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}setIsDni(e){this.isDni=e}setSubscriptionOfRequestOld(){}sendNewData(e){this.loading=this.labels.loadings.sendingData,this.pinService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e,"error"),this.loading=null):e&&"success"==e.status&&(this.loading=this.labels.loadings.validatingData,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error,"error")}))}testNoti(e){this.showAlert("Titleeee","messsaggeee",e)}showAlert(e,t,n){this.loading=null;let i=this.getFunderIconType(n);this.notis.showAlert(e,t,i)}getFunderIconType(e){if(!e||!this.funderStyles)return"error";switch(e){case"error":return this.funderStyles.errorIcon||e;case"success":return this.funderStyles.successIcon||e;case"warning":return this.funderStyles.warningIcon||e;case"info":return this.funderStyles.infoIcon||e;default:return e}}setNoService(e){this.loading=this.labels.loadings.validatingData,e.user_id=this.userId,e.package_id=this.packId,this.requestID&&(e.request_id=this.requestID),this.pinService.addSolicitud(e).then((e=>{e.data&&(this.requestID=e.data.request_id),this.pinService.setNoService({request_id:this.requestID}).then((()=>{this.setRequestStatus("no_service"),this.loading=null,this.cd.markForCheck()})).catch((e=>{this.setRequestStatus("no_service"),this.loading=null,this.cd.markForCheck()}))}))}validateRequest(e){e.user_id=this.userId,e.package_id=this.packId,this.loading=this.labels.loadings.validatingData,this.formComponent&&this.formComponent.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0},{value:!0}),this.pinService.checkService(e).then((t=>{if(t&&t.status&&"success"==t.status)this.gotoTerms(e);else if(t.message){let n=this.parseErrorResponse(t.message);"no-service"==n.title?this.setNoService(e):(this.notis.showAlert(n.title,n.description),this.loading=null),console.log("handle code: ",n.code),this.handleDisableInputs(n.code)}else this.setNoService(e)})).catch((t=>{if(console.error(t),t.message){let n=this.parseErrorResponse(t.message);"no-service"!=n.title?(this.notis.showAlert(n.title,n.description),this.loading=null):(this.pinService.addSolicitud(e).then((e=>{e.data&&(this.requestID=e.data.request_id),this.pinService.setNoService({request_id:this.requestID}).then((()=>{this.setRequestStatus("no_service"),this.loading=null})).catch((e=>{this.setRequestStatus("no_service"),this.loading=null}))})),this.loading=null,this.cd.markForCheck()),console.log("handle code: ",n.code),this.handleDisableInputs(n.code)}else this.notis.showAlert("Error indefinido!",t),this.loading=null,this.cd.markForCheck()}))}handleDisableInputs(e){!e||setTimeout((()=>{"venc"===e&&this.formComponent&&this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),"sop"===e&&this.formComponent&&this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),"nac"===e&&this.formComponent&&this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),this.cd.markForCheck()}),1e3)}parseErrorResponse(e){if(Array.isArray(e)){let t="";return e.forEach((e=>{t+=e+" "})),{title:this.labels.warnings.errorSomeData,description:t}}return"does not have pin service"==e.toLowerCase()||"does not have clave pin service"==e.toLowerCase()?{title:"no-service",description:this.labels.warnings.noPinService}:"document number invalid."==e.toLowerCase()?{title:this.labels.warnings.wrongDni,description:this.labels.warnings.wrongDniDesc}:"Incorrect support number"==e.toLowerCase()?{title:this.labels.warnings.error,code:"sop",description:this.labels.warnings.wrongSupport}:"incorrect date"==e.toLowerCase()?this.isDni?{title:this.labels.warnings.wrongDate,code:"venc",description:this.labels.warnings.wrongDateDesc}:{title:this.labels.warnings.wrongDate,code:"nac",description:this.labels.warnings.wrongDateDesc}:{title:"Error!",description:e}}gotoTerms(e){e.user_id=this.userId,e.package_id=this.packId,this.acceptCirbe&&(e.add_cirbe=!0),this.requestID&&(e.request_id=this.requestID),this.loading=this.labels.loadings.sendingData,this.testMode?setTimeout((()=>{this.solicitud=new a.l,this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=null}),4e3):this.skipCreationOfRequest?(this.acceptTerms(),this.setSubscriptionOfRequest()):this.pinService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?t.message&&(this.solicitud=e,400==t.code&&"Does not have Pin service"==t.message?(t.data&&(this.requestID=t.data.request_id),this.pinService.setNoService({request_id:this.requestID}).then((()=>{this.setRequestStatus("no_service"),this.loading=null})).catch((e=>{this.setRequestStatus("no_service"),this.loading=null}))):400==t.code&&"Incorrect support number"==t.message?(this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongSupport),this.setRequestStatus("form")):400==t.code&&"Incorrect date"==t.message?(this.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc),this.setRequestStatus("form")):(this.setRequestStatus("form"),this.showAlert("Error!",t.message))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,t.data?.detail&&this.setSteps(t.data.detail),this.setRequestStatus(this.solicitud.status_code),this.setSubscriptionOfRequest(),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.errorMessage&&this.showAlert(this.labels.warnings.error,e.errorMessage)}))}setSteps(e){if(this.steps){let e=this.steps.findIndex((e=>e.isCurrent));this.steps[e].isCompleted=!0,this.steps[e].isCurrent=!1,this.steps[e+1]&&(this.steps[e+1].isCurrent=!0)}else e&&(this.steps=JSON.parse(JSON.stringify(e)),this.steps.forEach((e=>{e.isCompleted=!1,e.isCurrent=!1})),this.steps[0].isCurrent=!0);this.cd.markForCheck()}acceptTerms(e=!0){let t={user_id:this.userId,request_id:this.requestID,terms_and_conditions:!0,opening:this.termsOpened?1:0};Object.keys(this.deviceInfoDetails).length>0&&(t={...t,ip:this.deviceInfoDetails.ip,device:this.deviceInfoDetails.device,os:`${this.deviceInfoDetails.os} ${this.deviceInfoDetails.os_version}`,resolution:this.deviceInfoDetails.screen}),e&&(this.loading=this.labels.loadings.validatingData),this.pinService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?e.message&&"You have a request in progress"==e.message?location.pathname.indexOf("widget-boxed")>-1?location.assign(e.response.widget_url_boxed):location.assign(e.response.widget_url):e.message&&"Invalid request status: stand_by"==e.message?this.setRequestStatus("stand_by"):this.showAlert("Error!",e.message?e.message:e):e&&"success"==e.status&&(this.setSubscriptionOfRequest(),e.data&&e.data.next_step_detail&&e.data.next_step_detail.portal&&"Seguridad Social"===e.data.next_step_detail.portal?this.setRequestStatus("waiting_otp_seguridad_social"):e.data&&e.data.next_step_detail&&e.data.next_step_detail.portal&&"AEAT"===e.data.next_step_detail.portal?this.setRequestStatus("waiting_otp_aeat"):e.data&&e.data.next_step_detail&&e.data.next_step_detail[0]&&e.data.next_step_detail[0].portal&&"Seguridad Social"===e.data.next_step_detail[0].portal?this.setRequestStatus("waiting_otp_seguridad_social"):e.data&&e.data.next_step_detail&&e.data.next_step_detail[0]&&e.data.next_step_detail[0].portal&&"AEAT"===e.data.next_step_detail[0].portal?this.setRequestStatus("waiting_otp_aeat"):e.data&&e.data.next_step_detail&&e.data.next_step_detail.portal&&"Banco de España"===e.data.next_step_detail.portal?(this.setRequestStatus("waiting_otp_bde"),this.disconnectWebsocket()):this.setRequestStatus(e.data.status_code),this.loading=null,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}isBdeStatus(){let e=this.solicitud?this.solicitud.status_code:null;return!!e&&("waiting_otp_bde"===e||"waiting_login_bde"===e||"invalid_otp_bde"===e)}sendOtpToBde(e){this.disconnectWebsocket(),this.pinService.sendOTPToBde(e,"qa"===c.N.env).then((e=>{e.status&&"error"==e.status?(e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.showAlert(this.labels.warnings.error,this.labels.warnings.noOtp):this.showAlert("Error!",e.message?e.message:e),this.loading=null):e?(console.warn("handle success!"),e.data?e.data.consent_process_completed=!0:e.consent_process_completed=!0,this.handleRequestStatus(e.data?e.data:e),this.cd.markForCheck()):this.loading=null})).catch((e=>{this.showAlert("Error!",e&&e.error?e.error:e),this.loading=null}))}requestOTP(e){this.loading="Enviando información..";let t={user_id:this.userId,request_id:this.requestID,code:e.code};this.isBdeStatus()?this.sendOtpToBde(t):this.pinService.sendOTP(t,"qa"===c.N.env).then((e=>{e.status&&"error"==e.status?(e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.showAlert(this.labels.warnings.error,this.labels.warnings.noOtp):this.showAlert("Error!",e.message?e.message:e),this.loading=null):e&&"success"==e.status?(this.handleRequestStatus(e.data?e.data:e),this.setSteps(),this.cd.markForCheck()):this.loading=null})).catch((e=>{this.showAlert("Error!",e&&e.error?e.error:e),this.loading=null}))}handleRequestStatus(e){let t=new a.l;this.solicitud&&(t=this.solicitud),e&&e.consent_process_completed?(this.requestedFromDetail=!0,t.status_code="consent_process_completed",this.solicitud=t,this.sendMessageToParent({type:"response",data:t}),setTimeout((()=>{this.disconnectWebsocket()}),3e3),this.data[this.flowName].showDocumentsOnSuccess&&!this.intervalToAskBack&&this.initIntervalToAskBack()):(this.otpComponent&&this.otpComponent.resetOtpNumber(),e.otp_status||e.next_step_detail?e.otp_status&&"VALID"===e.otp_status?Array.isArray(e.next_step_detail)?"Seguridad Social"===e.next_step_detail[0].portal?t.status_code="waiting_otp_seguridad_social":"AEAT"===e.next_step_detail[0].portal?t.status_code="waiting_otp_aeat":"Banco de España"===e.next_step_detail[0].portal?(this.disconnectWebsocket(),t.status_code="waiting_otp_bde"):t.status_code=e.status_code:Array.isArray(e.next_step_detail)||("Seguridad Social"===e.next_step_detail.portal?t.status_code="waiting_otp_seguridad_social":"AEAT"===e.next_step_detail.portal?t.status_code="waiting_otp_aeat":"Banco de España"===e.next_step_detail.portal?(this.disconnectWebsocket(),t.status_code="waiting_otp_bde"):t.status_code=e.status_code):e.otp_status&&"INVALID"===e.otp_status&&(t.status_code=e.status_code,this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)):e.otp_status&&"INVALID"===e.otp_status&&this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)),this.solicitud=t,this.setRequestStatus(this.solicitud.status_code),this.loading=null}askToBack(){this.pinService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code),this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}gotoErrorPhone(){}setBirthDate(e){}setExpiration(e){}setSupportNumber(e){}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.pinService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}retryRequest(e){let t={request_id:(this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID)||e,user_id:this.userId};this.loading=this.labels.loadings.resendingRequest,this.setSubscriptionOfRequest(),this.pinService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}newRequest(e){this.setRequestStatus("created")}disconnectWebsocket(){this.socket&&this.socket.close()}initIntervalToAskBack(){!this.solicitud||!this.solicitud.request_id||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(this.solicitud.request_id),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack)}askDetailToBack(e){let t=JSON.parse(JSON.stringify(this.solicitud.status_code));e||this.requestID?this.pinService.getSolicitudByCode(e).then((e=>{e&&e.data&&t!=e.data.status_code&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code))})).catch((e=>{this.loading=null,this.loadingRequestData=!1})):this.stopInterval()}setStatus(){if(this.showCancelRequest=!0,this.solicitud){if(this.solicitud){let e=this.solicitud.status_code;if("waiting_documents"===e||"saved_otp"===e)return void(this.loading=" ");let t=h[e];t&&("success"===t&&this.funderConfig&&this.funderConfig.infiniteLoopInCompleted&&(this.loading=" "),("abandoned"===t||"failed"===t)&&(this.showCancelRequest=!1),this.requestStatus=t,this.scrollUpContent())}}else this.requestStatus="form";this.cd.markForCheck()}scrollUpContent(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),300)}sendRetry(){}setCancel(e){this.setRequestStatus(e)}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,e&&(this.termsOpened=!0,this.formComponent.setTermsCheck(!0))}pictureTaken(e){this.picturesTaken.push(e._imageAsDataUrl)}getIfShowLogo(){return("loading"!=this.requestStatus&&"success"!=this.requestStatus&&!this.loading||!this.funderConfig?.infiniteLoopInCompleted)&&this.funderStyles?.withLogo}};wt.ɵfac=function(e){return new(e||wt)(m.Y36(m.sBO),m.Y36(f.gz),m.Y36(g.F),m.Y36(_.v),m.Y36(b.T),m.Y36(y.t),m.Y36(v.s),m.Y36(w.r),m.Y36(x.H),m.Y36(C.w),m.Y36(k.uw),m.Y36(T.D),m.Y36(M.a))},wt.ɵcmp=m.Xpm({type:wt,selectors:[["belender-widget-pin"]],viewQuery:function(e,t){if(1&e&&(m.Gf(Ge,5),m.Gf($e,5),m.Gf(Ge,5)),2&e){let e;m.iGM(e=m.CRH())&&(t.formComponent=e.first),m.iGM(e=m.CRH())&&(t.otpComponent=e.first),m.iGM(e=m.CRH())&&(t.theDiv=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[m._Bn([{provide:r.o2,useValue:{appearance:"standard"}}])],decls:4,vars:4,consts:[["id","widget-wrapper","class","h-full widget-belender",4,"ngIf"],[3,"flow","lang","requestID","requestStatus","allData","accepted","cancelled",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[4,"ngIf"],["id","widget-wrapper",1,"h-full","widget-belender"],["class","flex justify-start px-4 py-3 items-center font-bold gap-3 text-md bg-amber-500/20 rounded-sm border border-amber-500 text-amber-500",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"flex","justify-start","px-4","py-3","items-center","font-bold","gap-3","text-md","bg-amber-500/20","rounded-sm","border","border-amber-500","text-amber-500"],["svgIcon","mat:warning"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"userId","flowName","lang","requestIDFromURL","texts","data","labels","solicitud","goToTerms","nextStep","isDni",4,"ngIf"],[3,"otpType","flowType","data","labels","solicitud","minLength","lastThreeNumbersPhone","texts","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","flowName","packId","userId","requestID","texts",4,"ngIf"],[3,"data","labels","currentRequest","newRequest",4,"ngIf"],[3,"data","labels","texts","nextStep",4,"ngIf"],[3,"data","labels","solicitud","texts","retryRequest","newRequest",4,"ngIf"],[3,"data","labels","texts","solicitud","retryRequest",4,"ngIf"],[3,"texts","data",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"flowType","data","request_id","labels","user_id","textColor","customText","updateStatusCode",4,"ngIf"],["class","subheading-1 p-4 custom-html",3,"color","innerHTML",4,"ngIf"],[3,"userId","flowName","lang","requestIDFromURL","texts","data","labels","solicitud","goToTerms","nextStep","isDni"],["formStep",""],[3,"otpType","flowType","data","labels","solicitud","minLength","lastThreeNumbersPhone","texts","resendOTP","errorPhone","nextStep"],["otpStep",""],[3,"data","labels","flowName","packId","userId","requestID","texts"],[3,"data","labels","currentRequest","newRequest"],[3,"data","labels","texts","nextStep"],[3,"data","labels","solicitud","texts","retryRequest","newRequest"],[3,"data","labels","texts","solicitud","retryRequest"],[3,"texts","data"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[3,"flowType","data","request_id","labels","user_id","textColor","customText","updateStatusCode"],[1,"subheading-1","p-4","custom-html",3,"innerHTML"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","lang","requestID","requestStatus","allData","accepted","cancelled"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(m.YNc(0,_t,7,10,"div",0),m.YNc(1,bt,1,5,"vex-terms",1),m.YNc(2,yt,4,1,"div",2),m.YNc(3,vt,3,1,"ng-container",3)),2&e&&(m.Q6J("ngIf",t.data&&t.data.styles&&t.data.styles.colors&&!t.loading),m.xp6(1),m.Q6J("ngIf",t.showTermsDialog),m.xp6(1),m.Q6J("ngIf",(t.loading||"loading"===t.requestStatus)&&!t.error),m.xp6(1),m.Q6J("ngIf",t.testMode))},dependencies:[S.O5,I.L,O.q,L.y,P.i,A.Hw,E.lW,D.Ou,J,K,Pe,Ee,Ye,Fe,Ze,je,Je,We,Z.z],styles:[".widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.card[_ngcontent-%COMP%]{transition:all .2s ease;overflow:hidden;width:500px;max-width:100%;margin:0 auto}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}.webcam-wrapper[_ngcontent-%COMP%]{position:relative}.webcam-overlay[_ngcontent-%COMP%]{position:absolute;z-index:99;width:500px;top:0;left:0;width:100%;height:100%;justify-content:center}.webcam-overlay[_ngcontent-%COMP%] .overlay[_ngcontent-%COMP%]{background:url(/assets/img/exclude.png);width:100%;height:100%;background-repeat:no-repeat;background-size:cover;opacity:.7;max-width:500px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;top:0;left:0;background:#fff}"],data:{animation:[d.$]}}),wt=(0,s.gn)([(0,o.c)()],wt)},1916:(e,t,n)=>{n.r(t),n.d(t,{PinModule:()=>L});var i=n(6895),s=n(6383),r=n(5592),o=n(4006),a=n(3798),l=n(9391),c=n(182),d=n(7367),u=n(3238),h=n(5895),p=n(4246),m=n(9299),f=n(6e3),g=n(920),_=n(4650);const b=[{path:":idUser",component:g.n},{path:":idUser/:packID",component:g.n}];let y=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=_.oAB({type:e}),e.ɵinj=_.cJS({imports:[m.Bz.forChild(b),m.Bz,f.d8]}),e})();var v=n(7489),w=n(6981),x=n(1129),C=n(9476),k=n(3295),T=n(1145),M=n(3300),S=n(865),I=n(3033),O=n(5028);let L=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=_.oAB({type:e}),e.ɵinj=_.cJS({providers:[v.v,l.o,d.w,c.t,h.T,p.t,{provide:u.Ad,useValue:"es-ES"}],imports:[y,i.ez,s.G,r.J,o.u5,o.UX,a.a,w.x,x.n,C.F,k.g,T.j,M.C,S.q,I.d,O.q]}),e})()},8364:(e,t,n)=>{n.d(t,{T:()=>Gt});var i=n(5861),s=n(7582),r=n(9549),o=n(9933),a=n(5762),l=n(8259),c=n(2340),d=n(667);const u={created:"form",form:"form",terms_and_conditions:"form",waiting_otp_seguridad_social:"otp",waiting_login_seguridad_social:"otp",invalid_otp_seguridad_social:"otp",abandoned_after_bad_phone:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",all_documents_downloaded:"success",partial_documents_downloaded:"success",consent_process_completed:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",waiting_documents:"success",failed_with_retry:"failed",failed_without_retry:"failed",failed_documents_downloaded:"failed",consent_process_canceled:"failed",no_service:"no-service",no_sms_service:"no-service",no_clave_pin_service:"no-service",stand_by:"standby","no-phone":"no-phone",no_phone:"no-phone","no-more-phone":"no-phone",no_more_phone:"no-phone",bad_phone:"bad-phone",error_expiration_date:"error-expiration-date",error_birth_date:"error-birth-date",error_support_number:"error-support-number",duplicated:"duplicated"};var h=n(1931),p=n(4650),m=n(9299),f=n(5089),g=n(5601),_=n(7367),b=n(8460),y=n(5895),v=n(5206),w=n(7489),x=n(9045),C=n(5412),k=n(7308),T=n(3687),M=n(6895),S=n(7392),I=n(9101),O=n(1572),L=n(3364),P=n(1760),A=n(6830),E=n(4302),D=n(9112),N=n(9382),Y=n(4006),q=n(9391),R=n(3046),F=n(342),Z=n(3731);function U(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",5),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.success.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function H(e,t){if(1&e&&(p.TgZ(0,"div",6),p._UZ(1,"div",7)(2,"div",8),p.ALo(3,"safeHtml"),p.qZA()),2&e){const e=p.oxw();p.xp6(1),p.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),p.Q6J("innerHTML",e.texts.success.title,p.oJD),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(3,8,e.texts.success.description||""),p.oJD)}}function j(e,t){if(1&e&&p._UZ(0,"widget-documents",9),2&e){const e=p.oxw();p.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function z(e,t){if(1&e&&(p.TgZ(0,"div",10),p._UZ(1,"mat-progress-spinner",11),p.TgZ(2,"p",12),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Q6J("value",0),p.xp6(2),p.Oqu(e.loading)}}const B=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function J(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",13)(1,"button",14),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.gotoRedirect())})),p._uU(2),p.qZA()()}if(2&e){const e=p.oxw();p.Q6J("ngClass",p.kEZ(8,B,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),p.xp6(1),p.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let V=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.loading=null,this.showDocuments=!1}ngOnInit(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].automaticRedirectCallBack&&this.data[this.flowName].callBackUrl?setTimeout((()=>{location.assign(this.data[this.flowName].callBackUrl)}),2e3):this.data&&this.data[this.flowName]&&this.data[this.flowName].showDocumentsOnSuccess&&(this.showDocuments=!0)}save(){}gotoRedirect(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(g.M),p.Y36(q.o),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",loading:"loading",requestID:"requestID",packId:"packId",userId:"userId",flowName:"flowName",labels:"labels"},decls:5,vars:5,consts:[[3,"firstOption","logoUrl",4,"ngIf"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[3,"userId","packId","requestID",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],["class","flex items-center gap-2 py-4 flex-col md:flex-row",3,"ngClass",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(p.YNc(0,U,1,2,"belender-widget-logo",0),p.YNc(1,H,4,10,"div",1),p.YNc(2,j,1,3,"widget-documents",2),p.YNc(3,z,4,2,"div",3),p.YNc(4,J,3,12,"div",4)),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(1),p.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted&&!t.loading),p.xp6(1),p.Q6J("ngIf",t.showDocuments),p.xp6(1),p.Q6J("ngIf",t.loading),p.xp6(1),p.Q6J("ngIf",t.data&&t.data[t.flowName]&&t.data[t.flowName].enableUrlCallBack&&!t.data[t.flowName].automaticRedirectCallBack))},dependencies:[M.mk,M.O5,I.lW,O.Ou,R.X,F.A,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Q=n(4144);function W(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",7),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.errorPhone.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function G(e,t){if(1&e&&(p.TgZ(0,"form",8)(1,"mat-form-field",9)(2,"mat-label"),p._uU(3),p.qZA(),p._UZ(4,"input",10),p.qZA()()),2&e){const e=p.oxw();p.Q6J("formGroup",e.form),p.xp6(3),p.Oqu(e.labels.phone)}}const $=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function K(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",11)(1,"button",12),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.no())})),p._uU(2),p.qZA(),p.TgZ(3,"button",13),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.next())})),p._uU(4),p.qZA()()}if(2&e){const e=p.oxw();p.Q6J("ngClass",p.kEZ(12,$,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),p.xp6(1),p.Udp("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",e.labels.warnings.dontHavePhone," "),p.xp6(1),p.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.Q6J("disabled",e.form.invalid),p.xp6(1),p.hij(" ",e.labels.actions.next," ")}}let X=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.cd=n,this.notifications=i,this.loading=null,this.noPhone=new p.vpe(null),this.nextStep=new p.vpe(null)}ngOnInit(){this.form=this.fb.group({phone:[null,[Y.kI.required,Y.kI.maxLength(9),Y.kI.minLength(9)]]})}next(){this.nextStep.emit(this.form.get("phone").value)}no(){this.noPhone.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(p.sBO),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-phone-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{noPhone:"noPhone",nextStep:"nextStep"},decls:9,vars:13,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","w-full",3,"formGroup",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"mb-4","w-full","md:max-w-[500px]"],["maxlength","9","formControlName","phone","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"bg-red-500","text-red-50","px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"click"],["mat-flat-button","","type","button",1,"px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(p.YNc(0,W,1,2,"belender-widget-logo",0),p.TgZ(1,"div",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p._UZ(6,"br"),p.YNc(7,G,5,2,"form",5),p.qZA(),p.YNc(8,K,5,16,"div",6),p.qZA()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.Q6J("innerHTML",t.texts.errorPhone.title,p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(5,11,t.texts.errorPhone.description),p.oJD),p.xp6(3),p.Q6J("ngIf",!t.data.config.noRetryInBadPhone),p.xp6(1),p.Q6J("ngIf",!t.data.config.noRetryInBadPhone))},dependencies:[M.mk,M.O5,I.lW,r.KE,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.nD,Y.sg,Y.u,R.X,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ee(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",3),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.fail.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function te(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",10)(1,"button",11),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.retry())})),p._uU(2),p.qZA()()}if(2&e){const e=p.oxw(2);p.xp6(1),p.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",e.labels.actions.retry," ")}}const ne=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function ie(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",12)(1,"button",11),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.newRequest())})),p._uU(2),p.qZA()()}if(2&e){const e=p.oxw(2);p.Q6J("ngClass",p.kEZ(8,ne,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),p.xp6(1),p.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.Oqu(e.labels.actions.newRequest)}}function se(e,t){if(1&e&&(p.TgZ(0,"div",4)(1,"div",5),p._UZ(2,"div",6)(3,"div",7),p.ALo(4,"safeHtml"),p.qZA(),p.YNc(5,te,3,7,"div",8),p.YNc(6,ie,3,12,"div",9),p.qZA()),2&e){const e=p.oxw();p.xp6(2),p.Q6J("innerHTML",e.texts.fail.title,p.oJD),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(4,6,e.texts.fail.description),p.oJD),p.xp6(2),p.Q6J("ngIf",e.solicitud&&"failed_with_retry"==e.solicitud.status_code),p.xp6(1),p.Q6J("ngIf",e.solicitud&&"failed_documents_downloaded"==e.solicitud.status_code)}}function re(e,t){if(1&e&&(p.TgZ(0,"div",13),p._UZ(1,"mat-progress-spinner",14),p.TgZ(2,"p",15),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Q6J("value",0),p.xp6(2),p.Oqu(e.loading)}}let oe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.loading=null,this.retryOp=new p.vpe(null),this.newReq=new p.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(g.M),p.Y36(q.o),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",loading:"loading",labels:"labels"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:3,vars:3,consts:[[3,"firstOption","logoUrl",4,"ngIf"],["class","animated fadeIn fixed-content",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"animated","fadeIn","fixed-content"],[1,"px-2","py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(p.YNc(0,ee,1,2,"belender-widget-logo",0),p.YNc(1,se,7,8,"div",1),p.YNc(2,re,4,2,"div",2)),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(1),p.Q6J("ngIf",!t.loading),p.xp6(1),p.Q6J("ngIf",t.loading))},dependencies:[M.mk,M.O5,I.lW,O.Ou,R.X,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var ae=n(5439),le=n.n(ae),ce=(n(6866),n(3238)),de=n(3755),ue=n(3746),he=n(2932),pe=n(4246),me=n(1763),fe=n(5696),ge=n(1094);const _e=["termsCheckbox"],be=["assignmentCheckbox"];function ye(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",22),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.form.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function ve(e,t){if(1&e&&(p.TgZ(0,"mat-error"),p._uU(1),p.qZA()),2&e){const e=p.oxw();p.xp6(1),p.hij(" ",e.errorDNI," ")}}function we(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," El formato debe ser DD/MM/AAAA "),p.qZA())}function xe(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," Fecha inválida "),p.qZA())}function Ce(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," Debe ser mayor de 18 años "),p.qZA())}function ke(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," El formato debe ser DD/MM/AAAA "),p.qZA())}function Te(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," Fecha inválida "),p.qZA())}function Me(e,t){1&e&&(p.TgZ(0,"mat-error"),p._uU(1," Debe ser mayor de 18 años "),p.qZA())}function Se(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"mat-form-field",23)(1,"mat-label"),p._uU(2),p.qZA(),p._UZ(3,"input",24),p.TgZ(4,"mat-hint")(5,"a",25),p.NdJ("click",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.gotoExpirationDate(t))})),p.TgZ(6,"u"),p._uU(7),p.qZA()()(),p.YNc(8,ke,2,0,"mat-error",8),p.YNc(9,Te,2,0,"mat-error",8),p.YNc(10,Me,2,0,"mat-error",8),p.qZA()}if(2&e){const e=p.oxw();let t,n,i;p.xp6(2),p.Oqu(e.labels.expiration),p.xp6(5),p.Oqu(e.labels.findExpiration),p.xp6(1),p.Q6J("ngIf",null==(t=e.form.get("document_expiration"))?null:t.hasError("invalidFormat")),p.xp6(1),p.Q6J("ngIf",null==(n=e.form.get("document_expiration"))?null:n.hasError("invalidDate")),p.xp6(1),p.Q6J("ngIf",null==(i=e.form.get("document_expiration"))?null:i.hasError("underAge"))}}function Ie(e,t){if(1&e&&(p.TgZ(0,"mat-form-field",23)(1,"mat-label"),p._uU(2),p.qZA(),p._UZ(3,"input",26),p.qZA()),2&e){const e=p.oxw();p.xp6(2),p.Oqu(e.labels.support)}}function Oe(e,t){if(1&e&&(p.TgZ(0,"div",27)(1,"mat-form-field",6)(2,"mat-label"),p._uU(3),p.qZA(),p._UZ(4,"input",28),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),p.xp6(2),p.Oqu(e.labels.email),p.xp6(1),p.s9C("tabindex",e.disabledInputs.email?-1:1),p.s9C("placeholder",e.labels.inputEmail)}}function Le(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",29)(1,"belender-checkbox",30,31),p.NdJ("changeCheckbox",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.setTerms(t))})),p.TgZ(3,"belender-terms-and-policy-links",32),p.NdJ("goToTerms",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.gotoTermsAndConditions(t))})),p.qZA()()()}if(2&e){const e=p.oxw();p.xp6(1),p.Q6J("color",e.data.styles.colors.title),p.xp6(2),p.Q6J("userId",e.userId)("lang",e.lang)("flowName",e.flowName)("data",e.data)("showPolicyLink",null==e.data?null:e.data.config.showPolicyLink)("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Pe(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",33)(1,"belender-checkbox",34,35),p.NdJ("changeCheckbox",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.setAssignment(t))})),p._UZ(3,"div",36),p.qZA()()}if(2&e){const e=p.oxw();p.xp6(1),p.Q6J("color",e.data.styles.colors.title),p.xp6(2),p.Q6J("innerHTML",e.data[e.flowName]&&e.data[e.flowName].texts&&e.data[e.flowName].texts.dataAssignmentText?e.data[e.flowName].texts.dataAssignmentText:null==e.data?null:e.data.config.dataAssignmentText,p.oJD)}}function Ae(e,t){if(1&e&&(p.TgZ(0,"div",37),p._UZ(1,"mat-icon",38),p._uU(2),p.qZA()),2&e){const e=p.oxw();p.xp6(2),p.hij(" ",e.labels.warnings.haveToReadTerms," ")}}function Ee(e,t){if(1&e&&(p.TgZ(0,"div",39),p._UZ(1,"mat-icon",38),p._uU(2),p.qZA()),2&e){const e=p.oxw();p.xp6(2),p.hij(" ",e.errorDNI," ")}}function De(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",40),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.goBack())})),p._uU(1),p.qZA()}if(2&e){const e=p.oxw();p.Udp("border-radius",e.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",e.labels.actions.back," ")}}function Ne(e,t){if(1&e&&(p.TgZ(0,"div",41),p._UZ(1,"mat-progress-spinner",42),p.TgZ(2,"p",43),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Q6J("value",0),p.xp6(2),p.hij(" ",e.loading," ")}}const Ye=function(e){return{"dont-show-data":e}},qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Re=(()=>{class e{constructor(e,t,n,i,s,r){this.fb=e,this.utils=t,this.cd=n,this.widgetUtils=i,this.dialog=s,this.customService=r,this.next=new p.vpe(null),this.goTerms=new p.vpe(null),this.goIntro=new p.vpe(null),this.acceptTerms=!1,this.assignment=!1,this.termsReaded=!1,this.isDni=!1,this.isNie=!1,this.errorDNI=null,this.disabledInputs={document_number:!1,birth_date:!1,email:!1,phone:!1},this.noValidate=!1,this.testMode=!0,this.lang=""}ngOnInit(){this.solicitud?(this.noValidate="terms_and_conditions"==this.solicitud.status_code,this.setForm(this.solicitud)):this.setForm(null)}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setForm(e){console.warn("setForm");let t=e?e.person_document_number||e.dni||e.document_number:null,n=e&&e.person_birth_date?le()(e.person_birth_date).format("DD/MM/YYYY"):null,i=e&&e.birth_date?le()(e.birth_date).format("DD/MM/YYYY"):n,s=e?e.person_phone||e.phone:null,r=e?e.person_email||e.email:null;t&&this.setRegex(t);const o=this;o.form=o.fb.group(o.data&&o.data.config&&o.data.config.followMail?{document_number:[t||null,o.noValidate?[]:[Y.kI.required,Y.kI.maxLength(9),o.regexDNI()]],birth_date:[i||null,o.noValidate?[]:[Y.kI.required,(0,he.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],type:["DNI"],phone:[s||"",o.noValidate?[]:[Y.kI.required,Y.kI.maxLength(9),Y.kI.minLength(9)]],email:[r||null,o.noValidate?[]:[Y.kI.required,Y.kI.email]],document_expiration:[null,[(0,he.s)({checkFormat:!0,checkDate:!0})]],support_number:[null]}:{document_number:[t||null,o.noValidate?[]:[Y.kI.required,Y.kI.maxLength(9),o.regexDNI()]],birth_date:[i||null,o.noValidate?[]:[Y.kI.required,(0,he.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],type:["DNI"],phone:[s||"",o.noValidate?[]:[Y.kI.required,Y.kI.maxLength(9),Y.kI.minLength(9)]],email:[r||null],document_expiration:[null,[(0,he.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],support_number:[null]}),this.form.markAsUntouched(),this.form.updateValueAndValidity(),o.requestIDFromURL&&o.disableEnableInputs(t,n,s,r)}forceEnableDisableInputs(e,t,n,i){this.disableEnableInputs(e?e.value:this.disabledInputs.document_number,t?t.value:this.disabledInputs.birth_date,n?n.value:this.disabledInputs.phone,i?i.value:this.disabledInputs.email)}disableEnableInputs(e,t,n,i){this.disabledInputs={document_number:e||!1,birth_date:t||!1,email:i||!1,phone:n||!1},console.warn("this.disabledInputs",this.disabledInputs)}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}setRegex(e){if(!e)return;let t=this.widgetUtils.ValidateIDType(e);t&&t.type?("dni"===t.type?(this.isDni=!0,this.errorDNI=t.valid?null:"Debes ingresar un DNI válido!"):this.isDni=!1,"nie"===t.type?(this.isNie=!0,this.errorDNI=t.valid?null:"Debes ingresar un NIE válido!"):this.isNie=!1):(this.isDni=!1,this.isNie=!1,this.errorDNI="Debes ingresar un DNI o NIE válido!"),this.cd.markForCheck()}setTerms(e){this.acceptTerms=e}setAssignment(e){this.assignment=e}getIfValid(){return!!this.data.config.hideCheckLegal||this.acceptTerms}getFormsValid(){let e=!this.form.invalid,t=this.form.get("document_number").value;return t?this.setRegex(t):e=!1,!this.isDni&&!this.isNie&&(this.disabledInputs.document_number=!1,e=!1),this.errorDNI&&(e=!1),this.cd.markForCheck(),e}nextStep(){let e;e=this.data&&this.data.config&&this.data.config.followMail?{document_number:this.form.get("document_number").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("birth_date").value),type:this.form.get("type").value,phone:this.form.get("phone").value,email_copy:this.form.get("email").value,check_legal:!0,document_expiration_date:this.form.get("document_expiration")?this.utils.formatDate(this.form.get("document_expiration").value):"2029-04-11"}:{document_number:this.form.get("document_number").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("birth_date").value),type:this.form.get("type").value,phone:this.form.get("phone").value,check_legal:!0,email_copy:"roger.checa@belender.eu",document_expiration_date:this.form.get("document_expiration")?this.utils.formatDate(this.form.get("document_expiration").value):"2029-04-11"},this.next.emit(e)}getAssignmentValidation(){return!(this.data.config.forceChecks&&!this.termsReaded)&&(!this.data.config.dataAssignmentCheck||this.assignment)}goBack(){this.goIntro.emit(!0)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(de.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ue.R,{panelClass:"fullscreen-dialog"})}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(p.sBO),p.Y36(pe.t),p.Y36(C.uw),p.Y36(_.w))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(p.Gf(_e,5),p.Gf(be,5)),2&e){let e;p.iGM(e=p.CRH())&&(t.checkComponent=e.first),p.iGM(e=p.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{userId:"userId",data:"data",flowName:"flowName",texts:"texts",solicitud:"solicitud",pinMode:"pinMode",requestIDFromURL:"requestIDFromURL",labels:"labels",lang:"lang"},outputs:{next:"nextStep",goTerms:"goToTerms",goIntro:"goIntro"},features:[p._Bn([{provide:ce.sG,useValue:{parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}}}])],decls:36,vars:59,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between",3,"ngClass"],["appearance","outline"],["placeholder","Ej: 12312345R","formControlName","document_number","maxlength","9","matInput","",3,"tabindex"],[4,"ngIf"],["type","text","placeholder","Ej: 22/03/1990","formControlName","birth_date","matInput","","mask","d0/M0/0000",3,"tabindex"],["appearance","outline","class","w-full flex-1 belender-form-field",4,"ngIf"],["formControlName","phone","placeholder","Ej: 123123123","maxlength","9","type","text","matInput","",3,"tabindex"],["class","w-full",4,"ngIf"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","mt-6 flex justify-start items-center w-full flex-100",4,"ngIf"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","pl-3 pr-4 flex w-fit items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["class","px-8 py-1 bg-slate-100 hover:bg-slate-200 text-slate-900 w-full max-w-none md:max-w-[220px]","mat-flat-button","","type","button",3,"border-radius","click",4,"ngIf"],["mat-flat-button","","type","button",1,"px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],[3,"firstOption","logoUrl"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","text","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration","matInput","","mask","d0/M0/0000"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["type","text","placeholder","22211134","required","","formControlName","support_number","matInput",""],[1,"w-full"],["formControlName","email","type","email","matInput","",3,"tabindex","placeholder"],[1,"flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","lang","flowName","data","showPolicyLink","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],[1,"mt-6","flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"pl-3","pr-4","flex","w-fit","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["mat-flat-button","","type","button",1,"px-8","py-1","bg-slate-100","hover:bg-slate-200","text-slate-900","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){if(1&e&&(p.YNc(0,ye,1,2,"belender-widget-logo",0),p.TgZ(1,"form",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p.qZA(),p.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",7),p.YNc(11,ve,2,1,"mat-error",8),p.qZA(),p.TgZ(12,"mat-form-field",6)(13,"mat-label"),p._uU(14),p.qZA(),p._UZ(15,"input",9),p.YNc(16,we,2,0,"mat-error",8),p.YNc(17,xe,2,0,"mat-error",8),p.YNc(18,Ce,2,0,"mat-error",8),p.qZA(),p.YNc(19,Se,11,5,"mat-form-field",10),p.YNc(20,Ie,4,1,"mat-form-field",10),p.TgZ(21,"mat-form-field",6)(22,"mat-label"),p._uU(23),p.qZA(),p._UZ(24,"input",11),p.qZA(),p.YNc(25,Oe,5,6,"div",12),p.qZA(),p.TgZ(26,"div",13),p.YNc(27,Le,4,12,"div",14),p.YNc(28,Pe,4,2,"div",15),p.YNc(29,Ae,3,1,"div",16),p.YNc(30,Ee,3,1,"div",17),p.qZA(),p.TgZ(31,"div",18),p.YNc(32,De,2,3,"button",19),p.TgZ(33,"button",20),p.NdJ("click",(function(){return t.nextStep()})),p._uU(34),p.qZA()()(),p.YNc(35,Ne,4,2,"div",21)),2&e){let e,n,i;p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(1),p.Gre("animated ",t.loading?"hide-content":""," fadeIn fixed-content px-2"),p.Q6J("formGroup",t.form),p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.Q6J("innerHTML",t.texts.form.title,p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(5,51,t.texts.form.description||""),p.oJD),p.xp6(2),p.Q6J("ngClass",p.VKq(53,Ye,t.data.config.dontShowDataInTerms&&t.solicitud&&t.solicitud.status_code&&"terms_and_conditions"===t.solicitud.status_code)),p.xp6(1),p.Gre("",t.disabledInputs.document_number?"disabled-input":""," w-full flex-1 belender-form-field"),p.xp6(2),p.Oqu(t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),p.xp6(1),p.s9C("tabindex",t.disabledInputs.document_number?-1:1),p.xp6(1),p.Q6J("ngIf",t.errorDNI),p.xp6(1),p.Gre("",t.disabledInputs.birth_date?"disabled-input":""," w-full flex-1 belender-form-field"),p.xp6(2),p.Oqu(t.labels.birthday),p.xp6(1),p.s9C("tabindex",t.disabledInputs.birth_date?-1:1),p.xp6(1),p.Q6J("ngIf",null==(e=t.form.get("birth_date"))?null:e.hasError("invalidFormat")),p.xp6(1),p.Q6J("ngIf",null==(n=t.form.get("birth_date"))?null:n.hasError("invalidDate")),p.xp6(1),p.Q6J("ngIf",null==(i=t.form.get("birth_date"))?null:i.hasError("underAge")),p.xp6(1),p.Q6J("ngIf",t.pinMode&&!t.isNie),p.xp6(1),p.Q6J("ngIf",t.pinMode&&t.isNie),p.xp6(1),p.Gre("",t.disabledInputs.phone?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),p.xp6(2),p.Oqu(t.labels.phone),p.xp6(1),p.s9C("tabindex",t.disabledInputs.phone?-1:1),p.xp6(1),p.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.followMail),p.xp6(2),p.Q6J("ngIf",!t.data.config.hideCheckLegal),p.xp6(1),p.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),p.xp6(1),p.Q6J("ngIf",t.data.config.forceChecks&&!t.termsReaded),p.xp6(1),p.Q6J("ngIf",t.errorDNI),p.xp6(1),p.Q6J("ngClass",p.kEZ(55,qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Q6J("ngIf",t.data.config.introEnabled),p.xp6(1),p.Udp("color",t.getFormsValid()&&t.getAssignmentValidation()&&t.getIfValid()?t.data.styles.colors.btnText:"")("background",t.getFormsValid()&&t.getAssignmentValidation()&&t.getIfValid()?t.data.styles.colors.btnBg:"")("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",!t.getFormsValid()||!t.getAssignmentValidation()||!t.getIfValid()),p.xp6(1),p.hij(" ",t.labels.actions.continue," "),p.xp6(1),p.Q6J("ngIf",t.loading)}},dependencies:[M.mk,M.O5,S.Hw,I.lW,r.TO,r.KE,r.bx,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.Q7,Y.nD,Y.sg,Y.u,O.Ou,me.b,R.X,fe.T,ge.Z6,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}.hide-content[_ngcontent-%COMP%]{opacity:0!important;max-height:0px!important;overflow:hidden!important;padding:0!important}"]}),e})();const Fe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Ze=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.Activatedroute=n,this.next=new p.vpe(null),this.loading=null,this.accept=!1}ngOnInit(){this.Activatedroute.queryParams.subscribe((e=>{this.setForm(e)}))}nextStep(){let e={phone:this.form.get("phone").value};this.next.emit(e)}setForm(e){this.form=this.fb.group({phone:["",Y.kI.required]}),this.solicitud&&"bad_phone"==this.solicitud.status_code&&this.form.controls.phone.markAsTouched()}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(m.gz))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-form-step"]],inputs:{data:"data",flowName:"flowName",texts:"texts",mode:"mode",solicitud:"solicitud",loading:"loading",labels:"labels"},outputs:{next:"nextStep"},decls:14,vars:23,consts:[[1,"animated","fadeIn","fixed-content",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"mb-4","w-full","flex-1"],["formControlName","phone","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(p.TgZ(0,"form",0)(1,"div",1)(2,"div",2),p._uU(3),p.qZA(),p.TgZ(4,"div",3),p._uU(5),p.qZA()(),p.TgZ(6,"div",4)(7,"mat-form-field",5)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",6),p.qZA()(),p.TgZ(11,"div",7)(12,"button",8),p.NdJ("click",(function(){return t.nextStep()})),p._uU(13),p.qZA()()()),2&e&&(p.Q6J("formGroup",t.form),p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.Oqu(t.labels.warnings.phoneError),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.Oqu(t.labels.warnings.badPhoneSS),p.xp6(4),p.Oqu(t.labels.phone),p.xp6(2),p.Q6J("ngClass",p.kEZ(19,Fe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",t.form.invalid),p.xp6(1),p.Oqu(t.labels.actions.continue))},dependencies:[M.mk,I.lW,r.KE,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.sg,Y.u],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ue(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",5),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.noService.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}let He=(()=>{class e{constructor(){this.loading=null}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},decls:6,vars:11,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(p.YNc(0,Ue,1,2,"belender-widget-logo",0),p.TgZ(1,"form",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p.qZA()()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.Q6J("innerHTML",t.texts.noService.title,p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(5,9,t.texts.noService.description),p.oJD))},dependencies:[M.O5,Y._Y,Y.JL,Y.F,R.X,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function je(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",8),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.abandoned.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const ze=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Be=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new p.vpe(null),this.loading=null}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(g.M),p.Y36(q.o),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",loading:"loading",labels:"labels",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:11,vars:24,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(p.YNc(0,je,1,2,"belender-widget-logo",0),p.TgZ(1,"div",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p.TgZ(6,"div",5),p._uU(7),p.qZA()(),p.TgZ(8,"div",6)(9,"button",7),p.NdJ("click",(function(){return t.retry()})),p._uU(10),p.qZA()()()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.Q6J("innerHTML",t.texts.abandoned.title,p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(5,18,t.texts.abandoned.description),p.oJD),p.xp6(3),p.hij(" ",t.getTextStatus()," "),p.xp6(1),p.Q6J("ngClass",p.kEZ(20,ze,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.xp6(1),p.Oqu(t.labels.actions.retry))},dependencies:[M.mk,M.O5,I.lW,R.X,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Je=n(5145);function Ve(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",10),2&e){const e=p.oxw();p.Q6J("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}const Qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let We=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.nr=new p.vpe(null),this.loading=null}ngOnInit(){}newRequest(){this.nr.emit(!0)}gotoRequest(){location.assign(this.currentRequest.widget_url_boxed)}getStatus(){let e=Je.Z.find((e=>e.text==this.currentRequest.status_code));return e?e.label:this.labels.unknownState}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(g.M),p.Y36(q.o),p.Y36(y.T))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-duplicated-request-step"]],inputs:{currentRequest:"currentRequest",loading:"loading",data:"data",texts:"texts",labels:"labels"},outputs:{nr:"newRequest"},decls:16,vars:26,consts:[[3,"logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"flex","gap-2","justify-start","items-center","py-2"],[1,"w-fit","p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[3,"logoUrl"]],template:function(e,t){1&e&&(p.YNc(0,Ve,1,1,"belender-widget-logo",0),p.TgZ(1,"div",1)(2,"div",2)(3,"div",3),p._uU(4),p.qZA(),p.TgZ(5,"div",4),p._uU(6),p.qZA(),p.TgZ(7,"div",5),p._uU(8),p.TgZ(9,"div",6),p._uU(10),p.qZA()()(),p.TgZ(11,"div",7)(12,"button",8),p.NdJ("click",(function(){return t.newRequest()})),p._uU(13),p.qZA(),p.TgZ(14,"button",9),p.NdJ("click",(function(){return t.gotoRequest()})),p._uU(15),p.qZA()()()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.hij(" ",t.labels.warnings.duplicatedRequest," "),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.hij(" ",t.labels.warnings.alreadyHaveRequest," "),p.xp6(2),p.hij(" ",t.labels.warnings.currentRequestStatus," "),p.xp6(2),p.hij(" ",t.getStatus()," "),p.xp6(1),p.Q6J("ngClass",p.kEZ(22,Qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("border-radius",t.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",t.labels.actions.newRequest," "),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.xp6(1),p.hij(" ",t.labels.actions.gotoCurrentRequest," "))},dependencies:[M.mk,M.O5,I.lW,R.X],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ge(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",5),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.standby.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}let $e=(()=>{class e{constructor(){this.loading=null}ngOnInit(){console.error(this.data,this.texts)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-standby-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},decls:6,vars:11,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"firstOption","logoUrl"]],template:function(e,t){1&e&&(p.YNc(0,Ge,1,2,"belender-widget-logo",0),p.TgZ(1,"form",1)(2,"div",2),p._UZ(3,"div",3)(4,"div",4),p.ALo(5,"safeHtml"),p.qZA()()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(3),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.standby?t.texts.standby.titleSize+"px":"20px"),p.Q6J("innerHTML",t.texts.standby?t.texts.standby.title:"Solicitud en Stand By",p.oJD),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.Q6J("innerHTML",t.texts.standby?t.texts.standby.description:p.lcZ(5,9,"Descripcion del estado Stand By"),p.oJD))},dependencies:[M.O5,Y._Y,Y.JL,Y.F,R.X,Z.z]}),e})();const Ke=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Xe=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new p.vpe(null)}ngOnInit(){this.form=this.fb.group({birth_date:[null,[Y.kI.required]]})}next(){this.nextStep.emit(this.form.get("birth_date").value)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-birthday-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:16,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","text","placeholder","Ej: 22/03/1990","required","","formControlName","birth_date","matInput","","mask","d0/M0/0000"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._uU(3),p.qZA(),p.TgZ(4,"div",3),p._uU(5),p.qZA(),p.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",6),p.TgZ(11,"mat-hint"),p._uU(12,"DD/MM/YYYY"),p.qZA()()()(),p.TgZ(13,"div",7)(14,"button",8),p.NdJ("click",(function(){return t.next()})),p._uU(15),p.qZA()()()),2&e&&(p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.hij(" ",t.labels.warnings.wrongBirthday," "),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.hij(" ",t.labels.warnings.inputBirthDay," "),p.xp6(1),p.Q6J("formGroup",t.form),p.xp6(3),p.Oqu(t.labels.birthday),p.xp6(4),p.Q6J("ngClass",p.kEZ(19,Ke,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",t.form.invalid),p.xp6(1),p.hij(" ",t.labels.send," "))},dependencies:[M.mk,I.lW,r.KE,r.bx,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.Q7,Y.sg,Y.u,ge.Z6],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const et=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let tt=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new p.vpe(null)}ngOnInit(){this.form=this.fb.group({support_number:[null,[Y.kI.required]]})}next(){this.nextStep.emit(this.form.get("support_number").value)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-support-number-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:14,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","number","placeholder","Ej: 1233443","required","","formControlName","support_number","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._uU(3),p.qZA(),p.TgZ(4,"div",3),p._uU(5),p.qZA(),p.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",6),p.qZA()()(),p.TgZ(11,"div",7)(12,"button",8),p.NdJ("click",(function(){return t.next()})),p._uU(13),p.qZA()()()),2&e&&(p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.hij(" ",t.labels.warnings.wrongSupport," "),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.hij(" ",t.labels.warnings.inputSupport," "),p.xp6(1),p.Q6J("formGroup",t.form),p.xp6(3),p.Oqu(t.labels.support),p.xp6(2),p.Q6J("ngClass",p.kEZ(19,et,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",t.form.invalid),p.xp6(1),p.hij(" ",t.labels.send," "))},dependencies:[M.mk,I.lW,r.KE,r.hX,Q.Nt,Y._Y,Y.Fj,Y.wV,Y.JJ,Y.JL,Y.Q7,Y.sg,Y.u],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const nt=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let it=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new p.vpe(null)}ngOnInit(){this.form=this.fb.group({document_expiration_date:[null,[Y.kI.required]]})}next(){this.nextStep.emit(this.form.get("document_expiration_date").value)}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-error-expiration-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:16,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","date","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration_date","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8",3,"disabled","click"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._uU(3),p.qZA(),p.TgZ(4,"div",3),p._uU(5),p.qZA(),p.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),p._uU(9),p.qZA(),p._UZ(10,"input",6),p.TgZ(11,"mat-hint"),p._uU(12,"DD/MM/YYYY"),p.qZA()()()(),p.TgZ(13,"div",7)(14,"button",8),p.NdJ("click",(function(){return t.next()})),p._uU(15),p.qZA()()()),2&e&&(p.xp6(2),p.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),p.xp6(1),p.hij(" ",t.labels.warnings.wrongExpiration," "),p.xp6(1),p.Udp("color",t.data.styles.colors.text),p.xp6(1),p.hij(" ",t.labels.warnings.inputExpiration," "),p.xp6(1),p.Q6J("formGroup",t.form),p.xp6(3),p.Oqu(t.labels.expiration),p.xp6(4),p.Q6J("ngClass",p.kEZ(19,nt,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),p.xp6(1),p.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),p.Q6J("disabled",t.form.invalid),p.xp6(1),p.Oqu(t.labels.send))},dependencies:[M.mk,I.lW,r.KE,r.bx,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.Q7,Y.sg,Y.u],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function st(e,t){if(1&e&&p._UZ(0,"belender-widget-logo",5),2&e){const e=p.oxw();p.Q6J("firstOption",e.texts.noPhone.customImage)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function rt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"mat-form-field",12)(1,"mat-label"),p._uU(2),p.qZA(),p._UZ(3,"input",13),p.TgZ(4,"mat-hint")(5,"a",14),p.NdJ("click",(function(t){p.CHM(e);const n=p.oxw(2);return p.KtG(n.gotoExpirationDate(t))})),p.TgZ(6,"u"),p._uU(7),p.qZA()()()()}if(2&e){const e=p.oxw(2);p.xp6(2),p.Oqu(e.labels.expiration),p.xp6(5),p.Oqu(e.labels.findExpiration)}}function ot(e,t){if(1&e&&(p.TgZ(0,"mat-form-field",15)(1,"mat-label"),p._uU(2),p.qZA(),p._UZ(3,"input",16),p.qZA()),2&e){const e=p.oxw(2);p.xp6(2),p.Oqu(e.labels.support)}}function at(e,t){if(1&e&&(p.TgZ(0,"div",6),p._UZ(1,"div",7)(2,"div",8),p.ALo(3,"safeHtml"),p._UZ(4,"br"),p.TgZ(5,"form",9),p.YNc(6,rt,8,2,"mat-form-field",10),p.YNc(7,ot,4,1,"mat-form-field",11),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),p.Q6J("innerHTML",null==e.texts.noPhone?null:e.texts.noPhone.title,p.oJD),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(3,11,e.texts.noPhone.description),p.oJD),p.xp6(3),p.Q6J("formGroup",e.form),p.xp6(1),p.Q6J("ngIf",e.isDni),p.xp6(1),p.Q6J("ngIf",e.isNie)}}const lt=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function ct(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",17)(1,"button",18),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.next())})),p._uU(2),p.qZA()()}if(2&e){const e=p.oxw();p.Q6J("ngClass",p.kEZ(9,lt,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),p.xp6(1),p.Udp("color",e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),p.Q6J("disabled",e.form.invalid),p.xp6(1),p.hij(" ",e.labels.actions.next," ")}}function dt(e,t){if(1&e&&(p.TgZ(0,"div",19),p._uU(1),p.qZA()),2&e){const e=p.oxw();p.xp6(1),p.hij(" ",e.labels.loadings.gettingData," ")}}let ut=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.cd=n,this.dialog=i,this.loading=null,this.solicitud=null,this.answered=!1,this.nextStep=new p.vpe(null),this.isNie=!1,this.isDni=!1}ngOnInit(){console.warn(this.solicitud),this.loading=!0,this.checkIfDniOrNie(),this.isDni&&(this.form=this.fb.group({document_expiration_date:[null,Y.kI.required]})),this.isNie&&(this.form=this.fb.group({document_support:[null,Y.kI.required]})),this.loading=!1}checkIfDniOrNie(){this.setRegex(this.solicitud.person_document_number)}setRegex(e){e&&(this.isDni=!!e.toUpperCase().match(/^(\d{8})([A-Z])$/),this.isNie=!!e.toUpperCase().match(/^[XYZ]\d{7,8}[A-Z]$/),this.cd.markForCheck())}next(){let e={};this.isDni?e.document_expiration_date=this.utils.formatDate(this.form.get("document_expiration_date").value):this.isNie&&(e.document_support=this.form.get("document_support").value),this.nextStep.emit(e)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(de.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ue.R,{panelClass:"fullscreen-dialog"})}}return e.ɵfac=function(t){return new(t||e)(p.Y36(Y.QS),p.Y36(f.F),p.Y36(p.sBO),p.Y36(C.uw))},e.ɵcmp=p.Xpm({type:e,selectors:[["belender-no-phone-step"]],inputs:{data:"data",texts:"texts",loading:"loading",solicitud:"solicitud",labels:"labels"},outputs:{nextStep:"nextStep"},decls:5,vars:4,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],["class","py-4 flex flex-col",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],["class","w-full flex justify-center p-4 items-center",4,"ngIf"],[3,"firstOption","logoUrl"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"w-full",3,"formGroup"],["appearance","outline","class","w-full flex-1 belender-form-field",4,"ngIf"],["appearance","outline","class","mb-4 w-full md:max-w-[500px]",4,"ngIf"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","text","placeholder","Ej: 22/03/2030","formControlName","document_expiration_date","matInput","","mask","d0/M0/0000"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["appearance","outline",1,"mb-4","w-full","md:max-w-[500px]"],["formControlName","document_support","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"w-full","flex","justify-center","p-4","items-center"]],template:function(e,t){1&e&&(p.YNc(0,st,1,2,"belender-widget-logo",0),p.TgZ(1,"div",1),p.YNc(2,at,8,13,"div",2),p.YNc(3,ct,3,13,"div",3),p.YNc(4,dt,2,1,"div",4),p.qZA()),2&e&&(p.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),p.xp6(2),p.Q6J("ngIf",(t.isDni||t.isNie)&&!t.loading),p.xp6(1),p.Q6J("ngIf",(t.isDni||t.isNie)&&!t.loading),p.xp6(1),p.Q6J("ngIf",!t.isDni&&!t.isNie||t.loading))},dependencies:[M.mk,M.O5,I.lW,r.KE,r.bx,r.hX,Q.Nt,Y._Y,Y.Fj,Y.JJ,Y.JL,Y.sg,Y.u,R.X,ge.Z6,Z.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var ht=n(4385);const pt=["formStep"];function mt(e,t){if(1&e&&(p.TgZ(0,"mat-option",8),p._uU(1),p.qZA()),2&e){const e=t.$implicit;p.s9C("value",e),p.xp6(1),p.Oqu(e)}}function ft(e,t){if(1&e){const e=p.EpF();p.ynx(0),p.TgZ(1,"mat-form-field",5)(2,"mat-label"),p._uU(3,"Estado"),p.qZA(),p.TgZ(4,"mat-select",6),p.NdJ("selectionChange",(function(t){const n=p.CHM(e).index,i=p.oxw();return p.KtG(i.setItemSelected(t,n))})),p.YNc(5,mt,2,2,"mat-option",7),p.qZA()(),p.BQk()}if(2&e){const e=t.$implicit,n=t.index,i=p.oxw();p.xp6(1),p.Gre(" w-full ",n===i.triggerObject.index-1?"!border-t-2 border-green-500 ":"",""),p.xp6(3),p.Q6J("value",e),p.xp6(1),p.Q6J("ngForOf",i.items)}}function gt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",9),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.initTrigger())})),p._uU(1,"Empezar"),p.qZA()}}function _t(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",9),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.initTrigger())})),p._uU(1,"Continuar"),p.qZA()}}function bt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"button",9),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.initTriggerFromZero())})),p._uU(1,"Volver a empezar"),p.qZA()}}let yt=class{constructor(e,t){this.cd=e,this.utils=t,this.sendMessage=new p.vpe,this.requestedToPin=!1,this.items=["created","form","terms_and_conditions","waiting_otp_seguridad_social","waiting_login_seguridad_social","invalid_otp_seguridad_social","abandoned_after_bad_phone","abandoned_after_invalid_otp_seguridad_social","abandoned_after_terms_and_conditions","abandoned_after_waiting_otp_seguridad_social","all_documents_downloaded","partial_documents_downloaded","consent_process_completed","partial_documents_downloaded_and_deleted","all_documents_downloaded_and_deleted","failed_with_retry","failed_without_retry","failed_documents_downloaded","no_service","no_sms_service","stand_by","no-phone","no-more-phone","bad_phone","error_expiration_date","error_birth_date","error_support_number","duplicated"],this.triggerObject={index:0,items:["form","waiting_otp_seguridad_social","all_documents_downloaded"]}}ngOnInit(){}setItemSelected(e,t){console.warn(e,t),this.triggerObject.items[t]=e.value,console.warn(this.triggerObject)}initTrigger(){this.emitMessage(this.triggerObject.items[this.triggerObject.index]),this.triggerObject.index++}initTriggerFromZero(){this.triggerObject.index=0,this.initTrigger()}emitMessage(e){let t={status_code:e};console.log(t),this.sendMessage.emit(t)}closeInterval(){this.int&&clearInterval(this.int),this.triggerObject.index=0}addState(){this.triggerObject.items.push("")}};yt.ɵfac=function(e){return new(e||yt)(p.Y36(p.sBO),p.Y36(f.F))},yt.ɵcmp=p.Xpm({type:yt,selectors:[["belender-tester-sms"]],viewQuery:function(e,t){if(1&e&&p.Gf(pt,5),2&e){let e;p.iGM(e=p.CRH())&&(t.theDiv=e.first)}},outputs:{sendMessage:"sendMessage"},decls:9,vars:4,consts:[[1,"wrapper","flex","flex-col","justify-between","bg-slate-100","w-[200px]","h-full","p-2","gap-0"],[1,"flex","flex-col","h-full","dd-wrapper"],[4,"ngFor","ngForOf"],["mat-button","",1,"w-full","rounded-md",3,"click"],["mat-raised-button","","class","w-full rounded-md bg-blue-500 text-blue-50",3,"click",4,"ngIf"],["appearance","outline"],[1,"border",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["mat-raised-button","",1,"w-full","rounded-md","bg-blue-500","text-blue-50",3,"click"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0)(1,"div",1),p.YNc(2,ft,6,5,"ng-container",2),p.TgZ(3,"button",3),p.NdJ("click",(function(){return t.addState()})),p._uU(4,"Agregar estado"),p.qZA()(),p.TgZ(5,"div"),p.YNc(6,gt,2,0,"button",4),p.YNc(7,_t,2,0,"button",4),p.YNc(8,bt,2,0,"button",4),p.qZA()()),2&e&&(p.xp6(2),p.Q6J("ngForOf",t.triggerObject.items),p.xp6(4),p.Q6J("ngIf",!t.triggerObject.index||0==t.triggerObject.index),p.xp6(1),p.Q6J("ngIf",t.triggerObject.index&&t.triggerObject.index<t.triggerObject.items.length),p.xp6(1),p.Q6J("ngIf",t.triggerObject.index&&t.triggerObject.index>=t.triggerObject.items.length))},dependencies:[M.sg,M.O5,I.lW,r.KE,r.hX,ht.gD,ce.ey],styles:[".wrapper[_ngcontent-%COMP%]{position:fixed;top:0;right:0;box-shadow:-10px 20px 30px #0000004d;z-index:99!important;max-height:100vh}.dd-wrapper[_ngcontent-%COMP%]{max-height:calc(100vh - 70px)!important;overflow:auto}"],data:{animation:[d.$]}}),yt=(0,s.gn)([(0,o.c)()],yt);const vt=["formStep"],wt=["otpStep"];function xt(e,t){if(1&e&&(p.TgZ(0,"div",8),p._UZ(1,"mat-icon",9),p._uU(2),p.qZA()),2&e){const e=p.oxw(2);p.Q6J("@fadeInUp",void 0),p.xp6(2),p.hij(" ",e.warningAlert," ")}}function Ct(e,t){1&e&&(p.TgZ(0,"div",10),p._UZ(1,"mat-progress-spinner",11),p.qZA()),2&e&&(p.xp6(1),p.Q6J("value",0))}function kt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-intro-step",26),p.NdJ("gotoFlow",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.goFlow())}))("gotoManual",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.gotoManual())})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("flowName",e.flowName)}}function Tt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-manual-step",27),p.NdJ("dniChange",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.createRequestFromDNI(t))}))("goBack",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.gotoIntro())})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("flowName",e.flowName)("solicitud",e.solicitud)("packId",e.packId)("userId",e.userId)}}function Mt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-form-step",28,29),p.NdJ("goIntro",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.goIntro())}))("goToTerms",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.gotoTermsAndConditions())}))("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.gotoTerms(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("requestIDFromURL",e.requestIDFromURL)("lang",e.currentLang)("userId",e.userId)("flowName",e.flowName)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)("solicitud",e.solicitud)("pinMode",e.pinMode)}}function St(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-form-step",30),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.sendNewData(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function It(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-birthday-step",31),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setBirthDate(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function Ot(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-expiration-step",31),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setExpiration(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function Lt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-support-number-step",31),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setSupportNumber(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function Pt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-abandoned-step",32),p.NdJ("retry",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.retryRequest(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function At(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-shared-otp-step",33,34),p.NdJ("resendOTP",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.resendOTP(t))}))("errorPhone",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.requestOTP(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("otpType","otpSS")("labels",e.labels)("logoCustom",e.data[e.flowName].texts.otpSS.customImage)("flowType",e.flowName)("data",e.data)("texts",e.data[e.flowName].texts)("solicitud",e.solicitud)("minLength",6)}}function Et(e,t){if(1&e&&p._UZ(0,"belender-success-step",35),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("packId",e.packId)("flowName",e.flowName)("userId",e.userId)("requestID",e.requestID)("texts",e.data[e.flowName].texts)}}function Dt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-duplicated-request-step",36),p.NdJ("newRequest",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.newRequest(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("currentRequest",e.currentRequest)}}function Nt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-no-phone-step",30),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.sendDataToPin(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function Yt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-phone-step",37),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setPhone(t))}))("noPhone",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.setNoPhone())})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)}}function qt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-fail-step",38),p.NdJ("retry",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.retryRequest(t))}))("newRequest",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.newRequest(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Rt(e,t){if(1&e&&p._UZ(0,"belender-no-service-step",39),2&e){const e=p.oxw(3);p.Q6J("texts",e.data[e.flowName].texts)("data",e.data)("labels",e.labels)}}function Ft(e,t){if(1&e&&p._UZ(0,"belender-standby-step",39),2&e){const e=p.oxw(3);p.Q6J("texts",e.data[e.flowName].texts)("data",e.data)("labels",e.labels)}}function Zt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-cancel-request",40),p.NdJ("updateStatusCode",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setCancel(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("flowType",e.flowName)("request_id",e.requestID)("user_id",e.userId)("data",e.data)("labels",e.labels)("textColor",e.data.styles.colors.text)("customText",e.data.config.cancelRequestText)}}function Ut(e,t){if(1&e&&(p._UZ(0,"div",41),p.ALo(1,"safeHtml")),2&e){const e=p.oxw(3);p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",p.lcZ(1,3,(null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.aditionalDescription)||""),p.oJD)}}function Ht(e,t){if(1&e&&(p.ynx(0),p.YNc(1,kt,1,2,"belender-intro-step",12),p.YNc(2,Tt,1,5,"belender-manual-step",13),p.YNc(3,Mt,2,9,"belender-form-step",14),p.YNc(4,St,1,4,"belender-error-form-step",15),p.YNc(5,It,1,3,"belender-error-birthday-step",16),p.YNc(6,Ot,1,3,"belender-error-expiration-step",16),p.YNc(7,Lt,1,3,"belender-error-support-number-step",16),p.YNc(8,Pt,1,4,"belender-abandoned-step",17),p.YNc(9,At,2,8,"belender-shared-otp-step",18),p.YNc(10,Et,1,7,"belender-success-step",19),p.YNc(11,Dt,1,3,"belender-duplicated-request-step",20),p.YNc(12,Nt,1,4,"belender-no-phone-step",15),p.YNc(13,Yt,1,3,"belender-error-phone-step",21),p.YNc(14,qt,1,4,"belender-fail-step",22),p.YNc(15,Rt,1,3,"belender-no-service-step",23),p.YNc(16,Ft,1,3,"belender-standby-step",23),p.YNc(17,Zt,1,7,"belender-cancel-request",24),p.YNc(18,Ut,2,5,"div",25),p.BQk()),2&e){const e=p.oxw(2);p.xp6(1),p.Q6J("ngIf","intro"===e.requestStatus),p.xp6(1),p.Q6J("ngIf","manual"===e.requestStatus),p.xp6(1),p.Q6J("ngIf","form"===e.requestStatus&&!e.settingRequestFromBack),p.xp6(1),p.Q6J("ngIf","error-data"===e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-birth-date"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-expiration-date"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-support-number"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","abandoned"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","otp"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","success"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","duplicated"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","no-phone"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","bad-phone"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","failed"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","no-service"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","standby"==e.requestStatus),p.xp6(1),p.Q6J("ngIf",e.showCancelRequest&&e.data.config.cancelRequest&&e.requestIDFromURL),p.xp6(1),p.Q6J("ngIf","form"===e.requestStatus&&!e.loading&&e.data[e.flowName]&&(null==e.data[e.flowName]?null:e.data[e.flowName].showAditionalDescription)&&e.data[e.flowName].texts&&e.data[e.flowName].texts.form&&e.data[e.flowName].texts.form.aditionalDescription)}}function jt(e,t){1&e&&p._UZ(0,"belender-disabled-url")}function zt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div")(1,"div",42)(2,"div",43),p._uU(3,"Error!"),p.qZA(),p._UZ(4,"div",44),p.qZA(),p.TgZ(5,"div",45)(6,"button",46),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.error=!1)})),p._uU(7,"Ingresar manualmente"),p.qZA()()()}if(2&e){const e=p.oxw(2);p.xp6(4),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",e.error,p.oJD)}}function Bt(e,t){if(1&e&&(p.TgZ(0,"div"),p.YNc(1,xt,3,2,"div",6),p.YNc(2,Ct,2,1,"div",7),p.YNc(3,Ht,19,18,"ng-container",4),p.YNc(4,jt,1,0,"belender-disabled-url",4),p.YNc(5,zt,8,3,"div",4),p.qZA()),2&e){const e=p.oxw();p.Gre("h-full w-full flex-auto p-0 md:p-3 ",null==e.data||null==e.data.styles?null:e.data.styles.typography,""),p.Udp("background",null==e.data||null==e.data.styles||null==e.data.styles.colors?null:e.data.styles.colors.background),p.xp6(1),p.Q6J("ngIf",e.warningAlert&&"success"!=e.requestStatus),p.xp6(1),p.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"===e.requestStatus),p.xp6(1),p.Q6J("ngIf",!e.error&&!e.disableURL),p.xp6(1),p.Q6J("ngIf",!e.error&&e.disableURL),p.xp6(1),p.Q6J("ngIf",!e.loading&&e.error&&"loading"!=e.requestStatus)}}function Jt(e,t){if(1&e&&(p.TgZ(0,"div",47),p._UZ(1,"mat-progress-spinner",48),p.TgZ(2,"p",49),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),p.xp6(2),p.Oqu(e.loading)}}function Vt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"vex-terms",50),p.NdJ("accepted",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.handleTermsResponse(!1))})),p.qZA()}if(2&e){const e=p.oxw();p.Q6J("flow",e.flowName)("lang",e.currentLang)("allData",e.data)("requestStatus",e.solicitud?e.solicitud.status_code:"")("requestID",e.requestID)}}function Qt(e,t){if(1&e&&(p.ynx(0),p.TgZ(1,"div",51),p._uU(2),p.qZA(),p.BQk()),2&e){const e=p.oxw();p.xp6(2),p.hij("TestMode ",e.testMode?"ON":"OFF","")}}function Wt(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-tester-sms",52),p.NdJ("sendMessage",(function(t){p.CHM(e);const n=p.oxw();return p.KtG(n.setMessageFromTest(t))})),p.qZA()}}let Gt=class{constructor(e,t,n,i,s,r,o,a,l,d,u,p,m){if(this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.flowsS=a,this.pinService=l,this.deviceInfoService=d,this.dialog=u,this.translationService=p,this.scrollService=m,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this._loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.introEnabled=!1,this.manual=!1,this.pinMode=!1,this.requestIDFromURL=!1,this.warningAlert=null,this.stopPropagationOfSuccess=!1,this.paramsSetted=!1,this.requestStatus="loading",this.disableURL=!1,this.settingRequestFromBack=!1,this.showCancelRequest=!1,this.requestedFromDetail=!1,this.env=c.N,this.intervalToAskBack=null,this.loadingRequestData=!1,this.intervalCount=0,this.requestedToPin=!1,this.currentHeight=0,this.socketOpened=!0,this.isScaled=!1,this.termsOpened=!1,this.flowName="SMS",this.labels=h.S.es,this.currentLang="",this.showTermsDialog=!1,"OTPCredential"in window){const e=new AbortController;navigator.credentials.get({otp:{transport:["sms"]},signal:e.signal}).then((e=>{this.showAlert("otp",e)})).catch((e=>{console.log(e)}))}this.deviceInfoDetails$=this.deviceInfoService.deviceInfo$.subscribe((e=>{Object.keys(e).length>0&&(this.deviceInfoDetails=e)}))}ngOnInit(){this.getWindowsScreenOrientation(),this.setWarningPortals();const e=this;this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.initFunctions(),"pro"!=c.N.env&&(l(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),l(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}get loading(){return this._loading}set loading(e){this._loading=e,null!==e&&this.onLoadingChanged(e)}onLoadingChanged(e){this.scrollUpContent()}initFunctions(){var e=this;return(0,i.Z)((function*(){var t;e.Activatedroute.queryParams.subscribe((t=(0,i.Z)((function*(t){t&&t.request_id&&(e.requestID=t.request_id),t.lang?(e.currentLang=t.lang,e.loading=e.translationService.getFirstLoading(e.currentLang),e.setTranslation()):e.loading=e.labels.loadings.gettingData,e.userId?e.setInitialData(e.userId):e.loading=null})),function(e){return t.apply(this,arguments)}))}))()}testNoti(e){this.showAlert("Titleeee","messsaggeee",e)}setTranslation(){let e=this.translationService.getLabelsTranslated(this.currentLang);e&&(this.labels=e)}testAlert(e){this.showAlert("Error de prueba","Esta es una prueba de un error",e)}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewChecked(){this.getWidgetCardHeight()}getWindowsScreenOrientation(){window.screen&&window.screen.orientation&&(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler))}getWidgetCardHeight(){let e=l("#widget-wrapper").height()||0;this.isScaled$=this.deviceInfoService.isScaled$.subscribe((t=>{this.isScaled=t,this.isScaled&&(e*=1.5)})),this.sendMessageToParent({type:"widgetHeight",data:e})}setWarningPortals(){this.flowsS.getFlows().then((e=>{e&&e.data&&e.data.length&&"OCCASIONAL_FAIL"==e.data.find((e=>e.name==this.flowName)).status&&!this.warningAlert&&(this.warningAlert=this.labels.warnings.ocassionalError)})).catch((e=>{console.error(e)}))}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}window.top.postMessage(e,"*")}setInitialData(e){var t=this;return(0,i.Z)((function*(){yield t.validateRequestIdInUrl();const n=yield t.getFlow(e),i=t.customizationStoreService.FUNDER_CONFIG;if(t.funderStyles=t.customizationStoreService.FUNDER_STYLES,console.warn(t.funderStyles),t.data={config:i,styles:t.funderStyles,[t.flowName]:n},!t.data.config||!t.data.config.funder_id)return t.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.introEnabled=t.data.config.introEnabled,t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.currentLang,t.requestID,t.solicitud?t.solicitud.status_code:"").then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}getConfig(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getFunderConfig(e).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{console.error(e),t.loading=null}))}))}))()}getStyle(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getFunderStyles(e).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{console.error(e),t.loading=null}))}))}))()}validateRequestIdInUrl(){var e=this;return(0,i.Z)((function*(){return new Promise((t=>{var n;e.Activatedroute.queryParams.subscribe((n=(0,i.Z)((function*(n){if(n&&(e.setParamsToRequest(n),e.loading=null),n&&n.acceptTerms&&(e.paramsSetted=!0,e.autoAcceptTerms=!0),n.success&&(e.stopPropagationOfSuccess=!0,e.paramsSetted=!0),n&&n.request_id){e.requestID=n.request_id,e.disableURL=!1;let i=yield e.setFormFromVcCode(n.request_id,n);e.requestIDFromURL=!0,e.paramsSetted=!0,t(i)}else e.loading=null,t(null)})),function(e){return n.apply(this,arguments)}),(n=>{e.loading=null,t(null)}))}))}))()}setParamsToRequest(e){this.solicitud||this.setRequestStatus("form"),(e.document_number||e.document)&&!this.solicitud.person_document_number&&(this.solicitud.person_document_number=e.document_number||e.document,this.requestIDFromURL=!0,this.paramsSetted=!0),(e.birth_date||e.birthday)&&!this.solicitud.person_birth_date&&(this.solicitud.person_birth_date=e.birth_date||e.birthday,this.requestIDFromURL=!0,this.paramsSetted=!0),e.phone&&!this.solicitud.person_phone&&(this.solicitud.person_phone=e.phone,this.requestIDFromURL=!0,this.paramsSetted=!0),e.email&&!this.solicitud.email&&(this.solicitud.email=e.email,this.requestIDFromURL=!0,this.paramsSetted=!0)}setFormFromVcCode(e,t){var n=this;return(0,i.Z)((function*(){return n.loading=n.labels.loadings.gettingData,n.settingRequestFromBack=!0,new Promise((i=>{n.solicitudesService.getSolicitudByCode(e).then((e=>{e&&e.data?(n.solicitud=e.data,n.setStatus(),n.setSubscriptionOfRequest(),n.loading=null,n.skipCreationOfRequest=n.solicitud&&n.solicitud.status_code&&"prerequest"!=n.solicitud.status_code,n.autoAcceptTerms?n.acceptTerms():n.setParamsToRequest(t)):n.loading=null,n.settingRequestFromBack=!1,i(n.solicitud||null)})).catch((e=>{n.loading=null,n.settingRequestFromBack=!1,i(null)}))}))}))()}setMessageFromTest(e){this.handlePusherNotification(e)}handlePusherNotification(e){this.dataFromFirebase=e,e&&e.widget_url&&(this.widgetUrl=e.widget_url),e&&e.widget_url_boxed&&(this.widgetUrlBoxed=e.widget_url_boxed),this.sendMessageToParent({type:"websocket",data:e}),this.dataFromFirebase&&this.dataFromFirebase.status_code&&("consent_process_completed"===this.dataFromFirebase.status_code&&this.disconnectWebsocket(),this.setRequestStatus(JSON.parse(JSON.stringify(this.dataFromFirebase.status_code))),"terms_and_conditions"!=this.solicitud.status_code&&"saved_otp"!=this.solicitud.status_code&&setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500))}resendOTP(e){let t={request_id:(this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID)||e,user_id:this.userId};this.loading=this.labels.loadings.resendingOtp,this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data,this.setStatus()),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}gotoTerms(e){this.loading=this.labels.loadings.sendingData,e.package_id=this.packId,e.user_id=this.userId,this.requestID&&(e.request_id=this.requestID),this.testMode?setTimeout((()=>{this.solicitud=new a.l,this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=null}),4e3):this.skipCreationOfRequest?(this.acceptTerms(),this.setSubscriptionOfRequest()):this.checkSmsService(e)}checkSmsService(e){this.formComponent.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0}),this.solicitudesService.checkService(e).then((t=>{t&&t.message&&t.status&&"error"==t.status?t.message.birth_date?(this.loading=null,this.setRequestStatus("form"),this.notis.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate),this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):"string"==typeof t.message&&" fecha de nacimiento incorrecta"==t.message.toLowerCase()?(this.loading=null,this.setRequestStatus("form"),this.notis.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc),this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):"string"==typeof t.message&&"does not have sms service"==t.message.toLowerCase()?(this.loading=this.labels.loadings.creatingRequest,e.user_id=this.userId,e.package_id=this.packId,this.requestID&&(e.request_id=this.requestID),this.solicitudesService.addSolicitud(e).then((e=>{e.data&&(this.requestID=e.data.request_id),this.solicitudesService.setNoService({request_id:this.requestID}).then((()=>{this.loading=null})),this.setRequestStatus("no_service"),this.setStatus()}))):"string"==typeof t.message&&"birthdate incorrect"==t.message.toLowerCase()?(this.loading=null,this.setRequestStatus("form"),this.notis.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc),this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):(this.setRequestStatus("form"),this.setStatus(),this.loading=null):t&&t.status&&"success"==t.status?this.addSolicitudSMS(e):(this.loading=null,this.setRequestStatus("form"),this.setStatus(),this.notis.showAlert("Error:",t.message||t))})).catch((e=>{console.error(e),this.loading=null,e.message&&"birthdate incorrect"==e.message.toLowerCase()&&(this.setRequestStatus("form"),this.notis.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc))}))}addSolicitudPIN(e){this.data[this.flowName]&&this.data[this.flowName].packID&&(e.package_id=this.data[this.flowName].packID),this.formComponent.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0}),this.pinService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?t.message&&(this.solicitud=e,400==t.code&&"Does not have Pin service"==t.message?(this.setRequestStatus("no_service"),this.loading=null):400==t.code&&"Incorrect support number"==t.message?(this.notis.showAlert(this.labels.warnings.error,this.labels.warnings.wrongSupport),this.setRequestStatus("form")):400==t.code&&"Incorrect date"==t.message?(this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate),this.setRequestStatus("form")):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,t.message)),this.setStatus()):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,location.pathname.indexOf("widget-boxed")>-1?location.assign(t.data.widget_url_boxed+"&acceptTerms=true"):location.assign(t.data.widget_url+"&acceptTerms=true"),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.errorMessage&&this.showAlert("Error!",e.errorMessage)}))}addSolicitudSMS(e){this.solicitudesService.addSolicitud(e,this.packId,this.userId).then((t=>{console.warn(t),t&&t.status&&"error"==t.status?(this.solicitud=e,t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc)):"Incorrect date"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("form"),this.showAlert("Error!",t.message)),this.setStatus())):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,this.setStatus(),this.setSubscriptionOfRequest(),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}validateHaveSmsMode(e){this.solicitudesService.checkService(e).then((t=>{t&&t.message&&"does not have sms service"==t.message.toLowerCase()?(this.solicitud=e,this.setRequestStatus("form"),this.pinMode=!0,this.loading=null,this.showAlert(this.labels.warnings.noSms,this.labels.warnings.noSmsDesc)):this.addSolicitudSMS(e)})).catch((e=>{console.error(e)}))}createRequestFromDNI(e){let t={document_number:e,user_id:this.userId,package_id:this.packId,check_legal:!0};this.solicitudesService.addSolicitud(t,this.packId,this.userId).then((e=>{e&&e.status&&"error"==e.status?(this.solicitud=t,e.message&&(400==e.code?"Birthdate incorrect"==e.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc)):"Incorrect date"==e.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("form"),this.showAlert("Error!",e.message))),this.setStatus()):e&&e.status&&"success"==e.status?(this.requestID=e.data.request_id,this.solicitud=e.data,this.setStatus(),this.setSubscriptionOfRequest(),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+e)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}setSubscriptionOfRequest(){if(this.socket)return;const e=this;let t="wss://notifications.dev.belender.net";"qa"==c.N.env&&(t="wss://notifications.qa.belender.net"),"pro"==c.N.env&&(t="wss://notifications.belender.net"),c.N.notificationsBaseUrl&&(t=c.N.notificationsBaseUrl),this.socket=new WebSocket(`${t}?requests_id=${this.requestID}&user_id=${this.userId}`),this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(t){let n=JSON.parse(t.data);console.warn("message from wss: ",n),e.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada"),this.socketOpened=!1}}sendNewData(e){this.loading=this.labels.loadings.sendingData,this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e.message,"error"),this.loading=null):e&&"success"==e.status&&(this.loading=this.labels.loadings.validatingData,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}showAlert(e,t,n){this.loading=null;let i=this.getFunderIconType(n);this.notis.showAlert(e,t,i)}getFunderIconType(e){if(!e||!this.funderStyles)return"error";switch(e){case"error":return this.funderStyles.errorIcon||e;case"success":return this.funderStyles.successIcon||e;case"warning":return this.funderStyles.warningIcon||e;case"info":return this.funderStyles.infoIcon||e;default:return e}}setBirthDate(e){}setExpiration(e){}setSupportNumber(e){}acceptTerms(e=!0){let t={request_id:this.requestID,user_id:this.userId,terms_and_conditions:!0,opening:this.termsOpened?1:0};Object.keys(this.deviceInfoDetails).length>0&&(t={...t,ip:this.deviceInfoDetails.ip,device:this.deviceInfoDetails.device,os:`${this.deviceInfoDetails.os} ${this.deviceInfoDetails.os_version}`,resolution:this.deviceInfoDetails.screen}),e&&(this.loading=this.labels.loadings.validatingAndLoginSS),this.solicitudesService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?(e.message&&"You have a request in progress"==e.message?location.pathname.indexOf("widget-boxed")>-1?location.assign(e.response.widget_url_boxed):location.assign(e.response.widget_url):e.message?"Invalid request status: stand_by"==e.message?this.setRequestStatus("stand_by"):this.showAlert("Error!",e.message):this.showAlert("Error!",e),this.loading=null):e&&"success"==e.status?(this.solicitud=e.data,this.setStatus(),this.setSubscriptionOfRequest(),this.loading=null,this.cd.markForCheck()):this.loading=null})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}requestOTP(e){this.loading=this.labels.loadings.sendingData,this.testMode?setTimeout((()=>{this.solicitud=new a.l,this.setRequestStatus("all_documents_downloaded"),this.setStatus(),this.loading=null}),2e3):this.solicitudesService.sendOTP({request_id:this.requestID,user_id:this.userId,code:e.code}).then((e=>{e.status&&"error"==e.status?(e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.showAlert(this.labels.warnings.error,this.labels.warnings.noOtp):this.showAlert("Error!",e.message?e.message:e),this.loading=null):e&&"success"==e.status&&(this.handleRequestStatus(e.data||e),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}askToBack(){this.solicitudesService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.setStatus(),this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}gotoErrorPhone(){}setRequestStatus(e){if(this.solicitud)this.solicitud.status_code=e;else{let t=new a.l;t.status_code=e,this.solicitud=t}this.setStatus()}retryRequest(e){let t={request_id:(this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID)||e,user_id:this.userId};this.loading=this.labels.loadings.resendingRequest,this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data,this.setStatus()),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}newRequest(e){this.setRequestStatus("created")}gotoManual(){this.manual=!0,this.cd.markForCheck()}gotoIntro(){this.manual=!1}goFlow(){this.introEnabled=!1}goIntro(){this.manual=!1,this.introEnabled=!0}disconnectWebsocket(){this.socket&&this.socket.close()}gotoPin(){this.requestedToPin=!0;let e={request_id:this.solicitud.request_id};this.loading=this.labels.loadings.smsToPin,this.solicitudesService.noPhone(e).then((e=>{this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}gotoClavePinUrl(e){location.href.indexOf("widget-boxed")>-1?location.assign(e.widget_url_boxed):location.assign(e.widget_url)}setPhone(e){this.loading=this.labels.loadings.sendingNewPhone,this.solicitudesService.setPhone({phone:e},this.solicitud&&this.solicitud.request_id?this.solicitud.request_id:this.requestID)}setNoPhone(){this.loading=this.labels.loadings.validatingData,this.solicitudesService.noPhone({request_id:this.solicitud.request_id})}sendDataToPin(e){e.request_id=this.solicitud.request_id,this.loading=this.labels.loadings.sendingData,this.solicitudesService.smsToPin(e).then((e=>{e&&e.status&&"success"===e.status&&this.gotoClavePinUrl(e.data),e&&e.status&&"error"===e.status&&(e.message?"Does not have Pin service"==e.message?this.setRequestStatus("no-service"):this.showAlert("Error!",e.message):this.showAlert("Error!",e),this.loading=null)})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}requestStatusFromDetail(){this.requestedFromDetail=!0,this.loading=this.labels.loadings.validatingRequest,this.solicitudesService.getSolicitudByCode(this.solicitud.request_id).then((e=>{e&&e.consent_process_completed&&this.setRequestStatus("consent_process_completed"),this.loading=null})).catch((e=>{this.loading=null,this.setRequestStatus("failed")}))}handleRequestStatus(e){let t=new a.l;e.consent_process_completed?(this.requestedFromDetail=!0,t.status_code="consent_process_completed",this.solicitud=t,setTimeout((()=>{this.disconnectWebsocket()}),3e3),this.setStatus(),this.data[this.flowName].showDocumentsOnSuccess&&!this.intervalToAskBack&&this.initIntervalToAskBack()):(this.otpComponent&&this.otpComponent.resetOtpNumber(),e.otp_status?"VALID"===e.otp_status?e.nex_step_detail&&"Seguridad Social"===e.nex_step_detail.portal&&(t.status_code="waiting_otp_seguridad_social",this.solicitud=t,this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)):"INVALID"===e.otp_status&&(t.status_code=e.status_code,this.solicitud=t,this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)):(t.status_code="failed",this.solicitud=t,this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp))),this.loading=null}initIntervalToAskBack(){!this.solicitud||!this.solicitud.request_id||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(this.solicitud.request_id),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack)}askDetailToBack(e){if(!e&&!this.requestID)return void this.stopInterval();let t=JSON.parse(JSON.stringify(this.solicitud.status_code));this.pinService.getSolicitudByCode(e).then((e=>{e&&e.data&&t!=e.data.status_code&&(this.solicitud=e.data,this.setRequestStatus(this.solicitud.status_code))})).catch((e=>{this.loading=null,this.loadingRequestData=!1}))}handleBadPhone(){this.disconnectWebsocket(),this.loading=this.labels.loadings.validatingData,setTimeout((()=>{this.solicitud||(this.solicitud=new a.l),this.setRequestStatus("failed_without_retry"),this.setStatus(),this.loading=null}),3e3)}setCancel(e){this.setRequestStatus(e),this.setStatus()}setStatus(){if(this.showCancelRequest=!0,this.manual)this.requestStatus="manual";else if(this.introEnabled)this.requestStatus="intro";else if(this.solicitud){if(this.solicitud){let e=u[this.solicitud.status_code];if(e){if("success"===e&&this.data.config&&this.data.config.infiniteLoopInCompleted)return void(this.requestStatus="loading");if(("abandoned"===e||"failed"===e)&&(this.showCancelRequest=!1),"phone_not_exist_otp"===e)return void(this.data&&this.data.config&&this.data.config.tryPinWithoutSMS?(this.showCancelRequest=!1,this.gotoPin(),this.requestStatus="loading"):this.requestStatus=this.data.config.noRetryInBadPhone?"otp":"error-data");if("no-service"===e&&(this.requestStatus=e,this.data&&this.data.config&&this.data.config.tryPinWithoutSMS))return void(!this.requestedToPin&&this.gotoPin());if("bad-phone"===e&&this.data&&this.data.config&&this.data.config.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone");if("no-phone"===e){if(this.data&&this.data.config&&!this.data.config.tryPinWithoutSMS)return void(this.requestStatus="no-service");if(this.data&&this.data.config&&this.data.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone")}this.requestStatus=e,this.scrollUpContent()}}}else this.requestStatus="form"}scrollUpContent(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),300)}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,e&&(this.termsOpened=!0,this.formComponent.setTermsCheck(!0))}};Gt.ɵfac=function(e){return new(e||Gt)(p.Y36(p.sBO),p.Y36(m.gz),p.Y36(f.F),p.Y36(g.M),p.Y36(_.w),p.Y36(b.r),p.Y36(y.T),p.Y36(v.s),p.Y36(w.v),p.Y36(x.H),p.Y36(C.uw),p.Y36(k.D),p.Y36(T.a))},Gt.ɵcmp=p.Xpm({type:Gt,selectors:[["belender-widget-sms"]],viewQuery:function(e,t){if(1&e&&(p.Gf(vt,5),p.Gf(wt,5),p.Gf(vt,5)),2&e){let e;p.iGM(e=p.CRH())&&(t.formComponent=e.first),p.iGM(e=p.CRH())&&(t.otpComponent=e.first),p.iGM(e=p.CRH())&&(t.theDiv=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[p._Bn([{provide:r.o2,useValue:{appearance:"standard"}}])],decls:6,vars:5,consts:[[1,"h-full","widget-belender"],[3,"class","background",4,"ngIf"],["class","loading-wrapper",4,"ngIf"],[3,"flow","lang","allData","requestStatus","requestID","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"sendMessage",4,"ngIf"],["class","flex justify-start px-4 py-3 items-center font-bold gap-3 text-md bg-amber-500/20 rounded-sm border border-amber-500 text-amber-500",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],[1,"flex","justify-start","px-4","py-3","items-center","font-bold","gap-3","text-md","bg-amber-500/20","rounded-sm","border","border-amber-500","text-amber-500"],["svgIcon","mat:warning"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],["class","h-full ",3,"data","flowName","gotoFlow","gotoManual",4,"ngIf"],["class","h-full ",3,"data","flowName","solicitud","packId","userId","dniChange","goBack",4,"ngIf"],[3,"requestIDFromURL","lang","userId","flowName","data","labels","texts","solicitud","pinMode","goIntro","goToTerms","nextStep",4,"ngIf"],[3,"solicitud","data","labels","texts","nextStep",4,"ngIf"],[3,"data","labels","texts","nextStep",4,"ngIf"],[3,"solicitud","data","labels","texts","retry",4,"ngIf"],[3,"otpType","labels","logoCustom","flowType","data","texts","solicitud","minLength","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","packId","flowName","userId","requestID","texts",4,"ngIf"],[3,"data","labels","currentRequest","newRequest",4,"ngIf"],[3,"data","labels","texts","nextStep","noPhone",4,"ngIf"],[3,"data","labels","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"texts","data","labels",4,"ngIf"],[3,"flowType","request_id","user_id","data","labels","textColor","customText","updateStatusCode",4,"ngIf"],["class","subheading-1 p-4 custom-html",3,"color","innerHTML",4,"ngIf"],[1,"h-full",3,"data","flowName","gotoFlow","gotoManual"],[1,"h-full",3,"data","flowName","solicitud","packId","userId","dniChange","goBack"],[3,"requestIDFromURL","lang","userId","flowName","data","labels","texts","solicitud","pinMode","goIntro","goToTerms","nextStep"],["formStep",""],[3,"solicitud","data","labels","texts","nextStep"],[3,"data","labels","texts","nextStep"],[3,"solicitud","data","labels","texts","retry"],[3,"otpType","labels","logoCustom","flowType","data","texts","solicitud","minLength","resendOTP","errorPhone","nextStep"],["otpStep",""],[3,"data","labels","packId","flowName","userId","requestID","texts"],[3,"data","labels","currentRequest","newRequest"],[3,"data","labels","texts","nextStep","noPhone"],[3,"data","labels","texts","solicitud","retry","newRequest"],[3,"texts","data","labels"],[3,"flowType","request_id","user_id","data","labels","textColor","customText","updateStatusCode"],[1,"subheading-1","p-4","custom-html",3,"innerHTML"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[1,"loading-wrapper"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[3,"flow","lang","allData","requestStatus","requestID","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"],[3,"sendMessage"]],template:function(e,t){1&e&&(p.TgZ(0,"div",0),p.YNc(1,Bt,6,10,"div",1),p.YNc(2,Jt,4,3,"div",2),p.qZA(),p.YNc(3,Vt,1,5,"vex-terms",3),p.YNc(4,Qt,3,1,"ng-container",4),p.YNc(5,Wt,1,0,"belender-tester-sms",5)),2&e&&(p.xp6(1),p.Q6J("ngIf",t.data&&t.data.styles&&t.data.styles.colors),p.xp6(1),p.Q6J("ngIf",t.loading&&!t.error),p.xp6(1),p.Q6J("ngIf",t.showTermsDialog),p.xp6(1),p.Q6J("ngIf",t.testMode),p.xp6(1),p.Q6J("ngIf",t.testMode))},dependencies:[M.O5,S.Hw,I.lW,O.Ou,L.R,P.u,A.L,E.q,D.y,N.i,V,X,oe,Re,Ze,He,Be,We,$e,Xe,tt,it,ut,yt,Z.z],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative;min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"],data:{animation:[d.$]}}),Gt=(0,s.gn)([(0,o.c)()],Gt)},3006:(e,t,n)=>{n.r(t),n.d(t,{SmsModule:()=>B});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),y=n(9391),v=n(1572),w=n(182),x=n(4144),C=n(7367),k=n(9602),T=n(3238),M=n(5895),S=n(6257),I=n(1948),O=n(4246),L=n(9299),P=n(6e3),A=n(8364),E=n(4650);const D=[{path:":idUser",component:A.T},{path:":idUser/:packID",component:A.T}];let N=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=E.oAB({type:e}),e.ɵinj=E.cJS({imports:[L.Bz.forChild(D),L.Bz,P.d8]}),e})();var Y=n(6981),q=n(1129),R=n(9476),F=n(8962),Z=n(3468),U=n(3295),H=n(3300),j=n(865),z=n(3033);let B=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=E.oAB({type:e}),e.ɵinj=E.cJS({providers:[_.M,y.o,C.w,w.t,M.T,O.t,{provide:T.Ad,useValue:"es-ES"}],imports:[N,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,v.Cq,k.FA,T.XK,S.T5,I.Fk,Y.x,q.n,R.F,F.A,Z.f,U.g,H.C,j.q,z.d]}),e})()},1724:(e,t,n)=>{n.r(t),n.d(t,{VideoIdModule:()=>kt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),y=n(9391),v=n(1572),w=n(182),x=n(4144),C=n(7367),k=n(9602),T=n(3238),M=n(5895),S=n(6257),I=n(1948),O=n(4246),L=n(9299),P=n(6e3),A=n(5861),E=n(7582),D=n(9549),N=n(9933),Y=n(5762),q=n(8259),R=n(2340),F=n(1363),Z=n(4650),U=n(5089),H=n(529),j=n(6554);let z=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}getSolicitudes(){return this.localFetch.getFetch(R.N.baseUrl+"/requests")}getSolicitudByCode(e){return this.localFetch.freeGetFetch(R.N.baseUrl+"/requests/"+e)}setState(e,t){let n={request_id:e,status:t};return new Promise(((e,t)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid/status",n).then((n=>{n?e(n):t(n)})).catch((e=>{console.error("addSolicitud",e),t(e)}))}))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid",e).then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/sms/check-service",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/sms/retry",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/sms/resend-otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${R.N.baseUrl}/requests/${e}/person`,t).then((e=>{e?n(e):i(e)})).catch((e=>{i(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(R.N.baseUrl+"/requests/videoid/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(`${R.N.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?n(e):i(e)})).catch((e=>{i(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(Z.LFG(U.F),Z.LFG(H.eN),Z.LFG(j.r))},e.ɵprov=Z.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var B=n(8460),J=n(5412),V=n(6830),Q=n(833),W=n(4302),G=n(3731);function $(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij("¿No has recibido el código? Solicítalo de nuevo en ",e.secsCount," segundos")}}function K(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.AsE("¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? Solicítalo de nuevo en ",e.secsCount," segundos")}}function X(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij("¿No has recibido el código en tu teléfono? Solicítalo de nuevo en ",e.secsCount," segundos")}}const ee=function(e,t,n){return{color:e,border:t,background:n}};function te(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"small",11),Z.YNc(2,$,2,1,"span",5),Z.YNc(3,K,2,2,"span",5),Z.YNc(4,X,2,1,"span",5),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(4,ee,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&e.data.config.noRetryInBadPhone)}}function ne(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1," ¿No has recibido el código en tu teléfono? "),Z.qZA())}function ie(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? ")}}function se(e,t){1&e&&(Z.TgZ(0,"span"),Z._uU(1," ¿No has recibido el código en el teléfono? "),Z.qZA())}const re=function(e,t){return{color:e,background:t}};function oe(e,t){if(1&e){const e=Z.EpF();Z.ynx(0),Z.TgZ(1,"small",11),Z.YNc(2,ne,2,0,"span",5),Z.YNc(3,ie,2,1,"span",5),Z.YNc(4,se,2,0,"span",5),Z.TgZ(5,"a",12),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.resendOTP())})),Z._uU(6,"Reenviar"),Z.qZA()(),Z.BQk()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(5,ee,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngIf",e.data.config.noRetryInBadPhone),Z.xp6(1),Z.Q6J("ngStyle",Z.WLB(9,re,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor))}}let ae=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new Z.vpe(null),this.errPhone=new Z.vpe(null),this.resendO=new Z.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,A.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?q(e.target).next().focus():"Backspace"==e.code&&q(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:16,vars:20,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.TgZ(5,"div",4),Z.YNc(6,te,5,8,"ng-container",5),Z.YNc(7,oe,7,12,"ng-container",5),Z.qZA(),Z.TgZ(8,"div",6)(9,"mat-form-field",7)(10,"mat-label"),Z._uU(11," Código OTP "),Z.qZA(),Z.TgZ(12,"input",8),Z.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),Z.qZA()()()(),Z.TgZ(13,"div",9)(14,"button",10),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(15,"Siguiente"),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.otp.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,18,t.texts.otp.description||""),Z.oJD),Z.xp6(3),Z.Q6J("ngIf",t.secsCount&&t.secsCount>0),Z.xp6(1),Z.Q6J("ngIf",!t.secsCount||t.secsCount<=0),Z.xp6(7),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,i.PC,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function le(e,t){if(1&e&&(Z.TgZ(0,"div",2),Z._UZ(1,"div",3)(2,"div",4),Z.ALo(3,"safeHtml"),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),Z.Q6J("innerHTML",e.texts.success.title,Z.oJD),Z.xp6(1),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(3,8,e.texts.success.description||""),Z.oJD)}}function ce(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",6),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.gotoRedirect())})),Z._uU(2),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),Z.xp6(1),Z.hij(" ",e.data[e.flowName].btnTextCallBack||"Haga click aquí para finalizar"," ")}}let de=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.videoS=n,this.route=i}ngOnInit(){this.route.queryParams.subscribe((e=>{e.request_id&&(this.requestID=e.request_id,this.videoS.setState(this.requestID,"success").then((e=>{console.log("Se ha seteado el status success correctamente")})).catch((e=>{console.error("No se ha seteado el status success. Error: ",e)})))}))}save(){}gotoRedirect(){this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(z),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",packId:"packId",requestID:"requestID",userId:"userId",flowName:"flowName"},decls:2,vars:2,consts:[["class","pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.YNc(0,le,4,10,"div",0),Z.YNc(1,ce,3,7,"div",1)),2&e&&(Z.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),Z.xp6(1),Z.Q6J("ngIf",t.data[t.flowName].enableUrlCallBack))},dependencies:[i.O5,u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ue(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",6),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.retry())})),Z._uU(2,"Intentarlo nuevamente"),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function he(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",5)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.newRequest())})),Z._uU(2,"Crear nueva solicitud"),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}let pe=(()=>{class e{constructor(e,t,n){this.utils=e,this.videoS=t,this.route=n,this.retryOp=new Z.vpe(null),this.newReq=new Z.vpe(null)}ngOnInit(){this.route.queryParams.subscribe((e=>{e.request_id&&(this.requestID=e.request_id,this.videoS.setState(this.requestID,"failed").then((e=>{console.log("Se ha seteado el status failed correctamente")})).catch((e=>{console.error("No se ha seteado el status failed. Error: ",e)})))}))}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(U.F),Z.Y36(z),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:7,vars:8,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.YNc(5,ue,3,6,"div",4),Z.YNc(6,he,3,6,"div",4),Z.qZA()),2&e&&(Z.xp6(2),Z.Q6J("innerHTML",t.texts.fail.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,6,t.texts.fail.description),Z.oJD),Z.xp6(2),Z.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),Z.xp6(1),Z.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var me=n(1763),fe=n(5696);const ge=["termsCheckbox"],_e=["termsCertCheckbox"],be=["assignmentCheckbox"];function ye(e,t){if(1&e&&(Z.TgZ(0,"mat-form-field",5)(1,"mat-label"),Z._uU(2,"Razón social"),Z.qZA(),Z._UZ(3,"input",28),Z.qZA()),2&e){const e=Z.oxw();Z.Gre("",e.disabledInputs.razon?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",e.disabledInputs.razon?-1:1)}}function ve(e,t){if(1&e&&(Z.TgZ(0,"mat-form-field",5)(1,"mat-label"),Z._uU(2,"CIF"),Z.qZA(),Z._UZ(3,"input",29),Z.qZA()),2&e){const e=Z.oxw();Z.Gre("",e.disabledInputs.cif?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",e.disabledInputs.cif?-1:1)}}function we(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",30)(1,"belender-checkbox",22),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setPower(t))})),Z._uU(2," Consiento expresamente a la activación de un poder digital según las condiciones que pueden verse "),Z.TgZ(3,"a",24),Z.NdJ("click",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.gotoPowerConditions(t))})),Z.TgZ(4,"u"),Z._uU(5,"aquí"),Z.qZA()()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title)}}function xe(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",21)(1,"belender-checkbox",22,31),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setAssignment(t))})),Z._UZ(3,"div",32),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("innerHTML",null==e.data?null:e.data.config.dataAssignmentText,Z.oJD)}}const Ce=function(e){return{"dont-show-data":e}},ke={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Te=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.cd=n,this.requestID=null,this.next=new Z.vpe(null),this.goTerms=new Z.vpe(null),this.goTermsCert=new Z.vpe(null),this.goPower=new Z.vpe(null),this.acceptTerms=!1,this.acceptTerms2=!1,this.step=0,this.assignment=!1,this.disabledInputs={dni:!1,name:!1,lastname:!1,secondlastname:!1,phone:!1,email:!1,razon:!1,cif:!1,type:!1},this.requestAux={phone:null,email:null,razon:null,cif:null,name:null,lastname:null,secondLastname:null,dni:null,type:"NATURAL"},this.noValidate=!1,this.powerActivate=!1}ngOnInit(){this.solicitud?(this.noValidate="terms_and_conditions"==this.solicitud.status_code,this.setForm(this.solicitud)):this.setForm(null)}tabChanged(e){this.requestAux.type=e.value,this.setForm(this.requestAux)}setForm(e){this.requestAux.phone=e?e.person_phone||e.phone:null,this.requestAux.email=e?e.person_email||e.email||e.email_copy:null,this.requestAux.razon=e&&e.razon_social?e.razon_social:null,this.requestAux.cif=e&&e.cif?e.cif:null,this.requestAux.name=e?e.person_name||e.name:null,this.requestAux.lastname=e?e.person_first_surname||e.first_surname:null,this.requestAux.secondLastname=e?e.person_second_surname||e.second_surname:null,this.requestAux.dni=e&&e.document_number?e.document_number:e&&e.person_document_number?e.person_document_number:null,this.requestAux.type=e&&e.person_type?e.person_type:this.requestAux.type,this.form=this.fb.group("NATURAL"==this.requestAux.type?{type:[this.requestAux.type],name:[this.requestAux.name||null,this.noValidate?[]:[p.kI.required]],lastname:[this.requestAux.lastname||null,this.noValidate?[]:[p.kI.required]],secondLastname:[this.requestAux.secondLastname||null],email:[this.requestAux.email||null,this.noValidate?[]:[p.kI.required,p.kI.email]],phone:[this.requestAux.phone||"",this.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],dni:[this.requestAux.dni||null,this.noValidate?[]:[p.kI.required]]}:{type:[this.requestAux.type],name:[this.requestAux.name||null,this.noValidate?[]:[p.kI.required]],lastname:[this.requestAux.lastname||null,this.noValidate?[]:[p.kI.required]],secondLastname:[this.requestAux.secondLastname||null],email:[this.requestAux.email||null,this.noValidate?[]:[p.kI.required,p.kI.email]],dni:[this.requestAux.dni||null,this.noValidate?[]:[p.kI.required]],phone:[this.requestAux.phone||"",this.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],razon:[this.requestAux.razon||null,this.noValidate?[]:[p.kI.required]],cif:[this.requestAux.cif||null,this.noValidate?[]:[p.kI.required]]}),this.requestIDFromURL&&this.disableEnableInputs(this.requestAux.type,this.requestAux.name,this.requestAux.lastname,this.requestAux.secondLastname,this.requestAux.email,this.requestAux.phone,this.requestAux.dni,this.requestAux.razon,this.requestAux.cif),this.cd.markForCheck()}disableEnableInputs(e,t,n,i,s,r,o,a,l){this.disabledInputs={name:t||!1,lastname:n||!1,secondlastname:i||!1,email:s||!1,phone:r||!1,dni:o||!1,razon:a||!1,cif:l||!1,type:e||!1}}enableInput(e){this.disabledInputs[e]=!1,this.cd.markForCheck()}nextStep(){let e;e="NATURAL"==this.requestAux.type?{email_copy:this.form.get("email").value,phone:this.form.get("phone").value,name:this.form.get("name").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("secondLastname").value,document_number:this.form.get("dni").value,type:"Natural"}:{email_copy:this.form.get("email").value,phone:this.form.get("phone").value,name:this.form.get("name").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("secondLastname").value,document_number:this.form.get("dni").value,company_name:this.form.get("razon").value,cif:this.form.get("cif").value,type:"Legal",rmc_validation:this.userId},(this.data.config.activatePower||this.solicitud?.power_activate)&&(e.power_activate=1,e.terms_and_conditions_power=1),this.next.emit(e)}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(e){e.preventDefault(),e.stopPropagation(),this.goTermsCert.emit(!0)}setAssignment(e){this.assignment=e}getAssignmentValidation(){return!this.data.config.dataAssignmentCheck||this.assignment}setTerms2(e){this.acceptTerms2=e}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setTerms2Check(e){this.certCheckComponent.checked=e,this.acceptTerms2=e}setAssignmentCheck(e){this.assignmentCheckComponent.checked=e,this.assignment=e}setTerms(e){this.acceptTerms=e}getIfValid(){let e=this.form.invalid;return this.noValidate&&(e=!1),!((this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&!this.powerActivate)&&!e&&this.acceptTerms&&this.acceptTerms2&&this.getAssignmentValidation()}setPower(e){this.powerActivate=e}gotoPowerConditions(e){this.goPower.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(Z.sBO))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(Z.Gf(ge,5),Z.Gf(_e,5),Z.Gf(be,5)),2&e){let e;Z.iGM(e=Z.CRH())&&(t.checkComponent=e.first),Z.iGM(e=Z.CRH())&&(t.certCheckComponent=e.first),Z.iGM(e=Z.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{requestID:"requestID",flowName:"flowName",data:"data",texts:"texts",solicitud:"solicitud",userId:"userId",requestIDFromURL:"requestIDFromURL"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",goPower:"goToPower"},features:[Z._Bn([{provide:T.sG,useValue:ke},{provide:Z.soG,useValue:"es-ES"}])],decls:57,vars:63,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-1","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between",3,"ngClass"],["appearance","outline"],["formControlName","type",3,"tabindex","selectionChange"],["value","NATURAL"],["value","LEGAL"],["formControlName","name","matInput","",3,"tabindex"],["formControlName","lastname","matInput","",3,"tabindex"],["formControlName","secondLastname","matInput","",3,"tabindex"],["formControlName","email","placeholder","Ej: mi_email@dominio.com","type","email","matInput","",3,"tabindex"],["formControlName","phone","placeholder","Ej: 123123123","maxlength","9","type","text","matInput","",3,"tabindex"],["formControlName","dni","maxlength","9","minlength","9","placeholder","Ej: 2222221R","type","text","matInput","",3,"tabindex"],["appearance","outline",3,"class",4,"ngIf"],[1,"mt-8","flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","showPolicyLink","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["class","flex justify-between items-center w-full flex-100",4,"ngIf"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["termsCertCheckbox",""],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],["formControlName","razon","placeholder","Ej: Mi Empresa","type","text","matInput","",3,"tabindex"],["formControlName","cif","placeholder","Ej: 123123123","type","text","matInput","",3,"tabindex"],[1,"flex","justify-between","items-center","w-full","flex-100"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.TgZ(5,"div",4)(6,"mat-form-field",5)(7,"mat-label"),Z._uU(8,"Tipo de persona"),Z.qZA(),Z.TgZ(9,"mat-select",6),Z.NdJ("selectionChange",(function(e){return t.tabChanged(e)})),Z.TgZ(10,"mat-option",7),Z._uU(11,"Natural"),Z.qZA(),Z.TgZ(12,"mat-option",8),Z._uU(13,"Legal"),Z.qZA()()(),Z.TgZ(14,"mat-form-field",5)(15,"mat-label"),Z._uU(16,"Nombre"),Z.qZA(),Z._UZ(17,"input",9),Z.qZA(),Z.TgZ(18,"mat-form-field",5)(19,"mat-label"),Z._uU(20,"Primer apellido"),Z.qZA(),Z._UZ(21,"input",10),Z.qZA(),Z.TgZ(22,"mat-form-field",5)(23,"mat-label"),Z._uU(24,"Segundo apellido"),Z.qZA(),Z._UZ(25,"input",11),Z.qZA(),Z.TgZ(26,"mat-form-field",5)(27,"mat-label"),Z._uU(28,"Email"),Z.qZA(),Z._UZ(29,"input",12),Z.qZA(),Z.TgZ(30,"mat-form-field",5)(31,"mat-label"),Z._uU(32,"Teléfono"),Z.qZA(),Z._UZ(33,"input",13),Z.qZA(),Z.TgZ(34,"mat-form-field",5)(35,"mat-label"),Z._uU(36,"DNI"),Z.qZA(),Z._UZ(37,"input",14),Z.qZA(),Z.YNc(38,ye,4,4,"mat-form-field",15),Z.YNc(39,ve,4,4,"mat-form-field",15),Z.qZA(),Z.TgZ(40,"div",16)(41,"belender-checkbox",17,18),Z.NdJ("changeCheckbox",(function(e){return t.setTerms2(e)})),Z.TgZ(43,"belender-terms-and-policy-links",19),Z.NdJ("goToTerms",(function(e){return t.gotoTermsAndConditions(e)})),Z.qZA()()(),Z.YNc(44,we,6,1,"div",20),Z.TgZ(45,"div",21)(46,"belender-checkbox",22,23),Z.NdJ("changeCheckbox",(function(e){return t.setTerms(e)})),Z._uU(48," He leído y acepto los "),Z.TgZ(49,"a",24),Z.NdJ("click",(function(e){return t.gotoTermsAndConditionsCertificate(e)})),Z.TgZ(50,"u"),Z._uU(51,"términos y condiciones"),Z.qZA()(),Z._uU(52," para la emisión del certificado "),Z.qZA()(),Z.YNc(53,xe,4,2,"div",25),Z.TgZ(54,"div",26)(55,"button",27),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(56," Continuar "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.form.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,59,t.texts.form.description||""),Z.oJD),Z.xp6(2),Z.Q6J("ngClass",Z.VKq(61,Ce,t.data.config.dontShowDataInTerms&&t.solicitud&&t.solicitud.status_code&&"terms_and_conditions"===t.solicitud.status_code)),Z.xp6(1),Z.Gre("",t.disabledInputs.type?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.type?-1:1),Z.xp6(5),Z.Gre("",t.disabledInputs.name?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.name?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.lastname?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.lastname?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.secondlastname?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.secondlastname?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.email?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.email?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.phone?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.phone?-1:1),Z.xp6(1),Z.Gre("",t.disabledInputs.dni?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",t.disabledInputs.dni?-1:1),Z.xp6(1),Z.Q6J("ngIf","LEGAL"==t.requestAux.type),Z.xp6(1),Z.Q6J("ngIf","LEGAL"==t.requestAux.type),Z.xp6(2),Z.Q6J("color",t.data.styles.colors.title),Z.xp6(2),Z.Q6J("userId",t.userId)("showPolicyLink",null==t.data?null:t.data.config.showPolicyLink)("firstSentence",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.firstSentence)("secondSentence",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.secondSentence)("thirdSentence",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.thirdSentence)("policyActionText",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.policyActionText)("termsActionText",null==t.data[t.flowName]||null==t.data[t.flowName].texts||null==t.data[t.flowName].texts.form?null:t.data[t.flowName].texts.form.termsActionText)("customTerms",t.data[t.flowName].customTerms),Z.xp6(1),Z.Q6J("ngIf",t.requestID?null==t.solicitud?null:t.solicitud.power_activate:null==t.data?null:t.data.config.activatePower),Z.xp6(2),Z.Q6J("color",t.data.styles.colors.title),Z.xp6(7),Z.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),Z.xp6(2),Z.Udp("color",t.getIfValid()?t.data.styles.colors.btnText:"")("background",t.getIfValid()?t.data.styles.colors.btnBg:"")("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",!t.getIfValid()))},dependencies:[i.mk,i.O5,u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,f.gD,T.ey,me.b,fe.T,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})(),Me=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.Activatedroute=n,this.next=new Z.vpe(null),this.accept=!1}ngOnInit(){this.Activatedroute.queryParams.subscribe((e=>{this.setForm(e)}))}nextStep(){let e={phone:this.form.get("phone").value};this.next.emit(e)}setForm(e){this.form=this.fb.group({phone:["",p.kI.required]}),this.solicitud&&"bad_phone"==this.solicitud.status_code&&this.form.controls.phone.markAsTouched()}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(L.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-error-form-step"]],inputs:{data:"data",flowName:"flowName",texts:"texts",mode:"mode",solicitud:"solicitud"},outputs:{next:"nextStep"},decls:14,vars:14,consts:[[1,"animated","fadeIn","fixed-content",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","phone","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1)(2,"div",2),Z._uU(3," Error con el teléfono "),Z.qZA(),Z.TgZ(4,"div",3),Z._uU(5," El teléfono ingresado no coincide con registrado en la Seguridad Social, por favor ingrese otro "),Z.qZA()(),Z.TgZ(6,"div",4)(7,"mat-form-field",5)(8,"mat-label"),Z._uU(9,"Teléfono"),Z.qZA(),Z._UZ(10,"input",6),Z.qZA()(),Z.TgZ(11,"div",7)(12,"button",8),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(13," Continuar "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.xp6(2),Z.Udp("color",t.data.styles.colors.text),Z.xp6(8),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[u.lW,D.KE,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Se=n(5145);let Ie=(()=>{class e{constructor(e){this.utils=e,this.status="",this.label="Cargando datos.."}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":Se.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)}))}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(U.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"mat-progress-spinner"),Z.TgZ(3,"p"),Z._uU(4),Z.qZA()()()),2&e&&(Z.xp6(4),Z.Oqu(t.label))},dependencies:[v.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Oe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new Z.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return"Abandonado después de esperar OTP de Seguridad Social";case"abandoned_after_invalid_otp_seguridad_social":return"Abandonado despues de OTP inválido en Seguridad Social";case"abandoned_after_invalid_otp_aeat":return"Abandonado despues de OTP inválido en AEAT";case"abandoned_after_waiting_otp_aeat":return"Abandonado después de esperar OTP de AEAT";default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(U.F),Z.Y36(_.M),Z.Y36(y.o),Z.Y36(M.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:10,vars:17,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.TgZ(5,"div",4),Z._uU(6),Z.qZA()(),Z.TgZ(7,"div",5)(8,"button",6),Z.NdJ("click",(function(){return t.retry()})),Z._uU(9,"Intentarlo nuevamente"),Z.qZA()()()),2&e&&(Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.abandoned.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,15,t.texts.abandoned.description),Z.oJD),Z.xp6(3),Z.hij(" ",t.getTextStatus()," "),Z.xp6(2),Z.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Le(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function Pe(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña es requerida "),Z.qZA())}function Ae(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña debe tener al menos 8 carácteres "),Z.qZA())}function Ee(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," Es necesario repetir la contraseña "),Z.qZA())}function De(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," Las contraseñas deben coincidir "),Z.qZA())}function Ne(e,t){1&e&&(Z.TgZ(0,"mat-hint",12),Z._uU(1," La contraseña debe tener al menos 8 carácteres "),Z.qZA())}const Ye={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let qe=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.form=new p.cw({}),this.next=new Z.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Le("password","confirm_password")})}nextStep(){let e={password:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.qu),Z.Y36(U.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep"},features:[Z._Bn([{provide:T.sG,useValue:Ye},{provide:Z.soG,useValue:"es-ES"}])],decls:22,vars:23,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(Z.TgZ(0,"form",0)(1,"div",1),Z._UZ(2,"div",2)(3,"div",3),Z.ALo(4,"safeHtml"),Z.qZA(),Z.TgZ(5,"div",4)(6,"mat-form-field",5)(7,"mat-label"),Z._uU(8,"Contraseña"),Z.qZA(),Z._UZ(9,"input",6),Z.YNc(10,Pe,2,0,"mat-hint",7),Z.YNc(11,Ae,2,0,"mat-hint",7),Z.qZA(),Z.TgZ(12,"mat-form-field",8)(13,"mat-label"),Z._uU(14,"Repite Contraseña"),Z.qZA(),Z._UZ(15,"input",9),Z.YNc(16,Ee,2,0,"mat-hint",7),Z.YNc(17,De,2,0,"mat-hint",7),Z.YNc(18,Ne,2,0,"mat-hint",7),Z.qZA()(),Z.TgZ(19,"div",10)(20,"button",11),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(21," Guardar "),Z.qZA()()()),2&e&&(Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.password.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(4,21,t.texts.password.description),Z.oJD),Z.xp6(7),Z.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),Z.xp6(5),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.confirmedValidator),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.invalid&&t.f.confirm_password.errors.minlength),Z.xp6(2),Z.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,u.lW,D.KE,D.bx,D.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,G.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const Re=["formStep"];function Fe(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-power-cert",3),Z.NdJ("accept",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.acceptPowerCert())})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("hideButtons",!1)("flow","VideoID")("userId",e.userId)}}function Ze(e,t){if(1&e&&(Z.TgZ(0,"div",10),Z._UZ(1,"img",11),Z.qZA()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("src",e.data.styles.logoUrl,Z.LSH)}}function Ue(e,t){1&e&&(Z.TgZ(0,"div",12),Z._UZ(1,"mat-progress-spinner",13),Z.qZA()),2&e&&(Z.xp6(1),Z.Q6J("value",0))}function He(e,t){if(1&e&&Z._UZ(0,"belender-loading-step",23),2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("status",null==e.solicitud?null:e.solicitud.status_code)}}function je(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-form-step",24,25),Z.NdJ("goToTerms",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoTermsAndConditions())}))("goToPower",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.gotoOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("flowName",e.flowName)("requestID",e.requestID)("requestIDFromURL",e.requestIDFromURL)("userId",e.userId)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function ze(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-otp-step",26),Z.NdJ("resendOTP",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.resendOTP(t))}))("errorPhone",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.requestOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Be(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-password-step",27),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.sendPassword(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Je(e,t){if(1&e&&Z._UZ(0,"belender-success-step",28),2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("flowName",e.flowName)("packId",e.packId)("userId",e.userId)("requestID",e.requestID)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Ve(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-fail-step",29),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.retryRequest(t))}))("newRequest",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.newRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Qe(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-error-form-step",30),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.sendNewData(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("solicitud",e.solicitud)("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function We(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-abandoned-step",31),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.retryRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("solicitud",e.solicitud)("data",e.data)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Ge(e,t){if(1&e&&(Z.TgZ(0,"div",32)(1,"div",33)(2,"h1",34),Z._uU(3,"No existe la solicitud"),Z.qZA()(),Z.TgZ(4,"div",35),Z._uU(5," No existen solicitudes activas con el código requerido "),Z.qZA()()),2&e){const e=Z.oxw(4);Z.xp6(4),Z.Udp("color",e.data.styles.colors.text)}}function $e(e,t){if(1&e&&(Z.ynx(0),Z.YNc(1,He,1,2,"belender-loading-step",14),Z.YNc(2,je,2,7,"belender-form-step",15),Z.YNc(3,ze,1,3,"belender-otp-step",16),Z.YNc(4,Be,1,3,"belender-password-step",17),Z.YNc(5,Je,1,6,"belender-success-step",18),Z.YNc(6,Ve,1,3,"belender-fail-step",19),Z.YNc(7,Qe,1,3,"belender-error-form-step",20),Z.YNc(8,We,1,3,"belender-abandoned-step",21),Z.YNc(9,Ge,6,2,"div",22),Z.BQk()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("ngIf","loading"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","form"==e.getStatus()&&!e.loading),Z.xp6(1),Z.Q6J("ngIf","otp"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","password"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","success"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","failed"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","error-data"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","abandoned"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf","no-exist"==e.getStatus())}}function Ke(e,t){1&e&&Z._UZ(0,"belender-disabled-url")}function Xe(e,t){if(1&e&&(Z.TgZ(0,"div",36),Z._UZ(1,"mat-progress-spinner",37),Z.TgZ(2,"p",38),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.hij(" ",e.loading," ")}}function et(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",39)(1,"div",32)(2,"div",40),Z._uU(3,"Error!"),Z.qZA(),Z._UZ(4,"div",41),Z.qZA(),Z.TgZ(5,"div",42)(6,"button",43),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.error=!1)})),Z._uU(7," Ingresar manualmente "),Z.qZA()()()}if(2&e){const e=Z.oxw(3);Z.xp6(4),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",e.error,Z.oJD)}}function tt(e,t){if(1&e&&(Z.TgZ(0,"div",4)(1,"div"),Z.YNc(2,Ze,2,1,"div",6),Z.YNc(3,Ue,2,1,"div",7),Z.YNc(4,$e,10,9,"ng-container",5),Z.YNc(5,Ke,1,0,"belender-disabled-url",5),Z.YNc(6,Xe,4,3,"div",8),Z.YNc(7,et,8,3,"div",9),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.styles.withLogo&&"loading"!=e.getStatus()),Z.xp6(1),Z.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"==e.getStatus()),Z.xp6(1),Z.Q6J("ngIf",!e.error&&!e.disableURL),Z.xp6(1),Z.Q6J("ngIf",!e.error&&e.disableURL),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error),Z.xp6(1),Z.Q6J("ngIf",!e.loading&&e.error)}}function nt(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"div",44),Z._uU(2),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw(2);Z.xp6(2),Z.hij(" TestMode ",e.testMode?"ON":"OFF"," ")}}function it(e,t){if(1&e&&(Z.TgZ(0,"div",4),Z.YNc(1,tt,8,11,"div",1),Z.YNc(2,nt,3,1,"ng-container",5),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngIf",e.data),Z.xp6(1),Z.Q6J("ngIf",e.testMode)}}function st(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-terms",45),Z.NdJ("accepted",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!1))})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("flow","videoid")("requestStatus",e.solicitud?e.solicitud.status_code:"")}}let rt=class{constructor(e,t,n,i,s,r,o,a,l){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.webhooksService=a,this.dialog=l,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.requestIDFromURL=!1,this.requestCreated=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.flowName="VideoID",this.showTermsDialog=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.userId?this.setInitialData(this.userId):this.loading=null,"pro"!=R.N.env&&(q(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),q(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)}))),this.utils.setLoading(!1)}ngOnDestroy(){}sendMessageToParent(e){window.top.postMessage(e,"*")}setInitialData(e){var t=this;return(0,A.Z)((function*(){const n=yield t.getFlow(e);if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},!t.data.config||!t.data.config.funder_id)return t.notis.showAlert("Error!","No se ha configurado la customización del widget para este usuario","error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,A.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName).then((e=>{e&&e.data&&n(e.data),n(null)}),(e=>{n(null)}))}))}))()}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e&&this.setParamsToRequest(e),e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):this.loading=null}),(e=>{this.loading=null}))}setFormFromVcCode(e){var t=this;return(0,A.Z)((function*(){t.loading="Obteniendo datos de la solicitud...",t.videoIDService.getSolicitudByCode(e).then((e=>{e&&e.data?(t.solicitud=e.data,t.requestCreated=!0,t.requestIDFromURL=!0,t.setSubscriptionOfRequest(),t.loading=null,t.solicitud.status_code&&"waiting_video"===t.solicitud.status_code&&t.solicitud.url_video_id&&location.assign(t.solicitud.url_video_id),t.skipCreationOfRequest=t.solicitud&&t.solicitud.status_code&&"prerequest"!=t.solicitud.status_code,t.autoAcceptTerms&&t.gotoOTP()):t.loading=null})).catch((e=>{t.loading=null}))}))()}setParamsToRequest(e){this.requestIDFromURL=!0,this.solicitud||(this.solicitud={status_code:"form"}),e.document&&!this.solicitud.person_document_number&&(this.solicitud.document_number=e.document),e.birthday&&!this.solicitud.birth_date&&(this.solicitud.birth_date=e.birthday),e.expiration&&!this.solicitud.document_expiration_date&&(this.solicitud.document_expiration_date=e.expiration),e.type&&!this.solicitud.person_type&&(this.solicitud.person_type=e.type),e.phone&&!this.solicitud.person_phone&&(this.solicitud.person_phone=e.phone),e.email&&!this.solicitud.person_email&&(this.solicitud.person_email=e.email),e.cif&&!this.solicitud.cif&&(this.solicitud.cif=e.cif),e.razon&&!this.solicitud.razon_social&&(this.solicitud.razon_social=e.razon),e.name&&!this.solicitud.person_name&&(this.solicitud.person_name=e.name),e.lastname&&!this.solicitud.person_first_surname&&(this.solicitud.person_first_surname=e.lastname),e.second_lastname&&!this.solicitud.person_second_surname&&(this.solicitud.person_second_surname=e.second_lastname)}handlePusherNotification(e){this.dataFromFirebase=e,this.sendMessageToParent({type:"websocket",data:e}),this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,"invalid_otp_seguridad_social"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500))}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.videoIDService.resendOTP(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}gotoTerms(e){this.loading="Enviando datos..",e.package_id=this.packId,e.user_id=this.userId,this.requestID&&(e.request_id=this.requestID),this.testMode?setTimeout((()=>{this.solicitud=new Y.l,this.solicitud.status_code="waiting_otp_seguridad_social",this.loading=null}),4e3):this.skipCreationOfRequest?(this.gotoOTP(),this.setSubscriptionOfRequest()):this.videoIDService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.solicitud=e,t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha de nacimiento incorrecta")):"Incorrect date"==t.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha incorrecta")):(this.solicitud.status_code="no_service",this.loading=null):(this.solicitud.status_code="form",this.showAlert("Error!",t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.solicitud=t.data,this.sendMessageToParent({type:"response",data:t.data||t}),this.gotoOTP()):this.showAlert("Error!","Error desconocido: "+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==R.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==R.N.env&&(e="wss://notifications.belender.net"),R.N.notificationsBaseUrl&&(e=R.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=null})))}sendNewData(e){this.loading="Enviando información..",this.videoIDService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e),this.loading=null):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse("Validando nuevos datos, espere por favor.."),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}gotoOTP(e){let t=e;t.user_id=this.userId,t.package_id=this.packId,this.requestCreated?this.setTerms(e):(this.initWaitingForResponse("Iniciando el proceso de emisión de certificado.."),this.videoIDService.addSolicitud(t).then((n=>{n.status&&"error"==n.status?(console.error("error en el then",n),this.solicitud=t,this.solicitud.status_code="form",n.message?(this.showAlert("Error!",n.message),n.message&&" Teléfono incorrecto"===n.message&&setTimeout((()=>{this.formComponent.enableInput("phone")}),1e3)):this.showAlert("Error!",n)):n&&"success"==n.status&&(this.sendMessageToParent({type:"response",data:n.data||n}),this.solicitud=n.data,this.requestID=n.data.request_id,this.setSubscriptionOfRequest(),this.cd.markForCheck(),this.setTerms(e))})).catch((e=>{console.error("errooooooorrrrr",e),e&&e.error&&this.showAlert("Error!",e.error),this.loading=null})))}setTerms(e){this.loading="Enviando datos..";let t={request_id:this.solicitud.request_id,terms_and_conditions_service:!0,terms_and_conditions_certificate_emition:!0};(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e.terms_and_conditions_power),this.testMode?setTimeout((()=>{this.solicitud=new Y.l,this.solicitud.status_code="waiting_otp_seguridad_social",this.loading=null}),4e3):this.videoIDService.acceptTerms(t).then((e=>{e&&e.status&&"error"==e.status?(this.solicitud=t,e.message&&(400==e.code?"Birthdate incorrect"==e.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha de nacimiento incorrecta")):"Incorrect date"==e.message?(this.solicitud.status_code="form",this.showAlert("Error!","Fecha incorrecta!")):(this.solicitud.status_code="no_service",this.loading=null):(this.solicitud.status_code="form",this.showAlert("Error!",e.message)))):e&&e.status&&"success"==e.status?(this.solicitud.status_code="waiting_password",this.sendMessageToParent({type:"response",data:e.data||e}),this.loading=null):this.showAlert("Error!","Error desconocido: "+e)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}sendPassword(e){this.loading="Enviando password..",console.error("password: ",e),e.request_id=this.requestID,this.videoIDService.sendPassword(e).then((e=>{e&&e.status&&"error"==e.status?e.message&&(400==e.code?(this.solicitud.status_code="no_service",this.loading=null):(this.solicitud.status_code="waiting_password",this.showAlert("Error!",e.message))):e&&e.status&&"success"==e.status?(this.solicitud.status_code="waiting_otp",this.sendMessageToParent({type:"response",data:e.data||e})):this.showAlert("Error!","Error desconocido: "+e)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}requestOTP(e){this.loading="Enviando OTP..",this.testMode?setTimeout((()=>{this.solicitud=new Y.l,this.solicitud.status_code="all_documents_downloaded",this.loading=null}),2e3):this.videoIDService.sendOTP({request_id:this.requestID,otp:e.code}).then((e=>{e.status&&"error"==e.status?(this.showAlert("Error!",e.message?"invalid_otp"==e.message?"El código introducido no es correcto. Por favor, inténtelo de nuevo":e.message:e),this.loading=!1):e&&"success"==e.status&&(this.loading="Redirigiendo a Vintegris, aguarde por favor...",this.solicitud.status_code="loading",this.sendMessageToParent({type:"response",data:e.data||e}),this.cd.markForCheck(),location.assign(e.message))})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=null}))}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}gotoErrorPhone(){}setRequestStatus(e){this.solicitud.status_code=e}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading="Reintentando enviar la solicitud...",this.setSubscriptionOfRequest(),this.videoIDService.retryRequest(t).then((e=>{e&&e.data&&(this.solicitud=e.data),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}newRequest(e){this.solicitud.status_code="created"}getStatus(){return!this.solicitud||this.solicitud&&("created"==this.solicitud.status_code||"terms_and_conditions"==this.solicitud.status_code||"form"==this.solicitud.status_code)?"form":!this.solicitud||"waiting_login_seguridad_social"!=this.solicitud.status_code&&"loading"!=this.solicitud.status_code&&"saved_otp"!=this.solicitud.status_code?!this.solicitud||"waiting_otp"!=this.solicitud.status_code&&"invalid_otp"!=this.solicitud.status_code?!this.solicitud||"waiting_password"!=this.solicitud.status_code&&"approved_terms_digital_power"!=this.solicitud.status_code&&"declined_terms_digital_power"!=this.solicitud.status_code?!this.solicitud||"abandoned_after_bad_phone"!=this.solicitud.status_code&&"abandoned_after_invalid_otp_seguridad_social"!=this.solicitud.status_code&&"abandoned_after_terms_and_conditions"!=this.solicitud.status_code&&"abandoned_after_waiting_otp_seguridad_social"!=this.solicitud.status_code?!this.solicitud||"certificate_created"!=this.solicitud.status_code&&"waiting_certificate"!=this.solicitud.status_code&&"all_documents_downloaded"!=this.solicitud.status_code&&"partial_documents_downloaded"!=this.solicitud.status_code&&"waiting_video"!=this.solicitud.status_code&&"consent_process_completed"!=this.solicitud.status_code&&"waiting_documents"!=this.solicitud.status_code?!this.solicitud||"bad_phone"!=this.solicitud.status_code&&"phone_not_exist_otp"!=this.solicitud.status_code?!this.solicitud||"failed_with_retry"!=this.solicitud.status_code&&"failed_without_retry"!=this.solicitud.status_code&&"rejected_identity"!=this.solicitud.status_code&&"failed_documents_downloaded"!=this.solicitud.status_code?this.solicitud&&"no_service"==this.solicitud.status_code?"no-service":"no-exist":"failed":this.data.config.noRetryInBadPhone?"otp":"error-data":this.data.infiniteLoopInCompleted||"waiting_video"==this.solicitud.status_code?(this.loading="Aguardando validación por Video ID","loading"):"success":"abandoned":"password":"otp":(this.loading="Estamos procesando su solicitud. Espere un momento por favor","loading")}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,e&&this.formComponent.setTermsCheck(!0)}gotoTermsAndConditionsCertificate(){this.dialog.open(F.v,{panelClass:"fullscreen-dialog",data:{flow:"videoid"}}).afterClosed().subscribe((e=>{e&&this.formComponent.setTerms2Check(!0)}))}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}};function ot(e,t){if(1&e&&(Z.TgZ(0,"div",6),Z._UZ(1,"img",7),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("src",e.data.styles.logoUrl,Z.LSH)}}function at(e,t){if(1&e&&(Z.TgZ(0,"div",8),Z._UZ(1,"mat-progress-spinner",9),Z.TgZ(2,"p",10),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function lt(e,t){if(1&e&&(Z.TgZ(0,"div",1)(1,"div",2),Z.YNc(2,ot,2,1,"div",3),Z._UZ(3,"belender-success-step",4),Z.YNc(4,at,4,3,"div",5),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.styles.withLogo),Z.xp6(1),Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error)}}rt.ɵfac=function(e){return new(e||rt)(Z.Y36(Z.sBO),Z.Y36(L.gz),Z.Y36(U.F),Z.Y36(z),Z.Y36(C.w),Z.Y36(B.r),Z.Y36(M.T),Z.Y36(w.t),Z.Y36(J.uw))},rt.ɵcmp=Z.Xpm({type:rt,selectors:[["belender-widget-videoid"]],viewQuery:function(e,t){if(1&e&&Z.Gf(Re,5),2&e){let e;Z.iGM(e=Z.CRH())&&(t.formComponent=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[Z._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:3,vars:3,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","requestStatus","accepted","cancelled",4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],[4,"ngIf"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"data","status",4,"ngIf"],[3,"data","flowName","requestID","requestIDFromURL","userId","texts","solicitud","goToTerms","goToPower","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","texts","solicitud","nextStep",4,"ngIf"],[3,"data","flowName","packId","userId","requestID","texts",4,"ngIf"],[3,"data","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","texts","nextStep",4,"ngIf"],[3,"solicitud","data","texts","retry",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"data","status"],[3,"data","flowName","requestID","requestIDFromURL","userId","texts","solicitud","goToTerms","goToPower","goToTermsCertificate","nextStep"],["formStep",""],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","texts","solicitud","nextStep"],[3,"data","flowName","packId","userId","requestID","texts"],[3,"data","texts","solicitud","retry","newRequest"],[3,"solicitud","data","texts","nextStep"],[3,"solicitud","data","texts","retry"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"],[3,"flow","requestStatus","accepted","cancelled"]],template:function(e,t){1&e&&(Z.YNc(0,Fe,1,3,"vex-power-cert",0),Z.YNc(1,it,3,2,"div",1),Z.YNc(2,st,1,2,"vex-terms",2)),2&e&&(Z.Q6J("ngIf",t.viewPowerTerms),Z.xp6(1),Z.Q6J("ngIf",t.data),Z.xp6(1),Z.Q6J("ngIf",t.showTermsDialog))},dependencies:[i.O5,u.lW,v.Ou,V.L,Q.L,W.q,ae,de,pe,Te,Me,Ie,Oe,qe],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),rt=(0,E.gn)([(0,N.c)()],rt);let ct=class{constructor(e,t,n,i,s,r,o){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.notis=r,this.webhooksService=o,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=null,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=null})),"pro"!=R.N.env&&(q(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),q(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)}))),this.utils.setLoading(!1)}ngOnDestroy(){}setInitialData(e){this.customizationService.getCustomization(e).then((e=>{e&&(this.data=e,this.financiadorID=e.funder_id||"",this.cd.markForCheck()),this.loading=null}),(e=>{console.error(e),this.loading=null}))}handlePusherNotification(e){this.dataFromFirebase=e,this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,"invalid_otp_seguridad_social"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==R.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==R.N.env&&(e="wss://notifications.belender.net"),R.N.notificationsBaseUrl&&(e=R.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=null})))}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}setRequestStatus(e){this.solicitud.status_code=e}};function dt(e,t){if(1&e&&(Z.TgZ(0,"div",6),Z._UZ(1,"img",7),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("src",e.data.styles.logoUrl,Z.LSH)}}function ut(e,t){if(1&e&&(Z.TgZ(0,"div",8),Z._UZ(1,"mat-progress-spinner",9),Z.TgZ(2,"p",10),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function ht(e,t){if(1&e&&(Z.TgZ(0,"div",1)(1,"div",2),Z.YNc(2,dt,2,1,"div",3),Z._UZ(3,"belender-fail-step",4),Z.YNc(4,ut,4,3,"div",5),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.styles.withLogo),Z.xp6(1),Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error)}}ct.ɵfac=function(e){return new(e||ct)(Z.Y36(Z.sBO),Z.Y36(L.gz),Z.Y36(U.F),Z.Y36(z),Z.Y36(C.w),Z.Y36(M.T),Z.Y36(w.t))},ct.ɵcmp=Z.Xpm({type:ct,selectors:[["belender-widget-videoid-success"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud",flowName:"flowName"},features:[Z._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:1,vars:1,consts:[["class","h-full widget-belender",4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],[3,"data","texts"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&Z.YNc(0,lt,5,6,"div",0),2&e&&Z.Q6J("ngIf",t.data)},dependencies:[i.O5,v.Ou,de],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),ct=(0,E.gn)([(0,N.c)()],ct);let pt=class{constructor(e,t,n,i,s,r,o){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.notis=r,this.webhooksService=o,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1}ngOnInit(){const e=this;this.loading="Obteniendo información de la solicitud",this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=null,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=null})),"pro"!=R.N.env&&(q(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),q(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)}))),this.utils.setLoading(!1)}ngOnDestroy(){}setInitialData(e){this.customizationService.getCustomization(e).then((e=>{e&&(this.data=e,this.financiadorID=e.funder_id||"",this.cd.markForCheck()),this.loading=null}),(e=>{console.error(e),this.loading=null}))}handlePusherNotification(e){this.dataFromFirebase=e,this.dataFromFirebase&&this.dataFromFirebase.status_code&&(this.solicitud.status_code=this.dataFromFirebase.status_code,"invalid_otp_seguridad_social"==this.solicitud.status_code&&this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS"),setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==R.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==R.N.env&&(e="wss://notifications.belender.net"),R.N.notificationsBaseUrl&&(e=R.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=null})))}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}setRequestStatus(e){this.solicitud.status_code=e}};pt.ɵfac=function(e){return new(e||pt)(Z.Y36(Z.sBO),Z.Y36(L.gz),Z.Y36(U.F),Z.Y36(z),Z.Y36(C.w),Z.Y36(M.T),Z.Y36(w.t))},pt.ɵcmp=Z.Xpm({type:pt,selectors:[["belender-widget-videoid-fail"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud",flowName:"flowName"},features:[Z._Bn([{provide:D.o2,useValue:{appearance:"standard"}}])],decls:1,vars:1,consts:[["class","h-full widget-belender",4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],[3,"data","texts","solicitud"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&Z.YNc(0,ht,5,7,"div",0),2&e&&Z.Q6J("ngIf",t.data)},dependencies:[i.O5,v.Ou,pe],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),pt=(0,E.gn)([(0,N.c)()],pt);const mt=[{path:":idUser",component:rt},{path:":idUser/:packID",component:rt},{path:":idUser/:packID/success",component:ct},{path:":idUser/:packID/fail",component:pt}];let ft=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({imports:[L.Bz.forChild(mt),L.Bz,P.d8]}),e})();var gt=n(6981),_t=n(3848),bt=n(1129),yt=n(1258),vt=n(3295),wt=n(2266),xt=n(3300),Ct=n(865);let kt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({providers:[_.M,y.o,C.w,w.t,M.T,O.t,{provide:T.Ad,useValue:"es-ES"}],imports:[ft,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,v.Cq,k.FA,T.XK,S.T5,I.Fk,gt.x,_t.Nh,bt.n,yt.H,vt.g,wt.L,xt.C,Ct.q]}),e})()},5469:(e,t,n)=>{n.d(t,{B:()=>b});var i=n(7582),s=n(9933),r=n(8259),o=n(4650),a=n(5089),l=n(7367),c=n(8460),d=n(9299),u=n(9045),h=n(6895),p=n(2237),m=n(9199);const f=["widgetCard"];function g(e,t){1&e&&(o.ynx(0),o._UZ(1,"router-outlet"),o.BQk())}const _=function(e){return{"margin-top":e}};let b=class{constructor(e,t,n,i,s){this.utils=e,this.customizationService=t,this.customizationStoreService=n,this.router=i,this.deviceInfoService=s,this.type="",this.widgetHeight=0,this.warningsSpace=0,this.isScaled=!1,this.funderConfigLoaded=!1,this.funderStylesLoaded=!1}ngOnInit(){this.getWindowsScreenOrientation(),this.utils.getWarningsSpaces().subscribe((e=>{this.warningsSpace=e}));let e=this.router.url.split("/");this.userId=e.length&&e.some((e=>"smspin"===e))?e&&e.length&&e[e.length-3]?e[e.length-3]:"":e&&e.length&&e[e.length-2]?e[e.length-2]:"",this.packId=e.length&&e.some((e=>"smspin"===e))?e&&e.length&&e[e.length-2]?e[e.length-2]:"":e&&e.length&&e[e.length-1]?e[e.length-1]:"";let t=this.packId.split("?");t&&t.length&&(this.packId=t[0]),console.error("packId",this.packId),this.userId&&(this.customizationStoreService.setUserID(this.userId),this.setCustomization()),this.packId&&this.customizationStoreService.setPackID(this.packId)}ngDoCheck(){this.getWidgetCardHeight()}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewInit(){r("body").css("background","transparent"),r("body").css("background-color","transparent")}getWindowsScreenOrientation(){window.addEventListener("resize",(()=>{this.widgetHeight=this.widgetCard.nativeElement.offsetHeight,this.isScaled&&(this.widgetHeight=1.5*this.widgetHeight),this.sendMessageToParent({type:"widgetHeight",data:this.widgetHeight})})),window.screen&&window.screen.orientation?(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler)):console.warn("Screen Orientation API not supported.")}getWidgetCardHeight(){this.widgetCard&&this.widgetHeight!=this.widgetCard.nativeElement.offsetHeight&&(this.widgetHeight=this.widgetCard.nativeElement.offsetHeight,this.isScaled$=this.deviceInfoService.isScaled$.subscribe((e=>{this.isScaled=e,this.isScaled&&(this.widgetHeight=1.5*this.widgetHeight)})),this.sendMessageToParent({type:"widgetHeight",data:this.widgetHeight}))}sendMessageToParent(e){window.top.postMessage(e,"*")}setCustomization(){this.customizationService.getFunderConfig(this.userId).then((e=>{this.customizationStoreService.setFunderConfig(e.data),this.funderConfigLoaded=!0})).catch((e=>{console.log("🚀 ~ WidgetComponent ~ this.customizationService.getCustomization ~ e:",e)})),this.customizationService.getFunderStyles(this.userId).then((e=>{this.customizationStoreService.setFunderStyles(e.data),this.funderStylesLoaded=!0})).catch((e=>{console.log("🚀 ~ WidgetComponent ~ this.customizationService.getCustomization ~ e:",e)}))}};b.ɵfac=function(e){return new(e||b)(o.Y36(a.F),o.Y36(l.w),o.Y36(c.r),o.Y36(d.F0),o.Y36(u.H))},b.ɵcmp=o.Xpm({type:b,selectors:[["belender-widget"]],viewQuery:function(e,t){if(1&e&&o.Gf(f,5),2&e){let e;o.iGM(e=o.CRH())&&(t.widgetCard=e.first)}},inputs:{type:"type"},decls:4,vars:4,consts:[[1,"belender-page-layout","h-auto","p-0","md:p-4","overflow-y-visible",3,"ngStyle"],[1,"h-auto","overflow-y-visible","content-layout","overflow-x-hidden","content-widget","p-0","md:p-3"],["widgetCard",""],[4,"ngIf"]],template:function(e,t){1&e&&(o.TgZ(0,"vex-page-layout",0)(1,"vex-page-layout-content",1,2),o.YNc(3,g,2,0,"ng-container",3),o.qZA()()),2&e&&(o.Q6J("ngStyle",o.VKq(2,_,t.warningsSpace+"px")),o.xp6(3),o.Q6J("ngIf",t.funderConfigLoaded&&t.funderStylesLoaded))},dependencies:[h.O5,h.PC,d.lC,p.w,m.d],styles:[".badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.card[_ngcontent-%COMP%]{margin:0 auto;max-width:440px}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.content-layout[_ngcontent-%COMP%]{max-height:none;max-height:initial;overflow-y:auto;padding:0!important}.belender-page-layout[_ngcontent-%COMP%]{padding:0!important}"]}),b=(0,i.gn)([(0,s.c)()],b)},2932:(e,t,n)=>{function i(e={}){return t=>{const n=t.value;if(!n)return null;const i=n.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(e.checkFormat&&!i)return{invalidFormat:!0};if(!i)return null;const s=parseInt(i[1],10),r=parseInt(i[2],10)-1,o=parseInt(i[3],10),a=new Date(o,r,s);if(e.checkDate&&(a.getFullYear()!==o||a.getMonth()!==r||a.getDate()!==s))return{invalidDate:!0};if(e.checkAge){const e=new Date;let t=e.getFullYear()-o;const n=e.getMonth()-r;if((n<0||0===n&&e.getDate()<s)&&t--,t<18)return{underAge:!0}}return null}}n.d(t,{s:()=>i})},3842:(e,t,n)=>{n.d(t,{VU:()=>i});const i={status:"success",data:{request_id:"a29879d5-1f42-400a-bcb5-caa69ab31402",user_id:"f2216861-9119-4f74-94ff-677a8926b77c",user_name:"Roger BackOffice",person_id:"fc02a51d-7782-4cb3-882d-cad847e5d9b5",person_name:"Roger",person_phone:"666666666",person_document_number:"44011547N",person_document_expiration_date:"2032-10-24",person_document_support:"",person_birth_date:"1981-08-12",person_email:"test@gmail.com",flow_id:"d73a6c00-3ab9-46c4-9a85-471c14ec361d",flow_name:"ClavePin",funder_id:"5468ba73-7d05-4c9c-a81f-748fe7dafaba",funder_name:"Belender",status_code:"terms_and_conditions",status_message:"La solicitud se encuentra en estado de espera de terminos y condiciones",package_id:"2e0cc952-1b98-41fe-9b86-a3e4a8dcafa7",widget_url:"https://widget.dev.belender.net/widget/clavepin/f2216861-9119-4f74-94ff-677a8926b77c/2e0cc952-1b98-41fe-9b86-a3e4a8dcafa7?request_id=a29879d5-1f42-400a-bcb5-caa69ab31402",widget_url_boxed:"https://widget.dev.belender.net/widget-boxed/clavepin/f2216861-9119-4f74-94ff-677a8926b77c/2e0cc952-1b98-41fe-9b86-a3e4a8dcafa7?request_id=a29879d5-1f42-400a-bcb5-caa69ab31402",has_documents:!1,created_at:"2025-01-07T20:31:55.000000Z",updated_at:"2025-01-07T20:31:55.000000Z"}}},9382:(e,t,n)=>{n.d(t,{i:()=>h});var i=n(4650),s=n(5601),r=n(5895),o=n(6895),a=n(3731);function l(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",4),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw(2);return i.KtG(t.goToCancelRequest())})),i.ALo(1,"safeHtml"),i.qZA()}if(2&e){const e=i.oxw(2);i.Udp("color",e.textColor),i.Q6J("innerHTML",i.lcZ(1,3,e.customText),i.oJD)}}function c(e,t){if(1&e&&(i.TgZ(0,"div",5),i._uU(1),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.hij(" ",e.labels.loadings.cancelingRequest,"\n")}}const d=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function u(e,t){if(1&e&&(i.TgZ(0,"div",1),i.YNc(1,l,2,5,"div",2),i.YNc(2,c,2,1,"div",3),i.qZA()),2&e){const e=i.oxw();i.Q6J("ngClass",i.kEZ(3,d,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),i.xp6(1),i.Q6J("ngIf",!e.loading),i.xp6(1),i.Q6J("ngIf",e.loading)}}let h=(()=>{class e{constructor(e,t){this.solicitudesService=e,this.notis=t,this.customText="",this.textColor="",this.flowType="SMS",this.updateStatusCode=new i.vpe,this.requestType="sms",this.loading=!1}goToCancelRequest(){this.loading=!0;const e={request_id:this.request_id,user_id:this.user_id};this.requestType="ClavePin"===this.flowType?"clave-pin":"sms",this.solicitudesService.cancelRequest(e,this.requestType).then((e=>{e&&e.data&&this.updateStatusCode.emit("consent_process_canceled"),e.message&&this.showAlert(e.status?this.capitalizeFirstLetter(e.status)+"!":"Aviso!",e.message),setTimeout((()=>{this.loading=!1}),1e3)})).catch((e=>{this.loading=!1,this.showAlert("Error!",e.message||e)}))}capitalizeFirstLetter(e){return"string"!=typeof e||0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}showAlert(e,t){this.notis.showAlert(e,t)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.M),i.Y36(r.T))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-cancel-request"]],inputs:{data:"data",customText:"customText",textColor:"textColor",flowType:"flowType",request_id:"request_id",user_id:"user_id",labels:"labels"},outputs:{updateStatusCode:"updateStatusCode"},decls:1,vars:1,consts:[["class","flex",3,"ngClass",4,"ngIf"],[1,"flex",3,"ngClass"],["class","subheading-1 px-2 text-right underline cursor-pointer custom-html",3,"color","innerHTML","click",4,"ngIf"],["class","subheading-1 px-2 text-right text-orange-500 custom-html",4,"ngIf"],[1,"subheading-1","px-2","text-right","underline","cursor-pointer","custom-html",3,"innerHTML","click"],[1,"subheading-1","px-2","text-right","text-orange-500","custom-html"]],template:function(e,t){1&e&&i.YNc(0,u,3,7,"div",0),2&e&&i.Q6J("ngIf",t.data&&t.data.styles)},dependencies:[o.mk,o.O5,a.z]}),e})()},9112:(e,t,n)=>{n.d(t,{y:()=>P});var i=n(5861),s=n(4650),r=n(4006),o=n(8259),a=n(2340),l=n(5089),c=n(3687),d=n(6895),u=n(9101),h=n(2440),p=n(3046),m=n(3731);function f(e,t){if(1&e&&s._UZ(0,"belender-widget-logo",12),2&e){const e=s.oxw();s.Q6J("firstOption",e.logoCustom)("logoUrl",null==e.data.styles?null:e.data.styles.logoUrl)}}function g(e,t){if(1&e&&s._UZ(0,"div",13),2&e){const e=s.oxw();s.Udp("color",null==e.data.styles?null:e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),s.Q6J("innerHTML",e.texts[e.otpType].title,s.oJD)}}function _(e,t){if(1&e&&(s._UZ(0,"div",14),s.ALo(1,"safeHtml")),2&e){const e=s.oxw();s.Udp("color",null==e.data.styles?null:e.data.styles.colors.text),s.Q6J("innerHTML",s.lcZ(1,3,null==e.texts[e.otpType]?null:e.texts[e.otpType].description),s.oJD)}}function b(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.requestingOtp:"Estamos solicitando el código. Por favor, espere un momento."," ")}}function y(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.AsE(" ",e.labels?e.labels.otp.otpSentToNumber:"El código ha sido enviado al teléfono acabado en"," ",e.lastThreeNumbersPhone,". ")}}function v(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.requestingCode:"Estamos solicitando el código. Por favor, espere un momento."," ")}}const w=function(e,t,n){return{color:e,border:t,background:n}};function x(e,t){if(1&e&&(s.ynx(0),s.TgZ(1,"small",15),s.YNc(2,b,2,1,"ng-container",6),s.YNc(3,y,2,2,"ng-container",6),s.YNc(4,v,2,1,"ng-container",6),s.qZA(),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngStyle",s.kEZ(4,w,null==e.data.styles?null:e.data.styles.colors.accentColor,"1px solid "+(null==e.data.styles?null:e.data.styles.colors.accentColor),null==e.data.styles?null:e.data.styles.colors.accentBgColor)),s.xp6(1),s.Q6J("ngIf",!e.lastThreeNumbersPhone),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&!(null!=e.data.config&&e.data.config.noRetryInBadPhone)),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&(null==e.data.config?null:e.data.config.noRetryInBadPhone))}}function C(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.noReceivedCode:"¿No has recibido el código en tu teléfono?"," ")}}function k(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.AsE("",e.labels?e.labels.otp.noReceivedCode2:"¿No has recibido el código en el teléfono acabado en"," ",e.lastThreeNumbersPhone,"? ")}}function T(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.noReceivedCode:"¿No has recibido el código en tu teléfono?"," ")}}const M=function(e,t){return{color:e,background:t}};function S(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",18),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.resendOTP())})),s._uU(1),s.qZA()}if(2&e){const e=s.oxw(2);s.Q6J("ngStyle",s.WLB(2,M,null==e.data.styles?null:e.data.styles.colors.dangerTextButtonColor,null==e.data.styles?null:e.data.styles.colors.dangerColor)),s.xp6(1),s.hij(" ",e.labels?e.labels.actions.resend:"Reenviar"," ")}}function I(e,t){if(1&e&&(s.ynx(0),s.TgZ(1,"small",16),s.YNc(2,C,2,1,"span",6),s.YNc(3,k,2,2,"span",6),s.YNc(4,T,2,1,"span",6),s.YNc(5,S,2,5,"a",17),s.qZA(),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngStyle",s.kEZ(5,w,null==e.data.styles?null:e.data.styles.colors.dangerColor,"1px solid "+(null==e.data.styles?null:e.data.styles.colors.dangerColor),null==e.data.styles?null:e.data.styles.colors.dangerBgColor)),s.xp6(1),s.Q6J("ngIf",!e.lastThreeNumbersPhone),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&!(null!=e.data.config&&e.data.config.noRetryInBadPhone)),s.xp6(1),s.Q6J("ngIf",null==e.data.config?null:e.data.config.noRetryInBadPhone),s.xp6(1),s.Q6J("ngIf",!e.secondTry)}}const O=function(e,t){return{length:e,allowNumbersOnly:t,disableAutoFocus:!0}},L=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let P=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.scrollService=n,this.minLength=3,this.logoCustom="",this.next=new s.vpe(null),this.errPhone=new s.vpe(null),this.resendO=new s.vpe(null),this.secsCount=60,this.secondTry=!1,this.timerIsRunning=!1,this.env=a.N.env}ngOnInit(){this.form=this.fb.group({code1:[null,[r.kI.required,r.kI.maxLength(6),r.kI.minLength(this.minLength)]]}),"SMS"==this.flowType&&this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}ngAfterViewInit(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),100)}resetOtpNumber(){this.form.get("code1").setValue("")}ngOnChanges(e){e.otpType&&!e.otpType.previousValue&&(this.secsCount="otpAEAT"==e.otpType?.currentValue||"otpIRS"==e.otpType?.currentValue?300:60,this.initSecsInterval())}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastThreeNumbersPhone=t}initSecsInterval(){this.timerIsRunning||(this.interv=setInterval((()=>{this.timerIsRunning=!0,this.secsCount=this.secsCount-1,this.secsRemaining=this.getRemaining(),this.secsCount<=0&&this.finishSecsInterval()}),1e3))}getRemaining(){let e=Math.floor(this.secsCount/60),t=this.secsCount%60;return this.addZero(e)+":"+this.addZero(t)}addZero(e){return e>=10?e:"0"+e}finishSecsInterval(){this.timerIsRunning=!1,this.interv&&clearInterval(this.interv)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){var t=this;return(0,i.Z)((function*(){console.log(e),t.form.get("code1").setValue(e)}))()}setInputEvent(e){""!=e.target.value?o(e.target).next().focus():"Backspace"==e.code&&o(e.target).prev().focus()}nextStep(){let e={code:this.getCode()};this.next.emit(e)}resendOTP(){this.secondTry=!0,this.initSecsInterval(),this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(s.Y36(r.QS),s.Y36(l.F),s.Y36(c.a))},e.ɵcmp=s.Xpm({type:e,selectors:[["belender-shared-otp-step"]],inputs:{data:"data",texts:"texts",lastThreeNumbersPhone:"lastThreeNumbersPhone",solicitud:"solicitud",otpType:"otpType",minLength:"minLength",flowType:"flowType",logoCustom:"logoCustom",labels:"labels"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},features:[s.TTD],decls:15,vars:26,consts:[[3,"firstOption","logoUrl",4,"ngIf"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-1","flex","flex-col"],["id","otpTitle","class","title m-0",3,"color","font-size","innerHTML",4,"ngIf"],["id","otpDescription","class","subheading-1 pt-4",3,"color","innerHTML",4,"ngIf"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","w-full","flex-col","gap-2","py-2"],[1,"subheading-1","py-1","custom-html"],[3,"config","onInputChange"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[3,"firstOption","logoUrl"],["id","otpTitle",1,"title","m-0",3,"innerHTML"],["id","otpDescription",1,"subheading-1","pt-4",3,"innerHTML"],["id","secsCountContainer",1,"info-time","w-full",3,"ngStyle"],[1,"info-time","w-full",3,"ngStyle"],["id","resendOTPButton","class","ml-4",3,"ngStyle","click",4,"ngIf"],["id","resendOTPButton",1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(s.YNc(0,f,1,2,"belender-widget-logo",0),s.TgZ(1,"form",1)(2,"div",2),s.YNc(3,g,1,5,"div",3),s.YNc(4,_,2,5,"div",4),s.TgZ(5,"div",5),s.YNc(6,x,5,8,"ng-container",6),s.YNc(7,I,6,9,"ng-container",6),s.qZA(),s.TgZ(8,"div",7)(9,"p",8),s._uU(10),s.qZA(),s.TgZ(11,"ng-otp-input",9),s.NdJ("onInputChange",(function(e){return t.capturePasteEvent(e)})),s.qZA()()(),s.TgZ(12,"div",10)(13,"button",11),s.NdJ("click",(function(){return t.nextStep()})),s._uU(14),s.qZA()()()),2&e&&(s.Q6J("ngIf",null==t.data.styles?null:t.data.styles.withLogo),s.xp6(1),s.Q6J("formGroup",t.form),s.xp6(2),s.Q6J("ngIf",t.texts&&(null==t.texts[t.otpType]?null:t.texts[t.otpType].title)&&""!=(null==t.texts[t.otpType]?null:t.texts[t.otpType].title)),s.xp6(1),s.Q6J("ngIf",t.texts&&(null==t.texts[t.otpType]?null:t.texts[t.otpType].description)&&""!=(null==t.texts[t.otpType]?null:t.texts[t.otpType].description)),s.xp6(2),s.Q6J("ngIf",t.secsCount&&t.secsCount>0),s.xp6(1),s.Q6J("ngIf",!t.secsCount||t.secsCount<=0),s.xp6(2),s.Udp("color",t.data.styles.colors.text),s.xp6(1),s.hij(" ",t.labels?t.labels.otp.otpCode:"Código OTP (recibido por SMS)"," "),s.xp6(1),s.Q6J("config",s.WLB(19,O,t.minLength,"qa"!=t.env&&"dev"!=t.env)),s.xp6(1),s.Q6J("ngClass",s.kEZ(22,L,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),s.xp6(1),s.Udp("color",null==t.data.styles?null:t.data.styles.colors.btnText)("background",t.form.invalid?"":null==t.data.styles?null:t.data.styles.colors.btnBg)("border-radius",(null==t.data.styles?null:t.data.styles.btnRound)+"px"),s.Q6J("disabled",t.form.invalid),s.xp6(1),s.hij(" ",t.labels?t.labels.actions.next:"Siguiente"," "))},dependencies:[d.mk,d.O5,d.PC,u.lW,r._Y,r.JL,r.sg,h.df,p.X,m.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.code-wrapper[_ngcontent-%COMP%]{padding:5px;height:50px}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:40px;min-width:136px;border-radius:6px;border:1px solid rgba(0,0,0,.1);text-transform:uppercase;text-align:left;font-weight:700;transition:all .3s ease;outline:1px solid transparent;letter-spacing:12px;padding:0 18px}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover{background:#fcfcfc;border:1px solid rgba(0,0,0,.2);transition:all .3s ease}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:1px solid #4e98d0;border:1px solid #4e98d0}.info-time[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:7px 10px;min-height:40px;font-size:14px;line-height:14px;border-radius:5px;border-width:1px;border-style:solid;margin:10px 0}.info-time[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:14px;line-height:24px;padding:0 10px;border-radius:5px;cursor:pointer;transition:all .2s ease}@media (max-width: 576px){.info-time[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:0 20px}}"]}),e})()},5696:(e,t,n)=>{n.d(t,{T:()=>c});var i=n(4650),s=n(7403),r=n(5412),o=n(7308),a=n(6895);function l(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"span"),i._uU(1),i.TgZ(2,"a",0),i.NdJ("click",(function(t){i.CHM(e);const n=i.oxw();return i.KtG(n.gotoLegalDocument(t))})),i.TgZ(3,"u"),i._uU(4),i.qZA()()()}if(2&e){const e=i.oxw();i.xp6(1),i.hij(" ",e.parts.p3," "),i.xp6(3),i.Oqu(e.parts.a2)}}let c=(()=>{class e{constructor(e,t){this.dialog=e,this.translationService=t,this.goTerms=new i.vpe(null),this.customTerms=!1,this.lang="",this.parts={p1:"He leído y acepto los",p2:"del servicio",p3:"y la",a1:"términos y condiciones",a2:"política de privacidad"},this.translatedParts={ca:{p1:"He llegit i accepto els",p2:"del servei",p3:"i la",a1:"termes i condicions",a2:"política de privacitat"},en:{p1:"I have read and accept the",p2:"of the service",p3:"and the",a1:"terms and conditions",a2:"privacy policy"},fr:{p1:"J'ai lu et j'accepte les",p2:"du service",p3:"et la",a1:"conditions générales",a2:"politique de confidentialité"},it:{p1:"Ho letto e accetto i",p2:"del servizio",p3:"e la",a1:"termini e condizioni",a2:"informativa sulla privacy"},pt:{p1:"Li e aceito os",p2:"do serviço",p3:"e a",a1:"termos e condições",a2:"política de privacidade"},de:{p1:"Ich habe die",p2:"des Dienstes gelesen und akzeptiere sie",p3:"sowie die",a1:"Nutzungsbedingungen",a2:"Datenschutzrichtlinie"}}}ngOnInit(){this.parts={p1:this.getPart(this.firstSentence,"p1"),p2:this.getPart(this.secondSentence,"p2"),p3:this.getPart(this.thirdSentence,"p3"),a1:this.getPart(this.termsActionText,"a1"),a2:this.getPart(this.policyActionText,"a2")}}getPart(e,t){return e||(this.data&&this.lang&&this.translatedParts[this.lang]?this.translatedParts[this.lang][t]||this.parts[t]||"":this.parts[t]||"")}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.goTerms.emit(e)}gotoLegalDocument(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(s.N,{panelClass:"fullscreen-dialog",data:{lang:this.lang,allData:this.data,flow:this.flowName}})}}return e.ɵfac=function(t){return new(t||e)(i.Y36(r.uw),i.Y36(o.D))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-terms-and-policy-links"]],inputs:{userId:"userId",showPolicyLink:"showPolicyLink",firstSentence:"firstSentence",secondSentence:"secondSentence",thirdSentence:"thirdSentence",policyActionText:"policyActionText",termsActionText:"termsActionText",customTerms:"customTerms",lang:"lang",data:"data",flowName:"flowName"},outputs:{goTerms:"goToTerms"},decls:6,vars:4,consts:[["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],[4,"ngIf"]],template:function(e,t){1&e&&(i._uU(0),i.TgZ(1,"a",0),i.NdJ("click",(function(e){return t.gotoTermsAndConditions(e)})),i.TgZ(2,"u"),i._uU(3),i.qZA()(),i._uU(4),i.YNc(5,l,5,2,"span",1)),2&e&&(i.hij(" ",t.parts.p1," "),i.xp6(3),i.Oqu(t.parts.a1),i.xp6(1),i.hij(" ",t.parts.p2," "),i.xp6(1),i.Q6J("ngIf",t.showPolicyLink))},dependencies:[a.O5]}),e})()},3046:(e,t,n)=>{n.d(t,{X:()=>a});var i=n(4650),s=n(6895);function r(e,t){1&e&&i._UZ(0,"div",4)}const o=function(e){return{display:e}};let a=(()=>{class e{constructor(){this.logoUrl="",this.firstOption=this.logoUrl,this.logoUrlIsLoaded=!1}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-widget-logo"]],inputs:{logoUrl:"logoUrl",firstOption:"firstOption"},decls:4,vars:5,consts:[[1,"img-wrapper","p-4","flex","justify-center","items-center"],["class","animated-bg h-full w-full",4,"ngIf"],[1,"img-card",3,"src","ngStyle","load"],["img",""],[1,"animated-bg","h-full","w-full"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0),i.YNc(1,r,1,0,"div",1),i.TgZ(2,"img",2,3),i.NdJ("load",(function(){return t.logoUrlIsLoaded=!0})),i.qZA()()),2&e&&(i.xp6(1),i.Q6J("ngIf",!t.logoUrlIsLoaded),i.xp6(1),i.Q6J("src",t.firstOption||t.logoUrl,i.LSH)("ngStyle",i.VKq(3,o,t.logoUrlIsLoaded?"block":"none")))},dependencies:[s.O5,s.PC],styles:[".img-wrapper[_ngcontent-%COMP%]{max-height:240px}.img-wrapper[_ngcontent-%COMP%] .img-card[_ngcontent-%COMP%], .img-wrapper[_ngcontent-%COMP%] .animated-bg[_ngcontent-%COMP%]{max-width:240px;max-height:240px}"]}),e})()},5762:(e,t,n)=>{n.d(t,{l:()=>i});class i{constructor(){}}},3731:(e,t,n)=>{n.d(t,{z:()=>r});var i=n(4650),s=n(1481);let r=(()=>{class e{constructor(e){this.sanitized=e}transform(e){return this.sanitized.bypassSecurityTrustHtml(e)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.H7,16))},e.ɵpipe=i.Yjl({name:"safeHtml",type:e,pure:!0}),e})()},9391:(e,t,n)=>{n.d(t,{o:()=>l});var i=n(7396),s=n(3436),r=n(2340),o=n(4650),a=n(6554);let l=(()=>{class e{constructor(e){this.localFetch=e}getAttachmentsOld(e){return new Promise(((t,n)=>{const r=(0,i.IO)((0,i.hJ)(s.db,"solicitudes"),(0,i.ar)("id","==",e),(0,i.b9)(1));(0,i.cf)(r,(e=>{let n;e.forEach((e=>{n=e.data().attachments})),t(n)}),(e=>{n(e)}))}))}getAttachments(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${r.N.baseUrl}/requests/${e}/documents`).then((e=>{e?t(e):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}uploadFile(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(`${r.N.baseUrl}/documents/upload-files`,e).then((e=>{e?t(e):n("No se pudieron subir los documentos..")})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(o.LFG(a.r))},e.ɵprov=o.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},7489:(e,t,n)=>{n.d(t,{v:()=>l});var i=n(2340),s=n(4650),r=n(5089),o=n(529),a=n(6554);let l=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}getSolicitudes(){return this.localFetch.getFetch(i.N.baseUrl+"/requests")}getSolicitudByCode(e){return this.localFetch.freeGetFetch(i.N.baseUrl+"/requests/"+e)}noMatchPhone(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/cancel",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/check-service",e).then((e=>{this.sendMessageToParent(400===e.code?{type:"response",data:{...e.response,status_code:"no_clave_pin_service"}}:{type:"response",data:e.data||e}),t(e)})).catch((e=>{this.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}setNoService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/no-service",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/terms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/retry",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/clave-pin/resend-otp",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,s)=>{this.localFetch.putFetchWhitoutToken(`${i.N.baseUrl}/requests/${e}/person`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendOTP(e,t){let n="/requests/clave-pin/otp";return(i.N.scraperMock||t)&&(n="/mockscrapper/requests/clave-pin/otp"),new Promise(((t,s)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+n,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):s(e)})).catch((e=>{s(e)}))}))}sendOTPToBde(e,t){let n="/requests/cirbe-cp/otp";return(i.N.scraperMock||t)&&(n="/mockscrapper/requests/cirbe-cp/otp"),new Promise(((t,s)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+n,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):s(e)})).catch((e=>{s(e)}))}))}sendSecondTask(e){let t="/requests/clave-pin/secondTask";return i.N.scraperMock&&(t="/mockscrapper/requests/clave-pin/secondTask"),new Promise(((n,s)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+t,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,s)=>{this.localFetch.postFetch(`${i.N.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendMessageToParent(e){window.top.postMessage(e,"*")}}return e.ɵfac=function(t){return new(t||e)(s.LFG(r.F),s.LFG(o.eN),s.LFG(a.r))},e.ɵprov=s.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5206:(e,t,n)=>{n.d(t,{s:()=>l});var i=n(6197),s=n(2340),r=n(4650),o=n(5089),a=n(6554);let l=(()=>{class e{constructor(e,t){this.utils=e,this.localFetch=t,this.db=(0,i.N8)()}getFlows(){return new Promise(((e,t)=>{this.localFetch.getFetch(s.N.baseUrl+"/flows").then((n=>{n?e(n):t(!1)}),(e=>{t(!1)}))}))}getFlowsByUserID(e){return new Promise(((t,n)=>{const s=(0,i.iH)((0,i.N8)());(0,i.U2)((0,i.iU)(s,`documents/flows/${e}`)).then((e=>{e.exists()?t(e.val()):n("No data!")})).catch((e=>{console.error(e),n("Error!: "+e)}))}))}}return e.ɵfac=function(t){return new(t||e)(r.LFG(o.F),r.LFG(a.r))},e.ɵprov=r.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},9617:(e,t,n)=>{n.d(t,{U:()=>l});var i=n(2340),s=n(4650),r=n(5089),o=n(529),a=n(6554);let l=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}getPackagesByUserID(e){return new Promise(((t,n)=>{this.localFetch.getFetchWhitoutToken(i.N.baseUrl+"/users/"+e+"/pack-documents").then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}getPacksByPackId(e){return new Promise(((t,n)=>{this.localFetch.getFetchWhitoutToken(i.N.baseUrl+"/pack-documents/"+e).then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}getFlowPackagesByUserID(e,t){}}return e.ɵfac=function(t){return new(t||e)(s.LFG(r.F),s.LFG(o.eN),s.LFG(a.r))},e.ɵprov=s.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5601:(e,t,n)=>{n.d(t,{M:()=>l});var i=n(2340),s=n(4650),r=n(5089),o=n(529),a=n(6554);let l=(()=>{class e{constructor(e,t,n){this.utils=e,this.http=t,this.localFetch=n}getSolicitudes(){return this.localFetch.getFetch(i.N.baseUrl+"/requests")}getSolicitudByCode(e){return this.localFetch.freeGetFetch(i.N.baseUrl+"/requests/"+e)}setPhone(e,t){return new Promise(((n,s)=>{this.localFetch.putFetchWhitoutToken(`${i.N.baseUrl}/requests/${t}/person`,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}noPhone(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/no-phone",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}smsToPin(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms-clave",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}addSolicitud(e,t,n){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}setNoService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/no-service",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/terms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/check-service",e).then((e=>{this.sendMessageToParent(400===e.code?{type:"response",data:{...e.response,status_code:"no_sms_service"}}:{type:"response",data:e.data||e}),t(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/retry",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(i.N.baseUrl+"/requests/sms/resend-otp",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,s)=>{this.localFetch.putFetchWhitoutToken(`${i.N.baseUrl}/requests/${e}/person`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let s="/requests/sms/otp";i.N.scraperMock&&(s="/mockscrapper/requests/sms/otp"),this.localFetch.postFetchWhitoutToken(i.N.baseUrl+s,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}uploadFileFromWidget(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(i.N.baseUrl+"/documents/upload-files-from-widget",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,s)=>{this.localFetch.postFetch(`${i.N.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}getDocuments(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${i.N.baseUrl}/requests/${e}/documents`).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}getDocumentsIds(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${i.N.baseUrl}/requests/${e}/documents-ids-widget`).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}cancelRequest(e,t){return new Promise(((n,s)=>{this.localFetch.postFetch(i.N.baseUrl+`/requests/${t}/cancel`,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):s(e)})).catch((e=>{s(e)}))}))}sendMessageToParent(e){window.top.postMessage(e,"*")}}return e.ɵfac=function(t){return new(t||e)(s.LFG(r.F),s.LFG(o.eN),s.LFG(a.r))},e.ɵprov=s.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5145:(e,t,n)=>{n.d(t,{Z:()=>i});const i=[{id:0,text:"error_clave_pin",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Error con la clave PIN"},{id:1,text:"failed_without_retry",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo sin reintento"},{id:111,text:"failed_with_retry",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo con reintento"},{id:2,text:"bad_phone",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Teléfono erróneo"},{id:3,text:"failed_documents_downloaded",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo al descargar Documentos"},{id:4,text:"invalid_otp_aeat",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"OTP de AEAT inválido"},{id:5,text:"invalid_otp_seguridad_social",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"OTP de Seg. Social inválido"},{id:6,text:"max_entries_otp",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"not_interested",label:"Max intentos OTP"},{id:7,text:"abandoned_after_bad_phone",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"phonelink_erase",label:"Abandonado (bad phone)"},{id:8,text:"abandoned_after_terms",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (términos y condiciones)"},{id:9,text:"abandoned_after_invalid_otp_seguridad_social",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (invalid OTP SS)"},{id:10,text:"abandoned_after_invalid_otp_aeat",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (invalid OTP AEAT)"},{id:11,text:"abandoned_after_waiting_otp_aeat",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (waiting OTP AEAT)"},{id:12,text:"abandoned_after_waiting_otp_seguridad_social",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (waiting OTP SS)"},{id:13,text:"waiting_login_seguridad_social",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando login SS"},{id:14,text:"waiting_login_aeat",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando login AEAT"},{id:15,text:"waiting_otp_aeat",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando OTP AEAT"},{id:16,text:"waiting_otp_seguridad_social",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando OTP SS"},{id:17,text:"saved_otp",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"OTP guardado"},{id:171,text:"picked_up_otp",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"OTP recogido"},{id:18,text:"terms_and_conditions",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"Términos y condiciones"},{id:19,text:"waiting_documents",textClass:"text-cyan",bgClass:"bg-cyan-light",previewClass:"bg-cyan",icon:"hourglass_empty",label:"Esperando documentos"},{id:20,text:"created",textClass:"text-cyan",bgClass:"bg-cyan-light",previewClass:"bg-cyan",icon:"fiber_new",label:"Solicitud creada"},{id:21,text:"all_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Todo los documentos descargados"},{id:22,text:"partial_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Algunos Documentos descargados"},{id:23,text:"parcial_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Algunos Documentos descargados"},{id:24,text:"all_documents_downloaded_and_deleted",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"delete",label:"Todos descargados y eliminados"},{id:25,text:"partial_documents_downloaded_and_deleted",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"delete",label:"Algunos descargados y eliminados"},{id:26,text:"updated_data",textClass:"text-blue-500",bgClass:"bg-blue-500/10",previewClass:"bg-blue-500",icon:"check",label:"Datos del cliente actualizados"},{id:27,text:"resend_otp",textClass:"text-blue-500",bgClass:"bg-blue-500/10",previewClass:"bg-blue-500",icon:"refresh",label:"OTP reenviado"}]},8259:function(e,t){var n,i,s;
60
60
  /*!
61
61
  * jQuery JavaScript Library v3.7.1
62
62
  * https://jquery.com/