1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(self.webpackChunkapp=self.webpackChunkapp||[]).push([[9774],{29774:(se,z,s)=>{s.r(z),s.d(z,{EventSharePageModule:()=>q});var G=s(61380),B=s(69270),p=s(15861),M=s(92340),X=s(24889),e=s(45449),V=s(89102),c=s(47898),Y=s(27317),h=s(90603),U=s(14690),F=s(80698),K=s(90944),Z=s(99826);function W(i,v){if(1&i){const n=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",13)(1,"button",9),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(n);const l=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(l.doShare())}),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd()()}2&i&&(e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,1,"PG_CREATE_SHARE_STEP_BTN_SHARE_LINK")))}function J(i,v){if(1&i){const n=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",13)(1,"button",9),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(n);const l=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(l.doCopyLink())}),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd()()}2&i&&(e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,1,"PG_CREATE_SHARE_STEP_BTN_COPY_LINK")))}const Q=[{path:"",component:(()=>{class i{constructor(n,r,l,O,A,R,I,x,b,L,y,N,E,f,D,j,C,m,ee){var g=this;this.socialSharing=n,this.navigationService=r,this.createLogisticEventService=l,this.calendar=O,this.modalController=A,this.profileManagerService=R,this.momentService=I,this.clipboardService=x,this.pendingRelease=b,this.notificatorService=L,this.permissionsAndroidService=y,this.modalPermissionService=N,this.platform=E,this.androidPermissions=f,this.logService=D,this.resumeCreateEventInterruptedService=j,this.translateConfigService=C,this.socialSharingService=m,this.sessionAddFlowService=ee,this.eventDirection="ENTRY",this.existPendings=!1,this.navigateToQRCode=()=>{this.navigationService.root(["/home"])},this.navigateToPendingLiberations=()=>{this.navigationService.forward(["/push-notifications"])},this.doShare=()=>{const t=this.profileManagerService.getProfileLogistic(),o=this.createLogisticEventService.getLocator(),a=M.N.wc_url,d=this.createLogisticEventService.getTitle(),u=t?.company?.name?t?.company?.name:"",H="https://"+a+"/?l="+o,S=this.momentService.formatAsEventAt(this.createLogisticEventService.getStartDate()),P=t?.company?.address?t?.company?.address:"",_=this.translateConfigService.translate("SHARE_EVENT_SUBJECT"),$=this.mensageShared(d,u,S,P,H,"OTHERS");this.socialSharing.share($,_,"","").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.verifyIsAllGuestsHaveEmail=()=>{const t=this.createLogisticEventService.getAssistants();t.find(a=>!a.email)?this.openUpdateUserEmailModal(t):this.addToCalendar()},this.openUpdateUserEmailModal=function(){var t=(0,p.Z)(function*(o){o=o.filter(d=>!d.email);const a=yield g.modalController.create({component:X.I1,componentProps:{guests:o}});a.onDidDismiss().then(g.onModalDismissCallback),yield a.present()});return function(o){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.updateGuestsData=t=>{let o=this.createLogisticEventService.getAssistants();o=o.map(a=>t.find(u=>u.id===a.id)||a),this.createLogisticEventService.setAssistants(o)},this.addToCalendarComponsed=()=>{const t=this.profileManagerService.getProfileLogistic(),a=(this.createLogisticEventService.getTitle(),new Date(this.createLogisticEventService.getStartDate())),d=new Date(this.createLogisticEventService.getEndDate()),S="https://"+M.N.wc_url+"/?l="+this.createLogisticEventService.getLocator(),P=t?.company?.address?t?.company?.address:"",_=this.createLogisticEventService.getTitle(),$=t.company&&t.company.name?t.company.name:"",te=this.momentService.formatAsEventAt(this.createLogisticEventService.getStartDate()),k=this.createLogisticEventService.getDriver(),ne=this.createLogisticEventService.getAssistants(),T=[];k.email&&T.push(k.email),ne.forEach(w=>{w.email&&T.push(w.email)});const ie={url:S,attendees:T.length?T:null},oe=this.mensageShared(_,$,te,P,S,"CALENDAR");this.calendar.createEventInteractivelyWithOptions(_,P,oe,a,d,ie).then(this.addToCalendarSuccessResponse).catch(this.addToCalendarErrorResponse)},this.addToCalendar=(0,p.Z)(function*(){(yield g.haspermissionCalendar())?g.addToCalendarComponsed():g.modalPermissionService.openModal({permission:"CALENDAR"}).then(o=>{o?g.requestPermissionCalendarAndContact().then((0,p.Z)(function*(){(yield g.haspermissionCalendar())&&g.addToCalendarComponsed()})):g.logService.logError("permissionModal::addToCalendarPageEventSharedLogistic","","modal-permission-rejected")})}),this.addToCalendarSuccessResponse=t=>{console.log("addToCalendarSuccessResponse:",t)},this.addToCalendarErrorResponse=t=>{console.log("addToCalendarErrorResponse:",t)},this.doCopyLink=()=>{const t=M.N.wc_url,o=this.createLogisticEventService.getLocator();this.clipboardService.copy("https://"+t+"/?l="+o).then(()=>{const d={message:"",title:this.translateConfigService.translate("PG_CREATE_TOAST_COPY_LINK"),type:"success",timeout:3e3};this.notificatorService.notify(d)})},this.exit=()=>{this.createLogisticEventService.clearCreateEventData(),this.resumeCreateEventInterruptedService.clearProfileLogisticCreationInterrupte(),this.resumeCreateEventInterruptedService.clearResumeCreationInterrupte(),this.navigationService.forward(["/home"])},this.sessionAddFlowService.clearSessionId()}ngOnInit(){this.getDirection()}ionViewDidEnter(){}ionViewDidLeave(){}getDirection(){const n=this.createLogisticEventService.getType();"CLONE_EXIT"===n?this.eventDirection="ENTRY":"CLONE_ENTRY"===n&&(this.eventDirection="EXIT")}haspermissionCalendar(){var n=this;return(0,p.Z)(function*(){const r=n.platform.is("cordova")?yield n.permissionsAndroidService.hasPermission("READ_CALENDAR"):{hasPermission:!0},l=n.platform.is("cordova")?yield n.permissionsAndroidService.hasPermission("WRITE_CALENDAR"):{hasPermission:!0};return!(!r.hasPermission||!l.hasPermission)})()}requestPermissionCalendarAndContact(){var n=this;return(0,p.Z)(function*(){const r=[n.androidPermissions.PERMISSION.READ_CALENDAR,n.androidPermissions.PERMISSION.WRITE_CALENDAR];return!!(yield n.permissionsAndroidService.multRequestPermissions(r)).hasPermission})()}mensageShared(n,r,l,O,A,R){const I=this.translateConfigService.translate("SHARE_TEXT_1"),x=this.translateConfigService.translate("SHARE_TEXT_2"),b=this.translateConfigService.translate("SHARE_TEXT_3"),L=this.translateConfigService.translate("SHARE_TEXT_4"),y=this.translateConfigService.translate("SHARE_TEXT_5"),N=this.translateConfigService.translate("SHARE_TEXT_6_LG"),E=this.translateConfigService.translate("SHARE_TEXT_8"),f=`${I} "${n}" ${x} ${r}`,C=`${y} ${A} ${N}`;let m="";return"CALENDAR"===R?(m=`${f}, ${C}\n\n${E}`,m):(m=`${f}, ${b} ${l}, ${L} ${O}.\n\n${C}\n\n${E}`,m)}}return i.\u0275fac=function(n){return new(n||i)(e.\u0275\u0275directiveInject(V.e),e.\u0275\u0275directiveInject(c.f5),e.\u0275\u0275directiveInject(c.V),e.\u0275\u0275directiveInject(Y.f),e.\u0275\u0275directiveInject(h.ModalController),e.\u0275\u0275directiveInject(c.v4),e.\u0275\u0275directiveInject(c.EM),e.\u0275\u0275directiveInject(c.Yv),e.\u0275\u0275directiveInject(c.xJ),e.\u0275\u0275directiveInject(c.V6),e.\u0275\u0275directiveInject(c.YY),e.\u0275\u0275directiveInject(c.JQ),e.\u0275\u0275directiveInject(h.Platform),e.\u0275\u0275directiveInject(U.r),e.\u0275\u0275directiveInject(c.$V),e.\u0275\u0275directiveInject(c.NL),e.\u0275\u0275directiveInject(c.wK),e.\u0275\u0275directiveInject(c.iX),e.\u0275\u0275directiveInject(F.t))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-event-share"]],decls:25,vars:14,consts:[["mode","ios"],["slot","start","margin-start","1"],["src","./assets/toolbar-logo.png"],[1,"centralized-content"],[1,"page-title"],[1,"title"],[1,"sub-title",3,"innerHTML"],[1,"actions"],[1,"add-to-calendar-button-holder"],[3,"click"],["class","share-button-holder",4,"ngIf"],[1,"exit-button-holder","button-holder"],[1,"back",3,"click"],[1,"share-button-holder"]],template:function(n,r){1&n&&(e.\u0275\u0275elementStart(0,"ion-header",0)(1,"ion-toolbar",0)(2,"ion-buttons",1),e.\u0275\u0275element(3,"ion-img",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"ion-title"),e.\u0275\u0275text(5," KeyAccess "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(6,"ion-content")(7,"div",3)(8,"div",4)(9,"div",5),e.\u0275\u0275text(10),e.\u0275\u0275pipe(11,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(12,"div",6),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div",7)(15,"div",8)(16,"button",9),e.\u0275\u0275listener("click",function(){return r.verifyIsAllGuestsHaveEmail()}),e.\u0275\u0275text(17),e.\u0275\u0275pipe(18,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(19,W,4,3,"div",10),e.\u0275\u0275template(20,J,4,3,"div",10),e.\u0275\u0275elementStart(21,"div",11)(22,"button",12),e.\u0275\u0275listener("click",function(){return r.exit()}),e.\u0275\u0275text(23),e.\u0275\u0275pipe(24,"translate"),e.\u0275\u0275elementEnd()()()()()),2&n&&(e.\u0275\u0275advance(10),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(11,6,"PG_CREATE_SHARE_STEP_TEXT_TITLE")),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerHTML",e.\u0275\u0275pipeBind1(13,8,"PG_CREATE_SHARE_STEP_TEXT_SUBTITLE"),e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(18,10,"PG_CREATE_SHARE_STEP_BTN_CALENDAR")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","ENTRY"===r.eventDirection),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","ENTRY"===r.eventDirection),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(24,12,"PG_CREATE_SHARE_STEP_BTN_CLOSET")," "))},dependencies:[K.NgIf,h.IonButtons,h.IonContent,h.IonHeader,h.IonImg,h.IonTitle,h.IonToolbar,Z.X$],styles:["ion-toolbar[_ngcontent-%COMP%]{font-family:Nunito,sans-serif;background-color:#fff;--background: #fff !important;padding:0 16px}ion-toolbar[_ngcontent-%COMP%] ion-img[_ngcontent-%COMP%]{height:25px;width:25px}ion-toolbar[_ngcontent-%COMP%] ion-title[_ngcontent-%COMP%]{letter-spacing:1px}ion-toolbar[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:24px;padding:0;width:24px;margin:0;font-size:19px;color:#656768}ion-toolbar[_ngcontent-%COMP%] ion-button.hover[_ngcontent-%COMP%]{background:#fff}.centralized-content[_ngcontent-%COMP%]{height:calc(100vh - 56px);display:flex;justify-content:center;align-items:center;flex-direction:column}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%]{margin-top:30px;margin-bottom:26px}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:700;text-align:center}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%] .sub-title[_ngcontent-%COMP%]{text-align:center;color:#656768;font-size:.9em;margin-top:4px;padding:0 8px}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;width:100%;flex-direction:column;align-items:center;justify-content:center}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-button-holder[_ngcontent-%COMP%]{text-align:center;margin-top:1em}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-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}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active{background-color:#fff;color:#0ec254;transition:background-color .1s ease-out}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus{outline:none}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .add-to-calendar-button-holder[_ngcontent-%COMP%]{text-align:center;margin-top:1em}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .add-to-calendar-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}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .add-to-calendar-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active{background-color:#fff;color:#0ec254;transition:background-color .1s ease-out}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .add-to-calendar-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus{outline:none}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .button-holder[_ngcontent-%COMP%]{justify-content:center}.pulsate-fwd[_ngcontent-%COMP%]{animation:pulsate-fwd .5s ease-in-out infinite both;outline:none}@keyframes pulsate-fwd{0%{transform:scale(1)}50%{transform:scale(1.5)}to{transform:scale(1)}}"]}),i})()}];let q=(()=>{class i{}return i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=e.\u0275\u0275defineNgModule({type:i}),i.\u0275inj=e.\u0275\u0275defineInjector({imports:[B.I,G.RouterModule.forChild(Q)]}),i})()}}]); |