1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(self.webpackChunkapp=self.webpackChunkapp||[]).push([[1366],{37763:(C,v,o)=>{o.d(v,{i:()=>e});var m=o(61380),h=o(92198),u=o(45449);let e=(()=>{class t{constructor(l){this.router=l}focusInRouterNavigate(){this.router.events.pipe((0,h.h)(l=>l instanceof m.NavigationEnd)).subscribe(()=>{const l=document.querySelector("#focusHeader");l&&l?.focus()})}applyFocusQuerySelector(l,f){setTimeout(()=>{document.querySelector(`#${l}`)?.focus()},f)}}return t.\u0275fac=function(l){return new(l||t)(u.\u0275\u0275inject(m.Router))},t.\u0275prov=u.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},45944:(C,v,o)=>{o.d(v,{K:()=>u});var m=o(15861),d=o(45449);let h=(()=>{class r{constructor(){}set(t,a){localStorage.setItem(t,JSON.stringify(a))}get(t){return JSON.parse(localStorage.getItem(t))??null}remove(t){localStorage.removeItem(t)}clear(){localStorage.clear()}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=d.\u0275\u0275defineInjectable({token:r,factory:r.\u0275fac,providedIn:"root"}),r})(),u=(()=>{class r{constructor(t){this.simpleStorageService=t,this.KEY="REGISTER_HAS_COMPANY",this.cache=null}set(t){this.simpleStorageService.set(this.KEY,t),this.cache=t}get(){const t=this.simpleStorageService.get(this.KEY);return this.cache=t,t}remove(){var t=this;return(0,m.Z)(function*(){t.simpleStorageService.remove(t.KEY),t.cache=null})()}}return r.\u0275fac=function(t){return new(t||r)(d.\u0275\u0275inject(h))},r.\u0275prov=d.\u0275\u0275defineInjectable({token:r,factory:r.\u0275fac,providedIn:"root"}),r})()},31366:(C,v,o)=>{o.r(v),o.d(v,{StartPageModule:()=>_});var m=o(61380),d=o(15861),h=o(35548),u=o(64633),r=o(71609),e=o(45449),t=o(47898),a=o(90603),l=o(37763),f=o(45944),T=o(90944),E=o(33159),P=o(71237),y=o(17029),M=o(99826);function b(s,p){if(1&s){const n=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",13),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(n);const c=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(c.onBadgeTap())}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&s){const n=e.\u0275\u0275nextContext();e.\u0275\u0275classProp("env-dev","dev"===n.currentEnvironmentType)("env-homol","homol"===n.currentEnvironmentType),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ","dev"===n.currentEnvironmentType?"DEV":"HOMOL","\n")}}let I=(()=>{class s{constructor(n,i,c,S,x,D,w,A,j,H,L,B){this.legalModalService=n,this.notificatorService=i,this.menuController=c,this.navigationService=S,this.insomniaService=x,this.translateConfigService=D,this.modalCtrl=w,this.focusService=A,this.initRegisterHasCompanyStorageService=j,this.loadingService=H,this.environmentSwitcher=L,this.storageService=B,this.isOpen=!1,this.currentEnvironmentType="dev",this.tapCount=0,this.TAP_THRESHOLD=7,this.badgeTapCount=0,this.BADGE_TAP_THRESHOLD=20,this.ionViewWillEnter=()=>{this.allowItToRest(),this.setDisableRightSideMenu();const g=this.environmentSwitcher.getCurrentEnvironment();this.currentEnvironmentType=g.type},this.checkUniqueDeviceId=()=>{this.navigationService.forward(["/identity-validator"])},this.setDisableRightSideMenu=()=>{this.menuController.enable(!1).then(this.onSetDisableRightSideMenuSuccessResponse).catch(this.onSetDisableRightSideMenuErrorResponse)},this.onSetDisableRightSideMenuSuccessResponse=g=>{},this.onSetDisableRightSideMenuErrorResponse=g=>{console.log("onSetDisableRightSideMenuErrorResponse"),console.log(g)},this.openLegalModal=()=>{this.modalLegal()},this.onRejectCallback=()=>{this.legalModalService.hideModal();const g=this.translateConfigService.translate("PG_START_TOAST_ACCEPT"),N={title:this.translateConfigService.translate("PG_START_TOAST_NOTICE_TITLE"),message:g,type:"error"};this.notificatorService.notify(N)},this.onSuccessCallback=()=>{this.checkUniqueDeviceId()},this.allowItToRest=()=>{this.insomniaService.allowSleepAgain().then(this.allowItToRestSuccessResponse).catch(this.allowItToRestErrorResponse)},this.allowItToRestSuccessResponse=()=>{},this.allowItToRestErrorResponse=g=>{console.log("allowItToRestErrorResponse"),console.log(g)},this.languageCurrent=this.translateConfigService.languageCurrent}ionViewDidEnter(){this.focusService.applyFocusQuerySelector("start",100),this.initRegisterHasCompanyStorageService.remove()}onStart(){this.openLegalModal()}modalLegal(){var n=this;return(0,d.Z)(function*(){const i=yield n.modalCtrl.create({component:u.dP,cssClass:"legal-modal-start",componentProps:{}});yield i.present();const{data:c}=yield i.onDidDismiss();c?.accept?setTimeout(()=>{n.navigationService.forward(["/identity-validator"])},400):c&&n.onRejectCallback()})()}onLogoTap(){const n=this.environmentSwitcher.getCurrentEnvironment();if(n.production&&"prod"===n.type)return console.log("[EnvironmentSwitcher] Easter egg desabilitado em produ\xe7\xe3o"),this.tapCount++,void(this.tapCount>=10&&(console.log("[EnvironmentSwitcher] Easter egg desabilitado em produ\xe7\xe3o"),this.tapCount=0));this.tapCount++,clearTimeout(this.tapTimeout),this.tapTimeout=setTimeout(()=>{this.tapCount=0},2e3),this.tapCount>=this.TAP_THRESHOLD&&(this.tapCount=0,clearTimeout(this.tapTimeout),this.openEnvironmentSwitcher())}openEnvironmentSwitcher(){var n=this;return(0,d.Z)(function*(){const i=yield n.modalCtrl.create({component:r.X,cssClass:"environment-switcher-modal",backdropDismiss:!0});yield i.present();const{data:c}=yield i.onDidDismiss();c?.selected&&(yield n.switchEnvironmentAndClearStorage(c.environment))})()}switchEnvironmentAndClearStorage(n){var i=this;return(0,d.Z)(function*(){console.log(`[StartPage] Iniciando troca para: ${n}`),i.loadingService.show("Trocando ambiente...","switch-environment");try{yield i.storageService.startStorage(),console.log("[StartPage] Storage inicializado"),yield i.storageService.clear(),console.log("[StartPage] Storage limpo"),localStorage.clear(),console.log("[StartPage] localStorage limpo"),yield h.g.removeAllListeners(),console.log("[StartPage] Listeners removidos"),yield i.environmentSwitcher.switchEnvironment(n),console.log("[StartPage] Ambiente trocado no servi\xe7o"),i.loadingService.hide(null,"switch-environment"),i.notificatorService.notify({title:"Ambiente Alterado",message:`Ambiente trocado para ${{dev:"Desenvolvimento",homol:"Homologa\xe7\xe3o",prod:"Produ\xe7\xe3o"}[n]}. Recarregando...`,type:"success",timeout:2e3}),console.log("[StartPage] Recarregando app em 500ms..."),setTimeout(()=>{console.log("[StartPage] Recarregando agora!"),window.location.reload()},500)}catch(c){console.error("[StartPage] Erro ao trocar ambiente:",c),i.loadingService.hide(null,"switch-environment"),i.notificatorService.notify({title:"Erro",message:"Erro ao trocar ambiente",type:"error",timeout:3e3})}})()}onBadgeTap(){const n=this.environmentSwitcher.getCurrentEnvironment();n.production&&"prod"===n.type?console.log("[DebugConsole] Easter egg desabilitado em produ\xe7\xe3o"):(this.badgeTapCount++,clearTimeout(this.badgeTapTimeout),this.badgeTapTimeout=setTimeout(()=>{this.badgeTapCount=0},2e3),this.badgeTapCount>=this.BADGE_TAP_THRESHOLD&&(this.badgeTapCount=0,clearTimeout(this.badgeTapTimeout),localStorage.setItem("ka_debug_console_enabled","true"),this.notificatorService.notify({title:"Debug Console",message:"Debug Console reativado! Recarregue a p\xe1gina.",type:"success",timeout:3e3}),setTimeout(()=>{window.location.reload()},1e3)))}}return s.\u0275fac=function(n){return new(n||s)(e.\u0275\u0275directiveInject(t.HX),e.\u0275\u0275directiveInject(t.V6),e.\u0275\u0275directiveInject(a.MenuController),e.\u0275\u0275directiveInject(t.f5),e.\u0275\u0275directiveInject(t.gc),e.\u0275\u0275directiveInject(t.wK),e.\u0275\u0275directiveInject(a.ModalController),e.\u0275\u0275directiveInject(l.i),e.\u0275\u0275directiveInject(f.K),e.\u0275\u0275directiveInject(t.bz),e.\u0275\u0275directiveInject(t.VN),e.\u0275\u0275directiveInject(t.V1))},s.\u0275cmp=e.\u0275\u0275defineComponent({type:s,selectors:[["app-start"]],decls:24,vars:7,consts:[[1,"ion-no-border"],["id","start","tabindex","0"],["slot","end",1,"btn-translate"],["class","environment-badge",3,"env-dev","env-homol","click",4,"ngIf"],[1,"start-page"],[1,"ion-margin-vertical"],[2,"cursor","pointer",3,"click"],[1,"flex-auto"],[1,"welcome-message"],["tabindex","1",3,"innerHTML"],["size","12"],[1,"start-button-holder"],["type","button",3,"click"],[1,"environment-badge",3,"click"]],template:function(n,i){1&n&&(e.\u0275\u0275elementStart(0,"ion-header",0),e.\u0275\u0275element(1,"p",1),e.\u0275\u0275elementStart(2,"ion-toolbar")(3,"ion-buttons",2),e.\u0275\u0275element(4,"app-translate-btn"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275template(5,b,2,5,"div",3),e.\u0275\u0275elementStart(6,"ion-content",4)(7,"ion-grid")(8,"ion-row")(9,"ion-col",5)(10,"div",6),e.\u0275\u0275listener("click",function(){return i.onLogoTap()}),e.\u0275\u0275element(11,"app-full-logo"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(12,"ion-row",7)(13,"ion-col",5)(14,"div",8)(15,"ion-text"),e.\u0275\u0275element(16,"p",9),e.\u0275\u0275pipe(17,"translate"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(18,"ion-col",10)(19,"div",11)(20,"button",12),e.\u0275\u0275listener("click",function(){return i.onStart()}),e.\u0275\u0275text(21),e.\u0275\u0275pipe(22,"translate"),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275element(23,"app-privacy-footer"),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf","prod"!==i.currentEnvironmentType),e.\u0275\u0275advance(11),e.\u0275\u0275property("innerHTML",e.\u0275\u0275pipeBind1(17,3,"PG_START_WELCOME"),e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(22,5,"PG_START_BTN_START")))},dependencies:[T.NgIf,a.IonButtons,a.IonCol,a.IonContent,a.IonGrid,a.IonHeader,a.IonRow,a.IonText,a.IonToolbar,E.R,P.M,y.c,M.X$],styles:[".start-page[_ngcontent-%COMP%]{overflow:hidden;height:100vh;position:relative}.start-page[_ngcontent-%COMP%] .btn-translate[_ngcontent-%COMP%]{position:absolute;z-index:10000;right:0;top:1em}ion-header[_ngcontent-%COMP%]{height:0}ion-header[_ngcontent-%COMP%] #start[_ngcontent-%COMP%]{margin:0}ion-header[_ngcontent-%COMP%] ion-toolbar[_ngcontent-%COMP%]{--background: #fff}.half-top[_ngcontent-%COMP%]{height:50vh}.half-bottom[_ngcontent-%COMP%]{height:50vh;display:flex;flex-direction:column;justify-content:center;align-items:center}.logo-holder[_ngcontent-%COMP%]{padding-top:48px;text-align:center}.welcome-message[_ngcontent-%COMP%]{text-align:center;margin:0 2em;color:#383a3e;font-size:1.1em}.welcome-message[_ngcontent-%COMP%] ion-text[_ngcontent-%COMP%] a[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{font-weight:700;color:#6cb52d;font-family:Nunito,sans-serif;letter-spacing:1px}.start-button-holder[_ngcontent-%COMP%]{text-align:center;margin-top:3em}.start-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.75em 1.5em;border-radius:50px;background-color:#0ec254;color:#fff;font-size:1em;transition:background-color .1s ease-out}.start-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active{background-color:#fff;color:#0ec254;transition:background-color .1s ease-out}.start-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus{outline:none}.environment-badge[_ngcontent-%COMP%]{position:fixed;top:60px;right:16px;padding:6px 12px;border-radius:12px;font-size:11px;font-weight:700;letter-spacing:.5px;z-index:9999;box-shadow:0 2px 8px rgba(0,0,0,.15);animation:fadeIn .3s ease-in}.environment-badge.env-dev[_ngcontent-%COMP%]{background:linear-gradient(135deg,#4caf50 0%,#45a049 100%);color:#fff}.environment-badge.env-homol[_ngcontent-%COMP%]{background:linear-gradient(135deg,#ff9800 0%,#f57c00 100%);color:#fff}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}"]}),s})();var R=o(69270);const O=[{path:"",component:I}];let _=(()=>{class s{}return s.\u0275fac=function(n){return new(n||s)},s.\u0275mod=e.\u0275\u0275defineNgModule({type:s}),s.\u0275inj=e.\u0275\u0275defineInjector({imports:[R.I,m.RouterModule.forChild(O)]}),s})()}}]); |