diff --git a/README.md b/README.md index 4dd5dcd..d7eff4c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # dhtmlxScheduler # [![dhtmlx.com](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/) -[![npm: v.6.0.4](https://img.shields.io/badge/npm-v.6.0.4-blue.svg)](https://www.npmjs.com/package/dhtmlx-scheduler) +[![npm: v.6.0.5](https://img.shields.io/badge/npm-v.6.0.5-blue.svg)](https://www.npmjs.com/package/dhtmlx-scheduler) [![License: GPL v2](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) [DHTMLX Scheduler](https://dhtmlx.com/docs/products/dhtmlxScheduler) is a JavaScript library that allows you to add a Google-like scheduler to your web app or website. @@ -87,7 +87,7 @@ scheduler.parse([ ## License ## -dhtmlxScheduler v.6.0.4 Standard +dhtmlxScheduler v.6.0.5 Standard To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Individual, Commercial, Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at info@dhtmlx.com diff --git a/bower.json b/bower.json index bf9ba19..b53eed0 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "scheduler", - "version": "6.0.4", + "version": "6.0.5", "homepage": "https://dhtmlx.com/docs/products/dhtmlxScheduler/", "description": "JavaScript event calendar. Allows to manage events and appointments in different views", "main": [ diff --git a/codebase/dhtmlxscheduler.css b/codebase/dhtmlxscheduler.css index cefba68..d0d0cf1 100644 --- a/codebase/dhtmlxscheduler.css +++ b/codebase/dhtmlxscheduler.css @@ -1,7 +1,7 @@ /*! * @license * - * dhtmlxScheduler v.6.0.4 Standard + * dhtmlxScheduler v.6.0.5 Standard * * To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com * diff --git a/codebase/dhtmlxscheduler.d.ts b/codebase/dhtmlxscheduler.d.ts index 6f16058..5dc99ca 100644 --- a/codebase/dhtmlxscheduler.d.ts +++ b/codebase/dhtmlxscheduler.d.ts @@ -5,7 +5,90 @@ type SchedulerCallback = (...args: any[]) => any; type SchedulerFilterCallback = { (id: string | number, event: any): boolean } -type SchedulerEventName = "onAfterEventDisplay"|"onAfterFolderToggle"|"onAfterLightbox"|"onAfterQuickInfo"|"onAfterSchedulerResize"|"onBeforeCollapse"|"onBeforeDrag"|"onBeforeEventChanged"|"onBeforeEventCreated"|"onBeforeEventDelete"|"onBeforeEventDisplay"|"onBeforeEventDragIn"|"onBeforeEventDragOut"|"onBeforeEventPasted"|"onBeforeExpand"|"onBeforeExternalDragIn"|"onBeforeFolderToggle"|"onBeforeLightbox"|"onBeforeParse"|"onBeforeTodayDisplayed"|"onBeforeTooltip"|"onBeforeViewChange"|"onCellClick"|"onCellDblClick"|"onClearAll"|"onClick"|"onCollapse"|"onConfirmedBeforeEventDelete"|"onContextMenu"|"onDataRender"|"onDblClick"|"onDestroy"|"onDragEnd"|"onEmptyClick"|"onError"|"onEventAdded"|"onEventCancel"|"onEventChanged"|"onEventCollision"|"onEventCopied"|"onEventCreated"|"onEventCut"|"onEventDeleted"|"onEventDrag"|"onEventDragIn"|"onEventDragOut"|"onEventDropOut"|"onEventIdChange"|"onEventLoading"|"onEventPasted"|"onEventSave"|"onEventSelected"|"onEventUnselected"|"onExpand"|"onExternalDragIn"|"onLightbox"|"onLightboxButton"|"onLimitViolation"|"onLoadEnd"|"onLoadError"|"onLoadStart"|"onLocationError"|"onMouseDown"|"onMouseMove"|"onOptionsLoad"|"onOptionsLoadFinal"|"onOptionsLoadStart"|"onParse"|"onQuickInfo"|"onSaveError"|"onScaleAdd"|"onScaleDblClick"|"onSchedulerReady"|"onSchedulerResize"|"onTemplatesReady"|"onTimelineCreated"|"onViewChange"|"onViewMoreClick"|"onXLE"|"onXLS"|"onXScaleClick"|"onXScaleDblClick"|"onYScaleClick"|"onYScaleDblClick"; +type SchedulerEventName = "onAfterEventDisplay" | + "onAfterFolderToggle" | + "onAfterLightbox" | + "onAfterQuickInfo" | + "onAfterSchedulerResize" | + "onBeforeCollapse" | + "onBeforeDrag" | + "onBeforeEventChanged" | + "onBeforeEventCreated" | + "onBeforeEventDelete" | + "onBeforeEventDisplay" | + "onBeforeEventDragIn" | + "onBeforeEventDragOut" | + "onBeforeEventPasted" | + "onBeforeExpand" | + "onBeforeExternalDragIn" | + "onBeforeFolderToggle" | + "onBeforeLightbox" | + "onBeforeParse" | + "onBeforeTodayDisplayed" | + "onBeforeTooltip" | + "onBeforeViewChange" | + "onCellClick" | + "onCellDblClick" | + "onClearAll" | + "onClick" | + "onCollapse" | + "onConfirmedBeforeEventDelete" | + "onContextMenu" | + "onDataRender" | + "onDblClick" | + "onDestroy" | + "onDragEnd" | + "onEmptyClick" | + "onError" | + "onEventAdded" | + "onEventCancel" | + "onEventChanged" | + "onEventCollision" | + "onEventCopied" | + "onEventCreated" | + "onEventCut" | + "onEventDeleted" | + "onEventDrag" | + "onEventDragIn" | + "onEventDragOut" | + "onEventDropOut" | + "onEventIdChange" | + "onEventLoading" | + "onEventPasted" | + "onEventSave" | + "onEventSelected" | + "onEventUnselected" | + "onExpand" | + "onExternalDragIn" | + "onLightbox" | + "onLightboxButton" | + "onLimitViolation" | + "onLoadEnd" | + "onLoadError" | + "onLoadStart" | + "onLocationError" | + "onMouseDown" | + "onMouseMove" | + "onOptionsLoad" | + "onOptionsLoadFinal" | + "onOptionsLoadStart" | + "onParse" | + "onQuickInfo" | + "onSaveError" | + "onScaleAdd" | + "onScaleDblClick" | + "onSchedulerReady" | + "onSchedulerResize" | + "onTemplatesReady" | + "onTimelineCreated" | + "onViewChange" | + "onViewMoreClick" | + "onXLE" | + "onXLS" | + "onXScaleClick" | + "onXScaleDblClick" | + "onYScaleClick" | + "onYScaleDblClick"; export interface SchedulerTemplates { @@ -358,6 +441,13 @@ export interface SchedulerTemplates { */ grid_date(start: Date, end: Date): string; + /** + * specifies the text in the columns + * @param field_name the column's id + * @param event the event object + */ + grid_field(field_name: string, event: any): string; + /** * specifies the format of dates in columns with id='date' * @param start the date when an event is scheduled to begin @@ -373,11 +463,12 @@ export interface SchedulerTemplates { grid_single_date(date: Date): string; /** - * specifies the text in the columns - * @param field_name the column's id - * @param event the event object + * specifies the CSS class that will be applied to a cell of the view + * @param evs an array of objects of events contained in a cell (defined only in the 'cell' mode) + * @param date the date of a column + * @param section the section object */ - grid_field(field_name: string, event: any): string; + timeline_cell_class(evs: any[], date: Date, section: any): string; /** * specifies the number of scheduled events in a cell of the view @@ -388,32 +479,24 @@ export interface SchedulerTemplates { timeline_cell_value(evs: any[], date: Date, section: any): string; /** - * specifies the CSS class that will be applied to a cell of the view - * @param evs an array of objects of events contained in a cell (defined only in the 'cell' mode) - * @param date the date of a column - * @param section the section object + * specifies the date in the header of the view + * @param date1 the date when an event is scheduled to begin + * @param date2 the date when an event is scheduled to be completed */ - timeline_cell_class(evs: any[], date: Date, section: any): string; + timeline_date(date1: Date, date2: Date): string; /** - * specifies the name of a CSS class that will be applied to items of the X-Axis - * @param date the date which needs formatting + * specifies the CSS class that will be applied to a row of the Timeline view + * @param section the section object + * @param timeline the timeline object */ - timeline_scalex_class(date: Date): string; + timeline_row_class(section: any, timeline: any): string; /** - * specifies the name of a CSS class that will be applied to items of the second X-Axis + * specifies items of the X-Axis * @param date the date which needs formatting */ - timeline_second_scalex_class(date: Date): string; - - /** - * specifies the name of a CSS class that will be applied to items of the Y-Axis - * @param key the section's id - * @param label the section's label - * @param section the section object that contains the 'key' and 'label' properties - */ - timeline_scaley_class(key: string, label: string, section: any): string; + timeline_scale_date(date: Date): string; /** * specifies items of the Y-Axis @@ -424,31 +507,38 @@ export interface SchedulerTemplates { timeline_scale_label(key: string, label: string, section: any): string; /** - * specifies the tooltip over a day cell containing some scheduled event(s) - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object + * specifies the name of a CSS class that will be applied to items of the X-Axis + * @param date the date which needs formatting */ - timeline_tooltip(start: Date, end: Date, event: any): string; + timeline_scalex_class(date: Date): string; /** - * specifies the date in the header of the view - * @param date1 the date when an event is scheduled to begin - * @param date2 the date when an event is scheduled to be completed + * specifies the name of a CSS class that will be applied to items of the Y-Axis + * @param key the section's id + * @param label the section's label + * @param section the section object that contains the 'key' and 'label' properties */ - timeline_date(date1: Date, date2: Date): string; + timeline_scaley_class(key: string, label: string, section: any): string; /** - * specifies items of the X-Axis + * specifies items of the second X-Axis * @param date the date which needs formatting */ - timeline_scale_date(date: Date): string; + timeline_second_scale_date(date: Date): string; /** - * specifies items of the second X-Axis + * specifies the name of a CSS class that will be applied to items of the second X-Axis * @param date the date which needs formatting */ - timeline_second_scale_date(date: Date): string; + timeline_second_scalex_class(date: Date): string; + + /** + * specifies the tooltip over a day cell containing some scheduled event(s) + * @param start the date when an event is scheduled to begin + * @param end the date when an event is scheduled to be completed + * @param event the event object + */ + timeline_tooltip(start: Date, end: Date, event: any): string; /** * specifies the date in the header of the view @@ -477,13 +567,6 @@ export interface SchedulerTemplates { */ xml_format(date: Date): string; - /** - * specifies the CSS class that will be applied to a row of the Timeline view - * @param section the section object - * @param timeline the timeline object - */ - timeline_row_class(section: any, timeline: any): string; - [customTemplate: string]: any; } @@ -995,7 +1078,7 @@ export interface SchedulerConfigOptions { scroll_hour: number; /** - * specifies the delimiter that will be used to separate several sections/units in the related data property of the event + * specifies the delimeter that will be used to separate several sections/units in the related data property of the event */ section_delimiter: string; @@ -1224,6 +1307,50 @@ export interface SchedulerLocale { labels: SchedulerLocaleLabels; } +export interface SchedulerFormBlock { + + /** + * Renders the form block based on the provided configuration. + * @function + * @name SchedulerFormBlock#render + * @param {any} config - The configuration object for the custom lightbox control. + * @returns {string} Returns the HTML string representing the rendered the custom control. + */ + render: (config: any) => string; + + /** + * Sets the value of the custom lightbox control. + * @function + * @name SchedulerFormBlock#set_value + * @param {HTMLElement} node - HTML object related to HTML defined above. + * @param {*} value - value defined by map_to property. + * @param {Event} ev - The event object. + * @param {any} config - Section configuration object. + * @returns {void} + */ + set_value: (node: HTMLElement, value: any, ev: Event, config: any) => void; + + /** + * Gets the value of the custom control. + * @function + * @name SchedulerFormBlock#get_value + * @param {HTMLElement} node - HTML object related to HTML defined above. + * @param {Event} ev - The event object. + * @param {any} config - Section configuration object. + * @returns {*} Returns the value of the custom lightbox control. + */ + get_value: (node: HTMLElement, ev: Event, config: any) => any; + + /** + * Focuses on the custom lightbox control. + * @function + * @name SchedulerFormBlock#focus + * @param {HTMLElement} node - HTML object related to HTML defined above. + * @returns {void} + */ + focus: (node: HTMLElement) => void; + } + export interface SchedulerSizes { /** @@ -1440,9 +1567,9 @@ export interface SchedulerStatic { * attaches the handler to an inner event of dhtmlxScheduler * @param name the event's name, case-insensitive * @param handler the handler function - * @param settings optional, an object with settings for the event handler + * @param settings optional, optional, an object with settings for the event handler */ - attachEvent(name: SchedulerEventName, handler: SchedulerCallback, settings: any): string; + attachEvent(name: SchedulerEventName, handler: SchedulerCallback, settings?: any): string; /** * makes the scheduler reflect all data changes in the Backbone model and vice versa @@ -1933,7 +2060,7 @@ export interface SchedulerStatic { /** * serializes all events loaded into the scheduler */ - serialize(): any[]; + serialize(): void; /** * defines a named collection that can be loaded into Units, Timeline views, or the Lightbox @@ -2120,7 +2247,16 @@ export interface SchedulerStatic { * @param view optional, (optional) the view name */ updateView(date?: Date, view?: string): void; -} + + // /** + // * A key-value mapping of string keys to Scheduler form blocks. + // * The keys represent the names of the custom lightbox controls. + // * The values are objects that implement the SchedulerFormBlock interface. + // */ + form_blocks: { [key: string]: SchedulerFormBlock }; + + [customMethod: string]: any; + } export declare var scheduler: SchedulerStatic; diff --git a/codebase/dhtmlxscheduler.js b/codebase/dhtmlxscheduler.js index 6cf933d..eaaf50a 100644 --- a/codebase/dhtmlxscheduler.js +++ b/codebase/dhtmlxscheduler.js @@ -1,7 +1,7 @@ /*! * @license * - * dhtmlxScheduler v.6.0.4 Standard + * dhtmlxScheduler v.6.0.5 Standard * * To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com * @@ -32,5 +32,5 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * - */!function(a){"object"==_(t)&&void 0!==e?e.exports=a():(o=[],void 0===(s="function"==typeof(r=a)?r.apply(t,o):r)||(e.exports=s))}(function(){var e,t,r;return function e(t,a,n){function i(o,s){if(!a[o]){if(!t[o]){var _="function"==typeof _dereq_&&_dereq_;if(!s&&_)return _(o,!0);if(r)return r(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var l=a[o]={exports:{}};t[o][0].call(l.exports,function(e){var a=t[o][1][e];return i(a||e)},l,l.exports,e,t,a,n)}return a[o].exports}for(var r="function"==typeof _dereq_&&_dereq_,o=0;o0;)d(e)}function d(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var a=e.shift(),n=e.shift();t.call(a,n)}}s.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},s.prototype.hasCustomScheduler=function(){return this._customScheduler},s.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},s.prototype.fatalError=function(e,t){t?(a.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),a.exit(2)):this.throwLater(e)},s.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.prototype.invokeLater=function(e,t,a){this._lateQueue.push(e,t,a),this._queueTick()},s.prototype.invoke=function(e,t,a){this._normalQueue.push(e,t,a),this._queueTick()},s.prototype.settlePromises=function(e){this._normalQueue._pushOne(e),this._queueTick()},s.prototype._drainQueues=function(){_(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,_(this._lateQueue)},s.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},s.prototype._reset=function(){this._isTickUsed=!1},t.exports=s,t.exports.firstLineError=i},{"./queue":17,"./schedule":18}],2:[function(e,t,a){"use strict";t.exports=function(e,t,a,n){var i=!1,r=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(r,r,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},_=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(r){i||(i=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var d=a(r),l=new e(t);l._propagateFrom(this,1);var c=this._target();if(l._setBoundTo(d),d instanceof e){var u={promiseRejectionQueued:!1,promise:l,target:c,bindingPromise:d};c._then(t,o,void 0,l,u),d._then(s,_,void 0,l,u),l._setOnCancel(d)}else l._resolveCallback(c);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,a){return e.resolve(a).bind(t)}}},{}],3:[function(e,t,a){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=e("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(e){}return i},t.exports=i},{"./promise":15}],4:[function(e,t,a){"use strict";t.exports=function(t,a,n,i){var r=e("./util"),o=r.tryCatch,s=r.errorObj,_=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var a=e._cancellationParent;if(null==a||!a._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=a}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),_.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(r.isArray(e))for(var a=0;a=0)return a[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,a.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=a.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var a=e.prototype._pushContext,r=e.prototype._popContext,o=e._peekContext,s=e.prototype._peekContext,_=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=a,e.prototype._popContext=r,e._peekContext=o,e.prototype._peekContext=s,e.prototype._promiseCreated=_,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=i,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},{}],7:[function(e,t,n){"use strict";t.exports=function(t,n,i,r){var o,s,d,l,c=t._async,u=e("./errors").Warning,h=e("./util"),f=e("./es5"),p=h.canAttachTrace,v=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,g=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,y=null,b=null,x=!1,k=!(0==h.env("BLUEBIRD_DEBUG")),w=!(0==h.env("BLUEBIRD_WARNINGS")||!k&&!h.env("BLUEBIRD_WARNINGS")),E=!(0==h.env("BLUEBIRD_LONG_STACK_TRACES")||!k&&!h.env("BLUEBIRD_LONG_STACK_TRACES")),S=0!=h.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(w||!!h.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function a(){for(var t=0;t0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(e,t,a){return q(e,t,a||this)},t.onPossiblyUnhandledRejection=function(e){var a=t._getContext();s=h.contextBind(a,e)},t.onUnhandledRejectionHandled=function(e){var a=t._getContext();o=h.contextBind(a,e)};var D=function(){};t.longStackTraces=function(){if(c.haveItemsQueued()&&!ne.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ne.longStackTraces&&X()){var e=t.prototype._captureStackTrace,a=t.prototype._attachExtraTrace,i=t.prototype._dereferenceTrace;ne.longStackTraces=!0,D=function(){if(c.haveItemsQueued()&&!ne.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=e,t.prototype._attachExtraTrace=a,t.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),ne.longStackTraces=!1},t.prototype._captureStackTrace=B,t.prototype._attachExtraTrace=V,t.prototype._dereferenceTrace=U,n.activateLongStackTraces()}},t.hasLongStackTraces=function(){return ne.longStackTraces&&X()};var N={unhandledrejection:{before:function(){var e=h.global.onunhandledrejection;return h.global.onunhandledrejection=null,e},after:function(e){h.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=h.global.onrejectionhandled;return h.global.onrejectionhandled=null,e},after:function(e){h.global.onrejectionhandled=e}}},C=function(){var e=function(e,t){if(!e)return!h.global.dispatchEvent(t);var a;try{return a=e.before(),!h.global.dispatchEvent(t)}finally{e.after(a)}};try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=new CustomEvent(t,{detail:a,cancelable:!0});return f.defineProperty(n,"promise",{value:a.promise}),f.defineProperty(n,"reason",{value:a.reason}),e(N[t],n)}}if("function"==typeof Event){t=new Event("CustomEvent");return h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=new Event(t,{cancelable:!0});return n.detail=a,f.defineProperty(n,"promise",{value:a.promise}),f.defineProperty(n,"reason",{value:a.reason}),e(N[t],n)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!0,a),e(N[t],n)}}catch(e){}return function(){return!1}}(),T=h.isNode?function(){return a.emit.apply(a,arguments)}:h.global?function(e){var t="on"+e.toLowerCase(),a=h.global[t];return!!a&&(a.apply(h.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function A(e,t){return{promise:t}}var M={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(e,t,a){return{promise:t,child:a}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,a){return{reason:t,promise:a}},rejectionHandled:A},O=function(e){var t=!1;try{t=T.apply(null,arguments)}catch(e){c.throwLater(e),t=!0}var a=!1;try{a=C(e,M[e].apply(null,arguments))}catch(e){c.throwLater(e),a=!0}return a||t};function H(){return!1}function j(e,t,a){var n=this;try{e(t,a,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+h.toString(e));n._attachCancellationCallback(e)})}catch(e){return e}}function L(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?h.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function $(){return this._onCancelField}function P(e){this._onCancelField=e}function z(){this._cancellationParent=void 0,this._onCancelField=void 0}function F(e,t){if(0!=(1&t)){this._cancellationParent=e;var a=e._branchesRemainingToCancel;void 0===a&&(a=0),e._branchesRemainingToCancel=a+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}t.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&D()),"warnings"in e){var a=e.warnings;ne.warnings=!!a,S=ne.warnings,h.isObject(a)&&"wForgottenReturn"in a&&(S=!!a.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!ne.cancellation){if(c.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=z,t.prototype._propagateFrom=F,t.prototype._onCancel=$,t.prototype._setOnCancel=P,t.prototype._attachCancellationCallback=L,t.prototype._execute=j,I=F,ne.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!ne.monitoring?(ne.monitoring=!0,t.prototype._fireEvent=O):!e.monitoring&&ne.monitoring&&(ne.monitoring=!1,t.prototype._fireEvent=H)),"asyncHooks"in e&&h.nodeSupportsAsyncResource){var n=ne.asyncHooks,o=!!e.asyncHooks;n!==o&&(ne.asyncHooks=o,o?i():r())}return t},t.prototype._fireEvent=H,t.prototype._execute=function(e,t,a){try{e(t,a)}catch(e){return e}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(e){},t.prototype._attachCancellationCallback=function(e){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(e,t){};var I=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function R(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function B(){this._trace=new te(this._peekContext())}function V(e,t){if(p(e)){var a=this._trace;if(void 0!==a&&t&&(a=a._parent),void 0!==a)a.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=Y(e);h.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),h.notEnumerableProp(e,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function q(e,a,n){if(ne.warnings){var i,r=new u(e);if(a)n._attachExtraTrace(r);else if(ne.longStackTraces&&(i=t._peekContext()))i.attachExtraTrace(r);else{var o=Y(r);r.stack=o.message+"\n"+o.stack.join("\n")}O("warning",r)||W(r,"",!0)}}function J(e){for(var t=[],a=0;a0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),a=0;a0&&"SyntaxError"!=e.name&&(t=t.slice(a)),t}(e):[" (No stack trace)"],{message:a,stack:"SyntaxError"==e.name?t:J(t)}}function W(e,t,a){if("undefined"!=typeof console){var n;if(h.isObject(e)){var i=e.stack;n=t+b(i,e)}else n=t+String(e);"function"==typeof d?d(n,a):"function"!=typeof console.log&&"object"!==_(console.log)||console.log(n)}}function K(e,t,a,n){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(n):t(a,n))}catch(e){c.throwLater(e)}"unhandledRejection"===e?O(e,a,n)||i||W(a,"Unhandled rejection "):O(e,n)}function G(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():h.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){if(e.length<41)return e;return e.substr(0,38)+"..."}(t)+">, no stack trace)"}function X(){return"function"==typeof ae}var Q=function(){return!1},Z=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function ee(e){var t=e.match(Z);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function te(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);ae(this,te),t>32&&this.uncycle()}h.inherits(te,Error),n.CapturedTrace=te,te.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],a={},n=0,i=this;void 0!==i;++n)t.push(i),i=i._parent;for(n=(e=this._length=n)-1;n>=0;--n){var r=t[n].stack;void 0===a[r]&&(a[r]=n)}for(n=0;n0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var s=n>0?t[n-1]:this;o=0;--d)t[d]._length=_,_++;return}}}},te.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=Y(e),a=t.message,n=[t.stack],i=this;void 0!==i;)n.push(J(i.stack.split("\n"))),i=i._parent;!function(e){for(var t=e[0],a=1;a=0;--s)if(n[s]===r){o=s;break}for(s=o;s>=0;--s){var _=n[s];if(t[i]!==_)break;t.pop(),i--}t=n}}(n),function(e){for(var t=0;t=0)return y=/@/,b=t,x=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(b=function(e,t){return"string"==typeof e?e:"object"!==_(t)&&"function"!=typeof t||void 0===t.name||void 0===t.message?G(t):t.toString()},null):(y=e,b=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(d=function(e){console.warn(e)},h.isNode&&a.stderr.isTTY?d=function(e,t){var a=t?"":"";console.warn(a+e+"\n")}:h.isNode||"string"!=typeof(new Error).stack||(d=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var ne={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return E&&t.longStackTraces(),{asyncHooks:function(){return ne.asyncHooks},longStackTraces:function(){return ne.longStackTraces},warnings:function(){return ne.warnings},cancellation:function(){return ne.cancellation},monitoring:function(){return ne.monitoring},propagateFromFunction:function(){return I},boundValueFunction:function(){return R},checkForgottenReturns:function(e,t,a,n,i){if(void 0===e&&null!==t&&S){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;a&&(a+=" ");var r="",o="";if(t._trace){for(var s=t._trace.stack.split("\n"),_=J(s),d=_.length-1;d>=0;--d){var l=_[d];if(!g.test(l)){var c=l.match(m);c&&(r="at "+c[1]+":"+c[2]+":"+c[3]+" ");break}}if(_.length>0){var u=_[0];for(d=0;d0&&(o="\n"+s[d-1]);break}}}var h="a promise was created in a "+a+"handler "+r+"but was not returned from it, see http://goo.gl/rRqMUw"+o;n._warn(h,!0,t)}},setBounds:function(e,t){if(X()){for(var a,n,i=(e.stack||"").split("\n"),r=(t.stack||"").split("\n"),o=-1,s=-1,_=0;_=s||(Q=function(e){if(v.test(e))return!0;var t=ee(e);return!!(t&&t.fileName===a&&o<=t.line&&t.line<=s)})}},warn:q,deprecated:function(e,t){var a=e+" is deprecated and will be removed in a future version.";return t&&(a+=" Use "+t+" instead."),q(a)},CapturedTrace:te,fireDomEvent:C,fireGlobalEvent:T}}},{"./errors":9,"./es5":10,"./util":21}],8:[function(e,t,a){"use strict";t.exports=function(e){function t(){return this.value}function a(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(a){return a instanceof e&&a.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:a},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(a,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,a,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(a){if(arguments.length<=1)return a instanceof e&&a.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:a},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();return this.caught(a,function(){return n})}}},{}],9:[function(e,t,a){"use strict";var n,i,r=e("./es5"),o=r.freeze,s=e("./util"),_=s.inherits,d=s.notEnumerableProp;function l(e,t){function a(n){if(!(this instanceof a))return new a(n);d(this,"message","string"==typeof n?n:t),d(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return _(a,Error),a}var c=l("Warning","warning"),u=l("CancellationError","cancellation error"),h=l("TimeoutError","timeout error"),f=l("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(e){n=l("TypeError","type error"),i=l("RangeError","range error")}for(var p="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function c(){return h.call(this,this.promise._target()._settledValue())}function u(e){if(!l(this,e))return o.e=e,o}function h(e){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var _=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),e);if(_===n)return _;if(void 0!==_){i._setReturnedNonUndefined();var h=a(_,i);if(h instanceof t){if(null!=this.cancelPromise){if(h._isCancelled()){var f=new r("late cancellation observer");return i._attachExtraTrace(f),o.e=f,o}h.isPending()&&h._attachCancellationCallback(new d(this))}return h._then(c,u,void 0,this,void 0)}}}return i.isRejected()?(l(this),o.e=e,o):(l(this),e)}return _.prototype.isFinallyHandler=function(){return 0===this.type},d.prototype._resultCancelled=function(){l(this.finallyHandler)},t.prototype._passThrough=function(e,t,a,n){return"function"!=typeof e?this.then():this._then(a,n,void 0,new _(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,h,h)},t.prototype.tap=function(e){return this._passThrough(e,1,h)},t.prototype.tapCatch=function(e){var a=arguments.length;if(1===a)return this._passThrough(e,1,void 0,h);var n,r=new Array(a-1),o=0;for(n=0;n0&&"function"==typeof arguments[t]&&(e=arguments[t]);var n=[].slice.call(arguments);e&&n.pop();var i=new a(n).promise();return void 0!==e?i.spread(e):i}}},{"./util":21}],13:[function(e,t,a){"use strict";t.exports=function(t,a,n,i,r){var o=e("./util"),s=o.tryCatch;t.method=function(e){if("function"!=typeof e)throw new t.TypeError("expecting a function but got "+o.classString(e));return function(){var n=new t(a);n._captureStackTrace(),n._pushContext();var i=s(e).apply(this,arguments),o=n._popContext();return r.checkForgottenReturns(i,o,"Promise.method",n),n._resolveFromSyncValue(i),n}},t.attempt=t.try=function(e){if("function"!=typeof e)return i("expecting a function but got "+o.classString(e));var n,_=new t(a);if(_._captureStackTrace(),_._pushContext(),arguments.length>1){r.deprecated("calling Promise.try with more than 1 argument");var d=arguments[1],l=arguments[2];n=o.isArray(d)?s(e).apply(l,d):s(e).call(l,d)}else n=s(e)();var c=_._popContext();return r.checkForgottenReturns(n,c,"Promise.try",_),_._resolveFromSyncValue(n),_},t.prototype._resolveFromSyncValue=function(e){e===o.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":21}],14:[function(e,t,a){"use strict";var n=e("./util"),i=n.maybeWrapAsError,r=e("./errors").OperationalError,o=e("./es5");var s=/^(?:name|message|stack|cause)$/;function _(e){var t;if(function(e){return e instanceof Error&&o.getPrototypeOf(e)===Error.prototype}(e)){(t=new r(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var a=o.keys(e),i=0;i1){var a,n=new Array(t-1),i=0;for(a=0;a0&&"function"!=typeof e&&"function"!=typeof t){var a=".then() only accepts functions but was passed: "+_.classString(e);arguments.length>1&&(a+=", "+_.classString(t)),this._warn(a)}return this._then(e,t,void 0,void 0,void 0)},O.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},O.prototype.spread=function(e){return"function"!=typeof e?r("expecting a function but got "+_.classString(e)):this.all()._then(e,void 0,void 0,x,void 0)},O.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},O.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},O.prototype.error=function(e){return this.caught(_.originatesFromRejection,e)},O.getNewLibraryCopy=t.exports,O.is=function(e){return e instanceof O},O.fromNode=O.fromCallback=function(e){var t=new O(b);t._captureStackTrace();var a=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=M(e)(T(t,a));return n===A&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},O.all=function(e){return new E(e).promise()},O.cast=function(e){var t=w(e);return t instanceof O||((t=new O(b))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},O.resolve=O.fulfilled=O.cast,O.reject=O.rejected=function(e){var t=new O(b);return t._captureStackTrace(),t._rejectCallback(e,!0),t},O.setScheduler=function(e){if("function"!=typeof e)throw new m("expecting a function but got "+_.classString(e));return v.setScheduler(e)},O.prototype._then=function(e,t,a,n,i){var r=void 0!==i,o=r?i:new O(b),s=this._target(),d=s._bitField;r||(o._propagateFrom(this,3),o._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&d)?this._boundValue():s===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,o));var l=h();if(0!=(50397184&d)){var c,u,f=s._settlePromiseCtx;0!=(33554432&d)?(u=s._rejectionHandler0,c=e):0!=(16777216&d)?(u=s._fulfillmentHandler0,c=t,s._unsetRejectionIsUnhandled()):(f=s._settlePromiseLateCancellationObserver,u=new y("late cancellation observer"),s._attachExtraTrace(u),c=t),v.invoke(f,s,{handler:_.contextBind(l,c),promise:o,receiver:n,value:u})}else s._addCallbacks(e,t,o,n,l);return o},O.prototype._length=function(){return 65535&this._bitField},O.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},O.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},O.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},O.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},O.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},O.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},O.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},O.prototype._isFinal=function(){return(4194304&this._bitField)>0},O.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},O.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},O.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},O.prototype._setAsyncGuaranteed=function(){if(!v.hasCustomScheduler()){var e=this._bitField;this._bitField=e|(536870912&e)>>2^134217728}},O.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},O.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==s)return void 0===t&&this._isBound()?this._boundValue():t},O.prototype._promiseAt=function(e){return this[4*e-4+2]},O.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},O.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},O.prototype._boundValue=function(){},O.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,a=e._rejectionHandler0,n=e._promise0,i=e._receiverAt(0);void 0===i&&(i=s),this._addCallbacks(t,a,n,i,null)},O.prototype._migrateCallbackAt=function(e,t){var a=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),i=e._promiseAt(t),r=e._receiverAt(t);void 0===r&&(r=s),this._addCallbacks(a,n,i,r,null)},O.prototype._addCallbacks=function(e,t,a,n,i){var r=this._length();if(r>=65531&&(r=0,this._setLength(0)),0===r)this._promise0=a,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=_.contextBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=_.contextBind(i,t));else{var o=4*r-4;this[o+2]=a,this[o+3]=n,"function"==typeof e&&(this[o+0]=_.contextBind(i,e)),"function"==typeof t&&(this[o+1]=_.contextBind(i,t))}return this._setLength(r+1),r},O.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},O.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(n(),!1);var a=w(e,this);if(!(a instanceof O))return this._fulfill(e);t&&this._propagateFrom(a,2);var i=a._target();if(i!==this){var r=i._bitField;if(0==(50397184&r)){var o=this._length();o>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(e===this){var a=n();return this._attachExtraTrace(a),this._reject(a)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():v.settlePromises(this),this._dereferenceTrace())}},O.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return v.fatalError(e,_.isNode);(65535&t)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled()}},O.prototype._fulfillPromises=function(e,t){for(var a=1;a0){if(0!=(16842752&e)){var a=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,a,e),this._rejectPromises(t,a)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},O.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&f.defineProperty(O.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),O.defer=O.pending=function(){return D.deprecated("Promise.defer","new Promise"),{promise:new O(b),resolve:H,reject:j}},_.notEnumerableProp(O,"_makeSelfResolutionError",n),e("./method")(O,b,w,r,D),e("./bind")(O,b,w,D),e("./cancel")(O,E,r,D),e("./direct_resolve")(O),e("./synchronous_inspection")(O),e("./join")(O,E,w,b,v),O.Promise=O,O.version="3.7.2",_.toFastProperties(O),_.toFastProperties(O.prototype),L({a:1}),L({b:2}),L({c:3}),L(1),L(function(){}),L(void 0),L(!1),L(new O(b)),D.setBounds(p.firstLineError,_.lastLineError),O}},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21,async_hooks:void 0}],16:[function(e,t,a){"use strict";t.exports=function(t,a,n,i,r){var o=e("./util");o.isArray;function s(e){var n=this._promise=new t(a);e instanceof t&&(n._propagateFrom(e,3),e.suppressUnhandledRejections()),n._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(s,r),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(a,r){var s=n(this._values,this._promise);if(s instanceof t){var _=(s=s._target())._bitField;if(this._values=s,0==(50397184&_))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,r);if(0==(33554432&_))return 0!=(16777216&_)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=o.asArray(s)))0!==s.length?this._iterate(s):-5===r?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(r));else{var d=i("expecting an array or an iterable object but got "+o.classString(s)).reason();this._promise._rejectCallback(d,!1)}},s.prototype._iterate=function(e){var a=this.getActualLength(e.length);this._length=a,this._values=this.shouldCopyValues()?new Array(a):this._values;for(var i=this._promise,r=!1,o=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var a=0;a1,n=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=k.test(e+"")&&r.names(e).length>0;if(a||n||i)return!0}return!1}catch(e){return!1}}function E(e){function t(){}t.prototype=e;var a=new t;function n(){return _(a.foo)}return n(),n(),e}var S=/^[a-z$_][a-z$_0-9]*$/i;function D(e){return S.test(e)}function N(e,t,a){for(var n=new Array(e),i=0;i10||e[0]>0}(),U.nodeSupportsAsyncResource=U.isNode&&function(){var t=!1;try{t="function"==typeof e("async_hooks").AsyncResource.prototype.runInAsyncScope}catch(e){t=!1}return t}(),U.isNode&&U.toFastProperties(a);try{throw new Error}catch(e){U.lastLineError=e}t.exports=U},{"./es5":10,async_hooks:void 0}]},{},[3])(3)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,a(5),a(1),a(7).setImmediate)},function(e,t,a){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new r(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},a(8),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,a(1))},function(e,t,a){(function(e,t){!function(e,a){"use strict";if(!e.setImmediate){var n,i=1,r={},o=!1,s=e.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(e);_=_&&_.setTimeout?_:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick(function(){l(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,a=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=a,t}}()?function(){var t="setImmediate$"+Math.random()+"$",a=function(a){a.source===e&&"string"==typeof a.data&&0===a.data.indexOf(t)&&l(+a.data.slice(t.length))};e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(a){e.postMessage(t+a,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){l(e.data)},n=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;n=function(t){var a=s.createElement("script");a.onreadystatechange=function(){l(t),a.onreadystatechange=null,e.removeChild(a),a=null},e.appendChild(a)}}():n=function(e){setTimeout(l,0,e)},_.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),a=0;a=0){if(!a)return n;var o=0===r||!(i.charAt(r-1)||"").trim(),s=r+t.length>=i.length||!i.charAt(r+t.length).trim();if(o&&s)return n}}n=n.parentNode}return null}function x(e){var t=!1,a=!1;if(window.getComputedStyle){var n=window.getComputedStyle(e,null);t=n.display,a=n.visibility}else e.currentStyle&&(t=e.currentStyle.display,a=e.currentStyle.visibility);var i=!1,r=b({target:e},"dhx_form_repeat",!1);return r&&(i=!("0px"!=r.style.height)),i=i||!e.offsetHeight,"none"!=t&&"hidden"!=a&&!i}function k(e){return!isNaN(e.getAttribute("tabindex"))&&1*e.getAttribute("tabindex")>=0}function w(e){return!{a:!0,area:!0}[e.nodeName.loLowerCase()]||!!e.getAttribute("href")}function E(e){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[e.nodeName.toLowerCase()]||!e.hasAttribute("disabled")}function S(){return document.head.createShadowRoot||document.head.attachShadow}function D(e){if(!e)return document.body;if(!S())return document.body;for(;e.parentNode&&(e=e.parentNode);)if(e instanceof ShadowRoot)return e.host;return document.body}var N,C={getAbsoluteLeft:function(e){return this.getOffset(e).left},getAbsoluteTop:function(e){return this.getOffset(e).top},getOffsetSum:function(e){for(var t=0,a=0;e;)t+=parseInt(e.offsetTop),a+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:t,left:a}},getOffsetRect:function(e){var t=e.getBoundingClientRect(),a=0,n=0;if(/Mobi/.test(navigator.userAgent)){var i=document.createElement("div");i.style.position="absolute",i.style.left="0px",i.style.top="0px",i.style.width="1px",i.style.height="1px",document.body.appendChild(i);var r=i.getBoundingClientRect();a=t.top-r.top,n=t.left-r.left,i.parentNode.removeChild(i)}else{var o=document.body,s=document.documentElement,_=window.pageYOffset||s.scrollTop||o.scrollTop,d=window.pageXOffset||s.scrollLeft||o.scrollLeft,l=s.clientTop||o.clientTop||0,c=s.clientLeft||o.clientLeft||0;a=t.top+_-l,n=t.left+d-c}return{top:Math.round(a),left:Math.round(n)}},getOffset:function(e){return e.getBoundingClientRect?this.getOffsetRect(e):this.getOffsetSum(e)},closest:function(e,t){return e&&t?N(e,t):null},insertAfter:function(e,t){t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)},remove:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},getFocusableNodes:function(e){for(var t=e.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),a=Array.prototype.slice.call(t,0),n=0;n=0||navigator.userAgent.indexOf("Trident")>=0),isIE6:A&&!XMLHttpRequest&&navigator.userAgent.indexOf("MSIE")>=0,isIE7:A&&navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0,isIE8:A&&navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0,isOpera:A&&navigator.userAgent.indexOf("Opera")>=0,isChrome:A&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:A&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:A&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:A&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:A&&-1!=navigator.userAgent.indexOf("Edge"),isNode:!A||"undefined"==typeof navigator},O=a(6).Promise;var H=a(3),j=a.n(H);function L(e){"@babel/helpers - typeof";return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e){var t=function(e,t){for(var a="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",n=e.match(/%[a-zA-Z]/g),i=0;i50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":a+="set[3]=temp["+i+"]||0;";break;case"%i":a+="set[4]=temp["+i+"]||0;";break;case"%Y":a+="set[0]=temp["+i+"]||0;";break;case"%a":case"%A":a+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":a+="set[5]=temp["+i+"]||0;";break;case"%M":a+="set[1]=this.locale.date.month_short_hash[temp["+i+"]]||0;";break;case"%F":a+="set[1]=this.locale.date.month_full_hash[temp["+i+"]]||0;"}var r="set[0],set[1],set[2],set[3],set[4],set[5]";return t&&(r=" Date.UTC("+r+")"),new Function("date","var set=[0,0,1,0,0,0]; "+a+" return new Date("+r+");")},a=function(t,a){return function(n){for(var i=[0,0,1,0,0,0],r=n.match(/[a-zA-Z]+|[0-9]+/g),o=t.match(/%[a-zA-Z]/g),s=0;s50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":i[3]=r[s]||0;break;case"%i":i[4]=r[s]||0;break;case"%Y":i[0]=r[s]||0;break;case"%a":case"%A":i[3]=i[3]%12+("am"==(r[s]||"").toLowerCase()?0:12);break;case"%s":i[5]=r[s]||0;break;case"%M":i[1]=e.locale.date.month_short_hash[r[s]]||0;break;case"%F":i[1]=e.locale.date.month_full_hash[r[s]]||0}return a?new Date(Date.UTC(i[0],i[1],i[2],i[3],i[4],i[5])):new Date(i[0],i[1],i[2],i[3],i[4],i[5])}},n=!1;function i(){return"auto"===e.config.csp?n:e.config.csp}!function(){try{new Function("canUseCsp = false;")}catch(e){n=!0}}(),e.date={init:function(){for(var t=e.locale.date.month_short,a=e.locale.date.month_short_hash={},n=0;n0){var n=(+a-+e)%864e5;if(n&&e.getTimezoneOffset()==a.getTimezoneOffset()){var i=n/36e5;a.setTime(a.getTime()+60*(24-i)*60*1e3)}}return t>=0&&!e.getHours()&&a.getHours()&&(a.getDate()11?"pm":"am":n.getHours()>11?"pm":"am";case"%A":return a?n.getUTCHours()>11?"PM":"AM":n.getHours()>11?"PM":"AM";case"%s":return a?e.date.to_fixed(n.getUTCSeconds()):e.date.to_fixed(n.getSeconds());case"%W":return a?e.date.to_fixed(e.date.getUTCISOWeek(n)):e.date.to_fixed(e.date.getISOWeek(n));default:return t}})}}(t,a);t=t.replace(/%[a-zA-Z]/g,function(e){switch(e){case"%d":return'"+this.date.to_fixed(date.getDate())+"';case"%m":return'"+this.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+this.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+this.locale.date.day_short[date.getDay()]+"';case"%l":return'"+this.locale.date.day_full[date.getDay()]+"';case"%M":return'"+this.locale.date.month_short[date.getMonth()]+"';case"%F":return'"+this.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+this.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+this.date.to_fixed(date.getHours())+"';case"%i":return'"+this.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+this.date.to_fixed(date.getSeconds())+"';case"%W":return'"+this.date.to_fixed(this.date.getISOWeek(date))+"';default:return e}}),a&&(t=t.replace(/date\.get/g,"date.getUTC"));var n=new Function("date",'return "'+t+'";');return e.date._bind_host_object(n)},str_to_date:function(n,r,o){var s=i()?a:t,_=s(n,r),d=/^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,l=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/,c=/^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,u=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,h=s("%Y-%m-%d %H:%i:%s",r),f=s("%m/%d/%Y %H:%i:%s",r),p=s("%d-%m-%Y %H:%i:%s",r);return function(t){if(!o&&!e.config.parse_exact_format){if(t&&t.getISOWeek)return new Date(t);if("number"==typeof t)return new Date(t);if(function(e){return d.test(String(e))}(t))return h(t);if(function(e){return l.test(String(e))}(t))return f(t);if(function(e){return c.test(String(e))}(t))return p(t);if(function(e){return u.test(e)}(t))return new Date(t)}return _.call(e,t)}},getISOWeek:function(e){if(!e)return!1;var t=(e=this.date_part(new Date(e))).getDay();0===t&&(t=7);var a=new Date(e.valueOf());a.setDate(e.getDate()+(4-t));var n=a.getFullYear(),i=Math.round((a.getTime()-new Date(n,0,1).getTime())/864e5);return 1+Math.floor(i/7)},getUTCISOWeek:function(e){return this.getISOWeek(this.convert_to_utc(e))},convert_to_utc:function(e){return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}}}function P(e){"@babel/helpers - typeof";return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function z(e){"@babel/helpers - typeof";return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var F=a(2),I=a.n(F);function R(e){"@babel/helpers - typeof";return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(e){e._loaded={},e._load=function(t,a){if(t=t||this._load_url){var n;if(t+=(-1==t.indexOf("?")?"?":"&")+"timeshift="+(new Date).getTimezoneOffset(),this.config.prevent_cache&&(t+="&uid="+this.uid()),a=a||this._date,this._load_mode){var i=this.templates.load_format;for(a=this.date[this._load_mode+"_start"](new Date(a.valueOf()));a>this._min_date;)a=this.date.add(a,-1,this._load_mode);n=a;for(var r=!0;na&&this._loaded[i(o)]);if(n<=a)return!1;for(e.ajax.get(t+"&from="+i(a)+"&to="+i(n),s);a=400)&&(this.callEvent("onLoadError",[e.xmlDoc]),t=[]),this._process_loading(t),this.callEvent("onXLE",[]),this.callEvent("onParse",[])},e._process_loading=function(e){this._loading=!0,this._not_render=!0;for(var t=0;t1)&&(this.xy.scroll_width=0,this._mobile=!0),this.config.touch){var e=!0;try{document.createEvent("TouchEvent")}catch(t){e=!1}e?this._touch_events(["touchmove","touchstart","touchend"],function(e){return e.touches&&e.touches.length>1?null:e.touches[0]?{target:e.target,pageX:e.touches[0].pageX,pageY:e.touches[0].pageY,clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}:e},function(){return!1}):window.PointerEvent||window.navigator.pointerEnabled?this._touch_events(["pointermove","pointerdown","pointerup"],function(e){return"mouse"==e.pointerType?null:e},function(e){return!e||"mouse"==e.pointerType}):window.navigator.msPointerEnabled&&this._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(e){return e.pointerType==e.MSPOINTER_TYPE_MOUSE?null:e},function(e){return!e||e.pointerType==e.MSPOINTER_TYPE_MOUSE})}},e._touch_events=function(t,a,n){var i,r,o,s,_,d,l=0;function c(t,a,i){t.addEventListener(a,function(t){return!!e._is_lightbox_open()||(n(t)?void 0:i(t))},{passive:!1})}function u(t){n(t)||(e._hide_global_tip(),s&&(e._on_mouse_up(a(t)),e._temp_touch_block=!1),e._drag_id=null,e._drag_mode=null,e._drag_pos=null,e._pointerDragId=null,clearTimeout(o),s=d=!1,_=!0)}c(document.body,t[0],function(t){if(!n(t)){var l=a(t);if(l){if(s)return function(t){if(!n(t)){var a=e.getState().drag_mode,i=!!e.matrix&&e.matrix[e._mode],r=e.render_view_data;"create"==a&&i&&(e.render_view_data=function(){for(var t=e.getState().drag_id,a=e.getEvent(t),n=i.y_property,r=e.getEvents(a.start_date,a.end_date),o=0;o5||Math.abs(i.pageY-r.pageY)>5)&&(_=!0,clearTimeout(o)):_=!0)}}}),c(this._els.dhx_cal_data[0],"touchcancel",u),c(this._els.dhx_cal_data[0],"contextmenu",function(e){if(!n(e))return d?(e&&e.preventDefault&&e.preventDefault(),e.cancelBubble=!0,!1):void 0}),c(this._obj,t[1],function(t){var c;if(document&&document.body&&document.body.classList.add("dhx_cal_touch_active"),!n(t))if(e._pointerDragId=t.pointerId,s=_=!1,d=!0,c=r=a(t)){var u=new Date;if(!_&&!s&&u-l<250)return e._click.dhx_cal_data(c),window.setTimeout(function(){e.$destroyed||(c.type="dblclick",e._on_dbl_click(c))},50),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,e._block_next_stop=!0,!1;if(l=u,!_&&!s&&e.config.touch_drag){var h=e._locate_event(document.activeElement),f=e._locate_event(c.target),p=i?e._locate_event(i.target):null;if(h&&f&&h==f&&h!=p)return t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,e._ignore_next_click=!1,e._click.dhx_cal_data(c),i=c,!1;o=setTimeout(function(){if(!e.$destroyed){s=!0;var t=i.target,a=e._getClassName(t);t&&-1!=a.indexOf("dhx_body")&&(t=t.previousSibling),e._on_mouse_down(i,t),e._drag_mode&&"create"!=e._drag_mode&&e.for_rendered(e._drag_id,function(t,a){t.style.display="none",e._rendered.splice(a,1)}),e.config.touch_tip&&e._show_global_tip(),e.updateEvent(e._drag_id)}},e.config.touch_drag),i=c}}else _=!0}),c(this._els.dhx_cal_data[0],t[2],function(t){if(document&&document.body&&document.body.classList.remove("dhx_cal_touch_active"),!n(t))return e.config.touch_swipe_dates&&!s&&function(t,a,n,i){if(!t||!a)return!1;for(var r=t.target;r&&r!=e._obj;)r=r.parentNode;if(r!=e._obj)return!1;if(e.matrix&&e.matrix[e.getState().mode]&&e.matrix[e.getState().mode].scrollable)return!1;var o=Math.abs(t.pageY-a.pageY),s=Math.abs(t.pageX-a.pageX);return on&&(!o||s/o>3)&&(t.pageX>a.pageX?e._click.dhx_cal_next_button():e._click.dhx_cal_prev_button(),!0)}(i,r,200,100)&&(e._block_next_stop=!0),s&&(e._ignore_next_click=!0,setTimeout(function(){e._ignore_next_click=!1},100)),u(t),e._block_next_stop?(e._block_next_stop=!1,t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1):void 0}),e.event(document.body,t[2],u)},e._show_global_tip=function(){e._hide_global_tip();var t=e._global_tip=document.createElement("div");t.className="dhx_global_tip",e._update_global_tip(1),document.body.appendChild(t)},e._update_global_tip=function(t){var a=e._global_tip;if(a){var n="";if(e._drag_id&&!t){var i=e.getEvent(e._drag_id);i&&(n="
"+(i._timed?e.templates.event_header(i.start_date,i.end_date,i):e.templates.day_date(i.start_date,i.end_date,i))+"
")}"create"==e._drag_mode||"new-size"==e._drag_mode?a.innerHTML=(e.locale.labels.drag_to_create||"Drag to create")+n:a.innerHTML=(e.locale.labels.drag_to_move||"Drag to move")+n}},e._hide_global_tip=function(){var t=e._global_tip;t&&t.parentNode&&(t.parentNode.removeChild(t),e._global_tip=0)}}function U(e){var t,a;function n(){if(e._is_material_skin())return!0;if(void 0!==a)return a;var t=document.createElement("div");t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.innerHTML="
",document.body.appendChild(t);var n=window.getComputedStyle(t.querySelector(".dhx_body")).getPropertyValue("box-sizing");document.body.removeChild(t),(a=!("border-box"!==n))||setTimeout(function(){a=void 0},1e3)}function i(){if(!e._is_material_skin()&&!e._border_box_events()){var i=a;a=void 0,t=void 0,i!==n()&&e.$container&&e.getState().mode&&e.setCurrentView()}}e._skin_settings={fix_tab_position:[1,0],use_select_menu_space:[1,0],wide_form:[1,0],hour_size_px:[44,42],displayed_event_color:["#ff4a4a","ffc5ab"],displayed_event_text_color:["#ffef80","7e2727"]},e._skin_xy={lightbox_additional_height:[90,50],nav_height:[59,22],bar_height:[24,20]},e._is_material_skin=function(){return e.skin?(e.skin+"").indexOf("material")>-1:function(){if(void 0===t){var e=document.createElement("div");e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.innerHTML="
",document.body.appendChild(e);var a=window.getComputedStyle(e.querySelector(".dhx_cal_scale_placeholder")),n=a.getPropertyValue("position");t="absolute"===n,setTimeout(function(){t=null,e&&e.parentNode&&e.parentNode.removeChild(e)},500)}return t}()},window.addEventListener("DOMContentLoaded",i),window.addEventListener("load",i),e._border_box_events=function(){return n()},e._configure=function(e,t,a){for(var n in t)void 0===e[n]&&(e[n]=t[n][a])},e._skin_init=function(){if(!e.skin)for(var t=document.getElementsByTagName("link"),a=0;a"+e.getHours()+" "+t+""}),!i){var _=e.config.minicalendar;_&&(_.padding=14),e.templates.event_bar_date=function(t,a,n){return"• "+e.templates.event_date(t)+" "},e.attachEvent("onTemplatesReady",function(){var t=e.date.date_to_str("%d");e.templates._old_month_day||(e.templates._old_month_day=e.templates.month_day);var a=e.templates._old_month_day;if(e.templates.month_day=function(n){if("month"==this._mode){var i=t(n);return 1==n.getDate()&&(i=e.locale.date.month_full[n.getMonth()]+" "+i),+n==+e.date.date_part(this._currentDate())&&(i=e.locale.labels.dhx_cal_today_button+" "+i),i}return a.call(this,n)},e.config.fix_tab_position){var n=e._els.dhx_cal_navline[0].getElementsByTagName("div"),i=null,r=211,o=[14,75,136],s=14;e._is_material_skin()&&(o=[16,103,192],r=294,s=-1);for(var _=0;_-1&&r.click?r.click():(n(a,!0),i=!0)}27==t&&(n(a,!1),i=!0)}return i?(e.preventDefault&&e.preventDefault(),!(e.cancelBubble=!0)):void 0}}function r(t){r.cover||(r.cover=document.createElement("div"),e.event(r.cover,"keydown",i),r.cover.className="dhx_modal_cover",document.body.appendChild(r.cover)),r.cover.style.display=t?"inline-block":"none"}function o(t,a,n){var i=e._waiAria.messageButtonAttrString(t),r=(a||"").toLowerCase().replace(/ /g,"_"),o="scheduler_".concat(r,"_button dhtmlx_").concat(r,"_button");return"
").concat(t,"
")}function s(t){v.area||(v.area=document.createElement("div"),v.area.className="scheduler_message_area dhtmlx_message_area",v.area.style[v.position]="5px",document.body.appendChild(v.area)),v.hide(t.id);var a=document.createElement("div");return a.innerHTML="
"+t.text+"
",a.className="scheduler-info dhtmlx-info scheduler-"+t.type+" dhtmlx-"+t.type,e.event(a,"click",function(){v.hide(t.id),t=null}),e._waiAria.messageInfoAttr(a),"bottom"==v.position&&v.area.firstChild?v.area.insertBefore(a,v.area.firstChild):v.area.appendChild(a),t.expire>0&&(v.timers[t.id]=window.setTimeout(function(){v&&v.hide(t.id)},t.expire)),v.pull[t.id]=a,a=null,t.id}function _(){for(var e=[].slice.apply(arguments,[0]),t=0;t'+i.title+"
"),c+='
'+(i.content?"":i.text)+'
',r&&(c+=o(_(i.ok,e.locale.labels.message_ok,"OK"),"ok",!0)),s&&(c+=o(_(i.cancel,e.locale.labels.message_cancel,"Cancel"),"cancel",!1)),i.buttons)for(var u=0;u",d.innerHTML=c,i.content){var f=i.content;"string"==typeof f&&(f=document.getElementById(f)),"none"==f.style.display&&(f.style.display=""),d.childNodes[i.title?1:0].appendChild(f)}return e.event(d,"click",function(e){var t=e.target||e.srcElement;if(t.className||(t=t.parentNode),C.closest(t,".scheduler_popup_button")){var a=t.getAttribute("data-result");n(i,a="true"==a||"false"!=a&&a)}}),i.box=d,(r||s)&&(a=i),d}(s,d,l);s.hidden||r(!0),document.body.appendChild(c);var u=Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-c.offsetWidth)/2)),h=Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-c.offsetHeight)/2));return"top"==s.position?c.style.top="-3px":c.style.top=h+"px",c.style.left=u+"px",e.event(c,"keydown",i),p.focus(c),s.hidden&&p.hide(c),e.callEvent("onMessagePopup",[c]),c}function l(e){return d(e,!0,!1)}function c(e){return d(e,!0,!0)}function u(e){return d(e)}function h(e,t,a){return"object"!=Y(e)&&("function"==typeof t&&(a=t,t=""),e={text:e,type:t,callback:a}),e}function f(e,t,a,n){return"object"!=Y(e)&&(e={text:e,type:t,expire:a,id:n}),e.id=e.id||m.uid(),e.expire=e.expire||v.expire,e}e.event(document,"keydown",i,!0);var p=function(){var e=h.apply(this,arguments);return e.type=e.type||"alert",u(e)};p.hide=function(a){for(;a&&a.getAttribute&&!a.getAttribute(t);)a=a.parentNode;a&&(a.parentNode.removeChild(a),r(!1),e.callEvent("onAfterMessagePopup",[a]))},p.focus=function(e){setTimeout(function(){var t=C.getFocusableNodes(e);t.length&&t[0].focus&&t[0].focus()},1)};var v=function(e,t,a,n){switch((e=f.apply(this,arguments)).type=e.type||"info",e.type.split("-")[0]){case"alert":return l(e);case"confirm":return c(e);case"modalbox":return u(e);default:return s(e)}};v.seed=(new Date).valueOf(),v.uid=m.uid,v.expire=4e3,v.keyboard=!0,v.position="top",v.pull={},v.timers={},v.hideAll=function(){for(var e in v.pull)v.hide(e)},v.hide=function(e){var t=v.pull[e];t&&t.parentNode&&(window.setTimeout(function(){t.parentNode.removeChild(t),t=null},2e3),t.className+=" hidden",v.timers[e]&&window.clearTimeout(v.timers[e]),delete v.pull[e])};var g=[];return e.attachEvent("onMessagePopup",function(e){g.push(e)}),e.attachEvent("onAfterMessagePopup",function(e){for(var t=0;t \n"}},e.createTimelineView=function(){throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: "+a.timeline+"\nRelated docs: "+t.timeline)},e.createUnitsView=function(){throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: "+a.unit+"\nRelated docs: "+t.unit)},e.createGridView=function(){throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: "+a.grid+"\nRelated docs: "+t.grid)},e.addMarkedTimespan=function(){throw new Error("scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\nRelated docs: https://docs.dhtmlx.com/scheduler/limits.html")},e.renderCalendar=function(){throw new Error("scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\nhttps://docs.dhtmlx.com/scheduler/minicalendar.html")},e.exportToPNG=function(){throw new Error(["scheduler.exportToPNG is not implemented.","This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html","Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n"))},e.exportToPDF=function(){throw new Error(["scheduler.exportToPDF is not implemented.","This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html","Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n"))}}(t),function(e){var t=u();e.event=t.attach,e.eventRemove=t.detach,e._eventRemoveAll=t.detachAll,e._createDomEventScope=t.extend,e._trim=function(e){return(String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")}).apply(e)},e._isDate=function(e){return!(!e||"object"!=h(e)||!(e.getFullYear&&e.getMonth&&e.getDate))},e._isObject=function(e){return e&&"object"==h(e)}}(t),function(e){d(e),i(e),e._detachDomEvent=function(e,t,a){e.removeEventListener?e.removeEventListener(t,a,!1):e.detachEvent&&e.detachEvent("on"+t,a)},e._init_once=function(){r(e),e._init_once=function(){}};var t={render:function(t){return e._init_nav_bar(t)}},a={render:function(e){var t=document.createElement("div");return t.className="dhx_cal_header",t}},n={render:function(e){var t=document.createElement("div");return t.className="dhx_cal_data",t}};function o(e){return!!(e.querySelector(".dhx_cal_header")&&e.querySelector(".dhx_cal_data")&&e.querySelector(".dhx_cal_navline"))}e.init=function(i,r,s){if(!this.$destroyed){if(r=r||e._currentDate(),s=s||"week",this._obj&&this.unset_actions(),this._obj="string"==typeof i?document.getElementById(i):i,this.$container=this._obj,this.$root=this._obj,!this.$container.offsetHeight&&this.$container.offsetWidth&&"100%"===this.$container.style.height&&window.console.error(e._commonErrorMessages.collapsedContainer(),this.$container),this.config.wai_aria_attributes&&this.config.wai_aria_application_role&&this.$container.setAttribute("role","application"),this.config.header||o(this.$container)||(this.config.header=function(e){var t=["day","week","month"];if(e.matrix)for(var a in e.matrix)t.push(a);if(e._props)for(var a in e._props)t.push(a);if(e._grid&&e._grid.names)for(var a in e._grid.names)t.push(a);return["map","agenda","week_agenda","year"].forEach(function(a){e[a+"_view"]&&t.push(a)}),t.concat(["date"]).concat(["prev","today","next"])}(this),window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.","Using a default header configuration: ","scheduler.config.header = "+JSON.stringify(this.config.header,null,2),"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join("\n"))),this.config.header)this.$container.innerHTML="",this.$container.classList.add("dhx_cal_container"),this.config.header.height&&(this.xy.nav_height=this.config.header.height),this.$container.appendChild(t.render(this.config.header)),this.$container.appendChild(a.render()),this.$container.appendChild(n.render());else if(!o(this.$container))throw new Error(["Required DOM elements are missing from the scheduler container.","Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup","Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join("\n"));this.config.rtl&&(this.$container.className+=" dhx_cal_container_rtl"),this._skin_init&&e._skin_init(),e.date.init(),this._scroll=!0,this._quirks=this.$env.isIE&&"BackCompat"==document.compatMode,this._quirks7=this.$env.isIE&&-1==navigator.appVersion.indexOf("MSIE 8"),this._els=[],this.get_elements(),this.init_templates(),this.set_actions(),this._init_once(),this._init_touch_events(),this.set_sizes(),e.callEvent("onSchedulerReady",[]),e.$initialized=!0,this.setCurrentView(r,s)}},e.xy={min_event_height:40,scale_width:50,scroll_width:18,scale_height:20,month_scale_height:20,menu_width:25,margin_top:0,margin_left:0,editor_width:140,month_head_height:22,event_header_height:14},e.keys={edit_save:13,edit_cancel:27},e.bind=function(e,t){return e.bind?e.bind(t):function(){return e.apply(t,arguments)}},e.set_sizes=function(){var t=this._x=this._obj.clientWidth-this.xy.margin_left,a=this._y=this._obj.clientHeight-this.xy.margin_top,n=this._table_view?0:this.xy.scale_width+this.xy.scroll_width,i=this._table_view?-1:this.xy.scale_width,r=this.$container.querySelector(".dhx_cal_scale_placeholder");e._is_material_skin()?(r||((r=document.createElement("div")).className="dhx_cal_scale_placeholder",this.$container.insertBefore(r,this._els.dhx_cal_header[0])),r.style.display="block",this.set_xy(r,t,this.xy.scale_height+1,0,this.xy.nav_height+(this._quirks?-1:1))):r&&r.parentNode.removeChild(r),this._lightbox&&(e.$container.offsetWidth<1200||this._setLbPosition(document.querySelector(".dhx_cal_light"))),this.set_xy(this._els.dhx_cal_navline[0],t,this.xy.nav_height,0,0),this.set_xy(this._els.dhx_cal_header[0],t-n,this.xy.scale_height,i,this.xy.nav_height+(this._quirks?-1:1));var o=this._els.dhx_cal_navline[0].offsetHeight;o>0&&(this.xy.nav_height=o);var s=this.xy.scale_height+this.xy.nav_height+(this._quirks?-2:0);this.set_xy(this._els.dhx_cal_data[0],t,a-(s+2),0,s+2)},e.set_xy=function(e,t,a,n,i){var r="left";e.style.width=Math.max(0,t)+"px",e.style.height=Math.max(0,a)+"px",arguments.length>3&&(this.config.rtl&&(r="right"),e.style[r]=n+"px",e.style.top=i+"px")},e.get_elements=function(){for(var t=this._obj.getElementsByTagName("DIV"),a=0;a500&&e.unselect()},dhx_cal_prev_button:function(){e._click.dhx_cal_next_button(0,-1)},dhx_cal_next_button:function(t,a){var n=1;e.config.rtl&&(a=-a,n=-n),e.setCurrentView(e.date.add(e.date[e._mode+"_start"](new Date(e._date)),a||n,e._mode))},dhx_cal_today_button:function(){e.callEvent("onBeforeTodayDisplayed",[])&&e.setCurrentView(e._currentDate())},dhx_cal_tab:function(){var t=this.getAttribute("data-tab"),a=this.getAttribute("name"),n=t||a.substring(0,a.search("_tab"));e.setCurrentView(e._date,n)},buttons:{delete:function(t){var a=e.locale.labels.confirm_deleting;e._dhtmlx_confirm(a,e.locale.labels.title_confirm_deleting,function(){e.deleteEvent(t)})},edit:function(t){e.edit(t)},save:function(t){e.editStop(!0)},details:function(t){e.showLightbox(t)},cancel:function(t){e.editStop(!1)}}},e._dhtmlx_confirm=function(t,a,n){if(!t)return n();var i={text:t};a&&(i.title=a),n&&(i.callback=function(e){e&&n()}),e.confirm(i)},e.addEventNow=function(t,a,n){var i={};e._isObject(t)&&!e._isDate(t)&&(i=t,t=null);var r=6e4*(this.config.event_duration||this.config.time_step);t||(t=i.start_date||Math.round(e._currentDate().valueOf()/r)*r);var o=new Date(t);if(!a){var s=this.config.first_hour;s>o.getHours()&&(o.setHours(s),t=o.valueOf()),a=t.valueOf()+r}var _=new Date(a);o.valueOf()==_.valueOf()&&_.setTime(_.valueOf()+r),i.start_date=i.start_date||o,i.end_date=i.end_date||_,i.text=i.text||this.locale.labels.new_event,i.id=this._drag_id=i.id||this.uid(),this._drag_mode="new-size",this._loading=!0;var d=this.addEvent(i);return this.callEvent("onEventCreated",[this._drag_id,n]),this._loading=!1,this._drag_event={},this._on_mouse_up(n),d},e._on_dbl_click=function(t,a){if(a=a||t.target||t.srcElement,!this.config.readonly){var n=e._getClassName(a).split(" ")[0];switch(n){case"dhx_scale_holder":case"dhx_scale_holder_now":case"dhx_month_body":case"dhx_wa_day_data":if(!e.config.dblclick_create)break;this.addEventNow(this.getActionData(t).date,null,t);break;case"dhx_cal_event":case"dhx_wa_ev_body":case"dhx_agenda_line":case"dhx_grid_event":case"dhx_cal_event_line":case"dhx_cal_event_clear":var i=this._locate_event(a);if(!this.callEvent("onDblClick",[i,t]))return;this.config.details_on_dblclick||this._table_view||!this.getEvent(i)._timed||!this.config.select?this.showLightbox(i):this.edit(i);break;case"dhx_time_block":case"dhx_cal_container":return;default:var r=this["dblclick_"+n];if(r)r.call(this,t);else if(a.parentNode&&a!=this)return e._on_dbl_click(t,a.parentNode)}}},e._get_column_index=function(e){var t=0;if(this._cols){for(var a=0,n=0;a+this._cols[n]=this._cols.length)for(;t>=1&&this._ignores[Math.floor(t)];)t--}return t},e._week_indexes_from_pos=function(e){if(this._cols){var t=this._get_column_index(e.x);return e.x=Math.min(this._cols.length-1,Math.max(0,Math.ceil(t)-1)),e.y=Math.max(0,Math.ceil(60*e.y/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step),e}return e},e._mouse_coords=function(t){var a,n=document.body,i=document.documentElement;a=this.$env.isIE||!t.pageX&&!t.pageY?{x:t.clientX+(n.scrollLeft||i.scrollLeft||0)-n.clientLeft,y:t.clientY+(n.scrollTop||i.scrollTop||0)-n.clientTop}:{x:t.pageX,y:t.pageY},this.config.rtl&&this._colsS?(a.x=this.$container.querySelector(".dhx_cal_data").offsetWidth-a.x,"month"!==this._mode&&(a.x-=this.xy.scale_width)):a.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);var r=this.$container.querySelector(".dhx_cal_data");a.y-=this.$domHelpers.getAbsoluteTop(r)-this._els.dhx_cal_data[0].scrollTop,a.ev=t;var o=this["mouse_"+this._mode];if(o)a=o.call(this,a);else if(this._table_view){var s=this._get_column_index(a.x);if(!this._cols||!this._colsS)return a;var _=0;for(_=1;_a.y);_++);a.y=Math.ceil(24*(Math.max(0,s)+7*Math.max(0,_-1))*60/this.config.time_step),(e._drag_mode||"month"==this._mode)&&(a.y=24*(Math.max(0,Math.ceil(s)-1)+7*Math.max(0,_-1))*60/this.config.time_step),"move"==this._drag_mode&&e._ignores_detected&&e.config.preserve_length&&(a._ignores=!0,this._drag_event._event_length||(this._drag_event._event_length=this._get_real_event_length(this._drag_event.start_date,this._drag_event.end_date,{x_step:1,x_unit:"day"}))),a.x=0}else a=this._week_indexes_from_pos(a);return a.timestamp=+new Date,a},e._close_not_saved=function(){if((new Date).valueOf()-(e._new_event||0)>500&&e._edit_id){var t=e.locale.labels.confirm_closing;e._dhtmlx_confirm(t,e.locale.labels.title_confirm_closing,function(){e.editStop(e.config.positive_closing)}),t&&(this._drag_id=this._drag_pos=this._drag_mode=null)}},e._correct_shift=function(t,a){return t-6e4*(new Date(e._min_date).getTimezoneOffset()-new Date(t).getTimezoneOffset())*(a?-1:1)},e._is_pos_changed=function(e,t){function a(e,t,a){return!!(Math.abs(e-t)>a)}return!e||!this._drag_pos||!!(this._drag_pos.has_moved||!this._drag_pos.timestamp||t.timestamp-this._drag_pos.timestamp>100||a(e.ev.clientX,t.ev.clientX,5)||a(e.ev.clientY,t.ev.clientY,5))},e._correct_drag_start_date=function(t){var a;e.matrix&&(a=e.matrix[e._mode]),a=a||{x_step:1,x_unit:"day"},t=new Date(t);var n=1;return(a._start_correction||a._end_correction)&&(n=60*(a.last_hour||0)-(60*t.getHours()+t.getMinutes())||1),1*t+(e._get_fictional_event_length(t,n,a)-n)},e._correct_drag_end_date=function(t,a){var n;e.matrix&&(n=e.matrix[e._mode]),n=n||{x_step:1,x_unit:"day"};var i=1*t+e._get_fictional_event_length(t,a,n);return new Date(1*i-(e._get_fictional_event_length(i,-1,n,-1)+1))},e._on_mouse_move=function(t){if(this._drag_mode){var a=this._mouse_coords(t);if(this._is_pos_changed(this._drag_pos,a)){var n,i;if(this._edit_id!=this._drag_id&&this._close_not_saved(),!this._drag_mode)return;var r=null;if(this._drag_pos&&!this._drag_pos.has_moved&&((r=this._drag_pos).has_moved=!0),this._drag_pos=a,this._drag_pos.has_moved=!0,"create"==this._drag_mode){if(r&&(a=r),this._close_not_saved(),this.unselect(this._select_id),this._loading=!0,n=this._get_date_from_pos(a).valueOf(),!this._drag_start)return this.callEvent("onBeforeEventCreated",[t,this._drag_id])?(this._loading=!1,void(this._drag_start=n)):void(this._loading=!1);i=n,this._drag_start;var o=new Date(this._drag_start),s=new Date(i);"day"!=this._mode&&"week"!=this._mode||o.getHours()!=s.getHours()||o.getMinutes()!=s.getMinutes()||(s=new Date(this._drag_start+1e3)),this._drag_id=this.uid(),this.addEvent(o,s,this.locale.labels.new_event,this._drag_id,a.fields),this.callEvent("onEventCreated",[this._drag_id,t]),this._loading=!1,this._drag_mode="new-size"}var _,d=this.config.time_step,l=this.getEvent(this._drag_id);if(e.matrix&&(_=e.matrix[e._mode]),_=_||{x_step:1,x_unit:"day"},"move"==this._drag_mode)n=this._min_date.valueOf()+6e4*(a.y*this.config.time_step+24*a.x*60),!a.custom&&this._table_view&&(n+=1e3*this.date.time_part(l.start_date)),!this._table_view&&this._dragEventBody&&void 0===this._drag_event._move_event_shift&&(this._drag_event._move_event_shift=n-l.start_date),this._drag_event._move_event_shift&&(n-=this._drag_event._move_event_shift),n=this._correct_shift(n),a._ignores&&this.config.preserve_length&&this._table_view?(n=e._correct_drag_start_date(n),i=e._correct_drag_end_date(n,this._drag_event._event_length)):i=l.end_date.valueOf()-(l.start_date.valueOf()-n);else{if(n=l.start_date.valueOf(),i=l.end_date.valueOf(),this._table_view){var c=this._min_date.valueOf()+a.y*this.config.time_step*6e4+(a.custom?0:864e5);if("month"==this._mode)if(c=this._correct_shift(c,!1),this._drag_from_start){var u=864e5;c<=e.date.date_part(new Date(i+u-1)).valueOf()&&(n=c-u)}else i=c;else this.config.preserve_length?a.resize_from_start?n=e._correct_drag_start_date(c):i=e._correct_drag_end_date(c,0):a.resize_from_start?n=c:i=c}else{var h=this.date.date_part(new Date(l.end_date.valueOf()-1)).valueOf(),f=new Date(h),p=this.config.first_hour,v=60/d*(this.config.last_hour-p);this.config.time_step=1;var g=this._mouse_coords(t);this.config.time_step=d;var m=a.y*d*6e4,y=Math.min(a.y+1,v)*d*6e4,b=6e4*g.y;i=Math.abs(m-b)>Math.abs(y-b)?h+y:h+m,i+=6e4*(new Date(i).getTimezoneOffset()-f.getTimezoneOffset()),this._els.dhx_cal_data[0].style.cursor="s-resize","week"!=this._mode&&"day"!=this._mode||(i=this._correct_shift(i))}if("new-size"==this._drag_mode)if(i<=this._drag_start){var x=a.shift||(this._table_view&&!a.custom?864e5:0);n=i-(a.shift?0:x),i=this._drag_start+(x||6e4*d)}else n=this._drag_start;else i<=n&&(i=n+6e4*d)}var k=new Date(i-1),w=new Date(n);if("move"==this._drag_mode&&e.config.limit_drag_out&&(+w<+e._min_date||+i>+e._max_date)){if(+l.start_date<+e._min_date||+l.end_date>+e._max_date)w=new Date(l.start_date),i=new Date(l.end_date);else{var E=i-w;+w<+e._min_date?(w=new Date(e._min_date),a._ignores&&this.config.preserve_length&&this._table_view?(w=new Date(e._correct_drag_start_date(w)),_._start_correction&&(w=new Date(w.valueOf()+_._start_correction)),i=new Date(1*w+this._get_fictional_event_length(w,this._drag_event._event_length,_))):i=new Date(+w+E)):(i=new Date(e._max_date),a._ignores&&this.config.preserve_length&&this._table_view?(_._end_correction&&(i=new Date(i.valueOf()-_._end_correction)),i=new Date(1*i-this._get_fictional_event_length(i,0,_,!0)),w=new Date(1*i-this._get_fictional_event_length(i,this._drag_event._event_length,_,!0)),this._ignores_detected&&(w=e.date.add(w,_.x_step,_.x_unit),i=new Date(1*i-this._get_fictional_event_length(i,0,_,!0)),i=e.date.add(i,_.x_step,_.x_unit))):w=new Date(+i-E))}k=new Date(i-1)}if(!this._table_view&&this._dragEventBody&&!e.config.all_timed&&(!e._get_section_view()&&a.x!=this._get_event_sday({start_date:new Date(n),end_date:new Date(n)})||new Date(n).getHours()=this.config.last_hour)||(E=i-w,u=this._min_date.valueOf()+24*a.x*60*6e4,(i=e.date.date_part(new Date(u))).setHours(this.config.last_hour),k=new Date(i-1),"move"==this._drag_mode&&(w=new Date(+i-E))),this._table_view||k.getDate()==w.getDate()&&k.getHours()=r?b="dhx_after":n.valueOf()==s.valueOf()&&(b="dhx_now"),this._ignores_detected&&this._ignores[m]&&(b+=" dhx_scale_ignore"),y.className=b+" "+this.templates.month_date_class(n,s),y.setAttribute("data-cell-date",e.templates.format_date(n));var x="dhx_month_body",k="dhx_month_head";if(0===m&&this.config.left_border&&(x+=" dhx_month_body_border",k+=" dhx_month_head_border"),this._ignores_detected&&this._ignores[m])y.appendChild(document.createElement("div")),y.appendChild(document.createElement("div"));else{this._waiAria.monthCellAttr(y,n);var w=document.createElement("div");w.className=k,w.innerHTML=this.templates.month_day(n),y.appendChild(w);var E=document.createElement("div");E.className=x,E.style.height=g+"px",E.style.width=_[m],y.appendChild(E)}p.push(n);var S=n.getDate();(n=this.date.add(n,1,"day")).getDate()-S>1&&(n=new Date(n.getFullYear(),n.getMonth(),S+1,12,0))}e._colsS.heights[d]=u,u+=c(d)}this._min_date=o,this._max_date=n,t.innerHTML="",t.appendChild(h),this._scales={};var D=t.getElementsByTagName("div");for(d=0;d","gm"),a=new RegExp(" +","gm");function n(e){return(e+"").replace(t," ").replace(a," ")}var i=new RegExp("'","gm");function r(e){return(e+"").replace(i,"'")}for(var o in e._waiAria={getAttributeString:function(e){var t=[" "];for(var a in e)if("function"!=typeof e[a]&&"object"!=f(e[a])){var i=r(n(e[a]));t.push(a+"='"+i+"'")}return t.push(" "),t.join(" ")},setAttributes:function(e,t){for(var a in t)e.setAttribute(a,n(t[a]));return e},labelAttr:function(e,t){return this.setAttributes(e,{"aria-label":t})},label:function(t){return e._waiAria.getAttributeString({"aria-label":t})},hourScaleAttr:function(e,t){this.labelAttr(e,t)},monthCellAttr:function(t,a){this.labelAttr(t,e.templates.day_date(a))},navBarDateAttr:function(e,t){this.labelAttr(e,t)},dayHeaderAttr:function(e,t){this.labelAttr(e,t)},dayColumnAttr:function(t,a){this.dayHeaderAttr(t,e.templates.day_date(a))},headerButtonsAttributes:function(e,t){return this.setAttributes(e,{role:"button","aria-label":t})},headerToggleState:function(e,t){return this.setAttributes(e,{"aria-pressed":t?"true":"false"})},getHeaderCellAttr:function(t){return e._waiAria.getAttributeString({"aria-label":t})},eventAttr:function(e,t){this._eventCommonAttr(e,t)},_eventCommonAttr:function(t,a){a.setAttribute("aria-label",n(e.templates.event_text(t.start_date,t.end_date,t))),e.config.readonly&&a.setAttribute("aria-readonly",!0),t.$dataprocessor_class&&a.setAttribute("aria-busy",!0),a.setAttribute("aria-selected",e.getState().select_id==t.id?"true":"false")},setEventBarAttr:function(e,t){this._eventCommonAttr(e,t)},_getAttributes:function(e,t){var a={setAttribute:function(e,t){this[e]=t}};return e.apply(this,[t,a]),a},eventBarAttrString:function(e){return this.getAttributeString(this._getAttributes(this.setEventBarAttr,e))},agendaHeadAttrString:function(){return this.getAttributeString({role:"row"})},agendaHeadDateString:function(e){return this.getAttributeString({role:"columnheader","aria-label":e})},agendaHeadDescriptionString:function(e){return this.agendaHeadDateString(e)},agendaDataAttrString:function(){return this.getAttributeString({role:"grid"})},agendaEventAttrString:function(e){var t=this._getAttributes(this._eventCommonAttr,e);return t.role="row",this.getAttributeString(t)},agendaDetailsBtnString:function(){return this.getAttributeString({role:"button","aria-label":e.locale.labels.icon_details})},gridAttrString:function(){return this.getAttributeString({role:"grid"})},gridRowAttrString:function(e){return this.agendaEventAttrString(e)},gridCellAttrString:function(e,t,a){return this.getAttributeString({role:"gridcell","aria-label":[void 0===t.label?t.id:t.label,": ",a]})},mapAttrString:function(){return this.gridAttrString()},mapRowAttrString:function(e){return this.gridRowAttrString(e)},mapDetailsBtnString:function(){return this.agendaDetailsBtnString()},minicalHeader:function(e,t){this.setAttributes(e,{id:t+"","aria-live":"assertice","aria-atomic":"true"})},minicalGrid:function(e,t){this.setAttributes(e,{"aria-labelledby":t+"",role:"grid"})},minicalRow:function(e){this.setAttributes(e,{role:"row"})},minicalDayCell:function(t,a){var n=a.valueOf()=e._min_date.valueOf();this.setAttributes(t,{role:"gridcell","aria-label":e.templates.day_date(a),"aria-selected":n?"true":"false"})},minicalHeadCell:function(e){this.setAttributes(e,{role:"columnheader"})},weekAgendaDayCell:function(t,a){var n=t.querySelector(".dhx_wa_scale_bar"),i=t.querySelector(".dhx_wa_day_data"),r=e.uid()+"";this.setAttributes(n,{id:r}),this.setAttributes(i,{"aria-labelledby":r})},weekAgendaEvent:function(e,t){this.eventAttr(t,e)},lightboxHiddenAttr:function(e){e.setAttribute("aria-hidden","true")},lightboxVisibleAttr:function(e){e.setAttribute("aria-hidden","false")},lightboxSectionButtonAttrString:function(e){return this.getAttributeString({role:"button","aria-label":e,tabindex:"0"})},yearHeader:function(e,t){this.setAttributes(e,{id:t+""})},yearGrid:function(e,t){this.minicalGrid(e,t)},yearHeadCell:function(e){return this.minicalHeadCell(e)},yearRow:function(e){return this.minicalRow(e)},yearDayCell:function(e){this.setAttributes(e,{role:"gridcell"})},lightboxAttr:function(e){e.setAttribute("role","dialog"),e.setAttribute("aria-hidden","true"),e.firstChild.setAttribute("role","heading")},lightboxButtonAttrString:function(t){return this.getAttributeString({role:"button","aria-label":e.locale.labels[t],tabindex:"0"})},eventMenuAttrString:function(t){return this.getAttributeString({role:"button","aria-label":e.locale.labels[t]})},lightboxHeader:function(e,t){e.setAttribute("aria-label",t)},lightboxSelectAttrString:function(t){var a="";switch(t){case"%Y":a=e.locale.labels.year;break;case"%m":a=e.locale.labels.month;break;case"%d":a=e.locale.labels.day;break;case"%H:%i":a=e.locale.labels.hour+" "+e.locale.labels.minute}return e._waiAria.getAttributeString({"aria-label":a})},messageButtonAttrString:function(e){return"tabindex='0' role='button' aria-label='"+e+"'"},messageInfoAttr:function(e){e.setAttribute("role","alert")},messageModalAttr:function(e,t){e.setAttribute("role","dialog"),t&&e.setAttribute("aria-labelledby",t)},quickInfoAttr:function(e){e.setAttribute("role","dialog")},quickInfoHeaderAttrString:function(){return" role='heading' "},quickInfoHeader:function(e,t){e.setAttribute("aria-label",t)},quickInfoButtonAttrString:function(t){return e._waiAria.getAttributeString({role:"button","aria-label":t,tabindex:"0"})},tooltipAttr:function(e){e.setAttribute("role","tooltip")},tooltipVisibleAttr:function(e){e.setAttribute("aria-hidden","false")},tooltipHiddenAttr:function(e){e.setAttribute("aria-hidden","true")}},e._waiAria)e._waiAria[o]=function(t){return function(){return e.config.wai_aria_attributes?t.apply(this,arguments):" "}}(e._waiAria[o])}()}(t),t.utils=m,t.$domHelpers=C,t.utils.dom=C,t.uid=m.uid,t.mixin=m.mixin,t.defined=m.defined,t.assert=function(e){return function(t,a){t||e.config.show_errors&&!1!==e.callEvent("onError",[a])&&(e.message?e.message({type:"error",text:a,expire:-1}):console.log(a))}}(t),t.copy=m.copy,t._getFocusableNodes=C.getFocusableNodes,t._getClassName=C.getClassName,t._locate_css=C.locateCss;var a=W(t);t.utils.mixin(t,a),t.env=t.$env=M,t.Promise=O,function(e){e.destructor=function(){for(var t in e.callEvent("onDestroy",[]),this.clearAll(),this.$container&&(this.$container.innerHTML=""),this._eventRemoveAll&&this._eventRemoveAll(),this.resetLightbox&&this.resetLightbox(),this._dp&&this._dp.destructor&&this._dp.destructor(),this.detachAllEvents(),this)0===t.indexOf("$")&&delete this[t];e.$destroyed=!0}}(t),function(e){function t(e,t){var a={method:e};if(0===t.length)throw new Error("Arguments list of query is wrong.");if(1===t.length)return"string"==typeof t[0]?(a.url=t[0],a.async=!0):(a.url=t[0].url,a.async=t[0].async||!0,a.callback=t[0].callback,a.headers=t[0].headers),t[0].data?"string"!=typeof t[0].data?a.data=j()(t[0].data):a.data=t[0].data:a.data="",a;switch(a.url=t[0],e){case"GET":case"DELETE":a.callback=t[1],a.headers=t[2];break;case"POST":case"PUT":t[1]?"string"!=typeof t[1]?a.data=j()(t[1]):a.data=t[1]:a.data="",a.callback=t[2],a.headers=t[3]}return a}e.Promise=O,e.ajax={cache:!0,method:"get",serializeRequestParams:j.a,parse:function(t){return"string"!=typeof t?t:(t=t.replace(/^[\s]+/,""),"undefined"==typeof DOMParser||e.$env.isIE?void 0!==window.ActiveXObject&&((a=new window.ActiveXObject("Microsoft.XMLDOM")).async="false",a.loadXML(t)):a=(new DOMParser).parseFromString(t,"text/xml"),a);var a},xmltop:function(t,a,n){if(void 0===a.status||a.status<400){var i=a.responseXML?a.responseXML||a:this.parse(a.responseText||a);if(i&&null!==i.documentElement&&!i.getElementsByTagName("parsererror").length)return i.getElementsByTagName(t)[0]}return-1!==n&&e.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],n]),document.createElement("DIV")},xpath:function(t,a){if(a.nodeName||(a=a.responseXML||a),e.$env.isIE)return a.selectNodes(t)||[];for(var n,i=[],r=(a.ownerDocument||a).evaluate(t,a,null,XPathResult.ANY_TYPE,null);n=r.iterateNext();)i.push(n);return i},query:function(e){return this._call(e.method||"GET",e.url,e.data||"",e.async||!0,e.callback,e.headers)},get:function(e,a,n){var i=t("GET",arguments);return this.query(i)},getSync:function(e,a){var n=t("GET",arguments);return n.async=!1,this.query(n)},put:function(e,a,n,i){var r=t("PUT",arguments);return this.query(r)},del:function(e,a,n){var i=t("DELETE",arguments);return this.query(i)},post:function(e,a,n,i){1==arguments.length?a="":2==arguments.length&&"function"==typeof a&&(a="");var r=t("POST",arguments);return this.query(r)},postSync:function(e,a,n){a=null===a?"":String(a);var i=t("POST",arguments);return i.async=!1,this.query(i)},_call:function(t,a,n,i,r,o){return new e.Promise(function(s,_){var d=void 0===("undefined"==typeof XMLHttpRequest?"undefined":L(XMLHttpRequest))||e.$env.isIE?new window.ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest,l=null!==navigator.userAgent.match(/AppleWebKit/)&&null!==navigator.userAgent.match(/Qt/)&&null!==navigator.userAgent.match(/Safari/);if(i&&d.addEventListener("readystatechange",function(){if(4==d.readyState||l&&3==d.readyState){if((200!=d.status||""===d.responseText)&&!e.callEvent("onAjaxError",[d]))return;setTimeout(function(){"function"==typeof r&&r.apply(window,[{xmlDoc:d,filePath:a}]),s(d),"function"==typeof r&&(r=null,d=null)},0)}}),"GET"!=t||this.cache||(a+=(a.indexOf("?")>=0?"&":"?")+"dhxr"+(new Date).getTime()+"=1"),d.open(t,a,i),o)for(var c in o)d.setRequestHeader(c,o[c]);else"POST"==t.toUpperCase()||"PUT"==t||"DELETE"==t?d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):"GET"==t&&(n=null);if(d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(n),!i)return{xmlDoc:d,filePath:a}}.bind(this))},urlSeparator:function(e){return-1!=e.indexOf("?")?"&":"?"}},e.$ajax=e.ajax}(t),$(t),function(e){e.config={default_date:"%j %M %Y",month_date:"%F %Y",load_date:"%Y-%m-%d",week_date:"%l",day_date:"%D, %F %j",hour_date:"%H:%i",month_day:"%d",date_format:"%Y-%m-%d %H:%i",api_date:"%d-%m-%Y %H:%i",parse_exact_format:!1,preserve_length:!0,time_step:5,start_on_monday:!0,first_hour:0,last_hour:24,readonly:!1,drag_resize:!0,drag_move:!0,drag_create:!0,drag_event_body:!0,dblclick_create:!0,edit_on_create:!0,details_on_create:!1,header:null,resize_month_events:!1,resize_month_timed:!1,responsive_lightbox:!1,rtl:!1,cascade_event_display:!1,cascade_event_count:4,cascade_event_margin:30,multi_day:!0,multi_day_height_limit:0,drag_lightbox:!0,preserve_scroll:!0,select:!0,server_utc:!1,touch:!0,touch_tip:!0,touch_drag:500,touch_swipe_dates:!1,quick_info_detached:!0,positive_closing:!1,drag_highlight:!0,limit_drag_out:!1,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],buttons_left:["dhx_save_btn","dhx_cancel_btn"],buttons_right:["dhx_delete_btn"],lightbox:{sections:[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"time",height:72,type:"time",map_to:"auto"}]},highlight_displayed_event:!0,left_border:!1,ajax_error:"alert",delay_render:0,timeline_swap_resize:!0,wai_aria_attributes:!0,wai_aria_application_role:!0,csp:"auto",event_attribute:"data-event-id",show_errors:!0},e.config.buttons_left.$initial=e.config.buttons_left.join(),e.config.buttons_right.$initial=e.config.buttons_right.join(),e._helpers={parseDate:function(t){return(e.templates.xml_date||e.templates.parse_date)(t)},formatDate:function(t){return(e.templates.xml_format||e.templates.format_date)(t)}},e.templates={},e.init_templates=function(){var t=e.locale.labels;t.dhx_save_btn=t.icon_save,t.dhx_cancel_btn=t.icon_cancel,t.dhx_delete_btn=t.icon_delete;var a=e.date.date_to_str,n=e.config;!function(e,t){for(var a in t)e[a]||(e[a]=t[a])}(e.templates,{day_date:a(n.default_date),month_date:a(n.month_date),week_date:function(t,a){return n.rtl?e.templates.day_date(e.date.add(a,-1,"day"))+" – "+e.templates.day_date(t):e.templates.day_date(t)+" – "+e.templates.day_date(e.date.add(a,-1,"day"))},day_scale_date:a(n.default_date),month_scale_date:a(n.week_date),week_scale_date:a(n.day_date),hour_scale:a(n.hour_date),time_picker:a(n.hour_date),event_date:a(n.hour_date),month_day:a(n.month_day),load_format:a(n.load_date),format_date:a(n.date_format,n.server_utc),parse_date:e.date.str_to_date(n.date_format,n.server_utc),api_date:e.date.str_to_date(n.api_date,!1,!1),event_header:function(t,a,n){return e.templates.event_date(t)+" - "+e.templates.event_date(a)},event_text:function(e,t,a){return a.text},event_class:function(e,t,a){return""},month_date_class:function(e){return""},week_date_class:function(e){return""},event_bar_date:function(t,a,n){return e.templates.event_date(t)+" "},event_bar_text:function(e,t,a){return a.text},month_events_link:function(e,t){return"View more("+t+" events)"},drag_marker_class:function(e,t,a){return""},drag_marker_content:function(e,t,a){return""},tooltip_date_format:e.date.date_to_str("%Y-%m-%d %H:%i"),tooltip_text:function(t,a,n){return"Event: "+n.text+"
Start date: "+e.templates.tooltip_date_format(t)+"
End date: "+e.templates.tooltip_date_format(a)}}),this.callEvent("onTemplatesReady",[])}}(t),function(e){e._events={},e.clearAll=function(){this._events={},this._loaded={},this._edit_id=null,this._select_id=null,this._drag_id=null,this._drag_mode=null,this._drag_pos=null,this._new_event=null,this.clear_view(),this.callEvent("onClearAll",[])},e.addEvent=function(t,a,n,i,r){if(!arguments.length)return this.addEventNow();var o=t;1!=arguments.length&&((o=r||{}).start_date=t,o.end_date=a,o.text=n,o.id=i),o.id=o.id||e.uid(),o.text=o.text||"","string"==typeof o.start_date&&(o.start_date=this.templates.api_date(o.start_date)),"string"==typeof o.end_date&&(o.end_date=this.templates.api_date(o.end_date));var s=6e4*(this.config.event_duration||this.config.time_step);o.start_date.valueOf()==o.end_date.valueOf()&&o.end_date.setTime(o.end_date.valueOf()+s),o.start_date.setMilliseconds(0),o.end_date.setMilliseconds(0),o._timed=this.isOneDayEvent(o);var _=!this._events[o.id];return this._events[o.id]=o,this.event_updated(o),this._loading||this.callEvent(_?"onEventAdded":"onEventChanged",[o.id,o]),o.id},e.deleteEvent=function(t,a){var n=this._events[t];(a||this.callEvent("onBeforeEventDelete",[t,n])&&this.callEvent("onConfirmedBeforeEventDelete",[t,n]))&&(n&&(e.getState().select_id==t&&e.unselect(),delete this._events[t],this.event_updated(n),this._drag_id==n.id&&(this._drag_id=null,this._drag_mode=null,this._drag_pos=null)),this.callEvent("onEventDeleted",[t,n]))},e.getEvent=function(e){return this._events[e]},e.setEvent=function(e,t){t.id||(t.id=e),this._events[e]=t},e.for_rendered=function(e,t){for(var a=this._rendered.length-1;a>=0;a--)this._rendered[a].getAttribute(this.config.event_attribute)==e&&t(this._rendered[a],a)},e.changeEventId=function(t,a){if(t!=a){var n=this._events[t];n&&(n.id=a,this._events[a]=n,delete this._events[t]),this.for_rendered(t,function(t){t.setAttribute("event_id",a),t.setAttribute(e.config.event_attribute,a)}),this._select_id==t&&(this._select_id=a),this._edit_id==t&&(this._edit_id=a),this.callEvent("onEventIdChange",[t,a])}},function(){for(var t=["text","Text","start_date","StartDate","end_date","EndDate"],a=function(t){return function(a){return e.getEvent(a)[t]}},n=function(t){return function(a,n){var i=e.getEvent(a);i[t]=n,i._changed=!0,i._timed=this.isOneDayEvent(i),e.event_updated(i,!0)}},i=0;in||a<=i)&&(t>=n||t24-(this.config.last_hour-this.config.first_hour)||ti))}return!1},e.isOneDayEvent=function(e){var t=new Date(e.end_date.valueOf()-1);return e.start_date.getFullYear()===t.getFullYear()&&e.start_date.getMonth()===t.getMonth()&&e.start_date.getDate()===t.getDate()&&e.end_date.valueOf()-e.start_date.valueOf()<864e5},e.get_visible_events=function(e){var t=[];for(var a in this._events)this.is_visible_events(this._events[a])&&(e&&!this._events[a]._timed||this.filter_event(a,this._events[a])&&t.push(this._events[a]));return t},e.filter_event=function(e,t){var a=this["filter_"+this._mode];return!a||a(e,t)},e._is_main_area_event=function(e){return!!e._timed},e.render_view_data=function(t,a){var n=!1;if(!t){if(n=!0,this._not_render)return void(this._render_wait=!0);this._render_wait=!1,this.clear_view(),t=this.get_visible_events(!(this._table_view||this.config.multi_day))}for(var i=0,r=t.length;il){var c=l;1*this.config.max_month_events!==this.config.max_month_events||r[_]<=this.config.max_month_events?c=r[_]*n:(this.config.max_month_events+1)*n>l&&(c=(this.config.max_month_events+1)*n);for(var u=0;ut.id?1:-1:e.start_date>t.start_date?1:-1});var a=[],n=[];this._min_mapped_duration=Math.ceil(60*this.xy.min_event_height/this.config.hour_size_px);for(var i=0;ig&&(g=l[f]._sorder);r._sorder=g+1,r._inner=!1}else r._sorder=0;l.splice(u,u==l.length?0:1,r),l.length>(l.max_count||0)?(l.max_count=l.length,r._count=l.length):r._count=r._count?r._count:1}(_=this.config.last_hour)&&(n.push(r),e[i]=r=this._copy_event(r),_=this.config.last_hour&&(r.end_date.setMinutes(0),r.end_date.setHours(this.config.last_hour)),r.start_date>r.end_date||_==this.config.last_hour)&&(e.splice(i,1),i--)}}if(!t){for(i=0;it.id?1:-1:e.start_date>t.start_date?1:-1})},e._is_any_multiday_cell_visible=function(t,a,n){var i=this._cols.length,r=!1,o=t,s=!0,_=new Date(a);for(e.date.day_start(new Date(a)).valueOf()!=a.valueOf()&&(_=e.date.day_start(_),_=e.date.add(_,1,"day"));o<_;){s=!1;var d=this.locate_holder_day(o,!1,n)%i;if(!this._ignores[d]){r=!0;break}o=e.date.add(o,1,"day")}return s||r},e._pre_render_events_table=function(t,a){this._time_order(t);for(var n,i=[],r=[[],[],[],[],[],[],[]],o=this._colsS.heights,s=this._cols.length,_={},d=0;dthis._max_date&&(u.last_chunk=!1,f=this._max_date);var p=this.locate_holder_day(h,!1,l);if(l._sday=p%s,!this._ignores[l._sday]||!l._timed){var v=this.locate_holder_day(f,!0,l)||s;if(l._eday=v%s||s,l._length=v-p,l._sweek=Math.floor((this._correct_shift(h.valueOf(),1)-this._min_date.valueOf())/(864e5*s)),e._is_any_multiday_cell_visible(h,f,l)){var g,m=r[l._sweek];for(g=0;g",this._editor=y.querySelector("textarea"),this._quirks7&&(this._editor.style.height=d-12+"px"),e.event(this._editor,"keydown",function(t){if(t.shiftKey)return!0;var a=t.keyCode;a==e.keys.edit_save&&e.editStop(!0),a==e.keys.edit_cancel&&e.editStop(!1),a!=e.keys.edit_save&&a!=e.keys.edit_cancel||t.preventDefault&&t.preventDefault()}),e.event(this._editor,"selectstart",function(e){return e.cancelBubble=!0,!0}),e._focus(this._editor,!0),this._els.dhx_cal_data[0].scrollLeft=0}if(0!==this.xy.menu_width&&this._select_id==t.id){this.config.cascade_event_display&&this._drag_mode&&(g.style.zIndex=1);for(var b,x=this.config["icons_"+(this._edit_id==t.id?"edit":"select")],k="",w=t.color?"background-color: "+t.color+";":"",E=t.textColor?"color: "+t.textColor+";":"",S=0;S
";var D=this._render_v_bar(t,h-i+1,_,i,20*x.length+26-2,"","
",k,!0);D.style.left=h-i+1,this._els.dhx_cal_data[0].appendChild(D),this._rendered.push(D)}this.config.drag_highlight&&this._drag_id==t.id&&this.highlightEventPosition(t)}}},e._render_v_bar=function(t,a,n,i,r,o,s,_,d){var l=document.createElement("div"),c=t.id,u=d?"dhx_cal_event dhx_cal_select_menu":"dhx_cal_event",h=e.getState();h.drag_id==t.id&&(u+=" dhx_cal_event_drag"),h.select_id==t.id&&(u+=" dhx_cal_event_selected");var f=e.templates.event_class(t.start_date,t.end_date,t);f&&(u=u+" "+f),this.config.cascade_event_display&&(u+=" dhx_cal_event_cascade");var p=t.color?"background-color:"+t.color+";":"",v=t.textColor?"color:"+t.textColor+";":"",g=e._border_box_events(),m=i-2,y=g?m:i-4,b=g?m:i-6,x=g?m:i-(this._quirks?4:14),k=g?m-2:i-8,w=g?r-this.xy.event_header_height-1:r-(this._quirks?20:30)+1,E='
';l.innerHTML=E;var S=l.cloneNode(!0).firstChild;if(!d&&e.renderEvent(S,t,i,r,s,_))return S;S=l.firstChild;var D='
 
';D+='
'+s+"
",D+='
'+_+"
";var N="dhx_event_resize dhx_footer";return(d||!1===t._drag_resize)&&(N="dhx_resize_denied "+N),D+='
',S.innerHTML=D,S},e.renderEvent=function(){return!1},e.locate_holder=function(e){return"day"==this._mode?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[e]},e.locate_holder_day=function(e,t){var a=Math.floor((this._correct_shift(e,1)-this._min_date)/864e5);return t&&this.date.time_part(e)&&a++,a},e._get_dnd_order=function(e,t,a){if(!this._drag_event)return e;this._drag_event._orig_sorder?e=this._drag_event._orig_sorder:this._drag_event._orig_sorder=e;for(var n=t*e;n+t>a;)e--,n-=t;return e=Math.max(e,0)},e._get_event_bar_pos=function(t){var a=this.config.rtl,n=this._colsS,i=n[t._sday],r=n[t._eday];a&&(i=n[n.col_length]-n[t._eday]+n[0],r=n[n.col_length]-n[t._sday]+n[0]),r==i&&(r=n[t._eday+1]);var o=this.xy.bar_height,s=t._sorder;if(t.id==this._drag_id){var _=n.heights[t._sweek+1]-n.heights[t._sweek]-this.xy.month_head_height;s=e._get_dnd_order(s,o,_)}var d=s*o;return{x:i,x2:r,y:n.heights[t._sweek]+(n.height?this.xy.month_scale_height+2:2)+d}},e.render_event_bar=function(t){var a=this._rendered_location,n=this._get_event_bar_pos(t),i=n.y,r=n.x,o=n.x2,s="";if(o){var _=e.config.resize_month_events&&"month"==this._mode&&(!t._timed||e.config.resize_month_timed),d=document.createElement("div"),l=t.hasOwnProperty("_first_chunk")&&t._first_chunk,c=t.hasOwnProperty("_last_chunk")&&t._last_chunk,u=_&&(t._timed||l),h=_&&(t._timed||c),f=!0,p="dhx_cal_event_clear";t._timed&&!_||(f=!1,p="dhx_cal_event_line"),l&&(p+=" dhx_cal_event_line_start"),c&&(p+=" dhx_cal_event_line_end"),u&&(s+="
"),h&&(s+="
");var v=e.templates.event_class(t.start_date,t.end_date,t);v&&(p+=" "+v);var g=t.color?"background:"+t.color+";":"",m=t.textColor?"color:"+t.textColor+";":"",y=["position:absolute","top:"+i+"px","left:"+r+"px","width:"+(o-r-3-(f?1:0))+"px",m,g,t._text_style||""].join(";"),b="
";_&&(b+=s),"month"==e.getState().mode&&(t=e.getEvent(t.id)),t._timed&&(b+=e.templates.event_bar_date(t.start_date,t.end_date,t)),b+=e.templates.event_bar_text(t.start_date,t.end_date,t)+"
",b+="
",d.innerHTML=b,this._rendered.push(d.firstChild),a.appendChild(d.firstChild)}},e._locate_event=function(e){for(var t=null;e&&!t&&e.getAttribute;)t=e.getAttribute(this.config.event_attribute),e=e.parentNode;return t},e.edit=function(e){this._edit_id!=e&&(this.editStop(!1,e),this._edit_id=e,this.updateEvent(e))},e.editStop=function(e,t){if(!t||this._edit_id!=t){var a=this.getEvent(this._edit_id);a&&(e&&(a.text=this._editor.value),this._edit_id=null,this._editor=null,this.updateEvent(a.id),this._edit_stop_event(a,e))}},e._edit_stop_event=function(e,t){this._new_event?(t?this.callEvent("onEventAdded",[e.id,e]):e&&this.deleteEvent(e.id,!0),this._new_event=null):t&&this.callEvent("onEventChanged",[e.id,e])},e.getEvents=function(e,t){var a=[];for(var n in this._events){var i=this._events[n];i&&(!e&&!t||i.start_datee)&&a.push(i)}return a},e.getRenderedEvent=function(t){if(t){for(var a=e._rendered,n=0;n-1&&(c=c.split(e.config.section_delimiter)[0])}var u=_.getSectionTop(c),h=_.posFromDate(l.start_date),f=e.$container.querySelector(".dhx_timeline_data_wrapper");if(h-=(f.offsetWidth-_.dx)/2,u=u-f.offsetHeight/2+_.dy/2,_._smartRenderingEnabled())var p=_.attachEvent("onScroll",function(){v(),_.detachEvent(p)});_.scrollTo({left:h,top:u}),_._smartRenderingEnabled()||v()}}else v();e.callEvent("onAfterEventDisplay",[n,a])}function v(){n.color=o,n.textColor=s}}}(t),function(e){e._append_drag_marker=function(t){if(!t.parentNode){var a=e._els.dhx_cal_data[0].lastChild,n=e._getClassName(a);n.indexOf("dhx_scale_holder")<0&&a.previousSibling&&(a=a.previousSibling),n=e._getClassName(a),a&&0===n.indexOf("dhx_scale_holder")&&a.appendChild(t)}},e._update_marker_position=function(t,a){var n=e._calc_event_y(a,0);t.style.top=n.top+"px",t.style.height=n.height+"px"},e.highlightEventPosition=function(e){var t=document.createElement("div");t.setAttribute("event_id",e.id),t.setAttribute(this.config.event_attribute,e.id),this._rendered.push(t),this._update_marker_position(t,e);var a=this.templates.drag_marker_class(e.start_date,e.end_date,e),n=this.templates.drag_marker_content(e.start_date,e.end_date,e);t.className="dhx_drag_marker",a&&(t.className+=" "+a),n&&(t.innerHTML=n),this._append_drag_marker(t)}}(t),B(t),function(e){e._lightbox_controls={},e.formSection=function(t){for(var a=this.config.lightbox.sections,n=0;n
"},set_value:function(e,t,a,n){e.innerHTML=t||""},get_value:function(e,t,a){return e.innerHTML||""},focus:function(e){}},textarea:{render:function(t){var a=e._lightbox_controls.defaults.textarea,n=a?a.height:200;return"
"},set_value:function(t,a,n){e.form_blocks.textarea._get_input(t).value=a||""},get_value:function(t,a){return e.form_blocks.textarea._get_input(t).value},focus:function(t){var a=e.form_blocks.textarea._get_input(t);e._focus(a,!0)},_get_input:function(e){return e.getElementsByTagName("textarea")[0]}},select:{render:function(t){for(var a=e._lightbox_controls.defaults.select,n=a?a.height:23,i="
"},set_value:function(t,a,n,i){var r=t.firstChild;!r._dhx_onchange&&i.onchange&&(e.event(r,"change",i.onchange),r._dhx_onchange=!0),void 0===a&&(a=(r.options[0]||{}).value),r.value=a||""},get_value:function(e,t){return e.firstChild.value},focus:function(t){var a=t.firstChild;e._focus(a,!0)}},time:{render:function(t){t.time_format||(t.time_format=["%H:%i","%d","%m","%Y"]),t._time_format_order={};var a=t.time_format,n=e.config,i=e.date.date_part(e._currentDate()),r=1440,o=0;e.config.limit_time_select&&(r=60*n.last_hour+1,o=60*n.first_hour,i.setHours(n.first_hour));for(var s="",_=0;_0&&(s+=" ");var l="",c="";switch(d){case"%Y":var u,h,f;l="dhx_lightbox_year_select",t._time_format_order[3]=_,t.year_range&&(isNaN(t.year_range)?t.year_range.push&&(h=t.year_range[0],f=t.year_range[1]):u=t.year_range),u=u||10;var p=p||Math.floor(u/2);h=h||i.getFullYear()-p,f=f||h+u;for(var v=h;v"+v+"";break;case"%m":for(l="dhx_lightbox_month_select",t._time_format_order[2]=_,v=0;v<12;v++)c+="";break;case"%d":for(l="dhx_lightbox_day_select",t._time_format_order[1]=_,v=1;v<32;v++)c+="";break;case"%H:%i":l="dhx_lightbox_time_select",t._time_format_order[0]=_,v=o;var g=i.getDate();for(t._time_values=[];v"+this.templates.time_picker(i)+"",t._time_values.push(v),i.setTime(i.valueOf()+60*this.config.time_step*1e3),v=24*(i.getDate()!=g?1:0)*60+60*i.getHours()+i.getMinutes()}if(c){var m=e._waiAria.lightboxSelectAttrString(d);s+=" "}}var y=e._lightbox_controls.defaults.select,b=y?y.height:23;return"
"+s+"  –  "+s+"
"},set_value:function(t,a,n,i){var r,o,s=e.config,_=t.getElementsByTagName("select"),d=i._time_format_order;if(s.full_day){if(!t._full_day){var l="";e.config.wide_form||(l=t.previousSibling.innerHTML+l),t.previousSibling.innerHTML=l,t._full_day=!0}var c=t.previousSibling.getElementsByTagName("input")[0];c.checked=0===e.date.time_part(n.start_date)&&0===e.date.time_part(n.end_date),_[d[0]].disabled=c.checked,_[d[0]+_.length/2].disabled=c.checked,c.$_eventAttached||(c.$_eventAttached=!0,e.event(c,"click",function(){if(c.checked){var a={};e.form_blocks.time.get_value(t,a,i),r=e.date.date_part(a.start_date),(+(o=e.date.date_part(a.end_date))==+r||+o>=+r&&(0!==n.end_date.getHours()||0!==n.end_date.getMinutes()))&&(o=e.date.add(o,1,"day"))}else r=null,o=null;_[d[0]].disabled=c.checked,_[d[0]+_.length/2].disabled=c.checked,f(_,0,r||n.start_date),f(_,4,o||n.end_date)}))}if(s.auto_end_date&&s.event_duration)for(var u=function(){s.auto_end_date&&s.event_duration&&(r=new Date(_[d[3]].value,_[d[2]].value,_[d[1]].value,0,_[d[0]].value),o=new Date(r.getTime()+60*e.config.event_duration*1e3),f(_,4,o))},h=0;h<4;h++)_[h].$_eventAttached||(_[h].$_eventAttached=!0,e.event(_[h],"change",u));function f(e,t,a){for(var n=i._time_values,r=60*a.getHours()+a.getMinutes(),o=r,s=!1,_=0;_document.body.offsetWidth?e.style.left=Math.round(a+(document.body.offsetWidth-e.offsetWidth)/2)+"px":e.style.left=Math.round((document.body.offsetWidth-e.offsetWidth)/2)+"px"}},e.showCover=function(t){t&&(t.style.display="block",this._setLbPosition(t)),e.config.responsive_lightbox&&(document.documentElement.classList.add("dhx_cal_overflow_container"),document.body.classList.add("dhx_cal_overflow_container")),this.show_cover()},e.showLightbox=function(e){if(e)if(this.callEvent("onBeforeLightbox",[e])){var t=this.getLightbox();this.showCover(t),this._fill_lightbox(e,t),this._waiAria.lightboxVisibleAttr(t),this.callEvent("onLightbox",[e])}else this._new_event&&(this._new_event=null)},e._fill_lightbox=function(t,a){var n=this.getEvent(t),i=a.getElementsByTagName("span"),r=[];if(e.templates.lightbox_header){r.push("");var o=e.templates.lightbox_header(n.start_date,n.end_date,n);r.push(o),i[1].innerHTML="",i[2].innerHTML=o}else{var s=this.templates.event_header(n.start_date,n.end_date,n),_=(this.templates.event_bar_text(n.start_date,n.end_date,n)||"").substr(0,70);r.push(s),r.push(_),i[1].innerHTML=s,i[2].innerHTML=_}this._waiAria.lightboxHeader(a,r.join(" "));for(var d=this.config.lightbox.sections,l=0;l
"+e.locale.labels[n[i]]+"
";n=this.config.buttons_right;var r=e.config.rtl;for(i=0;i
"+e.locale.labels[n[i]]+"
";a+="",t.innerHTML=a,e.config.drag_lightbox&&(e.event(t.firstChild,"mousedown",e._ready_to_dnd),e.event(t.firstChild,"selectstart",function(e){return e.preventDefault(),!1}),t.firstChild.style.cursor="move",e._init_dnd_events()),this._waiAria.lightboxAttr(t),document.body.insertBefore(t,document.body.firstChild),this._lightbox=t;var o=this.config.lightbox.sections;for(a="",i=0;i
"+this.locale.labels["button_"+o[i].button]+"
"),this.config.wide_form&&(a+="
");var d=this.locale.labels["section_"+o[i].name];"string"!=typeof d&&(d=o[i].name),a+="
"+_+"
"+s.render.call(this,o[i]),a+="
"}}var l=t.getElementsByTagName("div");for(i=0;i 
"}(t),V(t),function(e){e.getRootView=function(){return{view:{render:function(){return{tag:"div",type:1,attrs:{style:"width:100%;height:100%;"},hooks:{didInsert:function(){e.setCurrentView()}},body:[{el:this.el,type:1}]}},init:function(){var t=document.createElement("DIV");t.id="scheduler_"+e.uid(),t.style.width="100%",t.style.height="100%",t.classList.add("dhx_cal_container"),t.cmp="grid",t.innerHTML='
 
 
',e.init(t),this.el=t}},type:4}}}(t),U(t),window.jQuery&&function(e){var t=0,a=[];e.fn.dhx_scheduler=function(n){if("string"!=typeof n){var i=[];return this.each(function(){if(this&&this.getAttribute)if(this.getAttribute("dhxscheduler"))i.push(window[this.getAttribute("dhxscheduler")]);else{var e="scheduler";t&&(e="scheduler"+(t+1),window[e]=Scheduler.getSchedulerInstance());var a=window[e];for(var r in this.setAttribute("dhxscheduler",e),n)"data"!=r&&(a.config[r]=n[r]);this.getElementsByTagName("div").length||(this.innerHTML='
 
 
',this.className+=" dhx_cal_container"),a.init(this,a.config.date,a.config.mode),n.data&&a.parse(n.data),i.push(a),t++}}),1===i.length?i[0]:i}if(a[n])return a[n].apply(this,[]);e.error("Method "+n+" does not exist on jQuery.dhx_scheduler")}}(window.jQuery),function(e){!function(){var t=e.setCurrentView,a=e.updateView,i=null,r=null,o=function(t,o){var s=this;n.a.clearTimeout(r),n.a.clearTimeout(i);var d=s._date,l=s._mode;_(this,t,o),r=setTimeout(function(){e.$destroyed||(s.callEvent("onBeforeViewChange",[l,d,o||s._mode,t||s._date])?(a.call(s,t,o),s.callEvent("onViewChange",[s._mode,s._date]),n.a.clearTimeout(i),r=0):_(s,d,l))},e.config.delay_render)},s=function(t,o){var s=this,d=arguments;_(this,t,o),n.a.clearTimeout(i),i=setTimeout(function(){e.$destroyed||r||a.apply(s,d)},e.config.delay_render)};function _(e,t,a){t&&(e._date=t),a&&(e._mode=a)}e.attachEvent("onSchedulerReady",function(){e.config.delay_render?(e.setCurrentView=o,e.updateView=s):(e.setCurrentView=t,e.updateView=a)})}()}(t),function(e){e.createDataProcessor=function(t){var a,n;t instanceof Function?a=t:t.hasOwnProperty("router")?a=t.router:t.hasOwnProperty("event")&&(a=t),n=a?"CUSTOM":t.mode||"REST-JSON";var i=new J(t.url);return i.init(e),i.setTransactionMode({mode:n,router:a},t.batchUpdate),i},e.DataProcessor=J}(t),function(e){e.attachEvent("onSchedulerReady",function(){"undefined"!=typeof dhtmlxError&&window.dhtmlxError.catchError("LoadXML",function(t,a,i){var r=i[0].responseText;switch(e.config.ajax_error){case"alert":n.a.alert(r);break;case"console":n.a.console.log(r)}})})}(t);var o=new he({en:ne,ar:K,be:G,ca:X,cn:Q,cs:Z,da:ee,de:te,el:ae,es:ie,fi:re,fr:oe,he:se,hu:_e,id:de,it:le,jp:ce,nb:fe,nl:pe,no:ve,pl:ge,pt:me,ro:ye,ru:be,si:xe,sk:ke,sv:we,tr:Ee,ua:Se});t.i18n={addLocale:o.addLocale,setLocale:function(e){if("string"==typeof e){var a=o.getLocale(e);a||(a=o.getLocale("en")),t.locale=a}else if(e)if(t.locale)for(var n in e)e[n]&&"object"===De(e[n])?(t.locale[n]||(t.locale[n]={}),t.mixin(t.locale[n],e[n],!0)):t.locale[n]=e[n];else t.locale=e},getLocale:o.getLocale},t.i18n.setLocale("en"),t.ext={};var s={};return t.plugins=function(a){(function(e,t,a){var n=[];for(var i in e)if(e[i]){var r=i.toLowerCase();t[r]&&t[r].forEach(function(t){var a=t.toLowerCase();e[a]||n.push(a)}),n.push(r)}return n.sort(function(e,t){var n=a[e]||0,i=a[t]||0;return n>i?1:n
';var i=document.createElement("DIV");return i.id="dhxSchedObj_"+this._genStr(12),i.innerHTML='
 
 
'+a+'
',document.body.appendChild(i.firstChild),this.attachObject(i.id,!1,!0),this.vs[this.av].sched=n,this.vs[this.av].schedId=i.id,n.setSizes=n.updateView,n.destructor=function(){},n.init(i.id,e,t),this.vs[this._viewRestore()].sched});var Me=function(e,t){t(!1,"The ".concat(e,' extension is not included in this version of dhtmlxScheduler.
\n\t\tYou may need a Professional version of the component.
\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.'))},Oe=function(e){!function(){var t=[];function a(){return!!t.length}function n(t){setTimeout(function(){if(e.$destroyed)return!0;a()||function(e,t){for(;e&&e!=t;)e=e.parentNode;return!(e!=t)}(document.activeElement,e.$container)||e.focus()},1)}function i(a){var n=(a=a||window.event).currentTarget;(function(e){return e==t[t.length-1]})(n)&&e.$keyboardNavigation.trapFocus(n,a)}if(e.attachEvent("onLightbox",function(){!function(a){e.eventRemove(a,"keydown",i),e.event(a,"keydown",i),t.push(a)}(e.getLightbox())}),e.attachEvent("onAfterLightbox",function(){var a=t.pop();a&&e.eventRemove(a,"keydown",i),n()}),e.attachEvent("onAfterQuickInfo",function(){n()}),!e._keyNavMessagePopup){e._keyNavMessagePopup=!0;var r=null,o=null,s=[];e.attachEvent("onMessagePopup",function(t){for(r=document.activeElement,o=r;o&&e._getClassName(o).indexOf("dhx_cal_data")<0;)o=o.parentNode;o&&(o=o.parentNode),e.eventRemove(t,"keydown",i),e.event(t,"keydown",i),s.push(t)}),e.attachEvent("onAfterMessagePopup",function(){var t=s.pop();t&&e.eventRemove(t,"keydown",i),setTimeout(function(){if(e.$destroyed)return!0;for(var t=document.activeElement;t&&e._getClassName(t).indexOf("dhx_cal_light")<0;)t=t.parentNode;t||(r&&r.parentNode?r.focus():o&&o.parentNode&&o.focus(),r=null,o=null)},1)})}e.$keyboardNavigation.isModal=a}()},He=function(e){e._temp_key_scope=function(){e.config.key_nav=!0,e.$keyboardNavigation._pasteDate=null,e.$keyboardNavigation._pasteSection=null;var t=null,a={};function n(e){e=e||window.event,a.x=e.clientX,a.y=e.clientY}function i(){for(var t,n,i=document.elementFromPoint(a.x,a.y);i&&i!=e._obj;)i=i.parentNode;return t=!(i!=e._obj),n=e.$keyboardNavigation.dispatcher.isEnabled(),t||n}function r(t){return e._lame_copy({},t)}document.body?e.event(document.body,"mousemove",n):e.event(window,"load",function(){e.event(document.body,"mousemove",n)}),e.attachEvent("onMouseMove",function(t,a){var n=e.getState();if(n.mode&&n.min_date){var i=e.getActionData(a);e.$keyboardNavigation._pasteDate=i.date,e.$keyboardNavigation._pasteSection=i.section}}),e._make_pasted_event=function(t){var a=e.$keyboardNavigation._pasteDate,n=e.$keyboardNavigation._pasteSection,i=t.end_date-t.start_date,o=r(t);if(function(e){delete e.rec_type,delete e.rec_pattern,delete e.event_pid,delete e.event_length}(o),o.start_date=new Date(a),o.end_date=new Date(o.start_date.valueOf()+i),n){var s=e._get_section_property();e.config.multisection?o[s]=t[s]:o[s]=n}return o},e._do_paste=function(t,a,n){!1!==e.callEvent("onBeforeEventPasted",[t,a,n])&&(e.addEvent(a),e.callEvent("onEventPasted",[t,a,n]))},e._is_key_nav_active=function(){return!(!this._is_initialized()||this._is_lightbox_open()||!this.config.key_nav)},e.event(document,"keydown",function(t){(t.ctrlKey||t.metaKey)&&86==t.keyCode&&e._buffer_event&&!e.$keyboardNavigation.dispatcher.isEnabled()&&(e.$keyboardNavigation.dispatcher.isActive=i())}),e._key_nav_copy_paste=function(a){if(!e._is_key_nav_active())return!0;if(37==a.keyCode||39==a.keyCode){a.cancelBubble=!0;var n=e.date.add(e._date,37==a.keyCode?-1:1,e._mode);return e.setCurrentView(n),!0}var o=function(){var t=e.$keyboardNavigation.dispatcher.getActiveNode();return t&&t.eventId?t.eventId:e._select_id}();if((a.ctrlKey||a.metaKey)&&67==a.keyCode)return o&&(e._buffer_event=r(e.getEvent(o)),t=!0,e.callEvent("onEventCopied",[e.getEvent(o)])),!0;if((a.ctrlKey||a.metaKey)&&88==a.keyCode&&o){t=!1;var s=e._buffer_event=r(e.getEvent(o));e.updateEvent(s.id),e.callEvent("onEventCut",[s])}if((a.ctrlKey||a.metaKey)&&86==a.keyCode&&i()){if(s=(s=e._buffer_event?e.getEvent(e._buffer_event.id):e._buffer_event)||e._buffer_event){var _=e._make_pasted_event(s);if(t)_.id=e.uid(),e._do_paste(t,_,s);else e.callEvent("onBeforeEventChanged",[_,a,!1,s])&&(e._do_paste(t,_,s),t=!0)}return!0}}},e._temp_key_scope()},je=function(e){e.$keyboardNavigation.attachSchedulerHandlers=function(){var t,a=e.$keyboardNavigation.dispatcher,n=function(t){if(e.config.key_nav)return a.keyDownHandler(t)},i=function(){a.keepScrollPosition(function(){a.focusGlobalNode()})};e.attachEvent("onDataRender",function(){e.config.key_nav&&a.isEnabled()&&!e.getState().editor_id&&(clearTimeout(t),t=setTimeout(function(){if(e.$destroyed)return!0;a.isEnabled()||a.enable(),r()}))});var r=function(){if(a.isEnabled()){var t=a.getActiveNode();t&&(t.isValid()||(t=t.fallback()),!t||t instanceof e.$keyboardNavigation.MinicalButton||t instanceof e.$keyboardNavigation.MinicalCell||a.keepScrollPosition(function(){t.focus(!0)}))}};function o(t){if(!e.config.key_nav)return!0;var n,i=e.$keyboardNavigation.isChildOf(t.target||t.srcElement,e.$container.querySelector(".dhx_cal_data")),r=e.getActionData(t);e._locate_event(t.target||t.srcElement)?n=new e.$keyboardNavigation.Event(e._locate_event(t.target||t.srcElement)):i&&(n=new e.$keyboardNavigation.TimeSlot,r.date&&i&&(n=n.nextSlot(new e.$keyboardNavigation.TimeSlot(r.date,null,r.section)))),n&&(a.isEnabled()?r.date&&i&&a.delay(function(){a.setActiveNode(n)}):a.activeNode=n)}e.attachEvent("onSchedulerReady",function(){var t=e.$container;e.eventRemove(document,"keydown",n),e.eventRemove(t,"mousedown",o),e.eventRemove(t,"focus",i),e.config.key_nav?(e.event(document,"keydown",n),e.event(t,"mousedown",o),e.event(t,"focus",i),t.setAttribute("tabindex","0")):t.removeAttribute("tabindex")});var s=e.updateEvent;e.updateEvent=function(t){var n=s.apply(this,arguments);if(e.config.key_nav&&a.isEnabled()&&e.getState().select_id==t){var i=new e.$keyboardNavigation.Event(t);e.getState().lightbox_id||function(t){if(e.config.key_nav&&a.isEnabled()){var n=t,i=new e.$keyboardNavigation.Event(n.eventId);if(!i.isValid()){var r=i.start||n.start,o=i.end||n.end,s=i.section||n.section;(i=new e.$keyboardNavigation.TimeSlot(r,o,s)).isValid()||(i=new e.$keyboardNavigation.TimeSlot)}a.setActiveNode(i);var _=a.getActiveNode();_&&_.getNode&&document.activeElement!=_.getNode()&&a.focusNode(a.getActiveNode())}}(i)}return n},e.attachEvent("onEventDeleted",function(t){if(!e.config.key_nav)return!0;a.isEnabled()&&(a.getActiveNode().eventId==t&&a.setActiveNode(new e.$keyboardNavigation.TimeSlot));return!0}),e.attachEvent("onClearAll",function(){if(!e.config.key_nav)return!0;a.isEnabled()&&a.getActiveNode()instanceof e.$keyboardNavigation.Event&&a.setActiveNode(new e.$keyboardNavigation.TimeSlot)})}};function Le(e){"@babel/helpers - typeof";return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e){"@babel/helpers - typeof";return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e){"@babel/helpers - typeof";return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ze(e){"@babel/helpers - typeof";return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fe(e){"@babel/helpers - typeof";return(Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Ie=new(function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._seed=0,this._schedulerPlugins=[],this._bundledExtensions=t,this._extensionsManager=new Te(t)}return function(e,t,a){t&&Ae(e.prototype,t),a&&Ae(e,a),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"plugin",value:function(e){this._schedulerPlugins.push(e),n.a.scheduler&&e(n.a.scheduler)}},{key:"getSchedulerInstance",value:function(e){for(var t=Ne(this._extensionsManager),a=0;a"+n(e)+""}};if(t("week"),t("","month_day"),this.matrix)for(var a in this.matrix)t(a);this._detachDomEvent(this._obj,"click",e._active_link_click),e.event(this._obj,"click",e._active_link_click)})},agenda_view:function(e){e.date.add_agenda=function(t){return e.date.add(t,1,"year")},e.templates.agenda_time=function(t,a,n){return n._timed?this.day_date(n.start_date,n.end_date,n)+" "+this.event_date(t):e.templates.day_date(t)+" – "+e.templates.day_date(a)},e.templates.agenda_text=function(e,t,a){return a.text},e.templates.agenda_date=function(){return""},e.date.agenda_start=function(){return e.date.date_part(e._currentDate())},e.attachEvent("onTemplatesReady",function(){var t=e.dblclick_dhx_cal_data;e.dblclick_dhx_cal_data=function(){if("agenda"==this._mode)!this.config.readonly&&this.config.dblclick_create&&this.addEventNow();else if(t)return t.apply(this,arguments)};var a=e.render_data;e.render_data=function(e){if("agenda"!=this._mode)return a.apply(this,arguments);i()};var n=e.render_view_data;function i(){var t=e.get_visible_events();t.sort(function(e,t){return e.start_date>t.start_date?1:-1});for(var a,n="
",i=0;i
"+(e.config.rtl?e.templates.agenda_time(r.end_date,r.start_date,r):e.templates.agenda_time(r.start_date,r.end_date,r))+"
",n+="
 
",n+=""+e.templates.agenda_text(r.start_date,r.end_date,r)+"
"}n+="
",e._els.dhx_cal_data[0].innerHTML=n,e._els.dhx_cal_data[0].childNodes[0].scrollTop=e._agendaScrollTop||0;var l=e._els.dhx_cal_data[0].childNodes[0];l.childNodes[l.childNodes.length-1].style.height=l.offsetHeight
"+a.date+"
"+a.description+"",e._table_view=!0,e.set_sizes()}}(t),t?(e._cols=null,e._colsS=null,e._table_view=!0,i()):e._table_view=!1}})},all_timed:function(e){e.config.all_timed="short",e.config.all_timed_month=!1;var t=function(t){return!((t.end_date-t.start_date)/36e5>=24)||"resize"==e._drag_mode&&e._drag_id==t.id};e._safe_copy=function(t){var a=null,n=e._copy_event(t);return t.event_pid&&(a=e.getEvent(t.event_pid)),a&&a.isPrototypeOf(t)&&(delete n.event_length,delete n.event_pid,delete n.rec_pattern,delete n.rec_type),n};var a=e._pre_render_events_line,n=e._pre_render_events_table,i=function(e,t){return this._table_view?n.call(this,e,t):a.call(this,e,t)};e._pre_render_events_line=e._pre_render_events_table=function(a,n){if(!this.config.all_timed||this._table_view&&"month"!=this._mode||"month"==this._mode&&!this.config.all_timed_month)return i.call(this,a,n);for(var r=0;rthis._min_date&&s.start_date+t}function u(t){var a=e.date.add(t,1,"day");return a=e.date.date_part(a)}function h(t,a){var n=e.date.date_part(new Date(t));return n.setHours(a),n}};var r=e.get_visible_events;e.get_visible_events=function(e){return this.config.all_timed&&this.config.multi_day?r.call(this,!1):r.call(this,e)},e.attachEvent("onBeforeViewChange",function(t,a,n,i){return e._allow_dnd="day"==n||"week"==n,!0}),e._is_main_area_event=function(e){return!!(e._timed||!0===this.config.all_timed||"short"==this.config.all_timed&&t(e))};var o=e.updateEvent;e.updateEvent=function(t){var a,n,i=e.getEvent(t);i&&(a=e.config.all_timed&&!(e.isOneDayEvent(e._events[t])||e.getState().drag_id))&&(n=e.config.update_render,e.config.update_render=!0),o.apply(e,arguments),i&&a&&(e.config.update_render=n)}},collision:function(e){var t,a;function n(a){e._get_section_view()&&a&&(t=e.getEvent(a)[e._get_section_property()])}e.config.collision_limit=1,e.attachEvent("onBeforeDrag",function(e){return n(e),!0}),e.attachEvent("onBeforeLightbox",function(t){var i=e.getEvent(t);return a=[i.start_date,i.end_date],n(t),!0}),e.attachEvent("onEventChanged",function(t){if(!t||!e.getEvent(t))return!0;var n=e.getEvent(t);if(!e.checkCollision(n)){if(!a)return!1;n.start_date=a[0],n.end_date=a[1],n._timed=this.isOneDayEvent(n)}return!0}),e.attachEvent("onBeforeEventChanged",function(t,a,n){return e.checkCollision(t)}),e.attachEvent("onEventAdded",function(t,a){e.checkCollision(a)||e.deleteEvent(t)}),e.attachEvent("onEventSave",function(t,a,n){if((a=e._lame_clone(a)).id=t,!a.start_date||!a.end_date){var i=e.getEvent(t);a.start_date=new Date(i.start_date),a.end_date=new Date(i.end_date)}return a.rec_type&&e._roll_back_dates(a),e.checkCollision(a)}),e._check_sections_collision=function(t,a){var n=e._get_section_property();return t[n]==a[n]&&t.id!=a.id},e.checkCollision=function(a){var n=[],i=e.config.collision_limit;if(a.rec_type)for(var r=e.getRecDates(a),o=0;o=i&&(h=!1)}else n.length>=i&&(h=!1);if(!h){var p=!e.callEvent("onEventCollision",[a,n]);return p||(a[u]=t||a[u]),p}return h}},container_autoresize:function(e){e.config.container_autoresize=!0,e.config.month_day_min_height=90,e.config.min_grid_size=25,e.config.min_map_size=400;var t=e._pre_render_events,a=!0,n=0,i=0;e._pre_render_events=function(r,o){if(!e.config.container_autoresize||!a)return t.apply(this,arguments);var s=this.xy.bar_height,_=this._colsS.heights,d=this._colsS.heights=[0,0,0,0,0,0,0],l=this._els.dhx_cal_data[0];if(r=this._table_view?this._pre_render_events_table(r,o):this._pre_render_events_line(r,o),this._table_view)if(o)this._colsS.heights=_;else{var c=l.firstChild;if(c.rows){for(var u=0;uthis._colsS.height-this.xy.month_head_height){var h=c.rows[u].cells,f=this._colsS.height-this.xy.month_head_height;1*this.config.max_month_events!==this.config.max_month_events||d[u]<=this.config.max_month_events?f=d[u]*s:(this.config.max_month_events+1)*s>this._colsS.height-this.xy.month_head_height&&(f=(this.config.max_month_events+1)*s);for(var p=0;pf&&(f=u)}_=3*f}else if("map"==l){_=0;var y=s.querySelectorAll(".dhx_map_line");for(c=0;c0){var a=document.cookie.indexOf(t);if(-1!=a){a+=t.length;var n=document.cookie.indexOf(";",a);return-1==n&&(n=document.cookie.length),document.cookie.substring(a,n)}}return""}(_);if(d){e._min_date||(e._min_date=o),(d=unescape(d).split("@"))[0]=this._helpers.parseDate(d[0]);var l=this.isViewExists(d[1])?d[1]:r;return o=isNaN(+d[0])?o:d[0],window.setTimeout(function(){e.$destroyed||e.setCurrentView(o,l)},1),!1}}return!0}),e.attachEvent("onViewChange",function(a,n){!function(e,t,a){var n=e+"="+a+(t?"; "+t:"");document.cookie=n}(t(e),"expires=Sun, 31 Jan 9999 22:00:00 GMT",escape(this._helpers.formatDate(n)+"@"+a))});var n=e._load;e._load=function(){var t=arguments;if(e._date)n.apply(this,t);else{var a=this;window.setTimeout(function(){n.apply(a,t)},1)}}},daytimeline:function(e){Me("Day Timeline",e.assert)},drag_between:function(e){Me("Drag Between",e.assert)},editors:function(e){e.form_blocks.combo={render:function(e){e.cached_options||(e.cached_options={});var t="";return t+="
"},set_value:function(t,a,n,i){!function(){n();var a=e.attachEvent("onAfterLightbox",function(){n(),e.detachEvent(a)});function n(){if(t._combo&&t._combo.DOMParent){var e=t._combo;e.unload?e.unload():e.destructor&&e.destructor(),e.DOMParent=e.DOMelem=null}}}(),window.dhx_globalImgPath=i.image_path||"/",t._combo=new dhtmlXCombo(t,i.name,t.offsetWidth-8),i.onchange&&t._combo.attachEvent("onChange",i.onchange),i.options_height&&t._combo.setOptionHeight(i.options_height);var r=t._combo;if(r.enableFilteringMode(i.filtering,i.script_path||null,!!i.cache),i.script_path){var o=n[i.map_to];o?i.cached_options[o]?(r.addOption(o,i.cached_options[o]),r.disable(1),r.selectOption(0),r.disable(0)):e.ajax.get(i.script_path+"?id="+o+"&uid="+e.uid(),function(t){var a,n=t.xmlDoc.responseText;try{a=JSON.parse(n).options[0].text}catch(n){a=e.ajax.xpath("//option",t.xmlDoc)[0].childNodes[0].nodeValue}i.cached_options[o]=a,r.addOption(o,a),r.disable(1),r.selectOption(0),r.disable(0)}):r.setComboValue("")}else{for(var s=[],_=0;_";for(var n=0;n",t.vertical&&(a+="
")}return a+=""},set_value:function(e,t,a,n){for(var i=e.getElementsByTagName("input"),r=0;r":""},set_value:function(t,a,n,i){t=document.getElementById(i.id);var r=e.uid(),o=void 0!==i.checked_value?a==i.checked_value:!!a;t.className+=" dhx_cal_checkbox";var s="",_="";if(e.config.wide_form?(t.innerHTML=_,t.nextSibling.innerHTML=s):t.innerHTML=s+_,i.handler){var d=t.getElementsByTagName("input")[0];if(d.$_eventAttached)return;d.$_eventAttached=!0,e.event(d,"click",i.handler)}},get_value:function(e,t,a){var n=(e=document.getElementById(a.id)).getElementsByTagName("input")[0];return n||(n=e.nextSibling.getElementsByTagName("input")[0]),n.checked?a.checked_value||!0:a.unchecked_value||!1},focus:function(e){}}},expand:function(e){e.ext.fullscreen={toggleIcon:null},e.expand=function(){if(e.callEvent("onBeforeExpand",[])){var t=e._obj;do{t._position=t.style.position||"",t.style.position="static"}while((t=t.parentNode)&&t.style);(t=e._obj).style.position="absolute",t._width=t.style.width,t._height=t.style.height,t.style.width=t.style.height="100%",t.style.top=t.style.left="0px";var a=document.body;a.scrollTop=0,(a=a.parentNode)&&(a.scrollTop=0),document.body._overflow=document.body.style.overflow||"",document.body.style.overflow="hidden",e._maximize(),e.callEvent("onExpand",[])}},e.collapse=function(){if(e.callEvent("onBeforeCollapse",[])){var t=e._obj;do{t.style.position=t._position}while((t=t.parentNode)&&t.style);(t=e._obj).style.width=t._width,t.style.height=t._height,document.body.style.overflow=document.body._overflow,e._maximize(),e.callEvent("onCollapse",[])}},e.attachEvent("onTemplatesReady",function(){var t=document.createElement("div");t.className="dhx_expand_icon",e.ext.fullscreen.toggleIcon=t,e._obj.appendChild(t),e.event(t,"click",function(){e.expanded?e.collapse():e.expand()})}),e._maximize=function(){this.expanded=!this.expanded,e.ext.fullscreen.toggleIcon.style.backgroundPosition="0 "+(this.expanded?"0":"18")+"px";for(var t=["left","top"],a=0;a=96&&t.keyCode<=105&&(t.keyCode-=48);var a=String.fromCharCode(t.keyCode);return a&&(t.keyCode=a.toLowerCase().charCodeAt(0)),t},getHashFromEvent:function(e){return this.getHash(this.getCommandFromEvent(e))},getHash:function(e){var t=[];for(var a in e.modifiers)e.modifiers[a]&&t.push(a);return t.push(e.keyCode),t.join(this.junctionChar)},getExpressions:function(e){return e.split(this.junctionChar)},getWords:function(e){return e.split(this.combinationChar)},trim:function(e){return e.replace(/\s/g,"")},junctionChar:",",combinationChar:"+",commandKeys:{shift:16,alt:18,ctrl:17,meta:!0},specialKeys:{backspace:8,tab:9,enter:13,esc:27,space:32,up:38,down:40,left:37,right:39,home:36,end:35,pageup:33,pagedown:34,delete:46,insert:45,plus:107,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123}}}(e),function(e){e.$keyboardNavigation.EventHandler={_handlers:null,findHandler:function(t){this._handlers||(this._handlers={});var a=e.$keyboardNavigation.shortcuts.getHash(t);return this._handlers[a]},doAction:function(e,t){var a=this.findHandler(e);a&&(a.call(this,t),t.preventDefault?t.preventDefault():t.returnValue=!1)},bind:function(t,a){this._handlers||(this._handlers={});for(var n=e.$keyboardNavigation.shortcuts,i=n.parse(t),r=0;r=i.length-1?0:o+1])return n.focus(),a.preventDefault(),!0;return!1}}(e),function(e){e.$keyboardNavigation.marker={clear:function(){for(var t=e.$container.querySelectorAll(".dhx_focus_slot"),a=0;a=0;o--)if(i[o].offsetWidth)return i[o];return null},addDataAttributes:function(t,a,n,i){for(var r=e.date.date_to_str(e.config.api_date),o=r(a),s=r(n),_=0;_e._max_date.valueOf()&&(_=new Date(e._max_date)),!i._trace_x)return o;for(var d=0;dt))return o;var c=this.createElement(),u=e._timeline_getX({start_date:t},!1,i)-1,h=e._timeline_getX({start_date:a},!1,i)-1,f=i._section_height[n]-1||i.dy-1,p=0;e._isRender("cell")&&(p=l.offsetTop,u+=i.dx,h+=i.dx,l=e.$container.querySelector(".dhx_cal_data"));var v=Math.max(1,h-u-1);return c.style.cssText="height: "+f+"px; left: "+u+"px; width: "+v+"px; top: "+p+"px;",l&&(l.appendChild(c),o.push(c)),o},renderMonthCell:function(t){for(var a=e.$container.querySelectorAll(".dhx_month_head"),n=[],i=0;i1?i=e.locate_holder_day(t)+d:(i=d,_.size&&i>_.position+_.size&&(i=0))}if(!(o=e.locate_holder(i))||o.querySelector(".dhx_scale_hour"))return document.createElement("div");var l=Math.max(60*t.getHours()+t.getMinutes(),60*s.first_hour),c=Math.min(60*a.getHours()+a.getMinutes(),60*s.last_hour);if(!c&&e.date.day_start(new Date(a)).valueOf()>e.date.day_start(new Date(t)).valueOf()&&(c=60*s.last_hour),c<=l)return[];var u=this.createElement(),h=e.config.hour_size_px*s.last_hour+1;return u.style.top=Math.round((60*l*1e3-36e5*e.config.first_hour)*e.config.hour_size_px/36e5)%h+"px",u.style.lineHeight=u.style.height=Math.max(Math.round(60*(c-l)*1e3*e.config.hour_size_px/36e5)%h,1)+"px",u.style.width="100%",o.appendChild(u),r.push(u),r[0]}}}(e),function(e){e.$keyboardNavigation.SchedulerNode=function(){},e.$keyboardNavigation.SchedulerNode.prototype=e._compose(e.$keyboardNavigation.EventHandler,{getDefaultNode:function(){var t=new e.$keyboardNavigation.TimeSlot;return t.isValid()||(t=t.fallback()),t},_modes:{month:"month",year:"year",dayColumns:"dayColumns",timeline:"timeline",units:"units",weekAgenda:"weekAgenda",list:"list"},getMode:function(){var t=e.getState().mode;return e.matrix&&e.matrix[t]?this._modes.timeline:e._props&&e._props[t]?this._modes.units:"month"==t?this._modes.month:"year"==t?this._modes.year:"week_agenda"==t?this._modes.weekAgenda:"map"==t||"agenda"==t||e._grid&&e["grid_"+t]?this._modes.list:this._modes.dayColumns},focus:function(){e.focus()},blur:function(){},disable:function(){e.$container.setAttribute("tabindex","0")},enable:function(){e.$container&&e.$container.removeAttribute("tabindex")},isEnabled:function(){return e.$container.hasAttribute("tabindex")},_compareEvents:function(e,t){return e.start_date.valueOf()==t.start_date.valueOf()?e.id>t.id?1:-1:e.start_date.valueOf()>t.start_date.valueOf()?1:-1},_pickEvent:function(t,a,n,i){var r=e.getState();t=new Date(Math.max(r.min_date.valueOf(),t.valueOf())),a=new Date(Math.min(r.max_date.valueOf(),a.valueOf()));var o=e.getEvents(t,a);o.sort(this._compareEvents),i&&(o=o.reverse());for(var s=!!n,_=0;_=this.getNodes().length&&(t=0),this.moveTo(new e.$keyboardNavigation.HeaderCell(t))},down:function(){this.moveTo(new e.$keyboardNavigation.TimeSlot)},enter:function(){var e=this.getNode();e&&e.click()}}}),e.$keyboardNavigation.HeaderCell.prototype.bindAll(e.$keyboardNavigation.HeaderCell.prototype.keys)}(e),function(e){e.$keyboardNavigation.Event=function(t){if(this.eventId=null,e.getEvent(t)){var a=e.getEvent(t);this.start=new Date(a.start_date),this.end=new Date(a.end_date),this.section=this._getSection(a),this.eventId=t}},e.$keyboardNavigation.Event.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{_getNodes:function(){return Array.prototype.slice.call(e.$container.querySelectorAll("["+e.config.event_attribute+"]"))},_modes:e.$keyboardNavigation.SchedulerNode.prototype._modes,getMode:e.$keyboardNavigation.SchedulerNode.prototype.getMode,_handlers:null,isValid:function(){return!(!e.getEvent(this.eventId)||!this.getNode())},fallback:function(){var t=this._getNodes()[0],a=null;if(t&&e._locate_event(t)){var n=e._locate_event(t);a=new e.$keyboardNavigation.Event(n)}else a=new e.$keyboardNavigation.TimeSlot;return a},isScrolledIntoView:function(t){var a=t.getBoundingClientRect(),n=e.$container.querySelector(".dhx_cal_data").getBoundingClientRect();return!(a.bottomn.bottom)},getNode:function(){var t="["+e.config.event_attribute+"='"+this.eventId+"']",a=e.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);if(a)return a;if(e.isMultisectionEvent&&e.isMultisectionEvent(e.getEvent(this.eventId))){for(var n=e.$container.querySelectorAll(t),i=0;ia.max_date.valueOf()||t.end_date.valueOf()<=a.min_date.valueOf())&&e.setCurrentView(t.start_date);var n=this.getNode();this.isScrolledIntoView(n)?e.$keyboardNavigation.dispatcher.keepScrollPosition(function(){e.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)}.bind(this)):e.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)},blur:function(){e.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this)},_getSection:function(t){var a=null,n=e.getState().mode;return e.matrix&&e.matrix[n]?a=t[e.matrix[e.getState().mode].y_property]:e._props&&e._props[n]&&(a=t[e._props[n].map_to]),a},_moveToSlot:function(t){var a=e.getEvent(this.eventId);if(a){var n=this._getSection(a),i=new e.$keyboardNavigation.TimeSlot(a.start_date,null,n);this.moveTo(i.nextSlot(i,t))}else this.moveTo(new e.$keyboardNavigation.TimeSlot)},keys:{left:function(){this._moveToSlot("left")},right:function(){this._moveToSlot("right")},down:function(){this.getMode()==this._modes.list?e.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler():this._moveToSlot("down")},space:function(){var t=this.getNode();t&&t.click?t.click():this.moveTo(new e.$keyboardNavigation.TimeSlot)},up:function(){this.getMode()==this._modes.list?e.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler():this._moveToSlot("up")},delete:function(){e.getEvent(this.eventId)?e._click.buttons.delete(this.eventId):this.moveTo(new e.$keyboardNavigation.TimeSlot)},enter:function(){e.getEvent(this.eventId)?e.showLightbox(this.eventId):this.moveTo(new e.$keyboardNavigation.TimeSlot)}}}),e.$keyboardNavigation.Event.prototype.bindAll(e.$keyboardNavigation.Event.prototype.keys)}(e),function(e){e.$keyboardNavigation.TimeSlot=function(t,a,n,i){var r=e.getState(),o=e.matrix&&e.matrix[r.mode];t||(t=this.getDefaultDate()),a||(a=o?e.date.add(t,o.x_step,o.x_unit):e.date.add(t,e.config.key_nav_step,"minute")),this.section=n||this._getDefaultSection(),this.start_date=new Date(t),this.end_date=new Date(a),this.movingDate=i||null},e.$keyboardNavigation.TimeSlot.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{_handlers:null,getDefaultDate:function(){var t,a=e.getState(),n=new Date(a.date);n.setSeconds(0),n.setMilliseconds(0);var i=new Date;i.setSeconds(0),i.setMilliseconds(0);var r=e.matrix&&e.matrix[a.mode],o=!1;if(n.valueOf()===i.valueOf()&&(o=!0),r)o?("day"===r.x_unit?(i.setHours(0),i.setMinutes(0)):"hour"===r.x_unit&&i.setMinutes(0),t=i):t=e.date[r.name+"_start"](new Date(a.date)),t=this.findVisibleColumn(t);else if(t=new Date(e.getState().min_date),o&&(t=i),t=this.findVisibleColumn(t),o||t.setHours(e.config.first_hour),!e._table_view){var s=e.$container.querySelector(".dhx_cal_data");s.scrollTop&&t.setHours(e.config.first_hour+Math.ceil(s.scrollTop/e.config.hour_size_px))}return t},clone:function(t){return new e.$keyboardNavigation.TimeSlot(t.start_date,t.end_date,t.section,t.movingDate)},_getMultisectionView:function(){var t,a=e.getState();return e._props&&e._props[a.mode]?t=e._props[a.mode]:e.matrix&&e.matrix[a.mode]&&(t=e.matrix[a.mode]),t},_getDefaultSection:function(){var e=null;return this._getMultisectionView()&&!e&&(e=this._getNextSection()),e},_getNextSection:function(e,t){var a=this._getMultisectionView(),n=a.order[e],i=n;(i=void 0!==n?n+t:a.size&&a.position?a.position:0)<0&&(i=0);var r=a.options||a.y_unit;return i>=r.length&&(i=r.length-1),r[i]?r[i].key:null},isValid:function(){var t=e.getState();if(this.start_date.valueOf()=t.max_date.valueOf())return!1;if(!this.isVisible(this.start_date,this.end_date))return!1;var a=this._getMultisectionView();return!a||void 0!==a.order[this.section]},fallback:function(){var t=new e.$keyboardNavigation.TimeSlot;return t.isValid()?t:new e.$keyboardNavigation.DataArea},getNodes:function(){return Array.prototype.slice.call(e.$container.querySelectorAll(".dhx_focus_slot"))},getNode:function(){return this.getNodes()[0]},focus:function(){this.section&&e.getView()&&e.getView().smart_rendering&&e.getView().scrollTo&&!e.$container.querySelector('[data-section-id="'.concat(this.section,'"]'))&&e.getView().scrollTo({section:this.section}),e.$keyboardNavigation.marker.render(this.start_date,this.end_date,this.section),e.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this),e.$keyboardNavigation._pasteDate=this.start_date,e.$keyboardNavigation._pasteSection=this.section},blur:function(){e.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this),e.$keyboardNavigation.marker.clear()},_modes:e.$keyboardNavigation.SchedulerNode.prototype._modes,_getMode:e.$keyboardNavigation.SchedulerNode.prototype.getMode,addMonthDate:function(t,a,n){var i;switch(a){case"up":i=e.date.add(t,-1,"week");break;case"down":i=e.date.add(t,1,"week");break;case"left":i=e.date.day_start(e.date.add(t,-1,"day")),i=this.findVisibleColumn(i,-1);break;case"right":i=e.date.day_start(e.date.add(t,1,"day")),i=this.findVisibleColumn(i,1);break;default:i=e.date.day_start(new Date(t))}var r=e.getState();return(t.valueOf()=r.max_date.valueOf())&&(i=new Date(r.min_date)),i},nextMonthSlot:function(t,a,n){var i,r;return(i=this.addMonthDate(t.start_date,a,n)).setHours(e.config.first_hour),(r=new Date(i)).setHours(e.config.last_hour),{start_date:i,end_date:r}},_alignTimeSlot:function(t,a,n,i){for(var r=new Date(a);r.valueOf()t.valueOf()&&(r=e.date.add(r,-i,n)),r},nextTimelineSlot:function(t,a,n){var i=e.getState(),r=e.matrix[i.mode],o=this._alignTimeSlot(t.start_date,e.date[r.name+"_start"](new Date(t.start_date)),r.x_unit,r.x_step),s=this._alignTimeSlot(t.end_date,e.date[r.name+"_start"](new Date(t.end_date)),r.x_unit,r.x_step);s.valueOf()<=o.valueOf()&&(s=e.date.add(o,r.x_step,r.x_unit));var _=this.clone(t);switch(_.start_date=o,_.end_date=s,_.section=t.section||this._getNextSection(),a){case"up":_.section=this._getNextSection(t.section,-1);break;case"down":_.section=this._getNextSection(t.section,1);break;case"left":_.start_date=this.findVisibleColumn(e.date.add(_.start_date,-r.x_step,r.x_unit),-1),_.end_date=e.date.add(_.start_date,r.x_step,r.x_unit);break;case"right":_.start_date=this.findVisibleColumn(e.date.add(_.start_date,r.x_step,r.x_unit),1),_.end_date=e.date.add(_.start_date,r.x_step,r.x_unit)}return(_.start_date.valueOf()=i.max_date.valueOf())&&(n&&_.start_date.valueOf()>=i.max_date.valueOf()?_.start_date=new Date(i.max_date):(_.start_date=e.date[i.mode+"_start"](e.date.add(i.date,"left"==a?-1:1,i.mode)),_.end_date=e.date.add(_.start_date,r.x_step,r.x_unit))),_},nextUnitsSlot:function(t,a,n){var i=this.clone(t);i.section=t.section||this._getNextSection();var r=t.section||this._getNextSection(),o=e.getState(),s=e._props[o.mode];switch(a){case"left":r=this._getNextSection(t.section,-1);var _=s.size?s.size-1:s.options.length;s.days>1&&s.order[r]==_-1&&e.date.add(t.start_date,-1,"day").valueOf()>=o.min_date.valueOf()&&(i=this.nextDaySlot(t,a,n));break;case"right":r=this._getNextSection(t.section,1),s.days>1&&!s.order[r]&&e.date.add(t.start_date,1,"day").valueOf()=r||!a&&!n&&(!i&&24==o||i==o)},isInVisibleDayTime:function(e,t){return this.isBeforeLastHour(e,t)&&this.isAfterFirstHour(e,t)},nextDaySlot:function(t,a,n){var i,r,o=e.config.key_nav_step,s=this._alignTimeSlot(t.start_date,e.date.day_start(new Date(t.start_date)),"minute",o),_=t.start_date;switch(a){case"up":if(i=e.date.add(s,-o,"minute"),!this.isInVisibleDayTime(i,!0)&&(!n||this.isInVisibleDayTime(_,!0))){var d=!0;n&&e.date.date_part(new Date(i)).valueOf()!=e.date.date_part(new Date(_)).valueOf()&&(d=!1),d&&(i=this.findVisibleColumn(e.date.add(t.start_date,-1,"day"),-1)),i.setHours(e.config.last_hour),i.setMinutes(0),i=e.date.add(i,-o,"minute")}r=e.date.add(i,o,"minute");break;case"down":i=e.date.add(s,o,"minute");var l=n?i:e.date.add(i,o,"minute");this.isInVisibleDayTime(l,!1)||n&&!this.isInVisibleDayTime(_,!1)||(n?(d=!0,e.date.date_part(new Date(_)).valueOf()==_.valueOf()&&(d=!1),d&&(i=this.findVisibleColumn(e.date.add(t.start_date,1,"day"),1)),i.setHours(e.config.first_hour),i.setMinutes(0),i=e.date.add(i,o,"minute")):((i=this.findVisibleColumn(e.date.add(t.start_date,1,"day"),1)).setHours(e.config.first_hour),i.setMinutes(0))),r=e.date.add(i,o,"minute");break;case"left":i=this._moveDate(t.start_date,-1),r=this._moveDate(t.end_date,-1);break;case"right":i=this._moveDate(t.start_date,1),r=this._moveDate(t.end_date,1);break;default:i=s,r=e.date.add(i,o,"minute")}return{start_date:i,end_date:r}},nextWeekAgendaSlot:function(t,a){var n,i,r=e.getState();switch(a){case"down":case"left":n=e.date.day_start(e.date.add(t.start_date,-1,"day")),n=this.findVisibleColumn(n,-1);break;case"up":case"right":n=e.date.day_start(e.date.add(t.start_date,1,"day")),n=this.findVisibleColumn(n,1);break;default:n=e.date.day_start(t.start_date)}return(t.start_date.valueOf()=r.max_date.valueOf())&&(n=new Date(r.min_date)),(i=new Date(n)).setHours(e.config.last_hour),{start_date:n,end_date:i}},nextAgendaSlot:function(e,t){return{start_date:e.start_date,end_date:e.end_date}},isDateVisible:function(t){if(!e._ignores_detected)return!0;var a,n=e.matrix&&e.matrix[e.getState().mode];return a=n?e._get_date_index(n,t):e.locate_holder_day(t),!e._ignores[a]},findVisibleColumn:function(t,a){var n=t;a=a||1;for(var i=e.getState();!this.isDateVisible(n)&&(a>0&&n.valueOf()<=i.max_date.valueOf()||a<0&&n.valueOf()>=i.min_date.valueOf());)n=this.nextDateColumn(n,a);return n},nextDateColumn:function(t,a){a=a||1;var n=e.matrix&&e.matrix[e.getState().mode];return n?e.date.add(t,a*n.x_step,n.x_unit):e.date.day_start(e.date.add(t,a,"day"))},isVisible:function(t,a){if(!e._ignores_detected)return!0;for(var n=new Date(t);n.valueOf()=r.end_date.valueOf()&&(r=this.nextSlot(r,a,n)),e.$keyboardNavigation.TimeSlot.prototype.clone(r)},extendSlot:function(t,a){var n;switch(this._getMode()){case this._modes.units:n="left"==a||"right"==a?this.nextUnitsSlot(t,a):this.extendUnitsSlot(t,a);break;case this._modes.timeline:n="down"==a||"up"==a?this.nextTimelineSlot(t,a):this.extendTimelineSlot(t,a);break;case this._modes.year:case this._modes.month:n=this.extendMonthSlot(t,a);break;case this._modes.dayColumns:n=this.extendDaySlot(t,a);break;case this._modes.weekAgenda:n=this.extendWeekAgendaSlot(t,a);break;default:n=t}var i=e.getState();return n.start_date.valueOf()i.max_date.valueOf()&&(n.end_date=this.findVisibleColumn(i.max_date,-1)),e.$keyboardNavigation.TimeSlot.prototype.clone(n)},extendTimelineSlot:function(e,t){return this.extendGenericSlot({left:"start_date",right:"end_date"},e,t,"timeline")},extendWeekAgendaSlot:function(e,t){return this.extendGenericSlot({left:"start_date",right:"end_date"},e,t,"weekAgenda")},extendGenericSlot:function(t,a,n,i){var r,o=a.movingDate;if(o||(o=t[n]),!o||!t[n])return a;if(!n)return e.$keyboardNavigation.TimeSlot.prototype.clone(a);(r=this.nextSlot({start_date:a[o],section:a.section},n,i,!0)).start_date.valueOf()==a.start_date.valueOf()&&(r=this.nextSlot({start_date:r.start_date,section:r.section},n,i,!0)),r.movingDate=o;var s=this.extendSlotDates(a,r,r.movingDate);return s.end_date.valueOf()<=s.start_date.valueOf()&&(r.movingDate="end_date"==r.movingDate?"start_date":"end_date"),s=this.extendSlotDates(a,r,r.movingDate),r.start_date=s.start_date,r.end_date=s.end_date,r},extendSlotDates:function(e,t,a){var n={start_date:null,end_date:null};return"start_date"==a?(n.start_date=t.start_date,n.end_date=e.end_date):(n.start_date=e.start_date,n.end_date=t.start_date),n},extendMonthSlot:function(t,a){return(t=this.extendGenericSlot({up:"start_date",down:"end_date",left:"start_date",right:"end_date"},t,a,"month")).start_date.setHours(e.config.first_hour),t.end_date=e.date.add(t.end_date,-1,"day"),t.end_date.setHours(e.config.last_hour),t},extendUnitsSlot:function(e,t){var a;switch(t){case"down":case"up":a=this.extendDaySlot(e,t);break;default:a=e}return a.section=e.section,a},extendDaySlot:function(e,t){return this.extendGenericSlot({up:"start_date",down:"end_date",left:"start_date",right:"end_date"},e,t,"dayColumns")},scrollSlot:function(t){var a=e.getState(),n=this.nextSlot(this,t);(n.start_date.valueOf()=a.max_date.valueOf())&&e.setCurrentView(new Date(n.start_date)),this.moveTo(n)},keys:{left:function(){this.scrollSlot("left")},right:function(){this.scrollSlot("right")},down:function(){this._getMode()==this._modes.list?e.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler():this.scrollSlot("down")},up:function(){this._getMode()==this._modes.list?e.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler():this.scrollSlot("up")},"shift+down":function(){this.moveTo(this.extendSlot(this,"down"))},"shift+up":function(){this.moveTo(this.extendSlot(this,"up"))},"shift+right":function(){this.moveTo(this.extendSlot(this,"right"))},"shift+left":function(){this.moveTo(this.extendSlot(this,"left"))},enter:function(){var t={start_date:new Date(this.start_date),end_date:new Date(this.end_date)},a=e.getState().mode;e.matrix&&e.matrix[a]?t[e.matrix[e.getState().mode].y_property]=this.section:e._props&&e._props[a]&&(t[e._props[a].map_to]=this.section),e.addEventNow(t)}}}),e.$keyboardNavigation.TimeSlot.prototype.bindAll(e.$keyboardNavigation.TimeSlot.prototype.keys)}(e),function(e){e.$keyboardNavigation.MinicalButton=function(e,t){this.container=e,this.index=t||0},e.$keyboardNavigation.MinicalButton.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{isValid:function(){return!!this.container.offsetWidth},fallback:function(){var t=new e.$keyboardNavigation.TimeSlot;return t.isValid()?t:new e.$keyboardNavigation.DataArea},focus:function(){e.$keyboardNavigation.dispatcher.globalNode.disable(),this.container.removeAttribute("tabindex"),e.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)},blur:function(){this.container.setAttribute("tabindex","0"),e.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this)},getNode:function(){return this.index?this.container.querySelector(".dhx_cal_next_button"):this.container.querySelector(".dhx_cal_prev_button")},keys:{right:function(t){this.moveTo(new e.$keyboardNavigation.MinicalButton(this.container,this.index?0:1))},left:function(t){this.moveTo(new e.$keyboardNavigation.MinicalButton(this.container,this.index?0:1))},down:function(){var t=new e.$keyboardNavigation.MinicalCell(this.container,0,0);t&&!t.isValid()&&(t=t.fallback()),this.moveTo(t)},enter:function(e){this.getNode().click()}}}),e.$keyboardNavigation.MinicalButton.prototype.bindAll(e.$keyboardNavigation.MinicalButton.prototype.keys)}(e),function(e){e.$keyboardNavigation.MinicalCell=function(e,t,a){this.container=e,this.row=t||0,this.col=a||0},e.$keyboardNavigation.MinicalCell.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{isValid:function(){var e=this._getGrid();return!(!e[this.row]||!e[this.row][this.col])},fallback:function(){var t=this.row,a=this.col,n=this._getGrid();n[t]||(t=0);var i=!0;if(t>n.length/2&&(i=!1),!n[t]){var r=new e.$keyboardNavigation.TimeSlot;return r.isValid()?r:new e.$keyboardNavigation.DataArea}if(i){for(var o=a;n[t]&&o-1||_.indexOf("dhx_before")>-1||_.indexOf("dhx_scale_ignore")>-1)&&(s=!1),a[n][r]=s}}return a},keys:{right:function(t){var a=this._getGrid(),n=this.row,i=this.col+1;a[n]&&a[n][i]||(a[n+1]?(n+=1,i=0):i=this.col);var r=new e.$keyboardNavigation.MinicalCell(this.container,n,i);r.isValid()||(r=r.fallback()),this.moveTo(r)},left:function(t){var a=this._getGrid(),n=this.row,i=this.col-1;a[n]&&a[n][i]||(i=a[n-1]?a[n-=1].length-1:this.col);var r=new e.$keyboardNavigation.MinicalCell(this.container,n,i);r.isValid()||(r=r.fallback()),this.moveTo(r)},down:function(){var t=this._getGrid(),a=this.row+1,n=this.col;t[a]&&t[a][n]||(a=this.row);var i=new e.$keyboardNavigation.MinicalCell(this.container,a,n);i.isValid()||(i=i.fallback()),this.moveTo(i)},up:function(){var t=this._getGrid(),a=this.row-1,n=this.col;if(t[a]&&t[a][n]){var i=new e.$keyboardNavigation.MinicalCell(this.container,a,n);i.isValid()||(i=i.fallback()),this.moveTo(i)}else{var r=0;this.col>t[this.row].length/2&&(r=1),this.moveTo(new e.$keyboardNavigation.MinicalButton(this.container,r))}},enter:function(e){this.getNode().querySelector(".dhx_month_head").click()}}}),e.$keyboardNavigation.MinicalCell.prototype.bindAll(e.$keyboardNavigation.MinicalCell.prototype.keys)}(e),function(e){e.$keyboardNavigation.DataArea=function(e){this.index=e||0},e.$keyboardNavigation.DataArea.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{getNode:function(t){return e.$container.querySelector(".dhx_cal_data")},_handlers:null,isValid:function(){return!0},fallback:function(){return this},keys:{"up,down,right,left":function(){this.moveTo(new e.$keyboardNavigation.TimeSlot)}}}),e.$keyboardNavigation.DataArea.prototype.bindAll(e.$keyboardNavigation.DataArea.prototype.keys)}(e),Oe(e),function(e){e.$keyboardNavigation.dispatcher={isActive:!1,activeNode:null,globalNode:new e.$keyboardNavigation.SchedulerNode,keepScrollPosition:function(t){var a,n,i=e.$container.querySelector(".dhx_timeline_scrollable_data");i||(i=e.$container.querySelector(".dhx_cal_data")),i&&(a=i.scrollTop,n=i.scrollLeft),t(),i&&(i.scrollTop=a,i.scrollLeft=n)},enable:function(){if(e.$container){this.isActive=!0;var t=this;this.keepScrollPosition(function(){t.globalNode.enable(),t.setActiveNode(t.getActiveNode())})}},disable:function(){this.isActive=!1,this.globalNode.disable()},isEnabled:function(){return!!this.isActive},getDefaultNode:function(){return this.globalNode.getDefaultNode()},setDefaultNode:function(){this.setActiveNode(this.getDefaultNode())},getActiveNode:function(){var e=this.activeNode;return e&&!e.isValid()&&(e=e.fallback()),e},focusGlobalNode:function(){this.blurNode(this.globalNode),this.focusNode(this.globalNode)},setActiveNode:function(e){e&&e.isValid()&&(this.activeNode&&this.activeNode.compareTo(e)||this.isEnabled()&&(this.blurNode(this.activeNode),this.activeNode=e,this.focusNode(this.activeNode)))},focusNode:function(t){t&&t.focus&&(t.focus(),t.getNode&&document.activeElement!=t.getNode()&&this.setActiveNode(new e.$keyboardNavigation.DataArea))},blurNode:function(e){e&&e.blur&&e.blur()},getInlineEditor:function(t){var a=e.$container.querySelector(".dhx_cal_editor["+e.config.event_attribute+"='"+t+"'] textarea");return a&&a.offsetWidth?a:null},keyDownHandler:function(t){if(!t.defaultPrevented){var a=this.getActiveNode();if((!e.$keyboardNavigation.isModal()||a&&a.container&&e.utils.dom.locateCss({target:a.container},"dhx_minical_popup",!1))&&(!e.getState().editor_id||!this.getInlineEditor(e.getState().editor_id))&&this.isEnabled()){t=t||window.event;var n=this.globalNode,i=e.$keyboardNavigation.shortcuts.getCommandFromEvent(t);a?a.findHandler(i)?a.doAction(i,t):n.findHandler(i)&&n.doAction(i,t):this.setDefaultNode()}}},_timeout:null,delay:function(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t||1)}}}(e),He(e),function(){je(e),function(e){e.$keyboardNavigation._minicalendars=[],e.$keyboardNavigation.isMinical=function(t){for(var a=e.$keyboardNavigation._minicalendars,n=0;n=e.config.collision_limit}),e.addEvent=function(t,a,n,i,r){var o=t;1!=arguments.length&&((o=r||{}).start_date=t,o.end_date=a,o.text=n,o.id=i,o.layer=this.defaultLayer),o.id=o.id||e.uid(),o.text=o.text||"","string"==typeof o.start_date&&(o.start_date=this.templates.api_date(o.start_date)),"string"==typeof o.end_date&&(o.end_date=this.templates.api_date(o.end_date)),o._timed=this.isOneDayEvent(o);var s=!this._events[o.id];this._events[o.id]=o,this.event_updated(o),this._loading||this.callEvent(s?"onEventAdded":"onEventChanged",[o.id,o])},this._evs_layer={};for(var t=0;to.getHours()&&(o.setHours(s),t=o.valueOf()),a=t+r}i.start_date=i.start_date||o,i.end_date=i.end_date||new Date(a),i.text=i.text||this.locale.labels.new_event,i.id=this._drag_id=this.uid(),i.layer=this.defaultLayer,this._drag_mode="new-size",this._loading=!0,this.addEvent(i),this.callEvent("onEventCreated",[this._drag_id,n]),this._loading=!1,this._drag_event={},this._on_mouse_up(n)},e._t_render_view_data=function(e){if(this.config.multi_day&&!this._table_view){for(var t=[],a=[],n=0;n';return x+='
 
',x+='
'+s+"
",x+='
'+_+"
",x+='',c.innerHTML=x,c.style.zIndex=100,c.firstChild},e.render_event_bar=function(t){var a=this._els.dhx_cal_data[0],n=this._colsS[t._sday],i=this._colsS[t._eday];i==n&&(i=this._colsS[t._eday+1]);var r=this.xy.bar_height,o=this._colsS.heights[t._sweek]+(this._colsS.height?this.xy.month_scale_height+2:2)+t._sorder*r,s=document.createElement("div"),_=t._timed?"dhx_cal_event_clear":"dhx_cal_event_line",d=e.templates["event_class_"+t.layer]?e.templates["event_class_"+t.layer](t.start_date,t.end_date,t):e.templates.event_class(t.start_date,t.end_date,t);d&&(_=_+" "+d);var l='
';t._timed&&(l+=e.templates["event_bar_date_"+t.layer]?e.templates["event_bar_date_"+t.layer](t.start_date,t.end_date,t):e.templates.event_bar_date(t.start_date,t.end_date,t)),l+=e.templates["event_bar_text_"+t.layer]?e.templates["event_bar_text_"+t.layer](t.start_date,t.end_date,t):e.templates.event_bar_text(t.start_date,t.end_date,t)+"
)",l+="",s.innerHTML=l,this._rendered.push(s.firstChild),a.appendChild(s.firstChild)},e.render_event=function(t){var a=e.xy.menu_width;if(e.getLayer(t.layer).noMenu&&(a=0),!(t._sday<0)){var n=e.locate_holder(t._sday);if(n){var i=60*t.start_date.getHours()+t.start_date.getMinutes(),r=60*t.end_date.getHours()+t.end_date.getMinutes()||60*e.config.last_hour,o=Math.round((60*i*1e3-60*this.config.first_hour*60*1e3)*this.config.hour_size_px/36e5)%(24*this.config.hour_size_px)+1,s=Math.max(e.xy.min_event_height,(r-i)*this.config.hour_size_px/60)+1,_=Math.floor((n.clientWidth-a)/t._count),d=t._sorder*_+1;t._inner||(_*=t._count-t._sorder);var l=this._render_v_bar(t.id,a+d,o,_,s,t._text_style,e.templates.event_header(t.start_date,t.end_date,t),e.templates.event_text(t.start_date,t.end_date,t));if(this._rendered.push(l),n.appendChild(l),d=d+parseInt(n.style.left,10)+a,o+=this._dy_shift,l.style.zIndex=this._layers_zindex[t.layer],this._edit_id==t.id){l.style.zIndex=parseInt(l.style.zIndex)+1;var c=l.style.zIndex;_=Math.max(_-4,e.xy.editor_width),(l=document.createElement("div")).setAttribute("event_id",t.id),l.setAttribute(this.config.event_attribute,t.id),this.set_xy(l,_,s-20,d,o+14),l.className="dhx_cal_editor",l.style.zIndex=c;var u=document.createElement("div");this.set_xy(u,_-6,s-26),u.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;",u.style.zIndex=c,l.appendChild(u),this._els.dhx_cal_data[0].appendChild(l),this._rendered.push(l),u.innerHTML="",this._quirks7&&(u.firstChild.style.height=s-12+"px"),this._editor=u.firstChild,this._editor.addEventListener("keypress",function(t){if(t.shiftKey)return!0;var a=t.keyCode;a==e.keys.edit_save&&e.editStop(!0),a==e.keys.edit_cancel&&e.editStop(!1)}),this._editor.addEventListener("selectstart",function(e){return e.cancelBubble=!0,!0}),u.firstChild.focus(),this._els.dhx_cal_data[0].scrollLeft=0,u.firstChild.select()}if(this._select_id==t.id){l.style.zIndex=parseInt(l.style.zIndex)+1;for(var h=this.config["icons_"+(this._edit_id==t.id?"edit":"select")],f="",p=0;p";var v=this._render_v_bar(t.id,d-a+1,o,a,20*h.length+26,"","
",f,!0);v.style.left=d-a+1,v.style.zIndex=l.style.zIndex,this._els.dhx_cal_data[0].appendChild(v),this._rendered.push(v)}}}},e.filter_agenda=function(t,a){var n=e.getLayer(a.layer);return n&&n.visible}})},limit:function(e){e.config.limit_start=null,e.config.limit_end=null,e.config.limit_view=!1,e.config.check_limits=!0,e.config.mark_now=!0,e.config.display_marked_timespans=!0,e.config.overwrite_marked_timespans=!0,e._temp_limit_scope=function(){var t=null,a=function(e,t,a){var n="object"==$e(e)?e:{days:e};return n.type="dhx_time_block",n.css="",t&&(a&&(n.sections=a),n=function(e,t,a){return t instanceof Date&&a instanceof Date?(e.start_date=t,e.end_date=a):(e.days=t,e.zones=a),e}(n,e,t)),n};e.blockTime=function(t,n,i){var r=a(t,n,i);return e.addMarkedTimespan(r)},e.unblockTime=function(t,n,i){var r=a(t,n=n||"fullday",i);return e.deleteMarkedTimespan(r)},e.attachEvent("onBeforeViewChange",function(t,a,n,i){function r(t,a){var n=e.config.limit_start,i=e.config.limit_end,r=e.date.add(t,1,a);return t.valueOf()>i.valueOf()||r<=n.valueOf()}return!e.config.limit_view||!r(i=i||a,n=n||t)||a.valueOf()==i.valueOf()||(setTimeout(function(){if(e.$destroyed)return!0;var t=r(a,n)?e.config.limit_start:a;e.setCurrentView(r(t,n)?null:t,n)},1),!1)}),e.checkInMarkedTimespan=function(t,a,n){a=a||"default";for(var r=!0,o=new Date(t.start_date.valueOf()),s=e.date.add(o,1,"day"),_=e._marked_timespans;os||t.end_date.getDate()!=o.getDate()?1440:e._get_zone_minutes(t.end_date),f=l[c],p=l[c+1];if(fu&&!(r="function"==typeof n&&n(t,u,h,f,p)))break}}return!r};var n=e.checkLimitViolation=function(t){if(!t)return!0;if(!e.config.check_limits)return!0;var a=e,n=a.config,i=[];if(t.rec_type)for(var r=e.getRecDates(t),o=0;o=n.limit_start.valueOf()&&s.end_date.valueOf()<=n.limit_end.valueOf())&&(l=!e.checkInMarkedTimespan(s,"dhx_time_block",function(e,t,n,i,r){var o=!0;return t<=r&&t>=i&&((1440==r||n<=r)&&(o=!1),e._timed&&a._drag_id&&"new-size"==a._drag_mode?(e.start_date.setHours(0),e.start_date.setMinutes(r)):o=!1),(n>=i&&n<=r||tr)&&(e._timed&&a._drag_id&&"new-size"==a._drag_mode?(e.end_date.setHours(0),e.end_date.setMinutes(i)):o=!1),o})),l||(l=a.checkEvent("onLimitViolation")?a.callEvent("onLimitViolation",[s.id,s]):l),_=_&&l}return _||(a._drag_id=null,a._drag_mode=null),_};function i(t,a,n,i,r){var o=e,s=[],_={_props:"map_to",matrix:"y_property"};for(var d in _){var l=_[d];if(o[d])for(var c in o[d]){var u=o[d][c][l];t[u]&&(s=o._add_timespan_zones(s,e._get_blocked_zones(a[c],t[u],n,i,r)))}}return s=o._add_timespan_zones(s,e._get_blocked_zones(a,"global",n,i,r))}e._get_blocked_zones=function(e,t,a,n,i){var r=[];if(e&&e[t])for(var o=e[t],s=this._get_relevant_blocked_zones(a,n,o,i),_=0;_=e.config.limit_end.valueOf()&&(a.start_date=this.date.add(e.config.limit_end,-1,"day")),a.end_date=e.config.limit_end.valueOf()&&(a.end_date=this.date.add(e.config.limit_end,-1,"day")),a.start_date.valueOf()>=a.end_date.valueOf()&&(a.end_date=this.date.add(a.start_date,this.config.event_duration||this.config.time_step,"minute")),a._timed=this.isOneDayEvent(a)),!0}),e.attachEvent("onEventChanged",function(a){if(!a)return!0;var i=e.getEvent(a);if(!n(i)){if(!t)return!1;i.start_date=t[0],i.end_date=t[1],i._timed=this.isOneDayEvent(i)}return!0}),e.attachEvent("onBeforeEventChanged",function(e,t,a){return n(e)}),e.attachEvent("onBeforeEventCreated",function(t){var a=e.getActionData(t).date,i={_timed:!0,start_date:a,end_date:e.date.add(a,e.config.time_step,"minute")};return n(i)}),e.attachEvent("onViewChange",function(){e._mark_now()}),e.attachEvent("onAfterSchedulerResize",function(){return window.setTimeout(function(){if(e.$destroyed)return!0;e._mark_now()},1),!0}),e.attachEvent("onTemplatesReady",function(){e._mark_now_timer=window.setInterval(function(){e._is_initialized()&&e._mark_now()},6e4)}),e._mark_now=function(t){this._els.dhx_now_time||(this._els.dhx_now_time=[]);var a=e._currentDate(),n=this.config;if(e._remove_mark_now(),!t&&n.mark_now&&athis._min_date&&a.getHours()>=n.first_hour&&a.getHours()1?(s.size&&s.options.length&&(t=(s.position+t)/s.options.length*s.size),r=t,o=t+_):o=(r=0)+_;for(var d=[],l=r;lt.start_date||void 0!==t.days&&t.zones)&&!t.type)return a;"fullday"==t.zones&&(t.zones=[0,1440]),t.zones&&t.invert_zones&&(t.zones=e.invertZones(t.zones)),t.id=e.uid(),t.css=t.css||"",t.type=t.type||"default";var s=t.sections;if(s){for(var _ in s)if(s.hasOwnProperty(_)){var d=s[_];for(d instanceof Array||(d=[d]),r=0;rf?e._get_zone_minutes(u):0,m=h>p||h.getDate()!=f.getDate()?1440:e._get_zone_minutes(h);v.zones=[g,m],a.push(v),f=p,p=e.date.add(p,1,"day")}else c.days instanceof Date&&(c.days=e.date.date_part(c.days).valueOf()),c.zones=t.zones.slice(),a.push(c)}return a},e._get_dates_by_index=function(t,a,n){var i=[];a=e.date.date_part(new Date(a||e._min_date)),n=new Date(n||e._max_date);for(var r=a.getDay(),o=t-r>=0?t-r:7-a.getDay()+t,s=e.date.add(a,o,"day");s+d&&+o<=+d))return i;n=d.getDay()}var l=o.getDay();l>n?n=7-(l-n):n-=l}var c=t.zones,u=e._get_css_classes_by_config(t);if(e._table_view&&"month"==e._mode){var h=[],f=[];if(a)h.push(a),f.push(n);else{f=_?[_]:e._get_dates_by_index(n);for(var p=0;p1?D=D*(N.size||N.options.length)+C:(D=C,N.size&&D>N.position+N.size&&(D=0))}for(a=a||e.locate_holder(D),p=0;p-1||(a.push.apply(a,e._on_scale_add_marker(s,i)),i=e.date.add(i,1,"day"))}}return a},e.markTimespan=function(t){var a=!1;this._els.dhx_cal_data||(e.get_elements(),a=!0);var n=e._marked_timespans_ids,i=e._marked_timespans_types,r=e._marked_timespans;e.deleteMarkedTimespan(),e.addMarkedTimespan(t);var o=e._mark_timespans();return a&&(e._els=[]),e._marked_timespans_ids=n,e._marked_timespans_types=i,e._marked_timespans=r,o},e.unmarkTimespan=function(e){if(e)for(var t=0;tr&&_<=r||_=i)a[n]=Math.min(i,_),a[n+1]=Math.max(r,d),n-=2;else{if(!o)continue;var l=i>_?0:2;a.splice(n+l,0,_,d)}t.splice(s--,2);break}return a},e._subtract_timespan_zones=function(e,t){for(var a=e.slice(),n=0;ni&&s=s&&r<=_&&a.splice(n,2),i_&&a.splice(d?n+2:n,d?0:2,_,r),n-=2;break}}return a},e.invertZones=function(t){return e._subtract_timespan_zones([0,1440],t.slice())},e._delete_marked_timespan_by_id=function(t){var a=e._marked_timespans_ids[t];if(a)for(var n=0;n1){var u=Math.round((a-e._min_date)/864e5),h=d.size||l.length;a=e.date.add(e._min_date,Math.floor(u/h),"day"),a=e.date.date_part(a)}else a=e.date.date_part(new Date(this._date));if(n=a.getDay(),i=a.valueOf(),o[r]&&o[r][c.key]){var f=o[r][c.key],p=e._get_types_to_render(f[n],f[i]);s.push.apply(s,e._get_configs_to_render(p))}}var v=o.global;if(e.config.overwrite_marked_timespans){var g=v[i]||v[n];s.push.apply(s,e._get_configs_to_render(g))}else v[i]&&s.push.apply(s,e._get_configs_to_render(v[i])),v[n]&&s.push.apply(s,e._get_configs_to_render(v[n]));for(var m=0;m"+n.text+"

"+(n.event_location||"")+"

"+e.templates.marker_date(t)+" - "+e.templates.marker_date(a)+""},e.dblclick_dhx_map_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow({start_date:e._date,end_date:e.date.add(e._date,e.config.time_step,"minute")})},e.templates.map_time=function(t,a,n){return e.config.rtl&&!n._timed?e.templates.day_date(a)+" – "+e.templates.day_date(t):n._timed?this.day_date(n.start_date,n.end_date,n)+" "+this.event_date(t):e.templates.day_date(t)+" – "+e.templates.day_date(a)},e.templates.map_text=function(e,t,a){return a.text},e.date.map_start=function(e){return e},e.date.add_map=function(e,t,a){return new Date(e.valueOf())},e.templates.map_date=function(e,t,a){return""},e._latLngUpdate=!1,e.attachEvent("onSchedulerReady",function(){e._isMapPositionSet=!1;var a=document.createElement("div");a.className="dhx_map",a.id="dhx_gmap",a.style.display="none",e._obj.appendChild(a),e._els.dhx_gmap=[],e._els.dhx_gmap.push(a),_("dhx_gmap");var n={zoom:e.config.map_initial_zoom||10,center:e.config.map_initial_position,mapTypeId:e.config.map_type||google.maps.MapTypeId.ROADMAP},i=new google.maps.Map(document.getElementById("dhx_gmap"),n);i.disableDefaultUI=!1,i.disableDoubleClickZoom=!e.config.readonly,google.maps.event.addListener(i,"dblclick",function(a){if(!e.config.readonly&&e.config.dblclick_create){var n=a.latLng;t.geocode({latLng:n},function(t,a){a==google.maps.GeocoderStatus.OK&&(n=t[0].geometry.location,e.addEventNow({lat:n.lat(),lng:n.lng(),event_location:t[0].formatted_address,start_date:e._date,end_date:e.date.add(e._date,e.config.time_step,"minute")}))})}});var r={content:""};e.config.map_infowindow_max_width&&(r.maxWidth=e.config.map_infowindow_max_width),e.map={_points:[],_markers:[],_infowindow:new google.maps.InfoWindow(r),_infowindows_content:[],_initialization_count:-1,_obj:i},t=new google.maps.Geocoder,e.config.map_resolve_user_location&&navigator.geolocation&&(e._isMapPositionSet||navigator.geolocation.getCurrentPosition(function(t){var a=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);i.setCenter(a),i.setZoom(e.config.map_zoom_after_resolve||10),e.map._infowindow.setContent(e.locale.labels.marker_geo_success),e.map._infowindow.position=i.getCenter(),e.map._infowindow.open(i),e._isMapPositionSet=!0},function(){e.map._infowindow.setContent(e.locale.labels.marker_geo_fail),e.map._infowindow.setPosition(i.getCenter()),e.map._infowindow.open(i),e._isMapPositionSet=!0})),google.maps.event.addListener(i,"resize",function(e){a.style.zIndex="5",i.setZoom(i.getZoom())}),google.maps.event.addListener(i,"tilesloaded",function(e){a.style.zIndex="5"}),a.style.display="none";var o=e.render_data;function s(){var t=e.get_visible_events();t.sort(function(e,t){return e.start_date.valueOf()==t.start_date.valueOf()?e.id>t.id?1:-1:e.start_date>t.start_date?1:-1});for(var a="
",n=0;n
"+e.templates.map_time(i.start_date,i.end_date,i)+"
",a+="
 
",a+="
"+e.templates.map_text(i.start_date,i.end_date,i)+"
"}a+="
",e._els.dhx_cal_data[0].scrollTop=0,e._els.dhx_cal_data[0].innerHTML=a,e._els.dhx_cal_data[0].style.width=e.xy.map_date_width+e.xy.map_description_width+1+"px";var l=e._els.dhx_cal_data[0].firstChild.childNodes,c=e._getNavDateElement();for(c&&(c.innerHTML=e.templates[e._mode+"_date"](e._min_date,e._max_date,e._mode)),e._rendered=[],n=0;n
"+a.date+"
"+a.description+"
",e._table_view=!0,e.set_sizes()}}(t),t){!function(){e._selected_event_id=null,e.map._infowindow.close();var t=e.map._markers;for(var a in t)t.hasOwnProperty(a)&&(t[a].setMap(null),delete e.map._markers[a],e.map._infowindows_content[a]&&delete e.map._infowindows_content[a])}(),s(),n.style.display="block",_("dhx_gmap"),a=e.map._obj.getCenter();for(var i=e.get_visible_events(),r=0;re._min_date||n.start_datee._max_date||n.start_date.valueOf()>=e._min_date&&n.end_date.valueOf()<=e._max_date?(e.map._markers[t]&&e.map._markers[t].setMap(null),c(n)):(e._selected_event_id=null,e.map._infowindow.close(),e.map._markers[t]&&e.map._markers[t].setMap(null))}return!0}),e.attachEvent("onEventIdChange",function(t,a){var n=e.getEvent(a);return(n.start_datee._min_date||n.start_datee._max_date||n.start_date.valueOf()>=e._min_date&&n.end_date.valueOf()<=e._max_date)&&(e.map._markers[t]&&(e.map._markers[t].setMap(null),delete e.map._markers[t]),e.map._infowindows_content[t]&&delete e.map._infowindows_content[t],c(n)),!0}),e.attachEvent("onEventAdded",function(t,a){return e._dataprocessor||(a.start_datee._min_date||a.start_datee._max_date||a.start_date.valueOf()>=e._min_date&&a.end_date.valueOf()<=e._max_date)&&(e.map._markers[t]&&e.map._markers[t].setMap(null),c(a)),!0}),e.attachEvent("onBeforeEventDelete",function(t,a){return e.map._markers[t]&&e.map._markers[t].setMap(null),e._selected_event_id=null,e.map._infowindow.close(),!0}),e._event_resolve_delay=1500,e.attachEvent("onEventLoading",function(t){return e.config.map_resolve_event_location&&t.event_location&&!t.lat&&!t.lng&&(e._event_resolve_delay+=1500,function(t,a,n,i){setTimeout(function(){if(e.$destroyed)return!0;var i=t.apply(a,n);return t=a=n=null,i},i||1)}(u,this,[t],e._event_resolve_delay)),!0}),e.attachEvent("onEventCancel",function(t,a){return a&&(e.map._markers[t]&&e.map._markers[t].setMap(null),e.map._infowindow.close()),!0})})},minical:function(e){var t=e._createDomEventScope();e.templates.calendar_month=e.date.date_to_str("%F %Y"),e.templates.calendar_scale_date=e.date.date_to_str("%D"),e.templates.calendar_date=e.date.date_to_str("%d"),e.config.minicalendar={mark_events:!0},e._synced_minicalendars=[],e.renderCalendar=function(a,n,i){var r=null,o=a.date||e._currentDate();if("string"==typeof o&&(o=this.templates.api_date(o)),n)r=this._render_calendar(n.parentNode,o,a,n),e.unmarkCalendar(r);else{var s=a.container,_=a.position;if("string"==typeof s&&(s=document.getElementById(s)),"string"==typeof _&&(_=document.getElementById(_)),_&&void 0===_.left&&void 0===_.right){var d=e.$domHelpers.getOffset(_);_={top:d.top+_.offsetHeight,left:d.left}}s||(s=e._get_def_cont(_)),(r=this._render_calendar(s,o,a)).$_eventAttached||(r.$_eventAttached=!0,t.attach(r,"click",function(t){var a=t.target||t.srcElement,n=e.$domHelpers;if(n.closest(a,".dhx_month_head")&&!n.closest(a,".dhx_after")&&!n.closest(a,".dhx_before")){var i=n.closest(a,"[data-cell-date]").getAttribute("data-cell-date"),r=e.templates.parse_date(i);e.unmarkCalendar(this),e.markCalendar(this,r,"dhx_calendar_click"),this._last_date=r,this.conf.handler&&this.conf.handler.call(e,r,this)}}.bind(r)))}if(e.config.minicalendar.mark_events)for(var l=e.date.month_start(o),c=e.date.add(l,1,"month"),u=this.getEvents(l,c),h=this["filter_"+this._mode],f={},p=0;p=c.valueOf())););}}return this._markCalendarCurrentDate(r),r.conf=a,a.sync&&!i&&this._synced_minicalendars.push(r),r.conf._on_xle_handler||(r.conf._on_xle_handler=e.attachEvent("onXLE",function(){e.updateCalendar(r,r.conf.date)})),this.config.wai_aria_attributes&&this.config.wai_aria_application_role&&r.setAttribute("role","application"),r},e._get_def_cont=function(t){return this._def_count||(this._def_count=document.createElement("div"),this._def_count.className="dhx_minical_popup",e.event(this._def_count,"click",function(e){e.cancelBubble=!0}),document.body.appendChild(this._def_count)),t.left&&(this._def_count.style.left=t.left+"px"),t.right&&(this._def_count.style.right=t.right+"px"),t.top&&(this._def_count.style.top=t.top+"px"),t.bottom&&(this._def_count.style.bottom=t.bottom+"px"),this._def_count._created=new Date,this._def_count},e._locateCalendar=function(t,a){if("string"==typeof a&&(a=e.templates.api_date(a)),+a>+t._max_date||+a<+t._min_date)return null;for(var n=t.querySelector(".dhx_year_body").childNodes[0],i=0,r=new Date(t._min_date);+this.date.add(r,1,"week")<=+a;)r=this.date.add(r,1,"week"),i++;var o=e.config.start_on_monday,s=(a.getDay()||(o?7:0))-(o?1:0);return n.rows[i].cells[s].firstChild},e.markCalendar=function(e,t,a){var n=this._locateCalendar(e,t);n&&(n.className+=" "+a)},e.unmarkCalendar=function(e,t,a){if(t=t||e._last_date,a=a||"dhx_calendar_click",t){var n=this._locateCalendar(e,t);n&&(n.className=(n.className||"").replace(RegExp(a,"g")))}},e._week_template=function(t){for(var a=t||250,n=0,i=document.createElement("div"),r=this.date.week_start(e._currentDate()),o=0;o<7;o++)this._cols[o]=Math.floor(a/(7-o)),this._render_x_header(o,n,r,i),r=this.date.add(r,1,"day"),a-=this._cols[o],n+=this._cols[o];return i.lastChild.className+=" dhx_scale_bar_last",i},e.updateCalendar=function(e,t){e.conf.date=t,this.renderCalendar(e.conf,e,!0)},e._mini_cal_arrows=[" "," "],e._render_calendar=function(a,n,i,r){var o=e.templates,s=this._cols;this._cols=[];var _=this._mode;this._mode="calendar";var d=this._colsS;this._colsS={height:0};var l=new Date(this._min_date),c=new Date(this._max_date),u=new Date(e._date),h=o.month_day,f=this._ignores_detected;this._ignores_detected=0,o.month_day=o.calendar_date,n=this.date.month_start(n);var p,v=this._week_template(a.offsetWidth-1-this.config.minicalendar.padding);r?p=r:(p=document.createElement("div")).className="dhx_cal_container dhx_mini_calendar",p.setAttribute("date",this._helpers.formatDate(n)),p.innerHTML="
":"'>")+"
"+(v?v.innerHTML:"")+"
";var g=p.querySelector(".dhx_year_month"),m=p.querySelector(".dhx_year_week"),y=p.querySelector(".dhx_year_body");if(g.innerHTML=this.templates.calendar_month(n),i.navigation)for(var b=function(t,a){var n=e.date.add(t._date,a,"month");e.updateCalendar(t,n),e._date.getMonth()==t._date.getMonth()&&e._date.getFullYear()==t._date.getFullYear()&&e._markCalendarCurrentDate(t)},x=["dhx_cal_prev_button","dhx_cal_next_button"],k=["left:1px;top:2px;position:absolute;","left:auto; right:1px;top:2px;position:absolute;"],w=[-1,1],E=function(t){return function(){if(i.sync)for(var a=e._synced_minicalendars,n=0;n500)&&(a=this._def_count.firstChild),a&&(t.detachAll(),a.innerHTML="",a.parentNode&&a.parentNode.removeChild(a),this._def_count&&(this._def_count.style.top="-1000px"),a.conf&&a.conf._on_xle_handler&&e.detachEvent(a.conf._on_xle_handler))},e.isCalendarVisible=function(){return!!(this._def_count&&parseInt(this._def_count.style.top,10)>0)&&this._def_count},e.attachEvent("onTemplatesReady",function(){e.event(document.body,"click",function(){e.destroyCalendar()})},{once:!0}),e.templates.calendar_time=e.date.date_to_str("%d-%m-%Y"),e.form_blocks.calendar_time={render:function(t){var a="",n=e.config,i=this.date.date_part(e._currentDate()),r=1440,o=0;n.limit_time_select&&(o=60*n.first_hour,r=60*n.last_hour+1),i.setHours(o/60),t._time_values=[],a+=" ")+"  –  "+a+""},set_value:function(t,a,n,i){var r,o,s=t.getElementsByTagName("input"),_=t.getElementsByTagName("select"),d=function(t,a,n){e.event(t,"click",function(){e.destroyCalendar(null,!0),e.renderCalendar({position:t,date:new Date(this._date),navigation:!0,handler:function(a){t.value=e.templates.calendar_time(a),t._date=new Date(a),e.destroyCalendar(),e.config.event_duration&&e.config.auto_end_date&&0===n&&h()}})})};if(e.config.full_day){if(!t._full_day){var l="";e.config.wide_form||(l=t.previousSibling.innerHTML+l),t.previousSibling.innerHTML=l,t._full_day=!0}var c=t.previousSibling.getElementsByTagName("input")[0],u=0===e.date.time_part(n.start_date)&&0===e.date.time_part(n.end_date);c.checked=u,_[0].disabled=c.checked,_[1].disabled=c.checked,c.$_eventAttached||(c.$_eventAttached=!0,e.event(c,"click",function(){if(!0===c.checked){var a={};e.form_blocks.calendar_time.get_value(t,a),r=e.date.date_part(a.start_date),(+(o=e.date.date_part(a.end_date))==+r||+o>=+r&&(0!==n.end_date.getHours()||0!==n.end_date.getMinutes()))&&(o=e.date.add(o,1,"day"))}var i=r||n.start_date,d=o||n.end_date;f(s[0],i),f(s[1],d),_[0].value=60*i.getHours()+i.getMinutes(),_[1].value=60*d.getHours()+d.getMinutes(),_[0].disabled=c.checked,_[1].disabled=c.checked}))}if(e.config.event_duration&&e.config.auto_end_date){var h=function(){e.config.auto_end_date&&e.config.event_duration&&(r=e.date.add(s[0]._date,_[0].value,"minute"),o=new Date(r.getTime()+60*e.config.event_duration*1e3),s[1].value=e.templates.calendar_time(o),s[1]._date=e.date.date_part(new Date(o)),_[1].value=60*o.getHours()+o.getMinutes())};_[0].$_eventAttached||_[0].addEventListener("change",h)}function f(t,a,n){d(t,a,n),t.value=e.templates.calendar_time(a),t._date=e.date.date_part(new Date(a))}function p(e){for(var t=i._time_values,a=60*e.getHours()+e.getMinutes(),n=a,r=!1,o=0;o=s.valueOf()))for(var _=n;_.valueOf()_&&e.markCalendar(t,_,"dhx_calendar_click"),_=e.date.add(_,1,"day")},e.attachEvent("onEventCancel",function(){e.destroyCalendar(null,!0)}),e.attachEvent("onDestroy",function(){e.destroyCalendar()})},monthheight:function(e){e.attachEvent("onTemplatesReady",function(){e.xy.scroll_width=0;var t=e.render_view_data;e.render_view_data=function(){var a=this._els.dhx_cal_data[0];a.firstChild._h_fix=!0,t.apply(e,arguments);var n=parseInt(a.style.height);a.style.height="1px",a.style.height=a.scrollHeight+"px",this._obj.style.height=this._obj.clientHeight+a.scrollHeight-n+"px"};var a=e._reset_month_scale;e._reset_month_scale=function(t,n,i,r){var o={clientHeight:100};a.apply(e,[o,n,i,r]),t.innerHTML=o.innerHTML}})},multisection:function(e){Me("Multisection",e.assert)},multisource:function(e){var t=e._load;e._load=function(e,a){if("object"==Pe(e=e||this._load_url))for(var n=function(e){var t=function(){};return t.prototype=e,t}(this._loaded),i=0;i]*>","g"),i=new RegExp("]*>","g");function r(e){return e.replace(i,"\n").replace(n,"")}function o(e,a){e=parseFloat(e),a=parseFloat(a),isNaN(a)||(e-=a);var n=_(e);return e=e-n.width+n.cols*t,isNaN(e)?"auto":100*e/t}function s(e,a,n){e=parseFloat(e),a=parseFloat(a),!isNaN(a)&&n&&(e-=a);var i=_(e);return e=e-i.width+i.cols*t,isNaN(e)?"auto":100*e/(t-(isNaN(a)?0:a))}function _(t){for(var a=0,n=e._els.dhx_cal_header[0].childNodes,i=n[1]?n[1].childNodes:n[0].childNodes,r=0;rs))break;t-=s+1,a+=s+1}return{width:a,cols:r}}function d(e){return e=parseFloat(e),isNaN(e)?"auto":100*e/a}function l(e,t){return(window.getComputedStyle?window.getComputedStyle(e,null)[t]:e.currentStyle?e.currentStyle[t]:null)||""}function c(t,a){for(var n=parseInt(t.style.left,10),i=0;in)return i;return a}function h(e){return e?"<"+e+">":""}function f(e){return e?"":""}function p(e,t,a,n){var i="<"+e+" profile='"+t+"'";return a&&(i+=" header='"+a+"'"),n&&(i+=" footer='"+n+"'"),i+=">"}function v(){var t="",n=e._mode;if(e.matrix&&e.matrix[e._mode]&&(n="cell"==e.matrix[e._mode].render?"matrix":"timeline"),t+="","week_agenda"==e._mode)for(var i=e._els.dhx_cal_data[0].getElementsByTagName("DIV"),o=0;o"+r(i[o].innerHTML)+"");else if("agenda"==e._mode||"map"==e._mode)t+=""+r((i=e._els.dhx_cal_header[0].childNodes[0].childNodes)[0].innerHTML)+""+r(i[1].innerHTML)+"";else if("year"==e._mode)for(i=e._els.dhx_cal_data[0].childNodes,o=0;o",t+=m(i[o].querySelector(".dhx_year_week").childNodes),t+=g(i[o].querySelector(".dhx_year_body")),t+="";else{t+="",t+=m(i=e._els.dhx_cal_header[0].childNodes),t+="";var s=e._els.dhx_cal_data[0];if(e.matrix&&e.matrix[e._mode]){for(t+="",o=0;o";t+="",a=s.firstChild.rows[0].cells[0].offsetHeight}else if("TABLE"==s.firstChild.tagName)t+=g(s);else{for(s=s.childNodes[s.childNodes.length-1];-1==s.className.indexOf("dhx_scale_holder");)s=s.previousSibling;for(s=s.childNodes,t+="",o=0;o";t+="",a=s[0].offsetHeight}}return t+=""}function g(e){for(var t="",n=e.querySelectorAll("tr"),i=0;i",a=s[0].offsetHeight}return t}function m(a){var n,i="";e.matrix&&e.matrix[e._mode]&&(e.matrix[e._mode].second_scale&&(n=a[1].childNodes),a=a[0].childNodes);for(var o=0;o";if(t=a[0].offsetWidth,n){var s=0,_=a[0].offsetWidth,d=1;for(o=0;o",(s+=n[o].offsetWidth)>=_&&(_+=a[d]?a[d].offsetWidth:0,d++),t=n[0].offsetWidth}return i}function y(t){var n="",i=e._rendered,_=e.matrix&&e.matrix[e._mode];if("agenda"==e._mode||"map"==e._mode)for(var h=0;h";else if("week_agenda"==e._mode)for(h=0;h"+r(i[h].innerHTML)+"";else if("year"==e._mode)for(i=e.get_visible_events(),h=0;h",(f=e.date.add(f,1,"day")).valueOf()>=e._max_date.valueOf())break}}else if(_&&"cell"==_.render)for(i=e._els.dhx_cal_data[0].getElementsByTagName("TD"),h=0;h";else for(h=0;h","event"==E?(n+="
",g=t?l(i[h].childNodes[2],"color"):"",n+=""):(g=t?l(i[h],"color"):"",n+=""),n+=""}}}}return n}function b(t,a,n,i,r,o){var s=!1;"fullcolor"==i&&(s=!0,i="color"),i=i||"color";var _="";if(t){var d=e._date,l=e._mode;a=e.date[n+"_start"](a),a=e.date["get_"+n+"_end"]?e.date["get_"+n+"_end"](a):e.date.add(a,1,n),_=p("pages",i,r,o);for(var c=new Date(t);+c<+a;c=this.date.add(c,1,n))this.setCurrentView(c,n),_+=h("page")+v().replace("–","-")+y(s)+f("page");_+=f("pages"),this.setCurrentView(d,l)}else _=p("data",i,r,o)+v().replace("–","-")+y(s)+f("data");return _}function x(t,a,n,i,r,o,s){!function(t,a){var n=e.uid(),i=document.createElement("div");i.style.display="none",document.body.appendChild(i),i.innerHTML='
',document.getElementById(n).firstChild.value=encodeURIComponent(t),document.getElementById(n).submit(),i.parentNode.removeChild(i)}("object"==ze(r)?function(e){for(var t="",a=0;awindow.innerWidth&&(r=window.innerWidth-n),r=Math.max(0,r),a.style.left=r+"px",a.style.top=t.top-(t.dy?i:-t.height)+"px"}else a.style.top=this.xy.scale_height+this.xy.nav_height+20+"px",1==t.dx?(a.style.right="auto",a.style.left=-n+"px",setTimeout(function(){a.style.left="-10px"},1)):(a.style.left="auto",a.style.right=-n+"px",setTimeout(function(){a.style.right="-10px"},1)),a.className=a.className.replace(" dhx_qi_left","").replace(" dhx_qi_right","")+" dhx_qi_"+(1==t.dx?"left":"right")},e.attachEvent("onTemplatesReady",function(){if(e.hideQuickInfo(),this._quick_info_box){var t=this._quick_info_box;t.parentNode&&t.parentNode.removeChild(t),this._quick_info_box=null}}),e._quick_info_onscroll_handler=function(t){e.hideQuickInfo()},e._init_quick_info=function(){if(!this._quick_info_box){var t=e.xy,a=this._quick_info_box=document.createElement("div");this._waiAria.quickInfoAttr(a),a.className="dhx_cal_quick_info",e.$testmode&&(a.className+=" dhx_no_animate"),e.config.rtl&&(a.className+=" dhx_quick_info_rtl");var n=this._waiAria.quickInfoHeaderAttrString(),i='
';i+='
';for(var r=e.config.icons_select,o=0;o
"+e.locale.labels[r[o]]+"
";i+="",a.innerHTML=i,e.event(a,"click",function(t){e._qi_button_click(t.target||t.srcElement)}),e.config.quick_info_detached&&(e._detachDomEvent(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler),e.event(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler))}return this._quick_info_box},e._qi_button_click=function(t){var a=e._quick_info_box;if(t&&t!=a){var n=e._getClassName(t);if(-1!=n.indexOf("_icon")){var i=e._quick_info_box_id;e._click.buttons[n.split(" ")[1].replace("icon_","")](i)}else e._qi_button_click(t.parentNode)}},e._get_event_counter_part=function(t){for(var a=e.getRenderedEvent(t),n=0,i=0,r=a;r&&r!=e._obj;)n+=r.offsetLeft,i+=r.offsetTop-r.scrollTop,r=r.offsetParent;return r?{left:n,top:i,dx:n+a.offsetWidth/2>e._x/2?1:0,dy:i+a.offsetHeight/2>e._y/2?1:0,width:a.offsetWidth,height:a.offsetHeight}:0},e._fill_quick_data=function(t){var a=e.getEvent(t),n=e._quick_info_box;e._quick_info_box_id=t;var i={content:e.templates.quick_info_title(a.start_date,a.end_date,a),date:e.templates.quick_info_date(a.start_date,a.end_date,a)},r=n.firstChild.firstChild;r.innerHTML=i.content,r.nextSibling.innerHTML=i.date,e._waiAria.quickInfoHeader(n,[i.content,i.date].join(" ")),n.firstChild.nextSibling.innerHTML=e.templates.quick_info_content(a.start_date,a.end_date,a)}},readonly:function(e){e.attachEvent("onTemplatesReady",function(){var t;e.form_blocks.recurring&&(t=e.form_blocks.recurring.set_value);var a=e.config.buttons_left.slice(),n=e.config.buttons_right.slice();function i(e,t,a,n){for(var i=t.getElementsByTagName(e),r=a.getElementsByTagName(e),o=r.length-1;o>=0;o--)if(a=r[o],n){var s=document.createElement("span");s.className="dhx_text_disabled",s.innerHTML=n(i[o]),a.parentNode.insertBefore(s,a),a.parentNode.removeChild(a)}else a.disabled=!0,t.checked&&(a.checked=!0)}e.attachEvent("onBeforeLightbox",function(i){this.config.readonly_form||this.getEvent(i).readonly?this.config.readonly_active=!0:(this.config.readonly_active=!1,e.config.buttons_left=a.slice(),e.config.buttons_right=n.slice(),e.form_blocks.recurring&&(e.form_blocks.recurring.set_value=t));var r=this.config.lightbox.sections;if(this.config.readonly_active){for(var o=0;o






'+r.repeat_text_occurences_count+'

'},_ds:{},_get_form_node:function(e,t,a){var n=e[t];if(!n)return null;if(n.nodeName)return n;if(n.length)for(var i=0;io)return t.setDate(t.getDate()+1*a[s]-o-(i?n:r));this.transpose_day_week(t,a,n+i,null,n)},e.transpose_type=function(t){var a="transpose_"+t;if(!this.date[a]){var n=t.split("_"),i="add_"+t,r=this.transponse_size[n[0]]*n[1];if("day"==n[0]||"week"==n[0]){var o=null;if(n[4]&&(o=n[4].split(","),e.config.start_on_monday)){for(var s=0;s0&&t.setDate(t.getDate()+n*r),o&&e.transpose_day_week(t,o,1,r),t},this.date[i]=function(t,a){var n=new Date(t.valueOf());if(o)for(var i=0;i=0&&(t.setDate(1),t.setMonth(t.getMonth()+o*r)),e.date[i](t,0,n)},this.date[i]=function(t,a,o,s){if(s?s++:s=1,s>12)return null;var _=new Date(t.valueOf());_.setDate(1),_.setMonth(_.getMonth()+a*r);var d=_.getMonth(),l=_.getFullYear();_.setDate(o.start_date.getDate()),n[3]&&e.date.day_week(_,n[2],n[3]);var c=e.config.recurring_overflow_instances;return _.getMonth()!=d&&"none"!=c&&(_="lastDay"===c?new Date(l,d+1,0,_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()):e.date[i](new Date(l,d+1,0),a||1,o,s)),_})}},e.repeat_date=function(t,a,n,i,r,o){i=i||this._min_date,r=r||this._max_date;var s=o||-1,_=new Date(t.start_date.valueOf()),d=_.getHours(),l=0;for(!t.rec_pattern&&t.rec_type&&(t.rec_pattern=t.rec_type.split("#")[0]),this.transpose_type(t.rec_pattern),_=e.date["transpose_"+t.rec_pattern](_,i,t);_&&(_0?new Date(n.valueOf()+1e3*a.event_length-60*r*1e3):new Date(t.valueOf()-60*r*1e3):new Date(i.valueOf())},e.getRecDates=function(t,a){var n="object"==Fe(t)?t:e.getEvent(t),i=[];if(a=a||100,!n.rec_type)return[{start_date:n.start_date,end_date:n.end_date}];if("none"==n.rec_type)return[];e.repeat_date(n,i,!0,n.start_date,n.end_date,a);for(var r=[],o=0;oe)if(i.rec_pattern){if("none"==i.rec_pattern)continue;var r=[];this.repeat_date(i,r,!0,e,t);for(var o=0;oe&&!this._rec_markers[r[o].id]&&a.push(r[o])}else this._is_virtual_event(i.id)||a.push(i)}return a},e.config.repeat_date="%m.%d.%Y",e.config.lightbox.sections=[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}],e._copy_dummy=function(e){var t=new Date(this.start_date),a=new Date(this.end_date);this.start_date=t,this.end_date=a,this.event_length=this.event_pid=this.rec_pattern=this.rec_type=null},e.config.include_end_by=!1,e.config.lightbox_recurring="ask",e.attachEvent("onClearAll",function(){e._rec_markers={},e._rec_markers_pull={},e._rec_temp=[]})},serialize:function(e){var t=I()(e);e.data_attributes=function(){var a=[],n=e._helpers.formatDate,i=t();for(var r in i){var o=i[r];for(var s in o)"_"!=s.substr(0,1)&&a.push([s,"start_date"==s||"end_date"==s?n:null]);break}return a},e.toXML=function(e){var a=[],n=this.data_attributes(),i=t();for(var r in i){var o=i[r];a.push("");for(var s=0;s");a.push("")}return(e||"")+""+a.join("\n")+""},e._serialize_json_value=function(e){return null===e||"boolean"==typeof e?e=""+e:(e||0===e||(e=""),e='"'+e.toString().replace(/\n/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'),e},e.toJSON=function(){return JSON.stringify(this.serialize())},e.toICal=function(a){var n=e.date.date_to_str("%Y%m%dT%H%i%s"),i=e.date.date_to_str("%Y%m%d"),r=[],o=t();for(var s in o){var _=o[s];r.push("BEGIN:VEVENT"),_._timed&&(_.start_date.getHours()||_.start_date.getMinutes())?r.push("DTSTART:"+n(_.start_date)):r.push("DTSTART:"+i(_.start_date)),_._timed&&(_.end_date.getHours()||_.end_date.getMinutes())?r.push("DTEND:"+n(_.end_date)):r.push("DTEND:"+i(_.end_date)),r.push("SUMMARY:"+_.text),r.push("END:VEVENT")}return"BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\nDESCRIPTION:"+(a||"")+"\n"+r.join("\n")+"\nEND:VCALENDAR"}},timeline:function(e){Me("Timeline",e.assert)},tooltip:function(e){var t=e._createDomEventScope(),a={};e.ext.tooltip=e.dhtmlXTooltip=e.tooltip=a,a.config={className:"dhtmlXTooltip scheduler_tooltip tooltip",timeout_to_display:50,timeout_to_hide:50,delta_x:15,delta_y:-20},a.tooltip=document.createElement("div"),a.tooltip.className=a.config.className,e._waiAria.tooltipAttr(a.tooltip),a.show=function(n,i){if(!this._mobile||e.config.touch_tooltip){var r=a,o=this.tooltip,s=o.style;r.tooltip.className=r.config.className;var _=this.position(n),d=n.target||n.srcElement;if(!this.isTooltip(d)){var l=_.x+(r.config.delta_x||0),c=_.y-(r.config.delta_y||0);s.visibility="hidden",s.right="",s.bottom="",s.left="0",s.top="0",e.config.rtl&&(o.className+=" dhtmlXTooltip_rtl"),this.tooltip.innerHTML=i,document.body.appendChild(this.tooltip);var u=this.tooltip.offsetWidth,h=this.tooltip.offsetHeight;if(document.documentElement.clientWidth-l-u<0?(s.left="",s.right=document.documentElement.clientWidth-l+2*(r.config.delta_x||0)+"px"):s.left=l<0?_.x+Math.abs(r.config.delta_x||0)+"px":l+"px",document.documentElement.clientHeight-c-h<0){var f=document.documentElement.clientHeight-c-2*(r.config.delta_y||0);f+h>document.documentElement.clientHeight?(c-=Math.abs(document.documentElement.clientHeight-c-h),c=Math.max(c,0),s.top=c+"px"):(s.bottom=f+"px",s.top="")}else s.top=c<0?_.y+Math.abs(r.config.delta_y||0)+"px":c+"px";e._waiAria.tooltipVisibleAttr(this.tooltip),s.visibility="visible",t.attach(this.tooltip,"mouseleave",function(t){for(var a=e.dhtmlXTooltip,n=t.relatedTarget;n!=e._obj&&n;)n=n.parentNode;n!=e._obj&&a.delay(a.hide,a,[],a.config.timeout_to_hide)}),e.callEvent("onTooltipDisplayed",[this.tooltip,this.tooltip.event_id])}}},a._clearTimeout=function(){this.tooltip._timeout_id&&clearTimeout(this.tooltip._timeout_id)},a.hide=function(){if(this.tooltip.parentNode){e._waiAria.tooltipHiddenAttr(this.tooltip);var a=this.tooltip.event_id;this.tooltip.event_id=null,t.detachAll(),this.tooltip.parentNode.removeChild(this.tooltip),e.callEvent("onAfterTooltip",[a])}this._clearTimeout()},a.delay=function(t,a,n,i){this._clearTimeout(),this.tooltip._timeout_id=setTimeout(function(){if(e.$destroyed)return!0;var i=t.apply(a,n);return t=a=n=null,i},i||this.config.timeout_to_display)},a.isTooltip=function(e){for(var t=!1;e&&!t;)t=e.className==this.tooltip.className,e=e.parentNode;return t},a.position=function(e){return{x:e.clientX,y:e.clientY}},e.attachEvent("onMouseMove",function(t,n){var i=n.target||n.srcElement,r=a,o=r.isTooltip(i),s=r.isTooltipTarget&&r.isTooltipTarget(i);if(t&&e.getState().editor_id!=t||o||s){var _,d;if(t||r.tooltip.event_id){var l=e.getEvent(t)||e.getEvent(r.tooltip.event_id);if(!l)return;if(r.tooltip.event_id=l.id,!(_=e.templates.tooltip_text(l.start_date,l.end_date,l)))return r.hide()}if(s&&(_=""),e.$env.isIE)for(var c in d={pageX:void 0,pageY:void 0,clientX:void 0,clientY:void 0,target:void 0,srcElement:void 0})d[c]=n[c];if(!e.callEvent("onBeforeTooltip",[t])||!_)return;r.delay(r.show,r,[d||n,_])}else r.delay(r.hide,r,[],r.config.timeout_to_hide)}),e.attachEvent("onBeforeDrag",function(){return a.hide(),!0}),e.attachEvent("onEventDeleted",function(){return a.hide(),!0}),e.attachEvent("onDestroy",function(){a.hide()})},treetimeline:function(e){Me("Tree Timeline",e.assert)},units:function(e){Me("Units",e.assert)},url:function(e){e._get_url_nav=function(){for(var e={},t=(document.location.hash||"").replace("#","").split(","),a=0;a",s+="
"+(o[_]._timed?this.templates.event_date(o[_].start_date):"")+"
",s+="
 
",s+=this.templates.year_tooltip(o[_].start_date,o[_].end_date,o[_])+""}}this._tooltip.style.display="",this._tooltip.style.top="0px",document.body.offsetWidth-a.left-this._tooltip.offsetWidth<0?this._tooltip.style.left=a.left-this._tooltip.offsetWidth+"px":this._tooltip.style.left=a.left+i.offsetWidth+"px",this._tooltip.date=t,this._tooltip.innerHTML=s,document.body.offsetHeight-a.top-this._tooltip.offsetHeight<0?this._tooltip.style.top=a.top-this._tooltip.offsetHeight+i.offsetHeight+"px":this._tooltip.style.top=a.top+"px"},e._year_view_tooltip_handler=function(a){if(t()){var n=a.target||a.srcElement;"a"==n.tagName.toLowerCase()&&(n=n.parentNode),-1!=e._getClassName(n).indexOf("dhx_year_event")?e._showToolTip(e.templates.parse_date(n.getAttribute("data-year-date")),e.$domHelpers.getOffset(n),a,n):e._hideToolTip()}},e._init_year_tooltip=function(){e._detachDomEvent(e._els.dhx_cal_data[0],"mouseover",e._year_view_tooltip_handler),e.event(e._els.dhx_cal_data[0],"mouseover",e._year_view_tooltip_handler)},e._get_year_cell=function(t){for(var a=e.templates.format_date(t),n=this.$root.querySelectorAll('.dhx_cal_data [data-cell-date="'.concat(a,'"] .dhx_month_head')),i=0;i=this._max_date.valueOf())return},e.year_view=function(t){var a;if(t&&(a=e.xy.scale_height,e.xy.scale_height=-1),e._els.dhx_cal_header[0].style.display=t?"none":"",e.set_sizes(),t&&(e.xy.scale_height=a),e._table_view=t,!this._load_mode||!this._load())if(t){if(e._init_year_tooltip(),e._reset_year_scale(),e._load_mode&&e._load())return void(e._render_wait=!0);e.render_view_data()}else e._hideToolTip()},e._reset_year_scale=function(){this._cols=[],this._colsS={};var t=[],a=this._els.dhx_cal_data[0],n=this.config;a.scrollTop=0,a.innerHTML="";var i=Math.floor(parseInt(a.style.width)/n.year_x),r=Math.floor((parseInt(a.style.height)-e.xy.year_top)/n.year_y);r<190&&(r=190,i=Math.floor((parseInt(a.style.width)-e.xy.scroll_width)/n.year_x));var o=i-11,s=0,_=document.createElement("div"),d=this.date.week_start(e._currentDate());this._process_ignores(d,7,"day",1);for(var l=7-(this._ignores_detected||0),c=0,u=0;u<7;u++)this._ignores&&this._ignores[u]||(this._cols[u]=Math.floor(o/(l-c)),this._render_x_header(u,s,d,_),o-=this._cols[u],s+=this._cols[u],c++),d=this.date.add(d,1,"day");for(_.lastChild.className+=" dhx_scale_bar_last",u=0;u<_.childNodes.length;u++)this._waiAria.yearHeadCell(_.childNodes[u]);var h=this.date[this._mode+"_start"](this.date.copy(this._date)),f=h,p=null;for(u=0;u
"+_.innerHTML+"
";var g=p.querySelector(".dhx_year_month"),m=p.querySelector(".dhx_year_grid"),y=p.querySelector(".dhx_year_week"),b=p.querySelector(".dhx_year_body"),x=e.uid();this._waiAria.yearHeader(g,x),this._waiAria.yearGrid(m,x),g.innerHTML=this.templates.year_month(h);var k=this.date.week_start(h);this._reset_month_scale(b,h,k,6);for(var w=b.querySelectorAll("td"),E=0;E0;)d(e)}function d(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var a=e.shift(),n=e.shift();t.call(a,n)}}s.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},s.prototype.hasCustomScheduler=function(){return this._customScheduler},s.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},s.prototype.fatalError=function(e,t){t?(a.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),a.exit(2)):this.throwLater(e)},s.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.prototype.invokeLater=function(e,t,a){this._lateQueue.push(e,t,a),this._queueTick()},s.prototype.invoke=function(e,t,a){this._normalQueue.push(e,t,a),this._queueTick()},s.prototype.settlePromises=function(e){this._normalQueue._pushOne(e),this._queueTick()},s.prototype._drainQueues=function(){_(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,_(this._lateQueue)},s.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},s.prototype._reset=function(){this._isTickUsed=!1},t.exports=s,t.exports.firstLineError=i},{"./queue":17,"./schedule":18}],2:[function(e,t,a){"use strict";t.exports=function(e,t,a,n){var i=!1,r=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(r,r,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},_=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(r){i||(i=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var d=a(r),l=new e(t);l._propagateFrom(this,1);var c=this._target();if(l._setBoundTo(d),d instanceof e){var u={promiseRejectionQueued:!1,promise:l,target:c,bindingPromise:d};c._then(t,o,void 0,l,u),d._then(s,_,void 0,l,u),l._setOnCancel(d)}else l._resolveCallback(c);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,a){return e.resolve(a).bind(t)}}},{}],3:[function(e,t,a){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=e("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(e){}return i},t.exports=i},{"./promise":15}],4:[function(e,t,a){"use strict";t.exports=function(t,a,n,i){var r=e("./util"),o=r.tryCatch,s=r.errorObj,_=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var a=e._cancellationParent;if(null==a||!a._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=a}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),_.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(r.isArray(e))for(var a=0;a=0)return a[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,a.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=a.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var a=e.prototype._pushContext,r=e.prototype._popContext,o=e._peekContext,s=e.prototype._peekContext,_=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=a,e.prototype._popContext=r,e._peekContext=o,e.prototype._peekContext=s,e.prototype._promiseCreated=_,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=i,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},{}],7:[function(e,t,n){"use strict";t.exports=function(t,n,i,r){var o,s,d,l,c=t._async,u=e("./errors").Warning,h=e("./util"),f=e("./es5"),p=h.canAttachTrace,v=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,g=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,y=null,b=null,x=!1,k=!(0==h.env("BLUEBIRD_DEBUG")),w=!(0==h.env("BLUEBIRD_WARNINGS")||!k&&!h.env("BLUEBIRD_WARNINGS")),E=!(0==h.env("BLUEBIRD_LONG_STACK_TRACES")||!k&&!h.env("BLUEBIRD_LONG_STACK_TRACES")),S=0!=h.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(w||!!h.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function a(){for(var t=0;t0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(e,t,a){return q(e,t,a||this)},t.onPossiblyUnhandledRejection=function(e){var a=t._getContext();s=h.contextBind(a,e)},t.onUnhandledRejectionHandled=function(e){var a=t._getContext();o=h.contextBind(a,e)};var D=function(){};t.longStackTraces=function(){if(c.haveItemsQueued()&&!ne.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ne.longStackTraces&&X()){var e=t.prototype._captureStackTrace,a=t.prototype._attachExtraTrace,i=t.prototype._dereferenceTrace;ne.longStackTraces=!0,D=function(){if(c.haveItemsQueued()&&!ne.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=e,t.prototype._attachExtraTrace=a,t.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),ne.longStackTraces=!1},t.prototype._captureStackTrace=B,t.prototype._attachExtraTrace=V,t.prototype._dereferenceTrace=U,n.activateLongStackTraces()}},t.hasLongStackTraces=function(){return ne.longStackTraces&&X()};var N={unhandledrejection:{before:function(){var e=h.global.onunhandledrejection;return h.global.onunhandledrejection=null,e},after:function(e){h.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=h.global.onrejectionhandled;return h.global.onrejectionhandled=null,e},after:function(e){h.global.onrejectionhandled=e}}},C=function(){var e=function(e,t){if(!e)return!h.global.dispatchEvent(t);var a;try{return a=e.before(),!h.global.dispatchEvent(t)}finally{e.after(a)}};try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=new CustomEvent(t,{detail:a,cancelable:!0});return f.defineProperty(n,"promise",{value:a.promise}),f.defineProperty(n,"reason",{value:a.reason}),e(N[t],n)}}if("function"==typeof Event){t=new Event("CustomEvent");return h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=new Event(t,{cancelable:!0});return n.detail=a,f.defineProperty(n,"promise",{value:a.promise}),f.defineProperty(n,"reason",{value:a.reason}),e(N[t],n)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!0,a),e(N[t],n)}}catch(e){}return function(){return!1}}(),T=h.isNode?function(){return a.emit.apply(a,arguments)}:h.global?function(e){var t="on"+e.toLowerCase(),a=h.global[t];return!!a&&(a.apply(h.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function A(e,t){return{promise:t}}var M={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(e,t,a){return{promise:t,child:a}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,a){return{reason:t,promise:a}},rejectionHandled:A},O=function(e){var t=!1;try{t=T.apply(null,arguments)}catch(e){c.throwLater(e),t=!0}var a=!1;try{a=C(e,M[e].apply(null,arguments))}catch(e){c.throwLater(e),a=!0}return a||t};function H(){return!1}function j(e,t,a){var n=this;try{e(t,a,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+h.toString(e));n._attachCancellationCallback(e)})}catch(e){return e}}function L(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?h.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function $(){return this._onCancelField}function P(e){this._onCancelField=e}function z(){this._cancellationParent=void 0,this._onCancelField=void 0}function F(e,t){if(0!=(1&t)){this._cancellationParent=e;var a=e._branchesRemainingToCancel;void 0===a&&(a=0),e._branchesRemainingToCancel=a+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}t.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&D()),"warnings"in e){var a=e.warnings;ne.warnings=!!a,S=ne.warnings,h.isObject(a)&&"wForgottenReturn"in a&&(S=!!a.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!ne.cancellation){if(c.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=z,t.prototype._propagateFrom=F,t.prototype._onCancel=$,t.prototype._setOnCancel=P,t.prototype._attachCancellationCallback=L,t.prototype._execute=j,I=F,ne.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!ne.monitoring?(ne.monitoring=!0,t.prototype._fireEvent=O):!e.monitoring&&ne.monitoring&&(ne.monitoring=!1,t.prototype._fireEvent=H)),"asyncHooks"in e&&h.nodeSupportsAsyncResource){var n=ne.asyncHooks,o=!!e.asyncHooks;n!==o&&(ne.asyncHooks=o,o?i():r())}return t},t.prototype._fireEvent=H,t.prototype._execute=function(e,t,a){try{e(t,a)}catch(e){return e}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(e){},t.prototype._attachCancellationCallback=function(e){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(e,t){};var I=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function R(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function B(){this._trace=new te(this._peekContext())}function V(e,t){if(p(e)){var a=this._trace;if(void 0!==a&&t&&(a=a._parent),void 0!==a)a.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=Y(e);h.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),h.notEnumerableProp(e,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function q(e,a,n){if(ne.warnings){var i,r=new u(e);if(a)n._attachExtraTrace(r);else if(ne.longStackTraces&&(i=t._peekContext()))i.attachExtraTrace(r);else{var o=Y(r);r.stack=o.message+"\n"+o.stack.join("\n")}O("warning",r)||W(r,"",!0)}}function J(e){for(var t=[],a=0;a0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),a=0;a0&&"SyntaxError"!=e.name&&(t=t.slice(a)),t}(e):[" (No stack trace)"],{message:a,stack:"SyntaxError"==e.name?t:J(t)}}function W(e,t,a){if("undefined"!=typeof console){var n;if(h.isObject(e)){var i=e.stack;n=t+b(i,e)}else n=t+String(e);"function"==typeof d?d(n,a):"function"!=typeof console.log&&"object"!==_(console.log)||console.log(n)}}function K(e,t,a,n){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(n):t(a,n))}catch(e){c.throwLater(e)}"unhandledRejection"===e?O(e,a,n)||i||W(a,"Unhandled rejection "):O(e,n)}function G(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():h.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){if(e.length<41)return e;return e.substr(0,38)+"..."}(t)+">, no stack trace)"}function X(){return"function"==typeof ae}var Q=function(){return!1},Z=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function ee(e){var t=e.match(Z);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function te(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);ae(this,te),t>32&&this.uncycle()}h.inherits(te,Error),n.CapturedTrace=te,te.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],a={},n=0,i=this;void 0!==i;++n)t.push(i),i=i._parent;for(n=(e=this._length=n)-1;n>=0;--n){var r=t[n].stack;void 0===a[r]&&(a[r]=n)}for(n=0;n0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var s=n>0?t[n-1]:this;o=0;--d)t[d]._length=_,_++;return}}}},te.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=Y(e),a=t.message,n=[t.stack],i=this;void 0!==i;)n.push(J(i.stack.split("\n"))),i=i._parent;!function(e){for(var t=e[0],a=1;a=0;--s)if(n[s]===r){o=s;break}for(s=o;s>=0;--s){var _=n[s];if(t[i]!==_)break;t.pop(),i--}t=n}}(n),function(e){for(var t=0;t=0)return y=/@/,b=t,x=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(b=function(e,t){return"string"==typeof e?e:"object"!==_(t)&&"function"!=typeof t||void 0===t.name||void 0===t.message?G(t):t.toString()},null):(y=e,b=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(d=function(e){console.warn(e)},h.isNode&&a.stderr.isTTY?d=function(e,t){var a=t?"":"";console.warn(a+e+"\n")}:h.isNode||"string"!=typeof(new Error).stack||(d=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var ne={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return E&&t.longStackTraces(),{asyncHooks:function(){return ne.asyncHooks},longStackTraces:function(){return ne.longStackTraces},warnings:function(){return ne.warnings},cancellation:function(){return ne.cancellation},monitoring:function(){return ne.monitoring},propagateFromFunction:function(){return I},boundValueFunction:function(){return R},checkForgottenReturns:function(e,t,a,n,i){if(void 0===e&&null!==t&&S){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;a&&(a+=" ");var r="",o="";if(t._trace){for(var s=t._trace.stack.split("\n"),_=J(s),d=_.length-1;d>=0;--d){var l=_[d];if(!g.test(l)){var c=l.match(m);c&&(r="at "+c[1]+":"+c[2]+":"+c[3]+" ");break}}if(_.length>0){var u=_[0];for(d=0;d0&&(o="\n"+s[d-1]);break}}}var h="a promise was created in a "+a+"handler "+r+"but was not returned from it, see http://goo.gl/rRqMUw"+o;n._warn(h,!0,t)}},setBounds:function(e,t){if(X()){for(var a,n,i=(e.stack||"").split("\n"),r=(t.stack||"").split("\n"),o=-1,s=-1,_=0;_=s||(Q=function(e){if(v.test(e))return!0;var t=ee(e);return!!(t&&t.fileName===a&&o<=t.line&&t.line<=s)})}},warn:q,deprecated:function(e,t){var a=e+" is deprecated and will be removed in a future version.";return t&&(a+=" Use "+t+" instead."),q(a)},CapturedTrace:te,fireDomEvent:C,fireGlobalEvent:T}}},{"./errors":9,"./es5":10,"./util":21}],8:[function(e,t,a){"use strict";t.exports=function(e){function t(){return this.value}function a(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(a){return a instanceof e&&a.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:a},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(a,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,a,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(a){if(arguments.length<=1)return a instanceof e&&a.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:a},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();return this.caught(a,function(){return n})}}},{}],9:[function(e,t,a){"use strict";var n,i,r=e("./es5"),o=r.freeze,s=e("./util"),_=s.inherits,d=s.notEnumerableProp;function l(e,t){function a(n){if(!(this instanceof a))return new a(n);d(this,"message","string"==typeof n?n:t),d(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return _(a,Error),a}var c=l("Warning","warning"),u=l("CancellationError","cancellation error"),h=l("TimeoutError","timeout error"),f=l("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(e){n=l("TypeError","type error"),i=l("RangeError","range error")}for(var p="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function c(){return h.call(this,this.promise._target()._settledValue())}function u(e){if(!l(this,e))return o.e=e,o}function h(e){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var _=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),e);if(_===n)return _;if(void 0!==_){i._setReturnedNonUndefined();var h=a(_,i);if(h instanceof t){if(null!=this.cancelPromise){if(h._isCancelled()){var f=new r("late cancellation observer");return i._attachExtraTrace(f),o.e=f,o}h.isPending()&&h._attachCancellationCallback(new d(this))}return h._then(c,u,void 0,this,void 0)}}}return i.isRejected()?(l(this),o.e=e,o):(l(this),e)}return _.prototype.isFinallyHandler=function(){return 0===this.type},d.prototype._resultCancelled=function(){l(this.finallyHandler)},t.prototype._passThrough=function(e,t,a,n){return"function"!=typeof e?this.then():this._then(a,n,void 0,new _(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,h,h)},t.prototype.tap=function(e){return this._passThrough(e,1,h)},t.prototype.tapCatch=function(e){var a=arguments.length;if(1===a)return this._passThrough(e,1,void 0,h);var n,r=new Array(a-1),o=0;for(n=0;n0&&"function"==typeof arguments[t]&&(e=arguments[t]);var n=[].slice.call(arguments);e&&n.pop();var i=new a(n).promise();return void 0!==e?i.spread(e):i}}},{"./util":21}],13:[function(e,t,a){"use strict";t.exports=function(t,a,n,i,r){var o=e("./util"),s=o.tryCatch;t.method=function(e){if("function"!=typeof e)throw new t.TypeError("expecting a function but got "+o.classString(e));return function(){var n=new t(a);n._captureStackTrace(),n._pushContext();var i=s(e).apply(this,arguments),o=n._popContext();return r.checkForgottenReturns(i,o,"Promise.method",n),n._resolveFromSyncValue(i),n}},t.attempt=t.try=function(e){if("function"!=typeof e)return i("expecting a function but got "+o.classString(e));var n,_=new t(a);if(_._captureStackTrace(),_._pushContext(),arguments.length>1){r.deprecated("calling Promise.try with more than 1 argument");var d=arguments[1],l=arguments[2];n=o.isArray(d)?s(e).apply(l,d):s(e).call(l,d)}else n=s(e)();var c=_._popContext();return r.checkForgottenReturns(n,c,"Promise.try",_),_._resolveFromSyncValue(n),_},t.prototype._resolveFromSyncValue=function(e){e===o.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":21}],14:[function(e,t,a){"use strict";var n=e("./util"),i=n.maybeWrapAsError,r=e("./errors").OperationalError,o=e("./es5");var s=/^(?:name|message|stack|cause)$/;function _(e){var t;if(function(e){return e instanceof Error&&o.getPrototypeOf(e)===Error.prototype}(e)){(t=new r(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var a=o.keys(e),i=0;i1){var a,n=new Array(t-1),i=0;for(a=0;a0&&"function"!=typeof e&&"function"!=typeof t){var a=".then() only accepts functions but was passed: "+_.classString(e);arguments.length>1&&(a+=", "+_.classString(t)),this._warn(a)}return this._then(e,t,void 0,void 0,void 0)},O.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},O.prototype.spread=function(e){return"function"!=typeof e?r("expecting a function but got "+_.classString(e)):this.all()._then(e,void 0,void 0,x,void 0)},O.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},O.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},O.prototype.error=function(e){return this.caught(_.originatesFromRejection,e)},O.getNewLibraryCopy=t.exports,O.is=function(e){return e instanceof O},O.fromNode=O.fromCallback=function(e){var t=new O(b);t._captureStackTrace();var a=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=M(e)(T(t,a));return n===A&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},O.all=function(e){return new E(e).promise()},O.cast=function(e){var t=w(e);return t instanceof O||((t=new O(b))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},O.resolve=O.fulfilled=O.cast,O.reject=O.rejected=function(e){var t=new O(b);return t._captureStackTrace(),t._rejectCallback(e,!0),t},O.setScheduler=function(e){if("function"!=typeof e)throw new m("expecting a function but got "+_.classString(e));return v.setScheduler(e)},O.prototype._then=function(e,t,a,n,i){var r=void 0!==i,o=r?i:new O(b),s=this._target(),d=s._bitField;r||(o._propagateFrom(this,3),o._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&d)?this._boundValue():s===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,o));var l=h();if(0!=(50397184&d)){var c,u,f=s._settlePromiseCtx;0!=(33554432&d)?(u=s._rejectionHandler0,c=e):0!=(16777216&d)?(u=s._fulfillmentHandler0,c=t,s._unsetRejectionIsUnhandled()):(f=s._settlePromiseLateCancellationObserver,u=new y("late cancellation observer"),s._attachExtraTrace(u),c=t),v.invoke(f,s,{handler:_.contextBind(l,c),promise:o,receiver:n,value:u})}else s._addCallbacks(e,t,o,n,l);return o},O.prototype._length=function(){return 65535&this._bitField},O.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},O.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},O.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},O.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},O.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},O.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},O.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},O.prototype._isFinal=function(){return(4194304&this._bitField)>0},O.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},O.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},O.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},O.prototype._setAsyncGuaranteed=function(){if(!v.hasCustomScheduler()){var e=this._bitField;this._bitField=e|(536870912&e)>>2^134217728}},O.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},O.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==s)return void 0===t&&this._isBound()?this._boundValue():t},O.prototype._promiseAt=function(e){return this[4*e-4+2]},O.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},O.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},O.prototype._boundValue=function(){},O.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,a=e._rejectionHandler0,n=e._promise0,i=e._receiverAt(0);void 0===i&&(i=s),this._addCallbacks(t,a,n,i,null)},O.prototype._migrateCallbackAt=function(e,t){var a=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),i=e._promiseAt(t),r=e._receiverAt(t);void 0===r&&(r=s),this._addCallbacks(a,n,i,r,null)},O.prototype._addCallbacks=function(e,t,a,n,i){var r=this._length();if(r>=65531&&(r=0,this._setLength(0)),0===r)this._promise0=a,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=_.contextBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=_.contextBind(i,t));else{var o=4*r-4;this[o+2]=a,this[o+3]=n,"function"==typeof e&&(this[o+0]=_.contextBind(i,e)),"function"==typeof t&&(this[o+1]=_.contextBind(i,t))}return this._setLength(r+1),r},O.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},O.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(n(),!1);var a=w(e,this);if(!(a instanceof O))return this._fulfill(e);t&&this._propagateFrom(a,2);var i=a._target();if(i!==this){var r=i._bitField;if(0==(50397184&r)){var o=this._length();o>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(e===this){var a=n();return this._attachExtraTrace(a),this._reject(a)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():v.settlePromises(this),this._dereferenceTrace())}},O.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return v.fatalError(e,_.isNode);(65535&t)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled()}},O.prototype._fulfillPromises=function(e,t){for(var a=1;a0){if(0!=(16842752&e)){var a=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,a,e),this._rejectPromises(t,a)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},O.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&f.defineProperty(O.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),O.defer=O.pending=function(){return D.deprecated("Promise.defer","new Promise"),{promise:new O(b),resolve:H,reject:j}},_.notEnumerableProp(O,"_makeSelfResolutionError",n),e("./method")(O,b,w,r,D),e("./bind")(O,b,w,D),e("./cancel")(O,E,r,D),e("./direct_resolve")(O),e("./synchronous_inspection")(O),e("./join")(O,E,w,b,v),O.Promise=O,O.version="3.7.2",_.toFastProperties(O),_.toFastProperties(O.prototype),L({a:1}),L({b:2}),L({c:3}),L(1),L(function(){}),L(void 0),L(!1),L(new O(b)),D.setBounds(p.firstLineError,_.lastLineError),O}},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21,async_hooks:void 0}],16:[function(e,t,a){"use strict";t.exports=function(t,a,n,i,r){var o=e("./util");o.isArray;function s(e){var n=this._promise=new t(a);e instanceof t&&(n._propagateFrom(e,3),e.suppressUnhandledRejections()),n._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(s,r),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(a,r){var s=n(this._values,this._promise);if(s instanceof t){var _=(s=s._target())._bitField;if(this._values=s,0==(50397184&_))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,r);if(0==(33554432&_))return 0!=(16777216&_)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=o.asArray(s)))0!==s.length?this._iterate(s):-5===r?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(r));else{var d=i("expecting an array or an iterable object but got "+o.classString(s)).reason();this._promise._rejectCallback(d,!1)}},s.prototype._iterate=function(e){var a=this.getActualLength(e.length);this._length=a,this._values=this.shouldCopyValues()?new Array(a):this._values;for(var i=this._promise,r=!1,o=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var a=0;a1,n=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=k.test(e+"")&&r.names(e).length>0;if(a||n||i)return!0}return!1}catch(e){return!1}}function E(e){function t(){}t.prototype=e;var a=new t;function n(){return _(a.foo)}return n(),n(),e}var S=/^[a-z$_][a-z$_0-9]*$/i;function D(e){return S.test(e)}function N(e,t,a){for(var n=new Array(e),i=0;i10||e[0]>0}(),U.nodeSupportsAsyncResource=U.isNode&&function(){var t=!1;try{t="function"==typeof e("async_hooks").AsyncResource.prototype.runInAsyncScope}catch(e){t=!1}return t}(),U.isNode&&U.toFastProperties(a);try{throw new Error}catch(e){U.lastLineError=e}t.exports=U},{"./es5":10,async_hooks:void 0}]},{},[3])(3)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,a(5),a(1),a(7).setImmediate)},function(e,t,a){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new r(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},a(8),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,a(1))},function(e,t,a){(function(e,t){!function(e,a){"use strict";if(!e.setImmediate){var n,i=1,r={},o=!1,s=e.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(e);_=_&&_.setTimeout?_:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick(function(){l(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,a=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=a,t}}()?function(){var t="setImmediate$"+Math.random()+"$",a=function(a){a.source===e&&"string"==typeof a.data&&0===a.data.indexOf(t)&&l(+a.data.slice(t.length))};e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(a){e.postMessage(t+a,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){l(e.data)},n=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;n=function(t){var a=s.createElement("script");a.onreadystatechange=function(){l(t),a.onreadystatechange=null,e.removeChild(a),a=null},e.appendChild(a)}}():n=function(e){setTimeout(l,0,e)},_.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),a=0;a=0){if(!a)return n;var o=0===r||!(i.charAt(r-1)||"").trim(),s=r+t.length>=i.length||!i.charAt(r+t.length).trim();if(o&&s)return n}}n=n.parentNode}return null}function x(e){var t=!1,a=!1;if(window.getComputedStyle){var n=window.getComputedStyle(e,null);t=n.display,a=n.visibility}else e.currentStyle&&(t=e.currentStyle.display,a=e.currentStyle.visibility);var i=!1,r=b({target:e},"dhx_form_repeat",!1);return r&&(i=!("0px"!=r.style.height)),i=i||!e.offsetHeight,"none"!=t&&"hidden"!=a&&!i}function k(e){return!isNaN(e.getAttribute("tabindex"))&&1*e.getAttribute("tabindex")>=0}function w(e){return!{a:!0,area:!0}[e.nodeName.loLowerCase()]||!!e.getAttribute("href")}function E(e){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[e.nodeName.toLowerCase()]||!e.hasAttribute("disabled")}function S(){return document.head.createShadowRoot||document.head.attachShadow}function D(e){if(!e)return document.body;if(!S())return document.body;for(;e.parentNode&&(e=e.parentNode);)if(e instanceof ShadowRoot)return e.host;return document.body}var N,C={getAbsoluteLeft:function(e){return this.getOffset(e).left},getAbsoluteTop:function(e){return this.getOffset(e).top},getOffsetSum:function(e){for(var t=0,a=0;e;)t+=parseInt(e.offsetTop),a+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:t,left:a}},getOffsetRect:function(e){var t=e.getBoundingClientRect(),a=0,n=0;if(/Mobi/.test(navigator.userAgent)){var i=document.createElement("div");i.style.position="absolute",i.style.left="0px",i.style.top="0px",i.style.width="1px",i.style.height="1px",document.body.appendChild(i);var r=i.getBoundingClientRect();a=t.top-r.top,n=t.left-r.left,i.parentNode.removeChild(i)}else{var o=document.body,s=document.documentElement,_=window.pageYOffset||s.scrollTop||o.scrollTop,d=window.pageXOffset||s.scrollLeft||o.scrollLeft,l=s.clientTop||o.clientTop||0,c=s.clientLeft||o.clientLeft||0;a=t.top+_-l,n=t.left+d-c}return{top:Math.round(a),left:Math.round(n)}},getOffset:function(e){return e.getBoundingClientRect?this.getOffsetRect(e):this.getOffsetSum(e)},closest:function(e,t){return e&&t?N(e,t):null},insertAfter:function(e,t){t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)},remove:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},getFocusableNodes:function(e){for(var t=e.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),a=Array.prototype.slice.call(t,0),n=0;n=0||navigator.userAgent.indexOf("Trident")>=0),isIE6:A&&!XMLHttpRequest&&navigator.userAgent.indexOf("MSIE")>=0,isIE7:A&&navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0,isIE8:A&&navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0,isOpera:A&&navigator.userAgent.indexOf("Opera")>=0,isChrome:A&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:A&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:A&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:A&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:A&&-1!=navigator.userAgent.indexOf("Edge"),isNode:!A||"undefined"==typeof navigator},O=a(6).Promise;var H=a(3),j=a.n(H);function L(e){"@babel/helpers - typeof";return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e){var t=function(e,t){for(var a="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",n=e.match(/%[a-zA-Z]/g),i=0;i50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":a+="set[3]=temp["+i+"]||0;";break;case"%i":a+="set[4]=temp["+i+"]||0;";break;case"%Y":a+="set[0]=temp["+i+"]||0;";break;case"%a":case"%A":a+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":a+="set[5]=temp["+i+"]||0;";break;case"%M":a+="set[1]=this.locale.date.month_short_hash[temp["+i+"]]||0;";break;case"%F":a+="set[1]=this.locale.date.month_full_hash[temp["+i+"]]||0;"}var r="set[0],set[1],set[2],set[3],set[4],set[5]";return t&&(r=" Date.UTC("+r+")"),new Function("date","var set=[0,0,1,0,0,0]; "+a+" return new Date("+r+");")},a=function(t,a){return function(n){for(var i=[0,0,1,0,0,0],r=n.match(/[a-zA-Z]+|[0-9]+/g),o=t.match(/%[a-zA-Z]/g),s=0;s50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":i[3]=r[s]||0;break;case"%i":i[4]=r[s]||0;break;case"%Y":i[0]=r[s]||0;break;case"%a":case"%A":i[3]=i[3]%12+("am"==(r[s]||"").toLowerCase()?0:12);break;case"%s":i[5]=r[s]||0;break;case"%M":i[1]=e.locale.date.month_short_hash[r[s]]||0;break;case"%F":i[1]=e.locale.date.month_full_hash[r[s]]||0}return a?new Date(Date.UTC(i[0],i[1],i[2],i[3],i[4],i[5])):new Date(i[0],i[1],i[2],i[3],i[4],i[5])}},n=!1;function i(){return"auto"===e.config.csp?n:e.config.csp}!function(){try{new Function("canUseCsp = false;")}catch(e){n=!0}}(),e.date={init:function(){for(var t=e.locale.date.month_short,a=e.locale.date.month_short_hash={},n=0;n0){var n=(+a-+e)%864e5;if(n&&e.getTimezoneOffset()==a.getTimezoneOffset()){var i=n/36e5;a.setTime(a.getTime()+60*(24-i)*60*1e3)}}return t>=0&&!e.getHours()&&a.getHours()&&(a.getDate()11?"pm":"am":n.getHours()>11?"pm":"am";case"%A":return a?n.getUTCHours()>11?"PM":"AM":n.getHours()>11?"PM":"AM";case"%s":return a?e.date.to_fixed(n.getUTCSeconds()):e.date.to_fixed(n.getSeconds());case"%W":return a?e.date.to_fixed(e.date.getUTCISOWeek(n)):e.date.to_fixed(e.date.getISOWeek(n));default:return t}})}}(t,a);t=t.replace(/%[a-zA-Z]/g,function(e){switch(e){case"%d":return'"+this.date.to_fixed(date.getDate())+"';case"%m":return'"+this.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+this.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+this.locale.date.day_short[date.getDay()]+"';case"%l":return'"+this.locale.date.day_full[date.getDay()]+"';case"%M":return'"+this.locale.date.month_short[date.getMonth()]+"';case"%F":return'"+this.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+this.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+this.date.to_fixed(date.getHours())+"';case"%i":return'"+this.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+this.date.to_fixed(date.getSeconds())+"';case"%W":return'"+this.date.to_fixed(this.date.getISOWeek(date))+"';default:return e}}),a&&(t=t.replace(/date\.get/g,"date.getUTC"));var n=new Function("date",'return "'+t+'";');return e.date._bind_host_object(n)},str_to_date:function(n,r,o){var s=i()?a:t,_=s(n,r),d=/^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,l=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/,c=/^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,u=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,h=s("%Y-%m-%d %H:%i:%s",r),f=s("%m/%d/%Y %H:%i:%s",r),p=s("%d-%m-%Y %H:%i:%s",r);return function(t){if(!o&&!e.config.parse_exact_format){if(t&&t.getISOWeek)return new Date(t);if("number"==typeof t)return new Date(t);if(function(e){return d.test(String(e))}(t))return h(t);if(function(e){return l.test(String(e))}(t))return f(t);if(function(e){return c.test(String(e))}(t))return p(t);if(function(e){return u.test(e)}(t))return new Date(t)}return _.call(e,t)}},getISOWeek:function(e){if(!e)return!1;var t=(e=this.date_part(new Date(e))).getDay();0===t&&(t=7);var a=new Date(e.valueOf());a.setDate(e.getDate()+(4-t));var n=a.getFullYear(),i=Math.round((a.getTime()-new Date(n,0,1).getTime())/864e5);return 1+Math.floor(i/7)},getUTCISOWeek:function(e){return this.getISOWeek(this.convert_to_utc(e))},convert_to_utc:function(e){return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}}}function P(e){"@babel/helpers - typeof";return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function z(e){"@babel/helpers - typeof";return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var F=a(2),I=a.n(F);function R(e){"@babel/helpers - typeof";return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(e){e._loaded={},e._load=function(t,a){if(t=t||this._load_url){var n;if(t+=(-1==t.indexOf("?")?"?":"&")+"timeshift="+(new Date).getTimezoneOffset(),this.config.prevent_cache&&(t+="&uid="+this.uid()),a=a||this._date,this._load_mode){var i=this.templates.load_format;for(a=this.date[this._load_mode+"_start"](new Date(a.valueOf()));a>this._min_date;)a=this.date.add(a,-1,this._load_mode);n=a;for(var r=!0;na&&this._loaded[i(o)]);if(n<=a)return!1;for(e.ajax.get(t+"&from="+i(a)+"&to="+i(n),s);a=400)&&(this.callEvent("onLoadError",[e.xmlDoc]),t=[]),this._process_loading(t),this.callEvent("onXLE",[]),this.callEvent("onParse",[])},e._process_loading=function(e){this._loading=!0,this._not_render=!0;for(var t=0;t1)&&(this.xy.scroll_width=0,this._mobile=!0),this.config.touch){var e=!0;try{document.createEvent("TouchEvent")}catch(t){e=!1}e?this._touch_events(["touchmove","touchstart","touchend"],function(e){return e.touches&&e.touches.length>1?null:e.touches[0]?{target:e.target,pageX:e.touches[0].pageX,pageY:e.touches[0].pageY,clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}:e},function(){return!1}):window.PointerEvent||window.navigator.pointerEnabled?this._touch_events(["pointermove","pointerdown","pointerup"],function(e){return"mouse"==e.pointerType?null:e},function(e){return!e||"mouse"==e.pointerType}):window.navigator.msPointerEnabled&&this._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(e){return e.pointerType==e.MSPOINTER_TYPE_MOUSE?null:e},function(e){return!e||e.pointerType==e.MSPOINTER_TYPE_MOUSE})}},e._touch_events=function(t,a,n){var i,r,o,s,_,d,l=0;function c(t,a,i){t.addEventListener(a,function(t){return!!e._is_lightbox_open()||(n(t)?void 0:i(t))},{passive:!1})}function u(t){n(t)||(e._hide_global_tip(),s&&(e._on_mouse_up(a(t)),e._temp_touch_block=!1),e._drag_id=null,e._drag_mode=null,e._drag_pos=null,e._pointerDragId=null,clearTimeout(o),s=d=!1,_=!0)}c(document.body,t[0],function(t){if(!n(t)){var l=a(t);if(l){if(s)return function(t){if(!n(t)){var a=e.getState().drag_mode,i=!!e.matrix&&e.matrix[e._mode],r=e.render_view_data;"create"==a&&i&&(e.render_view_data=function(){for(var t=e.getState().drag_id,a=e.getEvent(t),n=i.y_property,r=e.getEvents(a.start_date,a.end_date),o=0;o5||Math.abs(i.pageY-r.pageY)>5)&&(_=!0,clearTimeout(o)):_=!0)}}}),c(this._els.dhx_cal_data[0],"touchcancel",u),c(this._els.dhx_cal_data[0],"contextmenu",function(e){if(!n(e))return d?(e&&e.preventDefault&&e.preventDefault(),e.cancelBubble=!0,!1):void 0}),c(this._obj,t[1],function(t){var c;if(document&&document.body&&document.body.classList.add("dhx_cal_touch_active"),!n(t))if(e._pointerDragId=t.pointerId,s=_=!1,d=!0,c=r=a(t)){var u=new Date;if(!_&&!s&&u-l<250)return e._click.dhx_cal_data(c),window.setTimeout(function(){e.$destroyed||(c.type="dblclick",e._on_dbl_click(c))},50),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,e._block_next_stop=!0,!1;if(l=u,!_&&!s&&e.config.touch_drag){var h=e._locate_event(document.activeElement),f=e._locate_event(c.target),p=i?e._locate_event(i.target):null;if(h&&f&&h==f&&h!=p)return t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,e._ignore_next_click=!1,e._click.dhx_cal_data(c),i=c,!1;o=setTimeout(function(){if(!e.$destroyed){s=!0;var t=i.target,a=e._getClassName(t);t&&-1!=a.indexOf("dhx_body")&&(t=t.previousSibling),e._on_mouse_down(i,t),e._drag_mode&&"create"!=e._drag_mode&&e.for_rendered(e._drag_id,function(t,a){t.style.display="none",e._rendered.splice(a,1)}),e.config.touch_tip&&e._show_global_tip(),e.updateEvent(e._drag_id)}},e.config.touch_drag),i=c}}else _=!0}),c(this._els.dhx_cal_data[0],t[2],function(t){if(document&&document.body&&document.body.classList.remove("dhx_cal_touch_active"),!n(t))return e.config.touch_swipe_dates&&!s&&function(t,a,n,i){if(!t||!a)return!1;for(var r=t.target;r&&r!=e._obj;)r=r.parentNode;if(r!=e._obj)return!1;if(e.matrix&&e.matrix[e.getState().mode]&&e.matrix[e.getState().mode].scrollable)return!1;var o=Math.abs(t.pageY-a.pageY),s=Math.abs(t.pageX-a.pageX);return on&&(!o||s/o>3)&&(t.pageX>a.pageX?e._click.dhx_cal_next_button():e._click.dhx_cal_prev_button(),!0)}(i,r,200,100)&&(e._block_next_stop=!0),s&&(e._ignore_next_click=!0,setTimeout(function(){e._ignore_next_click=!1},100)),u(t),e._block_next_stop?(e._block_next_stop=!1,t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1):void 0}),e.event(document.body,t[2],u)},e._show_global_tip=function(){e._hide_global_tip();var t=e._global_tip=document.createElement("div");t.className="dhx_global_tip",e._update_global_tip(1),document.body.appendChild(t)},e._update_global_tip=function(t){var a=e._global_tip;if(a){var n="";if(e._drag_id&&!t){var i=e.getEvent(e._drag_id);i&&(n="
"+(i._timed?e.templates.event_header(i.start_date,i.end_date,i):e.templates.day_date(i.start_date,i.end_date,i))+"
")}"create"==e._drag_mode||"new-size"==e._drag_mode?a.innerHTML=(e.locale.labels.drag_to_create||"Drag to create")+n:a.innerHTML=(e.locale.labels.drag_to_move||"Drag to move")+n}},e._hide_global_tip=function(){var t=e._global_tip;t&&t.parentNode&&(t.parentNode.removeChild(t),e._global_tip=0)}}function U(e){var t,a;function n(){if(e._is_material_skin())return!0;if(void 0!==a)return a;var t=document.createElement("div");t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.innerHTML="
",document.body.appendChild(t);var n=window.getComputedStyle(t.querySelector(".dhx_body")).getPropertyValue("box-sizing");document.body.removeChild(t),(a=!("border-box"!==n))||setTimeout(function(){a=void 0},1e3)}function i(){if(!e._is_material_skin()&&!e._border_box_events()){var i=a;a=void 0,t=void 0,i!==n()&&e.$container&&e.getState().mode&&e.setCurrentView()}}e._skin_settings={fix_tab_position:[1,0],use_select_menu_space:[1,0],wide_form:[1,0],hour_size_px:[44,42],displayed_event_color:["#ff4a4a","ffc5ab"],displayed_event_text_color:["#ffef80","7e2727"]},e._skin_xy={lightbox_additional_height:[90,50],nav_height:[59,22],bar_height:[24,20]},e._is_material_skin=function(){return e.skin?(e.skin+"").indexOf("material")>-1:function(){if(void 0===t){var e=document.createElement("div");e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.innerHTML="
",document.body.appendChild(e);var a=window.getComputedStyle(e.querySelector(".dhx_cal_scale_placeholder")),n=a.getPropertyValue("position");t="absolute"===n,setTimeout(function(){t=null,e&&e.parentNode&&e.parentNode.removeChild(e)},500)}return t}()},window.addEventListener("DOMContentLoaded",i),window.addEventListener("load",i),e._border_box_events=function(){return n()},e._configure=function(e,t,a){for(var n in t)void 0===e[n]&&(e[n]=t[n][a])},e._skin_init=function(){if(!e.skin)for(var t=document.getElementsByTagName("link"),a=0;a"+e.getHours()+" "+t+""}),!i){var _=e.config.minicalendar;_&&(_.padding=14),e.templates.event_bar_date=function(t,a,n){return"• "+e.templates.event_date(t)+" "},e.attachEvent("onTemplatesReady",function(){var t=e.date.date_to_str("%d");e.templates._old_month_day||(e.templates._old_month_day=e.templates.month_day);var a=e.templates._old_month_day;if(e.templates.month_day=function(n){if("month"==this._mode){var i=t(n);return 1==n.getDate()&&(i=e.locale.date.month_full[n.getMonth()]+" "+i),+n==+e.date.date_part(this._currentDate())&&(i=e.locale.labels.dhx_cal_today_button+" "+i),i}return a.call(this,n)},e.config.fix_tab_position){var n=e._els.dhx_cal_navline[0].getElementsByTagName("div"),i=null,r=211,o=[14,75,136],s=14;e._is_material_skin()&&(o=[16,103,192],r=294,s=-1);for(var _=0;_-1&&r.click?r.click():(n(a,!0),i=!0)}27==t&&(n(a,!1),i=!0)}return i?(e.preventDefault&&e.preventDefault(),!(e.cancelBubble=!0)):void 0}}function r(t){r.cover||(r.cover=document.createElement("div"),e.event(r.cover,"keydown",i),r.cover.className="dhx_modal_cover",document.body.appendChild(r.cover)),r.cover.style.display=t?"inline-block":"none"}function o(t,a,n){var i=e._waiAria.messageButtonAttrString(t),r=(a||"").toLowerCase().replace(/ /g,"_"),o="scheduler_".concat(r,"_button dhtmlx_").concat(r,"_button");return"
").concat(t,"
")}function s(t){v.area||(v.area=document.createElement("div"),v.area.className="scheduler_message_area dhtmlx_message_area",v.area.style[v.position]="5px",document.body.appendChild(v.area)),v.hide(t.id);var a=document.createElement("div");return a.innerHTML="
"+t.text+"
",a.className="scheduler-info dhtmlx-info scheduler-"+t.type+" dhtmlx-"+t.type,e.event(a,"click",function(){v.hide(t.id),t=null}),e._waiAria.messageInfoAttr(a),"bottom"==v.position&&v.area.firstChild?v.area.insertBefore(a,v.area.firstChild):v.area.appendChild(a),t.expire>0&&(v.timers[t.id]=window.setTimeout(function(){v&&v.hide(t.id)},t.expire)),v.pull[t.id]=a,a=null,t.id}function _(){for(var e=[].slice.apply(arguments,[0]),t=0;t'+i.title+"
"),c+='
'+(i.content?"":i.text)+'
',r&&(c+=o(_(i.ok,e.locale.labels.message_ok,"OK"),"ok",!0)),s&&(c+=o(_(i.cancel,e.locale.labels.message_cancel,"Cancel"),"cancel",!1)),i.buttons)for(var u=0;u",d.innerHTML=c,i.content){var f=i.content;"string"==typeof f&&(f=document.getElementById(f)),"none"==f.style.display&&(f.style.display=""),d.childNodes[i.title?1:0].appendChild(f)}return e.event(d,"click",function(e){var t=e.target||e.srcElement;if(t.className||(t=t.parentNode),C.closest(t,".scheduler_popup_button")){var a=t.getAttribute("data-result");n(i,a="true"==a||"false"!=a&&a)}}),i.box=d,(r||s)&&(a=i),d}(s,d,l);s.hidden||r(!0),document.body.appendChild(c);var u=Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-c.offsetWidth)/2)),h=Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-c.offsetHeight)/2));return"top"==s.position?c.style.top="-3px":c.style.top=h+"px",c.style.left=u+"px",e.event(c,"keydown",i),p.focus(c),s.hidden&&p.hide(c),e.callEvent("onMessagePopup",[c]),c}function l(e){return d(e,!0,!1)}function c(e){return d(e,!0,!0)}function u(e){return d(e)}function h(e,t,a){return"object"!=Y(e)&&("function"==typeof t&&(a=t,t=""),e={text:e,type:t,callback:a}),e}function f(e,t,a,n){return"object"!=Y(e)&&(e={text:e,type:t,expire:a,id:n}),e.id=e.id||m.uid(),e.expire=e.expire||v.expire,e}e.event(document,"keydown",i,!0);var p=function(){var e=h.apply(this,arguments);return e.type=e.type||"alert",u(e)};p.hide=function(a){for(;a&&a.getAttribute&&!a.getAttribute(t);)a=a.parentNode;a&&(a.parentNode.removeChild(a),r(!1),e.callEvent("onAfterMessagePopup",[a]))},p.focus=function(e){setTimeout(function(){var t=C.getFocusableNodes(e);t.length&&t[0].focus&&t[0].focus()},1)};var v=function(e,t,a,n){switch((e=f.apply(this,arguments)).type=e.type||"info",e.type.split("-")[0]){case"alert":return l(e);case"confirm":return c(e);case"modalbox":return u(e);default:return s(e)}};v.seed=(new Date).valueOf(),v.uid=m.uid,v.expire=4e3,v.keyboard=!0,v.position="top",v.pull={},v.timers={},v.hideAll=function(){for(var e in v.pull)v.hide(e)},v.hide=function(e){var t=v.pull[e];t&&t.parentNode&&(window.setTimeout(function(){t.parentNode.removeChild(t),t=null},2e3),t.className+=" hidden",v.timers[e]&&window.clearTimeout(v.timers[e]),delete v.pull[e])};var g=[];return e.attachEvent("onMessagePopup",function(e){g.push(e)}),e.attachEvent("onAfterMessagePopup",function(e){for(var t=0;t \n"}},e.createTimelineView=function(){throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: "+a.timeline+"\nRelated docs: "+t.timeline)},e.createUnitsView=function(){throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: "+a.unit+"\nRelated docs: "+t.unit)},e.createGridView=function(){throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: "+a.grid+"\nRelated docs: "+t.grid)},e.addMarkedTimespan=function(){throw new Error("scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\nRelated docs: https://docs.dhtmlx.com/scheduler/limits.html")},e.renderCalendar=function(){throw new Error("scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\nhttps://docs.dhtmlx.com/scheduler/minicalendar.html")},e.exportToPNG=function(){throw new Error(["scheduler.exportToPNG is not implemented.","This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html","Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n"))},e.exportToPDF=function(){throw new Error(["scheduler.exportToPDF is not implemented.","This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html","Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n"))}}(t),function(e){var t=u();e.event=t.attach,e.eventRemove=t.detach,e._eventRemoveAll=t.detachAll,e._createDomEventScope=t.extend,e._trim=function(e){return(String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")}).apply(e)},e._isDate=function(e){return!(!e||"object"!=h(e)||!(e.getFullYear&&e.getMonth&&e.getDate))},e._isObject=function(e){return e&&"object"==h(e)}}(t),function(e){d(e),i(e),e._detachDomEvent=function(e,t,a){e.removeEventListener?e.removeEventListener(t,a,!1):e.detachEvent&&e.detachEvent("on"+t,a)},e._init_once=function(){r(e),e._init_once=function(){}};var t={render:function(t){return e._init_nav_bar(t)}},a={render:function(e){var t=document.createElement("div");return t.className="dhx_cal_header",t}},n={render:function(e){var t=document.createElement("div");return t.className="dhx_cal_data",t}};function o(e){return!!(e.querySelector(".dhx_cal_header")&&e.querySelector(".dhx_cal_data")&&e.querySelector(".dhx_cal_navline"))}e.init=function(i,r,s){if(!this.$destroyed){if(r=r||e._currentDate(),s=s||"week",this._obj&&this.unset_actions(),this._obj="string"==typeof i?document.getElementById(i):i,this.$container=this._obj,this.$root=this._obj,!this.$container.offsetHeight&&this.$container.offsetWidth&&"100%"===this.$container.style.height&&window.console.error(e._commonErrorMessages.collapsedContainer(),this.$container),this.config.wai_aria_attributes&&this.config.wai_aria_application_role&&this.$container.setAttribute("role","application"),this.config.header||o(this.$container)||(this.config.header=function(e){var t=["day","week","month"];if(e.matrix)for(var a in e.matrix)t.push(a);if(e._props)for(var a in e._props)t.push(a);if(e._grid&&e._grid.names)for(var a in e._grid.names)t.push(a);return["map","agenda","week_agenda","year"].forEach(function(a){e[a+"_view"]&&t.push(a)}),t.concat(["date"]).concat(["prev","today","next"])}(this),window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.","Using a default header configuration: ","scheduler.config.header = "+JSON.stringify(this.config.header,null,2),"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join("\n"))),this.config.header)this.$container.innerHTML="",this.$container.classList.add("dhx_cal_container"),this.config.header.height&&(this.xy.nav_height=this.config.header.height),this.$container.appendChild(t.render(this.config.header)),this.$container.appendChild(a.render()),this.$container.appendChild(n.render());else if(!o(this.$container))throw new Error(["Required DOM elements are missing from the scheduler container.","Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup","Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join("\n"));this.config.rtl&&(this.$container.className+=" dhx_cal_container_rtl"),this._skin_init&&e._skin_init(),e.date.init(),this._scroll=!0,this._quirks=this.$env.isIE&&"BackCompat"==document.compatMode,this._quirks7=this.$env.isIE&&-1==navigator.appVersion.indexOf("MSIE 8"),this._els=[],this.get_elements(),this.init_templates(),this.set_actions(),this._init_once(),this._init_touch_events(),this.set_sizes(),e.callEvent("onSchedulerReady",[]),e.$initialized=!0,this.setCurrentView(r,s)}},e.xy={min_event_height:40,scale_width:50,scroll_width:18,scale_height:20,month_scale_height:20,menu_width:25,margin_top:0,margin_left:0,editor_width:140,month_head_height:22,event_header_height:14},e.keys={edit_save:13,edit_cancel:27},e.bind=function(e,t){return e.bind?e.bind(t):function(){return e.apply(t,arguments)}},e.set_sizes=function(){var t=this._x=this._obj.clientWidth-this.xy.margin_left,a=this._y=this._obj.clientHeight-this.xy.margin_top,n=this._table_view?0:this.xy.scale_width+this.xy.scroll_width,i=this._table_view?-1:this.xy.scale_width,r=this.$container.querySelector(".dhx_cal_scale_placeholder");e._is_material_skin()?(r||((r=document.createElement("div")).className="dhx_cal_scale_placeholder",this.$container.insertBefore(r,this._els.dhx_cal_header[0])),r.style.display="block",this.set_xy(r,t,this.xy.scale_height+1,0,this.xy.nav_height+(this._quirks?-1:1))):r&&r.parentNode.removeChild(r),this._lightbox&&(e.$container.offsetWidth<1200||this._setLbPosition(document.querySelector(".dhx_cal_light"))),this.set_xy(this._els.dhx_cal_navline[0],t,this.xy.nav_height,0,0),this.set_xy(this._els.dhx_cal_header[0],t-n,this.xy.scale_height,i,this.xy.nav_height+(this._quirks?-1:1));var o=this._els.dhx_cal_navline[0].offsetHeight;o>0&&(this.xy.nav_height=o);var s=this.xy.scale_height+this.xy.nav_height+(this._quirks?-2:0);this.set_xy(this._els.dhx_cal_data[0],t,a-(s+2),0,s+2)},e.set_xy=function(e,t,a,n,i){var r="left";e.style.width=Math.max(0,t)+"px",e.style.height=Math.max(0,a)+"px",arguments.length>3&&(this.config.rtl&&(r="right"),e.style[r]=n+"px",e.style.top=i+"px")},e.get_elements=function(){for(var t=this._obj.getElementsByTagName("DIV"),a=0;a500&&e.unselect()},dhx_cal_prev_button:function(){e._click.dhx_cal_next_button(0,-1)},dhx_cal_next_button:function(t,a){var n=1;e.config.rtl&&(a=-a,n=-n),e.setCurrentView(e.date.add(e.date[e._mode+"_start"](new Date(e._date)),a||n,e._mode))},dhx_cal_today_button:function(){e.callEvent("onBeforeTodayDisplayed",[])&&e.setCurrentView(e._currentDate())},dhx_cal_tab:function(){var t=this.getAttribute("data-tab"),a=this.getAttribute("name"),n=t||a.substring(0,a.search("_tab"));e.setCurrentView(e._date,n)},buttons:{delete:function(t){var a=e.locale.labels.confirm_deleting;e._dhtmlx_confirm(a,e.locale.labels.title_confirm_deleting,function(){e.deleteEvent(t)})},edit:function(t){e.edit(t)},save:function(t){e.editStop(!0)},details:function(t){e.showLightbox(t)},cancel:function(t){e.editStop(!1)}}},e._dhtmlx_confirm=function(t,a,n){if(!t)return n();var i={text:t};a&&(i.title=a),n&&(i.callback=function(e){e&&n()}),e.confirm(i)},e.addEventNow=function(t,a,n){var i={};e._isObject(t)&&!e._isDate(t)&&(i=t,t=null);var r=6e4*(this.config.event_duration||this.config.time_step);t||(t=i.start_date||Math.round(e._currentDate().valueOf()/r)*r);var o=new Date(t);if(!a){var s=this.config.first_hour;s>o.getHours()&&(o.setHours(s),t=o.valueOf()),a=t.valueOf()+r}var _=new Date(a);o.valueOf()==_.valueOf()&&_.setTime(_.valueOf()+r),i.start_date=i.start_date||o,i.end_date=i.end_date||_,i.text=i.text||this.locale.labels.new_event,i.id=this._drag_id=i.id||this.uid(),this._drag_mode="new-size",this._loading=!0;var d=this.addEvent(i);return this.callEvent("onEventCreated",[this._drag_id,n]),this._loading=!1,this._drag_event={},this._on_mouse_up(n),d},e._on_dbl_click=function(t,a){if(a=a||t.target||t.srcElement,!this.config.readonly){var n=e._getClassName(a).split(" ")[0];switch(n){case"dhx_scale_holder":case"dhx_scale_holder_now":case"dhx_month_body":case"dhx_wa_day_data":if(!e.config.dblclick_create)break;this.addEventNow(this.getActionData(t).date,null,t);break;case"dhx_cal_event":case"dhx_wa_ev_body":case"dhx_agenda_line":case"dhx_grid_event":case"dhx_cal_event_line":case"dhx_cal_event_clear":var i=this._locate_event(a);if(!this.callEvent("onDblClick",[i,t]))return;this.config.details_on_dblclick||this._table_view||!this.getEvent(i)._timed||!this.config.select?this.showLightbox(i):this.edit(i);break;case"dhx_time_block":case"dhx_cal_container":return;default:var r=this["dblclick_"+n];if(r)r.call(this,t);else if(a.parentNode&&a!=this)return e._on_dbl_click(t,a.parentNode)}}},e._get_column_index=function(e){var t=0;if(this._cols){for(var a=0,n=0;a+this._cols[n]=this._cols.length)for(;t>=1&&this._ignores[Math.floor(t)];)t--}return t},e._week_indexes_from_pos=function(e){if(this._cols){var t=this._get_column_index(e.x);return e.x=Math.min(this._cols.length-1,Math.max(0,Math.ceil(t)-1)),e.y=Math.max(0,Math.ceil(60*e.y/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step),e}return e},e._mouse_coords=function(t){var a,n=document.body,i=document.documentElement;a=this.$env.isIE||!t.pageX&&!t.pageY?{x:t.clientX+(n.scrollLeft||i.scrollLeft||0)-n.clientLeft,y:t.clientY+(n.scrollTop||i.scrollTop||0)-n.clientTop}:{x:t.pageX,y:t.pageY},this.config.rtl&&this._colsS?(a.x=this.$container.querySelector(".dhx_cal_data").offsetWidth-a.x,"month"!==this._mode&&(a.x-=this.xy.scale_width)):a.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);var r=this.$container.querySelector(".dhx_cal_data");a.y-=this.$domHelpers.getAbsoluteTop(r)-this._els.dhx_cal_data[0].scrollTop,a.ev=t;var o=this["mouse_"+this._mode];if(o)a=o.call(this,a);else if(this._table_view){var s=this._get_column_index(a.x);if(!this._cols||!this._colsS)return a;var _=0;for(_=1;_a.y);_++);a.y=Math.ceil(24*(Math.max(0,s)+7*Math.max(0,_-1))*60/this.config.time_step),(e._drag_mode||"month"==this._mode)&&(a.y=24*(Math.max(0,Math.ceil(s)-1)+7*Math.max(0,_-1))*60/this.config.time_step),"move"==this._drag_mode&&e._ignores_detected&&e.config.preserve_length&&(a._ignores=!0,this._drag_event._event_length||(this._drag_event._event_length=this._get_real_event_length(this._drag_event.start_date,this._drag_event.end_date,{x_step:1,x_unit:"day"}))),a.x=0}else a=this._week_indexes_from_pos(a);return a.timestamp=+new Date,a},e._close_not_saved=function(){if((new Date).valueOf()-(e._new_event||0)>500&&e._edit_id){var t=e.locale.labels.confirm_closing;e._dhtmlx_confirm(t,e.locale.labels.title_confirm_closing,function(){e.editStop(e.config.positive_closing)}),t&&(this._drag_id=this._drag_pos=this._drag_mode=null)}},e._correct_shift=function(t,a){return t-6e4*(new Date(e._min_date).getTimezoneOffset()-new Date(t).getTimezoneOffset())*(a?-1:1)},e._is_pos_changed=function(e,t){function a(e,t,a){return!!(Math.abs(e-t)>a)}return!e||!this._drag_pos||!!(this._drag_pos.has_moved||!this._drag_pos.timestamp||t.timestamp-this._drag_pos.timestamp>100||a(e.ev.clientX,t.ev.clientX,5)||a(e.ev.clientY,t.ev.clientY,5))},e._correct_drag_start_date=function(t){var a;e.matrix&&(a=e.matrix[e._mode]),a=a||{x_step:1,x_unit:"day"},t=new Date(t);var n=1;return(a._start_correction||a._end_correction)&&(n=60*(a.last_hour||0)-(60*t.getHours()+t.getMinutes())||1),1*t+(e._get_fictional_event_length(t,n,a)-n)},e._correct_drag_end_date=function(t,a){var n;e.matrix&&(n=e.matrix[e._mode]),n=n||{x_step:1,x_unit:"day"};var i=1*t+e._get_fictional_event_length(t,a,n);return new Date(1*i-(e._get_fictional_event_length(i,-1,n,-1)+1))},e._on_mouse_move=function(t){if(this._drag_mode){var a=this._mouse_coords(t);if(this._is_pos_changed(this._drag_pos,a)){var n,i;if(this._edit_id!=this._drag_id&&this._close_not_saved(),!this._drag_mode)return;var r=null;if(this._drag_pos&&!this._drag_pos.has_moved&&((r=this._drag_pos).has_moved=!0),this._drag_pos=a,this._drag_pos.has_moved=!0,"create"==this._drag_mode){if(r&&(a=r),this._close_not_saved(),this.unselect(this._select_id),this._loading=!0,n=this._get_date_from_pos(a).valueOf(),!this._drag_start)return this.callEvent("onBeforeEventCreated",[t,this._drag_id])?(this._loading=!1,void(this._drag_start=n)):void(this._loading=!1);i=n,this._drag_start;var o=new Date(this._drag_start),s=new Date(i);"day"!=this._mode&&"week"!=this._mode||o.getHours()!=s.getHours()||o.getMinutes()!=s.getMinutes()||(s=new Date(this._drag_start+1e3)),this._drag_id=this.uid(),this.addEvent(o,s,this.locale.labels.new_event,this._drag_id,a.fields),this.callEvent("onEventCreated",[this._drag_id,t]),this._loading=!1,this._drag_mode="new-size"}var _,d=this.config.time_step,l=this.getEvent(this._drag_id);if(e.matrix&&(_=e.matrix[e._mode]),_=_||{x_step:1,x_unit:"day"},"move"==this._drag_mode)n=this._min_date.valueOf()+6e4*(a.y*this.config.time_step+24*a.x*60),!a.custom&&this._table_view&&(n+=1e3*this.date.time_part(l.start_date)),!this._table_view&&this._dragEventBody&&void 0===this._drag_event._move_event_shift&&(this._drag_event._move_event_shift=n-l.start_date),this._drag_event._move_event_shift&&(n-=this._drag_event._move_event_shift),n=this._correct_shift(n),a._ignores&&this.config.preserve_length&&this._table_view?(n=e._correct_drag_start_date(n),i=e._correct_drag_end_date(n,this._drag_event._event_length)):i=l.end_date.valueOf()-(l.start_date.valueOf()-n);else{if(n=l.start_date.valueOf(),i=l.end_date.valueOf(),this._table_view){var c=this._min_date.valueOf()+a.y*this.config.time_step*6e4+(a.custom?0:864e5);if("month"==this._mode)if(c=this._correct_shift(c,!1),this._drag_from_start){var u=864e5;c<=e.date.date_part(new Date(i+u-1)).valueOf()&&(n=c-u)}else i=c;else this.config.preserve_length?a.resize_from_start?n=e._correct_drag_start_date(c):i=e._correct_drag_end_date(c,0):a.resize_from_start?n=c:i=c}else{var h=this.date.date_part(new Date(l.end_date.valueOf()-1)).valueOf(),f=new Date(h),p=this.config.first_hour,v=60/d*(this.config.last_hour-p);this.config.time_step=1;var g=this._mouse_coords(t);this.config.time_step=d;var m=a.y*d*6e4,y=Math.min(a.y+1,v)*d*6e4,b=6e4*g.y;i=Math.abs(m-b)>Math.abs(y-b)?h+y:h+m,i+=6e4*(new Date(i).getTimezoneOffset()-f.getTimezoneOffset()),this._els.dhx_cal_data[0].style.cursor="s-resize","week"!=this._mode&&"day"!=this._mode||(i=this._correct_shift(i))}if("new-size"==this._drag_mode)if(i<=this._drag_start){var x=a.shift||(this._table_view&&!a.custom?864e5:0);n=i-(a.shift?0:x),i=this._drag_start+(x||6e4*d)}else n=this._drag_start;else i<=n&&(i=n+6e4*d)}var k=new Date(i-1),w=new Date(n);if("move"==this._drag_mode&&e.config.limit_drag_out&&(+w<+e._min_date||+i>+e._max_date)){if(+l.start_date<+e._min_date||+l.end_date>+e._max_date)w=new Date(l.start_date),i=new Date(l.end_date);else{var E=i-w;+w<+e._min_date?(w=new Date(e._min_date),a._ignores&&this.config.preserve_length&&this._table_view?(w=new Date(e._correct_drag_start_date(w)),_._start_correction&&(w=new Date(w.valueOf()+_._start_correction)),i=new Date(1*w+this._get_fictional_event_length(w,this._drag_event._event_length,_))):i=new Date(+w+E)):(i=new Date(e._max_date),a._ignores&&this.config.preserve_length&&this._table_view?(_._end_correction&&(i=new Date(i.valueOf()-_._end_correction)),i=new Date(1*i-this._get_fictional_event_length(i,0,_,!0)),w=new Date(1*i-this._get_fictional_event_length(i,this._drag_event._event_length,_,!0)),this._ignores_detected&&(w=e.date.add(w,_.x_step,_.x_unit),i=new Date(1*i-this._get_fictional_event_length(i,0,_,!0)),i=e.date.add(i,_.x_step,_.x_unit))):w=new Date(+i-E))}k=new Date(i-1)}if(!this._table_view&&this._dragEventBody&&!e.config.all_timed&&(!e._get_section_view()&&a.x!=this._get_event_sday({start_date:new Date(n),end_date:new Date(n)})||new Date(n).getHours()=this.config.last_hour)||(E=i-w,u=this._min_date.valueOf()+24*a.x*60*6e4,(i=e.date.date_part(new Date(u))).setHours(this.config.last_hour),k=new Date(i-1),"move"==this._drag_mode&&(w=new Date(+i-E))),this._table_view||k.getDate()==w.getDate()&&k.getHours()=r?b="dhx_after":n.valueOf()==s.valueOf()&&(b="dhx_now"),this._ignores_detected&&this._ignores[m]&&(b+=" dhx_scale_ignore"),y.className=b+" "+this.templates.month_date_class(n,s),y.setAttribute("data-cell-date",e.templates.format_date(n));var x="dhx_month_body",k="dhx_month_head";if(0===m&&this.config.left_border&&(x+=" dhx_month_body_border",k+=" dhx_month_head_border"),this._ignores_detected&&this._ignores[m])y.appendChild(document.createElement("div")),y.appendChild(document.createElement("div"));else{this._waiAria.monthCellAttr(y,n);var w=document.createElement("div");w.className=k,w.innerHTML=this.templates.month_day(n),y.appendChild(w);var E=document.createElement("div");E.className=x,E.style.height=g+"px",E.style.width=_[m],y.appendChild(E)}p.push(n);var S=n.getDate();(n=this.date.add(n,1,"day")).getDate()-S>1&&(n=new Date(n.getFullYear(),n.getMonth(),S+1,12,0))}e._colsS.heights[d]=u,u+=c(d)}this._min_date=o,this._max_date=n,t.innerHTML="",t.appendChild(h),this._scales={};var D=t.getElementsByTagName("div");for(d=0;d","gm"),a=new RegExp(" +","gm");function n(e){return(e+"").replace(t," ").replace(a," ")}var i=new RegExp("'","gm");function r(e){return(e+"").replace(i,"'")}for(var o in e._waiAria={getAttributeString:function(e){var t=[" "];for(var a in e)if("function"!=typeof e[a]&&"object"!=f(e[a])){var i=r(n(e[a]));t.push(a+"='"+i+"'")}return t.push(" "),t.join(" ")},setAttributes:function(e,t){for(var a in t)e.setAttribute(a,n(t[a]));return e},labelAttr:function(e,t){return this.setAttributes(e,{"aria-label":t})},label:function(t){return e._waiAria.getAttributeString({"aria-label":t})},hourScaleAttr:function(e,t){this.labelAttr(e,t)},monthCellAttr:function(t,a){this.labelAttr(t,e.templates.day_date(a))},navBarDateAttr:function(e,t){this.labelAttr(e,t)},dayHeaderAttr:function(e,t){this.labelAttr(e,t)},dayColumnAttr:function(t,a){this.dayHeaderAttr(t,e.templates.day_date(a))},headerButtonsAttributes:function(e,t){return this.setAttributes(e,{role:"button","aria-label":t})},headerToggleState:function(e,t){return this.setAttributes(e,{"aria-pressed":t?"true":"false"})},getHeaderCellAttr:function(t){return e._waiAria.getAttributeString({"aria-label":t})},eventAttr:function(e,t){this._eventCommonAttr(e,t)},_eventCommonAttr:function(t,a){a.setAttribute("aria-label",n(e.templates.event_text(t.start_date,t.end_date,t))),e.config.readonly&&a.setAttribute("aria-readonly",!0),t.$dataprocessor_class&&a.setAttribute("aria-busy",!0),a.setAttribute("aria-selected",e.getState().select_id==t.id?"true":"false")},setEventBarAttr:function(e,t){this._eventCommonAttr(e,t)},_getAttributes:function(e,t){var a={setAttribute:function(e,t){this[e]=t}};return e.apply(this,[t,a]),a},eventBarAttrString:function(e){return this.getAttributeString(this._getAttributes(this.setEventBarAttr,e))},agendaHeadAttrString:function(){return this.getAttributeString({role:"row"})},agendaHeadDateString:function(e){return this.getAttributeString({role:"columnheader","aria-label":e})},agendaHeadDescriptionString:function(e){return this.agendaHeadDateString(e)},agendaDataAttrString:function(){return this.getAttributeString({role:"grid"})},agendaEventAttrString:function(e){var t=this._getAttributes(this._eventCommonAttr,e);return t.role="row",this.getAttributeString(t)},agendaDetailsBtnString:function(){return this.getAttributeString({role:"button","aria-label":e.locale.labels.icon_details})},gridAttrString:function(){return this.getAttributeString({role:"grid"})},gridRowAttrString:function(e){return this.agendaEventAttrString(e)},gridCellAttrString:function(e,t,a){return this.getAttributeString({role:"gridcell","aria-label":[void 0===t.label?t.id:t.label,": ",a]})},mapAttrString:function(){return this.gridAttrString()},mapRowAttrString:function(e){return this.gridRowAttrString(e)},mapDetailsBtnString:function(){return this.agendaDetailsBtnString()},minicalHeader:function(e,t){this.setAttributes(e,{id:t+"","aria-live":"assertice","aria-atomic":"true"})},minicalGrid:function(e,t){this.setAttributes(e,{"aria-labelledby":t+"",role:"grid"})},minicalRow:function(e){this.setAttributes(e,{role:"row"})},minicalDayCell:function(t,a){var n=a.valueOf()=e._min_date.valueOf();this.setAttributes(t,{role:"gridcell","aria-label":e.templates.day_date(a),"aria-selected":n?"true":"false"})},minicalHeadCell:function(e){this.setAttributes(e,{role:"columnheader"})},weekAgendaDayCell:function(t,a){var n=t.querySelector(".dhx_wa_scale_bar"),i=t.querySelector(".dhx_wa_day_data"),r=e.uid()+"";this.setAttributes(n,{id:r}),this.setAttributes(i,{"aria-labelledby":r})},weekAgendaEvent:function(e,t){this.eventAttr(t,e)},lightboxHiddenAttr:function(e){e.setAttribute("aria-hidden","true")},lightboxVisibleAttr:function(e){e.setAttribute("aria-hidden","false")},lightboxSectionButtonAttrString:function(e){return this.getAttributeString({role:"button","aria-label":e,tabindex:"0"})},yearHeader:function(e,t){this.setAttributes(e,{id:t+""})},yearGrid:function(e,t){this.minicalGrid(e,t)},yearHeadCell:function(e){return this.minicalHeadCell(e)},yearRow:function(e){return this.minicalRow(e)},yearDayCell:function(e){this.setAttributes(e,{role:"gridcell"})},lightboxAttr:function(e){e.setAttribute("role","dialog"),e.setAttribute("aria-hidden","true"),e.firstChild.setAttribute("role","heading")},lightboxButtonAttrString:function(t){return this.getAttributeString({role:"button","aria-label":e.locale.labels[t],tabindex:"0"})},eventMenuAttrString:function(t){return this.getAttributeString({role:"button","aria-label":e.locale.labels[t]})},lightboxHeader:function(e,t){e.setAttribute("aria-label",t)},lightboxSelectAttrString:function(t){var a="";switch(t){case"%Y":a=e.locale.labels.year;break;case"%m":a=e.locale.labels.month;break;case"%d":a=e.locale.labels.day;break;case"%H:%i":a=e.locale.labels.hour+" "+e.locale.labels.minute}return e._waiAria.getAttributeString({"aria-label":a})},messageButtonAttrString:function(e){return"tabindex='0' role='button' aria-label='"+e+"'"},messageInfoAttr:function(e){e.setAttribute("role","alert")},messageModalAttr:function(e,t){e.setAttribute("role","dialog"),t&&e.setAttribute("aria-labelledby",t)},quickInfoAttr:function(e){e.setAttribute("role","dialog")},quickInfoHeaderAttrString:function(){return" role='heading' "},quickInfoHeader:function(e,t){e.setAttribute("aria-label",t)},quickInfoButtonAttrString:function(t){return e._waiAria.getAttributeString({role:"button","aria-label":t,tabindex:"0"})},tooltipAttr:function(e){e.setAttribute("role","tooltip")},tooltipVisibleAttr:function(e){e.setAttribute("aria-hidden","false")},tooltipHiddenAttr:function(e){e.setAttribute("aria-hidden","true")}},e._waiAria)e._waiAria[o]=function(t){return function(){return e.config.wai_aria_attributes?t.apply(this,arguments):" "}}(e._waiAria[o])}()}(t),t.utils=m,t.$domHelpers=C,t.utils.dom=C,t.uid=m.uid,t.mixin=m.mixin,t.defined=m.defined,t.assert=function(e){return function(t,a){t||e.config.show_errors&&!1!==e.callEvent("onError",[a])&&(e.message?e.message({type:"error",text:a,expire:-1}):console.log(a))}}(t),t.copy=m.copy,t._getFocusableNodes=C.getFocusableNodes,t._getClassName=C.getClassName,t._locate_css=C.locateCss;var a=W(t);t.utils.mixin(t,a),t.env=t.$env=M,t.Promise=O,function(e){e.destructor=function(){for(var t in e.callEvent("onDestroy",[]),this.clearAll(),this.$container&&(this.$container.innerHTML=""),this._eventRemoveAll&&this._eventRemoveAll(),this.resetLightbox&&this.resetLightbox(),this._dp&&this._dp.destructor&&this._dp.destructor(),this.detachAllEvents(),this)0===t.indexOf("$")&&delete this[t];e.$destroyed=!0}}(t),function(e){function t(e,t){var a={method:e};if(0===t.length)throw new Error("Arguments list of query is wrong.");if(1===t.length)return"string"==typeof t[0]?(a.url=t[0],a.async=!0):(a.url=t[0].url,a.async=t[0].async||!0,a.callback=t[0].callback,a.headers=t[0].headers),t[0].data?"string"!=typeof t[0].data?a.data=j()(t[0].data):a.data=t[0].data:a.data="",a;switch(a.url=t[0],e){case"GET":case"DELETE":a.callback=t[1],a.headers=t[2];break;case"POST":case"PUT":t[1]?"string"!=typeof t[1]?a.data=j()(t[1]):a.data=t[1]:a.data="",a.callback=t[2],a.headers=t[3]}return a}e.Promise=O,e.ajax={cache:!0,method:"get",serializeRequestParams:j.a,parse:function(t){return"string"!=typeof t?t:(t=t.replace(/^[\s]+/,""),"undefined"==typeof DOMParser||e.$env.isIE?void 0!==window.ActiveXObject&&((a=new window.ActiveXObject("Microsoft.XMLDOM")).async="false",a.loadXML(t)):a=(new DOMParser).parseFromString(t,"text/xml"),a);var a},xmltop:function(t,a,n){if(void 0===a.status||a.status<400){var i=a.responseXML?a.responseXML||a:this.parse(a.responseText||a);if(i&&null!==i.documentElement&&!i.getElementsByTagName("parsererror").length)return i.getElementsByTagName(t)[0]}return-1!==n&&e.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],n]),document.createElement("DIV")},xpath:function(t,a){if(a.nodeName||(a=a.responseXML||a),e.$env.isIE)return a.selectNodes(t)||[];for(var n,i=[],r=(a.ownerDocument||a).evaluate(t,a,null,XPathResult.ANY_TYPE,null);n=r.iterateNext();)i.push(n);return i},query:function(e){return this._call(e.method||"GET",e.url,e.data||"",e.async||!0,e.callback,e.headers)},get:function(e,a,n){var i=t("GET",arguments);return this.query(i)},getSync:function(e,a){var n=t("GET",arguments);return n.async=!1,this.query(n)},put:function(e,a,n,i){var r=t("PUT",arguments);return this.query(r)},del:function(e,a,n){var i=t("DELETE",arguments);return this.query(i)},post:function(e,a,n,i){1==arguments.length?a="":2==arguments.length&&"function"==typeof a&&(a="");var r=t("POST",arguments);return this.query(r)},postSync:function(e,a,n){a=null===a?"":String(a);var i=t("POST",arguments);return i.async=!1,this.query(i)},_call:function(t,a,n,i,r,o){return new e.Promise(function(s,_){var d=void 0===("undefined"==typeof XMLHttpRequest?"undefined":L(XMLHttpRequest))||e.$env.isIE?new window.ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest,l=null!==navigator.userAgent.match(/AppleWebKit/)&&null!==navigator.userAgent.match(/Qt/)&&null!==navigator.userAgent.match(/Safari/);if(i&&d.addEventListener("readystatechange",function(){if(4==d.readyState||l&&3==d.readyState){if((200!=d.status||""===d.responseText)&&!e.callEvent("onAjaxError",[d]))return;setTimeout(function(){"function"==typeof r&&r.apply(window,[{xmlDoc:d,filePath:a}]),s(d),"function"==typeof r&&(r=null,d=null)},0)}}),"GET"!=t||this.cache||(a+=(a.indexOf("?")>=0?"&":"?")+"dhxr"+(new Date).getTime()+"=1"),d.open(t,a,i),o)for(var c in o)d.setRequestHeader(c,o[c]);else"POST"==t.toUpperCase()||"PUT"==t||"DELETE"==t?d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):"GET"==t&&(n=null);if(d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(n),!i)return{xmlDoc:d,filePath:a}}.bind(this))},urlSeparator:function(e){return-1!=e.indexOf("?")?"&":"?"}},e.$ajax=e.ajax}(t),$(t),function(e){e.config={default_date:"%j %M %Y",month_date:"%F %Y",load_date:"%Y-%m-%d",week_date:"%l",day_date:"%D, %F %j",hour_date:"%H:%i",month_day:"%d",date_format:"%Y-%m-%d %H:%i",api_date:"%d-%m-%Y %H:%i",parse_exact_format:!1,preserve_length:!0,time_step:5,start_on_monday:!0,first_hour:0,last_hour:24,readonly:!1,drag_resize:!0,drag_move:!0,drag_create:!0,drag_event_body:!0,dblclick_create:!0,edit_on_create:!0,details_on_create:!1,header:null,resize_month_events:!1,resize_month_timed:!1,responsive_lightbox:!1,rtl:!1,cascade_event_display:!1,cascade_event_count:4,cascade_event_margin:30,multi_day:!0,multi_day_height_limit:0,drag_lightbox:!0,preserve_scroll:!0,select:!0,server_utc:!1,touch:!0,touch_tip:!0,touch_drag:500,touch_swipe_dates:!1,quick_info_detached:!0,positive_closing:!1,drag_highlight:!0,limit_drag_out:!1,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],buttons_left:["dhx_save_btn","dhx_cancel_btn"],buttons_right:["dhx_delete_btn"],lightbox:{sections:[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"time",height:72,type:"time",map_to:"auto"}]},highlight_displayed_event:!0,left_border:!1,ajax_error:"alert",delay_render:0,timeline_swap_resize:!0,wai_aria_attributes:!0,wai_aria_application_role:!0,csp:"auto",event_attribute:"data-event-id",show_errors:!0},e.config.buttons_left.$initial=e.config.buttons_left.join(),e.config.buttons_right.$initial=e.config.buttons_right.join(),e._helpers={parseDate:function(t){return(e.templates.xml_date||e.templates.parse_date)(t)},formatDate:function(t){return(e.templates.xml_format||e.templates.format_date)(t)}},e.templates={},e.init_templates=function(){var t=e.locale.labels;t.dhx_save_btn=t.icon_save,t.dhx_cancel_btn=t.icon_cancel,t.dhx_delete_btn=t.icon_delete;var a=e.date.date_to_str,n=e.config;!function(e,t){for(var a in t)e[a]||(e[a]=t[a])}(e.templates,{day_date:a(n.default_date),month_date:a(n.month_date),week_date:function(t,a){return n.rtl?e.templates.day_date(e.date.add(a,-1,"day"))+" – "+e.templates.day_date(t):e.templates.day_date(t)+" – "+e.templates.day_date(e.date.add(a,-1,"day"))},day_scale_date:a(n.default_date),month_scale_date:a(n.week_date),week_scale_date:a(n.day_date),hour_scale:a(n.hour_date),time_picker:a(n.hour_date),event_date:a(n.hour_date),month_day:a(n.month_day),load_format:a(n.load_date),format_date:a(n.date_format,n.server_utc),parse_date:e.date.str_to_date(n.date_format,n.server_utc),api_date:e.date.str_to_date(n.api_date,!1,!1),event_header:function(t,a,n){return e.templates.event_date(t)+" - "+e.templates.event_date(a)},event_text:function(e,t,a){return a.text},event_class:function(e,t,a){return""},month_date_class:function(e){return""},week_date_class:function(e){return""},event_bar_date:function(t,a,n){return e.templates.event_date(t)+" "},event_bar_text:function(e,t,a){return a.text},month_events_link:function(e,t){return"View more("+t+" events)"},drag_marker_class:function(e,t,a){return""},drag_marker_content:function(e,t,a){return""},tooltip_date_format:e.date.date_to_str("%Y-%m-%d %H:%i"),tooltip_text:function(t,a,n){return"Event: "+n.text+"
Start date: "+e.templates.tooltip_date_format(t)+"
End date: "+e.templates.tooltip_date_format(a)}}),this.callEvent("onTemplatesReady",[])}}(t),function(e){e._events={},e.clearAll=function(){this._events={},this._loaded={},this._edit_id=null,this._select_id=null,this._drag_id=null,this._drag_mode=null,this._drag_pos=null,this._new_event=null,this.clear_view(),this.callEvent("onClearAll",[])},e.addEvent=function(t,a,n,i,r){if(!arguments.length)return this.addEventNow();var o=t;1!=arguments.length&&((o=r||{}).start_date=t,o.end_date=a,o.text=n,o.id=i),o.id=o.id||e.uid(),o.text=o.text||"","string"==typeof o.start_date&&(o.start_date=this.templates.api_date(o.start_date)),"string"==typeof o.end_date&&(o.end_date=this.templates.api_date(o.end_date));var s=6e4*(this.config.event_duration||this.config.time_step);o.start_date.valueOf()==o.end_date.valueOf()&&o.end_date.setTime(o.end_date.valueOf()+s),o.start_date.setMilliseconds(0),o.end_date.setMilliseconds(0),o._timed=this.isOneDayEvent(o);var _=!this._events[o.id];return this._events[o.id]=o,this.event_updated(o),this._loading||this.callEvent(_?"onEventAdded":"onEventChanged",[o.id,o]),o.id},e.deleteEvent=function(t,a){var n=this._events[t];(a||this.callEvent("onBeforeEventDelete",[t,n])&&this.callEvent("onConfirmedBeforeEventDelete",[t,n]))&&(n&&(e.getState().select_id==t&&e.unselect(),delete this._events[t],this.event_updated(n),this._drag_id==n.id&&(this._drag_id=null,this._drag_mode=null,this._drag_pos=null)),this.callEvent("onEventDeleted",[t,n]))},e.getEvent=function(e){return this._events[e]},e.setEvent=function(e,t){t.id||(t.id=e),this._events[e]=t},e.for_rendered=function(e,t){for(var a=this._rendered.length-1;a>=0;a--)this._rendered[a].getAttribute(this.config.event_attribute)==e&&t(this._rendered[a],a)},e.changeEventId=function(t,a){if(t!=a){var n=this._events[t];n&&(n.id=a,this._events[a]=n,delete this._events[t]),this.for_rendered(t,function(t){t.setAttribute("event_id",a),t.setAttribute(e.config.event_attribute,a)}),this._select_id==t&&(this._select_id=a),this._edit_id==t&&(this._edit_id=a),this.callEvent("onEventIdChange",[t,a])}},function(){for(var t=["text","Text","start_date","StartDate","end_date","EndDate"],a=function(t){return function(a){return e.getEvent(a)[t]}},n=function(t){return function(a,n){var i=e.getEvent(a);i[t]=n,i._changed=!0,i._timed=this.isOneDayEvent(i),e.event_updated(i,!0)}},i=0;in||a<=i)&&(t>=n||t24-(this.config.last_hour-this.config.first_hour)||ti))}return!1},e.isOneDayEvent=function(e){var t=new Date(e.end_date.valueOf()-1);return e.start_date.getFullYear()===t.getFullYear()&&e.start_date.getMonth()===t.getMonth()&&e.start_date.getDate()===t.getDate()&&e.end_date.valueOf()-e.start_date.valueOf()<864e5},e.get_visible_events=function(e){var t=[];for(var a in this._events)this.is_visible_events(this._events[a])&&(e&&!this._events[a]._timed||this.filter_event(a,this._events[a])&&t.push(this._events[a]));return t},e.filter_event=function(e,t){var a=this["filter_"+this._mode];return!a||a(e,t)},e._is_main_area_event=function(e){return!!e._timed},e.render_view_data=function(t,a){var n=!1;if(!t){if(n=!0,this._not_render)return void(this._render_wait=!0);this._render_wait=!1,this.clear_view(),t=this.get_visible_events(!(this._table_view||this.config.multi_day))}for(var i=0,r=t.length;il){var c=l;1*this.config.max_month_events!==this.config.max_month_events||r[_]<=this.config.max_month_events?c=r[_]*n:(this.config.max_month_events+1)*n>l&&(c=(this.config.max_month_events+1)*n);for(var u=0;ut.id?1:-1:e.start_date>t.start_date?1:-1});var a=[],n=[];this._min_mapped_duration=Math.ceil(60*this.xy.min_event_height/this.config.hour_size_px);for(var i=0;ig&&(g=l[f]._sorder);r._sorder=g+1,r._inner=!1}else r._sorder=0;l.splice(u,u==l.length?0:1,r),l.length>(l.max_count||0)?(l.max_count=l.length,r._count=l.length):r._count=r._count?r._count:1}(_=this.config.last_hour)&&(n.push(r),e[i]=r=this._copy_event(r),_=this.config.last_hour&&(r.end_date.setMinutes(0),r.end_date.setHours(this.config.last_hour)),r.start_date>r.end_date||_==this.config.last_hour)&&(e.splice(i,1),i--)}}if(!t){for(i=0;it.id?1:-1:e.start_date>t.start_date?1:-1})},e._is_any_multiday_cell_visible=function(t,a,n){var i=this._cols.length,r=!1,o=t,s=!0,_=new Date(a);for(e.date.day_start(new Date(a)).valueOf()!=a.valueOf()&&(_=e.date.day_start(_),_=e.date.add(_,1,"day"));o<_;){s=!1;var d=this.locate_holder_day(o,!1,n)%i;if(!this._ignores[d]){r=!0;break}o=e.date.add(o,1,"day")}return s||r},e._pre_render_events_table=function(t,a){this._time_order(t);for(var n,i=[],r=[[],[],[],[],[],[],[]],o=this._colsS.heights,s=this._cols.length,_={},d=0;dthis._max_date&&(u.last_chunk=!1,f=this._max_date);var p=this.locate_holder_day(h,!1,l);if(l._sday=p%s,!this._ignores[l._sday]||!l._timed){var v=this.locate_holder_day(f,!0,l)||s;if(l._eday=v%s||s,l._length=v-p,l._sweek=Math.floor((this._correct_shift(h.valueOf(),1)-this._min_date.valueOf())/(864e5*s)),e._is_any_multiday_cell_visible(h,f,l)){var g,m=r[l._sweek];for(g=0;g",this._editor=y.querySelector("textarea"),this._quirks7&&(this._editor.style.height=d-12+"px"),e.event(this._editor,"keydown",function(t){if(t.shiftKey)return!0;var a=t.keyCode;a==e.keys.edit_save&&e.editStop(!0),a==e.keys.edit_cancel&&e.editStop(!1),a!=e.keys.edit_save&&a!=e.keys.edit_cancel||t.preventDefault&&t.preventDefault()}),e.event(this._editor,"selectstart",function(e){return e.cancelBubble=!0,!0}),e._focus(this._editor,!0),this._els.dhx_cal_data[0].scrollLeft=0}if(0!==this.xy.menu_width&&this._select_id==t.id){this.config.cascade_event_display&&this._drag_mode&&(g.style.zIndex=1);for(var b,x=this.config["icons_"+(this._edit_id==t.id?"edit":"select")],k="",w=t.color?"background-color: "+t.color+";":"",E=t.textColor?"color: "+t.textColor+";":"",S=0;S
";var D=this._render_v_bar(t,h-i+1,_,i,20*x.length+26-2,"","
",k,!0);D.style.left=h-i+1,this._els.dhx_cal_data[0].appendChild(D),this._rendered.push(D)}this.config.drag_highlight&&this._drag_id==t.id&&this.highlightEventPosition(t)}}},e._render_v_bar=function(t,a,n,i,r,o,s,_,d){var l=document.createElement("div"),c=t.id,u=d?"dhx_cal_event dhx_cal_select_menu":"dhx_cal_event",h=e.getState();h.drag_id==t.id&&(u+=" dhx_cal_event_drag"),h.select_id==t.id&&(u+=" dhx_cal_event_selected");var f=e.templates.event_class(t.start_date,t.end_date,t);f&&(u=u+" "+f),this.config.cascade_event_display&&(u+=" dhx_cal_event_cascade");var p=t.color?"background-color:"+t.color+";":"",v=t.textColor?"color:"+t.textColor+";":"",g=e._border_box_events(),m=i-2,y=g?m:i-4,b=g?m:i-6,x=g?m:i-(this._quirks?4:14),k=g?m-2:i-8,w=g?r-this.xy.event_header_height-1:r-(this._quirks?20:30)+1,E='
';l.innerHTML=E;var S=l.cloneNode(!0).firstChild;if(!d&&e.renderEvent(S,t,i,r,s,_))return S;S=l.firstChild;var D='
 
';D+='
'+s+"
",D+='
'+_+"
";var N="dhx_event_resize dhx_footer";return(d||!1===t._drag_resize)&&(N="dhx_resize_denied "+N),D+='
',S.innerHTML=D,S},e.renderEvent=function(){return!1},e.locate_holder=function(e){return"day"==this._mode?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[e]},e.locate_holder_day=function(e,t){var a=Math.floor((this._correct_shift(e,1)-this._min_date)/864e5);return t&&this.date.time_part(e)&&a++,a},e._get_dnd_order=function(e,t,a){if(!this._drag_event)return e;this._drag_event._orig_sorder?e=this._drag_event._orig_sorder:this._drag_event._orig_sorder=e;for(var n=t*e;n+t>a;)e--,n-=t;return e=Math.max(e,0)},e._get_event_bar_pos=function(t){var a=this.config.rtl,n=this._colsS,i=n[t._sday],r=n[t._eday];a&&(i=n[n.col_length]-n[t._eday]+n[0],r=n[n.col_length]-n[t._sday]+n[0]),r==i&&(r=n[t._eday+1]);var o=this.xy.bar_height,s=t._sorder;if(t.id==this._drag_id){var _=n.heights[t._sweek+1]-n.heights[t._sweek]-this.xy.month_head_height;s=e._get_dnd_order(s,o,_)}var d=s*o;return{x:i,x2:r,y:n.heights[t._sweek]+(n.height?this.xy.month_scale_height+2:2)+d}},e.render_event_bar=function(t){var a=this._rendered_location,n=this._get_event_bar_pos(t),i=n.y,r=n.x,o=n.x2,s="";if(o){var _=e.config.resize_month_events&&"month"==this._mode&&(!t._timed||e.config.resize_month_timed),d=document.createElement("div"),l=t.hasOwnProperty("_first_chunk")&&t._first_chunk,c=t.hasOwnProperty("_last_chunk")&&t._last_chunk,u=_&&(t._timed||l),h=_&&(t._timed||c),f=!0,p="dhx_cal_event_clear";t._timed&&!_||(f=!1,p="dhx_cal_event_line"),l&&(p+=" dhx_cal_event_line_start"),c&&(p+=" dhx_cal_event_line_end"),u&&(s+="
"),h&&(s+="
");var v=e.templates.event_class(t.start_date,t.end_date,t);v&&(p+=" "+v);var g=t.color?"background:"+t.color+";":"",m=t.textColor?"color:"+t.textColor+";":"",y=["position:absolute","top:"+i+"px","left:"+r+"px","width:"+(o-r-3-(f?1:0))+"px",m,g,t._text_style||""].join(";"),b="
";_&&(b+=s),"month"==e.getState().mode&&(t=e.getEvent(t.id)),t._timed&&(b+=e.templates.event_bar_date(t.start_date,t.end_date,t)),b+=e.templates.event_bar_text(t.start_date,t.end_date,t)+"
",b+="
",d.innerHTML=b,this._rendered.push(d.firstChild),a.appendChild(d.firstChild)}},e._locate_event=function(e){for(var t=null;e&&!t&&e.getAttribute;)t=e.getAttribute(this.config.event_attribute),e=e.parentNode;return t},e.edit=function(e){this._edit_id!=e&&(this.editStop(!1,e),this._edit_id=e,this.updateEvent(e))},e.editStop=function(e,t){if(!t||this._edit_id!=t){var a=this.getEvent(this._edit_id);a&&(e&&(a.text=this._editor.value),this._edit_id=null,this._editor=null,this.updateEvent(a.id),this._edit_stop_event(a,e))}},e._edit_stop_event=function(e,t){this._new_event?(t?this.callEvent("onEventAdded",[e.id,e]):e&&this.deleteEvent(e.id,!0),this._new_event=null):t&&this.callEvent("onEventChanged",[e.id,e])},e.getEvents=function(e,t){var a=[];for(var n in this._events){var i=this._events[n];i&&(!e&&!t||i.start_datee)&&a.push(i)}return a},e.getRenderedEvent=function(t){if(t){for(var a=e._rendered,n=0;n-1&&(c=c.split(e.config.section_delimiter)[0])}var u=_.getSectionTop(c),h=_.posFromDate(l.start_date),f=e.$container.querySelector(".dhx_timeline_data_wrapper");if(h-=(f.offsetWidth-_.dx)/2,u=u-f.offsetHeight/2+_.dy/2,_._smartRenderingEnabled())var p=_.attachEvent("onScroll",function(){v(),_.detachEvent(p)});_.scrollTo({left:h,top:u}),_._smartRenderingEnabled()||v()}}else v();e.callEvent("onAfterEventDisplay",[n,a])}function v(){n.color=o,n.textColor=s}}}(t),function(e){e._append_drag_marker=function(t){if(!t.parentNode){var a=e._els.dhx_cal_data[0].lastChild,n=e._getClassName(a);n.indexOf("dhx_scale_holder")<0&&a.previousSibling&&(a=a.previousSibling),n=e._getClassName(a),a&&0===n.indexOf("dhx_scale_holder")&&a.appendChild(t)}},e._update_marker_position=function(t,a){var n=e._calc_event_y(a,0);t.style.top=n.top+"px",t.style.height=n.height+"px"},e.highlightEventPosition=function(e){var t=document.createElement("div");t.setAttribute("event_id",e.id),t.setAttribute(this.config.event_attribute,e.id),this._rendered.push(t),this._update_marker_position(t,e);var a=this.templates.drag_marker_class(e.start_date,e.end_date,e),n=this.templates.drag_marker_content(e.start_date,e.end_date,e);t.className="dhx_drag_marker",a&&(t.className+=" "+a),n&&(t.innerHTML=n),this._append_drag_marker(t)}}(t),B(t),function(e){function t(){var t=!0===e.config.csp,a=!!window.Sfdc||!!window.$A||window.Aura||"$shadowResolver$"in document.body;return t||a?e.$root:document.body}e._lightbox_controls={},e.formSection=function(t){for(var a=this.config.lightbox.sections,n=0;n
"},set_value:function(e,t,a,n){e.innerHTML=t||""},get_value:function(e,t,a){return e.innerHTML||""},focus:function(e){}},textarea:{render:function(t){var a=e._lightbox_controls.defaults.textarea,n=a?a.height:200;return"
"},set_value:function(t,a,n){e.form_blocks.textarea._get_input(t).value=a||""},get_value:function(t,a){return e.form_blocks.textarea._get_input(t).value},focus:function(t){var a=e.form_blocks.textarea._get_input(t);e._focus(a,!0)},_get_input:function(e){return e.getElementsByTagName("textarea")[0]}},select:{render:function(t){for(var a=e._lightbox_controls.defaults.select,n=a?a.height:23,i="
"},set_value:function(t,a,n,i){var r=t.firstChild;!r._dhx_onchange&&i.onchange&&(e.event(r,"change",i.onchange),r._dhx_onchange=!0),void 0===a&&(a=(r.options[0]||{}).value),r.value=a||""},get_value:function(e,t){return e.firstChild.value},focus:function(t){var a=t.firstChild;e._focus(a,!0)}},time:{render:function(t){t.time_format||(t.time_format=["%H:%i","%d","%m","%Y"]),t._time_format_order={};var a=t.time_format,n=e.config,i=e.date.date_part(e._currentDate()),r=1440,o=0;e.config.limit_time_select&&(r=60*n.last_hour+1,o=60*n.first_hour,i.setHours(n.first_hour));for(var s="",_=0;_0&&(s+=" ");var l="",c="";switch(d){case"%Y":var u,h,f;l="dhx_lightbox_year_select",t._time_format_order[3]=_,t.year_range&&(isNaN(t.year_range)?t.year_range.push&&(h=t.year_range[0],f=t.year_range[1]):u=t.year_range),u=u||10;var p=p||Math.floor(u/2);h=h||i.getFullYear()-p,f=f||h+u;for(var v=h;v"+v+"";break;case"%m":for(l="dhx_lightbox_month_select",t._time_format_order[2]=_,v=0;v<12;v++)c+="";break;case"%d":for(l="dhx_lightbox_day_select",t._time_format_order[1]=_,v=1;v<32;v++)c+="";break;case"%H:%i":l="dhx_lightbox_time_select",t._time_format_order[0]=_,v=o;var g=i.getDate();for(t._time_values=[];v"+this.templates.time_picker(i)+"",t._time_values.push(v),i.setTime(i.valueOf()+60*this.config.time_step*1e3),v=24*(i.getDate()!=g?1:0)*60+60*i.getHours()+i.getMinutes()}if(c){var m=e._waiAria.lightboxSelectAttrString(d);s+=" "}}var y=e._lightbox_controls.defaults.select,b=y?y.height:23;return"
"+s+"  –  "+s+"
"},set_value:function(t,a,n,i){var r,o,s=e.config,_=t.getElementsByTagName("select"),d=i._time_format_order;if(s.full_day){if(!t._full_day){var l="";e.config.wide_form||(l=t.previousSibling.innerHTML+l),t.previousSibling.innerHTML=l,t._full_day=!0}var c=t.previousSibling.getElementsByTagName("input")[0];c.checked=0===e.date.time_part(n.start_date)&&0===e.date.time_part(n.end_date),_[d[0]].disabled=c.checked,_[d[0]+_.length/2].disabled=c.checked,c.$_eventAttached||(c.$_eventAttached=!0,e.event(c,"click",function(){if(c.checked){var a={};e.form_blocks.time.get_value(t,a,i),r=e.date.date_part(a.start_date),(+(o=e.date.date_part(a.end_date))==+r||+o>=+r&&(0!==n.end_date.getHours()||0!==n.end_date.getMinutes()))&&(o=e.date.add(o,1,"day"))}else r=null,o=null;_[d[0]].disabled=c.checked,_[d[0]+_.length/2].disabled=c.checked,f(_,0,r||n.start_date),f(_,4,o||n.end_date)}))}if(s.auto_end_date&&s.event_duration)for(var u=function(){s.auto_end_date&&s.event_duration&&(r=new Date(_[d[3]].value,_[d[2]].value,_[d[1]].value,0,_[d[0]].value),o=new Date(r.getTime()+60*e.config.event_duration*1e3),f(_,4,o))},h=0;h<4;h++)_[h].$_eventAttached||(_[h].$_eventAttached=!0,e.event(_[h],"change",u));function f(e,t,a){for(var n=i._time_values,r=60*a.getHours()+a.getMinutes(),o=r,s=!1,_=0;_t().offsetWidth?e.style.left=Math.round(n+(t().offsetWidth-e.offsetWidth)/2)+"px":e.style.left=Math.round((t().offsetWidth-e.offsetWidth)/2)+"px"}},e.showCover=function(a){a&&(a.style.display="block",this._setLbPosition(a)),e.config.responsive_lightbox&&(document.documentElement.classList.add("dhx_cal_overflow_container"),t().classList.add("dhx_cal_overflow_container")),this.show_cover()},e.showLightbox=function(e){if(e)if(this.callEvent("onBeforeLightbox",[e])){var t=this.getLightbox();this.showCover(t),this._fill_lightbox(e,t),this._waiAria.lightboxVisibleAttr(t),this.callEvent("onLightbox",[e])}else this._new_event&&(this._new_event=null)},e._fill_lightbox=function(t,a){var n=this.getEvent(t),i=a.getElementsByTagName("span"),r=[];if(e.templates.lightbox_header){r.push("");var o=e.templates.lightbox_header(n.start_date,n.end_date,n);r.push(o),i[1].innerHTML="",i[2].innerHTML=o}else{var s=this.templates.event_header(n.start_date,n.end_date,n),_=(this.templates.event_bar_text(n.start_date,n.end_date,n)||"").substr(0,70);r.push(s),r.push(_),i[1].innerHTML=s,i[2].innerHTML=_}this._waiAria.lightboxHeader(a,r.join(" "));for(var d=this.config.lightbox.sections,l=0;l
"+e.locale.labels[i[r]]+"
";i=this.config.buttons_right;var o=e.config.rtl;for(r=0;r
"+e.locale.labels[i[r]]+"
";n+="",a.innerHTML=n,e.config.drag_lightbox&&(e.event(a.firstChild,"mousedown",e._ready_to_dnd),e.event(a.firstChild,"selectstart",function(e){return e.preventDefault(),!1}),a.firstChild.style.cursor="move",e._init_dnd_events()),this._waiAria.lightboxAttr(a),t().insertBefore(a,t().firstChild),this._lightbox=a;var s=this.config.lightbox.sections;for(n="",r=0;r
"+this.locale.labels["button_"+s[r].button]+"
"),this.config.wide_form&&(n+="
");var l=this.locale.labels["section_"+s[r].name];"string"!=typeof l&&(l=s[r].name),n+="
"+d+"
"+_.render.call(this,s[r]),n+="
"}}var c=a.getElementsByTagName("div");for(r=0;r 
"}(t),V(t),function(e){e.getRootView=function(){return{view:{render:function(){return{tag:"div",type:1,attrs:{style:"width:100%;height:100%;"},hooks:{didInsert:function(){e.setCurrentView()}},body:[{el:this.el,type:1}]}},init:function(){var t=document.createElement("DIV");t.id="scheduler_"+e.uid(),t.style.width="100%",t.style.height="100%",t.classList.add("dhx_cal_container"),t.cmp="grid",t.innerHTML='
 
 
',e.init(t),this.el=t}},type:4}}}(t),U(t),window.jQuery&&function(e){var t=0,a=[];e.fn.dhx_scheduler=function(n){if("string"!=typeof n){var i=[];return this.each(function(){if(this&&this.getAttribute)if(this.getAttribute("dhxscheduler"))i.push(window[this.getAttribute("dhxscheduler")]);else{var e="scheduler";t&&(e="scheduler"+(t+1),window[e]=Scheduler.getSchedulerInstance());var a=window[e];for(var r in this.setAttribute("dhxscheduler",e),n)"data"!=r&&(a.config[r]=n[r]);this.getElementsByTagName("div").length||(this.innerHTML='
 
 
',this.className+=" dhx_cal_container"),a.init(this,a.config.date,a.config.mode),n.data&&a.parse(n.data),i.push(a),t++}}),1===i.length?i[0]:i}if(a[n])return a[n].apply(this,[]);e.error("Method "+n+" does not exist on jQuery.dhx_scheduler")}}(window.jQuery),function(e){!function(){var t=e.setCurrentView,a=e.updateView,i=null,r=null,o=function(t,o){var s=this;n.a.clearTimeout(r),n.a.clearTimeout(i);var d=s._date,l=s._mode;_(this,t,o),r=setTimeout(function(){e.$destroyed||(s.callEvent("onBeforeViewChange",[l,d,o||s._mode,t||s._date])?(a.call(s,t,o),s.callEvent("onViewChange",[s._mode,s._date]),n.a.clearTimeout(i),r=0):_(s,d,l))},e.config.delay_render)},s=function(t,o){var s=this,d=arguments;_(this,t,o),n.a.clearTimeout(i),i=setTimeout(function(){e.$destroyed||r||a.apply(s,d)},e.config.delay_render)};function _(e,t,a){t&&(e._date=t),a&&(e._mode=a)}e.attachEvent("onSchedulerReady",function(){e.config.delay_render?(e.setCurrentView=o,e.updateView=s):(e.setCurrentView=t,e.updateView=a)})}()}(t),function(e){e.createDataProcessor=function(t){var a,n;t instanceof Function?a=t:t.hasOwnProperty("router")?a=t.router:t.hasOwnProperty("event")&&(a=t),n=a?"CUSTOM":t.mode||"REST-JSON";var i=new J(t.url);return i.init(e),i.setTransactionMode({mode:n,router:a},t.batchUpdate),i},e.DataProcessor=J}(t),function(e){e.attachEvent("onSchedulerReady",function(){"undefined"!=typeof dhtmlxError&&window.dhtmlxError.catchError("LoadXML",function(t,a,i){var r=i[0].responseText;switch(e.config.ajax_error){case"alert":n.a.alert(r);break;case"console":n.a.console.log(r)}})})}(t);var o=new he({en:ne,ar:K,be:G,ca:X,cn:Q,cs:Z,da:ee,de:te,el:ae,es:ie,fi:re,fr:oe,he:se,hu:_e,id:de,it:le,jp:ce,nb:fe,nl:pe,no:ve,pl:ge,pt:me,ro:ye,ru:be,si:xe,sk:ke,sv:we,tr:Ee,ua:Se});t.i18n={addLocale:o.addLocale,setLocale:function(e){if("string"==typeof e){var a=o.getLocale(e);a||(a=o.getLocale("en")),t.locale=a}else if(e)if(t.locale)for(var n in e)e[n]&&"object"===De(e[n])?(t.locale[n]||(t.locale[n]={}),t.mixin(t.locale[n],e[n],!0)):t.locale[n]=e[n];else t.locale=e},getLocale:o.getLocale},t.i18n.setLocale("en"),t.ext={};var s={};return t.plugins=function(a){(function(e,t,a){var n=[];for(var i in e)if(e[i]){var r=i.toLowerCase();t[r]&&t[r].forEach(function(t){var a=t.toLowerCase();e[a]||n.push(a)}),n.push(r)}return n.sort(function(e,t){var n=a[e]||0,i=a[t]||0;return n>i?1:n
';var i=document.createElement("DIV");return i.id="dhxSchedObj_"+this._genStr(12),i.innerHTML='
 
 
'+a+'
',document.body.appendChild(i.firstChild),this.attachObject(i.id,!1,!0),this.vs[this.av].sched=n,this.vs[this.av].schedId=i.id,n.setSizes=n.updateView,n.destructor=function(){},n.init(i.id,e,t),this.vs[this._viewRestore()].sched});var Me=function(e,t){t(!1,"The ".concat(e,' extension is not included in this version of dhtmlxScheduler.
\n\t\tYou may need a Professional version of the component.
\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.'))},Oe=function(e){!function(){var t=[];function a(){return!!t.length}function n(t){setTimeout(function(){if(e.$destroyed)return!0;a()||function(e,t){for(;e&&e!=t;)e=e.parentNode;return!(e!=t)}(document.activeElement,e.$container)||e.focus()},1)}function i(a){var n=(a=a||window.event).currentTarget;(function(e){return e==t[t.length-1]})(n)&&e.$keyboardNavigation.trapFocus(n,a)}if(e.attachEvent("onLightbox",function(){!function(a){e.eventRemove(a,"keydown",i),e.event(a,"keydown",i),t.push(a)}(e.getLightbox())}),e.attachEvent("onAfterLightbox",function(){var a=t.pop();a&&e.eventRemove(a,"keydown",i),n()}),e.attachEvent("onAfterQuickInfo",function(){n()}),!e._keyNavMessagePopup){e._keyNavMessagePopup=!0;var r=null,o=null,s=[];e.attachEvent("onMessagePopup",function(t){for(r=document.activeElement,o=r;o&&e._getClassName(o).indexOf("dhx_cal_data")<0;)o=o.parentNode;o&&(o=o.parentNode),e.eventRemove(t,"keydown",i),e.event(t,"keydown",i),s.push(t)}),e.attachEvent("onAfterMessagePopup",function(){var t=s.pop();t&&e.eventRemove(t,"keydown",i),setTimeout(function(){if(e.$destroyed)return!0;for(var t=document.activeElement;t&&e._getClassName(t).indexOf("dhx_cal_light")<0;)t=t.parentNode;t||(r&&r.parentNode?r.focus():o&&o.parentNode&&o.focus(),r=null,o=null)},1)})}e.$keyboardNavigation.isModal=a}()},He=function(e){e._temp_key_scope=function(){e.config.key_nav=!0,e.$keyboardNavigation._pasteDate=null,e.$keyboardNavigation._pasteSection=null;var t=null,a={};function n(e){e=e||window.event,a.x=e.clientX,a.y=e.clientY}function i(){for(var t,n,i=document.elementFromPoint(a.x,a.y);i&&i!=e._obj;)i=i.parentNode;return t=!(i!=e._obj),n=e.$keyboardNavigation.dispatcher.isEnabled(),t||n}function r(t){return e._lame_copy({},t)}document.body?e.event(document.body,"mousemove",n):e.event(window,"load",function(){e.event(document.body,"mousemove",n)}),e.attachEvent("onMouseMove",function(t,a){var n=e.getState();if(n.mode&&n.min_date){var i=e.getActionData(a);e.$keyboardNavigation._pasteDate=i.date,e.$keyboardNavigation._pasteSection=i.section}}),e._make_pasted_event=function(t){var a=e.$keyboardNavigation._pasteDate,n=e.$keyboardNavigation._pasteSection,i=t.end_date-t.start_date,o=r(t);if(function(e){delete e.rec_type,delete e.rec_pattern,delete e.event_pid,delete e.event_length}(o),o.start_date=new Date(a),o.end_date=new Date(o.start_date.valueOf()+i),n){var s=e._get_section_property();e.config.multisection?o[s]=t[s]:o[s]=n}return o},e._do_paste=function(t,a,n){!1!==e.callEvent("onBeforeEventPasted",[t,a,n])&&(e.addEvent(a),e.callEvent("onEventPasted",[t,a,n]))},e._is_key_nav_active=function(){return!(!this._is_initialized()||this._is_lightbox_open()||!this.config.key_nav)},e.event(document,"keydown",function(t){(t.ctrlKey||t.metaKey)&&86==t.keyCode&&e._buffer_event&&!e.$keyboardNavigation.dispatcher.isEnabled()&&(e.$keyboardNavigation.dispatcher.isActive=i())}),e._key_nav_copy_paste=function(a){if(!e._is_key_nav_active())return!0;if(37==a.keyCode||39==a.keyCode){a.cancelBubble=!0;var n=e.date.add(e._date,37==a.keyCode?-1:1,e._mode);return e.setCurrentView(n),!0}var o=function(){var t=e.$keyboardNavigation.dispatcher.getActiveNode();return t&&t.eventId?t.eventId:e._select_id}();if((a.ctrlKey||a.metaKey)&&67==a.keyCode)return o&&(e._buffer_event=r(e.getEvent(o)),t=!0,e.callEvent("onEventCopied",[e.getEvent(o)])),!0;if((a.ctrlKey||a.metaKey)&&88==a.keyCode&&o){t=!1;var s=e._buffer_event=r(e.getEvent(o));e.updateEvent(s.id),e.callEvent("onEventCut",[s])}if((a.ctrlKey||a.metaKey)&&86==a.keyCode&&i()){if(s=(s=e._buffer_event?e.getEvent(e._buffer_event.id):e._buffer_event)||e._buffer_event){var _=e._make_pasted_event(s);if(t)_.id=e.uid(),e._do_paste(t,_,s);else e.callEvent("onBeforeEventChanged",[_,a,!1,s])&&(e._do_paste(t,_,s),t=!0)}return!0}}},e._temp_key_scope()},je=function(e){e.$keyboardNavigation.attachSchedulerHandlers=function(){var t,a=e.$keyboardNavigation.dispatcher,n=function(t){if(e.config.key_nav)return a.keyDownHandler(t)},i=function(){a.keepScrollPosition(function(){a.focusGlobalNode()})};e.attachEvent("onDataRender",function(){e.config.key_nav&&a.isEnabled()&&!e.getState().editor_id&&(clearTimeout(t),t=setTimeout(function(){if(e.$destroyed)return!0;a.isEnabled()||a.enable(),r()}))});var r=function(){if(a.isEnabled()){var t=a.getActiveNode();t&&(t.isValid()||(t=t.fallback()),!t||t instanceof e.$keyboardNavigation.MinicalButton||t instanceof e.$keyboardNavigation.MinicalCell||a.keepScrollPosition(function(){t.focus(!0)}))}};function o(t){if(!e.config.key_nav)return!0;var n,i=e.$keyboardNavigation.isChildOf(t.target||t.srcElement,e.$container.querySelector(".dhx_cal_data")),r=e.getActionData(t);e._locate_event(t.target||t.srcElement)?n=new e.$keyboardNavigation.Event(e._locate_event(t.target||t.srcElement)):i&&(n=new e.$keyboardNavigation.TimeSlot,r.date&&i&&(n=n.nextSlot(new e.$keyboardNavigation.TimeSlot(r.date,null,r.section)))),n&&(a.isEnabled()?r.date&&i&&a.delay(function(){a.setActiveNode(n)}):a.activeNode=n)}e.attachEvent("onSchedulerReady",function(){var t=e.$container;e.eventRemove(document,"keydown",n),e.eventRemove(t,"mousedown",o),e.eventRemove(t,"focus",i),e.config.key_nav?(e.event(document,"keydown",n),e.event(t,"mousedown",o),e.event(t,"focus",i),t.setAttribute("tabindex","0")):t.removeAttribute("tabindex")});var s=e.updateEvent;e.updateEvent=function(t){var n=s.apply(this,arguments);if(e.config.key_nav&&a.isEnabled()&&e.getState().select_id==t){var i=new e.$keyboardNavigation.Event(t);e.getState().lightbox_id||function(t){if(e.config.key_nav&&a.isEnabled()){var n=t,i=new e.$keyboardNavigation.Event(n.eventId);if(!i.isValid()){var r=i.start||n.start,o=i.end||n.end,s=i.section||n.section;(i=new e.$keyboardNavigation.TimeSlot(r,o,s)).isValid()||(i=new e.$keyboardNavigation.TimeSlot)}a.setActiveNode(i);var _=a.getActiveNode();_&&_.getNode&&document.activeElement!=_.getNode()&&a.focusNode(a.getActiveNode())}}(i)}return n},e.attachEvent("onEventDeleted",function(t){if(!e.config.key_nav)return!0;a.isEnabled()&&(a.getActiveNode().eventId==t&&a.setActiveNode(new e.$keyboardNavigation.TimeSlot));return!0}),e.attachEvent("onClearAll",function(){if(!e.config.key_nav)return!0;a.isEnabled()&&a.getActiveNode()instanceof e.$keyboardNavigation.Event&&a.setActiveNode(new e.$keyboardNavigation.TimeSlot)})}};function Le(e){"@babel/helpers - typeof";return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e){"@babel/helpers - typeof";return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e){"@babel/helpers - typeof";return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ze(e){"@babel/helpers - typeof";return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fe(e){"@babel/helpers - typeof";return(Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Ie=new(function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._seed=0,this._schedulerPlugins=[],this._bundledExtensions=t,this._extensionsManager=new Te(t)}return function(e,t,a){t&&Ae(e.prototype,t),a&&Ae(e,a),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"plugin",value:function(e){this._schedulerPlugins.push(e),n.a.scheduler&&e(n.a.scheduler)}},{key:"getSchedulerInstance",value:function(e){for(var t=Ne(this._extensionsManager),a=0;a"+n(e)+""}};if(t("week"),t("","month_day"),this.matrix)for(var a in this.matrix)t(a);this._detachDomEvent(this._obj,"click",e._active_link_click),e.event(this._obj,"click",e._active_link_click)})},agenda_view:function(e){e.date.add_agenda=function(t){return e.date.add(t,1,"year")},e.templates.agenda_time=function(t,a,n){return n._timed?this.day_date(n.start_date,n.end_date,n)+" "+this.event_date(t):e.templates.day_date(t)+" – "+e.templates.day_date(a)},e.templates.agenda_text=function(e,t,a){return a.text},e.templates.agenda_date=function(){return""},e.date.agenda_start=function(){return e.date.date_part(e._currentDate())},e.attachEvent("onTemplatesReady",function(){var t=e.dblclick_dhx_cal_data;e.dblclick_dhx_cal_data=function(){if("agenda"==this._mode)!this.config.readonly&&this.config.dblclick_create&&this.addEventNow();else if(t)return t.apply(this,arguments)};var a=e.render_data;e.render_data=function(e){if("agenda"!=this._mode)return a.apply(this,arguments);i()};var n=e.render_view_data;function i(){var t=e.get_visible_events();t.sort(function(e,t){return e.start_date>t.start_date?1:-1});for(var a,n="
",i=0;i
"+(e.config.rtl?e.templates.agenda_time(r.end_date,r.start_date,r):e.templates.agenda_time(r.start_date,r.end_date,r))+"
",n+="
 
",n+=""+e.templates.agenda_text(r.start_date,r.end_date,r)+"
"}n+="
",e._els.dhx_cal_data[0].innerHTML=n,e._els.dhx_cal_data[0].childNodes[0].scrollTop=e._agendaScrollTop||0;var l=e._els.dhx_cal_data[0].childNodes[0];l.childNodes[l.childNodes.length-1].style.height=l.offsetHeight
"+a.date+"
"+a.description+"",e._table_view=!0,e.set_sizes()}}(t),t?(e._cols=null,e._colsS=null,e._table_view=!0,i()):e._table_view=!1}})},all_timed:function(e){e.config.all_timed="short",e.config.all_timed_month=!1;var t=function(t){return!((t.end_date-t.start_date)/36e5>=24)||"resize"==e._drag_mode&&e._drag_id==t.id};e._safe_copy=function(t){var a=null,n=e._copy_event(t);return t.event_pid&&(a=e.getEvent(t.event_pid)),a&&a.isPrototypeOf(t)&&(delete n.event_length,delete n.event_pid,delete n.rec_pattern,delete n.rec_type),n};var a=e._pre_render_events_line,n=e._pre_render_events_table,i=function(e,t){return this._table_view?n.call(this,e,t):a.call(this,e,t)};e._pre_render_events_line=e._pre_render_events_table=function(a,n){if(!this.config.all_timed||this._table_view&&"month"!=this._mode||"month"==this._mode&&!this.config.all_timed_month)return i.call(this,a,n);for(var r=0;rthis._min_date&&s.start_date+t}function u(t){var a=e.date.add(t,1,"day");return a=e.date.date_part(a)}function h(t,a){var n=e.date.date_part(new Date(t));return n.setHours(a),n}};var r=e.get_visible_events;e.get_visible_events=function(e){return this.config.all_timed&&this.config.multi_day?r.call(this,!1):r.call(this,e)},e.attachEvent("onBeforeViewChange",function(t,a,n,i){return e._allow_dnd="day"==n||"week"==n,!0}),e._is_main_area_event=function(e){return!!(e._timed||!0===this.config.all_timed||"short"==this.config.all_timed&&t(e))};var o=e.updateEvent;e.updateEvent=function(t){var a,n,i=e.getEvent(t);i&&(a=e.config.all_timed&&!(e.isOneDayEvent(e._events[t])||e.getState().drag_id))&&(n=e.config.update_render,e.config.update_render=!0),o.apply(e,arguments),i&&a&&(e.config.update_render=n)}},collision:function(e){var t,a;function n(a){e._get_section_view()&&a&&(t=e.getEvent(a)[e._get_section_property()])}e.config.collision_limit=1,e.attachEvent("onBeforeDrag",function(e){return n(e),!0}),e.attachEvent("onBeforeLightbox",function(t){var i=e.getEvent(t);return a=[i.start_date,i.end_date],n(t),!0}),e.attachEvent("onEventChanged",function(t){if(!t||!e.getEvent(t))return!0;var n=e.getEvent(t);if(!e.checkCollision(n)){if(!a)return!1;n.start_date=a[0],n.end_date=a[1],n._timed=this.isOneDayEvent(n)}return!0}),e.attachEvent("onBeforeEventChanged",function(t,a,n){return e.checkCollision(t)}),e.attachEvent("onEventAdded",function(t,a){e.checkCollision(a)||e.deleteEvent(t)}),e.attachEvent("onEventSave",function(t,a,n){if((a=e._lame_clone(a)).id=t,!a.start_date||!a.end_date){var i=e.getEvent(t);a.start_date=new Date(i.start_date),a.end_date=new Date(i.end_date)}return a.rec_type&&e._roll_back_dates(a),e.checkCollision(a)}),e._check_sections_collision=function(t,a){var n=e._get_section_property();return t[n]==a[n]&&t.id!=a.id},e.checkCollision=function(a){var n=[],i=e.config.collision_limit;if(a.rec_type)for(var r=e.getRecDates(a),o=0;o=i&&(h=!1)}else n.length>=i&&(h=!1);if(!h){var p=!e.callEvent("onEventCollision",[a,n]);return p||(a[u]=t||a[u]),p}return h}},container_autoresize:function(e){e.config.container_autoresize=!0,e.config.month_day_min_height=90,e.config.min_grid_size=25,e.config.min_map_size=400;var t=e._pre_render_events,a=!0,n=0,i=0;e._pre_render_events=function(r,o){if(!e.config.container_autoresize||!a)return t.apply(this,arguments);var s=this.xy.bar_height,_=this._colsS.heights,d=this._colsS.heights=[0,0,0,0,0,0,0],l=this._els.dhx_cal_data[0];if(r=this._table_view?this._pre_render_events_table(r,o):this._pre_render_events_line(r,o),this._table_view)if(o)this._colsS.heights=_;else{var c=l.firstChild;if(c.rows){for(var u=0;uthis._colsS.height-this.xy.month_head_height){var h=c.rows[u].cells,f=this._colsS.height-this.xy.month_head_height;1*this.config.max_month_events!==this.config.max_month_events||d[u]<=this.config.max_month_events?f=d[u]*s:(this.config.max_month_events+1)*s>this._colsS.height-this.xy.month_head_height&&(f=(this.config.max_month_events+1)*s);for(var p=0;pc&&(c=s.childNodes[u].offsetHeight);_=c}else _=Math.max(s.offsetHeight-1,s.scrollHeight);if("month"==l)e.config.month_day_min_height&&!t&&(_=s.getElementsByTagName("tr").length*e.config.month_day_min_height),t&&(s.style.height=_+"px");else if("year"==l)_=190*e.config.year_y;else if("agenda"==l){if(_=0,s.childNodes&&s.childNodes.length)for(var h=0;hv&&(v=f)}_=3*v}else if("map"==l){_=0;var x=s.querySelectorAll(".dhx_map_line");for(h=0;h0){var a=document.cookie.indexOf(t);if(-1!=a){a+=t.length;var n=document.cookie.indexOf(";",a);return-1==n&&(n=document.cookie.length),document.cookie.substring(a,n)}}return""}(_);if(d){e._min_date||(e._min_date=o),(d=unescape(d).split("@"))[0]=this._helpers.parseDate(d[0]);var l=this.isViewExists(d[1])?d[1]:r;return o=isNaN(+d[0])?o:d[0],window.setTimeout(function(){e.$destroyed||e.setCurrentView(o,l)},1),!1}}return!0}),e.attachEvent("onViewChange",function(a,n){!function(e,t,a){var n=e+"="+a+(t?"; "+t:"");document.cookie=n}(t(e),"expires=Sun, 31 Jan 9999 22:00:00 GMT",escape(this._helpers.formatDate(n)+"@"+a))});var n=e._load;e._load=function(){var t=arguments;if(e._date)n.apply(this,t);else{var a=this;window.setTimeout(function(){n.apply(a,t)},1)}}},daytimeline:function(e){Me("Day Timeline",e.assert)},drag_between:function(e){Me("Drag Between",e.assert)},editors:function(e){e.form_blocks.combo={render:function(e){e.cached_options||(e.cached_options={});var t="";return t+="
"},set_value:function(t,a,n,i){!function(){n();var a=e.attachEvent("onAfterLightbox",function(){n(),e.detachEvent(a)});function n(){if(t._combo&&t._combo.DOMParent){var e=t._combo;e.unload?e.unload():e.destructor&&e.destructor(),e.DOMParent=e.DOMelem=null}}}(),window.dhx_globalImgPath=i.image_path||"/",t._combo=new dhtmlXCombo(t,i.name,t.offsetWidth-8),i.onchange&&t._combo.attachEvent("onChange",i.onchange),i.options_height&&t._combo.setOptionHeight(i.options_height);var r=t._combo;if(r.enableFilteringMode(i.filtering,i.script_path||null,!!i.cache),i.script_path){var o=n[i.map_to];o?i.cached_options[o]?(r.addOption(o,i.cached_options[o]),r.disable(1),r.selectOption(0),r.disable(0)):e.ajax.get(i.script_path+"?id="+o+"&uid="+e.uid(),function(t){var a,n=t.xmlDoc.responseText;try{a=JSON.parse(n).options[0].text}catch(n){a=e.ajax.xpath("//option",t.xmlDoc)[0].childNodes[0].nodeValue}i.cached_options[o]=a,r.addOption(o,a),r.disable(1),r.selectOption(0),r.disable(0)}):r.setComboValue("")}else{for(var s=[],_=0;_";for(var n=0;n",t.vertical&&(a+="
")}return a+=""},set_value:function(e,t,a,n){for(var i=e.getElementsByTagName("input"),r=0;r":""},set_value:function(t,a,n,i){t=document.getElementById(i.id);var r=e.uid(),o=void 0!==i.checked_value?a==i.checked_value:!!a;t.className+=" dhx_cal_checkbox";var s="",_="";if(e.config.wide_form?(t.innerHTML=_,t.nextSibling.innerHTML=s):t.innerHTML=s+_,i.handler){var d=t.getElementsByTagName("input")[0];if(d.$_eventAttached)return;d.$_eventAttached=!0,e.event(d,"click",i.handler)}},get_value:function(e,t,a){var n=(e=document.getElementById(a.id)).getElementsByTagName("input")[0];return n||(n=e.nextSibling.getElementsByTagName("input")[0]),n.checked?a.checked_value||!0:a.unchecked_value||!1},focus:function(e){}}},expand:function(e){e.ext.fullscreen={toggleIcon:null},e.expand=function(){if(e.callEvent("onBeforeExpand",[])){var t=e._obj;do{t._position=t.style.position||"",t.style.position="static"}while((t=t.parentNode)&&t.style);(t=e._obj).style.position="absolute",t._width=t.style.width,t._height=t.style.height,t.style.width=t.style.height="100%",t.style.top=t.style.left="0px";var a=document.body;a.scrollTop=0,(a=a.parentNode)&&(a.scrollTop=0),document.body._overflow=document.body.style.overflow||"",document.body.style.overflow="hidden",e._maximize(),e.callEvent("onExpand",[])}},e.collapse=function(){if(e.callEvent("onBeforeCollapse",[])){var t=e._obj;do{t.style.position=t._position}while((t=t.parentNode)&&t.style);(t=e._obj).style.width=t._width,t.style.height=t._height,document.body.style.overflow=document.body._overflow,e._maximize(),e.callEvent("onCollapse",[])}},e.attachEvent("onTemplatesReady",function(){var t=document.createElement("div");t.className="dhx_expand_icon",e.ext.fullscreen.toggleIcon=t,e._obj.appendChild(t),e.event(t,"click",function(){e.expanded?e.collapse():e.expand()})}),e._maximize=function(){this.expanded=!this.expanded,e.ext.fullscreen.toggleIcon.style.backgroundPosition="0 "+(this.expanded?"0":"18")+"px";for(var t=["left","top"],a=0;a=96&&t.keyCode<=105&&(t.keyCode-=48);var a=String.fromCharCode(t.keyCode);return a&&(t.keyCode=a.toLowerCase().charCodeAt(0)),t},getHashFromEvent:function(e){return this.getHash(this.getCommandFromEvent(e))},getHash:function(e){var t=[];for(var a in e.modifiers)e.modifiers[a]&&t.push(a);return t.push(e.keyCode),t.join(this.junctionChar)},getExpressions:function(e){return e.split(this.junctionChar)},getWords:function(e){return e.split(this.combinationChar)},trim:function(e){return e.replace(/\s/g,"")},junctionChar:",",combinationChar:"+",commandKeys:{shift:16,alt:18,ctrl:17,meta:!0},specialKeys:{backspace:8,tab:9,enter:13,esc:27,space:32,up:38,down:40,left:37,right:39,home:36,end:35,pageup:33,pagedown:34,delete:46,insert:45,plus:107,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123}}}(e),function(e){e.$keyboardNavigation.EventHandler={_handlers:null,findHandler:function(t){this._handlers||(this._handlers={});var a=e.$keyboardNavigation.shortcuts.getHash(t);return this._handlers[a]},doAction:function(e,t){var a=this.findHandler(e);a&&(a.call(this,t),t.preventDefault?t.preventDefault():t.returnValue=!1)},bind:function(t,a){this._handlers||(this._handlers={});for(var n=e.$keyboardNavigation.shortcuts,i=n.parse(t),r=0;r=i.length-1?0:o+1])return n.focus(),a.preventDefault(),!0;return!1}}(e),function(e){e.$keyboardNavigation.marker={clear:function(){for(var t=e.$container.querySelectorAll(".dhx_focus_slot"),a=0;a=0;o--)if(i[o].offsetWidth)return i[o];return null},addDataAttributes:function(t,a,n,i){for(var r=e.date.date_to_str(e.config.api_date),o=r(a),s=r(n),_=0;_e._max_date.valueOf()&&(_=new Date(e._max_date)),!i._trace_x)return o;for(var d=0;dt))return o;var c=this.createElement(),u=e._timeline_getX({start_date:t},!1,i)-1,h=e._timeline_getX({start_date:a},!1,i)-1,f=i._section_height[n]-1||i.dy-1,p=0;e._isRender("cell")&&(p=l.offsetTop,u+=i.dx,h+=i.dx,l=e.$container.querySelector(".dhx_cal_data"));var v=Math.max(1,h-u-1);return c.style.cssText="height: "+f+"px; left: "+u+"px; width: "+v+"px; top: "+p+"px;",l&&(l.appendChild(c),o.push(c)),o},renderMonthCell:function(t){for(var a=e.$container.querySelectorAll(".dhx_month_head"),n=[],i=0;i1?i=e.locate_holder_day(t)+d:(i=d,_.size&&i>_.position+_.size&&(i=0))}if(!(o=e.locate_holder(i))||o.querySelector(".dhx_scale_hour"))return document.createElement("div");var l=Math.max(60*t.getHours()+t.getMinutes(),60*s.first_hour),c=Math.min(60*a.getHours()+a.getMinutes(),60*s.last_hour);if(!c&&e.date.day_start(new Date(a)).valueOf()>e.date.day_start(new Date(t)).valueOf()&&(c=60*s.last_hour),c<=l)return[];var u=this.createElement(),h=e.config.hour_size_px*s.last_hour+1;return u.style.top=Math.round((60*l*1e3-36e5*e.config.first_hour)*e.config.hour_size_px/36e5)%h+"px",u.style.lineHeight=u.style.height=Math.max(Math.round(60*(c-l)*1e3*e.config.hour_size_px/36e5)%h,1)+"px",u.style.width="100%",o.appendChild(u),r.push(u),r[0]}}}(e),function(e){e.$keyboardNavigation.SchedulerNode=function(){},e.$keyboardNavigation.SchedulerNode.prototype=e._compose(e.$keyboardNavigation.EventHandler,{getDefaultNode:function(){var t=new e.$keyboardNavigation.TimeSlot;return t.isValid()||(t=t.fallback()),t},_modes:{month:"month",year:"year",dayColumns:"dayColumns",timeline:"timeline",units:"units",weekAgenda:"weekAgenda",list:"list"},getMode:function(){var t=e.getState().mode;return e.matrix&&e.matrix[t]?this._modes.timeline:e._props&&e._props[t]?this._modes.units:"month"==t?this._modes.month:"year"==t?this._modes.year:"week_agenda"==t?this._modes.weekAgenda:"map"==t||"agenda"==t||e._grid&&e["grid_"+t]?this._modes.list:this._modes.dayColumns},focus:function(){e.focus()},blur:function(){},disable:function(){e.$container.setAttribute("tabindex","0")},enable:function(){e.$container&&e.$container.removeAttribute("tabindex")},isEnabled:function(){return e.$container.hasAttribute("tabindex")},_compareEvents:function(e,t){return e.start_date.valueOf()==t.start_date.valueOf()?e.id>t.id?1:-1:e.start_date.valueOf()>t.start_date.valueOf()?1:-1},_pickEvent:function(t,a,n,i){var r=e.getState();t=new Date(Math.max(r.min_date.valueOf(),t.valueOf())),a=new Date(Math.min(r.max_date.valueOf(),a.valueOf()));var o=e.getEvents(t,a);o.sort(this._compareEvents),i&&(o=o.reverse());for(var s=!!n,_=0;_=this.getNodes().length&&(t=0),this.moveTo(new e.$keyboardNavigation.HeaderCell(t))},down:function(){this.moveTo(new e.$keyboardNavigation.TimeSlot)},enter:function(){var e=this.getNode();e&&e.click()}}}),e.$keyboardNavigation.HeaderCell.prototype.bindAll(e.$keyboardNavigation.HeaderCell.prototype.keys)}(e),function(e){e.$keyboardNavigation.Event=function(t){if(this.eventId=null,e.getEvent(t)){var a=e.getEvent(t);this.start=new Date(a.start_date),this.end=new Date(a.end_date),this.section=this._getSection(a),this.eventId=t}},e.$keyboardNavigation.Event.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{_getNodes:function(){return Array.prototype.slice.call(e.$container.querySelectorAll("["+e.config.event_attribute+"]"))},_modes:e.$keyboardNavigation.SchedulerNode.prototype._modes,getMode:e.$keyboardNavigation.SchedulerNode.prototype.getMode,_handlers:null,isValid:function(){return!(!e.getEvent(this.eventId)||!this.getNode())},fallback:function(){var t=this._getNodes()[0],a=null;if(t&&e._locate_event(t)){var n=e._locate_event(t);a=new e.$keyboardNavigation.Event(n)}else a=new e.$keyboardNavigation.TimeSlot;return a},isScrolledIntoView:function(t){var a=t.getBoundingClientRect(),n=e.$container.querySelector(".dhx_cal_data").getBoundingClientRect();return!(a.bottomn.bottom)},getNode:function(){var t="["+e.config.event_attribute+"='"+this.eventId+"']",a=e.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);if(a)return a;if(e.isMultisectionEvent&&e.isMultisectionEvent(e.getEvent(this.eventId))){for(var n=e.$container.querySelectorAll(t),i=0;ia.max_date.valueOf()||t.end_date.valueOf()<=a.min_date.valueOf())&&e.setCurrentView(t.start_date);var n=this.getNode();this.isScrolledIntoView(n)?e.$keyboardNavigation.dispatcher.keepScrollPosition(function(){e.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)}.bind(this)):e.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)},blur:function(){e.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this)},_getSection:function(t){var a=null,n=e.getState().mode;return e.matrix&&e.matrix[n]?a=t[e.matrix[e.getState().mode].y_property]:e._props&&e._props[n]&&(a=t[e._props[n].map_to]),a},_moveToSlot:function(t){var a=e.getEvent(this.eventId);if(a){var n=this._getSection(a),i=new e.$keyboardNavigation.TimeSlot(a.start_date,null,n);this.moveTo(i.nextSlot(i,t))}else this.moveTo(new e.$keyboardNavigation.TimeSlot)},keys:{left:function(){this._moveToSlot("left")},right:function(){this._moveToSlot("right")},down:function(){this.getMode()==this._modes.list?e.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler():this._moveToSlot("down")},space:function(){var t=this.getNode();t&&t.click?t.click():this.moveTo(new e.$keyboardNavigation.TimeSlot)},up:function(){this.getMode()==this._modes.list?e.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler():this._moveToSlot("up")},delete:function(){e.getEvent(this.eventId)?e._click.buttons.delete(this.eventId):this.moveTo(new e.$keyboardNavigation.TimeSlot)},enter:function(){e.getEvent(this.eventId)?e.showLightbox(this.eventId):this.moveTo(new e.$keyboardNavigation.TimeSlot)}}}),e.$keyboardNavigation.Event.prototype.bindAll(e.$keyboardNavigation.Event.prototype.keys)}(e),function(e){e.$keyboardNavigation.TimeSlot=function(t,a,n,i){var r=e.getState(),o=e.matrix&&e.matrix[r.mode];t||(t=this.getDefaultDate()),a||(a=o?e.date.add(t,o.x_step,o.x_unit):e.date.add(t,e.config.key_nav_step,"minute")),this.section=n||this._getDefaultSection(),this.start_date=new Date(t),this.end_date=new Date(a),this.movingDate=i||null},e.$keyboardNavigation.TimeSlot.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{_handlers:null,getDefaultDate:function(){var t,a=e.getState(),n=new Date(a.date);n.setSeconds(0),n.setMilliseconds(0);var i=new Date;i.setSeconds(0),i.setMilliseconds(0);var r=e.matrix&&e.matrix[a.mode],o=!1;if(n.valueOf()===i.valueOf()&&(o=!0),r)o?("day"===r.x_unit?(i.setHours(0),i.setMinutes(0)):"hour"===r.x_unit&&i.setMinutes(0),t=i):t=e.date[r.name+"_start"](new Date(a.date)),t=this.findVisibleColumn(t);else if(t=new Date(e.getState().min_date),o&&(t=i),t=this.findVisibleColumn(t),o||t.setHours(e.config.first_hour),!e._table_view){var s=e.$container.querySelector(".dhx_cal_data");s.scrollTop&&t.setHours(e.config.first_hour+Math.ceil(s.scrollTop/e.config.hour_size_px))}return t},clone:function(t){return new e.$keyboardNavigation.TimeSlot(t.start_date,t.end_date,t.section,t.movingDate)},_getMultisectionView:function(){var t,a=e.getState();return e._props&&e._props[a.mode]?t=e._props[a.mode]:e.matrix&&e.matrix[a.mode]&&(t=e.matrix[a.mode]),t},_getDefaultSection:function(){var e=null;return this._getMultisectionView()&&!e&&(e=this._getNextSection()),e},_getNextSection:function(e,t){var a=this._getMultisectionView(),n=a.order[e],i=n;(i=void 0!==n?n+t:a.size&&a.position?a.position:0)<0&&(i=0);var r=a.options||a.y_unit;return i>=r.length&&(i=r.length-1),r[i]?r[i].key:null},isValid:function(){var t=e.getState();if(this.start_date.valueOf()=t.max_date.valueOf())return!1;if(!this.isVisible(this.start_date,this.end_date))return!1;var a=this._getMultisectionView();return!a||void 0!==a.order[this.section]},fallback:function(){var t=new e.$keyboardNavigation.TimeSlot;return t.isValid()?t:new e.$keyboardNavigation.DataArea},getNodes:function(){return Array.prototype.slice.call(e.$container.querySelectorAll(".dhx_focus_slot"))},getNode:function(){return this.getNodes()[0]},focus:function(){this.section&&e.getView()&&e.getView().smart_rendering&&e.getView().scrollTo&&!e.$container.querySelector('[data-section-id="'.concat(this.section,'"]'))&&e.getView().scrollTo({section:this.section}),e.$keyboardNavigation.marker.render(this.start_date,this.end_date,this.section),e.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this),e.$keyboardNavigation._pasteDate=this.start_date,e.$keyboardNavigation._pasteSection=this.section},blur:function(){e.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this),e.$keyboardNavigation.marker.clear()},_modes:e.$keyboardNavigation.SchedulerNode.prototype._modes,_getMode:e.$keyboardNavigation.SchedulerNode.prototype.getMode,addMonthDate:function(t,a,n){var i;switch(a){case"up":i=e.date.add(t,-1,"week");break;case"down":i=e.date.add(t,1,"week");break;case"left":i=e.date.day_start(e.date.add(t,-1,"day")),i=this.findVisibleColumn(i,-1);break;case"right":i=e.date.day_start(e.date.add(t,1,"day")),i=this.findVisibleColumn(i,1);break;default:i=e.date.day_start(new Date(t))}var r=e.getState();return(t.valueOf()=r.max_date.valueOf())&&(i=new Date(r.min_date)),i},nextMonthSlot:function(t,a,n){var i,r;return(i=this.addMonthDate(t.start_date,a,n)).setHours(e.config.first_hour),(r=new Date(i)).setHours(e.config.last_hour),{start_date:i,end_date:r}},_alignTimeSlot:function(t,a,n,i){for(var r=new Date(a);r.valueOf()t.valueOf()&&(r=e.date.add(r,-i,n)),r},nextTimelineSlot:function(t,a,n){var i=e.getState(),r=e.matrix[i.mode],o=this._alignTimeSlot(t.start_date,e.date[r.name+"_start"](new Date(t.start_date)),r.x_unit,r.x_step),s=this._alignTimeSlot(t.end_date,e.date[r.name+"_start"](new Date(t.end_date)),r.x_unit,r.x_step);s.valueOf()<=o.valueOf()&&(s=e.date.add(o,r.x_step,r.x_unit));var _=this.clone(t);switch(_.start_date=o,_.end_date=s,_.section=t.section||this._getNextSection(),a){case"up":_.section=this._getNextSection(t.section,-1);break;case"down":_.section=this._getNextSection(t.section,1);break;case"left":_.start_date=this.findVisibleColumn(e.date.add(_.start_date,-r.x_step,r.x_unit),-1),_.end_date=e.date.add(_.start_date,r.x_step,r.x_unit);break;case"right":_.start_date=this.findVisibleColumn(e.date.add(_.start_date,r.x_step,r.x_unit),1),_.end_date=e.date.add(_.start_date,r.x_step,r.x_unit)}return(_.start_date.valueOf()=i.max_date.valueOf())&&(n&&_.start_date.valueOf()>=i.max_date.valueOf()?_.start_date=new Date(i.max_date):(_.start_date=e.date[i.mode+"_start"](e.date.add(i.date,"left"==a?-1:1,i.mode)),_.end_date=e.date.add(_.start_date,r.x_step,r.x_unit))),_},nextUnitsSlot:function(t,a,n){var i=this.clone(t);i.section=t.section||this._getNextSection();var r=t.section||this._getNextSection(),o=e.getState(),s=e._props[o.mode];switch(a){case"left":r=this._getNextSection(t.section,-1);var _=s.size?s.size-1:s.options.length;s.days>1&&s.order[r]==_-1&&e.date.add(t.start_date,-1,"day").valueOf()>=o.min_date.valueOf()&&(i=this.nextDaySlot(t,a,n));break;case"right":r=this._getNextSection(t.section,1),s.days>1&&!s.order[r]&&e.date.add(t.start_date,1,"day").valueOf()=r||!a&&!n&&(!i&&24==o||i==o)},isInVisibleDayTime:function(e,t){return this.isBeforeLastHour(e,t)&&this.isAfterFirstHour(e,t)},nextDaySlot:function(t,a,n){var i,r,o=e.config.key_nav_step,s=this._alignTimeSlot(t.start_date,e.date.day_start(new Date(t.start_date)),"minute",o),_=t.start_date;switch(a){case"up":if(i=e.date.add(s,-o,"minute"),!this.isInVisibleDayTime(i,!0)&&(!n||this.isInVisibleDayTime(_,!0))){var d=!0;n&&e.date.date_part(new Date(i)).valueOf()!=e.date.date_part(new Date(_)).valueOf()&&(d=!1),d&&(i=this.findVisibleColumn(e.date.add(t.start_date,-1,"day"),-1)),i.setHours(e.config.last_hour),i.setMinutes(0),i=e.date.add(i,-o,"minute")}r=e.date.add(i,o,"minute");break;case"down":i=e.date.add(s,o,"minute");var l=n?i:e.date.add(i,o,"minute");this.isInVisibleDayTime(l,!1)||n&&!this.isInVisibleDayTime(_,!1)||(n?(d=!0,e.date.date_part(new Date(_)).valueOf()==_.valueOf()&&(d=!1),d&&(i=this.findVisibleColumn(e.date.add(t.start_date,1,"day"),1)),i.setHours(e.config.first_hour),i.setMinutes(0),i=e.date.add(i,o,"minute")):((i=this.findVisibleColumn(e.date.add(t.start_date,1,"day"),1)).setHours(e.config.first_hour),i.setMinutes(0))),r=e.date.add(i,o,"minute");break;case"left":i=this._moveDate(t.start_date,-1),r=this._moveDate(t.end_date,-1);break;case"right":i=this._moveDate(t.start_date,1),r=this._moveDate(t.end_date,1);break;default:i=s,r=e.date.add(i,o,"minute")}return{start_date:i,end_date:r}},nextWeekAgendaSlot:function(t,a){var n,i,r=e.getState();switch(a){case"down":case"left":n=e.date.day_start(e.date.add(t.start_date,-1,"day")),n=this.findVisibleColumn(n,-1);break;case"up":case"right":n=e.date.day_start(e.date.add(t.start_date,1,"day")),n=this.findVisibleColumn(n,1);break;default:n=e.date.day_start(t.start_date)}return(t.start_date.valueOf()=r.max_date.valueOf())&&(n=new Date(r.min_date)),(i=new Date(n)).setHours(e.config.last_hour),{start_date:n,end_date:i}},nextAgendaSlot:function(e,t){return{start_date:e.start_date,end_date:e.end_date}},isDateVisible:function(t){if(!e._ignores_detected)return!0;var a,n=e.matrix&&e.matrix[e.getState().mode];return a=n?e._get_date_index(n,t):e.locate_holder_day(t),!e._ignores[a]},findVisibleColumn:function(t,a){var n=t;a=a||1;for(var i=e.getState();!this.isDateVisible(n)&&(a>0&&n.valueOf()<=i.max_date.valueOf()||a<0&&n.valueOf()>=i.min_date.valueOf());)n=this.nextDateColumn(n,a);return n},nextDateColumn:function(t,a){a=a||1;var n=e.matrix&&e.matrix[e.getState().mode];return n?e.date.add(t,a*n.x_step,n.x_unit):e.date.day_start(e.date.add(t,a,"day"))},isVisible:function(t,a){if(!e._ignores_detected)return!0;for(var n=new Date(t);n.valueOf()=r.end_date.valueOf()&&(r=this.nextSlot(r,a,n)),e.$keyboardNavigation.TimeSlot.prototype.clone(r)},extendSlot:function(t,a){var n;switch(this._getMode()){case this._modes.units:n="left"==a||"right"==a?this.nextUnitsSlot(t,a):this.extendUnitsSlot(t,a);break;case this._modes.timeline:n="down"==a||"up"==a?this.nextTimelineSlot(t,a):this.extendTimelineSlot(t,a);break;case this._modes.year:case this._modes.month:n=this.extendMonthSlot(t,a);break;case this._modes.dayColumns:n=this.extendDaySlot(t,a);break;case this._modes.weekAgenda:n=this.extendWeekAgendaSlot(t,a);break;default:n=t}var i=e.getState();return n.start_date.valueOf()i.max_date.valueOf()&&(n.end_date=this.findVisibleColumn(i.max_date,-1)),e.$keyboardNavigation.TimeSlot.prototype.clone(n)},extendTimelineSlot:function(e,t){return this.extendGenericSlot({left:"start_date",right:"end_date"},e,t,"timeline")},extendWeekAgendaSlot:function(e,t){return this.extendGenericSlot({left:"start_date",right:"end_date"},e,t,"weekAgenda")},extendGenericSlot:function(t,a,n,i){var r,o=a.movingDate;if(o||(o=t[n]),!o||!t[n])return a;if(!n)return e.$keyboardNavigation.TimeSlot.prototype.clone(a);(r=this.nextSlot({start_date:a[o],section:a.section},n,i,!0)).start_date.valueOf()==a.start_date.valueOf()&&(r=this.nextSlot({start_date:r.start_date,section:r.section},n,i,!0)),r.movingDate=o;var s=this.extendSlotDates(a,r,r.movingDate);return s.end_date.valueOf()<=s.start_date.valueOf()&&(r.movingDate="end_date"==r.movingDate?"start_date":"end_date"),s=this.extendSlotDates(a,r,r.movingDate),r.start_date=s.start_date,r.end_date=s.end_date,r},extendSlotDates:function(e,t,a){var n={start_date:null,end_date:null};return"start_date"==a?(n.start_date=t.start_date,n.end_date=e.end_date):(n.start_date=e.start_date,n.end_date=t.start_date),n},extendMonthSlot:function(t,a){return(t=this.extendGenericSlot({up:"start_date",down:"end_date",left:"start_date",right:"end_date"},t,a,"month")).start_date.setHours(e.config.first_hour),t.end_date=e.date.add(t.end_date,-1,"day"),t.end_date.setHours(e.config.last_hour),t},extendUnitsSlot:function(e,t){var a;switch(t){case"down":case"up":a=this.extendDaySlot(e,t);break;default:a=e}return a.section=e.section,a},extendDaySlot:function(e,t){return this.extendGenericSlot({up:"start_date",down:"end_date",left:"start_date",right:"end_date"},e,t,"dayColumns")},scrollSlot:function(t){var a=e.getState(),n=this.nextSlot(this,t);(n.start_date.valueOf()=a.max_date.valueOf())&&e.setCurrentView(new Date(n.start_date)),this.moveTo(n)},keys:{left:function(){this.scrollSlot("left")},right:function(){this.scrollSlot("right")},down:function(){this._getMode()==this._modes.list?e.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler():this.scrollSlot("down")},up:function(){this._getMode()==this._modes.list?e.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler():this.scrollSlot("up")},"shift+down":function(){this.moveTo(this.extendSlot(this,"down"))},"shift+up":function(){this.moveTo(this.extendSlot(this,"up"))},"shift+right":function(){this.moveTo(this.extendSlot(this,"right"))},"shift+left":function(){this.moveTo(this.extendSlot(this,"left"))},enter:function(){var t={start_date:new Date(this.start_date),end_date:new Date(this.end_date)},a=e.getState().mode;e.matrix&&e.matrix[a]?t[e.matrix[e.getState().mode].y_property]=this.section:e._props&&e._props[a]&&(t[e._props[a].map_to]=this.section),e.addEventNow(t)}}}),e.$keyboardNavigation.TimeSlot.prototype.bindAll(e.$keyboardNavigation.TimeSlot.prototype.keys)}(e),function(e){e.$keyboardNavigation.MinicalButton=function(e,t){this.container=e,this.index=t||0},e.$keyboardNavigation.MinicalButton.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{isValid:function(){return!!this.container.offsetWidth},fallback:function(){var t=new e.$keyboardNavigation.TimeSlot;return t.isValid()?t:new e.$keyboardNavigation.DataArea},focus:function(){e.$keyboardNavigation.dispatcher.globalNode.disable(),this.container.removeAttribute("tabindex"),e.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)},blur:function(){this.container.setAttribute("tabindex","0"),e.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this)},getNode:function(){return this.index?this.container.querySelector(".dhx_cal_next_button"):this.container.querySelector(".dhx_cal_prev_button")},keys:{right:function(t){this.moveTo(new e.$keyboardNavigation.MinicalButton(this.container,this.index?0:1))},left:function(t){this.moveTo(new e.$keyboardNavigation.MinicalButton(this.container,this.index?0:1))},down:function(){var t=new e.$keyboardNavigation.MinicalCell(this.container,0,0);t&&!t.isValid()&&(t=t.fallback()),this.moveTo(t)},enter:function(e){this.getNode().click()}}}),e.$keyboardNavigation.MinicalButton.prototype.bindAll(e.$keyboardNavigation.MinicalButton.prototype.keys)}(e),function(e){e.$keyboardNavigation.MinicalCell=function(e,t,a){this.container=e,this.row=t||0,this.col=a||0},e.$keyboardNavigation.MinicalCell.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{isValid:function(){var e=this._getGrid();return!(!e[this.row]||!e[this.row][this.col])},fallback:function(){var t=this.row,a=this.col,n=this._getGrid();n[t]||(t=0);var i=!0;if(t>n.length/2&&(i=!1),!n[t]){var r=new e.$keyboardNavigation.TimeSlot;return r.isValid()?r:new e.$keyboardNavigation.DataArea}if(i){for(var o=a;n[t]&&o-1||_.indexOf("dhx_before")>-1||_.indexOf("dhx_scale_ignore")>-1)&&(s=!1),a[n][r]=s}}return a},keys:{right:function(t){var a=this._getGrid(),n=this.row,i=this.col+1;a[n]&&a[n][i]||(a[n+1]?(n+=1,i=0):i=this.col);var r=new e.$keyboardNavigation.MinicalCell(this.container,n,i);r.isValid()||(r=r.fallback()),this.moveTo(r)},left:function(t){var a=this._getGrid(),n=this.row,i=this.col-1;a[n]&&a[n][i]||(i=a[n-1]?a[n-=1].length-1:this.col);var r=new e.$keyboardNavigation.MinicalCell(this.container,n,i);r.isValid()||(r=r.fallback()),this.moveTo(r)},down:function(){var t=this._getGrid(),a=this.row+1,n=this.col;t[a]&&t[a][n]||(a=this.row);var i=new e.$keyboardNavigation.MinicalCell(this.container,a,n);i.isValid()||(i=i.fallback()),this.moveTo(i)},up:function(){var t=this._getGrid(),a=this.row-1,n=this.col;if(t[a]&&t[a][n]){var i=new e.$keyboardNavigation.MinicalCell(this.container,a,n);i.isValid()||(i=i.fallback()),this.moveTo(i)}else{var r=0;this.col>t[this.row].length/2&&(r=1),this.moveTo(new e.$keyboardNavigation.MinicalButton(this.container,r))}},enter:function(e){this.getNode().querySelector(".dhx_month_head").click()}}}),e.$keyboardNavigation.MinicalCell.prototype.bindAll(e.$keyboardNavigation.MinicalCell.prototype.keys)}(e),function(e){e.$keyboardNavigation.DataArea=function(e){this.index=e||0},e.$keyboardNavigation.DataArea.prototype=e._compose(e.$keyboardNavigation.KeyNavNode,{getNode:function(t){return e.$container.querySelector(".dhx_cal_data")},_handlers:null,isValid:function(){return!0},fallback:function(){return this},keys:{"up,down,right,left":function(){this.moveTo(new e.$keyboardNavigation.TimeSlot)}}}),e.$keyboardNavigation.DataArea.prototype.bindAll(e.$keyboardNavigation.DataArea.prototype.keys)}(e),Oe(e),function(e){e.$keyboardNavigation.dispatcher={isActive:!1,activeNode:null,globalNode:new e.$keyboardNavigation.SchedulerNode,keepScrollPosition:function(t){var a,n,i=e.$container.querySelector(".dhx_timeline_scrollable_data");i||(i=e.$container.querySelector(".dhx_cal_data")),i&&(a=i.scrollTop,n=i.scrollLeft),t(),i&&(i.scrollTop=a,i.scrollLeft=n)},enable:function(){if(e.$container){this.isActive=!0;var t=this;this.keepScrollPosition(function(){t.globalNode.enable(),t.setActiveNode(t.getActiveNode())})}},disable:function(){this.isActive=!1,this.globalNode.disable()},isEnabled:function(){return!!this.isActive},getDefaultNode:function(){return this.globalNode.getDefaultNode()},setDefaultNode:function(){this.setActiveNode(this.getDefaultNode())},getActiveNode:function(){var e=this.activeNode;return e&&!e.isValid()&&(e=e.fallback()),e},focusGlobalNode:function(){this.blurNode(this.globalNode),this.focusNode(this.globalNode)},setActiveNode:function(e){e&&e.isValid()&&(this.activeNode&&this.activeNode.compareTo(e)||this.isEnabled()&&(this.blurNode(this.activeNode),this.activeNode=e,this.focusNode(this.activeNode)))},focusNode:function(t){t&&t.focus&&(t.focus(),t.getNode&&document.activeElement!=t.getNode()&&this.setActiveNode(new e.$keyboardNavigation.DataArea))},blurNode:function(e){e&&e.blur&&e.blur()},getInlineEditor:function(t){var a=e.$container.querySelector(".dhx_cal_editor["+e.config.event_attribute+"='"+t+"'] textarea");return a&&a.offsetWidth?a:null},keyDownHandler:function(t){if(!t.defaultPrevented){var a=this.getActiveNode();if((!e.$keyboardNavigation.isModal()||a&&a.container&&e.utils.dom.locateCss({target:a.container},"dhx_minical_popup",!1))&&(!e.getState().editor_id||!this.getInlineEditor(e.getState().editor_id))&&this.isEnabled()){t=t||window.event;var n=this.globalNode,i=e.$keyboardNavigation.shortcuts.getCommandFromEvent(t);a?a.findHandler(i)?a.doAction(i,t):n.findHandler(i)&&n.doAction(i,t):this.setDefaultNode()}}},_timeout:null,delay:function(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t||1)}}}(e),He(e),function(){je(e),function(e){e.$keyboardNavigation._minicalendars=[],e.$keyboardNavigation.isMinical=function(t){for(var a=e.$keyboardNavigation._minicalendars,n=0;n=e.config.collision_limit}),e.addEvent=function(t,a,n,i,r){var o=t;1!=arguments.length&&((o=r||{}).start_date=t,o.end_date=a,o.text=n,o.id=i,o.layer=this.defaultLayer),o.id=o.id||e.uid(),o.text=o.text||"","string"==typeof o.start_date&&(o.start_date=this.templates.api_date(o.start_date)),"string"==typeof o.end_date&&(o.end_date=this.templates.api_date(o.end_date)),o._timed=this.isOneDayEvent(o);var s=!this._events[o.id];this._events[o.id]=o,this.event_updated(o),this._loading||this.callEvent(s?"onEventAdded":"onEventChanged",[o.id,o])},this._evs_layer={};for(var t=0;to.getHours()&&(o.setHours(s),t=o.valueOf()),a=t+r}i.start_date=i.start_date||o,i.end_date=i.end_date||new Date(a),i.text=i.text||this.locale.labels.new_event,i.id=this._drag_id=this.uid(),i.layer=this.defaultLayer,this._drag_mode="new-size",this._loading=!0,this.addEvent(i),this.callEvent("onEventCreated",[this._drag_id,n]),this._loading=!1,this._drag_event={},this._on_mouse_up(n)},e._t_render_view_data=function(e){if(this.config.multi_day&&!this._table_view){for(var t=[],a=[],n=0;n';return x+='
 
',x+='
'+s+"
",x+='
'+_+"
",x+='',c.innerHTML=x,c.style.zIndex=100,c.firstChild},e.render_event_bar=function(t){var a=this._els.dhx_cal_data[0],n=this._colsS[t._sday],i=this._colsS[t._eday];i==n&&(i=this._colsS[t._eday+1]);var r=this.xy.bar_height,o=this._colsS.heights[t._sweek]+(this._colsS.height?this.xy.month_scale_height+2:2)+t._sorder*r,s=document.createElement("div"),_=t._timed?"dhx_cal_event_clear":"dhx_cal_event_line",d=e.templates["event_class_"+t.layer]?e.templates["event_class_"+t.layer](t.start_date,t.end_date,t):e.templates.event_class(t.start_date,t.end_date,t);d&&(_=_+" "+d);var l='
';t._timed&&(l+=e.templates["event_bar_date_"+t.layer]?e.templates["event_bar_date_"+t.layer](t.start_date,t.end_date,t):e.templates.event_bar_date(t.start_date,t.end_date,t)),l+=e.templates["event_bar_text_"+t.layer]?e.templates["event_bar_text_"+t.layer](t.start_date,t.end_date,t):e.templates.event_bar_text(t.start_date,t.end_date,t)+"
)",l+="",s.innerHTML=l,this._rendered.push(s.firstChild),a.appendChild(s.firstChild)},e.render_event=function(t){var a=e.xy.menu_width;if(e.getLayer(t.layer).noMenu&&(a=0),!(t._sday<0)){var n=e.locate_holder(t._sday);if(n){var i=60*t.start_date.getHours()+t.start_date.getMinutes(),r=60*t.end_date.getHours()+t.end_date.getMinutes()||60*e.config.last_hour,o=Math.round((60*i*1e3-60*this.config.first_hour*60*1e3)*this.config.hour_size_px/36e5)%(24*this.config.hour_size_px)+1,s=Math.max(e.xy.min_event_height,(r-i)*this.config.hour_size_px/60)+1,_=Math.floor((n.clientWidth-a)/t._count),d=t._sorder*_+1;t._inner||(_*=t._count-t._sorder);var l=this._render_v_bar(t.id,a+d,o,_,s,t._text_style,e.templates.event_header(t.start_date,t.end_date,t),e.templates.event_text(t.start_date,t.end_date,t));if(this._rendered.push(l),n.appendChild(l),d=d+parseInt(n.style.left,10)+a,o+=this._dy_shift,l.style.zIndex=this._layers_zindex[t.layer],this._edit_id==t.id){l.style.zIndex=parseInt(l.style.zIndex)+1;var c=l.style.zIndex;_=Math.max(_-4,e.xy.editor_width),(l=document.createElement("div")).setAttribute("event_id",t.id),l.setAttribute(this.config.event_attribute,t.id),this.set_xy(l,_,s-20,d,o+14),l.className="dhx_cal_editor",l.style.zIndex=c;var u=document.createElement("div");this.set_xy(u,_-6,s-26),u.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;",u.style.zIndex=c,l.appendChild(u),this._els.dhx_cal_data[0].appendChild(l),this._rendered.push(l),u.innerHTML="",this._quirks7&&(u.firstChild.style.height=s-12+"px"),this._editor=u.firstChild,this._editor.addEventListener("keypress",function(t){if(t.shiftKey)return!0;var a=t.keyCode;a==e.keys.edit_save&&e.editStop(!0),a==e.keys.edit_cancel&&e.editStop(!1)}),this._editor.addEventListener("selectstart",function(e){return e.cancelBubble=!0,!0}),u.firstChild.focus(),this._els.dhx_cal_data[0].scrollLeft=0,u.firstChild.select()}if(this._select_id==t.id){l.style.zIndex=parseInt(l.style.zIndex)+1;for(var h=this.config["icons_"+(this._edit_id==t.id?"edit":"select")],f="",p=0;p";var v=this._render_v_bar(t.id,d-a+1,o,a,20*h.length+26,"","
",f,!0);v.style.left=d-a+1,v.style.zIndex=l.style.zIndex,this._els.dhx_cal_data[0].appendChild(v),this._rendered.push(v)}}}},e.filter_agenda=function(t,a){var n=e.getLayer(a.layer);return n&&n.visible}})},limit:function(e){e.config.limit_start=null,e.config.limit_end=null,e.config.limit_view=!1,e.config.check_limits=!0,e.config.mark_now=!0,e.config.display_marked_timespans=!0,e.config.overwrite_marked_timespans=!0,e._temp_limit_scope=function(){var t=null,a=function(e,t,a){var n="object"==$e(e)?e:{days:e};return n.type="dhx_time_block",n.css="",t&&(a&&(n.sections=a),n=function(e,t,a){return t instanceof Date&&a instanceof Date?(e.start_date=t,e.end_date=a):(e.days=t,e.zones=a),e}(n,e,t)),n};e.blockTime=function(t,n,i){var r=a(t,n,i);return e.addMarkedTimespan(r)},e.unblockTime=function(t,n,i){var r=a(t,n=n||"fullday",i);return e.deleteMarkedTimespan(r)},e.attachEvent("onBeforeViewChange",function(t,a,n,i){function r(t,a){var n=e.config.limit_start,i=e.config.limit_end,r=e.date.add(t,1,a);return t.valueOf()>i.valueOf()||r<=n.valueOf()}return!e.config.limit_view||!r(i=i||a,n=n||t)||a.valueOf()==i.valueOf()||(setTimeout(function(){if(e.$destroyed)return!0;var t=r(a,n)?e.config.limit_start:a;e.setCurrentView(r(t,n)?null:t,n)},1),!1)}),e.checkInMarkedTimespan=function(t,a,n){a=a||"default";for(var r=!0,o=new Date(t.start_date.valueOf()),s=e.date.add(o,1,"day"),_=e._marked_timespans;os||t.end_date.getDate()!=o.getDate()?1440:e._get_zone_minutes(t.end_date),f=l[c],p=l[c+1];if(fu&&!(r="function"==typeof n&&n(t,u,h,f,p)))break}}return!r};var n=e.checkLimitViolation=function(t){if(!t)return!0;if(!e.config.check_limits)return!0;var a=e,n=a.config,i=[];if(t.rec_type)for(var r=e.getRecDates(t),o=0;o=n.limit_start.valueOf()&&s.end_date.valueOf()<=n.limit_end.valueOf())&&(l=!e.checkInMarkedTimespan(s,"dhx_time_block",function(e,t,n,i,r){var o=!0;return t<=r&&t>=i&&((1440==r||n<=r)&&(o=!1),e._timed&&a._drag_id&&"new-size"==a._drag_mode?(e.start_date.setHours(0),e.start_date.setMinutes(r)):o=!1),(n>=i&&n<=r||tr)&&(e._timed&&a._drag_id&&"new-size"==a._drag_mode?(e.end_date.setHours(0),e.end_date.setMinutes(i)):o=!1),o})),l||(l=a.checkEvent("onLimitViolation")?a.callEvent("onLimitViolation",[s.id,s]):l),_=_&&l}return _||(a._drag_id=null,a._drag_mode=null),_};function i(t,a,n,i,r){var o=e,s=[],_={_props:"map_to",matrix:"y_property"};for(var d in _){var l=_[d];if(o[d])for(var c in o[d]){var u=o[d][c][l];t[u]&&(s=o._add_timespan_zones(s,e._get_blocked_zones(a[c],t[u],n,i,r)))}}return s=o._add_timespan_zones(s,e._get_blocked_zones(a,"global",n,i,r))}e._get_blocked_zones=function(e,t,a,n,i){var r=[];if(e&&e[t])for(var o=e[t],s=this._get_relevant_blocked_zones(a,n,o,i),_=0;_=e.config.limit_end.valueOf()&&(a.start_date=this.date.add(e.config.limit_end,-1,"day")),a.end_date=e.config.limit_end.valueOf()&&(a.end_date=this.date.add(e.config.limit_end,-1,"day")),a.start_date.valueOf()>=a.end_date.valueOf()&&(a.end_date=this.date.add(a.start_date,this.config.event_duration||this.config.time_step,"minute")),a._timed=this.isOneDayEvent(a)),!0}),e.attachEvent("onEventChanged",function(a){if(!a)return!0;var i=e.getEvent(a);if(!n(i)){if(!t)return!1;i.start_date=t[0],i.end_date=t[1],i._timed=this.isOneDayEvent(i)}return!0}),e.attachEvent("onBeforeEventChanged",function(e,t,a){return n(e)}),e.attachEvent("onBeforeEventCreated",function(t){var a=e.getActionData(t).date,i={_timed:!0,start_date:a,end_date:e.date.add(a,e.config.time_step,"minute")};return n(i)}),e.attachEvent("onViewChange",function(){e._mark_now()}),e.attachEvent("onAfterSchedulerResize",function(){return window.setTimeout(function(){if(e.$destroyed)return!0;e._mark_now()},1),!0}),e.attachEvent("onTemplatesReady",function(){e._mark_now_timer=window.setInterval(function(){e._is_initialized()&&e._mark_now()},6e4)}),e._mark_now=function(t){this._els.dhx_now_time||(this._els.dhx_now_time=[]);var a=e._currentDate(),n=this.config;if(e._remove_mark_now(),!t&&n.mark_now&&athis._min_date&&a.getHours()>=n.first_hour&&a.getHours()1?(s.size&&s.options.length&&(t=(s.position+t)/s.options.length*s.size),r=t,o=t+_):o=(r=0)+_;for(var d=[],l=r;lt.start_date||void 0!==t.days&&t.zones)&&!t.type)return a;"fullday"==t.zones&&(t.zones=[0,1440]),t.zones&&t.invert_zones&&(t.zones=e.invertZones(t.zones)),t.id=e.uid(),t.css=t.css||"",t.type=t.type||"default";var s=t.sections;if(s){for(var _ in s)if(s.hasOwnProperty(_)){var d=s[_];for(d instanceof Array||(d=[d]),r=0;rf?e._get_zone_minutes(u):0,m=h>p||h.getDate()!=f.getDate()?1440:e._get_zone_minutes(h);v.zones=[g,m],a.push(v),f=p,p=e.date.add(p,1,"day")}else c.days instanceof Date&&(c.days=e.date.date_part(c.days).valueOf()),c.zones=t.zones.slice(),a.push(c)}return a},e._get_dates_by_index=function(t,a,n){var i=[];a=e.date.date_part(new Date(a||e._min_date)),n=new Date(n||e._max_date);for(var r=a.getDay(),o=t-r>=0?t-r:7-a.getDay()+t,s=e.date.add(a,o,"day");s+d&&+o<=+d))return i;n=d.getDay()}var l=o.getDay();l>n?n=7-(l-n):n-=l}var c=t.zones,u=e._get_css_classes_by_config(t);if(e._table_view&&"month"==e._mode){var h=[],f=[];if(a)h.push(a),f.push(n);else{f=_?[_]:e._get_dates_by_index(n);for(var p=0;p1?D=D*(N.size||N.options.length)+C:(D=C,N.size&&D>N.position+N.size&&(D=0))}for(a=a||e.locate_holder(D),p=0;p-1||(a.push.apply(a,e._on_scale_add_marker(s,i)),i=e.date.add(i,1,"day"))}}return a},e.markTimespan=function(t){var a=!1;this._els.dhx_cal_data||(e.get_elements(),a=!0);var n=e._marked_timespans_ids,i=e._marked_timespans_types,r=e._marked_timespans;e.deleteMarkedTimespan(),e.addMarkedTimespan(t);var o=e._mark_timespans();return a&&(e._els=[]),e._marked_timespans_ids=n,e._marked_timespans_types=i,e._marked_timespans=r,o},e.unmarkTimespan=function(e){if(e)for(var t=0;tr&&_<=r||_=i)a[n]=Math.min(i,_),a[n+1]=Math.max(r,d),n-=2;else{if(!o)continue;var l=i>_?0:2;a.splice(n+l,0,_,d)}t.splice(s--,2);break}return a},e._subtract_timespan_zones=function(e,t){for(var a=e.slice(),n=0;ni&&s=s&&r<=_&&a.splice(n,2),i_&&a.splice(d?n+2:n,d?0:2,_,r),n-=2;break}}return a},e.invertZones=function(t){return e._subtract_timespan_zones([0,1440],t.slice())},e._delete_marked_timespan_by_id=function(t){var a=e._marked_timespans_ids[t];if(a)for(var n=0;n1){var u=Math.round((a-e._min_date)/864e5),h=d.size||l.length;a=e.date.add(e._min_date,Math.floor(u/h),"day"),a=e.date.date_part(a)}else a=e.date.date_part(new Date(this._date));if(n=a.getDay(),i=a.valueOf(),o[r]&&o[r][c.key]){var f=o[r][c.key],p=e._get_types_to_render(f[n],f[i]);s.push.apply(s,e._get_configs_to_render(p))}}var v=o.global;if(e.config.overwrite_marked_timespans){var g=v[i]||v[n];s.push.apply(s,e._get_configs_to_render(g))}else v[i]&&s.push.apply(s,e._get_configs_to_render(v[i])),v[n]&&s.push.apply(s,e._get_configs_to_render(v[n]));for(var m=0;m"+n.text+"

"+(n.event_location||"")+"

"+e.templates.marker_date(t)+" - "+e.templates.marker_date(a)+""},e.dblclick_dhx_map_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow({start_date:e._date,end_date:e.date.add(e._date,e.config.time_step,"minute")})},e.templates.map_time=function(t,a,n){return e.config.rtl&&!n._timed?e.templates.day_date(a)+" – "+e.templates.day_date(t):n._timed?this.day_date(n.start_date,n.end_date,n)+" "+this.event_date(t):e.templates.day_date(t)+" – "+e.templates.day_date(a)},e.templates.map_text=function(e,t,a){return a.text},e.date.map_start=function(e){return e},e.date.add_map=function(e,t,a){return new Date(e.valueOf())},e.templates.map_date=function(e,t,a){return""},e._latLngUpdate=!1,e.attachEvent("onSchedulerReady",function(){e._isMapPositionSet=!1;var a=document.createElement("div");a.className="dhx_map",a.id="dhx_gmap",a.style.display="none",e._obj.appendChild(a),e._els.dhx_gmap=[],e._els.dhx_gmap.push(a),_("dhx_gmap");var n={zoom:e.config.map_initial_zoom||10,center:e.config.map_initial_position,mapTypeId:e.config.map_type||google.maps.MapTypeId.ROADMAP},i=new google.maps.Map(document.getElementById("dhx_gmap"),n);i.disableDefaultUI=!1,i.disableDoubleClickZoom=!e.config.readonly,google.maps.event.addListener(i,"dblclick",function(a){if(!e.config.readonly&&e.config.dblclick_create){var n=a.latLng;t.geocode({latLng:n},function(t,a){a==google.maps.GeocoderStatus.OK&&(n=t[0].geometry.location,e.addEventNow({lat:n.lat(),lng:n.lng(),event_location:t[0].formatted_address,start_date:e._date,end_date:e.date.add(e._date,e.config.time_step,"minute")}))})}});var r={content:""};e.config.map_infowindow_max_width&&(r.maxWidth=e.config.map_infowindow_max_width),e.map={_points:[],_markers:[],_infowindow:new google.maps.InfoWindow(r),_infowindows_content:[],_initialization_count:-1,_obj:i},t=new google.maps.Geocoder,e.config.map_resolve_user_location&&navigator.geolocation&&(e._isMapPositionSet||navigator.geolocation.getCurrentPosition(function(t){var a=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);i.setCenter(a),i.setZoom(e.config.map_zoom_after_resolve||10),e.map._infowindow.setContent(e.locale.labels.marker_geo_success),e.map._infowindow.position=i.getCenter(),e.map._infowindow.open(i),e._isMapPositionSet=!0},function(){e.map._infowindow.setContent(e.locale.labels.marker_geo_fail),e.map._infowindow.setPosition(i.getCenter()),e.map._infowindow.open(i),e._isMapPositionSet=!0})),google.maps.event.addListener(i,"resize",function(e){a.style.zIndex="5",i.setZoom(i.getZoom())}),google.maps.event.addListener(i,"tilesloaded",function(e){a.style.zIndex="5"}),a.style.display="none";var o=e.render_data;function s(){var t=e.get_visible_events();t.sort(function(e,t){return e.start_date.valueOf()==t.start_date.valueOf()?e.id>t.id?1:-1:e.start_date>t.start_date?1:-1});for(var a="
",n=0;n
"+e.templates.map_time(i.start_date,i.end_date,i)+"
",a+="
 
",a+="
"+e.templates.map_text(i.start_date,i.end_date,i)+"
"}a+="
",e._els.dhx_cal_data[0].scrollTop=0,e._els.dhx_cal_data[0].innerHTML=a,e._els.dhx_cal_data[0].style.width=e.xy.map_date_width+e.xy.map_description_width+1+"px";var l=e._els.dhx_cal_data[0].firstChild.childNodes,c=e._getNavDateElement();for(c&&(c.innerHTML=e.templates[e._mode+"_date"](e._min_date,e._max_date,e._mode)),e._rendered=[],n=0;n
"+a.date+"
"+a.description+"
",e._table_view=!0,e.set_sizes()}}(t),t){!function(){e._selected_event_id=null,e.map._infowindow.close();var t=e.map._markers;for(var a in t)t.hasOwnProperty(a)&&(t[a].setMap(null),delete e.map._markers[a],e.map._infowindows_content[a]&&delete e.map._infowindows_content[a])}(),s(),n.style.display="block",_("dhx_gmap"),a=e.map._obj.getCenter();for(var i=e.get_visible_events(),r=0;re._min_date||n.start_datee._max_date||n.start_date.valueOf()>=e._min_date&&n.end_date.valueOf()<=e._max_date?(e.map._markers[t]&&e.map._markers[t].setMap(null),c(n)):(e._selected_event_id=null,e.map._infowindow.close(),e.map._markers[t]&&e.map._markers[t].setMap(null))}return!0}),e.attachEvent("onEventIdChange",function(t,a){var n=e.getEvent(a);return(n.start_datee._min_date||n.start_datee._max_date||n.start_date.valueOf()>=e._min_date&&n.end_date.valueOf()<=e._max_date)&&(e.map._markers[t]&&(e.map._markers[t].setMap(null),delete e.map._markers[t]),e.map._infowindows_content[t]&&delete e.map._infowindows_content[t],c(n)),!0}),e.attachEvent("onEventAdded",function(t,a){return e._dataprocessor||(a.start_datee._min_date||a.start_datee._max_date||a.start_date.valueOf()>=e._min_date&&a.end_date.valueOf()<=e._max_date)&&(e.map._markers[t]&&e.map._markers[t].setMap(null),c(a)),!0}),e.attachEvent("onBeforeEventDelete",function(t,a){return e.map._markers[t]&&e.map._markers[t].setMap(null),e._selected_event_id=null,e.map._infowindow.close(),!0}),e._event_resolve_delay=1500,e.attachEvent("onEventLoading",function(t){return e.config.map_resolve_event_location&&t.event_location&&!t.lat&&!t.lng&&(e._event_resolve_delay+=1500,function(t,a,n,i){setTimeout(function(){if(e.$destroyed)return!0;var i=t.apply(a,n);return t=a=n=null,i},i||1)}(u,this,[t],e._event_resolve_delay)),!0}),e.attachEvent("onEventCancel",function(t,a){return a&&(e.map._markers[t]&&e.map._markers[t].setMap(null),e.map._infowindow.close()),!0})})},minical:function(e){var t=e._createDomEventScope();e.templates.calendar_month=e.date.date_to_str("%F %Y"),e.templates.calendar_scale_date=e.date.date_to_str("%D"),e.templates.calendar_date=e.date.date_to_str("%d"),e.config.minicalendar={mark_events:!0},e._synced_minicalendars=[],e.renderCalendar=function(a,n,i){var r=null,o=a.date||e._currentDate();if("string"==typeof o&&(o=this.templates.api_date(o)),n)r=this._render_calendar(n.parentNode,o,a,n),e.unmarkCalendar(r);else{var s=a.container,_=a.position;if("string"==typeof s&&(s=document.getElementById(s)),"string"==typeof _&&(_=document.getElementById(_)),_&&void 0===_.left&&void 0===_.right){var d=e.$domHelpers.getOffset(_);_={top:d.top+_.offsetHeight,left:d.left}}s||(s=e._get_def_cont(_)),(r=this._render_calendar(s,o,a)).$_eventAttached||(r.$_eventAttached=!0,t.attach(r,"click",function(t){var a=t.target||t.srcElement,n=e.$domHelpers;if(n.closest(a,".dhx_month_head")&&!n.closest(a,".dhx_after")&&!n.closest(a,".dhx_before")){var i=n.closest(a,"[data-cell-date]").getAttribute("data-cell-date"),r=e.templates.parse_date(i);e.unmarkCalendar(this),e.markCalendar(this,r,"dhx_calendar_click"),this._last_date=r,this.conf.handler&&this.conf.handler.call(e,r,this)}}.bind(r)))}if(e.config.minicalendar.mark_events)for(var l=e.date.month_start(o),c=e.date.add(l,1,"month"),u=this.getEvents(l,c),h=this["filter_"+this._mode],f={},p=0;p=c.valueOf())););}}return this._markCalendarCurrentDate(r),r.conf=a,a.sync&&!i&&this._synced_minicalendars.push(r),r.conf._on_xle_handler||(r.conf._on_xle_handler=e.attachEvent("onXLE",function(){e.updateCalendar(r,r.conf.date)})),this.config.wai_aria_attributes&&this.config.wai_aria_application_role&&r.setAttribute("role","application"),r},e._get_def_cont=function(t){return this._def_count||(this._def_count=document.createElement("div"),this._def_count.className="dhx_minical_popup",e.event(this._def_count,"click",function(e){e.cancelBubble=!0}),document.body.appendChild(this._def_count)),t.left&&(this._def_count.style.left=t.left+"px"),t.right&&(this._def_count.style.right=t.right+"px"),t.top&&(this._def_count.style.top=t.top+"px"),t.bottom&&(this._def_count.style.bottom=t.bottom+"px"),this._def_count._created=new Date,this._def_count},e._locateCalendar=function(t,a){if("string"==typeof a&&(a=e.templates.api_date(a)),+a>+t._max_date||+a<+t._min_date)return null;for(var n=t.querySelector(".dhx_year_body").childNodes[0],i=0,r=new Date(t._min_date);+this.date.add(r,1,"week")<=+a;)r=this.date.add(r,1,"week"),i++;var o=e.config.start_on_monday,s=(a.getDay()||(o?7:0))-(o?1:0);return n.rows[i].cells[s].firstChild},e.markCalendar=function(e,t,a){var n=this._locateCalendar(e,t);n&&(n.className+=" "+a)},e.unmarkCalendar=function(e,t,a){if(t=t||e._last_date,a=a||"dhx_calendar_click",t){var n=this._locateCalendar(e,t);n&&(n.className=(n.className||"").replace(RegExp(a,"g")))}},e._week_template=function(t){for(var a=t||250,n=0,i=document.createElement("div"),r=this.date.week_start(e._currentDate()),o=0;o<7;o++)this._cols[o]=Math.floor(a/(7-o)),this._render_x_header(o,n,r,i),r=this.date.add(r,1,"day"),a-=this._cols[o],n+=this._cols[o];return i.lastChild.className+=" dhx_scale_bar_last",i},e.updateCalendar=function(e,t){e.conf.date=t,this.renderCalendar(e.conf,e,!0)},e._mini_cal_arrows=[" "," "],e._render_calendar=function(a,n,i,r){var o=e.templates,s=this._cols;this._cols=[];var _=this._mode;this._mode="calendar";var d=this._colsS;this._colsS={height:0};var l=new Date(this._min_date),c=new Date(this._max_date),u=new Date(e._date),h=o.month_day,f=this._ignores_detected;this._ignores_detected=0,o.month_day=o.calendar_date,n=this.date.month_start(n);var p,v=this._week_template(a.offsetWidth-1-this.config.minicalendar.padding);r?p=r:(p=document.createElement("div")).className="dhx_cal_container dhx_mini_calendar",p.setAttribute("date",this._helpers.formatDate(n)),p.innerHTML="
":"'>")+"
"+(v?v.innerHTML:"")+"
";var g=p.querySelector(".dhx_year_month"),m=p.querySelector(".dhx_year_week"),y=p.querySelector(".dhx_year_body");if(g.innerHTML=this.templates.calendar_month(n),i.navigation)for(var b=function(t,a){var n=e.date.add(t._date,a,"month");e.updateCalendar(t,n),e._date.getMonth()==t._date.getMonth()&&e._date.getFullYear()==t._date.getFullYear()&&e._markCalendarCurrentDate(t)},x=["dhx_cal_prev_button","dhx_cal_next_button"],k=["left:1px;top:2px;position:absolute;","left:auto; right:1px;top:2px;position:absolute;"],w=[-1,1],E=function(t){return function(){if(i.sync)for(var a=e._synced_minicalendars,n=0;n500)&&(a=this._def_count.firstChild),a&&(t.detachAll(),a.innerHTML="",a.parentNode&&a.parentNode.removeChild(a),this._def_count&&(this._def_count.style.top="-1000px"),a.conf&&a.conf._on_xle_handler&&e.detachEvent(a.conf._on_xle_handler))},e.isCalendarVisible=function(){return!!(this._def_count&&parseInt(this._def_count.style.top,10)>0)&&this._def_count},e.attachEvent("onTemplatesReady",function(){e.event(document.body,"click",function(){e.destroyCalendar()})},{once:!0}),e.templates.calendar_time=e.date.date_to_str("%d-%m-%Y"),e.form_blocks.calendar_time={render:function(t){var a="",n=e.config,i=this.date.date_part(e._currentDate()),r=1440,o=0;n.limit_time_select&&(o=60*n.first_hour,r=60*n.last_hour+1),i.setHours(o/60),t._time_values=[],a+=" ")+"  –  "+a+""},set_value:function(t,a,n,i){var r,o,s=t.getElementsByTagName("input"),_=t.getElementsByTagName("select"),d=function(t,a,n){e.event(t,"click",function(){e.destroyCalendar(null,!0),e.renderCalendar({position:t,date:new Date(this._date),navigation:!0,handler:function(a){t.value=e.templates.calendar_time(a),t._date=new Date(a),e.destroyCalendar(),e.config.event_duration&&e.config.auto_end_date&&0===n&&h()}})})};if(e.config.full_day){if(!t._full_day){var l="";e.config.wide_form||(l=t.previousSibling.innerHTML+l),t.previousSibling.innerHTML=l,t._full_day=!0}var c=t.previousSibling.getElementsByTagName("input")[0],u=0===e.date.time_part(n.start_date)&&0===e.date.time_part(n.end_date);c.checked=u,_[0].disabled=c.checked,_[1].disabled=c.checked,c.$_eventAttached||(c.$_eventAttached=!0,e.event(c,"click",function(){if(!0===c.checked){var a={};e.form_blocks.calendar_time.get_value(t,a),r=e.date.date_part(a.start_date),(+(o=e.date.date_part(a.end_date))==+r||+o>=+r&&(0!==n.end_date.getHours()||0!==n.end_date.getMinutes()))&&(o=e.date.add(o,1,"day"))}var i=r||n.start_date,d=o||n.end_date;f(s[0],i),f(s[1],d),_[0].value=60*i.getHours()+i.getMinutes(),_[1].value=60*d.getHours()+d.getMinutes(),_[0].disabled=c.checked,_[1].disabled=c.checked}))}if(e.config.event_duration&&e.config.auto_end_date){var h=function(){e.config.auto_end_date&&e.config.event_duration&&(r=e.date.add(s[0]._date,_[0].value,"minute"),o=new Date(r.getTime()+60*e.config.event_duration*1e3),s[1].value=e.templates.calendar_time(o),s[1]._date=e.date.date_part(new Date(o)),_[1].value=60*o.getHours()+o.getMinutes())};_[0].$_eventAttached||_[0].addEventListener("change",h)}function f(t,a,n){d(t,a,n),t.value=e.templates.calendar_time(a),t._date=e.date.date_part(new Date(a))}function p(e){for(var t=i._time_values,a=60*e.getHours()+e.getMinutes(),n=a,r=!1,o=0;o=s.valueOf()))for(var _=n;_.valueOf()_&&e.markCalendar(t,_,"dhx_calendar_click"),_=e.date.add(_,1,"day")},e.attachEvent("onEventCancel",function(){e.destroyCalendar(null,!0)}),e.attachEvent("onDestroy",function(){e.destroyCalendar()})},monthheight:function(e){e.attachEvent("onTemplatesReady",function(){e.xy.scroll_width=0;var t=e.render_view_data;e.render_view_data=function(){var a=this._els.dhx_cal_data[0];a.firstChild._h_fix=!0,t.apply(e,arguments);var n=parseInt(a.style.height);a.style.height="1px",a.style.height=a.scrollHeight+"px",this._obj.style.height=this._obj.clientHeight+a.scrollHeight-n+"px"};var a=e._reset_month_scale;e._reset_month_scale=function(t,n,i,r){var o={clientHeight:100};a.apply(e,[o,n,i,r]),t.innerHTML=o.innerHTML}})},multisection:function(e){Me("Multisection",e.assert)},multisource:function(e){var t=e._load;e._load=function(e,a){if("object"==Pe(e=e||this._load_url))for(var n=function(e){var t=function(){};return t.prototype=e,t}(this._loaded),i=0;i]*>","g"),i=new RegExp("]*>","g");function r(e){return e.replace(i,"\n").replace(n,"")}function o(e,a){e=parseFloat(e),a=parseFloat(a),isNaN(a)||(e-=a);var n=_(e);return e=e-n.width+n.cols*t,isNaN(e)?"auto":100*e/t}function s(e,a,n){e=parseFloat(e),a=parseFloat(a),!isNaN(a)&&n&&(e-=a);var i=_(e);return e=e-i.width+i.cols*t,isNaN(e)?"auto":100*e/(t-(isNaN(a)?0:a))}function _(t){for(var a=0,n=e._els.dhx_cal_header[0].childNodes,i=n[1]?n[1].childNodes:n[0].childNodes,r=0;rs))break;t-=s+1,a+=s+1}return{width:a,cols:r}}function d(e){return e=parseFloat(e),isNaN(e)?"auto":100*e/a}function l(e,t){return(window.getComputedStyle?window.getComputedStyle(e,null)[t]:e.currentStyle?e.currentStyle[t]:null)||""}function c(t,a){for(var n=parseInt(t.style.left,10),i=0;in)return i;return a}function h(e){return e?"<"+e+">":""}function f(e){return e?"":""}function p(e,t,a,n){var i="<"+e+" profile='"+t+"'";return a&&(i+=" header='"+a+"'"),n&&(i+=" footer='"+n+"'"),i+=">"}function v(){var t="",n=e._mode;if(e.matrix&&e.matrix[e._mode]&&(n="cell"==e.matrix[e._mode].render?"matrix":"timeline"),t+="","week_agenda"==e._mode)for(var i=e._els.dhx_cal_data[0].getElementsByTagName("DIV"),o=0;o"+r(i[o].innerHTML)+"");else if("agenda"==e._mode||"map"==e._mode)t+=""+r((i=e._els.dhx_cal_header[0].childNodes[0].childNodes)[0].innerHTML)+""+r(i[1].innerHTML)+"";else if("year"==e._mode)for(i=e._els.dhx_cal_data[0].childNodes,o=0;o",t+=m(i[o].querySelector(".dhx_year_week").childNodes),t+=g(i[o].querySelector(".dhx_year_body")),t+="";else{t+="",t+=m(i=e._els.dhx_cal_header[0].childNodes),t+="";var s=e._els.dhx_cal_data[0];if(e.matrix&&e.matrix[e._mode]){for(t+="",o=0;o";t+="",a=s.firstChild.rows[0].cells[0].offsetHeight}else if("TABLE"==s.firstChild.tagName)t+=g(s);else{for(s=s.childNodes[s.childNodes.length-1];-1==s.className.indexOf("dhx_scale_holder");)s=s.previousSibling;for(s=s.childNodes,t+="",o=0;o";t+="",a=s[0].offsetHeight}}return t+=""}function g(e){for(var t="",n=e.querySelectorAll("tr"),i=0;i",a=s[0].offsetHeight}return t}function m(a){var n,i="";e.matrix&&e.matrix[e._mode]&&(e.matrix[e._mode].second_scale&&(n=a[1].childNodes),a=a[0].childNodes);for(var o=0;o";if(t=a[0].offsetWidth,n){var s=0,_=a[0].offsetWidth,d=1;for(o=0;o",(s+=n[o].offsetWidth)>=_&&(_+=a[d]?a[d].offsetWidth:0,d++),t=n[0].offsetWidth}return i}function y(t){var n="",i=e._rendered,_=e.matrix&&e.matrix[e._mode];if("agenda"==e._mode||"map"==e._mode)for(var h=0;h";else if("week_agenda"==e._mode)for(h=0;h"+r(i[h].innerHTML)+"";else if("year"==e._mode)for(i=e.get_visible_events(),h=0;h",(f=e.date.add(f,1,"day")).valueOf()>=e._max_date.valueOf())break}}else if(_&&"cell"==_.render)for(i=e._els.dhx_cal_data[0].getElementsByTagName("TD"),h=0;h";else for(h=0;h","event"==E?(n+="
",g=t?l(i[h].childNodes[2],"color"):"",n+=""):(g=t?l(i[h],"color"):"",n+=""),n+=""}}}}return n}function b(t,a,n,i,r,o){var s=!1;"fullcolor"==i&&(s=!0,i="color"),i=i||"color";var _="";if(t){var d=e._date,l=e._mode;a=e.date[n+"_start"](a),a=e.date["get_"+n+"_end"]?e.date["get_"+n+"_end"](a):e.date.add(a,1,n),_=p("pages",i,r,o);for(var c=new Date(t);+c<+a;c=this.date.add(c,1,n))this.setCurrentView(c,n),_+=h("page")+v().replace("–","-")+y(s)+f("page");_+=f("pages"),this.setCurrentView(d,l)}else _=p("data",i,r,o)+v().replace("–","-")+y(s)+f("data");return _}function x(t,a,n,i,r,o,s){!function(t,a){var n=e.uid(),i=document.createElement("div");i.style.display="none",document.body.appendChild(i),i.innerHTML='
',document.getElementById(n).firstChild.value=encodeURIComponent(t),document.getElementById(n).submit(),i.parentNode.removeChild(i)}("object"==ze(r)?function(e){for(var t="",a=0;awindow.innerWidth&&(r=window.innerWidth-n),r=Math.max(0,r),a.style.left=r+"px",a.style.top=t.top-(t.dy?i:-t.height)+"px"}else a.style.top=this.xy.scale_height+this.xy.nav_height+20+"px",1==t.dx?(a.style.right="auto",a.style.left=-n+"px",setTimeout(function(){a.style.left="-10px"},1)):(a.style.left="auto",a.style.right=-n+"px",setTimeout(function(){a.style.right="-10px"},1)),a.className=a.className.replace(" dhx_qi_left","").replace(" dhx_qi_right","")+" dhx_qi_"+(1==t.dx?"left":"right")},e.attachEvent("onTemplatesReady",function(){if(e.hideQuickInfo(),this._quick_info_box){var t=this._quick_info_box;t.parentNode&&t.parentNode.removeChild(t),this._quick_info_box=null}}),e._quick_info_onscroll_handler=function(t){e.hideQuickInfo()},e._init_quick_info=function(){if(!this._quick_info_box){var t=e.xy,a=this._quick_info_box=document.createElement("div");this._waiAria.quickInfoAttr(a),a.className="dhx_cal_quick_info",e.$testmode&&(a.className+=" dhx_no_animate"),e.config.rtl&&(a.className+=" dhx_quick_info_rtl");var n=this._waiAria.quickInfoHeaderAttrString(),i='
';i+='
';for(var r=e.config.icons_select,o=0;o
"+e.locale.labels[r[o]]+"
";i+="",a.innerHTML=i,e.event(a,"click",function(t){e._qi_button_click(t.target||t.srcElement)}),e.config.quick_info_detached&&(e._detachDomEvent(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler),e.event(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler))}return this._quick_info_box},e._qi_button_click=function(t){var a=e._quick_info_box;if(t&&t!=a){var n=e._getClassName(t);if(-1!=n.indexOf("_icon")){var i=e._quick_info_box_id;e._click.buttons[n.split(" ")[1].replace("icon_","")](i)}else e._qi_button_click(t.parentNode)}},e._get_event_counter_part=function(t){for(var a=e.getRenderedEvent(t),n=0,i=0,r=a;r&&r!=e._obj;)n+=r.offsetLeft,i+=r.offsetTop-r.scrollTop,r=r.offsetParent;return r?{left:n,top:i,dx:n+a.offsetWidth/2>e._x/2?1:0,dy:i+a.offsetHeight/2>e._y/2?1:0,width:a.offsetWidth,height:a.offsetHeight}:0},e._fill_quick_data=function(t){var a=e.getEvent(t),n=e._quick_info_box;e._quick_info_box_id=t;var i={content:e.templates.quick_info_title(a.start_date,a.end_date,a),date:e.templates.quick_info_date(a.start_date,a.end_date,a)},r=n.firstChild.firstChild;r.innerHTML=i.content,r.nextSibling.innerHTML=i.date,e._waiAria.quickInfoHeader(n,[i.content,i.date].join(" ")),n.firstChild.nextSibling.innerHTML=e.templates.quick_info_content(a.start_date,a.end_date,a)}},readonly:function(e){e.attachEvent("onTemplatesReady",function(){var t;e.form_blocks.recurring&&(t=e.form_blocks.recurring.set_value);var a=e.config.buttons_left.slice(),n=e.config.buttons_right.slice();function i(e,t,a,n){for(var i=t.getElementsByTagName(e),r=a.getElementsByTagName(e),o=r.length-1;o>=0;o--)if(a=r[o],n){var s=document.createElement("span");s.className="dhx_text_disabled",s.innerHTML=n(i[o]),a.parentNode.insertBefore(s,a),a.parentNode.removeChild(a)}else a.disabled=!0,t.checked&&(a.checked=!0)}e.attachEvent("onBeforeLightbox",function(i){this.config.readonly_form||this.getEvent(i).readonly?this.config.readonly_active=!0:(this.config.readonly_active=!1,e.config.buttons_left=a.slice(),e.config.buttons_right=n.slice(),e.form_blocks.recurring&&(e.form_blocks.recurring.set_value=t));var r=this.config.lightbox.sections;if(this.config.readonly_active){for(var o=0;o






'+r.repeat_text_occurences_count+'

'},_ds:{},_get_form_node:function(e,t,a){var n=e[t];if(!n)return null;if(n.nodeName)return n;if(n.length)for(var i=0;io)return t.setDate(t.getDate()+1*a[s]-o-(i?n:r));this.transpose_day_week(t,a,n+i,null,n)},e.transpose_type=function(t){var a="transpose_"+t;if(!this.date[a]){var n=t.split("_"),i="add_"+t,r=this.transponse_size[n[0]]*n[1];if("day"==n[0]||"week"==n[0]){var o=null;if(n[4]&&(o=n[4].split(","),e.config.start_on_monday)){for(var s=0;s0&&t.setDate(t.getDate()+n*r),o&&e.transpose_day_week(t,o,1,r),t},this.date[i]=function(t,a){var n=new Date(t.valueOf());if(o)for(var i=0;i=0&&(t.setDate(1),t.setMonth(t.getMonth()+o*r)),e.date[i](t,0,n)},this.date[i]=function(t,a,o,s){if(s?s++:s=1,s>12)return null;var _=new Date(t.valueOf());_.setDate(1),_.setMonth(_.getMonth()+a*r);var d=_.getMonth(),l=_.getFullYear();_.setDate(o.start_date.getDate()),n[3]&&e.date.day_week(_,n[2],n[3]);var c=e.config.recurring_overflow_instances;return _.getMonth()!=d&&"none"!=c&&(_="lastDay"===c?new Date(l,d+1,0,_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()):e.date[i](new Date(l,d+1,0),a||1,o,s)),_})}},e.repeat_date=function(t,a,n,i,r,o){i=i||this._min_date,r=r||this._max_date;var s=o||-1,_=new Date(t.start_date.valueOf()),d=_.getHours(),l=0;for(!t.rec_pattern&&t.rec_type&&(t.rec_pattern=t.rec_type.split("#")[0]),this.transpose_type(t.rec_pattern),_=e.date["transpose_"+t.rec_pattern](_,i,t);_&&(_0?new Date(n.valueOf()+1e3*a.event_length-60*r*1e3):new Date(t.valueOf()-60*r*1e3):new Date(i.valueOf())},e.getRecDates=function(t,a){var n="object"==Fe(t)?t:e.getEvent(t),i=[];if(a=a||100,!n.rec_type)return[{start_date:n.start_date,end_date:n.end_date}];if("none"==n.rec_type)return[];e.repeat_date(n,i,!0,n.start_date,n.end_date,a);for(var r=[],o=0;oe)if(i.rec_pattern){if("none"==i.rec_pattern)continue;var r=[];this.repeat_date(i,r,!0,e,t);for(var o=0;oe&&!this._rec_markers[r[o].id]&&a.push(r[o])}else this._is_virtual_event(i.id)||a.push(i)}return a},e.config.repeat_date="%m.%d.%Y",e.config.lightbox.sections=[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}],e._copy_dummy=function(e){var t=new Date(this.start_date),a=new Date(this.end_date);this.start_date=t,this.end_date=a,this.event_length=this.event_pid=this.rec_pattern=this.rec_type=null},e.config.include_end_by=!1,e.config.lightbox_recurring="ask",e.attachEvent("onClearAll",function(){e._rec_markers={},e._rec_markers_pull={},e._rec_temp=[]})},serialize:function(e){var t=I()(e);e.data_attributes=function(){var a=[],n=e._helpers.formatDate,i=t();for(var r in i){var o=i[r];for(var s in o)"_"!=s.substr(0,1)&&a.push([s,"start_date"==s||"end_date"==s?n:null]);break}return a},e.toXML=function(e){var a=[],n=this.data_attributes(),i=t();for(var r in i){var o=i[r];a.push("");for(var s=0;s");a.push("")}return(e||"")+""+a.join("\n")+""},e._serialize_json_value=function(e){return null===e||"boolean"==typeof e?e=""+e:(e||0===e||(e=""),e='"'+e.toString().replace(/\n/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'),e},e.toJSON=function(){return JSON.stringify(this.serialize())},e.toICal=function(a){var n=e.date.date_to_str("%Y%m%dT%H%i%s"),i=e.date.date_to_str("%Y%m%d"),r=[],o=t();for(var s in o){var _=o[s];r.push("BEGIN:VEVENT"),_._timed&&(_.start_date.getHours()||_.start_date.getMinutes())?r.push("DTSTART:"+n(_.start_date)):r.push("DTSTART:"+i(_.start_date)),_._timed&&(_.end_date.getHours()||_.end_date.getMinutes())?r.push("DTEND:"+n(_.end_date)):r.push("DTEND:"+i(_.end_date)),r.push("SUMMARY:"+_.text),r.push("END:VEVENT")}return"BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\nDESCRIPTION:"+(a||"")+"\n"+r.join("\n")+"\nEND:VCALENDAR"}},timeline:function(e){Me("Timeline",e.assert)},tooltip:function(e){var t=e._createDomEventScope(),a={};e.ext.tooltip=e.dhtmlXTooltip=e.tooltip=a,a.config={className:"dhtmlXTooltip scheduler_tooltip tooltip",timeout_to_display:50,timeout_to_hide:50,delta_x:15,delta_y:-20},a.tooltip=document.createElement("div"),a.tooltip.className=a.config.className,e._waiAria.tooltipAttr(a.tooltip),a.show=function(n,i){if(!this._mobile||e.config.touch_tooltip){var r=a,o=this.tooltip,s=o.style;r.tooltip.className=r.config.className;var _=this.position(n),d=n.target||n.srcElement;if(!this.isTooltip(d)){var l=_.x+(r.config.delta_x||0),c=_.y-(r.config.delta_y||0);s.visibility="hidden",s.right="",s.bottom="",s.left="0",s.top="0",e.config.rtl&&(o.className+=" dhtmlXTooltip_rtl"),this.tooltip.innerHTML=i,document.body.appendChild(this.tooltip);var u=this.tooltip.offsetWidth,h=this.tooltip.offsetHeight;if(document.documentElement.clientWidth-l-u<0?(s.left="",s.right=document.documentElement.clientWidth-l+2*(r.config.delta_x||0)+"px"):s.left=l<0?_.x+Math.abs(r.config.delta_x||0)+"px":l+"px",document.documentElement.clientHeight-c-h<0){var f=document.documentElement.clientHeight-c-2*(r.config.delta_y||0);f+h>document.documentElement.clientHeight?(c-=Math.abs(document.documentElement.clientHeight-c-h),c=Math.max(c,0),s.top=c+"px"):(s.bottom=f+"px",s.top="")}else s.top=c<0?_.y+Math.abs(r.config.delta_y||0)+"px":c+"px";e._waiAria.tooltipVisibleAttr(this.tooltip),s.visibility="visible",t.attach(this.tooltip,"mouseleave",function(t){for(var a=e.dhtmlXTooltip,n=t.relatedTarget;n!=e._obj&&n;)n=n.parentNode;n!=e._obj&&a.delay(a.hide,a,[],a.config.timeout_to_hide)}),e.callEvent("onTooltipDisplayed",[this.tooltip,this.tooltip.event_id])}}},a._clearTimeout=function(){this.tooltip._timeout_id&&clearTimeout(this.tooltip._timeout_id)},a.hide=function(){if(this.tooltip.parentNode){e._waiAria.tooltipHiddenAttr(this.tooltip);var a=this.tooltip.event_id;this.tooltip.event_id=null,t.detachAll(),this.tooltip.parentNode.removeChild(this.tooltip),e.callEvent("onAfterTooltip",[a])}this._clearTimeout()},a.delay=function(t,a,n,i){this._clearTimeout(),this.tooltip._timeout_id=setTimeout(function(){if(e.$destroyed)return!0;var i=t.apply(a,n);return t=a=n=null,i},i||this.config.timeout_to_display)},a.isTooltip=function(e){for(var t=!1;e&&!t;)t=e.className==this.tooltip.className,e=e.parentNode;return t},a.position=function(e){return{x:e.clientX,y:e.clientY}},e.attachEvent("onMouseMove",function(t,n){var i=n.target||n.srcElement,r=a,o=r.isTooltip(i),s=r.isTooltipTarget&&r.isTooltipTarget(i);if(t&&e.getState().editor_id!=t||o||s){var _,d;if(t||r.tooltip.event_id){var l=e.getEvent(t)||e.getEvent(r.tooltip.event_id);if(!l)return;if(r.tooltip.event_id=l.id,!(_=e.templates.tooltip_text(l.start_date,l.end_date,l)))return r.hide()}if(s&&(_=""),e.$env.isIE)for(var c in d={pageX:void 0,pageY:void 0,clientX:void 0,clientY:void 0,target:void 0,srcElement:void 0})d[c]=n[c];if(!e.callEvent("onBeforeTooltip",[t])||!_)return;r.delay(r.show,r,[d||n,_])}else r.delay(r.hide,r,[],r.config.timeout_to_hide)}),e.attachEvent("onBeforeDrag",function(){return a.hide(),!0}),e.attachEvent("onEventDeleted",function(){return a.hide(),!0}),e.attachEvent("onDestroy",function(){a.hide()})},treetimeline:function(e){Me("Tree Timeline",e.assert)},units:function(e){Me("Units",e.assert)},url:function(e){e._get_url_nav=function(){for(var e={},t=(document.location.hash||"").replace("#","").split(","),a=0;a",s+="
"+(o[_]._timed?this.templates.event_date(o[_].start_date):"")+"
",s+="
 
",s+=this.templates.year_tooltip(o[_].start_date,o[_].end_date,o[_])+""}}this._tooltip.style.display="",this._tooltip.style.top="0px",document.body.offsetWidth-a.left-this._tooltip.offsetWidth<0?this._tooltip.style.left=a.left-this._tooltip.offsetWidth+"px":this._tooltip.style.left=a.left+i.offsetWidth+"px",this._tooltip.date=t,this._tooltip.innerHTML=s,document.body.offsetHeight-a.top-this._tooltip.offsetHeight<0?this._tooltip.style.top=a.top-this._tooltip.offsetHeight+i.offsetHeight+"px":this._tooltip.style.top=a.top+"px"},e._year_view_tooltip_handler=function(a){if(t()){var n=a.target||a.srcElement;"a"==n.tagName.toLowerCase()&&(n=n.parentNode),-1!=e._getClassName(n).indexOf("dhx_year_event")?e._showToolTip(e.templates.parse_date(n.getAttribute("data-year-date")),e.$domHelpers.getOffset(n),a,n):e._hideToolTip()}},e._init_year_tooltip=function(){e._detachDomEvent(e._els.dhx_cal_data[0],"mouseover",e._year_view_tooltip_handler),e.event(e._els.dhx_cal_data[0],"mouseover",e._year_view_tooltip_handler)},e._get_year_cell=function(t){for(var a=e.templates.format_date(t),n=this.$root.querySelectorAll('.dhx_cal_data [data-cell-date="'.concat(a,'"] .dhx_month_head')),i=0;i=this._max_date.valueOf())return},e.year_view=function(t){var a;if(t&&(a=e.xy.scale_height,e.xy.scale_height=-1),e._els.dhx_cal_header[0].style.display=t?"none":"",e.set_sizes(),t&&(e.xy.scale_height=a),e._table_view=t,!this._load_mode||!this._load())if(t){if(e._init_year_tooltip(),e._reset_year_scale(),e._load_mode&&e._load())return void(e._render_wait=!0);e.render_view_data()}else e._hideToolTip()},e._reset_year_scale=function(){this._cols=[],this._colsS={};var t=[],a=this._els.dhx_cal_data[0],n=this.config;a.scrollTop=0,a.innerHTML="";var i=Math.floor(parseInt(a.style.width)/n.year_x),r=Math.floor((parseInt(a.style.height)-e.xy.year_top)/n.year_y);r<190&&(r=190,i=Math.floor((parseInt(a.style.width)-e.xy.scroll_width)/n.year_x));var o=i-11,s=0,_=document.createElement("div"),d=this.date.week_start(e._currentDate());this._process_ignores(d,7,"day",1);for(var l=7-(this._ignores_detected||0),c=0,u=0;u<7;u++)this._ignores&&this._ignores[u]||(this._cols[u]=Math.floor(o/(l-c)),this._render_x_header(u,s,d,_),o-=this._cols[u],s+=this._cols[u],c++),d=this.date.add(d,1,"day");for(_.lastChild.className+=" dhx_scale_bar_last",u=0;u<_.childNodes.length;u++)this._waiAria.yearHeadCell(_.childNodes[u]);var h=this.date[this._mode+"_start"](this.date.copy(this._date)),f=h,p=null;for(u=0;u
"+_.innerHTML+"
";var g=p.querySelector(".dhx_year_month"),m=p.querySelector(".dhx_year_grid"),y=p.querySelector(".dhx_year_week"),b=p.querySelector(".dhx_year_body"),x=e.uid();this._waiAria.yearHeader(g,x),this._waiAria.yearGrid(m,x),g.innerHTML=this.templates.year_month(h);var k=this.date.week_start(h);this._reset_month_scale(b,h,k,6);for(var w=b.querySelectorAll("td"),E=0;E 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\nfunction noop() {}\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\nprocess.listeners = function (name) {\n return [];\n};\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\nprocess.cwd = function () {\n return '/';\n};\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function () {\n return 0;\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n/* @preserve\n * The MIT License (MIT)\n * \n * Copyright (c) 2013-2018 Petka Antonov\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n * \n */\n/**\n * bluebird build version 3.7.2\n * Features enabled: core\n * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\n*/\n!function (e) {\n if (\"object\" == (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) && \"undefined\" != typeof module) module.exports = e();else if (\"function\" == typeof define && define.amd) define([], e);else {\n var f;\n \"undefined\" != typeof window ? f = window : \"undefined\" != typeof global ? f = global : \"undefined\" != typeof self && (f = self), f.Promise = e();\n }\n}(function () {\n var define, module, exports;\n return function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n var a = typeof _dereq_ == \"function\" && _dereq_;\n if (!u && a) return a(o, !0);\n if (i) return i(o, !0);\n var f = new Error(\"Cannot find module '\" + o + \"'\");\n throw f.code = \"MODULE_NOT_FOUND\", f;\n }\n var l = n[o] = {\n exports: {}\n };\n t[o][0].call(l.exports, function (e) {\n var n = t[o][1][e];\n return s(n ? n : e);\n }, l, l.exports, e, t, n, r);\n }\n return n[o].exports;\n }\n var i = typeof _dereq_ == \"function\" && _dereq_;\n for (var o = 0; o < r.length; o++) {\n s(r[o]);\n }\n return s;\n }({\n 1: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var firstLineError;\n try {\n throw new Error();\n } catch (e) {\n firstLineError = e;\n }\n var schedule = _dereq_(\"./schedule\");\n var Queue = _dereq_(\"./queue\");\n function Async() {\n this._customScheduler = false;\n this._isTickUsed = false;\n this._lateQueue = new Queue(16);\n this._normalQueue = new Queue(16);\n this._haveDrainedQueues = false;\n var self = this;\n this.drainQueues = function () {\n self._drainQueues();\n };\n this._schedule = schedule;\n }\n Async.prototype.setScheduler = function (fn) {\n var prev = this._schedule;\n this._schedule = fn;\n this._customScheduler = true;\n return prev;\n };\n Async.prototype.hasCustomScheduler = function () {\n return this._customScheduler;\n };\n Async.prototype.haveItemsQueued = function () {\n return this._isTickUsed || this._haveDrainedQueues;\n };\n Async.prototype.fatalError = function (e, isNode) {\n if (isNode) {\n process.stderr.write(\"Fatal \" + (e instanceof Error ? e.stack : e) + \"\\n\");\n process.exit(2);\n } else {\n this.throwLater(e);\n }\n };\n Async.prototype.throwLater = function (fn, arg) {\n if (arguments.length === 1) {\n arg = fn;\n fn = function fn() {\n throw arg;\n };\n }\n if (typeof setTimeout !== \"undefined\") {\n setTimeout(function () {\n fn(arg);\n }, 0);\n } else try {\n this._schedule(function () {\n fn(arg);\n });\n } catch (e) {\n throw new Error(\"No async scheduler available\\n\\n See http://goo.gl/MqrFmX\\n\");\n }\n };\n function AsyncInvokeLater(fn, receiver, arg) {\n this._lateQueue.push(fn, receiver, arg);\n this._queueTick();\n }\n function AsyncInvoke(fn, receiver, arg) {\n this._normalQueue.push(fn, receiver, arg);\n this._queueTick();\n }\n function AsyncSettlePromises(promise) {\n this._normalQueue._pushOne(promise);\n this._queueTick();\n }\n Async.prototype.invokeLater = AsyncInvokeLater;\n Async.prototype.invoke = AsyncInvoke;\n Async.prototype.settlePromises = AsyncSettlePromises;\n function _drainQueue(queue) {\n while (queue.length() > 0) {\n _drainQueueStep(queue);\n }\n }\n function _drainQueueStep(queue) {\n var fn = queue.shift();\n if (typeof fn !== \"function\") {\n fn._settlePromises();\n } else {\n var receiver = queue.shift();\n var arg = queue.shift();\n fn.call(receiver, arg);\n }\n }\n Async.prototype._drainQueues = function () {\n _drainQueue(this._normalQueue);\n this._reset();\n this._haveDrainedQueues = true;\n _drainQueue(this._lateQueue);\n };\n Async.prototype._queueTick = function () {\n if (!this._isTickUsed) {\n this._isTickUsed = true;\n this._schedule(this.drainQueues);\n }\n };\n Async.prototype._reset = function () {\n this._isTickUsed = false;\n };\n module.exports = Async;\n module.exports.firstLineError = firstLineError;\n }, {\n \"./queue\": 17,\n \"./schedule\": 18\n }],\n 2: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise, INTERNAL, tryConvertToPromise, debug) {\n var calledBind = false;\n var rejectThis = function rejectThis(_, e) {\n this._reject(e);\n };\n var targetRejected = function targetRejected(e, context) {\n context.promiseRejectionQueued = true;\n context.bindingPromise._then(rejectThis, rejectThis, null, this, e);\n };\n var bindingResolved = function bindingResolved(thisArg, context) {\n if ((this._bitField & 50397184) === 0) {\n this._resolveCallback(context.target);\n }\n };\n var bindingRejected = function bindingRejected(e, context) {\n if (!context.promiseRejectionQueued) this._reject(e);\n };\n Promise.prototype.bind = function (thisArg) {\n if (!calledBind) {\n calledBind = true;\n Promise.prototype._propagateFrom = debug.propagateFromFunction();\n Promise.prototype._boundValue = debug.boundValueFunction();\n }\n var maybePromise = tryConvertToPromise(thisArg);\n var ret = new Promise(INTERNAL);\n ret._propagateFrom(this, 1);\n var target = this._target();\n ret._setBoundTo(maybePromise);\n if (maybePromise instanceof Promise) {\n var context = {\n promiseRejectionQueued: false,\n promise: ret,\n target: target,\n bindingPromise: maybePromise\n };\n target._then(INTERNAL, targetRejected, undefined, ret, context);\n maybePromise._then(bindingResolved, bindingRejected, undefined, ret, context);\n ret._setOnCancel(maybePromise);\n } else {\n ret._resolveCallback(target);\n }\n return ret;\n };\n Promise.prototype._setBoundTo = function (obj) {\n if (obj !== undefined) {\n this._bitField = this._bitField | 2097152;\n this._boundTo = obj;\n } else {\n this._bitField = this._bitField & ~2097152;\n }\n };\n Promise.prototype._isBound = function () {\n return (this._bitField & 2097152) === 2097152;\n };\n Promise.bind = function (thisArg, value) {\n return Promise.resolve(value).bind(thisArg);\n };\n };\n }, {}],\n 3: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var old;\n if (typeof Promise !== \"undefined\") old = Promise;\n function noConflict() {\n try {\n if (Promise === bluebird) Promise = old;\n } catch (e) {}\n return bluebird;\n }\n var bluebird = _dereq_(\"./promise\")();\n bluebird.noConflict = noConflict;\n module.exports = bluebird;\n }, {\n \"./promise\": 15\n }],\n 4: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise, PromiseArray, apiRejection, debug) {\n var util = _dereq_(\"./util\");\n var tryCatch = util.tryCatch;\n var errorObj = util.errorObj;\n var async = Promise._async;\n Promise.prototype[\"break\"] = Promise.prototype.cancel = function () {\n if (!debug.cancellation()) return this._warn(\"cancellation is disabled\");\n var promise = this;\n var child = promise;\n while (promise._isCancellable()) {\n if (!promise._cancelBy(child)) {\n if (child._isFollowing()) {\n child._followee().cancel();\n } else {\n child._cancelBranched();\n }\n break;\n }\n var parent = promise._cancellationParent;\n if (parent == null || !parent._isCancellable()) {\n if (promise._isFollowing()) {\n promise._followee().cancel();\n } else {\n promise._cancelBranched();\n }\n break;\n } else {\n if (promise._isFollowing()) promise._followee().cancel();\n promise._setWillBeCancelled();\n child = promise;\n promise = parent;\n }\n }\n };\n Promise.prototype._branchHasCancelled = function () {\n this._branchesRemainingToCancel--;\n };\n Promise.prototype._enoughBranchesHaveCancelled = function () {\n return this._branchesRemainingToCancel === undefined || this._branchesRemainingToCancel <= 0;\n };\n Promise.prototype._cancelBy = function (canceller) {\n if (canceller === this) {\n this._branchesRemainingToCancel = 0;\n this._invokeOnCancel();\n return true;\n } else {\n this._branchHasCancelled();\n if (this._enoughBranchesHaveCancelled()) {\n this._invokeOnCancel();\n return true;\n }\n }\n return false;\n };\n Promise.prototype._cancelBranched = function () {\n if (this._enoughBranchesHaveCancelled()) {\n this._cancel();\n }\n };\n Promise.prototype._cancel = function () {\n if (!this._isCancellable()) return;\n this._setCancelled();\n async.invoke(this._cancelPromises, this, undefined);\n };\n Promise.prototype._cancelPromises = function () {\n if (this._length() > 0) this._settlePromises();\n };\n Promise.prototype._unsetOnCancel = function () {\n this._onCancelField = undefined;\n };\n Promise.prototype._isCancellable = function () {\n return this.isPending() && !this._isCancelled();\n };\n Promise.prototype.isCancellable = function () {\n return this.isPending() && !this.isCancelled();\n };\n Promise.prototype._doInvokeOnCancel = function (onCancelCallback, internalOnly) {\n if (util.isArray(onCancelCallback)) {\n for (var i = 0; i < onCancelCallback.length; ++i) {\n this._doInvokeOnCancel(onCancelCallback[i], internalOnly);\n }\n } else if (onCancelCallback !== undefined) {\n if (typeof onCancelCallback === \"function\") {\n if (!internalOnly) {\n var e = tryCatch(onCancelCallback).call(this._boundValue());\n if (e === errorObj) {\n this._attachExtraTrace(e.e);\n async.throwLater(e.e);\n }\n }\n } else {\n onCancelCallback._resultCancelled(this);\n }\n }\n };\n Promise.prototype._invokeOnCancel = function () {\n var onCancelCallback = this._onCancel();\n this._unsetOnCancel();\n async.invoke(this._doInvokeOnCancel, this, onCancelCallback);\n };\n Promise.prototype._invokeInternalOnCancel = function () {\n if (this._isCancellable()) {\n this._doInvokeOnCancel(this._onCancel(), true);\n this._unsetOnCancel();\n }\n };\n Promise.prototype._resultCancelled = function () {\n this.cancel();\n };\n };\n }, {\n \"./util\": 21\n }],\n 5: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (NEXT_FILTER) {\n var util = _dereq_(\"./util\");\n var getKeys = _dereq_(\"./es5\").keys;\n var tryCatch = util.tryCatch;\n var errorObj = util.errorObj;\n function catchFilter(instances, cb, promise) {\n return function (e) {\n var boundTo = promise._boundValue();\n predicateLoop: for (var i = 0; i < instances.length; ++i) {\n var item = instances[i];\n if (item === Error || item != null && item.prototype instanceof Error) {\n if (e instanceof item) {\n return tryCatch(cb).call(boundTo, e);\n }\n } else if (typeof item === \"function\") {\n var matchesPredicate = tryCatch(item).call(boundTo, e);\n if (matchesPredicate === errorObj) {\n return matchesPredicate;\n } else if (matchesPredicate) {\n return tryCatch(cb).call(boundTo, e);\n }\n } else if (util.isObject(e)) {\n var keys = getKeys(item);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n if (item[key] != e[key]) {\n continue predicateLoop;\n }\n }\n return tryCatch(cb).call(boundTo, e);\n }\n }\n return NEXT_FILTER;\n };\n }\n return catchFilter;\n };\n }, {\n \"./es5\": 10,\n \"./util\": 21\n }],\n 6: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise) {\n var longStackTraces = false;\n var contextStack = [];\n Promise.prototype._promiseCreated = function () {};\n Promise.prototype._pushContext = function () {};\n Promise.prototype._popContext = function () {\n return null;\n };\n Promise._peekContext = Promise.prototype._peekContext = function () {};\n function Context() {\n this._trace = new Context.CapturedTrace(peekContext());\n }\n Context.prototype._pushContext = function () {\n if (this._trace !== undefined) {\n this._trace._promiseCreated = null;\n contextStack.push(this._trace);\n }\n };\n Context.prototype._popContext = function () {\n if (this._trace !== undefined) {\n var trace = contextStack.pop();\n var ret = trace._promiseCreated;\n trace._promiseCreated = null;\n return ret;\n }\n return null;\n };\n function createContext() {\n if (longStackTraces) return new Context();\n }\n function peekContext() {\n var lastIndex = contextStack.length - 1;\n if (lastIndex >= 0) {\n return contextStack[lastIndex];\n }\n return undefined;\n }\n Context.CapturedTrace = null;\n Context.create = createContext;\n Context.deactivateLongStackTraces = function () {};\n Context.activateLongStackTraces = function () {\n var Promise_pushContext = Promise.prototype._pushContext;\n var Promise_popContext = Promise.prototype._popContext;\n var Promise_PeekContext = Promise._peekContext;\n var Promise_peekContext = Promise.prototype._peekContext;\n var Promise_promiseCreated = Promise.prototype._promiseCreated;\n Context.deactivateLongStackTraces = function () {\n Promise.prototype._pushContext = Promise_pushContext;\n Promise.prototype._popContext = Promise_popContext;\n Promise._peekContext = Promise_PeekContext;\n Promise.prototype._peekContext = Promise_peekContext;\n Promise.prototype._promiseCreated = Promise_promiseCreated;\n longStackTraces = false;\n };\n longStackTraces = true;\n Promise.prototype._pushContext = Context.prototype._pushContext;\n Promise.prototype._popContext = Context.prototype._popContext;\n Promise._peekContext = Promise.prototype._peekContext = peekContext;\n Promise.prototype._promiseCreated = function () {\n var ctx = this._peekContext();\n if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;\n };\n };\n return Context;\n };\n }, {}],\n 7: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise, Context, enableAsyncHooks, disableAsyncHooks) {\n var async = Promise._async;\n var Warning = _dereq_(\"./errors\").Warning;\n var util = _dereq_(\"./util\");\n var es5 = _dereq_(\"./es5\");\n var canAttachTrace = util.canAttachTrace;\n var unhandledRejectionHandled;\n var possiblyUnhandledRejection;\n var bluebirdFramePattern = /[\\\\\\/]bluebird[\\\\\\/]js[\\\\\\/](release|debug|instrumented)/;\n var nodeFramePattern = /\\((?:timers\\.js):\\d+:\\d+\\)/;\n var parseLinePattern = /[\\/<\\(](.+?):(\\d+):(\\d+)\\)?\\s*$/;\n var stackFramePattern = null;\n var formatStack = null;\n var indentStackFrames = false;\n var printWarning;\n var debugging = !!(util.env(\"BLUEBIRD_DEBUG\") != 0 && (true || util.env(\"BLUEBIRD_DEBUG\") || util.env(\"NODE_ENV\") === \"development\"));\n var warnings = !!(util.env(\"BLUEBIRD_WARNINGS\") != 0 && (debugging || util.env(\"BLUEBIRD_WARNINGS\")));\n var longStackTraces = !!(util.env(\"BLUEBIRD_LONG_STACK_TRACES\") != 0 && (debugging || util.env(\"BLUEBIRD_LONG_STACK_TRACES\")));\n var wForgottenReturn = util.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\") != 0 && (warnings || !!util.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\"));\n var deferUnhandledRejectionCheck;\n (function () {\n var promises = [];\n function unhandledRejectionCheck() {\n for (var i = 0; i < promises.length; ++i) {\n promises[i]._notifyUnhandledRejection();\n }\n unhandledRejectionClear();\n }\n function unhandledRejectionClear() {\n promises.length = 0;\n }\n deferUnhandledRejectionCheck = function deferUnhandledRejectionCheck(promise) {\n promises.push(promise);\n setTimeout(unhandledRejectionCheck, 1);\n };\n es5.defineProperty(Promise, \"_unhandledRejectionCheck\", {\n value: unhandledRejectionCheck\n });\n es5.defineProperty(Promise, \"_unhandledRejectionClear\", {\n value: unhandledRejectionClear\n });\n })();\n Promise.prototype.suppressUnhandledRejections = function () {\n var target = this._target();\n target._bitField = target._bitField & ~1048576 | 524288;\n };\n Promise.prototype._ensurePossibleRejectionHandled = function () {\n if ((this._bitField & 524288) !== 0) return;\n this._setRejectionIsUnhandled();\n deferUnhandledRejectionCheck(this);\n };\n Promise.prototype._notifyUnhandledRejectionIsHandled = function () {\n fireRejectionEvent(\"rejectionHandled\", unhandledRejectionHandled, undefined, this);\n };\n Promise.prototype._setReturnedNonUndefined = function () {\n this._bitField = this._bitField | 268435456;\n };\n Promise.prototype._returnedNonUndefined = function () {\n return (this._bitField & 268435456) !== 0;\n };\n Promise.prototype._notifyUnhandledRejection = function () {\n if (this._isRejectionUnhandled()) {\n var reason = this._settledValue();\n this._setUnhandledRejectionIsNotified();\n fireRejectionEvent(\"unhandledRejection\", possiblyUnhandledRejection, reason, this);\n }\n };\n Promise.prototype._setUnhandledRejectionIsNotified = function () {\n this._bitField = this._bitField | 262144;\n };\n Promise.prototype._unsetUnhandledRejectionIsNotified = function () {\n this._bitField = this._bitField & ~262144;\n };\n Promise.prototype._isUnhandledRejectionNotified = function () {\n return (this._bitField & 262144) > 0;\n };\n Promise.prototype._setRejectionIsUnhandled = function () {\n this._bitField = this._bitField | 1048576;\n };\n Promise.prototype._unsetRejectionIsUnhandled = function () {\n this._bitField = this._bitField & ~1048576;\n if (this._isUnhandledRejectionNotified()) {\n this._unsetUnhandledRejectionIsNotified();\n this._notifyUnhandledRejectionIsHandled();\n }\n };\n Promise.prototype._isRejectionUnhandled = function () {\n return (this._bitField & 1048576) > 0;\n };\n Promise.prototype._warn = function (message, shouldUseOwnTrace, promise) {\n return warn(message, shouldUseOwnTrace, promise || this);\n };\n Promise.onPossiblyUnhandledRejection = function (fn) {\n var context = Promise._getContext();\n possiblyUnhandledRejection = util.contextBind(context, fn);\n };\n Promise.onUnhandledRejectionHandled = function (fn) {\n var context = Promise._getContext();\n unhandledRejectionHandled = util.contextBind(context, fn);\n };\n var disableLongStackTraces = function disableLongStackTraces() {};\n Promise.longStackTraces = function () {\n if (async.haveItemsQueued() && !config.longStackTraces) {\n throw new Error(\"cannot enable long stack traces after promises have been created\\n\\n See http://goo.gl/MqrFmX\\n\");\n }\n if (!config.longStackTraces && longStackTracesIsSupported()) {\n var Promise_captureStackTrace = Promise.prototype._captureStackTrace;\n var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;\n var Promise_dereferenceTrace = Promise.prototype._dereferenceTrace;\n config.longStackTraces = true;\n disableLongStackTraces = function disableLongStackTraces() {\n if (async.haveItemsQueued() && !config.longStackTraces) {\n throw new Error(\"cannot enable long stack traces after promises have been created\\n\\n See http://goo.gl/MqrFmX\\n\");\n }\n Promise.prototype._captureStackTrace = Promise_captureStackTrace;\n Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;\n Promise.prototype._dereferenceTrace = Promise_dereferenceTrace;\n Context.deactivateLongStackTraces();\n config.longStackTraces = false;\n };\n Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;\n Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;\n Promise.prototype._dereferenceTrace = longStackTracesDereferenceTrace;\n Context.activateLongStackTraces();\n }\n };\n Promise.hasLongStackTraces = function () {\n return config.longStackTraces && longStackTracesIsSupported();\n };\n var legacyHandlers = {\n unhandledrejection: {\n before: function before() {\n var ret = util.global.onunhandledrejection;\n util.global.onunhandledrejection = null;\n return ret;\n },\n after: function after(fn) {\n util.global.onunhandledrejection = fn;\n }\n },\n rejectionhandled: {\n before: function before() {\n var ret = util.global.onrejectionhandled;\n util.global.onrejectionhandled = null;\n return ret;\n },\n after: function after(fn) {\n util.global.onrejectionhandled = fn;\n }\n }\n };\n var fireDomEvent = function () {\n var dispatch = function dispatch(legacy, e) {\n if (legacy) {\n var fn;\n try {\n fn = legacy.before();\n return !util.global.dispatchEvent(e);\n } finally {\n legacy.after(fn);\n }\n } else {\n return !util.global.dispatchEvent(e);\n }\n };\n try {\n if (typeof CustomEvent === \"function\") {\n var event = new CustomEvent(\"CustomEvent\");\n util.global.dispatchEvent(event);\n return function (name, event) {\n name = name.toLowerCase();\n var eventData = {\n detail: event,\n cancelable: true\n };\n var domEvent = new CustomEvent(name, eventData);\n es5.defineProperty(domEvent, \"promise\", {\n value: event.promise\n });\n es5.defineProperty(domEvent, \"reason\", {\n value: event.reason\n });\n return dispatch(legacyHandlers[name], domEvent);\n };\n } else if (typeof Event === \"function\") {\n var event = new Event(\"CustomEvent\");\n util.global.dispatchEvent(event);\n return function (name, event) {\n name = name.toLowerCase();\n var domEvent = new Event(name, {\n cancelable: true\n });\n domEvent.detail = event;\n es5.defineProperty(domEvent, \"promise\", {\n value: event.promise\n });\n es5.defineProperty(domEvent, \"reason\", {\n value: event.reason\n });\n return dispatch(legacyHandlers[name], domEvent);\n };\n } else {\n var event = document.createEvent(\"CustomEvent\");\n event.initCustomEvent(\"testingtheevent\", false, true, {});\n util.global.dispatchEvent(event);\n return function (name, event) {\n name = name.toLowerCase();\n var domEvent = document.createEvent(\"CustomEvent\");\n domEvent.initCustomEvent(name, false, true, event);\n return dispatch(legacyHandlers[name], domEvent);\n };\n }\n } catch (e) {}\n return function () {\n return false;\n };\n }();\n var fireGlobalEvent = function () {\n if (util.isNode) {\n return function () {\n return process.emit.apply(process, arguments);\n };\n } else {\n if (!util.global) {\n return function () {\n return false;\n };\n }\n return function (name) {\n var methodName = \"on\" + name.toLowerCase();\n var method = util.global[methodName];\n if (!method) return false;\n method.apply(util.global, [].slice.call(arguments, 1));\n return true;\n };\n }\n }();\n function generatePromiseLifecycleEventObject(name, promise) {\n return {\n promise: promise\n };\n }\n var eventToObjectGenerator = {\n promiseCreated: generatePromiseLifecycleEventObject,\n promiseFulfilled: generatePromiseLifecycleEventObject,\n promiseRejected: generatePromiseLifecycleEventObject,\n promiseResolved: generatePromiseLifecycleEventObject,\n promiseCancelled: generatePromiseLifecycleEventObject,\n promiseChained: function promiseChained(name, promise, child) {\n return {\n promise: promise,\n child: child\n };\n },\n warning: function warning(name, _warning) {\n return {\n warning: _warning\n };\n },\n unhandledRejection: function unhandledRejection(name, reason, promise) {\n return {\n reason: reason,\n promise: promise\n };\n },\n rejectionHandled: generatePromiseLifecycleEventObject\n };\n var activeFireEvent = function activeFireEvent(name) {\n var globalEventFired = false;\n try {\n globalEventFired = fireGlobalEvent.apply(null, arguments);\n } catch (e) {\n async.throwLater(e);\n globalEventFired = true;\n }\n var domEventFired = false;\n try {\n domEventFired = fireDomEvent(name, eventToObjectGenerator[name].apply(null, arguments));\n } catch (e) {\n async.throwLater(e);\n domEventFired = true;\n }\n return domEventFired || globalEventFired;\n };\n Promise.config = function (opts) {\n opts = Object(opts);\n if (\"longStackTraces\" in opts) {\n if (opts.longStackTraces) {\n Promise.longStackTraces();\n } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {\n disableLongStackTraces();\n }\n }\n if (\"warnings\" in opts) {\n var warningsOption = opts.warnings;\n config.warnings = !!warningsOption;\n wForgottenReturn = config.warnings;\n if (util.isObject(warningsOption)) {\n if (\"wForgottenReturn\" in warningsOption) {\n wForgottenReturn = !!warningsOption.wForgottenReturn;\n }\n }\n }\n if (\"cancellation\" in opts && opts.cancellation && !config.cancellation) {\n if (async.haveItemsQueued()) {\n throw new Error(\"cannot enable cancellation after promises are in use\");\n }\n Promise.prototype._clearCancellationData = cancellationClearCancellationData;\n Promise.prototype._propagateFrom = cancellationPropagateFrom;\n Promise.prototype._onCancel = cancellationOnCancel;\n Promise.prototype._setOnCancel = cancellationSetOnCancel;\n Promise.prototype._attachCancellationCallback = cancellationAttachCancellationCallback;\n Promise.prototype._execute = cancellationExecute;\n _propagateFromFunction = cancellationPropagateFrom;\n config.cancellation = true;\n }\n if (\"monitoring\" in opts) {\n if (opts.monitoring && !config.monitoring) {\n config.monitoring = true;\n Promise.prototype._fireEvent = activeFireEvent;\n } else if (!opts.monitoring && config.monitoring) {\n config.monitoring = false;\n Promise.prototype._fireEvent = defaultFireEvent;\n }\n }\n if (\"asyncHooks\" in opts && util.nodeSupportsAsyncResource) {\n var prev = config.asyncHooks;\n var cur = !!opts.asyncHooks;\n if (prev !== cur) {\n config.asyncHooks = cur;\n if (cur) {\n enableAsyncHooks();\n } else {\n disableAsyncHooks();\n }\n }\n }\n return Promise;\n };\n function defaultFireEvent() {\n return false;\n }\n Promise.prototype._fireEvent = defaultFireEvent;\n Promise.prototype._execute = function (executor, resolve, reject) {\n try {\n executor(resolve, reject);\n } catch (e) {\n return e;\n }\n };\n Promise.prototype._onCancel = function () {};\n Promise.prototype._setOnCancel = function (handler) {\n ;\n };\n Promise.prototype._attachCancellationCallback = function (onCancel) {\n ;\n };\n Promise.prototype._captureStackTrace = function () {};\n Promise.prototype._attachExtraTrace = function () {};\n Promise.prototype._dereferenceTrace = function () {};\n Promise.prototype._clearCancellationData = function () {};\n Promise.prototype._propagateFrom = function (parent, flags) {\n ;\n ;\n };\n function cancellationExecute(executor, resolve, reject) {\n var promise = this;\n try {\n executor(resolve, reject, function (onCancel) {\n if (typeof onCancel !== \"function\") {\n throw new TypeError(\"onCancel must be a function, got: \" + util.toString(onCancel));\n }\n promise._attachCancellationCallback(onCancel);\n });\n } catch (e) {\n return e;\n }\n }\n function cancellationAttachCancellationCallback(onCancel) {\n if (!this._isCancellable()) return this;\n var previousOnCancel = this._onCancel();\n if (previousOnCancel !== undefined) {\n if (util.isArray(previousOnCancel)) {\n previousOnCancel.push(onCancel);\n } else {\n this._setOnCancel([previousOnCancel, onCancel]);\n }\n } else {\n this._setOnCancel(onCancel);\n }\n }\n function cancellationOnCancel() {\n return this._onCancelField;\n }\n function cancellationSetOnCancel(onCancel) {\n this._onCancelField = onCancel;\n }\n function cancellationClearCancellationData() {\n this._cancellationParent = undefined;\n this._onCancelField = undefined;\n }\n function cancellationPropagateFrom(parent, flags) {\n if ((flags & 1) !== 0) {\n this._cancellationParent = parent;\n var branchesRemainingToCancel = parent._branchesRemainingToCancel;\n if (branchesRemainingToCancel === undefined) {\n branchesRemainingToCancel = 0;\n }\n parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;\n }\n if ((flags & 2) !== 0 && parent._isBound()) {\n this._setBoundTo(parent._boundTo);\n }\n }\n function bindingPropagateFrom(parent, flags) {\n if ((flags & 2) !== 0 && parent._isBound()) {\n this._setBoundTo(parent._boundTo);\n }\n }\n var _propagateFromFunction = bindingPropagateFrom;\n function _boundValueFunction() {\n var ret = this._boundTo;\n if (ret !== undefined) {\n if (ret instanceof Promise) {\n if (ret.isFulfilled()) {\n return ret.value();\n } else {\n return undefined;\n }\n }\n }\n return ret;\n }\n function longStackTracesCaptureStackTrace() {\n this._trace = new CapturedTrace(this._peekContext());\n }\n function longStackTracesAttachExtraTrace(error, ignoreSelf) {\n if (canAttachTrace(error)) {\n var trace = this._trace;\n if (trace !== undefined) {\n if (ignoreSelf) trace = trace._parent;\n }\n if (trace !== undefined) {\n trace.attachExtraTrace(error);\n } else if (!error.__stackCleaned__) {\n var parsed = parseStackAndMessage(error);\n util.notEnumerableProp(error, \"stack\", parsed.message + \"\\n\" + parsed.stack.join(\"\\n\"));\n util.notEnumerableProp(error, \"__stackCleaned__\", true);\n }\n }\n }\n function longStackTracesDereferenceTrace() {\n this._trace = undefined;\n }\n function checkForgottenReturns(returnValue, promiseCreated, name, promise, parent) {\n if (returnValue === undefined && promiseCreated !== null && wForgottenReturn) {\n if (parent !== undefined && parent._returnedNonUndefined()) return;\n if ((promise._bitField & 65535) === 0) return;\n if (name) name = name + \" \";\n var handlerLine = \"\";\n var creatorLine = \"\";\n if (promiseCreated._trace) {\n var traceLines = promiseCreated._trace.stack.split(\"\\n\");\n var stack = cleanStack(traceLines);\n for (var i = stack.length - 1; i >= 0; --i) {\n var line = stack[i];\n if (!nodeFramePattern.test(line)) {\n var lineMatches = line.match(parseLinePattern);\n if (lineMatches) {\n handlerLine = \"at \" + lineMatches[1] + \":\" + lineMatches[2] + \":\" + lineMatches[3] + \" \";\n }\n break;\n }\n }\n if (stack.length > 0) {\n var firstUserLine = stack[0];\n for (var i = 0; i < traceLines.length; ++i) {\n if (traceLines[i] === firstUserLine) {\n if (i > 0) {\n creatorLine = \"\\n\" + traceLines[i - 1];\n }\n break;\n }\n }\n }\n }\n var msg = \"a promise was created in a \" + name + \"handler \" + handlerLine + \"but was not returned from it, \" + \"see http://goo.gl/rRqMUw\" + creatorLine;\n promise._warn(msg, true, promiseCreated);\n }\n }\n function deprecated(name, replacement) {\n var message = name + \" is deprecated and will be removed in a future version.\";\n if (replacement) message += \" Use \" + replacement + \" instead.\";\n return warn(message);\n }\n function warn(message, shouldUseOwnTrace, promise) {\n if (!config.warnings) return;\n var warning = new Warning(message);\n var ctx;\n if (shouldUseOwnTrace) {\n promise._attachExtraTrace(warning);\n } else if (config.longStackTraces && (ctx = Promise._peekContext())) {\n ctx.attachExtraTrace(warning);\n } else {\n var parsed = parseStackAndMessage(warning);\n warning.stack = parsed.message + \"\\n\" + parsed.stack.join(\"\\n\");\n }\n if (!activeFireEvent(\"warning\", warning)) {\n formatAndLogError(warning, \"\", true);\n }\n }\n function reconstructStack(message, stacks) {\n for (var i = 0; i < stacks.length - 1; ++i) {\n stacks[i].push(\"From previous event:\");\n stacks[i] = stacks[i].join(\"\\n\");\n }\n if (i < stacks.length) {\n stacks[i] = stacks[i].join(\"\\n\");\n }\n return message + \"\\n\" + stacks.join(\"\\n\");\n }\n function removeDuplicateOrEmptyJumps(stacks) {\n for (var i = 0; i < stacks.length; ++i) {\n if (stacks[i].length === 0 || i + 1 < stacks.length && stacks[i][0] === stacks[i + 1][0]) {\n stacks.splice(i, 1);\n i--;\n }\n }\n }\n function removeCommonRoots(stacks) {\n var current = stacks[0];\n for (var i = 1; i < stacks.length; ++i) {\n var prev = stacks[i];\n var currentLastIndex = current.length - 1;\n var currentLastLine = current[currentLastIndex];\n var commonRootMeetPoint = -1;\n for (var j = prev.length - 1; j >= 0; --j) {\n if (prev[j] === currentLastLine) {\n commonRootMeetPoint = j;\n break;\n }\n }\n for (var j = commonRootMeetPoint; j >= 0; --j) {\n var line = prev[j];\n if (current[currentLastIndex] === line) {\n current.pop();\n currentLastIndex--;\n } else {\n break;\n }\n }\n current = prev;\n }\n }\n function cleanStack(stack) {\n var ret = [];\n for (var i = 0; i < stack.length; ++i) {\n var line = stack[i];\n var isTraceLine = \" (No stack trace)\" === line || stackFramePattern.test(line);\n var isInternalFrame = isTraceLine && shouldIgnore(line);\n if (isTraceLine && !isInternalFrame) {\n if (indentStackFrames && line.charAt(0) !== \" \") {\n line = \" \" + line;\n }\n ret.push(line);\n }\n }\n return ret;\n }\n function stackFramesAsArray(error) {\n var stack = error.stack.replace(/\\s+$/g, \"\").split(\"\\n\");\n for (var i = 0; i < stack.length; ++i) {\n var line = stack[i];\n if (\" (No stack trace)\" === line || stackFramePattern.test(line)) {\n break;\n }\n }\n if (i > 0 && error.name != \"SyntaxError\") {\n stack = stack.slice(i);\n }\n return stack;\n }\n function parseStackAndMessage(error) {\n var stack = error.stack;\n var message = error.toString();\n stack = typeof stack === \"string\" && stack.length > 0 ? stackFramesAsArray(error) : [\" (No stack trace)\"];\n return {\n message: message,\n stack: error.name == \"SyntaxError\" ? stack : cleanStack(stack)\n };\n }\n function formatAndLogError(error, title, isSoft) {\n if (typeof console !== \"undefined\") {\n var message;\n if (util.isObject(error)) {\n var stack = error.stack;\n message = title + formatStack(stack, error);\n } else {\n message = title + String(error);\n }\n if (typeof printWarning === \"function\") {\n printWarning(message, isSoft);\n } else if (typeof console.log === \"function\" || _typeof(console.log) === \"object\") {\n console.log(message);\n }\n }\n }\n function fireRejectionEvent(name, localHandler, reason, promise) {\n var localEventFired = false;\n try {\n if (typeof localHandler === \"function\") {\n localEventFired = true;\n if (name === \"rejectionHandled\") {\n localHandler(promise);\n } else {\n localHandler(reason, promise);\n }\n }\n } catch (e) {\n async.throwLater(e);\n }\n if (name === \"unhandledRejection\") {\n if (!activeFireEvent(name, reason, promise) && !localEventFired) {\n formatAndLogError(reason, \"Unhandled rejection \");\n }\n } else {\n activeFireEvent(name, promise);\n }\n }\n function formatNonError(obj) {\n var str;\n if (typeof obj === \"function\") {\n str = \"[function \" + (obj.name || \"anonymous\") + \"]\";\n } else {\n str = obj && typeof obj.toString === \"function\" ? obj.toString() : util.toString(obj);\n var ruselessToString = /\\[object [a-zA-Z0-9$_]+\\]/;\n if (ruselessToString.test(str)) {\n try {\n var newStr = JSON.stringify(obj);\n str = newStr;\n } catch (e) {}\n }\n if (str.length === 0) {\n str = \"(empty array)\";\n }\n }\n return \"(<\" + snip(str) + \">, no stack trace)\";\n }\n function snip(str) {\n var maxChars = 41;\n if (str.length < maxChars) {\n return str;\n }\n return str.substr(0, maxChars - 3) + \"...\";\n }\n function longStackTracesIsSupported() {\n return typeof captureStackTrace === \"function\";\n }\n var shouldIgnore = function shouldIgnore() {\n return false;\n };\n var parseLineInfoRegex = /[\\/<\\(]([^:\\/]+):(\\d+):(?:\\d+)\\)?\\s*$/;\n function parseLineInfo(line) {\n var matches = line.match(parseLineInfoRegex);\n if (matches) {\n return {\n fileName: matches[1],\n line: parseInt(matches[2], 10)\n };\n }\n }\n function setBounds(firstLineError, lastLineError) {\n if (!longStackTracesIsSupported()) return;\n var firstStackLines = (firstLineError.stack || \"\").split(\"\\n\");\n var lastStackLines = (lastLineError.stack || \"\").split(\"\\n\");\n var firstIndex = -1;\n var lastIndex = -1;\n var firstFileName;\n var lastFileName;\n for (var i = 0; i < firstStackLines.length; ++i) {\n var result = parseLineInfo(firstStackLines[i]);\n if (result) {\n firstFileName = result.fileName;\n firstIndex = result.line;\n break;\n }\n }\n for (var i = 0; i < lastStackLines.length; ++i) {\n var result = parseLineInfo(lastStackLines[i]);\n if (result) {\n lastFileName = result.fileName;\n lastIndex = result.line;\n break;\n }\n }\n if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex) {\n return;\n }\n shouldIgnore = function shouldIgnore(line) {\n if (bluebirdFramePattern.test(line)) return true;\n var info = parseLineInfo(line);\n if (info) {\n if (info.fileName === firstFileName && firstIndex <= info.line && info.line <= lastIndex) {\n return true;\n }\n }\n return false;\n };\n }\n function CapturedTrace(parent) {\n this._parent = parent;\n this._promisesCreated = 0;\n var length = this._length = 1 + (parent === undefined ? 0 : parent._length);\n captureStackTrace(this, CapturedTrace);\n if (length > 32) this.uncycle();\n }\n util.inherits(CapturedTrace, Error);\n Context.CapturedTrace = CapturedTrace;\n CapturedTrace.prototype.uncycle = function () {\n var length = this._length;\n if (length < 2) return;\n var nodes = [];\n var stackToIndex = {};\n for (var i = 0, node = this; node !== undefined; ++i) {\n nodes.push(node);\n node = node._parent;\n }\n length = this._length = i;\n for (var i = length - 1; i >= 0; --i) {\n var stack = nodes[i].stack;\n if (stackToIndex[stack] === undefined) {\n stackToIndex[stack] = i;\n }\n }\n for (var i = 0; i < length; ++i) {\n var currentStack = nodes[i].stack;\n var index = stackToIndex[currentStack];\n if (index !== undefined && index !== i) {\n if (index > 0) {\n nodes[index - 1]._parent = undefined;\n nodes[index - 1]._length = 1;\n }\n nodes[i]._parent = undefined;\n nodes[i]._length = 1;\n var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;\n if (index < length - 1) {\n cycleEdgeNode._parent = nodes[index + 1];\n cycleEdgeNode._parent.uncycle();\n cycleEdgeNode._length = cycleEdgeNode._parent._length + 1;\n } else {\n cycleEdgeNode._parent = undefined;\n cycleEdgeNode._length = 1;\n }\n var currentChildLength = cycleEdgeNode._length + 1;\n for (var j = i - 2; j >= 0; --j) {\n nodes[j]._length = currentChildLength;\n currentChildLength++;\n }\n return;\n }\n }\n };\n CapturedTrace.prototype.attachExtraTrace = function (error) {\n if (error.__stackCleaned__) return;\n this.uncycle();\n var parsed = parseStackAndMessage(error);\n var message = parsed.message;\n var stacks = [parsed.stack];\n var trace = this;\n while (trace !== undefined) {\n stacks.push(cleanStack(trace.stack.split(\"\\n\")));\n trace = trace._parent;\n }\n removeCommonRoots(stacks);\n removeDuplicateOrEmptyJumps(stacks);\n util.notEnumerableProp(error, \"stack\", reconstructStack(message, stacks));\n util.notEnumerableProp(error, \"__stackCleaned__\", true);\n };\n var captureStackTrace = function stackDetection() {\n var v8stackFramePattern = /^\\s*at\\s*/;\n var v8stackFormatter = function v8stackFormatter(stack, error) {\n if (typeof stack === \"string\") return stack;\n if (error.name !== undefined && error.message !== undefined) {\n return error.toString();\n }\n return formatNonError(error);\n };\n if (typeof Error.stackTraceLimit === \"number\" && typeof Error.captureStackTrace === \"function\") {\n Error.stackTraceLimit += 6;\n stackFramePattern = v8stackFramePattern;\n formatStack = v8stackFormatter;\n var captureStackTrace = Error.captureStackTrace;\n shouldIgnore = function shouldIgnore(line) {\n return bluebirdFramePattern.test(line);\n };\n return function (receiver, ignoreUntil) {\n Error.stackTraceLimit += 6;\n captureStackTrace(receiver, ignoreUntil);\n Error.stackTraceLimit -= 6;\n };\n }\n var err = new Error();\n if (typeof err.stack === \"string\" && err.stack.split(\"\\n\")[0].indexOf(\"stackDetection@\") >= 0) {\n stackFramePattern = /@/;\n formatStack = v8stackFormatter;\n indentStackFrames = true;\n return function captureStackTrace(o) {\n o.stack = new Error().stack;\n };\n }\n var hasStackAfterThrow;\n try {\n throw new Error();\n } catch (e) {\n hasStackAfterThrow = \"stack\" in e;\n }\n if (!(\"stack\" in err) && hasStackAfterThrow && typeof Error.stackTraceLimit === \"number\") {\n stackFramePattern = v8stackFramePattern;\n formatStack = v8stackFormatter;\n return function captureStackTrace(o) {\n Error.stackTraceLimit += 6;\n try {\n throw new Error();\n } catch (e) {\n o.stack = e.stack;\n }\n Error.stackTraceLimit -= 6;\n };\n }\n formatStack = function formatStack(stack, error) {\n if (typeof stack === \"string\") return stack;\n if ((_typeof(error) === \"object\" || typeof error === \"function\") && error.name !== undefined && error.message !== undefined) {\n return error.toString();\n }\n return formatNonError(error);\n };\n return null;\n }([]);\n if (typeof console !== \"undefined\" && typeof console.warn !== \"undefined\") {\n printWarning = function printWarning(message) {\n console.warn(message);\n };\n if (util.isNode && process.stderr.isTTY) {\n printWarning = function printWarning(message, isSoft) {\n var color = isSoft ? \"\\x1B[33m\" : \"\\x1B[31m\";\n console.warn(color + message + \"\\x1B[0m\\n\");\n };\n } else if (!util.isNode && typeof new Error().stack === \"string\") {\n printWarning = function printWarning(message, isSoft) {\n console.warn(\"%c\" + message, isSoft ? \"color: darkorange\" : \"color: red\");\n };\n }\n }\n var config = {\n warnings: warnings,\n longStackTraces: false,\n cancellation: false,\n monitoring: false,\n asyncHooks: false\n };\n if (longStackTraces) Promise.longStackTraces();\n return {\n asyncHooks: function asyncHooks() {\n return config.asyncHooks;\n },\n longStackTraces: function longStackTraces() {\n return config.longStackTraces;\n },\n warnings: function warnings() {\n return config.warnings;\n },\n cancellation: function cancellation() {\n return config.cancellation;\n },\n monitoring: function monitoring() {\n return config.monitoring;\n },\n propagateFromFunction: function propagateFromFunction() {\n return _propagateFromFunction;\n },\n boundValueFunction: function boundValueFunction() {\n return _boundValueFunction;\n },\n checkForgottenReturns: checkForgottenReturns,\n setBounds: setBounds,\n warn: warn,\n deprecated: deprecated,\n CapturedTrace: CapturedTrace,\n fireDomEvent: fireDomEvent,\n fireGlobalEvent: fireGlobalEvent\n };\n };\n }, {\n \"./errors\": 9,\n \"./es5\": 10,\n \"./util\": 21\n }],\n 8: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise) {\n function returner() {\n return this.value;\n }\n function thrower() {\n throw this.reason;\n }\n Promise.prototype[\"return\"] = Promise.prototype.thenReturn = function (value) {\n if (value instanceof Promise) value.suppressUnhandledRejections();\n return this._then(returner, undefined, undefined, {\n value: value\n }, undefined);\n };\n Promise.prototype[\"throw\"] = Promise.prototype.thenThrow = function (reason) {\n return this._then(thrower, undefined, undefined, {\n reason: reason\n }, undefined);\n };\n Promise.prototype.catchThrow = function (reason) {\n if (arguments.length <= 1) {\n return this._then(undefined, thrower, undefined, {\n reason: reason\n }, undefined);\n } else {\n var _reason = arguments[1];\n var handler = function handler() {\n throw _reason;\n };\n return this.caught(reason, handler);\n }\n };\n Promise.prototype.catchReturn = function (value) {\n if (arguments.length <= 1) {\n if (value instanceof Promise) value.suppressUnhandledRejections();\n return this._then(undefined, returner, undefined, {\n value: value\n }, undefined);\n } else {\n var _value = arguments[1];\n if (_value instanceof Promise) _value.suppressUnhandledRejections();\n var handler = function handler() {\n return _value;\n };\n return this.caught(value, handler);\n }\n };\n };\n }, {}],\n 9: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var es5 = _dereq_(\"./es5\");\n var Objectfreeze = es5.freeze;\n var util = _dereq_(\"./util\");\n var inherits = util.inherits;\n var notEnumerableProp = util.notEnumerableProp;\n function subError(nameProperty, defaultMessage) {\n function SubError(message) {\n if (!(this instanceof SubError)) return new SubError(message);\n notEnumerableProp(this, \"message\", typeof message === \"string\" ? message : defaultMessage);\n notEnumerableProp(this, \"name\", nameProperty);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n Error.call(this);\n }\n }\n inherits(SubError, Error);\n return SubError;\n }\n var _TypeError, _RangeError;\n var Warning = subError(\"Warning\", \"warning\");\n var CancellationError = subError(\"CancellationError\", \"cancellation error\");\n var TimeoutError = subError(\"TimeoutError\", \"timeout error\");\n var AggregateError = subError(\"AggregateError\", \"aggregate error\");\n try {\n _TypeError = TypeError;\n _RangeError = RangeError;\n } catch (e) {\n _TypeError = subError(\"TypeError\", \"type error\");\n _RangeError = subError(\"RangeError\", \"range error\");\n }\n var methods = (\"join pop push shift unshift slice filter forEach some \" + \"every map indexOf lastIndexOf reduce reduceRight sort reverse\").split(\" \");\n for (var i = 0; i < methods.length; ++i) {\n if (typeof Array.prototype[methods[i]] === \"function\") {\n AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];\n }\n }\n es5.defineProperty(AggregateError.prototype, \"length\", {\n value: 0,\n configurable: false,\n writable: true,\n enumerable: true\n });\n AggregateError.prototype[\"isOperational\"] = true;\n var level = 0;\n AggregateError.prototype.toString = function () {\n var indent = Array(level * 4 + 1).join(\" \");\n var ret = \"\\n\" + indent + \"AggregateError of:\" + \"\\n\";\n level++;\n indent = Array(level * 4 + 1).join(\" \");\n for (var i = 0; i < this.length; ++i) {\n var str = this[i] === this ? \"[Circular AggregateError]\" : this[i] + \"\";\n var lines = str.split(\"\\n\");\n for (var j = 0; j < lines.length; ++j) {\n lines[j] = indent + lines[j];\n }\n str = lines.join(\"\\n\");\n ret += str + \"\\n\";\n }\n level--;\n return ret;\n };\n function OperationalError(message) {\n if (!(this instanceof OperationalError)) return new OperationalError(message);\n notEnumerableProp(this, \"name\", \"OperationalError\");\n notEnumerableProp(this, \"message\", message);\n this.cause = message;\n this[\"isOperational\"] = true;\n if (message instanceof Error) {\n notEnumerableProp(this, \"message\", message.message);\n notEnumerableProp(this, \"stack\", message.stack);\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n inherits(OperationalError, Error);\n var errorTypes = Error[\"__BluebirdErrorTypes__\"];\n if (!errorTypes) {\n errorTypes = Objectfreeze({\n CancellationError: CancellationError,\n TimeoutError: TimeoutError,\n OperationalError: OperationalError,\n RejectionError: OperationalError,\n AggregateError: AggregateError\n });\n es5.defineProperty(Error, \"__BluebirdErrorTypes__\", {\n value: errorTypes,\n writable: false,\n enumerable: false,\n configurable: false\n });\n }\n module.exports = {\n Error: Error,\n TypeError: _TypeError,\n RangeError: _RangeError,\n CancellationError: errorTypes.CancellationError,\n OperationalError: errorTypes.OperationalError,\n TimeoutError: errorTypes.TimeoutError,\n AggregateError: errorTypes.AggregateError,\n Warning: Warning\n };\n }, {\n \"./es5\": 10,\n \"./util\": 21\n }],\n 10: [function (_dereq_, module, exports) {\n var isES5 = function () {\n \"use strict\";\n\n return this === undefined;\n }();\n if (isES5) {\n module.exports = {\n freeze: Object.freeze,\n defineProperty: Object.defineProperty,\n getDescriptor: Object.getOwnPropertyDescriptor,\n keys: Object.keys,\n names: Object.getOwnPropertyNames,\n getPrototypeOf: Object.getPrototypeOf,\n isArray: Array.isArray,\n isES5: isES5,\n propertyIsWritable: function propertyIsWritable(obj, prop) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n return !!(!descriptor || descriptor.writable || descriptor.set);\n }\n };\n } else {\n var has = {}.hasOwnProperty;\n var str = {}.toString;\n var proto = {}.constructor.prototype;\n var ObjectKeys = function ObjectKeys(o) {\n var ret = [];\n for (var key in o) {\n if (has.call(o, key)) {\n ret.push(key);\n }\n }\n return ret;\n };\n var ObjectGetDescriptor = function ObjectGetDescriptor(o, key) {\n return {\n value: o[key]\n };\n };\n var ObjectDefineProperty = function ObjectDefineProperty(o, key, desc) {\n o[key] = desc.value;\n return o;\n };\n var ObjectFreeze = function ObjectFreeze(obj) {\n return obj;\n };\n var ObjectGetPrototypeOf = function ObjectGetPrototypeOf(obj) {\n try {\n return Object(obj).constructor.prototype;\n } catch (e) {\n return proto;\n }\n };\n var ArrayIsArray = function ArrayIsArray(obj) {\n try {\n return str.call(obj) === \"[object Array]\";\n } catch (e) {\n return false;\n }\n };\n module.exports = {\n isArray: ArrayIsArray,\n keys: ObjectKeys,\n names: ObjectKeys,\n defineProperty: ObjectDefineProperty,\n getDescriptor: ObjectGetDescriptor,\n freeze: ObjectFreeze,\n getPrototypeOf: ObjectGetPrototypeOf,\n isES5: isES5,\n propertyIsWritable: function propertyIsWritable() {\n return true;\n }\n };\n }\n }, {}],\n 11: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise, tryConvertToPromise, NEXT_FILTER) {\n var util = _dereq_(\"./util\");\n var CancellationError = Promise.CancellationError;\n var errorObj = util.errorObj;\n var catchFilter = _dereq_(\"./catch_filter\")(NEXT_FILTER);\n function PassThroughHandlerContext(promise, type, handler) {\n this.promise = promise;\n this.type = type;\n this.handler = handler;\n this.called = false;\n this.cancelPromise = null;\n }\n PassThroughHandlerContext.prototype.isFinallyHandler = function () {\n return this.type === 0;\n };\n function FinallyHandlerCancelReaction(finallyHandler) {\n this.finallyHandler = finallyHandler;\n }\n FinallyHandlerCancelReaction.prototype._resultCancelled = function () {\n checkCancel(this.finallyHandler);\n };\n function checkCancel(ctx, reason) {\n if (ctx.cancelPromise != null) {\n if (arguments.length > 1) {\n ctx.cancelPromise._reject(reason);\n } else {\n ctx.cancelPromise._cancel();\n }\n ctx.cancelPromise = null;\n return true;\n }\n return false;\n }\n function succeed() {\n return finallyHandler.call(this, this.promise._target()._settledValue());\n }\n function fail(reason) {\n if (checkCancel(this, reason)) return;\n errorObj.e = reason;\n return errorObj;\n }\n function finallyHandler(reasonOrValue) {\n var promise = this.promise;\n var handler = this.handler;\n if (!this.called) {\n this.called = true;\n var ret = this.isFinallyHandler() ? handler.call(promise._boundValue()) : handler.call(promise._boundValue(), reasonOrValue);\n if (ret === NEXT_FILTER) {\n return ret;\n } else if (ret !== undefined) {\n promise._setReturnedNonUndefined();\n var maybePromise = tryConvertToPromise(ret, promise);\n if (maybePromise instanceof Promise) {\n if (this.cancelPromise != null) {\n if (maybePromise._isCancelled()) {\n var reason = new CancellationError(\"late cancellation observer\");\n promise._attachExtraTrace(reason);\n errorObj.e = reason;\n return errorObj;\n } else if (maybePromise.isPending()) {\n maybePromise._attachCancellationCallback(new FinallyHandlerCancelReaction(this));\n }\n }\n return maybePromise._then(succeed, fail, undefined, this, undefined);\n }\n }\n }\n if (promise.isRejected()) {\n checkCancel(this);\n errorObj.e = reasonOrValue;\n return errorObj;\n } else {\n checkCancel(this);\n return reasonOrValue;\n }\n }\n Promise.prototype._passThrough = function (handler, type, success, fail) {\n if (typeof handler !== \"function\") return this.then();\n return this._then(success, fail, undefined, new PassThroughHandlerContext(this, type, handler), undefined);\n };\n Promise.prototype.lastly = Promise.prototype[\"finally\"] = function (handler) {\n return this._passThrough(handler, 0, finallyHandler, finallyHandler);\n };\n Promise.prototype.tap = function (handler) {\n return this._passThrough(handler, 1, finallyHandler);\n };\n Promise.prototype.tapCatch = function (handlerOrPredicate) {\n var len = arguments.length;\n if (len === 1) {\n return this._passThrough(handlerOrPredicate, 1, undefined, finallyHandler);\n } else {\n var catchInstances = new Array(len - 1),\n j = 0,\n i;\n for (i = 0; i < len - 1; ++i) {\n var item = arguments[i];\n if (util.isObject(item)) {\n catchInstances[j++] = item;\n } else {\n return Promise.reject(new TypeError(\"tapCatch statement predicate: \" + \"expecting an object but got \" + util.classString(item)));\n }\n }\n catchInstances.length = j;\n var handler = arguments[i];\n return this._passThrough(catchFilter(catchInstances, handler, this), 1, undefined, finallyHandler);\n }\n };\n return PassThroughHandlerContext;\n };\n }, {\n \"./catch_filter\": 5,\n \"./util\": 21\n }],\n 12: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise, PromiseArray, tryConvertToPromise, INTERNAL, async) {\n var util = _dereq_(\"./util\");\n var canEvaluate = util.canEvaluate;\n var tryCatch = util.tryCatch;\n var errorObj = util.errorObj;\n var reject;\n if (!true) {\n if (canEvaluate) {\n var thenCallback = function thenCallback(i) {\n return new Function(\"value\", \"holder\", \" \\n\\\n 'use strict'; \\n\\\n holder.pIndex = value; \\n\\\n holder.checkFulfillment(this); \\n\\\n \".replace(/Index/g, i));\n };\n var promiseSetter = function promiseSetter(i) {\n return new Function(\"promise\", \"holder\", \" \\n\\\n 'use strict'; \\n\\\n holder.pIndex = promise; \\n\\\n \".replace(/Index/g, i));\n };\n var generateHolderClass = function generateHolderClass(total) {\n var props = new Array(total);\n for (var i = 0; i < props.length; ++i) {\n props[i] = \"this.p\" + (i + 1);\n }\n var assignment = props.join(\" = \") + \" = null;\";\n var cancellationCode = \"var promise;\\n\" + props.map(function (prop) {\n return \" \\n\\\n promise = \" + prop + \"; \\n\\\n if (promise instanceof Promise) { \\n\\\n promise.cancel(); \\n\\\n } \\n\\\n \";\n }).join(\"\\n\");\n var passedArguments = props.join(\", \");\n var name = \"Holder$\" + total;\n var code = \"return function(tryCatch, errorObj, Promise, async) { \\n\\\n 'use strict'; \\n\\\n function [TheName](fn) { \\n\\\n [TheProperties] \\n\\\n this.fn = fn; \\n\\\n this.asyncNeeded = true; \\n\\\n this.now = 0; \\n\\\n } \\n\\\n \\n\\\n [TheName].prototype._callFunction = function(promise) { \\n\\\n promise._pushContext(); \\n\\\n var ret = tryCatch(this.fn)([ThePassedArguments]); \\n\\\n promise._popContext(); \\n\\\n if (ret === errorObj) { \\n\\\n promise._rejectCallback(ret.e, false); \\n\\\n } else { \\n\\\n promise._resolveCallback(ret); \\n\\\n } \\n\\\n }; \\n\\\n \\n\\\n [TheName].prototype.checkFulfillment = function(promise) { \\n\\\n var now = ++this.now; \\n\\\n if (now === [TheTotal]) { \\n\\\n if (this.asyncNeeded) { \\n\\\n async.invoke(this._callFunction, this, promise); \\n\\\n } else { \\n\\\n this._callFunction(promise); \\n\\\n } \\n\\\n \\n\\\n } \\n\\\n }; \\n\\\n \\n\\\n [TheName].prototype._resultCancelled = function() { \\n\\\n [CancellationCode] \\n\\\n }; \\n\\\n \\n\\\n return [TheName]; \\n\\\n }(tryCatch, errorObj, Promise, async); \\n\\\n \";\n code = code.replace(/\\[TheName\\]/g, name).replace(/\\[TheTotal\\]/g, total).replace(/\\[ThePassedArguments\\]/g, passedArguments).replace(/\\[TheProperties\\]/g, assignment).replace(/\\[CancellationCode\\]/g, cancellationCode);\n return new Function(\"tryCatch\", \"errorObj\", \"Promise\", \"async\", code)(tryCatch, errorObj, Promise, async);\n };\n var holderClasses = [];\n var thenCallbacks = [];\n var promiseSetters = [];\n for (var i = 0; i < 8; ++i) {\n holderClasses.push(generateHolderClass(i + 1));\n thenCallbacks.push(thenCallback(i + 1));\n promiseSetters.push(promiseSetter(i + 1));\n }\n reject = function reject(reason) {\n this._reject(reason);\n };\n }\n }\n Promise.join = function () {\n var last = arguments.length - 1;\n var fn;\n if (last > 0 && typeof arguments[last] === \"function\") {\n fn = arguments[last];\n if (!true) {\n if (last <= 8 && canEvaluate) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n var HolderClass = holderClasses[last - 1];\n var holder = new HolderClass(fn);\n var callbacks = thenCallbacks;\n for (var i = 0; i < last; ++i) {\n var maybePromise = tryConvertToPromise(arguments[i], ret);\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if ((bitField & 50397184) === 0) {\n maybePromise._then(callbacks[i], reject, undefined, ret, holder);\n promiseSetters[i](maybePromise, holder);\n holder.asyncNeeded = false;\n } else if ((bitField & 33554432) !== 0) {\n callbacks[i].call(ret, maybePromise._value(), holder);\n } else if ((bitField & 16777216) !== 0) {\n ret._reject(maybePromise._reason());\n } else {\n ret._cancel();\n }\n } else {\n callbacks[i].call(ret, maybePromise, holder);\n }\n }\n if (!ret._isFateSealed()) {\n if (holder.asyncNeeded) {\n var context = Promise._getContext();\n holder.fn = util.contextBind(context, holder.fn);\n }\n ret._setAsyncGuaranteed();\n ret._setOnCancel(holder);\n }\n return ret;\n }\n }\n }\n var args = [].slice.call(arguments);\n ;\n if (fn) args.pop();\n var ret = new PromiseArray(args).promise();\n return fn !== undefined ? ret.spread(fn) : ret;\n };\n };\n }, {\n \"./util\": 21\n }],\n 13: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {\n var util = _dereq_(\"./util\");\n var tryCatch = util.tryCatch;\n Promise.method = function (fn) {\n if (typeof fn !== \"function\") {\n throw new Promise.TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n return function () {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._pushContext();\n var value = tryCatch(fn).apply(this, arguments);\n var promiseCreated = ret._popContext();\n debug.checkForgottenReturns(value, promiseCreated, \"Promise.method\", ret);\n ret._resolveFromSyncValue(value);\n return ret;\n };\n };\n Promise.attempt = Promise[\"try\"] = function (fn) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._pushContext();\n var value;\n if (arguments.length > 1) {\n debug.deprecated(\"calling Promise.try with more than 1 argument\");\n var arg = arguments[1];\n var ctx = arguments[2];\n value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) : tryCatch(fn).call(ctx, arg);\n } else {\n value = tryCatch(fn)();\n }\n var promiseCreated = ret._popContext();\n debug.checkForgottenReturns(value, promiseCreated, \"Promise.try\", ret);\n ret._resolveFromSyncValue(value);\n return ret;\n };\n Promise.prototype._resolveFromSyncValue = function (value) {\n if (value === util.errorObj) {\n this._rejectCallback(value.e, false);\n } else {\n this._resolveCallback(value, true);\n }\n };\n };\n }, {\n \"./util\": 21\n }],\n 14: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var util = _dereq_(\"./util\");\n var maybeWrapAsError = util.maybeWrapAsError;\n var errors = _dereq_(\"./errors\");\n var OperationalError = errors.OperationalError;\n var es5 = _dereq_(\"./es5\");\n function isUntypedError(obj) {\n return obj instanceof Error && es5.getPrototypeOf(obj) === Error.prototype;\n }\n var rErrorKey = /^(?:name|message|stack|cause)$/;\n function wrapAsOperationalError(obj) {\n var ret;\n if (isUntypedError(obj)) {\n ret = new OperationalError(obj);\n ret.name = obj.name;\n ret.message = obj.message;\n ret.stack = obj.stack;\n var keys = es5.keys(obj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!rErrorKey.test(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n }\n util.markAsOriginatingFromRejection(obj);\n return obj;\n }\n function nodebackForPromise(promise, multiArgs) {\n return function (err, value) {\n if (promise === null) return;\n if (err) {\n var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\n promise._attachExtraTrace(wrapped);\n promise._reject(wrapped);\n } else if (!multiArgs) {\n promise._fulfill(value);\n } else {\n var args = [].slice.call(arguments, 1);\n ;\n promise._fulfill(args);\n }\n promise = null;\n };\n }\n module.exports = nodebackForPromise;\n }, {\n \"./errors\": 9,\n \"./es5\": 10,\n \"./util\": 21\n }],\n 15: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function () {\n var makeSelfResolutionError = function makeSelfResolutionError() {\n return new TypeError(\"circular promise resolution chain\\n\\n See http://goo.gl/MqrFmX\\n\");\n };\n var reflectHandler = function reflectHandler() {\n return new Promise.PromiseInspection(this._target());\n };\n var apiRejection = function apiRejection(msg) {\n return Promise.reject(new TypeError(msg));\n };\n function Proxyable() {}\n var UNDEFINED_BINDING = {};\n var util = _dereq_(\"./util\");\n util.setReflectHandler(reflectHandler);\n var getDomain = function getDomain() {\n var domain = process.domain;\n if (domain === undefined) {\n return null;\n }\n return domain;\n };\n var getContextDefault = function getContextDefault() {\n return null;\n };\n var getContextDomain = function getContextDomain() {\n return {\n domain: getDomain(),\n async: null\n };\n };\n var AsyncResource = util.isNode && util.nodeSupportsAsyncResource ? _dereq_(\"async_hooks\").AsyncResource : null;\n var getContextAsyncHooks = function getContextAsyncHooks() {\n return {\n domain: getDomain(),\n async: new AsyncResource(\"Bluebird::Promise\")\n };\n };\n var getContext = util.isNode ? getContextDomain : getContextDefault;\n util.notEnumerableProp(Promise, \"_getContext\", getContext);\n var enableAsyncHooks = function enableAsyncHooks() {\n getContext = getContextAsyncHooks;\n util.notEnumerableProp(Promise, \"_getContext\", getContextAsyncHooks);\n };\n var disableAsyncHooks = function disableAsyncHooks() {\n getContext = getContextDomain;\n util.notEnumerableProp(Promise, \"_getContext\", getContextDomain);\n };\n var es5 = _dereq_(\"./es5\");\n var Async = _dereq_(\"./async\");\n var async = new Async();\n es5.defineProperty(Promise, \"_async\", {\n value: async\n });\n var errors = _dereq_(\"./errors\");\n var TypeError = Promise.TypeError = errors.TypeError;\n Promise.RangeError = errors.RangeError;\n var CancellationError = Promise.CancellationError = errors.CancellationError;\n Promise.TimeoutError = errors.TimeoutError;\n Promise.OperationalError = errors.OperationalError;\n Promise.RejectionError = errors.OperationalError;\n Promise.AggregateError = errors.AggregateError;\n var INTERNAL = function INTERNAL() {};\n var APPLY = {};\n var NEXT_FILTER = {};\n var tryConvertToPromise = _dereq_(\"./thenables\")(Promise, INTERNAL);\n var PromiseArray = _dereq_(\"./promise_array\")(Promise, INTERNAL, tryConvertToPromise, apiRejection, Proxyable);\n var Context = _dereq_(\"./context\")(Promise);\n /*jshint unused:false*/\n var createContext = Context.create;\n var debug = _dereq_(\"./debuggability\")(Promise, Context, enableAsyncHooks, disableAsyncHooks);\n var CapturedTrace = debug.CapturedTrace;\n var PassThroughHandlerContext = _dereq_(\"./finally\")(Promise, tryConvertToPromise, NEXT_FILTER);\n var catchFilter = _dereq_(\"./catch_filter\")(NEXT_FILTER);\n var nodebackForPromise = _dereq_(\"./nodeback\");\n var errorObj = util.errorObj;\n var tryCatch = util.tryCatch;\n function check(self, executor) {\n if (self == null || self.constructor !== Promise) {\n throw new TypeError(\"the promise constructor cannot be invoked directly\\n\\n See http://goo.gl/MqrFmX\\n\");\n }\n if (typeof executor !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(executor));\n }\n }\n function Promise(executor) {\n if (executor !== INTERNAL) {\n check(this, executor);\n }\n this._bitField = 0;\n this._fulfillmentHandler0 = undefined;\n this._rejectionHandler0 = undefined;\n this._promise0 = undefined;\n this._receiver0 = undefined;\n this._resolveFromExecutor(executor);\n this._promiseCreated();\n this._fireEvent(\"promiseCreated\", this);\n }\n Promise.prototype.toString = function () {\n return \"[object Promise]\";\n };\n Promise.prototype.caught = Promise.prototype[\"catch\"] = function (fn) {\n var len = arguments.length;\n if (len > 1) {\n var catchInstances = new Array(len - 1),\n j = 0,\n i;\n for (i = 0; i < len - 1; ++i) {\n var item = arguments[i];\n if (util.isObject(item)) {\n catchInstances[j++] = item;\n } else {\n return apiRejection(\"Catch statement predicate: \" + \"expecting an object but got \" + util.classString(item));\n }\n }\n catchInstances.length = j;\n fn = arguments[i];\n if (typeof fn !== \"function\") {\n throw new TypeError(\"The last argument to .catch() \" + \"must be a function, got \" + util.toString(fn));\n }\n return this.then(undefined, catchFilter(catchInstances, fn, this));\n }\n return this.then(undefined, fn);\n };\n Promise.prototype.reflect = function () {\n return this._then(reflectHandler, reflectHandler, undefined, this, undefined);\n };\n Promise.prototype.then = function (didFulfill, didReject) {\n if (debug.warnings() && arguments.length > 0 && typeof didFulfill !== \"function\" && typeof didReject !== \"function\") {\n var msg = \".then() only accepts functions but was passed: \" + util.classString(didFulfill);\n if (arguments.length > 1) {\n msg += \", \" + util.classString(didReject);\n }\n this._warn(msg);\n }\n return this._then(didFulfill, didReject, undefined, undefined, undefined);\n };\n Promise.prototype.done = function (didFulfill, didReject) {\n var promise = this._then(didFulfill, didReject, undefined, undefined, undefined);\n promise._setIsFinal();\n };\n Promise.prototype.spread = function (fn) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n return this.all()._then(fn, undefined, undefined, APPLY, undefined);\n };\n Promise.prototype.toJSON = function () {\n var ret = {\n isFulfilled: false,\n isRejected: false,\n fulfillmentValue: undefined,\n rejectionReason: undefined\n };\n if (this.isFulfilled()) {\n ret.fulfillmentValue = this.value();\n ret.isFulfilled = true;\n } else if (this.isRejected()) {\n ret.rejectionReason = this.reason();\n ret.isRejected = true;\n }\n return ret;\n };\n Promise.prototype.all = function () {\n if (arguments.length > 0) {\n this._warn(\".all() was passed arguments but it does not take any\");\n }\n return new PromiseArray(this).promise();\n };\n Promise.prototype.error = function (fn) {\n return this.caught(util.originatesFromRejection, fn);\n };\n Promise.getNewLibraryCopy = module.exports;\n Promise.is = function (val) {\n return val instanceof Promise;\n };\n Promise.fromNode = Promise.fromCallback = function (fn) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs : false;\n var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));\n if (result === errorObj) {\n ret._rejectCallback(result.e, true);\n }\n if (!ret._isFateSealed()) ret._setAsyncGuaranteed();\n return ret;\n };\n Promise.all = function (promises) {\n return new PromiseArray(promises).promise();\n };\n Promise.cast = function (obj) {\n var ret = tryConvertToPromise(obj);\n if (!(ret instanceof Promise)) {\n ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._setFulfilled();\n ret._rejectionHandler0 = obj;\n }\n return ret;\n };\n Promise.resolve = Promise.fulfilled = Promise.cast;\n Promise.reject = Promise.rejected = function (reason) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._rejectCallback(reason, true);\n return ret;\n };\n Promise.setScheduler = function (fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n return async.setScheduler(fn);\n };\n Promise.prototype._then = function (didFulfill, didReject, _, receiver, internalData) {\n var haveInternalData = internalData !== undefined;\n var promise = haveInternalData ? internalData : new Promise(INTERNAL);\n var target = this._target();\n var bitField = target._bitField;\n if (!haveInternalData) {\n promise._propagateFrom(this, 3);\n promise._captureStackTrace();\n if (receiver === undefined && (this._bitField & 2097152) !== 0) {\n if (!((bitField & 50397184) === 0)) {\n receiver = this._boundValue();\n } else {\n receiver = target === this ? undefined : this._boundTo;\n }\n }\n this._fireEvent(\"promiseChained\", this, promise);\n }\n var context = getContext();\n if (!((bitField & 50397184) === 0)) {\n var handler,\n value,\n settler = target._settlePromiseCtx;\n if ((bitField & 33554432) !== 0) {\n value = target._rejectionHandler0;\n handler = didFulfill;\n } else if ((bitField & 16777216) !== 0) {\n value = target._fulfillmentHandler0;\n handler = didReject;\n target._unsetRejectionIsUnhandled();\n } else {\n settler = target._settlePromiseLateCancellationObserver;\n value = new CancellationError(\"late cancellation observer\");\n target._attachExtraTrace(value);\n handler = didReject;\n }\n async.invoke(settler, target, {\n handler: util.contextBind(context, handler),\n promise: promise,\n receiver: receiver,\n value: value\n });\n } else {\n target._addCallbacks(didFulfill, didReject, promise, receiver, context);\n }\n return promise;\n };\n Promise.prototype._length = function () {\n return this._bitField & 65535;\n };\n Promise.prototype._isFateSealed = function () {\n return (this._bitField & 117506048) !== 0;\n };\n Promise.prototype._isFollowing = function () {\n return (this._bitField & 67108864) === 67108864;\n };\n Promise.prototype._setLength = function (len) {\n this._bitField = this._bitField & -65536 | len & 65535;\n };\n Promise.prototype._setFulfilled = function () {\n this._bitField = this._bitField | 33554432;\n this._fireEvent(\"promiseFulfilled\", this);\n };\n Promise.prototype._setRejected = function () {\n this._bitField = this._bitField | 16777216;\n this._fireEvent(\"promiseRejected\", this);\n };\n Promise.prototype._setFollowing = function () {\n this._bitField = this._bitField | 67108864;\n this._fireEvent(\"promiseResolved\", this);\n };\n Promise.prototype._setIsFinal = function () {\n this._bitField = this._bitField | 4194304;\n };\n Promise.prototype._isFinal = function () {\n return (this._bitField & 4194304) > 0;\n };\n Promise.prototype._unsetCancelled = function () {\n this._bitField = this._bitField & ~65536;\n };\n Promise.prototype._setCancelled = function () {\n this._bitField = this._bitField | 65536;\n this._fireEvent(\"promiseCancelled\", this);\n };\n Promise.prototype._setWillBeCancelled = function () {\n this._bitField = this._bitField | 8388608;\n };\n Promise.prototype._setAsyncGuaranteed = function () {\n if (async.hasCustomScheduler()) return;\n var bitField = this._bitField;\n this._bitField = bitField | (bitField & 536870912) >> 2 ^ 134217728;\n };\n Promise.prototype._setNoAsyncGuarantee = function () {\n this._bitField = (this._bitField | 536870912) & ~134217728;\n };\n Promise.prototype._receiverAt = function (index) {\n var ret = index === 0 ? this._receiver0 : this[index * 4 - 4 + 3];\n if (ret === UNDEFINED_BINDING) {\n return undefined;\n } else if (ret === undefined && this._isBound()) {\n return this._boundValue();\n }\n return ret;\n };\n Promise.prototype._promiseAt = function (index) {\n return this[index * 4 - 4 + 2];\n };\n Promise.prototype._fulfillmentHandlerAt = function (index) {\n return this[index * 4 - 4 + 0];\n };\n Promise.prototype._rejectionHandlerAt = function (index) {\n return this[index * 4 - 4 + 1];\n };\n Promise.prototype._boundValue = function () {};\n Promise.prototype._migrateCallback0 = function (follower) {\n var bitField = follower._bitField;\n var fulfill = follower._fulfillmentHandler0;\n var reject = follower._rejectionHandler0;\n var promise = follower._promise0;\n var receiver = follower._receiverAt(0);\n if (receiver === undefined) receiver = UNDEFINED_BINDING;\n this._addCallbacks(fulfill, reject, promise, receiver, null);\n };\n Promise.prototype._migrateCallbackAt = function (follower, index) {\n var fulfill = follower._fulfillmentHandlerAt(index);\n var reject = follower._rejectionHandlerAt(index);\n var promise = follower._promiseAt(index);\n var receiver = follower._receiverAt(index);\n if (receiver === undefined) receiver = UNDEFINED_BINDING;\n this._addCallbacks(fulfill, reject, promise, receiver, null);\n };\n Promise.prototype._addCallbacks = function (fulfill, reject, promise, receiver, context) {\n var index = this._length();\n if (index >= 65535 - 4) {\n index = 0;\n this._setLength(0);\n }\n if (index === 0) {\n this._promise0 = promise;\n this._receiver0 = receiver;\n if (typeof fulfill === \"function\") {\n this._fulfillmentHandler0 = util.contextBind(context, fulfill);\n }\n if (typeof reject === \"function\") {\n this._rejectionHandler0 = util.contextBind(context, reject);\n }\n } else {\n var base = index * 4 - 4;\n this[base + 2] = promise;\n this[base + 3] = receiver;\n if (typeof fulfill === \"function\") {\n this[base + 0] = util.contextBind(context, fulfill);\n }\n if (typeof reject === \"function\") {\n this[base + 1] = util.contextBind(context, reject);\n }\n }\n this._setLength(index + 1);\n return index;\n };\n Promise.prototype._proxy = function (proxyable, arg) {\n this._addCallbacks(undefined, undefined, arg, proxyable, null);\n };\n Promise.prototype._resolveCallback = function (value, shouldBind) {\n if ((this._bitField & 117506048) !== 0) return;\n if (value === this) return this._rejectCallback(makeSelfResolutionError(), false);\n var maybePromise = tryConvertToPromise(value, this);\n if (!(maybePromise instanceof Promise)) return this._fulfill(value);\n if (shouldBind) this._propagateFrom(maybePromise, 2);\n var promise = maybePromise._target();\n if (promise === this) {\n this._reject(makeSelfResolutionError());\n return;\n }\n var bitField = promise._bitField;\n if ((bitField & 50397184) === 0) {\n var len = this._length();\n if (len > 0) promise._migrateCallback0(this);\n for (var i = 1; i < len; ++i) {\n promise._migrateCallbackAt(this, i);\n }\n this._setFollowing();\n this._setLength(0);\n this._setFollowee(maybePromise);\n } else if ((bitField & 33554432) !== 0) {\n this._fulfill(promise._value());\n } else if ((bitField & 16777216) !== 0) {\n this._reject(promise._reason());\n } else {\n var reason = new CancellationError(\"late cancellation observer\");\n promise._attachExtraTrace(reason);\n this._reject(reason);\n }\n };\n Promise.prototype._rejectCallback = function (reason, synchronous, ignoreNonErrorWarnings) {\n var trace = util.ensureErrorObject(reason);\n var hasStack = trace === reason;\n if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {\n var message = \"a promise was rejected with a non-error: \" + util.classString(reason);\n this._warn(message, true);\n }\n this._attachExtraTrace(trace, synchronous ? hasStack : false);\n this._reject(reason);\n };\n Promise.prototype._resolveFromExecutor = function (executor) {\n if (executor === INTERNAL) return;\n var promise = this;\n this._captureStackTrace();\n this._pushContext();\n var synchronous = true;\n var r = this._execute(executor, function (value) {\n promise._resolveCallback(value);\n }, function (reason) {\n promise._rejectCallback(reason, synchronous);\n });\n synchronous = false;\n this._popContext();\n if (r !== undefined) {\n promise._rejectCallback(r, true);\n }\n };\n Promise.prototype._settlePromiseFromHandler = function (handler, receiver, value, promise) {\n var bitField = promise._bitField;\n if ((bitField & 65536) !== 0) return;\n promise._pushContext();\n var x;\n if (receiver === APPLY) {\n if (!value || typeof value.length !== \"number\") {\n x = errorObj;\n x.e = new TypeError(\"cannot .spread() a non-array: \" + util.classString(value));\n } else {\n x = tryCatch(handler).apply(this._boundValue(), value);\n }\n } else {\n x = tryCatch(handler).call(receiver, value);\n }\n var promiseCreated = promise._popContext();\n bitField = promise._bitField;\n if ((bitField & 65536) !== 0) return;\n if (x === NEXT_FILTER) {\n promise._reject(value);\n } else if (x === errorObj) {\n promise._rejectCallback(x.e, false);\n } else {\n debug.checkForgottenReturns(x, promiseCreated, \"\", promise, this);\n promise._resolveCallback(x);\n }\n };\n Promise.prototype._target = function () {\n var ret = this;\n while (ret._isFollowing()) {\n ret = ret._followee();\n }\n return ret;\n };\n Promise.prototype._followee = function () {\n return this._rejectionHandler0;\n };\n Promise.prototype._setFollowee = function (promise) {\n this._rejectionHandler0 = promise;\n };\n Promise.prototype._settlePromise = function (promise, handler, receiver, value) {\n var isPromise = promise instanceof Promise;\n var bitField = this._bitField;\n var asyncGuaranteed = (bitField & 134217728) !== 0;\n if ((bitField & 65536) !== 0) {\n if (isPromise) promise._invokeInternalOnCancel();\n if (receiver instanceof PassThroughHandlerContext && receiver.isFinallyHandler()) {\n receiver.cancelPromise = promise;\n if (tryCatch(handler).call(receiver, value) === errorObj) {\n promise._reject(errorObj.e);\n }\n } else if (handler === reflectHandler) {\n promise._fulfill(reflectHandler.call(receiver));\n } else if (receiver instanceof Proxyable) {\n receiver._promiseCancelled(promise);\n } else if (isPromise || promise instanceof PromiseArray) {\n promise._cancel();\n } else {\n receiver.cancel();\n }\n } else if (typeof handler === \"function\") {\n if (!isPromise) {\n handler.call(receiver, value, promise);\n } else {\n if (asyncGuaranteed) promise._setAsyncGuaranteed();\n this._settlePromiseFromHandler(handler, receiver, value, promise);\n }\n } else if (receiver instanceof Proxyable) {\n if (!receiver._isResolved()) {\n if ((bitField & 33554432) !== 0) {\n receiver._promiseFulfilled(value, promise);\n } else {\n receiver._promiseRejected(value, promise);\n }\n }\n } else if (isPromise) {\n if (asyncGuaranteed) promise._setAsyncGuaranteed();\n if ((bitField & 33554432) !== 0) {\n promise._fulfill(value);\n } else {\n promise._reject(value);\n }\n }\n };\n Promise.prototype._settlePromiseLateCancellationObserver = function (ctx) {\n var handler = ctx.handler;\n var promise = ctx.promise;\n var receiver = ctx.receiver;\n var value = ctx.value;\n if (typeof handler === \"function\") {\n if (!(promise instanceof Promise)) {\n handler.call(receiver, value, promise);\n } else {\n this._settlePromiseFromHandler(handler, receiver, value, promise);\n }\n } else if (promise instanceof Promise) {\n promise._reject(value);\n }\n };\n Promise.prototype._settlePromiseCtx = function (ctx) {\n this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);\n };\n Promise.prototype._settlePromise0 = function (handler, value, bitField) {\n var promise = this._promise0;\n var receiver = this._receiverAt(0);\n this._promise0 = undefined;\n this._receiver0 = undefined;\n this._settlePromise(promise, handler, receiver, value);\n };\n Promise.prototype._clearCallbackDataAtIndex = function (index) {\n var base = index * 4 - 4;\n this[base + 2] = this[base + 3] = this[base + 0] = this[base + 1] = undefined;\n };\n Promise.prototype._fulfill = function (value) {\n var bitField = this._bitField;\n if ((bitField & 117506048) >>> 16) return;\n if (value === this) {\n var err = makeSelfResolutionError();\n this._attachExtraTrace(err);\n return this._reject(err);\n }\n this._setFulfilled();\n this._rejectionHandler0 = value;\n if ((bitField & 65535) > 0) {\n if ((bitField & 134217728) !== 0) {\n this._settlePromises();\n } else {\n async.settlePromises(this);\n }\n this._dereferenceTrace();\n }\n };\n Promise.prototype._reject = function (reason) {\n var bitField = this._bitField;\n if ((bitField & 117506048) >>> 16) return;\n this._setRejected();\n this._fulfillmentHandler0 = reason;\n if (this._isFinal()) {\n return async.fatalError(reason, util.isNode);\n }\n if ((bitField & 65535) > 0) {\n async.settlePromises(this);\n } else {\n this._ensurePossibleRejectionHandled();\n }\n };\n Promise.prototype._fulfillPromises = function (len, value) {\n for (var i = 1; i < len; i++) {\n var handler = this._fulfillmentHandlerAt(i);\n var promise = this._promiseAt(i);\n var receiver = this._receiverAt(i);\n this._clearCallbackDataAtIndex(i);\n this._settlePromise(promise, handler, receiver, value);\n }\n };\n Promise.prototype._rejectPromises = function (len, reason) {\n for (var i = 1; i < len; i++) {\n var handler = this._rejectionHandlerAt(i);\n var promise = this._promiseAt(i);\n var receiver = this._receiverAt(i);\n this._clearCallbackDataAtIndex(i);\n this._settlePromise(promise, handler, receiver, reason);\n }\n };\n Promise.prototype._settlePromises = function () {\n var bitField = this._bitField;\n var len = bitField & 65535;\n if (len > 0) {\n if ((bitField & 16842752) !== 0) {\n var reason = this._fulfillmentHandler0;\n this._settlePromise0(this._rejectionHandler0, reason, bitField);\n this._rejectPromises(len, reason);\n } else {\n var value = this._rejectionHandler0;\n this._settlePromise0(this._fulfillmentHandler0, value, bitField);\n this._fulfillPromises(len, value);\n }\n this._setLength(0);\n }\n this._clearCancellationData();\n };\n Promise.prototype._settledValue = function () {\n var bitField = this._bitField;\n if ((bitField & 33554432) !== 0) {\n return this._rejectionHandler0;\n } else if ((bitField & 16777216) !== 0) {\n return this._fulfillmentHandler0;\n }\n };\n if (typeof Symbol !== \"undefined\" && Symbol.toStringTag) {\n es5.defineProperty(Promise.prototype, Symbol.toStringTag, {\n get: function get() {\n return \"Object\";\n }\n });\n }\n function deferResolve(v) {\n this.promise._resolveCallback(v);\n }\n function deferReject(v) {\n this.promise._rejectCallback(v, false);\n }\n Promise.defer = Promise.pending = function () {\n debug.deprecated(\"Promise.defer\", \"new Promise\");\n var promise = new Promise(INTERNAL);\n return {\n promise: promise,\n resolve: deferResolve,\n reject: deferReject\n };\n };\n util.notEnumerableProp(Promise, \"_makeSelfResolutionError\", makeSelfResolutionError);\n _dereq_(\"./method\")(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug);\n _dereq_(\"./bind\")(Promise, INTERNAL, tryConvertToPromise, debug);\n _dereq_(\"./cancel\")(Promise, PromiseArray, apiRejection, debug);\n _dereq_(\"./direct_resolve\")(Promise);\n _dereq_(\"./synchronous_inspection\")(Promise);\n _dereq_(\"./join\")(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async);\n Promise.Promise = Promise;\n Promise.version = \"3.7.2\";\n util.toFastProperties(Promise);\n util.toFastProperties(Promise.prototype);\n function fillTypes(value) {\n var p = new Promise(INTERNAL);\n p._fulfillmentHandler0 = value;\n p._rejectionHandler0 = value;\n p._promise0 = value;\n p._receiver0 = value;\n }\n // Complete slack tracking, opt out of field-type tracking and \n // stabilize map \n fillTypes({\n a: 1\n });\n fillTypes({\n b: 2\n });\n fillTypes({\n c: 3\n });\n fillTypes(1);\n fillTypes(function () {});\n fillTypes(undefined);\n fillTypes(false);\n fillTypes(new Promise(INTERNAL));\n debug.setBounds(Async.firstLineError, util.lastLineError);\n return Promise;\n };\n }, {\n \"./async\": 1,\n \"./bind\": 2,\n \"./cancel\": 4,\n \"./catch_filter\": 5,\n \"./context\": 6,\n \"./debuggability\": 7,\n \"./direct_resolve\": 8,\n \"./errors\": 9,\n \"./es5\": 10,\n \"./finally\": 11,\n \"./join\": 12,\n \"./method\": 13,\n \"./nodeback\": 14,\n \"./promise_array\": 16,\n \"./synchronous_inspection\": 19,\n \"./thenables\": 20,\n \"./util\": 21,\n \"async_hooks\": undefined\n }],\n 16: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise, INTERNAL, tryConvertToPromise, apiRejection, Proxyable) {\n var util = _dereq_(\"./util\");\n var isArray = util.isArray;\n function toResolutionValue(val) {\n switch (val) {\n case -2:\n return [];\n case -3:\n return {};\n case -6:\n return new Map();\n }\n }\n function PromiseArray(values) {\n var promise = this._promise = new Promise(INTERNAL);\n if (values instanceof Promise) {\n promise._propagateFrom(values, 3);\n values.suppressUnhandledRejections();\n }\n promise._setOnCancel(this);\n this._values = values;\n this._length = 0;\n this._totalResolved = 0;\n this._init(undefined, -2);\n }\n util.inherits(PromiseArray, Proxyable);\n PromiseArray.prototype.length = function () {\n return this._length;\n };\n PromiseArray.prototype.promise = function () {\n return this._promise;\n };\n PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {\n var values = tryConvertToPromise(this._values, this._promise);\n if (values instanceof Promise) {\n values = values._target();\n var bitField = values._bitField;\n ;\n this._values = values;\n if ((bitField & 50397184) === 0) {\n this._promise._setAsyncGuaranteed();\n return values._then(init, this._reject, undefined, this, resolveValueIfEmpty);\n } else if ((bitField & 33554432) !== 0) {\n values = values._value();\n } else if ((bitField & 16777216) !== 0) {\n return this._reject(values._reason());\n } else {\n return this._cancel();\n }\n }\n values = util.asArray(values);\n if (values === null) {\n var err = apiRejection(\"expecting an array or an iterable object but got \" + util.classString(values)).reason();\n this._promise._rejectCallback(err, false);\n return;\n }\n if (values.length === 0) {\n if (resolveValueIfEmpty === -5) {\n this._resolveEmptyArray();\n } else {\n this._resolve(toResolutionValue(resolveValueIfEmpty));\n }\n return;\n }\n this._iterate(values);\n };\n PromiseArray.prototype._iterate = function (values) {\n var len = this.getActualLength(values.length);\n this._length = len;\n this._values = this.shouldCopyValues() ? new Array(len) : this._values;\n var result = this._promise;\n var isResolved = false;\n var bitField = null;\n for (var i = 0; i < len; ++i) {\n var maybePromise = tryConvertToPromise(values[i], result);\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n bitField = maybePromise._bitField;\n } else {\n bitField = null;\n }\n if (isResolved) {\n if (bitField !== null) {\n maybePromise.suppressUnhandledRejections();\n }\n } else if (bitField !== null) {\n if ((bitField & 50397184) === 0) {\n maybePromise._proxy(this, i);\n this._values[i] = maybePromise;\n } else if ((bitField & 33554432) !== 0) {\n isResolved = this._promiseFulfilled(maybePromise._value(), i);\n } else if ((bitField & 16777216) !== 0) {\n isResolved = this._promiseRejected(maybePromise._reason(), i);\n } else {\n isResolved = this._promiseCancelled(i);\n }\n } else {\n isResolved = this._promiseFulfilled(maybePromise, i);\n }\n }\n if (!isResolved) result._setAsyncGuaranteed();\n };\n PromiseArray.prototype._isResolved = function () {\n return this._values === null;\n };\n PromiseArray.prototype._resolve = function (value) {\n this._values = null;\n this._promise._fulfill(value);\n };\n PromiseArray.prototype._cancel = function () {\n if (this._isResolved() || !this._promise._isCancellable()) return;\n this._values = null;\n this._promise._cancel();\n };\n PromiseArray.prototype._reject = function (reason) {\n this._values = null;\n this._promise._rejectCallback(reason, false);\n };\n PromiseArray.prototype._promiseFulfilled = function (value, index) {\n this._values[index] = value;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n this._resolve(this._values);\n return true;\n }\n return false;\n };\n PromiseArray.prototype._promiseCancelled = function () {\n this._cancel();\n return true;\n };\n PromiseArray.prototype._promiseRejected = function (reason) {\n this._totalResolved++;\n this._reject(reason);\n return true;\n };\n PromiseArray.prototype._resultCancelled = function () {\n if (this._isResolved()) return;\n var values = this._values;\n this._cancel();\n if (values instanceof Promise) {\n values.cancel();\n } else {\n for (var i = 0; i < values.length; ++i) {\n if (values[i] instanceof Promise) {\n values[i].cancel();\n }\n }\n }\n };\n PromiseArray.prototype.shouldCopyValues = function () {\n return true;\n };\n PromiseArray.prototype.getActualLength = function (len) {\n return len;\n };\n return PromiseArray;\n };\n }, {\n \"./util\": 21\n }],\n 17: [function (_dereq_, module, exports) {\n \"use strict\";\n\n function arrayMove(src, srcIndex, dst, dstIndex, len) {\n for (var j = 0; j < len; ++j) {\n dst[j + dstIndex] = src[j + srcIndex];\n src[j + srcIndex] = void 0;\n }\n }\n function Queue(capacity) {\n this._capacity = capacity;\n this._length = 0;\n this._front = 0;\n }\n Queue.prototype._willBeOverCapacity = function (size) {\n return this._capacity < size;\n };\n Queue.prototype._pushOne = function (arg) {\n var length = this.length();\n this._checkCapacity(length + 1);\n var i = this._front + length & this._capacity - 1;\n this[i] = arg;\n this._length = length + 1;\n };\n Queue.prototype.push = function (fn, receiver, arg) {\n var length = this.length() + 3;\n if (this._willBeOverCapacity(length)) {\n this._pushOne(fn);\n this._pushOne(receiver);\n this._pushOne(arg);\n return;\n }\n var j = this._front + length - 3;\n this._checkCapacity(length);\n var wrapMask = this._capacity - 1;\n this[j + 0 & wrapMask] = fn;\n this[j + 1 & wrapMask] = receiver;\n this[j + 2 & wrapMask] = arg;\n this._length = length;\n };\n Queue.prototype.shift = function () {\n var front = this._front,\n ret = this[front];\n this[front] = undefined;\n this._front = front + 1 & this._capacity - 1;\n this._length--;\n return ret;\n };\n Queue.prototype.length = function () {\n return this._length;\n };\n Queue.prototype._checkCapacity = function (size) {\n if (this._capacity < size) {\n this._resizeTo(this._capacity << 1);\n }\n };\n Queue.prototype._resizeTo = function (capacity) {\n var oldCapacity = this._capacity;\n this._capacity = capacity;\n var front = this._front;\n var length = this._length;\n var moveItemsCount = front + length & oldCapacity - 1;\n arrayMove(this, 0, this, oldCapacity, moveItemsCount);\n };\n module.exports = Queue;\n }, {}],\n 18: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var util = _dereq_(\"./util\");\n var schedule;\n var noAsyncScheduler = function noAsyncScheduler() {\n throw new Error(\"No async scheduler available\\n\\n See http://goo.gl/MqrFmX\\n\");\n };\n var NativePromise = util.getNativePromise();\n if (util.isNode && typeof MutationObserver === \"undefined\") {\n var GlobalSetImmediate = global.setImmediate;\n var ProcessNextTick = process.nextTick;\n schedule = util.isRecentNode ? function (fn) {\n GlobalSetImmediate.call(global, fn);\n } : function (fn) {\n ProcessNextTick.call(process, fn);\n };\n } else if (typeof NativePromise === \"function\" && typeof NativePromise.resolve === \"function\") {\n var nativePromise = NativePromise.resolve();\n schedule = function schedule(fn) {\n nativePromise.then(fn);\n };\n } else if (typeof MutationObserver !== \"undefined\" && !(typeof window !== \"undefined\" && window.navigator && (window.navigator.standalone || window.cordova)) && \"classList\" in document.documentElement) {\n schedule = function () {\n var div = document.createElement(\"div\");\n var opts = {\n attributes: true\n };\n var toggleScheduled = false;\n var div2 = document.createElement(\"div\");\n var o2 = new MutationObserver(function () {\n div.classList.toggle(\"foo\");\n toggleScheduled = false;\n });\n o2.observe(div2, opts);\n var scheduleToggle = function scheduleToggle() {\n if (toggleScheduled) return;\n toggleScheduled = true;\n div2.classList.toggle(\"foo\");\n };\n return function schedule(fn) {\n var o = new MutationObserver(function () {\n o.disconnect();\n fn();\n });\n o.observe(div, opts);\n scheduleToggle();\n };\n }();\n } else if (typeof setImmediate !== \"undefined\") {\n schedule = function schedule(fn) {\n setImmediate(fn);\n };\n } else if (typeof setTimeout !== \"undefined\") {\n schedule = function schedule(fn) {\n setTimeout(fn, 0);\n };\n } else {\n schedule = noAsyncScheduler;\n }\n module.exports = schedule;\n }, {\n \"./util\": 21\n }],\n 19: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise) {\n function PromiseInspection(promise) {\n if (promise !== undefined) {\n promise = promise._target();\n this._bitField = promise._bitField;\n this._settledValueField = promise._isFateSealed() ? promise._settledValue() : undefined;\n } else {\n this._bitField = 0;\n this._settledValueField = undefined;\n }\n }\n PromiseInspection.prototype._settledValue = function () {\n return this._settledValueField;\n };\n var value = PromiseInspection.prototype.value = function () {\n if (!this.isFulfilled()) {\n throw new TypeError(\"cannot get fulfillment value of a non-fulfilled promise\\n\\n See http://goo.gl/MqrFmX\\n\");\n }\n return this._settledValue();\n };\n var reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function () {\n if (!this.isRejected()) {\n throw new TypeError(\"cannot get rejection reason of a non-rejected promise\\n\\n See http://goo.gl/MqrFmX\\n\");\n }\n return this._settledValue();\n };\n var isFulfilled = PromiseInspection.prototype.isFulfilled = function () {\n return (this._bitField & 33554432) !== 0;\n };\n var isRejected = PromiseInspection.prototype.isRejected = function () {\n return (this._bitField & 16777216) !== 0;\n };\n var isPending = PromiseInspection.prototype.isPending = function () {\n return (this._bitField & 50397184) === 0;\n };\n var isResolved = PromiseInspection.prototype.isResolved = function () {\n return (this._bitField & 50331648) !== 0;\n };\n PromiseInspection.prototype.isCancelled = function () {\n return (this._bitField & 8454144) !== 0;\n };\n Promise.prototype.__isCancelled = function () {\n return (this._bitField & 65536) === 65536;\n };\n Promise.prototype._isCancelled = function () {\n return this._target().__isCancelled();\n };\n Promise.prototype.isCancelled = function () {\n return (this._target()._bitField & 8454144) !== 0;\n };\n Promise.prototype.isPending = function () {\n return isPending.call(this._target());\n };\n Promise.prototype.isRejected = function () {\n return isRejected.call(this._target());\n };\n Promise.prototype.isFulfilled = function () {\n return isFulfilled.call(this._target());\n };\n Promise.prototype.isResolved = function () {\n return isResolved.call(this._target());\n };\n Promise.prototype.value = function () {\n return value.call(this._target());\n };\n Promise.prototype.reason = function () {\n var target = this._target();\n target._unsetRejectionIsUnhandled();\n return reason.call(target);\n };\n Promise.prototype._value = function () {\n return this._settledValue();\n };\n Promise.prototype._reason = function () {\n this._unsetRejectionIsUnhandled();\n return this._settledValue();\n };\n Promise.PromiseInspection = PromiseInspection;\n };\n }, {}],\n 20: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (Promise, INTERNAL) {\n var util = _dereq_(\"./util\");\n var errorObj = util.errorObj;\n var isObject = util.isObject;\n function tryConvertToPromise(obj, context) {\n if (isObject(obj)) {\n if (obj instanceof Promise) return obj;\n var then = getThen(obj);\n if (then === errorObj) {\n if (context) context._pushContext();\n var ret = Promise.reject(then.e);\n if (context) context._popContext();\n return ret;\n } else if (typeof then === \"function\") {\n if (isAnyBluebirdPromise(obj)) {\n var ret = new Promise(INTERNAL);\n obj._then(ret._fulfill, ret._reject, undefined, ret, null);\n return ret;\n }\n return doThenable(obj, then, context);\n }\n }\n return obj;\n }\n function doGetThen(obj) {\n return obj.then;\n }\n function getThen(obj) {\n try {\n return doGetThen(obj);\n } catch (e) {\n errorObj.e = e;\n return errorObj;\n }\n }\n var hasProp = {}.hasOwnProperty;\n function isAnyBluebirdPromise(obj) {\n try {\n return hasProp.call(obj, \"_promise0\");\n } catch (e) {\n return false;\n }\n }\n function doThenable(x, then, context) {\n var promise = new Promise(INTERNAL);\n var ret = promise;\n if (context) context._pushContext();\n promise._captureStackTrace();\n if (context) context._popContext();\n var synchronous = true;\n var result = util.tryCatch(then).call(x, resolve, reject);\n synchronous = false;\n if (promise && result === errorObj) {\n promise._rejectCallback(result.e, true, true);\n promise = null;\n }\n function resolve(value) {\n if (!promise) return;\n promise._resolveCallback(value);\n promise = null;\n }\n function reject(reason) {\n if (!promise) return;\n promise._rejectCallback(reason, synchronous, true);\n promise = null;\n }\n return ret;\n }\n return tryConvertToPromise;\n };\n }, {\n \"./util\": 21\n }],\n 21: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var es5 = _dereq_(\"./es5\");\n var canEvaluate = typeof navigator == \"undefined\";\n var errorObj = {\n e: {}\n };\n var tryCatchTarget;\n var globalObject = typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : this !== undefined ? this : null;\n function tryCatcher() {\n try {\n var target = tryCatchTarget;\n tryCatchTarget = null;\n return target.apply(this, arguments);\n } catch (e) {\n errorObj.e = e;\n return errorObj;\n }\n }\n function tryCatch(fn) {\n tryCatchTarget = fn;\n return tryCatcher;\n }\n var inherits = function inherits(Child, Parent) {\n var hasProp = {}.hasOwnProperty;\n function T() {\n this.constructor = Child;\n this.constructor$ = Parent;\n for (var propertyName in Parent.prototype) {\n if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length - 1) !== \"$\") {\n this[propertyName + \"$\"] = Parent.prototype[propertyName];\n }\n }\n }\n T.prototype = Parent.prototype;\n Child.prototype = new T();\n return Child.prototype;\n };\n function isPrimitive(val) {\n return val == null || val === true || val === false || typeof val === \"string\" || typeof val === \"number\";\n }\n function isObject(value) {\n return typeof value === \"function\" || _typeof(value) === \"object\" && value !== null;\n }\n function maybeWrapAsError(maybeError) {\n if (!isPrimitive(maybeError)) return maybeError;\n return new Error(safeToString(maybeError));\n }\n function withAppended(target, appendee) {\n var len = target.length;\n var ret = new Array(len + 1);\n var i;\n for (i = 0; i < len; ++i) {\n ret[i] = target[i];\n }\n ret[i] = appendee;\n return ret;\n }\n function getDataPropertyOrDefault(obj, key, defaultValue) {\n if (es5.isES5) {\n var desc = Object.getOwnPropertyDescriptor(obj, key);\n if (desc != null) {\n return desc.get == null && desc.set == null ? desc.value : defaultValue;\n }\n } else {\n return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;\n }\n }\n function notEnumerableProp(obj, name, value) {\n if (isPrimitive(obj)) return obj;\n var descriptor = {\n value: value,\n configurable: true,\n enumerable: false,\n writable: true\n };\n es5.defineProperty(obj, name, descriptor);\n return obj;\n }\n function thrower(r) {\n throw r;\n }\n var inheritedDataKeys = function () {\n var excludedPrototypes = [Array.prototype, Object.prototype, Function.prototype];\n var isExcludedProto = function isExcludedProto(val) {\n for (var i = 0; i < excludedPrototypes.length; ++i) {\n if (excludedPrototypes[i] === val) {\n return true;\n }\n }\n return false;\n };\n if (es5.isES5) {\n var getKeys = Object.getOwnPropertyNames;\n return function (obj) {\n var ret = [];\n var visitedKeys = Object.create(null);\n while (obj != null && !isExcludedProto(obj)) {\n var keys;\n try {\n keys = getKeys(obj);\n } catch (e) {\n return ret;\n }\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (visitedKeys[key]) continue;\n visitedKeys[key] = true;\n var desc = Object.getOwnPropertyDescriptor(obj, key);\n if (desc != null && desc.get == null && desc.set == null) {\n ret.push(key);\n }\n }\n obj = es5.getPrototypeOf(obj);\n }\n return ret;\n };\n } else {\n var hasProp = {}.hasOwnProperty;\n return function (obj) {\n if (isExcludedProto(obj)) return [];\n var ret = [];\n\n /*jshint forin:false */\n enumeration: for (var key in obj) {\n if (hasProp.call(obj, key)) {\n ret.push(key);\n } else {\n for (var i = 0; i < excludedPrototypes.length; ++i) {\n if (hasProp.call(excludedPrototypes[i], key)) {\n continue enumeration;\n }\n }\n ret.push(key);\n }\n }\n return ret;\n };\n }\n }();\n var thisAssignmentPattern = /this\\s*\\.\\s*\\S+\\s*=/;\n function isClass(fn) {\n try {\n if (typeof fn === \"function\") {\n var keys = es5.names(fn.prototype);\n var hasMethods = es5.isES5 && keys.length > 1;\n var hasMethodsOtherThanConstructor = keys.length > 0 && !(keys.length === 1 && keys[0] === \"constructor\");\n var hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + \"\") && es5.names(fn).length > 0;\n if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) {\n return true;\n }\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n function toFastProperties(obj) {\n /*jshint -W027,-W055,-W031*/\n function FakeConstructor() {}\n FakeConstructor.prototype = obj;\n var receiver = new FakeConstructor();\n function ic() {\n return _typeof(receiver.foo);\n }\n ic();\n ic();\n return obj;\n eval(obj);\n }\n var rident = /^[a-z$_][a-z$_0-9]*$/i;\n function isIdentifier(str) {\n return rident.test(str);\n }\n function filledRange(count, prefix, suffix) {\n var ret = new Array(count);\n for (var i = 0; i < count; ++i) {\n ret[i] = prefix + i + suffix;\n }\n return ret;\n }\n function safeToString(obj) {\n try {\n return obj + \"\";\n } catch (e) {\n return \"[no string representation]\";\n }\n }\n function isError(obj) {\n return obj instanceof Error || obj !== null && _typeof(obj) === \"object\" && typeof obj.message === \"string\" && typeof obj.name === \"string\";\n }\n function markAsOriginatingFromRejection(e) {\n try {\n notEnumerableProp(e, \"isOperational\", true);\n } catch (ignore) {}\n }\n function originatesFromRejection(e) {\n if (e == null) return false;\n return e instanceof Error[\"__BluebirdErrorTypes__\"].OperationalError || e[\"isOperational\"] === true;\n }\n function canAttachTrace(obj) {\n return isError(obj) && es5.propertyIsWritable(obj, \"stack\");\n }\n var ensureErrorObject = function () {\n if (!(\"stack\" in new Error())) {\n return function (value) {\n if (canAttachTrace(value)) return value;\n try {\n throw new Error(safeToString(value));\n } catch (err) {\n return err;\n }\n };\n } else {\n return function (value) {\n if (canAttachTrace(value)) return value;\n return new Error(safeToString(value));\n };\n }\n }();\n function classString(obj) {\n return {}.toString.call(obj);\n }\n function copyDescriptors(from, to, filter) {\n var keys = es5.names(from);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (filter(key)) {\n try {\n es5.defineProperty(to, key, es5.getDescriptor(from, key));\n } catch (ignore) {}\n }\n }\n }\n var asArray = function asArray(v) {\n if (es5.isArray(v)) {\n return v;\n }\n return null;\n };\n if (typeof Symbol !== \"undefined\" && Symbol.iterator) {\n var ArrayFrom = typeof Array.from === \"function\" ? function (v) {\n return Array.from(v);\n } : function (v) {\n var ret = [];\n var it = v[Symbol.iterator]();\n var itResult;\n while (!(itResult = it.next()).done) {\n ret.push(itResult.value);\n }\n return ret;\n };\n asArray = function asArray(v) {\n if (es5.isArray(v)) {\n return v;\n } else if (v != null && typeof v[Symbol.iterator] === \"function\") {\n return ArrayFrom(v);\n }\n return null;\n };\n }\n var isNode = typeof process !== \"undefined\" && classString(process).toLowerCase() === \"[object process]\";\n var hasEnvVariables = typeof process !== \"undefined\" && typeof process.env !== \"undefined\";\n function env(key) {\n return hasEnvVariables ? process.env[key] : undefined;\n }\n function getNativePromise() {\n if (typeof Promise === \"function\") {\n try {\n var promise = new Promise(function () {});\n if (classString(promise) === \"[object Promise]\") {\n return Promise;\n }\n } catch (e) {}\n }\n }\n var reflectHandler;\n function contextBind(ctx, cb) {\n if (ctx === null || typeof cb !== \"function\" || cb === reflectHandler) {\n return cb;\n }\n if (ctx.domain !== null) {\n cb = ctx.domain.bind(cb);\n }\n var async = ctx.async;\n if (async !== null) {\n var old = cb;\n cb = function cb() {\n var args = new Array(2).concat([].slice.call(arguments));\n ;\n args[0] = old;\n args[1] = this;\n return async.runInAsyncScope.apply(async, args);\n };\n }\n return cb;\n }\n var ret = {\n setReflectHandler: function setReflectHandler(fn) {\n reflectHandler = fn;\n },\n isClass: isClass,\n isIdentifier: isIdentifier,\n inheritedDataKeys: inheritedDataKeys,\n getDataPropertyOrDefault: getDataPropertyOrDefault,\n thrower: thrower,\n isArray: es5.isArray,\n asArray: asArray,\n notEnumerableProp: notEnumerableProp,\n isPrimitive: isPrimitive,\n isObject: isObject,\n isError: isError,\n canEvaluate: canEvaluate,\n errorObj: errorObj,\n tryCatch: tryCatch,\n inherits: inherits,\n withAppended: withAppended,\n maybeWrapAsError: maybeWrapAsError,\n toFastProperties: toFastProperties,\n filledRange: filledRange,\n toString: safeToString,\n canAttachTrace: canAttachTrace,\n ensureErrorObject: ensureErrorObject,\n originatesFromRejection: originatesFromRejection,\n markAsOriginatingFromRejection: markAsOriginatingFromRejection,\n classString: classString,\n copyDescriptors: copyDescriptors,\n isNode: isNode,\n hasEnvVariables: hasEnvVariables,\n env: env,\n global: globalObject,\n getNativePromise: getNativePromise,\n contextBind: contextBind\n };\n ret.isRecentNode = ret.isNode && function () {\n var version;\n if (process.versions && process.versions.node) {\n version = process.versions.node.split(\".\").map(Number);\n } else if (process.version) {\n version = process.version.split(\".\").map(Number);\n }\n return version[0] === 0 && version[1] > 10 || version[0] > 0;\n }();\n ret.nodeSupportsAsyncResource = ret.isNode && function () {\n var supportsAsync = false;\n try {\n var res = _dereq_(\"async_hooks\").AsyncResource;\n supportsAsync = typeof res.prototype.runInAsyncScope === \"function\";\n } catch (e) {\n supportsAsync = false;\n }\n return supportsAsync;\n }();\n if (ret.isNode) ret.toFastProperties(process);\n try {\n throw new Error();\n } catch (e) {\n ret.lastLineError = e;\n }\n module.exports = ret;\n }, {\n \"./es5\": 10,\n \"async_hooks\": undefined\n }]\n }, {}, [3])(3);\n});\n;\nif (typeof window !== 'undefined' && window !== null) {\n window.P = window.Promise;\n} else if (typeof self !== 'undefined' && self !== null) {\n self.P = self.Promise;\n}","var scope = typeof global !== \"undefined\" && global || typeof self !== \"undefined\" && self || window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function () {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function () {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout = exports.clearInterval = function (timeout) {\n if (timeout) {\n timeout.close();\n }\n};\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function () {};\nTimeout.prototype.close = function () {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function (item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\nexports.unenroll = function (item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\nexports._unrefActive = exports.active = function (item) {\n clearTimeout(item._idleTimeoutId);\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout) item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = typeof self !== \"undefined\" && self.setImmediate || typeof global !== \"undefined\" && global.setImmediate || this && this.setImmediate;\nexports.clearImmediate = typeof self !== \"undefined\" && self.clearImmediate || typeof global !== \"undefined\" && global.clearImmediate || this && this.clearImmediate;","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = {\n callback: callback,\n args: args\n };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n function installNextTickImplementation() {\n registerImmediate = function registerImmediate(handle) {\n process.nextTick(function () {\n runIfPresent(handle);\n });\n };\n }\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function () {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function onGlobalMessage(event) {\n if (event.source === global && typeof event.data === \"string\" && event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n registerImmediate = function registerImmediate(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function (event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n registerImmediate = function registerImmediate(handle) {\n channel.port2.postMessage(handle);\n };\n }\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function registerImmediate(handle) {\n // Create a