PageSourceSearch

https://sotreqlink.sotreq.com.br/218.8b6315c3e284473d.js

js sotreq.com.br collected 2026-10-07 21:20:03 UTC 55,657 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkCustomerPanel=self.webpackChunkCustomerPanel||[]).push([[218],{7837:(A,M,l)=>{l.r(M),l.d(M,{AccessRequestModule:()=>fe});var u=l(177),y=l(1626),d=l(9417),S=l(1141),x=l(2242),m=l(3147),e=l(4438);function w(r,a){if(1&r){const t=e.RV6();e.j41(0,"button",17),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.tryAgain())}),e.EFF(1," Tentar Novamente "),e.k0s()}}function E(r,a){1&r&&(e.j41(0,"div",18)(1,"div",19)(2,"h4"),e.EFF(3,"J\xe1 tem acesso ao sistema?"),e.k0s(),e.j41(4,"p"),e.EFF(5,'Se voc\xea j\xe1 possui credenciais de acesso, utilize o bot\xe3o "Entrar" na tela de login.'),e.k0s(),e.j41(6,"p"),e.EFF(7,"Caso tenha esquecido sua senha, entre em contato com o administrador da sua empresa ou com nosso suporte."),e.k0s()()())}function _(r,a){1&r&&(e.j41(0,"div",18)(1,"div",19)(2,"h4"),e.EFF(3,"Informa\xe7\xf5es necess\xe1rias para o suporte:"),e.k0s(),e.j41(4,"ul")(5,"li"),e.EFF(6,"Seu CPF ou CNPJ completo"),e.k0s(),e.j41(7,"li"),e.EFF(8,"Nome completo ou raz\xe3o social"),e.k0s(),e.j41(9,"li"),e.EFF(10,"Telefone de contato"),e.k0s(),e.j41(11,"li"),e.EFF(12,"Relacionamento com a Sotreq (cliente, prospect, etc.)"),e.k0s()()()())}let C=(()=>{class r{route;router;errorType="generic";errorMessage="";constructor(t,n){this.route=t,this.router=n}ngOnInit(){this.route.queryParams.subscribe(t=>{this.errorType=t.type||"generic",this.setErrorMessage()})}setErrorMessage(){switch(this.errorType){case"not-found":this.errorMessage="Seu registro n\xe3o foi encontrado em nossos sistemas. Por favor, entre em contato com um Representante de Suporte ao Produto da filial Sotreq mais pr\xf3xima ou com a Sotreq+ nos telefones 11 3003-1920 ou 0800 940 1920 para obter assist\xeancia.";break;case"already-registered":this.errorMessage="O CNPJ/CPF informado da sua empresa j\xe1 est\xe1 cadastrado no SotreqLink (Portal do Cliente). Pedimos que procure o Administrador que foi cadastrado ou entre em contato com o seu Representante de Suporte ao Produto da filial Sotreq mais pr\xf3xima ou com a Sotreq+ nos telefones 11 3003-1920 ou 0800 940 1920 para maiores detalhes.";break;default:this.errorMessage="Ocorreu um erro durante o processo de solicita\xe7\xe3o de acesso. Tente novamente ou entre em contato com o suporte."}}goToLogin(){this.router.navigate(["/login"])}
1tryAgain(){this.router.navigate(["/access-request/validate-customer"])}openWhatsAppSupport(){window.open("https://wa.me/5511999999999","_blank","noopener")}openSupportPhone(){window.open("tel:+551133334444","_self")}getErrorIcon(){switch(this.errorType){case"not-found":return"pi pi-search";case"already-registered":return"pi pi-exclamation-triangle";default:return"pi pi-times-circle"}}getErrorTitle(){switch(this.errorType){case"not-found":return"Registro N\xe3o Encontrado";case"already-registered":return"J\xe1 Cadastrado";default:return"Erro no Processo"}}showTryAgainButton(){return"generic"===this.errorType}static \u0275fac=function(n){return new(n||r)(e.rXU(m.nX),e.rXU(m.Ix))};static \u0275cmp=e.VBU({type:r,selectors:[["app-access-error"]],decls:34,vars:7,consts:[[1,"access-error-container"],[1,"access-error-card"],[1,"error-header"],[1,"error-icon"],[1,"error-message"],[1,"support-options"],[1,"support-grid"],[1,"support-option"],["type","button",1,"btn","btn-support","whatsapp",3,"click"],[1,"pi","pi-whatsapp"],[1,"support-description"],["type","button",1,"btn","btn-support","phone",3,"click"],[1,"pi","pi-phone"],[1,"form-actions"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button","class","btn btn-primary",3,"click",4,"ngIf"],["class","additional-info",4,"ngIf"],["type","button",1,"btn","btn-primary",3,"click"],[1,"additional-info"],[1,"info-box"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.nrm(4,"i"),e.k0s(),e.j41(5,"h1"),e.EFF(6),e.k0s()(),e.j41(7,"div",4)(8,"p"),e.EFF(9),e.k0s()(),e.j41(10,"div",5)(11,"h3"),e.EFF(12,"Como podemos ajudar?"),e.k0s(),e.j41(13,"div",6)(14,"div",7)(15,"button",8),e.bIt("click",function(){return o.openWhatsAppSupport()}),e.nrm(16,"i",9),e.j41(17,"span"),e.EFF(18,"WhatsApp Sotreq+"),e.k0s()(),e.j41(19,"p",10),e.EFF(20,"Atendimento r\xe1pido via WhatsApp"),e.k0s()(),e.j41(21,"div",7)(22,"button",11),e.bIt("click",function(){return o.openSupportPhone()}),e.nrm(23,"i",12),e.j41(24,"span"),e.EFF(25,"Telefone de Suporte"),e.k0s()(),e.j41(26,"p",10),e.EFF(27,"Fale com nosso time de suporte"),e.k0s()()()(),e.j41(28,"div",13)(29,"button",14),e.bIt("click",function(){return o.goToLogin()}),e.EFF(30," Voltar ao Login "),e.k0s(),e.DNE(31,w,2,0,"button",15),e.k0s(),e.DNE(32,E,8,0,"div",16)(33,_,13,0,"div",16),e.k0s()()),2&n&&(e.R7$(4),e.HbH(o.getErrorIcon()),e.R7$(2),e.JRh(o.getErrorTitle()),e.R7$(3),e.JRh(o.errorMessage),e.R7$(22),e.Y8G("ngIf",o.showTryAgainButton()),e.R7$(),e.Y8G("ngIf","already-registered"===o.errorType),e.R7$(),e.Y8G("ngIf","not-found"===o.errorType))},dependencies:[u.bT],styles:[".access-error-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:100vh;padding:1rem;background-color:#f8f9fa}.access-error-card[_ngcontent-%COMP%]{background:#fff;border-radius:.5rem;box-shadow:0 .125rem .25rem #00000013;padding:2rem;width:100%;max-width:600px}.error-header[_ngcontent-%COMP%]{text-align:center;margin-bottom:2rem}.error-icon[_ngcontent-%COMP%]{font-size:4rem;margin-bottom:1rem;color:#dc3545}.error-header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{color:#212529;font-size:1.75rem;font-weight:600;margin:0}.error-message[_ngcontent-%COMP%]{text-align:center;margin-bottom:2rem}.error-message[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:#6c757d;font-size:1.1rem;line-height:1.6;margin:0}.support-options[_ngcontent-%COMP%]{margin-bottom:2rem}.support-options[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{color:#212529;font-size:1.25rem;font-weight:600;margin-bottom:1rem;text-align:center}.support-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media (max-width: 576px){.support-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.support-option[_ngcontent-%COMP%]{text-align:center}.btn-support[_ngcontent-%COMP%]{width:100%;padding:1rem;border:2px solid transparent;border-radius:.5rem;font-size:1rem;font-weight:500;cursor:pointer;transition:all .2s ease-in-out;display:flex;flex-direction:column;align-items:center;gap:.5rem;text-decoration:none}.btn-support[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1.5rem}.btn-support.whatsapp[_ngcontent-%COMP%]{background-color:#25d366;color:#fff}.btn-support.whatsapp[_ngcontent-%COMP%]:hover{background-color:#22c55e;transform:translateY(-2px)}.btn-support.phone[_ngcontent-%COMP%]{background-color:#007bff;color:#fff}.btn-support.phone[_ngcontent-%COMP%]:hover{background-color:#0056b3;transform:translateY(-2px)}.support-description[_ngcontent-%COMP%]{font-size:.875rem;color:#6c757d;margin-top:.5rem;margin-bottom:0}.form-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:center;margin-bottom:1.5rem}.btn[_ngcontent-%COMP%]{padding:.75rem 1.5rem;border:none;border-radius:.375rem;font-size:1rem;font-weight:500;cursor:pointer;transition:all .2s ease-in-out;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.btn-primary[_ngcontent-%COMP%]{background-color:#007bff;color:#fff}.btn-primary[_ngcontent-%COMP%]:hover{background-color:#0056b3}.btn-secondary[_ngcontent-%COMP%]{background-color:#6c757d;color:#fff}.btn-secondary[_ngcontent-%COMP%]:hover{background-color:#545b62}.additional-info[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;padding-top:1.5rem}.info-box[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #dee2e6;border-radius:.375rem;padding:1.5rem}
1.info-box[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{color:#212529;font-size:1.125rem;font-weight:600;margin-bottom:1rem;margin-top:0}.info-box[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:#6c757d;margin-bottom:.5rem}.info-box[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.info-box[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]{color:#6c757d;margin-bottom:0;padding-left:1.5rem}.info-box[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{margin-bottom:.25rem}"]})}return r})(),k=(()=>{class r{router;constructor(t){this.router=t}backToLogin(){this.router.navigate(["/login"])}static \u0275fac=function(n){return new(n||r)(e.rXU(m.Ix))};static \u0275cmp=e.VBU({type:r,selectors:[["app-access-request"]],decls:2,vars:0,consts:[[1,"access-request-container"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.nrm(1,"router-outlet"),e.k0s())},dependencies:[m.n3],styles:[".access-request-container[_ngcontent-%COMP%]{min-height:100vh;background-color:#e5e7eb}"]})}return r})();var p=l(467);const g_BASE="access-request";var N=l(9350),D=l(7707);function b(r,a){const t="object"==typeof a;return new Promise((n,o)=>{const s=new D.Ms({next:i=>{n(i),s.unsubscribe()},error:o,complete:()=>{t?n(a.defaultValue):o(new N.G)}});r.subscribe(s)})}var V=l(5312),F=l(4412),O=l(1131);let T=(()=>{class r{http;msalAuthService;baseUrl=V.c.apis.bff;currentRequestSubject=new F.t(null);constructor(t,n){this.http=t,this.msalAuthService=n}start(){var t=this;return(0,p.A)(function*(){return b(t.http.post(`${t.baseUrl}/customer/access-request/start`,{}))})()}entraCallback(t){var n=this;return(0,p.A)(function*(){return b(n.http.post(`${n.baseUrl}/customer/access-request/entra/callback`,t))})()}validateDocument(t){var n=this;return(0,p.A)(function*(){const o=`${n.baseUrl}/customer/validate-document?document=${encodeURIComponent(t)}`;return b(n.http.get(o))})()}requestValidationCode(t){var n=this;return(0,p.A)(function*(){return b(n.http.post(`${n.baseUrl}/customer/request-validation-code`,t))})()}validateCode(t){var n=this;return(0,p.A)(function*(){return b(n.http.post(`${n.baseUrl}/customer/validate-code`,t))})()}resendCode(t){var n=this;return(0,p.A)(function*(){return b(n.http.post(`${n.baseUrl}/customer/resend-code`,t))})()}createMasterUser(t){var n=this;return(0,p.A)(function*(){return b(n.http.post(`${n.baseUrl}/customer/master-user`,t))})()}getCurrentUserEmail(){return this.msalAuthService.getUserEmail()}getCurrentUserOid(){return this.msalAuthService.getUserOid()}getCurrentUserDocument(){return this.msalAuthService.getUserDocument()}setCurrentRequest(t){this.currentRequestSubject.next(t)}getCurrentRequest(){return this.currentRequestSubject.value}clearCurrentRequest(){this.currentRequestSubject.next(null)}static \u0275fac=function(n){return new(n||r)(e.KVO(y.Qq),e.KVO(O.h))};static \u0275prov=e.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),R=(()=>{class r{STORAGE_KEY="access-request-state";stateSubject=new F.t({});constructor(){this.loadStateFromStorage()}get state$(){return this.stateSubject.asObservable()}getCurrentState(){return this.stateSubject.value}updateState(t){const o={...this.stateSubject.value,...t};this.stateSubject.next(o),this.saveStateToStorage(o)}setValidationContext(t){this.updateState({requestToken:t.requestToken,customerName:t.customerName,availableContacts:t.availableContacts,codeSent:t.codeSent,validationMessage:t.validationMessage,codeExpiresAt:t.codeExpiresAt??null,retryAfterSeconds:t.retryAfterSeconds??null,validatedDocument:t.validatedDocument})}setSelectedContact(t,n){this.updateState({selectedContactHash:t,contactMasked:n})}setResendCooldown(t){const n="number"==typeof t&&!Number.isNaN(t),o=n?Math.max(0,Math.ceil(t)):0;this.updateState({resendAvailableInSeconds:o,retryAfterSeconds:n?o:null})}setCurrentStep(t){this.updateState({step:t})}setSessionId(t){this.updateState({sessionId:t})}isValidForStep(t){const n=this.getCurrentState();switch(t){case"validate-customer":return!!n.sessionId;case"select-contact":case"enter-code":case"success":return!!n.requestToken;default:return!0}}getCodeValidationData(){const t=this.getCurrentState();return{requestToken:t.requestToken,contactHash:t.selectedContactHash,contactMasked:t.contactMasked,validationMessage:t.validationMessage,codeSent:t.codeSent,codeExpiresAt:t.codeExpiresAt??null,retryAfterSeconds:t.retryAfterSeconds??null,resendAvailableInSeconds:t.resendAvailableInSeconds}}getContactSelectionData(){const t=this.getCurrentState();return{requestToken:t.requestToken,customerName:t.customerName}}clearState(){sessionStorage.removeItem(this.STORAGE_KEY),this.stateSubject.next({})}clearSensitiveData(){const n={step:this.getCurrentState().step};this.stateSubject.next(n),this.saveStateToStorage(n)}loadStateFromStorage(){try{const t=sessionStorage.getItem(this.STORAGE_KEY);if(t){const n=JSON.parse(t);this.stateSubject.next(n)}}catch(t){console.error("Erro ao carregar estado do sessionStorage:",t),this.clearState()}}saveStateToStorage(t){try{const n=this.sanitizeStateForStorage(t);sessionStorage.setItem(this.STORAGE_KEY,JSON.stringify(n))}catch(n){console.error("Erro ao salvar estado no sessionStorage:",n)}}sanitizeStateForStorage(t){return{...t}}hasActiveFlow(){const t=this.getCurrentState();return!(!t.requestToken&&!t.sessionId)}getNextStep(){const t=this.getCurrentState();return t.sessionId?t.requestToken?t.selectedContactHash?"enter-code":"select-contact":"validate-customer":"entra-return"}static \u0275fac=function(n){return new(n||r)};static \u0275prov=e.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var $=l(8810);let P=(()=>{class r{handleHttpError(t){const n=this.createErrorInfo(t);return console.error("Access Request Error:",n),(0,$.$)(()=>n)}createErrorInfo(t){let n,o;
1if(t.error instanceof ErrorEvent)n=t.error.message,o="CLIENT_ERROR";else switch(t.status){case 400:n=this.getBadRequestMessage(t),o="BAD_REQUEST";break;case 401:n="N\xe3o autorizado. Fa\xe7a login novamente.",o="UNAUTHORIZED";break;case 403:n="Acesso negado.",o="FORBIDDEN";break;case 404:n="Recurso n\xe3o encontrado.",o="NOT_FOUND";break;case 422:n=this.getValidationMessage(t),o="VALIDATION_ERROR";break;case 500:n="Erro interno do servidor. Tente novamente mais tarde.",o="INTERNAL_SERVER_ERROR";break;case 0:n="Sem conex\xe3o com o servidor. Verifique sua internet.",o="NO_CONNECTION";break;default:n=`Erro ${t.status}: ${t.statusText}`,o=`HTTP_${t.status}`}return{code:o,message:n,details:t.error,timestamp:new Date}}getBadRequestMessage(t){return t.error?.message?t.error.message:t.error?.errors?Object.values(t.error.errors).flat().join(". "):"Dados inv\xe1lidos enviados."}getValidationMessage(t){return t.error?.message?t.error.message:t.error?.errors?Object.entries(t.error.errors).map(([o,s])=>`${o}: ${s.join(", ")}`).join("; "):"Dados de valida\xe7\xe3o inv\xe1lidos."}getErrorMessage(t){return t?.message?t.message:"string"==typeof t?t:"Ocorreu um erro inesperado"}static \u0275fac=function(n){return new(n||r)};static \u0275prov=e.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var G=l(5788),L=l(1125);const U=()=>({opacity:.5,pointerEvents:"none",cursor:"not-allowed"}),q=r=>({"selected-contact":r}),B=r=>({"text-600":r});function H(r,a){if(1&r){const t=e.RV6();e.j41(0,"div",23),e.bIt("click",function(){const o=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onContactSelect(o.id))})("keydown.enter",function(){const o=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onContactSelect(o.id))})("keydown.space",function(){const o=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onContactSelect(o.id))}),e.j41(1,"div",24)(2,"input",25),e.bIt("change",function(){const o=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onContactSelect(o.id))}),e.k0s(),e.j41(3,"label",26)(4,"span",27),e.EFF(5),e.k0s()()()()}if(2&r){const t=a.$implicit,n=e.XpG(3);e.Y8G("ngClass",e.eq3(7,q,n.selectedContactHash===t.id)),e.R7$(2),e.Y8G("id","contact-"+t.id)("value",t.id)("checked",n.selectedContactHash===t.id),e.R7$(),e.Y8G("for","contact-"+t.id),e.R7$(2),e.Lme("",t.obfuscatedName," - ",t.obfuscatedEmail,"")}}function X(r,a){if(1&r&&(e.j41(0,"div",21),e.DNE(1,H,6,9,"div",22),e.k0s()),2&r){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.contactOptions)}}function z(r,a){if(1&r&&(e.j41(0,"div",28)(1,"div",29),e.nrm(2,"i",30),e.j41(3,"span",31),e.EFF(4),e.k0s()()()),2&r){const t=e.XpG(2);e.R7$(4),e.JRh(t.selectionErrorMessage)}}function Y(r,a){1&r&&e.nrm(0,"i",32)}function J(r,a){if(1&r){const t=e.RV6();e.qex(0),e.j41(1,"h2",7),e.EFF(2,"Verifica\xe7\xe3o de Acesso"),e.k0s(),e.j41(3,"p",8),e.EFF(4," Para ajudar na seguran\xe7a do nosso portal queremos verificar o seu acesso, para isso mandaremos um c\xf3digo para o seu e-mail. "),e.k0s(),e.j41(5,"p",9),e.EFF(6," Escolha o e-mail para receber um c\xf3digo de verifica\xe7\xe3o: "),e.k0s(),e.DNE(7,X,2,1,"div",10)(8,z,5,1,"div",11),e.j41(9,"div",12)(10,"button",13),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.goBack())}),e.k0s(),e.j41(11,"button",14),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onGenerateCode())}),e.DNE(12,Y,1,0,"i",15),e.j41(13,"span"),e.EFF(14),e.k0s()()(),e.j41(15,"div",16)(16,"p",17)(17,"a",18),e.bIt("click",function(o){e.eBV(t);const s=e.XpG();return e.Njj(s.selectedContactHash?s.hasAlreadyCode(o):o.preventDefault())}),e.EFF(18," J\xe1 tenho um c\xf3digo "),e.k0s()(),e.j41(19,"p",19)(20,"a",20),e.EFF(21," N\xe3o tenho acesso ao e-mail "),e.k0s()()(),e.bVm()}if(2&r){const t=e.XpG();e.R7$(7),e.Y8G("ngIf",t.contactOptions.length>0),e.R7$(),e.Y8G("ngIf",t.selectionErrorMessage),e.R7$(2),e.Y8G("disabled",t.isLoading),e.R7$(),e.Y8G("disabled",!t.selectedContactHash||t.isLoading),e.R7$(),e.Y8G("ngIf",t.isLoading),e.R7$(2),e.JRh(t.isLoading?"Enviando...":"Receber c\xf3digo"),e.R7$(3),e.Y8G("ngStyle",t.selectedContactHash?null:e.lJ4(9,U)),e.BMQ("aria-disabled",!t.selectedContactHash),e.R7$(3),e.Y8G("href",t.whatsappSupportLink,e.B4B)}}function K(r,a){if(1&r&&(e.j41(0,"div",28)(1,"div",45),e.nrm(2,"i",46),e.j41(3,"span",47),e.EFF(4),e.k0s()()()),2&r){const t=e.XpG(3);e.R7$(4),e.JRh(t.codeInfoMessage)}}function W(r,a){1&r&&(e.j41(0,"span"),e.EFF(1,"C\xf3digo \xe9 obrigat\xf3rio"),e.k0s())}function Q(r,a){1&r&&(e.j41(0,"span"),e.EFF(1,"C\xf3digo deve ter exatamente 6 d\xedgitos"),e.k0s())}
1function Z(r,a){if(1&r&&(e.j41(0,"small",48),e.DNE(1,W,2,0,"span",49)(2,Q,2,0,"span",49),e.k0s()),2&r){let t,n;const o=e.XpG(3);e.R7$(),e.Y8G("ngIf",null==(t=o.codeForm.get("code"))||null==t.errors?null:t.errors.required),e.R7$(),e.Y8G("ngIf",null==(n=o.codeForm.get("code"))||null==n.errors?null:n.errors.pattern)}}function ee(r,a){if(1&r&&(e.j41(0,"div",28)(1,"div",29),e.nrm(2,"i",30),e.j41(3,"span",31),e.EFF(4),e.k0s()()()),2&r){const t=e.XpG(3);e.R7$(4),e.JRh(t.codeErrorMessage)}}function te(r,a){1&r&&e.nrm(0,"i",32)}function ne(r,a){if(1&r){const t=e.RV6();e.qex(0),e.j41(1,"h2",34),e.EFF(2,"Validar c\xf3digo"),e.k0s(),e.j41(3,"p",35),e.EFF(4),e.k0s(),e.DNE(5,K,5,1,"div",11),e.j41(6,"form",36),e.bIt("ngSubmit",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onCodeSubmit())}),e.j41(7,"div",28)(8,"input",37),e.bIt("input",function(o){e.eBV(t);const s=e.XpG(2);return e.Njj(s.onCodeInput(o))}),e.k0s(),e.DNE(9,Z,3,2,"small",38),e.k0s(),e.DNE(10,ee,5,1,"div",11),e.j41(11,"div",39)(12,"button",40),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.goBack())}),e.k0s(),e.j41(13,"button",41),e.DNE(14,te,1,0,"i",15),e.j41(15,"span"),e.EFF(16),e.k0s()()(),e.j41(17,"div",42)(18,"p",43),e.EFF(19," N\xe3o recebeu o c\xf3digo? "),e.j41(20,"span",44),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(!o.isResendDisabled()&&o.onResendCode())}),e.EFF(21),e.k0s()()()(),e.bVm()}if(2&r){let t;const n=e.XpG(2);e.R7$(4),e.SpI(" ",n.validationMessage," "),e.R7$(),e.Y8G("ngIf",n.codeInfoMessage),e.R7$(),e.Y8G("formGroup",n.codeForm),e.R7$(3),e.Y8G("ngIf",(null==(t=n.codeForm.get("code"))?null:t.invalid)&&(null==(t=n.codeForm.get("code"))?null:t.touched)),e.R7$(),e.Y8G("ngIf",n.codeErrorMessage),e.R7$(2),e.Y8G("disabled",n.isValidating),e.R7$(),e.Y8G("disabled",n.isValidating||n.codeForm.invali
1d),e.R7$(),e.Y8G("ngIf",n.isValidating),e.R7$(2),e.JRh(n.isValidating?"Validando...":"Validar c\xf3digo"),e.R7$(4),e.Y8G("ngClass",e.eq3(11,B,n.isResendDisabled())),e.R7$(),e.SpI(" ",n.getResendButtonText()," ")}}function oe(r,a){if(1&r){const t=e.RV6();e.j41(0,"div",16)(1,"h2",50),e.EFF(2,"N\xe3o foi poss\xedvel carregar os dados"),e.k0s(),e.j41(3,"p",51),e.EFF(4),e.k0s(),e.j41(5,"button",52),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.goBack())}),e.EFF(6," Voltar para sele\xe7\xe3o "),e.k0s()()}if(2&r){const t=e.XpG(2);e.R7$(4),e.JRh(t.codeErrorMessage||"Refa\xe7a a sele\xe7\xe3o de contato para solicitar ou informar um c\xf3digo.")}}function re(r,a){if(1&r&&(e.qex(0),e.DNE(1,ne,22,13,"ng-container",33)(2,oe,7,1,"ng-template",null,0,e.C5r),e.bVm()),2&r){const t=e.sdS(3),n=e.XpG();e.R7$(),e.Y8G("ngIf",n.hasValidContext)("ngIfElse",t)}}let I=(()=>{class r{fb;route;router;accessRequestService;stateService;errorHandler;toaster;userService;DEFAULT_COOLDOWN_SECONDS=60;TIMER_STORAGE_KEY="access-request-resend-timer";whatsappSupportLink="https://api.whatsapp.com/send?phone=551130031920&text=Ol%C3%A1.%20Gostaria%20de%20falar%20sobre%20o%20Sotreqlink";viewMode="select";contactOptions=[];selectedContactHash="";isLoading=!1;selectionErrorMessage="";customerName="";codeForm;isValidating=!1;isResendLoading=!1;codeErrorMessage="";codeInfoMessage="";resendTimer=0;contactMasked="";validationMessage="Informe o c\xf3digo enviado para o seu e-mail cadastrado.";codeExpiresAt=null;hasValidContext=!1;initialRetrySeconds=0;resendInterval=null;codeValueChangesSub;routeDataSub;constructor(t,n,o,s,i,c,h,f){this.fb=t,this.route=n,this.router=o,this.accessRequestService=s,this.stateService=i,this.errorHandler=c,this.toaster=h,this.userService=f}ngOnInit(){this.applyView("code"===this.route.snapshot.data?.view?"code":"select"),this.routeDataSub=this.route.data.subscribe(n=>{const o="code"===n?.view?"code":"select";o!==this.viewMode&&this.applyView(o)})}ngOnDestroy(){this.cleanupCodeResources(),this.routeDataSub?.unsubscribe()}validatePrerequisites(){return!!this.stateService.isValidForStep("select-contact")||(this.router.navigate([`/${g_BASE}/validate-customer`]),!1)}applyView(t){this.viewMode=t,"code"===t?this.initializeCodeFlow():(this.cleanupCodeResources(),this.initializeSelectionFlow())}initializeSelectionFlow(){this.selectionErrorMessage="",this.validatePrerequisites()&&this.loadContactOptions()}loadContactOptions(){var t=this;return(0,p.A)(function*(){try{const n=t.stateService.getCurrentState();if(t.contactOptions=n.availableContacts||[],t.customerName=n.customerName||"Cliente",0===t.contactOptions.length)return void(t.selectionErrorMessage="Nenhum contato encontrado. Reinicie o processo.")}catch(n){t.selectionErrorMessage=t.errorHandler.getErrorMessage(n)}})()}onGenerateCode(){var t=this;return(0,p.A)(function*(){if(t.selectedContactHash){t.isLoading=!0,t.selectionErrorMessage="";try{const n=t.stateService.getCurrentState();if(!n.requestToken)return void(t.selectionErrorMessage="Dados da sess\xe3o perdidos. Reinicie o processo.");const o=t.contactOptions.find(i=>i.id===t.selectedContactHash);o&&t.stateService.setSelectedContact(t.selectedContactHash,o.obfuscatedEmail);const s=yield t.accessRequestService.requestValidationCode({requestToken:n.requestToken,selectedContactId:t.selectedContactHash});if(s?.codeSent){const i=s.retryAfterSeconds??void 0,c=`Informe o c\xf3digo recebido no e-mail ${o?.obfuscatedEmail}`;t.stateService.setResendCooldown(i),t.stateService.updateState({step:"enter-code",codeSent:!0,validationMessage:c,retryAfterSeconds:i??null}),(yield t.router.navigate(["/",g_BASE,"enter-code"]))||console.warn("[EmailSelection] Navega\xe7\xe3o para enter-code cancelada")}else t.selectionErrorMessage=s.message||"Erro ao enviar c\xf3digo."}catch(n){t.selectionErrorMessage=t.errorHandler.getErrorMessage(n)}finally{t.isLoading=!1}}else t.selectionErrorMessage="Selecione um e-mail para continuar."})()}onContactSelect(t){this.selectedContactHash=t,this.selectionErrorMessage=""}goBack(){"code"===this.viewMode?(this.stateService.setCurrentStep("select-contact"),this.router.navigate([`/${g_BASE}
1/select-contact`])):this.router.navigate([`/${g_BASE}/validate-customer`])}hasAlreadyCode(t){var n=this;return(0,p.A)(function*(){if(t?.preventDefault(),n.selectionErrorMessage="",!n.selectedContactHash)return void(n.selectionErrorMessage="Selecione um e-mail para continuar.");const o=n.stateService.getCurrentState();if(!o.requestToken)return n.selectionErrorMessage="Dados da sess\xe3o perdidos. Reinicie o processo.",void(yield n.router.navigate([`/${g_BASE}/validate-customer`]));const s=n.contactOptions.find(f=>f.id===n.selectedContactHash);s&&n.stateService.setSelectedContact(n.selectedContactHash,s.obfuscatedEmail);const i=o.retryAfterSeconds??o.resendAvailableInSeconds??null,c=s?`Informe o c\xf3digo recebido no e-mail ${s.obfuscatedEmail}`:o.validationMessage||"Informe o c\xf3digo recebido no e-mail";n.stateService.setResendCooldown(i),n.stateService.updateState({step:"enter-code",codeSent:!0,validationMessage:c,retryAfterSeconds:i}),(yield n.router.navigate(["/",g_BASE,"enter-code"]))||console.warn("[EmailSelection] Navega\xe7\xe3o para enter-code cancelada via j\xe1 tenho c\xf3digo")})()}initializeCodeFlow(){this.cleanupCodeResources(),this.codeForm=this.fb.group({code:["",[d.k0.required,d.k0.pattern(/^\d{6}$/)]]}),this.codeErrorMessage="",this.codeInfoMessage="",this.contactMasked="",this.validationMessage="Informe o c\xf3digo enviado para o seu e-mail cadastrado.",this.codeExpiresAt=null,this.hasValidContext=!1,this.resendTimer=0,this.initialRetrySeconds=0,this.hydrateCodeContext(),this.hasValidContext&&(!this.initializeResendTimer()&&this.initialRetrySeconds>0&&this.startCooldown(this.initialRetrySeconds),this.codeValueChangesSub=this.codeForm.get("code")?.valueChanges.subscribe(()=>{this.codeErrorMessage="",this.codeInfoMessage=""}))}hydrateCodeContext(){const t=this.stateService.getCodeValidationData();if(!t.requestToken)return this.hasValidContext=!1,void(this.codeErrorMessage="N\xe3o encontramos dados da solicita\xe7\xe3o. Refa\xe7a a verifica\xe7\xe3o para continuar.");this.hasValidContext=!0,this.stateService.setCurrentStep("enter-code"),t.validationMessage&&(this.validationMessage=t.validationMessage),this.contactMasked=t.contactMasked??"",this.codeExpiresAt=t.codeExpiresAt??null;const n=t.retryAfterSeconds??t.resendAvailableInSeconds??0;this.initialRetrySeconds=n>0?Math.ceil(n):0}initializeResendTimer(){const t=sessionStorage.getItem(this.TIMER_STORAGE_KEY);if(!t)return!1;try{const n=JSON.parse(t);if(n?.startedAt&&n?.duration){const o=this.computeRemainingSeconds(n.startedAt,n.duration);if(o>0)return this.resendTimer=o,this.startResendCountdown(),!0}}catch{const n=Number.parseInt(t,10);if(!Number.isNaN(n)){const o=this.computeRemainingSeconds(n,this.DEFAULT_COOLDOWN_SECONDS);if(o>0)return this.resendTimer=o,this.startResendCountdown(),!0}}return sessionStorage.removeItem(this.TIMER_STORAGE_KEY),!1}startResendCountdown(){this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=setInterval(()=>{this.resendTimer=Math.max(0,this.resendTimer-1),this.resendTimer<=0&&this.clearCooldown()},1e3)}startCooldown(t=this.DEFAULT_COOLDOWN_SECONDS){const n=Math.max(0,Math.ceil(t));if(n<=0)return void this.clearCooldown();const o={startedAt:Date.now(),duration:n};sessionStorage.setItem(this.TIMER_STORAGE_KEY,JSON.stringify(o)),this.resendTimer=n,this.startResendCountdown()}clearCooldown(){this.resendInterval&&(clearInterval(this.resendInterval),this.resendInterval=null),this.resendTimer=0,sessionStorage.removeItem(this.TIMER_STORAGE_KEY)}cleanupCodeResources(){this.resendInterval&&(clearInterval(this.resendInterval),this.resendInterval=null),this.codeValueChangesSub?.unsubscribe(),this.codeValueChangesSub=void 0}computeRemainingSeconds(t,n){const o=Math.floor((Date.now()-t)/1e3);return Math.max(0,Math.ceil(n)-o)}onCodeSubmit(){var t=this;
1return(0,p.A)(function*(){if(t.codeForm.invalid)t.codeForm.markAllAsTouched();else{t.isValidating=!0,t.codeErrorMessage="",t.codeInfoMessage="";try{const n=t.codeForm.value.code,{requestToken:o}=t.stateService.getCodeValidationData();if(!o)return void(t.codeErrorMessage="Dados da sess\xe3o perdidos. Reinicie o processo.");const s=yield t.accessRequestService.validateCode({requestToken:o,code:n});if(!s.codeSent)return void(t.codeErrorMessage=s.message||"Erro ao validar c\xf3digo.");const i=yield t.handleMasterUserCreation();t.stateService.setResendCooldown(null),t.clearCooldown(),t.stateService.clearState(),i&&t.toaster.success("Cadastro realizado com sucesso!"),yield t.syncCompanyContext(i),t.getIsTermAccepted(i)?yield t.router.navigateByUrl("/home"):yield t.router.navigateByUrl("/accessTerm")}catch(n){console.error("Erro ao validar c\xf3digo:",n),t.codeErrorMessage=400===n.status?"C\xf3digo inv\xe1lido":410===n.status?"C\xf3digo expirado. Solicite um novo c\xf3digo.":429===n.status?"Muitas tentativas. Aguarde alguns minutos antes de tentar novamente.":"C\xf3digo inv\xe1lido."}finally{t.isValidating=!1}}})()}onResendCode(){var t=this;return(0,p.A)(function*(){if(!(t.resendTimer>0)){t.isResendLoading=!0,t.codeErrorMessage="",t.codeInfoMessage="";try{const{requestToken:n,contactHash:o}=t.stateService.getCodeValidationData();if(!n)return void(t.codeErrorMessage="Dados da sess\xe3o perdidos. Reinicie o processo.");if(!o)return void(t.codeErrorMessage="Selecione um contato para reenviar o c\xf3digo.");const s=yield t.accessRequestService.requestValidationCode({requestToken:n,selectedContactId:o}),i=s.retryAfterSeconds??null;null===i?(t.clearCooldown(),t.stateService.setResendCooldown(null)):(t.startCooldown(i),t.stateService.setResendCooldown(i)),t.codeExpiresAt=s.codeExpiresAt??null,t.codeErrorMessage="",t.codeInfoMessage=s.message||"C\xf3digo reenviado com sucesso!"}catch(n){if(console.error("Erro ao reenviar c\xf3digo:",n),t.codeInfoMessage="",429===n.status){const o=Number(n.error?.waitTimeSeconds)||t.DEFAULT_COOLDOWN_SECONDS;t.codeErrorMessage=`Aguarde ${o} segundos antes de solicitar um novo c\xf3digo.`,t.startCooldown(o),t.stateService.setResendCooldown(o)}else t.codeErrorMessage="Erro ao reenviar c\xf3digo. Tente novamente."}finally{t.isResendLoading=!1}}})()}onCodeInput(t){let o=t.target.value.replaceAll(/\D/g,"");o=o.substring(0,6),this.codeForm.get("code")?.value!==o&&this.codeForm.patchValue({code:o},{emitEvent:!1}),6===o.length&&this.onCodeSubmit()}getResendButtonText(){return this.isResendLoading?"Reenviando...":this.resendTimer>0?`Reenviar c\xf3digo (${this.resendTimer}s)`:"Reenviar c\xf3digo"}isResendDisabled(){return this.resendTimer>0||this.isResendLoading}handleMasterUserCreation(){var t=this;return(0,p.A)(function*(){try{const n=t.buildMasterUserPayload();return n?(yield t.accessRequestService.createMasterUser(n))||(t.toaster.error("Erro ao criar usu\xe1rio mestre."),null):(t.toaster.error("Dados insuficientes para criar usu\xe1rio."),null)}catch(n){return console.error("Erro ao criar usu\xe1rio mestre:",n),t.toaster.error("Erro ao criar usu\xe1rio."),null}})()}syncCompanyContext(t){var n=this;return(0,p.A)(function*(){console.log("syncCompanyContext acionado",{masterUserResponse:t});const o=n.getLoginInfoId(t);if(!o)return void console.warn("syncCompanyContext ignorado: LoginInfoId nao encontrado no retorno do createMasterUser.");let s=!1;try{for(let i=1;i<=3;i++){if((yield b(n.userService.switchCompany(o,!1)))?.idLoginInfo===o){s=!0,console.log("Contexto da empresa sincronizado com sucesso.",{loginInfoId:o});break}console.log("Tentativa de sincroniza\xe7\xe3o do contexto da empresa falhou, tentando novamente...",{attempt:i}),yield n.wait(250*i)}s||console.warn("Contexto da empresa nao confirmou o loginInfo esperado apos switchCompany.",{expectedLoginInfoId:o}),yield b(n.userService.clearClassicSessionId(!1))}catch(i){console.warn("Nao foi possivel sincronizar o contexto da empresa ap\xf3s o cadastro.",i)}})()}wait(t){return new Promise(n=>setTimeout(n,t))}getLoginInfoId(t){console.log("getLoginInfoId chamado",{response:t});const n=t?.LoginInfoId??t?.loginInfoId;if(null==n)return null;const o=Number(n);return Number.isFinite(o)&&o>0?o:null}getIsTermAccepted(t){return!0===(t?.IsTermAccepted??t?.isTermAccepted)}buildMasterUserPayload(){const t=this.accessRequestService.getCurrentUserEmail(),n=this.accessRequestService.getCurrentUserOid(),s=this.stateService.getCurrentState().validatedDocument;return t&&n&&s?{Email:t,Oid:n,Document:s}:null}static \u0275fac=function(n){return new(n||r)(e.rXU(d.ok),e.rXU(m.nX),e.rXU(m.Ix),e.rXU(T),e.rXU(R),e.rXU(P),e.rXU(G.W9),e.rXU(L.D))};static \u0275cmp=e.VBU({type:r,selectors:[["app-email-selection"]],decls:7,vars:3,consts:[["missingContext",""],[1,"flex","justify-content-center","align-items-center","min-h-screen",2,"background-color","#e5e7eb"],[1,"surface-card","p-6","shadow-3","border-round","w-full",2,"max-width","500px","margin","1rem"],[1,"flex","justify-content-center","mb-4"],["src","assets/images/logo-sotreqlink.svg","alt","SotreqLink",2,"max-height","60px"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"text-left","mb-3","text-900",2,"font-size","20px","font-weight","600"],[1,"mb-4",2,"font-size","14px","line-height","1.4","margin-bottom","24px","color","#6b7280","text-align","justify"],[1,"mb-3",2,"font-size","14px","font-weight","400","color","#374151"],["class","contact-list mb-4","style","margin-bottom: 32px;",4,"ngIf"],["class","mb-4",4,"ngIf"],[1,"flex","gap-3","mb-4",2,"margin-bottom","32px"],["pButton","","type","button","label","Voltar",1,"p-button-outlined","p-button-secondary","flex-1",2,"padding","12px 24px","font-size","14px","font-weight","500",3,"click","disabled"],["pButton","","type","button",1,"p-button","p-button-primary","flex-1",2,"padding","12px 24px","font-size","14px","font-weight","500","background-color","#343434 !important","border-color","#343434 !important","color","#ffffff !important",3,"click","disabled"],["class","pi pi-spin pi-spinner mr-2",4,"ngIf"],[1,"text-center"],[2,"margin-bottom","8px"],["href","#",1,"curs
1or-pointer",2,"color","#000","font-size","14px","font-weight","600","text-decoration","none",3,"click","ngStyle"],[2,"margin-bottom","0"],["target","_blank","rel","noopener",1,"cursor-pointer",2,"color","#000","font-size","14px","font-weight","600","text-decoration","none",3,"href"],[1,"contact-list","mb-4",2,"margin-bottom","32px"],["class","contact-option mb-2","style","margin-bottom: 8px;",3,"ngClass","click","keydown.enter","keydown.space",4,"ngFor","ngForOf"],[1,"contact-option","mb-2",2,"margin-bottom","8px",3,"click","keydown.enter","keydown.space","ngClass"],[1,"flex","align-items-center",2,"padding","12px 0"],["type","radio","name","contact",1,"mr-3",2,"margin-right","12px","width","16px","height","16px",3,"change","id","value","checked"],[1,"cursor-pointer","flex-1",3,"for"],[1,"text-900",2,"font-size","14px","font-weight","400"],[1,"mb-4"],[1,"p-3","border-round","surface-100","border-left-3","border-red-500"],[1,"pi","pi-exclamation-triangle","mr-2","text-red-600"],[1,"text-red-700"],[1,"pi","pi-spin","pi-spinner","mr-2"],[4,"ngIf","ngIfElse"],[1,"text-left","mb-3","text-xl","font-semibold","text-900"],[1,"text-left","mb-4",2,"font-size","14px","line-height","1.4","color","#6b7280"],[3,"ngSubmit","formGroup"],["pInputText","","id","code","type","text","placeholder","C\xf3digo de verifica\xe7\xe3o","maxlength","6","formControlName","code",1,"w-full",2,"font-size","1rem","letter-spacing","normal","height","56px","border","1px solid #d1d5db","border-radius","4px","padding","12px 16px","text-align","left","box-sizing","border-box","background-color","#ffffff",3,"input"],["class","p-error block mt-1",4,"ngIf"],[1,"flex","gap-3","mb-4"],["pButton","","type","button","label","Voltar",1,"p-button-outlined","p-button-secondary","flex-1","p-3",3,"click","disabled"],["pButton","","type","submit",1,"p-button","p-button-primary","flex-1","p-3",2,"background-color","#343434 !important","border-color","#343434 !important","color","#ffffff !important",3,"disabled"],[1,"text-center","mt-4"],[1,"text-sm","mb-0",2,"color","#6b7280"],[1,"cursor-pointer",2,"font-weight","600","margin-left","6px","text-decoration","underline","color","#1d4ed8",3,"click","ngClass"],[1,"p-3","border-round","surface-100","border-left-3","border-green-500"],[1,"pi","pi-check-circle","mr-2","text-green-600"],[1,"text-green-700"],[1,"p-error","block","mt-1"],[4,"ngIf"],[1,"text-xl","font-semibold","text-900","mb-3"],[1,"text-600","mb-4"],["pButton","","type","button",1,"p-button","p-button-primary","w-full",3,"click"]],template:function(n,o){1&n&&(e.j41(0,"div",1)(1,"div",2)(2,"div",3),e.nrm(3,"img",4),e.k0s(),e.qex(4,5),e.DNE(5,J,22,10,"ng-container",6)(6,re,4,2,"ng-container",6),e.bVm(),e.k0s()()),2&n&&(e.R7$(4),e.Y8G("ngSwitch",o.viewMode),e.R7$(),e.Y8G("ngSwitchCase","select"),e.R7$(),e.Y8G("ngSwitchCase","code"))},dependencies:[u.YU,u.Sq,u.bT,u.B3,u.ux,u.e1,d.qT,d.me,d.BC,d.cb,d.tU,d.j4,d.JD,S._f,x.S],styles:["[_nghost-%COMP%]{display:block;font-family:Univers LT Std,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif}.surface-card[_ngcontent-%COMP%]{background:#fff;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.text-900[_ngcontent-%COMP%]{color:#1a1a1a}.text-600[_ngcontent-%COMP%]{color:#666}.text-500[_ngcontent-%COMP%]{color:#6b7280}.text-xl[_ngcontent-%COMP%]{font-size:1.25rem}.text-sm[_ngcontent-%COMP%]{font-size:.875rem}.font-semibold[_ngcontent-%COMP%]{font-weight:600}.font-bold[_ngcontent-%COMP%]{font-weight:700}.line-height-3[_ngcontent-%COMP%]{line-height:1.5}.flex-1[_ngcontent-%COMP%]{flex:1}.contact-option[_ngcontent-%COMP%]{cursor:pointer}.contact-option[_ngcontent-%COMP%]:hover{background-color:#00000005}.contact-option.selected-contact[_ngcontent-%COMP%]{background-color:#007bff14}input[type=radio][_ngcontent-%COMP%]{accent-color:#000;cursor:pointer}.p-button[_ngcontent-%COMP%]{border-radius:4px;border:1px solid;transition:all .2s ease}.p-button-primary[_ngcontent-%COMP%]{background-color:#4a5568;border-color:#4a5568;color:#fff}.p-button-primary[_ngcontent-%COMP%]:hover:not(:disabled){background-color:#2d3748;border-color:#2d3748}.p-button-outlined.p-button-secondary[_ngcontent-%COMP%]{color:#4a5568;border-color:#cbd5e0;background-color:transparent}.p-button-outlined.p-button-secondary[_ngcontent-%COMP%]:hover:not(:disabled){background-color:#f7fafc;border-color:#a0aec0}a[_ngcontent-%COMP%]{color:#000}a[_ngcontent-%COMP%]:hover{color:#333}.border-left-3[_ngcontent-%COMP%]{border-left-width:3px!important;border-left-style:solid}.border-red-500[_ngcontent-%COMP%]{border-left-color:#ef4444!important}.border-green-500[_ngcontent-%COMP%]{border-left-color:#22c55e!important}.surface-100[_ngcontent-%COMP%]{background-color:#fef2f2!important}.text-red-600[_ngcontent-%COMP%]{color:#dc2626}.text-red-700[_ngcontent-%COMP%]{color:#b91c1c}.text-green-600[_ngcontent-%COMP%]{color:#16a34a}.text-green-700[_ngcontent-%COMP%]{color:#15803d}"]})}return r})();function se(r,a){1&r&&(e.j41(0,"div",3)(1,"div",4),e.nrm(2,"div",5),e.k0s(),e.j41(3,"h2"),e.EFF(4,"Processando seu retorno..."),e.k0s(),e.j41(5,"p"),e.EFF(6,"Aguarde enquanto validamos suas credenciais com o External Entra ID."),e.k0s()())}function ie(r,a){if(1&r){const t=e.RV6();e.j41(0,"div",6)(1,"div",7),e.nrm(2,"i",8),e.k0s(),e.j41(3,"h2"),e.EFF(4,"Erro no Processamento"),e.k0s(),e.j41(5,"p",9),e.EFF(6),e.k0s(),e.j41(7,"div",10)(8,"button",11),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.retryProcess())}),e.EFF(9," Tentar Novamente "),e.k0s(),e.j41(10,"button",12),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.goToLogin())}),e.EFF(11," Voltar ao Login "),e.k0s()()()}if(2&r){const t=e.XpG();e.R7$(6),e.JRh(t.error)}}let ae=(()=>{class r{route;router;accessRequestService;isProcessing=!0;error=null;constructor(t,n,o){this.route=t,this.router=n,this.accessRequestService=o}ngOnInit(){this.processEntraCallback()}processEntraCallback(){var t=this;return(0,p.A)(function*(){try{const n=t.route.snapshot.queryParams;yield t.accessRequestService.entraCallback(n),yield t.router.navigate(["/access-request/vali
1date-customer"])}catch(n){console.error("Erro ao processar retorno do Entra ID:",n),t.error="Ocorreu um erro ao processar seu retorno do sistema de autentica\xe7\xe3o. Tente novamente.",t.isProcessing=!1}})()}retryProcess(){this.error=null,this.isProcessing=!0,this.processEntraCallback()}goToLogin(){this.router.navigate(["/login"])}static \u0275fac=function(n){return new(n||r)(e.rXU(m.nX),e.rXU(m.Ix),e.rXU(T))};static \u0275cmp=e.VBU({type:r,selectors:[["app-entra-return-handler"]],decls:3,vars:2,consts:[[1,"entra-return-container"],["class","processing-state",4,"ngIf"],["class","error-state",4,"ngIf"],[1,"processing-state"],[1,"spinner"],[1,"spinner-circle"],[1,"error-state"],[1,"error-icon"],[1,"pi","pi-exclamation-triangle"],[1,"error-message"],[1,"error-actions"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-secondary",3,"click"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.DNE(1,se,7,0,"div",1)(2,ie,12,1,"div",2),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngIf",o.isProcessing),e.R7$(),e.Y8G("ngIf",o.error&&!o.isProcessing))},dependencies:[u.bT],styles:[".entra-return-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:400px;padding:2rem;text-align:center}.processing-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem}.spinner[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin-bottom:1rem}.spinner-circle[_ngcontent-%COMP%]{width:50px;height:50px;border:4px solid #f3f3f3;border-top:4px solid #007bff;border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.error-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;max-width:500px}.error-icon[_ngcontent-%COMP%]{font-size:3rem;color:#dc3545;margin-bottom:1rem}.error-message[_ngcontent-%COMP%]{color:#6c757d;font-size:1.1rem;line-height:1.5;margin-bottom:1.5rem}.error-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;flex-wrap:wrap;justify-content:center}.btn[_ngcontent-%COMP%]{padding:.75rem 1.5rem;border:none;border-radius:.375rem;font-size:1rem;font-weight:500;cursor:pointer;transition:all .2s ease-in-out;text-decoration:none;display:inline-block}.btn-primary[_ngcontent-%COMP%]{background-color:#007bff;color:#fff}.btn-primary[_ngcontent-%COMP%]:hover{background-color:#0056b3}.btn-secondary[_ngcontent-%COMP%]{background-color:#6c757d;color:#fff}.btn-secondary[_ngcontent-%COMP%]:hover{background-color:#545b62}h2[_ngcontent-%COMP%]{color:#212529;font-size:1.5rem;font-weight:600;margin:0}p[_ngcontent-%COMP%]{color:#6c757d;margin:0}"]})}return r})(),v=(()=>class r{static CPF_LENGTH=11;static CNPJ_LENGTH=14;static CPF_PLACEHOLDER="000.000.000-00";static CNPJ_PLACEHOLDER="AA.AAA.AAA/AAAA-00";static extractDigits(t){return"string"!=typeof t?"":t.replace(/[^a-zA-Z0-9]/g,"")}static formatCpf(t){return t.substring(0,this.CPF_LENGTH).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2")}static formatCnpj(t){return t.substring(0,this.CNPJ_LENGTH).replace(/^(\w{2})(\w)/,"$1.$2").replace(/(\w{3})(\w)/,"$1.$2").replace(/(\w{3})(\w)/,"$1/$2").replace(/(\w{4})(\w?)/,"$1-$2").replace(/\-([a-zA-Z]{1,2})/,"-").replace(/\-(\d{1,2})(\w?)/,"-$1")}static formatDocument(t){const n=this.extractDigits(t);return n.length>this.CPF_LENGTH?this.formatCnpj(n):this.formatCpf(n)}static getPlaceholder(t){return t.length>this.CPF_LENGTH?this.CNPJ_PLACEHOLDER:this.CPF_PLACEHOLDER}static isValidCpf(t){if(!t||t.length!==this.CPF_LENGTH||/^(\d)\1{10}$/.test(t))return!1;let n=0;for(let c=0;c<9;c++)n+=parseInt(t.charAt(c),10)*(10-c);let o=n%11;const s=o<2?0:11-o;if(parseInt(t.charAt(9),10)!==s)return!1;n=0;for(let c=0;c<10;c++)n+=parseInt(t.charAt(c),10)*(11-c);o=n%11;const i=o<2?0:11-o;return parseInt(t.charAt(10),10)===i}static isValidCnpj(t){if(!t||t.length!==this.CNPJ_LENGTH||/^([a-zA-Z0-9])\1{13}$/.test(t.toUpperCase()))return!1;let n=0;const o=[5,4,3,2,9,8,7,6,5,4,3,2];for(let f=0;f<12;
1f++)n+=(t.toUpperCase().charCodeAt(f)-48)*o[f];let s=n%11;const i=s<2?0:11-s;if(parseInt(t.charAt(12),10)!==i)return!1;n=0;const c=[6,5,4,3,2,9,8,7,6,5,4,3,2];for(let f=0;f<13;f++)n+=(t.toUpperCase().charCodeAt(f)-48)*c[f];s=n%11;const h=s<2?0:11-s;return parseInt(t.charAt(13),10)===h}static isValidDocument(t){const n=this.extractDigits(t);return n.length===this.CPF_LENGTH?this.isValidCpf(n):n.length===this.CNPJ_LENGTH&&this.isValidCnpj(n)}})();function ce(r,a){if(1&r&&(e.j41(0,"div",18)(1,"div",19),e.nrm(2,"i",20),e.j41(3,"span",21),e.EFF(4),e.k0s()()()),2&r){const t=e.XpG();e.R7$(4),e.JRh(t.error)}}function le(r,a){1&r&&(e.j41(0,"small",22),e.EFF(1," Documento obrigat\xf3rio. "),e.k0s())}function de(r,a){1&r&&(e.j41(0,"small",22),e.EFF(1," Informe um CPF ou CNPJ v\xe1lido. "),e.k0s())}function ue(r,a){1&r&&(e.j41(0,"small",22),e.EFF(1," CPF inv\xe1lido. "),e.k0s())}function pe(r,a){1&r&&(e.j41(0,"small",22),e.EFF(1," CNPJ inv\xe1lido. "),e.k0s())}const me=[{path:"",component:k,children:[{path:"",redirectTo:"entra-return",pathMatch:"full"},{path:"entra-return",component:ae},{path:"validate-customer",component:(()=>{class r{fb;router;route;accessRequestService;stateService;errorHandler;msalAuthService;isLoading=!1;error=null;documentForm;documentPlaceholder="CNPJ ou CPF";isFromRequestCompanyAccess=!1;CPF_LENGTH=11;CNPJ_LENGTH=14;documentLengthValidator=t=>{const n=v.extractDigits(t.value);return n?n.length===this.CPF_LENGTH?v.isValidCpf(n)?null:{invalidCpf:!0}:n.length===this.CNPJ_LENGTH?v.isValidCnpj(n)?null:{invalidCnpj:!0}:{invalidLength:!0}:null};constructor(t,n,o,s,i,c,h){this.fb=t,this.router=n,this.route=o,this.accessRequestService=s,this.stateService=i,this.errorHandler=c,this.msalAuthService=h,this.isFromRequestCompanyAccess="request-company-access"===this.route.snapshot.queryParamMap.get("source"),this.documentForm=this.fb.group({document:["",[d.k0.required,this.documentLengthValidator]]})}onSubmit(){var t=this;return(0,p.A)(function*(){if(t.isLoading)return;if(t.documentForm.invalid)return void t.documentForm.markAllAsTouched();const n=v.extractDigits(t.documentForm.get("document")?.value);t.isLoading=!0,t.error=null;try{const o=yield t.accessRequestService.validateDocument(n);t.stateService.setValidationContext({requestToken:o.requestToken,customerName:o.customerName,availableContacts:o.availableContacts,codeSent:o.codeSent,validationMessage:o.message,codeExpiresAt:o.codeExpiresAt,retryAfterSeconds:o.retryAfterSeconds,validatedDocument:n}),yield t.router.navigate([`/${g_BASE}/select-contact`])}catch(o){console.error("Erro na valida\xe7\xe3o de documento:",o),t.error=t.errorHandler.getErrorMessage(o)}finally{t.isLoading=!1}})()}onDocumentInput(t){const n=t.target;let o=v.extractDigits(n.value);o.length>this.CNPJ_LENGTH&&(o=o.substring(0,this.CNPJ_LENGTH));const i=o.length>this.CPF_LENGTH?v.formatCnpj(o):v.formatCpf(o),c=this.documentForm.get("document");c?.setValue(i,{emitEvent:!1}),c?.updateValueAndValidity({emitEvent:!1}),n.value=i}get secondaryButtonLabel(){return this.isFromRequestCompanyAccess?"Voltar":"Sair"}onSecondaryAction(){this.isFromRequestCompanyAccess?this.router.navigate(["/home"]):this.msalAuthService.logout()}static \u0275fac=function(n){return new(n||r)(e.rXU(d.ok),e.rXU(m.Ix),e.rXU(m.nX),e.rXU(T),e.rXU(R),e.rXU(P),e.rXU(O.h))};static \u0275cmp=e.VBU({type:r,selectors:[["app-validate-customer"]],decls:24,vars:11,consts:[[1,"flex","justify-content-center","align-items-center","min-h-screen",2,"background-color","#e5e7eb"],[1,"surface-card","p-6","shadow-3","border-round","w-full",2,"max-width","500px","margin","1rem"],[1,"flex","justify-content-center","mb-4"],["src","assets/images/logo-sotreqlink.svg","alt","SotreqLink",2,"max-height","60px"],[1,"mb-3","text-xl","font-semibold","text-900"],["class","mb-4",4,"ngIf"],[1,"flex","flex-column","gap-3",3,"ngSubmit","formGroup"],[1,"text-600"],[1,"flex","flex-column","gap-2"],["for","document",1,"font-semibold","text-900"],["id","document","type","text","pInputText","","maxlength","18","formControlName","document",1,"w-full",3,"input","placeholder"],["class","text-red-600",4,"ngIf"],[1,"flex","gap-3","mb-4",2,"margin-bottom","32px"],["pButton","","type","button",1,"p-button-outlined","p-button-secondary","flex-1",2,"padding","12px 24px","font-size","14px","font-weight","500","background-color","#ffffff !important","border","1p
1x solid #d1d5db !important","border-color","#d1d5db !important","color","#343434 !important",3,"click","label","disabled"],["pButton","","type","submit","label","Continuar",1,"p-button","p-button-primary","flex-1",2,"padding","12px 24px","font-size","14px","font-weight","500","background-color","#343434 !important","border-color","#343434 !important","color","#ffffff !important",3,"loading","disabled"],["href","https://api.whatsapp.com/send?phone=551130031920&text=Ol%C3%A1.%20Gostaria%20de%20falar%20sobre%20o%20Sotreqlink","target","_blank","rel","noopener",1,"whatsapp-open"],["xmlns","http://www.w3.org/2000/svg","width","30","height","30","viewBox","0 0 24 24"],["d","M.057 24l1.687-6.163c-1.041-1.804-1.588-3.849-1.587-5.946.003-6.556 5.338-11.891 11.893-11.891 3.181.001 6.167 1.24 8.413 3.488 2.245 2.248 3.481 5.236 3.48 8.414-.003 6.557-5.338 11.892-11.893 11.892-1.99-.001-3.951-.5-5.688-1.448l-6.305 1.654zm6.597-3.807c1.676.995 3.276 1.591 5.392 1.592 5.448 0 9.886-4.434 9.889-9.885.002-5.462-4.415-9.89-9.881-9.892-5.452 0-9.887 4.434-9.889 9.884-.001 2.225.651 3.891 1.746 5.634l-.999 3.648 3.742-.981zm11.387-5.464c-.074-.124-.272-.198-.57-.347-.297-.149-1.758-.868-2.031-.967-.272-.099-.47-.149-.669.149-.198.297-.768.967-.941 1.165-.173.198-.347.223-.644.074-.297-.149-1.255-.462-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.521.151-.172.2-.296.3-.495.099-.198.05-.372-.025-.521-.075-.148-.669-1.611-.916-2.206-.242-.579-.487-.501-.669-.51l-.57-.01c-.198 0-.52.074-.792.372s-1.04 1.016-1.04 2.479 1.065 2.876 1.213 3.074c.149.198 2.095 3.2 5.076 4.487.709.306 1.263.489 1.694.626.712.226 1.36.194 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.695.248-1.29.173-1.414z","fill","#FFFFFF"],[1,"mb-4"],[1,"p-3","border-round","surface-100","border-left-3","border-red-500","mb-4","error"],[1,"pi","pi-exclamation-triangle","mr-3","text-red-600"],[1,"text-red-700"],[1,"text-red-600"]],template:function(n,o){if(1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.nrm(3,"img",3),e.k0s(),e.j41(4,"h2",4),e.EFF(5,"Valida\xe7\xe3o de Documento"),e.k0s(),e.DNE(6,ce,5,1,"div",5),e.j41(7,"form",6),e.bIt("ngSubmit",function(){return o.onSubmit()}),e.j41(8,"p",7),e.EFF(9,"Digite seu CPF ou CNPJ para prosseguir com a solicita\xe7\xe3o de acesso."),e.k0s(),e.j41(10,"div",8)(11,"label",9),e.EFF(12,"CNPJ ou CPF"),e.k0s(),e.j41(13,"input",10),e.bIt("input",function(i){return o.onDocumentInput(i)}),e.k0s(),e.DNE(14,le,2,0,"small",11)(15,de,2,0,"small",11)(16,ue,2,0,"small",11)(17,pe,2,0,"small",11),e.k0s(),e.j41(18,"div",12)(19,"button",13),e.bIt("click",function(){return o.onSecondaryAction()}),e.k0s(),e.nrm(20,"button",14),e.k0s()()()(),e.j41(21,"a",15),e.qSk(),e.j41(22,"svg",16),e.nrm(23,"path",17),e.k0s()()),2&n){let s,i,c,h;e.R7$(6),e.Y8G("ngIf",o.error),e.R7$(),e.Y8G("formGroup",o.documentForm),e.R7$(6),e.Y8G("placeholder",o.documentPlaceholder),e.R7$(),e.Y8G("ngIf",(null==(s=o.documentForm.get("document"))?null:s.hasError("required"))&&(null==(s=o.documentForm.get("document"))?null:s.touched)),e.R7$(),e.Y8G("ngIf",(null==(i=o.documentForm.get("document"))?null:i.hasError("invalidLength"))&&(null==(i=o.documentForm.get("document"))?null:i.touched)),e.R7$(),e.Y8G("ngIf",(null==(c=o.documentForm.get("document"))?null:c.hasError("invalidCpf"))&&(null==(c=o.documentForm.get("document"))?null:c.touched)),e.R7$(),e.Y8G("ngIf",(null==(h=o.documentForm.get("document"))?null:h.hasError("invalidCnpj"))&&(null==(h=o.documentForm.get("document"))?null:h.touched)),e.R7$(2),e.Y8G("label",o.secondaryButtonLabel)("disabled",o.isLoading),e.R7$(),e.Y8G("loading",o.isLoading)("disabled",o.documentForm.invalid||o.isLoading)}},dependencies:[u.bT,d.qT,d.me,d.BC,d.cb,d.tU,d.j4,d.JD,S._f,x.S],styles:["[_nghost-%COMP%]{display:block;font-family:Univers LT Std,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.surface-card[_ngcontent-%COMP%]{background:#fff;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.text-xl[_ngcontent-%COMP%]{font-size:1.25rem}.text-sm[_ngcontent-%COMP%]{font-size:.875rem}.font-semibold[_ngcontent-%COMP%]{font-weight:600}
1.font-medium[_ngcontent-%COMP%]{font-weight:500}.line-height-3[_ngcontent-%COMP%]{line-height:1.5}.text-900[_ngcontent-%COMP%]{color:#212529}.text-600[_ngcontent-%COMP%]{color:#6c757d}.text-red-600[_ngcontent-%COMP%]{color:#dc2626}.text-red-700[_ngcontent-%COMP%]{color:#b91c1c}.flex-1[_ngcontent-%COMP%]{flex:1}.p-button[_ngcontent-%COMP%]{border-radius:.375rem;font-weight:500;padding:.75rem 1.5rem}.p-button-primary[_ngcontent-%COMP%]{background-color:#374151;border-color:#374151;color:#fff}.p-button-primary[_ngcontent-%COMP%]:hover:not(:disabled){background-color:#1f2937;border-color:#1f2937}.p-button-outlined.p-button-secondary[_ngcontent-%COMP%]{color:#374151;border-color:#d1d5db;background-color:transparent}.p-button-outlined.p-button-secondary[_ngcontent-%COMP%]:hover:not(:disabled){background-color:#f9fafb;border-color:#9ca3af}.p-inputtext[_ngcontent-%COMP%]{border-radius:.375rem;border:1px solid #d1d5db;padding:.75rem}.p-inputtext[_ngcontent-%COMP%]:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.border-left-3[_ngcontent-%COMP%]{border-left-width:3px!important;border-left-style:solid}.border-red-500[_ngcontent-%COMP%]{border-left-color:#ef4444!important}.surface-100[_ngcontent-%COMP%]{background-color:#fef2f2!important}.error[_ngcontent-%COMP%]{text-align:justify;display:flex;align-items:center;justify-content:space-between}"]})}return r})()},{path:"select-contact",component:I,data:{view:"select"}},{path:"enter-code",component:I,data:{view:"code"}},{path:"error",component:C}]}];let ge=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=e.$C({type:r});static \u0275inj=e.G2t({imports:[m.iI.forChild(me),m.iI]})}return r})(),fe=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=e.$C({type:r});static \u0275inj=e.G2t({providers:[T,R],imports:[u.MD,d.X1,d.YN,y.q1,S.tm,x.u,ge]})}return r})()},2242:(A,M,l)=>{l.d(M,{S:()=>x,u:()=>m});var u=l(4438),y=l(177),d=l(9417),S=l(5779);let x=(()=>{class e{el;ngModel;cd;config;variant="outlined";filled;constructor(E,_,C,k){this.el=E,this.ngModel=_,this.cd=C,this.config=k}ngAfterViewInit(){this.updateFilledState(),this.cd.detectChanges()}ngDoCheck(){this.updateFilledState()}onInput(){this.updateFilledState()}updateFilledState(){this.filled=this.el.nativeElement.value&&this.el.nativeElement.value.length||this.ngModel&&this.ngModel.model}static \u0275fac=function(_){return new(_||e)(u.rXU(u.aKT),u.rXU(d.vS,8),u.rXU(u.gRc),u.rXU(S.r1))};static \u0275dir=u.FsC({type:e,selectors:[["","pInputText",""]],hostAttrs:[1,"p-inputtext","p-component","p-element"],hostVars:4,hostBindings:function(_,C){1&_&&u.bIt("input",function(p){return C.onInput(p)}),2&_&&u.AVh("p-filled",C.filled)("p-variant-filled","filled"===C.variant||"filled"===C.config.inputStyle())},inputs:{variant:"variant"}})}return e})(),m=(()=>{class e{static \u0275fac=function(_){return new(_||e)};static \u0275mod=u.$C({type:e});static \u0275inj=u.G2t({imports:[y.MD]})}return e})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.