Files
kapp/2416.d41f23e5be68de03.js
T
2026-05-21 11:19:10 -03:00

1 line
31 KiB
JavaScript

(self.webpackChunkapp=self.webpackChunkapp||[]).push([[2416],{12416:(Pe,$,p)=>{p.r($),p.d($,{ExitPageModule:()=>ce});var G=p(61380),F=p(69270),C=p(15861),H=p(92340),E=p(90603),b=p(24889),U=p(64633),e=p(45449),m=p(47898),Z=p(89102),Q=p(27317),W=p(14690),K=p(21284),Y=p(80698),w=p(90944),J=p(87871),q=p(99826);function ee(l,_){1&l&&(e.\u0275\u0275elementStart(0,"div",8)(1,"div",9),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd()()),2&l&&(e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,1,"PG_EXIT_TEXT_NO_EVENTS")))}function te(l,_){if(1&l&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",26),e.\u0275\u0275element(2,"app-avatar",27),e.\u0275\u0275elementStart(3,"div",28)(4,"div",29),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",30)(7,"span",31),e.\u0275\u0275text(8),e.\u0275\u0275pipe(9,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementContainerEnd()),2&l){const n=e.\u0275\u0275nextContext().$implicit;let o,r,s,g;e.\u0275\u0275advance(2),e.\u0275\u0275property("firstName",null!==(o=null==n||null==n.driver||null==n.driver.fullName||null==(o=n.driver.fullName.split(" "))?null:o[0])&&void 0!==o?o:"")("lastName",null!==(r=null==n||null==n.driver||null==n.driver.fullName||null==(r=n.driver.fullName.split(" "))||null==(s=r.slice(1))?null:s.join(" "))&&void 0!==r?r:"")("thumbnailImage",null!==(g=null==n||null==n.driver?null:n.driver.thumbnailImage)&&void 0!==g?g:null)("size","sm"),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(null==n||null==n.driver?null:n.driver.fullName),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(9,6,"PG_EXIT_TEXT_DRIVER"))}}function ne(l,_){if(1&l&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",32),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",33),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&l){const n=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,2,"PG_EXIT_TEXT_LICENSEPLATONE")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(n.driver.licensePlateOne)}}function ie(l,_){if(1&l&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",32),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",33),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&l){const n=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,2,"PG_EXIT_TEXT_LICENSEPLATTWO")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(n.driver.licensePlateTwo)}}function oe(l,_){if(1&l&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",32),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",33),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&l){const n=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,2,"PG_EXIT_TEXT_NOTES")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(n.notes)}}function re(l,_){if(1&l){const n=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",10)(1,"div",11),e.\u0275\u0275listener("click",function(){const s=e.\u0275\u0275restoreView(n).$implicit,g=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(g.onEventClick(s))}),e.\u0275\u0275elementStart(2,"div",12)(3,"div",13),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",14),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"div",15),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(9,"div",16),e.\u0275\u0275listener("click",function(){const s=e.\u0275\u0275restoreView(n).$implicit,g=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(g.onEventClick(s))}),e.\u0275\u0275template(10,te,10,8,"ng-container",7),e.\u0275\u0275elementStart(11,"div",17)(12,"div",18),e.\u0275\u0275template(13,ne,6,4,"ng-container",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div",18),e.\u0275\u0275template(15,ie,6,4,"ng-container",7),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(16,"div",17)(17,"div",18),e.\u0275\u0275template(18,oe,6,4,"ng-container",7),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(19,"div",19)(20,"div",20)(21,"div",21),e.\u0275\u0275listener("click",function(){const s=e.\u0275\u0275restoreView(n).$implicit,g=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(g.createEntry(s))}),e.\u0275\u0275text(22),e.\u0275\u0275pipe(23,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(24,"div",20)(25,"div",22),e.\u0275\u0275listener("click",function(){const s=e.\u0275\u0275restoreView(n).$implicit,g=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(g.verifyIsAllGuestsHaveEmail(s))}),e.\u0275\u0275element(26,"ion-icon",23),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(27,"div",24),e.\u0275\u0275listener("click",function(){const s=e.\u0275\u0275restoreView(n).$implicit,g=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(g.shareEvent(s))}),e.\u0275\u0275element(28,"ion-icon",25),e.\u0275\u0275elementEnd()()()()}if(2&l){const n=_.$implicit,o=e.\u0275\u0275nextContext();e.\u0275\u0275property("className","event"),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(o.getEventTitleToTheView(n)),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(n.company?n.company.name:""),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(n.date),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",null==n?null:n.driver),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",n.driver&&n.driver.licensePlateOne),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.driver&&n.driver.licensePlateTwo),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",n.notes),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(23,9,"PG_EXIT_BTN_CREATE_ENTRANCE")," ")}}function se(l,_){if(1&l){const n=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ion-fab",35)(1,"ion-fab-button",36),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(n);const r=e.\u0275\u0275nextContext(2);return e.\u0275\u0275resetView(r.onGoToCreateEvent())}),e.\u0275\u0275element(2,"ion-icon",37),e.\u0275\u0275elementEnd()()}if(2&l){const n=e.\u0275\u0275nextContext().ngIf;e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled","Offline"===n.status)}}function ae(l,_){if(1&l&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,se,3,1,"ion-fab",34),e.\u0275\u0275elementContainerEnd()),2&l){const n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.shouldShowAddEventButton())}}const le=[{path:"",component:(()=>{class l{constructor(n,o,r,s,g,v,h,x,S,L,V,j,y,R,k,X,A,M,de,ge,pe,me,ve,he,fe,_e,ue){var a=this;this.logisticCompanyService=n,this.inviteApiService=o,this.navigationService=r,this.momentService=s,this.loadingService=g,this.notificatorService=v,this.profileManagerService=h,this.router=x,this.socialSharing=S,this.calendar=L,this.modalController=V,this.logService=j,this.authService=y,this.apiService=R,this.activatedRoute=k,this.enterExitIonTabsManagerService=X,this.geolocationService=A,this.portalLoginManagerService=M,this.androidPermissions=de,this.permissionsAndroidService=ge,this.modalPermissionsService=pe,this.platform=me,this.resumeCreateEventInterruptedService=ve,this.translateConfigService=he,this.stateService=fe,this.sessionAddFlowService=_e,this.userPhotoService=ue,this.events=[],this.voProfiles=[],this.numberRegistersPagination=10,this.page=0,this.loaded=!1,this.context="",this.processGetEventsErrorResponse=t=>{console.log("processGetEventsErrorResponse"),console.log("error:",t),this.logService.logError("http::processGetEventsErrorResponse","",t),this.loadingService.hide(null,"loading-events");const i={title:this.translateConfigService.translate("TOAST_TITLE_ERROR"),message:this.translateConfigService.translate("PG_EXIT_TOAST_EVENTS_ERROR_MESSAGE"),type:"error"};this.notificatorService.notify(i)},this.onEventClick=t=>{const i=t&&t.company?t.company.instanceName:"",c={state:{viewType:this.context,eventId:t.id,companyInstanceName:i}};this.getCompanyInstanceRelatedProfile(i).then(d=>{this.navigationService.forward(["/view-logistic-event/"],c)}).catch(d=>{this.handleErrorGetCompanyInstanceRelated(d,c)})},this.navigateToQRCode=()=>{this.navigationService.forward(["/home"])},this.shareEvent=t=>{const i=this.profileManagerService.getProfileLogistic(),c=t.title,d=this.momentService.formatAsEventAt(t.startAt),f=i.company&&i.company.name?i.company.name:"",P=t.fullPathLocator,T=this.getCompanyAddress(t),I=this.translateConfigService.translate("SHARE_EVENT_SUBJECT"),O=this.mensageShared(c,f,d,T,P,"OTHERS");this.socialSharing.share(O,I,"","").then(this.shareSuccessResponse).catch(this.shareErrorResponse)},this.shareSuccessResponse=t=>{console.log("shareSuccessResponse"),console.log("response:",t)},this.shareErrorResponse=t=>{console.log("shareErrorResponse"),console.log("error:",t)},this.createEntry=t=>{this.loadingService.show("Carregando dados","loading-event-data"),this.logisticCompanyService.getEvent(t.id,{},t.company?t.company.instanceName:"").then(function(){var f=(0,C.Z)(function*(u){yield a.loadingService.hide(null,"loading-event-data"),t=u,delete(t={...t,licensePlateOne:t.driver&&t.driver.licensePlateOne?t.driver.licensePlateOne:null,licensePlateTwo:t.driver&&t.driver.licensePlateTwo?t.driver.licensePlateTwo:null,hasCart:!(!t.driver||!t.driver.hasCart)&&t.driver.hasCart,onFoot:!(!t.driver||!t.driver.onFoot)&&t.driver.onFoot}).id,t.useLocatorPreAuthorized=null,t.useOwnLocator=null,t.locatorPreAuthorized=null,t.locator="",a.goToCreateEventName(t,"CLONE_EXIT")});return function(u){return f.apply(this,arguments)}}()).catch(function(){var f=(0,C.Z)(function*(u){yield a.loadingService.hide(null,"loading-event-data"),a.logService.logError("http::logisticEventApiService.getEvent","",u);const P={title:a.translateConfigService.translate("TOAST_TITLE_ERROR"),message:a.translateConfigService.translate("PG_EXIT_TOAST_EVENTS_DATA_ERROR_MESSAGE"),type:"error"};a.notificatorService.notify(P)});return function(u){return f.apply(this,arguments)}}())},this.verifyIsAllGuestsHaveEmail=t=>{this.eventBeingShare=t,this.addToCalendar(this.eventBeingShare)},this.openUpdateUserEmailModal=function(){var t=(0,C.Z)(function*(i){i=i.filter(d=>!d.email);const c=yield a.modalController.create({component:b.I1,componentProps:{guests:i}});c.onDidDismiss().then(a.onModalDismissCallback),yield c.present()});return function(i){return t.apply(this,arguments)}}(),this.onModalDismissCallback=t=>{console.log("onModalDismissCallback detail:",t),t&&t.data&&(this.updateGuestsData(t.data.guests),t.data.share&&this.addToCalendar(this.eventBeingShare))},this.updateGuestsData=t=>{let i=this.eventBeingShare.guests;i=i.map(c=>t.find(f=>f.id===c.id)||c),this.eventBeingShare.guests=i},this.addToCalendar=t=>{const i=this.profileManagerService.getProfileLogistic(),c=t.title,d=new Date(t.startAt),f=this.momentService.formatAsEventAt(t.startAt),u=new Date(t.endAt),P=i.company&&i.company.name?i.company.name:"",O="https://"+H.N.wc_url+"/?l="+t.locator,z=this.getCompanyAddress(t),N=[];t?.driver.email&&N.push(t?.driver.email),t?.assistants.forEach(B=>{B.email&&N.push(B.email)});const Ce={url:O,attendees:N.length?N:null},Ee=this.mensageShared(c,P,f,z,O,"CALENDAR");this.calendar.createEventInteractivelyWithOptions(c,z,Ee,d,u,Ce).then(this.addToCalendarSuccessResponse).catch(this.addToCalendarErrorResponse)},this.getCompanyAddress=t=>t.company&&t.company.address?t.company.address:"",this.addToCalendarSuccessResponse=t=>{console.log("addToCalendarSuccessResponse:",t)},this.addToCalendarErrorResponse=t=>{this.logService.logError("http::addToCalendarErrorResponse","",t),console.log("addToCalendarErrorResponse:",t)},this.getGuestClass=t=>t.status.toLowerCase().replace(/_/g,"-"),this.getEventTitleToTheView=t=>t.title,this.goToCreateEventName=(t=null,i="EXIT")=>{this.navigationService.forward(["/logistic-events/create/event-name"],{state:{action:t?"edit":"create",eventType:i,event:t}})},this.thereAreProfiles=()=>this.voProfiles.length>0,this.getNonLimitedProfiles=()=>{const t=[];return this.voProfiles.forEach(i=>{i.authorities&&i.authorities.includes("ROLE_COMPANY_LIMITED")?1!==i.authorities.length&&t.push(i):t.push(i)}),t},this.getExpeditionProfiles=()=>{const t=[];return this.voProfiles.forEach(i=>{i.authorities&&i.authorities.includes("ROLE_LOGI_EXP")&&t.push(i)}),t},this.thereAreNonLimitedProfiles=()=>!!this.getNonLimitedProfiles().length,this.onGoToCreateEvent=(0,C.Z)(function*(){a.sessionAddFlowService.clearSessionId(),!a.resumeCreateEvent()&&(a.loadingService.show(a.translateConfigService.translate("LOADING_CHECKING_DATA"),"on-create-event"),a.thereAreNonLimitedProfiles()?a.getVoProfiles().then((0,C.Z)(function*(){a.loadingService.hide(null,"on-create-event");const i=a.getExpeditionProfiles();if(!a.resumeCreateEventInterruptedService.getResumeCreationInterrupted().logistic.eventType)if(i&&i.length>1){const d=yield a.modalController.create({component:b.w9,componentProps:{profiles:a.getExpeditionProfiles()}});d.onDidDismiss().then(f=>{f.data?a.selectProfileModalVOOnProfileSelectCreateEventCallback(f.data):a.selectProfileModalVOOnBackCreateEventCallback()}),yield d.present()}else if(i[0])a.selectProfileModalVOOnProfileSelectCreateEventCallback(i[0]);else{a.loadingService.hide(null,"on-create-event");const d={title:a.translateConfigService.translate("PG_EXIT_TOAST_NO_ACCESS_PROFILE_TITLE"),message:a.translateConfigService.translate("PG_EXIT_TOAST_NO_ACCESS_PROFILE_MESSAGE"),type:"error",timeout:5e3};a.notificatorService.notify(d)}})).catch(i=>{a.loadingService.hide(null,"on-create-event");const c={title:a.translateConfigService.translate("PG_EXIT_TOAST_ERROR_REQUEST_TITLE"),message:a.translateConfigService.translate("PG_EXIT_TOAST_MESSAGE_ERROR_REQUEST"),type:"error",timeout:5e3};a.notificatorService.notify(c)}):a.loadingService.hide(null,"on-create-event").then(()=>{a.cantCreateEvent()}))}),this.getVoProfiles=()=>new Promise((t,i)=>{this.authService.getToken().then(c=>{this.apiService.getUserProfiles("LG",c).subscribe(d=>this.processGetVOUserProfilesSuccessResponse(d,t),d=>this.processGetVOUserProfilesErrorResponse(d,i))})}),this.processGetVOUserProfilesSuccessResponse=(t,i)=>{this.voProfiles=t,i()},this.processGetVOUserProfilesErrorResponse=(t,i)=>{i()},this.selectProfileModalVOOnProfileSelectCreateEventCallback=t=>{this.profileManagerService.setProfileLogistic(t),this.authService.getToken().then(i=>this.portalLoginManagerService.getAccessToken(t.login,t.portal,i)).then(function(){var i=(0,C.Z)(function*(c){const d=c.access_token,f=t.company.instanceName,{authorized:u}=yield a.checkSoftLock(f,d);u?a.handleVerifyCoordinatesSuccessResponse({authorized:u}):a.modalPermissionsService.openModal({permission:"GPS"}).then(function(){var P=(0,C.Z)(function*(T){if(T){a.platform.is("cordova")&&(yield a.permissionsAndroidService.hasPermission(a.androidPermissions.PERMISSION.ACCESS_COARSE_LOCATION));const{lat:I,lng:O}=yield a.geoCoordinates("geolocation::afterProfileSelectionLogistic","on-create-event");if(!I||!O)return;a.apiService.verifyCoordinates(t.company.instanceName,I,O,d).subscribe(a.handleVerifyCoordinatesSuccessResponse,a.handleVerifyCoordinatesErrorResponse)}else a.logService.logError("permissionModal::afterProfileSelectionPageExitLogitist","","modal-permission-rejected")});return function(T){return P.apply(this,arguments)}}())});return function(c){return i.apply(this,arguments)}}())},this.handleVerifyCoordinatesSuccessResponse=function(){var t=(0,C.Z)(function*(i){if(i.authorized)a.goToCreateEventName();else{const c=yield a.modalController.create({component:b.NO});c.onDidDismiss().then(()=>{}),yield c.present()}});return function(i){return t.apply(this,arguments)}}(),this.handleVerifyCoordinatesErrorResponse=t=>{this.logService.logError("http::exitHandleVerifyCoordinatesErrorResponse","",t);const i={title:this.translateConfigService.translate("PG_EXIT_TOAST_ERROR_CHECKING_LOCATION_MESSAGE"),message:this.translateConfigService.translate("PG_EXIT_TOAST_ERROR_CHECKING_LOCATION_MESSAGE"),type:"error",timeout:5e3};this.notificatorService.notify(i)},this.selectProfileModalVOOnBackCreateEventCallback=()=>{},this.shouldShowAddEventButton=()=>"VIEWING_TO_CREATE_FROM"!==this.context,this.sessionAddFlowService.clearSessionId(),this.activatedRoute.queryParams.subscribe(t=>{this.router.getCurrentNavigation().extras.state&&(this.context=this.router.getCurrentNavigation().extras.state.context,"VIEWING_TO_CREATE_FROM"===this.context?this.enterExitIonTabsManagerService.hide():this.enterExitIonTabsManagerService.show())})}ionViewDidEnter(){this.getVoProfiles(),this.resetEventsAndPage(),this.getEvents(this.page,!1)}ionViewWillLeave(){this.resetEventsAndPage()}callInfiniteScroll(n){setTimeout(()=>{n.target.complete(),this.page+=1,this.getEvents(this.page,n)},500)}getEvents(n,o){this.loaded=!1,o||this.loadingService.show(this.translateConfigService.translate("PG_EXIT_LOADING_EVENTS"),"loading-events");const r={"happensOn.equals":this.getStartAtFilterValue(),size:this.numberRegistersPagination,page:n,"eventStatus.in":"OPENED","eventBehavior.in":"EXIT",sort:["startAt,asc","endAt,asc","status,asc"]};this.logisticCompanyService.getEventsV2(r).then(s=>{s.exit.events.length>0?(this.processGetEventsSuccessResponse(s.exit.events),this.infiniteScroll.complete()):(this.infiniteScroll.disabled=!0,this.loadingService.hide(null,"loading-events"))}).catch(s=>{this.infiniteScroll.disabled=!0,this.processGetEventsErrorResponse(s)}).finally(()=>{this.loadingService.hide(null,"loading-events"),this.loaded=!0})}getStartAtFilterValue(n=null){return(n=n?new Date(n):new Date).setHours(0,0,0,0),n.toISOString()}getEndAtFilterValue(n=null){return(n=n?new Date(n):new Date).setHours(23,59,59,999),n.toISOString()}processGetEventsSuccessResponse(n){for(let o=0;o<n.length;o++)this.events.push(n[o]);this.loadingService.hide(null,"loading-events"),this.enrichPhotos(n)}enrichPhotos(n){const o=n.filter(r=>!!r.driver).map(r=>r.driver);o.length&&this.userPhotoService.enrichUsersWithPhotos(o)}resetEventsAndPage(){this.page=0,this.events=[]}geoCoordinates(n,o){var r=this;return(0,C.Z)(function*(){try{const s=yield r.geolocationService.getCurrentPositionAndRequestPermission();return{lat:s&&s.coords&&s.coords.latitude?s.coords.latitude:null,lng:s&&s.coords&&s.coords.longitude?s.coords.longitude:null}}catch(s){console.log("error:",s),r.loadingService.hide(null,o),r.logService.logError(n,"",s);let g="",v="";return"denied"===s?.coarseLocation||"denied"===s?.location?(v=r.translateConfigService.translate("TOAST_LOCATION_PERMISSION_DENIED_TITLE"),g=r.translateConfigService.translate("TOAST_LOCATION_PERMISSION_DENIED_MESSAGE")):(v=r.translateConfigService.translate("PG_EXIT_TOAST_GETTING_LOCATION_TITLE"),g=r.translateConfigService.translate("PG_EXIT_TOAST_GETTING_LOCATION_MESSAGE")),void r.notificatorService.notify({title:v,message:g,type:"error",timeout:8e3})}})()}resumeCreateEvent(n){let o=!1;const{logistic:r,vo:s,action:g,event:v}=this.resumeCreateEventInterruptedService.getResumeCreationInterrupted();return this.resumeCreateEventInterruptedService.showModalResumeCreateEventInterrupted({target:"LOGISTIC",eventType:"EXIT",canCreateEvent:!0,action:g,event:{id:v?.id?v?.id:"",instanceName:v?.instanceName?v.instanceName:""}}),(""!==r.eventType||r.eventType.length>1||s)&&(console.log(r,s),o=!0),o}mensageShared(n,o,r,s,g,v){const h=this.translateConfigService.translate("SHARE_TEXT_1"),x=this.translateConfigService.translate("SHARE_TEXT_2"),S=this.translateConfigService.translate("SHARE_TEXT_3"),L=this.translateConfigService.translate("SHARE_TEXT_4"),V=this.translateConfigService.translate("SHARE_TEXT_5"),j=this.translateConfigService.translate("SHARE_TEXT_6_LG"),y=this.translateConfigService.translate("SHARE_TEXT_8"),R=`${h} "${n}" ${x} ${o}`,A=`${V} ${g} ${j}`;let M="";return"CALENDAR"===v?(M=`${R}, ${A}\n\n${y}`,M):(M=`${R}, ${S} ${r}, ${L} ${s}.\n\n${A}\n\n${y}`,M)}getCompanyInstanceRelatedProfile(n){let o=null;return new Promise((r,s)=>{const g=h=>{const x=h;console.log(x);const S=this.getProfile(x,n);S?(this.profileManagerService.setProfile(S),r(S)):s("Does not have desired profile")},v=h=>{this.logService.logError("http::processGetCompanyInstanceRelatedLoginErrorResponse","",h),s(h)};this.authService.getToken().then(h=>{o=h,this.apiService.getUserProfiles("VO",o).subscribe(g,v)})})}getProfile(n,o){return n.find(r=>r.company.instanceName===o&&null!==r.login)}handleErrorGetCompanyInstanceRelated(n,o){console.log("http::processGetCompanyInstanceRelatedLoginErrorResponse",n),this.logService.logError("http::processGetCompanyInstanceRelatedLoginErrorResponse","",n),this.profileManagerService.getProfile()&&this.navigationService.forward(["/view-logistic-event/"],o)}checkSoftLock(n,o){var r=this;return(0,C.Z)(function*(){try{const{authorized:s}=yield r.apiService.checkSoftLock(n,null,null,o).toPromise();return{authorized:s}}catch(s){throw r.logService.logError("http:api:geo:verify-coodinates","CheckSoftLock HttpErro",s),s}})()}cantCreateEvent(){var n=this;return(0,C.Z)(function*(){yield(yield n.modalController.create({component:U.AL,componentProps:{},cssClass:"can-create-modal"})).present()})()}}return l.\u0275fac=function(n){return new(n||l)(e.\u0275\u0275directiveInject(m.g5),e.\u0275\u0275directiveInject(m.cX),e.\u0275\u0275directiveInject(m.f5),e.\u0275\u0275directiveInject(m.EM),e.\u0275\u0275directiveInject(m.bz),e.\u0275\u0275directiveInject(m.V6),e.\u0275\u0275directiveInject(m.v4),e.\u0275\u0275directiveInject(G.Router),e.\u0275\u0275directiveInject(Z.e),e.\u0275\u0275directiveInject(Q.f),e.\u0275\u0275directiveInject(E.ModalController),e.\u0275\u0275directiveInject(m.$V),e.\u0275\u0275directiveInject(m.e8),e.\u0275\u0275directiveInject(m.sM),e.\u0275\u0275directiveInject(G.ActivatedRoute),e.\u0275\u0275directiveInject(m.oG),e.\u0275\u0275directiveInject(m._1),e.\u0275\u0275directiveInject(m.dj),e.\u0275\u0275directiveInject(W.r),e.\u0275\u0275directiveInject(m.YY),e.\u0275\u0275directiveInject(m.JQ),e.\u0275\u0275directiveInject(E.Platform),e.\u0275\u0275directiveInject(m.NL),e.\u0275\u0275directiveInject(m.wK),e.\u0275\u0275directiveInject(K.b),e.\u0275\u0275directiveInject(Y.t),e.\u0275\u0275directiveInject(m.IR))},l.\u0275cmp=e.\u0275\u0275defineComponent({type:l,selectors:[["app-exit"]],viewQuery:function(n,o){if(1&n&&e.\u0275\u0275viewQuery(E.IonInfiniteScroll,5),2&n){let r;e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(o.infiniteScroll=r.first)}},decls:12,vars:8,consts:[[1,"page-title"],[1,"sub-title"],[1,"events"],["class","empty",4,"ngIf"],[3,"className",4,"ngFor","ngForOf"],[2,"z-index","100000",3,"ionInfinite"],["loadingSpinner","crescent"],[4,"ngIf"],[1,"empty"],[1,"text"],[3,"className"],[1,"top",3,"click"],[1,"title"],[1,"content"],[1,"company"],[1,"date"],[1,"middle",3,"click"],[1,"row"],[1,"field"],[1,"bottom"],[1,"actions"],[1,"create-entry-holder",3,"click"],[1,"calendar-holder",3,"click"],["slot","start","name","calendar","mode","ios"],[1,"share-holder",3,"click"],["slot","start","name","share","mode","ios"],[1,"driver-card"],[3,"firstName","lastName","thumbnailImage","size"],[1,"driver-info"],[1,"driver-name"],[1,"driver-meta"],[1,"driver-role-label"],[1,"label"],[1,"value"],["vertical","top","horizontal","end","slot","fixed",4,"ngIf"],["vertical","top","horizontal","end","slot","fixed"],[3,"disabled","click"],["name","add"]],template:function(n,o){1&n&&(e.\u0275\u0275elementStart(0,"ion-content")(1,"div",0)(2,"div",1),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(5,"div",2),e.\u0275\u0275template(6,ee,4,3,"div",3),e.\u0275\u0275template(7,re,29,11,"div",4),e.\u0275\u0275elementStart(8,"ion-infinite-scroll",5),e.\u0275\u0275listener("ionInfinite",function(s){return o.callInfiniteScroll(s)}),e.\u0275\u0275element(9,"ion-infinite-scroll-content",6),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(10,ae,2,1,"ng-container",7),e.\u0275\u0275pipe(11,"async"),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,4,"PG_EXIT_TEXT_TITLE")),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",o.loaded&&o.events&&0===o.events.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",o.events),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(11,6,o.stateService.getState())))},dependencies:[w.NgForOf,w.NgIf,E.IonContent,E.IonFab,E.IonFabButton,E.IonIcon,E.IonInfiniteScroll,E.IonInfiniteScrollContent,J.A,w.AsyncPipe,q.X$],styles:["ion-content[_ngcontent-%COMP%]{--background: #f1f1f1}.page-title[_ngcontent-%COMP%]{margin-top:30px;margin-bottom:26px}.page-title[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:initial!important;font-weight:700;text-align:center}.page-title[_ngcontent-%COMP%] .sub-title[_ngcontent-%COMP%]{text-align:center;color:#656768;font-size:.9em;margin-top:4px}.empty[_ngcontent-%COMP%], .not-empty[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:3em;color:#656768;font-size:.9em}.empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%], .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}.empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%], .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;margin-top:1em}.empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;border:1px solid #eee;padding:.25em .75em;border-radius:32px;margin-right:8px}.empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%], .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{margin-left:4px;color:#0ec254;margin-top:2px}.not-empty[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:1em;color:#656768;font-size:.9em;margin-bottom:2em}.not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}.not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;margin-top:0}.not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;border:1px solid #eee;padding:.25em .75em;border-radius:32px;margin-right:8px}.not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{margin-left:4px;color:#0ec254;margin-top:2px}.event[_ngcontent-%COMP%]{border:1px solid #eee;box-shadow:2px 2px 8px rgba(67,60,98,.1);background-color:#fff;border-radius:8px;width:90%;margin:12px auto}.event[_ngcontent-%COMP%] .top[_ngcontent-%COMP%]{display:flex;padding:16px;border-bottom:1px solid #eee;flex-direction:column}.event[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;font-size:.9em;color:#656768;margin-top:8px}.event[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:initial!important}.event[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{font-weight:700}.event[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .company[_ngcontent-%COMP%]{font-size:.9em}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%]{display:flex;padding:16px;border-bottom:1px solid #eee;flex-direction:column}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-grow:1;margin-bottom:8px}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:50%}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:700}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .driver-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-bottom:8px}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .driver-card[_ngcontent-%COMP%] app-avatar[_ngcontent-%COMP%]{flex-shrink:0}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .driver-card[_ngcontent-%COMP%] .driver-info[_ngcontent-%COMP%]{flex:1;min-width:0}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .driver-card[_ngcontent-%COMP%] .driver-info[_ngcontent-%COMP%] .driver-name[_ngcontent-%COMP%]{font-size:.9em;font-weight:700;color:#333}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .driver-card[_ngcontent-%COMP%] .driver-info[_ngcontent-%COMP%] .driver-meta[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:2px}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .driver-card[_ngcontent-%COMP%] .driver-info[_ngcontent-%COMP%] .driver-meta[_ngcontent-%COMP%] .driver-role-label[_ngcontent-%COMP%]{font-size:.8em;color:#aaa}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;font-size:.9em;color:#656768;margin-top:8px}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:initial!important}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{font-weight:700}.event[_ngcontent-%COMP%] .middle[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .company[_ngcontent-%COMP%]{font-size:.9em}.event[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%]{display:flex;padding:16px;justify-content:space-between}.event[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.event[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .create-entry-holder[_ngcontent-%COMP%]{border-radius:38px;display:flex;justify-content:center;align-items:center;border:2px solid #0ec254;background-color:#fff;color:#0ec254;height:38px;padding:0 12px}.event[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .calendar-holder[_ngcontent-%COMP%], .event[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-holder[_ngcontent-%COMP%]{height:38px;width:38px;border-radius:38px;display:flex;justify-content:center;align-items:center;border:2px solid #0ec254;background-color:#fff;color:#0ec254;font-size:24px}.event[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-holder[_ngcontent-%COMP%]{margin-left:12px}"]}),l})()}];let ce=(()=>{class l{}return l.\u0275fac=function(n){return new(n||l)},l.\u0275mod=e.\u0275\u0275defineNgModule({type:l}),l.\u0275inj=e.\u0275\u0275defineInjector({imports:[F.I,G.RouterModule.forChild(le)]}),l})()}}]);