Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/calendar/entry/dist/ |
Upload File : |
this.BX=this.BX||{};(function(t,e,i,a,s,n,r,o,l){"use strict";let d=t=>t,c;class h{static getNewEntry(t){const a={};const s=h.getNewEntryTime(new Date);const n=i.Util.getUserSettings();const o=i.Util.getCurrentUserId();a.ID=null;a.NAME=h.getNewEntryName();a.dateFrom=s.from;a.dateTo=s.to;if(t.type==="location"){a.SECT_ID=r.RoomsManager.getNewEntrySectionId(t.type,parseInt(t.ownerId))}else{a.SECT_ID=e.SectionManager.getNewEntrySectionId(t.type,parseInt(t.ownerId))}a.REMIND=h.getNewEntryReminders();a.attendeesEntityList=[{entityId:"user",id:o}];a.ATTENDEE_LIST=[{id:i.Util.getCurrentUserId(),status:"H"}];if(t.type==="user"&&o!==t.ownerId){a.attendeesEntityList.push({entityId:"user",id:t.ownerId});a.ATTENDEE_LIST=[{id:t.ownerId,status:"H"},{id:i.Util.getCurrentUserId(),status:"Y"}]}else if(t.type==="group"){a.attendeesEntityList.push({entityId:"project",id:t.ownerId})}a.TZ_FROM=n.timezoneName||n.timezoneDefaultName||"";a.TZ_TO=n.timezoneName||n.timezoneDefaultName||"";return new E({data:a})}static getNewEntryTime(t,e){t=i.Util.getUsableDateTime(t);const a=i.Util.getCalendarContext();if(a){const e=a.getDisplayedViewRange();if(l.Type.isDate(e==null?void 0:e.start)){const s=t.getTime();if(s<e.start.getTime()||s>e.end.getTime()){const s=new Date(e.start.getTime());const n=a.util.getWorkTime();s.setHours(n.start,0,0,0);t=i.Util.getUsableDateTime(s)}}}return{from:t,to:new Date(t.getTime()+(e||3600)*1e3)}}static getNewEntryName(){return h.newEntryName||""}static setNewEntryName(t){h.newEntryName=t}static showEditEntryNotification(t){i.Util.showNotification(l.Loc.getMessage("CALENDAR_SAVE_EVENT_NOTIFICATION"),[{title:l.Loc.getMessage("CALENDAR_EVENT_DO_VIEW"),events:{click:function(e,i,a){h.openViewSlider(t);i.close()}}}])}static showNewEntryNotification(t){i.Util.showNotification(l.Loc.getMessage("CALENDAR_NEW_EVENT_NOTIFICATION"),[{title:l.Loc.getMessage("CALENDAR_EVENT_DO_VIEW"),events:{click:(e,i,a)=>{h.openViewSlider(t);i.close()}}}])}static showDeleteEntryNotification(t){if(t&&t instanceof E){BX.UI.Notification.Center.notify({id:"calendar"+t.getUniqueId(),content:l.Loc.getMessage("CALENDAR_DELETE_EVENT_NOTIFICATION"),actions:[{title:l.Loc.getMessage("CALENDAR_EVENT_DO_CANCEL"),events:{click:(e,i,a)=>{t.cancelDelete();i.close()}}}]})}}static showReleaseLocationNotification(){BX.UI.Notification.Center.notify({content:l.Loc.getMessage("CALENDAR_RELEASE_LOCATION_NOTIFICATION")})}static closeDeleteNotificationBalloon(t){if(t&&t instanceof E){const e=BX.UI.Notification.Center.getBalloonById("calendar"+t.getUniqueId());if(e){e.close()}}}static openEditSlider(t={}){const e=i.Util.getBX();if(e.Calendar&&e.Calendar.SliderLoader){const i=BX.Calendar.Util||e.Calendar.Util;const a=i.getCalendarContext();const s=t!=null&&t.isLocationCalendar?a.roomsManager:null;const n=t!=null&&t.isLocationCalendar?a.categoryManager:null;new e.Calendar.SliderLoader(t.entry?`EDIT${t.entry.id}`:"NEW",{calendarContext:t.calendarContext||a,entry:t.entry||null,type:t.type,isLocationCalendar:t.isLocationCalendar||false,roomsManager:s,categoryManager:n,locationAccess:t.locationAccess||i.hasLocationAccess(),locationCapacity:t.locationCapacity||0,ownerId:t.ownerId||0,userId:t.userId,formDataValue:t.formDataValue||null,jumpToControl:t.jumpToControl}).show()}}static openViewSlider(t=null,e={}){if(!l.Type.isNull(t)){const a=i.Util.getBX();if(a.Calendar&&a.Calendar.SliderLoader){new a.Calendar.SliderLoader(t,{entryDateFrom:e.from,timezoneOffset:e.timezoneOffset,calendarContext:e.calendarContext||null,link:e.link}).show()}}}static openSettingsSlider(){const t=i.Util.getBX();const e=BX.Calendar.Util||t.Calendar.Util;h.getSettingsSlider().then((t=>{new t({calendarContext:e.getCalendarContext(),showPersonalSettings:e.userIsOwner(),showGeneralSettings:e.hasFullAccess(),settings:e.getSettings(),isExtranet:e.isExtranet()}).show()}))}static getSettingsSlider(){return new Promise((t=>{const e=i.Util.getBX();if(e.Calendar.SettingsInterface){t(e.Calendar.SettingsInterface)}else{const i="calendar.settingsinterface";e.Runtime.loadExtension(i).then((()=>{if(e.Calendar.SettingsInterface){t(e.Calendar.SettingsInterface)}else{console.error(`Extension ${i} not found`)}}))}}))}static openSectionsSlider(){const t=i.Util.getBX();const e=BX.Calendar.Util||t.Calendar.Util;const a=e.getCalendarContext();h.getSectionsSlider().then((t=>{new t({calendarContext:a,readonly:e.isReadOnlyMode(),sectionManager:a.sectionManager,isCollabFeatureEnabled:e.isCollabFeatureEnabled()}).show()}))}static getSectionsSlider(){return new Promise((t=>{const e=i.Util.getBX();if(e.Calendar.SectionInterface){t(e.Calendar.SectionInterface)}else{const i="calendar.sectioninterface";e.Runtime.loadExtension(i).then((()=>{if(e.Calendar.SectionInterface){t(e.Calendar.SectionInterface)}else{console.error(`Extension ${i} not found`)}}))}}))}static openRoomsSlider(){const t=i.Util.getBX();const e=BX.Calendar.Util||t.Calendar.Util;const a=t.Calendar.Util.getCalendarContext();h.getRoomsSlider().then((t=>{new t({calendarContext:a,readonly:e.isReadOnlyMode(),roomsManager:a.roomsManager,categoryManager:a.categoryManager}).show()}))}static getRoomsSlider(){return new Promise((t=>{const e=i.Util.getBX();if(e.Calendar.Rooms.RoomsInterface){t(e.Calendar.Rooms.RoomsInterface)}else{const i="calendar.rooms";e.Runtime.loadExtension(i).then((()=>{if(e.Calendar.Rooms.RoomsInterface){t(e.Calendar.Rooms.RoomsInterface)}else{console.error(`Extension ${i} not found`)}}))}}))}static deleteEntry(t,e=null){if(t instanceof E){const s=i.Util.getBX().SidePanel.Instance.getTopSlider();const n=()=>{if(s&&s.getData().get("type")==="calendar:slider"){i.Util.getBX().SidePanel.Instance.close()}};a.EventEmitter.subscribe("BX.Calendar.Entry:beforeDelete",n);const r=()=>{const t=i.Util.getCalendarContext();if(t){t.reload()}else if(e){e.reload()}a.EventEmitter.unsubscribe("BX.Calendar.Entry:delete",r);a.EventEmitter.unsubscribe("BX.Calendar.Entry:beforeDelete",n)};a.EventEmitter.subscribe("BX.Calendar.Entry:delete",r);t.delete()}}static setMeetingStatus(t,e,a={}){return new Promise((s=>{if(!l.Type.isPlainObject(a)){a={}}a.recursionMode=a.recursionMode||false;if(e==="N"&&!a.confirmed){if(t.isRecursive()&&!t.isOpenEvent()){this.showConfirmStatusDialog(t,s);return false}}BX.ajax.runAction("calendar.api.calendarajax.setMeetingStatus",{data:{entryId:t.id,entryParentId:t.parentId,status:e,recursionMode:a.recursionMode,currentDateFrom:i.Util.formatDate(t.from)}}).then((i=>{BX.Event.EventEmitter.emit("BX.Calendar.Entry:onChangeMeetingStatus",new l.Event.BaseEvent({data:{entry:t,status:e,recursionMode:a.recursionMode,currentDateFrom:t.from,counters:i.data.counters}}));if(t instanceof E){t.setCurrentStatus(e)}s({entry:t,status:e,recursionMode:a.recursionMode,currentDateFrom:t.from})}))}))}static showConfirmStatusDialog(t,e=null){if(!this.confirmDeclineDialog){this.confirmDeclineDialog=this.createConfirmStatusDialog()}this.confirmDeclineDialog.show();this.confirmDeclineDialog.unsubscribeAll("onDecline");this.confirmDeclineDialog.subscribe("onDecline",(function(i){if(i&&l.Type.isFunction(i.getData)){h.setMeetingStatus(t,"N",{recursionMode:i.getData().recursionMode,confirmed:true}).then((()=>{if(l.Type.isFunction(e)){e()}}))}}))}static showConfirmEditDialog(t){if(!this.confirmEditDialog){this.confirmEditDialog=this.createConfirmEditDialog()}this.confirmEditDialog.show(t);if(l.Type.isFunction(t.callback)){this.confirmEditDialog.unsubscribeAll("onEdit");this.confirmEditDialog.subscribe("onEdit",(e=>{if(e&&l.Type.isFunction(e.getData)){t.callback(e.getData())}}))}}static showReInviteUsersDialog(t){if(!this.reinviteUsersDialog){this.reinviteUsersDialog=this.createReinviteUserDialog()}this.reinviteUsersDialog.show();if(l.Type.isFunction(t.callback)){this.reinviteUsersDialog.unsubscribeAll("onSelect");this.reinviteUsersDialog.subscribe("onSelect",(function(e){if(e&&l.Type.isFunction(e.getData)){t.callback(e.getData())}}))}}static showConfirmedEmailDialog(t={}){if(!this.confirmedEmailDialog){this.confirmedEmailDialog=this.createConfirmedEmailDialog()}this.confirmedEmailDialog.show();if(l.Type.isFunction(t.callback)){this.confirmedEmailDialog.unsubscribeAll("onSelect");this.confirmedEmailDialog.subscribe("onSelect",(function(e){if(e&&l.Type.isFunction(e.getData)){t.callback(e.getData())}}))}}static getLocationRepeatBusyErrorPopup(t={}){return new o.MessageBox({title:l.Loc.getMessage("EC_LOCATION_REPEAT_BUSY_POPUP_TITLE"),message:l.Tag.render(c||(c=d` <div class="calendar-list-slider-messagebox-text-with-title"> ${0} </div> `),t.message),minHeight:100,minWidth:300,maxWidth:690,buttons:BX.UI.Dialogs.MessageBoxButtons.YES_CANCEL,onYes:t.onYesCallback,onCancel:t.onCancelCallback,yesCaption:l.Loc.getMessage("EC_LOCATION_REPEAT_BUSY_POPUP_SAVE_WITHOUT_ROOM"),cancelCaption:l.Loc.getMessage("EC_LOCATION_REPEAT_BUSY_POPUP_RETURN_TO_EDIT"),mediumButtonSize:false,popupOptions:{events:{onPopupClose:t.onPopupCloseCallback},closeByEsc:true,padding:0,contentPadding:0,animation:"fading-slide"}})}static showEmailLimitationDialog(t={}){if(!this.limitationEmailDialog){this.limitationEmailDialog=this.createEmailLimitationDialog()}this.limitationEmailDialog.subscribe("onSaveWithoutAttendees",(()=>{if(l.Type.isFunction(t.callback)){t.callback()}}));this.limitationEmailDialog.show()}static getCompactViewForm(t=true){if(!h.compactEntryForm&&t){h.compactEntryForm=new s.CompactEventForm}return h.compactEntryForm}static openCompactViewForm(t={}){const e=h.getCompactViewForm();if(!e.isShown()){e.unsubscribeAll("onClose");if(l.Type.isFunction(t.closeCallback)){e.subscribe("onClose",t.closeCallback)}e.showInViewMode(t)}}static openCompactEditForm(t={}){const e=h.getCompactViewForm();if(!e.isShown()){e.unsubscribeAll("onClose");if(l.Type.isFunction(t.closeCallback)){e.subscribe("onClose",t.closeCallback)}e.showInEditMode(t)}}static getEntryInstance(t,e,i={}){let a=null;if(t instanceof E){a=t}else{if(l.Type.isObject(t)&&l.Type.isObject(t.data)){a=new E({data:t.data,userIndex:e})}else if(l.Type.isObject(t)){a=new E({data:t,userIndex:e})}else{a=h.getNewEntry(i)}}return a}static getUserIndex(t={}){return h.userIndex}static setUserIndex(t){h.userIndex=t}handlePullChanges(t){var e;if(["edit_event_location","delete_event_location"].includes(t.command)){var a,s,n;(a=top.BX.Calendar)==null?void 0:(s=a.Controls)==null?void 0:(n=s.Location)==null?void 0:n.handlePull(t);return}if(!BX.Calendar.Util.checkRequestId(t.requestUid)){return}const r=h.getCompactViewForm();if(r&&r.isShown()){r.handlePull(t)}BX.SidePanel.Instance.getOpenSliders().forEach((e=>{var i;const a=h.slidersMap.get(e);if(a&&a.entry&&a.entry.parentId===parseInt(t==null?void 0:(i=t.fields)==null?void 0:i.PARENT_ID)){var s;if(t.command==="delete_event"&&a.entry.getType()===(t==null?void 0:(s=t.fields)==null?void 0:s.CAL_TYPE)){e.close()}}}));if(t.command==="set_meeting_status"){top.BX.Event.EventEmitter.emit("BX.Calendar:doReloadCounters")}if(t.command==="delete_event"||t.command==="edit_event"){var o,d;if(!t.fields||t!=null&&(o=t.fields)!=null&&o.IS_MEETING&&(t==null?void 0:(d=t.fields)==null?void 0:d.MEETING_STATUS)==="Q"){top.BX.Event.EventEmitter.emit("BX.Calendar:doReloadCounters")}}const c=i.Util.getCalendarContext();const E=parseInt(t==null?void 0:(e=t.fields)==null?void 0:e.SECTION_ID);let u=l.Type.isArray(t.sections)&&t.sections.find((t=>t.id===E&&t.isShown()));let T=t!=null&&t.fields?h.getEntryInstance(c.getView().getEntryById(h.getEntryUniqueId(t.fields))):null;if((u||T)&&c){c.reloadDebounce()}}static registerDeleteTimeout(t){h.delayedActionList.push(t)}static unregisterDeleteTimeout({action:t,data:e}){h.delayedActionList=h.delayedActionList.filter((i=>i.action!==t||i.data.entryId!==e.entryId||i.data.recursionMode!==e.recursionMode||i.data.excludeDate!==e.excludeDate))}static doDelayedActions(){let t=[];return new Promise((e=>{if(!h.delayedActionList.length){e()}h.delayedActionList.forEach((({action:i,data:a,params:s})=>{const n=parseInt(a.requestUid);t.push(a.requestUid);if(s.entry){h.closeDeleteNotificationBalloon(s.entry)}BX.ajax.runAction(`calendar.api.calendarajax.${i}`,{data:a}).then((()=>{l.Type.isFunction(s.callback);{s.callback()}t=t.filter((t=>t!==n));if(!t.length){e()}}),(()=>{t=t.filter((t=>t!==n));if(!t.length){e()}}));h.unregisterDeleteTimeout({action:i,data:a,params:s})}))}))}static getEntryUniqueId(t,e){let a=t.PARENT_ID||t.ID;if(t.RRULE){a+="|"+(e?i.Util.formatDate(e.from):i.Util.formatDate(BX.parseDate(t.DATE_FROM)))}if(t["~TYPE"]==="tasks"){a+="|"+"task"}return a}static registerEntrySlider(t,e){const a=i.Util.getBX().SidePanel.Instance.getTopSlider();if(a){h.slidersMap.set(a,{entry:t,control:e})}}static getNewEntryReminders(t="withTime"){const e=i.Util.getUserSettings();if(l.Type.isObjectLike(e.defaultReminders)&&l.Type.isArray(e.defaultReminders[t])&&e.defaultReminders[t].length){return e.defaultReminders[t]}return t==="withTime"?[{type:"min",count:15}]:[{type:"daybefore",before:0,time:480}]}static setNewEntryReminders(t="withTime",e){const a=i.Util.getUserSettings();if(l.Type.isObjectLike(a.defaultReminders)){a.defaultReminders[t]=e}i.Util.setUserSettings(a)}static createConfirmEditDialog(){const t=i.Util.getBX();return new t.Calendar.Controls.ConfirmEditDialog}static createConfirmStatusDialog(){const t=i.Util.getBX();return new t.Calendar.Controls.ConfirmStatusDialog}static createReinviteUserDialog(){const t=i.Util.getBX();return new t.Calendar.Controls.ReinviteUserDialog}static createConfirmedEmailDialog(){const t=i.Util.getBX();return new t.Calendar.Controls.ConfirmedEmailDialog}static createEmailLimitationDialog(){const t=i.Util.getBX();return new t.Calendar.Controls.EmailLimitationDialog}static async downloadIcs(t){const{status:e,data:a}=await i.Util.getBX().ajax.runAction("calendar.api.calendarentryajax.getIcsContent",{data:{eventId:t}});if(e!=="success"){return}i.Util.downloadIcsFile(a,"event")}}h.newEntryName="";h.userIndex={};h.delayedActionList=[];h.DELETE_DELAY_TIMEOUT=4e3;h.slidersMap=new WeakMap;class E{constructor(t={}){this.FULL_DAY_LENGTH=86400;this.prepareData(t.data);this.parts=[];if(t.userIndex){this.setUserIndex(t.userIndex)}this.delayTimeoutMap=new Map}prepareData(t){this.data=t;this.id=parseInt(this.data.ID||0);this.parentId=parseInt(this.data.PARENT_ID||0);if(!this.data.DT_SKIP_TIME){this.data.DT_SKIP_TIME=this.data.SKIP_TIME?"Y":"N"}if(!l.Type.isString(this.data.NAME)){this.data.NAME=l.Loc.getMessage("CALENDAR_DEFAULT_ENTRY_NAME")}else{this.data.NAME=this.data.NAME.replaceAll(/\r\n|\r|\n/g," ")}this.fullDay=this.data.DT_SKIP_TIME==="Y";this.accessibility=this.data.ACCESSIBILITY||"busy";this.important=this.data.IMPORTANCE==="high";this.private=!!this.data.PRIVATE_EVENT;this.setSectionId(this.data.SECT_ID);this.name=this.data.NAME;this.userTimezoneOffsetFrom=parseInt(this.data["~USER_OFFSET_FROM"])||0;this.userTimezoneOffsetTo=parseInt(this.data["~USER_OFFSET_TO"])||this.userTimezoneOffsetFrom;if(!this.data.DT_LENGTH){this.data.DT_LENGTH=this.data.DURATION||0}if(this.fullDay&&!this.data.DT_LENGTH){this.data.DT_LENGTH=this.FULL_DAY_LENGTH}if(!l.Type.isString(this.data.DATE_FROM)&&!l.Type.isString(this.data.DATE_TO)&&l.Type.isDate(this.data.dateFrom)&&l.Type.isDate(this.data.dateTo)){this.from=this.data.dateFrom;this.to=this.data.dateTo;this.data.DT_LENGTH=Math.round((this.to.getTime()-this.from.getTime())/1e3);this.data.DURATION=this.data.DT_LENGTH;if(this.fullDay){this.data.DATE_FROM=i.Util.formatDate(this.from.getTime());this.data.DATE_TO=i.Util.formatDate(this.to.getTime())}else{this.from=new Date(this.from.getTime()-(parseInt(this.data["~USER_OFFSET_FROM"])||0)*1e3);this.to=new Date(this.to.getTime()-(parseInt(this.data["~USER_OFFSET_TO"])||0)*1e3)}}else{if(this.isTask()){this.from=BX.parseDate(this.data.DATE_FROM)||new Date;this.to=BX.parseDate(this.data.DATE_TO)||this.from}else{this.from=BX.parseDate(this.data.DATE_FROM)||new Date;this.to=BX.parseDate(this.data.DATE_TO)||this.from}}if(this.fullDay){this.from.setHours(0,0,0,0);this.to.setHours(0,0,0,0)}if(!this.data.ATTENDEES_CODES&&!this.isTask()){if(this.data.CAL_TYPE==="user"&&this.data.OWNER_ID){this.data.ATTENDEES_CODES=["U"+this.data.OWNER_ID]}else if(this.data.CREATED_BY){this.data.ATTENDEES_CODES=["U"+this.data.CREATED_BY]}}this.startDayCode=this.from;this.endDayCode=this.to;if(!l.Type.isArray(this.data.REMIND)&&l.Type.isArray(this.data.remind)){this.data.REMIND=[];this.data.remind.forEach((function(t){this.data.REMIND.push({type:"min",count:t})}),this);delete this.data.remind}if(this.data.permissions){this.permissions=this.data.permissions}}getAttendeesCodes(){return this.data.ATTENDEES_CODES||[]}getAttendeesEntityList(){return this.data.attendeesEntityList||[]}getAttendees(){if(!this.attendeeList){this.attendeeList=[];if(l.Type.isArray(this.data["ATTENDEE_LIST"])){const t=this.getUserIndex();this.data["ATTENDEE_LIST"].forEach((e=>{if(t[e.id]){let i=BX.clone(t[e.id]);i.STATUS=e.status;i.ENTRY_ID=e.entryId||false;this.attendeeList.push(i)}}))}}return this.attendeeList}setUserIndex(t){this.userIndex=t}getUserIndex(){return this.userIndex||h.getUserIndex()}cleanParts(){this.parts=[]}startPart(t){t.partIndex=this.parts.length;this.parts.push(t);return this.parts[t.partIndex]}registerPartNode(t,e){t.params=e}checkPartIsRegistered(t){return l.Type.isPlainObject(t.params)}getPart(t){return this.parts[t]||false}getWrap(t){return this.parts[t||0].params.wrapNode}getSectionName(){}getDescription(){return this.data.DESCRIPTION||""}applyViewRange(t){let e=t.start.getTime(),i=t.end.getTime(),a=this.from.getTime(),s=this.to.getTime();if(s<e||a>i)return false;if(a<e){this.displayFrom=t.start;this.startDayCode=this.displayFrom}if(s>i){this.displayTo=t.end;this.endDayCode=this.displayTo}return true}isPersonal(){}isMeeting(){return!!this.data.IS_MEETING}isPrivate(){return this.private}isResourcebooking(){return this.data.EVENT_TYPE==="#resourcebooking#"}isTask(){return this.data["~TYPE"]==="tasks"}isSharingEvent(){return this.data["EVENT_TYPE"]==="#shared#"||this.data["EVENT_TYPE"]==="#shared_crm#"}isInvited(){return this.getCurrentStatus()==="Q"}isLocation(){return this.getType()==="location"}isFullDay(){return this.fullDay}isLongWithTime(){return!this.fullDay&&i.Util.getDayCode(this.from)!==i.Util.getDayCode(this.to)}isExpired(){return this.to.getTime()<(new Date).getTime()}hasEmailAttendees(){if(this.emailAttendeesCache===undefined){const t=h.getUserIndex();for(let e=0;e<this.data["ATTENDEE_LIST"].length;e++){let i=this.data["ATTENDEE_LIST"][e];if((i.status==="Y"||i.status==="Q")&&t[i.id]&&t[i.id].EMAIL_USER){this.emailAttendeesCache=true;break}}}return this.emailAttendeesCache}ownerIsEmailUser(){if(this.ownerIsEmailUserCache===undefined){const t=h.getUserIndex();this.ownerIsEmailUserCache=t[parseInt(this.data.MEETING_HOST)]&&t[parseInt(this.data.MEETING_HOST)].EMAIL_USER}return this.ownerIsEmailUserCache}isSelected(){return!!this.selected}isCrm(){return!!this.data.UF_CRM_CAL_EVENT}isFirstReccurentEntry(){return(this.data.DATE_FROM_TS_UTC===Math.floor(BX.parseDate(this.data["~DATE_FROM"]).getTime()/1e3)*1e3||BX.parseDate(this.data["DATE_FROM"]).getTime()===BX.parseDate(this.data["~DATE_FROM"]).getTime())&&!this.data.RECURRENCE_ID}isRecursive(){return!!this.data.RRULE}isFirstInstance(){return this.data.RRULE&&this.data.RINDEX===0}getMeetingHost(){return parseInt(this.data.MEETING_HOST)}getMeetingNotify(){return this.data.MEETING.NOTIFY}getHideGuests(){return this.data.MEETING&&BX.Type.isBoolean(this.data.MEETING.HIDE_GUESTS)?this.data.MEETING.HIDE_GUESTS:true}getRrule(){return this.data.RRULE}getRRuleDescription(){return this.data["~RRULE_DESCRIPTION"]}hasRecurrenceId(){return this.data.RECURRENCE_ID}wasEverRecursive(){return this.data.RRULE||this.data.RECURRENCE_ID}deselect(){this.selected=false}select(){this.selected=true}deleteParts(t){const e=i.Util.getCalendarContext();if(e){const i=e.getView().getContainer();if(t==="all"){e.getView().entries.forEach((t=>{const e=parseInt(t.data.RECURRENCE_ID);if(parseInt(t.id)===this.id||e>0&&e===this.id||e>0&&e===parseInt(this.data.RECURRENCE_ID)||e>0&&parseInt(t.id)===parseInt(this.data.RECURRENCE_ID)){const e=i.querySelector('div[data-bx-calendar-entry="'+t.uid+'"]');if(e){e.style.opacity=0;setTimeout((()=>{e.style.display="none"}),200)}}}))}else if(t==="next"){e.getView().entries.forEach((t=>{if((parseInt(t.id)===this.id||parseInt(t.data.RECURRENCE_ID)===this.id||parseInt(t.data.RECURRENCE_ID)===parseInt(this.data.RECURRENCE_ID)||parseInt(t.id)===parseInt(this.data.RECURRENCE_ID))&&t.from.getTime()>this.from.getTime()){const e=i.querySelector('div[data-bx-calendar-entry="'+t.uid+'"]');if(e){e.style.opacity=0;setTimeout((()=>{e.style.display="none"}),200)}}}))}else if(t==="this"||!t){const t=i.querySelectorAll('div[data-bx-calendar-entry="'+this.getUniqueId()+'"]');t.forEach((t=>{t.style.opacity=0;setTimeout((()=>{t.style.display="none"}),200)}))}}}getUniqueId(){return h.getEntryUniqueId(this.data,this)}getCurrentStatus(){let t=i.Util.getCurrentUserId(),e=false,a,s;if(this.isMeeting()){if(t===parseInt(this.data.CREATED_BY)){e=this.data.MEETING_STATUS||"Q"}else if(t===parseInt(this.data.MEETING_HOST)){e="H"}else if(l.Type.isArray(this.data["ATTENDEE_LIST"])){for(a=0;a<this.data["ATTENDEE_LIST"].length;a++){s=this.data["ATTENDEE_LIST"][a];if(parseInt(s.id)===t){e=s.status;break}}}}else if(t===parseInt(this.data.CREATED_BY)){e=this.data.MEETING_STATUS||"H"}return i.Util.getMeetingStatusList().includes(e)?e:false}setCurrentStatus(t){if(this.isMeeting()&&i.Util.getMeetingStatusList().includes(t)){this.data.MEETING_STATUS=t;const e=i.Util.getCurrentUserId();if(l.Type.isArray(this.data["ATTENDEE_LIST"])){for(let i=0;i<this.data["ATTENDEE_LIST"].length;i++){if(parseInt(this.data["ATTENDEE_LIST"][i].id)===e){this.data["ATTENDEE_LIST"][i].status=t;this.attendeeList=null;break}}}}}getReminders(){let t=[];if(this.data&&this.data.REMIND){this.data.REMIND.forEach((function(e){switch(e.type){case"min":t.push(e.count);break;case"hour":t.push(parseInt(e.count)*60);break;case"day":t.push(parseInt(e.count)*60*24);break;case"daybefore":t.push(e);break;case"date":if(!l.Type.isDate(e.value)){e.value=i.Util.parseDate(e.value)}if(l.Type.isDate(e.value)){t.push(e)}break}}))}return t}getLengthInDays(){let t=new Date(this.from.getFullYear(),this.from.getMonth(),this.from.getDate(),0,0,0),e=new Date(this.to.getFullYear(),this.to.getMonth(),this.to.getDate(),0,0,0);return Math.round((e.getTime()-t.getTime())/i.Util.getDayLength())+1}getName(){return this.name||""}getColor(){return this.data.COLOR}getType(){return this.data.CAL_TYPE}getOwnerId(){return this.data.OWNER_ID}delete(t){t=l.Type.isPlainObject(t)?t:{};let e=t.recursionMode||false;if(this.wasEverRecursive()&&!t.confirmed){return this.showConfirmDeleteDialog({entry:this})}else{BX.onCustomEvent("BX.Calendar.Entry:beforeDelete",[{entryId:this.id,recursionMode:e,entryData:this.data}]);h.showDeleteEntryNotification(this);this.deleteParts(e);const a="deleteCalendarEntry";const s={entryId:this.parentId,recursionMode:t.recursionMode||false,requestUid:i.Util.registerRequestId()};h.registerDeleteTimeout({action:a,data:s,params:{entry:this,callback:()=>{BX.onCustomEvent("BX.Calendar.Entry:delete",[{entryId:this.id,recursionMode:e}])}}});this.deleteTimeout=setTimeout(h.doDelayedActions,h.DELETE_DELAY_TIMEOUT);this.delayTimeoutMap.set(this.deleteTimeout,{action:a,data:s})}}deleteThis(){let t="this";if(this.isRecursive()){BX.onCustomEvent("BX.Calendar.Entry:beforeDelete",[{entryId:this.id,recursionMode:t,entryData:this.data}]);h.showDeleteEntryNotification(this);this.deleteParts(t);const e="excludeRecursionDate";const i={entryId:this.parentId,recursionMode:t,excludeDate:this.data.DATE_FROM};h.registerDeleteTimeout({action:e,data:i,params:{entry:this,callback:()=>{BX.onCustomEvent("BX.Calendar.Entry:delete",[i])}}});this.deleteTimeout=setTimeout(h.doDelayedActions,h.DELETE_DELAY_TIMEOUT);this.delayTimeoutMap.set(this.deleteTimeout,{action:e,data:i})}else if(this.hasRecurrenceId()){this.delete({confirmed:true,recursionMode:"this"})}}deleteNext(){let t="next";if(this.isRecursive()&&this.isFirstReccurentEntry()){this.deleteAll()}else{BX.onCustomEvent("BX.Calendar.Entry:beforeDelete",[{entryId:this.id,recursionMode:t}]);h.showDeleteEntryNotification(this);this.deleteParts(t);const e="changeRecurciveEntryUntil";const a={entryId:this.parentId,recursionMode:t,untilDate:i.Util.formatDate(this.from.getTime()-i.Util.getDayLength())};h.registerDeleteTimeout({action:e,data:a,params:{entry:this,callback:()=>{BX.onCustomEvent("BX.Calendar.Entry:delete",[a])}}});this.deleteTimeout=setTimeout(h.doDelayedActions,h.DELETE_DELAY_TIMEOUT);this.delayTimeoutMap.set(this.deleteTimeout,{action:e,data:a})}}deleteAll(){return this.delete({confirmed:true,recursionMode:"all"})}cancelDelete(){if(this.deleteTimeout){const t=this.delayTimeoutMap.get(this.deleteTimeout);if(t){h.unregisterDeleteTimeout(t);BX.onCustomEvent("BX.Calendar.Entry:cancelDelete",[{entryId:this.id,entryData:this.data}]);this.delayTimeoutMap.delete(this.delayTimeoutMap)}clearTimeout(this.deleteTimeout);this.deleteTimeout=null}const t=i.Util.getCalendarContext();if(t){t.reload()}}showConfirmDeleteDialog(t){if(!this.confirmDeleteDialog){this.confirmDeleteDialog=new(window.BX||window.top.BX).Calendar.Controls.ConfirmDeleteDialog({entry:t.entry})}this.confirmDeleteDialog.show()}save(){}getLocation(){return this.data.LOCATION}setTimezone(t,e=null){if(l.Type.isString(t)){this.data.TZ_FROM=t;if(l.Type.isNull(e)){this.data.TZ_TO=t}}if(l.Type.isString(e)){this.data.TZ_TO=e}}getTimezoneFrom(){return this.data.TZ_FROM||""}getTimezoneTo(){return this.data.TZ_TO||""}setSectionId(t){this.data.SECT_ID=this.sectionId=this.isTask()?"tasks":parseInt(t)}setDateTimeValue({from:t,to:e}){if(l.Type.isDate(t)&&l.Type.isDate(e)){this.from=this.data.dateFrom=t;this.to=this.data.dateTo=e;this.data.DT_LENGTH=Math.round((this.to.getTime()-this.from.getTime())/1e3);this.data.DURATION=this.data.DT_LENGTH;if(this.fullDay){this.data.DATE_FROM=i.Util.formatDate(this.from.getTime());this.data.DATE_TO=i.Util.formatDate(this.to.getTime())}else{this.data.DATE_FROM=i.Util.formatDateTime(this.from.getTime());this.data.DATE_TO=i.Util.formatDateTime(this.to.getTime())}}}isOpenEvent(){return this.getType()==="open_event"}}E.CAL_TYPES={user:"user",group:"group",company:"company_calendar"};t.EntryManager=h;t.Entry=E})(this.BX.Calendar=this.BX.Calendar||{},BX.Calendar,BX.Calendar,BX.Event,BX.Calendar,BX,BX.Calendar,BX.UI.Dialogs,BX); //# sourceMappingURL=entry.bundle.map.js