MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / ae

Function ae

codebase/dhtmlxscheduler.js:37–37  ·  view source on GitHub ↗
(e,i)

Source from the content-addressed store, hash-verified

35 </div>`;y.innerHTML=m;var x=y.cloneNode(!0).firstChild;if(!f&&r.renderEvent(x,d,p,v,c,u))return d.color&&x.style.setProperty("--dhx-scheduler-event-background",d.color),d.textColor&&x.style.setProperty("--dhx-scheduler-event-color",d.textColor),x;x=y.firstChild,d.color&&x.style.setProperty("--dhx-scheduler-event-background",d.color),d.textColor&&x.style.setProperty("--dhx-scheduler-event-color",d.textColor);var b='<div class="dhx_event_move dhx_header" >&nbsp;</div>';b+='<div class="dhx_event_move dhx_title">'+c+"</div>",b+='<div class="dhx_body">'+u+"</div>";var E="dhx_event_resize dhx_footer";return(f||d._drag_resize===!1)&&(E="dhx_resize_denied "+E),b+='<div class="'+E+'" style=" width:'+(f?" margin-top:-1px;":"")+'" ></div>',x.innerHTML=b,x},r.renderEvent=function(){return!1},r.locate_holder=function(d){return this._mode=="day"?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[d]},r.locate_holder_day=function(d,l){var h=Math.floor((this._correct_shift(d,1)-this._min_date)/864e5);return l&&this.date.time_part(d)&&h++,h},r._get_dnd_order=function(d,l,h){if(!this._drag_event)return d;this._drag_event._orig_sorder?d=this._drag_event._orig_sorder:this._drag_event._orig_sorder=d;for(var p=l*d;p+l>h;)d--,p-=l;return Math.max(d,0)},r._get_event_bar_pos=function(d){var l=this.config.rtl,h=this._colsS,p=h[d._sday],v=h[d._eday];l&&(p=h[h.col_length]-h[d._eday]+h[0],v=h[h.col_length]-h[d._sday]+h[0]),v==p&&(v=h[d._eday+1]);var g=this.xy.bar_height,c=d._sorder;if(d.id==this._drag_id){var u=h.heights[d._sweek+1]-h.heights[d._sweek]-this.xy.month_head_height;c=r._get_dnd_order(c,g,u)}var f=c*g;return{x:p,x2:v,y:h.heights[d._sweek]+(h.height?this.xy.month_scale_height+2:2)+f}},r.render_event_bar=function(d){var l=this._rendered_location,h=this._get_event_bar_pos(d),p=h.y,v=h.x,g=h.x2,c="";if(g){var u=r.config.resize_month_events&&this._mode=="month"&&(!d._timed||r.config.resize_month_timed),f=document.createElement("div"),y=d.hasOwnProperty("_first_chunk")&&d._first_chunk,w=d.hasOwnProperty("_last_chunk")&&d._last_chunk,D=u&&(d._timed||y),M=u&&(d._timed||w),k=!0,N="dhx_cal_event_clear";d._timed&&!u||(k=!1,N="dhx_cal_event_line"),y&&(N+=" dhx_cal_event_line_start"),w&&(N+=" dhx_cal_event_line_end"),D&&(c+="<div class='dhx_event_resize dhx_event_resize_start'></div>"),M&&(c+="<div class='dhx_event_resize dhx_event_resize_end'></div>");var m=r.templates.event_class(d.start_date,d.end_date,d);m&&(N+=" "+m);var x=d.color?"--dhx-scheduler-event-background:"+d.color+";":"",b=d.textColor?"--dhx-scheduler-event-color:"+d.textColor+";":"",E=["position:absolute","top:"+p+"px","left:"+v+"px","width:"+(g-v-(k?1:0))+"px","height:"+(this.xy.bar_height-2)+"px",b,x,d._text_style||""].join(";"),S="<div event_id='"+d.id+"' "+this.config.event_attribute+"='"+d.id+"' class='"+N+"' style='"+E+"'"+this._waiAria.eventBarAttrString(d)+">";u&&(S+=c),r.getState().mode!="month"||d._beforeEventChangedFlag||(d=r.getEvent(d.id)),d._timed&&(S+=`<span class='dhx_cal_event_clear_date'>${r.templates.event_bar_date(d.start_date,d.end_date,d)}</span>`),S+="<div class='dhx_cal_event_line_content'>",S+=r.templates.event_bar_text(d.start_date,d.end_date,d)+"</div>",S+="</div>",S+="</div>",f.innerHTML=S,this._rendered.push(f.firstChild),l.appendChild(f.firstChild)}},r._locate_event=function(d){for(var l=null;d&&!l&&d.getAttribute;)l=d.getAttribute(this.config.event_attribute),d=d.parentNode;return l},r.edit=function(d){this._edit_id!=d&&(this.editStop(!1,d),this._edit_id=d,this.updateEvent(d))},r.editStop=function(d,l){if(!l||this._edit_id!=l){var h=this.getEvent(this._edit_id);h&&(d&&(h.text=this._editor.value),this._edit_id=null,this._editor=null,this.updateEvent(h.id),this._edit_stop_event(h,d))}},r._edit_stop_event=function(d,l){this._new_event?(l?this.callEvent("onEventAdded",[d.id,d]):d&&this.deleteEvent(d.id,!0),delete d.$new,this._new_event=null):l&&this.callEvent("onEventChanged",[d.id,d])},r.getEvents=function(d,l){var h=[];for(var p in this._events){var v=this._events[p];v&&(!d&&!l||v.start_date<l&&v.end_date>d)&&h.push(v)}return h},r.getRenderedEvent=function(d){if(d){for(var l=r._rendered,h=0;h<l.length;h++){var p=l[h];if(p.getAttribute(r.config.event_attribute)==d)return p}return null}},r.showEvent=function(d,l){d&&typeof d=="object"&&(l=d.mode,w=d.section,d=d.section);var h=typeof d=="number"||typeof d=="string"?r.getEvent(d):d;if(l=l||r._mode,h&&(!this.checkEvent("onBeforeEventDisplay")||this.callEvent("onBeforeEventDisplay",[h,l]))){var p=r.config.scroll_hour;r.config.scroll_hour=h.start_date.getHours();var v=r.config.preserve_scroll;r.config.preserve_scroll=!1;var g=h.color,c=h.textColor;if(r.config.highlight_displayed_event&&(h.color=r.config.displayed_event_color,h.textColor=r.config.displayed_event_text_color),r.setCurrentView(new Date(h.start_date),l),r.config.scroll_hour=p,r.config.preserve_scroll=v,r.matrix&&r.matrix[l]){var u=r.getView(),f=u.y_property,y=r.getEvent(h.id);if(y){if(!w){var w=y[f];Array.isArray(w)?w=w[0]:typeof w=="string"&&r.config.section_delimiter&&w.indexOf(r.config.section_delimiter)>-1&&(w=w.split(r.config.section_delimiter)[0])}var D=u.getSectionTop(w),M=u.posFromDate(y.start_date),k=r.$container.querySelector(".dhx_timeline_data_wrapper");if(M-=(k.offsetWidth-u.dx)/2,D=D-k.offsetHeight/2+u.dy/2,u._smartRenderingEnabled())var N=u.attachEvent("onScroll",function(){m(),u.detachEvent(N)});u.scrollTo({left:M,top:D}),u._smartRenderingEnabled()||m()}}else m();r.callEvent("onAfterEventDisplay",[h,l])}function m(){h.color=g,h.textColor=c}}}(i),function(r){r._append_drag_marker=function(d){if(!d.parentNode){var l=r._els.dhx_cal_data[0].lastChild,h=r._getClassName(l);h.indexOf("dhx_scale_holder")<0&&l.previousSibling&&(l=l.previousSibling),h=r._getClassName(l),l&&h.indexOf("dhx_scale_holder")===0&&l.appendChild(d)}},r._update_marker_position=function(d,l){var h=r._calc_event_y(l,0);d.style.top=h.top+"px",d.style.height=h.height+"px"},r.highlightEventPosition=function(d){var l=document.createElement("div");l.setAttribute("event_id",d.id),l.setAttribute(this.config.event_attribute,d.id),this._rendered.push(l),this._update_marker_position(l,d);var h=this.templates.drag_marker_class(d.start_date,d.end_date,d),p=this.templates.drag_marker_content(d.start_date,d.end_date,d);l.className="dhx_drag_marker",h&&(l.className+=" "+h),p&&(l.innerHTML=p),this._append_drag_marker(l)}}(i),Ft(i),Bt(i),Jt(i),function(r){r.getRootView=function(){return{view:{render:function(){return{tag:"div",type:1,attrs:{style:"width:100%;height:100%;"},hooks:{didInsert:function(){r.setCurrentView()}},body:[{el:this.el,type:1}]}},init:function(){var d=document.createElement("DIV");d.id="scheduler_"+r.uid(),d.style.width="100%",d.style.height="100%",d.classList.add("dhx_cal_container"),d.cmp="grid",d.innerHTML='<div class="dhx_cal_navline"><div class="dhx_cal_prev_button"></div><div class="dhx_cal_next_button"></div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div><div class="dhx_cal_tab" data-tab="day"></div><div class="dhx_cal_tab" data-tab="week"></div><div class="dhx_cal_tab" data-tab="month"></div></div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div>',r.init(d),this.el=d}},type:4}}}(i),Wt(i),typeof window<"u"&&window.jQuery&&(n=window.jQuery,s=0,a=[],n.fn.dhx_scheduler=function(r){if(typeof r!="string"){var d=[];return this.each(function(){if(this&&this.getAttribute)if(this.getAttribute("dhxscheduler"))d.push(window[this.getAttribute("dhxscheduler")]);else{var l="scheduler";s&&(l="scheduler"+(s+1),window[l]=Scheduler.getSchedulerInstance());var h=window[l];for(var p in this.setAttribute("dhxscheduler",l),r)p!="data"&&(h.config[p]=r[p]);this.getElementsByTagName("div").length||(this.innerHTML='<div class="dhx_cal_navline"><div class="dhx_cal_prev_button"></div><div class="dhx_cal_next_button"></div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div><div class="dhx_cal_tab" name="day_tab" data-tab="day" style="right:204px;"></div><div class="dhx_cal_tab" name="week_tab" data-tab="week" style="right:140px;"></div><div class="dhx_cal_tab" name="month_tab" data-tab="month" style="right:76px;"></div></div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div>',this.className+=" dhx_cal_container"),h.init(this,h.config.date,h.config.mode),r.data&&h.parse(r.data),d.push(h),s++}}),d.length===1?d[0]:d}if(a[r])return a[r].apply(this,[]);n.error("Method "+r+" does not exist on jQuery.dhx_scheduler")}),function(r){(function(){var d=r.setCurrentView,l=r.updateView,h=null,p=null,v=function(u,f){var y=this;Q.clearTimeout(p),Q.clearTimeout(h);var w=y._date,D=y._mode;c(this,u,f),p=setTimeout(function(){r.$destroyed||(y.callEvent("onBeforeViewChange",[D,w,f||y._mode,u||y._date])?(l.call(y,u,f),y.callEvent("onViewChange",[y._mode,y._date]),Q.clearTimeout(h),p=0):c(y,w,D))},r.config.delay_render)},g=function(u,f){var y=this,w=arguments;c(this,u,f),Q.clearTimeout(h),h=setTimeout(function(){r.$destroyed||p||l.apply(y,w)},r.config.delay_render)};function c(u,f,y){f&&(u._date=f),y&&(u._mode=y)}r.attachEvent("onSchedulerReady",function(){r.config.delay_render?(r.setCurrentView=v,r.updateView=g):(r.setCurrentView=d,r.updateView=l)})})()}(i),function(r){r.createDataProcessor=function(d){var l,h;d instanceof Function?l=d:d.hasOwnProperty("router")?l=d.router:d.hasOwnProperty("event")&&(l=d),h=l?"CUSTOM":d.mode||"REST-JSON";var p=new $e(d.url);return p.init(r),p.setTransactionMode({mode:h,router:l},d.batchUpdate),p},r.DataProcessor=$e}(i),function(r){r.attachEvent("onSchedulerReady",function(){typeof dhtmlxError<"u"&&window.dhtmlxError.catchError("LoadXML",function(d,l,h){var p=h[0].responseText;switch(r.config.ajax_error){case"alert":Q.alert(p);break;case"console":Q.console.log(p)}})})}(i);const o=new Xt(Zt);i.i18n={addLocale:o.addLocale,setLocale:function(r){if(typeof r=="string"){var d=o.getLocale(r);d||(d=o.getLocale("en")),i.locale=d}else if(r)if(i.locale)for(var l in r)r[l]&&typeof r[l]=="object"?(i.locale[l]||(i.locale[l]={}),i.mixin(i.locale[l],r[l],!0)):i.locale[l]=r[l];else i.locale=r;var h=i.locale.labels;h.dhx_save_btn=h.icon_save,h.dhx_cancel_btn=h.icon_cancel,h.dhx_delete_btn=h.icon_delete,i.$container&&i.get_elements()},getLocale:o.getLocale},i.i18n.setLocale("en"),i.ext={},Lt(i);const _={};return i.plugins=function(r){return function(l,h,p){const v=[];for(const g in l)if(l[g]){const c=g.toLowerCase();h[c]&&h[c].forEach(function(u){const f=u.toLowerCase();l[f]||v.push(f)}),v.push(c)}return v.sort(function(g,c){const u=p[g]||0,f=p[c]||0;return u>f?1:u<f?-1:0}),v}(r,{treetimeline:["timeline"],daytimeline:["timeline"],outerdrag:["legacy"]},{legacy:1,limit:1,timeline:2,daytimeline:3,treetimeline:3,outerdrag:6}).forEach(function(l){if(!_[l]){const h=e.getExtension(l);if(!h)throw new Error("unknown plugin "+l);h(i),_[l]=!0}}),_},i.plugins({all_timed:"short"}),i}class ta{constructor(i){this._extensions={};for(const t in i)this._extensions[t]=i[t]}addExtension(i,t){this._extensions[i]=t}getExtension(i){return this._extensions[i]}}typeof dhtmlx<"u"&&dhtmlx.attaches&&(dhtmlx.attaches.attachScheduler=function(e,i,t,n){t=t||'<div class="dhx_cal_tab" name="day_tab" data-tab="day" style="right:204px;"></div><div class="dhx_cal_tab" name="week_tab" data-tab="week" style="right:140px;"></div><div class="dhx_cal_tab" name="month_tab" data-tab="month" style="right:76px;"></div>';var s=document.createElement("DIV");return s.id="dhxSchedObj_"+this._genStr(12),s.innerHTML='<div id="'+s.id+'" class="dhx_cal_container" style="width:100%; height:100%;"><div class="dhx_cal_navline"><div class="dhx_cal_prev_button"></div><div class="dhx_cal_next_button"></div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div>'+t+'</div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div></div>',document.body.appendChild(s.firstChild),this.attachObject(s.id,!1,!0),this.vs[this.av].sched=n,this.vs[this.av].schedId=s.id,n.setSizes=n.updateView,n.destructor=function(){},n.init(s.id,e,i),this.vs[this._viewRestore()].sched});const he=(e,i)=>{i(!1,`The ${e} extension is not included in this version of dhtmlxScheduler.<br>
36 You may need a <a href="https://docs.dhtmlx.com/scheduler/editions_comparison.html" target="_blank">Professional version of the component</a>.<br>
37 Contact us at <a href="https://dhtmlx.com/docs/contact.shtml" target="_blank">https://dhtmlx.com/docs/contact.shtml</a> if you have any questions.`)};function aa(e){(function(){var i=[];function t(){return!!i.length}function n(_){setTimeout(function(){if(e.$destroyed)return!0;t()||function(r,d){for(;r&&r!=d;)r=r.parentNode;return r==d}(document.activeElement,e.$container)||e.focus()},1)}function s(_){var r=(_=_||window.event).currentTarget;r==i[i.length-1]&&e.$keyboardNavigation.trapFocus(r,_)}if(e.attachEvent("onLightbox",function(){var _;_=e.getLightbox(),e.eventRemove(_,"keydown",s),e.event(_,"keydown",s),i.push(_)}),e.attachEvent("onAfterLightbox",function(){var _=i.pop();_&&e.eventRemove(_,"keydown",s),n()}),e.attachEvent("onAfterQuickInfo",function(){n()}),!e._keyNavMessagePopup){e._keyNavMessagePopup=!0;var a=null,o=null;const _=[];e.attachEvent("onMessagePopup",function(r){for(a=document.activeElement,o=a;o&&e._getClassName(o).indexOf("dhx_cal_data")<0;)o=o.parentNode;o&&(o=o.parentNode),e.eventRemove(r,"keydown",s),e.event(r,"keydown",s),_.push(r)}),e.attachEvent("onAfterMessagePopup",function(){var r=_.pop();r&&e.eventRemove(r,"keydown",s),setTimeout(function(){if(e.$destroyed)return!0;for(var d=document.activeElement;d&&e._getClassName(d).indexOf("dhx_cal_light")<0;)d=d.parentNode;d||(a&&a.parentNode?a.focus():o&&o.parentNode&&o.focus(),a=null,o=null)},1)})}e.$keyboardNavigation.isModal=t})()}function na(e){e._temp_key_scope=function(){e.config.key_nav=!0,e.$keyboardNavigation._pasteDate=null,e.$keyboardNavigation._pasteSection=null;var i=null,t={};function n(o){o=o||window.event,t.x=o.clientX,t.y=o.clientY}function s(){for(var o,_,r=document.elementFromPoint(t.x,t.y);r&&r!=e._obj;)r=r.parentNode;return o=r==e._obj,_=e.$keyboardNavigation.dispatcher.isEnabled(),o||_}function a(o){return e._lame_copy({},o)}document.body?e.event(document.body,"mousemove",n):e.event(window,"load",function(){e.event(document.body,"mousemove",n)}),e.attachEvent("onMouseMove",function(o,_){var r=e.getState();if(r.mode&&r.min_date){var d=e.getActionData(_);e.$keyboardNavigation._pasteDate=d.date,e.$keyboardNavigation._pasteSection=d.section}}),e._make_pasted_event=function(o){var _=e.$keyboardNavigation._pasteDate,r=e.$keyboardNavigation._pasteSection,d=o.end_date-o.start_date,l=a(o);if(function(p){delete p.rec_type,delete p.rec_pattern,delete p.event_pid,delete p.event_length}(l),l.start_date=new Date(_),l.end_date=new Date(l.start_date.valueOf()+d),r){var h=e._get_section_property();e.config.multisection&&o[h]&&e.isMultisectionEvent&&e.isMultisectionEvent(o)?l[h]=o[h]:l[h]=r}return l},e._do_paste=function(o,_,r){e.callEvent("onBeforeEventPasted",[o,_,r])!==!1&&(e.addEvent(_),e.callEvent("onEventPasted",[o,_,r]))},e._is_key_nav_active=function(){return!(!this._is_initialized()||this._is_lightbox_open()||!this.config.key_nav)},e.event(document,"keydown",function(o){(o.ctrlKey||o.metaKey)&&o.keyCode==86&&e._buffer_event&&!e.$keyboardNavigation.dispatcher.isEnabled()&&(e.$keyboardNavigation.dispatcher.isActive=s())}),e._key_nav_copy_paste=function(o){if(!e._is_key_nav_active())return!0;if(o.keyCode==37||o.keyCode==39){o.cancelBubble=!0;var _=e.date.add(e._date,o.keyCode==37?-1:1,e._mode);return e.setCurrentView(_),!0}var r,d=(r=e.$keyboardNavigation.dispatcher.getActiveNode())&&r.eventId?r.eventId:e._select_id;if((o.ctrlKey||o.metaKey)&&o.keyCode==67)return d&&(e._buffer_event=a(e.getEvent(d)),i=!0,e.callEvent("onEventCopied",[e.getEvent(d)])),!0;if((o.ctrlKey||o.metaKey)&&o.keyCode==88&&d){i=!1;var l=e._buffer_event=a(e.getEvent(d));e.updateEvent(l.id),e.callEvent("onEventCut",[l])}if((o.ctrlKey||o.metaKey)&&o.keyCode==86&&s()){if(l=(l=e._buffer_event?e.getEvent(e._buffer_event.id):e._buffer_event)||e._buffer_event){var h=e._make_pasted_event(l);i?(h.id=e.uid(),e._do_paste(i,h,l)):e.callEvent("onBeforeEventChanged",[h,o,!1,l])&&(e._do_paste(i,h,l),i=!0)}return!0}}},e._temp_key_scope()}function ra(e){e.$keyboardNavigation.attachSchedulerHandlers=function(){var i,t=e.$keyboardNavigation.dispatcher,n=function(r){if(e.config.key_nav)return t.keyDownHandler(r)},s=function(){t.keepScrollPosition(function(){t.focusGlobalNode()})};e.attachEvent("onDataRender",function(){e.config.key_nav&&t.isEnabled()&&!e.getState().editor_id&&(clearTimeout(i),i=setTimeout(function(){if(e.$destroyed)return!0;t.isEnabled()||t.enable(),a()}))});var a=function(){if(t.isEnabled()){var r=t.getActiveNode();r&&(r.isValid()||(r=r.fallback()),!r||r instanceof e.$keyboardNavigation.MinicalButton||r instanceof e.$keyboardNavigation.MinicalCell||t.keepScrollPosition(function(){r.focus(!0)}))}};function o(r){if(!e.config.key_nav)return!0;const d=e.getView();let l=!1;if(e.getState().mode==="month")l=e.$keyboardNavigation.isChildOf(r.target||r.srcElement,e.$container.querySelector(".dhx_cal_month_table"));else if(d&&d.layout==="timeline")l=e.$keyboardNavigation.isChildOf(r.target||r.srcElement,e.$container.querySelector(".dhx_timeline_data_col"));else{const v=e.$container.querySelectorAll(".dhx_scale_holder");l=Array.from(v).some(g=>g===r.target.parentNode)}var h,p=e.getActionData(r);e._locate_event(r.target||r.srcElement)?h=new e.$keyboardNavigation.Event(e._locate_event(r.target||r.srcElement)):l&&(h=new e.$keyboardNavigation.TimeSlot,p.date&&l&&(h=h.nextSlot(new e.$keyboardNavigation.TimeSlot(p.date,null,p.section)))),h&&(t.isEnabled()?p.date&&l&&t.delay(function(){t.setActiveNode(h)}):t.activeNode=h)}e.attachEvent("onSchedulerReady",function(){var r=e.$container;e.eventRemove(document,"keydown",n),e.eventRemove(r,"mousedown",o),e.eventRemove(r,"focus",s),e.config.key_nav?(e.event(document,"keydown",n),e.event(r,"mousedown",o),e.event(r,"focus",s),r.setAttribute("tabindex","0")):r.removeAttribute("tabindex")});var _=e.updateEvent;e.updateEvent=function(r){var d=_.apply(this,arguments);if(e.config.key_nav&&t.isEnabled()&&e.getState().select_id==r){var l=new e.$keyboardNavigation.Event(r);e.getState().lightbox_id||function(h){if(e.config.key_nav&&t.isEnabled()){var p=h,v=new e.$keyboardNavigation.Event(p.eventId);if(!v.isValid()){var g=v.start||p.start,c=v.end||p.end,u=v.section||p.section;(v=new e.$keyboardNavigation.TimeSlot(g,c,u)).isValid()||(v=new e.$keyboardNavigation.TimeSlot)}t.setActiveNode(v);var f=t.getActiveNode();f&&f.getNode&&document.activeElement!=f.getNode()&&t.focusNode(t.getActiveNode())}}(l)}return d},e.attachEvent("onEventDeleted",function(r){return e.config.key_nav&&t.isEnabled()&&t.getActiveNode().eventId==r&&t.setActiveNode(new e.$keyboardNavigation.TimeSlot),!0}),e.attachEvent("onClearAll",function(){if(!e.config.key_nav)return!0;t.isEnabled()&&t.getActiveNode()instanceof e.$keyboardNavigation.Event&&t.setActiveNode(new e.$keyboardNavigation.TimeSlot)})}}class ia{constructor(i){this.map=null,this._markers=[],this.scheduler=i}onEventClick(i){if(this._markers&&this._markers.length>0){for(let t=0;t<this._markers.length;t++)if(i.id==this._markers[t].event.id){let n=this.settings.zoom_after_resolve||this.settings.initial_zoom;i.lat&&i.lng?(this.map.setCenter({lat:i.lat,lng:i.lng}),this.map.setZoom(n)):(this.map.setCenter({lat:this.settings.error_position.lat,lng:this.settings.error_position.lng}),this.map.setZoom(n)),google.maps.event.trigger(this._markers[t].marker,"click")}}}initialize(i,t){this.settings=t;let n=this.scheduler,s={center:{lat:t.initial_position.lat,lng:t.initial_position.lng},zoom:t.initial_zoom,mapId:i.id,scrollwheel:!0,mapTypeId:t.type};if(this.map===null)this.map=new google.maps.Map(i,s);else{let a=this.map;i.appendChild(this.map.__gm.messageOverlay),i.appendChild(this.map.__gm.outerContainer),setTimeout(function(){a.setOptions({container:i.id})},500)}google.maps.event.addListener(this.map,"dblclick",function(a){const o=new google.maps.Geocoder;if(!n.config.readonly&&n.config.dblclick_create){let _=a.latLng;o.geocode({latLng:_},function(r,d){d==google.maps.GeocoderStatus.OK?(_=r[0].geometry.location,n.addEventNow({lat:_.lat(),lng:_.lng(),event_location:r[0].formatted_address,start_date:n.getState().date,end_date:n.date.add(n.getState().date,n.config.time_step,"minute")})):console.error("Geocode was not successful for the following reason: "+d)})}})}destroy(i){for(google.maps.event.clearInstanceListeners(window),google.maps.event.clearInstanceListeners(document),google.maps.event.clearInstanceListeners(i);i.firstChild;)i.firstChild.remove();i.innerHTML=""}async addEventMarker(i){let t={title:i.text,position:{},map:{}};i.lat&&i.lng?t.position={lat:i.lat,lng:i.lng}:t.position={lat:this.settings.error_position.lat,lng:this.settings.error_position.lng};const{AdvancedMarkerElement:n}=await google.maps.importLibrary("marker");let s;this.scheduler.ext.mapView.createMarker?(t.map=this.map,s=this.scheduler.ext.mapView.createMarker(t)):(s=new n(t),s.map=this.map),s.setMap(this.map),i["!nativeeditor_status"]=="true_deleted"&&s.setMap(null),google.maps.event.addListener(s,"click",()=>{this.infoWindow&&this.infoWindow.close(),this.infoWindow=new google.maps.InfoWindow({maxWidth:this.settings.info_window_max_width}),this.infoWindow.setContent(this.scheduler.templates.map_info_content(i)),this.infoWindow.open({anchor:s,map:this.map})});let a={event:i,...t,marker:s};this._markers.push(a)}removeEventMarker(i){for(let t=0;t<this._markers.length;t++)i==this._markers[t].event.id&&(this._markers[t].marker.setVisible(!1),this._markers[t].marker.setMap(null),this._markers[t].marker.setPosition(null),this._markers[t].marker=null,this._markers.splice(t,1),t--)}updateEventMarker(i){for(let t=0;t<this._markers.length;t++)if(this._markers[t].event.id==i.id){this._markers[t].event=i,this._markers[t].position.lat=i.lat,this._markers[t].position.lng=i.lng,this._markers[t].text=i.text;let n=new google.maps.LatLng(i.lat,i.lng);this._markers[t].marker.setPosition(n)}}clearEventMarkers(){if(this._markers.length>0){for(let i=0;i<this._markers.length;i++)this._markers[i].marker.setMap(null);this._markers=[]}}setView(i,t,n){this.map.setCenter({lat:i,lng:t}),this.map.setZoom(n)}async resolveAddress(i){const t=new google.maps.Geocoder;return await new Promise(n=>{t.geocode({address:i},function(s,a){a==google.maps.GeocoderStatus.OK?n({lat:s[0].geometry.location.lat(),lng:s[0].geometry.location.lng()}):(console.error("Geocode was not successful for the following reason: "+a),n({}))})})}}class oa{constructor(i){this.map=null,this._markers=[],this.scheduler=i}onEventClick(i){if(this._markers&&this._markers.length>0)for(let t=0;t<this._markers.length;t++)i.id==this._markers[t].event.id&&(this._markers[t].marker.openPopup(),this._markers[t].marker.closeTooltip(),i.lat&&i.lng?this.setView(i.lat,i.lng,this.settings.zoom_after_resolve||this.settings.initial_zoom):this.setView(this.settings.error_position.lat,this.settings.error_position.lng,this.settings.zoom_after_resolve||this.settings.initial_zoom))}initialize(i,t){let n=this.scheduler,s=document.createElement("div");s.className="mapWrapper",s.id="mapWrapper",s.style.width=i.style.width,s.style.height=i.style.height,i.appendChild(s);let a=L.map(s,{center:L.latLng(t.initial_position.lat,t.initial_position.lng),zoom:t.initial_zoom,keyboard:!1});L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(a),a.on("dblclick",async function(o){let _=await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${o.latlng.lat}&lon=${o.latlng.lng}&format=json`,{method:"GET",headers:{"Accept-Language":"en"}}).then(r=>r.json());if(_.address){let r=_.address.country;n.addEventNow({lat:o.latlng.lat,lng:o.latlng.lng,event_location:r,start_date:n.getState().date,end_date:n.date.add(n.getState().date,n.config.time_step,"minute")})}else console.error("unable recieve a position of the event",_.error)}),this.map=a,this.settings=t}destroy(i){for(this.map.remove();i.firstChild;)i.firstChild.remove();i.innerHTML=""}addEventMarker(i){const t=L.icon({iconUrl:"https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png",iconSize:[25,41],shadowSize:[30,65],iconAnchor:[12,41],shadowAnchor:[7,65]});let n={minWidth:180,maxWidth:this.settings.info_window_max_width};const s=L.popup(n).setContent(this.scheduler.templates.map_info_content(i)),a=L.tooltip().setContent(i.text);let o=[i.lat,i.lng];i.lat&&i.lng||(o=[this.settings.error_position.lat,this.settings.error_position.lng]);const _={event:i,marker:L.marker(o,{icon:t}).bindPopup(s).bindTooltip(a).addTo(this.map)};this._markers.push(_)}removeEventMarker(i){for(let t=0;t<this._markers.length;t++)i==this._markers[t].event.id&&(this.map.removeLayer(this._markers[t].marker),this._markers.splice(t,1),t--)}updateEventMarker(i){for(let t=0;t<this._markers.length;t++)this._markers[t].event.id==i.id&&(this._markers[t].event=i,i.lat&&i.lng?this._markers[t].marker.setLatLng([i.lat,i.lng]):this._markers[t].marker.setLatLng([this.settings.error_position.lat,this.settings.error_position.lng]))}clearEventMarkers(){if(this._markers){for(let i=0;i<this._markers.length;i++)this.map.removeLayer(this._markers[i].marker);this._markers=[]}}setView(i,t,n){this.map.setView([i,t],n)}async resolveAddress(i){let t={},n=await fetch(`https://nominatim.openstreetmap.org/search?q=${i}&format=json`,{method:"GET",headers:{"Accept-Language":"en"}}).then(s=>s.json());return n&&n.length?(t.lat=+n[0].lat,t.lng=+n[0].lon):console.error(`Unable recieve a position of the event's location: ${i}`),t}}class sa{constructor(i){this.map=null,this._markers=[],this.scheduler=i}onEventClick(i){if(this._markers&&this._markers.length>0)for(let t=0;t<this._markers.length;t++){const n=this._markers[t].marker.getPopup();n.isOpen()&&n.remove(),i.id==this._markers[t].event.id&&(this._markers[t].marker.togglePopup(),i.lat&&i.lng?this.setView(i.lat,i.lng,this.settings.zoom_after_resolve||this.settings.initial_zoom):this.setView(this.settings.error_position.lat,this.settings.error_position.lng,this.settings.zoom_after_resolve||this.settings.initial_zoom))}}initialize(i,t){let n=this.scheduler;mapboxgl.accessToken=t.accessToken;const s=new mapboxgl.Map({container:i,center:[t.initial_position.lng,t.initial_position.lat],zoom:t.initial_zoom+1});s.on("dblclick",async function(a){let o=await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${a.lngLat.lng},${a.lngLat.lat}.json?access_token=${t.accessToken}`).then(_=>_.json());if(o.features){let _=o.features[0].place_name;n.addEventNow({lat:a.lngLat.lat,lng:a.lngLat.lng,event_location:_,start_date:n.getState().date,end_date:n.date.add(n.getState().date,n.config.time_step,"minute")})}else console.error("unable recieve a position of the event")}),this.map=s,this.settings=t}destroy(i){for(this.map.remove();i.firstChild;)i.firstChild.remove();i.innerHTML=""}addEventMarker(i){let t=[i.lng,i.lat];i.lat&&i.lng||(t=[this.settings.error_position.lng,this.settings.error_position.lat]);const n=new mapboxgl.Popup({offset:25,focusAfterOpen:!1}).setMaxWidth(`${this.settings.info_window_max_width}px`).setHTML(this.scheduler.templates.map_info_content(i)),s={event:i,marker:new mapboxgl.Marker().setLngLat(t).setPopup(n).addTo(this.map)};this._markers.push(s)}removeEventMarker(i){for(let t=0;t<this._markers.length;t++)i==this._markers[t].event.id&&(this._markers[t].marker.remove(),this._markers.splice(t,1),t--)}updateEventMarker(i){for(let t=0;t<this._markers.length;t++)this._markers[t].event.id==i.id&&(this._markers[t].event=i,i.lat&&i.lng?this._markers[t].marker.setLngLat([i.lng,i.lat]):this._markers[t].marker.setLngLat([this.settings.error_position.lng,this.settings.error_position.lat]))}clearEventMarkers(){for(let i=0;i<this._markers.length;i++)this._markers[i].marker.remove();this._markers=[]}setView(i,t,n){this.map.setCenter([t,i]),this.map.setZoom(n)}async resolveAddress(i){let t=await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${i}.json?access_token=${this.settings.accessToken}`).then(s=>s.json()),n={};return t&&t.features.length?(n.lng=t.features[0].center[0],n.lat=t.features[0].center[1]):console.error(`Unable recieve a position of the event's location: ${i}`),n}}var He=["MO","TU","WE","TH","FR","SA","SU"],Z=function(){function e(i,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=i,this.n=t}return e.fromStr=function(i){return new e(He.indexOf(i))},e.prototype.nth=function(i){return this.n===i?this:new e(this.weekday,i)},e.prototype.equals=function(i){return this.weekday===i.weekday&&this.n===i.n},e.prototype.toString=function(){var i=He[this.weekday];return this.n&&(i=(this.n>0?"+":"")+String(this.n)+i),i},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e}(),J=function(e){return e!=null},ie=function(e){return typeof e=="number"},nt=function(e){return typeof e=="string"&&He.includes(e)},ee=Array.isArray,oe=function(e,i){i===void 0&&(i=e),arguments.length===1&&(i=e,e=0);for(var t=[],n=e;n<i;n++)t.push(n);return t},Y=function(e,i){var t=0,n=[];if(ee(e))for(;t<i;t++)n[t]=[].concat(e);else for(;t<i;t++)n[t]=e;return n},da=function(e){return ee(e)?e:[e]};function ye(e,i,t){t===void 0&&(t=" ");var n=String(e);return i|=0,n.length>i?String(n):((i-=n.length)>t.length&&(t+=Y(t,i/t.length)),t.slice(0,i)+String(n))}var ae=function(e,i){var t=e%i;return t*i<0?t+i:t},ze=function(e,i){return{div:Math.floor(e/i),mod:ae(e,i)}},se=function(e){return!J(e)||e.length===0},K=function(e){return!se(e)},F=function(e,i){return K(e)&&e.indexOf(i)!==-1},ge=function(e,i,t,n,s,a){return n===void 0&&(n=0),s===void 0&&(s=0),a===void 0&&(a=0),new Date(Date.UTC(e,i-1,t,n,s,a))},_a=[31,28,31,30,31,30,31,31,30,31,30,31],rt=864e5,it=ge(1970,1,1),la=[6,0,1,2,3,4,5],ke=function(e){return e%4==0&&e%100!=0||e%400==0},ot=function(e){return e instanceof Date},Ee=function(e){return ot(e)&&!isNaN(e.getTime())},qe=function(e){return i=it,t=e.getTime()-i.getTime(),Math.round(t/rt);var i,t},st=function(e){return new Date(it.getTime()+e*rt)},ca=function(e){var i=e.getUTCMonth();return i===1&&ke(e.getUTCFullYear())?29:_a[i]},be=function(e){return la[e.getUTCDay()]},dt=function(e,i){var t=ge(e,i+1,1);return[be(t),ca(t)]},_t=function(e,i){return i=i||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()))},je=function(e){return new Date(e.getTime())},lt=function(e){for(var i=[],t=0;t<e.length;t++)i.push(je(e[t]));return i},De=function(e){e.sort(function(i,t){return i.getTime()-t.getTime()})},Ie=function(e,i){i===void 0&&(i=!0);var t=new Date(e);return[ye(t.getUTCFullYear().toString(),4,"0"),ye(t.getUTCMonth()+1,2,"0"),ye(t.getUTCDate(),2,"0"),"T",ye(t.getUTCHours(),2,"0"),ye(t.getUTCMinutes(),2,"0"),ye(t.getUTCSeconds(),2,"0"),i?"Z":""].join("")},Re=function(e){var i=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(e);if(!i)throw new Error("Invalid UNTIL value: ".concat(e));return new Date(Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[5],10)||0,parseInt(i[6],10)||0,parseInt(i[7],10)||0))},ct=function(e,i){return e.toLocaleString("sv-SE",{timeZone:i}).replace(" ","T")+"Z"},xe=function(){function e(i,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=i,this.args=t,i==="between"?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):i==="before"?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):i==="after"&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return e.prototype.accept=function(i){++this.total;var t=this.minDate&&i<this.minDate,n=this.maxDate&&i>this.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return!!t||(this.add(i),!1);return this.add(i)},e.prototype.add=function(i){return this._result.push(i),!0},e.prototype.getValue=function(){var i=this._result;switch(this.method){case"all":case"between":return i;default:return i.length?i[i.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),Pe=function(e,i){return Pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])},Pe(e,i)};function Ue(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function t(){this.constructor=e}Pe(e,i),e.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}var te=function(){return te=Object.assign||function(e){for(var i,t=1,n=arguments.length;t<n;t++)for(var s in i=arguments[t])Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s]);return e},te.apply(this,arguments)};function q(e,i,t){if(t||arguments.length===2)for(var n,s=0,a=i.length;s<a;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return e.concat(n||Array.prototype.slice.call(i))}typeof SuppressedError=="function"&&SuppressedError;var V,ht=function(e){function i(t,n,s){var a=e.call(this,t,n)||this;return a.iterator=s,a}return Ue(i,e),i.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},i}(xe),Me={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},ut=function(e,i){return e.indexOf(i)!==-1},ha=function(e){return e.toString()},ua=function(e,i,t){return"".concat(i," ").concat(t,", ").concat(e)},de=function(){function e(i,t,n,s){if(t===void 0&&(t=ha),n===void 0&&(n=Me),s===void 0&&(s=ua),this.text=[],this.language=n||Me,this.gettext=t,this.dateFormatter=s,this.rrule=i,this.options=i.options,this.origOptions=i.origOptions,this.origOptions.bymonthday){var a=[].concat(this.options.bymonthday),o=[].concat(this.options.bynmonthday);a.sort(function(l,h){return l-h}),o.sort(function(l,h){return h-l}),this.bymonthday=a.concat(o),this.bymonthday.length||(this.bymonthday=null)}if(J(this.origOptions.byweekday)){var _=ee(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],r=String(_);this.byweekday={allWeeks:_.filter(function(l){return!l.n}),someWeeks:_.filter(function(l){return!!l.n}),isWeekdays:r.indexOf("MO")!==-1&&r.indexOf("TU")!==-1&&r.indexOf("WE")!==-1&&r.indexOf("TH")!==-1&&r.indexOf("FR")!==-1&&r.indexOf("SA")===-1&&r.indexOf("SU")===-1,isEveryDay:r.indexOf("MO")!==-1&&r.indexOf("TU")!==-1&&r.indexOf("WE")!==-1&&r.indexOf("TH")!==-1&&r.indexOf("FR")!==-1&&r.indexOf("SA")!==-1&&r.indexOf("SU")!==-1};var d=function(l,h){return l.weekday-h.weekday};this.byweekday.allWeeks.sort(d),this.byweekday.someWeeks.sort(d),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return e.isFullyConvertible=function(i){if(!(i.options.freq in e.IMPLEMENTED)||i.origOptions.until&&i.origOptions.count)return!1;for(var t in i.origOptions){if(ut(["dtstart","tzid","wkst","freq"],t))return!0;if(!ut(e.IMPLEMENTED[i.options.freq],t))return!1}return!0},e.prototype.isFullyConvertible=function(){return e.isFullyConvertible(this.rrule)},e.prototype.toString=function(){var i=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return i("RRule error: Unable to fully convert this rrule to text");if(this.text=[i("every")],this[z.FREQUENCIES[this.options.freq]](),this.options.until){this.add(i("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(i("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?i("times"):i("time"));return this.isFullyConvertible()||this.add(i("(~ approximate)")),this.text.join("")},e.prototype.HOURLY=function(){var i=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?i("hours"):i("hour"))},e.prototype.MINUTELY=function(){var i=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?i("minutes"):i("minute"))},e.prototype.DAILY=function(){var i=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?i("weekdays"):i("weekday")):this.add(this.plural(this.options.interval)?i("days"):i("day")),this.origOptions.bymonth&&(this.add(i("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},e.prototype.WEEKLY=function(){var i=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?i("weeks"):i("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?i("weekdays"):i("weekday")):this.add(i("on")).add(i("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?i("days"):i("day")):(this.options.interval===1&&this.add(i("week")),this.origOptions.bymonth&&(this.add(i("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},e.prototype.MONTHLY=function(){var i=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(i("months")),this.plural(this.options.interval)&&this.add(i("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?i("months"):i("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(i("on")).add(i("weekdays")):this.byweekday&&this._byweekday()},e.prototype.YEARLY=function(){var i=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(i("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?i("years"):i("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(i("on the")).add(this.list(this.options.byyearday,this.nth,i("and"))).add(i("day")),this.options.byweekno&&this.add(i("in")).add(this.plural(this.options.byweekno.length)?i("weeks"):i("week")).add(this.list(this.options.byweekno,void 0,i("and")))},e.prototype._bymonthday=function(){var i=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(i("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,i("or"))).add(i("the")).add(this.list(this.bymonthday,this.nth,i("or"))):this.add(i("on the")).add(this.list(this.bymonthday,this.nth,i("and")))},e.prototype._byweekday=function(){var i=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(i("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(i("and")),this.add(i("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,i("and"))))},e.prototype._byhour=function(){var i=this.gettext;this.add(i("at")).add(this.list(this.origOptions.byhour,void 0,i("and")))},e.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},e.prototype.nth=function(i){var t;i=parseInt(i.toString(),10);var n=this.gettext;if(i===-1)return n("last");var s=Math.abs(i);switch(s){case 1:case 21:case 31:t=s+n("st");break;case 2:case 22:t=s+n("nd");break;case 3:case 23:t=s+n("rd");break;default:t=s+n("th")}return i<0?t+" "+n("last"):t},e.prototype.monthtext=function(i){return this.language.monthNames[i-1]},e.prototype.weekdaytext=function(i){var t=ie(i)?(i+1)%7:i.getJsWeekday();return(i.n?this.nth(i.n)+" ":"")+this.language.dayNames[t]},e.prototype.plural=function(i){return i%100!=1},e.prototype.add=function(i){return this.text.push(" "),this.text.push(i),this},e.prototype.list=function(i,t,n,s){var a=this;s===void 0&&(s=","),ee(i)||(i=[i]),t=t||function(_){return _.toString()};var o=function(_){return t&&t.call(a,_)};return n?function(_,r,d){for(var l="",h=0;h<_.length;h++)h!==0&&(h===_.length-1?l+=" "+d+" ":l+=r+" "),l+=_[h];return l}(i.map(o),s,n):i.map(o).join(s+" ")},e}(),fa=function(){function e(i){this.done=!0,this.rules=i}return e.prototype.start=function(i){return this.text=i,this.done=!1,this.nextSymbol()},e.prototype.isDone=function(){return this.done&&this.symbol===null},e.prototype.nextSymbol=function(){var i,t;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in i=null,this.rules){var s=this.rules[n].exec(this.text);s&&(i===null||s[0].length>i[0].length)&&(i=s,t=n)}if(i!=null&&(this.text=this.text.substr(i[0].length),this.text===""&&(this.done=!0)),i==null)return this.done=!0,this.symbol=null,void(this.value=null)}while(t==="SKIP");return this.symbol=t,this.value=i,!0},e.prototype.accept=function(i){if(this.symbol===i){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(i){if(this.accept(i))return!0;throw new Error("expected "+i+" but found "+this.symbol)},e}();function ft(e,i){i===void 0&&(i=Me);var t={},n=new fa(i.tokens);return n.start(e)?(function(){n.expect("every");var l=n.acceptNumber();if(l&&(t.interval=parseInt(l[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=z.DAILY,n.nextSymbol()&&(a(),d());break;case"weekday(s)":t.freq=z.WEEKLY,t.byweekday=[z.MO,z.TU,z.WE,z.TH,z.FR],n.nextSymbol(),a(),d();break;case"week(s)":t.freq=z.WEEKLY,n.nextSymbol()&&(s(),a(),d());break;case"hour(s)":t.freq=z.HOURLY,n.nextSymbol()&&(s(),d());break;case"minute(s)":t.freq=z.MINUTELY,n.nextSymbol()&&(s(),d());break;case"month(s)":t.freq=z.MONTHLY,n.nextSymbol()&&(s(),d());break;case"year(s)":t.freq=z.YEARLY,n.nextSymbol()&&(s(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=z.WEEKLY;var h=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[z[h]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var p=_();if(!p)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(z[p]),n.nextSymbol()}a(),function(){n.accept("on"),n.accept("the");var g=r();if(g)for(t.bymonthday=[g],n.nextSymbol();n.accept("comma");){if(!(g=r()))throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(g),n.nextSymbol()}}(),d();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=z.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var v=o();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(v),n.nextSymbol()}s(),d();break;default:throw new Error("Unknown symbol")}}(),t):null;function s(){var l=n.accept("on"),h=n.accept("the");if(l||h)do{var p=r(),v=_(),g=o();if(p)v?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(z[v].nth(p))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(p),n.accept("day(s)"));else if(v)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(z[v]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[z.MO,z.TU,z.WE,z.TH,z.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var c=n.acceptNumber();if(!c)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(c[0],10)];n.accept("comma");){if(!(c=n.acceptNumber()))throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(c[0],10))}}else{if(!g)return;n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(g)}}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){if(n.accept("at"))do{var l=n.acceptNumber();if(!l)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(l[0],10)];n.accept("comma");){if(!(l=n.acceptNumber()))throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(l[0],10))}}while(n.accept("comma")||n.accept("at"))}function o(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function _(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function r(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var l=parseInt(n.value[1],10);if(l<-366||l>366)throw new Error("Nth out of range: "+l);return n.nextSymbol(),n.accept("last")?-l:l;default:return!1}}function d(){if(n.symbol==="until"){var l=Date.parse(n.text);if(!l)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(l)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}function Ye(e){return e<V.HOURLY}(function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"})(V||(V={}));var pa=function(e,i){return i===void 0&&(i=Me),new z(ft(e,i)||void 0)},we=["count","until","interval","byweekday","bymonthday","bymonth"];de.IMPLEMENTED=[],de.IMPLEMENTED[V.HOURLY]=we,de.IMPLEMENTED[V.MINUTELY]=we,de.IMPLEMENTED[V.DAILY]=["byhour"].concat(we),de.IMPLEMENTED[V.WEEKLY]=we,de.IMPLEMENTED[V.MONTHLY]=we,de.IMPLEMENTED[V.YEARLY]=["byweekno","byyearday"].concat(we);var ga=de.isFullyConvertible,Ne=function(){function e(i,t,n,s){this.hour=i,this.minute=t,this.second=n,this.millisecond=s||0}return e.prototype.getHours=function(){return this.hour},e.prototype.getMinutes=function(){return this.minute},e.prototype.getSeconds=function(){return this.second},e.prototype.getMilliseconds=function(){return this.millisecond},e.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},e}(),ma=function(e){function i(t,n,s,a,o,_,r){var d=e.call(this,a,o,_,r)||this;return d.year=t,d.month=n,d.day=s,d}return Ue(i,e),i.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},i.prototype.getWeekday=function(){return be(new Date(this.getTime()))},i.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},i.prototype.getDay=function(){return this.day},i.prototype.getMonth=function(){return this.month},i.prototype.getYear=function(){return this.year},i.prototype.addYears=function(t){this.year+=t},i.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),s=ae(this.month,12);this.month=s,this.year+=n,this.month===0&&(this.month=12,--this.year)}},i.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+7*t:this.day+=-(this.getWeekday()-n)+7*t,this.fixDay()},i.prototype.addDaily=function(t){this.day+=t,this.fixDay()},i.prototype.addHours=function(t,n,s){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var a=ze(this.hour,24),o=a.div,_=a.mod;if(o&&(this.hour=_,this.addDaily(o)),se(s)||F(s,this.hour))break}},i.prototype.addMinutes=function(t,n,s,a){for(n&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var o=ze(this.minute,60),_=o.div,r=o.mod;if(_&&(this.minute=r,this.addHours(_,!1,s)),(se(s)||F(s,this.hour))&&(se(a)||F(a,this.minute)))break}},i.prototype.addSeconds=function(t,n,s,a,o){for(n&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var _=ze(this.second,60),r=_.div,d=_.mod;if(r&&(this.second=d,this.addMinutes(r,!1,s,a)),(se(s)||F(s,this.hour))&&(se(a)||F(a,this.minute))&&(se(o)||F(o,this.second)))break}},i.prototype.fixDay=function(){if(!(this.day<=28)){var t=dt(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>9999))return;t=dt(this.year,this.month-1)[1]}}},i.prototype.add=function(t,n){var s=t.freq,a=t.interval,o=t.wkst,_=t.byhour,r=t.byminute,d=t.bysecond;switch(s){case V.YEARLY:return this.addYears(a);case V.MONTHLY:return this.addMonths(a);case V.WEEKLY:return this.addWeekly(a,o);case V.DAILY:return this.addDaily(a);case V.HOURLY:return this.addHours(a,n,_);case V.MINUTELY:return this.addMinutes(a,n,_,r);case V.SECONDLY:return this.addSeconds(a,n,_,r,d)}},i}(Ne);function pt(e){for(var i=[],t=0,n=Object.keys(e);t<n.length;t++){var s=n[t];F(Ra,s)||i.push(s),ot(e[s])&&!Ee(e[s])&&i.push(s)}if(i.length)throw new Error("Invalid options: "+i.join(", "));return te({},e)}function va(e){var i=te(te({},Be),pt(e));if(J(i.byeaster)&&(i.freq=z.YEARLY),!J(i.freq)||!z.FREQUENCIES[i.freq])throw new Error("Invalid frequency: ".concat(i.freq," ").concat(e.freq));if(i.dtstart||(i.dtstart=new Date(new Date().setMilliseconds(0))),J(i.wkst)?ie(i.wkst)||(i.wkst=i.wkst.weekday):i.wkst=z.MO.weekday,J(i.bysetpos)){ie(i.bysetpos)&&(i.bysetpos=[i.bysetpos]);for(var t=0;t<i.bysetpos.length;t++)if((a=i.bysetpos[t])===0||!(a>=-366&&a<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}if(!(i.byweekno||K(i.byweekno)||K(i.byyearday)||i.bymonthday||K(i.bymonthday)||J(i.byweekday)||J(i.byeaster)))switch(i.freq){case z.YEARLY:i.bymonth||(i.bymonth=i.dtstart.getUTCMonth()+1),i.bymonthday=i.dtstart.getUTCDate();break;case z.MONTHLY:i.bymonthday=i.dtstart.getUTCDate();break;case z.WEEKLY:i.byweekday=[be(i.dtstart)]}if(J(i.bymonth)&&!ee(i.bymonth)&&(i.bymonth=[i.bymonth]),J(i.byyearday)&&!ee(i.byyearday)&&ie(i.byyearday)&&(i.byyearday=[i.byyearday]),J(i.bymonthday))if(ee(i.bymonthday)){var n=[],s=[];for(t=0;t<i.bymonthday.length;t++){var a;(a=i.bymonthday[t])>0?n.push(a):a<0&&s.push(a)}i.bymonthday=n,i.bynmonthday=s}else i.bymonthday<0?(i.bynmonthday=[i.bymonthday],i.bymonthday=[]):(i.bynmonthday=[],i.bymonthday=[i.bymonthday]);else i.bymonthday=[],i.bynmonthday=[];if(J(i.byweekno)&&!ee(i.byweekno)&&(i.byweekno=[i.byweekno]),J(i.byweekday))if(ie(i.byweekday))i.byweekday=[i.byweekday],i.bynweekday=null;else if(nt(i.byweekday))i.byweekday=[Z.fromStr(i.byweekday).weekday],i.bynweekday=null;else if(i.byweekday instanceof Z)!i.byweekday.n||i.freq>z.MONTHLY?(i.byweekday=[i.byweekday.weekday],i.bynweekday=null):(i.bynweekday=[[i.byweekday.weekday,i.byweekday.n]],i.byweekday=null);else{var o=[],_=[];for(t=0;t<i.byweekday.length;t++){var r=i.byweekday[t];ie(r)?o.push(r):nt(r)?o.push(Z.fromStr(r).weekday):!r.n||i.freq>z.MONTHLY?o.push(r.weekday):_.push([r.weekday,r.n])}i.byweekday=K(o)?o:null,i.bynweekday=K(_)?_:null}else i.bynweekday=null;return J(i.byhour)?ie(i.byhour)&&(i.byhour=[i.byhour]):i.byhour=i.freq<z.HOURLY?[i.dtstart.getUTCHours()]:null,J(i.byminute)?ie(i.byminute)&&(i.byminute=[i.byminute]):i.byminute=i.freq<z.MINUTELY?[i.dtstart.getUTCMinutes()]:null,J(i.bysecond)?ie(i.bysecond)&&(i.bysecond=[i.bysecond]):i.bysecond=i.freq<z.SECONDLY?[i.dtstart.getUTCSeconds()]:null,{parsedOptions:i}}function Ve(e){var i=e.split(`
38`).map(ya).filter(function(t){return t!==null});return te(te({},i[0]),i[1])}function Te(e){var i={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(e);if(!t)return i;var n=t[1],s=t[2];return n&&(i.tzid=n),i.dtstart=Re(s),i}function ya(e){if(!(e=e.replace(/^\s+|\s+$/,"")).length)return null;var i=/^([A-Z]+?)[:;]/.exec(e.toUpperCase());if(!i)return gt(e);var t=i[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return gt(e);case"DTSTART":return Te(e);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(e))}}function gt(e){var i=Te(e.replace(/^RRULE:/i,""));return e.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach(function(t){var n=t.split("="),s=n[0],a=n[1];switch(s.toUpperCase()){case"FREQ":i.freq=V[a.toUpperCase()];break;case"WKST":i.wkst=re[a.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var o=function(d){return d.indexOf(",")!==-1?d.split(",").map(mt):mt(d)}(a),_=s.toLowerCase();i[_]=o;break;case"BYWEEKDAY":case"BYDAY":i.byweekday=function(d){var l=d.split(",");return l.map(function(h){if(h.length===2)return re[h];var p=h.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!p||p.length<3)throw new SyntaxError("Invalid weekday string: ".concat(h));var v=Number(p[1]),g=p[2],c=re[g].weekday;return new Z(c,v)})}(a);break;case"DTSTART":case"TZID":var r=Te(e);i.tzid=r.tzid,i.dtstart=r.dtstart;break;case"UNTIL":i.until=Re(a);break;case"BYEASTER":i.byeaster=Number(a);break;default:throw new Error("Unknown RRULE property '"+s+"'")}}),i}function mt(e){return/^[+-]?\d+$/.test(e)?Number(e):e}var Ae=function(){function e(i,t){if(isNaN(i.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=i,this.tzid=t}return Object.defineProperty(e.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var i=Ie(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(i):";TZID=".concat(this.tzid,":").concat(i)},e.prototype.getTime=function(){return this.date.getTime()},e.prototype.rezonedDate=function(){return this.isUTC?this.date:(i=this.date,t=this.tzid,n=Intl.DateTimeFormat().resolvedOptions().timeZone,s=new Date(ct(i,n)),a=new Date(ct(i,t??"UTC")).getTime()-s.getTime(),new Date(i.getTime()-a));var i,t,n,s,a},e}();function Fe(e){for(var i=[],t="",n=Object.keys(e),s=Object.keys(Be),a=0;a<n.length;a++)if(n[a]!=="tzid"&&F(s,n[a])){var o=n[a].toUpperCase(),_=e[n[a]],r="";if(J(_)&&(!ee(_)||_.length)){switch(o){case"FREQ":r=z.FREQUENCIES[e.freq];break;case"WKST":r=ie(_)?new Z(_).toString():_.toString();break;case"BYWEEKDAY":o="BYDAY",r=da(_).map(function(v){return v instanceof Z?v:ee(v)?new Z(v[0],v[1]):new Z(v)}).toString();break;case"DTSTART":t=ba(_,e.tzid);break;case"UNTIL":r=Ie(_,!e.tzid);break;default:if(ee(_)){for(var d=[],l=0;l<_.length;l++)d[l]=String(_[l]);r=d.toString()}else r=String(_)}r&&i.push([o,r])}}var h=i.map(function(v){var g=v[0],c=v[1];return"".concat(g,"=").concat(c.toString())}).join(";"),p="";return h!==""&&(p="RRULE:".concat(h)),[t,p].filter(function(v){return!!v}).join(`
39`)}function ba(e,i){return e?"DTSTART"+new Ae(new Date(e),i).toString():""}function xa(e,i){return Array.isArray(e)?!!Array.isArray(i)&&e.length===i.length&&e.every(function(t,n){return t.getTime()===i[n].getTime()}):e instanceof Date?i instanceof Date&&e.getTime()===i.getTime():e===i}var wa=function(){function e(){this.all=!1,this.before=[],this.after=[],this.between=[]}return e.prototype._cacheAdd=function(i,t,n){t&&(t=t instanceof Date?je(t):lt(t)),i==="all"?this.all=t:(n._value=t,this[i].push(n))},e.prototype._cacheGet=function(i,t){var n=!1,s=t?Object.keys(t):[],a=function(l){for(var h=0;h<s.length;h++){var p=s[h];if(!xa(t[p],l[p]))return!0}return!1},o=this[i];if(i==="all")n=this.all;else if(ee(o))for(var _=0;_<o.length;_++){var r=o[_];if(!s.length||!a(r)){n=r._value;break}}if(!n&&this.all){var d=new xe(i,t);for(_=0;_<this.all.length&&d.accept(this.all[_]);_++);n=d.getValue(),this._cacheAdd(i,n,t)}return ee(n)?lt(n):n instanceof Date?je(n):n},e}(),ka=q(q(q(q(q(q(q(q(q(q(q(q(q([],Y(1,31),!0),Y(2,28),!0),Y(3,31),!0),Y(4,30),!0),Y(5,31),!0),Y(6,30),!0),Y(7,31),!0),Y(8,31),!0),Y(9,30),!0),Y(10,31),!0),Y(11,30),!0),Y(12,31),!0),Y(1,7),!0),Ea=q(q(q(q(q(q(q(q(q(q(q(q(q([],Y(1,31),!0),Y(2,29),!0),Y(3,31),!0),Y(4,30),!0),Y(5,31),!0),Y(6,30),!0),Y(7,31),!0),Y(8,31),!0),Y(9,30),!0),Y(10,31),!0),Y(11,30),!0),Y(12,31),!0),Y(1,7),!0),Da=oe(1,29),Sa=oe(1,30),ue=oe(1,31),G=oe(1,32),Ma=q(q(q(q(q(q(q(q(q(q(q(q(q([],G,!0),Sa,!0),G,!0),ue,!0),G,!0),ue,!0),G,!0),G,!0),ue,!0),G,!0),ue,!0),G,!0),G.slice(0,7),!0),Na=q(q(q(q(q(q(q(q(q(q(q(q(q([],G,!0),Da,!0),G,!0),ue,!0),G,!0),ue,!0),G,!0),G,!0),ue,!0),G,!0),ue,!0),G,!0),G.slice(0,7),!0),Ta=oe(-28,0),Aa=oe(-29,0),fe=oe(-30,0),X=oe(-31,0),Ca=q(q(q(q(q(q(q(q(q(q(q(q(q([],X,!0),Aa,!0),X,!0),fe,!0),X,!0),fe,!0),X,!0),X,!0),fe,!0),X,!0),fe,!0),X,!0),X.slice(0,7),!0),Oa=q(q(q(q(q(q(q(q(q(q(q(q(q([],X,!0),Ta,!0),X,!0),fe,!0),X,!0),fe,!0),X,!0),X,!0),fe,!0),X,!0),fe,!0),X,!0),X.slice(0,7),!0),La=[0,31,60,91,121,152,182,213,244,274,305,335,366],$a=[0,31,59,90,120,151,181,212,243,273,304,334,365],vt=function(){for(var e=[],i=0;i<55;i++)e=e.concat(oe(7));return e}();function Ha(e,i){var t,n,s=ge(e,1,1),a=ke(e)?366:365,o=ke(e+1)?366:365,_=qe(s),r=be(s),d=te(te({yearlen:a,nextyearlen:o,yearordinal:_,yearweekday:r},function(N){var m=ke(N)?366:365,x=ge(N,1,1),b=be(x);return m===365?{mmask:ka,mdaymask:Na,nmdaymask:Oa,wdaymask:vt.slice(b),mrange:$a}:{mmask:Ea,mdaymask:Ma,nmdaymask:Ca,wdaymask:vt.slice(b),mrange:La}}(e)),{wnomask:null});if(se(i.byweekno))return d;d.wnomask=Y(0,a+7);var l=t=ae(7-r+i.wkst,7);l>=4?(l=0,n=d.yearlen+ae(r-i.wkst,7)):n=a-l;for(var h=Math.floor(n/7),p=ae(n,7),v=Math.floor(h+p/4),g=0;g<i.byweekno.length;g++){var c=i.byweekno[g];if(c<0&&(c+=v+1),c>0&&c<=v){var u=void 0;c>1?(u=l+7*(c-1),l!==t&&(u-=7-t)):u=l;for(var f=0;f<7&&(d.wnomask[u]=1,u++,d.wdaymask[u]!==i.wkst);f++);}}if(F(i.byweekno,1)&&(u=l+7*v,l!==t&&(u-=7-t),u<a))for(g=0;g<7&&(d.wnomask[u]=1,u+=1,d.wdaymask[u]!==i.wkst);g++);if(l){var y=void 0;if(F(i.byweekno,-1))y=-1;else{var w=be(ge(e-1,1,1)),D=ae(7-w.valueOf()+i.wkst,7),M=ke(e-1)?366:365,k=void 0;D>=4?(D=0,k=M+ae(w-i.wkst,7)):k=a-l,y=Math.floor(52+ae(k,7)/4)}if(F(i.byweekno,y))for(u=0;u<l;u++)d.wnomask[u]=1}return d}var za=function(){function e(i){this.options=i}return e.prototype.rebuild=function(i,t){var n=this.options;if(i!==this.lastyear&&(this.yearinfo=Ha(i,n)),K(n.bynweekday)&&(t!==this.lastmonth||i!==this.lastyear)){var s=this.yearinfo,a=s.yearlen,o=s.mrange,_=s.wdaymask;this.monthinfo=function(r,d,l,h,p,v){var g={lastyear:r,lastmonth:d,nwdaymask:[]},c=[];if(v.freq===z.YEARLY)if(se(v.bymonth))c=[[0,l]];else for(var u=0;u<v.bymonth.length;u++)d=v.bymonth[u],c.push(h.slice(d-1,d+1));else v.freq===z.MONTHLY&&(c=[h.slice(d-1,d+1)]);if(se(c))return g;for(g.nwdaymask=Y(0,l),u=0;u<c.length;u++)for(var f=c[u],y=f[0],w=f[1]-1,D=0;D<v.bynweekday.length;D++){var M=void 0,k=v.bynweekday[D],N=k[0],m=k[1];m<0?(M=w+7*(m+1),M-=ae(p[M]-N,7)):(M=y+7*(m-1),M+=ae(7-p[M]+N,7)),y<=M&&M<=w&&(g.nwdaymask[M]=1)}return g}(i,t,a,o,_,n)}J(n.byeaster)&&(this.eastermask=function(r,d){d===void 0&&(d=0);var l=r%19,h=Math.floor(r/100),p=r%100,v=Math.floor(h/4),g=h%4,c=Math.floor((h+8)/25),u=Math.floor((h-c+1)/3),f=Math.floor(19*l+h-v-u+15)%30,y=Math.floor(p/4),w=p%4,D=Math.floor(32+2*g+2*y-f-w)%7,M=Math.floor((l+11*f+22*D)/451),k=Math.floor((f+D-7*M+114)/31),N=(f+D-7*M+114)%31+1,m=Date.UTC(r,k-1,N+d),x=Date.UTC(r,0,1);return[Math.ceil((m-x)/864e5)]}(i,n.byeaster))},Object.defineProperty(e.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),e.prototype.ydayset=function(){return[oe(this.yearlen),0,this.yearlen]},e.prototype.mdayset=function(i,t){for(var n=this.mrange[t-1],s=this.mrange[t],a=Y(null,this.yearlen),o=n;o<s;o++)a[o]=o;return[a,n,s]},e.prototype.wdayset=function(i,t,n){for(var s=Y(null,this.yearlen+7),a=qe(ge(i,t,n))-this.yearordinal,o=a,_=0;_<7&&(s[a]=a,++a,this.wdaymask[a]!==this.options.wkst);_++);return[s,o,a]},e.prototype.ddayset=function(i,t,n){var s=Y(null,this.yearlen),a=qe(ge(i,t,n))-this.yearordinal;return s[a]=a,[s,a,a+1]},e.prototype.htimeset=function(i,t,n,s){var a=this,o=[];return this.options.byminute.forEach(function(_){o=o.concat(a.mtimeset(i,_,n,s))}),De(o),o},e.prototype.mtimeset=function(i,t,n,s){var a=this.options.bysecond.map(function(o){return new Ne(i,t,o,s)});return De(a),a},e.prototype.stimeset=function(i,t,n,s){return[new Ne(i,t,n,s)]},e.prototype.getdayset=function(i){switch(i){case V.YEARLY:return this.ydayset.bind(this);case V.MONTHLY:return this.mdayset.bind(this);case V.WEEKLY:return this.wdayset.bind(this);case V.DAILY:default:return this.ddayset.bind(this)}},e.prototype.gettimeset=function(i){switch(i){case V.HOURLY:return this.htimeset.bind(this);case V.MINUTELY:return this.mtimeset.bind(this);case V.SECONDLY:return this.stimeset.bind(this)}},e}();function qa(e,i,t,n,s,a){for(var o=[],_=0;_<e.length;_++){var r=void 0,d=void 0,l=e[_];l<0?(r=Math.floor(l/i.length),d=ae(l,i.length)):(r=Math.floor((l-1)/i.length),d=ae(l-1,i.length));for(var h=[],p=t;p<n;p++){var v=a[p];J(v)&&h.push(v)}var g=void 0;g=r<0?h.slice(r)[0]:h[r];var c=i[d],u=st(s.yearordinal+g),f=_t(u,c);F(o,f)||o.push(f)}return De(o),o}function yt(e,i){var t=i.dtstart,n=i.freq,s=i.interval,a=i.until,o=i.bysetpos,_=i.count;if(_===0||s===0)return _e(e);var r=ma.fromDate(t),d=new za(i);d.rebuild(r.year,r.month);for(var l=function(m,x,b){var E=b.freq,S=b.byhour,T=b.byminute,A=b.bysecond;return Ye(E)?function(C){var $=C.dtstart.getTime()%1e3;if(!Ye(C.freq))return[];var H=[];return C.byhour.forEach(function(O){C.byminute.forEach(function(R){C.bysecond.forEach(function(P){H.push(new Ne(O,R,P,$))})})}),H}(b):E>=z.HOURLY&&K(S)&&!F(S,x.hour)||E>=z.MINUTELY&&K(T)&&!F(T,x.minute)||E>=z.SECONDLY&&K(A)&&!F(A,x.second)?[]:m.gettimeset(E)(x.hour,x.minute,x.second,x.millisecond)}(d,r,i);;){var h=d.getdayset(n)(r.year,r.month,r.day),p=h[0],v=h[1],g=h[2],c=Ia(p,v,g,d,i);if(K(o))for(var u=qa(o,l,v,g,d,p),f=0;f<u.length;f++){var y=u[f];if(a&&y>a)return _e(e);if(y>=t){var w=bt(y,i);if(!e.accept(w)||_&&!--_)return _e(e)}}else for(f=v;f<g;f++){var D=p[f];if(J(D))for(var M=st(d.yearordinal+D),k=0;k<l.length;k++){var N=l[k];if(y=_t(M,N),a&&y>a||y>=t&&(w=bt(y,i),!e.accept(w)||_&&!--_))return _e(e)}}if(i.interval===0||(r.add(i,c),r.year>9999))return _e(e);Ye(n)||(l=d.gettimeset(n)(r.hour,r.minute,r.second,0)),d.rebuild(r.year,r.month)}}function ja(e,i,t){var n=t.bymonth,s=t.byweekno,a=t.byweekday,o=t.byeaster,_=t.bymonthday,r=t.bynmonthday,d=t.byyearday;return K(n)&&!F(n,e.mmask[i])||K(s)&&!e.wnomask[i]||K(a)&&!F(a,e.wdaymask[i])||K(e.nwdaymask)&&!e.nwdaymask[i]||o!==null&&!F(e.eastermask,i)||(K(_)||K(r))&&!F(_,e.mdaymask[i])&&!F(r,e.nmdaymask[i])||K(d)&&(i<e.yearlen&&!F(d,i+1)&&!F(d,-e.yearlen+i)||i>=e.yearlen&&!F(d,i+1-e.yearlen)&&!F(d,-e.nextyearlen+i-e.yearlen))}function bt(e,i){return new Ae(e,i.tzid).rezonedDate()}function _e(e){return e.getValue()}function Ia(e,i,t,n,s){for(var a=!1,o=i;o<t;o++){var _=e[o];(a=ja(n,_,s))&&(e[_]=null)}return a}var re={MO:new Z(0),TU:new Z(1),WE:new Z(2),TH:new Z(3),FR:new Z(4),SA:new Z(5),SU:new Z(6)},Be={freq:V.YEARLY,dtstart:null,interval:1,wkst:re.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Ra=Object.keys(Be),z=function(){function e(i,t){i===void 0&&(i={}),t===void 0&&(t=!1),this._cache=t?null:new wa,this.origOptions=pt(i);var n=va(i).parsedOptions;this.options=n}return e.parseText=function(i,t){return ft(i,t)},e.fromText=function(i,t){return pa(i,t)},e.fromString=function(i){return new e(e.parseString(i)||void 0)},e.prototype._iter=function(i){return yt(i,this.options)},e.prototype._cacheGet=function(i,t){return!!this._cache&&this._cache._cacheGet(i,t)},e.prototype._cacheAdd=function(i,t,n){if(this._cache)return this._cache._cacheAdd(i,t,n)},e.prototype.all=function(i){if(i)return this._iter(new ht("all",{},i));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new xe("all",{})),this._cacheAdd("all",t)),t},e.prototype.between=function(i,t,n,s){if(n===void 0&&(n=!1),!Ee(i)||!Ee(t))throw new Error("Invalid date passed in to RRule.between");var a={before:t,after:i,inc:n};if(s)return this._iter(new ht("between",a,s));var o=this._cacheGet("between",a);return o===!1&&(o=this._iter(new xe("between",a)),this._cacheAdd("between",o,a)),o},e.prototype.before=function(i,t){if(t===void 0&&(t=!1),!Ee(i))throw new Error("Invalid date passed in to RRule.before");var n={dt:i,inc:t},s=this._cacheGet("before",n);return s===!1&&(s=this._iter(new xe("before",n)),this._cacheAdd("before",s,n)),s},e.prototype.after=function(i,t){if(t===void 0&&(t=!1),!Ee(i))throw new Error("Invalid date passed in to RRule.after");var n={dt:i,inc:t},s=this._cacheGet("after",n);return s===!1&&(s=this._iter(new xe("after",n)),this._cacheAdd("after",s,n)),s},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return Fe(this.origOptions)},e.prototype.toText=function(i,t,n){return function(s,a,o,_){return new de(s,a,o,_).toString()}(this,i,t,n)},e.prototype.isFullyConvertibleToText=function(){return ga(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=V.YEARLY,e.MONTHLY=V.MONTHLY,e.WEEKLY=V.WEEKLY,e.DAILY=V.DAILY,e.HOURLY=V.HOURLY,e.MINUTELY=V.MINUTELY,e.SECONDLY=V.SECONDLY,e.MO=re.MO,e.TU=re.TU,e.WE=re.WE,e.TH=re.TH,e.FR=re.FR,e.SA=re.SA,e.SU=re.SU,e.parseString=Ve,e.optionsToString=Fe,e}(),xt={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function Pa(e,i){var t=[],n=[],s=[],a=[],o=Te(e),_=o.dtstart,r=o.tzid,d=function(l,h){if(h===void 0&&(h=!1),l=l&&l.trim(),!l)throw new Error("Invalid empty string");if(!h)return l.split(/\s/);for(var p=l.split(`
40`),v=0;v<p.length;){var g=p[v]=p[v].replace(/\s+$/g,"");g?v>0&&g[0]===" "?(p[v-1]+=g.slice(1),p.splice(v,1)):v+=1:p.splice(v,1)}return p}(e,i.unfold);return d.forEach(function(l){var h;if(l){var p=function(f){var y=function(k){if(k.indexOf(":")===-1)return{name:"RRULE",value:k};var N=(b=k,E=":",S=1,T=b.split(E),S?T.slice(0,S).concat([T.slice(S).join(E)]):T),m=N[0],x=N[1],b,E,S,T;return{name:m,value:x}}(f),w=y.name,D=y.value,M=w.split(";");if(!M)throw new Error("empty property name");return{name:M[0].toUpperCase(),parms:M.slice(1),value:D}}(l),v=p.name,g=p.parms,c=p.value;switch(v.toUpperCase()){case"RRULE":if(g.length)throw new Error("unsupported RRULE parm: ".concat(g.join(",")));t.push(Ve(l));break;case"RDATE":var u=((h=/RDATE(?:;TZID=([^:=]+))?/i.exec(l))!==null&&h!==void 0?h:[])[1];u&&!r&&(r=u),n=n.concat(wt(c,g));break;case"EXRULE":if(g.length)throw new Error("unsupported EXRULE parm: ".concat(g.join(",")));s.push(Ve(c));break;case"EXDATE":a=a.concat(wt(c,g));break;case"DTSTART":break;default:throw new Error("unsupported property: "+v)}}}),{dtstart:_,tzid:r,rrulevals:t,rdatevals:n,exrulevals:s,exdatevals:a}}function me(e,i){return i===void 0&&(i={}),function(t,n){var s=Pa(t,n),a=s.rrulevals,o=s.rdatevals,_=s.exrulevals,r=s.exdatevals,d=s.dtstart,l=s.tzid,h=n.cache===!1;if(n.compatible&&(n.forceset=!0,n.unfold=!0),n.forceset||a.length>1||o.length||_.length||r.length){var p=new Ua(h);return p.dtstart(d),p.tzid(l||void 0),a.forEach(function(g){p.rrule(new z(Je(g,d,l),h))}),o.forEach(function(g){p.rdate(g)}),_.forEach(function(g){p.exrule(new z(Je(g,d,l),h))}),r.forEach(function(g){p.exdate(g)}),n.compatible&&n.dtstart&&p.rdate(d),p}var v=a[0]||{};return new z(Je(v,v.dtstart||n.dtstart||d,v.tzid||n.tzid||l),h)}(e,function(t){var n=[],s=Object.keys(t),a=Object.keys(xt);if(s.forEach(function(o){F(a,o)||n.push(o)}),n.length)throw new Error("Invalid options: "+n.join(", "));return te(te({},xt),t)}(i))}function Je(e,i,t){return te(te({},e),{dtstart:i,tzid:t})}function wt(e,i){return function(t){t.forEach(function(n){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(n))throw new Error("unsupported RDATE/EXDATE parm: "+n)})}(i),e.split(",").map(function(t){return Re(t)})}function kt(e){var i=this;return function(t){if(t!==void 0&&(i["_".concat(e)]=t),i["_".concat(e)]!==void 0)return i["_".concat(e)];for(var n=0;n<i._rrule.length;n++){var s=i._rrule[n].origOptions[e];if(s)return s}}}var Ua=function(e){function i(t){t===void 0&&(t=!1);var n=e.call(this,{},t)||this;return n.dtstart=kt.apply(n,["dtstart"]),n.tzid=kt.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return Ue(i,e),i.prototype._iter=function(t){return function(n,s,a,o,_,r){var d={},l=n.accept;function h(c,u){a.forEach(function(f){f.between(c,u,!0).forEach(function(y){d[Number(y)]=!0})})}_.forEach(function(c){var u=new Ae(c,r).rezonedDate();d[Number(u)]=!0}),n.accept=function(c){var u=Number(c);return isNaN(u)?l.call(this,c):!(!d[u]&&(h(new Date(u-1),new Date(u+1)),!d[u]))||(d[u]=!0,l.call(this,c))},n.method==="between"&&(h(n.args.after,n.args.before),n.accept=function(c){var u=Number(c);return!!d[u]||(d[u]=!0,l.call(this,c))});for(var p=0;p<o.length;p++){var v=new Ae(o[p],r).rezonedDate();if(!n.accept(new Date(v.getTime())))break}s.forEach(function(c){yt(n,c.options)});var g=n._result;switch(De(g),n.method){case"all":case"between":return g;case"before":return g.length&&g[g.length-1]||null;default:return g.length&&g[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},i.prototype.rrule=function(t){Et(t,this._rrule)},i.prototype.exrule=function(t){Et(t,this._exrule)},i.prototype.rdate=function(t){Dt(t,this._rdate)},i.prototype.exdate=function(t){Dt(t,this._exdate)},i.prototype.rrules=function(){return this._rrule.map(function(t){return me(t.toString())})},i.prototype.exrules=function(){return this._exrule.map(function(t){return me(t.toString())})},i.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},i.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},i.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(Fe({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`

Callers 4

zeFunction · 0.85
dhtmlxscheduler.jsFile · 0.85
HaFunction · 0.85
qaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected