1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
(self.webpackChunkapp=self.webpackChunkapp||[]).push([[1363],{91363:(O,m,i)=>{i.r(m),i.d(m,{CreateEventEventOptionsPageModule:()=>M});var h=i(90944),d=i(24006),E=i(61380),e=i(45449),u=i(47898),C=i(37763),p=i(90603),f=i(36290),l=i(99826);function S(n,v){if(1&n&&(e.\u0275\u0275elementStart(0,"div",22)(1,"div",23),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(6,"min. "),e.\u0275\u0275elementEnd()()),2&n){const o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,2,"PG_CREATE_OPTIONS_STEP_TEXT_CHECKINSTART_MAX")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(o.maxcheckInStartAt)}}function P(n,v){if(1&n&&(e.\u0275\u0275elementStart(0,"div",23),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const o=v.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(o.message)}}function T(n,v){if(1&n&&(e.\u0275\u0275elementStart(0,"div",22),e.\u0275\u0275template(1,P,2,1,"div",24),e.\u0275\u0275elementEnd()),2&n){const o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",o.eventTitleFormErrors)}}let I=(()=>{class n{constructor(o,t,r,s,_,N,x,y){this.createEventService=o,this.navigationService=t,this.commonService=r,this.notificatorService=s,this.fb=_,this.translateConfigService=N,this.focusService=x,this.profileManagerService=y,this.defaultMultiCheckIn=!1,this.defaultCompanionAllowed=!0,this.defaultNeedAuthorization=!0,this.defaultCheckInStartAt=15,this.multiCheckin=this.defaultMultiCheckIn,this.allowCompanion=this.defaultCompanionAllowed,this.needAuthorization=this.defaultNeedAuthorization,this.checkInStartAt=this.defaultCheckInStartAt,this.maxcheckInStartAt=60,this.navigateToQRCode=()=>{this.navigationService.forward(["/home"])},this.navigateToPendingLiberations=()=>{this.navigationService.forward(["/push-notifications"])},this.onSubmit=()=>{this.cleanValidationErrors();const a=this.commonService.clearString(this.checkInStartAt),g=this.validateInput({checkInStartAt:a});if(g.length){this.setValidationErrors(g);const b={title:this.translateConfigService.translate("PG_CREATE_OPTIONS_STEP_TOAST_INVALID_DATA_TITLE"),message:this.translateConfigService.translate("PG_CREATE_OPTIONS_STEP_TOAST_INVALID_DATA_MESSAGE"),type:"error"};this.notificatorService.notify(b)}else this.createEventService.setMultiCheckIn(this.multiCheckin),this.createEventService.setCompanionAllowed(this.allowCompanion),this.createEventService.setNeedAuthorization(this.needAuthorization),this.createEventService.setCheckInStartAt(a),this.goToEventResume()},this.validateInput=a=>{const c=[],g=this.validateCheckInStartAtInput(a);return g&&c.push(g),c},this.validateCheckInStartAtInput=a=>a.checkInStartAt&&/^\d+$/.test(a.checkInStartAt)?this.checkInStartAtForm.errors&&this.checkInStartAtForm.errors.max?{message:`${this.translateConfigService.translate("PG_CREATE_OPTIONS_STEP_TEXT_CHECKINSTART_MAX")} ${this.maxcheckInStartAt}min.`,field:"title"}:null:{message:this.translateConfigService.translate("PG_CREATE_OPTIONS_STEP_TEXT_CHECKINSTART"),field:"title"},this.onMultiCheckinChange=a=>{const{checked:c}=a.target;this.multiCheckin=c},this.onCompanionAllowedChange=a=>{const{checked:c}=a.target;this.allowCompanion=c},this.onNeedAuthorizationChange=a=>{const{checked:c}=a.target;this.needAuthorization=c},this.onCheckInStartAtChange=a=>{const{value:c}=a.target;this.checkInStartAt=c},this.goToEventResume=()=>{const c={state:{event:{id:this.createEventService.getId(),title:this.createEventService.getTitle(),startAt:this.createEventService.getStartDate(),endAt:this.createEventService.getEndDate(),floor:this.createEventService.getSelectedFloor(),group:this.createEventService.getSelectedGroup(),hosts:this.createEventService.getHosts(),guests:this.createEventService.getGuests(),multiCheckin:this.createEventService.getMultiCheckIn(),allowCompanion:this.createEventService.getCompanionAllowed(),needAuthorization:this.createEventService.getNeedAuthorization(),checkinStartAt:this.createEventService.getCheckInStartAt(),bookeis:this.createEventService.getBookings(),bookeisToCancel:this.existIdEvent?this.createEventService.getBookeisToCancel():[],recurrent:this.createEventService.getRecurrent(),recurrenceDates:this.createEventService.getRecurrenceDates()},isLimitedProfile:!1}};this.navigationService.forward(["/create-event-event-resume"],c)},this.goOneStepBack=()=>{this.navigationService.back(["/create-event-event-guests"])},this.setValidationErrors=a=>{this.eventTitleFormErrors=a},this.cleanValidationErrors=()=>{this.eventTitleFormErrors=[]},this.existIdEvent=!this.createEventService.getIsNew()}ionViewWillEnter(){this.focusService.applyFocusQuerySelector("create_event_options",3500)}ngOnInit(){let o=15;if(this.createEventService.getIsNew()){const{multiCheckin:t,allowCompanion:r,checkinStartAt:s,autoRelease:_}=this.createEventService.getSettingsCompany()??{};this.multiCheckin=void 0!==t?t:this.defaultMultiCheckIn,this.allowCompanion=void 0!==r?r:this.defaultCompanionAllowed,this.needAuthorization=void 0!==_?!_:this.defaultNeedAuthorization,this.checkInStartAt=void 0!==s?s:this.defaultCheckInStartAt}else this.multiCheckin=this.createEventService.getMultiCheckIn(),this.allowCompanion=this.createEventService.getCompanionAllowed(),this.needAuthorization=this.createEventService.getNeedAuthorization(),this.checkInStartAt=this.createEventService.getCheckInStartAt(),o=this.createEventService.getCheckInStartAt()?this.defaultCheckInStartAt:15;o=this.checkInStartAt,this.eventTitleFormErrors=[],this.form=this.fb.group({checkInStartAt:[o,[d.Validators.max(this.maxcheckInStartAt)]]})}get checkInStartAtForm(){return this.form.get("checkInStartAt")}ionViewDidEnter(){}ionViewDidLeave(){}isLimited2Profile(){return this.profileManagerService.getProfile()?.authorities?.includes("ROLE_COMPANY_LIMITED2")||!1}}return n.\u0275fac=function(o){return new(o||n)(e.\u0275\u0275directiveInject(u.jc),e.\u0275\u0275directiveInject(u.f5),e.\u0275\u0275directiveInject(u.v_),e.\u0275\u0275directiveInject(u.V6),e.\u0275\u0275directiveInject(d.UntypedFormBuilder),e.\u0275\u0275directiveInject(u.wK),e.\u0275\u0275directiveInject(C.i),e.\u0275\u0275directiveInject(u.v4))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-create-event-event-options"]],decls:63,vars:62,consts:[["defaultHref","create-event-event-guests",3,"title","showBadge","refresh","menuToggle"],[1,"centralized-content"],[2,"width","100%","height","10px"],[1,"ion-margin-vertical"],[1,"input-holder"],["id","create_event_options",1,"input"],["tabindex","2","type","checkbox","id","multi-check-in","name","multiCheckin",3,"checked","change"],["for","multi-check-in","tabindex","1"],[1,"options"],[3,"ngClass","click"],[1,"input"],["type","checkbox","id","companion-allowed","name","allowCompanion",3,"checked","change"],["for","companion-allowed"],["type","checkbox","id","auto-release","name","autoRelease",3,"checked","disabled","change"],["for","auto-release"],["for","check-in-start-at"],[3,"formGroup"],["type","tel","id","check-in-start-at","name","checkInStartAt","formControlName","checkInStartAt",3,"maxlength","max","input"],["class","errors",4,"ngIf"],[1,"button-holder"],["type","button",1,"back",3,"click"],["type","submit",3,"disabled","click"],[1,"errors"],[1,"error"],["class","error",4,"ngFor","ngForOf"]],template:function(o,t){1&o&&(e.\u0275\u0275element(0,"app-header",0),e.\u0275\u0275pipe(1,"translate"),e.\u0275\u0275elementStart(2,"ion-content")(3,"div",1),e.\u0275\u0275element(4,"div",2),e.\u0275\u0275elementStart(5,"ion-row")(6,"ion-col",3)(7,"div",4)(8,"div",5)(9,"input",6),e.\u0275\u0275listener("change",function(s){return t.onMultiCheckinChange(s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"label",7),e.\u0275\u0275text(11),e.\u0275\u0275pipe(12,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(13,"div",8)(14,"div",9),e.\u0275\u0275listener("click",function(){return t.onMultiCheckinChange({target:{checked:!0}})}),e.\u0275\u0275text(15),e.\u0275\u0275pipe(16,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"div",9),e.\u0275\u0275listener("click",function(){return t.onMultiCheckinChange({target:{checked:!1}})}),e.\u0275\u0275text(18),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(20,"div",4)(21,"div",10)(22,"input",11),e.\u0275\u0275listener("change",function(s){return t.onCompanionAllowedChange(s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"label",12),e.\u0275\u0275text(24),e.\u0275\u0275pipe(25,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(26,"div",8)(27,"div",9),e.\u0275\u0275listener("click",function(){return t.onCompanionAllowedChange({target:{checked:!0}})}),e.\u0275\u0275text(28),e.\u0275\u0275pipe(29,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(30,"div",9),e.\u0275\u0275listener("click",function(){return t.onCompanionAllowedChange({target:{checked:!1}})}),e.\u0275\u0275text(31),e.\u0275\u0275pipe(32,"translate"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(33,"div",4)(34,"div",10)(35,"input",13),e.\u0275\u0275listener("change",function(s){return t.onNeedAuthorizationChange(s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(36,"label",14),e.\u0275\u0275text(37),e.\u0275\u0275pipe(38,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(39,"div",8)(40,"div",9),e.\u0275\u0275listener("click",function(){return!t.isLimited2Profile()&&t.onNeedAuthorizationChange({target:{checked:!0}})}),e.\u0275\u0275text(41),e.\u0275\u0275pipe(42,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(43,"div",9),e.\u0275\u0275listener("click",function(){return!t.isLimited2Profile()&&t.onNeedAuthorizationChange({target:{checked:!1}})}),e.\u0275\u0275text(44),e.\u0275\u0275pipe(45,"translate"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(46,"div",4)(47,"div",10)(48,"label",15),e.\u0275\u0275text(49),e.\u0275\u0275pipe(50,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(51,"form",16)(52,"input",17),e.\u0275\u0275listener("input",function(s){return t.onCheckInStartAtChange(s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(53,"br"),e.\u0275\u0275template(54,S,7,4,"div",18),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(55,T,2,1,"div",18),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(56,"div",19)(57,"button",20),e.\u0275\u0275listener("click",function(){return t.goOneStepBack()}),e.\u0275\u0275text(58),e.\u0275\u0275pipe(59,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(60,"button",21),e.\u0275\u0275listener("click",function(){return t.onSubmit()}),e.\u0275\u0275text(61),e.\u0275\u0275pipe(62,"translate"),e.\u0275\u0275elementEnd()()()()()()),2&o&&(e.\u0275\u0275property("title",e.\u0275\u0275pipeBind1(1,36,"PG_CREATE_OPTIONS_STEP_HEADER_TITLE"))("showBadge",!0)("refresh",!1)("menuToggle",!1),e.\u0275\u0275advance(9),e.\u0275\u0275property("checked",t.multiCheckin),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(12,38,"PG_CREATE_OPTIONS_STEP_TEXT_MULTCHECKIN")," "),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass","option yes "+(t.multiCheckin?"active":"")),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(16,40,"PG_CREATE_OPTIONS_STEP_TEXT_MULTCHECKIN_YES")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass","option no "+(t.multiCheckin?"":"active")),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(19,42,"PG_CREATE_OPTIONS_STEP_TEXT_MULTCHECKIN_NO")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("checked",t.allowCompanion),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(25,44,"PG_CREATE_OPTIONS_STEP_TEXT_COMPANION_ALLOWED")," "),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass","option yes "+(t.allowCompanion?"active":"")),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(29,46,"PG_CREATE_OPTIONS_STEP_TEXT_COMPANION_ALLOWED_YES")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass","option no "+(t.allowCompanion?"":"active")),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(32,48,"PG_CREATE_OPTIONS_STEP_TEXT_COMPANION_ALLOWED_NO")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("checked",t.needAuthorization)("disabled",t.isLimited2Profile()),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(38,50,"PG_CREATE_OPTIONS_STEP_TEXT_NEED_AUTHORIZATION")," "),e.\u0275\u0275advance(3),e.\u0275\u0275classProp("disabled",t.isLimited2Profile()),e.\u0275\u0275property("ngClass","option yes "+(t.needAuthorization?"active":"")),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(42,52,"PG_CREATE_OPTIONS_STEP_TEXT_NEED_AUTHORIZATION_YES")," "),e.\u0275\u0275advance(2),e.\u0275\u0275classProp("disabled",t.isLimited2Profile()),e.\u0275\u0275property("ngClass","option no "+(t.needAuthorization?"":"active")),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(45,54,"PG_CREATE_OPTIONS_STEP_TEXT_NEED_AUTHORIZATION_NO")," "),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(50,56,"PG_CREATE_OPTIONS_STEP_TEXT_CHECKIN_STARTAT")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("formGroup",t.form),e.\u0275\u0275advance(1),e.\u0275\u0275property("maxlength",2)("max",t.maxcheckInStartAt),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",null==t.checkInStartAtForm||null==t.checkInStartAtForm.errors?null:t.checkInStartAtForm.errors.max),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.eventTitleFormErrors),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(59,58,"BTN_BACK")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",null==t.checkInStartAtForm||null==t.checkInStartAtForm.errors?null:t.checkInStartAtForm.errors.max),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(62,60,"BTN_NEXT")," "))},dependencies:[h.NgClass,h.NgForOf,h.NgIf,d.\u0275NgNoValidate,d.DefaultValueAccessor,d.NgControlStatus,d.NgControlStatusGroup,d.MaxLengthValidator,p.IonCol,p.IonContent,p.IonRow,d.FormGroupDirective,d.FormControlName,f.G,l.X$],styles:["ion-content[_ngcontent-%COMP%]{--background: #f1f1f1}ion-toolbar[_ngcontent-%COMP%]{font-family:Nunito,sans-serif}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:flex-start;flex-direction:column}.centralized-content[_ngcontent-%COMP%] .errors[_ngcontent-%COMP%]{width:80%;margin:12px 10% 0;color:#f0181b;text-align:center}.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-size:initial!important;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}.centralized-content[_ngcontent-%COMP%] .input-holder[_ngcontent-%COMP%]{margin-top:24px;margin-bottom:24px}.centralized-content[_ngcontent-%COMP%] .input-holder[_ngcontent-%COMP%]:first-of-type{margin-top:0}.centralized-content[_ngcontent-%COMP%] .input-holder[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{display:block}.centralized-content[_ngcontent-%COMP%] .input-holder[_ngcontent-%COMP%] .input[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.centralized-content[_ngcontent-%COMP%] .input-holder[_ngcontent-%COMP%] .options[_ngcontent-%COMP%]{margin-top:4px;display:flex;justify-content:flex-start;align-items:center}.centralized-content[_ngcontent-%COMP%] .input-holder[_ngcontent-%COMP%] .options[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{padding:6px 12px;border-radius:50px;border:1px solid #eee;background-color:#fff;transition:background-color .35s ease,border-color .35s ease}.centralized-content[_ngcontent-%COMP%] .input-holder[_ngcontent-%COMP%] .options[_ngcontent-%COMP%] .option.yes[_ngcontent-%COMP%]{margin-right:8px}.centralized-content[_ngcontent-%COMP%] .input-holder[_ngcontent-%COMP%] .options[_ngcontent-%COMP%] .option.active[_ngcontent-%COMP%]{color:#fff;background-color:#0ec254;border-color:#0ec254;transition:background-color .35s ease,border-color .35s ease}.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)}}.disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none;cursor:not-allowed}input[disabled][_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed}.option.disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none;cursor:not-allowed}"]}),n})();var A=i(69270);const k=[{path:"",component:I}];let M=(()=>{class n{}return n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=e.\u0275\u0275defineNgModule({type:n}),n.\u0275inj=e.\u0275\u0275defineInjector({imports:[h.CommonModule,d.FormsModule,A.I,E.RouterModule.forChild(k)]}),n})()},37763:(O,m,i)=>{i.d(m,{i:()=>C});var h=i(61380),E=i(92198),e=i(45449);let C=(()=>{class p{constructor(l){this.router=l}focusInRouterNavigate(){this.router.events.pipe((0,E.h)(l=>l instanceof h.NavigationEnd)).subscribe(()=>{const l=document.querySelector("#focusHeader");l&&l?.focus()})}applyFocusQuerySelector(l,S){setTimeout(()=>{document.querySelector(`#${l}`)?.focus()},S)}}return p.\u0275fac=function(l){return new(l||p)(e.\u0275\u0275inject(h.Router))},p.\u0275prov=e.\u0275\u0275defineInjectable({token:p,factory:p.\u0275fac,providedIn:"root"}),p})()}}]); |