diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index 982fa0db1..96b8e7cde 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -58,6 +58,7 @@ width: 100%; height: 100%; z-index: 100000; // alertify container + outline: none; font: @colortheme_app-font; .cp-checkmark { diff --git a/customize.dist/src/less2/include/colortheme-dark.less b/customize.dist/src/less2/include/colortheme-dark.less index 2c143c9a6..869ff862b 100644 --- a/customize.dist/src/less2/include/colortheme-dark.less +++ b/customize.dist/src/less2/include/colortheme-dark.less @@ -419,3 +419,7 @@ @cp_flatpickr-bg: @cryptpad_color_grey_800; @cp_flatpickr-highlight: @cryptpad_color_brand_300; @cp_flatpickr-highlight-text: @cryptpad_color_grey_800; + +// Calendar + +@cp_calendar-border: @cryptpad_color_grey_600; diff --git a/customize.dist/src/less2/include/colortheme.less b/customize.dist/src/less2/include/colortheme.less index 255540bec..6af7fe46a 100644 --- a/customize.dist/src/less2/include/colortheme.less +++ b/customize.dist/src/less2/include/colortheme.less @@ -419,3 +419,7 @@ @cp_flatpickr-bg: @cryptpad_color_grey_50; @cp_flatpickr-highlight: @cryptpad_color_brand_fadest; @cp_flatpickr-highlight-text: @cryptpad_text_col; + +// Calendar + +@cp_calendar-border: @cryptpad_color_grey_300; diff --git a/customize.dist/src/less2/include/forms.less b/customize.dist/src/less2/include/forms.less index 6181df09b..969c873c7 100644 --- a/customize.dist/src/less2/include/forms.less +++ b/customize.dist/src/less2/include/forms.less @@ -1,5 +1,6 @@ @import (reference) "./colortheme-all.less"; @import (reference) "./variables.less"; +@import (reference) "./tools.less"; .forms_main() { --LessLoader_require: LessLoader_currentFile(); @@ -13,14 +14,20 @@ color: @cp_forms-fg; background-color: @cp_forms-bg; border: 1px solid @cp_forms-border; - width: 100%; font-size: 100%; padding: @alertify_padding-base; + &:not(.tui-full-calendar-content) { + width: 100%; + } + &.tui-full-calendar-content { + font-size: @colortheme_app-font-size; + } &[readonly] { background-color: @cp_forms-readonly; border-color: @cp_forms-readonly-border; color: @cp_forms-fg; } + .tools_placeholder-color(); } input:not(.form-control) { @@ -112,6 +119,11 @@ &.no-margin { margin: 0; } + &.small { + line-height: initial; + padding: 5px; + height: auto; + } &:hover, &:not(:disabled):not(.disabled):active, &:focus { color: @cp_buttons-fg; diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 3cb9da2d2..31846b391 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -996,6 +996,9 @@ display: flex; #cp-toolbar-chat-drawer-open { order: 0; } #cp-toolbar-userlist-drawer-open { order: 1; } + & > .cp-dropdown-container { + height: @toolbar_line-height; + } } .cp-toolbar-bottom-right { diff --git a/customize.dist/src/less2/include/tools.less b/customize.dist/src/less2/include/tools.less index 87650ccdd..2b385cf6a 100644 --- a/customize.dist/src/less2/include/tools.less +++ b/customize.dist/src/less2/include/tools.less @@ -4,16 +4,20 @@ @color: @cp_forms-placeholder; &::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: @color; + font-weight: normal; } &::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */ color: @color; opacity: 1; /* Firefox */ + font-weight: normal; } &:-ms-input-placeholder { /* Internet Explorer 10-11 */ color: @color; + font-weight: normal; } &::-ms-input-placeholder { /* Microsoft Edge */ color: @color; + font-weight: normal; } } diff --git a/www/admin/inner.js b/www/admin/inner.js index 33691892b..332ff1fe3 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -1295,12 +1295,19 @@ define([ var end = h('input'); var $start = $(start); var $end = $(end); + var is24h = false; + try { + is24h = !new Intl.DateTimeFormat(navigator.language, { hour: 'numeric' }).format(0).match(/AM/); + } catch (e) {} + var endPickr = Flatpickr(end, { enableTime: true, + time_24hr: is24h, minDate: new Date() }); Flatpickr(start, { enableTime: true, + time_24hr: is24h, minDate: new Date(), onChange: function () { endPickr.set('minDate', new Date($start.val())); diff --git a/www/calendar/app-calendar.less b/www/calendar/app-calendar.less new file mode 100644 index 000000000..bc0f47a48 --- /dev/null +++ b/www/calendar/app-calendar.less @@ -0,0 +1,266 @@ +@import (reference) '../../customize/src/less2/include/framework.less'; +@import (reference) '../../customize/src/less2/include/sidebar-layout.less'; +@import (reference) '../../customize/src/less2/include/tools.less'; +@import (reference) '../../customize/src/less2/include/avatar.less'; + +&.cp-app-calendar { + + .framework_min_main(); + .sidebar-layout_main(); + + display: flex; + flex-flow: column; + + #cp-sidebarlayout-container #cp-sidebarlayout-rightside { + padding: 0; + & > div { + margin: 0; + } + + .cp-forcehide { + display: none !important; + } + + .tui-full-calendar-layout { + background-color: @cp_sidebar-right-bg !important; + color: @cryptpad_text_col; + .tui-full-calendar-month { + .tui-full-calendar-weekday-schedule-time .tui-full-calendar-weekday-schedule-title { + color: @cryptpad_text_col !important; // XXX + } + .tui-full-calendar-extra-date { + .tui-full-calendar-weekday-grid-date { + color: @cp_sidebar-hint !important; // XXX + opacity: 0.5; + } + } + .tui-full-calendar-weekday-grid-date { + color: @cryptpad_text_col !important; // XXX + } + .tui-full-calendar-month-dayname-item span { + color: @cryptpad_text_col !important; // XXX + } + } + .tui-full-calendar-dayname * { + color: @cryptpad_text_col !important; // XXX + } + .tui-full-calendar-month-more { + background-color: @cp_sidebar-right-bg !important; + color: @cryptpad_text_col; + span { + color: @cryptpad_text_col !important; + } + } + } + .tui-full-calendar-timegrid-timezone { + background-color: @cp_sidebar-right-bg !important; + .tui-full-calendar-timegrid-hour { + color: @cryptpad_text_col !important; + } + color: @cryptpad_text_col; + } + .tui-full-calendar-timegrid-gridline, .tui-full-calendar-time-date { + border-color: @cp_calendar-border !important; + } + .tui-full-calendar-splitter, .tui-full-calendar-left, .tui-full-calendar-dayname-container, .tui-full-calendar-weekday-grid-line { + border-color: @cp_calendar-border !important; + + } + .tui-full-calendar-popup-container { + background: @cp_flatpickr-bg; + color: @cryptpad_text_col; + .tui-full-calendar-icon:not(.tui-full-calendar-calendar-dot):not(.tui-full-calendar-dropdown-arrow):not(.tui-full-calendar-ic-checkbox) { + display: none; + } + } + li.tui-full-calendar-popup-section-item { + padding: 0 6px; + height: 32px; + } + .tui-full-calendar-popup-section-item { + height: auto; + margin: 0; + &:not(li):not(button) { + padding: 0; + margin-top: 5px; + } + #tui-full-calendar-schedule-calendar { + width: 179px; + top: 0; + } + &:not(button) { + border: none; + display: inline-flex; + align-items: center; + &:hover { + background-color: @cp_dropdown-bg-hover; + } + .tui-full-calendar-content { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font: @colortheme_app-font; + } + input { flex: 1; } + } + } + .tui-full-calendar-section-date-dash { + height: auto; + } + .tui-full-calendar-section-title, .tui-full-calendar-section-location { + width: 100%; + } + .tui-full-calendar-dropdown-menu { + top: 38px; + width: 221px; // same as button + background-color: @cp_dropdown-bg; + color: @cp_dropdown-fg; + } + .tui-full-calendar-section-state, #tui-full-calendar-schedule-private { + display: none !important; + } + + .tui-full-calendar-popup:not(.tui-full-calendar-popup-detail) { + .tui-full-calendar-section-calendar { + width: 221px; // 50% + } + .tui-full-calendar-popup-section { + display: flex; + align-items: center; + flex-wrap: wrap; + .tui-full-calendar-section-start-date, .tui-full-calendar-section-end-date { + flex: 1; + } + .tui-full-calendar-section-allday { + width: 100%; + height: 32px; + } + } + } + .tui-full-calendar-popup-detail { + font: @colortheme_app-font; + color: @cryptpad_text_col; + .tui-full-calendar-popup-container { + padding-bottom: 17px; + } + .tui-full-calendar-popup-detail-date { + font-size: 14px; + } + .tui-full-calendar-section-button { + border: 0; + display: flex; + align-items: center; + button { + flex: 1; + margin: 0; + } + } + .tui-full-calendar-popup-vertical-line { + visibility: hidden; + width: 10px; + } + } + + .cp-calendar-close { + height: auto; + line-height: initial; + border: 1px solid; + &:not(:hover) { + background: transparent; + } + } + } + + #cp-toolbar .cp-calendar-browse { + display: flex; + align-items: center; + } + + #cp-sidebarlayout-leftside { + & > div { + padding: 10px + } + .cp-calendar-new { + display: flex; + align-items: center; + justify-content: space-between; + } + .cp-calendar-list { + .cp-calendar-team { + height: 30px; + .avatar_main(30px); + .cp-avatar { + margin-right: 10px; + } + .cp-name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + display: flex; + align-items: center; + justify-content: center; + margin: 5px 0; + } + .cp-calendar-entry { + display: flex; + align-items: center; + justify-content: space-between; + padding: 5px; + cursor: pointer; + &.cp-ghost { + padding: 0; + button { + .tools_unselectable(); + cursor: pointer; + width: 100%; + display: flex; + justify-content: space-between; + background: transparent; + border: 1px solid @cryptpad_text_col; + height: 36px; + font: @colortheme_app-font; + align-items: center; + color: @cryptpad_text_col; + &:hover { + background: @cp_sidebar-left-active; + } + } + } + &:not(:last-child) { + margin-bottom: 10px; + } + &:hover { + background: fade(@cryptpad_text_col, 10%); + } + &.cp-restricted { + color: @cp_drive-header-fg; + } + &.cp-active { + background: @cp_sidebar-left-active; + } + .tools_unselectable(); + .cp-calendar-color { + display: inline-block; + border-radius: 50%; + width: 15px; + height: 15px; + flex-shrink: 0; + } + .cp-calendar-title { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding: 0 5px; + } + } + } + } + .cp-calendar-colorpicker { + width: 100px; + height: 25px; + cursor: pointer; + border: 1px solid @cp_forms-border; + } +} + diff --git a/www/calendar/index.html b/www/calendar/index.html new file mode 100644 index 000000000..96a3cce86 --- /dev/null +++ b/www/calendar/index.html @@ -0,0 +1,12 @@ + + + + CryptPad + + + + + + + + diff --git a/www/calendar/inner.html b/www/calendar/inner.html new file mode 100644 index 000000000..8c77c4fd7 --- /dev/null +++ b/www/calendar/inner.html @@ -0,0 +1,18 @@ + + + + + + + + +
+
+ + + diff --git a/www/calendar/inner.js b/www/calendar/inner.js new file mode 100644 index 000000000..e21438746 --- /dev/null +++ b/www/calendar/inner.js @@ -0,0 +1,947 @@ +define([ + 'jquery', + '/bower_components/chainpad-crypto/crypto.js', + '/common/toolbar.js', + '/bower_components/nthen/index.js', + '/common/sframe-common.js', + '/common/common-util.js', + '/common/common-hash.js', + '/common/common-interface.js', + '/common/common-ui-elements.js', + '/common/common-realtime.js', + '/common/clipboard.js', + '/common/inner/common-mediatag.js', + '/common/hyperscript.js', + '/customize/messages.js', + '/customize/application_config.js', + '/lib/calendar/tui-calendar.min.js', + + '/common/inner/share.js', + '/common/inner/access.js', + '/common/inner/properties.js', + + '/common/jscolor.js', + 'css!/lib/calendar/tui-calendar.min.css', + 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/calendar/app-calendar.less', +], function ( + $, + Crypto, + Toolbar, + nThen, + SFCommon, + Util, + Hash, + UI, + UIElements, + Realtime, + Clipboard, + MT, + h, + Messages, + AppConfig, + Calendar, + Share, Access, Properties + ) +{ + var APP = window.APP = { + calendars: {} + }; + + var common; + var metadataMgr; + var sframeChan; + +Messages.calendar = "Calendar"; // XXX +Messages.calendar_default = "My calendar"; // XXX +Messages.calendar_new = "New calendar"; // XXX +Messages.calendar_day = "Day"; +Messages.calendar_week = "Week"; +Messages.calendar_month = "Month"; +Messages.calendar_today = "Today"; +Messages.calendar_deleteConfirm = "Are you sure you want to delete this calendar from your account?"; +Messages.calendar_deleteTeamConfirm = "Are you sure you want to delete this calendar from this team?"; +Messages.calendar_deleteOwned = " It will still be visible for the users it has been shared with."; +Messages.calendar_errorNoCalendar = "No editable calendar selected!"; +Messages.calendar_myCalendars = "My calendars"; +Messages.calendar_tempCalendar = "Temp calendar"; +Messages.calendar_import = "Import to my calendars"; +Messages.calendar_newEvent = "New event"; +Messages.calendar_new = "New calendar"; +Messages.calendar_dateRange = "{0} - {1}"; +Messages.calendar_dateTimeRange = "{0} {1} - {2}"; + + var onCalendarsUpdate = Util.mkEvent(); + + var newCalendar = function (data, cb) { + APP.module.execCommand('CREATE', data, function (obj) { + if (obj && obj.error) { return void cb(obj.error); } + cb(null, obj); + }); + }; + var updateCalendar = function (data, cb) { + APP.module.execCommand('UPDATE', data, function (obj) { + if (obj && obj.error) { return void cb(obj.error); } + cb(null, obj); + }); + }; + var deleteCalendar = function (data, cb) { + APP.module.execCommand('DELETE', data, function (obj) { + if (obj && obj.error) { return void cb(obj.error); } + cb(null, obj); + }); + }; + var importCalendar = function (data, cb) { + APP.module.execCommand('IMPORT', data, function (obj) { + if (obj && obj.error) { return void cb(obj.error); } + cb(null, obj); + }); + }; + var newEvent = function (data, cb) { + var start = data.start; + var end = data.end; + data.start = +new Date(start._date); + data.end = +new Date(end._date); + APP.module.execCommand('CREATE_EVENT', data, function (obj) { + if (obj && obj.error) { return void cb(obj.error); } + cb(null, obj); + }); + }; + var updateEvent = function (data, cb) { + APP.module.execCommand('UPDATE_EVENT', data, function (obj) { + if (obj && obj.error) { return void cb(obj.error); } + cb(null, obj); + }); + }; + var deleteEvent = function (data, cb) { + APP.module.execCommand('DELETE_EVENT', data, function (obj) { + if (obj && obj.error) { return void cb(obj.error); } + cb(null, obj); + }); + }; + + var getContrast = function (color) { + var rgb = Util.hexToRGB(color); + // http://www.w3.org/TR/AERT#color-contrast + var brightness = Math.round(((parseInt(rgb[0]) * 299) + + (parseInt(rgb[1]) * 587) + + (parseInt(rgb[2]) * 114)) / 1000); + return (brightness > 125) ? 'black' : 'white'; + }; + + var getWeekDays = function () { + var baseDate = new Date(Date.UTC(2017, 0, 1)); // just a Sunday + var weekDays = []; + for(var i = 0; i < 7; i++) { + weekDays.push(baseDate.toLocaleDateString(undefined, { weekday: 'long' })); + baseDate.setDate(baseDate.getDate() + 1); + } + return weekDays.map(function (day) { return day.replace(/^./, function (str) { return str.toUpperCase(); }); }); + }; + + + + var getCalendars = function () { + return Object.keys(APP.calendars).map(function (id) { + var c = APP.calendars[id]; + if (c.hidden || c.restricted || c.loading) { return; } + var md = Util.find(c, ['content', 'metadata']); + if (!md) { return void console.error('Ignore calendar without metadata'); } + return { + id: id, + name: Util.fixHTML(md.title), + color: getContrast(md.color), + bgColor: md.color, + dragBgColor: md.color, + borderColor: md.color, + }; + }).filter(Boolean); + }; + var getSchedules = function () { + var s = []; + Object.keys(APP.calendars).forEach(function (id) { + var c = APP.calendars[id]; + if (c.hidden || c.restricted || c.loading) { return; } + var data = c.content || {}; + Object.keys(data.content || {}).forEach(function (uid) { + var obj = data.content[uid]; + obj.title = Util.fixHTML(obj.title || ""); + obj.location = Util.fixHTML(obj.location || ""); + if (c.readOnly) { + obj.isReadOnly = true; + } + s.push(data.content[uid]); + }); + }); + return s; + }; + var renderCalendar = function () { + var cal = APP.calendar; + if (!cal) { return; } + + cal.clear(); + cal.setCalendars(getCalendars()); + cal.createSchedules(getSchedules(), true); + cal.render(); + }; + var onCalendarUpdate = function (data) { + var cal = APP.calendar; + + if (data.deleted) { + // Remove this calendar + delete APP.calendars[data.id]; + } else { + // Update local data + APP.calendars[data.id] = data; + } + + // If calendar if initialized, update it + if (!cal) { return; } + onCalendarsUpdate.fire(); + renderCalendar(); + }; + + var getTime = function (time) { + var d = new Date(); + d.setHours(time.hour); + d.setMinutes(time.minutes); + return d.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}); + }; + + // If this browser doesn't support options to toLocaleTimeString, use default layout + if (!(function () { + // Modern browser will return a RangeError if the "locale" argument is invalid. + // Note: the "locale" argument has the same browser compatibility table as the "options" + try { + new Date().toLocaleTimeString('i'); + } catch (e) { + return e.name === 'RangeError'; + } + })()) { getTime = undefined; } + + var templates = { + popupSave: function () { + return Messages.settings_save; + }, + timegridDisplayTime: getTime, + timegridDisplayPrimaryTime: getTime, + popupDetailDate: function(isAllDay, start, end) { + var startDate = start._date.toLocaleDateString(); + var endDate = end._date.toLocaleDateString(); + if (isAllDay) { + if (startDate === endDate) { return startDate; } + return Messages._getKey('calendar_dateRange', [startDate, endDate]); + } + + var startTime = getTime({ + hour: start._date.getHours(), + minutes: start._date.getMinutes(), + }); + var endTime = getTime({ + hour: end._date.getHours(), + minutes: end._date.getMinutes(), + }); + + if (startDate === endDate && startTime === endTime) { + return start._date.toLocaleString(); + } + if (startDate === endDate) { + return Messages._getKey('calendar_dateTimeRange', [startDate, startTime, endTime]); + } + return Messages._getKey('calendar_dateRange', [start._date.toLocaleString(), end._date.toLocaleString()]); + } + }; + + // XXX Note: always create calendars in your own proxy. If you want a team calendar, you can share it with the team later. + var editCalendar = function (id) { + var isNew = !id; + var data = APP.calendars[id]; + if (id && !data) { return; } + var md = {}; + if (!isNew) { md = Util.find(data, ['content', 'metadata']); } + if (!md) { return; } + + // Create form data + var labelTitle = h('label', Messages.kanban_title); + var title = h('input'); + var $title = $(title); + $title.val(md.title || Messages.calendar_new); + var labelColor = h('label', Messages.kanban_color); + + var $colorPicker = $(h('div.cp-calendar-colorpicker')); + var jscolorL = new window.jscolor($colorPicker[0], { showOnClick: false, valueElement: undefined, zIndex: 100000 }); + $colorPicker.click(function() { + jscolorL.show(); + }); + if (md.color) { jscolorL.fromString(md.color); } + else { jscolorL.fromString(Util.getRandomColor()); } + + var form = h('div', [ + labelTitle, + title, + labelColor, + $colorPicker[0] + ]); + + var send = function (obj) { + if (isNew) { + return void newCalendar(obj, function (err) { + if (err) { console.error(err); return void UI.warn(Messages.error); } + UI.log(Messages.saved); + }); + } + obj.id = id; + updateCalendar(obj, function (err) { + if (err) { console.error(err); return void UI.warn(Messages.error); } + UI.log(Messages.saved); + }); + }; + var m = UI.dialog.customModal(form, { + buttons: [{ + className: 'cancel', + name: Messages.cancel, + onClick: function () {}, + keys: [27] + }, { + className: 'primary', + name: Messages.settings_save, + onClick: function () { + var color = jscolorL.toHEXString(); + var title = $title.val(); + var obj = { + color: color, + title: title + }; + if (!title || !title.trim() ||!/^#[0-9a-fA-F]{6}$/.test(color)) { + return true; + } + send(obj); + }, + keys: [13] + }] + }); + UI.openCustomModal(m); + }; + + var isReadOnly = function (id, teamId) { + var data = APP.calendars[id]; + return data.readOnly || (data.roTeams && data.roTeams.indexOf(teamId) !== -1); + }; + var makeEditDropdown = function (id, teamId) { + var options = []; + var privateData = metadataMgr.getPrivateData(); + var cantRemove = teamId === 0 || (teamId !== 1 && privateData.teams[teamId].viewer); + var data = APP.calendars[id]; + if (!data.readOnly) { + options.push({ + tag: 'a', + attributes: { + 'class': 'fa fa-pencil', + }, + content: h('span', Messages.tag_edit), + action: function (e) { + e.stopPropagation(); + editCalendar(id); + return true; + } + }); + } + if (data.teams.indexOf(1) === -1 || teamId === 0) { + options.push({ + tag: 'a', + attributes: { + 'class': 'fa fa-clone', + }, + content: h('span', Messages.calendar_import), + action: function (e) { + e.stopPropagation(); + importCalendar({ + id: id, + teamId: teamId + }, function (obj) { + if (obj && obj.error) { + console.error(obj.error); + return void UI.warn(obj.error); + } + }); + return true; + } + }); + } + if (!data.restricted) { + options.push({ + tag: 'a', + attributes: { + 'class': 'fa fa-shhare-alt', + }, + content: h('span', Messages.shareButton), + action: function (e) { + e.stopPropagation(); + var friends = common.getFriends(); + var cal = APP.calendars[id]; + var title = Util.find(cal, ['content', 'metadata', 'title']); + var color = Util.find(cal, ['content', 'metadata', 'color']); + Share.getShareModal(common, { + teamId: teamId === 1 ? undefined : teamId, + origin: APP.origin, + pathname: "/calendar/", + friends: friends, + title: title, + password: cal.password, // XXX support passwords + calendar: { + title: title, + color: color, + channel: id, + }, + common: common, + hashes: cal.hashes + }); + return true; + } + }); + options.push({ + tag: 'a', + attributes: { + 'class': 'fa fa-lock', + }, + content: h('span', Messages.accessButton), + action: function (e) { + e.stopPropagation(); + var cal = APP.calendars[id]; + var title = Util.find(cal, ['content', 'metadata', 'title']); + var color = Util.find(cal, ['content', 'metadata', 'color']); + var h = cal.hashes || {}; + var href = Hash.hashToHref(h.editHash || h.viewHash, 'calendar'); + Access.getAccessModal(common, { + title: title, + password: cal.password, // XXX support passwords + calendar: { + title: title, + color: color, + channel: id, + }, + common: common, + noExpiration: true, + noEditPassword: true, + channel: id, + href: href + }); + return true; + } + }); + options.push({ + tag: 'a', + attributes: { + 'class': 'fa fa-info-circle', + }, + content: h('span', Messages.propertiesButton), + action: function (e) { + e.stopPropagation(); + var cal = APP.calendars[id]; + var title = Util.find(cal, ['content', 'metadata', 'title']); + var color = Util.find(cal, ['content', 'metadata', 'color']); + var h = cal.hashes || {}; + var href = Hash.hashToHref(h.editHash || h.viewHash, 'calendar'); + Properties.getPropertiesModal(common, { + calendar: { + title: title, + color: color, + channel: id, + }, + common: common, + channel: id, + href: href + }); + return true; + } + }); + } + if (!cantRemove) { + options.push({ + tag: 'a', + attributes: { + 'class': 'fa fa-trash-o', + }, + content: h('span', Messages.kanban_delete), + action: function (e) { + e.stopPropagation(); + var cal = APP.calendars[id]; + var key = Messages.calendar_deleteConfirm; + var teams = (cal && cal.teams) || []; + if (teams.length === 1 && teams[0] !== 1) { + key = Messages.calendar_deleteTeamConfirm; + } + if (cal.owned) { + key += Messages.calendar_deleteOwned; + } + UI.confirm(Messages.calendar_deleteConfirm, function (yes) { + if (!yes) { return; } + deleteCalendar({ + id: id, + teamId: teamId, + }, function (err) { + if (err) { + console.error(err); + UI.warn(Messages.error); + } + }); + }); + } + }); + } + var dropdownConfig = { + text: '', + options: options, // Entries displayed in the menu + common: common, + buttonCls: 'btn btn-cancel fa fa-ellipsis-h small' + }; + return UIElements.createDropdown(dropdownConfig)[0]; + }; + var makeCalendarEntry = function (id, teamId) { + // XXX handle RESTRICTED calendars (data.restricted) + var data = APP.calendars[id]; + var edit; + if (data.loading) { + edit = h('i.fa.fa-spinner.fa-spin'); + } else { + edit = makeEditDropdown(id, teamId); + } + var md = Util.find(data, ['content', 'metadata']); + if (!md) { return; } + var active = data.hidden ? '' : '.cp-active'; + var restricted = data.restricted ? '.cp-restricted' : ''; + var calendar = h('div.cp-calendar-entry'+active+restricted, { + 'data-uid': id + }, [ + h('span.cp-calendar-color', { + style: 'background-color: '+md.color+';' + }), + h('span.cp-calendar-title', md.title), + data.restricted ? h('i.fa.fa-ban', {title: Messages.fm_restricted}) : + (isReadOnly(id, teamId) ? h('i.fa.fa-eye', {title: Messages.readonly}) : undefined), + edit + ]); + $(calendar).click(function () { + data.hidden = !data.hidden; + if (APP.$calendars) { + APP.$calendars.find('[data-uid="'+id+'"]').toggleClass('cp-active', !data.hidden); + } else { + $(calendar).toggleClass('cp-active', !data.hidden); + } + + renderCalendar(); + }); + if (APP.$calendars) { APP.$calendars.append(calendar); } + return calendar; + }; + var makeLeftside = function (calendar, $container) { + // Show calendars + var calendars = h('div.cp-calendar-list'); + var $calendars = APP.$calendars = $(calendars).appendTo($container); + onCalendarsUpdate.reg(function () { + $calendars.empty(); + var privateData = metadataMgr.getPrivateData(); + var filter = function (teamId) { + return Object.keys(APP.calendars || {}).filter(function (id) { + var cal = APP.calendars[id] || {}; + var teams = cal.teams || []; + return teams.indexOf(typeof(teamId) !== "undefined" ? teamId : 1) !== -1; + }); + }; + var tempCalendars = filter(0); + if (tempCalendars.length) { + APP.$calendars.append(h('div.cp-calendar-team', [ + h('span', Messages.calendar_tempCalendar) + ])); + makeCalendarEntry(tempCalendars[0], 0); + } + var myCalendars = filter(1); + if (myCalendars.length) { + APP.$calendars.append(h('div.cp-calendar-team', [ + h('span', Messages.calendar_myCalendars) + ])); + } + myCalendars.forEach(function (id) { + makeCalendarEntry(id, 1); + }); + Object.keys(privateData.teams).forEach(function (teamId) { + var calendars = filter(teamId); + if (!calendars.length) { return; } + var team = privateData.teams[teamId]; + var avatar = h('span.cp-avatar'); + common.displayAvatar($(avatar), team.avatar, team.displayName); + APP.$calendars.append(h('div.cp-calendar-team', [ + avatar, + h('span.cp-name', {title: team.name}, team.name) + ])); + calendars.forEach(function (id) { + makeCalendarEntry(id, teamId); + }); + }); + + // Add new button + var $newContainer = $(h('div.cp-calendar-entry.cp-ghost')).appendTo($calendars); + var newButton = h('button', [ + h('i.fa.fa-plus'), + h('span', Messages.calendar_new), + h('span') + ]); + $(newButton).click(function () { + editCalendar(); + }).appendTo($newContainer); + }); + onCalendarsUpdate.fire(); + + }; + var updateDateRange = function () { + var range = APP.calendar._renderRange; + var start = range.start._date.toLocaleDateString(); + var end = range.end._date.toLocaleDateString(); + var date = [ + h('b', start), + h('span', ' - '), + h('b', end), + ]; + if (APP.calendar._viewName === "day") { + date = h('b', start); + } else if (APP.calendar._viewName === "month") { + var month; + var mid = new Date(Math.floor(((+range.start._date) + (+range.end._date)) / 2)); + try { + month = mid.toLocaleString('default', { + month: 'long', + year:'numeric' + }); + month = month.replace(/^./, function (str) { return str.toUpperCase(); }); + date = h('b', month); + } catch (e) { + // Use same as week range: first day of month to last day of month + } + } + APP.toolbar.$bottomM.empty().append(h('div', date)); + }; + var makeCalendar = function () { + var $container = $('#cp-sidebarlayout-container'); + var leftside; + $container.append([ + leftside = h('div#cp-sidebarlayout-leftside'), + h('div#cp-sidebarlayout-rightside') + ]); + + var cal = APP.calendar = new Calendar('#cp-sidebarlayout-rightside', { + defaultView: 'week', // weekly view option + taskView: false, + useCreationPopup: true, + useDetailPopup: true, + usageStatistics: false, + calendars: getCalendars(), + template: templates, + month: { + daynames: getWeekDays(), + startDayOfWeek: 1, + }, + week: { + daynames: getWeekDays(), + startDayOfWeek: 1, + } + }); + + makeLeftside(cal, $(leftside)); + + cal.on('beforeCreateSchedule', function(event) { + // XXX Recurrence (later) + // On creation, select a recurrence rule (daily / weekly / monthly / more weird rules) + // then mark it under recurrence rule with a uid (the same for all the recurring events) + // ie: recurrenceRule: DAILY|{uid} + // Use template to hide "recurrenceRule" from the detailPopup or at least to use + // a non technical value + + var schedule = { + id: Util.uid(), + calendarId: event.calendarId, + title: Util.fixHTML(event.title), + category: "time", + location: Util.fixHTML(event.location), + start: event.start, + isAllDay: event.isAllDay, + end: event.end, + }; + + newEvent(schedule, function (err) { + if (err) { + console.error(err); + return void UI.warn(err); + } + cal.createSchedules([schedule]); + }); + }); + cal.on('beforeUpdateSchedule', function(event) { + var changes = event.changes || {}; + delete changes.state; + if (changes.end) { changes.end = +new Date(changes.end._date); } + if (changes.start) { changes.start = +new Date(changes.start._date); } + var old = event.schedule; + + updateEvent({ + ev: old, + changes: changes + }, function (err) { + if (err) { + console.error(err); + return void UI.warn(err); + } + cal.updateSchedule(old.id, old.calendarId, changes); + }); + }); + cal.on('beforeDeleteSchedule', function(event) { + var data = event.schedule; + deleteEvent(event.schedule, function (err) { + if (err) { + console.error(err); + return void UI.warn(err); + } + cal.deleteSchedule(data.id, data.calendarId); + }); + }); + + updateDateRange(); + + renderCalendar(); + + // Toolbar + + // Change view mode + var options = ['day', 'week', 'month'].map(function (k) { + return { + tag: 'a', + attributes: { + 'class': 'cp-calendar-view', + 'data-value': k, + 'href': '#', + }, + content: Messages['calendar_'+k] + // Messages.calendar_day + // Messages.calendar_week + // Messages.calendar_month + }; + }); + var dropdownConfig = { + text: Messages.calendar_week, + options: options, // Entries displayed in the menu + isSelect: true, + common: common, + caretDown: true, + left: true, + }; + var $block = UIElements.createDropdown(dropdownConfig); + $block.setValue('week'); + var $views = $block.find('a'); + $views.click(function () { + var mode = $(this).attr('data-value'); + cal.changeView(mode); + updateDateRange(); + }); + APP.toolbar.$bottomR.append($block); + + // New event button + var newEventBtn = h('button', [ + h('i.fa.fa-plus'), + h('span', Messages.calendar_newEvent) + ]); + $(newEventBtn).click(function (e) { + e.preventDefault(); + cal.openCreationPopup({isAllDay:false}); + }).appendTo(APP.toolbar.$bottomL); + + // Change page + var goLeft = h('button.fa.fa-chevron-left'); + var goRight = h('button.fa.fa-chevron-right'); + var goToday = h('button', Messages.calendar_today); + $(goLeft).click(function () { + cal.prev(); + updateDateRange(); + }); + $(goRight).click(function () { + cal.next(); + updateDateRange(); + }); + $(goToday).click(function () { + cal.today(); + updateDateRange(); + }); + APP.toolbar.$bottomL.append(h('div.cp-calendar-browse', [ + goLeft, goToday, goRight + ])); + + }; + + var createToolbar = function () { + var displayed = ['useradmin', 'newpad', 'limit', 'pageTitle', 'notifications']; + var configTb = { + displayed: displayed, + sfCommon: common, + $container: APP.$toolbar, + pageTitle: Messages.calendar, + metadataMgr: common.getMetadataMgr(), + }; + APP.toolbar = Toolbar.create(configTb); + APP.toolbar.$rightside.hide(); + }; + + var onEvent = function (obj) { + var ev = obj.ev; + var data = obj.data; + if (ev === 'UPDATE') { + onCalendarUpdate(data); + return; + } + }; + + nThen(function (waitFor) { + $(waitFor(UI.addLoadingScreen)); + SFCommon.create(waitFor(function (c) { APP.common = common = c; })); + }).nThen(function (waitFor) { + APP.$toolbar = $('#cp-toolbar'); + sframeChan = common.getSframeChannel(); + sframeChan.onReady(waitFor()); + }).nThen(function (/*waitFor*/) { + createToolbar(); + metadataMgr = common.getMetadataMgr(); + var privateData = metadataMgr.getPrivateData(); + var user = metadataMgr.getUserData(); + + // Fix flatpickr selection + var MutationObserver = window.MutationObserver; + var onFlatPickr = function (el) { + // Don't close event creation popup when clicking on flatpickr + $(el).mousedown(function (e) { + e.stopPropagation(); + }); + }; + var observer = new MutationObserver(function(mutations) { + mutations.forEach(function(mutation) { + var node; + for (var i = 0; i < mutation.addedNodes.length; i++) { + node = mutation.addedNodes[i]; + if (node.classList && node.classList.contains('flatpickr-calendar')) { + onFlatPickr(node); + } + } + }); + }); + observer.observe($('body')[0], { + childList: true, + subtree: false + }); + + // Customize creation/update popup + var onCalendarPopup = function (el) { + var $el = $(el); + $el.find('.tui-full-calendar-confirm').addClass('btn btn-primary').prepend(h('i.fa.fa-floppy-o')); + $el.find('input').attr('autocomplete', 'off'); + $el.find('.tui-full-calendar-dropdown-button').addClass('btn btn-secondary'); + $el.find('.tui-full-calendar-popup-close').addClass('btn btn-cancel fa fa-times cp-calendar-close').empty(); + + var calendars = APP.calendars || {}; + var show = false; + $el.find('.tui-full-calendar-dropdown-menu li').each(function (i, li) { + var $li = $(li); + var id = $li.attr('data-calendar-id'); + var c = calendars[id]; + if (!c || c.readOnly) { + return void $li.remove(); + } + // If at least one calendar is editable, show the popup + show = true; + }); + if ($el.find('.tui-full-calendar-hide.tui-full-calendar-dropdown').length || !show) { + $el.hide(); + UI.warn(Messages.calendar_errorNoCalendar); + return; + } + var isUpdate = Boolean($el.find('#tui-full-calendar-schedule-title').val()); + if (!isUpdate) { $el.find('.tui-full-calendar-dropdown-menu li').first().click(); } + }; + var onCalendarEditPopup = function (el) { + var $el = $(el); + $el.find('.tui-full-calendar-popup-edit').addClass('btn btn-primary'); + $el.find('.tui-full-calendar-popup-edit .tui-full-calendar-icon').addClass('fa fa-pencil').removeClass('tui-full-calendar-icon'); + $el.find('.tui-full-calendar-popup-delete').addClass('btn btn-danger'); + $el.find('.tui-full-calendar-popup-delete .tui-full-calendar-icon').addClass('fa fa-trash').removeClass('tui-full-calendar-icon'); + $el.find('.tui-full-calendar-content').removeClass('tui-full-calendar-content'); + }; + var onPopupRemoved = function () { + var start, end; + if (window.CP_startPickr) { start = window.CP_startPickr.calendarContainer; } + if (window.CP_endPickr) { end = window.CP_endPickr.calendarContainer; } + $('.flatpickr-calendar').each(function (i, el) { + if (el === start || el === end) { return; } + $(el).remove(); + }); + }; + var observer2 = new MutationObserver(function(mutations) { + mutations.forEach(function(mutation) { + var node, _node; + for (var i = 0; i < mutation.addedNodes.length; i++) { + node = mutation.addedNodes[i]; + try { + if (node.classList && node.classList.contains('tui-full-calendar-popup') + && !node.classList.contains('tui-full-calendar-popup-detail')) { + onCalendarPopup(node); + } + if (node.classList && node.classList.contains('tui-full-calendar-popup') + && node.classList.contains('tui-full-calendar-popup-detail')) { + onCalendarEditPopup(node); + } + } catch (e) {} + } + for (var j = 0; j < mutation.removedNodes.length; j++) { + _node = mutation.addedNodes[j]; + try { + if (_node.classList && _node.classList.contains('tui-full-calendar-popup')) { + onPopupRemoved(); + } + } catch (e) {} + } + }); + }); + observer2.observe($('body')[0], { + childList: true, + subtree: true + }); + + APP.module = common.makeUniversal('calendar', { + onEvent: onEvent + }); + APP.module.execCommand('SUBSCRIBE', null, function (obj) { + if (obj.empty && !privateData.calendarHash) { + // No calendar yet, create one + newCalendar({ + teamId: 1, + initialCalendar: true, + color: user.color, + title: Messages.calendar_default + }, function (err) { + if (err) { return void UI.errorLoadingScreen(Messages.error); } // XXX + makeCalendar(); + UI.removeLoadingScreen(); + }); + return; + } + if (privateData.calendarHash) { + APP.module.execCommand('OPEN', { + hash: privateData.hashes.editHash || privateData.hashes.viewHash, + password: privateData.password + }, function (obj) { + if (obj && obj.error) { console.error(obj.error); } + }); + } + makeCalendar(); + UI.removeLoadingScreen(); + }); + + APP.origin = privateData.origin; + + + }); +}); diff --git a/www/calendar/main.js b/www/calendar/main.js new file mode 100644 index 000000000..11b1ba4bf --- /dev/null +++ b/www/calendar/main.js @@ -0,0 +1,24 @@ +// Load #1, load as little as possible because we are in a race to get the loading screen up. +define([ + '/bower_components/nthen/index.js', + '/api/config', + '/common/dom-ready.js', + '/common/sframe-common-outer.js', +], function (nThen, ApiConfig, DomReady, SFCommonO) { + + // Loaded in load #2 + nThen(function (waitFor) { + DomReady.onReady(waitFor()); + }).nThen(function (waitFor) { + SFCommonO.initIframe(waitFor); + }).nThen(function (/*waitFor*/) { + var addData = function (meta) { + meta.calendarHash = Boolean(window.location.hash); + }; + SFCommonO.start({ + addData: addData, + noRealtime: true, + cache: true, + }); + }); +}); diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index 20c1cd8b7..b6ee407c5 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -12,7 +12,7 @@ define(function() { * You should never remove the drive from this list. */ config.availablePadTypes = ['drive', 'teams', 'pad', 'sheet', 'code', 'slide', 'poll', 'kanban', 'whiteboard', - /*'doc', 'presentation',*/ 'file', /*'todo',*/ 'contacts']; + /*'doc', 'presentation',*/ 'file', /*'todo',*/ 'contacts', 'calendar']; /* The registered only types are apps restricted to registered users. * You should never remove apps from this list unless you know what you're doing. The apps * listed here by default can't work without a user account. @@ -20,7 +20,7 @@ define(function() { * users and these users will be redirected to the login page if they still try to access * the app */ - config.registeredOnlyTypes = ['file', 'contacts', 'notifications', 'support']; + config.registeredOnlyTypes = ['file', 'contacts', 'notifications', 'support', 'calendar']; /* CryptPad is available is multiple languages, but only English and French are maintained * by the developers. The other languages may be outdated, and any missing string for a langauge diff --git a/www/common/common-constants.js b/www/common/common-constants.js index fdae2b5de..0a1c1d7f6 100644 --- a/www/common/common-constants.js +++ b/www/common/common-constants.js @@ -15,6 +15,6 @@ define(['/customize/application_config.js'], function (AppConfig) { MAX_TEAMS_SLOTS: AppConfig.maxTeamsSlots || 5, MAX_TEAMS_OWNED: AppConfig.maxOwnedTeams || 5, // Apps - criticalApps: ['profile', 'settings', 'debug', 'admin', 'support', 'notifications'] + criticalApps: ['profile', 'settings', 'debug', 'admin', 'support', 'notifications', 'calendar'] }; }); diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index b4c377f61..54e7a06c5 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1357,13 +1357,20 @@ define([ var $innerblock = $('
', {'class': 'cp-dropdown-content'}); if (config.left) { $innerblock.addClass('cp-dropdown-left'); } + var hide = function () { + window.setTimeout(function () { $innerblock.hide(); }, 0); + }; + config.options.forEach(function (o) { if (!isValidOption(o)) { return; } if (isElement(o)) { return $innerblock.append($(o)); } var $el = $('<' + o.tag + '>', o.attributes || {}).html(o.content || ''); $el.appendTo($innerblock); if (typeof(o.action) === 'function') { - $el.click(o.action); + $el.click(function (e) { + var close = o.action(e); + if (close) { hide(); } + }); } }); @@ -1383,10 +1390,6 @@ define([ } }; - var hide = function () { - window.setTimeout(function () { $innerblock.hide(); }, 0); - }; - var show = function () { var wh = $(window).height(); var button = $button[0].getBoundingClientRect(); @@ -2931,7 +2934,7 @@ define([ var dismiss = function () { common.mailbox.dismiss(data, function (err) { - console.log(err); + if (err) { console.log(err); } }); }; var answer = function (yes) { @@ -2940,6 +2943,7 @@ define([ href: msg.content.href, password: msg.content.password, title: msg.content.title, + calendar: msg.content.calendar, answer: yes }, { channel: msg.content.user.notifications, @@ -2975,16 +2979,29 @@ define([ // Add the pad to your drive // This command will also add your mailbox to the metadata log // The callback is called when the pad is stored, independantly of the metadata command - sframeChan.query('Q_ACCEPT_OWNERSHIP', data, function (err, res) { - if (err || (res && res.error)) { - return void console.error(err | res.error); - } - UI.log(Messages.saved); - if (autoStoreModal[data.channel]) { - autoStoreModal[data.channel].delete(); - delete autoStoreModal[data.channel]; - } - }); + if (data.calendar) { + var calendarModule = common.makeUniversal('calendar'); + var calendarData = data.calendar; + calendarData.href = data.href; + calendarData.teamId = 1; + calendarModule.execCommand('ADD', calendarData, function (obj) { + if (obj && obj.error) { + console.error(obj.error); + return void UI.warn(Messages.error); + } + }); + } else { + sframeChan.query('Q_ACCEPT_OWNERSHIP', data, function (err, res) { + if (err || (res && res.error)) { + return void console.error(err | res.error); + } + UI.log(Messages.saved); + if (autoStoreModal[data.channel]) { + autoStoreModal[data.channel].delete(); + delete autoStoreModal[data.channel]; + } + }); + } // Remove yourself from the pending owners sframeChan.query('Q_SET_PAD_METADATA', { diff --git a/www/common/common-util.js b/www/common/common-util.js index 36ae5cf64..9101749f8 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -585,6 +585,18 @@ return isEmoji(emojis[0])? emojis[0]: str[0]; }; + Util.getRandomColor = function (light) { + var getColor = function () { + if (light) { + return Math.floor(Math.random() * 156) + 70; + } + return Math.floor(Math.random() * 200) + 25; + }; + return '#' + getColor().toString(16) + + getColor().toString(16) + + getColor().toString(16); + }; + if (typeof(module) !== 'undefined' && module.exports) { module.exports = Util; } else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) { diff --git a/www/common/inner/access.js b/www/common/inner/access.js index cb3fc57c9..52b0d0319 100644 --- a/www/common/inner/access.js +++ b/www/common/inner/access.js @@ -336,6 +336,7 @@ define([ common.mailbox.sendTo("ADD_OWNER", { channel: channel, href: href, + calendar: opts.calendar, password: data.password || priv.password, title: data.title || title }, { @@ -841,7 +842,7 @@ define([ // In the properties, we should have the edit href if we know it. // We should know it because the pad is stored, but it's better to check... - if (!data.noEditPassword && owned && data.href) { // FIXME SHEET fix password change for sheets + if (!data.noEditPassword && !opts.noEditPassword && owned && data.href) { // FIXME SHEET fix password change for sheets var isOO = parsed.type === 'sheet'; var isFile = parsed.hashData.type === 'file'; var isSharedFolder = parsed.type === 'drive'; @@ -984,7 +985,7 @@ define([ if (err || (obj && obj.error)) { UI.warn(Messages.error); } }); }); - $d.append(h('br')); + if (!opts.noEditPassword) { $d.append(h('br')); } $d.append(h('div', [ h('label', Messages.access_destroyPad), h('br'), @@ -1016,7 +1017,7 @@ define([ var owned = Modal.isOwned(Env, data); // Request edit access - if (common.isLoggedIn() && ((data.roHref && !data.href) || data.fakeHref) && !owned) { + if (common.isLoggedIn() && ((data.roHref && !data.href) || data.fakeHref) && !owned && !opts.calendar) { var requestButton = h('button.btn.btn-secondary.no-margin.cp-access-margin-right', Messages.requestEdit_button); var requestBlock = h('p', requestButton); @@ -1054,7 +1055,7 @@ define([ var canMute = data.mailbox && owned === true && ( (typeof (data.mailbox) === "string" && data.owners[0] === edPublic) || data.mailbox[edPublic]); - if (owned === true) { + if (owned === true && !opts.calendar) { var cbox = UI.createCheckbox('cp-access-mute', Messages.access_muteRequests, !canMute); var $cbox = $(cbox); var spinner = UI.makeSpinner($cbox); diff --git a/www/common/inner/share.js b/www/common/inner/share.js index 860eb5566..f2eb2e953 100644 --- a/www/common/inner/share.js +++ b/www/common/inner/share.js @@ -112,6 +112,7 @@ define([ password: config.password, isTemplate: config.isTemplate, name: myName, + isCalendar: Boolean(config.calendar), title: title }, { viewed: team && team.id, @@ -123,6 +124,19 @@ define([ } // If it's a team with edit right, add the pad directly if (!team) { return; } + if (config.calendar) { + var calendarModule = common.makeUniversal('calendar'); + var calendarData = config.calendar; + calendarData.href = href; + calendarData.teamId = team.id; + calendarModule.execCommand('ADD', calendarData, function (obj) { + if (obj && obj.error) { + console.error(obj.error); + return void UI.warn(Messages.error); + } + }); + return; + } sframeChan.query('Q_STORE_IN_TEAM', { href: href, password: config.password, diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index c23bb1f60..b7bf479f3 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -19,6 +19,7 @@ define([ '/common/outer/team.js', '/common/outer/messenger.js', '/common/outer/history.js', + '/common/outer/calendar.js', '/common/outer/network-config.js', '/customize/application_config.js', @@ -32,7 +33,7 @@ define([ ], function (Sortify, UserObject, ProxyManager, Migrate, Hash, Util, Constants, Feedback, Realtime, Messaging, Pinpad, Cache, SF, Cursor, OnlyOffice, Mailbox, Profile, Team, Messenger, History, - NetConfig, AppConfig, + Calendar, NetConfig, AppConfig, Crypto, ChainPad, CpNetflux, Listmap, Netflux, nThen, Saferphore) { var onReadyEvt = Util.mkEvent(true); @@ -178,6 +179,24 @@ define([ typeof(store.proxy.curvePublic) === 'string'; }; + Store.isOwned = function (owners) { + var edPublic = store.proxy.edPublic; + // Not logged in? false + if (!edPublic) { return false; } + // No owners? false + if (!Array.isArray(owners) || !owners.length) { return false; } + + if (owners.indexOf(edPublic) !== -1) { return true; } + + // No team + var teams = store.proxy.teams; + if (!teams) { return false; } + return Object.keys(teams).some(function (id) { + var ed = Util.find(teams[id], ['keys', 'drive', 'edPublic']); + return ed && owners.indexOf(ed) !== -1; + }); + }; + var getUserChannelList = function () { var userChannel = store.driveChannel; if (!userChannel) { return null; } @@ -212,6 +231,13 @@ define([ list = list.concat(mList); } + if (store.proxy.calendars) { + var cList = Object.keys(store.proxy.calendars).map(function (c) { + return store.proxy.calendars[c].channel; + }); + list = list.concat(cList); + } + list.push(userChannel); list.sort(); @@ -567,18 +593,10 @@ define([ }; // Get or create the user color for the cursor position - var getRandomColor = function () { - var getColor = function () { - return Math.floor(Math.random() * 156) + 70; - }; - return '#' + getColor().toString(16) + - getColor().toString(16) + - getColor().toString(16); - }; - var getUserColor = function () { + Store.getUserColor = function () { var color = Util.find(store, ['proxy', 'settings', 'general', 'cursor', 'color']); if (!color) { - color = getRandomColor(); + color = Util.getRandomColor(true); Store.setAttribute(null, { attr: ['general', 'cursor', 'color'], value: color @@ -602,7 +620,7 @@ define([ uid: proxy.uid || store.noDriveUid, // Random uid in nodrive mode avatar: Util.find(proxy, ['profile', 'avatar']), profile: Util.find(proxy, ['profile', 'view']), - color: getUserColor(), + color: Store.getUserColor(), notifications: Util.find(proxy, ['mailboxes', 'notifications', 'channel']), curvePublic: proxy.curvePublic, }, @@ -1508,7 +1526,7 @@ define([ } }; // Teams support offline/cache mode - if (obj.type === "team") { return void todo(); } + if (['team', 'calendar'].indexOf(obj.type) !== -1) { return void todo(); } // If we're in "noDrive" mode if (!store.proxy) { return void todo(); } // Other modules should wait for the ready event @@ -1528,6 +1546,7 @@ define([ broadcast([], "UPDATE_METADATA"); }, pinPads: function (data, cb) { Store.pinPads(null, data, cb); }, + unpinPads: function (data, cb) { Store.unpinPads(null, data, cb); }, }, waitFor, function (ev, data, clients) { clients.forEach(function (cId) { postMessage(cId, 'UNIVERSAL_EVENT', { @@ -2665,6 +2684,8 @@ define([ }, true); }).nThen(function (waitFor) { loadUniversal(Team, 'team', waitFor, clientId); + }).nThen(function (waitFor) { + loadUniversal(Calendar, 'calendar', waitFor); }).nThen(function () { cb(); }); @@ -2726,6 +2747,7 @@ define([ loadUniversal(Messenger, 'messenger', waitFor); store.messenger = store.modules['messenger']; loadUniversal(Profile, 'profile', waitFor); + loadUniversal(Calendar, 'calendar', waitFor); if (store.modules['team']) { store.modules['team'].onReady(waitFor); } loadUniversal(History, 'history', waitFor); }).nThen(function () { diff --git a/www/common/outer/calendar.js b/www/common/outer/calendar.js new file mode 100644 index 000000000..e02ad1412 --- /dev/null +++ b/www/common/outer/calendar.js @@ -0,0 +1,802 @@ +define([ + '/common/common-util.js', + '/common/common-hash.js', + '/common/common-constants.js', + '/common/common-realtime.js', + '/common/outer/cache-store.js', + '/customize/messages.js', + '/bower_components/nthen/index.js', + '/bower_components/chainpad-listmap/chainpad-listmap.js', + '/bower_components/chainpad-crypto/crypto.js', + '/bower_components/chainpad/chainpad.dist.js', +], function (Util, Hash, Constants, Realtime, Cache, Messages, nThen, Listmap, Crypto, ChainPad) { + var Calendar = {}; + + +/* TODO +* Calendar +{ + href, + roHref, + channel, (pinning) + title, (when created from the UI, own calendar has no title) + color +} + + +* Own drive +{ + calendars: { + uid: calendar, + uid: calendar + } +} + +* Team drive +{ + calendars: { + uid: calendar, + uid: calendar + } +} + +* Calendars are listmap +{ + content: {}, + metadata: { + title: "pewpewpew" + } +} + +ctx.calendars[channel] = { + lm: lm, + proxy: lm.proxy? + stores: [teamId, teamId, 1] +} + +* calendar app can subscribe to this module + * when a listmap changes, push an update for this calendar to subscribed tabs +* Ability to open a calendar not stored in the stores but from its URL directly +* No "userlist" visible in the UI +* No framework + + + + + +*/ + + var getStore = function (ctx, id) { + if (!id || id === 1) { + return ctx.store; + } + var m = ctx.store.modules && ctx.store.modules.team; + if (!m) { return; } + return m.getTeam(id); + }; + + var makeCalendar = function () { + var hash = Hash.createRandomHash('calendar'); + var secret = Hash.getSecrets('calendar', hash); + var roHash = Hash.getViewHashFromKeys(secret); + var href = Hash.hashToHref(hash, 'calendar'); + var roHref = Hash.hashToHref(roHash, 'calendar'); + return { + href: href, + roHref: roHref, + channel: secret.channel, + }; + }; + var initializeCalendars = function (ctx, cb) { + var proxy = ctx.store.proxy; + proxy.calendars = proxy.calendars || {}; + setTimeout(cb); + }; + + var sendUpdate = function (ctx, c) { + ctx.emit('UPDATE', { + teams: c.stores, + roTeams: c.roStores, + id: c.channel, + loading: !c.ready && !c.cacheready, + readOnly: c.readOnly || (!c.ready && c.cacheready) || c.offline, + offline: c.offline, + deleted: !c.stores.length, + restricted: c.restricted, + owned: ctx.Store.isOwned(c.owners), + content: Util.clone(c.proxy), + hashes: c.hashes + }, ctx.clients); + }; + + var closeCalendar = function (ctx, id) { + var ctxCal = ctx.calendars[id]; + if (!ctxCal) { return; } + + // If the calendar doesn't exist in any other team, stop it and delete it from ctx + if (!ctxCal.stores.length) { + ctxCal.lm.stop(); + delete ctx.calendars[id]; + } + }; + + var updateLocalCalendars = function (ctx, c, data) { + // Also update local data + c.stores.forEach(function (id) { + var s = getStore(ctx, id); + if (!s || !s.proxy) { return; } + if (!s.rpc) { return; } // team viewer + if (!s.proxy.calendars) { return; } + var cal = s.proxy.calendars[c.channel]; + if (!cal) { return; } + if (cal.color !== data.color) { cal.color = data.color; } + if (cal.title !== data.title) { cal.title = data.title; } + }); + }; + var openChannel = function (ctx, cfg, _cb) { + var cb = Util.once(Util.mkAsync(_cb || function () {})); + var teamId = cfg.storeId; + var data = cfg.data; + var channel = data.channel; + console.error(cfg); + if (!channel) { return; } + + var c = ctx.calendars[channel]; + + var update = function () { + sendUpdate(ctx, c); + }; + + if (c) { + if (c.readOnly && data.href) { + // Upgrade readOnly calendar to editable + var upgradeParsed = Hash.parsePadUrl(data.href); + var upgradeSecret = Hash.getSecrets('calendar', upgradeParsed.hash, data.password); + var upgradeCrypto = Crypto.createEncryptor(upgradeSecret.keys); + c.hashes.editHash = Hash.getEditHashFromKeys(upgradeSecret); + c.lm.setReadOnly(false, upgradeCrypto); + c.readOnly = false; + } else if (teamId === 0) { + // Existing calendars can't be "temp calendars" (unless they are an upgrade) + return void cb(); + } + + // Remove from roStores when upgrading this store + if (c.roStores.indexOf(teamId) !== -1 && data.href) { + c.roStores.splice(c.roStores.indexOf(teamId), 1); + // If we've upgraded a stored calendar, remove the temp calendar + if (c.stores.indexOf(0) !== -1) { + c.stores.splice(c.stores.indexOf(0), 1); + } + update(); + } + + // Don't store duplicates + if (c.stores && c.stores.indexOf(teamId) !== -1) { return void cb(); } + + // If we store a temp calendar to our account or team, remove this "temp calendar" + if (c.stores.indexOf(0) !== -1) { c.stores.splice(c.stores.indexOf(0), 1); } + + c.stores.push(teamId); + if (!data.href) { + c.roStores.push(teamId); + } + update(); + return void cb(); + } + + // Multiple teams can have the same calendar. Make sure we remember the list of stores + // that know it so that we don't close the calendar when leaving/deleting a team. + c = ctx.calendars[channel] = { + ready: false, + channel: channel, + readOnly: !data.href, + stores: [teamId], + roStores: data.href ? [] : [teamId], + hashes: {} + }; + + + var parsed = Hash.parsePadUrl(data.href || data.roHref); + var secret = Hash.getSecrets('calendar', parsed.hash, data.password); + var crypto = Crypto.createEncryptor(secret.keys); + + c.hashes.viewHash = Hash.getViewHashFromKeys(secret); + if (data.href) { + c.hashes.editHash = Hash.getEditHashFromKeys(secret); + } + + c.proxy = { + metadata: { + color: data.color, + title: data.title + } + }; + update(); + + var onDeleted = function () { + // Remove this calendar from all our teams + // XXX Maybe not? don't remove automatically so that we can tell the user to do so. + c.stores.forEach(function (storeId) { + var store = getStore(ctx, storeId); + if (!store || !store.rpc || !store.proxy.calendars) { return; } + delete store.proxy.calendars[channel]; + // And unpin + var unpin = store.unpin || ctx.unpinPads; + unpin([channel], function (res) { + if (res && res.error) { console.error(res.error); } + }); + }); + + // Close listmap, update the UI and clear the memory + if (c.lm) { c.lm.stop(); } + c.stores = []; + sendUpdate(ctx, c); + delete ctx.calendars[channel]; + }; + + nThen(function (waitFor) { + if (!ctx.store.network || cfg.isNew) { return; } + // This is supposed to be an existing channel. Make sure it exists on the server + // before trying to load it. + // NOTE: if we can't check (error), we can skip this step. On "ready", we have + // another check to make sure we won't make a new calendar + ctx.Store.isNewChannel(null, channel, waitFor(function (obj) { + if (obj && obj.error) { + // If we can't check, skip this part + return; + } + if (obj && typeof(obj.isNew) === "boolean") { + if (obj.isNew) { + onDeleted(); + cb({error: 'EDELETED'}); + waitFor.abort(); + return; + } + } + })); + }).nThen(function () { + // Set the owners as the first store opening it. We don't know yet if it's a new or + // existing calendar. "owners' will be ignored if the calendar already exists. + var edPublic; + if (teamId === 1 || !teamId) { + edPublic = ctx.store.proxy.edPublic; + } else { + var teams = ctx.store.modules.team && ctx.store.modules.team.getTeamsData(); + var team = teams && teams[teamId]; + edPublic = team ? team.edPublic : undefined; + } + + var config = { + data: {}, + network: ctx.store.network || ctx.store.networkPromise, + channel: secret.channel, + crypto: crypto, + owners: [edPublic], + ChainPad: ChainPad, + validateKey: secret.keys.validateKey || undefined, + userName: 'calendar', + Cache: Cache, + classic: true, + onRejected: ctx.Store && ctx.Store.onRejected + }; + + var lm = Listmap.create(config); + c.lm = lm; + var proxy = c.proxy = lm.proxy; + + lm.proxy.on('cacheready', function () { + if (!proxy.metadata) { return; } + c.cacheready = true; + setTimeout(update); + if (cb) { cb(null, lm.proxy); } + }).on('ready', function (info) { + var md = info.metadata; + c.owners = md.owners || []; + c.ready = true; + if (!proxy.metadata) { + if (!cfg.isNew) { + // no metadata on an existing calendar: deleted calendar + return void onDeleted(); + } + proxy.metadata = { + color: data.color, + title: data.title + }; + } + setTimeout(update); + if (cb) { cb(null, lm.proxy); } + }).on('change', [], function () { + if (!c.ready) { return; } + setTimeout(update); + }).on('change', ['metadata'], function () { + // if title or color have changed, update our local values + var md = proxy.metadata; + if (!md || !md.title || !md.color) { return; } + updateLocalCalendars(ctx, c, md); + }).on('disconnect', function () { + c.offline = true; + setTimeout(update); + }).on('reconnect', function () { + c.offline = false; + setTimeout(update); + }).on('error', function (info) { + if (!info || !info.error) { return; } + if (info.error === "EDELETED" ) { + return void onDeleted(); + } + if (info.error === "ERESTRICTED" ) { + c.restricted = true; + } + cb(info); + }); + }); + }; + var decryptTeamCalendarHref = function (store, calData) { + if (!calData.href) { return; } + + // Already decrypted? nothing to do + if (calData.href.indexOf('#') !== -1) { return; } + + // href exists and is encrypted: decrypt if we can or ignore the href + if (store.secondaryKey) { + try { + calData.href = store.userObject.cryptor.decrypt(calData.href); + } catch (e) { + console.error(e); + delete calData.href; + } + } else { + delete calData.href; + } + }; + var initializeStore = function (ctx, store) { + var c = store.proxy.calendars; + var storeId = store.id || 1; + + // Add listeners + store.proxy.on('change', ['calendars'], function (o, n, p) { + if (p.length < 2) { return; } + + // Handle deletions + if (o && !n) { + (function () { + var id = p[1]; + var ctxCal = ctx.calendars[id]; + if (!ctxCal) { return; } + var idx = ctxCal.stores.indexOf(storeId); + + // Check if the team has loaded this calendar in memory + if (idx === -1) { return; } + + // Remove the team from memory + ctxCal.stores.splice(idx, 1); + var roIdx = ctxCal.roStores.indexOf(storeId); + if (roIdx !== -1) { ctxCal.roStores.splice(roIdx, 1); } + + // Check if we need to close listmap and update the UI + closeCalendar(ctx, id); + sendUpdate(ctx, ctxCal); + })(); + } + + // Handle additions + // NOTE: this also upgrade from readOnly to edit (add an "href" to the calendar) + if (!o && n) { + (function () { + var id = p[1]; + var _cal = store.proxy.calendars[id]; + if (!_cal) { return; } + var cal = Util.clone(_cal); + decryptTeamCalendarHref(store, cal); + openChannel(ctx, { + storeId: storeId, + data: cal + }); + })(); + } + }); + + // If this store contains existing calendars, open them + Object.keys(c || {}).forEach(function (channel) { + var cal = Util.clone(c[channel]); + decryptTeamCalendarHref(store, cal); + openChannel(ctx, { + storeId: storeId, + data: cal + }); + }); + }; + var openChannels = function (ctx) { + // Personal drive + initializeStore(ctx, ctx.store); + + var teams = ctx.store.modules.team && ctx.store.modules.team.getTeamsData(); + if (!teams) { return; } + Object.keys(teams).forEach(function (id) { + var store = getStore(ctx, id); + initializeStore(ctx, store); + }); + }; + + + var subscribe = function (ctx, data, cId, cb) { + // Subscribe to new notifications + var idx = ctx.clients.indexOf(cId); + if (idx === -1) { + ctx.clients.push(cId); + } + cb({ + empty: !Object.keys(ctx.calendars).length + }); + Object.keys(ctx.calendars).forEach(function (channel) { + var c = ctx.calendars[channel] || {}; + sendUpdate(ctx, c); + }); + }; + + var openCalendar = function (ctx, data, cId, cb) { + var secret = Hash.getSecrets('calendar', data.hash, data.password); + var hash = Hash.getEditHashFromKeys(secret); + var roHash = Hash.getViewHashFromKeys(secret); + + var cal = { + href: hash && Hash.hashToHref(hash, 'calendar'), + roHref: roHash && Hash.hashToHref(roHash, 'calendar'), + channel: secret.channel, + color: Util.getRandomColor(), + title: '...' + }; + openChannel(ctx, { + storeId: 0, + data: cal + }, cb); + }; + var importCalendar = function (ctx, data, cId, cb) { + var id = data.id; + var c = ctx.calendars[id]; + if (!c) { return void cb({error: "ENOENT"}); } + if (!Array.isArray(c.stores) || c.stores.indexOf(data.teamId) === -1) { + return void cb({error: 'EINVAL'}); + } + + // Add to my calendars + var store = ctx.store; + var calendars = store.proxy.calendars = store.proxy.calendars || {}; + var hash = c.hashes.editHash; + var roHash = c.hashes.viewHash; + calendars[id] = { + href: hash && Hash.hashToHref(hash, 'calendar'), + roHref: roHash && Hash.hashToHref(roHash, 'calendar'), + channel: id, + color: Util.find(c,['proxy', 'metadata', 'color']) || Util.getRandomColor(), + title: Util.find(c,['proxy', 'metadata', 'title']) || '...' + }; + ctx.Store.onSync(null, cb); + + // Make the change in memory + openChannel(ctx, { + storeId: 1, + data: { + href: calendars[id].href, + toHref: calendars[id].roHref, + channel: id + } + }); + }; + var addCalendar = function (ctx, data, cId, cb) { + var store = getStore(ctx, data.teamId); + if (!store) { return void cb({error: "NO_STORE"}); } + // Check team edit rights: viewers in teams don't have rpc + if (!store.rpc) { return void cb({error: "EFORBIDDEN"}); } + + var c = store.proxy.calendars = store.proxy.calendars || {}; + var parsed = Hash.parsePadUrl(data.href); + var secret = Hash.getSecrets(parsed.type, parsed.hash, data.password); + + if (secret.channel !== data.channel) { return void cb({error: 'EINVAL'}); } + + var hash = Hash.getEditHashFromKeys(secret); + var roHash = Hash.getViewHashFromKeys(secret); + var href = hash && Hash.hashToHref(hash, 'calendar'); + var cal = { + href: href, + roHref: roHash && Hash.hashToHref(roHash, 'calendar'), + color: data.color, + title: data.title, + channel: data.channel + }; + + // If it already existed and it's not an upgrade, nothing to do + if (c[data.channel] && (c[data.channel].href || !cal.href)) { return void cb(); } + + cal.color = data.color; + cal.title = data.title; + openChannel(ctx, { + storeId: store.id || 1, + data: Util.clone(cal) + }, function (err) { + if (err) { + // Can't open this channel, don't store it + console.error(err); + return void cb({error: err.error}); + } + + if (href && store.id && store.secondaryKey) { + try { + cal.href = store.userObject.cryptor.encrypt(href); + } catch (e) { + console.error(e); + } + } + + // Add the calendar and call back + // If it already existed it means this is an upgrade + c[cal.channel] = cal; + var pin = store.pin || ctx.pinPads; + pin([cal.channel], function (res) { + if (res && res.error) { console.error(res.error); } + }); + ctx.Store.onSync(store.id, cb); + }); + }; + var createCalendar = function (ctx, data, cId, cb) { + var store = getStore(ctx, data.teamId); + if (!store) { return void cb({error: "NO_STORE"}); } + // Check team edit rights: viewers in teams don't have rpc + if (!store.rpc) { return void cb({error: "EFORBIDDEN"}); } + + var c = store.proxy.calendars = store.proxy.calendars || {}; + var cal = makeCalendar(); + cal.color = data.color; + cal.title = data.title; + openChannel(ctx, { + storeId: store.id || 1, + data: cal, + isNew: true + }, function (err) { + if (err) { + // Can't open this channel, don't store it + console.error(err); + return void cb({error: err.error}); + } + // Add the calendar and call back + // Wait for the metadata to be stored (channel fully ready) before adding it + // to our store + var ctxCal = ctx.calendars[cal.channel]; + Realtime.whenRealtimeSyncs(ctxCal.lm.realtime, function () { + c[cal.channel] = cal; + var pin = store.pin || ctx.pinPads; + pin([cal.channel], function (res) { + if (res && res.error) { console.error(res.error); } + }); + ctx.Store.onSync(store.id, cb); + }); + }); + }; + var updateCalendar = function (ctx, data, cId, cb) { + var id = data.id; + var c = ctx.calendars[id]; + if (!c) { return void cb({error: "ENOENT"}); } + var md = Util.find(c, ['proxy', 'metadata']); + if (!md) { return void cb({error: 'EINVAL'}); } + md.title = data.title; + md.color = data.color; + Realtime.whenRealtimeSyncs(c.lm.realtime, cb); + sendUpdate(ctx, c); + + updateLocalCalendars(ctx, c, data); + }; + var deleteCalendar = function (ctx, data, cId, cb) { + var store = getStore(ctx, data.teamId); + if (!store) { return void cb({error: "NO_STORE"}); } + if (!store.rpc) { return void cb({error: "EFORBIDDEN"}); } + if (!store.proxy.calendars) { return; } + var id = data.id; + var cal = store.proxy.calendars[id]; + if (!cal) { return void cb(); } // Already deleted + + // Delete + delete store.proxy.calendars[id]; + + // Unpin + var unpin = store.unpin || ctx.unpinPads; + unpin([id], function (res) { + if (res && res.error) { console.error(res.error); } + }); + + // Clear/update ctx data + + // Remove this store from the calendar's clients + var ctxCal = ctx.calendars[id]; + var idx = ctxCal.stores.indexOf(store.id || 1); + ctxCal.stores.splice(idx, 1); + + closeCalendar(ctx, id); + + ctx.Store.onSync(store.id, function () { + sendUpdate(ctx, ctxCal); + cb(); + }); + }; + + var createEvent = function (ctx, data, cId, cb) { + var id = data.calendarId; + var c = ctx.calendars[id]; + if (!c) { return void cb({error: "ENOENT"}); } + c.proxy.content = c.proxy.content || {}; + c.proxy.content[data.id] = data; + Realtime.whenRealtimeSyncs(c.lm.realtime, function () { + sendUpdate(ctx, c); + cb(); + }); + }; + var updateEvent = function (ctx, data, cId, cb) { + if (!data || !data.ev) { return void cb({error: 'EINVAL'}); } + var id = data.ev.calendarId; + var c = ctx.calendars[id]; + if (!c || !c.proxy || !c.proxy.content) { return void cb({error: "ENOENT"}); } + + // Find the event + var ev = c.proxy.content[data.ev.id]; + if (!ev) { return void cb({error: "EINVAL"}); } + + // update the event + var changes = data.changes || {}; + + var newC; + if (changes.calendarId) { + newC = ctx.calendars[changes.calendarId]; + if (!newC || !newC.proxy) { return void cb({error: "ENOENT"}); } + newC.proxy.content = newC.proxy.content || {}; + } + + Object.keys(changes).forEach(function (key) { + ev[key] = changes[key]; + }); + + // Move to a different calendar? + if (changes.calendarId && newC) { + newC.proxy.content[data.ev.id] = Util.clone(ev); + delete c.proxy.content[data.ev.id]; + } + + nThen(function (waitFor) { + Realtime.whenRealtimeSyncs(c.lm.realtime, waitFor()); + if (newC) { Realtime.whenRealtimeSyncs(newC.lm.realtime, waitFor()); } + }).nThen(cb); + }; + var deleteEvent = function (ctx, data, cId, cb) { + var id = data.calendarId; + var c = ctx.calendars[id]; + if (!c) { return void cb({error: "ENOENT"}); } + c.proxy.content = c.proxy.content || {}; + delete c.proxy.content[data.id]; + Realtime.whenRealtimeSyncs(c.lm.realtime, cb); + }; + + var removeClient = function (ctx, cId) { + var idx = ctx.clients.indexOf(cId); + ctx.clients.splice(idx, 1); + }; + + Calendar.init = function (cfg, waitFor, emit) { + var calendar = {}; + var store = cfg.store; + if (!store.loggedIn || !store.proxy.edPublic) { return; } // XXX logged in only? + var ctx = { + store: store, + Store: cfg.Store, + pinPads: cfg.pinPads, + unpinPads: cfg.unpinPads, + updateMetadata: cfg.updateMetadata, + emit: emit, + onReady: Util.mkEvent(true), + calendars: {}, + clients: [], + }; + + initializeCalendars(ctx, waitFor(function (err) { + if (err) { return; } + openChannels(ctx); + })); + + calendar.closeTeam = function (teamId) { + Object.keys(ctx.calendars).forEach(function (id) { + var ctxCal = ctx.calendars[id]; + var idx = ctxCal.stores.indexOf(teamId); + if (idx === -1) { return; } + ctxCal.stores.splice(idx, 1); + var roIdx = ctxCal.roStores.indexOf(teamId); + if (roIdx !== -1) { ctxCal.roStores.splice(roIdx, 1); } + + closeCalendar(ctx, id); + sendUpdate(ctx, ctxCal); + }); + }; + calendar.openTeam = function (teamId) { + var store = getStore(ctx, teamId); + if (!store) { return; } + initializeStore(ctx, store); + }; + calendar.upgradeTeam = function (teamId) { + if (!teamId) { return; } + var store = getStore(ctx, teamId); + if (!store) { return; } + Object.keys(ctx.calendars).forEach(function (id) { + var ctxCal = ctx.calendars[id]; + var idx = ctxCal.stores.indexOf(teamId); + if (idx === -1) { return; } + var _cal = store.proxy.calendars[id]; + var cal = Util.clone(_cal); + decryptTeamCalendarHref(store, cal); + openChannel(ctx, { + storeId: teamId, + data: cal + }); + sendUpdate(ctx, ctxCal); + }); + }; + + calendar.removeClient = function (clientId) { + removeClient(ctx, clientId); + }; + calendar.execCommand = function (clientId, obj, cb) { + var cmd = obj.cmd; + var data = obj.data; + if (cmd === 'SUBSCRIBE') { + return void subscribe(ctx, data, clientId, cb); + } + if (cmd === 'OPEN') { + ctx.Store.onReadyEvt.reg(function () { + openCalendar(ctx, data, clientId, cb); + }); + return; + } + if (cmd === 'IMPORT') { + if (ctx.store.offline) { return void cb({error: 'OFFLINE'}); } + return void importCalendar(ctx, data, clientId, cb); + } + if (cmd === 'ADD') { + if (ctx.store.offline) { return void cb({error: 'OFFLINE'}); } + return void addCalendar(ctx, data, clientId, cb); + } + if (cmd === 'CREATE') { + if (data.initialCalendar) { + return void ctx.Store.onReadyEvt.reg(function () { + createCalendar(ctx, data, clientId, cb); + }); + } + if (ctx.store.offline) { return void cb({error: 'OFFLINE'}); } + return void createCalendar(ctx, data, clientId, cb); + } + if (cmd === 'UPDATE') { + if (ctx.store.offline) { return void cb({error: 'OFFLINE'}); } + return void updateCalendar(ctx, data, clientId, cb); + } + if (cmd === 'DELETE') { + if (ctx.store.offline) { return void cb({error: 'OFFLINE'}); } + return void deleteCalendar(ctx, data, clientId, cb); + } + if (cmd === 'CREATE_EVENT') { + if (ctx.store.offline) { return void cb({error: 'OFFLINE'}); } + return void createEvent(ctx, data, clientId, cb); + } + if (cmd === 'UPDATE_EVENT') { + if (ctx.store.offline) { return void cb({error: 'OFFLINE'}); } + return void updateEvent(ctx, data, clientId, cb); + } + if (cmd === 'DELETE_EVENT') { + if (ctx.store.offline) { return void cb({error: 'OFFLINE'}); } + return void deleteEvent(ctx, data, clientId, cb); + } + }; + + return calendar; + }; + + return Calendar; +}); + + + diff --git a/www/common/outer/sharedfolder.js b/www/common/outer/sharedfolder.js index 188fb2e40..3bc39546c 100644 --- a/www/common/outer/sharedfolder.js +++ b/www/common/outer/sharedfolder.js @@ -186,7 +186,7 @@ define([ ChainPad: ChainPad, classic: true, network: network, - Cache: Cache, // ICE shared-folder cache + Cache: Cache, // shared-folder cache metadata: { validateKey: secret.keys.validateKey || undefined, owners: owners diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 373e9c762..c5423ff7b 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -130,6 +130,9 @@ define([ delete ctx.store.proxy.teams[teamId]; ctx.emit('LEAVE_TEAM', teamId, team.clients); ctx.updateMetadata(); + if (ctx.store.calendar) { + ctx.store.calendar.closeTeam(teamId); + } if (ctx.store.mailbox) { ctx.store.mailbox.close('team-'+teamId, function () { // Close team mailbox @@ -154,6 +157,13 @@ define([ if (membersChannel) { list.push(membersChannel); } if (mailboxChannel) { list.push(mailboxChannel); } + if (store.proxy.calendars) { + var cList = Object.keys(store.proxy.calendars).map(function (c) { + return store.proxy.calendars[c].channel; + }); + list = list.concat(cList); + } + var state = store.roster.getState(); if (state.members) { Object.keys(state.members).forEach(function (curve) { @@ -338,6 +348,7 @@ define([ }); }, true); }).nThen(function () { + if (ctx.store.calendar) { ctx.store.calendar.openTeam(id); } cb(); }); }; @@ -1249,6 +1260,13 @@ define([ team.userObject.setReadOnly(!secret.keys.secondaryKey, secret.keys.secondaryKey); } + // Upgrade? update calendar rights + if (secret.keys.secondaryKey) { + try { + ctx.store.modules.calendar.upgradeTeam(teamId); + } catch (e) { console.error(e); } + } + if (!secret.keys.secondaryKey && team.rpc) { team.rpc.destroy(); } diff --git a/www/common/requireconfig.js b/www/common/requireconfig.js index 36979ce36..1689c0527 100644 --- a/www/common/requireconfig.js +++ b/www/common/requireconfig.js @@ -15,7 +15,9 @@ define([ "json.sortify": "/bower_components/json.sortify/dist/JSON.sortify", //"pdfjs-dist/build/pdf": "/bower_components/pdfjs-dist/build/pdf", //"pdfjs-dist/build/pdf.worker": "/bower_components/pdfjs-dist/build/pdf.worker" - cm: '/bower_components/codemirror' + cm: '/bower_components/codemirror', + 'tui-code-snippet': '/lib/calendar/tui-code-snippet.min', + 'tui-date-picker': '/lib/calendar/date-picker', }, map: { '*': { diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index fa5bcab2a..100ba7d72 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -571,7 +571,7 @@ define([ var defaultTitle = Utils.UserObject.getDefaultName(parsed); var edPublic, curvePublic, notifications, isTemplate; var settings = {}; - var isSafe = ['debug', 'profile', 'drive', 'teams'].indexOf(currentPad.app) !== -1; + var isSafe = ['debug', 'profile', 'drive', 'teams', 'calendar'].indexOf(currentPad.app) !== -1; var isDeleted = isNewFile && currentPad.hash.length > 0; if (isDeleted) { diff --git a/www/lib/calendar/date-picker.js b/www/lib/calendar/date-picker.js new file mode 100644 index 000000000..bc42dbbeb --- /dev/null +++ b/www/lib/calendar/date-picker.js @@ -0,0 +1,53 @@ +define([ + 'jquery', + '/lib/datepicker/flatpickr.js', + + 'css!/lib/datepicker/flatpickr.min.css', +], function ($, Flatpickr) { + var createRangePicker = function (cfg) { + var start = cfg.startpicker; + var end = cfg.endpicker; + + var is24h = false + try { + is24h = !new Intl.DateTimeFormat(navigator.language, { hour: 'numeric' }).format(0).match(/AM/); + } catch (e) {} + + var e = $(end.input)[0]; + var endPickr = Flatpickr(e, { + enableTime: true, + time_24hr: is24h, + minDate: start.date + }); + endPickr.setDate(end.date); + + var s = $(start.input)[0]; + var startPickr = Flatpickr(s, { + enableTime: true, + time_24hr: is24h, + onChange: function () { + endPickr.set('minDate', startPickr.parseDate(s.value)); + } + }); + startPickr.setDate(start.date); + window.CP_startPickr = startPickr; + window.CP_endPickr = endPickr; + + var getStartDate = function () { + setTimeout(function () { $(startPickr.calendarContainer).remove(); }); + return startPickr.parseDate(s.value); + }; + var getEndDate = function () { + setTimeout(function () { $(endPickr.calendarContainer).remove(); }); + return endPickr.parseDate(e.value); + }; + + return { + getStartDate: getStartDate, + getEndDate: getEndDate, + }; + }; + return { + createRangePicker: createRangePicker + }; +}); diff --git a/www/lib/calendar/tui-calendar.min.css b/www/lib/calendar/tui-calendar.min.css new file mode 100644 index 000000000..786e00cd6 --- /dev/null +++ b/www/lib/calendar/tui-calendar.min.css @@ -0,0 +1,7 @@ +/*! + * TOAST UI Calendar + * @version 1.13.0 | Wed Dec 23 2020 + * @author NHN FE Development Lab + * @license MIT + */.tui-full-calendar-layout{height:100%;position:relative;box-sizing:border-box}.tui-full-calendar-layout *{box-sizing:border-box}.tui-full-calendar-dragging{cursor:move}.tui-full-calendar-resizing{cursor:row-resize}.tui-full-calendar-resizing-x{cursor:col-resize}.tui-full-calendar-hidden{display:none!important}.tui-full-calendar-invisible span{visibility:hidden}.tui-full-calendar-clear:after{content:"";display:block;clear:both}.tui-full-calendar-scroll-y{overflow-y:scroll}.tui-full-calendar-dot{display:inline-block;position:relative;top:-1px;content:"";width:7px;height:7px;border-radius:50%}.tui-full-calendar-holiday{color:red}.tui-full-calendar-today{background:rgba(218,229,249,.3)}.handle-x{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAACVBMVEX///////////+OSuX+AAAAA3RSTlMrQJG5H4EIAAAAEUlEQVR4AWNgYoRABhjEFAEAArQAIcHQcPsAAAAASUVORK5CYII=)}.handle-x,.handle-y{background-position:50%;background-repeat:no-repeat}.handle-y{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAICAMAAADp7a43AAAACVBMVEX///////////+OSuX+AAAAA3RSTlMrQJG5H4EIAAAAEUlEQVR4AWNgYmRiZABB/CwAAtgAIUTUNkMAAAAASUVORK5CYII=)}@media only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-devicepixel-ratio:1.5),only screen and (min-resolution:1.5dppx){.handle-x{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAMAAADHqI+lAAAACVBMVEX///////////+OSuX+AAAAA3RSTlMZK5EY+QKaAAAAGUlEQVR4AWNgYmJAwegCIMDIiIwxBKhhBgAcSABh8gN42gAAAABJRU5ErkJggg==);background-size:8px 4px}.handle-y{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAQCAMAAAAcVM5PAAAACVBMVEX///////////+OSuX+AAAAA3RSTlMEK5EMBzK5AAAAGElEQVR4AWNgYmIAYxgDBBgZQRjOoKcaABzQAGGjsIM/AAAAAElFTkSuQmCC);background-size:4px 8px}}.tui-full-calendar-month-week-item .tui-full-calendar-weekday-grid{overflow-y:hidden}.tui-full-calendar-month-week-item .tui-full-calendar-weekday-schedules{overflow-y:visible;height:0}.tui-full-calendar-month-week-item .tui-full-calendar-weekday-schedule{margin:0 10px}.tui-full-calendar-month-week-item .tui-full-calendar-today{background:none}.tui-full-calendar-month-week-item .tui-full-calendar-today .tui-full-calendar-weekday-grid-date-decorator{display:inline-block;width:27px;height:27px;line-height:27px;text-align:center;background:#135de6;border-radius:50%;color:#fff;font-weight:700;margin-left:2px}.tui-full-calendar-weekday-container,.tui-full-calendar-weekday-grid,.tui-full-calendar-weekday-grid-line{height:100%;min-height:inherit}.tui-full-calendar-weekday-grid{position:absolute;width:100%;overflow-y:scroll}.tui-full-calendar-weekday-border{border-top:1px solid #ddd}.tui-full-calendar-weekday-container{position:relative}.tui-full-calendar-weekday-container>div{height:100%}.tui-full-calendar-weekday-grid-line{position:absolute;padding:3px}.tui-full-calendar-weekday-grid-line .tui-full-calendar-weekday-grid-footer{position:absolute;bottom:4px}.tui-full-calendar-weekday-grid-line .tui-full-calendar-weekday-grid-date{display:inline-block;width:27px;height:27px;line-height:27px;text-align:center}.tui-full-calendar-weekday-grid-line .tui-full-calendar-weekday-grid-date-title{line-height:27px;margin-right:5px}.tui-full-calendar-weekday-grid-line .tui-full-calendar-weekday-grid-more-schedules{float:right;display:inline-block;height:27px;line-height:27px;padding:0 5px;text-align:center;font-size:11px;font-weight:700;color:#aaa}.tui-full-calendar-weekday-creation,.tui-full-calendar-weekday-schedules{top:0;left:0;width:100%;height:100%;position:absolute;overflow-y:scroll}.tui-full-calendar-weekday-schedules{font-size:12px}.tui-full-calendar-weekday-schedules-height-span{width:1px;margin-left:-1px}.tui-full-calendar-weekday-schedule-block{position:absolute}.tui-full-calendar-weekday-schedule-block-dragging-dim{opacity:.3}.tui-full-calendar-weekday-schedule{position:relative;margin:0 10px 0 1px;cursor:pointer;border-left-style:solid;border-left-width:3px}.tui-full-calendar-weekday-schedule.tui-full-calendar-weekday-schedule-time{border-left-width:0}.tui-full-calendar-weekday-schedule.tui-full-calendar-weekday-schedule-time .tui-full-calendar-weekday-schedule-title{padding-left:9px}.tui-full-calendar-weekday-schedule-bullet{position:absolute;padding:0;width:6px;height:6px;top:6px;left:0;border-radius:50%}.tui-full-calendar-weekday-schedule-bullet-focused{left:10px;background:#fff}.tui-full-calendar-weekday-schedule-title{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:3px;font-weight:700}.tui-full-calendar-weekday-schedule-title-focused{padding-left:16px}.tui-full-calendar-weekday-schedule-cover{position:absolute;top:0;width:100%;height:100%;background-color:rgba(0,0,0,.2);box-shadow:0 2px 6px 0 rgba(0,0,0,.1)}.tui-full-calendar-weekday-exceed-left .tui-full-calendar-weekday-schedule{margin-left:0;border-left-width:0}.tui-full-calendar-weekday-exceed-right .tui-full-calendar-weekday-schedule{margin-right:0}.tui-full-calendar-weekday-exceed-right .tui-full-calendar-weekday-resize-handle{display:none}.tui-full-calendar-weekday-exceed-in-month{cursor:pointer}.tui-full-calendar-weekday-exceed-in-month:hover{background-color:#f0f1f5}.tui-full-calendar-weekday-collapse-btn,.tui-full-calendar-weekday-exceed-in-week{position:absolute;bottom:5px;margin-right:5px;font-size:12px;line-height:14px;cursor:pointer;padding:1px 5px;background-color:#fff;border:1px solid #ddd;color:#000}.tui-full-calendar-weekday-resize-handle{position:absolute;top:0;right:0;width:6px;background-position:3px;cursor:col-resize;line-height:18px}.tui-full-calendar-weekday-filled{background-color:#e8e8e8!important}.tui-full-calendar-left{height:100%;float:left;box-sizing:border-box;display:table}.tui-full-calendar-left-content{display:table-cell;vertical-align:middle;text-align:right;font-size:11px}.tui-full-calendar-right{height:100%;overflow-y:scroll;position:relative}.tui-full-calendar-week-container{width:100%;height:inherit;display:inline-block;font-size:10px;min-height:600px}.tui-full-calendar-week-container .tui-full-calendar-today{background:none}.tui-full-calendar-dayname{position:absolute;margin-left:-1px;height:100%;overflow:hidden}.tui-full-calendar-dayname.tui-full-calendar-today{font-weight:700}.tui-full-calendar-dayname-container{overflow-y:scroll}.tui-full-calendar-dayname-leftmargin{position:relative;height:100%}.tui-full-calendar-dayname-date{font-size:26px}.tui-full-calendar-dayname-name{font-weight:700;font-size:12px}.tui-full-calendar-daygrid-layout{height:100%}.tui-full-calendar-daygrid-layout .tui-full-calendar-right{overflow-y:hidden}.tui-full-calendar-daygrid-guide-creation-block{position:absolute;top:0;bottom:0;z-index:1}.tui-full-calendar-timegrid-container{height:100%;position:relative;overflow:hidden;overflow-y:scroll}.tui-full-calendar-timegrid-container-split{height:100%;position:relative;overflow:hidden}.tui-full-calendar-timegrid-left{position:absolute}.tui-full-calendar-timegrid-hour{position:relative;color:#555;box-sizing:border-box}.tui-full-calendar-timegrid-hour:first-child span{display:none}.tui-full-calendar-timegrid-hour:last-child{border-bottom:none}.tui-full-calendar-timegrid-hour span{position:absolute;top:-11px;left:0;right:5px;text-align:right;line-height:25px}.tui-full-calendar-timegrid-right{position:relative}.tui-full-calendar-timegrid-gridline{border-bottom:1px solid #eee;box-sizing:border-box}.tui-full-calendar-timegrid-gridline:last-child{border-bottom:none}.tui-full-calendar-timegrid-schedules{position:absolute;width:100%;height:100%;top:0;left:0;cursor:pointer}.tui-full-calendar-timegrid-hourmarker{position:absolute;width:100%;display:table}.tui-full-calendar-timegrid-hourmarker-line-left{position:absolute;min-height:1px;left:0}.tui-full-calendar-timegrid-hourmarker-line-today{position:absolute;min-height:1px}.tui-full-calendar-timegrid-hourmarker-line-right{position:absolute;min-height:1px;right:0}.tui-full-calendar-timegrid-hourmarker-time{padding-right:5px;line-height:12px;text-align:right;display:table-cell;vertical-align:bottom}.tui-full-calendar-timegrid-todaymarker{position:absolute;text-indent:-9999px;width:9px;height:9px;background-color:#135de6;margin:-4px 0 0 -5px;border-radius:50%}.tui-full-calendar-timegrid-sticky-container{position:absolute;top:0}.tui-full-calendar-timegrid-timezone-label-container{position:absolute}.tui-full-calendar-timegrid-timezone-label-cell{display:table}.tui-full-calendar-timegrid-timezone-label{display:table-cell;vertical-align:middle;padding-right:5px;text-align:right}.tui-full-calendar-timegrid-timezone-close-btn{cursor:pointer;position:absolute;text-align:center;background-color:#fff}.tui-full-calendar-timegrid-timezone-close-btn .tui-full-calendar-icon{width:5px;height:10px}.tui-full-calendar-time-date{position:absolute;height:100%;margin-left:-1px;box-sizing:content-box}.tui-full-calendar-time-date:last-child{border-right:none;margin:0}.tui-full-calendar-time-date:last-child .tui-full-calendar-time-guide-creation,.tui-full-calendar-time-date:last-child .tui-full-calendar-time-schedule{left:0}.tui-full-calendar-time-date-schedule-block-wrap{position:relative;height:100%}.tui-full-calendar-time-date-schedule-block{position:absolute;right:0}.tui-full-calendar-time-date-schedule-block-pending{opacity:.7}.tui-full-calendar-time-date-schedule-block-dragging-dim{opacity:.3}.tui-full-calendar-time-date-schedule-block-focused{box-shadow:0 0 8px 0 rgba(0,0,0,.2)}.tui-full-calendar-time-date-schedule-block-cover{position:absolute;top:0;width:100%;height:100%;background-color:rgba(0,0,0,.2);box-shadow:0 2px 6px 0 rgba(0,0,0,.1)}.tui-full-calendar-time-schedule{position:relative;left:1px;height:100%;overflow:hidden;font-size:12px;font-weight:700}.tui-full-calendar-time-schedule-content{overflow:hidden;border-left-width:3px;border-left-style:solid;padding:1px 0 0 3px}.tui-full-calendar-time-schedule-content-travel-time{font-weight:400;font-size:11px}.tui-full-calendar-time-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px;text-align:center;color:#fff;cursor:row-resize;background-position:top}.tui-full-calendar-time-guide-creation{position:absolute;right:10px;left:1px;padding:3px}.tui-full-calendar-time-guide-move .tui-full-calendar-time-resize-handle,.tui-full-calendar-time-guide-move .tui-full-calendar-time-schedule,.tui-full-calendar-time-guide-resize .tui-full-calendar-time-resize-handle,.tui-full-calendar-time-guide-resize .tui-full-calendar-time-schedule{opacity:.8;z-index:97}.tui-full-calendar-time-guide-creation-label{cursor:default}.tui-full-calendar-time-guide-bottom{position:absolute;bottom:3px}.tui-full-calendar-month{height:100%;min-height:600px}.tui-full-calendar-month-dayname{width:100%;position:absolute;font-size:13px}.tui-full-calendar-month-dayname-item{height:100%;font-weight:700}.tui-full-calendar-month-week-item{position:relative}.tui-full-calendar-month-week-item>div{height:100%}.tui-full-calendar-month-more{height:inherit;min-width:280px;min-height:150px}.tui-full-calendar-month-more-title{position:relative}.tui-full-calendar-month-more-title-day{font-size:23px;color:#333}.tui-full-calendar-month-more-title-day-label{font-size:12px;color:#333}.tui-full-calendar-month-more-close{position:absolute;right:0;outline:0;background:none;border:0;font-size:14px;line-height:28px;padding:0 7px;cursor:pointer}.tui-full-calendar-month-more-list{overflow-y:auto}.tui-full-calendar-month-more-schedule{cursor:pointer;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px}.tui-full-calendar-month-guide-block{position:absolute}.tui-full-calendar-month-weekday-schedule{margin-top:2px}.tui-full-calendar-month-creation-guide{top:0;bottom:-1px;left:-1px;right:0;position:absolute;z-index:20}.tui-full-calendar-month-guide-focused{box-shadow:0 0 8px 0 rgba(0,0,0,.2)}.tui-full-calendar-month-guide{position:relative;padding-left:3px;line-height:18px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tui-full-calendar-month-guide-cover{width:100%;position:absolute;top:-50%;left:-50%;background-color:rgba(0,0,0,.2);box-shadow:0 2px 6px 0 rgba(0,0,0,.1)}.tui-full-calendar-month-exceed-left .tui-full-calendar-month-guide{margin-left:0}.tui-full-calendar-month-exceed-right .tui-full-calendar-month-guide{margin-right:0}.tui-full-calendar-month-exceed-right .tui-full-calendar-month-guide-handle{display:none}.tui-full-calendar-month-guide-handle{position:absolute;top:0;right:3px;width:6px;background-position:3px;cursor:col-resize}.tui-full-calendar-vlayout-container{position:relative}.tui-full-calendar-splitter{clear:left;cursor:row-resize}.tui-full-calendar-splitter:hover{border-color:#999}.tui-full-calendar-splitter-focused{background-color:#ddd;border:none}.tui-full-calendar-splitter-guide{position:absolute;width:100%;height:3px;border:none;background-color:#e8e8e8}.tui-full-calendar-popup{position:absolute;font-weight:2.5;box-shadow:0 2px 6px 0 rgba(0,0,0,.1);clear:both}.tui-full-calendar-popup-container{min-width:474px;box-shadow:0 2px 6px 0 rgba(0,0,0,.1);background-color:#fff;border:1px solid #d5d5d5;padding:17px;border-radius:2px}.tui-full-calendar-popup-section{font-size:0;min-height:40px}.tui-full-calendar-section-calendar{width:176px}.tui-full-calendar-section-calendar.tui-full-calendar-hide{height:21px;visibility:hidden}.tui-full-calendar-section-title{width:calc(100% - 36px);padding-right:4px}.tui-full-calendar-section-title input{width:365px}.tui-full-calendar-button.tui-full-calendar-section-private{height:32px;padding:8px;font-size:0;margin-left:4px}.tui-full-calendar-section-private.tui-full-calendar-public .tui-full-calendar-ic-private{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAKdJREFUKBVjYCATMKLri46Olvn9+3fX////HUByjIyMB1hZWcuWLl36BFktikaQpl+/fl0EKhBCVgRkv2NjY9NH1syErABkE1TTdqBCWRAG8reDxKBycOUoGmHOA2pIA5kOwiA2SDVMDq4TmREaGvofhJHFcLHhfgwLC9sKNNULl0KQODCgtq1atcobxIY7lZAmkGJkNXCNIAlSwIjSCApqIgJnK0wNALoOPwSpOcq0AAAAAElFTkSuQmCC) no-repeat}.tui-full-calendar-section-end-date,.tui-full-calendar-section-start-date{width:176px}.tui-full-calendar-section-end-date input,.tui-full-calendar-section-start-date input{width:139px}.tui-full-calendar-section-end-date:focus .tui-datepicker,.tui-full-calendar-section-end-date:focus .tui-full-calendar-popup-section-item,.tui-full-calendar-section-end-date:hover .tui-datepicker,.tui-full-calendar-section-end-date:hover .tui-full-calendar-popup-section-item,.tui-full-calendar-section-start-date:focus .tui-datepicker,.tui-full-calendar-section-start-date:focus .tui-full-calendar-popup-section-item,.tui-full-calendar-section-start-date:hover .tui-datepicker,.tui-full-calendar-section-start-date:hover .tui-full-calendar-popup-section-item{border-color:#bbb}.tui-full-calendar-section-date-dash{font-size:12px;color:#d5d5d5;height:32px;padding:0 4px;vertical-align:middle}.tui-full-calendar-popup-section-item.tui-full-calendar-section-allday{border:none;padding:0 0 0 8px;cursor:pointer}.tui-full-calendar-popup-section-item.tui-full-calendar-section-location{display:block}.tui-full-calendar-popup-section-item.tui-full-calendar-section-location input{width:400px}.tui-full-calendar-section-allday .tui-full-calendar-icon.tui-full-calendar-ic-checkbox{margin:0}.tui-full-calendar-popup-section-item.tui-full-calendar-section-allday .tui-full-calendar-content{padding-left:4px}.tui-full-calendar-section-state{width:109px}.tui-full-calendar-section-state .tui-full-calendar-content{width:58px;text-overflow:ellipsis;overflow:hidden}.tui-full-calendar-popup-section-item{height:32px;padding:0 9px 0 12px;border:1px solid #d5d5d5;display:inline-block;font-size:0;border-radius:2px}.tui-full-calendar-popup-section-item:focus,.tui-full-calendar-popup-section-item:hover{border-color:#bbb}.tui-full-calendar-popup-section-item .tui-full-calendar-icon{position:relative}.tui-full-calendar-popup-section-item .tui-full-calendar-content{text-align:left;display:inline-block;font-size:12px;vertical-align:middle;position:relative;padding-left:8px}.tui-full-calendar-section-calendar .tui-full-calendar-dropdown-button .tui-full-calendar-content{width:125px;text-overflow:ellipsis;overflow:hidden;top:-1px}.tui-full-calendar-popup-section-item input{border:none;height:30px;outline:none;display:inline-block}.tui-full-calendar-popup-section-item input::placeholder{color:#bbb;font-weight:300}.tui-full-calendar-dropdown{position:relative}.tui-full-calendar-dropdown:hover .tui-full-calendar-dropdown-button{border:1px solid #bbb}.tui-full-calendar-dropdown-button.tui-full-calendar-popup-section-item{height:32px;font-size:0;top:-1px}.tui-full-calendar-dropdown-arrow{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYBgFOEOAEVkmPDxc89+/f6eAYjzI4kD2FyYmJrOVK1deh4kzwRggGiQBVJCELAZig8SQNYHEmEEEMrh69eo1HR0dfqCYJUickZGxf9WqVf3IakBsFBthklpaWmVA9mEQhrJhUoTp0NBQCRAmrHL4qgAAuu4cWZOZIGsAAAAASUVORK5CYII=) no-repeat}.dropdown.open .tui-full-calendar-dropdown-arrow,.tui-full-calendar-open .tui-full-calendar-dropdown-arrow{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAIFJREFUKBVjYBj+gBmXF2NiYiTV1dV5rl279gWbGiZsgg0NDSw/f/5cCZRbBWJjU4PVRjExsR6g4nAgln/z5g3v1atXd6JrxtAYHh4e+v///z4khZa6urrXgJqvIYkxMCJzgJo0//37dwooxoMsDmR/YWJiMlu5cuV1NPFRLrYQAADMVCaUtbG7XwAAAABJRU5ErkJggg==) no-repeat}.tui-full-calendar-dropdown-menu{position:absolute;top:31px;padding:4px 0;background-color:#fff;border:1px solid #d5d5d5;border-top:none;border-radius:0 0 2px 2px;width:100%;display:none}.tui-full-calendar-dropdown:hover .tui-full-calendar-dropdown-menu{border:1px solid #bbb;border-top:none}.tui-full-calendar-open .tui-full-calendar-dropdown-menu{display:block}.tui-full-calendar-dropdown-menu-item{height:30px;border:none;cursor:pointer}.tui-full-calendar-section-calendar .tui-full-calendar-dropdown-menu-item,.tui-full-calendar-section-state .tui-full-calendar-dropdown-menu-item{width:100%}.tui-full-calendar-dropdown-menu-item:hover{background-color:rgba(81,92,230,.05)}.tui-full-calendar-dropdown-menu-item .tui-full-calendar-content{line-height:30px}.tui-full-calendar-button.tui-full-calendar-popup-close{position:absolute;top:10px;right:10px;background-color:#fff;padding:2px;border:none}.tui-full-calendar-section-button-save{height:36px}.tui-full-calendar-popup-save{float:right}.tui-full-calendar-popup-arrow-border,.tui-full-calendar-popup-arrow-fill{position:absolute}.tui-full-calendar-arrow-top .tui-full-calendar-popup-arrow-border{border:8px solid transparent;border-top:none;border-bottom:8px solid #d5d5d5;left:calc(50% - 8px);top:-7px}.tui-full-calendar-arrow-right .tui-full-calendar-popup-arrow-border{border:8px solid transparent;border-right:none;border-left:8px solid #d5d5d5;top:calc(50% - 8px);right:-7px}.tui-full-calendar-arrow-bottom .tui-full-calendar-popup-arrow-border{border:8px solid transparent;border-top-color:#d5d5d5;border-bottom:none;left:calc(50% - 8px);bottom:-7px}.tui-full-calendar-arrow-left .tui-full-calendar-popup-arrow-border{border:8px solid transparent;border-right-color:#d5d5d5;border-left:none;top:calc(50% - 8px);left:-7px}.tui-full-calendar-arrow-top .tui-full-calendar-popup-arrow-fill{border:7px solid transparent;border-top:none;border-bottom:7px solid #fff;left:-7px;top:1px}.tui-full-calendar-arrow-right .tui-full-calendar-popup-arrow-fill{border:7px solid transparent;border-right:none;border-left:7px solid #fff;top:-7px;right:1px}.tui-full-calendar-arrow-bottom .tui-full-calendar-popup-arrow-fill{border:7px solid transparent;border-top-color:#fff;border-bottom:none;left:-7px;bottom:1px}.tui-full-calendar-arrow-left .tui-full-calendar-popup-arrow-fill{border:7px solid transparent;border-right-color:#fff;border-left:none;top:-7px;left:1px}.tui-full-calendar-button{background:#fff;border:1px solid #d5d5d5;border-radius:2px;text-align:center;outline:none;font-size:12px;cursor:pointer;color:#333}.tui-full-calendar-button:hover{border-color:#bbb;color:#333}.tui-full-calendar-button:active{background:#f9f9f9;color:#333}.tui-full-calendar-button .round{border-radius:25px}.tui-full-calendar-confirm{width:96px;height:36px;border-radius:40px;background-color:#ff6618;font-size:12px;font-weight:700;color:#fff;border:none}.tui-full-calendar-confirm:hover{background-color:#e55b15;color:#fff}.tui-full-calendar-confirm:active{background-color:#d95614;color:#fff}.tui-full-calendar-icon.tui-full-calendar-right{float:right;top:1px}.tui-full-calendar-icon .tui-full-calendar-none{display:none}.tui-full-calendar-icon.tui-full-calendar-calendar-dot{border-radius:8px;width:12px;height:12px;margin:1px}input[type=checkbox].tui-full-calendar-checkbox-square{display:none}input[type=checkbox].tui-full-calendar-checkbox-square+span{display:inline-block;cursor:pointer;line-height:14px;margin-right:8px;width:14px;height:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAADpJREFUKBVjPHfu3O5///65MJAAmJiY9jCcOXPmP6kApIeJBItQlI5qRAkOVM5o4KCGBwqPkcxEvhsAbzRE+Jhb9IwAAAAASUVORK5CYII=) no-repeat;vertical-align:middle}input[type=checkbox].tui-full-calendar-checkbox-square:checked+span{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMBJREFUKBWVkjEOwjAMRe2WgZW7IIHEDdhghhuwcQ42rlJugAQS54Cxa5cq1QM5TUpByZfS2j9+dlJVt/tX5ZxbS4ZU9VLkQvSHKTIGRaVJYFmKrBbTCJxE2UgCdDzMZDkHrOV6b95V0US6UmgKodujEZbJg0B0ZgEModO5lrY1TMQf1TpyJGBEjD+E2NPN7ukIUDiF/BfEXgRiGEw8NgkffYGYwCi808fpn/6OvfUfsDr/Vc1IfRf8sKnFVqeiVQfDu0tf/nWH9gAAAABJRU5ErkJggg==) no-repeat}input[type=checkbox].tui-full-calendar-checkbox-round{display:none}input[type=checkbox].tui-full-calendar-checkbox-round+span{display:inline-block;cursor:pointer;width:14px;height:14px;line-height:14px;vertical-align:middle;margin-right:8px;border-radius:8px;border:2px solid;background:transparent}.tui-full-calendar-popup-top-line{position:absolute;border-radius:2px 2px 0 0;width:100%;height:4px;border:none;top:0}.tui-full-calendar-popup-detail .tui-full-calendar-popup-container{width:301px;min-width:301px;padding-bottom:0}.tui-full-calendar-popup-detail .tui-full-calendar-icon{width:12px;height:12px;background-size:12px;position:relative;margin-right:8px}.tui-full-calendar-popup-detail .tui-full-calendar-icon.tui-full-calendar-ic-location-b,.tui-full-calendar-popup-detail .tui-full-calendar-icon.tui-full-calendar-ic-user-b{top:-2px}.tui-full-calendar-popup-detail .tui-full-calendar-icon.tui-full-calendar-ic-state-b{top:-1px}.tui-full-calendar-popup-detail .tui-full-calendar-icon.tui-full-calendar-calendar-dot{width:10px;height:10px;margin-right:8px;top:-1px}.tui-full-calendar-popup-detail .tui-full-calendar-content{line-height:24px;height:24px;font-size:12px;line-height:2}.tui-full-calendar-popup-detail .tui-full-calendar-section-header{margin-bottom:6px}.tui-full-calendar-popup-detail .tui-full-calendar-popup-detail-item-separate{margin-top:4px}.tui-full-calendar-popup-detail .tui-full-calendar-popup-detail-item-indent{text-indent:-20px;padding-left:20px}.tui-full-calendar-popup-detail .tui-full-calendar-schedule-title{font-size:15px;font-weight:700;line-height:1.6;word-break:break-all}.tui-full-calendar-popup-detail .tui-full-calendar-schedule-private{display:none;width:16px;height:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAKpJREFUKBVjYCATMKLri46Olvn9+3fX////HUByjIyMB1hZWcuWLl36BFktikaQpl+/fl0EKhBCVgRkv2NjY9NH1syErABkE1TTdqBCWRAG8reDxKBycOUoGmHOA2pIA5kOwiA2SDVMDqYTRSNQUBIkgewkJDZYDqYR7sewsLCtQFO9YBLYaGBAbVu1apU3SA5uIyFNIMXIauAaQRKkgBGlERTURATOVpgaABRQQOK46wEAAAAAAElFTkSuQmCC) no-repeat 16px}.tui-full-calendar-popup-detail .tui-full-calendar-schedule-private .tui-full-calendar-ic-private{display:block}.tui-full-calendar-popup-detail .tui-full-calendar-section-detail{margin-bottom:16px}.tui-full-calendar-popup-detail .tui-full-calendar-section-button{border-top:1px solid #e5e5e5;font-size:0}.tui-full-calendar-section-button .tui-full-calendar-icon{margin-right:4px;top:-3px}.tui-full-calendar-section-button .tui-full-calendar-content{position:relative;top:2px}.tui-full-calendar-popup-delete,.tui-full-calendar-popup-edit{display:inline-block;padding:7px 9px 11px;width:calc(50% - 1px);outline:none;background:none;border:none;cursor:pointer}.tui-full-calendar-popup-vertical-line{background:#e5e5e5;width:1px;height:14px;vertical-align:middle;display:inline-block;margin-top:-7px}.tui-datepicker{left:-12px;z-index:1;border-color:#d5d5d5}.tui-full-calendar-icon{width:14px;height:14px;display:inline-block;vertical-align:middle}.tui-full-calendar-icon.tui-full-calendar-ic-title{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAO5JREFUKBVjYCATMOLSFxkZqfHnz5+1QHktNDVbV69e7cOCJgjmQjXtB3IksMh7g8SY0CXQNTEyMlYD1fBCabhyFI3omkCq/v//PwnotC8gGq4LyIBrxKYJpBBoU15oaCgPiEbWCPYjUEIFGBBY/QS0qRWooRVIg/UBDXgMYoBtBHJSgWxsAQFWjET8BBqQBuLDNM4Can6GpAAb8ydQMADo3x0gSbDGlStX3gVqdMSjGUUTSCNKAggPD1cDOmU/EEuBJKEAQxNIHEUjSABNM1ZNIHXMIAIZXL169a2+vv5moK18QKeXAv20B1meYjYAr7xrljpOzc0AAAAASUVORK5CYII=) no-repeat}.tui-full-calendar-icon.tui-full-calendar-ic-location{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAR1JREFUKBWdUTtPg1AUBiT8CydHJtv/0MTJRWAgcTK1bq0/pO3k4E4IYLo2Me46tS4wumjSpV07kAb6HXLPzaGPRZLL+c73uE/D+OdnHuaCIOhVVTUEf620pWVZ0yRJ3qW3FfR9f1zX9UgaGJumOUnT9Fn3DDzPuwPOuD9TvSzL3kizhOFJ4LnjOJc0wM0FP2Asgx0mEehHUfRHgzDzqF3GOogzbJg8V6XHFqYv4Cvqy7J8DcOwWYmw8Hwy1kHMRjcaKuEGgV82caWbZay3indagJyxcKLOlKeRdJA627YfUVaN0v6tlKbZVjCO4zW2cw91px3AxJEmOONCNoTzPP9xXZfOd6u0Bzz60RGOgmQuiuIb4S3gB0IvaoJW2QMDs1bBoH1CAQAAAABJRU5ErkJggg==) no-repeat}.tui-full-calendar-icon.tui-full-calendar-ic-date{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAGpJREFUKBVjYKAGCA0N/Q/C6GZhE2cEKQoLC9v6//9/L3QN2PiMjIzbVq1a5c0EkiRWE7JasEZsJhMSI1sjC7LJq1evBvsZWQyZjRxwZNs4hDSiBA6y55EDBRsb7EdQasAmiUNsKw5x4oQBkUAeDPJ53KsAAAAASUVORK5CYII=) no-repeat}.tui-full-calendar-icon.tui-full-calendar-ic-state{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAIxJREFUKBVjYCATMKLrCw8P9/z3798soLgMVO4JExNT2sqVK7cjq2VC5oDYME2MjIyNIAwUkoGKoShlQeFBOGCbVq1a1QDihoaG1gMpmO0gITAAOzUsLGzr////vWCC+GigK7YBDfUGO5VYTSADYWox/IjPNmS5UY3IoYHGBgcOKG7QxPFxt+KTJCgHAGcZJbGLRuJ2AAAAAElFTkSuQmCC) no-repeat}.tui-full-calendar-icon.tui-full-calendar-ic-private{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAKpJREFUKBVjYCATMKLri46Olvn9+3fX////HUByjIyMB1hZWcuWLl36BFktikaQpl+/fl0EKhBCVgRkv2NjY9NH1syErABkE1TTdqBCWRAG8reDxKBycOUoGmHOA2pIA5kOwiA2SDVMDqYTRSNQUBIkgewkJDZYDqYR7sewsLCtQFO9YBLYaGBAbVu1apU3SA5uIyFNIMXIauAaQRKkgBGlERTURATOVpgaABRQQOK46wEAAAAAAElFTkSuQmCC) no-repeat}.tui-full-calendar-icon.tui-full-calendar-ic-close{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAJRJREFUKBXFkNERhCAMREUbuEKohzq0Eq2DDq6Da4B60KezDORkxj+ZwchmX0IYhtdWCGFl9y5g82NtzDnPdzAaudo76ZBS+nrvPxiInMkJcs5tMcZFfqcfxdqIRiELof+BiIJPg+mExmpmvKRn3zKj7OrG9Y79szPL14A1xEP0Hgy4gBZS5R7czHj3ehSgOzkVeyfuGrBw/WLm0hsAAAAASUVORK5CYII=) no-repeat}.tui-full-calendar-ic-location-b{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAOZJREFUKBWVUT0KwjAUbkzGTuJWPYNDpV0cXD2ETuIRBK+gs4ubp3BwcXBp6eINBKWDgydoid9X8oKCggYeee/7S9IGwZ9LverTNO3Wdb2y1o6IK6WOWutFlmU30XmDE58hbgvpTA+Y+mJqCemS20jdG2N6LPYMICc6b5BrIG3ONBZ7CoVj7w0cfllGRDj+gKQpjt/iPU0ye/LkROcNANaoCUzjqqquIsBuHddAWoiyLO9RFHUwJ4JxR/qmKIqdYG9vCMNwCeIiJHuHecj/B0GSJBng7ifO+ErDPM8L4b7ucRzPWJ8ET1E7YC7tmi9qAAAAAElFTkSuQmCC)}.tui-full-calendar-ic-state-b{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYCARMCKrNzEx8QTyZ/3//18GJM7IyPgESKWdOXNmO4gPAkwQCk6CFQMVNoIwVOMsuCw6w9jY+D8Iw8TR+SBxsJOATtkKNM0LphAbDbRxG9Bp3mAnEVIMMgCmBt0P2AxHERusGkAhgOJQ7Jyt2IUJiAIAwwIn24FgmhkAAAAASUVORK5CYII=)}.tui-full-calendar-icon.tui-full-calendar-ic-user-b{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAJpJREFUKBVjYKA1YES3wMTExBMoNgsqnnbmzJntyGqYkDlQ9qz////LgDCQD9MIV4ZNA1wSGwObhjRGRsYnIAzUkIZNE0licE+bm5tr/fnzJx1osjPQBFmoKY+BftnLwsIy8+TJk9dAYmANxsbGoUD2YiBmBwliAT+BYrFnz55dDfNDO1AAl2KQfpAcSA0DTIMyiEMAEKMG0wgAolIjcM7Tjm8AAAAASUVORK5CYII=)}.tui-full-calendar-icon.tui-full-calendar-ic-edit{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAMdJREFUKBVjYCARMOJTb2xsLMfIyBjLysq64Pjx409BapnwaQDKzf7//3/L79+/D1tbW0uB1LJg02BmZqYIVPgdKBf/79+//UC2xs+fP8OB/H4MG0CK//79ewCkEGQYExOTI5DawMnJuQTER/EDTDFQXA4kCQQ3QBpOnz79AsJF8gMWxTA1KDTYBhyKMUwH6WSysrKSB7kZyIY5AySOVTFIggno+5VAmijFYA1AwhzEgAKcJsMUwIMVGKPH2NnZ7ZFDBKYImQYAuO5YIMgk39gAAAAASUVORK5CYII=)}.tui-full-calendar-icon.tui-full-calendar-ic-delete{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAFhJREFUKBVjYCARMKKrNzEx2fr//38vkDgjI+O2M2fOeCOrAWtAVoQsicyGaWZCFsTHBtr6H588Tjm4H4yNjfGacPbsWbBaop0Es3JYaQBFDMxjWOitMDEA3EEZfFEISwUAAAAASUVORK5CYII=)}.tui-full-calendar-icon.tui-full-calendar-ic-arrow-solid-top{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAIFJREFUKBVjYBj+gBmXF2NiYiTV1dV5rl279gWbGiZsgg0NDSw/f/5cCZRbBWJjU4PVRjExsR6g4nAgln/z5g3v1atXd6JrxtAYHh4e+v///z4khZa6urrXgJqvIYkxMCJzgJo0//37dwooxoMsDmR/YWJiMlu5cuV1NPFRLrYQAADMVCaUtbG7XwAAAABJRU5ErkJggg==) no-repeat}.tui-full-calendar-icon.tui-full-calendar-ic-milestone{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAGFJREFUKBVjYCARMILU/3dw+I+hj5FxG+P+/d7o4rg1IKtE0syELI6T/f+/F0yOOA0w1UCa9hpYkGxjYDxwABwIILH/jo5bGWBuZ2TcClOHogEmCKKxBSlInPZ+ANlCEgAA37EU4AHbBQUAAAAASUVORK5CYII=) no-repeat}.tui-full-calendar-icon.tui-full-calendar-ic-arrow-left{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAHCAYAAAAvZezQAAAAAXNSR0IArs4c6QAAAFZJREFUCB1jZICCyspK83///hUxgvhVVVV6f//+3c3ExJTMVFNTowqU2cHMzJzf3t6+hen379/zgIp2t7W1rQCpZmJlZU0C0q5AbREgAQwzwAIgGZgtADMCJqH/QyvhAAAAAElFTkSuQmCC) no-repeat}.tui-full-calendar-icon.tui-full-calendar-ic-arrow-right{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAHCAYAAAAvZezQAAAAAXNSR0IArs4c6QAAAFxJREFUCB1jKC8vX1lZWWnOAAVMQLD4379/m6qqqvRAYowgAsiJAAr2sbCw2IMFQIIVFRUL////r8SCpMKVlZXVnhFooA9Q+VxmZmbXtra2S0xATizQYD8QB6QaAJMLJ9BqE9yTAAAAAElFTkSuQmCC) no-repeat}.tui-full-calendar-ic-repeat-b{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAQpJREFUKBVjYCARMCKrNzU1tf/3718lUMwQiP8yMjKeYWJi6j516tRhExOThjNnzjTANQAFqv///98CVHQPSO8A0ixATa5AtjyQPgDETmfPngULMpiZmbn//fu3BSg4B6ggCyjxG8hm8PT0ZH/9+vUJoJgTiA8CTCACqDgXaOJ9Xl7eTJhikDhQcSVQsQGITT8A9rSxsfF/mJVApzWCQgPGd3BwYPny5cstoNOuAZ3rAwoJOAAqviAqKtoOEwAaxPr58+dpQL4iEGeAxJFt2AfkOwA1PQTSu4Em/gGyPYC0EpCuAdraCtIADiWgQCPQOmdmZmYHoNgVoCJfIB0CpG8DI84BphgoRjoAAAzgdELI91E5AAAAAElFTkSuQmCC)} +/*# sourceMappingURL=tui-calendar.min.css.map */ \ No newline at end of file diff --git a/www/lib/calendar/tui-calendar.min.js b/www/lib/calendar/tui-calendar.min.js new file mode 100644 index 000000000..2fef47389 --- /dev/null +++ b/www/lib/calendar/tui-calendar.min.js @@ -0,0 +1,8 @@ +/*! + * TOAST UI Calendar + * @version 1.13.0 | Wed Dec 23 2020 + * @author NHN FE Development Lab + * @license MIT + */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("tui-code-snippet"),require("tui-date-picker")):"function"==typeof define&&define.amd?define(["tui-code-snippet","tui-date-picker"],t):"object"==typeof exports?exports.Calendar=t(require("tui-code-snippet"),require("tui-date-picker")):(e.tui=e.tui||{},e.tui.Calendar=t(e.tui&&e.tui.util,e.tui&&e.tui.DatePicker))}(window,(function(e,t){return function(e){var t={};function n(l){if(t[l])return t[l].exports;var o=t[l]={i:l,l:!1,exports:{}};return e[l].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(l,o,function(t){return e[t]}.bind(null,o));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=36)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var l,o=n(6),i=n(13),a=n(0),r=/^auto$|^$|%/;var s=(l={appendHTMLElement:function(e,t,n){var l;return n=n||"",(l=document.createElement(e)).className=n,t?t.appendChild(l):document.body.appendChild(l),l},remove:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},get:function(e){return document.getElementById(e)},_matcher:function(e,t){return/^\./.test(t)?l.hasClass(e,t.replace(".","")):/^#/.test(t)?e.id===t.replace("#",""):e.nodeName.toLowerCase()===t.toLowerCase()},find:function(e,t,n){var o=[],i=!1,r=a.isUndefined(n)||!1===n,s=a.isFunction(n);return a.isString(t)&&(t=l.get(t)),function e(t,a){for(var u,c=t.childNodes,d=0,h=c.length;d0&&(e(u,a),i))break}(t=t||window.document.body,e),r?o[0]||null:o},closest:function(e,t,n){var o;if(!e)return null;if(o=e.parentNode,!n&&l._matcher(e,t))return e;for(;o&&o!==window.document.body;){if(l._matcher(o,t))return o;o=o.parentNode}return null},text:function(e){var t="",n=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)t+=l.text(e)}else if(3===o||4===o)return e.nodeValue}else for(;e[n];n+=1)t+=l.text(e[n]);return t},setData:function(e,t,n){"dataset"in e?e.dataset[t]=n:e.setAttribute("data-"+t,n)},getData:function(e,t){return"dataset"in e?e.dataset[t]:e.getAttribute("data-"+t)},hasClass:function(e,t){var n;return a.isUndefined(e.classList)?(n=l.getClass(e)).length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(n):e.classList.contains(t)},addClass:function(e,t){var n;a.isUndefined(e.classList)?l.hasClass(e,t)||(n=l.getClass(e),l.setClass(e,(n?n+" ":"")+t)):a.forEachArray(t.split(" "),(function(t){e.classList.add(t)}))},setClass:function(e,t){a.isUndefined(e.className.baseVal)?e.className=t:e.className.baseVal=t},removeClass:function(e,t){var n="";a.isUndefined(e.classList)?(n=(" "+l.getClass(e)+" ").replace(" "+t+" "," "),l.setClass(e,n.replace(/^\s\s*/,"").replace(/\s\s*$/,""))):e.classList.remove(t)},getClass:function(e){return e&&e.className?a.isUndefined(e.className.baseVal)?e.className:e.className.baseVal:""},getStyle:function(e,t){var n,l=e.style[t]||e.currentStyle&&e.currentStyle[t];return l&&"auto"!==l||!document.defaultView||(l=(n=document.defaultView.getComputedStyle(e,null))?n[t]:null),"auto"===l?null:l},getComputedStyle:function(e){var t=document.defaultView;return t&&t.getComputedStyle?document.defaultView.getComputedStyle(e):{getPropertyValue:function(t){var n=/(\-([a-z]){1})/g;return"float"===t&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,(function(){return arguments[2].toUpperCase()}))),e.currentStyle[t]||null}}},setPosition:function(e,t,n){t=a.isUndefined(t)?0:t,n=a.isUndefined(n)?0:n,e._pos=[t,n],e.style.left=a.isNumber(t)?t+"px":t,e.style.top=a.isNumber(n)?n+"px":n},setLTRB:function(e,t){var n;["left","top","right","bottom"].forEach((function(l){n=a.isUndefined(t[l])?"":t[l],e.style[l]=a.isNumber(n)?n+"px":n}))},getPosition:function(e,t){var n,l,o;return t&&(e._pos=null),e._pos?e._pos:(n=0,l=0,(r.test(e.style.left)||r.test(e.style.top))&&"getBoundingClientRect"in e?(n=(o=e.getBoundingClientRect()).left,l=o.top):(n=parseFloat(e.style.left||0),l=parseFloat(e.style.top||0)),[n,l])},getSize:function(e){var t,n=l.getStyle(e,"width"),o=l.getStyle(e,"height");return(r.test(n)||r.test(o)||a.isNull(n)||a.isNull(o))&&"getBoundingClientRect"in e?(n=(t=e.getBoundingClientRect()).width||e.offsetWidth,o=t.height||e.offsetHeight):(n=parseFloat(n||0),o=parseFloat(o||0)),[n,o]},getBCRect:function(e){var t=e.getBoundingClientRect();return t=a.extend({width:e.offsetWidth,height:e.offsetHeight},t)},testProp:function(e){for(var t=document.documentElement.style,n=0,l=e.length;n12&&(t%=12),l.leadingZero(t,2)+":"+l.leadingZero(n,2)},tt:function(e){return e.getHours()<12?"am":"pm"}},l={MILLISECONDS_PER_DAY:864e5,MILLISECONDS_PER_HOUR:36e5,MILLISECONDS_PER_MINUTES:6e4,MILLISECONDS_SCHEDULE_MIN_DURATION:12e5,_convMilliseconds:function(e,n,l){var o={day:0,hour:1,minutes:2,seconds:3};return e in o&&!t.isNaN(n)&&r.reduce([n].concat([24,60,60,1e3].slice(o[e])),l)},millisecondsTo:function(e,t){var n=u,o=e+t;return n[o]||(n[o]=l._convMilliseconds(e,t,(function(e,t){return e/t}))),n[o]},millisecondsFrom:function(e,t){var n=c,o=e+t;return n[o]||(n[o]=l._convMilliseconds(e,t,(function(e,t){return e*t}))),n[o]},minutesFromHours:function(e){return 60*e},range:function(e,t,n){for(var o=e.getTime(),r=t.getTime(),s=o,u=a(new i(e)),c=[];s<=r&&r>=u.d.getTime();)c.push(l.start(u.d)),s+=n,u.addDate(1);return c},clone:function(e){return new i(e)},compare:function(e,t){var n=e.getTime(),l=t.getTime();return nl?1:0},isSameMonth:function(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()},isSameDate:function(e,t){return l.isSameMonth(e,t)&&e.getDate()===t.getDate()},isValid:function(e){return e instanceof i&&!window.isNaN(e.getTime())},toUTC:function(e){var t=e.getTime(),n=l.millisecondsFrom("minutes",(new Date).getTimezoneOffset());return new i(t+n)},leadingZero:function(e,t){var n="",l=0;if(String(e).length>t)return String(e);for(;l8?(n=~e.indexOf("/")?"/":"-",l=(a=a.splice(1))[0].split(n),o=a[1]?a[1].split(":"):[0,0,0]):(l=[(a=a[0]).substr(0,4),a.substr(4,2),a.substr(6,2)],o=[0,0,0]),(new i).setWithRaw(Number(l[0]),Number(l[1])+t,Number(l[2]),Number(o[0]),Number(o[1]),Number(o[2]),0))},raw:function(e){return{y:e.getFullYear(),M:e.getMonth(),d:e.getDate(),h:e.getHours(),m:e.getMinutes(),s:e.getSeconds(),ms:e.getMilliseconds()}},start:function(e){var t=e?new i(e):new i;return t.setHours(0,0,0,0),t},end:function(e){var t=e?new i(e):new i;return t.setHours(23,59,59,0),t},format:function(e,t){var n=t;return r.forEachOwnProperties(o,(function(t,l){n=n.replace(l,t(e))})),n},startDateOfMonth:function(e){var t=new i(e);return t.setDate(1),t.setHours(0,0,0,0),t},endDateOfMonth:function(e){var t=l.startDateOfMonth(e);return t.setMonth(t.getMonth()+1),t.setDate(t.getDate()-1),t.setHours(23,59,59),t},arr2dCalendar:function(e,t,n){var o,s,u,c,d,h,p,m,f=[],g=t.startDayOfWeek,y=r.isUndefined(t.isAlways6Week)||t.isAlways6Week,S=t.visibleWeeksCount,_=t.workweek;return S?(s=new i(e),(u=a(new i(e))).addDate(7*(S-1)),u=u.d):(s=l.startDateOfMonth(e),u=l.endDateOfMonth(e)),o=r.range(g,7).concat(r.range(7)).slice(0,7),c=r.inArray(s.getDay(),o),h=7-(r.inArray(u.getDay(),o)+1),d=S?7*S:y?42:c+u.getDate()+h,p=l.start(s).addDate(-c),r.forEachArray(r.range(d),(function(e){var t;e%7||(m=f[e/7]=[]),t=l.start(p),t=n?n(t):t,_&&l.isWeekend(t.getDay())||m.push(t),p.setDate(p.getDate()+1)})),f},getGridLeftAndWidth:function(e,t,n,o){var i=100/e,a=e>5?100/(e-1):i,s=0,u=r.range(n,7).concat(r.range(e)).slice(0,7);return o&&(u=r.filter(u,(function(e){return!l.isWeekend(e)}))),t=!o&&t,r.map(u,(function(n){var o,r=t?a:i;return e>5&&t&&l.isWeekend(n)&&(r=a/2),o={day:n,width:r,left:s},s+=r,o}))},isWeekend:function(e){return 0===e||6===e},isBetweenWithDate:function(e,t,n){return e=parseInt(l.format(e,"YYYYMMDD"),10),t=parseInt(l.format(t,"YYYYMMDD"),10),n=parseInt(l.format(n,"YYYYMMDD"),10),t<=e&&e<=n},isStartOfDay:function(e){return!l.compare(l.start(e),e)},convertStartDayToLastDay:function(e){var t=new i(e);return l.isStartOfDay(e)&&(t.setDate(t.getDate()-1),t.setHours(23,59,59)),t},getStartOfNextDay:function(e){var t=l.start(e);return t.setHours(24),t},getDateDifference:function(e,t){var n=new i(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new i(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return Math.round((n-o)/l.MILLISECONDS_PER_DAY)},getHourDifference:function(e,t){var n=new i(e).getTime(),o=new i(t).getTime();return Math.round((n-o)/l.MILLISECONDS_PER_HOUR)},hasMultiDates:function(e,t){var n=l.getDateDifference(e,t),o=Math.abs(l.getHourDifference(e,t)),i=1===Math.abs(n)&&o<24&&l.isStartOfDay(t);return!l.isSameDate(e,t)&&!i},renderEnd:function(e,t){var n=l.getDateDifference(e,t);return Math.abs(n)>=1&&l.isStartOfDay(t)?l.convertStartDayToLastDay(t):l.end(t)}},e.exports=l}).call(this,n(8))},function(e,t,n){"use strict";var l,o,i=n(0),a=n(52),r=h(),s=r,u=null,c=!1,d=null;function h(e){return e=i.isUndefined(e)?Date.now():e,6e4*new Date(e).getTimezoneOffset()}function p(e){return!c&&u?6e4*u(e):s}function m(e){var t=Date.UTC.apply(null,e);return new Date(t+h(t))}function f(e){var t;if(e instanceof S)t=e.getUTCTime();else if("number"==typeof e)t=e;else{if(null!==e)throw new Error("Invalid Type");t=0}return new Date(t)}function g(e){var t;if(e instanceof Date)t=e.getTime();else{if("string"!=typeof e)throw new Error("Invalid Type");t=Date.parse(e)}return t=function(e){return c?e-p(e)+r:e}(t),new Date(t)}function y(e){return e instanceof Date||"string"==typeof e}function S(e){var t;i.isUndefined(e)&&(e=Date.now()),t=arguments.length>1?m(arguments):y(e)?g(e):f(e),this._date=t}function _(e){s=6e4*e}function C(){return i.isNumber(l)?l:(new Date).getTimezoneOffset()}function v(e){o=e}function E(e,t){var n,l=C();return e&&(n=function(e){if(i.isFunction(d))return d;if(a.supportIntl(e))return a.offsetCalculator;return null}(e))?n(e,t):l}S.prototype.getTime=function(){var e=this._date.getTime();return e+p(e)-h(e)},S.prototype.getUTCTime=function(){return this._date.getTime()},S.prototype.toUTCString=function(){return this._date.toUTCString()},S.prototype.toDate=function(){return this._date},S.prototype.valueOf=function(){return this.getTime()},S.prototype.addDate=function(e){return this.setDate(this.getDate()+e),this},S.prototype.addMinutes=function(e){return this.setMinutes(this.getMinutes()+e),this},S.prototype.addMilliseconds=function(e){return this.setMilliseconds(this.getMilliseconds()+e),this},S.prototype.setWithRaw=function(e,t,n,l,o,i,a){return this.setFullYear(e,t,n),this.setHours(l,o,i,a),this},S.prototype.toLocalTime=function(){var e=this.getTime(),t=this.getUTCTime();return new S(t-(e-t))},["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds"].forEach((function(e){S.prototype[e]=function(){return this._date[e].apply(this._date,arguments)}})),["setDate","setFullYear","setHours","setMilliseconds","setMinutes","setMonth","setSeconds"].forEach((function(e){S.prototype[e]=function(){return this._date[e].apply(this._date,arguments),this.getTime()}})),e.exports={Date:S,setOffset:_,setOffsetByTimezoneOption:function(e){this.setOffset(-e),l=-e,c=!0},getOffset:function(){return c?s/6e4:0},setOffsetCallback:function(e){u=e},restoreOffset:function(){s=h()},getNativeOffsetMs:function(){return r},hasPrimaryTimezoneCustomSetting:function(){return c},resetCustomSetting:function(){c=!1},setOffsetCalculator:function(e){d=e},setPrimaryTimezoneByOption:function(e){var t,n;e&&e.timezoneName&&(t=e.timezoneName,c=!0,v(t),(n=E(t,Date.now()))===r/6e4&&(c=!1),function(e){l=e,_(e)}(n))},getPrimaryOffset:C,getOffsetByTimezoneName:E,getPrimaryTimezoneName:function(){return o},isNativeOsUsingDSTTimezone:function(){var e=(new Date).getFullYear();return new Date(e,0,1).getTimezoneOffset()!==new Date(e,6,1).getTimezoneOffset()},isPrimaryUsingDSTTimezone:function(){var e=(new Date).getFullYear(),t=new Date(e,0,1),n=new Date(e,6,1);return E(o,t)!==E(o,n)},isDifferentOffsetStartAndEndTime:function(e,t){var n=E(o,e),l=E(o,t),i=0;return n>l?i=1:nn?n:e},maxDate:function(e,t){return e>t?e:t},stripTags:function(e){return e.replace(/<([^>]+)>/gi,"")},firstIn2dArray:function(e){return l.pick(e,"0","0")},lastIn2dArray:function(e){var t=e.length-1,n=e[t].length-1;return l.pick(e,t,n)},setAutoEllipsis:function(e,t,n){l.forEach(o.find(e,t,!0),(function(e){(n||e.offsetWidth0)for(n=0;n0?e=(e+t)%24:t<0&&(e=(e+=t)>0?e:24+e),e},parseUnit:function(e){return[parseFloat(e,10),e.match(/[\d.\-+]*\s*(.*)/)[1]||""]},find:function(e,t,n){var o;return l.forEach(e,(function(e){return t&&(o=t(e)),!o||(o=e,!1)}),n),o},getScheduleChanges:function(e,t,n){var o={},i=["start","end"];return l.forEach(t,(function(t){i.indexOf(t)>-1?a.compare(e[t],n[t])&&(o[t]=n[t]):l.isUndefined(n[t])||e[t]===n[t]||(o[t]=n[t])})),l.isEmpty(o)?null:o}}},function(e,t,n){"use strict";var l=n(0),o=["touchstart","mousedown"],i={on:function(e,t,n,o){l.isString(t)?l.forEach(t.split(" "),(function(t){i._on(e,t,n,o)})):l.forEachOwnProperties(t,(function(t,l){i._on(e,l,t,n)}))},_on:function(e,t,n,o){var a,r,s;a=t+l.stamp(n)+(o?"_"+l.stamp(o):""),e._evt&&e._evt[a]||(s=r=function(t){n.call(o||e,t||window.event)},"addEventListener"in e?"mouseenter"===t||"mouseleave"===t?(r=function(t){t=t||window.event,i._checkMouse(e,t)&&s(t)},e.addEventListener("mouseenter"===t?"mouseover":"mouseout",r,!1)):("mousewheel"===t&&e.addEventListener("DOMMouseScroll",r,!1),e.addEventListener(t,r,!1)):"attachEvent"in e&&e.attachEvent("on"+t,r),e._evt=e._evt||{},e._evt[a]=r)},off:function(e,t,n,o){l.isString(t)?l.forEach(t.split(" "),(function(t){i._off(e,t,n,o)})):l.forEachOwnProperties(t,(function(t,l){i._off(e,l,t,n)}))},_off:function(e,t,n,o){var i=t+l.stamp(n)+(o?"_"+l.stamp(o):""),a=e._evt&&e._evt[i];if(a){if("removeEventListener"in e)"mouseenter"===t||"mouseleave"===t?e.removeEventListener("mouseenter"===t?"mouseover":"mouseout",a,!1):("mousewheel"===t&&e.removeEventListener("DOMMouseScroll",a,!1),e.removeEventListener(t,a,!1));else if("detachEvent"in e)try{e.detachEvent("on"+t,a)}catch(e){}delete e._evt[i],l.keys(e._evt).length||delete e._evt}},once:function(e,t,n,o){var a=this;l.isObject(t)?l.forEachOwnProperties(t,(function(t,l){i.once(e,l,t,n)})):i.on(e,t,(function l(){n.apply(o||e,arguments),a._off(e,t,l,o)}),o)},stopPropagation:function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},stop:function(e){i.preventDefault(e),i.stopPropagation(e)},disableScrollPropagation:function(e){i.on(e,"mousewheel MozMousePixelScroll",i.stopPropagation)},disableClickPropagation:function(e){i.on(e,o.join(" ")+" click dblclick",i.stopPropagation)},getMousePosition:function(e,t){var n;return t?(n=t.getBoundingClientRect(),[e.clientX-n.left-t.clientLeft,e.clientY-n.top-t.clientTop]):[e.clientX,e.clientY]},getWheelDelta:function(e){var t=0;return e.wheelDelta&&(t=e.wheelDelta/120),e.detail&&(t=-e.detail/3),t},_checkMouse:function(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(e){return!1}return n!==e},trigger:function(e,t,n){l.isUndefined(n)&&/(mouse|click)/.exec(t)&&(n=i.mouseEvent(t)),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent&&e.fireEvent("on"+t,n)},mouseEvent:function(e,t){var n,o;return o=l.extend({bubbles:!0,cancelable:"mousemove"!==e,view:window,wheelDelta:0,detail:0,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0},t),"function"==typeof document.createEvent?(n=document.createEvent("MouseEvents")).initMouseEvent(e,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,document.body.parentNode):document.createEventObject&&(n=document.createEventObject(),l.forEach(o,(function(e,t){n[t]=e}),this),n.button={0:1,1:4,2:2}[n.button]||n.button),n},getMouseButton:function(e){var t;return document.implementation.hasFeature("MouseEvents","2.0")?e.button:(t=String(e.button),"0,1,3,5,7".indexOf(t)>-1?0:"2,6".indexOf(t)>-1?2:~"4".indexOf(t)?1:-1)},getEventTarget:function(e){return e.target||e.srcElement}};e.exports=i},function(e,t,n){e.exports=n(21).default},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var l=n(0),o=n(1),i=n(13);function a(e){var t=l.stamp(this);l.isUndefined(e)&&(e=o.appendHTMLElement("div")),o.addClass(e,this.cssprefix(t)),this.id=t,this.container=e,this.children=new i((function(e){return l.stamp(e)})),this.parent=null,this.state={}}a.prototype.cssPrefix="tui-view-",a.prototype.addChild=function(e,t){t&&t.call(e,this),e.parent=this,this.children.add(e)},a.prototype.removeChild=function(e,t){var n=l.isNumber(e)?this.children.items[e]:e;e=l.stamp(n),t&&t.call(n,this),this.children.remove(e)},a.prototype.render=function(){this.children.each((function(e){e.render()}))},a.prototype.recursive=function(e,t){l.isFunction(e)&&(t||e(this),this.children.each((function(t){t.recursive(e)})))},a.prototype.resize=function(){for(var e=Array.prototype.slice.call(arguments),t=this.parent;t;)l.isFunction(t._onResize)&&t._onResize.apply(t,e),t=t.parent},a.prototype._beforeDestroy=function(){},a.prototype._destroy=function(){this._beforeDestroy(),this.children.clear(),this.container.innerHTML="",this.id=this.parent=this.children=this.container=null},a.prototype.destroy=function(e){this.children.each((function(e){e.destroy(!0),e._destroy()})),e||this._destroy()},a.prototype.getViewBound=function(){var e=this.container,t=o.getPosition(e),n=o.getSize(e);return{x:t[0],y:t[1],width:n[0],height:n[1]}},a.prototype.cssprefix=function(e){return this.cssPrefix+(e||"")},a.prototype.setState=function(e){l.extend(this.state,e)},l.CustomEvents.mixin(a),e.exports=a},function(e,t,n){"use strict";t.__esModule=!0,t.extend=r,t.indexOf=function(e,t){for(var n=0,l=e.length;n":">",'"':""","'":"'","`":"`","=":"="},o=/[&<>"'`=]/g,i=/[&<>"'`=]/;function a(e){return l[e]}function r(e){for(var t=1;t1?i(s.call(arguments),(function(e){l.add(e)})):(t=this.getItemID(e),(n=this.items)[t]||(this.length+=1),n[t]=e)},u.prototype.remove=function(e){var t,n,o=this,i=[];return this.length?arguments.length>1?i=l.map(s.call(arguments),(function(e){return o.remove(e)})):(t=this.items,r(e)&&(e=this.getItemID(e)),t[e]?(this.length-=1,n=t[e],delete t[e],n):i):i},u.prototype.clear=function(){this.items={},this.length=0},u.prototype.has=function(e){var t,n;return!!this.length&&(t=a(e),n=!1,t?this.each((function(t){return!0!==e(t)||(n=!0,!1)})):(e=r(e)?this.getItemID(e):e,n=l.isExisty(this.items[e])),n)},u.prototype.doWhenHas=function(e,t,n){var o=this.items[e];l.isExisty(o)&&t.call(n||this,o)},u.prototype.find=function(e){var t=new u;return this.hasOwnProperty("getItemID")&&(t.getItemID=this.getItemID),this.each((function(n){!0===e(n)&&t.add(n)})),t},u.prototype.groupBy=function(e,t){var n,o,i={},r=a(e),s=this.getItemID;if(l.isArray(e)){if(l.forEachArray(e,(function(e){i[String(e)]=new u(s)})),!t)return i;e=t,r=!0}return this.each((function(t){r?o=e(t):(o=t[e],a(o)&&(o=o.apply(t))),(n=i[o])||(n=i[o]=new u(s)),n.add(t)})),i},u.prototype.single=function(e){var t,n=l.isFunction(e);return this.each((function(l){return n&&!e(l)||(t=l,!1)}),this),t},u.prototype.sort=function(e){var t=[];return this.each((function(e){t.push(e)})),a(e)&&(t=t.sort(e)),t},u.prototype.each=function(e,t){o(this.items,e,t||this)},u.prototype.toArray=function(){return this.length?l.map(this.items,(function(e){return e})):[]},e.exports=u},function(e,t,n){"use strict";var l=n(0),o=n(4),i=n(3),a=n(56),r=n(57),s=o.Date,u=i.MILLISECONDS_SCHEDULE_MIN_DURATION,c="allday";function d(){this.id="",this.title="",this.body="",this.isAllDay=!1,this.start=null,this.end=null,this.color="#000",this.isVisible=!0,this.bgColor="#a1b56c",this.dragBgColor="#a1b56c",this.borderColor="#000",this.calendarId="",this.category="",this.dueDateClass="",this.customStyle="",this.isPending=!1,this.isFocused=!1,this.isReadOnly=!1,this.isPrivate=!1,this.location="",this.attendees=[],this.recurrenceRule="",this.state="",this.goingDuration=0,this.comingDuration=0,this.raw=null,l.stamp(this)}d.schema={required:["title"],dateRange:["start","end"]},d.create=function(e){var t=new d;return t.init(e),t},d.prototype.init=function(e){(e=l.extend({},e)).category===c&&(e.isAllDay=!0),this.id=e.id||"",this.title=e.title||"",this.body=e.body||"",this.isAllDay=!!l.isExisty(e.isAllDay)&&e.isAllDay,this.isVisible=!l.isExisty(e.isVisible)||e.isVisible,this.color=e.color||this.color,this.bgColor=e.bgColor||this.bgColor,this.dragBgColor=e.dragBgColor||this.dragBgColor,this.borderColor=e.borderColor||this.borderColor,this.calendarId=e.calendarId||"",this.category=e.category||"",this.dueDateClass=e.dueDateClass||"",this.customStyle=e.customStyle||"",this.location=e.location||"",this.attendees=e.attendees||[],this.recurrenceRule=e.recurrenceRule||"",this.isPrivate=e.isPrivate||!1,this.isPending=e.isPending||!1,this.isFocused=e.isFocused||!1,this.isReadOnly=e.isReadOnly||!1,this.goingDuration=e.goingDuration||0,this.comingDuration=e.comingDuration||0,this.state=e.state||"",this.isAllDay?this.setAllDayPeriod(e.start,e.end):this.setTimePeriod(e.start,e.end),this.raw=e.raw||null},d.prototype.setAllDayPeriod=function(e,t){e=l.isString(e)&&10===e.length?i.parse(e):new s(e||Date.now()),l.isString(t)&&10===t.length?(t=i.parse(t)).setHours(23,59,59):t=new s(t||e),this.start=i.start(e),this.end=i.renderEnd(e,t)},d.prototype.setTimePeriod=function(e,t){this.start=new s(e||Date.now()),this.end=new s(t||this.start),t||this.end.setMinutes(this.end.getMinutes()+30)},d.prototype.getStarts=function(){return this.start},d.prototype.getEnds=function(){return this.end},d.prototype.cid=function(){return l.stamp(this)},d.prototype.equals=function(e){return this.id===e.id&&(this.title===e.title&&(this.body===e.body&&(this.isAllDay===e.isAllDay&&(0===i.compare(this.getStarts(),e.getStarts())&&(0===i.compare(this.getEnds(),e.getEnds())&&(this.color===e.color&&(this.bgColor===e.bgColor&&(this.dragBgColor===e.dragBgColor&&this.borderColor===e.borderColor))))))))},d.prototype.duration=function(){var e=this.getStarts(),t=this.getEnds(),n=o.hasPrimaryTimezoneCustomSetting();return this.isAllDay?i.end(t)-i.start(e):n&&o.isPrimaryUsingDSTTimezone()?function(e,t){var n=o.isDifferentOffsetStartAndEndTime(e.getTime(),t.getTime()),l=t-e;return 0!==n.isOffsetChanged&&(l+=6e4*n.offsetDiff),l}(e,t):n&&o.isNativeOsUsingDSTTimezone()?function(e,t){var n=e.toDate().getTimezoneOffset(),l=t.toDate().getTimezoneOffset();return t-e+6e4*(l-n)}(e,t):t-e},d.prototype.collidesWith=function(e){var t=this.getStarts(),n=this.getEnds(),l=e.getStarts(),o=e.getEnds(),a=i.millisecondsFrom("minutes",this.goingDuration),r=i.millisecondsFrom("minutes",this.comingDuration),s=i.millisecondsFrom("minutes",e.goingDuration),c=i.millisecondsFrom("minutes",e.comingDuration);return Math.abs(n-t)(t-=a)&&lt&&o=n},r.mixin(d.prototype),a.mixin(d.prototype),e.exports=d},function(e,t,n){"use strict";var l=n(0),o=n(3);function i(e,t){return e!==t?e?-1:1:0}function a(e,t){var n=String(e),l=String(t);return n>l?1:n0))return o;s=o-1}return~s},compare:{schedule:{asc:function(e,t){var n,a,r,s,u=e.valueOf(),c=t.valueOf();return(r=i(u.isAllDay||e.hasMultiDates,c.isAllDay||t.hasMultiDates))?r:(s=o.compare(e.getStarts(),t.getStarts()))?s:(n=e.duration())<(a=t.duration())?1:n>a?-1:l.stamp(u)-l.stamp(c)}},bool:{asc:i,desc:function(e,t){return e!==t?e?1:-1:0}},num:{asc:function(e,t){return Number(e)-Number(t)},desc:function(e,t){var n=Number(e);return Number(t)-n}},str:{asc:a,desc:function(e,t){var n=String(e),l=String(t);return n>l?-1:nl?1:nl?-1:n30?t=1:e<=30&&(t=.5),t}e.exports=u},function(e,t,n){"use strict";var l=n(0),o=n(5),i=n(1),a=n(6),r=n(3),s=Math.floor;e.exports=function(e){var t=e.children,n=t.sort((function(e,t){return l.stamp(e)-l.stamp(t)})),u=t.length,c=t.single().getRenderDateRange().length,d=l.pick(e.vLayout.panels[1],"container"),h=i.getSize(d),p=e.grids;return function(e){var t,i,m,f=a.getMousePosition(e,d),g=function(e){for(var t,n=0,l=p.length;n=n.length&&(y=n.length-1),(t=l.pick(n,y))?(g<0&&(g=0),g>=(m=t.getRenderDateRange()).length&&(g=m.length-1),(i=l.pick(m,g))?{x:g,y:y,sizeX:c,sizeY:u,date:r.end(i),weekdayView:t,triggerEvent:e.type}:null):null}}},function(e,t,n){e.exports=n(21)},function(e,t,n){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.__esModule=!0;var i=o(n(22)),a=l(n(48)),r=l(n(12)),s=o(n(10)),u=o(n(49)),c=l(n(51));function d(){var e=new i.HandlebarsEnvironment;return s.extend(e,i),e.SafeString=a.default,e.Exception=r.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var h=d();h.create=d,c.default(h),h.default=h,t.default=h,e.exports=t.default},function(e,t,n){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=c;var o=n(10),i=l(n(12)),a=n(23),r=n(45),s=l(n(24)),u=n(25);t.VERSION="4.7.6";t.COMPILER_REVISION=8;t.LAST_COMPATIBLE_COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};function c(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},a.registerDefaultHelpers(this),r.registerDefaultDecorators(this)}c.prototype={constructor:c,logger:s.default,log:s.default.log,registerHelper:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new i.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===o.toString.call(e))o.extend(this.partials,e);else{if(void 0===t)throw new i.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new i.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){u.resetLoggedProperties()}};var d=s.default.log;t.log=d,t.createFrame=o.createFrame,t.logger=s.default},function(e,t,n){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),i.default(e),a.default(e),r.default(e),s.default(e),u.default(e),c.default(e)},t.moveHelperToHooks=function(e,t,n){e.helpers[t]&&(e.hooks[t]=e.helpers[t],n||delete e.helpers[t])};var o=l(n(38)),i=l(n(39)),a=l(n(40)),r=l(n(41)),s=l(n(42)),u=l(n(43)),c=l(n(44))},function(e,t,n){"use strict";t.__esModule=!0;var l=n(10),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=l.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var n=arguments.length,l=Array(n>1?n-1:0),i=1;i0?i.d.setMonth(o+1,0):i.d.setMonth(t,0),a=i.d.getDate())),this.d.setMonth(o,Math.min(n,a)),this},o.prototype._isLeapYear=function(){var e=this.d.getFullYear();return e%4==0&&e%100!=0||!(e%400)},o.prototype.setHours=function(e,t,n,l){return this.d.setHours(e,t,n,l),this},o.prototype.isBetween=function(e,t){var n=this.safe;return n(e)<=this.d&&this.d<=n(t)},e.exports=o},function(e,t,n){"use strict";(function(t){var l=n(0),o=n(1),i=n(6),a=n(2);function r(e,t){i.on(t,"mousedown",this._onMouseDown,this),this.options=l.extend({distance:10,exclude:null},e),this.container=t,this._cancelled=!1,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}function s(e){o.closest(e.target,a.classname(".popup"))||i.preventDefault(e)}r.prototype.destroy=function(){i.off(this.container,"mousedown",this._onMouseDown,this),this._isMoved=null,this.container=null},r.prototype._clearData=function(){this._cancelled=!1,this._distance=0,this._isMoved=!1,this._dragStartFired=!1,this._dragStartEventData=null},r.prototype._toggleDragEvent=function(e){var n,l,a=this.container;e?(n="on",l="disable"):(n="off",l="enable"),o[l+"TextSelection"](a,s),o[l+"ImageDrag"](a,s),i[n](t.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)},r.prototype._getEventData=function(e){return{target:i.getEventTarget(e),originEvent:e}},r.prototype._onMouseDown=function(e){var t=this.options,n=i.getEventTarget(e);0===i.getMouseButton(e)&&(t.exclude&&t.exclude(n)?this._cancelled=!0:(this._clearData(),this._dragStartEventData=this._getEventData(e),this._toggleDragEvent(!0),this.fire("mousedown",this._dragStartEventData)))},r.prototype._onMouseMove=function(e){var t;if(this._cancelled)this._clearData();else if(t=this.options.distance,s(e),this._distance(t-=r)&&lt&&a=n},e.exports=a},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(5),a=n(1),r=n(6),s=n(9),u=n(65),c=n(27),d=Math.abs;function h(e,t,n){var i,r;if(!(this instanceof h))return new h(e,t);s.call(this,t),a.addClass(t,o.classname("vlayout-container")),i=this.options=l.extend({panels:[],panelHeights:[]},e),this.panels=[],this._drag=new c({distance:10,exclude:function(e){return!a.hasClass(e,o.classname("splitter"))}},t),this._drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd},this),this._dragData=null,this.theme=n,i.panels.length&&(i.panelHeights.length&&(r=i.panelHeights.slice(),l.forEach(i.panels,(function(e){e.isSplitter||e.autoHeight||(e.height=r.shift())}))),this.addPanels(i.panels,this.container)),this.refresh()}l.inherit(h,s),h.prototype.getLayoutData=function(){var e=[];return l.forEach(this.panels,(function(t){t.isSplitter()||t.options.autoHeight||e.push(t.getHeight())})),e},h.prototype.setLayoutData=function(e){e.length&&(l.forEach(this.panels,(function(t){t.isSplitter()||t.options.autoHeight||t.setHeight(null,e.shift())})),this.refresh())},h.prototype.nextPanel=function(e){return this.panels[e.index+1]},h.prototype.prevPanel=function(e){return this.panels[e.index-1]},h.prototype._initializeGuideElement=function(e,t){var n=e.cloneNode(!0);return a.addClass(n,o.classname("splitter-guide")),this._refreshGuideElement(n,t),this.container.appendChild(n),n},h.prototype._refreshGuideElement=function(e,t){e.style.top=t+"px"},h.prototype._clearGuideElement=function(e){a.remove(e)},h.prototype._resize=function(e,t,n){var o,i,a=d(t-n),r=[],s=n>t,u=s?"nextPanel":"prevPanel";for(i=(o=this[s?"prevPanel":"nextPanel"](e)).getResizeInfoByGrowth(a),r.push([o,i[0]]),o=this[u](o);l.isExisty(o);o=this[u](o))o.isSplitter()||(i=o.getResizeInfoByGrowth(-a),r.push([o,i[0]]),a-=i[1]);l.forEach(r,(function(e){e[0].setHeight(null,e[1],!0),e[0].fire("resize")}))},h.prototype._getMouseYAdditionalLimit=function(e){var t,n=0,o=0,i=function(e){return e.isSplitter()?e.getHeight():e.options.minHeight};for(t=this.prevPanel(e);l.isExisty(t);t=this.prevPanel(t))n+=i(t);for(t=this.nextPanel(e);l.isExisty(t);t=this.nextPanel(t))o+=i(t);return[n,o]},h.prototype._onDragStart=function(e){var t=e.originEvent,n=e.target,i=a.getData(n,"panelIndex"),s=this.panels[i],u=s.getHeight(),c=r.getMousePosition(t,n)[1],d=r.getMousePosition(t,this.container)[1],h=this._initializeGuideElement(n,d);s.addClass(o.classname("splitter-focused")),this._dragData={splPanel:s,splOffsetY:c,guideElement:h,startY:d-c,minY:0,maxY:this.getViewBound().height-u},l.browser.msie||a.addClass(document.body,o.classname("resizing"))},h.prototype._onDrag=function(e){var t=this._dragData,n=r.getMousePosition(e.originEvent,this.container)[1];n=i.limit(n-t.splOffsetY,[t.minY],[t.maxY]),this._refreshGuideElement(t.guideElement,n)},h.prototype._onDragEnd=function(e){var t=this._dragData,n=this._getMouseYAdditionalLimit(t.splPanel),l=r.getMousePosition(e.originEvent,this.container)[1];l=i.limit(l-t.splOffsetY,[t.minY+n[0]],[t.maxY-n[1]]),this._resize(t.splPanel,t.startY,l),this.fire("resize",{layoutData:this.getLayoutData()}),this._dragData=null,this._clearGuideElement(t.guideElement),t.splPanel.removeClass(o.classname("splitter-focused")),a.removeClass(document.body,o.classname("resizing"))},h.prototype.refresh=function(){var e,t=[],n=this.getViewBound().height,o=0;n&&(l.forEach(this.panels,(function(e){e.options.autoHeight?t.push(e):o+=e.getHeight()})),e=(n-o)/t.length,l.forEach(t,(function(t){t.setHeight(null,e)})))},h.prototype.addPanel=function(e,t){var n=document.createElement("div"),o=this.panels,i=o.length;e=l.extend({index:i},e),o.push(new u(e,n,this.theme)),t.appendChild(n)},h.prototype.addPanels=function(e,t){var n=this,o=document.createDocumentFragment();l.forEach(e,(function(e){n.addPanel(e,o)})),t.appendChild(o)},h.prototype.getPanelByName=function(e){var t;return l.forEach(this.panels,(function(n){n.name===e&&(t=n)})),t},e.exports=h},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(1),a=n(3),r=n(4).Date,s=n(9);function u(e,t){t=i.appendHTMLElement("div",t,o.classname("weekday")),this.options=l.extend({containerBottomGutter:8,scheduleHeight:18,scheduleGutter:2,narrowWeekend:!1,startDayOfWeek:0,workweek:!1},e),this._cacheParentViewModel=null,s.call(this,t)}l.inherit(u,s),u.prototype.getRenderDateRange=function(){return this._cacheParentViewModel.range},u.prototype.getRenderDateGrids=function(){return this._cacheParentViewModel.grids},u.prototype.getBaseViewModel=function(e){var t=this.options,n=e.range,o=100/n.length,i=e.grids,s=e.exceedDate||{},u=e.theme,c=(new r).toLocalTime();return this._cacheParentViewModel=e,{width:o,scheduleHeight:t.scheduleHeight,scheduleBlockHeight:t.scheduleHeight+t.scheduleGutter,scheduleBlockGutter:t.scheduleGutter,dates:l.map(n,(function(e,t){var n=e.getDay(),l=a.format(new r(e),"YYYYMMDD"),o=a.isSameDate(c,e);return{date:a.format(e,"YYYY-MM-DD"),month:e.getMonth()+1,day:n,isToday:o,ymd:l,hiddenSchedules:s[l]||0,width:i[t]?i[t].width:0,left:i[t]?i[t].left:0,color:this._getDayNameColor(u,n,o),backgroundColor:this._getDayBackgroundColor(u,n)}}),this)}},u.prototype.getExceedDate=function(e,t,n){var o=this._initExceedDate(n);return l.forEach(t,(function(t){l.forEach(t,(function(t){l.forEach(t,(function(t){var n;!t||t.topo&&(a=o-n-l-3),{y:a,arrowDirection:i}},f.prototype._getXAndArrowLeft=function(e,t,n,l,o){var i,a=(e+t)/2,r=a-n/2;return r+n>o?i=a-(r=t-n+8):r+=8,ro?r=i-(a=Math.max(o-n-l,0))-l-8:a-=l,(r<0||r>n)&&(r=null),{y:a,arrowTop:r}},p.prototype._getXAndArrowDirection=function(e,t,n,l,o){var i="arrow-left",a=t;return a+n>o?(i="arrow-right",a=e-n-4):a+=4,an[1]?l=n.slice(0):(o=u(t[0],o),l=[o=c(n[0],o),i]),l},p.prototype.start=function(e){var t,n=this.options,o=e.target,i=e.model,s=e.x,u=e.y,c=new r(this.view.options.renderMonth);n.isCreationMode?i&&!a.isSameMonth(c,i.start)&&(i.start.setMonth(c.getMonth()),i.start.setDate(1),i.end.setMonth(c.getMonth()),i.end.setDate(1)):(s=(t=this._getCoordByDate(i.getStarts()))[0],u=t[1],l.extend(this.options,{top:parseInt(o.style.top,10)+"px",height:parseInt(o.style.height,10)+"px",label:i.title},i)),(l.isUndefined(s)||l.isUndefined(u))&&(s=(t=this._getCoordByDate(i.getStarts()))[0],u=t[1]),this.startCoord=[s,u],this.update(s,u)},p.prototype._updateGuides=function(e){l.forEach(e,(function(e){var t=e.guide,n=o.classname("month-exceed-left"),l=o.classname("month-exceed-right");t.style.display="block",t.style.left=e.left+"%",t.style.width=e.width+"%",e.exceedL?i.addClass(t,n):i.removeClass(t,n),e.exceedR?i.addClass(t,l):i.removeClass(t,l)}))},p.prototype._getOriginIndicate=function(e,t){var n,l,o=c(e[0],t[0]),i=u(e[0],t[0])+1;return t[1]>e[1]?(o=e[0],i=this.days,l=!0):t[1]e[1]?(o=0,n=!0):t[1]o)&&i.push(e)})),i},p.prototype.update=function(e,t){var n=this,o=this.startCoord,i=[e,t],a=this.options.isResizeMode?this._getLimitedCoord(i,o):i,r=l.keys(this.guideElements),s=l.range(c(o[1],a[1]),u(o[1],a[1])+1),d=this._getExcludesInRange(s,r),h={};this._removeGuideElements(d),l.forEach(s,(function(e){var t,r=n._getGuideElement(e);r&&(t=e===o[1]?n._getOriginIndicate(o,a):e===i[1]?n._getMouseIndicate(o,i):n._getContainIndicate(),h[e]=l.extend({guide:r},t))})),this._updateGuides(h)},p.prototype.clear=function(){l.forEach(this.guideElements,(function(e){i.remove(e)})),this.guideElements={}},p.prototype._getStyles=function(e){var t={};return e&&(t.border=e.common.creationGuide.border,t.backgroundColor=e.common.creationGuide.backgroundColor,t.scheduleHeight=e.month.schedule.height,t.scheduleGutter=e.month.schedule.marginTop,t.marginLeft=e.month.schedule.marginLeft,t.marginRight=e.month.schedule.marginRight,t.borderRadius=e.month.schedule.borderRadius),t},e.exports=p},function(e,t,n){"use strict";(function(t){var l=n(0),o=n(37);n(115),n(116),t.jQuery&&(t.jQuery.fn.tuiCalendar=function(){var e,n,i=this.get(0),a=Array.prototype.slice.apply(arguments);if(i)if(e=l.pick(a,0)||{},n=t.jQuery.data(i,"tuiCalendar")){if("string"==typeof e&&n[e])return n[e].apply(n,a.slice(1))}else n=new o(i,e),t.jQuery.data(i,"tuiCalendar",n);return this}),e.exports=o}).call(this,n(8))},function(e,t,n){"use strict";var l=n(0),o=n(20),i=n(26),a=n(3),r=n(53),s=n(27),u=n(54),c=n(64),d=n(98),h=n(4),p=h.Date,m=n(2),f=n(11),g=Math.min;function y(e,t){!0===(t=l.extend({usageStatistics:!0},t)).usageStatistics&&l.sendHostname&&l.sendHostname("calendar","UA-129951699-1"),l.isString(e)&&(e=document.querySelector(e)),this._calendarColor={},this._renderDate=a.start(),this._renderRange={start:null,end:null},this._controller=function(e){return u(e)}(t),this._controller.setCalendars(t.calendars),this._layout=new r(e,this._controller.theme),this._dragHandler=new s({distance:10},this._layout.container),this._viewName=t.defaultView||"week",this._refreshMethod=null,this._scrollToNowMethod=null,this._requestScrollToNow=!1,this._openCreationPopup=null,this._hideMoreView=null,this._requestRender=0,this._options={},this._initialize(t)}function S(e,t){e.recursive((function(e){var n=e.options;n&&t(e,n)}))}y.prototype.destroy=function(){this._dragHandler.destroy(),this._controller.off(),this._layout.clear(),this._layout.destroy(),l.forEach(this._options.template,(function(e,t){e&&o.unregisterHelper(t+"-tmpl")})),this._options=this._renderDate=this._controller=this._layout=this._dragHandler=this._viewName=this._refreshMethod=this._scrollToNowMethod=null},y.prototype._initialize=function(e){var t=this._controller,n=this._viewName;this._options=l.extend({defaultView:n,taskView:!0,scheduleView:!0,template:l.extend({allday:null,time:null},l.pick(e,"template")||{}),week:l.extend({},l.pick(e,"week")||{}),month:l.extend({},l.pick(e,"month")||{}),calendars:[],useCreationPopup:!1,useDetailPopup:!1,timezones:e.timezone&&e.timezone.zones?e.timezone.zones:[],disableDblClick:!1,disableClick:!1,isReadOnly:!1},e),this._options.week=l.extend({startDayOfWeek:0,workweek:!1},l.pick(this._options,"week")||{}),this._options.timezone=l.extend({zones:[]},l.pick(e,"timezone")||{}),this._options.month=l.extend({startDayOfWeek:0,workweek:!1,scheduleFilter:function(e){return Boolean(e.isVisible)&&("allday"===e.category||"time"===e.category)}},l.pick(e,"month")||{}),this._options.isReadOnly&&(this._options.useCreationPopup=!1),this._layout.controller=t,this._setAdditionalInternalOptions(this._options),this.changeView(n,!0)},y.prototype._setAdditionalInternalOptions=function(e){var t,n,i=e.timezone;l.forEach(e.template,(function(e,t){e&&o.registerHelper(t+"-tmpl",e)})),l.forEach(e.calendars||[],(function(e){this.setCalendarColor(e.id,e,!0)}),this),i&&(n=i.offsetCalculator,l.isFunction(n)&&h.setOffsetCalculator(n),(t=i.zones).length&&(h.setPrimaryTimezoneByOption(t[0]),l.isNumber(t[0].timezoneOffset)&&h.setOffsetByTimezoneOption(t[0].timezoneOffset)))},y.prototype.createSchedules=function(e,t){l.forEach(e,(function(e){this._setScheduleColor(e.calendarId,e)}),this),this._controller.createSchedules(e,t),t||this.render()},y.prototype.getSchedule=function(e,t){return this._controller.schedules.single((function(n){return n.id===e&&n.calendarId===t}))},y.prototype.updateSchedule=function(e,t,n,l){var o=this._controller,i=o.schedules.single((function(n){return n.id===e&&n.calendarId===t}));n&&i&&(n=this._hasChangedCalendar(i,n)?this._setScheduleColor(n.calendarId,n):n,o.updateSchedule(i,n),l||this.render())},y.prototype._hasChangedCalendar=function(e,t){return e&&t.calendarId&&e.calendarId!==t.calendarId},y.prototype._setScheduleColor=function(e,t){var n=this._calendarColor[e];return n&&(t.color=t.color||n.color,t.bgColor=t.bgColor||n.bgColor,t.borderColor=t.borderColor||n.borderColor,t.dragBgColor=t.dragBgColor||n.dragBgColor),t},y.prototype.deleteSchedule=function(e,t,n){var l=this._controller,o=l.schedules.single((function(n){return n.id===e&&n.calendarId===t}));o&&(l.deleteSchedule(o),n||this.render())},y.prototype._getWeekDayRange=function(e,t,n){var o,i,r,s;return t=t||0,o=(e=l.isDate(e)?e:new p(e)).getDay(),i=new p(e).addDate(-o+t),r=new p(i).addDate(6),o0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):o(this);if(n.data&&n.ids){var a=l.createFrame(n.data);a.contextPath=l.appendContextPath(n.data.contextPath,n.name),n={data:a}}return i(t,n)}))},e.exports=t.default},function(e,t,n){"use strict";(function(l){t.__esModule=!0;var o,i=n(10),a=n(12),r=(o=a)&&o.__esModule?o:{default:o};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new r.default("Must pass iterator to #each");var n,o=t.fn,a=t.inverse,s=0,u="",c=void 0,d=void 0;function h(t,n,l){c&&(c.key=t,c.index=n,c.first=0===n,c.last=!!l,d&&(c.contextPath=d+t)),u+=o(e[t],{data:c,blockParams:i.blockParams([e[t],t],[d+t,null])})}if(t.data&&t.ids&&(d=i.appendContextPath(t.data.contextPath,t.ids[0])+"."),i.isFunction(e)&&(e=e.call(this)),t.data&&(c=i.createFrame(t.data)),e&&"object"==typeof e)if(i.isArray(e))for(var p=e.length;s=r.LAST_COMPATIBLE_COMPILER_REVISION&&t<=r.COMPILER_REVISION)return;if(ta.MILLISECONDS_PER_DAY?"allday":t.category},this.schedules=r.createScheduleCollection(),this.dateMatrix={},this.theme=new s(e.theme),this.calendars=[]}d.prototype._getContainDatesInSchedule=function(e){var t,n=e.getStarts(),l=e.getEnds(),o=a.start(n),i=0===a.compare(n,l)?l:a.convertStartDayToLastDay(l),r=a.end(i);return u.hasPrimaryTimezoneCustomSetting()&&(o=(t=function(e){var t=e.getStarts(),n=e.getEnds(),l=(a.start(t),0===a.compare(t,n)?n:a.convertStartDayToLastDay(n)),o=(a.end(l),u.getNativeOffsetMs()),i=t.toDate().getTimezoneOffset(),r=0,s=u.getPrimaryTimezoneName(),d=u.getPrimaryOffset(),h=u.getOffsetByTimezoneName(s,t.getTime());return u.isNativeOsUsingDSTTimezone()&&o!==i&&(r=6e4*i-o),u.isPrimaryUsingDSTTimezone()&&d!==h&&(r=6e4*(d-h)),{start:a.start(t.getUTCTime()+r),end:a.end(a.convertStartDayToLastDay(new c(n.getUTCTime()+r)))}}(e)).start,r=t.end),a.range(o,r,a.MILLISECONDS_PER_DAY)},d.prototype.createSchedule=function(e,t){var n,l={data:e};return this.invoke("beforeCreateSchedule",l)?(n=this.addSchedule(o.create(e)),t||this.fire("createdSchedule",n),n):null},d.prototype.createSchedules=function(e,t){var n=this;return l.map(e,(function(e){return n.createSchedule(e,t)}))},d.prototype.updateSchedule=function(e,t){var n=t.start||e.start,o=t.end||e.end;return["milestone","task","allday","time"].indexOf((t=t||{}).category)>-1&&e.set("category",t.category),"allday"===t.category&&(t.isAllDay=!0),l.isUndefined(t.isAllDay)||e.set("isAllDay",t.isAllDay),l.isUndefined(t.calendarId)||e.set("calendarId",t.calendarId),t.title&&e.set("title",t.title),t.body&&e.set("body",t.body),(t.start||t.end)&&(e.isAllDay?e.setAllDayPeriod(n,o):e.setTimePeriod(n,o)),t.color&&e.set("color",t.color),t.bgColor&&e.set("bgColor",t.bgColor),t.borderColor&&e.set("borderColor",t.borderColor),t.origin&&e.set("origin",t.origin),l.isUndefined(t.isPending)||e.set("isPending",t.isPending),l.isUndefined(t.isFocused)||e.set("isFocused",t.isFocused),l.isUndefined(t.isReadOnly)||e.set("isReadOnly",t.isReadOnly),t.location&&e.set("location",t.location),t.state&&e.set("state",t.state),t.raw&&e.set("raw",t.raw),t.attendees&&e.set("attendees",t.attendees),this._removeFromMatrix(e),this._addToMatrix(e),this.fire("updateSchedule"),e},d.prototype.deleteSchedule=function(e){return this._removeFromMatrix(e),this.schedules.remove(e),e},d.prototype._addToMatrix=function(e){var t=this.dateMatrix,n=this._getContainDatesInSchedule(e);l.forEach(n,(function(n){var o=a.format(n,"YYYYMMDD");(t[o]=t[o]||[]).push(l.stamp(e))}))},d.prototype._removeFromMatrix=function(e){var t=l.stamp(e);l.forEach(this.dateMatrix,(function(e){var n=l.inArray(t,e);~n&&e.splice(n,1)}),this)},d.prototype.addSchedule=function(e,t){return this.schedules.add(e),this._addToMatrix(e),t||this.fire("addedSchedule",e),e},d.prototype.splitScheduleByDateRange=function(e,t,n){var o=a.range(a.start(e),a.end(t),a.MILLISECONDS_PER_DAY),i=this.dateMatrix,s={};return l.forEachArray(o,(function(e){var t,o=a.format(e,"YYYYMMDD"),u=i[o];t=s[o]=r.createScheduleCollection(),u&&u.length&&l.forEachArray(u,(function(e){n.doWhenHas(e,(function(e){t.add(e)}))}))})),s},d.prototype.findByDateRange=function(e,t){var n,o,s,u=a.range(a.start(e),a.end(t),a.MILLISECONDS_PER_DAY),c=this.schedules.items,d=this.dateMatrix,h=a.format,p={};return l.forEachArray(u,(function(e){o=h(e,"YYYYMMDD"),n=d[o],s=p[o]=r.createScheduleCollection(),n&&n.length&&s.add.apply(s,l.map(n,(function(e){return i.create(c[e])})))})),p},d.prototype.clearSchedules=function(){this.dateMatrix={},this.schedules.clear(),this.fire("clearSchedules")},d.prototype.setTheme=function(e){return this.theme.setStyles(e)},d.prototype.setCalendars=function(e){this.calendars=e},l.CustomEvents.mixin(d),e.exports=d},function(e,t,n){"use strict";var l=n(0),o=l.isExisty,i=l.pick,a=l.isFunction,r={set:function(e,t){this[e]!==t&&(this[e]=t,this._changed||(this._changed={}),this._changed[e]=!0,this._dirty=!0)},isDirty:function(){return!!this._dirty},dirty:function(e){(e=!o(e)||e)||(this._changed={}),this._dirty=e},deleteProp:function(e){delete this[e],this._changed&&delete this._changed[e]},isPropChanged:function(e){return!!this._changed&&!0===this._changed[e]},mixin:function(e){var t=/(^_|mixin|wrap)/;l.forEachOwnProperties(r,(function(n,l){t.test(l)||(e[l]=r[l])}))},wrap:function(e,t,n){var s,u=r.wrap;l.isObject(t)?l.forEachOwnProperties(t,(function(t,n){u(e,n,t)})):(n=!o(n)||n,e._wrapper||(e._wrapper=function(e,t){return function(){var n=Array.prototype.slice.call(arguments),l=e.apply(this,n);return this._dirty=t,l}}),o(i(e,t))&&a(e[t])&&!o(i(e,t,"_wrapped"))&&(s=e[t],e[t]=e._wrapper(s,n),e[t]._wrapped=!0))}};e.exports=r},function(e,t,n){"use strict";var l,o=n(4).Date,i=n(0),a=/^\s*|\s*$/g,r=n(3);l={trim:function(e){return e.replace(a,"")},validators:{required:function(e,t){var n=!0;return i.forEach(t,(function(t){var o;return o=e[t],n=!i.isUndefined(o)&&""!==l.trim(o)})),n},dateRange:function(e,t){var n,l;return!i.isExisty(e)||2!==t.length||(n=new o(e[t[0]]),l=new o(e[t[1]]),!(!r.isValid(n)||!r.isValid(l))&&1!==r.compare(n,l))}},isValid:function(){var e,t=this,n=this.constructor.schema,o=l.validators,a=!0;return!n||(i.forEach(n,(function(n,l){return!(e=o[l])||(a=e(t,n))})),a)},parameterize:function(){var e={},t=i.isFunction;return i.forEach(this,(function(n,l){t(n)||(e[l]=n)})),e},mixin:function(e){i.forEach(l,(function(t,n){"mixin"!==n&&(e[n]=t)}))}},e.exports=l},function(e,t,n){"use strict";var l=n(0),o=n(59),i=n(60),a=n(5);function r(e){var t=e||o;this._map=new l.HashMap,this.setStyles(t)}r.prototype.getStyle=function(e){return this._map.get(e)},r.prototype.setStyle=function(e,t){var n={};return n[e]=t,0===this.setStyles(n).length},r.prototype.setStyles=function(e){var t=[];return l.forEach(e,(function(e,n){l.isUndefined(i[n])?t.push(n):(this._map.set(n,e),a.set(this,n,e))}),this),l.forEach(i,(function(e,t){this.getStyle(t)||(this._map.set(t,e),a.set(this,t,e))}),this),t},r.prototype.clear=function(){var e=this._map.keys(),t={};l.forEach(e,(function(e){var n=e.split(".")[0];t[n]||(t[n]=n)})),l.forEach(t,(function(e){delete this[e]}),this),this._map.removeAll()},e.exports=r},function(e,t,n){"use strict";e.exports={"common.border":"1px solid #e5e5e5","common.backgroundColor":"white","common.holiday.color":"#ff4040","common.saturday.color":"#333","common.dayname.color":"#333","common.today.color":"#333","common.creationGuide.backgroundColor":"rgba(81, 92, 230, 0.05)","common.creationGuide.border":"1px solid #515ce6","month.dayname.height":"31px","month.dayname.borderLeft":"none","month.dayname.paddingLeft":"10px","month.dayname.paddingRight":"0","month.dayname.backgroundColor":"inherit","month.dayname.fontSize":"12px","month.dayname.fontWeight":"normal","month.dayname.textAlign":"left","month.holidayExceptThisMonth.color":"rgba(255, 64, 64, 0.4)","month.dayExceptThisMonth.color":"rgba(51, 51, 51, 0.4)","month.weekend.backgroundColor":"inherit","month.day.fontSize":"14px","month.schedule.borderRadius":"2px","month.schedule.height":"24px","month.schedule.marginTop":"2px","month.schedule.marginLeft":"8px","month.schedule.marginRight":"8px","month.moreView.border":"1px solid #d5d5d5","month.moreView.boxShadow":"0 2px 6px 0 rgba(0, 0, 0, 0.1)","month.moreView.backgroundColor":"white","month.moreView.paddingBottom":"17px","month.moreViewTitle.height":"44px","month.moreViewTitle.marginBottom":"12px","month.moreViewTitle.borderBottom":"none","month.moreViewTitle.padding":"12px 17px 0 17px","month.moreViewList.padding":"0 17px","week.dayname.height":"42px","week.dayname.borderTop":"1px solid #e5e5e5","week.dayname.borderBottom":"1px solid #e5e5e5","week.dayname.borderLeft":"none","week.dayname.paddingLeft":"0","week.dayname.backgroundColor":"inherit","week.dayname.textAlign":"left","week.today.color":"inherit","week.pastDay.color":"#bbb","week.vpanelSplitter.border":"1px solid #e5e5e5","week.vpanelSplitter.height":"3px","week.daygrid.borderRight":"1px solid #e5e5e5","week.daygrid.backgroundColor":"inherit","week.daygridLeft.width":"72px","week.daygridLeft.backgroundColor":"inherit","week.daygridLeft.paddingRight":"8px","week.daygridLeft.borderRight":"1px solid #e5e5e5","week.today.backgroundColor":"rgba(81, 92, 230, 0.05)","week.weekend.backgroundColor":"inherit","week.timegridLeft.width":"72px","week.timegridLeft.backgroundColor":"inherit","week.timegridLeft.borderRight":"1px solid #e5e5e5","week.timegridLeft.fontSize":"11px","week.timegridOneHour.height":"52px","week.timegridHalfHour.height":"26px","week.timegridHalfHour.borderBottom":"none","week.timegridHorizontalLine.borderBottom":"1px solid #e5e5e5","week.timegrid.paddingRight":"8px","week.timegrid.borderRight":"1px solid #e5e5e5","week.timegridSchedule.borderRadius":"2px","week.timegridSchedule.paddingLeft":"2px","week.currentTime.color":"#515ce6","week.currentTime.fontSize":"11px","week.currentTime.fontWeight":"normal","week.currentTimeLinePast.border":"1px dashed #515ce6","week.currentTimeLineBullet.backgroundColor":"#515ce6","week.currentTimeLineToday.border":"1px solid #515ce6","week.currentTimeLineFuture.border":"none","week.creationGuide.color":"#515ce6","week.creationGuide.fontSize":"11px","week.creationGuide.fontWeight":"bold","week.dayGridSchedule.borderRadius":"2px","week.dayGridSchedule.height":"24px","week.dayGridSchedule.marginTop":"2px","week.dayGridSchedule.marginLeft":"8px","week.dayGridSchedule.marginRight":"8px"}},function(e,t,n){"use strict";e.exports={"common.border":"1px solid #e5e5e5","common.backgroundColor":"white","common.holiday.color":"#ff4040","common.saturday.color":"#333","common.dayname.color":"#333","common.today.color":"#333","common.creationGuide.backgroundColor":"rgba(81, 92, 230, 0.05)","common.creationGuide.border":"1px solid #515ce6","month.dayname.height":"31px","month.dayname.borderLeft":"1px solid #e5e5e5","month.dayname.paddingLeft":"10px","month.dayname.paddingRight":"10px","month.dayname.backgroundColor":"inherit","month.dayname.fontSize":"12px","month.dayname.fontWeight":"normal","month.dayname.textAlign":"left","month.holidayExceptThisMonth.color":"rgba(255, 64, 64, 0.4)","month.dayExceptThisMonth.color":"rgba(51, 51, 51, 0.4)","month.weekend.backgroundColor":"inherit","month.day.fontSize":"14px","month.schedule.borderRadius":"2px","month.schedule.height":"24px","month.schedule.marginTop":"2px","month.schedule.marginLeft":"8px","month.schedule.marginRight":"8px","month.moreView.border":"1px solid #d5d5d5","month.moreView.boxShadow":"0 2px 6px 0 rgba(0, 0, 0, 0.1)","month.moreView.backgroundColor":"white","month.moreView.paddingBottom":"17px","month.moreViewTitle.height":"44px","month.moreViewTitle.marginBottom":"12px","month.moreViewTitle.backgroundColor":"inherit","month.moreViewTitle.borderBottom":"none","month.moreViewTitle.padding":"12px 17px 0 17px","month.moreViewList.padding":"0 17px","week.dayname.height":"42px","week.dayname.borderTop":"1px solid #e5e5e5","week.dayname.borderBottom":"1px solid #e5e5e5","week.dayname.borderLeft":"inherit","week.dayname.paddingLeft":"0","week.dayname.backgroundColor":"inherit","week.dayname.textAlign":"left","week.today.color":"#333","week.pastDay.color":"#bbb","week.vpanelSplitter.border":"1px solid #e5e5e5","week.vpanelSplitter.height":"3px","week.daygrid.borderRight":"1px solid #e5e5e5","week.daygrid.backgroundColor":"inherit","week.daygridLeft.width":"72px","week.daygridLeft.backgroundColor":"inherit","week.daygridLeft.paddingRight":"8px","week.daygridLeft.borderRight":"1px solid #e5e5e5","week.today.backgroundColor":"rgba(81, 92, 230, 0.05)","week.weekend.backgroundColor":"inherit","week.timegridLeft.width":"72px","week.timegridLeft.backgroundColor":"inherit","week.timegridLeft.borderRight":"1px solid #e5e5e5","week.timegridLeft.fontSize":"11px","week.timegridLeftTimezoneLabel.height":"40px","week.timegridLeftAdditionalTimezone.backgroundColor":"white","week.timegridOneHour.height":"52px","week.timegridHalfHour.height":"26px","week.timegridHalfHour.borderBottom":"none","week.timegridHorizontalLine.borderBottom":"1px solid #e5e5e5","week.timegrid.paddingRight":"8px","week.timegrid.borderRight":"1px solid #e5e5e5","week.timegridSchedule.borderRadius":"2px","week.timegridSchedule.paddingLeft":"2px","week.currentTime.color":"#515ce6","week.currentTime.fontSize":"11px","week.currentTime.fontWeight":"normal","week.pastTime.color":"#bbb","week.pastTime.fontWeight":"normal","week.futureTime.color":"#333","week.futureTime.fontWeight":"normal","week.currentTimeLinePast.border":"1px dashed #515ce6","week.currentTimeLineBullet.backgroundColor":"#515ce6","week.currentTimeLineToday.border":"1px solid #515ce6","week.currentTimeLineFuture.border":"none","week.creationGuide.color":"#515ce6","week.creationGuide.fontSize":"11px","week.creationGuide.fontWeight":"bold","week.dayGridSchedule.borderRadius":"2px","week.dayGridSchedule.height":"24px","week.dayGridSchedule.marginTop":"2px","week.dayGridSchedule.marginLeft":"8px","week.dayGridSchedule.marginRight":"8px"}},function(e,t,n){"use strict";var l=n(0),o=l.forEachArray,i=Array.prototype.slice,a=n(3),r=n(4),s=r.Date,u=n(13),c=n(28),d={getCollisionGroup:function(e){var t,n=[],a=!1;return e.length?(n[0]=[l.stamp(e[0].valueOf())],o(e.slice(1),(function(r,s){a=!1,t=i.apply(e,[0,s+1]).reverse(),o(t,(function(e){return!r.collidesWith(e)||(a=!0,o(n.slice(0).reverse(),(function(t){return!~l.inArray(l.stamp(e.valueOf()),t)||(t.push(l.stamp(r.valueOf())),!1)})),!1)})),a||n.push([l.stamp(r.valueOf())])})),n):n},getLastRowInColumn:function(e,t){for(var n=e.length;n>0;)if(n-=1,!l.isUndefined(e[n][t]))return n;return!1},getMatrices:function(e,t){var n=[],i=d.getLastRowInColumn;return o(t,(function(t){var a=[[]];o(t,(function(t){for(var n,o,r=e.items[t],s=0,u=!1;!u;)!1===(o=i(a,s))?(a[0].push(r),u=!0):r.collidesWith(a[o][s])||(n=o+1,l.isUndefined(a[n])&&(a[n]=[]),a[n][s]=r,u=!0),s+=1})),n.push(a)})),n},getScheduleInDateRangeFilter:function(e,t){return function(n){var l,o=n.getStarts(),i=n.getEnds();return r.hasPrimaryTimezoneCustomSetting()&&(l=function(e,t){var n=r.getNativeOffsetMs(),l=e.toDate().getTimezoneOffset(),o=0,i=r.getPrimaryTimezoneName(),a=r.getPrimaryOffset(),u=r.getOffsetByTimezoneName(i,e.getTime());r.isNativeOsUsingDSTTimezone()&&n!==l&&(o=6e4*l-n);r.isPrimaryUsingDSTTimezone()&&a!==u&&(o=6e4*(a-u));return{start:new s(e.getUTCTime()+o),end:new s(t.getUTCTime()+o)}}(o,i),o=l.start,i=l.end),!(it)}},positionViewModels:function(e,t,n,i){var r;r=l.map(a.range(e,t,a.MILLISECONDS_PER_DAY),(function(e){return a.format(e,"YYYYMMDD")})),o(n,(function(e){o(e,(function(e){o(e,(function(e,t){var n,o,s,u;e&&(s=e.getStarts(),u=e.getEnds(),o=a.range(a.start(s),a.renderEnd(s,u),a.MILLISECONDS_PER_DAY).length,n=a.format(s,"YYYYMMDD"),e.top=t,e.left=l.inArray(n,r),e.width=o,i&&i(e))}))}))}))},limitRenderRange:function(e,t,n){function l(n){return n.getStarts()t&&(n.exceedRight=!0,n.renderEnds=new s(t)),n}return n.constructor===u?(n.each(l),null):l(n)},convertToViewModel:function(e){var t;return t=new u((function(e){return e.cid()})),e.each((function(e){t.add(c.create(e))})),t}};e.exports=d},function(e,t,n){"use strict";var l=n(0),o=n(13),i=n(15),a=n(3),r=n(4).Date,s=a.MILLISECONDS_SCHEDULE_MIN_DURATION,u={generateTimeArrayInRow:function(e){var t,n,o,i,r,u=[],c=[],d=Math.max.apply(null,l.map(e,(function(e){return e.length})));for(n=1;n=u&&lu&&o<=c||lu||o>c&&lt?e.filter((function(e){return e.top0?r.apply(null,o):0},_adjustTimeTopIndex:function(e){var t=this.Month,n=t._getAlldayMaxTopIndexAtYMD,a=e.find(t._onlyAlldayFilter),r=e.find(t._onlyTimeFilter).sort(o.compare.schedule.asc),s={};r.forEach((function(e){var t=i.format(e.getStarts(),"YYYYMMDD"),o=s[t];l.isUndefined(o)&&(o=s[t]=n(t,a)),s[t]=e.top=o+1}))},_stackTimeFromTop:function(e){var t=this.Month,n=e.find(t._onlyAlldayFilter),a=e.find(t._onlyTimeFilter).sort(o.compare.schedule.asc),s={},u=this.dateMatrix;a.forEach((function(e){var t,o,a=i.format(e.getStarts(),"YYYYMMDD"),c=s[a];if(l.isUndefined(c)&&(c=s[a]=[],l.forEach(u[a],(function(e){n.doWhenHas(e,(function(e){c.push(e.top)}))}))),l.inArray(e.top,c)>=0)for(t=r.apply(null,c)+1,o=1;o<=t&&(e.top=o,!(l.inArray(e.top,c)<0));o+=1);c.push(e.top)}))},_addMultiDatesInfo:function(e){e.each((function(e){var t=e.model,n=t.getStarts(),l=t.getEnds();e.hasMultiDates=i.hasMultiDates(n,l),!t.isAllDay&&e.hasMultiDates&&(e.renderStarts=i.start(n),e.renderEnds=i.renderEnd(n,l))}))},findByDateRange:function(e,t,n,l){var i,r,s,u,c,d=this.Core,h=this.Month,p=d.getScheduleInDateRangeFilter(e,t);return l=l||!1,n=n||[],p=a.and.apply(null,[p].concat(n)),i=this.schedules.find(p),r=d.convertToViewModel(i),h._addMultiDatesInfo(r),h._adjustRenderRange(e,t,r),s=r.sort(o.compare.schedule.asc),u=d.getCollisionGroup(s),c=d.getMatrices(r,u),d.positionViewModels(e,t,c,h._weightTopValue),l?h._adjustTimeTopIndex(r):h._stackTimeFromTop(r),c}};e.exports=s},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(1),a=n(5),r=n(29),s=n(11),u=n(14),c=n(66),d=n(67),h=n(69),p=n(73),m=n(32),f=n(33),g=n(83),y=n(84),S=n(86),_=n(34),C=n(88),v=n(90),E=n(91),w=n(93),P=n(96),k={click:y,creation:S,move:_,resize:C},b={click:v,creation:E,move:w,resize:P},R=[{name:"milestone",type:"daygrid",minHeight:20,maxHeight:80,showExpandableButton:!0,maxExpandableHeight:210,handlers:["click"],show:!0},{name:"task",type:"daygrid",minHeight:40,maxHeight:120,showExpandableButton:!0,maxExpandableHeight:210,handlers:["click","move"],show:!0},{name:"allday",type:"daygrid",minHeight:30,maxHeight:80,showExpandableButton:!0,maxExpandableHeight:210,handlers:["click","creation","move","resize"],show:!0},{name:"time",type:"timegrid",autoHeight:!0,handlers:["click","creation","move","resize"],show:!0}];e.exports=function(e,t,n,y,S){var _,C,v,E,w,P,I,D,F,x,X,M,O,T,H=[],L=[],B=y.taskView,A=y.scheduleView,z={milestone:l.isArray(B)?l.inArray("milestone",B)>=0:B,task:l.isArray(B)?l.inArray("task",B)>=0:B,allday:l.isArray(A)?l.inArray("allday",A)>=0:A,time:l.isArray(A)?l.inArray("time",A)>=0:A};return l.forEach(R,(function(e){var t=e.name;e=l.extend({},e),H.push(e),e.show=z[t],e.show&&(L.length&&L.push({isSplitter:!0}),L.push(l.extend({},e)))})),L.length&&((F=L[L.length-1]).autoHeight=!0,F.maxHeight=null,F.showExpandableButton=!1,l.forEach(H,(function(e){return e.name!==F.name||(e.showExpandableButton=!1,!1)}))),l.extend(y.week,{panels:H}),(_=new c(null,y.week,t,H,S)).handler={click:{},dayname:{},creation:{},move:{},resize:{}},C=i.appendHTMLElement("div",_.container,o.classname("dayname-layout")),v=new d(y,C,e.theme),_.handler.dayname.date=new g(n,v,e),_.addChild(v),(E=i.appendHTMLElement("div",_.container,o.classname("vlayout-area"))).style.height=i.getSize(_.container)[1]-v.container.offsetHeight+"px",w=new r({panels:L,panelHeights:y.week.panelHeights||[]},E,e.theme),_.vLayout=w,l.forEach(H,(function(t){var o,i=t.name,a=t.handlers;t.show&&("daygrid"===t.type?((o=new h(i,y,w.getPanelByName(t.name).container,e.theme)).on("afterRender",(function(e){w.getPanelByName(i).setHeight(null,e.height)})),_.addChild(o),l.forEach(a,(function(t){y.isReadOnly&&"click"!==t||(_.handler[t][i]=new k[t](n,o,e,y),o.addHandler(t,_.handler[t][i],w.getPanelByName(i)))}))):"timegrid"===t.type&&(o=new p(i,y,w.getPanelByName(i).container),_.addChild(o),l.forEach(a,(function(t){y.isReadOnly&&"click"!==t||(_.handler[t][i]=new b[t](n,o,e,y))})),o.on("clickTimezonesCollapsedBtn",(function(){var e=!_.state.timezonesCollapsed;_.setState({timezonesCollapsed:e}),s.requestAnimFrame((function(){_.invoke("clickTimezonesCollapseBtn",e)||_.render()}))}))))})),w.on("resize",(function(){s.requestAnimFrame((function(){_.render()}))})),y.useCreationPopup&&(P=new m(t,e.calendars,y.usageStatistics),I=function(e){l.extend(e,{useCreationPopup:!0}),e.isAllDay?_.handler.creation.allday.fire("beforeCreateSchedule",e):_.handler.creation.time.fire("beforeCreateSchedule",e)},P.on("beforeCreateSchedule",I)),D=function(e){P&&P.setCalendars(e)},e.on("setCalendars",D),y.useDetailPopup&&(x=new f(t,e.calendars),X=function(t){var n=t.schedule.calendarId;t.calendar=a.find(e.calendars,(function(e){return e.id===n})),y.isReadOnly&&(t.schedule=l.extend({},t.schedule,{isReadOnly:!0})),x.render(t)},M=function(e){e.isAllDay?_.handler.creation.allday.fire("beforeDeleteSchedule",e):_.handler.creation.time.fire("beforeDeleteSchedule",e)},T=function(e){e.isAllDay?_.handler.move.allday.fire("beforeUpdateSchedule",e):_.handler.move.time.fire("beforeUpdateSchedule",e)},l.forEach(_.handler.click,(function(e){e.on("clickSchedule",X)})),y.useCreationPopup?(O=function(t){var n=e.calendars;t.isEditMode=!0,P.setCalendars(n),P.render(t)},P.on("beforeUpdateSchedule",T),x.on("beforeUpdateSchedule",O)):x.on("beforeUpdateSchedule",T),x.on("beforeDeleteSchedule",M)),_.on("afterRender",(function(){w.refresh()})),_.controller=e.Week,_._beforeDestroy=function(){l.forEach(_.handler,(function(e){l.forEach(e,(function(e){e.off(),e.destroy()}))})),y.useCreationPopup&&(P.off("beforeCreateSchedule",I),P.destroy()),y.useDetailPopup&&(x.off("beforeDeleteSchedule",M),x.destroy()),_.off()},{view:_,refresh:function(){var e=_.getViewBound().height,t=i.getBCRect(v.container).height;w.container.style.height=e-t+"px",w.refresh()},scrollToNow:function(){_.children.each((function(e){e.scrollToNow&&e.scrollToNow()}))},openCreationPopup:function(e){P&&(e.isAllDay?_.handler.creation.allday.invokeCreationClick(u.create(e)):_.handler.creation.time.invokeCreationClick(u.create(e)))},showCreationPopup:function(t){P&&(P.setCalendars(e.calendars),P.render(t))}}}},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(5),a=n(1),r=n(9);function s(e,t,n){r.call(this,t),this.options=l.extend({index:0,name:"0",minHeight:0,maxHeight:null,height:null,isSplitter:!1,autoHeight:!1,className:""},e),this.index=this.options.index,this.name=this.options.name||String(this.index),this.isHeightForcedSet=!1,this.theme=n,this._initPanel(this.options,t)}l.inherit(s,r),s.prototype.isSplitter=function(){return this.options.isSplitter},s.prototype.setMaxHeight=function(e){this.options.autoHeight||(this.options.maxHeight=e)},s.prototype.setHeightForcedSet=function(e){this.isHeightForcedSet=e},s.prototype.getHeightForcedSet=function(){return this.isHeightForcedSet},s.prototype.setHeight=function(e,t,n){var l=this.options.maxHeight,o=this.options.minHeight,i=this.options.autoHeight;e=e||this.container,(n||!this.isHeightForcedSet||i)&&(n?this.isHeightForcedSet=!0:l&&(t=Math.min(t,l)),t=Math.max(o,t),e.style.height=t+"px")},s.prototype.getResizeInfoByGrowth=function(e){var t=this.getHeight(),n=t+e,l=Math.max(0,n,this.options.minHeight);return[l,t-l]},s.prototype.getHeight=function(){return a.getSize(this.container)[1]},s.prototype.addClass=function(e){a.addClass(this.container,e)},s.prototype.removeClass=function(e){a.removeClass(this.container,e)},s.prototype._initPanel=function(e,t){var n;if(a.setData(t,"panelIndex",e.index),e.isSplitter)return a.addClass(t,o.classname("splitter")),void this.applyTheme();e.className&&a.addClass(t,e.className),e.autoHeight?a.setData(t,"autoHeight",!0):(n=i.limit(e.height||0,[e.minHeight],[e.maxHeight||e.height]),e.height=n,this.setHeight(t,n))},s.prototype.applyTheme=function(){var e=this.container.style,t=this.theme;t&&(e.borderTop=t.week.vpanelSplitter.border||t.common.border,e.borderBottom=t.week.vpanelSplitter.border||t.common.border,e.height=t.week.vpanelSplitter.height)},e.exports=s},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(1),a=n(3),r=n(4).Date,s=n(9);function u(e,t,n,u,c){var d;n=i.appendHTMLElement("div",n),s.call(this,n),i.addClass(n,o.classname("week-container")),d=this._getRenderDateRange(new r),this.options=l.extend({scheduleFilter:[function(e){return Boolean(e.isVisible)}],renderStartDate:a.format(d.start,"YYYY-MM-DD"),renderEndDate:a.format(d.end,"YYYY-MM-DD"),narrowWeekend:!1,startDayOfWeek:0,workweek:!1,showTimezoneCollapseButton:!1,timezonesCollapsed:!1,hourStart:0,hourEnd:24},t),this.controller=e,this.panels=u,this.state={timezonesCollapsed:this.options.timezonesCollapsed},"day"===c&&function(e){e.workweek=!1}(this.options)}l.inherit(u,s),u.prototype.render=function(){var e,t,n,o,i,s,u=this,c=this.options,d=c.scheduleFilter,h=c.narrowWeekend,p=c.startDayOfWeek,m=c.workweek,f=this.controller.theme||{},g=this.state;e=new r(c.renderStartDate),t=new r(c.renderEndDate),s=a.range(a.start(e),a.end(t),a.MILLISECONDS_PER_DAY),c.workweek&&a.compare(e,t)&&(e=(s=l.filter(s,(function(e){return!a.isWeekend(e.getDay())})))[0],t=s[s.length-1]),n=this.controller.findByDateRange(a.start(e),a.end(t),this.panels,d,this.options),i=a.getGridLeftAndWidth(s.length,h,p,m),o={schedulesInDateRange:n,renderStartDate:e,renderEndDate:t,grids:i,range:s,theme:f,state:g},this.children.each((function(e){var t,n=l.pick(e.options,"viewName");e.render(o),n&&(t=o.schedulesInDateRange[n],l.isArray(t)?u._invokeAfterRenderSchedule(t):l.forEach(t,(function(e){u._invokeAfterRenderSchedule(e)})))})),this.fire("afterRender")},u.prototype._invokeAfterRenderSchedule=function(e){var t=this;l.forEachArray(e,(function(e){l.forEachArray(e,(function(e){l.forEachArray(e,(function(e){e&&t.fire("afterRenderSchedule",{schedule:e.model})}))}))}))},u.prototype.viewName="week",u.prototype._getRenderDateRange=function(e){var t=a.start(e),n=new r(Number(t)),l=new r(Number(t));return n.setDate(n.getDate()-3),l.setDate(l.getDate()+3),{start:n,end:l}},l.CustomEvents.mixin(u),e.exports=u},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(5),a=n(3),r=n(4).Date,s=n(1),u=n(9),c=n(68);function d(e,t,n){t=s.appendHTMLElement("div",t,o.classname("dayname-container")),this.options=l.extend({daynames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],timezones:e.timezones},e.week),this.theme=n,u.call(this,t),this.applyTheme()}l.inherit(d,u),d.prototype._getBaseViewModel=function(e,t,n){var o=this.options.daynames,i=this.theme,s=(new r).toLocalTime();return l.map(a.range(a.start(e),a.end(t),a.MILLISECONDS_PER_DAY),(function(e,t){var l=e.getDay(),r=a.isSameDate(e,s),u=e1&&(n=i.parseUnit(l.marginLeft),l.marginLeft=n[0]*o+n[1])),l},d.prototype.applyTheme=function(){var e=this._getStyles(this.theme),t=this.container.style;return t.borderTop=e.borderTop,t.borderBottom=e.borderBottom,t.height=e.height,t.backgroundColor=e.backgroundColor,t.textAlign=e.textAlign,t},e.exports=d},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n \n '+(null!=(i=(h(n,"weekDayname-tmpl")||t&&h(t,"weekDayname-tmpl")||s).call(r,t,{name:"weekDayname-tmpl",hash:{},data:o,loc:{start:{line:7,column:8},end:{line:7,column:35}}}))?i:"")+"\n \n
\n"},2:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:3,column:49},end:{line:3,column:63}}}):i)+"today"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.escapeExpression,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n'+(null!=(i=u(n,"each").call(r,null!=t?u(t,"dayNames"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:2,column:0},end:{line:10,column:9}}}))?i:"")+"
\n"},useData:!0})},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(5),a=n(3),r=n(1),s=n(4).Date,u=n(9),c=n(70),d=n(72),h=n(11),p=Math.max,m=Math.min;function f(e,t,n,i){n=r.appendHTMLElement("div",n,o.classname("daygrid-layout")),u.call(this,n),e=e||"daygrid",this.options=l.extend({viewName:e,daynames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],renderStartDate:"",renderEndDate:"",containerBottomGutter:18,scheduleHeight:parseInt(i.week.dayGridSchedule.height,10),scheduleGutter:parseInt(i.week.dayGridSchedule.marginTop,10),scheduleContainerTop:1,timezones:t.timezones,isReadOnly:t.isReadOnly,getViewModelFunc:function(t){return t.schedulesInDateRange[e]},setViewModelFunc:function(t,n){t.schedulesInDateRange[e]=n}},t.week),this.handler={},this.vPanel=null,this.state.collapsed=!0}function g(e,t,n){return 0===e||6===e?n.weekendBackgroundColor:t?n.todayBackgroundColor:n.backgroundColor}function y(e,t){var n;return l.forEach(e,(function(e){e.name===t&&(n=e)})),n}l.inherit(f,u),f.prototype.getBaseViewModel=function(e){var t,n=this.options,o=n.daynames,i=e.range,r=e.grids,u=n.getViewModelFunc(e),c={},d=y(n.panels,n.viewName),h=this.getViewBound().height,f=this.state.collapsed,S=!!this.vPanel&&this.vPanel.getHeightForcedSet(),_=e.state.timezonesCollapsed,C=this._getStyles(e.theme,_),v=(new s).toLocalTime();return d.showExpandableButton&&(S||(h=f?p(h,d.maxHeight):m(h,d.maxExpandableHeight)),t=Math.floor(h/(n.scheduleHeight+n.scheduleGutter)),f&&(c=this.parent.controller.getExceedDate(t,u,e.range),u=this.parent.controller.excludeExceedSchedules(u,t),n.setViewModelFunc(e,u))),{viewName:n.viewName,range:i,grids:r,days:l.map(e.range,(function(t,n){var l=t.getDay(),i=a.format(t,"YYYYMMDD"),s=a.isSameDate(v,t);return{day:l,dayName:o[l],isToday:s,date:t.getDate(),renderDate:a.format(t,"YYYY-MM-DD"),hiddenSchedules:c[i]||0,width:r[n]?r[n].width:0,left:r[n]?r[n].left:0,backgroundColor:e.range.length>1?g(l,s,C):C.backgroundColor}})),exceedDate:c,showExpandableButton:d.showExpandableButton,collapsed:f,collapseBtnIndex:this.state.clickedExpandBtnIndex,styles:C}},f.prototype.render=function(e){var t,n=this.options,l=this.container,i=this.getBaseViewModel(e),a=this.options.scheduleContainerTop;l.innerHTML=d(i),this.children.clear(),t=new c(n,r.find(o.classname(".container"),l)),this.addChild(t),t.on("afterRender",(function(e){i.height=e.minHeight+a})),this.children.each((function(t){t.render(e)}),this),this.fire("afterRender",i)},f.prototype._beforeDestroy=function(){},f.prototype.addHandler=function(e,t,n){var l=this;this.handler[e]=t,this.vPanel=n,"click"===e&&(t.on("expand",(function(){l.setState({collapsed:!1})}),this),t.on("collapse",(function(){l.setState({collapsed:!0})}),this))},f.prototype._expand=function(){h.requestAnimFrame((function(){var e=this.vPanel,t=this.options,n=y(t.panels,t.viewName);e.setMaxHeight(n.maxExpandableHeight),e.setHeightForcedSet(!1),e.setHeight(null,n.maxExpandableHeight),this.parent&&this.parent.render()}),this)},f.prototype._collapse=function(){h.requestAnimFrame((function(){var e=this.vPanel,t=this.options,n=y(t.panels,t.viewName);e.setMaxHeight(n.maxHeight),e.setHeightForcedSet(!1),e.setHeight(null,n.minHeight),this.parent&&this.parent.render()}),this)},f.prototype.setState=function(e){var t=this.state.collapsed;u.prototype.setState.call(this,e),this.state.collapsed!==t&&(this.state.collapsed?this._collapse():this._expand())},f.prototype._getStyles=function(e,t){var n,l={},o=this.options.timezones.length,a=t;return e&&(l.borderRight=e.week.daygrid.borderRight||e.common.border,l.todayBackgroundColor=e.week.today.backgroundColor,l.weekendBackgroundColor=e.week.weekend.backgroundColor,l.backgroundColor=e.week.daygrid.backgroundColor,l.leftWidth=e.week.daygridLeft.width,l.leftBackgroundColor=e.week.daygridLeft.backgroundColor,l.leftPaddingRight=e.week.daygridLeft.paddingRight,l.leftBorderRight=e.week.daygridLeft.borderRight,!a&&o>1&&(n=i.parseUnit(l.leftWidth),l.leftWidth=n[0]*o+n[1])),l},e.exports=f},function(e,t,n){"use strict";var l=n(0),o=n(30),i=n(71),a=Math.max;function r(e,t){o.call(this,e,t),this.collapsed=!0}l.inherit(r,o),r.prototype.render=function(e){var t,n=this.container;t=this.getBaseViewModel(e),n.innerHTML=i(t),this.fire("afterRender",t)},r.prototype._getMaxScheduleInDay=function(e){return a.apply(null,l.map(e,(function(e){return Math.max.apply(null,l.map(e,(function(e){return e.length})))})))},r.prototype._getMinHeight=function(e){var t=this.options;return e*t.scheduleHeight+(e-1)*t.scheduleGutter},r.prototype.getBaseViewModel=function(e){var t,n=this.options,i=n.getViewModelFunc(e),a=this._getMaxScheduleInDay(i),r=this._getStyles(e.theme);return t=o.prototype.getBaseViewModel.call(this,e),t=l.extend({minHeight:this._getMinHeight(a),matrices:i,scheduleContainerTop:this.options.scheduleContainerTop,maxScheduleInDay:a,isReadOnly:n.isReadOnly,styles:r},t)},r.prototype._getStyles=function(e){var t={};return e&&(t.borderRadius=e.week.dayGridSchedule.borderRadius),t},e.exports=r},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i;return null!=(i=(e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]})(n,"each").call(null!=t?t:e.nullContext||{},t,{name:"each",hash:{},fn:e.program(2,o,0),inverse:e.noop,data:o,loc:{start:{line:3,column:4},end:{line:27,column:15}}}))?i:""},2:function(e,t,n,l,o){var i;return"\n "+(null!=(i=(e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]})(n,"each").call(null!=t?t:e.nullContext||{},t,{name:"each",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o,loc:{start:{line:4,column:4},end:{line:26,column:15}}}))?i:"")},3:function(e,t,n,l,o){var i;return"\n "+(null!=(i=(e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]})(n,"if").call(null!=t?t:e.nullContext||{},t,{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o,loc:{start:{line:5,column:4},end:{line:25,column:13}}}))?i:"")},4:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\n
\n
\n '+(null!=(i=(d(n,"schedule-tmpl")||t&&d(t,"schedule-tmpl")||s).call(r,null!=t?d(t,"model"):t,{name:"schedule-tmpl",hash:{},data:o,loc:{start:{line:21,column:87},end:{line:21,column:112}}}))?i:"")+"\n "+(null!=(i=d(n,"unless").call(r,(d(n,"or")||t&&d(t,"or")||s).call(r,(i=o&&d(o,"root"))&&d(i,"isReadOnly"),null!=(i=null!=t?d(t,"model"):t)?d(i,"isReadOnly"):i,{name:"or",hash:{},data:o,loc:{start:{line:22,column:22},end:{line:22,column:60}}}),{name:"unless",hash:{},fn:e.program(15,o,0),inverse:e.noop,data:o,loc:{start:{line:22,column:12},end:{line:22,column:193}}}))?i:"")+"\n
\n
\n"},5:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:8,column:31},end:{line:8,column:45}}}):i)+"weekday-exceed-left"},7:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:9,column:32},end:{line:9,column:46}}}):i)+"weekday-exceed-right"},9:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:13,column:146},end:{line:13,column:160}}}):i)+"weekday-schedule-focused "},11:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color: #ffffff; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+";\n"},13:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"bgColor"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"borderColor"):i,t))+";\n"},15:function(e,t,n,l,o){var i,a,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' '},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n'+(null!=(i=c(n,"each").call(r,null!=t?c(t,"matrices"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:2,column:4},end:{line:28,column:15}}}))?i:"")+"
\n"},useData:!0})},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n'},2:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-right: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"borderRight"),t))+";\n"},4:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=a(n,"each").call(null!=t?t:e.nullContext||{},null!=t?a(t,"days"):t,{name:"each",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o,loc:{start:{line:17,column:8},end:{line:27,column:19}}}))?i:""},5:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=a(n,"if").call(null!=t?t:e.nullContext||{},(i=o&&a(o,"root"))&&a(i,"collapsed"),{name:"if",hash:{},fn:e.program(6,o,0),inverse:e.program(9,o,0),data:o,loc:{start:{line:18,column:12},end:{line:26,column:19}}}))?i:""},6:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=a(n,"if").call(null!=t?t:e.nullContext||{},null!=t?a(t,"hiddenSchedules"):t,{name:"if",hash:{},fn:e.program(7,o,0),inverse:e.noop,data:o,loc:{start:{line:19,column:16},end:{line:21,column:23}}}))?i:""},7:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' '+(null!=(i=(c(n,"weekGridFooterExceed-tmpl")||t&&c(t,"weekGridFooterExceed-tmpl")||s).call(r,null!=t?c(t,"hiddenSchedules"):t,{name:"weekGridFooterExceed-tmpl",hash:{},data:o,loc:{start:{line:20,column:145},end:{line:20,column:192}}}))?i:"")+"\n"},9:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=(a(n,"fi")||t&&a(t,"fi")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},o&&a(o,"key"),"===",(i=o&&a(o,"root"))&&a(i,"collapseBtnIndex"),{name:"fi",hash:{},fn:e.program(10,o,0),inverse:e.noop,data:o,loc:{start:{line:23,column:16},end:{line:25,column:23}}}))?i:""},10:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' '+(null!=(i="function"==typeof(a=null!=(a=c(n,"collapseBtnTitle-tmpl")||(null!=t?c(t,"collapseBtnTitle-tmpl"):t))?a:s)?a.call(r,{name:"collapseBtnTitle-tmpl",hash:{},data:o,loc:{start:{line:24,column:121},end:{line:24,column:148}}}):a)?i:"")+"\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n '+(null!=(i=(h(n,"dayGridTitle-tmpl")||t&&h(t,"dayGridTitle-tmpl")||s).call(r,null!=t?h(t,"viewName"):t,{name:"dayGridTitle-tmpl",hash:{},data:o,loc:{start:{line:2,column:4},end:{line:2,column:36}}}))?i:"")+'\n
\n
\n
\n
\n'+(null!=(i=h(n,"each").call(r,null!=t?h(t,"days"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:7,column:8},end:{line:14,column:19}}}))?i:"")+(null!=(i=h(n,"if").call(r,(i=o&&h(o,"root"))&&h(i,"showExpandableButton"),{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o,loc:{start:{line:16,column:8},end:{line:28,column:15}}}))?i:"")+"
\n
\n
\n"},useData:!0})},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(5),a=n(1),r=n(6),s=n(3),u=n(4),c=n(11),d=n(9),h=n(74),p=n(76),m=n(77),f=n(78),g=n(79),y=u.Date;function S(e,t,n,o){var a,r,u=e.hourStart,c=e.hourEnd,d=new y(e.renderEndDate),h=parseInt(n/60,10),p=Math.abs(n%60),m=(new y).toLocalTime(),f=m.getMinutes(),g=l.range(0,24),S=null;return(h<0||-0===h)&&p>0&&(h-=1),i.shiftArray(g,h),i.takeArray(g,u,c),a=i.shiftHours(m.getHours(),h)%24,r=l.inArray(a,g),t&&(f<20?S=a:f>40&&(S=a+1),l.isNumber(S)&&(S%=24)),l.map(g,(function(e,n){var l,i;return t&&n<=r||d=0,f,n);u.setMinutes(u.getMinutes()+f),r=s.getDateDifference(u,p),l>0&&(m=n.additionalTimezoneBackgroundColor),c.push({timeSlots:g,displayLabel:t.displayLabel,timezoneOffset:t.timezoneOffset,tooltip:t.tooltip||"",width:h,left:d?0:(a.length-l-1)*h,isPrimary:0===l,backgroundColor:m||"",hidden:0!==l&&d,hourmarker:u,dateDifferenceSign:r<0?"-":"+",dateDifference:Math.abs(r)})})),c},C.prototype._getBaseViewModel=function(e){var t=e.grids,n=e.range,o=this.options,i=this._getHourmarkerViewModel((new y).toLocalTime(),t,n),a=l.pick(e,"state","timezonesCollapsed"),r=this._getStyles(e.theme,a);return l.extend(i,{timezones:this._getTimezoneViewModel(i.todaymarkerLeft,a,r),hoursLabels:S(o,i.todaymarkerLeft>=0,0,r),styles:r,showTimezoneCollapseButton:l.pick(o,"showTimezoneCollapseButton"),timezonesCollapsed:a})},C.prototype._renderChildren=function(e,t,n,i){var r,u,c,d,p=this,m=this.options,f=s.format((new y).toLocalTime(),"YYYYMMDD"),g=0;n.innerHTML="",this.children.clear(),d=a.getSize(n.parentElement)[1],l.forEach(e,(function(e,l){c=l===f,r={index:g,left:t[g]?t[g].left:0,width:t[g]?t[g].width:0,ymd:l,isToday:c,isPending:m.isPending,isFocused:m.isFocused,isReadOnly:m.isReadOnly,hourStart:m.hourStart,hourEnd:m.hourEnd},(u=new h(r,a.appendHTMLElement("div",n,o.classname("time-date")),i)).render(l,e,d),p.addChild(u),g+=1}))},C.prototype.render=function(e){var t=this.options,n=e.schedulesInDateRange[t.viewName],i=this.container,r=e.grids,s=this._getBaseViewModel(e),u=l.keys(n).length;this._cacheParentViewModel=e,this._cacheHoursLabels=s.hoursLabels,u&&(s.showHourMarker=s.todaymarkerLeft>=0,i.innerHTML=m(s),this.renderStickyContainer(s),this._renderChildren(n,r,a.find(o.classname(".timegrid-schedules-container"),i),e.theme),this._hourLabels=a.find("ul",i),this.hourmarkers=a.find(o.classname(".timegrid-hourmarker"),i,!0),this._scrolled||(this._scrolled=!0,this.scrollToNow()))},C.prototype.renderStickyContainer=function(e){var t=this.stickyContainer;t.innerHTML=f(e),t.style.display=e.timezones.length>1?"block":"none",t.style.width=e.styles.leftWidth,t.style.height=e.styles.displayTimezoneLabelHeight,t.style.borderBottom=e.styles.leftBorderRight},C.prototype.refreshHourmarker=function(){var e,t=this.hourmarkers,n=this._cacheParentViewModel,i=this._cacheHoursLabels,r=this.rAnimationFrameID;t&&n&&!r&&(e=this._getBaseViewModel(n),this.rAnimationFrameID=c.requestAnimFrame((function(){var r=!1;l.forEach(i,(function(t,n){return t.hidden===e.hoursLabels[n].hidden||(r=!0,!1)})),r?this.render(n):l.forEach(t,(function(t){var n=a.find(o.classname(".timegrid-todaymarker"),t),l=a.find(o.classname(".timegrid-hourmarker-time"),t),i=a.closest(t,o.classname(".timegrid-timezone")),r=i?a.getData(i,"timezoneIndex"):0;t.style.top=e.hourmarkerTop+"%",n&&(n.style.display=e.todaymarkerLeft>=0?"block":"none"),l&&(l.innerHTML=g(e.hourmarkerTimzones[r]))})),this.rAnimationFrameID=null}),this))},C.prototype.attachEvent=function(){clearInterval(this.intervalID),clearTimeout(this.timerID),this.intervalID=this.timerID=this.rAnimationFrameID=null,this.timerID=setTimeout(this.onTick.bind(this),1e3*(60-(new y).getSeconds())),r.on(this.stickyContainer,"click",this._onClickStickyContainer,this)},C.prototype.scrollToNow=function(){var e,t,n,l,o,i=this.container;this.hourmarkers&&this.hourmarkers.length&&(e=this.hourmarkers[0].offsetTop,t=this.getViewBound(),n=e,l=t.height/4,10,o=function(){n>e-l?(n-=10,i.scrollTop=n,c.requestAnimFrame(o)):i.scrollTop=e-l},c.requestAnimFrame(o))},C.prototype.onTick=function(){this.timerID&&(clearTimeout(this.timerID),this.timerID=null),this.intervalID||(this.intervalID=setInterval(this.onTick.bind(this),6e4)),this.refreshHourmarker()},C.prototype._getStyles=function(e,t){var n,l={},o=this.options.timezones.length,a=t;return e&&(l.borderBottom=e.week.timegridHorizontalLine.borderBottom||e.common.border,l.halfHourBorderBottom=e.week.timegridHalfHour.borderBottom||e.common.border,l.todayBackgroundColor=e.week.today.backgroundColor,l.weekendBackgroundColor=e.week.weekend.backgroundColor,l.backgroundColor=e.week.daygrid.backgroundColor,l.leftWidth=e.week.timegridLeft.width,l.leftBackgroundColor=e.week.timegridLeft.backgroundColor,l.leftBorderRight=e.week.timegridLeft.borderRight||e.common.border,l.leftFontSize=e.week.timegridLeft.fontSize,l.timezoneWidth=e.week.timegridLeft.width,l.additionalTimezoneBackgroundColor=e.week.timegridLeftAdditionalTimezone.backgroundColor||l.leftBackgroundColor,l.displayTimezoneLabelHeight=e.week.timegridLeftTimezoneLabel.height,l.displayTimezoneLabelBackgroundColor="inherit"===e.week.timegridLeft.backgroundColor?"white":e.week.timegridLeft.backgroundColor,l.oneHourHeight=e.week.timegridOneHour.height,l.halfHourHeight=e.week.timegridHalfHour.height,l.quaterHourHeight=parseInt(l.halfHourHeight,10)/2+"px",l.currentTimeColor=e.week.currentTime.color,l.currentTimeFontSize=e.week.currentTime.fontSize,l.currentTimeFontWeight=e.week.currentTime.fontWeight,l.pastTimeColor=e.week.pastTime.color,l.pastTimeFontWeight=e.week.pastTime.fontWeight,l.futureTimeColor=e.week.futureTime.color,l.futureTimeFontWeight=e.week.futureTime.fontWeight,l.currentTimeLeftBorderTop=e.week.currentTimeLinePast.border,l.currentTimeBulletBackgroundColor=e.week.currentTimeLineBullet.backgroundColor,l.currentTimeTodayBorderTop=e.week.currentTimeLineToday.border,l.currentTimeRightBorderTop=e.week.currentTimeLineFuture.border,!a&&o>1&&(n=i.parseUnit(l.leftWidth),l.leftWidth=n[0]*o+n[1])),l},C.prototype._onClickStickyContainer=function(e){var t=r.getEventTarget(e);a.closest(t,o.classname(".timegrid-timezone-close-btn"))&&this.fire("clickTimezonesCollapsedBtn")},e.exports=C},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(3),a=n(1),r=n(9),s=n(75),u=n(4),c=l.forEachArray,d=i.MILLISECONDS_SCHEDULE_MIN_DURATION;function h(e,t,n){r.call(this,t),this.options=l.extend({index:0,width:0,ymd:"",isToday:!1,pending:!1,hourStart:0,hourEnd:24,defaultMarginBottom:2,minHeight:18.5,isReadOnly:!1},e),this.timeTmpl=s,this.theme=n,t.style.width=e.width+"%",t.style.left=e.left+"%",this.options.isToday&&a.addClass(this.container,o.classname("today")),this.applyTheme()}l.inherit(h,r),h.prototype._parseDateGroup=function(e){var t=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10),l=parseInt(e.substr(6,2),10),o=i.start();return o.setFullYear(t,n-1,l),i.start(o)},h.prototype._getScheduleViewBoundX=function(e,t){var n=t.baseWidth*(e.extraSpace+1);return e.hasCollide||(n=null),{left:t.baseLeft[t.columnIndex],width:n}},h.prototype._getScheduleViewBoundY=function(e,t){var n,l,o,a,r,s=t.baseMS,c=t.baseHeight,h=!1,p=!1,m=i.millisecondsFrom("minutes",e.valueOf().goingDuration),f=i.millisecondsFrom("minutes",e.valueOf().comingDuration),g=e.duration(),y=function(e,t){var n=i.millisecondsFrom("minutes",e.valueOf().goingDuration),l=t.todayStart.toDate().getTimezoneOffset(),o=u.getNativeOffsetMs(),a=e.valueOf().start.toDate().getTimezoneOffset(),r=u.getPrimaryOffset(),s=u.getOffsetByTimezoneName(u.getPrimaryTimezoneName(),e.valueOf().start.getTime()),c=e.valueOf().start-n-t.todayStart;return u.hasPrimaryTimezoneCustomSetting()&&(u.isNativeOsUsingDSTTimezone()&&o!==l&&(c+=6e4*a-o),u.isPrimaryUsingDSTTimezone()&&r!==s&&(c+=6e4*(r-s))),c}(e,t);return n=c*y/s,l=c*((g=g>d?g:d)+m+f)/s,o=c*m/s,a=c*g/s,r=c*f/s,y<0&&(n=0,l+=c*y/s,h=!0),l+n>c&&(l=c-n,p=!0),{top:n,height:Math.max(l,this.options.minHeight)-this.options.defaultMarginBottom,modelDurationHeight:a,goingDurationHeight:o,comingDurationHeight:r,hasGoingDuration:m>0,hasComingDuration:f>0,croppedStart:h,croppedEnd:p}},h.prototype.getScheduleViewBound=function(e,t){var n=this._getScheduleViewBoundX(e,t),o=this._getScheduleViewBoundY(e,t),i=e.model,a=l.pick(i,"isReadOnly")||!1,r=i.isFocused?"#ffffff":i.borderColor;return r===i.bgColor&&(r=null),l.extend({isReadOnly:a,travelBorderColor:r},n,o)},h.prototype._getBaseViewModel=function(e,t,n){var o,a,r=this,s=this.options,u=s.hourStart,d=s.hourEnd,h=s.isReadOnly;n=n||this.getViewBound().height,(o=this._parseDateGroup(e)).setHours(u),a=i.millisecondsFrom("hour",d-u),c(t,(function(e){var t,i,s,u;for(t=Math.max.apply(null,l.map(e,(function(e){return e.length}))),i=100/t,s=[],u=0;u\n
\n'+(null!=(i=h(n,"if").call(r,null!=t?h(t,"hasGoingDuration"):t,{name:"if",hash:{},fn:e.program(19,o,0),inverse:e.noop,data:o,loc:{start:{line:29,column:12},end:{line:37,column:19}}}))?i:"")+'
\n '+(null!=(i=(h(n,"time-tmpl")||t&&h(t,"time-tmpl")||s).call(r,null!=t?h(t,"model"):t,{name:"time-tmpl",hash:{},data:o,loc:{start:{line:45,column:20},end:{line:45,column:41}}}))?i:"")+"\n
\n"+(null!=(i=h(n,"if").call(r,null!=t?h(t,"hasComingDuration"):t,{name:"if",hash:{},fn:e.program(26,o,0),inverse:e.noop,data:o,loc:{start:{line:47,column:12},end:{line:54,column:19}}}))?i:"")+"
\n "+(null!=(i=h(n,"unless").call(r,(h(n,"or")||t&&h(t,"or")||s).call(r,null!=t?h(t,"croppedEnd"):t,(h(n,"or")||t&&h(t,"or")||s).call(r,(i=o&&h(o,"root"))&&h(i,"isReadOnly"),null!=(i=null!=t?h(t,"model"):t)?h(i,"isReadOnly"):i,{name:"or",hash:{},data:o,loc:{start:{line:56,column:37},end:{line:56,column:75}}}),{name:"or",hash:{},data:o,loc:{start:{line:56,column:22},end:{line:56,column:76}}}),{name:"unless",hash:{},fn:e.program(29,o,0),inverse:e.noop,data:o,loc:{start:{line:56,column:12},end:{line:56,column:207}}}))?i:"")+"\n
\n"},5:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:6,column:83},end:{line:6,column:97}}}):i)+"time-date-schedule-block-pending"},7:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" padding-left: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"paddingLeft"),t))+";\n"},9:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:12,column:147},end:{line:12,column:161}}}):i)+"time-schedule-focused "},11:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-bottom-left-radius: "+r(a((i=(i=o&&s(o,"root"))&&s(i,"styles"))&&s(i,"borderRadius"),t))+";\n border-bottom-right-radius: "+r(a((i=(i=o&&s(o,"root"))&&s(i,"styles"))&&s(i,"borderRadius"),t))+";\n"},13:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-top-left-radius: "+r(a((i=(i=o&&s(o,"root"))&&s(i,"styles"))&&s(i,"borderRadius"),t))+";\n border-top-right-radius: "+r(a((i=(i=o&&s(o,"root"))&&s(i,"styles"))&&s(i,"borderRadius"),t))+";\n"},15:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color: #ffffff; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+";\n"},17:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"bgColor"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"borderColor"):i,t))+";\n"},19:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
'+(null!=(i=(c(n,"goingDuration-tmpl")||t&&c(t,"goingDuration-tmpl")||s).call(r,null!=t?c(t,"model"):t,{name:"goingDuration-tmpl",hash:{},data:o,loc:{start:{line:36,column:66},end:{line:36,column:96}}}))?i:"")+"
\n"},20:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-color:"+e.escapeExpression(e.lambda(null!=(i=null!=t?a(t,"model"):t)?a(i,"color"):i,t))+";\n"},22:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-color:"+e.escapeExpression(e.lambda(null!=(i=null!=t?a(t,"model"):t)?a(i,"borderColor"):i,t))+";\n"},24:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"border-bottom: 1px dashed "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"travelBorderColor")||(null!=t?a(t,"travelBorderColor"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"travelBorderColor",hash:{},data:o,loc:{start:{line:44,column:67},end:{line:44,column:88}}}):i)+";"},26:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
'+(null!=(i=(c(n,"comingDuration-tmpl")||t&&c(t,"comingDuration-tmpl")||s).call(r,null!=t?c(t,"model"):t,{name:"comingDuration-tmpl",hash:{},data:o,loc:{start:{line:53,column:26},end:{line:53,column:57}}}))?i:"")+"
\n"},27:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-color:"+e.escapeExpression(e.lambda(null!=(i=null!=t?a(t,"model"):t)?a(i,"borderColor"):i,t))+";\n "},29:function(e,t,n,l,o){var i,a,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
 
'},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.escapeExpression,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n'+(null!=(i=u(n,"each").call(r,null!=t?u(t,"matrices"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:2,column:0},end:{line:61,column:9}}}))?i:"")+"
\n"},useData:!0})},function(e,t,n){"use strict";(function(t){var l=n(0),o=n(6),i=n(1),a=n(31);function r(e){this.container=e,this._direction=r.DIRECTION.INSIDE,this._offset=0,this._intervalID=0,o.on(e,{mousedown:this._onMouseDown},this)}r.DIRECTION={INSIDE:0,TOP:1,RIGHT:2,BOTTOM:3,LEFT:4},r.prototype.destroy=function(){o.off(this.container,{mousedown:this._onMouseDown,mousemove:this._onMouseMove,mouseup:this._onMouseUp},this),window.clearInterval(this._intervalID),this._intervalID=this._direction=this.container=null},r.prototype._getEdgePositions=function(e){return{top:e.top,right:e.left+e.width,bottom:e.bottom,left:e.left}},r.prototype.getRealSize=function(e){var t,n,l=i.getComputedStyle(e);return t=parseFloat(l.getPropertyValue("border-top-width"))+parseFloat(l.getPropertyValue("border-bottom-width")),n=parseFloat(l.getPropertyValue("padding-top"))+parseFloat(l.getPropertyValue("padding-bottom")),[e.clientWidth+t+n,e.clientHeight+t+n]},r.prototype.hasScrollbar=function(e){var t=this.getRealSize(e);return[e.offsetWidth>Math.ceil(t[0]),e.offsetHeight>Math.ceil(t[1])]},r.prototype.isOnScrollbar=function(e,t){var n=this.getRealSize(e),l=o.getMousePosition(t,e);return n[0]-2=t.top&&n.y<=t.bottom&&n.x>=t.left&&n.x<=t.right)this._direction=r.DIRECTION.INSIDE;else{if(n.yt.bottom)return this._direction=r.DIRECTION.BOTTOM,void(this._offset=n.y-t.bottom);if(n.x\n'+(null!=(i=d(n,"if").call(r,null!=t?d(t,"isPrimary"):t,{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.program(10,o,0),data:o,loc:{start:{line:4,column:8},end:{line:26,column:15}}}))?i:"")+" \n"},2:function(e,t,n,l,o){return"display:none;"},4:function(e,t,n,l,o){var i,a=null!=t?t:e.nullContext||{},r=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return(null!=(i=r(n,"each").call(a,null!=t?r(t,"timeSlots"):t,{name:"each",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o,loc:{start:{line:5,column:12},end:{line:9,column:23}}}))?i:"")+(null!=(i=r(n,"if").call(a,(i=o&&r(o,"root"))&&r(i,"showHourMarker"),{name:"if",hash:{},fn:e.program(8,o,0),inverse:e.noop,data:o,loc:{start:{line:10,column:12},end:{line:14,column:19}}}))?i:"")},5:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n '+(null!=(i=(c(n,"timegridDisplayPrimayTime-tmpl")||t&&c(t,"timegridDisplayPrimayTime-tmpl")||s).call(r,t,{name:"timegridDisplayPrimayTime-tmpl",hash:{},data:o,loc:{start:{line:7,column:68},end:{line:7,column:109}}}))?i:"")+"\n
\n"},6:function(e,t,n,l,o){return"display:none"},8:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n
'+(null!=(i=(d(n,"timegridCurrentTime-tmpl")||t&&d(t,"timegridCurrentTime-tmpl")||s).call(r,t,{name:"timegridCurrentTime-tmpl",hash:{},data:o,loc:{start:{line:12,column:223},end:{line:12,column:258}}}))?i:"")+"
\n
\n"},10:function(e,t,n,l,o){var i,a=null!=t?t:e.nullContext||{},r=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return(null!=(i=r(n,"each").call(a,null!=t?r(t,"timeSlots"):t,{name:"each",hash:{},fn:e.program(11,o,0),inverse:e.noop,data:o,loc:{start:{line:16,column:12},end:{line:20,column:23}}}))?i:"")+(null!=(i=r(n,"if").call(a,(i=o&&r(o,"root"))&&r(i,"showHourMarker"),{name:"if",hash:{},fn:e.program(13,o,0),inverse:e.noop,data:o,loc:{start:{line:21,column:12},end:{line:25,column:19}}}))?i:"")},11:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n '+(null!=(i=(c(n,"timegridDisplayTime-tmpl")||t&&c(t,"timegridDisplayTime-tmpl")||s).call(r,t,{name:"timegridDisplayTime-tmpl",hash:{},data:o,loc:{start:{line:18,column:68},end:{line:18,column:103}}}))?i:"")+"\n
\n"},13:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n
'+(null!=(i=(d(n,"timegridCurrentTime-tmpl")||t&&d(t,"timegridCurrentTime-tmpl")||s).call(r,t,{name:"timegridCurrentTime-tmpl",hash:{},data:o,loc:{start:{line:23,column:171},end:{line:23,column:206}}}))?i:"")+"
\n
\n"},15:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n
\n
\n'},16:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-bottom: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"borderBottom"),t))+";\n"},18:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n
\n
today
\n
\n
\n
\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n'+(null!=(i=h(n,"each").call(r,null!=t?h(t,"timezones"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:2,column:4},end:{line:28,column:15}}}))?i:"")+'
\n
\n
\n'+(null!=(i=h(n,"each").call(r,null!=t?h(t,"hoursLabels"):t,{name:"each",hash:{},fn:e.program(15,o,0),inverse:e.noop,data:o,loc:{start:{line:32,column:8},end:{line:40,column:19}}}))?i:"")+'
\n
\n
\n
\n\n'+(null!=(i=h(n,"if").call(r,null!=t?h(t,"showHourMarker"):t,{name:"if",hash:{},fn:e.program(18,o,0),inverse:e.noop,data:o,loc:{start:{line:46,column:4},end:{line:53,column:11}}}))?i:"")+"
\n"},useData:!0})},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n
\n'+(null!=(i=h(n,"if").call(r,(h(n,"and")||t&&h(t,"and")||s).call(r,null!=t?h(t,"isPrimary"):t,(i=o&&h(o,"root"))&&h(i,"showTimezoneCollapseButton"),{name:"and",hash:{},data:o,loc:{start:{line:4,column:14},end:{line:4,column:62}}}),{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o,loc:{start:{line:4,column:8},end:{line:10,column:15}}}))?i:"")+'
'+(null!=(i=(h(n,"timezoneDisplayLabel-tmpl")||t&&h(t,"timezoneDisplayLabel-tmpl")||s).call(r,null!=t?h(t,"timezoneOffset"):t,null!=t?h(t,"displayLabel"):t,{name:"timezoneDisplayLabel-tmpl",hash:{},data:o,loc:{start:{line:11,column:59},end:{line:11,column:118}}}))?i:"")+"
\n
\n
\n"},2:function(e,t,n,l,o){return"display:none;"},4:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
\n \n \n \n
\n'},5:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:7,column:84},end:{line:7,column:98}}}):i)+"ic-arrow-right"},7:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:7,column:120},end:{line:7,column:134}}}):i)+"ic-arrow-left"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a=null!=t?t:e.nullContext||{},r=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=r(n,"each").call(a,(r(n,"reverse")||t&&r(t,"reverse")||e.hooks.helperMissing).call(a,null!=t?r(t,"timezones"):t,{name:"reverse",hash:{},data:o,loc:{start:{line:1,column:8},end:{line:1,column:27}}}),{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:1,column:0},end:{line:14,column:11}}}))?i:""},useData:!0})},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return(null!=(i=(a(n,"timegridCurrentTime-tmpl")||t&&a(t,"timegridCurrentTime-tmpl")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},t,{name:"timegridCurrentTime-tmpl",hash:{},data:o,loc:{start:{line:1,column:0},end:{line:1,column:35}}}))?i:"")+"\n"},useData:!0})},function(e,n){e.exports=t},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:3,column:150},end:{line:3,column:164}}}):i)+"hide"},3:function(e,t,n,l,o){var i,a=null!=t?t:e.nullContext||{},r=e.hooks.helperMissing,s="function",u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
  • \n \n '+u(typeof(i=null!=(i=c(n,"name")||(null!=t?c(t,"name"):t))?i:r)===s?i.call(a,{name:"name",hash:{},data:o,loc:{start:{line:13,column:60},end:{line:13,column:68}}}):i)+"\n
  • \n"},5:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:23,column:135},end:{line:23,column:149}}}):i)+"public"},7:function(e,t,n,l,o){return" checked"},9:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"state")||(null!=t?a(t,"state"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"state",hash:{},data:o,loc:{start:{line:54,column:99},end:{line:54,column:108}}}):i)},11:function(e,t,n,l,o){var i,a,r=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i="function"==typeof(a=null!=(a=r(n,"popupStateBusy-tmpl")||(null!=t?r(t,"popupStateBusy-tmpl"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"popupStateBusy-tmpl",hash:{},data:o,loc:{start:{line:54,column:116},end:{line:54,column:141}}}):a)?i:""},13:function(e,t,n,l,o){var i,a,r=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i="function"==typeof(a=null!=(a=r(n,"popupUpdate-tmpl")||(null!=t?r(t,"popupUpdate-tmpl"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"popupUpdate-tmpl",hash:{},data:o,loc:{start:{line:69,column:163},end:{line:69,column:185}}}):a)?i:""},15:function(e,t,n,l,o){var i,a,r=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i="function"==typeof(a=null!=(a=r(n,"popupSave-tmpl")||(null!=t?r(t,"popupSave-tmpl"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"popupSave-tmpl",hash:{},data:o,loc:{start:{line:69,column:193},end:{line:69,column:213}}}):a)?i:""},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n
    \n
    \n \n
      \n'+(null!=(i=h(n,"each").call(r,null!=t?h(t,"calendars"):t,{name:"each",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o,loc:{start:{line:10,column:16},end:{line:15,column:25}}}))?i:"")+'
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n -\n
    \n \n \n
    \n
    \n
    \n \n \n '+(null!=(i=typeof(a=null!=(a=h(n,"popupIsAllDay-tmpl")||(null!=t?h(t,"popupIsAllDay-tmpl"):t))?a:s)===u?a.call(r,{name:"popupIsAllDay-tmpl",hash:{},data:o,loc:{start:{line:48,column:52},end:{line:48,column:76}}}):a)?i:"")+'\n
    \n
    \n
    \n \n
      \n
    • \n \n '+(null!=(i=typeof(a=null!=(a=h(n,"popupStateBusy-tmpl")||(null!=t?h(t,"popupStateBusy-tmpl"):t))?a:s)===u?a.call(r,{name:"popupStateBusy-tmpl",hash:{},data:o,loc:{start:{line:60,column:52},end:{line:60,column:77}}}):a)?i:"")+'\n
    • \n
    • \n \n '+(null!=(i=typeof(a=null!=(a=h(n,"popupStateFree-tmpl")||(null!=t?h(t,"popupStateFree-tmpl"):t))?a:s)===u?a.call(r,{name:"popupStateFree-tmpl",hash:{},data:o,loc:{start:{line:64,column:52},end:{line:64,column:77}}}):a)?i:"")+'\n
    • \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n'},useData:!0})},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    '+(null!=(i=(c(n,"popupDetailLocation-tmpl")||t&&c(t,"popupDetailLocation-tmpl")||s).call(r,null!=t?c(t,"schedule"):t,{name:"popupDetailLocation-tmpl",hash:{},data:o,loc:{start:{line:11,column:182},end:{line:11,column:221}}}))?i:"")+"
    "},3:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    '+(null!=(i=(c(n,"popupDetailRepeat-tmpl")||t&&c(t,"popupDetailRepeat-tmpl")||s).call(r,null!=t?c(t,"schedule"):t,{name:"popupDetailRepeat-tmpl",hash:{},data:o,loc:{start:{line:12,column:186},end:{line:12,column:223}}}))?i:"")+"
    "},5:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    '+(null!=(i=(d(n,"popupDetailUser-tmpl")||t&&d(t,"popupDetailUser-tmpl")||s).call(r,null!=t?d(t,"schedule"):t,{name:"popupDetailUser-tmpl",hash:{},data:o,loc:{start:{line:13,column:218},end:{line:13,column:253}}}))?i:"")+"
    "},7:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    '+(null!=(i=(c(n,"popupDetailState-tmpl")||t&&c(t,"popupDetailState-tmpl")||s).call(r,null!=t?c(t,"schedule"):t,{name:"popupDetailState-tmpl",hash:{},data:o,loc:{start:{line:14,column:176},end:{line:14,column:212}}}))?i:"")+"
    "},9:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    '+u(c(null!=(i=null!=t?d(t,"calendar"):t)?d(i,"name"):i,t))+"
    \n"},11:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    '+(null!=(i=(c(n,"popupDetailBody-tmpl")||t&&c(t,"popupDetailBody-tmpl")||s).call(r,null!=t?c(t,"schedule"):t,{name:"popupDetailBody-tmpl",hash:{},data:o,loc:{start:{line:18,column:151},end:{line:18,column:186}}}))?i:"")+"
    "},13:function(e,t,n,l,o){return""},15:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n \n
    \n \n
    \n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n
    \n
    \n
    \n \n '+c(d(null!=(i=null!=t?h(t,"schedule"):t)?h(i,"title"):i,t))+'\n
    \n
    '+(null!=(i=(h(n,"popupDetailDate-tmpl")||t&&h(t,"popupDetailDate-tmpl")||s).call(r,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"isAllDay"):i,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"start"):i,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"end"):i,{name:"popupDetailDate-tmpl",hash:{},data:o,loc:{start:{line:8,column:73},end:{line:8,column:145}}}))?i:"")+'
    \n
    \n
    \n '+(null!=(i=h(n,"if").call(r,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"location"):i,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:11,column:8},end:{line:11,column:241}}}))?i:"")+"\n "+(null!=(i=h(n,"if").call(r,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"recurrenceRule"):i,{name:"if",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o,loc:{start:{line:12,column:8},end:{line:12,column:243}}}))?i:"")+"\n "+(null!=(i=h(n,"if").call(r,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"attendees"):i,{name:"if",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o,loc:{start:{line:13,column:8},end:{line:13,column:273}}}))?i:"")+"\n "+(null!=(i=h(n,"if").call(r,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"state"):i,{name:"if",hash:{},fn:e.program(7,o,0),inverse:e.noop,data:o,loc:{start:{line:14,column:8},end:{line:14,column:232}}}))?i:"")+"\n"+(null!=(i=h(n,"if").call(r,null!=t?h(t,"calendar"):t,{name:"if",hash:{},fn:e.program(9,o,0),inverse:e.noop,data:o,loc:{start:{line:15,column:8},end:{line:17,column:15}}}))?i:"")+" "+(null!=(i=h(n,"if").call(r,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"body"):i,{name:"if",hash:{},fn:e.program(11,o,0),inverse:e.noop,data:o,loc:{start:{line:18,column:8},end:{line:18,column:206}}}))?i:"")+"\n
    \n"+(null!=(i=h(n,"if").call(r,null!=(i=null!=t?h(t,"schedule"):t)?h(i,"isReadOnly"):i,{name:"if",hash:{},fn:e.program(13,o,0),inverse:e.program(15,o,0),data:o,loc:{start:{line:20,column:4},end:{line:27,column:11}}}))?i:"")+'
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n'},useData:!0})},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(1);function a(e,t,n){this.dragHandler=e,this.dayNameView=t,this.baseController=n,e.on({click:this._onClick},this)}a.prototype.destroy=function(){this.dragHandler.off(this),this.dayNameView=this.baseController=this.dragHandler=null},a.prototype.checkExpectCondition=function(e){return!!i.closest(e,o.classname(".dayname-date-area"))},a.prototype._onClick=function(e){var t=e.target,n=this.checkExpectCondition(t),l=i.closest(t,o.classname(".dayname"));n&&l&&this.fire("clickDayname",{date:i.getData(l,"date")})},l.CustomEvents.mixin(a),e.exports=a},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(1),a=n(34);function r(e,t,n){this.dragHandler=e,this.view=t,this.controller=n,e.on({click:this._onClick},this)}r.prototype.destroy=function(){this.dragHandler.off(this),this.view=this.controller=this.dragHandler=null},r.prototype.checkExpectCondition=a.prototype.checkExpectedCondition,r.prototype._onClick=function(e){var t,n=this,l=e.target,a=this.checkExpectCondition(l),r=this.controller.schedules,s=i.closest(l,o.classname(".weekday-collapse-btn")),u=i.closest(l,o.classname(".weekday-exceed-in-week"));if(this.view.container.contains(l)){if(!s)return u?(this.view.setState({clickedExpandBtnIndex:parseInt(i.getData(u,"index"),10)}),void n.fire("expand")):void(a&&i.closest(l,o.classname(".weekday-schedule"))&&(t=i.closest(l,o.classname(".weekday-schedule-block")),r.doWhenHas(i.getData(t,"id"),(function(t){n.fire("clickSchedule",{schedule:t,event:e.originEvent})}))));n.fire("collapse")}},l.CustomEvents.mixin(r),e.exports=r},function(e,t,n){"use strict";(function(t){var l=n(0),o=n(2),i=n(3),a=n(1),r=n(11);function s(e){this.daygridMove=e,this.scheduleContainer=null,this._dragStartXIndex=null,this.guideElement=null,this.elements=null,e.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._clearGuideElement,click:this._clearGuideElement},this)}s.prototype.destroy=function(){this._clearGuideElement(),this.daygridMove.off(this),this.daygridMove=this.scheduleContainer=this._dragStartXIndex=this.elements=this.guideElement=null},s.prototype._clearGuideElement=function(){this._showOriginScheduleBlocks(),a.remove(this.guideElement),l.browser.msie||a.removeClass(t.document.body,o.classname("dragging")),this._dragStartXIndex=this.getScheduleDataFunc=this.guideElement=null},s.prototype._hideOriginScheduleBlocks=function(e){var t=o.classname("weekday-schedule-block-dragging-dim"),n=a.find(o.classname(".weekday-schedule-block"),this.daygridMove.view.container,!0);this.elements=l.filter(n,(function(t){return a.getData(t,"id")===e})),l.forEach(this.elements,(function(e){a.addClass(e,t)}))},s.prototype._showOriginScheduleBlocks=function(){var e=o.classname("weekday-schedule-block-dragging-dim");l.forEach(this.elements,(function(t){a.removeClass(t,e)}))},s.prototype._highlightScheduleBlocks=function(e,t){var n=a.find(o.classname(".weekday-schedule"),t,!0);l.forEach(n,(function(t){t.style.margin="0",e.isFocused||(t.style.backgroundColor=e.dragBgColor,t.style.borderLeftColor=e.borderColor,t.style.color="#ffffff")}))},s.prototype.refreshGuideElement=function(e,t,n,l){var i=this.guideElement;r.requestAnimFrame((function(){i.style.left=e+"%",i.style.width=t+"%",n?a.addClass(i,o.classname("weekday-exceed-left")):a.removeClass(i,o.classname("weekday-exceed-left")),l?a.addClass(i,o.classname("weekday-exceed-right")):a.removeClass(i,o.classname("weekday-exceed-right"))}))},s.prototype._getScheduleBlockDataFunc=function(e){var t=e.model,n=e.datesInRange,l=e.range,o=100/n,a=i.start(t.start),r=i.end(t.end),s=i.start(l[0]),u=i.end(l[l.length-1]),c=Math.ceil((a.getTime()-s.getTime())/i.MILLISECONDS_PER_DAY)||0,d=Math.ceil((r.getTime()-u.getTime())/i.MILLISECONDS_PER_DAY)||0;return function(e){return{baseWidthPercent:o,fromLeft:c+e,fromRight:d+e}}},s.prototype._onDragStart=function(e){var n,i=this.daygridMove.view.container,r=this.guideElement=e.scheduleBlockElement.cloneNode(!0);l.browser.msie||a.addClass(t.document.body,o.classname("dragging")),this._hideOriginScheduleBlocks(String(e.model.cid())),n=a.find(o.classname(".weekday-schedules"),i),a.appendHTMLElement("div",r,o.classname("weekday-schedule-cover")),n.appendChild(r),this._dragStartXIndex=e.xIndex,this.getScheduleDataFunc=this._getScheduleBlockDataFunc(e),this._highlightScheduleBlocks(e.model,r)},s.prototype._onDrag=function(e){var t,n,l,o,i,a,r,s,u=this.getScheduleDataFunc,c=this._dragStartXIndex,d=e.datesInRange,h=e.grids;u&&(n=(t=u(e.xIndex-c)).fromLeft<0,l=t.fromRight>0,i=Math.max(0,t.fromLeft),o=-1*t.fromLeft+(d+t.fromRight),a=n?o+t.fromLeft:o,a=l?a-t.fromRight:a,r=h[i]?h[i].left:0,s=function(e,t,n){for(var l=0,o=0,i=n.length;ol&&n<=e&&(t+=o[n]?o[n].width:0);return t}},s.prototype._onDragStart=function(e){var n,a=this.resizeHandler.view.container,r=this.scheduleBlockElement=e.scheduleBlockElement,s=this.guideElement=r.cloneNode(!0);l.browser.msie||i.addClass(t.document.body,o.classname("resizing-x")),n=i.find(o.classname(".weekday-schedules"),a),i.addClass(s,o.classname("daygrid-guide-move")),i.addClass(r,o.classname("weekday-schedule-block-dragging-dim")),n.appendChild(s),this.getScheduleDataFunc=this.getGuideElementWidthFunc(e)},s.prototype._onDrag=function(e){var t=this.getScheduleDataFunc;t&&this.refreshGuideElement(t(e.xIndex))},e.exports=s}).call(this,n(8))},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(1);function a(e,t,n){this.dragHandler=e,this.timeGridView=t,this.baseController=n,e.on({click:this._onClick},this)}a.prototype.destroy=function(){this.dragHandler.off(this),this.timeGridView=this.baseController=this.dragHandler=null},a.prototype.checkExpectCondition=function(e){var t,n;return!!(t=i.closest(e,o.classname(".time-date")))&&(!(!(n=i.getClass(t).match(o.time.getViewIDRegExp))||n.length<2)&&l.pick(this.timeGridView.children.items,Number(n[1])))},a.prototype._onClick=function(e){var t=this,n=e.target,l=this.checkExpectCondition(n),a=i.closest(n,o.classname(".time-date-schedule-block")),r=this.baseController.schedules;l&&a&&r.doWhenHas(i.getData(a,"id"),(function(n){t.fire("clickSchedule",{schedule:n,event:e.originEvent})}))},l.CustomEvents.mixin(a),e.exports=a},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(15),a=n(3),r=n(1),s=n(6),u=n(5),c=n(92),d=n(4).Date,h=n(18),p=300;function m(e,t,n,l){this.dragHandler=e,this.timeGridView=t,this.baseController=n,this.guide=new c(this),this._getScheduleDataFunc=null,this._dragStart=null,this._requestOnClick=!1,this._disableDblClick=l.disableDblClick,this._disableClick=l.disableClick,e.on("dragStart",this._onDragStart,this),e.on("click",this._onClick,this),this._disableDblClick?p=0:s.on(t.container,"dblclick",this._onDblClick,this)}m.prototype.destroy=function(){var e=this.timeGridView;this.guide.destroy(),this.dragHandler.off(this),e&&e.container&&s.off(e.container,"dblclick",this._onDblClick,this),this.dragHandler=this.timeGridView=this.baseController=this._getScheduleDataFunc=this._dragStart=this.guide=null},m.prototype.checkExpectedCondition=function(e){var t,n=r.getClass(e);return n===o.classname("time-date-schedule-block-wrap")&&(e=e.parentNode,n=r.getClass(e)),!(!(t=n.match(o.time.getViewIDRegExp))||t.length<2)&&l.pick(this.timeGridView.children.items,t[1])},m.prototype._onDragStart=function(e,t,n){var l,o,i=e.target,a=this.checkExpectedCondition(i);a&&(l=this._getScheduleDataFunc=this._retriveScheduleData(a),o=this._dragStart=l(e.originEvent),n&&n(o),this.dragHandler.on({drag:this._onDrag,dragEnd:this._onDragEnd},this),this.fire(t||"timeCreationDragstart",o))},m.prototype._onDrag=function(e,t,n){var l,o=this._getScheduleDataFunc;o&&(l=o(e.originEvent),n&&n(l),this.fire(t||"timeCreationDrag",l))},m.prototype._createSchedule=function(e){var t,n,l,o,i,r=e.relatedView,s=e.createRange,c=e.nearestGridTimeY,h=e.nearestGridEndTimeY?e.nearestGridEndTimeY:new d(c).addMinutes(30);s||(s=[c,h]),t=new d(r.getDate()),n=a.start(t),l=a.getStartOfNextDay(t),o=u.limitDate(s[0],n,l),i=u.limitDate(s[1],n,l),this.fire("beforeCreateSchedule",{isAllDay:!1,start:new d(o),end:new d(i),guide:this.guide,triggerEventName:e.triggerEvent})},m.prototype._onDragEnd=function(e){var t=this,n=this._dragStart;this.dragHandler.off({drag:this._onDrag,dragEnd:this._onDragEnd},this),this._onDrag(e,"timeCreationDragend",(function(e){var l=[n.nearestGridTimeY,e.nearestGridTimeY].sort(i.compare.num.asc);l[1].addMinutes(30),e.createRange=l,t._createSchedule(e)})),this._dragStart=this._getScheduleDataFunc=null},m.prototype._onClick=function(e){var t,n,l,o=this;this.dragHandler.off({drag:this._onDrag,dragEnd:this._onDragEnd},this),(t=this.checkExpectedCondition(e.target))&&!this._disableClick&&(n=this._retriveScheduleData(t),l=n(e.originEvent),this._requestOnClick=!0,setTimeout((function(){o._requestOnClick&&(o.fire("timeCreationClick",l),o._createSchedule(l)),o._requestOnClick=!1}),p),this._dragStart=this._getScheduleDataFunc=null)},m.prototype._onDblClick=function(e){var t,n;(t=this.checkExpectedCondition(e.target))&&(n=this._retriveScheduleData(t)(e),this.fire("timeCreationClick",n),this._createSchedule(n),this._requestOnClick=!1)},m.prototype.invokeCreationClick=function(e){var t,n,o=this.timeGridView.options,i=a.range(o.renderStartDate,o.renderEndDate,a.MILLISECONDS_PER_DAY),r=o.hourStart,s=e.start;l.forEach(i,(function(e,t){a.isSameDate(e,s)&&(n=this.timeGridView.children.toArray()[t])}),this),n||(n=this.timeGridView.children.toArray()[0]),t=this._retriveScheduleDataFromDate(n,e.start,e.end,r),this.fire("timeCreationClick",t),this._createSchedule(t)},h.mixin(m),l.CustomEvents.mixin(m),e.exports=m},function(e,t,n){"use strict";(function(t){var l=n(5),o=n(3),i=n(2),a=n(1),r=n(11),s=n(5).ratio,u=n(4).Date,c=60*o.MILLISECONDS_PER_MINUTES;function d(e){this.guideElement=t.document.createElement("div"),this.guideTimeElement=a.appendHTMLElement("span",this.guideElement,i.classname("time-guide-creation-label")),a.addClass(this.guideElement,i.classname("time-guide-creation")),this.timeCreation=e,this._styleUnit=null,this._styleStart=null,this._styleFunc=null,e.on({timeCreationDragstart:this._createGuideElement,timeCreationDrag:this._onDrag,timeCreationClick:this._createGuideElement},this),this.applyTheme(e.baseController.theme)}d.prototype.destroy=function(){this.clearGuideElement(),this.timeCreation.off(this),this.timeCreation=this._styleUnit=this._styleStart=this._styleFunc=this.guideElement=this.guideTimeElement=null},d.prototype.clearGuideElement=function(){var e=this.guideElement,t=this.guideTimeElement;a.remove(e),r.requestAnimFrame((function(){e.style.display="none",e.style.top="",e.style.height="",t.innerHTML=""}))},d.prototype._refreshGuideElement=function(e,t,n,l,r){var s=this.guideElement,u=this.guideTimeElement;s.style.top=e+"px",s.style.height=t+"px",s.style.display="block",u.innerHTML=o.format(n,"HH:mm")+" - "+o.format(l,"HH:mm"),r?a.removeClass(u,i.classname("time-guide-bottom")):a.addClass(u,i.classname("time-guide-bottom"))},d.prototype._getUnitData=function(e){var t=e.options,n=e.getViewBound().height,l=t.hourEnd-t.hourStart,i=o.parse(t.ymd),a=o.getStartOfNextDay(i);return i.setHours(0,0,0,0),i.setHours(t.hourStart),[n,l,i,a,n/l]},d.prototype._limitStyleData=function(e,t,n,o){var i=this._styleUnit;return[e=l.limit(e,[0],[i[0]]),t=l.limit(e+t,[0],[i[0]])-e,n=l.limitDate(n,i[2],i[3]),o=l.limitDate(o,i[2],i[3])]},d.prototype._getStyleDataFunc=function(e,t,n){var i=n,a=o.end(n);return function(n){var o=n.nearestGridY,r=n.nearestGridTimeY,c=n.nearestGridEndTimeY||new u(r).addMinutes(30);return[l.limit(s(t,e,o),[0],[e]),l.limitDate(r,i,a),l.limitDate(c,i,a)]}},d.prototype._createGuideElement=function(e){var t,n,l,i,a,r,s,d,h=e.relatedView,p=o.millisecondsFrom("hour",e.hourStart)||0;t=this._styleUnit=this._getUnitData(h),n=this._styleFunc=this._getStyleDataFunc.apply(this,t),l=this._styleStart=n(e),s=new u(l[1]).addMinutes(o.minutesFromHours(p)),d=new u(l[2]).addMinutes(o.minutesFromHours(p)),a=l[0],r=t[4]*(d-s)/c,i=this._limitStyleData(a,r,s,d),this._refreshGuideElement.apply(this,i),h.container.appendChild(this.guideElement)},d.prototype._onDrag=function(e){var t,n,l,o=this._styleFunc,i=this._styleUnit,a=this._styleStart,s=this._refreshGuideElement.bind(this);o&&i&&a&&(t=i[4]/2,(n=o(e))[0]>a[0]?l=this._limitStyleData(a[0],n[0]-a[0]+t,a[1],new u(n[1]).addMinutes(30)):(l=this._limitStyleData(n[0],a[0]-n[0]+t,n[1],new u(a[1]).addMinutes(30))).push(!0),r.requestAnimFrame((function(){s.apply(null,l)})))},d.prototype.applyTheme=function(e){var t=this.guideElement.style,n=this.guideTimeElement.style;t.backgroundColor=e.common.creationGuide.backgroundColor,t.border=e.common.creationGuide.border,n.color=e.week.creationGuide.color,n.fontSize=e.week.creationGuide.fontSize,n.fontWeight=e.week.creationGuide.fontWeight},e.exports=d}).call(this,n(8))},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(3),a=n(1),r=n(6),s=n(4).Date,u=n(18),c=n(94);function d(e,t,n){this.dragHandler=e,this.timeGridView=t,this.baseController=n,this._getScheduleDataFunc=null,this._dragStart=null,this._guide=new c(this),e.on("dragStart",this._onDragStart,this),e.on("mousedown",this._onMouseDown,this)}d.prototype.destroy=function(){this._guide.destroy(),this.dragHandler.off(this),this.dragHandler=this.timeGridView=this.baseController=this._getScheduleDataFunc=this._dragStart=this._guide=null},d.prototype.checkExpectCondition=function(e){return!!a.closest(e,o.classname(".time-schedule"))&&this._getTimeView(e)},d.prototype._getTimeView=function(e){var t,n=a.closest(e,o.classname(".time-date"));return!!n&&(!(!(t=a.getClass(n).match(o.time.getViewIDRegExp))||t.length<2)&&l.pick(this.timeGridView.children.items,Number(t[1])))},d.prototype._onMouseDown=function(e){var t=e.target,n=this.checkExpectCondition(t),i=a.closest(t,o.classname(".time-date-schedule-block"));n&&i&&l.browser.firefox&&r.preventDefault(e.originEvent)},d.prototype._onDragStart=function(e){var t,n,l,i,r=e.target,s=this.checkExpectCondition(r),u=a.closest(r,o.classname(".time-date-schedule-block")),c=this.baseController;s&&u&&(l=a.getData(u,"id"),(i=c.schedules.items[l]).isReadOnly||(t=this._getScheduleDataFunc=this._retriveScheduleData(s),n=this._dragStart=t(e.originEvent,{targetModelID:l,model:i}),this.dragHandler.on({drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this),this.fire("timeMoveDragstart",n)))},d.prototype._onDrag=function(e,t,n){var l,o=this._getScheduleDataFunc,i=this._getTimeView(e.target),a=this._dragStart;i&&o&&a&&(l=o(e.originEvent,{currentView:i,targetModelID:a.targetModelID}),n&&n(l),this.fire(t||"timeMoveDrag",l))},d.prototype._updateSchedule=function(e){var t,n,l=this.baseController,o=e.targetModelID,a=e.nearestRange,r=a[1]-a[0],u=0,c=l.schedules.items[o],d=e.relatedView,h=e.currentView;c&&h&&(r-=i.millisecondsFrom("minutes",30),t=new s(c.getStarts()).addMilliseconds(r),n=new s(c.getEnds()).addMilliseconds(r),h&&(u=h.getDate()-d.getDate()),t.addMilliseconds(u),n.addMilliseconds(u),this.fire("beforeUpdateSchedule",{schedule:c,changes:{start:t,end:n},start:t,end:n}))},d.prototype._onDragEnd=function(e){var t,n=this._getScheduleDataFunc,l=this._getTimeView(e.target),o=this._dragStart;this.dragHandler.off({drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this),n&&o&&((t=n(e.originEvent,{currentView:l,targetModelID:o.targetModelID})).range=[o.timeY,new s(t.timeY).addMinutes(30)],t.nearestRange=[o.nearestGridTimeY,new s(t.nearestGridTimeY).addMinutes(30)],this._updateSchedule(t),this.fire("timeMoveDragend",t))},d.prototype._onClick=function(e){var t,n=this._getScheduleDataFunc,l=this._dragStart;this.dragHandler.off({drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this),n&&l&&(t=n(e.originEvent,{targetModelID:l.targetModelID}),this.fire("timeMoveClick",t))},u.mixin(d),l.CustomEvents.mixin(d),e.exports=d},function(e,t,n){"use strict";(function(t){var l=n(0),o=n(2),i=n(1),a=n(11),r=n(5).ratio,s=n(16),u=n(95),c=n(4).Date,d=n(14),h=n(3),p=n(5),m=h.MILLISECONDS_SCHEDULE_MIN_DURATION;function f(e){this._guideLayer=null,this._model=null,this._viewModel=null,this._lastDrag=null,this.guideElement=null,this.timeMove=e,this._container=null,this._getTopFunc=null,this._startGridY=0,this._startTopPixel=0,e.on({timeMoveDragstart:this._onDragStart,timeMoveDrag:this._onDrag,timeMoveDragend:this._clearGuideElement,timeMoveClick:this._clearGuideElement},this)}f.prototype.destroy=function(){this._clearGuideElement(),this.timeMove.off(this),this._guideLayer&&this._guideLayer.destroy(),this.guideElement=this.timeMove=this._container=this._guideLayer=this._lastDrag=this._getTopFunc=this._startGridY=this._startTopPixel=this._viewModel=null},f.prototype._clearGuideElement=function(){l.browser.msie||i.removeClass(t.document.body,o.classname("dragging")),this._guideLayer&&this._guideLayer.destroy(),this._showOriginScheduleBlocks(),this.guideElement=this._getTopFunc=this._guideLayer=this._model=this._lastDrag=this._startGridY=this._startTopPixel=this._viewModel=null},f.prototype._hideOriginScheduleBlocks=function(){var e=o.classname("time-date-schedule-block-dragging-dim");this.guideElement&&i.addClass(this.guideElement,e)},f.prototype._showOriginScheduleBlocks=function(){var e=o.classname("time-date-schedule-block-dragging-dim");this.guideElement&&i.removeClass(this.guideElement,e)},f.prototype._refreshGuideElement=function(e,t,n){var o=this;a.requestAnimFrame((function(){o._guideLayer&&(o._guideLayer.setPosition(0,e),o._guideLayer.setContent(u(l.extend({model:t},n))))}))},f.prototype._onDragStart=function(e){var t,n,a,r,s=i.closest(e.target,o.classname(".time-date-schedule-block"));s&&(this._startTopPixel=parseFloat(s.style.top),this._startGridY=e.nearestGridY,this.guideElement=s,this._container=e.relatedView.container,this._model=l.extend(d.create(e.model),e.model),n=(n=this._model.duration())>m?n:m,t=(a=h.millisecondsFrom("minutes",this._model.goingDuration))+n+(r=h.millisecondsFrom("minutes",this._model.comingDuration)),this._lastDrag=e,this._viewModel={hasGoingDuration:a>0,hasComingDuration:r>0,goingDurationHeight:p.ratio(t,a,100),modelDurationHeight:p.ratio(t,n,100),comingDurationHeight:p.ratio(t,r,100)},this._resetGuideLayer(),this._hideOriginScheduleBlocks())},f.prototype._onDrag=function(e){var n,a,s=e.currentView,u=s.options,d=s.getViewBound().height,p=parseFloat(this.guideElement.style.height),m=u.hourEnd-u.hourStart,f=e.nearestGridY-this._startGridY,g=r(m,d,f),y=e.nearestGridY-this._lastDrag.nearestGridY;l.browser.msie||i.addClass(t.document.body,o.classname("dragging")),this._container!==s.container&&(this._container=s.container,this._resetGuideLayer()),a=this._startTopPixel+g,n=d-p,a=Math.max(a,0),a=Math.min(a,n),this._model.start=new c(this._model.getStarts()).addMinutes(h.minutesFromHours(y)),this._model.end=new c(this._model.getEnds()).addMinutes(h.minutesFromHours(y)),this._lastDrag=e,this._refreshGuideElement(a,this._model,this._viewModel)},f.prototype._resetGuideLayer=function(){this._guideLayer&&(this._guideLayer.destroy(),this._guideLayer=null),this._guideLayer=new s(null,this._container),this._guideLayer.setSize(this._container.getBoundingClientRect().width,this.guideElement.style.height),this._guideLayer.setPosition(0,this.guideElement.style.top),this._guideLayer.setContent(u(l.extend({model:this._model},this._viewModel))),this._guideLayer.show()},e.exports=f}).call(this,n(8))},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    '+(null!=(i=(d(n,"goingDuration-tmpl")||t&&d(t,"goingDuration-tmpl")||s).call(r,null!=t?d(t,"model"):t,{name:"goingDuration-tmpl",hash:{},data:o,loc:{start:{line:4,column:230},end:{line:4,column:260}}}))?i:"")+"
    \n"},3:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    '+(null!=(i=(d(n,"comingDuration-tmpl")||t&&d(t,"comingDuration-tmpl")||s).call(r,null!=t?d(t,"model"):t,{name:"comingDuration-tmpl",hash:{},data:o,loc:{start:{line:10,column:228},end:{line:10,column:259}}}))?i:"")+"
    \n"},5:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
     
    '},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n
    \n'+(null!=(i=h(n,"if").call(r,null!=t?h(t,"hasGoingDuration"):t,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:3,column:8},end:{line:5,column:15}}}))?i:"")+'
    \n '+(null!=(i=(h(n,"time-tmpl")||t&&h(t,"time-tmpl")||s).call(r,null!=t?h(t,"model"):t,{name:"time-tmpl",hash:{},data:o,loc:{start:{line:7,column:16},end:{line:7,column:37}}}))?i:"")+"\n
    \n"+(null!=(i=h(n,"if").call(r,null!=t?h(t,"hasComingDuration"):t,{name:"if",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o,loc:{start:{line:9,column:8},end:{line:11,column:15}}}))?i:"")+"
    \n "+(null!=(i=h(n,"unless").call(r,null!=t?h(t,"croppedEnd"):t,{name:"unless",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o,loc:{start:{line:13,column:4},end:{line:13,column:104}}}))?i:"")+'\n
    \n
    \n'},useData:!0})},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(3),a=n(1),r=n(4).Date,s=n(5),u=n(18),c=n(97);function d(e,t,n){this.dragHandler=e,this.timeGridView=t,this.baseController=n,this._getScheduleDataFunc=null,this._dragStart=null,this._guide=new c(this),e.on("dragStart",this._onDragStart,this)}d.prototype.destroy=function(){this._guide.destroy(),this.dragHandler.off(this),this.dragHandler=this.timeGridView=this.baseController=this._getScheduleDataFunc=this._dragStart=this._guide=null},d.prototype.checkExpectCondition=function(e){var t,n;return!!a.hasClass(e,o.classname("time-resize-handle"))&&(!!(t=a.closest(e,o.classname(".time-date")))&&(!(!(n=a.getClass(t).match(o.time.getViewIDRegExp))||n.length<2)&&l.pick(this.timeGridView.children.items,Number(n[1]))))},d.prototype._onDragStart=function(e){var t,n,l,i=e.target,r=this.checkExpectCondition(i),s=a.closest(i,o.classname(".time-date-schedule-block")),u=this.baseController;r&&s&&(t=a.getData(s,"id"),n=this._getScheduleDataFunc=this._retriveScheduleData(r),l=this._dragStart=n(e.originEvent,{targetModelID:t,schedule:u.schedules.items[t]}),this.dragHandler.on({drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this),this.fire("timeResizeDragstart",l))},d.prototype._onDrag=function(e,t,n){var l,o=this._getScheduleDataFunc,i=this._dragStart;o&&i&&(l=o(e.originEvent,{targetModelID:i.targetModelID}),n&&n(l),this.fire(t||"timeResizeDrag",l))},d.prototype._updateSchedule=function(e){var t,n,l,o,a=this.baseController,u=e.targetModelID,c=e.nearestRange,d=c[1]-c[0],h=a.schedules.items[u],p=e.relatedView;h&&(d-=i.millisecondsFrom("minutes",30),l=new r(p.getDate()),t=i.end(l),(n=new r(h.getEnds()).addMilliseconds(d))>t&&(n=new r(t)),n.getTime()-h.getStarts().getTime()\n \n '+(null!=(i=(d(n,"monthDayname-tmpl")||t&&d(t,"monthDayname-tmpl")||s).call(r,t,{name:"monthDayname-tmpl",hash:{},data:o,loc:{start:{line:16,column:12},end:{line:16,column:40}}}))?i:"")+"\n \n \n"},2:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-right: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"borderLeft"),t))+";\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.escapeExpression,u=e.lambda,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n'+(null!=(i=c(n,"each").call(r,null!=t?c(t,"daynames"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:3,column:0},end:{line:19,column:9}}}))?i:"")+"
    \n"},useData:!0})},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(5),a=n(1),r=n(9),s=n(30),u=n(102),c=n(103),d=Math.floor,h=Math.min;function p(e,t){s.call(this,e,t),t.style.height=e.heightPercent+"%"}l.inherit(p,s),p.prototype.getViewBound=function(){return r.prototype.getViewBound.call(this)},p.prototype._getRenderLimitIndex=function(e){var t,n=this.options,o=e||this.getViewBound().height,i=l.pick(n,"grid","header","height")||0,a=l.pick(n,"grid","footer","height")||0,r=n.visibleScheduleCount||0;return t=d((o-=i+a)/(n.scheduleHeight+n.scheduleGutter)),r||(r=t),h(t,r)},p.prototype.getBaseViewModel=function(e){var t,n=this.options,o=l.pick(n,"grid","header","height")||0,i=l.pick(n,"grid","footer","height")||0,a=this._getRenderLimitIndex()+1,r=this.getExceedDate(a,e.eventsInDateRange,e.range),u=this._getStyles(e.theme);return e=l.extend({exceedDate:r},e),t=s.prototype.getBaseViewModel.call(this,e),t=l.extend({matrices:e.eventsInDateRange,gridHeaderHeight:o,gridFooterHeight:i,renderLimitIdx:a,isReadOnly:n.isReadOnly,styles:u},t)},p.prototype.render=function(e){var t,n,r,d,h,p=this.container,m=this.getBaseViewModel(e);this.options.visibleWeeksCount||(n=m.dates,r=this.options.renderMonth,d=e.theme,h=r.getMonth()+1,l.forEach(n,(function(e){var t=e.month!==h;e.isOtherMonth=t,t&&(e.color=s.prototype._getDayNameColor(d,e.day,e.isToday,t))}))),p.innerHTML=u(m),(t=a.find(o.classname(".weekday-schedules"),p))&&(t.innerHTML=c(m),i.setAutoEllipsis(o.classname(".weekday-schedule-title"),p,!0))},p.prototype._beforeDestroy=function(){},p.prototype._getStyles=function(e){var t={};return e&&(t.borderTop=e.common.border,t.borderLeft=e.common.border,t.fontSize=e.month.day.fontSize,t.borderRadius=e.month.schedule.borderRadius,t.marginLeft=e.month.schedule.marginLeft,t.marginRight=e.month.schedule.marginRight,t.scheduleBulletTop=this.options.scheduleHeight/3),t},e.exports=p},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n
    \n '+(null!=(i=(d(n,"monthGridHeader-tmpl")||t&&d(t,"monthGridHeader-tmpl")||s).call(r,t,{name:"monthGridHeader-tmpl",hash:{},data:o,loc:{start:{line:14,column:44},end:{line:14,column:75}}}))?i:"")+"\n"+(null!=(i=d(n,"if").call(r,null!=t?d(t,"hiddenSchedules"):t,{name:"if",hash:{},fn:e.program(10,o,0),inverse:e.noop,data:o,loc:{start:{line:15,column:12},end:{line:17,column:19}}}))?i:"")+'
    \n
    \n '+(null!=(i=(d(n,"monthGridFooter-tmpl")||t&&d(t,"monthGridFooter-tmpl")||s).call(r,t,{name:"monthGridFooter-tmpl",hash:{},data:o,loc:{start:{line:20,column:44},end:{line:20,column:75}}}))?i:"")+"\n"+(null!=(i=d(n,"if").call(r,null!=t?d(t,"hiddenSchedules"):t,{name:"if",hash:{},fn:e.program(12,o,0),inverse:e.noop,data:o,loc:{start:{line:21,column:12},end:{line:23,column:19}}}))?i:"")+"
    \n
    \n"},2:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:7,column:84},end:{line:7,column:98}}}):i)+"near-month-day"},4:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:7,column:135},end:{line:7,column:149}}}):i)+"today"},6:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:7,column:182},end:{line:7,column:196}}}):i)+"extra-date"},8:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-right:"+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"borderLeft"),t))+";\n"},10:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' '+(null!=(i=(c(n,"monthGridHeaderExceed-tmpl")||t&&c(t,"monthGridHeaderExceed-tmpl")||s).call(r,null!=t?c(t,"hiddenSchedules"):t,{name:"monthGridHeaderExceed-tmpl",hash:{},data:o,loc:{start:{line:16,column:87},end:{line:16,column:135}}}))?i:"")+"\n"},12:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' '+(null!=(i=(c(n,"monthGridFooterExceed-tmpl")||t&&c(t,"monthGridFooterExceed-tmpl")||s).call(r,null!=t?c(t,"hiddenSchedules"):t,{name:"monthGridFooterExceed-tmpl",hash:{},data:o,loc:{start:{line:22,column:87},end:{line:22,column:135}}}))?i:"")+"\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n
    \n'+(null!=(i=c(n,"each").call(r,null!=t?c(t,"dates"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:6,column:0},end:{line:26,column:11}}}))?i:"")+'
    \n
    \n'},useData:!0})},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i;return null!=(i=(e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]})(n,"each").call(null!=t?t:e.nullContext||{},t,{name:"each",hash:{},fn:e.program(2,o,0),inverse:e.noop,data:o,loc:{start:{line:2,column:0},end:{line:80,column:11}}}))?i:""},2:function(e,t,n,l,o){var i;return"\n"+(null!=(i=(e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]})(n,"each").call(null!=t?t:e.nullContext||{},t,{name:"each",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o,loc:{start:{line:3,column:0},end:{line:79,column:11}}}))?i:"")},3:function(e,t,n,l,o){var i;return"\n"+(null!=(i=(e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]})(n,"if").call(null!=t?t:e.nullContext||{},t,{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.noop,data:o,loc:{start:{line:4,column:0},end:{line:78,column:9}}}))?i:"")},4:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"\n"+(null!=(i=(a(n,"fi")||t&&a(t,"fi")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},null!=t?a(t,"top"):t,"<",(i=o&&a(o,"root"))&&a(i,"renderLimitIdx"),{name:"fi",hash:{},fn:e.program(5,o,0),inverse:e.noop,data:o,loc:{start:{line:5,column:4},end:{line:77,column:13}}}))?i:"")},5:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n'+(null!=(i=(c(n,"fi")||t&&c(t,"fi")||s).call(r,null!=(i=null!=t?c(t,"model"):t)?c(i,"isAllDay"):i,"||",null!=t?c(t,"hasMultiDates"):t,{name:"fi",hash:{},fn:e.program(10,o,0),inverse:e.program(23,o,0),data:o,loc:{start:{line:13,column:8},end:{line:75,column:15}}}))?i:"")+"
    \n"},6:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:9,column:31},end:{line:9,column:45}}}):i)+"weekday-exceed-left"},8:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:10,column:32},end:{line:10,column:46}}}):i)+"weekday-exceed-right"},10:function(e,t,n,l,o){var i,a,r=e.lambda,s=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n '+(null!=(i=(d(n,"allday-tmpl")||t&&d(t,"allday-tmpl")||c).call(u,null!=t?d(t,"model"):t,{name:"allday-tmpl",hash:{},data:o,loc:{start:{line:29,column:47},end:{line:29,column:70}}}))?i:"")+"\n "+(null!=(i=d(n,"unless").call(u,(d(n,"or")||t&&d(t,"or")||c).call(u,(i=o&&d(o,"root"))&&d(i,"isReadOnly"),null!=(i=null!=t?d(t,"model"):t)?d(i,"isReadOnly"):i,{name:"or",hash:{},data:o,loc:{start:{line:30,column:22},end:{line:30,column:60}}}),{name:"unless",hash:{},fn:e.program(21,o,0),inverse:e.noop,data:o,loc:{start:{line:30,column:12},end:{line:30,column:194}}}))?i:"")+"\n
    \n"},11:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:14,column:146},end:{line:14,column:160}}}):i)+"weekday-schedule-focused "},13:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" margin-left: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"marginLeft"),t))+";\n"},15:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" margin-right: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"marginRight"),t))+";\n"},17:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color: #ffffff; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+";\n"},19:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"bgColor"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"borderColor"):i,t))+";\n"},21:function(e,t,n,l,o){var i,a,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' '},23:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=(a(n,"fi")||t&&a(t,"fi")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},null!=(i=null!=t?a(t,"model"):t)?a(i,"category"):i,"===","time",{name:"fi",hash:{},fn:e.program(24,o,0),inverse:e.program(33,o,0),data:o,loc:{start:{line:33,column:12},end:{line:74,column:19}}}))?i:""},24:function(e,t,n,l,o){var i,a,r=e.lambda,s=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n \n '+(null!=(i=(d(n,"time-tmpl")||t&&d(t,"time-tmpl")||c).call(u,null!=t?d(t,"model"):t,{name:"time-tmpl",hash:{},data:o,loc:{start:{line:54,column:53},end:{line:54,column:74}}}))?i:"")+"\n
    \n"},25:function(e,t,n,l,o){return" background: #ffffff\n"},27:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" background:"+e.escapeExpression(e.lambda(null!=(i=null!=t?a(t,"model"):t)?a(i,"borderColor"):i,t))+"\n"},29:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color: #ffffff;\n background-color: "+e.escapeExpression(e.lambda(null!=(i=null!=t?a(t,"model"):t)?a(i,"color"):i,t))+"\n"},31:function(e,t,n,l,o){return" color:#333;\n"},33:function(e,t,n,l,o){var i,a,r=e.lambda,s=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n '+(null!=(i=(d(n,"schedule-tmpl")||t&&d(t,"schedule-tmpl")||c).call(u,null!=t?d(t,"model"):t,{name:"schedule-tmpl",hash:{},data:o,loc:{start:{line:72,column:65},end:{line:72,column:90}}}))?i:"")+"\n
    \n"},34:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" margin-left: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"marginLeft"),t))+";\n"},36:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" margin-right: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"marginRight"),t))+";\n"},38:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color: #ffffff; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+";\n"},40:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"bgColor"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"borderColor"):i,t))+";\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=a(n,"each").call(null!=t?t:e.nullContext||{},null!=t?a(t,"matrices"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:1,column:0},end:{line:81,column:11}}}))?i:""},useData:!0})},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(3),a=n(1);function r(e,t,n){this.dragHandler=e,this.monthView=t,this.baseController=n,e.on({click:this._onClick},this)}r.prototype.destroy=function(){this.dragHandler.off(this),this.monthView=this.baseController=this.dragHandler=null},r.prototype._onClick=function(e){var t,n=this,l=this.baseController.schedules,r=a.closest(e.target,o.classname(".weekday-schedule-block"))||a.closest(e.target,o.classname(".month-more-schedule"));(t=a.closest(e.target,o.classname(".weekday-exceed-in-month")))&&n.fire("clickMore",{date:i.parse(a.getData(t,"ymd")),target:t,ymd:a.getData(t,"ymd")}),r&&l.doWhenHas(a.getData(r,"id"),(function(t){n.fire("clickSchedule",{schedule:t,event:e.originEvent})}))},l.CustomEvents.mixin(r),e.exports=r},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(3),a=n(15),r=n(1),s=n(6),u=n(19),c=n(106),d=n(4).Date,h=300;function p(e,t,n,l){this.dragHandler=e,this.monthView=t,this.baseController=n,this.getScheduleData=null,this._cache=null,this.guide=new c(this),this._requestOnClick=!1,this._disableDblClick=l.disableDblClick,this._disableClick=l.disableClick,e.on("dragStart",this._onDragStart,this),e.on("click",this._onClick,this),this._disableDblClick?h=0:s.on(t.container,"dblclick",this._onDblClick,this)}function m(e){return r.closest(e,o.classname(".weekday-grid"))&&!r.closest(e,o.classname(".weekday-exceed-in-month"))}p.prototype.destroy=function(){this.dragHandler.off(this),this.guide.destroy(),this.monthView&&this.monthView.container&&s.off(this.monthView.container,"dblclick",this._onDblClick,this),this.dragHandler=this.monthView=this.baseController=this.getScheduleData=this._cache=this.guide=null},p.prototype._createSchedule=function(e){this.fire("beforeCreateSchedule",{isAllDay:e.isAllDay,start:e.start,end:e.end,guide:this.guide.guide,triggerEventName:e.triggerEvent})},p.prototype._onDragStart=function(e){var t;m(e.target)&&(this.dragHandler.on({drag:this._onDrag,dragEnd:this._onDragEnd},this),this.getScheduleData=u(this.monthView),t=this.getScheduleData(e.originEvent),this._cache={start:new d(t.date)},this.fire("monthCreationDragstart",t))},p.prototype._onDrag=function(e){var t;this.getScheduleData&&(t=this.getScheduleData(e.originEvent))&&this.fire("monthCreationDrag",t)},p.prototype._onDragEnd=function(e){var t,n,l=this._cache;this.dragHandler.off({drag:this._onDrag,dragEnd:this._onDragEnd},this),this.getScheduleData&&((t=this.getScheduleData(e.originEvent))&&(l.end=new d(t.date),l.isAllDay=!0,n=[l.start,l.end].sort(a.compare.num.asc),l.start=new d(n[0]),l.end=i.end(n[1]),this._createSchedule(l)),this.fire("monthCreationDragend",t),this.getScheduleData=this._cache=null)},p.prototype._onDblClick=function(e){var t,n;m(e.target)&&(t=u(this.monthView)(e),this.fire("monthCreationClick",t),n=this._adjustStartAndEndTime(new d(t.date),new d(t.date)),this._createSchedule({start:n.start,end:n.end,isAllDay:!1,triggerEvent:t.triggerEvent}),this._requestOnClick=!1)},p.prototype._onClick=function(e){var t,n,l=this;m(e.target)&&!this._disableClick&&(t=u(this.monthView)(e.originEvent),this._requestOnClick=!0,setTimeout((function(){l._requestOnClick&&(l.fire("monthCreationClick",t),n=l._adjustStartAndEndTime(new d(t.date),new d(t.date)),l._createSchedule({start:n.start,end:n.end,isAllDay:!1,triggerEvent:t.triggerEvent})),l._requestOnClick=!1}),h))},p.prototype._adjustStartAndEndTime=function(e,t){var n=new d,l=n.getHours(),o=n.getMinutes();return o=o<=30?0:30,e.setHours(l,o,0,0),t.setHours(l+1,o,0,0),{start:e,end:t}},p.prototype.invokeCreationClick=function(e){var t={model:e};this.fire("monthCreationClick",t),this._createSchedule({start:e.start,end:e.end,isAllDay:e.isAllDay,triggerEvent:"manual"})},l.CustomEvents.mixin(p),e.exports=p},function(e,t,n){"use strict";var l=n(35);function o(e){this.monthCreation=e,this.guide=null,e.on({monthCreationDragstart:this._createGuideElement,monthCreationDrag:this._onDrag,monthCreationDragend:this._onDragEnd,monthCreationClick:this._createGuideElement},this)}o.prototype.destroy=function(){this.monthCreation.off(this),this.guide&&this.guide.destroy(),this.guide=this.monthCreation=null},o.prototype._createGuideElement=function(e){this.guide=new l({isCreationMode:!0,height:"100%",top:0},this.monthCreation.monthView),this.guide.start(e)},o.prototype._onDrag=function(e){this.guide.update(e.x,e.y)},o.prototype._onDragEnd=function(){this.guide=null},e.exports=o},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a,r=e.escapeExpression,s=e.lambda,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n'},3:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n
    \n'+(null!=(i=h(n,"if").call(r,null!=t?h(t,"isAllDay"):t,{name:"if",hash:{},fn:e.program(4,o,0),inverse:e.program(6,o,0),data:o,loc:{start:{line:9,column:12},end:{line:13,column:19}}}))?i:"")+'
    \n
     
    \n
    \n'},4:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+(null!=(i=(a(n,"allday-tmpl")||t&&a(t,"allday-tmpl")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},t,{name:"allday-tmpl",hash:{},data:o,loc:{start:{line:10,column:16},end:{line:10,column:38}}}))?i:"")+"\n"},6:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+(null!=(i=(a(n,"time-tmpl")||t&&a(t,"time-tmpl")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},t,{name:"time-tmpl",hash:{},data:o,loc:{start:{line:12,column:16},end:{line:12,column:36}}}))?i:"")+"\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n'+(null!=(i=c(n,"if").call(r,null!=t?c(t,"isCreationMode"):t,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o,loc:{start:{line:2,column:4},end:{line:17,column:11}}}))?i:"")+"
    \n"},useData:!0})},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(3),a=n(1),r=n(19),s=n(109),u=n(4).Date,c=n(5);function d(e,t,n){this.dragHandler=e,this.monthView=t,this.baseController=n,this.getScheduleData=null,this._cache=null,this.guide=new s(this),e.on("dragStart",this._onDragStart,this)}d.prototype.destroy=function(){this.dragHandler.off(this),this.dragHandler=this.monthView=this.baseController=null},d.prototype._updateSchedule=function(e){var t=i.end(new u(e.end)),n=e.schedule,l=c.getScheduleChanges(n,["end"],{end:t});this.fire("beforeUpdateSchedule",{schedule:n,changes:l,start:new u(n.getStarts()),end:t})},d.prototype._onDragStart=function(e){var t,n,l,i=e.target;a.hasClass(i,o.classname("weekday-resize-handle"))&&(i=a.closest(i,o.classname(".weekday-schedule-block")))&&(t=a.getData(i,"id"),n=this.baseController.schedules.items[t],this.dragHandler.on({drag:this._onDrag,dragEnd:this._onDragEnd},this),this.getScheduleData=r(this.monthView),(l=this.getScheduleData(e.originEvent)).target=i,l.model=n,this._cache={schedule:n,target:i,start:new u(l.date)},this.fire("monthResizeDragstart",l))},d.prototype._onDrag=function(e){var t;this.getScheduleData&&(t=this.getScheduleData(e.originEvent))&&this.fire("monthResizeDrag",t)},d.prototype._onDragEnd=function(e){var t,n,l,o=this._cache;this.dragHandler.off({drag:this._onDrag,dragEnd:this._onDragEnd},this),this.getScheduleData&&((t=this.getScheduleData(e.originEvent))&&(n=new u(o.schedule.getStarts()),l=new u(t.date),o.end=l,n<=o.end&&this._updateSchedule(o)),this.fire("monthResizeDragend",t),this.getScheduleData=this._cache=null)},l.CustomEvents.mixin(d),e.exports=d},function(e,t,n){"use strict";(function(t){var l=n(0),o=n(2),i=n(1),a=n(35);function r(e){this.monthResize=e,this.elements=null,this.guide=null,e.on({monthResizeDragstart:this._onDragStart,monthResizeDrag:this._onDrag,monthResizeDragend:this._onDragEnd},this)}r.prototype.destroy=function(){this.monthResize.off(this),this.guide.destroy(),this.guide=this.monthResize=null},r.prototype._hideScheduleBlocks=function(e){this.elements=i.find(o.classname(".weekday-schedule-block-"+e),this.monthResize.monthView.container,!0),l.forEach(this.elements,(function(e){e.style.display="none"}))},r.prototype._showScheduleBlocks=function(){l.forEach(this.elements,(function(e){e.style.display="block"}))},r.prototype._onDragStart=function(e){this.guide=new a({isResizeMode:!0},this.monthResize.monthView),this.guide.start(e),this._hideScheduleBlocks(e.model.cid()),l.browser.msie||i.addClass(t.document.body,o.classname("resizing-x"))},r.prototype._onDrag=function(e){this.guide.update(e.x,e.y)},r.prototype._onDragEnd=function(){this._showScheduleBlocks(),this.guide.destroy(),this.elements=this.guide=null,l.browser.msie||i.removeClass(t.document.body,o.classname("resizing-x"))},e.exports=r}).call(this,n(8))},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(1),a=n(3),r=n(19),s=n(111),u=n(4).Date;function c(e,t,n){this.dragHandler=e,this.monthView=t,this.baseController=n,this.getScheduleData=null,this._cache=null,this.guide=new s(this),e.on("dragStart",this._onDragStart,this)}c.prototype.destroy=function(){this.dragHandler.off(this),this.dragHandler=this.monthView=this.baseController=null},c.prototype.updateSchedule=function(e){var t=e.model,n=t.duration(),l=a.raw(t.start),o=new u(e.end),i=new u(o);i.setHours(l.h,l.m,l.s,l.ms),this.fire("beforeUpdateSchedule",{schedule:t,changes:{start:i,end:new u(i).addMilliseconds(n)},start:i,end:new u(i).addMilliseconds(n)})},c.prototype.getMonthScheduleBlock=function(e){var t=o.classname(".weekday-schedule-block");return i.closest(e,t)},c.prototype.getMoreLayerScheduleBlock=function(e){var t=o.classname(".month-more-schedule");return i.closest(e,t)},c.prototype.hasPermissionToHandle=function(e){var t,n=null;return i.hasClass(e,o.classname("weekday-resize-handle"))?null:((t=this.getMonthScheduleBlock(e))?n=i.getData(t,"id"):(t=this.getMoreLayerScheduleBlock(e))&&(n=i.getData(t,"id"),this.fire("monthMoveStart_from_morelayer")),n)},c.prototype._onDragStart=function(e){var t,n=e.target,l=this.hasPermissionToHandle(n),o=this.baseController.schedules.items[l];l&&o&&!o.isReadOnly&&!o.isPending&&(this.dragHandler.on({drag:this._onDrag,dragEnd:this._onDragEnd},this),this.getScheduleData=r(this.monthView),(t=this.getScheduleData(e.originEvent)).originEvent=e.originEvent,t.target=this.getMonthScheduleBlock(n),t.model=o,this._cache={model:o,target:n,start:new u(Number(t.date))},this.fire("monthMoveDragstart",t))},c.prototype._onDrag=function(e){var t;this.getScheduleData&&(t=l.extend({originEvent:e.originEvent},this.getScheduleData(e.originEvent)))&&this.fire("monthMoveDrag",t)},c.prototype._onDragEnd=function(e){var t,n=this._cache;this.dragHandler.off({drag:this._onDrag,dragEnd:this._onDragEnd},this),this.getScheduleData&&((t=this.getScheduleData(e.originEvent))&&(n.end=new u(t.date),this.updateSchedule(n)),this.fire("monthMoveDragend",t),this.getScheduleData=this._cache=null)},l.CustomEvents.mixin(c),e.exports=c},function(e,t,n){"use strict";(function(t){var l=n(0),o=n(2),i=n(1),a=n(6),r=n(16),s=n(112),u=n(14);function c(e){this.monthMove=e,this.elements=null,this.layer=null,e.on({monthMoveDragstart:this._onDragStart,monthMoveDrag:this._onDrag,monthMoveDragend:this._onDragEnd},this)}c.prototype.destroy=function(){this.monthMove.off(this),this._clearGridBgColor(),this.layer&&this.layer.destroy(),this.element&&i.remove(this.element),this.monthMove=this.elements=this.layer=null},c.prototype._hideOriginScheduleBlocks=function(e){var t=o.classname("weekday-schedule-block-dragging-dim");this.elements=i.find(o.classname(".weekday-schedule-block-"+e),this.monthMove.monthView.container,!0),l.forEach(this.elements,(function(e){i.addClass(e,t)}))},c.prototype._showOriginScheduleBlocks=function(){var e=o.classname("weekday-schedule-block-dragging-dim");l.forEach(this.elements,(function(t){i.removeClass(t,e)}))},c.prototype._clearGridBgColor=function(){var e=o.classname(".weekday-filled"),t=o.classname("weekday-filled"),n=i.find(e,this.monthMove.monthView.container);n&&i.removeClass(n,t)},c.prototype._updateGridBgColor=function(e){var t=i.find(o.classname(".weekday-grid-line"),this.monthMove.monthView.container,!0),n=o.classname("weekday-filled"),l=e.x+e.sizeX*e.y;this._clearGridBgColor(),t&&t[l]&&i.addClass(t[l],n)},c.prototype._onDragStart=function(e){var n=this.monthMove.monthView,c=n.children.single(),d=c.options,h=100/c.getRenderDateRange().length,p=d.scheduleGutter+d.scheduleHeight,m=n.container,f=a.getMousePosition(e.originEvent,m),g=e.model,y=new r(null,m);this._hideOriginScheduleBlocks(g.cid()),this.layer=y,y.setSize(h+"%",p),y.setPosition(f[0],f[1]),y.setContent(s({model:l.extend(u.create(g),g),styles:{scheduleHeight:d.scheduleHeight,scheduleBulletTop:d.scheduleHeight/3,borderRadius:n.controller.theme.month.schedule.borderRadius}})),y.show(),l.browser.msie||i.addClass(t.document.body,o.classname("dragging"))},c.prototype._onDrag=function(e){var t=this.monthMove.monthView.container,n=a.getMousePosition(e.originEvent,t);this._updateGridBgColor(e),this.layer&&this.layer.setPosition(n[0],n[1])},c.prototype._onDragEnd=function(){this._showOriginScheduleBlocks(),l.browser.msie||i.removeClass(t.document.body,o.classname("dragging")),this._clearGridBgColor(),this.layer.destroy(),this.layer=null},e.exports=c}).call(this,n(8))},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" border-left:3px solid "+e.escapeExpression(e.lambda(null!=(i=null!=t?a(t,"model"):t)?a(i,"borderColor"):i,t))+";\n "},3:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' \n'},5:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:16,column:110},end:{line:16,column:124}}}):i)+"weekday-schedule-title-focused"},7:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+(null!=(i=(a(n,"allday-tmpl")||t&&a(t,"allday-tmpl")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},null!=t?a(t,"model"):t,{name:"allday-tmpl",hash:{},data:o,loc:{start:{line:18,column:12},end:{line:18,column:35}}}))?i:"")+"\n"},9:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" "+(null!=(i=(a(n,"time-tmpl")||t&&a(t,"time-tmpl")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},null!=t?a(t,"model"):t,{name:"time-tmpl",hash:{},data:o,loc:{start:{line:20,column:12},end:{line:20,column:33}}}))?i:"")+"\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n'+(null!=(i=h(n,"unless").call(r,null!=(i=null!=t?h(t,"model"):t)?h(i,"isAllDay"):i,{name:"unless",hash:{},fn:e.program(3,o,0),inverse:e.noop,data:o,loc:{start:{line:13,column:4},end:{line:15,column:15}}}))?i:"")+'
    \n'+(null!=(i=h(n,"if").call(r,null!=(i=null!=t?h(t,"model"):t)?h(i,"isAllDay"):i,{name:"if",hash:{},fn:e.program(7,o,0),inverse:e.program(9,o,0),data:o,loc:{start:{line:17,column:8},end:{line:21,column:15}}}))?i:"")+'
    \n
    \n
    \n'},useData:!0})},function(e,t,n){"use strict";var l=n(0),o=n(2),i=n(6),a=n(1),r=n(9),s=n(16),u=n(5),c=n(114);function d(e,t,n){r.call(this,t),this.layer=new s(null,t),this._viewModel=null,this.options=l.extend({moreLayerSize:{width:null,height:null},scheduleHeight:parseInt(n.month.schedule.height,10)||18,scheduleGutter:parseInt(n.month.schedule.marginTop,10)||2,scheduleBulletTop:(parseInt(n.month.schedule.height,10)||18)/3,borderRadius:n.month.schedule.borderRadius},e),this.theme=n,i.on(t,"click",this._onClick,this)}l.inherit(d,r),d.prototype._onClick=function(e){var t=i.getEventTarget(e),n=o.classname("month-more-close");(a.hasClass(t,n)||a.closest(t,"."+n))&&this.hide()},d.prototype._onMouseDown=function(e){var t=i.getEventTarget(e);a.closest(t,o.classname(".month-more"))||this.hide()},d.prototype._getRenderPosition=function(e,t){var n=i.getMousePosition({clientX:a.getPosition(e)[0],clientY:a.getPosition(t)[1]},this.container),l=a.getSize(this.container),o=n[0]-5,r=n[1]-5;return[o=u.ratio(l[0],100,o),r=u.ratio(l[1],100,r)]},d.prototype.destroy=function(){this.layer.destroy(),this.layer=null,i.off(this.container,"click",this._onClick,this),i.off(document.body,"mousedown",this._onMouseDown,this),r.prototype.destroy.call(this)},d.prototype.render=function(e){var t,n,r,s,u=a.closest(e.target,o.classname(".weekday-grid-line")),d=a.closest(u,o.classname(".month-week-item")),h=this.layer,p=this,m=this._getRenderPosition(u,d),f=a.getSize(d)[1]+10,g=u.offsetWidth+10,y=this.options,S=y.moreLayerSize,_=this._getStyles(this.theme),C="",v=a.getSize(this.container),E=m[0],w=m[1];this._viewModel=l.extend(e,{scheduleGutter:y.scheduleGutter,scheduleHeight:y.scheduleHeight,scheduleBulletTop:y.scheduleBulletTop,borderRadius:y.borderRadius,styles:_}),g=Math.max(g,280),C=parseInt(_.titleHeight,10),C+=parseInt(_.titleMarginBottom,10),e.schedules.length<=10?C+=(y.scheduleGutter+y.scheduleHeight)*e.schedules.length:C+=10*(y.scheduleGutter+y.scheduleHeight),C+=parseInt(_.paddingBottom,10),C+=5,S.width&&(g=S.width),S.height&&(C=S.height),(isNaN(C)||C=v[0],s=n+C>=v[1],E+="%",w+="%",r&&s?h.setLTRB({right:0,bottom:0}):!r&&s?h.setLTRB({left:E,bottom:0}):r&&!s?h.setLTRB({right:0,top:w}):h.setPosition(E,w),h.setSize(g,C),h.show(),l.debounce((function(){i.on(document.body,"mousedown",p._onMouseDown,p)}))()},d.prototype.hide=function(){this.layer.hide(),i.off(document.body,"mousedown",this._onMouseDown,this)},d.prototype.refresh=function(){this._viewModel&&this.layer.setContent(c(this._viewModel))},d.prototype.getMoreViewElement=function(){return a.find(o.classname(".month-more"),this.layer.container)},d.prototype._getStyles=function(e){var t={},n="";return e&&(t.border=e.month.moreView.border||e.common.border,t.boxShadow=e.month.moreView.boxShadow,t.backgroundColor=e.month.moreView.backgroundColor||e.common.backgroundColor,t.paddingBottom=e.month.moreView.paddingBottom,t.titleHeight=e.month.moreViewTitle.height,t.titleMarginBottom=e.month.moreViewTitle.marginBottom,t.titleBackgroundColor=e.month.moreViewTitle.backgroundColor,t.titleBorderBottom=e.month.moreViewTitle.borderBottom,t.titlePadding=e.month.moreViewTitle.padding,t.listPadding=e.month.moreViewList.padding,n="calc(100%",parseInt(t.titleHeight,10)&&(n+=" - "+t.titleHeight),parseInt(t.titleMarginBottom,10)&&(n+=" - "+t.titleMarginBottom),n+=")",t.listHeight=n),t},e.exports=d},function(e,t,n){var l=n(7);e.exports=(l.default||l).template({1:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=(a(n,"fi")||t&&a(t,"fi")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},null!=(i=null!=t?a(t,"model"):t)?a(i,"isAllDay"):i,"||",null!=t?a(t,"hasMultiDates"):t,{name:"fi",hash:{},fn:e.program(2,o,0),inverse:e.program(7,o,0),data:o,loc:{start:{line:9,column:8},end:{line:65,column:15}}}))?i:""},2:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n '+(null!=(i=(d(n,"allday-tmpl")||t&&d(t,"allday-tmpl")||s).call(r,null!=t?d(t,"model"):t,{name:"allday-tmpl",hash:{},data:o,loc:{start:{line:20,column:20},end:{line:20,column:43}}}))?i:"")+"\n
    \n"},3:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color: #ffffff; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; border-left:3px solid "+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"borderColor"):i,t))+";\n"},5:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"bgColor"):i,t))+"; border-left:3px solid "+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"borderColor"):i,t))+";\n"},7:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(i=(a(n,"fi")||t&&a(t,"fi")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},null!=(i=null!=t?a(t,"model"):t)?a(i,"category"):i,"===","time",{name:"fi",hash:{},fn:e.program(8,o,0),inverse:e.program(17,o,0),data:o,loc:{start:{line:23,column:12},end:{line:64,column:19}}}))?i:""},8:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d="function",h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n \n '+(null!=(i=(h(n,"time-tmpl")||t&&h(t,"time-tmpl")||s).call(r,null!=t?h(t,"model"):t,{name:"time-tmpl",hash:{},data:o,loc:{start:{line:42,column:53},end:{line:42,column:74}}}))?i:"")+"\n
    \n"},9:function(e,t,n,l,o){return" background: #ffffff\n"},11:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" background:"+e.escapeExpression(e.lambda(null!=(i=null!=t?a(t,"model"):t)?a(i,"borderColor"):i,t))+"\n "},13:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"\n color: #ffffff;\n background-color: "+e.escapeExpression(e.lambda(null!=(i=null!=t?a(t,"model"):t)?a(i,"color"):i,t))+"\n"},15:function(e,t,n,l,o){return" color:#333;\n "},17:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u=e.escapeExpression,c=e.lambda,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n '+(null!=(i=(d(n,"schedule-tmpl")||t&&d(t,"schedule-tmpl")||s).call(r,null!=t?d(t,"model"):t,{name:"schedule-tmpl",hash:{},data:o,loc:{start:{line:62,column:65},end:{line:62,column:90}}}))?i:"")+"\n
    \n"},18:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return e.escapeExpression("function"==typeof(i=null!=(i=a(n,"CSS_PREFIX")||(null!=t?a(t,"CSS_PREFIX"):t))?i:e.hooks.helperMissing)?i.call(null!=t?t:e.nullContext||{},{name:"CSS_PREFIX",hash:{},data:o,loc:{start:{line:47,column:115},end:{line:47,column:129}}}):i)+"weekday-schedule-focused "},20:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" margin-left: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"marginLeft"),t))+";\n"},22:function(e,t,n,l,o){var i,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" margin-right: "+e.escapeExpression(e.lambda((i=(i=o&&a(o,"root"))&&a(i,"styles"))&&a(i,"marginRight"),t))+";\n"},24:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color: #ffffff; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+";\n"},26:function(e,t,n,l,o){var i,a=e.lambda,r=e.escapeExpression,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"color"):i,t))+"; background-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"bgColor"):i,t))+"; border-color:"+r(a(null!=(i=null!=t?s(t,"model"):t)?s(i,"borderColor"):i,t))+";\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,l,o){var i,a,r=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'
    \n
    \n '+(null!=(i=(h(n,"monthMoreTitleDate-tmpl")||t&&h(t,"monthMoreTitleDate-tmpl")||s).call(r,null!=t?h(t,"date"):t,null!=t?h(t,"dayname"):t,{name:"monthMoreTitleDate-tmpl",hash:{},data:o,loc:{start:{line:4,column:58},end:{line:4,column:100}}}))?i:"")+'\n \n
    \n
    \n'+(null!=(i=h(n,"each").call(r,null!=t?h(t,"schedules"):t,{name:"each",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:8,column:8},end:{line:66,column:17}}}))?i:"")+"
    \n
    \n"},useData:!0})},function(e,t,n){},function(e,t,n){"use strict";var l=n(0),o=n(20),i=n(3),a=n(5),r=n(2),s=Math.max,u={stamp:function(e){return l.stamp(e)},equal:function(e,t){return e===t},or:function(e,t){return e||t},and:function(e,t){return e&&t},fi:function(e,t,n,l){switch(t){case"==":return e==n?l.fn(this):l.inverse(this);case"===":return e===n?l.fn(this):l.inverse(this);case"!==":return e!==n?l.fn(this):l.inverse(this);case"<":return e'+a.stripTags(e.title)+""},"milestoneTitle-tmpl":function(){return'Milestone'},"task-tmpl":function(e){return"#"+e.title},"taskTitle-tmpl":function(){return'Task'},"alldayTitle-tmpl":function(){return'All Day'},"allday-tmpl":function(e){return a.stripTags(e.title)},"time-tmpl":function(e){return a.stripTags(e.title)},"goingDuration-tmpl":function(e){var t=e.goingDuration,n=parseInt(t/60,10),l=t%60;return"GoingTime "+i.leadingZero(n,2)+":"+i.leadingZero(l,2)},"comingDuration-tmpl":function(e){var t=e.goingDuration,n=parseInt(t/60,10),l=t%60;return"ComingTime "+i.leadingZero(n,2)+":"+i.leadingZero(l,2)},"monthMoreTitleDate-tmpl":function(e,t){var n=r.classname("month-more-title-day"),o=r.classname("month-more-title-day-label");return''+l.pick(e.split("."),2)+' '+t+""},"monthMoreClose-tmpl":function(){return""},"monthGridHeader-tmpl":function(e){var t=parseInt(e.date.split("-")[2],10),n=[];return n.push(r.classname("weekday-grid-date")),e.isToday&&n.push(r.classname("weekday-grid-date-decorator")),''+t+""},"monthGridHeaderExceed-tmpl":function(e){return''+e+" more"},"monthGridFooter-tmpl":function(){return""},"monthGridFooterExceed-tmpl":function(e){return""},"monthDayname-tmpl":function(e){return e.label},"weekDayname-tmpl":function(e){var t=r.classname("dayname-date"),n=r.classname("dayname-name");return''+e.date+'  '+e.dayName+""},"weekGridFooterExceed-tmpl":function(e){return"+"+e},"dayGridTitle-tmpl":function(e){var t=o.helpers[e+"Title-tmpl"];return t?t(e):e},"schedule-tmpl":function(e){var t=o.helpers[e.category+"-tmpl"];return t?t(e):""},"collapseBtnTitle-tmpl":function(){return''},"timezoneDisplayLabel-tmpl":function(e,t){var n,o,a;return l.isUndefined(t)&&(n=e<0?"-":"+",o=Math.abs(parseInt(e/60,10)),a=Math.abs(e%60),t=n+i.leadingZero(o,2)+":"+i.leadingZero(a,2)),t},"timegridDisplayPrimayTime-tmpl":function(e){return o.helpers["timegridDisplayPrimaryTime-tmpl"](e)},"timegridDisplayPrimaryTime-tmpl":function(e){var t=e.hour,n=t>=12?"pm":"am";return t>12&&(t-=12),t+" "+n},"timegridDisplayTime-tmpl":function(e){return i.leadingZero(e.hour,2)+":"+i.leadingZero(e.minutes,2)},"timegridCurrentTime-tmpl":function(e){var t=[];return e.dateDifference&&t.push("["+e.dateDifferenceSign+e.dateDifference+"]
    "),t.push(i.format(e.hourmarker,"HH:mm")),t.join("")},"popupIsAllDay-tmpl":function(){return"All day"},"popupStateFree-tmpl":function(){return"Free"},"popupStateBusy-tmpl":function(){return"Busy"},"titlePlaceholder-tmpl":function(){return"Subject"},"locationPlaceholder-tmpl":function(){return"Location"},"startDatePlaceholder-tmpl":function(){return"Start date"},"endDatePlaceholder-tmpl":function(){return"End date"},"popupSave-tmpl":function(){return"Save"},"popupUpdate-tmpl":function(){return"Update"},"popupDetailDate-tmpl":function(e,t,n){var l=i.isSameDate(t,n),o=(l?"":"YYYY.MM.DD ")+"hh:mm tt";return e?i.format(t,"YYYY.MM.DD")+(l?"":" - "+i.format(n,"YYYY.MM.DD")):i.format(t,"YYYY.MM.DD hh:mm tt")+" - "+i.format(n,o)},"popupDetailLocation-tmpl":function(e){return e.location},"popupDetailUser-tmpl":function(e){return(e.attendees||[]).join(", ")},"popupDetailState-tmpl":function(e){return e.state||"Busy"},"popupDetailRepeat-tmpl":function(e){return e.recurrenceRule},"popupDetailBody-tmpl":function(e){return e.body},"popupEdit-tmpl":function(){return"Edit"},"popupDelete-tmpl":function(){return"Delete"}};function c(e,t,n){return n=n||"",l.isNumber(e)?n+":"+e+t:n+":auto"}function d(e,t){for(var n,l=0,o=0,i=t.length;o + * @license MIT + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.util=e():(t.tui=t.tui||{},t.tui.util=e())}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="dist",e(0)}([function(t,e,n){"use strict";var r={},o=n(1),i=o.extend;i(r,o),i(r,n(3)),i(r,n(2)),i(r,n(4)),i(r,n(5)),i(r,n(6)),i(r,n(7)),i(r,n(8)),i(r,n(9)),r.browser=n(10),r.popup=n(11),r.formatDate=n(12),r.defineClass=n(13),r.defineModule=n(14),r.defineNamespace=n(15),r.CustomEvents=n(16),r.Enum=n(17),r.ExMap=n(18),r.HashMap=n(20),r.Map=n(19),t.exports=r},function(t,e,n){"use strict";function r(t,e){var n,r,o,i,u=Object.prototype.hasOwnProperty;for(o=1,i=arguments.length;o-1||h.inArray(e,o)>-1)return!1;for(n in e){if(e.hasOwnProperty(n)!==t.hasOwnProperty(n))return!1;if(typeof e[n]!=typeof t[n])return!1}for(n in t){if(e.hasOwnProperty(n)!==t.hasOwnProperty(n))return!1;if(typeof e[n]!=typeof t[n])return!1;if("object"==typeof t[n]||"function"==typeof t[n]){if(r.push(t),o.push(e),!c(t[n],e[n]))return!1;r.pop(),o.pop()}else if(t[n]!==e[n])return!1}return!0}function p(t,e){for(var n=arguments,r=n[0],o=1,i=n.length;o=0&&r","'":"'"," ":" "};return t.replace(/&|<|>|"|'| /g,function(t){return e[t]?e[t]:t})}function o(t){var e={'"':"quot","&":"amp","<":"lt",">":"gt","'":"#39"};return t.replace(/[<>&"']/g,function(t){return e[t]?"&"+e[t]+";":t})}function i(t){return/[<>&"']/.test(t)}function u(t,e){for(var n,r,o=0,i=t.length,u={};o1}),u=a.keys(u).sort(),n=u.join("")}var s=n(4),a=n(1);t.exports={decodeHTMLEntity:r,encodeHTMLEntity:o,hasEncodableString:i,getDuplicatedChar:u}},function(t,e){"use strict";function n(t,e){function n(){o=u.call(arguments),window.clearTimeout(r),r=window.setTimeout(function(){t.apply(null,o)},e)}var r,o;return e=e||0,n}function r(){return Number(new Date)}function o(t,e){function n(){return c=u.call(arguments),p?(f(c),void(p=!1)):(a=i.timestamp(),o=o||a,s(c),void(a-o>=e&&f(c)))}function r(){p=!0,o=null}var o,s,a,c,p=!0,f=function(e){t.apply(null,e),o=null};return e=e||0,s=i.debounce(f,e),n.reset=r,n}var i={},u=Array.prototype.slice;i.timestamp=r,i.debounce=n,i.throttle=o,t.exports=i},function(t,e,n){"use strict";function r(t){var e=(new Date).getTime();return e-t>c}function o(t,e){var n="https://www.google-analytics.com/collect",o=location.hostname,u="event",s="use",c="TOAST UI "+t+" for "+o+": Statistics",p=window.localStorage.getItem(c);(a.isUndefined(window.tui)||window.tui.usageStatistics!==!1)&&(p&&!r(p)||(window.localStorage.setItem(c,(new Date).getTime()),setTimeout(function(){"interactive"!==document.readyState&&"complete"!==document.readyState||i(n,{v:1,t:u,tid:e,cid:o,dp:o,dh:t,el:t,ec:s})},1e3)))}function i(t,e){var n=s.map(u.keys(e),function(t,n){var r=0===n?"":"&";return r+t+"="+e[t]}).join(""),r=document.createElement("img");return r.src=t+"?"+n,r.style.display="none",document.body.appendChild(r),document.body.removeChild(r),r}var u=n(1),s=n(4),a=n(2),c=6048e5;t.exports={imagePing:i,sendHostname:o}},function(t,e){"use strict";function n(){var t,e,n=window.navigator,o=n.appName.replace(/\s/g,"_"),i=n.userAgent,u=/MSIE\s([0-9]+[.0-9]*)/,s=/Trident.*rv:11\./,a=/Edge\/(\d+)\./,c={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},p={Microsoft_Internet_Explorer:function(){var t=i.match(u);t?(r.msie=!0,r.version=parseFloat(t[1])):r.others=!0},Netscape:function(){var n=!1;if(s.exec(i))r.msie=!0,r.version=11,n=!0;else if(a.exec(i))r.edge=!0,r.version=i.match(a)[1],n=!0;else for(t in c)if(c.hasOwnProperty(t)&&(e=i.match(c[t]),e&&e.length>1)){r[t]=n=!0,r.version=parseFloat(e[1]||0);break}n||(r.others=!0)}},f=p[o];f&&p[o]()}var r={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};window&&window.navigator&&n(),t.exports=r},function(t,e,n){"use strict";function r(){this.openedPopup={},this.closeWithParentPopup={},this.postBridgeUrl=""}var o=n(4),i=n(2),u=n(5),s=n(10),a=n(1),c=0;r.prototype.getPopupList=function(t){var e;return e=i.isExisty(t)?this.openedPopup[t]:this.openedPopup},r.prototype.openPopup=function(t,e){var n,r,o;if(e=a.extend({popupName:"popup_"+c+"_"+Number(new Date),popupOptionStr:"",useReload:!0,closeWithParent:!0,method:"get",param:{}},e||{}),e.method=e.method.toUpperCase(),this.postBridgeUrl=e.postBridgeUrl||this.postBridgeUrl,o="POST"===e.method&&e.param&&s.msie&&11===s.version,!i.isExisty(t))throw new Error("Popup#open() need popup url.");c+=1,e.param&&("GET"===e.method?t=t+(/\?/.test(t)?"&":"?")+this._parameterize(e.param):"POST"===e.method&&(o||(r=this.createForm(t,e.param,e.method,e.popupName),t="about:blank"))),n=this.openedPopup[e.popupName],i.isExisty(n)?n.closed?this.openedPopup[e.popupName]=n=this._open(o,e.param,t,e.popupName,e.popupOptionStr):(e.useReload&&n.location.replace(t),n.focus()):this.openedPopup[e.popupName]=n=this._open(o,e.param,t,e.popupName,e.popupOptionStr),this.closeWithParentPopup[e.popupName]=e.closeWithParent,(!n||n.closed||i.isUndefined(n.closed))&&alert("please enable popup windows for this website"),e.param&&"POST"===e.method&&!o&&(n&&r.submit(),r.parentNode&&r.parentNode.removeChild(r)),window.onunload=u.bind(this.closeAllPopup,this)},r.prototype.close=function(t,e){var n=e||window;t=!!i.isExisty(t)&&t,t&&(window.onunload=null),n.closed||(n.opener=window.location.href,n.close())},r.prototype.closeAllPopup=function(t){var e=i.isExisty(t);o.forEachOwnProperties(this.openedPopup,function(t,n){(e&&this.closeWithParentPopup[n]||!e)&&this.close(!1,t)},this)},r.prototype.focus=function(t){this.getPopupList(t).focus()},r.prototype.parseQuery=function(){var t,e,n={};return t=window.location.search.substr(1),o.forEachArray(t.split("&"),function(t){e=t.split("="),n[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}),n},r.prototype.createForm=function(t,e,n,r,i){var u,s=document.createElement("form");return i=i||document.body,s.method=n||"POST",s.action=t||"",s.target=r||"",s.style.display="none",o.forEachOwnProperties(e,function(t,e){u=document.createElement("input"),u.name=e,u.type="hidden",u.value=t,s.appendChild(u)}),i.appendChild(s),s},r.prototype._parameterize=function(t){var e=[];return o.forEachOwnProperties(t,function(t,n){e.push(encodeURIComponent(n)+"="+encodeURIComponent(t))}),e.join("&")},r.prototype._open=function(t,e,n,r,o){var i;return t?(i=window.open(this.postBridgeUrl,r,o),setTimeout(function(){i.redirect(n,e)},100)):i=window.open(n,r,o),i},t.exports=new r},function(t,e,n){"use strict";function r(t,e,n){var r,o,i,u;return t=Number(t),e=Number(e),n=Number(n),r=t>-1&&t<100||t>1969&&t<2070,o=e>0&&e<13,!(!r||!o)&&(u=c[e],2===e&&t%4===0&&(t%100===0&&t%400!==0||(u=29)),i=n>0&&n<=u)}function o(t,e,n){var o,a,c,f=u.pick(n,"meridiemSet","AM")||"AM",h=u.pick(n,"meridiemSet","PM")||"PM";return a=i.isDate(e)?{year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate(),hour:e.getHours(),minute:e.getMinutes()}:{year:e.year,month:e.month,date:e.date,hour:e.hour,minute:e.minute},!!r(a.year,a.month,a.date)&&(a.meridiem="",/([^\\]|^)[aA]\b/.test(t)&&(o=a.hour>11?h:f,a.hour>12&&(a.hour%=12),0===a.hour&&(a.hour=12),a.meridiem=o),c=t.replace(s,function(t){return t.indexOf("\\")>-1?t.replace(/\\/,""):p[t](a)||""}))}var i=n(2),u=n(1),s=/[\\]*YYYY|[\\]*YY|[\\]*MMMM|[\\]*MMM|[\\]*MM|[\\]*M|[\\]*DD|[\\]*D|[\\]*HH|[\\]*H|[\\]*A/gi,a=["Invalid month","January","February","March","April","May","June","July","August","September","October","November","December"],c=[0,31,28,31,30,31,30,31,31,30,31,30,31],p={M:function(t){return Number(t.month)},MM:function(t){var e=t.month;return Number(e)<10?"0"+e:e},MMM:function(t){return a[Number(t.month)].substr(0,3)},MMMM:function(t){return a[Number(t.month)]},D:function(t){return Number(t.date)},d:function(t){return p.D(t)},DD:function(t){var e=t.date;return Number(e)<10?"0"+e:e},dd:function(t){return p.DD(t)},YY:function(t){return Number(t.year)%100},yy:function(t){return p.YY(t)},YYYY:function(t){var e="20",n=t.year;return n>69&&n<100&&(e="19"),Number(n)<100?e+String(n):n},yyyy:function(t){return p.YYYY(t)},A:function(t){return t.meridiem},a:function(t){return t.meridiem},hh:function(t){var e=t.hour;return Number(e)<10?"0"+e:e},HH:function(t){return p.hh(t)},h:function(t){return String(Number(t.hour))},H:function(t){return p.h(t)},m:function(t){return String(Number(t.minute))},mm:function(t){var e=t.minute;return Number(e)<10?"0"+e:e}};t.exports=o},function(t,e,n){"use strict";function r(t,e){var n;return e||(e=t,t=null),n=e.init||function(){},t&&o(n,t),e.hasOwnProperty("static")&&(i(n,e["static"]),delete e["static"]),i(n.prototype,e),n}var o=n(6).inherit,i=n(1).extend;t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=e||{};return i.isFunction(n[u])&&n[u](),o(t,n)}var o=n(15),i=n(2),u="initialize";t.exports=r},function(t,e,n){"use strict";function r(t,e,n){var r,u,s,a;return r=t.split("."),r.unshift(window),u=o.reduce(r,function(t,e){return t[e]=t[e]||{},t[e]}),n?(a=r.pop(),s=i.pick.apply(null,r),u=s[a]=e):i.extend(u,e),u}var o=n(4),i=n(1);t.exports=r},function(t,e,n){"use strict";function r(){this.events=null,this.contexts=null}var o=n(4),i=n(2),u=n(1),s=/\s+/g;r.mixin=function(t){u.extend(t.prototype,r.prototype)},r.prototype._getHandlerItem=function(t,e){var n={handler:t};return e&&(n.context=e),n},r.prototype._safeEvent=function(t){var e,n=this.events;return n||(n=this.events={}),t&&(e=n[t],e||(e=[],n[t]=e),n=e),n},r.prototype._safeContext=function(){var t=this.contexts;return t||(t=this.contexts=[]),t},r.prototype._indexOfContext=function(t){for(var e=this._safeContext(),n=0;e[n];){if(t===e[n][0])return n;n+=1}return-1},r.prototype._memorizeContext=function(t){var e,n;i.isExisty(t)&&(e=this._safeContext(),n=this._indexOfContext(t),n>-1?e[n][1]+=1:e.push([t,1]))},r.prototype._forgetContext=function(t){var e,n;i.isExisty(t)&&(e=this._safeContext(),n=this._indexOfContext(t),n>-1&&(e[n][1]-=1,e[n][1]<=0&&e.splice(n,1)))},r.prototype._bindEvent=function(t,e,n){var r=this._safeEvent(t);this._memorizeContext(n),r.push(this._getHandlerItem(e,n))},r.prototype.on=function(t,e,n){var r=this;i.isString(t)?(t=t.split(s),o.forEach(t,function(t){r._bindEvent(t,e,n)})):i.isObject(t)&&(n=e,o.forEach(t,function(t,e){r.on(e,t,n)}))},r.prototype.once=function(t,e,n){function r(){e.apply(n,arguments),u.off(t,r,n)}var u=this;return i.isObject(t)?(n=e,void o.forEach(t,function(t,e){u.once(e,t,n)})):void this.on(t,r,n)},r.prototype._spliceMatches=function(t,e){var n,r=0;if(i.isArray(t))for(n=t.length;r0},r.prototype.getListenerLength=function(t){var e=this._safeEvent(t);return e.length},t.exports=r},function(t,e,n){"use strict";function r(t){t&&this.set.apply(this,arguments)}var o=n(4),i=n(2),u=function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}(),s=0;r.prototype.set=function(t){var e=this;i.isArray(t)||(t=o.toArray(arguments)),o.forEach(t,function(t){e._addItem(t)})},r.prototype.getName=function(t){var e,n=this;return o.forEach(this,function(r,o){if(n._isEnumItem(o)&&t===r)return e=o,!1}),e},r.prototype._addItem=function(t){var e;this.hasOwnProperty(t)||(e=this._makeEnumValue(),u?Object.defineProperty(this,t,{enumerable:!0,configurable:!1,writable:!1,value:e}):this[t]=e)},r.prototype._makeEnumValue=function(){var t;return t=s,s+=1,t},r.prototype._isEnumItem=function(t){return i.isNumber(this[t])},t.exports=r},function(t,e,n){"use strict";function r(t){this._map=new i(t),this.size=this._map.size}var o=n(4),i=n(19),u=["get","has","forEach","keys","values","entries"],s=["delete","clear"];o.forEachArray(u,function(t){r.prototype[t]=function(){return this._map[t].apply(this._map,arguments)}}),o.forEachArray(s,function(t){r.prototype[t]=function(){var e=this._map[t].apply(this._map,arguments);return this.size=this._map.size,e}}),r.prototype.set=function(){return this._map.set.apply(this._map,arguments),this.size=this._map.size,this},r.prototype.setObject=function(t){o.forEachOwnProperties(t,function(t,e){this.set(e,t)},this)},r.prototype.deleteByKeys=function(t){o.forEachArray(t,function(t){this["delete"](t)},this)},r.prototype.merge=function(t){t.forEach(function(t,e){this.set(e,t)},this)},r.prototype.filter=function(t){var e=new r;return this.forEach(function(n,r){t(n,r)&&e.set(r,n)}),e},t.exports=r},function(t,e,n){"use strict";function r(t,e){this._keys=t,this._valueGetter=e,this._length=this._keys.length,this._index=-1,this._done=!1}function o(t){this._valuesForString={},this._valuesForIndex={},this._keys=[],t&&this._setInitData(t),this.size=0}var i=n(4),u=n(2),s=n(3),a=n(10),c=n(5),p={},f={};r.prototype.next=function(){var t={};do this._index+=1;while(u.isUndefined(this._keys[this._index])&&this._index=this._length?t.done=!0:(t.done=!1,t.value=this._valueGetter(this._keys[this._index],this._index)),t},o.prototype._setInitData=function(t){if(!u.isArray(t))throw new Error("Only Array is supported.");i.forEachArray(t,function(t){this.set(t[0],t[1])},this)},o.prototype._isNaN=function(t){return"number"==typeof t&&t!==t},o.prototype._getKeyIndex=function(t){var e,n=-1;return u.isString(t)?(e=this._valuesForString[t],e&&(n=e.keyIndex)):n=s.inArray(t,this._keys),n},o.prototype._getOriginKey=function(t){var e=t;return t===p?e=void 0:t===f&&(e=NaN),e},o.prototype._getUniqueKey=function(t){var e=t;return u.isUndefined(t)?e=p:this._isNaN(t)&&(e=f),e},o.prototype._getValueObject=function(t,e){return u.isString(t)?this._valuesForString[t]:(u.isUndefined(e)&&(e=this._getKeyIndex(t)),e>=0?this._valuesForIndex[e]:void 0)},o.prototype._getOriginValue=function(t,e){return this._getValueObject(t,e).origin},o.prototype._getKeyValuePair=function(t,e){return[this._getOriginKey(t),this._getOriginValue(t,e)]},o.prototype._createValueObject=function(t,e){return{keyIndex:e,origin:t}},o.prototype.set=function(t,e){var n,r=this._getUniqueKey(t),o=this._getKeyIndex(r);return o<0&&(o=this._keys.push(r)-1,this.size+=1),n=this._createValueObject(e,o),u.isString(t)?this._valuesForString[t]=n:this._valuesForIndex[o]=n,this},o.prototype.get=function(t){var e=this._getUniqueKey(t),n=this._getValueObject(e);return n&&n.origin},o.prototype.keys=function(){return new r(this._keys,c.bind(this._getOriginKey,this))},o.prototype.values=function(){return new r(this._keys,c.bind(this._getOriginValue,this))},o.prototype.entries=function(){return new r(this._keys,c.bind(this._getKeyValuePair,this))},o.prototype.has=function(t){return!!this._getValueObject(t)},o.prototype["delete"]=function(t){var e;u.isString(t)?this._valuesForString[t]&&(e=this._valuesForString[t].keyIndex,delete this._valuesForString[t]):(e=this._getKeyIndex(t),e>=0&&delete this._valuesForIndex[e]),e>=0&&(delete this._keys[e],this.size-=1)},o.prototype.forEach=function(t,e){e=e||this,i.forEachArray(this._keys,function(n){u.isUndefined(n)||t.call(e,this._getValueObject(n).origin,n,this)},this)},o.prototype.clear=function(){o.call(this)},function(){window.Map&&(a.firefox&&a.version>=37||a.chrome&&a.version>=42)&&(o=window.Map)}(),t.exports=o},function(t,e,n){"use strict";function r(t){this.length=0,t&&this.setObject(t)}var o=n(4),i=n(2),u="å";r.prototype.set=function(t,e){2===arguments.length?this.setKeyValue(t,e):this.setObject(t)},r.prototype.setKeyValue=function(t,e){this.has(t)||(this.length+=1),this[this.encodeKey(t)]=e},r.prototype.setObject=function(t){var e=this;o.forEachOwnProperties(t,function(t,n){e.setKeyValue(n,t)})},r.prototype.merge=function(t){var e=this;t.each(function(t,n){e.setKeyValue(n,t)})},r.prototype.encodeKey=function(t){return u+t},r.prototype.decodeKey=function(t){var e=t.split(u);return e[e.length-1]},r.prototype.get=function(t){return this[this.encodeKey(t)]},r.prototype.has=function(t){return this.hasOwnProperty(this.encodeKey(t))},r.prototype.remove=function(t){return arguments.length>1&&(t=o.toArray(arguments)),i.isArray(t)?this.removeByKeyArray(t):this.removeByKey(t)},r.prototype.removeByKey=function(t){var e=this.has(t)?this.get(t):null;return null!==e&&(delete this[this.encodeKey(t)],this.length-=1),e},r.prototype.removeByKeyArray=function(t){var e=[],n=this;return o.forEach(t,function(t){e.push(n.removeByKey(t))}),e},r.prototype.removeAll=function(){var t=this;this.each(function(e,n){t.remove(n)})},r.prototype.each=function(t){var e,n=this;o.forEachOwnProperties(this,function(r,o){if(o.charAt(0)===u&&(e=t(r,n.decodeKey(o))),e===!1)return e})},r.prototype.keys=function(){var t=[],e=this;return this.each(function(n,r){t.push(e.decodeKey(r))}),t},r.prototype.find=function(t){var e=[];return this.each(function(n,r){t(n,r)&&e.push(n)}),e},r.prototype.toArray=function(){var t=[];return this.each(function(e){t.push(e)}),t},t.exports=r}])}); \ No newline at end of file