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AOyhG,SAAW,KACd7B,IAAWA,EAAO,EAEtB5/F,OAAO0hG,YAAc,KACjB/B,IAAcA,EAAU,EAE5B3/F,OAAO2hG,UAAa9B,IAChBsB,GAAOtB,CAAM","sources":["webpack://field-frontend/./node_modules/@fullcalendar/core/locales/de.js","webpack://field-frontend/webpack/bootstrap","webpack://field-frontend/./src/modules/modal.js","webpack://field-frontend/./node_modules/tslib/tslib.es6.js","webpack://field-frontend/./node_modules/preact/dist/preact.module.js","webpack://field-frontend/./node_modules/preact/hooks/dist/hooks.module.js","webpack://field-frontend/./node_modules/preact/compat/dist/compat.module.js","webpack://field-frontend/./node_modules/@fullcalendar/core/vdom.js","webpack://field-frontend/./node_modules/@fullcalendar/common/vdom.js","webpack://field-frontend/./node_modules/@fullcalendar/common/main.js","webpack://field-frontend/./node_modules/@fullcalendar/core/main.js","webpack://field-frontend/./node_modules/@fullcalendar/premium-common/main.js","webpack://field-frontend/./node_modules/@fullcalendar/scrollgrid/main.js","webpack://field-frontend/./node_modules/@fullcalendar/timeline/main.js","webpack://field-frontend/./node_modules/@fullcalendar/resource-common/main.js","webpack://field-frontend/./node_modules/@fullcalendar/resource-timeline/main.js","webpack://field-frontend/./src/modules/calendar.js","webpack://field-frontend/./src/main.js","webpack://field-frontend/./src/modules/api.js"],"sourcesContent":["'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction affix(buttonText) {\n return buttonText === \"Tag\" || buttonText === \"Monat\" ? \"r\" : buttonText === \"Jahr\" ? \"s\" : \"\";\n}\nvar de = {\n code: \"de\",\n week: {\n dow: 1,\n doy: 4\n },\n buttonText: {\n prev: \"Zur\\xFCck\",\n next: \"Vor\",\n today: \"Heute\",\n year: \"Jahr\",\n month: \"Monat\",\n week: \"Woche\",\n day: \"Tag\",\n list: \"Termin\\xFCbersicht\"\n },\n weekText: \"KW\",\n weekTextLong: \"Woche\",\n allDayText: \"Ganzt\\xE4gig\",\n moreLinkText: function(n) {\n return \"+ weitere \" + n;\n },\n noEventsText: \"Keine Ereignisse anzuzeigen\",\n buttonHints: {\n prev: function(buttonText) {\n return \"Vorherige\".concat(affix(buttonText), \" \").concat(buttonText);\n },\n next: function(buttonText) {\n return \"N\\xE4chste\".concat(affix(buttonText), \" \").concat(buttonText);\n },\n today: function(buttonText) {\n if (buttonText === \"Tag\") {\n return \"Heute\";\n }\n return \"Diese\".concat(affix(buttonText), \" \").concat(buttonText);\n }\n },\n viewHint: function(buttonText) {\n var glue = buttonText === \"Woche\" ? \"n\" : buttonText === \"Monat\" ? \"s\" : \"es\";\n return buttonText + glue + \"ansicht\";\n },\n navLinkHint: \"Gehe zu $0\",\n moreLinkHint: function(eventCnt) {\n return \"Zeige \" + (eventCnt === 1 ? \"ein weiteres Ereignis\" : eventCnt + \" weitere Ereignisse\");\n },\n closeHint: \"Schlie\\xDFen\",\n timeHint: \"Uhrzeit\",\n eventHint: \"Ereignis\"\n};\n\nexports.default = de;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","class Modal {\r\n _domId = '';\r\n _instance = '';\r\n _domInstance = null;\r\n _options = {}\r\n _info = {}\r\n\r\n /**\r\n * \r\n * @param {object} props \r\n * @param {string} props.domId\r\n * @param {object} props.options\r\n */\r\n constructor(props) {\r\n this._domId = props.domId || ''\r\n this._options = props.options || {}\r\n this._domInstance = document.getElementById(this._domId);\r\n this.init();\r\n }\r\n init = () => {\r\n try {\r\n this._instance = new bootstrap.Modal(this._domInstance, this._options);\r\n this._domInstance.addEventListener('hide.bs.modal', this.onClose)\r\n this._domInstance.addEventListener('show.bs.modal', this.onOpen)\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n\r\n onOpen = (event) => {\r\n }\r\n onClose = (event) => {\r\n\r\n }\r\n onSubmit = async (info) => {\r\n const data = {\r\n resourceId: info.resource.id,\r\n start: info.date,\r\n end: info.date,\r\n }\r\n this.postData(data).then(() => {\r\n\r\n //TODO: close dialog \r\n\r\n })\r\n\r\n\r\n }\r\n\r\n\r\n open = (info) => {\r\n try {\r\n\r\n this._info = info;\r\n // console.log(\"info:\");\r\n var startDate = document.getElementById(this._options.startId)\r\n var startHour = document.getElementById(this._options.startHourId)\r\n var dialogFields = document.getElementById(this._options.fieldsId)\r\n document.getElementById(\"DialogField3\").value = info.booking.createdBy.userName\r\n\r\n // console.log(info);\r\n // console.log(info.jsEvent);\r\n // console.log(info.jsEvent.type);\r\n\r\n\r\n\r\n if (info.jsEvent.type == 'mouseup') {\r\n // console.log(\"no\");\r\n var date = info.dateStr.split(\"T\")\r\n var fieldName = info.resource.id\r\n startDate.value = date[0]\r\n startHour.value = (date[1].split(\":00Z\")[0]).toString()\r\n // console.log(date)\r\n\r\n dialogFields.value = fieldName\r\n\r\n } else if (info.jsEvent.type == 'click') {\r\n // console.log(\"yes\");\r\n\r\n //info.event.id\r\n // console.log(info.event.start)\r\n var date = info.event.start.toISOString().split(\"T\")\r\n var fieldName = info.event._def.resourceIds[0]\r\n\r\n startDate.value = date[0]\r\n startHour.value = (date[1].split(\":00.000Z\")[0]).toString()\r\n dialogFields.value = fieldName\r\n // console.log(date)\r\n document.getElementById(\"hiddenId\").value = info.event.id\r\n var event = new Event('change');\r\n document.getElementById(\"hiddenId\").dispatchEvent(event);\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n try {\r\n var event = new Event('change');\r\n startHour.dispatchEvent(event);\r\n startDate.dispatchEvent(event);\r\n dialogFields.dispatchEvent(event);\r\n } catch (e) {\r\n console.error(e);\r\n\r\n }\r\n this._instance.show()\r\n }\r\n close = () => {\r\n\r\n this._instance.hide()\r\n\r\n\r\n\r\n\r\n }\r\n postData = async (data) => {\r\n\r\n (async () => {\r\n const rawResponse = await fetch('/api/Bookings', {\r\n method: 'POST',\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(data)\r\n });\r\n const content = await rawResponse.json();\r\n // this.refetchEvents();\r\n window.location.reload();\r\n })();\r\n\r\n\r\n }\r\n}\r\nexport { Modal }","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","var n,l,u,i,t,o,r,f={},e=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a(n){var l=n.parentNode;l&&l.removeChild(n)}function h(l,u,i){var t,o,r,f={};for(r in u)\"key\"==r?t=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v(l,f,t,o,null)}function v(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function y(){return{current:null}}function p(n){return n.children}function d(n,l){this.props=n,this.context=l}function _(n,l){if(null==l)return n.__?_(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l0?v(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y2&&(f.children=arguments.length>3?n.call(arguments,2):i),v(l.type,f,t||l.key,o||l.ref,null)}function B(n,l){var u={__c:l=\"__cC\"+r++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(b)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=e.slice,l={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},d.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s({},this.state),\"function\"==typeof n&&(n=n(s({},u),this.props)),n&&s(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),b(this))},d.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b(this))},d.prototype.render=p,t=[],g.__r=0,r=0;export{d as Component,p as Fragment,q as cloneElement,B as createContext,h as createElement,y as createRef,h,S as hydrate,i as isValidElement,l as options,P as render,x as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","import{options as n}from\"preact\";var t,r,u,i,o=0,f=[],c=[],e=n.__b,a=n.__r,v=n.diffed,l=n.__c,m=n.unmount;function d(t,u){n.__h&&n.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function p(n){return o=1,y(B,n)}function y(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){r.u=!0;var f=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return!n.__N}))return!f||f.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!f||f.call(this,n,t,r))}}return o.__N||o.__}function h(u,i){var o=d(t++,3);!n.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o))}function s(u,i){var o=d(t++,4);!n.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__h.push(o))}function _(n){return o=5,F(function(){return{current:n}},[])}function A(n,t,r){o=6,s(function(){return\"function\"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function F(n,r){var u=d(t++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T(n,t){return o=8,F(function(){return n},t)}function q(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function x(t,r){n.useDebugValue&&n.useDebugValue(r?r(t):t)}function P(n){var u=d(t++,10),i=p();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function V(){var n=d(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[]}catch(r){t.__H.__h=[],n.__e(r,t.__v)}}n.__b=function(n){r=null,e&&e(n)},n.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[])),u=r},n.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===n.requestAnimationFrame||((i=n.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c})),u=r=null},n.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return!n.__||w(n)})}catch(u){r.some(function(n){n.__h&&(n.__h=[])}),r=[],n.__e(u,t.__v)}}),l&&l(t,r)},n.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n)}catch(n){r=n}}),u.__H=void 0,r&&n.__e(r,u.__v))};var g=\"function\"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r))}function k(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function w(n){var t=r;n.__c=n.__(),r=t}function z(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B(n,t){return\"function\"==typeof t?t(n):t}export{T as useCallback,q as useContext,x as useDebugValue,h as useEffect,P as useErrorBoundary,V as useId,A as useImperativeHandle,s as useLayoutEffect,F as useMemo,y as useReducer,_ as useRef,p as useState};\n//# sourceMappingURL=hooks.module.js.map\n","import{Component as n,createElement as t,options as e,toChildArray as r,Fragment as u,render as o,hydrate as i,createContext as l,createRef as c,cloneElement as f}from\"preact\";export{Component,Fragment,createContext,createElement,createRef}from\"preact\";import{useState as a,useId as s,useReducer as h,useEffect as v,useLayoutEffect as d,useRef as p,useImperativeHandle as m,useMemo as y,useCallback as _,useContext as b,useDebugValue as S}from\"preact/hooks\";export*from\"preact/hooks\";function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if(\"__source\"!==e&&!(e in t))return!0;for(var r in t)if(\"__source\"!==r&&n[r]!==t[r])return!0;return!1}function E(n,t){return n===t&&(0!==n||1/n==1/t)||n!=n&&t!=t}function w(n){this.props=n}function R(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return!r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:C(this.props,n)}function u(e){return this.shouldComponentUpdate=r,t(n,e)}return u.displayName=\"Memo(\"+(n.displayName||n.name)+\")\",u.prototype.isReactComponent=!0,u.__f=!0,u}(w.prototype=new n).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var x=e.__b;e.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),x&&x(n)};var N=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.forward_ref\")||3911;function k(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=N,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName=\"ForwardRef(\"+(n.displayName||n.name)+\")\",t}var A=function(n,t){return null==n?null:r(r(n).map(t))},O={map:A,forEach:A,count:function(n){return n?r(n).length:0},only:function(n){var t=r(n);if(1!==t.length)throw\"Children.only\";return t[0]},toArray:r},T=e.__e;e.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r)};var I=e.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){\"function\"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function M(n){var e,r,u;function o(o){if(e||(e=n()).then(function(n){r=n.default||n},function(n){u=n}),u)throw u;if(!r)throw e;return t(r,o)}return o.displayName=\"Lazy\",o.__f=!0,o}function V(){this.u=null,this.o=null}e.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n)},(D.prototype=new n).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l())};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},D.prototype.componentWillUnmount=function(){this.t=[]},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement(\"div\"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P)}this.__b=null}var i=e.__a&&t(u,null,n.fallback);return i&&(i.__h=null),[t(u,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&(\"t\"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]>>1,1),e.i.removeChild(n)}}),o(t(P,{context:e.context},n.__v),e.l)):e.l&&e.componentWillUnmount()}function j(n,e){var r=t($,{__v:n,i:e});return r.containerInfo=e,r}(V.prototype=new n).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u()};e?e(o):o()}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=r(n.children);n.revealOrder&&\"b\"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t)})};var z=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.element\")||60103,B=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,H=\"undefined\"!=typeof document,Z=function(n){return(\"undefined\"!=typeof Symbol&&\"symbol\"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function Y(n,t,e){return null==t.__k&&(t.textContent=\"\"),o(n,t),\"function\"==typeof e&&e(),n?n.__c:null}function q(n,t,e){return i(n,t),\"function\"==typeof e&&e(),n?n.__c:null}n.prototype.isReactComponent={},[\"componentWillMount\",\"componentWillReceiveProps\",\"componentWillUpdate\"].forEach(function(t){Object.defineProperty(n.prototype,t,{configurable:!0,get:function(){return this[\"UNSAFE_\"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})});var G=e.event;function J(){}function K(){return this.cancelBubble}function Q(){return this.defaultPrevented}e.event=function(n){return G&&(n=G(n)),n.persist=J,n.isPropagationStopped=K,n.isDefaultPrevented=Q,n.nativeEvent=n};var X,nn={configurable:!0,get:function(){return this.class}},tn=e.vnode;e.vnode=function(n){var t=n.type,e=n.props,u=e;if(\"string\"==typeof t){var o=-1===t.indexOf(\"-\");for(var i in u={},e){var l=e[i];H&&\"children\"===i&&\"noscript\"===t||\"value\"===i&&\"defaultValue\"in e&&null==l||(\"defaultValue\"===i&&\"value\"in e&&null==e.value?i=\"value\":\"download\"===i&&!0===l?l=\"\":/ondoubleclick/i.test(i)?i=\"ondblclick\":/^onchange(textarea|input)/i.test(i+t)&&!Z(e.type)?i=\"oninput\":/^onfocus$/i.test(i)?i=\"onfocusin\":/^onblur$/i.test(i)?i=\"onfocusout\":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&B.test(i)?i=i.replace(/[A-Z0-9]/g,\"-$&\").toLowerCase():null===l&&(l=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),u[i]&&(i=\"oninputCapture\")),u[i]=l)}\"select\"==t&&u.multiple&&Array.isArray(u.value)&&(u.value=r(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),\"select\"==t&&null!=u.defaultValue&&(u.value=r(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value})),n.props=u,e.class!=e.className&&(nn.enumerable=\"className\"in e,null!=e.className&&(u.class=e.className),Object.defineProperty(u,\"className\",nn))}n.$$typeof=z,tn&&tn(n)};var en=e.__r;e.__r=function(n){en&&en(n),X=n.__c};var rn={ReactCurrentDispatcher:{current:{readContext:function(n){return X.__n[n.__c].props.value}}}},un=\"17.0.2\";function on(n){return t.bind(null,n)}function ln(n){return!!n&&n.$$typeof===z}function cn(n){return ln(n)?f.apply(null,arguments):n}function fn(n){return!!n.__k&&(o(null,n),!0)}function an(n){return n&&(n.base||1===n.nodeType&&n)||null}var sn=function(n,t){return n(t)},hn=function(n,t){return n(t)},vn=u;function dn(n){n()}function pn(n){return n}function mn(){return[!1,dn]}var yn=d;function _n(n,t){var e=t(),r=a({h:{__:e,v:t}}),u=r[0].h,o=r[1];return d(function(){u.__=e,u.v=t,E(u.__,t())||o({h:u})},[n,e,t]),v(function(){return E(u.__,u.v())||o({h:u}),n(function(){E(u.__,u.v())||o({h:u})})},[n]),e}var bn={useState:a,useId:s,useReducer:h,useEffect:v,useLayoutEffect:d,useInsertionEffect:yn,useTransition:mn,useDeferredValue:pn,useSyncExternalStore:_n,startTransition:dn,useRef:p,useImperativeHandle:m,useMemo:y,useCallback:_,useContext:b,useDebugValue:S,version:\"17.0.2\",Children:O,render:Y,hydrate:q,unmountComponentAtNode:fn,createPortal:j,createElement:t,createContext:l,createFactory:on,cloneElement:cn,createRef:c,Fragment:u,isValidElement:ln,findDOMNode:an,Component:n,PureComponent:w,memo:R,forwardRef:k,flushSync:hn,unstable_batchedUpdates:sn,StrictMode:vn,Suspense:D,SuspenseList:V,lazy:M,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:rn};export{O as Children,w as PureComponent,vn as StrictMode,D as Suspense,V as SuspenseList,rn as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,cn as cloneElement,on as createFactory,j as createPortal,bn as default,an as findDOMNode,hn as flushSync,k as forwardRef,q as hydrate,ln as isValidElement,M as lazy,R as memo,Y as render,dn as startTransition,fn as unmountComponentAtNode,sn as unstable_batchedUpdates,pn as useDeferredValue,yn as useInsertionEffect,_n as useSyncExternalStore,mn as useTransition,un as version};\n//# sourceMappingURL=compat.module.js.map\n","import { __extends } from 'tslib';\nimport * as preact from 'preact';\nimport * as preactCompat from 'preact/compat';\n\nvar globalObj = typeof globalThis !== 'undefined' ? globalThis : window; // // TODO: streamline when killing IE11 support\nif (globalObj.FullCalendarVDom) {\n console.warn('FullCalendar VDOM already loaded');\n}\nelse {\n globalObj.FullCalendarVDom = {\n Component: preact.Component,\n createElement: preact.createElement,\n render: preact.render,\n createRef: preact.createRef,\n Fragment: preact.Fragment,\n createContext: createContext,\n createPortal: preactCompat.createPortal,\n flushSync: flushSync,\n unmountComponentAtNode: unmountComponentAtNode,\n };\n}\n// HACKS...\n// TODO: lock version\n// TODO: link gh issues\nfunction flushSync(runBeforeFlush) {\n runBeforeFlush();\n var oldDebounceRendering = preact.options.debounceRendering; // orig\n var callbackQ = [];\n function execCallbackSync(callback) {\n callbackQ.push(callback);\n }\n preact.options.debounceRendering = execCallbackSync;\n preact.render(preact.createElement(FakeComponent, {}), document.createElement('div'));\n while (callbackQ.length) {\n callbackQ.shift()();\n }\n preact.options.debounceRendering = oldDebounceRendering;\n}\nvar FakeComponent = /** @class */ (function (_super) {\n __extends(FakeComponent, _super);\n function FakeComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FakeComponent.prototype.render = function () { return preact.createElement('div', {}); };\n FakeComponent.prototype.componentDidMount = function () { this.setState({}); };\n return FakeComponent;\n}(preact.Component));\nfunction createContext(defaultValue) {\n var ContextType = preact.createContext(defaultValue);\n var origProvider = ContextType.Provider;\n ContextType.Provider = function () {\n var _this = this;\n var isNew = !this.getChildContext;\n var children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params\n if (isNew) {\n var subs_1 = [];\n this.shouldComponentUpdate = function (_props) {\n if (_this.props.value !== _props.value) {\n subs_1.forEach(function (c) {\n c.context = _props.value;\n c.forceUpdate();\n });\n }\n };\n this.sub = function (c) {\n subs_1.push(c);\n var old = c.componentWillUnmount;\n c.componentWillUnmount = function () {\n subs_1.splice(subs_1.indexOf(c), 1);\n old && old.call(c);\n };\n };\n }\n return children;\n };\n return ContextType;\n}\nfunction unmountComponentAtNode(node) {\n preact.render(null, node);\n}\n","/// \nif (typeof FullCalendarVDom === 'undefined') {\n throw new Error('Please import the top-level fullcalendar lib before attempting to import a plugin.');\n}\nvar Component = FullCalendarVDom.Component;\nvar createElement = FullCalendarVDom.createElement;\nvar render = FullCalendarVDom.render;\nvar createRef = FullCalendarVDom.createRef;\nvar Fragment = FullCalendarVDom.Fragment;\nvar createContext = FullCalendarVDom.createContext;\nvar createPortal = FullCalendarVDom.createPortal;\nvar flushSync = FullCalendarVDom.flushSync;\nvar unmountComponentAtNode = FullCalendarVDom.unmountComponentAtNode;\n/* eslint-enable */\n\nexport { Component, Fragment, createContext, createElement, createPortal, createRef, flushSync, render, unmountComponentAtNode };\n","/*!\nFullCalendar v5.11.3\nDocs & License: https://fullcalendar.io/\n(c) 2022 Adam Shaw\n*/\nimport './main.css';\n\nimport { __assign, __spreadArray, __extends } from 'tslib';\nimport { createContext, Component, createRef, createElement, Fragment, createPortal } from './vdom.js';\nexport * from './vdom.js';\n\n// no public types yet. when there are, export from:\n// import {} from './api-type-deps'\nvar EventSourceApi = /** @class */ (function () {\n function EventSourceApi(context, internalEventSource) {\n this.context = context;\n this.internalEventSource = internalEventSource;\n }\n EventSourceApi.prototype.remove = function () {\n this.context.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: this.internalEventSource.sourceId,\n });\n };\n EventSourceApi.prototype.refetch = function () {\n this.context.dispatch({\n type: 'FETCH_EVENT_SOURCES',\n sourceIds: [this.internalEventSource.sourceId],\n isRefetch: true,\n });\n };\n Object.defineProperty(EventSourceApi.prototype, \"id\", {\n get: function () {\n return this.internalEventSource.publicId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventSourceApi.prototype, \"url\", {\n get: function () {\n return this.internalEventSource.meta.url;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventSourceApi.prototype, \"format\", {\n get: function () {\n return this.internalEventSource.meta.format; // TODO: bad. not guaranteed\n },\n enumerable: false,\n configurable: true\n });\n return EventSourceApi;\n}());\n\nfunction removeElement(el) {\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n }\n}\n// Querying\n// ----------------------------------------------------------------------------------------------------------------\nfunction elementClosest(el, selector) {\n if (el.closest) {\n return el.closest(selector);\n // really bad fallback for IE\n // from https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\n }\n if (!document.documentElement.contains(el)) {\n return null;\n }\n do {\n if (elementMatches(el, selector)) {\n return el;\n }\n el = (el.parentElement || el.parentNode);\n } while (el !== null && el.nodeType === 1);\n return null;\n}\nfunction elementMatches(el, selector) {\n var method = el.matches || el.matchesSelector || el.msMatchesSelector;\n return method.call(el, selector);\n}\n// accepts multiple subject els\n// returns a real array. good for methods like forEach\n// TODO: accept the document\nfunction findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n for (var i = 0; i < containers.length; i += 1) {\n var matches = containers[i].querySelectorAll(selector);\n for (var j = 0; j < matches.length; j += 1) {\n allMatches.push(matches[j]);\n }\n }\n return allMatches;\n}\n// accepts multiple subject els\n// only queries direct child elements // TODO: rename to findDirectChildren!\nfunction findDirectChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i += 1) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j += 1) {\n var childNode = childNodes[j];\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n}\n// Style\n// ----------------------------------------------------------------------------------------------------------------\nvar PIXEL_PROP_RE = /(top|left|right|bottom|width|height)$/i;\nfunction applyStyle(el, props) {\n for (var propName in props) {\n applyStyleProp(el, propName, props[propName]);\n }\n}\nfunction applyStyleProp(el, name, val) {\n if (val == null) {\n el.style[name] = '';\n }\n else if (typeof val === 'number' && PIXEL_PROP_RE.test(name)) {\n el.style[name] = val + \"px\";\n }\n else {\n el.style[name] = val;\n }\n}\n// Event Handling\n// ----------------------------------------------------------------------------------------------------------------\n// if intercepting bubbled events at the document/window/body level,\n// and want to see originating element (the 'target'), use this util instead\n// of `ev.target` because it goes within web-component boundaries.\nfunction getEventTargetViaRoot(ev) {\n var _a, _b;\n return (_b = (_a = ev.composedPath) === null || _a === void 0 ? void 0 : _a.call(ev)[0]) !== null && _b !== void 0 ? _b : ev.target;\n}\n// Shadow DOM consuderations\n// ----------------------------------------------------------------------------------------------------------------\nfunction getElRoot(el) {\n return el.getRootNode ? el.getRootNode() : document;\n}\n// Unique ID for DOM attribute\nvar guid$1 = 0;\nfunction getUniqueDomId() {\n guid$1 += 1;\n return 'fc-dom-' + guid$1;\n}\n\n// Stops a mouse/touch event from doing it's native browser action\nfunction preventDefault(ev) {\n ev.preventDefault();\n}\n// Event Delegation\n// ----------------------------------------------------------------------------------------------------------------\nfunction buildDelegationHandler(selector, handler) {\n return function (ev) {\n var matchedChild = elementClosest(ev.target, selector);\n if (matchedChild) {\n handler.call(matchedChild, ev, matchedChild);\n }\n };\n}\nfunction listenBySelector(container, eventType, selector, handler) {\n var attachedHandler = buildDelegationHandler(selector, handler);\n container.addEventListener(eventType, attachedHandler);\n return function () {\n container.removeEventListener(eventType, attachedHandler);\n };\n}\nfunction listenToHoverBySelector(container, selector, onMouseEnter, onMouseLeave) {\n var currentMatchedChild;\n return listenBySelector(container, 'mouseover', selector, function (mouseOverEv, matchedChild) {\n if (matchedChild !== currentMatchedChild) {\n currentMatchedChild = matchedChild;\n onMouseEnter(mouseOverEv, matchedChild);\n var realOnMouseLeave_1 = function (mouseLeaveEv) {\n currentMatchedChild = null;\n onMouseLeave(mouseLeaveEv, matchedChild);\n matchedChild.removeEventListener('mouseleave', realOnMouseLeave_1);\n };\n // listen to the next mouseleave, and then unattach\n matchedChild.addEventListener('mouseleave', realOnMouseLeave_1);\n }\n });\n}\n// Animation\n// ----------------------------------------------------------------------------------------------------------------\nvar transitionEventNames = [\n 'webkitTransitionEnd',\n 'otransitionend',\n 'oTransitionEnd',\n 'msTransitionEnd',\n 'transitionend',\n];\n// triggered only when the next single subsequent transition finishes\nfunction whenTransitionDone(el, callback) {\n var realCallback = function (ev) {\n callback(ev);\n transitionEventNames.forEach(function (eventName) {\n el.removeEventListener(eventName, realCallback);\n });\n };\n transitionEventNames.forEach(function (eventName) {\n el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes\n });\n}\n// ARIA workarounds\n// ----------------------------------------------------------------------------------------------------------------\nfunction createAriaClickAttrs(handler) {\n return __assign({ onClick: handler }, createAriaKeyboardAttrs(handler));\n}\nfunction createAriaKeyboardAttrs(handler) {\n return {\n tabIndex: 0,\n onKeyDown: function (ev) {\n if (ev.key === 'Enter' || ev.key === ' ') {\n handler(ev);\n ev.preventDefault(); // if space, don't scroll down page\n }\n },\n };\n}\n\nvar guidNumber = 0;\nfunction guid() {\n guidNumber += 1;\n return String(guidNumber);\n}\n/* FullCalendar-specific DOM Utilities\n----------------------------------------------------------------------------------------------------------------------*/\n// Make the mouse cursor express that an event is not allowed in the current area\nfunction disableCursor() {\n document.body.classList.add('fc-not-allowed');\n}\n// Returns the mouse cursor to its original look\nfunction enableCursor() {\n document.body.classList.remove('fc-not-allowed');\n}\n/* Selection\n----------------------------------------------------------------------------------------------------------------------*/\nfunction preventSelection(el) {\n el.classList.add('fc-unselectable');\n el.addEventListener('selectstart', preventDefault);\n}\nfunction allowSelection(el) {\n el.classList.remove('fc-unselectable');\n el.removeEventListener('selectstart', preventDefault);\n}\n/* Context Menu\n----------------------------------------------------------------------------------------------------------------------*/\nfunction preventContextMenu(el) {\n el.addEventListener('contextmenu', preventDefault);\n}\nfunction allowContextMenu(el) {\n el.removeEventListener('contextmenu', preventDefault);\n}\nfunction parseFieldSpecs(input) {\n var specs = [];\n var tokens = [];\n var i;\n var token;\n if (typeof input === 'string') {\n tokens = input.split(/\\s*,\\s*/);\n }\n else if (typeof input === 'function') {\n tokens = [input];\n }\n else if (Array.isArray(input)) {\n tokens = input;\n }\n for (i = 0; i < tokens.length; i += 1) {\n token = tokens[i];\n if (typeof token === 'string') {\n specs.push(token.charAt(0) === '-' ?\n { field: token.substring(1), order: -1 } :\n { field: token, order: 1 });\n }\n else if (typeof token === 'function') {\n specs.push({ func: token });\n }\n }\n return specs;\n}\nfunction compareByFieldSpecs(obj0, obj1, fieldSpecs) {\n var i;\n var cmp;\n for (i = 0; i < fieldSpecs.length; i += 1) {\n cmp = compareByFieldSpec(obj0, obj1, fieldSpecs[i]);\n if (cmp) {\n return cmp;\n }\n }\n return 0;\n}\nfunction compareByFieldSpec(obj0, obj1, fieldSpec) {\n if (fieldSpec.func) {\n return fieldSpec.func(obj0, obj1);\n }\n return flexibleCompare(obj0[fieldSpec.field], obj1[fieldSpec.field])\n * (fieldSpec.order || 1);\n}\nfunction flexibleCompare(a, b) {\n if (!a && !b) {\n return 0;\n }\n if (b == null) {\n return -1;\n }\n if (a == null) {\n return 1;\n }\n if (typeof a === 'string' || typeof b === 'string') {\n return String(a).localeCompare(String(b));\n }\n return a - b;\n}\n/* String Utilities\n----------------------------------------------------------------------------------------------------------------------*/\nfunction padStart(val, len) {\n var s = String(val);\n return '000'.substr(0, len - s.length) + s;\n}\nfunction formatWithOrdinals(formatter, args, fallbackText) {\n if (typeof formatter === 'function') {\n return formatter.apply(void 0, args);\n }\n if (typeof formatter === 'string') { // non-blank string\n return args.reduce(function (str, arg, index) { return (str.replace('$' + index, arg || '')); }, formatter);\n }\n return fallbackText;\n}\n/* Number Utilities\n----------------------------------------------------------------------------------------------------------------------*/\nfunction compareNumbers(a, b) {\n return a - b;\n}\nfunction isInt(n) {\n return n % 1 === 0;\n}\n/* FC-specific DOM dimension stuff\n----------------------------------------------------------------------------------------------------------------------*/\nfunction computeSmallestCellWidth(cellEl) {\n var allWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-frame');\n var contentWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-cushion');\n if (!allWidthEl) {\n throw new Error('needs fc-scrollgrid-shrink-frame className'); // TODO: use const\n }\n if (!contentWidthEl) {\n throw new Error('needs fc-scrollgrid-shrink-cushion className');\n }\n return cellEl.getBoundingClientRect().width - allWidthEl.getBoundingClientRect().width + // the cell padding+border\n contentWidthEl.getBoundingClientRect().width;\n}\n\nvar DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\n// Adding\nfunction addWeeks(m, n) {\n var a = dateToUtcArray(m);\n a[2] += n * 7;\n return arrayToUtcDate(a);\n}\nfunction addDays(m, n) {\n var a = dateToUtcArray(m);\n a[2] += n;\n return arrayToUtcDate(a);\n}\nfunction addMs(m, n) {\n var a = dateToUtcArray(m);\n a[6] += n;\n return arrayToUtcDate(a);\n}\n// Diffing (all return floats)\n// TODO: why not use ranges?\nfunction diffWeeks(m0, m1) {\n return diffDays(m0, m1) / 7;\n}\nfunction diffDays(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60 * 24);\n}\nfunction diffHours(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60);\n}\nfunction diffMinutes(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60);\n}\nfunction diffSeconds(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / 1000;\n}\nfunction diffDayAndTime(m0, m1) {\n var m0day = startOfDay(m0);\n var m1day = startOfDay(m1);\n return {\n years: 0,\n months: 0,\n days: Math.round(diffDays(m0day, m1day)),\n milliseconds: (m1.valueOf() - m1day.valueOf()) - (m0.valueOf() - m0day.valueOf()),\n };\n}\n// Diffing Whole Units\nfunction diffWholeWeeks(m0, m1) {\n var d = diffWholeDays(m0, m1);\n if (d !== null && d % 7 === 0) {\n return d / 7;\n }\n return null;\n}\nfunction diffWholeDays(m0, m1) {\n if (timeAsMs(m0) === timeAsMs(m1)) {\n return Math.round(diffDays(m0, m1));\n }\n return null;\n}\n// Start-Of\nfunction startOfDay(m) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n ]);\n}\nfunction startOfHour(m) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours(),\n ]);\n}\nfunction startOfMinute(m) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours(),\n m.getUTCMinutes(),\n ]);\n}\nfunction startOfSecond(m) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours(),\n m.getUTCMinutes(),\n m.getUTCSeconds(),\n ]);\n}\n// Week Computation\nfunction weekOfYear(marker, dow, doy) {\n var y = marker.getUTCFullYear();\n var w = weekOfGivenYear(marker, y, dow, doy);\n if (w < 1) {\n return weekOfGivenYear(marker, y - 1, dow, doy);\n }\n var nextW = weekOfGivenYear(marker, y + 1, dow, doy);\n if (nextW >= 1) {\n return Math.min(w, nextW);\n }\n return w;\n}\nfunction weekOfGivenYear(marker, year, dow, doy) {\n var firstWeekStart = arrayToUtcDate([year, 0, 1 + firstWeekOffset(year, dow, doy)]);\n var dayStart = startOfDay(marker);\n var days = Math.round(diffDays(firstWeekStart, dayStart));\n return Math.floor(days / 7) + 1; // zero-indexed\n}\n// start-of-first-week - start-of-year\nfunction firstWeekOffset(year, dow, doy) {\n // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n var fwd = 7 + dow - doy;\n // first-week day local weekday -- which local weekday is fwd\n var fwdlw = (7 + arrayToUtcDate([year, 0, fwd]).getUTCDay() - dow) % 7;\n return -fwdlw + fwd - 1;\n}\n// Array Conversion\nfunction dateToLocalArray(date) {\n return [\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ];\n}\nfunction arrayToLocalDate(a) {\n return new Date(a[0], a[1] || 0, a[2] == null ? 1 : a[2], // day of month\n a[3] || 0, a[4] || 0, a[5] || 0);\n}\nfunction dateToUtcArray(date) {\n return [\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds(),\n ];\n}\nfunction arrayToUtcDate(a) {\n // according to web standards (and Safari), a month index is required.\n // massage if only given a year.\n if (a.length === 1) {\n a = a.concat([0]);\n }\n return new Date(Date.UTC.apply(Date, a));\n}\n// Other Utils\nfunction isValidDate(m) {\n return !isNaN(m.valueOf());\n}\nfunction timeAsMs(m) {\n return m.getUTCHours() * 1000 * 60 * 60 +\n m.getUTCMinutes() * 1000 * 60 +\n m.getUTCSeconds() * 1000 +\n m.getUTCMilliseconds();\n}\n\nfunction createEventInstance(defId, range, forcedStartTzo, forcedEndTzo) {\n return {\n instanceId: guid(),\n defId: defId,\n range: range,\n forcedStartTzo: forcedStartTzo == null ? null : forcedStartTzo,\n forcedEndTzo: forcedEndTzo == null ? null : forcedEndTzo,\n };\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n// Merges an array of objects into a single object.\n// The second argument allows for an array of property names who's object values will be merged together.\nfunction mergeProps(propObjs, complexPropsMap) {\n var dest = {};\n if (complexPropsMap) {\n for (var name_1 in complexPropsMap) {\n var complexObjs = [];\n // collect the trailing object values, stopping when a non-object is discovered\n for (var i = propObjs.length - 1; i >= 0; i -= 1) {\n var val = propObjs[i][name_1];\n if (typeof val === 'object' && val) { // non-null object\n complexObjs.unshift(val);\n }\n else if (val !== undefined) {\n dest[name_1] = val; // if there were no objects, this value will be used\n break;\n }\n }\n // if the trailing values were objects, use the merged value\n if (complexObjs.length) {\n dest[name_1] = mergeProps(complexObjs);\n }\n }\n }\n // copy values into the destination, going from last to first\n for (var i = propObjs.length - 1; i >= 0; i -= 1) {\n var props = propObjs[i];\n for (var name_2 in props) {\n if (!(name_2 in dest)) { // if already assigned by previous props or complex props, don't reassign\n dest[name_2] = props[name_2];\n }\n }\n }\n return dest;\n}\nfunction filterHash(hash, func) {\n var filtered = {};\n for (var key in hash) {\n if (func(hash[key], key)) {\n filtered[key] = hash[key];\n }\n }\n return filtered;\n}\nfunction mapHash(hash, func) {\n var newHash = {};\n for (var key in hash) {\n newHash[key] = func(hash[key], key);\n }\n return newHash;\n}\nfunction arrayToHash(a) {\n var hash = {};\n for (var _i = 0, a_1 = a; _i < a_1.length; _i++) {\n var item = a_1[_i];\n hash[item] = true;\n }\n return hash;\n}\nfunction buildHashFromArray(a, func) {\n var hash = {};\n for (var i = 0; i < a.length; i += 1) {\n var tuple = func(a[i], i);\n hash[tuple[0]] = tuple[1];\n }\n return hash;\n}\nfunction hashValuesToArray(obj) {\n var a = [];\n for (var key in obj) {\n a.push(obj[key]);\n }\n return a;\n}\nfunction isPropsEqual(obj0, obj1) {\n if (obj0 === obj1) {\n return true;\n }\n for (var key in obj0) {\n if (hasOwnProperty.call(obj0, key)) {\n if (!(key in obj1)) {\n return false;\n }\n }\n }\n for (var key in obj1) {\n if (hasOwnProperty.call(obj1, key)) {\n if (obj0[key] !== obj1[key]) {\n return false;\n }\n }\n }\n return true;\n}\nfunction getUnequalProps(obj0, obj1) {\n var keys = [];\n for (var key in obj0) {\n if (hasOwnProperty.call(obj0, key)) {\n if (!(key in obj1)) {\n keys.push(key);\n }\n }\n }\n for (var key in obj1) {\n if (hasOwnProperty.call(obj1, key)) {\n if (obj0[key] !== obj1[key]) {\n keys.push(key);\n }\n }\n }\n return keys;\n}\nfunction compareObjs(oldProps, newProps, equalityFuncs) {\n if (equalityFuncs === void 0) { equalityFuncs = {}; }\n if (oldProps === newProps) {\n return true;\n }\n for (var key in newProps) {\n if (key in oldProps && isObjValsEqual(oldProps[key], newProps[key], equalityFuncs[key])) ;\n else {\n return false;\n }\n }\n // check for props that were omitted in the new\n for (var key in oldProps) {\n if (!(key in newProps)) {\n return false;\n }\n }\n return true;\n}\n/*\nassumed \"true\" equality for handler names like \"onReceiveSomething\"\n*/\nfunction isObjValsEqual(val0, val1, comparator) {\n if (val0 === val1 || comparator === true) {\n return true;\n }\n if (comparator) {\n return comparator(val0, val1);\n }\n return false;\n}\nfunction collectFromHash(hash, startIndex, endIndex, step) {\n if (startIndex === void 0) { startIndex = 0; }\n if (step === void 0) { step = 1; }\n var res = [];\n if (endIndex == null) {\n endIndex = Object.keys(hash).length;\n }\n for (var i = startIndex; i < endIndex; i += step) {\n var val = hash[i];\n if (val !== undefined) { // will disregard undefined for sparse arrays\n res.push(val);\n }\n }\n return res;\n}\n\nfunction parseRecurring(refined, defaultAllDay, dateEnv, recurringTypes) {\n for (var i = 0; i < recurringTypes.length; i += 1) {\n var parsed = recurringTypes[i].parse(refined, dateEnv);\n if (parsed) {\n var allDay = refined.allDay;\n if (allDay == null) {\n allDay = defaultAllDay;\n if (allDay == null) {\n allDay = parsed.allDayGuess;\n if (allDay == null) {\n allDay = false;\n }\n }\n }\n return {\n allDay: allDay,\n duration: parsed.duration,\n typeData: parsed.typeData,\n typeId: i,\n };\n }\n }\n return null;\n}\nfunction expandRecurring(eventStore, framingRange, context) {\n var dateEnv = context.dateEnv, pluginHooks = context.pluginHooks, options = context.options;\n var defs = eventStore.defs, instances = eventStore.instances;\n // remove existing recurring instances\n // TODO: bad. always expand events as a second step\n instances = filterHash(instances, function (instance) { return !defs[instance.defId].recurringDef; });\n for (var defId in defs) {\n var def = defs[defId];\n if (def.recurringDef) {\n var duration = def.recurringDef.duration;\n if (!duration) {\n duration = def.allDay ?\n options.defaultAllDayEventDuration :\n options.defaultTimedEventDuration;\n }\n var starts = expandRecurringRanges(def, duration, framingRange, dateEnv, pluginHooks.recurringTypes);\n for (var _i = 0, starts_1 = starts; _i < starts_1.length; _i++) {\n var start = starts_1[_i];\n var instance = createEventInstance(defId, {\n start: start,\n end: dateEnv.add(start, duration),\n });\n instances[instance.instanceId] = instance;\n }\n }\n }\n return { defs: defs, instances: instances };\n}\n/*\nEvent MUST have a recurringDef\n*/\nfunction expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end,\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n}\n\nvar INTERNAL_UNITS = ['years', 'months', 'days', 'milliseconds'];\nvar PARSE_RE = /^(-?)(?:(\\d+)\\.)?(\\d+):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?/;\n// Parsing and Creation\nfunction createDuration(input, unit) {\n var _a;\n if (typeof input === 'string') {\n return parseString(input);\n }\n if (typeof input === 'object' && input) { // non-null object\n return parseObject(input);\n }\n if (typeof input === 'number') {\n return parseObject((_a = {}, _a[unit || 'milliseconds'] = input, _a));\n }\n return null;\n}\nfunction parseString(s) {\n var m = PARSE_RE.exec(s);\n if (m) {\n var sign = m[1] ? -1 : 1;\n return {\n years: 0,\n months: 0,\n days: sign * (m[2] ? parseInt(m[2], 10) : 0),\n milliseconds: sign * ((m[3] ? parseInt(m[3], 10) : 0) * 60 * 60 * 1000 + // hours\n (m[4] ? parseInt(m[4], 10) : 0) * 60 * 1000 + // minutes\n (m[5] ? parseInt(m[5], 10) : 0) * 1000 + // seconds\n (m[6] ? parseInt(m[6], 10) : 0) // ms\n ),\n };\n }\n return null;\n}\nfunction parseObject(obj) {\n var duration = {\n years: obj.years || obj.year || 0,\n months: obj.months || obj.month || 0,\n days: obj.days || obj.day || 0,\n milliseconds: (obj.hours || obj.hour || 0) * 60 * 60 * 1000 + // hours\n (obj.minutes || obj.minute || 0) * 60 * 1000 + // minutes\n (obj.seconds || obj.second || 0) * 1000 + // seconds\n (obj.milliseconds || obj.millisecond || obj.ms || 0), // ms\n };\n var weeks = obj.weeks || obj.week;\n if (weeks) {\n duration.days += weeks * 7;\n duration.specifiedWeeks = true;\n }\n return duration;\n}\n// Equality\nfunction durationsEqual(d0, d1) {\n return d0.years === d1.years &&\n d0.months === d1.months &&\n d0.days === d1.days &&\n d0.milliseconds === d1.milliseconds;\n}\nfunction asCleanDays(dur) {\n if (!dur.years && !dur.months && !dur.milliseconds) {\n return dur.days;\n }\n return 0;\n}\n// Simple Math\nfunction addDurations(d0, d1) {\n return {\n years: d0.years + d1.years,\n months: d0.months + d1.months,\n days: d0.days + d1.days,\n milliseconds: d0.milliseconds + d1.milliseconds,\n };\n}\nfunction subtractDurations(d1, d0) {\n return {\n years: d1.years - d0.years,\n months: d1.months - d0.months,\n days: d1.days - d0.days,\n milliseconds: d1.milliseconds - d0.milliseconds,\n };\n}\nfunction multiplyDuration(d, n) {\n return {\n years: d.years * n,\n months: d.months * n,\n days: d.days * n,\n milliseconds: d.milliseconds * n,\n };\n}\n// Conversions\n// \"Rough\" because they are based on average-case Gregorian months/years\nfunction asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n}\nfunction asRoughMonths(dur) {\n return asRoughDays(dur) / 30;\n}\nfunction asRoughDays(dur) {\n return asRoughMs(dur) / 864e5;\n}\nfunction asRoughMinutes(dur) {\n return asRoughMs(dur) / (1000 * 60);\n}\nfunction asRoughSeconds(dur) {\n return asRoughMs(dur) / 1000;\n}\nfunction asRoughMs(dur) {\n return dur.years * (365 * 864e5) +\n dur.months * (30 * 864e5) +\n dur.days * 864e5 +\n dur.milliseconds;\n}\n// Advanced Math\nfunction wholeDivideDurations(numerator, denominator) {\n var res = null;\n for (var i = 0; i < INTERNAL_UNITS.length; i += 1) {\n var unit = INTERNAL_UNITS[i];\n if (denominator[unit]) {\n var localRes = numerator[unit] / denominator[unit];\n if (!isInt(localRes) || (res !== null && res !== localRes)) {\n return null;\n }\n res = localRes;\n }\n else if (numerator[unit]) {\n // needs to divide by something but can't!\n return null;\n }\n }\n return res;\n}\nfunction greatestDurationDenominator(dur) {\n var ms = dur.milliseconds;\n if (ms) {\n if (ms % 1000 !== 0) {\n return { unit: 'millisecond', value: ms };\n }\n if (ms % (1000 * 60) !== 0) {\n return { unit: 'second', value: ms / 1000 };\n }\n if (ms % (1000 * 60 * 60) !== 0) {\n return { unit: 'minute', value: ms / (1000 * 60) };\n }\n if (ms) {\n return { unit: 'hour', value: ms / (1000 * 60 * 60) };\n }\n }\n if (dur.days) {\n if (dur.specifiedWeeks && dur.days % 7 === 0) {\n return { unit: 'week', value: dur.days / 7 };\n }\n return { unit: 'day', value: dur.days };\n }\n if (dur.months) {\n return { unit: 'month', value: dur.months };\n }\n if (dur.years) {\n return { unit: 'year', value: dur.years };\n }\n return { unit: 'millisecond', value: 0 };\n}\n\n// timeZoneOffset is in minutes\nfunction buildIsoString(marker, timeZoneOffset, stripZeroTime) {\n if (stripZeroTime === void 0) { stripZeroTime = false; }\n var s = marker.toISOString();\n s = s.replace('.000', '');\n if (stripZeroTime) {\n s = s.replace('T00:00:00Z', '');\n }\n if (s.length > 10) { // time part wasn't stripped, can add timezone info\n if (timeZoneOffset == null) {\n s = s.replace('Z', '');\n }\n else if (timeZoneOffset !== 0) {\n s = s.replace('Z', formatTimeZoneOffset(timeZoneOffset, true));\n }\n // otherwise, its UTC-0 and we want to keep the Z\n }\n return s;\n}\n// formats the date, but with no time part\n// TODO: somehow merge with buildIsoString and stripZeroTime\n// TODO: rename. omit \"string\"\nfunction formatDayString(marker) {\n return marker.toISOString().replace(/T.*$/, '');\n}\n// TODO: use Date::toISOString and use everything after the T?\nfunction formatIsoTimeString(marker) {\n return padStart(marker.getUTCHours(), 2) + ':' +\n padStart(marker.getUTCMinutes(), 2) + ':' +\n padStart(marker.getUTCSeconds(), 2);\n}\nfunction formatTimeZoneOffset(minutes, doIso) {\n if (doIso === void 0) { doIso = false; }\n var sign = minutes < 0 ? '-' : '+';\n var abs = Math.abs(minutes);\n var hours = Math.floor(abs / 60);\n var mins = Math.round(abs % 60);\n if (doIso) {\n return sign + padStart(hours, 2) + \":\" + padStart(mins, 2);\n }\n return \"GMT\" + sign + hours + (mins ? \":\" + padStart(mins, 2) : '');\n}\n\n// TODO: new util arrayify?\nfunction removeExact(array, exactVal) {\n var removeCnt = 0;\n var i = 0;\n while (i < array.length) {\n if (array[i] === exactVal) {\n array.splice(i, 1);\n removeCnt += 1;\n }\n else {\n i += 1;\n }\n }\n return removeCnt;\n}\nfunction isArraysEqual(a0, a1, equalityFunc) {\n if (a0 === a1) {\n return true;\n }\n var len = a0.length;\n var i;\n if (len !== a1.length) { // not array? or not same length?\n return false;\n }\n for (i = 0; i < len; i += 1) {\n if (!(equalityFunc ? equalityFunc(a0[i], a1[i]) : a0[i] === a1[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction memoize(workerFunc, resEquality, teardownFunc) {\n var currentArgs;\n var currentRes;\n return function () {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (!currentArgs) {\n currentRes = workerFunc.apply(this, newArgs);\n }\n else if (!isArraysEqual(currentArgs, newArgs)) {\n if (teardownFunc) {\n teardownFunc(currentRes);\n }\n var res = workerFunc.apply(this, newArgs);\n if (!resEquality || !resEquality(res, currentRes)) {\n currentRes = res;\n }\n }\n currentArgs = newArgs;\n return currentRes;\n };\n}\nfunction memoizeObjArg(workerFunc, resEquality, teardownFunc) {\n var _this = this;\n var currentArg;\n var currentRes;\n return function (newArg) {\n if (!currentArg) {\n currentRes = workerFunc.call(_this, newArg);\n }\n else if (!isPropsEqual(currentArg, newArg)) {\n if (teardownFunc) {\n teardownFunc(currentRes);\n }\n var res = workerFunc.call(_this, newArg);\n if (!resEquality || !resEquality(res, currentRes)) {\n currentRes = res;\n }\n }\n currentArg = newArg;\n return currentRes;\n };\n}\nfunction memoizeArraylike(// used at all?\nworkerFunc, resEquality, teardownFunc) {\n var _this = this;\n var currentArgSets = [];\n var currentResults = [];\n return function (newArgSets) {\n var currentLen = currentArgSets.length;\n var newLen = newArgSets.length;\n var i = 0;\n for (; i < currentLen; i += 1) {\n if (!newArgSets[i]) { // one of the old sets no longer exists\n if (teardownFunc) {\n teardownFunc(currentResults[i]);\n }\n }\n else if (!isArraysEqual(currentArgSets[i], newArgSets[i])) {\n if (teardownFunc) {\n teardownFunc(currentResults[i]);\n }\n var res = workerFunc.apply(_this, newArgSets[i]);\n if (!resEquality || !resEquality(res, currentResults[i])) {\n currentResults[i] = res;\n }\n }\n }\n for (; i < newLen; i += 1) {\n currentResults[i] = workerFunc.apply(_this, newArgSets[i]);\n }\n currentArgSets = newArgSets;\n currentResults.splice(newLen); // remove excess\n return currentResults;\n };\n}\nfunction memoizeHashlike(workerFunc, resEquality, teardownFunc) {\n var _this = this;\n var currentArgHash = {};\n var currentResHash = {};\n return function (newArgHash) {\n var newResHash = {};\n for (var key in newArgHash) {\n if (!currentResHash[key]) {\n newResHash[key] = workerFunc.apply(_this, newArgHash[key]);\n }\n else if (!isArraysEqual(currentArgHash[key], newArgHash[key])) {\n if (teardownFunc) {\n teardownFunc(currentResHash[key]);\n }\n var res = workerFunc.apply(_this, newArgHash[key]);\n newResHash[key] = (resEquality && resEquality(res, currentResHash[key]))\n ? currentResHash[key]\n : res;\n }\n else {\n newResHash[key] = currentResHash[key];\n }\n }\n currentArgHash = newArgHash;\n currentResHash = newResHash;\n return newResHash;\n };\n}\n\nvar EXTENDED_SETTINGS_AND_SEVERITIES = {\n week: 3,\n separator: 0,\n omitZeroMinute: 0,\n meridiem: 0,\n omitCommas: 0,\n};\nvar STANDARD_DATE_PROP_SEVERITIES = {\n timeZoneName: 7,\n era: 6,\n year: 5,\n month: 4,\n day: 2,\n weekday: 2,\n hour: 1,\n minute: 1,\n second: 1,\n};\nvar MERIDIEM_RE = /\\s*([ap])\\.?m\\.?/i; // eats up leading spaces too\nvar COMMA_RE = /,/g; // we need re for globalness\nvar MULTI_SPACE_RE = /\\s+/g;\nvar LTR_RE = /\\u200e/g; // control character\nvar UTC_RE = /UTC|GMT/;\nvar NativeFormatter = /** @class */ (function () {\n function NativeFormatter(formatSettings) {\n var standardDateProps = {};\n var extendedSettings = {};\n var severity = 0;\n for (var name_1 in formatSettings) {\n if (name_1 in EXTENDED_SETTINGS_AND_SEVERITIES) {\n extendedSettings[name_1] = formatSettings[name_1];\n severity = Math.max(EXTENDED_SETTINGS_AND_SEVERITIES[name_1], severity);\n }\n else {\n standardDateProps[name_1] = formatSettings[name_1];\n if (name_1 in STANDARD_DATE_PROP_SEVERITIES) { // TODO: what about hour12? no severity\n severity = Math.max(STANDARD_DATE_PROP_SEVERITIES[name_1], severity);\n }\n }\n }\n this.standardDateProps = standardDateProps;\n this.extendedSettings = extendedSettings;\n this.severity = severity;\n this.buildFormattingFunc = memoize(buildFormattingFunc);\n }\n NativeFormatter.prototype.format = function (date, context) {\n return this.buildFormattingFunc(this.standardDateProps, this.extendedSettings, context)(date);\n };\n NativeFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) {\n var _a = this, standardDateProps = _a.standardDateProps, extendedSettings = _a.extendedSettings;\n var diffSeverity = computeMarkerDiffSeverity(start.marker, end.marker, context.calendarSystem);\n if (!diffSeverity) {\n return this.format(start, context);\n }\n var biggestUnitForPartial = diffSeverity;\n if (biggestUnitForPartial > 1 && // the two dates are different in a way that's larger scale than time\n (standardDateProps.year === 'numeric' || standardDateProps.year === '2-digit') &&\n (standardDateProps.month === 'numeric' || standardDateProps.month === '2-digit') &&\n (standardDateProps.day === 'numeric' || standardDateProps.day === '2-digit')) {\n biggestUnitForPartial = 1; // make it look like the dates are only different in terms of time\n }\n var full0 = this.format(start, context);\n var full1 = this.format(end, context);\n if (full0 === full1) {\n return full0;\n }\n var partialDateProps = computePartialFormattingOptions(standardDateProps, biggestUnitForPartial);\n var partialFormattingFunc = buildFormattingFunc(partialDateProps, extendedSettings, context);\n var partial0 = partialFormattingFunc(start);\n var partial1 = partialFormattingFunc(end);\n var insertion = findCommonInsertion(full0, partial0, full1, partial1);\n var separator = extendedSettings.separator || betterDefaultSeparator || context.defaultSeparator || '';\n if (insertion) {\n return insertion.before + partial0 + separator + partial1 + insertion.after;\n }\n return full0 + separator + full1;\n };\n NativeFormatter.prototype.getLargestUnit = function () {\n switch (this.severity) {\n case 7:\n case 6:\n case 5:\n return 'year';\n case 4:\n return 'month';\n case 3:\n return 'week';\n case 2:\n return 'day';\n default:\n return 'time'; // really?\n }\n };\n return NativeFormatter;\n}());\nfunction buildFormattingFunc(standardDateProps, extendedSettings, context) {\n var standardDatePropCnt = Object.keys(standardDateProps).length;\n if (standardDatePropCnt === 1 && standardDateProps.timeZoneName === 'short') {\n return function (date) { return (formatTimeZoneOffset(date.timeZoneOffset)); };\n }\n if (standardDatePropCnt === 0 && extendedSettings.week) {\n return function (date) { return (formatWeekNumber(context.computeWeekNumber(date.marker), context.weekText, context.weekTextLong, context.locale, extendedSettings.week)); };\n }\n return buildNativeFormattingFunc(standardDateProps, extendedSettings, context);\n}\nfunction buildNativeFormattingFunc(standardDateProps, extendedSettings, context) {\n standardDateProps = __assign({}, standardDateProps); // copy\n extendedSettings = __assign({}, extendedSettings); // copy\n sanitizeSettings(standardDateProps, extendedSettings);\n standardDateProps.timeZone = 'UTC'; // we leverage the only guaranteed timeZone for our UTC markers\n var normalFormat = new Intl.DateTimeFormat(context.locale.codes, standardDateProps);\n var zeroFormat; // needed?\n if (extendedSettings.omitZeroMinute) {\n var zeroProps = __assign({}, standardDateProps);\n delete zeroProps.minute; // seconds and ms were already considered in sanitizeSettings\n zeroFormat = new Intl.DateTimeFormat(context.locale.codes, zeroProps);\n }\n return function (date) {\n var marker = date.marker;\n var format;\n if (zeroFormat && !marker.getUTCMinutes()) {\n format = zeroFormat;\n }\n else {\n format = normalFormat;\n }\n var s = format.format(marker);\n return postProcess(s, date, standardDateProps, extendedSettings, context);\n };\n}\nfunction sanitizeSettings(standardDateProps, extendedSettings) {\n // deal with a browser inconsistency where formatting the timezone\n // requires that the hour/minute be present.\n if (standardDateProps.timeZoneName) {\n if (!standardDateProps.hour) {\n standardDateProps.hour = '2-digit';\n }\n if (!standardDateProps.minute) {\n standardDateProps.minute = '2-digit';\n }\n }\n // only support short timezone names\n if (standardDateProps.timeZoneName === 'long') {\n standardDateProps.timeZoneName = 'short';\n }\n // if requesting to display seconds, MUST display minutes\n if (extendedSettings.omitZeroMinute && (standardDateProps.second || standardDateProps.millisecond)) {\n delete extendedSettings.omitZeroMinute;\n }\n}\nfunction postProcess(s, date, standardDateProps, extendedSettings, context) {\n s = s.replace(LTR_RE, ''); // remove left-to-right control chars. do first. good for other regexes\n if (standardDateProps.timeZoneName === 'short') {\n s = injectTzoStr(s, (context.timeZone === 'UTC' || date.timeZoneOffset == null) ?\n 'UTC' : // important to normalize for IE, which does \"GMT\"\n formatTimeZoneOffset(date.timeZoneOffset));\n }\n if (extendedSettings.omitCommas) {\n s = s.replace(COMMA_RE, '').trim();\n }\n if (extendedSettings.omitZeroMinute) {\n s = s.replace(':00', ''); // zeroFormat doesn't always achieve this\n }\n // ^ do anything that might create adjacent spaces before this point,\n // because MERIDIEM_RE likes to eat up loading spaces\n if (extendedSettings.meridiem === false) {\n s = s.replace(MERIDIEM_RE, '').trim();\n }\n else if (extendedSettings.meridiem === 'narrow') { // a/p\n s = s.replace(MERIDIEM_RE, function (m0, m1) { return m1.toLocaleLowerCase(); });\n }\n else if (extendedSettings.meridiem === 'short') { // am/pm\n s = s.replace(MERIDIEM_RE, function (m0, m1) { return m1.toLocaleLowerCase() + \"m\"; });\n }\n else if (extendedSettings.meridiem === 'lowercase') { // other meridiem transformers already converted to lowercase\n s = s.replace(MERIDIEM_RE, function (m0) { return m0.toLocaleLowerCase(); });\n }\n s = s.replace(MULTI_SPACE_RE, ' ');\n s = s.trim();\n return s;\n}\nfunction injectTzoStr(s, tzoStr) {\n var replaced = false;\n s = s.replace(UTC_RE, function () {\n replaced = true;\n return tzoStr;\n });\n // IE11 doesn't include UTC/GMT in the original string, so append to end\n if (!replaced) {\n s += \" \" + tzoStr;\n }\n return s;\n}\nfunction formatWeekNumber(num, weekText, weekTextLong, locale, display) {\n var parts = [];\n if (display === 'long') {\n parts.push(weekTextLong);\n }\n else if (display === 'short' || display === 'narrow') {\n parts.push(weekText);\n }\n if (display === 'long' || display === 'short') {\n parts.push(' ');\n }\n parts.push(locale.simpleNumberFormat.format(num));\n if (locale.options.direction === 'rtl') { // TODO: use control characters instead?\n parts.reverse();\n }\n return parts.join('');\n}\n// Range Formatting Utils\n// 0 = exactly the same\n// 1 = different by time\n// and bigger\nfunction computeMarkerDiffSeverity(d0, d1, ca) {\n if (ca.getMarkerYear(d0) !== ca.getMarkerYear(d1)) {\n return 5;\n }\n if (ca.getMarkerMonth(d0) !== ca.getMarkerMonth(d1)) {\n return 4;\n }\n if (ca.getMarkerDay(d0) !== ca.getMarkerDay(d1)) {\n return 2;\n }\n if (timeAsMs(d0) !== timeAsMs(d1)) {\n return 1;\n }\n return 0;\n}\nfunction computePartialFormattingOptions(options, biggestUnit) {\n var partialOptions = {};\n for (var name_2 in options) {\n if (!(name_2 in STANDARD_DATE_PROP_SEVERITIES) || // not a date part prop (like timeZone)\n STANDARD_DATE_PROP_SEVERITIES[name_2] <= biggestUnit) {\n partialOptions[name_2] = options[name_2];\n }\n }\n return partialOptions;\n}\nfunction findCommonInsertion(full0, partial0, full1, partial1) {\n var i0 = 0;\n while (i0 < full0.length) {\n var found0 = full0.indexOf(partial0, i0);\n if (found0 === -1) {\n break;\n }\n var before0 = full0.substr(0, found0);\n i0 = found0 + partial0.length;\n var after0 = full0.substr(i0);\n var i1 = 0;\n while (i1 < full1.length) {\n var found1 = full1.indexOf(partial1, i1);\n if (found1 === -1) {\n break;\n }\n var before1 = full1.substr(0, found1);\n i1 = found1 + partial1.length;\n var after1 = full1.substr(i1);\n if (before0 === before1 && after0 === after1) {\n return {\n before: before0,\n after: after0,\n };\n }\n }\n }\n return null;\n}\n\nfunction expandZonedMarker(dateInfo, calendarSystem) {\n var a = calendarSystem.markerToArray(dateInfo.marker);\n return {\n marker: dateInfo.marker,\n timeZoneOffset: dateInfo.timeZoneOffset,\n array: a,\n year: a[0],\n month: a[1],\n day: a[2],\n hour: a[3],\n minute: a[4],\n second: a[5],\n millisecond: a[6],\n };\n}\n\nfunction createVerboseFormattingArg(start, end, context, betterDefaultSeparator) {\n var startInfo = expandZonedMarker(start, context.calendarSystem);\n var endInfo = end ? expandZonedMarker(end, context.calendarSystem) : null;\n return {\n date: startInfo,\n start: startInfo,\n end: endInfo,\n timeZone: context.timeZone,\n localeCodes: context.locale.codes,\n defaultSeparator: betterDefaultSeparator || context.defaultSeparator,\n };\n}\n\n/*\nTODO: fix the terminology of \"formatter\" vs \"formatting func\"\n*/\n/*\nAt the time of instantiation, this object does not know which cmd-formatting system it will use.\nIt receives this at the time of formatting, as a setting.\n*/\nvar CmdFormatter = /** @class */ (function () {\n function CmdFormatter(cmdStr) {\n this.cmdStr = cmdStr;\n }\n CmdFormatter.prototype.format = function (date, context, betterDefaultSeparator) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(date, null, context, betterDefaultSeparator));\n };\n CmdFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(start, end, context, betterDefaultSeparator));\n };\n return CmdFormatter;\n}());\n\nvar FuncFormatter = /** @class */ (function () {\n function FuncFormatter(func) {\n this.func = func;\n }\n FuncFormatter.prototype.format = function (date, context, betterDefaultSeparator) {\n return this.func(createVerboseFormattingArg(date, null, context, betterDefaultSeparator));\n };\n FuncFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) {\n return this.func(createVerboseFormattingArg(start, end, context, betterDefaultSeparator));\n };\n return FuncFormatter;\n}());\n\nfunction createFormatter(input) {\n if (typeof input === 'object' && input) { // non-null object\n return new NativeFormatter(input);\n }\n if (typeof input === 'string') {\n return new CmdFormatter(input);\n }\n if (typeof input === 'function') {\n return new FuncFormatter(input);\n }\n return null;\n}\n\n// base options\n// ------------\nvar BASE_OPTION_REFINERS = {\n navLinkDayClick: identity,\n navLinkWeekClick: identity,\n duration: createDuration,\n bootstrapFontAwesome: identity,\n buttonIcons: identity,\n customButtons: identity,\n defaultAllDayEventDuration: createDuration,\n defaultTimedEventDuration: createDuration,\n nextDayThreshold: createDuration,\n scrollTime: createDuration,\n scrollTimeReset: Boolean,\n slotMinTime: createDuration,\n slotMaxTime: createDuration,\n dayPopoverFormat: createFormatter,\n slotDuration: createDuration,\n snapDuration: createDuration,\n headerToolbar: identity,\n footerToolbar: identity,\n defaultRangeSeparator: String,\n titleRangeSeparator: String,\n forceEventDuration: Boolean,\n dayHeaders: Boolean,\n dayHeaderFormat: createFormatter,\n dayHeaderClassNames: identity,\n dayHeaderContent: identity,\n dayHeaderDidMount: identity,\n dayHeaderWillUnmount: identity,\n dayCellClassNames: identity,\n dayCellContent: identity,\n dayCellDidMount: identity,\n dayCellWillUnmount: identity,\n initialView: String,\n aspectRatio: Number,\n weekends: Boolean,\n weekNumberCalculation: identity,\n weekNumbers: Boolean,\n weekNumberClassNames: identity,\n weekNumberContent: identity,\n weekNumberDidMount: identity,\n weekNumberWillUnmount: identity,\n editable: Boolean,\n viewClassNames: identity,\n viewDidMount: identity,\n viewWillUnmount: identity,\n nowIndicator: Boolean,\n nowIndicatorClassNames: identity,\n nowIndicatorContent: identity,\n nowIndicatorDidMount: identity,\n nowIndicatorWillUnmount: identity,\n showNonCurrentDates: Boolean,\n lazyFetching: Boolean,\n startParam: String,\n endParam: String,\n timeZoneParam: String,\n timeZone: String,\n locales: identity,\n locale: identity,\n themeSystem: String,\n dragRevertDuration: Number,\n dragScroll: Boolean,\n allDayMaintainDuration: Boolean,\n unselectAuto: Boolean,\n dropAccept: identity,\n eventOrder: parseFieldSpecs,\n eventOrderStrict: Boolean,\n handleWindowResize: Boolean,\n windowResizeDelay: Number,\n longPressDelay: Number,\n eventDragMinDistance: Number,\n expandRows: Boolean,\n height: identity,\n contentHeight: identity,\n direction: String,\n weekNumberFormat: createFormatter,\n eventResizableFromStart: Boolean,\n displayEventTime: Boolean,\n displayEventEnd: Boolean,\n weekText: String,\n weekTextLong: String,\n progressiveEventRendering: Boolean,\n businessHours: identity,\n initialDate: identity,\n now: identity,\n eventDataTransform: identity,\n stickyHeaderDates: identity,\n stickyFooterScrollbar: identity,\n viewHeight: identity,\n defaultAllDay: Boolean,\n eventSourceFailure: identity,\n eventSourceSuccess: identity,\n eventDisplay: String,\n eventStartEditable: Boolean,\n eventDurationEditable: Boolean,\n eventOverlap: identity,\n eventConstraint: identity,\n eventAllow: identity,\n eventBackgroundColor: String,\n eventBorderColor: String,\n eventTextColor: String,\n eventColor: String,\n eventClassNames: identity,\n eventContent: identity,\n eventDidMount: identity,\n eventWillUnmount: identity,\n selectConstraint: identity,\n selectOverlap: identity,\n selectAllow: identity,\n droppable: Boolean,\n unselectCancel: String,\n slotLabelFormat: identity,\n slotLaneClassNames: identity,\n slotLaneContent: identity,\n slotLaneDidMount: identity,\n slotLaneWillUnmount: identity,\n slotLabelClassNames: identity,\n slotLabelContent: identity,\n slotLabelDidMount: identity,\n slotLabelWillUnmount: identity,\n dayMaxEvents: identity,\n dayMaxEventRows: identity,\n dayMinWidth: Number,\n slotLabelInterval: createDuration,\n allDayText: String,\n allDayClassNames: identity,\n allDayContent: identity,\n allDayDidMount: identity,\n allDayWillUnmount: identity,\n slotMinWidth: Number,\n navLinks: Boolean,\n eventTimeFormat: createFormatter,\n rerenderDelay: Number,\n moreLinkText: identity,\n moreLinkHint: identity,\n selectMinDistance: Number,\n selectable: Boolean,\n selectLongPressDelay: Number,\n eventLongPressDelay: Number,\n selectMirror: Boolean,\n eventMaxStack: Number,\n eventMinHeight: Number,\n eventMinWidth: Number,\n eventShortHeight: Number,\n slotEventOverlap: Boolean,\n plugins: identity,\n firstDay: Number,\n dayCount: Number,\n dateAlignment: String,\n dateIncrement: createDuration,\n hiddenDays: identity,\n monthMode: Boolean,\n fixedWeekCount: Boolean,\n validRange: identity,\n visibleRange: identity,\n titleFormat: identity,\n eventInteractive: Boolean,\n // only used by list-view, but languages define the value, so we need it in base options\n noEventsText: String,\n viewHint: identity,\n navLinkHint: identity,\n closeHint: String,\n timeHint: String,\n eventHint: String,\n moreLinkClick: identity,\n moreLinkClassNames: identity,\n moreLinkContent: identity,\n moreLinkDidMount: identity,\n moreLinkWillUnmount: identity,\n};\n// do NOT give a type here. need `typeof BASE_OPTION_DEFAULTS` to give real results.\n// raw values.\nvar BASE_OPTION_DEFAULTS = {\n eventDisplay: 'auto',\n defaultRangeSeparator: ' - ',\n titleRangeSeparator: ' \\u2013 ',\n defaultTimedEventDuration: '01:00:00',\n defaultAllDayEventDuration: { day: 1 },\n forceEventDuration: false,\n nextDayThreshold: '00:00:00',\n dayHeaders: true,\n initialView: '',\n aspectRatio: 1.35,\n headerToolbar: {\n start: 'title',\n center: '',\n end: 'today prev,next',\n },\n weekends: true,\n weekNumbers: false,\n weekNumberCalculation: 'local',\n editable: false,\n nowIndicator: false,\n scrollTime: '06:00:00',\n scrollTimeReset: true,\n slotMinTime: '00:00:00',\n slotMaxTime: '24:00:00',\n showNonCurrentDates: true,\n lazyFetching: true,\n startParam: 'start',\n endParam: 'end',\n timeZoneParam: 'timeZone',\n timeZone: 'local',\n locales: [],\n locale: '',\n themeSystem: 'standard',\n dragRevertDuration: 500,\n dragScroll: true,\n allDayMaintainDuration: false,\n unselectAuto: true,\n dropAccept: '*',\n eventOrder: 'start,-duration,allDay,title',\n dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' },\n handleWindowResize: true,\n windowResizeDelay: 100,\n longPressDelay: 1000,\n eventDragMinDistance: 5,\n expandRows: false,\n navLinks: false,\n selectable: false,\n eventMinHeight: 15,\n eventMinWidth: 30,\n eventShortHeight: 30,\n};\n// calendar listeners\n// ------------------\nvar CALENDAR_LISTENER_REFINERS = {\n datesSet: identity,\n eventsSet: identity,\n eventAdd: identity,\n eventChange: identity,\n eventRemove: identity,\n windowResize: identity,\n eventClick: identity,\n eventMouseEnter: identity,\n eventMouseLeave: identity,\n select: identity,\n unselect: identity,\n loading: identity,\n // internal\n _unmount: identity,\n _beforeprint: identity,\n _afterprint: identity,\n _noEventDrop: identity,\n _noEventResize: identity,\n _resize: identity,\n _scrollRequest: identity,\n};\n// calendar-specific options\n// -------------------------\nvar CALENDAR_OPTION_REFINERS = {\n buttonText: identity,\n buttonHints: identity,\n views: identity,\n plugins: identity,\n initialEvents: identity,\n events: identity,\n eventSources: identity,\n};\nvar COMPLEX_OPTION_COMPARATORS = {\n headerToolbar: isMaybeObjectsEqual,\n footerToolbar: isMaybeObjectsEqual,\n buttonText: isMaybeObjectsEqual,\n buttonHints: isMaybeObjectsEqual,\n buttonIcons: isMaybeObjectsEqual,\n dateIncrement: isMaybeObjectsEqual,\n};\nfunction isMaybeObjectsEqual(a, b) {\n if (typeof a === 'object' && typeof b === 'object' && a && b) { // both non-null objects\n return isPropsEqual(a, b);\n }\n return a === b;\n}\n// view-specific options\n// ---------------------\nvar VIEW_OPTION_REFINERS = {\n type: String,\n component: identity,\n buttonText: String,\n buttonTextKey: String,\n dateProfileGeneratorClass: identity,\n usesMinMaxTime: Boolean,\n classNames: identity,\n content: identity,\n didMount: identity,\n willUnmount: identity,\n};\n// util funcs\n// ----------------------------------------------------------------------------------------------------\nfunction mergeRawOptions(optionSets) {\n return mergeProps(optionSets, COMPLEX_OPTION_COMPARATORS);\n}\nfunction refineProps(input, refiners) {\n var refined = {};\n var extra = {};\n for (var propName in refiners) {\n if (propName in input) {\n refined[propName] = refiners[propName](input[propName]);\n }\n }\n for (var propName in input) {\n if (!(propName in refiners)) {\n extra[propName] = input[propName];\n }\n }\n return { refined: refined, extra: extra };\n}\nfunction identity(raw) {\n return raw;\n}\n\nfunction parseEvents(rawEvents, eventSource, context, allowOpenRange) {\n var eventStore = createEmptyEventStore();\n var eventRefiners = buildEventRefiners(context);\n for (var _i = 0, rawEvents_1 = rawEvents; _i < rawEvents_1.length; _i++) {\n var rawEvent = rawEvents_1[_i];\n var tuple = parseEvent(rawEvent, eventSource, context, allowOpenRange, eventRefiners);\n if (tuple) {\n eventTupleToStore(tuple, eventStore);\n }\n }\n return eventStore;\n}\nfunction eventTupleToStore(tuple, eventStore) {\n if (eventStore === void 0) { eventStore = createEmptyEventStore(); }\n eventStore.defs[tuple.def.defId] = tuple.def;\n if (tuple.instance) {\n eventStore.instances[tuple.instance.instanceId] = tuple.instance;\n }\n return eventStore;\n}\n// retrieves events that have the same groupId as the instance specified by `instanceId`\n// or they are the same as the instance.\n// why might instanceId not be in the store? an event from another calendar?\nfunction getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) { return isEventDefsGrouped(def_1, lookDef); });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n}\nfunction isEventDefsGrouped(def0, def1) {\n return Boolean(def0.groupId && def0.groupId === def1.groupId);\n}\nfunction createEmptyEventStore() {\n return { defs: {}, instances: {} };\n}\nfunction mergeEventStores(store0, store1) {\n return {\n defs: __assign(__assign({}, store0.defs), store1.defs),\n instances: __assign(__assign({}, store0.instances), store1.instances),\n };\n}\nfunction filterEventStoreDefs(eventStore, filterFunc) {\n var defs = filterHash(eventStore.defs, filterFunc);\n var instances = filterHash(eventStore.instances, function (instance) { return (defs[instance.defId] // still exists?\n ); });\n return { defs: defs, instances: instances };\n}\nfunction excludeSubEventStore(master, sub) {\n var defs = master.defs, instances = master.instances;\n var filteredDefs = {};\n var filteredInstances = {};\n for (var defId in defs) {\n if (!sub.defs[defId]) { // not explicitly excluded\n filteredDefs[defId] = defs[defId];\n }\n }\n for (var instanceId in instances) {\n if (!sub.instances[instanceId] && // not explicitly excluded\n filteredDefs[instances[instanceId].defId] // def wasn't filtered away\n ) {\n filteredInstances[instanceId] = instances[instanceId];\n }\n }\n return {\n defs: filteredDefs,\n instances: filteredInstances,\n };\n}\n\nfunction normalizeConstraint(input, context) {\n if (Array.isArray(input)) {\n return parseEvents(input, null, context, true); // allowOpenRange=true\n }\n if (typeof input === 'object' && input) { // non-null object\n return parseEvents([input], null, context, true); // allowOpenRange=true\n }\n if (input != null) {\n return String(input);\n }\n return null;\n}\n\nfunction parseClassNames(raw) {\n if (Array.isArray(raw)) {\n return raw;\n }\n if (typeof raw === 'string') {\n return raw.split(/\\s+/);\n }\n return [];\n}\n\n// TODO: better called \"EventSettings\" or \"EventConfig\"\n// TODO: move this file into structs\n// TODO: separate constraint/overlap/allow, because selection uses only that, not other props\nvar EVENT_UI_REFINERS = {\n display: String,\n editable: Boolean,\n startEditable: Boolean,\n durationEditable: Boolean,\n constraint: identity,\n overlap: identity,\n allow: identity,\n className: parseClassNames,\n classNames: parseClassNames,\n color: String,\n backgroundColor: String,\n borderColor: String,\n textColor: String,\n};\nvar EMPTY_EVENT_UI = {\n display: null,\n startEditable: null,\n durationEditable: null,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: [],\n};\nfunction createEventUi(refined, context) {\n var constraint = normalizeConstraint(refined.constraint, context);\n return {\n display: refined.display || null,\n startEditable: refined.startEditable != null ? refined.startEditable : refined.editable,\n durationEditable: refined.durationEditable != null ? refined.durationEditable : refined.editable,\n constraints: constraint != null ? [constraint] : [],\n overlap: refined.overlap != null ? refined.overlap : null,\n allows: refined.allow != null ? [refined.allow] : [],\n backgroundColor: refined.backgroundColor || refined.color || '',\n borderColor: refined.borderColor || refined.color || '',\n textColor: refined.textColor || '',\n classNames: (refined.className || []).concat(refined.classNames || []), // join singular and plural\n };\n}\n// TODO: prevent against problems with <2 args!\nfunction combineEventUis(uis) {\n return uis.reduce(combineTwoEventUis, EMPTY_EVENT_UI);\n}\nfunction combineTwoEventUis(item0, item1) {\n return {\n display: item1.display != null ? item1.display : item0.display,\n startEditable: item1.startEditable != null ? item1.startEditable : item0.startEditable,\n durationEditable: item1.durationEditable != null ? item1.durationEditable : item0.durationEditable,\n constraints: item0.constraints.concat(item1.constraints),\n overlap: typeof item1.overlap === 'boolean' ? item1.overlap : item0.overlap,\n allows: item0.allows.concat(item1.allows),\n backgroundColor: item1.backgroundColor || item0.backgroundColor,\n borderColor: item1.borderColor || item0.borderColor,\n textColor: item1.textColor || item0.textColor,\n classNames: item0.classNames.concat(item1.classNames),\n };\n}\n\nvar EVENT_NON_DATE_REFINERS = {\n id: String,\n groupId: String,\n title: String,\n url: String,\n interactive: Boolean,\n};\nvar EVENT_DATE_REFINERS = {\n start: identity,\n end: identity,\n date: identity,\n allDay: Boolean,\n};\nvar EVENT_REFINERS = __assign(__assign(__assign({}, EVENT_NON_DATE_REFINERS), EVENT_DATE_REFINERS), { extendedProps: identity });\nfunction parseEvent(raw, eventSource, context, allowOpenRange, refiners) {\n if (refiners === void 0) { refiners = buildEventRefiners(context); }\n var _a = refineEventDef(raw, context, refiners), refined = _a.refined, extra = _a.extra;\n var defaultAllDay = computeIsDefaultAllDay(eventSource, context);\n var recurringRes = parseRecurring(refined, defaultAllDay, context.dateEnv, context.pluginHooks.recurringTypes);\n if (recurringRes) {\n var def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', recurringRes.allDay, Boolean(recurringRes.duration), context);\n def.recurringDef = {\n typeId: recurringRes.typeId,\n typeData: recurringRes.typeData,\n duration: recurringRes.duration,\n };\n return { def: def, instance: null };\n }\n var singleRes = parseSingle(refined, defaultAllDay, context, allowOpenRange);\n if (singleRes) {\n var def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', singleRes.allDay, singleRes.hasEnd, context);\n var instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo);\n return { def: def, instance: instance };\n }\n return null;\n}\nfunction refineEventDef(raw, context, refiners) {\n if (refiners === void 0) { refiners = buildEventRefiners(context); }\n return refineProps(raw, refiners);\n}\nfunction buildEventRefiners(context) {\n return __assign(__assign(__assign({}, EVENT_UI_REFINERS), EVENT_REFINERS), context.pluginHooks.eventRefiners);\n}\n/*\nWill NOT populate extendedProps with the leftover properties.\nWill NOT populate date-related props.\n*/\nfunction parseEventDef(refined, extra, sourceId, allDay, hasEnd, context) {\n var def = {\n title: refined.title || '',\n groupId: refined.groupId || '',\n publicId: refined.id || '',\n url: refined.url || '',\n recurringDef: null,\n defId: guid(),\n sourceId: sourceId,\n allDay: allDay,\n hasEnd: hasEnd,\n interactive: refined.interactive,\n ui: createEventUi(refined, context),\n extendedProps: __assign(__assign({}, (refined.extendedProps || {})), extra),\n };\n for (var _i = 0, _a = context.pluginHooks.eventDefMemberAdders; _i < _a.length; _i++) {\n var memberAdder = _a[_i];\n __assign(def, memberAdder(refined));\n }\n // help out EventApi from having user modify props\n Object.freeze(def.ui.classNames);\n Object.freeze(def.extendedProps);\n return def;\n}\nfunction parseSingle(refined, defaultAllDay, context, allowOpenRange) {\n var allDay = refined.allDay;\n var startMeta;\n var startMarker = null;\n var hasEnd = false;\n var endMeta;\n var endMarker = null;\n var startInput = refined.start != null ? refined.start : refined.date;\n startMeta = context.dateEnv.createMarkerMeta(startInput);\n if (startMeta) {\n startMarker = startMeta.marker;\n }\n else if (!allowOpenRange) {\n return null;\n }\n if (refined.end != null) {\n endMeta = context.dateEnv.createMarkerMeta(refined.end);\n }\n if (allDay == null) {\n if (defaultAllDay != null) {\n allDay = defaultAllDay;\n }\n else {\n // fall back to the date props LAST\n allDay = (!startMeta || startMeta.isTimeUnspecified) &&\n (!endMeta || endMeta.isTimeUnspecified);\n }\n }\n if (allDay && startMarker) {\n startMarker = startOfDay(startMarker);\n }\n if (endMeta) {\n endMarker = endMeta.marker;\n if (allDay) {\n endMarker = startOfDay(endMarker);\n }\n if (startMarker && endMarker <= startMarker) {\n endMarker = null;\n }\n }\n if (endMarker) {\n hasEnd = true;\n }\n else if (!allowOpenRange) {\n hasEnd = context.options.forceEventDuration || false;\n endMarker = context.dateEnv.add(startMarker, allDay ?\n context.options.defaultAllDayEventDuration :\n context.options.defaultTimedEventDuration);\n }\n return {\n allDay: allDay,\n hasEnd: hasEnd,\n range: { start: startMarker, end: endMarker },\n forcedStartTzo: startMeta ? startMeta.forcedTzo : null,\n forcedEndTzo: endMeta ? endMeta.forcedTzo : null,\n };\n}\nfunction computeIsDefaultAllDay(eventSource, context) {\n var res = null;\n if (eventSource) {\n res = eventSource.defaultAllDay;\n }\n if (res == null) {\n res = context.options.defaultAllDay;\n }\n return res;\n}\n\n/* Date stuff that doesn't belong in datelib core\n----------------------------------------------------------------------------------------------------------------------*/\n// given a timed range, computes an all-day range that has the same exact duration,\n// but whose start time is aligned with the start of the day.\nfunction computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n}\n// given a timed range, computes an all-day range based on how for the end date bleeds into the next day\n// TODO: give nextDayThreshold a default arg\nfunction computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n}\n// spans from one day into another?\nfunction isMultiDayRange(range) {\n var visibleRange = computeVisibleDayRange(range);\n return diffDays(visibleRange.start, visibleRange.end) > 1;\n}\nfunction diffDates(date0, date1, dateEnv, largeUnit) {\n if (largeUnit === 'year') {\n return createDuration(dateEnv.diffWholeYears(date0, date1), 'year');\n }\n if (largeUnit === 'month') {\n return createDuration(dateEnv.diffWholeMonths(date0, date1), 'month');\n }\n return diffDayAndTime(date0, date1); // returns a duration\n}\n\nfunction parseRange(input, dateEnv) {\n var start = null;\n var end = null;\n if (input.start) {\n start = dateEnv.createMarker(input.start);\n }\n if (input.end) {\n end = dateEnv.createMarker(input.end);\n }\n if (!start && !end) {\n return null;\n }\n if (start && end && end < start) {\n return null;\n }\n return { start: start, end: end };\n}\n// SIDE-EFFECT: will mutate ranges.\n// Will return a new array result.\nfunction invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n var i;\n var dateRange;\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges);\n for (i = 0; i < ranges.length; i += 1) {\n dateRange = ranges[i];\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: dateRange.start });\n }\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n }\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: constraintRange.end });\n }\n return invertedRanges;\n}\nfunction compareRanges(range0, range1) {\n return range0.start.valueOf() - range1.start.valueOf(); // earlier ranges go first\n}\nfunction intersectRanges(range0, range1) {\n var start = range0.start, end = range0.end;\n var newRange = null;\n if (range1.start !== null) {\n if (start === null) {\n start = range1.start;\n }\n else {\n start = new Date(Math.max(start.valueOf(), range1.start.valueOf()));\n }\n }\n if (range1.end != null) {\n if (end === null) {\n end = range1.end;\n }\n else {\n end = new Date(Math.min(end.valueOf(), range1.end.valueOf()));\n }\n }\n if (start === null || end === null || start < end) {\n newRange = { start: start, end: end };\n }\n return newRange;\n}\nfunction rangesEqual(range0, range1) {\n return (range0.start === null ? null : range0.start.valueOf()) === (range1.start === null ? null : range1.start.valueOf()) &&\n (range0.end === null ? null : range0.end.valueOf()) === (range1.end === null ? null : range1.end.valueOf());\n}\nfunction rangesIntersect(range0, range1) {\n return (range0.end === null || range1.start === null || range0.end > range1.start) &&\n (range0.start === null || range1.end === null || range0.start < range1.end);\n}\nfunction rangeContainsRange(outerRange, innerRange) {\n return (outerRange.start === null || (innerRange.start !== null && innerRange.start >= outerRange.start)) &&\n (outerRange.end === null || (innerRange.end !== null && innerRange.end <= outerRange.end));\n}\nfunction rangeContainsMarker(range, date) {\n return (range.start === null || date >= range.start) &&\n (range.end === null || date < range.end);\n}\n// If the given date is not within the given range, move it inside.\n// (If it's past the end, make it one millisecond before the end).\nfunction constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}\n\n/*\nSpecifying nextDayThreshold signals that all-day ranges should be sliced.\n*/\nfunction sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n var ui = eventUis[def.defId];\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else if (ui.display !== 'none') {\n (ui.display === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}\nfunction hasBgRendering(def) {\n return def.ui.display === 'background' || def.ui.display === 'inverse-background';\n}\nfunction setElSeg(el, seg) {\n el.fcSeg = seg;\n}\nfunction getElSeg(el) {\n return el.fcSeg ||\n el.parentNode.fcSeg || // for the harness\n null;\n}\n// event ui computation\nfunction compileEventUis(eventDefs, eventUiBases) {\n return mapHash(eventDefs, function (eventDef) { return compileEventUi(eventDef, eventUiBases); });\n}\nfunction compileEventUi(eventDef, eventUiBases) {\n var uis = [];\n if (eventUiBases['']) {\n uis.push(eventUiBases['']);\n }\n if (eventUiBases[eventDef.defId]) {\n uis.push(eventUiBases[eventDef.defId]);\n }\n uis.push(eventDef.ui);\n return combineEventUis(uis);\n}\nfunction sortEventSegs(segs, eventOrderSpecs) {\n var objs = segs.map(buildSegCompareObj);\n objs.sort(function (obj0, obj1) { return compareByFieldSpecs(obj0, obj1, eventOrderSpecs); });\n return objs.map(function (c) { return c._seg; });\n}\n// returns a object with all primitive props that can be compared\nfunction buildSegCompareObj(seg) {\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var range = eventRange.instance ? eventRange.instance.range : eventRange.range;\n var start = range.start ? range.start.valueOf() : 0; // TODO: better support for open-range events\n var end = range.end ? range.end.valueOf() : 0; // \"\n return __assign(__assign(__assign({}, eventDef.extendedProps), eventDef), { id: eventDef.publicId, start: start,\n end: end, duration: end - start, allDay: Number(eventDef.allDay), _seg: seg });\n}\nfunction computeSegDraggable(seg, context) {\n var pluginHooks = context.pluginHooks;\n var transformers = pluginHooks.isDraggableTransformers;\n var _a = seg.eventRange, def = _a.def, ui = _a.ui;\n var val = ui.startEditable;\n for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) {\n var transformer = transformers_1[_i];\n val = transformer(val, def, ui, context);\n }\n return val;\n}\nfunction computeSegStartResizable(seg, context) {\n return seg.isStart && seg.eventRange.ui.durationEditable && context.options.eventResizableFromStart;\n}\nfunction computeSegEndResizable(seg, context) {\n return seg.isEnd && seg.eventRange.ui.durationEditable;\n}\nfunction buildSegTimeText(seg, timeFormat, context, defaultDisplayEventTime, // defaults to true\ndefaultDisplayEventEnd, // defaults to true\nstartOverride, endOverride) {\n var dateEnv = context.dateEnv, options = context.options;\n var displayEventTime = options.displayEventTime, displayEventEnd = options.displayEventEnd;\n var eventDef = seg.eventRange.def;\n var eventInstance = seg.eventRange.instance;\n if (displayEventTime == null) {\n displayEventTime = defaultDisplayEventTime !== false;\n }\n if (displayEventEnd == null) {\n displayEventEnd = defaultDisplayEventEnd !== false;\n }\n var wholeEventStart = eventInstance.range.start;\n var wholeEventEnd = eventInstance.range.end;\n var segStart = startOverride || seg.start || seg.eventRange.range.start;\n var segEnd = endOverride || seg.end || seg.eventRange.range.end;\n var isStartDay = startOfDay(wholeEventStart).valueOf() === startOfDay(segStart).valueOf();\n var isEndDay = startOfDay(addMs(wholeEventEnd, -1)).valueOf() === startOfDay(addMs(segEnd, -1)).valueOf();\n if (displayEventTime && !eventDef.allDay && (isStartDay || isEndDay)) {\n segStart = isStartDay ? wholeEventStart : segStart;\n segEnd = isEndDay ? wholeEventEnd : segEnd;\n if (displayEventEnd && eventDef.hasEnd) {\n return dateEnv.formatRange(segStart, segEnd, timeFormat, {\n forcedStartTzo: startOverride ? null : eventInstance.forcedStartTzo,\n forcedEndTzo: endOverride ? null : eventInstance.forcedEndTzo,\n });\n }\n return dateEnv.format(segStart, timeFormat, {\n forcedTzo: startOverride ? null : eventInstance.forcedStartTzo, // nooooo, same\n });\n }\n return '';\n}\nfunction getSegMeta(seg, todayRange, nowDate) {\n var segRange = seg.eventRange.range;\n return {\n isPast: segRange.end < (nowDate || todayRange.start),\n isFuture: segRange.start >= (nowDate || todayRange.end),\n isToday: todayRange && rangeContainsMarker(todayRange, segRange.start),\n };\n}\nfunction getEventClassNames(props) {\n var classNames = ['fc-event'];\n if (props.isMirror) {\n classNames.push('fc-event-mirror');\n }\n if (props.isDraggable) {\n classNames.push('fc-event-draggable');\n }\n if (props.isStartResizable || props.isEndResizable) {\n classNames.push('fc-event-resizable');\n }\n if (props.isDragging) {\n classNames.push('fc-event-dragging');\n }\n if (props.isResizing) {\n classNames.push('fc-event-resizing');\n }\n if (props.isSelected) {\n classNames.push('fc-event-selected');\n }\n if (props.isStart) {\n classNames.push('fc-event-start');\n }\n if (props.isEnd) {\n classNames.push('fc-event-end');\n }\n if (props.isPast) {\n classNames.push('fc-event-past');\n }\n if (props.isToday) {\n classNames.push('fc-event-today');\n }\n if (props.isFuture) {\n classNames.push('fc-event-future');\n }\n return classNames;\n}\nfunction buildEventRangeKey(eventRange) {\n return eventRange.instance\n ? eventRange.instance.instanceId\n : eventRange.def.defId + \":\" + eventRange.range.start.toISOString();\n // inverse-background events don't have specific instances. TODO: better solution\n}\nfunction getSegAnchorAttrs(seg, context) {\n var _a = seg.eventRange, def = _a.def, instance = _a.instance;\n var url = def.url;\n if (url) {\n return { href: url };\n }\n var emitter = context.emitter, options = context.options;\n var eventInteractive = options.eventInteractive;\n if (eventInteractive == null) {\n eventInteractive = def.interactive;\n if (eventInteractive == null) {\n eventInteractive = Boolean(emitter.hasHandlers('eventClick'));\n }\n }\n // mock what happens in EventClicking\n if (eventInteractive) {\n // only attach keyboard-related handlers because click handler is already done in EventClicking\n return createAriaKeyboardAttrs(function (ev) {\n emitter.trigger('eventClick', {\n el: ev.target,\n event: new EventApi(context, def, instance),\n jsEvent: ev,\n view: context.viewApi,\n });\n });\n }\n return {};\n}\n\nvar STANDARD_PROPS = {\n start: identity,\n end: identity,\n allDay: Boolean,\n};\nfunction parseDateSpan(raw, dateEnv, defaultDuration) {\n var span = parseOpenDateSpan(raw, dateEnv);\n var range = span.range;\n if (!range.start) {\n return null;\n }\n if (!range.end) {\n if (defaultDuration == null) {\n return null;\n }\n range.end = dateEnv.add(range.start, defaultDuration);\n }\n return span;\n}\n/*\nTODO: somehow combine with parseRange?\nWill return null if the start/end props were present but parsed invalidly.\n*/\nfunction parseOpenDateSpan(raw, dateEnv) {\n var _a = refineProps(raw, STANDARD_PROPS), standardProps = _a.refined, extra = _a.extra;\n var startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null;\n var endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null;\n var allDay = standardProps.allDay;\n if (allDay == null) {\n allDay = (startMeta && startMeta.isTimeUnspecified) &&\n (!endMeta || endMeta.isTimeUnspecified);\n }\n return __assign({ range: {\n start: startMeta ? startMeta.marker : null,\n end: endMeta ? endMeta.marker : null,\n }, allDay: allDay }, extra);\n}\nfunction isDateSpansEqual(span0, span1) {\n return rangesEqual(span0.range, span1.range) &&\n span0.allDay === span1.allDay &&\n isSpanPropsEqual(span0, span1);\n}\n// the NON-DATE-RELATED props\nfunction isSpanPropsEqual(span0, span1) {\n for (var propName in span1) {\n if (propName !== 'range' && propName !== 'allDay') {\n if (span0[propName] !== span1[propName]) {\n return false;\n }\n }\n }\n // are there any props that span0 has that span1 DOESN'T have?\n // both have range/allDay, so no need to special-case.\n for (var propName in span0) {\n if (!(propName in span1)) {\n return false;\n }\n }\n return true;\n}\nfunction buildDateSpanApi(span, dateEnv) {\n return __assign(__assign({}, buildRangeApi(span.range, dateEnv, span.allDay)), { allDay: span.allDay });\n}\nfunction buildRangeApiWithTimeZone(range, dateEnv, omitTime) {\n return __assign(__assign({}, buildRangeApi(range, dateEnv, omitTime)), { timeZone: dateEnv.timeZone });\n}\nfunction buildRangeApi(range, dateEnv, omitTime) {\n return {\n start: dateEnv.toDate(range.start),\n end: dateEnv.toDate(range.end),\n startStr: dateEnv.formatIso(range.start, { omitTime: omitTime }),\n endStr: dateEnv.formatIso(range.end, { omitTime: omitTime }),\n };\n}\nfunction fabricateEventRange(dateSpan, eventUiBases, context) {\n var res = refineEventDef({ editable: false }, context);\n var def = parseEventDef(res.refined, res.extra, '', // sourceId\n dateSpan.allDay, true, // hasEnd\n context);\n return {\n def: def,\n ui: compileEventUi(def, eventUiBases),\n instance: createEventInstance(def.defId, dateSpan.range),\n range: dateSpan.range,\n isStart: true,\n isEnd: true,\n };\n}\n\nfunction triggerDateSelect(selection, pev, context) {\n context.emitter.trigger('select', __assign(__assign({}, buildDateSpanApiWithContext(selection, context)), { jsEvent: pev ? pev.origEvent : null, view: context.viewApi || context.calendarApi.view }));\n}\nfunction triggerDateUnselect(pev, context) {\n context.emitter.trigger('unselect', {\n jsEvent: pev ? pev.origEvent : null,\n view: context.viewApi || context.calendarApi.view,\n });\n}\nfunction buildDateSpanApiWithContext(dateSpan, context) {\n var props = {};\n for (var _i = 0, _a = context.pluginHooks.dateSpanTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(props, transform(dateSpan, context));\n }\n __assign(props, buildDateSpanApi(dateSpan, context.dateEnv));\n return props;\n}\n// Given an event's allDay status and start date, return what its fallback end date should be.\n// TODO: rename to computeDefaultEventEnd\nfunction getDefaultEventEnd(allDay, marker, context) {\n var dateEnv = context.dateEnv, options = context.options;\n var end = marker;\n if (allDay) {\n end = startOfDay(end);\n end = dateEnv.add(end, options.defaultAllDayEventDuration);\n }\n else {\n end = dateEnv.add(end, options.defaultTimedEventDuration);\n }\n return end;\n}\n\n// applies the mutation to ALL defs/instances within the event store\nfunction applyMutationToEventStore(eventStore, eventConfigBase, mutation, context) {\n var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase);\n var dest = createEmptyEventStore();\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, context);\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = dest.defs[instance.defId]; // important to grab the newly modified def\n dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, context);\n }\n return dest;\n}\nfunction applyMutationToEventDef(eventDef, eventConfig, mutation, context) {\n var standardProps = mutation.standardProps || {};\n // if hasEnd has not been specified, guess a good value based on deltas.\n // if duration will change, there's no way the default duration will persist,\n // and thus, we need to mark the event as having a real end\n if (standardProps.hasEnd == null &&\n eventConfig.durationEditable &&\n (mutation.startDelta || mutation.endDelta)) {\n standardProps.hasEnd = true; // TODO: is this mutation okay?\n }\n var copy = __assign(__assign(__assign({}, eventDef), standardProps), { ui: __assign(__assign({}, eventDef.ui), standardProps.ui) });\n if (mutation.extendedProps) {\n copy.extendedProps = __assign(__assign({}, copy.extendedProps), mutation.extendedProps);\n }\n for (var _i = 0, _a = context.pluginHooks.eventDefMutationAppliers; _i < _a.length; _i++) {\n var applier = _a[_i];\n applier(copy, mutation, context);\n }\n if (!copy.hasEnd && context.options.forceEventDuration) {\n copy.hasEnd = true;\n }\n return copy;\n}\nfunction applyMutationToEventInstance(eventInstance, eventDef, // must first be modified by applyMutationToEventDef\neventConfig, mutation, context) {\n var dateEnv = context.dateEnv;\n var forceAllDay = mutation.standardProps && mutation.standardProps.allDay === true;\n var clearEnd = mutation.standardProps && mutation.standardProps.hasEnd === false;\n var copy = __assign({}, eventInstance);\n if (forceAllDay) {\n copy.range = computeAlignedDayRange(copy.range);\n }\n if (mutation.datesDelta && eventConfig.startEditable) {\n copy.range = {\n start: dateEnv.add(copy.range.start, mutation.datesDelta),\n end: dateEnv.add(copy.range.end, mutation.datesDelta),\n };\n }\n if (mutation.startDelta && eventConfig.durationEditable) {\n copy.range = {\n start: dateEnv.add(copy.range.start, mutation.startDelta),\n end: copy.range.end,\n };\n }\n if (mutation.endDelta && eventConfig.durationEditable) {\n copy.range = {\n start: copy.range.start,\n end: dateEnv.add(copy.range.end, mutation.endDelta),\n };\n }\n if (clearEnd) {\n copy.range = {\n start: copy.range.start,\n end: getDefaultEventEnd(eventDef.allDay, copy.range.start, context),\n };\n }\n // in case event was all-day but the supplied deltas were not\n // better util for this?\n if (eventDef.allDay) {\n copy.range = {\n start: startOfDay(copy.range.start),\n end: startOfDay(copy.range.end),\n };\n }\n // handle invalid durations\n if (copy.range.end < copy.range.start) {\n copy.range.end = getDefaultEventEnd(eventDef.allDay, copy.range.start, context);\n }\n return copy;\n}\n\n// no public types yet. when there are, export from:\n// import {} from './api-type-deps'\nvar ViewApi = /** @class */ (function () {\n function ViewApi(type, getCurrentData, dateEnv) {\n this.type = type;\n this.getCurrentData = getCurrentData;\n this.dateEnv = dateEnv;\n }\n Object.defineProperty(ViewApi.prototype, \"calendar\", {\n get: function () {\n return this.getCurrentData().calendarApi;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewApi.prototype, \"title\", {\n get: function () {\n return this.getCurrentData().viewTitle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewApi.prototype, \"activeStart\", {\n get: function () {\n return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewApi.prototype, \"activeEnd\", {\n get: function () {\n return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewApi.prototype, \"currentStart\", {\n get: function () {\n return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewApi.prototype, \"currentEnd\", {\n get: function () {\n return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end);\n },\n enumerable: false,\n configurable: true\n });\n ViewApi.prototype.getOption = function (name) {\n return this.getCurrentData().options[name]; // are the view-specific options\n };\n return ViewApi;\n}());\n\nvar EVENT_SOURCE_REFINERS = {\n id: String,\n defaultAllDay: Boolean,\n url: String,\n format: String,\n events: identity,\n eventDataTransform: identity,\n // for any network-related sources\n success: identity,\n failure: identity,\n};\nfunction parseEventSource(raw, context, refiners) {\n if (refiners === void 0) { refiners = buildEventSourceRefiners(context); }\n var rawObj;\n if (typeof raw === 'string') {\n rawObj = { url: raw };\n }\n else if (typeof raw === 'function' || Array.isArray(raw)) {\n rawObj = { events: raw };\n }\n else if (typeof raw === 'object' && raw) { // not null\n rawObj = raw;\n }\n if (rawObj) {\n var _a = refineProps(rawObj, refiners), refined = _a.refined, extra = _a.extra;\n var metaRes = buildEventSourceMeta(refined, context);\n if (metaRes) {\n return {\n _raw: raw,\n isFetching: false,\n latestFetchId: '',\n fetchRange: null,\n defaultAllDay: refined.defaultAllDay,\n eventDataTransform: refined.eventDataTransform,\n success: refined.success,\n failure: refined.failure,\n publicId: refined.id || '',\n sourceId: guid(),\n sourceDefId: metaRes.sourceDefId,\n meta: metaRes.meta,\n ui: createEventUi(refined, context),\n extendedProps: extra,\n };\n }\n }\n return null;\n}\nfunction buildEventSourceRefiners(context) {\n return __assign(__assign(__assign({}, EVENT_UI_REFINERS), EVENT_SOURCE_REFINERS), context.pluginHooks.eventSourceRefiners);\n}\nfunction buildEventSourceMeta(raw, context) {\n var defs = context.pluginHooks.eventSourceDefs;\n for (var i = defs.length - 1; i >= 0; i -= 1) { // later-added plugins take precedence\n var def = defs[i];\n var meta = def.parseMeta(raw);\n if (meta) {\n return { sourceDefId: i, meta: meta };\n }\n }\n return null;\n}\n\nfunction reduceCurrentDate(currentDate, action) {\n switch (action.type) {\n case 'CHANGE_DATE':\n return action.dateMarker;\n default:\n return currentDate;\n }\n}\nfunction getInitialDate(options, dateEnv) {\n var initialDateInput = options.initialDate;\n // compute the initial ambig-timezone date\n if (initialDateInput != null) {\n return dateEnv.createMarker(initialDateInput);\n }\n return getNow(options.now, dateEnv); // getNow already returns unzoned\n}\nfunction getNow(nowInput, dateEnv) {\n if (typeof nowInput === 'function') {\n nowInput = nowInput();\n }\n if (nowInput == null) {\n return dateEnv.createNowMarker();\n }\n return dateEnv.createMarker(nowInput);\n}\n\nvar CalendarApi = /** @class */ (function () {\n function CalendarApi() {\n }\n CalendarApi.prototype.getCurrentData = function () {\n return this.currentDataManager.getCurrentData();\n };\n CalendarApi.prototype.dispatch = function (action) {\n return this.currentDataManager.dispatch(action);\n };\n Object.defineProperty(CalendarApi.prototype, \"view\", {\n get: function () { return this.getCurrentData().viewApi; } // for public API\n ,\n enumerable: false,\n configurable: true\n });\n CalendarApi.prototype.batchRendering = function (callback) {\n callback();\n };\n CalendarApi.prototype.updateSize = function () {\n this.trigger('_resize', true);\n };\n // Options\n // -----------------------------------------------------------------------------------------------------------------\n CalendarApi.prototype.setOption = function (name, val) {\n this.dispatch({\n type: 'SET_OPTION',\n optionName: name,\n rawOptionValue: val,\n });\n };\n CalendarApi.prototype.getOption = function (name) {\n return this.currentDataManager.currentCalendarOptionsInput[name];\n };\n CalendarApi.prototype.getAvailableLocaleCodes = function () {\n return Object.keys(this.getCurrentData().availableRawLocales);\n };\n // Trigger\n // -----------------------------------------------------------------------------------------------------------------\n CalendarApi.prototype.on = function (handlerName, handler) {\n var currentDataManager = this.currentDataManager;\n if (currentDataManager.currentCalendarOptionsRefiners[handlerName]) {\n currentDataManager.emitter.on(handlerName, handler);\n }\n else {\n console.warn(\"Unknown listener name '\" + handlerName + \"'\");\n }\n };\n CalendarApi.prototype.off = function (handlerName, handler) {\n this.currentDataManager.emitter.off(handlerName, handler);\n };\n // not meant for public use\n CalendarApi.prototype.trigger = function (handlerName) {\n var _a;\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n (_a = this.currentDataManager.emitter).trigger.apply(_a, __spreadArray([handlerName], args));\n };\n // View\n // -----------------------------------------------------------------------------------------------------------------\n CalendarApi.prototype.changeView = function (viewType, dateOrRange) {\n var _this = this;\n this.batchRendering(function () {\n _this.unselect();\n if (dateOrRange) {\n if (dateOrRange.start && dateOrRange.end) { // a range\n _this.dispatch({\n type: 'CHANGE_VIEW_TYPE',\n viewType: viewType,\n });\n _this.dispatch({\n type: 'SET_OPTION',\n optionName: 'visibleRange',\n rawOptionValue: dateOrRange,\n });\n }\n else {\n var dateEnv = _this.getCurrentData().dateEnv;\n _this.dispatch({\n type: 'CHANGE_VIEW_TYPE',\n viewType: viewType,\n dateMarker: dateEnv.createMarker(dateOrRange),\n });\n }\n }\n else {\n _this.dispatch({\n type: 'CHANGE_VIEW_TYPE',\n viewType: viewType,\n });\n }\n });\n };\n // Forces navigation to a view for the given date.\n // `viewType` can be a specific view name or a generic one like \"week\" or \"day\".\n // needs to change\n CalendarApi.prototype.zoomTo = function (dateMarker, viewType) {\n var state = this.getCurrentData();\n var spec;\n viewType = viewType || 'day'; // day is default zoom\n spec = state.viewSpecs[viewType] || this.getUnitViewSpec(viewType);\n this.unselect();\n if (spec) {\n this.dispatch({\n type: 'CHANGE_VIEW_TYPE',\n viewType: spec.type,\n dateMarker: dateMarker,\n });\n }\n else {\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: dateMarker,\n });\n }\n };\n // Given a duration singular unit, like \"week\" or \"day\", finds a matching view spec.\n // Preference is given to views that have corresponding buttons.\n CalendarApi.prototype.getUnitViewSpec = function (unit) {\n var _a = this.getCurrentData(), viewSpecs = _a.viewSpecs, toolbarConfig = _a.toolbarConfig;\n var viewTypes = [].concat(toolbarConfig.header ? toolbarConfig.header.viewsWithButtons : [], toolbarConfig.footer ? toolbarConfig.footer.viewsWithButtons : []);\n var i;\n var spec;\n for (var viewType in viewSpecs) {\n viewTypes.push(viewType);\n }\n for (i = 0; i < viewTypes.length; i += 1) {\n spec = viewSpecs[viewTypes[i]];\n if (spec) {\n if (spec.singleUnit === unit) {\n return spec;\n }\n }\n }\n return null;\n };\n // Current Date\n // -----------------------------------------------------------------------------------------------------------------\n CalendarApi.prototype.prev = function () {\n this.unselect();\n this.dispatch({ type: 'PREV' });\n };\n CalendarApi.prototype.next = function () {\n this.unselect();\n this.dispatch({ type: 'NEXT' });\n };\n CalendarApi.prototype.prevYear = function () {\n var state = this.getCurrentData();\n this.unselect();\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: state.dateEnv.addYears(state.currentDate, -1),\n });\n };\n CalendarApi.prototype.nextYear = function () {\n var state = this.getCurrentData();\n this.unselect();\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: state.dateEnv.addYears(state.currentDate, 1),\n });\n };\n CalendarApi.prototype.today = function () {\n var state = this.getCurrentData();\n this.unselect();\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: getNow(state.calendarOptions.now, state.dateEnv),\n });\n };\n CalendarApi.prototype.gotoDate = function (zonedDateInput) {\n var state = this.getCurrentData();\n this.unselect();\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: state.dateEnv.createMarker(zonedDateInput),\n });\n };\n CalendarApi.prototype.incrementDate = function (deltaInput) {\n var state = this.getCurrentData();\n var delta = createDuration(deltaInput);\n if (delta) { // else, warn about invalid input?\n this.unselect();\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: state.dateEnv.add(state.currentDate, delta),\n });\n }\n };\n // for external API\n CalendarApi.prototype.getDate = function () {\n var state = this.getCurrentData();\n return state.dateEnv.toDate(state.currentDate);\n };\n // Date Formatting Utils\n // -----------------------------------------------------------------------------------------------------------------\n CalendarApi.prototype.formatDate = function (d, formatter) {\n var dateEnv = this.getCurrentData().dateEnv;\n return dateEnv.format(dateEnv.createMarker(d), createFormatter(formatter));\n };\n // `settings` is for formatter AND isEndExclusive\n CalendarApi.prototype.formatRange = function (d0, d1, settings) {\n var dateEnv = this.getCurrentData().dateEnv;\n return dateEnv.formatRange(dateEnv.createMarker(d0), dateEnv.createMarker(d1), createFormatter(settings), settings);\n };\n CalendarApi.prototype.formatIso = function (d, omitTime) {\n var dateEnv = this.getCurrentData().dateEnv;\n return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime: omitTime });\n };\n // Date Selection / Event Selection / DayClick\n // -----------------------------------------------------------------------------------------------------------------\n // this public method receives start/end dates in any format, with any timezone\n // NOTE: args were changed from v3\n CalendarApi.prototype.select = function (dateOrObj, endDate) {\n var selectionInput;\n if (endDate == null) {\n if (dateOrObj.start != null) {\n selectionInput = dateOrObj;\n }\n else {\n selectionInput = {\n start: dateOrObj,\n end: null,\n };\n }\n }\n else {\n selectionInput = {\n start: dateOrObj,\n end: endDate,\n };\n }\n var state = this.getCurrentData();\n var selection = parseDateSpan(selectionInput, state.dateEnv, createDuration({ days: 1 }));\n if (selection) { // throw parse error otherwise?\n this.dispatch({ type: 'SELECT_DATES', selection: selection });\n triggerDateSelect(selection, null, state);\n }\n };\n // public method\n CalendarApi.prototype.unselect = function (pev) {\n var state = this.getCurrentData();\n if (state.dateSelection) {\n this.dispatch({ type: 'UNSELECT_DATES' });\n triggerDateUnselect(pev, state);\n }\n };\n // Public Events API\n // -----------------------------------------------------------------------------------------------------------------\n CalendarApi.prototype.addEvent = function (eventInput, sourceInput) {\n if (eventInput instanceof EventApi) {\n var def = eventInput._def;\n var instance = eventInput._instance;\n var currentData = this.getCurrentData();\n // not already present? don't want to add an old snapshot\n if (!currentData.eventStore.defs[def.defId]) {\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore({ def: def, instance: instance }), // TODO: better util for two args?\n });\n this.triggerEventAdd(eventInput);\n }\n return eventInput;\n }\n var state = this.getCurrentData();\n var eventSource;\n if (sourceInput instanceof EventSourceApi) {\n eventSource = sourceInput.internalEventSource;\n }\n else if (typeof sourceInput === 'boolean') {\n if (sourceInput) { // true. part of the first event source\n eventSource = hashValuesToArray(state.eventSources)[0];\n }\n }\n else if (sourceInput != null) { // an ID. accepts a number too\n var sourceApi = this.getEventSourceById(sourceInput); // TODO: use an internal function\n if (!sourceApi) {\n console.warn(\"Could not find an event source with ID \\\"\" + sourceInput + \"\\\"\"); // TODO: test\n return null;\n }\n eventSource = sourceApi.internalEventSource;\n }\n var tuple = parseEvent(eventInput, eventSource, state, false);\n if (tuple) {\n var newEventApi = new EventApi(state, tuple.def, tuple.def.recurringDef ? null : tuple.instance);\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore(tuple),\n });\n this.triggerEventAdd(newEventApi);\n return newEventApi;\n }\n return null;\n };\n CalendarApi.prototype.triggerEventAdd = function (eventApi) {\n var _this = this;\n var emitter = this.getCurrentData().emitter;\n emitter.trigger('eventAdd', {\n event: eventApi,\n relatedEvents: [],\n revert: function () {\n _this.dispatch({\n type: 'REMOVE_EVENTS',\n eventStore: eventApiToStore(eventApi),\n });\n },\n });\n };\n // TODO: optimize\n CalendarApi.prototype.getEventById = function (id) {\n var state = this.getCurrentData();\n var _a = state.eventStore, defs = _a.defs, instances = _a.instances;\n id = String(id);\n for (var defId in defs) {\n var def = defs[defId];\n if (def.publicId === id) {\n if (def.recurringDef) {\n return new EventApi(state, def, null);\n }\n for (var instanceId in instances) {\n var instance = instances[instanceId];\n if (instance.defId === def.defId) {\n return new EventApi(state, def, instance);\n }\n }\n }\n }\n return null;\n };\n CalendarApi.prototype.getEvents = function () {\n var currentData = this.getCurrentData();\n return buildEventApis(currentData.eventStore, currentData);\n };\n CalendarApi.prototype.removeAllEvents = function () {\n this.dispatch({ type: 'REMOVE_ALL_EVENTS' });\n };\n // Public Event Sources API\n // -----------------------------------------------------------------------------------------------------------------\n CalendarApi.prototype.getEventSources = function () {\n var state = this.getCurrentData();\n var sourceHash = state.eventSources;\n var sourceApis = [];\n for (var internalId in sourceHash) {\n sourceApis.push(new EventSourceApi(state, sourceHash[internalId]));\n }\n return sourceApis;\n };\n CalendarApi.prototype.getEventSourceById = function (id) {\n var state = this.getCurrentData();\n var sourceHash = state.eventSources;\n id = String(id);\n for (var sourceId in sourceHash) {\n if (sourceHash[sourceId].publicId === id) {\n return new EventSourceApi(state, sourceHash[sourceId]);\n }\n }\n return null;\n };\n CalendarApi.prototype.addEventSource = function (sourceInput) {\n var state = this.getCurrentData();\n if (sourceInput instanceof EventSourceApi) {\n // not already present? don't want to add an old snapshot\n if (!state.eventSources[sourceInput.internalEventSource.sourceId]) {\n this.dispatch({\n type: 'ADD_EVENT_SOURCES',\n sources: [sourceInput.internalEventSource],\n });\n }\n return sourceInput;\n }\n var eventSource = parseEventSource(sourceInput, state);\n if (eventSource) { // TODO: error otherwise?\n this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [eventSource] });\n return new EventSourceApi(state, eventSource);\n }\n return null;\n };\n CalendarApi.prototype.removeAllEventSources = function () {\n this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' });\n };\n CalendarApi.prototype.refetchEvents = function () {\n this.dispatch({ type: 'FETCH_EVENT_SOURCES', isRefetch: true });\n };\n // Scroll\n // -----------------------------------------------------------------------------------------------------------------\n CalendarApi.prototype.scrollToTime = function (timeInput) {\n var time = createDuration(timeInput);\n if (time) {\n this.trigger('_scrollRequest', { time: time });\n }\n };\n return CalendarApi;\n}());\n\nvar EventApi = /** @class */ (function () {\n // instance will be null if expressing a recurring event that has no current instances,\n // OR if trying to validate an incoming external event that has no dates assigned\n function EventApi(context, def, instance) {\n this._context = context;\n this._def = def;\n this._instance = instance || null;\n }\n /*\n TODO: make event struct more responsible for this\n */\n EventApi.prototype.setProp = function (name, val) {\n var _a, _b;\n if (name in EVENT_DATE_REFINERS) {\n console.warn('Could not set date-related prop \\'name\\'. Use one of the date-related methods instead.');\n // TODO: make proper aliasing system?\n }\n else if (name === 'id') {\n val = EVENT_NON_DATE_REFINERS[name](val);\n this.mutate({\n standardProps: { publicId: val }, // hardcoded internal name\n });\n }\n else if (name in EVENT_NON_DATE_REFINERS) {\n val = EVENT_NON_DATE_REFINERS[name](val);\n this.mutate({\n standardProps: (_a = {}, _a[name] = val, _a),\n });\n }\n else if (name in EVENT_UI_REFINERS) {\n var ui = EVENT_UI_REFINERS[name](val);\n if (name === 'color') {\n ui = { backgroundColor: val, borderColor: val };\n }\n else if (name === 'editable') {\n ui = { startEditable: val, durationEditable: val };\n }\n else {\n ui = (_b = {}, _b[name] = val, _b);\n }\n this.mutate({\n standardProps: { ui: ui },\n });\n }\n else {\n console.warn(\"Could not set prop '\" + name + \"'. Use setExtendedProp instead.\");\n }\n };\n EventApi.prototype.setExtendedProp = function (name, val) {\n var _a;\n this.mutate({\n extendedProps: (_a = {}, _a[name] = val, _a),\n });\n };\n EventApi.prototype.setStart = function (startInput, options) {\n if (options === void 0) { options = {}; }\n var dateEnv = this._context.dateEnv;\n var start = dateEnv.createMarker(startInput);\n if (start && this._instance) { // TODO: warning if parsed bad\n var instanceRange = this._instance.range;\n var startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity); // what if parsed bad!?\n if (options.maintainDuration) {\n this.mutate({ datesDelta: startDelta });\n }\n else {\n this.mutate({ startDelta: startDelta });\n }\n }\n };\n EventApi.prototype.setEnd = function (endInput, options) {\n if (options === void 0) { options = {}; }\n var dateEnv = this._context.dateEnv;\n var end;\n if (endInput != null) {\n end = dateEnv.createMarker(endInput);\n if (!end) {\n return; // TODO: warning if parsed bad\n }\n }\n if (this._instance) {\n if (end) {\n var endDelta = diffDates(this._instance.range.end, end, dateEnv, options.granularity);\n this.mutate({ endDelta: endDelta });\n }\n else {\n this.mutate({ standardProps: { hasEnd: false } });\n }\n }\n };\n EventApi.prototype.setDates = function (startInput, endInput, options) {\n if (options === void 0) { options = {}; }\n var dateEnv = this._context.dateEnv;\n var standardProps = { allDay: options.allDay };\n var start = dateEnv.createMarker(startInput);\n var end;\n if (!start) {\n return; // TODO: warning if parsed bad\n }\n if (endInput != null) {\n end = dateEnv.createMarker(endInput);\n if (!end) { // TODO: warning if parsed bad\n return;\n }\n }\n if (this._instance) {\n var instanceRange = this._instance.range;\n // when computing the diff for an event being converted to all-day,\n // compute diff off of the all-day values the way event-mutation does.\n if (options.allDay === true) {\n instanceRange = computeAlignedDayRange(instanceRange);\n }\n var startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity);\n if (end) {\n var endDelta = diffDates(instanceRange.end, end, dateEnv, options.granularity);\n if (durationsEqual(startDelta, endDelta)) {\n this.mutate({ datesDelta: startDelta, standardProps: standardProps });\n }\n else {\n this.mutate({ startDelta: startDelta, endDelta: endDelta, standardProps: standardProps });\n }\n }\n else { // means \"clear the end\"\n standardProps.hasEnd = false;\n this.mutate({ datesDelta: startDelta, standardProps: standardProps });\n }\n }\n };\n EventApi.prototype.moveStart = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ startDelta: delta });\n }\n };\n EventApi.prototype.moveEnd = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ endDelta: delta });\n }\n };\n EventApi.prototype.moveDates = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ datesDelta: delta });\n }\n };\n EventApi.prototype.setAllDay = function (allDay, options) {\n if (options === void 0) { options = {}; }\n var standardProps = { allDay: allDay };\n var maintainDuration = options.maintainDuration;\n if (maintainDuration == null) {\n maintainDuration = this._context.options.allDayMaintainDuration;\n }\n if (this._def.allDay !== allDay) {\n standardProps.hasEnd = maintainDuration;\n }\n this.mutate({ standardProps: standardProps });\n };\n EventApi.prototype.formatRange = function (formatInput) {\n var dateEnv = this._context.dateEnv;\n var instance = this._instance;\n var formatter = createFormatter(formatInput);\n if (this._def.hasEnd) {\n return dateEnv.formatRange(instance.range.start, instance.range.end, formatter, {\n forcedStartTzo: instance.forcedStartTzo,\n forcedEndTzo: instance.forcedEndTzo,\n });\n }\n return dateEnv.format(instance.range.start, formatter, {\n forcedTzo: instance.forcedStartTzo,\n });\n };\n EventApi.prototype.mutate = function (mutation) {\n var instance = this._instance;\n if (instance) {\n var def = this._def;\n var context_1 = this._context;\n var eventStore_1 = context_1.getCurrentData().eventStore;\n var relevantEvents = getRelevantEvents(eventStore_1, instance.instanceId);\n var eventConfigBase = {\n '': {\n display: '',\n startEditable: true,\n durationEditable: true,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: [],\n },\n };\n relevantEvents = applyMutationToEventStore(relevantEvents, eventConfigBase, mutation, context_1);\n var oldEvent = new EventApi(context_1, def, instance); // snapshot\n this._def = relevantEvents.defs[def.defId];\n this._instance = relevantEvents.instances[instance.instanceId];\n context_1.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: relevantEvents,\n });\n context_1.emitter.trigger('eventChange', {\n oldEvent: oldEvent,\n event: this,\n relatedEvents: buildEventApis(relevantEvents, context_1, instance),\n revert: function () {\n context_1.dispatch({\n type: 'RESET_EVENTS',\n eventStore: eventStore_1,\n });\n },\n });\n }\n };\n EventApi.prototype.remove = function () {\n var context = this._context;\n var asStore = eventApiToStore(this);\n context.dispatch({\n type: 'REMOVE_EVENTS',\n eventStore: asStore,\n });\n context.emitter.trigger('eventRemove', {\n event: this,\n relatedEvents: [],\n revert: function () {\n context.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: asStore,\n });\n },\n });\n };\n Object.defineProperty(EventApi.prototype, \"source\", {\n get: function () {\n var sourceId = this._def.sourceId;\n if (sourceId) {\n return new EventSourceApi(this._context, this._context.getCurrentData().eventSources[sourceId]);\n }\n return null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"start\", {\n get: function () {\n return this._instance ?\n this._context.dateEnv.toDate(this._instance.range.start) :\n null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"end\", {\n get: function () {\n return (this._instance && this._def.hasEnd) ?\n this._context.dateEnv.toDate(this._instance.range.end) :\n null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"startStr\", {\n get: function () {\n var instance = this._instance;\n if (instance) {\n return this._context.dateEnv.formatIso(instance.range.start, {\n omitTime: this._def.allDay,\n forcedTzo: instance.forcedStartTzo,\n });\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"endStr\", {\n get: function () {\n var instance = this._instance;\n if (instance && this._def.hasEnd) {\n return this._context.dateEnv.formatIso(instance.range.end, {\n omitTime: this._def.allDay,\n forcedTzo: instance.forcedEndTzo,\n });\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"id\", {\n // computable props that all access the def\n // TODO: find a TypeScript-compatible way to do this at scale\n get: function () { return this._def.publicId; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"groupId\", {\n get: function () { return this._def.groupId; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"allDay\", {\n get: function () { return this._def.allDay; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"title\", {\n get: function () { return this._def.title; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"url\", {\n get: function () { return this._def.url; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"display\", {\n get: function () { return this._def.ui.display || 'auto'; } // bad. just normalize the type earlier\n ,\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"startEditable\", {\n get: function () { return this._def.ui.startEditable; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"durationEditable\", {\n get: function () { return this._def.ui.durationEditable; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"constraint\", {\n get: function () { return this._def.ui.constraints[0] || null; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"overlap\", {\n get: function () { return this._def.ui.overlap; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"allow\", {\n get: function () { return this._def.ui.allows[0] || null; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"backgroundColor\", {\n get: function () { return this._def.ui.backgroundColor; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"borderColor\", {\n get: function () { return this._def.ui.borderColor; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"textColor\", {\n get: function () { return this._def.ui.textColor; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"classNames\", {\n // NOTE: user can't modify these because Object.freeze was called in event-def parsing\n get: function () { return this._def.ui.classNames; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"extendedProps\", {\n get: function () { return this._def.extendedProps; },\n enumerable: false,\n configurable: true\n });\n EventApi.prototype.toPlainObject = function (settings) {\n if (settings === void 0) { settings = {}; }\n var def = this._def;\n var ui = def.ui;\n var _a = this, startStr = _a.startStr, endStr = _a.endStr;\n var res = {};\n if (def.title) {\n res.title = def.title;\n }\n if (startStr) {\n res.start = startStr;\n }\n if (endStr) {\n res.end = endStr;\n }\n if (def.publicId) {\n res.id = def.publicId;\n }\n if (def.groupId) {\n res.groupId = def.groupId;\n }\n if (def.url) {\n res.url = def.url;\n }\n if (ui.display && ui.display !== 'auto') {\n res.display = ui.display;\n }\n // TODO: what about recurring-event properties???\n // TODO: include startEditable/durationEditable/constraint/overlap/allow\n if (settings.collapseColor && ui.backgroundColor && ui.backgroundColor === ui.borderColor) {\n res.color = ui.backgroundColor;\n }\n else {\n if (ui.backgroundColor) {\n res.backgroundColor = ui.backgroundColor;\n }\n if (ui.borderColor) {\n res.borderColor = ui.borderColor;\n }\n }\n if (ui.textColor) {\n res.textColor = ui.textColor;\n }\n if (ui.classNames.length) {\n res.classNames = ui.classNames;\n }\n if (Object.keys(def.extendedProps).length) {\n if (settings.collapseExtendedProps) {\n __assign(res, def.extendedProps);\n }\n else {\n res.extendedProps = def.extendedProps;\n }\n }\n return res;\n };\n EventApi.prototype.toJSON = function () {\n return this.toPlainObject();\n };\n return EventApi;\n}());\nfunction eventApiToStore(eventApi) {\n var _a, _b;\n var def = eventApi._def;\n var instance = eventApi._instance;\n return {\n defs: (_a = {}, _a[def.defId] = def, _a),\n instances: instance\n ? (_b = {}, _b[instance.instanceId] = instance, _b) : {},\n };\n}\nfunction buildEventApis(eventStore, context, excludeInstance) {\n var defs = eventStore.defs, instances = eventStore.instances;\n var eventApis = [];\n var excludeInstanceId = excludeInstance ? excludeInstance.instanceId : '';\n for (var id in instances) {\n var instance = instances[id];\n var def = defs[instance.defId];\n if (instance.instanceId !== excludeInstanceId) {\n eventApis.push(new EventApi(context, def, instance));\n }\n }\n return eventApis;\n}\n\nvar calendarSystemClassMap = {};\nfunction registerCalendarSystem(name, theClass) {\n calendarSystemClassMap[name] = theClass;\n}\nfunction createCalendarSystem(name) {\n return new calendarSystemClassMap[name]();\n}\nvar GregorianCalendarSystem = /** @class */ (function () {\n function GregorianCalendarSystem() {\n }\n GregorianCalendarSystem.prototype.getMarkerYear = function (d) {\n return d.getUTCFullYear();\n };\n GregorianCalendarSystem.prototype.getMarkerMonth = function (d) {\n return d.getUTCMonth();\n };\n GregorianCalendarSystem.prototype.getMarkerDay = function (d) {\n return d.getUTCDate();\n };\n GregorianCalendarSystem.prototype.arrayToMarker = function (arr) {\n return arrayToUtcDate(arr);\n };\n GregorianCalendarSystem.prototype.markerToArray = function (marker) {\n return dateToUtcArray(marker);\n };\n return GregorianCalendarSystem;\n}());\nregisterCalendarSystem('gregory', GregorianCalendarSystem);\n\nvar ISO_RE = /^\\s*(\\d{4})(-?(\\d{2})(-?(\\d{2})([T ](\\d{2}):?(\\d{2})(:?(\\d{2})(\\.(\\d+))?)?(Z|(([-+])(\\d{2})(:?(\\d{2}))?))?)?)?)?$/;\nfunction parse(str) {\n var m = ISO_RE.exec(str);\n if (m) {\n var marker = new Date(Date.UTC(Number(m[1]), m[3] ? Number(m[3]) - 1 : 0, Number(m[5] || 1), Number(m[7] || 0), Number(m[8] || 0), Number(m[10] || 0), m[12] ? Number(\"0.\" + m[12]) * 1000 : 0));\n if (isValidDate(marker)) {\n var timeZoneOffset = null;\n if (m[13]) {\n timeZoneOffset = (m[15] === '-' ? -1 : 1) * (Number(m[16] || 0) * 60 +\n Number(m[18] || 0));\n }\n return {\n marker: marker,\n isTimeUnspecified: !m[6],\n timeZoneOffset: timeZoneOffset,\n };\n }\n }\n return null;\n}\n\nvar DateEnv = /** @class */ (function () {\n function DateEnv(settings) {\n var timeZone = this.timeZone = settings.timeZone;\n var isNamedTimeZone = timeZone !== 'local' && timeZone !== 'UTC';\n if (settings.namedTimeZoneImpl && isNamedTimeZone) {\n this.namedTimeZoneImpl = new settings.namedTimeZoneImpl(timeZone);\n }\n this.canComputeOffset = Boolean(!isNamedTimeZone || this.namedTimeZoneImpl);\n this.calendarSystem = createCalendarSystem(settings.calendarSystem);\n this.locale = settings.locale;\n this.weekDow = settings.locale.week.dow;\n this.weekDoy = settings.locale.week.doy;\n if (settings.weekNumberCalculation === 'ISO') {\n this.weekDow = 1;\n this.weekDoy = 4;\n }\n if (typeof settings.firstDay === 'number') {\n this.weekDow = settings.firstDay;\n }\n if (typeof settings.weekNumberCalculation === 'function') {\n this.weekNumberFunc = settings.weekNumberCalculation;\n }\n this.weekText = settings.weekText != null ? settings.weekText : settings.locale.options.weekText;\n this.weekTextLong = (settings.weekTextLong != null ? settings.weekTextLong : settings.locale.options.weekTextLong) || this.weekText;\n this.cmdFormatter = settings.cmdFormatter;\n this.defaultSeparator = settings.defaultSeparator;\n }\n // Creating / Parsing\n DateEnv.prototype.createMarker = function (input) {\n var meta = this.createMarkerMeta(input);\n if (meta === null) {\n return null;\n }\n return meta.marker;\n };\n DateEnv.prototype.createNowMarker = function () {\n if (this.canComputeOffset) {\n return this.timestampToMarker(new Date().valueOf());\n }\n // if we can't compute the current date val for a timezone,\n // better to give the current local date vals than UTC\n return arrayToUtcDate(dateToLocalArray(new Date()));\n };\n DateEnv.prototype.createMarkerMeta = function (input) {\n if (typeof input === 'string') {\n return this.parse(input);\n }\n var marker = null;\n if (typeof input === 'number') {\n marker = this.timestampToMarker(input);\n }\n else if (input instanceof Date) {\n input = input.valueOf();\n if (!isNaN(input)) {\n marker = this.timestampToMarker(input);\n }\n }\n else if (Array.isArray(input)) {\n marker = arrayToUtcDate(input);\n }\n if (marker === null || !isValidDate(marker)) {\n return null;\n }\n return { marker: marker, isTimeUnspecified: false, forcedTzo: null };\n };\n DateEnv.prototype.parse = function (s) {\n var parts = parse(s);\n if (parts === null) {\n return null;\n }\n var marker = parts.marker;\n var forcedTzo = null;\n if (parts.timeZoneOffset !== null) {\n if (this.canComputeOffset) {\n marker = this.timestampToMarker(marker.valueOf() - parts.timeZoneOffset * 60 * 1000);\n }\n else {\n forcedTzo = parts.timeZoneOffset;\n }\n }\n return { marker: marker, isTimeUnspecified: parts.isTimeUnspecified, forcedTzo: forcedTzo };\n };\n // Accessors\n DateEnv.prototype.getYear = function (marker) {\n return this.calendarSystem.getMarkerYear(marker);\n };\n DateEnv.prototype.getMonth = function (marker) {\n return this.calendarSystem.getMarkerMonth(marker);\n };\n // Adding / Subtracting\n DateEnv.prototype.add = function (marker, dur) {\n var a = this.calendarSystem.markerToArray(marker);\n a[0] += dur.years;\n a[1] += dur.months;\n a[2] += dur.days;\n a[6] += dur.milliseconds;\n return this.calendarSystem.arrayToMarker(a);\n };\n DateEnv.prototype.subtract = function (marker, dur) {\n var a = this.calendarSystem.markerToArray(marker);\n a[0] -= dur.years;\n a[1] -= dur.months;\n a[2] -= dur.days;\n a[6] -= dur.milliseconds;\n return this.calendarSystem.arrayToMarker(a);\n };\n DateEnv.prototype.addYears = function (marker, n) {\n var a = this.calendarSystem.markerToArray(marker);\n a[0] += n;\n return this.calendarSystem.arrayToMarker(a);\n };\n DateEnv.prototype.addMonths = function (marker, n) {\n var a = this.calendarSystem.markerToArray(marker);\n a[1] += n;\n return this.calendarSystem.arrayToMarker(a);\n };\n // Diffing Whole Units\n DateEnv.prototype.diffWholeYears = function (m0, m1) {\n var calendarSystem = this.calendarSystem;\n if (timeAsMs(m0) === timeAsMs(m1) &&\n calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1) &&\n calendarSystem.getMarkerMonth(m0) === calendarSystem.getMarkerMonth(m1)) {\n return calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0);\n }\n return null;\n };\n DateEnv.prototype.diffWholeMonths = function (m0, m1) {\n var calendarSystem = this.calendarSystem;\n if (timeAsMs(m0) === timeAsMs(m1) &&\n calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1)) {\n return (calendarSystem.getMarkerMonth(m1) - calendarSystem.getMarkerMonth(m0)) +\n (calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0)) * 12;\n }\n return null;\n };\n // Range / Duration\n DateEnv.prototype.greatestWholeUnit = function (m0, m1) {\n var n = this.diffWholeYears(m0, m1);\n if (n !== null) {\n return { unit: 'year', value: n };\n }\n n = this.diffWholeMonths(m0, m1);\n if (n !== null) {\n return { unit: 'month', value: n };\n }\n n = diffWholeWeeks(m0, m1);\n if (n !== null) {\n return { unit: 'week', value: n };\n }\n n = diffWholeDays(m0, m1);\n if (n !== null) {\n return { unit: 'day', value: n };\n }\n n = diffHours(m0, m1);\n if (isInt(n)) {\n return { unit: 'hour', value: n };\n }\n n = diffMinutes(m0, m1);\n if (isInt(n)) {\n return { unit: 'minute', value: n };\n }\n n = diffSeconds(m0, m1);\n if (isInt(n)) {\n return { unit: 'second', value: n };\n }\n return { unit: 'millisecond', value: m1.valueOf() - m0.valueOf() };\n };\n DateEnv.prototype.countDurationsBetween = function (m0, m1, d) {\n // TODO: can use greatestWholeUnit\n var diff;\n if (d.years) {\n diff = this.diffWholeYears(m0, m1);\n if (diff !== null) {\n return diff / asRoughYears(d);\n }\n }\n if (d.months) {\n diff = this.diffWholeMonths(m0, m1);\n if (diff !== null) {\n return diff / asRoughMonths(d);\n }\n }\n if (d.days) {\n diff = diffWholeDays(m0, m1);\n if (diff !== null) {\n return diff / asRoughDays(d);\n }\n }\n return (m1.valueOf() - m0.valueOf()) / asRoughMs(d);\n };\n // Start-Of\n // these DON'T return zoned-dates. only UTC start-of dates\n DateEnv.prototype.startOf = function (m, unit) {\n if (unit === 'year') {\n return this.startOfYear(m);\n }\n if (unit === 'month') {\n return this.startOfMonth(m);\n }\n if (unit === 'week') {\n return this.startOfWeek(m);\n }\n if (unit === 'day') {\n return startOfDay(m);\n }\n if (unit === 'hour') {\n return startOfHour(m);\n }\n if (unit === 'minute') {\n return startOfMinute(m);\n }\n if (unit === 'second') {\n return startOfSecond(m);\n }\n return null;\n };\n DateEnv.prototype.startOfYear = function (m) {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m),\n ]);\n };\n DateEnv.prototype.startOfMonth = function (m) {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m),\n this.calendarSystem.getMarkerMonth(m),\n ]);\n };\n DateEnv.prototype.startOfWeek = function (m) {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m),\n this.calendarSystem.getMarkerMonth(m),\n m.getUTCDate() - ((m.getUTCDay() - this.weekDow + 7) % 7),\n ]);\n };\n // Week Number\n DateEnv.prototype.computeWeekNumber = function (marker) {\n if (this.weekNumberFunc) {\n return this.weekNumberFunc(this.toDate(marker));\n }\n return weekOfYear(marker, this.weekDow, this.weekDoy);\n };\n // TODO: choke on timeZoneName: long\n DateEnv.prototype.format = function (marker, formatter, dateOptions) {\n if (dateOptions === void 0) { dateOptions = {}; }\n return formatter.format({\n marker: marker,\n timeZoneOffset: dateOptions.forcedTzo != null ?\n dateOptions.forcedTzo :\n this.offsetForMarker(marker),\n }, this);\n };\n DateEnv.prototype.formatRange = function (start, end, formatter, dateOptions) {\n if (dateOptions === void 0) { dateOptions = {}; }\n if (dateOptions.isEndExclusive) {\n end = addMs(end, -1);\n }\n return formatter.formatRange({\n marker: start,\n timeZoneOffset: dateOptions.forcedStartTzo != null ?\n dateOptions.forcedStartTzo :\n this.offsetForMarker(start),\n }, {\n marker: end,\n timeZoneOffset: dateOptions.forcedEndTzo != null ?\n dateOptions.forcedEndTzo :\n this.offsetForMarker(end),\n }, this, dateOptions.defaultSeparator);\n };\n /*\n DUMB: the omitTime arg is dumb. if we omit the time, we want to omit the timezone offset. and if we do that,\n might as well use buildIsoString or some other util directly\n */\n DateEnv.prototype.formatIso = function (marker, extraOptions) {\n if (extraOptions === void 0) { extraOptions = {}; }\n var timeZoneOffset = null;\n if (!extraOptions.omitTimeZoneOffset) {\n if (extraOptions.forcedTzo != null) {\n timeZoneOffset = extraOptions.forcedTzo;\n }\n else {\n timeZoneOffset = this.offsetForMarker(marker);\n }\n }\n return buildIsoString(marker, timeZoneOffset, extraOptions.omitTime);\n };\n // TimeZone\n DateEnv.prototype.timestampToMarker = function (ms) {\n if (this.timeZone === 'local') {\n return arrayToUtcDate(dateToLocalArray(new Date(ms)));\n }\n if (this.timeZone === 'UTC' || !this.namedTimeZoneImpl) {\n return new Date(ms);\n }\n return arrayToUtcDate(this.namedTimeZoneImpl.timestampToArray(ms));\n };\n DateEnv.prototype.offsetForMarker = function (m) {\n if (this.timeZone === 'local') {\n return -arrayToLocalDate(dateToUtcArray(m)).getTimezoneOffset(); // convert \"inverse\" offset to \"normal\" offset\n }\n if (this.timeZone === 'UTC') {\n return 0;\n }\n if (this.namedTimeZoneImpl) {\n return this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m));\n }\n return null;\n };\n // Conversion\n DateEnv.prototype.toDate = function (m, forcedTzo) {\n if (this.timeZone === 'local') {\n return arrayToLocalDate(dateToUtcArray(m));\n }\n if (this.timeZone === 'UTC') {\n return new Date(m.valueOf()); // make sure it's a copy\n }\n if (!this.namedTimeZoneImpl) {\n return new Date(m.valueOf() - (forcedTzo || 0));\n }\n return new Date(m.valueOf() -\n this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) * 1000 * 60);\n };\n return DateEnv;\n}());\n\nvar globalLocales = [];\n\nvar MINIMAL_RAW_EN_LOCALE = {\n code: 'en',\n week: {\n dow: 0,\n doy: 4, // 4 days need to be within the year to be considered the first week\n },\n direction: 'ltr',\n buttonText: {\n prev: 'prev',\n next: 'next',\n prevYear: 'prev year',\n nextYear: 'next year',\n year: 'year',\n today: 'today',\n month: 'month',\n week: 'week',\n day: 'day',\n list: 'list',\n },\n weekText: 'W',\n weekTextLong: 'Week',\n closeHint: 'Close',\n timeHint: 'Time',\n eventHint: 'Event',\n allDayText: 'all-day',\n moreLinkText: 'more',\n noEventsText: 'No events to display',\n};\nvar RAW_EN_LOCALE = __assign(__assign({}, MINIMAL_RAW_EN_LOCALE), { \n // Includes things we don't want other locales to inherit,\n // things that derive from other translatable strings.\n buttonHints: {\n prev: 'Previous $0',\n next: 'Next $0',\n today: function (buttonText, unit) {\n return (unit === 'day')\n ? 'Today'\n : \"This \" + buttonText;\n },\n }, viewHint: '$0 view', navLinkHint: 'Go to $0', moreLinkHint: function (eventCnt) {\n return \"Show \" + eventCnt + \" more event\" + (eventCnt === 1 ? '' : 's');\n } });\nfunction organizeRawLocales(explicitRawLocales) {\n var defaultCode = explicitRawLocales.length > 0 ? explicitRawLocales[0].code : 'en';\n var allRawLocales = globalLocales.concat(explicitRawLocales);\n var rawLocaleMap = {\n en: RAW_EN_LOCALE,\n };\n for (var _i = 0, allRawLocales_1 = allRawLocales; _i < allRawLocales_1.length; _i++) {\n var rawLocale = allRawLocales_1[_i];\n rawLocaleMap[rawLocale.code] = rawLocale;\n }\n return {\n map: rawLocaleMap,\n defaultCode: defaultCode,\n };\n}\nfunction buildLocale(inputSingular, available) {\n if (typeof inputSingular === 'object' && !Array.isArray(inputSingular)) {\n return parseLocale(inputSingular.code, [inputSingular.code], inputSingular);\n }\n return queryLocale(inputSingular, available);\n}\nfunction queryLocale(codeArg, available) {\n var codes = [].concat(codeArg || []); // will convert to array\n var raw = queryRawLocale(codes, available) || RAW_EN_LOCALE;\n return parseLocale(codeArg, codes, raw);\n}\nfunction queryRawLocale(codes, available) {\n for (var i = 0; i < codes.length; i += 1) {\n var parts = codes[i].toLocaleLowerCase().split('-');\n for (var j = parts.length; j > 0; j -= 1) {\n var simpleId = parts.slice(0, j).join('-');\n if (available[simpleId]) {\n return available[simpleId];\n }\n }\n }\n return null;\n}\nfunction parseLocale(codeArg, codes, raw) {\n var merged = mergeProps([MINIMAL_RAW_EN_LOCALE, raw], ['buttonText']);\n delete merged.code; // don't want this part of the options\n var week = merged.week;\n delete merged.week;\n return {\n codeArg: codeArg,\n codes: codes,\n week: week,\n simpleNumberFormat: new Intl.NumberFormat(codeArg),\n options: merged,\n };\n}\n\nfunction formatDate(dateInput, options) {\n if (options === void 0) { options = {}; }\n var dateEnv = buildDateEnv$1(options);\n var formatter = createFormatter(options);\n var dateMeta = dateEnv.createMarkerMeta(dateInput);\n if (!dateMeta) { // TODO: warning?\n return '';\n }\n return dateEnv.format(dateMeta.marker, formatter, {\n forcedTzo: dateMeta.forcedTzo,\n });\n}\nfunction formatRange(startInput, endInput, options) {\n var dateEnv = buildDateEnv$1(typeof options === 'object' && options ? options : {}); // pass in if non-null object\n var formatter = createFormatter(options);\n var startMeta = dateEnv.createMarkerMeta(startInput);\n var endMeta = dateEnv.createMarkerMeta(endInput);\n if (!startMeta || !endMeta) { // TODO: warning?\n return '';\n }\n return dateEnv.formatRange(startMeta.marker, endMeta.marker, formatter, {\n forcedStartTzo: startMeta.forcedTzo,\n forcedEndTzo: endMeta.forcedTzo,\n isEndExclusive: options.isEndExclusive,\n defaultSeparator: BASE_OPTION_DEFAULTS.defaultRangeSeparator,\n });\n}\n// TODO: more DRY and optimized\nfunction buildDateEnv$1(settings) {\n var locale = buildLocale(settings.locale || 'en', organizeRawLocales([]).map); // TODO: don't hardcode 'en' everywhere\n return new DateEnv(__assign(__assign({ timeZone: BASE_OPTION_DEFAULTS.timeZone, calendarSystem: 'gregory' }, settings), { locale: locale }));\n}\n\nvar DEF_DEFAULTS = {\n startTime: '09:00',\n endTime: '17:00',\n daysOfWeek: [1, 2, 3, 4, 5],\n display: 'inverse-background',\n classNames: 'fc-non-business',\n groupId: '_businessHours', // so multiple defs get grouped\n};\n/*\nTODO: pass around as EventDefHash!!!\n*/\nfunction parseBusinessHours(input, context) {\n return parseEvents(refineInputs(input), null, context);\n}\nfunction refineInputs(input) {\n var rawDefs;\n if (input === true) {\n rawDefs = [{}]; // will get DEF_DEFAULTS verbatim\n }\n else if (Array.isArray(input)) {\n // if specifying an array, every sub-definition NEEDS a day-of-week\n rawDefs = input.filter(function (rawDef) { return rawDef.daysOfWeek; });\n }\n else if (typeof input === 'object' && input) { // non-null object\n rawDefs = [input];\n }\n else { // is probably false\n rawDefs = [];\n }\n rawDefs = rawDefs.map(function (rawDef) { return (__assign(__assign({}, DEF_DEFAULTS), rawDef)); });\n return rawDefs;\n}\n\nfunction pointInsideRect(point, rect) {\n return point.left >= rect.left &&\n point.left < rect.right &&\n point.top >= rect.top &&\n point.top < rect.bottom;\n}\n// Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false\nfunction intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom),\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}\nfunction translateRect(rect, deltaX, deltaY) {\n return {\n left: rect.left + deltaX,\n right: rect.right + deltaX,\n top: rect.top + deltaY,\n bottom: rect.bottom + deltaY,\n };\n}\n// Returns a new point that will have been moved to reside within the given rectangle\nfunction constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom),\n };\n}\n// Returns a point that is the center of the given rectangle\nfunction getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2,\n };\n}\n// Subtracts point2's coordinates from point1's coordinates, returning a delta\nfunction diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top,\n };\n}\n\nvar canVGrowWithinCell;\nfunction getCanVGrowWithinCell() {\n if (canVGrowWithinCell == null) {\n canVGrowWithinCell = computeCanVGrowWithinCell();\n }\n return canVGrowWithinCell;\n}\nfunction computeCanVGrowWithinCell() {\n // for SSR, because this function is call immediately at top-level\n // TODO: just make this logic execute top-level, immediately, instead of doing lazily\n if (typeof document === 'undefined') {\n return true;\n }\n var el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.top = '0px';\n el.style.left = '0px';\n el.innerHTML = '
';\n el.querySelector('table').style.height = '100px';\n el.querySelector('div').style.height = '100%';\n document.body.appendChild(el);\n var div = el.querySelector('div');\n var possible = div.offsetHeight > 0;\n document.body.removeChild(el);\n return possible;\n}\n\nvar EMPTY_EVENT_STORE = createEmptyEventStore(); // for purecomponents. TODO: keep elsewhere\nvar Splitter = /** @class */ (function () {\n function Splitter() {\n this.getKeysForEventDefs = memoize(this._getKeysForEventDefs);\n this.splitDateSelection = memoize(this._splitDateSpan);\n this.splitEventStore = memoize(this._splitEventStore);\n this.splitIndividualUi = memoize(this._splitIndividualUi);\n this.splitEventDrag = memoize(this._splitInteraction);\n this.splitEventResize = memoize(this._splitInteraction);\n this.eventUiBuilders = {}; // TODO: typescript protection\n }\n Splitter.prototype.splitProps = function (props) {\n var _this = this;\n var keyInfos = this.getKeyInfo(props);\n var defKeys = this.getKeysForEventDefs(props.eventStore);\n var dateSelections = this.splitDateSelection(props.dateSelection);\n var individualUi = this.splitIndividualUi(props.eventUiBases, defKeys); // the individual *bases*\n var eventStores = this.splitEventStore(props.eventStore, defKeys);\n var eventDrags = this.splitEventDrag(props.eventDrag);\n var eventResizes = this.splitEventResize(props.eventResize);\n var splitProps = {};\n this.eventUiBuilders = mapHash(keyInfos, function (info, key) { return _this.eventUiBuilders[key] || memoize(buildEventUiForKey); });\n for (var key in keyInfos) {\n var keyInfo = keyInfos[key];\n var eventStore = eventStores[key] || EMPTY_EVENT_STORE;\n var buildEventUi = this.eventUiBuilders[key];\n splitProps[key] = {\n businessHours: keyInfo.businessHours || props.businessHours,\n dateSelection: dateSelections[key] || null,\n eventStore: eventStore,\n eventUiBases: buildEventUi(props.eventUiBases[''], keyInfo.ui, individualUi[key]),\n eventSelection: eventStore.instances[props.eventSelection] ? props.eventSelection : '',\n eventDrag: eventDrags[key] || null,\n eventResize: eventResizes[key] || null,\n };\n }\n return splitProps;\n };\n Splitter.prototype._splitDateSpan = function (dateSpan) {\n var dateSpans = {};\n if (dateSpan) {\n var keys = this.getKeysForDateSpan(dateSpan);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n dateSpans[key] = dateSpan;\n }\n }\n return dateSpans;\n };\n Splitter.prototype._getKeysForEventDefs = function (eventStore) {\n var _this = this;\n return mapHash(eventStore.defs, function (eventDef) { return _this.getKeysForEventDef(eventDef); });\n };\n Splitter.prototype._splitEventStore = function (eventStore, defKeys) {\n var defs = eventStore.defs, instances = eventStore.instances;\n var splitStores = {};\n for (var defId in defs) {\n for (var _i = 0, _a = defKeys[defId]; _i < _a.length; _i++) {\n var key = _a[_i];\n if (!splitStores[key]) {\n splitStores[key] = createEmptyEventStore();\n }\n splitStores[key].defs[defId] = defs[defId];\n }\n }\n for (var instanceId in instances) {\n var instance = instances[instanceId];\n for (var _b = 0, _c = defKeys[instance.defId]; _b < _c.length; _b++) {\n var key = _c[_b];\n if (splitStores[key]) { // must have already been created\n splitStores[key].instances[instanceId] = instance;\n }\n }\n }\n return splitStores;\n };\n Splitter.prototype._splitIndividualUi = function (eventUiBases, defKeys) {\n var splitHashes = {};\n for (var defId in eventUiBases) {\n if (defId) { // not the '' key\n for (var _i = 0, _a = defKeys[defId]; _i < _a.length; _i++) {\n var key = _a[_i];\n if (!splitHashes[key]) {\n splitHashes[key] = {};\n }\n splitHashes[key][defId] = eventUiBases[defId];\n }\n }\n }\n return splitHashes;\n };\n Splitter.prototype._splitInteraction = function (interaction) {\n var splitStates = {};\n if (interaction) {\n var affectedStores_1 = this._splitEventStore(interaction.affectedEvents, this._getKeysForEventDefs(interaction.affectedEvents));\n // can't rely on defKeys because event data is mutated\n var mutatedKeysByDefId = this._getKeysForEventDefs(interaction.mutatedEvents);\n var mutatedStores_1 = this._splitEventStore(interaction.mutatedEvents, mutatedKeysByDefId);\n var populate = function (key) {\n if (!splitStates[key]) {\n splitStates[key] = {\n affectedEvents: affectedStores_1[key] || EMPTY_EVENT_STORE,\n mutatedEvents: mutatedStores_1[key] || EMPTY_EVENT_STORE,\n isEvent: interaction.isEvent,\n };\n }\n };\n for (var key in affectedStores_1) {\n populate(key);\n }\n for (var key in mutatedStores_1) {\n populate(key);\n }\n }\n return splitStates;\n };\n return Splitter;\n}());\nfunction buildEventUiForKey(allUi, eventUiForKey, individualUi) {\n var baseParts = [];\n if (allUi) {\n baseParts.push(allUi);\n }\n if (eventUiForKey) {\n baseParts.push(eventUiForKey);\n }\n var stuff = {\n '': combineEventUis(baseParts),\n };\n if (individualUi) {\n __assign(stuff, individualUi);\n }\n return stuff;\n}\n\nfunction getDateMeta(date, todayRange, nowDate, dateProfile) {\n return {\n dow: date.getUTCDay(),\n isDisabled: Boolean(dateProfile && !rangeContainsMarker(dateProfile.activeRange, date)),\n isOther: Boolean(dateProfile && !rangeContainsMarker(dateProfile.currentRange, date)),\n isToday: Boolean(todayRange && rangeContainsMarker(todayRange, date)),\n isPast: Boolean(nowDate ? (date < nowDate) : todayRange ? (date < todayRange.start) : false),\n isFuture: Boolean(nowDate ? (date > nowDate) : todayRange ? (date >= todayRange.end) : false),\n };\n}\nfunction getDayClassNames(meta, theme) {\n var classNames = [\n 'fc-day',\n \"fc-day-\" + DAY_IDS[meta.dow],\n ];\n if (meta.isDisabled) {\n classNames.push('fc-day-disabled');\n }\n else {\n if (meta.isToday) {\n classNames.push('fc-day-today');\n classNames.push(theme.getClass('today'));\n }\n if (meta.isPast) {\n classNames.push('fc-day-past');\n }\n if (meta.isFuture) {\n classNames.push('fc-day-future');\n }\n if (meta.isOther) {\n classNames.push('fc-day-other');\n }\n }\n return classNames;\n}\nfunction getSlotClassNames(meta, theme) {\n var classNames = [\n 'fc-slot',\n \"fc-slot-\" + DAY_IDS[meta.dow],\n ];\n if (meta.isDisabled) {\n classNames.push('fc-slot-disabled');\n }\n else {\n if (meta.isToday) {\n classNames.push('fc-slot-today');\n classNames.push(theme.getClass('today'));\n }\n if (meta.isPast) {\n classNames.push('fc-slot-past');\n }\n if (meta.isFuture) {\n classNames.push('fc-slot-future');\n }\n }\n return classNames;\n}\n\nvar DAY_FORMAT = createFormatter({ year: 'numeric', month: 'long', day: 'numeric' });\nvar WEEK_FORMAT = createFormatter({ week: 'long' });\nfunction buildNavLinkAttrs(context, dateMarker, viewType, isTabbable) {\n if (viewType === void 0) { viewType = 'day'; }\n if (isTabbable === void 0) { isTabbable = true; }\n var dateEnv = context.dateEnv, options = context.options, calendarApi = context.calendarApi;\n var dateStr = dateEnv.format(dateMarker, viewType === 'week' ? WEEK_FORMAT : DAY_FORMAT);\n if (options.navLinks) {\n var zonedDate = dateEnv.toDate(dateMarker);\n var handleInteraction = function (ev) {\n var customAction = viewType === 'day' ? options.navLinkDayClick :\n viewType === 'week' ? options.navLinkWeekClick : null;\n if (typeof customAction === 'function') {\n customAction.call(calendarApi, dateEnv.toDate(dateMarker), ev);\n }\n else {\n if (typeof customAction === 'string') {\n viewType = customAction;\n }\n calendarApi.zoomTo(dateMarker, viewType);\n }\n };\n return __assign({ title: formatWithOrdinals(options.navLinkHint, [dateStr, zonedDate], dateStr), 'data-navlink': '' }, (isTabbable\n ? createAriaClickAttrs(handleInteraction)\n : { onClick: handleInteraction }));\n }\n return { 'aria-label': dateStr };\n}\n\nvar _isRtlScrollbarOnLeft = null;\nfunction getIsRtlScrollbarOnLeft() {\n if (_isRtlScrollbarOnLeft === null) {\n _isRtlScrollbarOnLeft = computeIsRtlScrollbarOnLeft();\n }\n return _isRtlScrollbarOnLeft;\n}\nfunction computeIsRtlScrollbarOnLeft() {\n var outerEl = document.createElement('div');\n applyStyle(outerEl, {\n position: 'absolute',\n top: -1000,\n left: 0,\n border: 0,\n padding: 0,\n overflow: 'scroll',\n direction: 'rtl',\n });\n outerEl.innerHTML = '
';\n document.body.appendChild(outerEl);\n var innerEl = outerEl.firstChild;\n var res = innerEl.getBoundingClientRect().left > outerEl.getBoundingClientRect().left;\n removeElement(outerEl);\n return res;\n}\n\nvar _scrollbarWidths;\nfunction getScrollbarWidths() {\n if (!_scrollbarWidths) {\n _scrollbarWidths = computeScrollbarWidths();\n }\n return _scrollbarWidths;\n}\nfunction computeScrollbarWidths() {\n var el = document.createElement('div');\n el.style.overflow = 'scroll';\n el.style.position = 'absolute';\n el.style.top = '-9999px';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n var res = computeScrollbarWidthsForEl(el);\n document.body.removeChild(el);\n return res;\n}\n// WARNING: will include border\nfunction computeScrollbarWidthsForEl(el) {\n return {\n x: el.offsetHeight - el.clientHeight,\n y: el.offsetWidth - el.clientWidth,\n };\n}\n\nfunction computeEdges(el, getPadding) {\n if (getPadding === void 0) { getPadding = false; }\n var computedStyle = window.getComputedStyle(el);\n var borderLeft = parseInt(computedStyle.borderLeftWidth, 10) || 0;\n var borderRight = parseInt(computedStyle.borderRightWidth, 10) || 0;\n var borderTop = parseInt(computedStyle.borderTopWidth, 10) || 0;\n var borderBottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;\n var badScrollbarWidths = computeScrollbarWidthsForEl(el); // includes border!\n var scrollbarLeftRight = badScrollbarWidths.y - borderLeft - borderRight;\n var scrollbarBottom = badScrollbarWidths.x - borderTop - borderBottom;\n var res = {\n borderLeft: borderLeft,\n borderRight: borderRight,\n borderTop: borderTop,\n borderBottom: borderBottom,\n scrollbarBottom: scrollbarBottom,\n scrollbarLeft: 0,\n scrollbarRight: 0,\n };\n if (getIsRtlScrollbarOnLeft() && computedStyle.direction === 'rtl') { // is the scrollbar on the left side?\n res.scrollbarLeft = scrollbarLeftRight;\n }\n else {\n res.scrollbarRight = scrollbarLeftRight;\n }\n if (getPadding) {\n res.paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;\n res.paddingRight = parseInt(computedStyle.paddingRight, 10) || 0;\n res.paddingTop = parseInt(computedStyle.paddingTop, 10) || 0;\n res.paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0;\n }\n return res;\n}\nfunction computeInnerRect(el, goWithinPadding, doFromWindowViewport) {\n if (goWithinPadding === void 0) { goWithinPadding = false; }\n var outerRect = doFromWindowViewport ? el.getBoundingClientRect() : computeRect(el);\n var edges = computeEdges(el, goWithinPadding);\n var res = {\n left: outerRect.left + edges.borderLeft + edges.scrollbarLeft,\n right: outerRect.right - edges.borderRight - edges.scrollbarRight,\n top: outerRect.top + edges.borderTop,\n bottom: outerRect.bottom - edges.borderBottom - edges.scrollbarBottom,\n };\n if (goWithinPadding) {\n res.left += edges.paddingLeft;\n res.right -= edges.paddingRight;\n res.top += edges.paddingTop;\n res.bottom -= edges.paddingBottom;\n }\n return res;\n}\nfunction computeRect(el) {\n var rect = el.getBoundingClientRect();\n return {\n left: rect.left + window.pageXOffset,\n top: rect.top + window.pageYOffset,\n right: rect.right + window.pageXOffset,\n bottom: rect.bottom + window.pageYOffset,\n };\n}\nfunction computeClippedClientRect(el) {\n var clippingParents = getClippingParents(el);\n var rect = el.getBoundingClientRect();\n for (var _i = 0, clippingParents_1 = clippingParents; _i < clippingParents_1.length; _i++) {\n var clippingParent = clippingParents_1[_i];\n var intersection = intersectRects(rect, clippingParent.getBoundingClientRect());\n if (intersection) {\n rect = intersection;\n }\n else {\n return null;\n }\n }\n return rect;\n}\nfunction computeHeightAndMargins(el) {\n return el.getBoundingClientRect().height + computeVMargins(el);\n}\nfunction computeVMargins(el) {\n var computed = window.getComputedStyle(el);\n return parseInt(computed.marginTop, 10) +\n parseInt(computed.marginBottom, 10);\n}\n// does not return window\nfunction getClippingParents(el) {\n var parents = [];\n while (el instanceof HTMLElement) { // will stop when gets to document or null\n var computedStyle = window.getComputedStyle(el);\n if (computedStyle.position === 'fixed') {\n break;\n }\n if ((/(auto|scroll)/).test(computedStyle.overflow + computedStyle.overflowY + computedStyle.overflowX)) {\n parents.push(el);\n }\n el = el.parentNode;\n }\n return parents;\n}\n\n// given a function that resolves a result asynchronously.\n// the function can either call passed-in success and failure callbacks,\n// or it can return a promise.\n// if you need to pass additional params to func, bind them first.\nfunction unpromisify(func, success, failure) {\n // guard against success/failure callbacks being called more than once\n // and guard against a promise AND callback being used together.\n var isResolved = false;\n var wrappedSuccess = function () {\n if (!isResolved) {\n isResolved = true;\n success.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n };\n var wrappedFailure = function () {\n if (!isResolved) {\n isResolved = true;\n if (failure) {\n failure.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n }\n };\n var res = func(wrappedSuccess, wrappedFailure);\n if (res && typeof res.then === 'function') {\n res.then(wrappedSuccess, wrappedFailure);\n }\n}\n\nvar Emitter = /** @class */ (function () {\n function Emitter() {\n this.handlers = {};\n this.thisContext = null;\n }\n Emitter.prototype.setThisContext = function (thisContext) {\n this.thisContext = thisContext;\n };\n Emitter.prototype.setOptions = function (options) {\n this.options = options;\n };\n Emitter.prototype.on = function (type, handler) {\n addToHash(this.handlers, type, handler);\n };\n Emitter.prototype.off = function (type, handler) {\n removeFromHash(this.handlers, type, handler);\n };\n Emitter.prototype.trigger = function (type) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var attachedHandlers = this.handlers[type] || [];\n var optionHandler = this.options && this.options[type];\n var handlers = [].concat(optionHandler || [], attachedHandlers);\n for (var _a = 0, handlers_1 = handlers; _a < handlers_1.length; _a++) {\n var handler = handlers_1[_a];\n handler.apply(this.thisContext, args);\n }\n };\n Emitter.prototype.hasHandlers = function (type) {\n return Boolean((this.handlers[type] && this.handlers[type].length) ||\n (this.options && this.options[type]));\n };\n return Emitter;\n}());\nfunction addToHash(hash, type, handler) {\n (hash[type] || (hash[type] = []))\n .push(handler);\n}\nfunction removeFromHash(hash, type, handler) {\n if (handler) {\n if (hash[type]) {\n hash[type] = hash[type].filter(function (func) { return func !== handler; });\n }\n }\n else {\n delete hash[type]; // remove all handler funcs for this type\n }\n}\n\n/*\nRecords offset information for a set of elements, relative to an origin element.\nCan record the left/right OR the top/bottom OR both.\nProvides methods for querying the cache by position.\n*/\nvar PositionCache = /** @class */ (function () {\n function PositionCache(originEl, els, isHorizontal, isVertical) {\n this.els = els;\n var originClientRect = this.originClientRect = originEl.getBoundingClientRect(); // relative to viewport top-left\n if (isHorizontal) {\n this.buildElHorizontals(originClientRect.left);\n }\n if (isVertical) {\n this.buildElVerticals(originClientRect.top);\n }\n }\n // Populates the left/right internal coordinate arrays\n PositionCache.prototype.buildElHorizontals = function (originClientLeft) {\n var lefts = [];\n var rights = [];\n for (var _i = 0, _a = this.els; _i < _a.length; _i++) {\n var el = _a[_i];\n var rect = el.getBoundingClientRect();\n lefts.push(rect.left - originClientLeft);\n rights.push(rect.right - originClientLeft);\n }\n this.lefts = lefts;\n this.rights = rights;\n };\n // Populates the top/bottom internal coordinate arrays\n PositionCache.prototype.buildElVerticals = function (originClientTop) {\n var tops = [];\n var bottoms = [];\n for (var _i = 0, _a = this.els; _i < _a.length; _i++) {\n var el = _a[_i];\n var rect = el.getBoundingClientRect();\n tops.push(rect.top - originClientTop);\n bottoms.push(rect.bottom - originClientTop);\n }\n this.tops = tops;\n this.bottoms = bottoms;\n };\n // Given a left offset (from document left), returns the index of the el that it horizontally intersects.\n // If no intersection is made, returns undefined.\n PositionCache.prototype.leftToIndex = function (leftPosition) {\n var _a = this, lefts = _a.lefts, rights = _a.rights;\n var len = lefts.length;\n var i;\n for (i = 0; i < len; i += 1) {\n if (leftPosition >= lefts[i] && leftPosition < rights[i]) {\n return i;\n }\n }\n return undefined; // TODO: better\n };\n // Given a top offset (from document top), returns the index of the el that it vertically intersects.\n // If no intersection is made, returns undefined.\n PositionCache.prototype.topToIndex = function (topPosition) {\n var _a = this, tops = _a.tops, bottoms = _a.bottoms;\n var len = tops.length;\n var i;\n for (i = 0; i < len; i += 1) {\n if (topPosition >= tops[i] && topPosition < bottoms[i]) {\n return i;\n }\n }\n return undefined; // TODO: better\n };\n // Gets the width of the element at the given index\n PositionCache.prototype.getWidth = function (leftIndex) {\n return this.rights[leftIndex] - this.lefts[leftIndex];\n };\n // Gets the height of the element at the given index\n PositionCache.prototype.getHeight = function (topIndex) {\n return this.bottoms[topIndex] - this.tops[topIndex];\n };\n return PositionCache;\n}());\n\n/* eslint max-classes-per-file: \"off\" */\n/*\nAn object for getting/setting scroll-related information for an element.\nInternally, this is done very differently for window versus DOM element,\nso this object serves as a common interface.\n*/\nvar ScrollController = /** @class */ (function () {\n function ScrollController() {\n }\n ScrollController.prototype.getMaxScrollTop = function () {\n return this.getScrollHeight() - this.getClientHeight();\n };\n ScrollController.prototype.getMaxScrollLeft = function () {\n return this.getScrollWidth() - this.getClientWidth();\n };\n ScrollController.prototype.canScrollVertically = function () {\n return this.getMaxScrollTop() > 0;\n };\n ScrollController.prototype.canScrollHorizontally = function () {\n return this.getMaxScrollLeft() > 0;\n };\n ScrollController.prototype.canScrollUp = function () {\n return this.getScrollTop() > 0;\n };\n ScrollController.prototype.canScrollDown = function () {\n return this.getScrollTop() < this.getMaxScrollTop();\n };\n ScrollController.prototype.canScrollLeft = function () {\n return this.getScrollLeft() > 0;\n };\n ScrollController.prototype.canScrollRight = function () {\n return this.getScrollLeft() < this.getMaxScrollLeft();\n };\n return ScrollController;\n}());\nvar ElementScrollController = /** @class */ (function (_super) {\n __extends(ElementScrollController, _super);\n function ElementScrollController(el) {\n var _this = _super.call(this) || this;\n _this.el = el;\n return _this;\n }\n ElementScrollController.prototype.getScrollTop = function () {\n return this.el.scrollTop;\n };\n ElementScrollController.prototype.getScrollLeft = function () {\n return this.el.scrollLeft;\n };\n ElementScrollController.prototype.setScrollTop = function (top) {\n this.el.scrollTop = top;\n };\n ElementScrollController.prototype.setScrollLeft = function (left) {\n this.el.scrollLeft = left;\n };\n ElementScrollController.prototype.getScrollWidth = function () {\n return this.el.scrollWidth;\n };\n ElementScrollController.prototype.getScrollHeight = function () {\n return this.el.scrollHeight;\n };\n ElementScrollController.prototype.getClientHeight = function () {\n return this.el.clientHeight;\n };\n ElementScrollController.prototype.getClientWidth = function () {\n return this.el.clientWidth;\n };\n return ElementScrollController;\n}(ScrollController));\nvar WindowScrollController = /** @class */ (function (_super) {\n __extends(WindowScrollController, _super);\n function WindowScrollController() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n WindowScrollController.prototype.getScrollTop = function () {\n return window.pageYOffset;\n };\n WindowScrollController.prototype.getScrollLeft = function () {\n return window.pageXOffset;\n };\n WindowScrollController.prototype.setScrollTop = function (n) {\n window.scroll(window.pageXOffset, n);\n };\n WindowScrollController.prototype.setScrollLeft = function (n) {\n window.scroll(n, window.pageYOffset);\n };\n WindowScrollController.prototype.getScrollWidth = function () {\n return document.documentElement.scrollWidth;\n };\n WindowScrollController.prototype.getScrollHeight = function () {\n return document.documentElement.scrollHeight;\n };\n WindowScrollController.prototype.getClientHeight = function () {\n return document.documentElement.clientHeight;\n };\n WindowScrollController.prototype.getClientWidth = function () {\n return document.documentElement.clientWidth;\n };\n return WindowScrollController;\n}(ScrollController));\n\nvar Theme = /** @class */ (function () {\n function Theme(calendarOptions) {\n if (this.iconOverrideOption) {\n this.setIconOverride(calendarOptions[this.iconOverrideOption]);\n }\n }\n Theme.prototype.setIconOverride = function (iconOverrideHash) {\n var iconClassesCopy;\n var buttonName;\n if (typeof iconOverrideHash === 'object' && iconOverrideHash) { // non-null object\n iconClassesCopy = __assign({}, this.iconClasses);\n for (buttonName in iconOverrideHash) {\n iconClassesCopy[buttonName] = this.applyIconOverridePrefix(iconOverrideHash[buttonName]);\n }\n this.iconClasses = iconClassesCopy;\n }\n else if (iconOverrideHash === false) {\n this.iconClasses = {};\n }\n };\n Theme.prototype.applyIconOverridePrefix = function (className) {\n var prefix = this.iconOverridePrefix;\n if (prefix && className.indexOf(prefix) !== 0) { // if not already present\n className = prefix + className;\n }\n return className;\n };\n Theme.prototype.getClass = function (key) {\n return this.classes[key] || '';\n };\n Theme.prototype.getIconClass = function (buttonName, isRtl) {\n var className;\n if (isRtl && this.rtlIconClasses) {\n className = this.rtlIconClasses[buttonName] || this.iconClasses[buttonName];\n }\n else {\n className = this.iconClasses[buttonName];\n }\n if (className) {\n return this.baseIconClass + \" \" + className;\n }\n return '';\n };\n Theme.prototype.getCustomButtonIconClass = function (customButtonProps) {\n var className;\n if (this.iconOverrideCustomButtonOption) {\n className = customButtonProps[this.iconOverrideCustomButtonOption];\n if (className) {\n return this.baseIconClass + \" \" + this.applyIconOverridePrefix(className);\n }\n }\n return '';\n };\n return Theme;\n}());\nTheme.prototype.classes = {};\nTheme.prototype.iconClasses = {};\nTheme.prototype.baseIconClass = '';\nTheme.prototype.iconOverridePrefix = '';\n\nvar ScrollResponder = /** @class */ (function () {\n function ScrollResponder(execFunc, emitter, scrollTime, scrollTimeReset) {\n var _this = this;\n this.execFunc = execFunc;\n this.emitter = emitter;\n this.scrollTime = scrollTime;\n this.scrollTimeReset = scrollTimeReset;\n this.handleScrollRequest = function (request) {\n _this.queuedRequest = __assign({}, _this.queuedRequest || {}, request);\n _this.drain();\n };\n emitter.on('_scrollRequest', this.handleScrollRequest);\n this.fireInitialScroll();\n }\n ScrollResponder.prototype.detach = function () {\n this.emitter.off('_scrollRequest', this.handleScrollRequest);\n };\n ScrollResponder.prototype.update = function (isDatesNew) {\n if (isDatesNew && this.scrollTimeReset) {\n this.fireInitialScroll(); // will drain\n }\n else {\n this.drain();\n }\n };\n ScrollResponder.prototype.fireInitialScroll = function () {\n this.handleScrollRequest({\n time: this.scrollTime,\n });\n };\n ScrollResponder.prototype.drain = function () {\n if (this.queuedRequest && this.execFunc(this.queuedRequest)) {\n this.queuedRequest = null;\n }\n };\n return ScrollResponder;\n}());\n\nvar ViewContextType = createContext({}); // for Components\nfunction buildViewContext(viewSpec, viewApi, viewOptions, dateProfileGenerator, dateEnv, theme, pluginHooks, dispatch, getCurrentData, emitter, calendarApi, registerInteractiveComponent, unregisterInteractiveComponent) {\n return {\n dateEnv: dateEnv,\n options: viewOptions,\n pluginHooks: pluginHooks,\n emitter: emitter,\n dispatch: dispatch,\n getCurrentData: getCurrentData,\n calendarApi: calendarApi,\n viewSpec: viewSpec,\n viewApi: viewApi,\n dateProfileGenerator: dateProfileGenerator,\n theme: theme,\n isRtl: viewOptions.direction === 'rtl',\n addResizeHandler: function (handler) {\n emitter.on('_resize', handler);\n },\n removeResizeHandler: function (handler) {\n emitter.off('_resize', handler);\n },\n createScrollResponder: function (execFunc) {\n return new ScrollResponder(execFunc, emitter, createDuration(viewOptions.scrollTime), viewOptions.scrollTimeReset);\n },\n registerInteractiveComponent: registerInteractiveComponent,\n unregisterInteractiveComponent: unregisterInteractiveComponent,\n };\n}\n\n/* eslint max-classes-per-file: off */\nvar PureComponent = /** @class */ (function (_super) {\n __extends(PureComponent, _super);\n function PureComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PureComponent.prototype.shouldComponentUpdate = function (nextProps, nextState) {\n if (this.debug) {\n // eslint-disable-next-line no-console\n console.log(getUnequalProps(nextProps, this.props), getUnequalProps(nextState, this.state));\n }\n return !compareObjs(this.props, nextProps, this.propEquality) ||\n !compareObjs(this.state, nextState, this.stateEquality);\n };\n // HACK for freakin' React StrictMode\n PureComponent.prototype.safeSetState = function (newState) {\n if (!compareObjs(this.state, __assign(__assign({}, this.state), newState), this.stateEquality)) {\n this.setState(newState);\n }\n };\n PureComponent.addPropsEquality = addPropsEquality;\n PureComponent.addStateEquality = addStateEquality;\n PureComponent.contextType = ViewContextType;\n return PureComponent;\n}(Component));\nPureComponent.prototype.propEquality = {};\nPureComponent.prototype.stateEquality = {};\nvar BaseComponent = /** @class */ (function (_super) {\n __extends(BaseComponent, _super);\n function BaseComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BaseComponent.contextType = ViewContextType;\n return BaseComponent;\n}(PureComponent));\nfunction addPropsEquality(propEquality) {\n var hash = Object.create(this.prototype.propEquality);\n __assign(hash, propEquality);\n this.prototype.propEquality = hash;\n}\nfunction addStateEquality(stateEquality) {\n var hash = Object.create(this.prototype.stateEquality);\n __assign(hash, stateEquality);\n this.prototype.stateEquality = hash;\n}\n// use other one\nfunction setRef(ref, current) {\n if (typeof ref === 'function') {\n ref(current);\n }\n else if (ref) {\n // see https://github.com/facebook/react/issues/13029\n ref.current = current;\n }\n}\n\n/*\nan INTERACTABLE date component\n\nPURPOSES:\n- hook up to fg, fill, and mirror renderers\n- interface for dragging and hits\n*/\nvar DateComponent = /** @class */ (function (_super) {\n __extends(DateComponent, _super);\n function DateComponent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.uid = guid();\n return _this;\n }\n // Hit System\n // -----------------------------------------------------------------------------------------------------------------\n DateComponent.prototype.prepareHits = function () {\n };\n DateComponent.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n return null; // this should be abstract\n };\n // Pointer Interaction Utils\n // -----------------------------------------------------------------------------------------------------------------\n DateComponent.prototype.isValidSegDownEl = function (el) {\n return !this.props.eventDrag && // HACK\n !this.props.eventResize && // HACK\n !elementClosest(el, '.fc-event-mirror');\n };\n DateComponent.prototype.isValidDateDownEl = function (el) {\n return !elementClosest(el, '.fc-event:not(.fc-bg-event)') &&\n !elementClosest(el, '.fc-more-link') && // a \"more..\" link\n !elementClosest(el, 'a[data-navlink]') && // a clickable nav link\n !elementClosest(el, '.fc-popover'); // hack\n };\n return DateComponent;\n}(BaseComponent));\n\n// TODO: easier way to add new hooks? need to update a million things\nfunction createPlugin(input) {\n return {\n id: guid(),\n deps: input.deps || [],\n reducers: input.reducers || [],\n isLoadingFuncs: input.isLoadingFuncs || [],\n contextInit: [].concat(input.contextInit || []),\n eventRefiners: input.eventRefiners || {},\n eventDefMemberAdders: input.eventDefMemberAdders || [],\n eventSourceRefiners: input.eventSourceRefiners || {},\n isDraggableTransformers: input.isDraggableTransformers || [],\n eventDragMutationMassagers: input.eventDragMutationMassagers || [],\n eventDefMutationAppliers: input.eventDefMutationAppliers || [],\n dateSelectionTransformers: input.dateSelectionTransformers || [],\n datePointTransforms: input.datePointTransforms || [],\n dateSpanTransforms: input.dateSpanTransforms || [],\n views: input.views || {},\n viewPropsTransformers: input.viewPropsTransformers || [],\n isPropsValid: input.isPropsValid || null,\n externalDefTransforms: input.externalDefTransforms || [],\n viewContainerAppends: input.viewContainerAppends || [],\n eventDropTransformers: input.eventDropTransformers || [],\n componentInteractions: input.componentInteractions || [],\n calendarInteractions: input.calendarInteractions || [],\n themeClasses: input.themeClasses || {},\n eventSourceDefs: input.eventSourceDefs || [],\n cmdFormatter: input.cmdFormatter,\n recurringTypes: input.recurringTypes || [],\n namedTimeZonedImpl: input.namedTimeZonedImpl,\n initialView: input.initialView || '',\n elementDraggingImpl: input.elementDraggingImpl,\n optionChangeHandlers: input.optionChangeHandlers || {},\n scrollGridImpl: input.scrollGridImpl || null,\n contentTypeHandlers: input.contentTypeHandlers || {},\n listenerRefiners: input.listenerRefiners || {},\n optionRefiners: input.optionRefiners || {},\n propSetHandlers: input.propSetHandlers || {},\n };\n}\nfunction buildPluginHooks(pluginDefs, globalDefs) {\n var isAdded = {};\n var hooks = {\n reducers: [],\n isLoadingFuncs: [],\n contextInit: [],\n eventRefiners: {},\n eventDefMemberAdders: [],\n eventSourceRefiners: {},\n isDraggableTransformers: [],\n eventDragMutationMassagers: [],\n eventDefMutationAppliers: [],\n dateSelectionTransformers: [],\n datePointTransforms: [],\n dateSpanTransforms: [],\n views: {},\n viewPropsTransformers: [],\n isPropsValid: null,\n externalDefTransforms: [],\n viewContainerAppends: [],\n eventDropTransformers: [],\n componentInteractions: [],\n calendarInteractions: [],\n themeClasses: {},\n eventSourceDefs: [],\n cmdFormatter: null,\n recurringTypes: [],\n namedTimeZonedImpl: null,\n initialView: '',\n elementDraggingImpl: null,\n optionChangeHandlers: {},\n scrollGridImpl: null,\n contentTypeHandlers: {},\n listenerRefiners: {},\n optionRefiners: {},\n propSetHandlers: {},\n };\n function addDefs(defs) {\n for (var _i = 0, defs_1 = defs; _i < defs_1.length; _i++) {\n var def = defs_1[_i];\n if (!isAdded[def.id]) {\n isAdded[def.id] = true;\n addDefs(def.deps);\n hooks = combineHooks(hooks, def);\n }\n }\n }\n if (pluginDefs) {\n addDefs(pluginDefs);\n }\n addDefs(globalDefs);\n return hooks;\n}\nfunction buildBuildPluginHooks() {\n var currentOverrideDefs = [];\n var currentGlobalDefs = [];\n var currentHooks;\n return function (overrideDefs, globalDefs) {\n if (!currentHooks || !isArraysEqual(overrideDefs, currentOverrideDefs) || !isArraysEqual(globalDefs, currentGlobalDefs)) {\n currentHooks = buildPluginHooks(overrideDefs, globalDefs);\n }\n currentOverrideDefs = overrideDefs;\n currentGlobalDefs = globalDefs;\n return currentHooks;\n };\n}\nfunction combineHooks(hooks0, hooks1) {\n return {\n reducers: hooks0.reducers.concat(hooks1.reducers),\n isLoadingFuncs: hooks0.isLoadingFuncs.concat(hooks1.isLoadingFuncs),\n contextInit: hooks0.contextInit.concat(hooks1.contextInit),\n eventRefiners: __assign(__assign({}, hooks0.eventRefiners), hooks1.eventRefiners),\n eventDefMemberAdders: hooks0.eventDefMemberAdders.concat(hooks1.eventDefMemberAdders),\n eventSourceRefiners: __assign(__assign({}, hooks0.eventSourceRefiners), hooks1.eventSourceRefiners),\n isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers),\n eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers),\n eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers),\n dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers),\n datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms),\n dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms),\n views: __assign(__assign({}, hooks0.views), hooks1.views),\n viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers),\n isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid,\n externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms),\n viewContainerAppends: hooks0.viewContainerAppends.concat(hooks1.viewContainerAppends),\n eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),\n calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),\n componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),\n themeClasses: __assign(__assign({}, hooks0.themeClasses), hooks1.themeClasses),\n eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs),\n cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter,\n recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes),\n namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl,\n initialView: hooks0.initialView || hooks1.initialView,\n elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl,\n optionChangeHandlers: __assign(__assign({}, hooks0.optionChangeHandlers), hooks1.optionChangeHandlers),\n scrollGridImpl: hooks1.scrollGridImpl || hooks0.scrollGridImpl,\n contentTypeHandlers: __assign(__assign({}, hooks0.contentTypeHandlers), hooks1.contentTypeHandlers),\n listenerRefiners: __assign(__assign({}, hooks0.listenerRefiners), hooks1.listenerRefiners),\n optionRefiners: __assign(__assign({}, hooks0.optionRefiners), hooks1.optionRefiners),\n propSetHandlers: __assign(__assign({}, hooks0.propSetHandlers), hooks1.propSetHandlers),\n };\n}\n\nvar StandardTheme = /** @class */ (function (_super) {\n __extends(StandardTheme, _super);\n function StandardTheme() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return StandardTheme;\n}(Theme));\nStandardTheme.prototype.classes = {\n root: 'fc-theme-standard',\n tableCellShaded: 'fc-cell-shaded',\n buttonGroup: 'fc-button-group',\n button: 'fc-button fc-button-primary',\n buttonActive: 'fc-button-active',\n};\nStandardTheme.prototype.baseIconClass = 'fc-icon';\nStandardTheme.prototype.iconClasses = {\n close: 'fc-icon-x',\n prev: 'fc-icon-chevron-left',\n next: 'fc-icon-chevron-right',\n prevYear: 'fc-icon-chevrons-left',\n nextYear: 'fc-icon-chevrons-right',\n};\nStandardTheme.prototype.rtlIconClasses = {\n prev: 'fc-icon-chevron-right',\n next: 'fc-icon-chevron-left',\n prevYear: 'fc-icon-chevrons-right',\n nextYear: 'fc-icon-chevrons-left',\n};\nStandardTheme.prototype.iconOverrideOption = 'buttonIcons'; // TODO: make TS-friendly\nStandardTheme.prototype.iconOverrideCustomButtonOption = 'icon';\nStandardTheme.prototype.iconOverridePrefix = 'fc-icon-';\n\nfunction compileViewDefs(defaultConfigs, overrideConfigs) {\n var hash = {};\n var viewType;\n for (viewType in defaultConfigs) {\n ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs);\n }\n for (viewType in overrideConfigs) {\n ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs);\n }\n return hash;\n}\nfunction ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs) {\n if (hash[viewType]) {\n return hash[viewType];\n }\n var viewDef = buildViewDef(viewType, hash, defaultConfigs, overrideConfigs);\n if (viewDef) {\n hash[viewType] = viewDef;\n }\n return viewDef;\n}\nfunction buildViewDef(viewType, hash, defaultConfigs, overrideConfigs) {\n var defaultConfig = defaultConfigs[viewType];\n var overrideConfig = overrideConfigs[viewType];\n var queryProp = function (name) { return ((defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] :\n ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null)); };\n var theComponent = queryProp('component');\n var superType = queryProp('superType');\n var superDef = null;\n if (superType) {\n if (superType === viewType) {\n throw new Error('Can\\'t have a custom view type that references itself');\n }\n superDef = ensureViewDef(superType, hash, defaultConfigs, overrideConfigs);\n }\n if (!theComponent && superDef) {\n theComponent = superDef.component;\n }\n if (!theComponent) {\n return null; // don't throw a warning, might be settings for a single-unit view\n }\n return {\n type: viewType,\n component: theComponent,\n defaults: __assign(__assign({}, (superDef ? superDef.defaults : {})), (defaultConfig ? defaultConfig.rawOptions : {})),\n overrides: __assign(__assign({}, (superDef ? superDef.overrides : {})), (overrideConfig ? overrideConfig.rawOptions : {})),\n };\n}\n\n/* eslint max-classes-per-file: off */\n// NOTE: in JSX, you should always use this class with arg. otherwise, will default to any???\nvar RenderHook = /** @class */ (function (_super) {\n __extends(RenderHook, _super);\n function RenderHook() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rootElRef = createRef();\n _this.handleRootEl = function (el) {\n setRef(_this.rootElRef, el);\n if (_this.props.elRef) {\n setRef(_this.props.elRef, el);\n }\n };\n return _this;\n }\n RenderHook.prototype.render = function () {\n var _this = this;\n var props = this.props;\n var hookProps = props.hookProps;\n return (createElement(MountHook, { hookProps: hookProps, didMount: props.didMount, willUnmount: props.willUnmount, elRef: this.handleRootEl }, function (rootElRef) { return (createElement(ContentHook, { hookProps: hookProps, content: props.content, defaultContent: props.defaultContent, backupElRef: _this.rootElRef }, function (innerElRef, innerContent) { return props.children(rootElRef, normalizeClassNames(props.classNames, hookProps), innerElRef, innerContent); })); }));\n };\n return RenderHook;\n}(BaseComponent));\n// TODO: rename to be about function, not default. use in above type\n// for forcing rerender of components that use the ContentHook\nvar CustomContentRenderContext = createContext(0);\nfunction ContentHook(props) {\n return (createElement(CustomContentRenderContext.Consumer, null, function (renderId) { return (createElement(ContentHookInner, __assign({ renderId: renderId }, props))); }));\n}\nvar ContentHookInner = /** @class */ (function (_super) {\n __extends(ContentHookInner, _super);\n function ContentHookInner() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.innerElRef = createRef();\n return _this;\n }\n ContentHookInner.prototype.render = function () {\n return this.props.children(this.innerElRef, this.renderInnerContent());\n };\n ContentHookInner.prototype.componentDidMount = function () {\n this.updateCustomContent();\n };\n ContentHookInner.prototype.componentDidUpdate = function () {\n this.updateCustomContent();\n };\n ContentHookInner.prototype.componentWillUnmount = function () {\n if (this.customContentInfo && this.customContentInfo.destroy) {\n this.customContentInfo.destroy();\n }\n };\n ContentHookInner.prototype.renderInnerContent = function () {\n var customContentInfo = this.customContentInfo; // only populated if using non-[p]react node(s)\n var innerContent = this.getInnerContent();\n var meta = this.getContentMeta(innerContent);\n // initial run, or content-type changing? (from vue -> react for example)\n if (!customContentInfo || customContentInfo.contentKey !== meta.contentKey) {\n // clearing old value\n if (customContentInfo) {\n if (customContentInfo.destroy) {\n customContentInfo.destroy();\n }\n customContentInfo = this.customContentInfo = null;\n }\n // assigning new value\n if (meta.contentKey) {\n customContentInfo = this.customContentInfo = __assign({ contentKey: meta.contentKey, contentVal: innerContent[meta.contentKey] }, meta.buildLifecycleFuncs());\n }\n // updating\n }\n else if (customContentInfo) {\n customContentInfo.contentVal = innerContent[meta.contentKey];\n }\n return customContentInfo\n ? [] // signal that something was specified\n : innerContent; // assume a [p]react vdom node. use it\n };\n ContentHookInner.prototype.getInnerContent = function () {\n var props = this.props;\n var innerContent = normalizeContent(props.content, props.hookProps);\n if (innerContent === undefined) { // use the default\n innerContent = normalizeContent(props.defaultContent, props.hookProps);\n }\n return innerContent == null ? null : innerContent; // convert undefined to null (better for React)\n };\n ContentHookInner.prototype.getContentMeta = function (innerContent) {\n var contentTypeHandlers = this.context.pluginHooks.contentTypeHandlers;\n var contentKey = '';\n var buildLifecycleFuncs = null;\n if (innerContent) { // allowed to be null, for convenience to caller\n for (var searchKey in contentTypeHandlers) {\n if (innerContent[searchKey] !== undefined) {\n contentKey = searchKey;\n buildLifecycleFuncs = contentTypeHandlers[searchKey];\n break;\n }\n }\n }\n return { contentKey: contentKey, buildLifecycleFuncs: buildLifecycleFuncs };\n };\n ContentHookInner.prototype.updateCustomContent = function () {\n if (this.customContentInfo) { // for non-[p]react\n this.customContentInfo.render(this.innerElRef.current || this.props.backupElRef.current, // the element to render into\n this.customContentInfo.contentVal);\n }\n };\n return ContentHookInner;\n}(BaseComponent));\nvar MountHook = /** @class */ (function (_super) {\n __extends(MountHook, _super);\n function MountHook() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handleRootEl = function (rootEl) {\n _this.rootEl = rootEl;\n if (_this.props.elRef) {\n setRef(_this.props.elRef, rootEl);\n }\n };\n return _this;\n }\n MountHook.prototype.render = function () {\n return this.props.children(this.handleRootEl);\n };\n MountHook.prototype.componentDidMount = function () {\n var callback = this.props.didMount;\n if (callback) {\n callback(__assign(__assign({}, this.props.hookProps), { el: this.rootEl }));\n }\n };\n MountHook.prototype.componentWillUnmount = function () {\n var callback = this.props.willUnmount;\n if (callback) {\n callback(__assign(__assign({}, this.props.hookProps), { el: this.rootEl }));\n }\n };\n return MountHook;\n}(BaseComponent));\nfunction buildClassNameNormalizer() {\n var currentGenerator;\n var currentHookProps;\n var currentClassNames = [];\n return function (generator, hookProps) {\n if (!currentHookProps || !isPropsEqual(currentHookProps, hookProps) || generator !== currentGenerator) {\n currentGenerator = generator;\n currentHookProps = hookProps;\n currentClassNames = normalizeClassNames(generator, hookProps);\n }\n return currentClassNames;\n };\n}\nfunction normalizeClassNames(classNames, hookProps) {\n if (typeof classNames === 'function') {\n classNames = classNames(hookProps);\n }\n return parseClassNames(classNames);\n}\nfunction normalizeContent(input, hookProps) {\n if (typeof input === 'function') {\n return input(hookProps, createElement); // give the function the vdom-creation func\n }\n return input;\n}\n\nvar ViewRoot = /** @class */ (function (_super) {\n __extends(ViewRoot, _super);\n function ViewRoot() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.normalizeClassNames = buildClassNameNormalizer();\n return _this;\n }\n ViewRoot.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var hookProps = { view: context.viewApi };\n var customClassNames = this.normalizeClassNames(options.viewClassNames, hookProps);\n return (createElement(MountHook, { hookProps: hookProps, didMount: options.viewDidMount, willUnmount: options.viewWillUnmount, elRef: props.elRef }, function (rootElRef) { return props.children(rootElRef, [\"fc-\" + props.viewSpec.type + \"-view\", 'fc-view'].concat(customClassNames)); }));\n };\n return ViewRoot;\n}(BaseComponent));\n\nfunction parseViewConfigs(inputs) {\n return mapHash(inputs, parseViewConfig);\n}\nfunction parseViewConfig(input) {\n var rawOptions = typeof input === 'function' ?\n { component: input } :\n input;\n var component = rawOptions.component;\n if (rawOptions.content) {\n component = createViewHookComponent(rawOptions);\n // TODO: remove content/classNames/didMount/etc from options?\n }\n return {\n superType: rawOptions.type,\n component: component,\n rawOptions: rawOptions,\n };\n}\nfunction createViewHookComponent(options) {\n return function (viewProps) { return (createElement(ViewContextType.Consumer, null, function (context) { return (createElement(ViewRoot, { viewSpec: context.viewSpec }, function (viewElRef, viewClassNames) {\n var hookProps = __assign(__assign({}, viewProps), { nextDayThreshold: context.options.nextDayThreshold });\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.classNames, content: options.content, didMount: options.didMount, willUnmount: options.willUnmount, elRef: viewElRef }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement(\"div\", { className: viewClassNames.concat(customClassNames).join(' '), ref: rootElRef }, innerContent)); }));\n })); })); };\n}\n\nfunction buildViewSpecs(defaultInputs, optionOverrides, dynamicOptionOverrides, localeDefaults) {\n var defaultConfigs = parseViewConfigs(defaultInputs);\n var overrideConfigs = parseViewConfigs(optionOverrides.views);\n var viewDefs = compileViewDefs(defaultConfigs, overrideConfigs);\n return mapHash(viewDefs, function (viewDef) { return buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides, localeDefaults); });\n}\nfunction buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides, localeDefaults) {\n var durationInput = viewDef.overrides.duration ||\n viewDef.defaults.duration ||\n dynamicOptionOverrides.duration ||\n optionOverrides.duration;\n var duration = null;\n var durationUnit = '';\n var singleUnit = '';\n var singleUnitOverrides = {};\n if (durationInput) {\n duration = createDurationCached(durationInput);\n if (duration) { // valid?\n var denom = greatestDurationDenominator(duration);\n durationUnit = denom.unit;\n if (denom.value === 1) {\n singleUnit = durationUnit;\n singleUnitOverrides = overrideConfigs[durationUnit] ? overrideConfigs[durationUnit].rawOptions : {};\n }\n }\n }\n var queryButtonText = function (optionsSubset) {\n var buttonTextMap = optionsSubset.buttonText || {};\n var buttonTextKey = viewDef.defaults.buttonTextKey;\n if (buttonTextKey != null && buttonTextMap[buttonTextKey] != null) {\n return buttonTextMap[buttonTextKey];\n }\n if (buttonTextMap[viewDef.type] != null) {\n return buttonTextMap[viewDef.type];\n }\n if (buttonTextMap[singleUnit] != null) {\n return buttonTextMap[singleUnit];\n }\n return null;\n };\n var queryButtonTitle = function (optionsSubset) {\n var buttonHints = optionsSubset.buttonHints || {};\n var buttonKey = viewDef.defaults.buttonTextKey; // use same key as text\n if (buttonKey != null && buttonHints[buttonKey] != null) {\n return buttonHints[buttonKey];\n }\n if (buttonHints[viewDef.type] != null) {\n return buttonHints[viewDef.type];\n }\n if (buttonHints[singleUnit] != null) {\n return buttonHints[singleUnit];\n }\n return null;\n };\n return {\n type: viewDef.type,\n component: viewDef.component,\n duration: duration,\n durationUnit: durationUnit,\n singleUnit: singleUnit,\n optionDefaults: viewDef.defaults,\n optionOverrides: __assign(__assign({}, singleUnitOverrides), viewDef.overrides),\n buttonTextOverride: queryButtonText(dynamicOptionOverrides) ||\n queryButtonText(optionOverrides) || // constructor-specified buttonText lookup hash takes precedence\n viewDef.overrides.buttonText,\n buttonTextDefault: queryButtonText(localeDefaults) ||\n viewDef.defaults.buttonText ||\n queryButtonText(BASE_OPTION_DEFAULTS) ||\n viewDef.type,\n // not DRY\n buttonTitleOverride: queryButtonTitle(dynamicOptionOverrides) ||\n queryButtonTitle(optionOverrides) ||\n viewDef.overrides.buttonHint,\n buttonTitleDefault: queryButtonTitle(localeDefaults) ||\n viewDef.defaults.buttonHint ||\n queryButtonTitle(BASE_OPTION_DEFAULTS),\n // will eventually fall back to buttonText\n };\n}\n// hack to get memoization working\nvar durationInputMap = {};\nfunction createDurationCached(durationInput) {\n var json = JSON.stringify(durationInput);\n var res = durationInputMap[json];\n if (res === undefined) {\n res = createDuration(durationInput);\n durationInputMap[json] = res;\n }\n return res;\n}\n\nvar DateProfileGenerator = /** @class */ (function () {\n function DateProfileGenerator(props) {\n this.props = props;\n this.nowDate = getNow(props.nowInput, props.dateEnv);\n this.initHiddenDays();\n }\n /* Date Range Computation\n ------------------------------------------------------------------------------------------------------------------*/\n // Builds a structure with info about what the dates/ranges will be for the \"prev\" view.\n DateProfileGenerator.prototype.buildPrev = function (currentDateProfile, currentDate, forceToValid) {\n var dateEnv = this.props.dateEnv;\n var prevDate = dateEnv.subtract(dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month\n currentDateProfile.dateIncrement);\n return this.build(prevDate, -1, forceToValid);\n };\n // Builds a structure with info about what the dates/ranges will be for the \"next\" view.\n DateProfileGenerator.prototype.buildNext = function (currentDateProfile, currentDate, forceToValid) {\n var dateEnv = this.props.dateEnv;\n var nextDate = dateEnv.add(dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month\n currentDateProfile.dateIncrement);\n return this.build(nextDate, 1, forceToValid);\n };\n // Builds a structure holding dates/ranges for rendering around the given date.\n // Optional direction param indicates whether the date is being incremented/decremented\n // from its previous value. decremented = -1, incremented = 1 (default).\n DateProfileGenerator.prototype.build = function (currentDate, direction, forceToValid) {\n if (forceToValid === void 0) { forceToValid = true; }\n var props = this.props;\n var validRange;\n var currentInfo;\n var isRangeAllDay;\n var renderRange;\n var activeRange;\n var isValid;\n validRange = this.buildValidRange();\n validRange = this.trimHiddenDays(validRange);\n if (forceToValid) {\n currentDate = constrainMarkerToRange(currentDate, validRange);\n }\n currentInfo = this.buildCurrentRangeInfo(currentDate, direction);\n isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit);\n renderRange = this.buildRenderRange(this.trimHiddenDays(currentInfo.range), currentInfo.unit, isRangeAllDay);\n renderRange = this.trimHiddenDays(renderRange);\n activeRange = renderRange;\n if (!props.showNonCurrentDates) {\n activeRange = intersectRanges(activeRange, currentInfo.range);\n }\n activeRange = this.adjustActiveRange(activeRange);\n activeRange = intersectRanges(activeRange, validRange); // might return null\n // it's invalid if the originally requested date is not contained,\n // or if the range is completely outside of the valid range.\n isValid = rangesIntersect(currentInfo.range, validRange);\n return {\n // constraint for where prev/next operations can go and where events can be dragged/resized to.\n // an object with optional start and end properties.\n validRange: validRange,\n // range the view is formally responsible for.\n // for example, a month view might have 1st-31st, excluding padded dates\n currentRange: currentInfo.range,\n // name of largest unit being displayed, like \"month\" or \"week\"\n currentRangeUnit: currentInfo.unit,\n isRangeAllDay: isRangeAllDay,\n // dates that display events and accept drag-n-drop\n // will be `null` if no dates accept events\n activeRange: activeRange,\n // date range with a rendered skeleton\n // includes not-active days that need some sort of DOM\n renderRange: renderRange,\n // Duration object that denotes the first visible time of any given day\n slotMinTime: props.slotMinTime,\n // Duration object that denotes the exclusive visible end time of any given day\n slotMaxTime: props.slotMaxTime,\n isValid: isValid,\n // how far the current date will move for a prev/next operation\n dateIncrement: this.buildDateIncrement(currentInfo.duration),\n // pass a fallback (might be null) ^\n };\n };\n // Builds an object with optional start/end properties.\n // Indicates the minimum/maximum dates to display.\n // not responsible for trimming hidden days.\n DateProfileGenerator.prototype.buildValidRange = function () {\n var input = this.props.validRangeInput;\n var simpleInput = typeof input === 'function'\n ? input.call(this.props.calendarApi, this.nowDate)\n : input;\n return this.refineRange(simpleInput) ||\n { start: null, end: null }; // completely open-ended\n };\n // Builds a structure with info about the \"current\" range, the range that is\n // highlighted as being the current month for example.\n // See build() for a description of `direction`.\n // Guaranteed to have `range` and `unit` properties. `duration` is optional.\n DateProfileGenerator.prototype.buildCurrentRangeInfo = function (date, direction) {\n var props = this.props;\n var duration = null;\n var unit = null;\n var range = null;\n var dayCount;\n if (props.duration) {\n duration = props.duration;\n unit = props.durationUnit;\n range = this.buildRangeFromDuration(date, direction, duration, unit);\n }\n else if ((dayCount = this.props.dayCount)) {\n unit = 'day';\n range = this.buildRangeFromDayCount(date, direction, dayCount);\n }\n else if ((range = this.buildCustomVisibleRange(date))) {\n unit = props.dateEnv.greatestWholeUnit(range.start, range.end).unit;\n }\n else {\n duration = this.getFallbackDuration();\n unit = greatestDurationDenominator(duration).unit;\n range = this.buildRangeFromDuration(date, direction, duration, unit);\n }\n return { duration: duration, unit: unit, range: range };\n };\n DateProfileGenerator.prototype.getFallbackDuration = function () {\n return createDuration({ day: 1 });\n };\n // Returns a new activeRange to have time values (un-ambiguate)\n // slotMinTime or slotMaxTime causes the range to expand.\n DateProfileGenerator.prototype.adjustActiveRange = function (range) {\n var _a = this.props, dateEnv = _a.dateEnv, usesMinMaxTime = _a.usesMinMaxTime, slotMinTime = _a.slotMinTime, slotMaxTime = _a.slotMaxTime;\n var start = range.start, end = range.end;\n if (usesMinMaxTime) {\n // expand active range if slotMinTime is negative (why not when positive?)\n if (asRoughDays(slotMinTime) < 0) {\n start = startOfDay(start); // necessary?\n start = dateEnv.add(start, slotMinTime);\n }\n // expand active range if slotMaxTime is beyond one day (why not when negative?)\n if (asRoughDays(slotMaxTime) > 1) {\n end = startOfDay(end); // necessary?\n end = addDays(end, -1);\n end = dateEnv.add(end, slotMaxTime);\n }\n }\n return { start: start, end: end };\n };\n // Builds the \"current\" range when it is specified as an explicit duration.\n // `unit` is the already-computed greatestDurationDenominator unit of duration.\n DateProfileGenerator.prototype.buildRangeFromDuration = function (date, direction, duration, unit) {\n var _a = this.props, dateEnv = _a.dateEnv, dateAlignment = _a.dateAlignment;\n var start;\n var end;\n var res;\n // compute what the alignment should be\n if (!dateAlignment) {\n var dateIncrement = this.props.dateIncrement;\n if (dateIncrement) {\n // use the smaller of the two units\n if (asRoughMs(dateIncrement) < asRoughMs(duration)) {\n dateAlignment = greatestDurationDenominator(dateIncrement).unit;\n }\n else {\n dateAlignment = unit;\n }\n }\n else {\n dateAlignment = unit;\n }\n }\n // if the view displays a single day or smaller\n if (asRoughDays(duration) <= 1) {\n if (this.isHiddenDay(start)) {\n start = this.skipHiddenDays(start, direction);\n start = startOfDay(start);\n }\n }\n function computeRes() {\n start = dateEnv.startOf(date, dateAlignment);\n end = dateEnv.add(start, duration);\n res = { start: start, end: end };\n }\n computeRes();\n // if range is completely enveloped by hidden days, go past the hidden days\n if (!this.trimHiddenDays(res)) {\n date = this.skipHiddenDays(date, direction);\n computeRes();\n }\n return res;\n };\n // Builds the \"current\" range when a dayCount is specified.\n DateProfileGenerator.prototype.buildRangeFromDayCount = function (date, direction, dayCount) {\n var _a = this.props, dateEnv = _a.dateEnv, dateAlignment = _a.dateAlignment;\n var runningCount = 0;\n var start = date;\n var end;\n if (dateAlignment) {\n start = dateEnv.startOf(start, dateAlignment);\n }\n start = startOfDay(start);\n start = this.skipHiddenDays(start, direction);\n end = start;\n do {\n end = addDays(end, 1);\n if (!this.isHiddenDay(end)) {\n runningCount += 1;\n }\n } while (runningCount < dayCount);\n return { start: start, end: end };\n };\n // Builds a normalized range object for the \"visible\" range,\n // which is a way to define the currentRange and activeRange at the same time.\n DateProfileGenerator.prototype.buildCustomVisibleRange = function (date) {\n var props = this.props;\n var input = props.visibleRangeInput;\n var simpleInput = typeof input === 'function'\n ? input.call(props.calendarApi, props.dateEnv.toDate(date))\n : input;\n var range = this.refineRange(simpleInput);\n if (range && (range.start == null || range.end == null)) {\n return null;\n }\n return range;\n };\n // Computes the range that will represent the element/cells for *rendering*,\n // but which may have voided days/times.\n // not responsible for trimming hidden days.\n DateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) {\n return currentRange;\n };\n // Compute the duration value that should be added/substracted to the current date\n // when a prev/next operation happens.\n DateProfileGenerator.prototype.buildDateIncrement = function (fallback) {\n var dateIncrement = this.props.dateIncrement;\n var customAlignment;\n if (dateIncrement) {\n return dateIncrement;\n }\n if ((customAlignment = this.props.dateAlignment)) {\n return createDuration(1, customAlignment);\n }\n if (fallback) {\n return fallback;\n }\n return createDuration({ days: 1 });\n };\n DateProfileGenerator.prototype.refineRange = function (rangeInput) {\n if (rangeInput) {\n var range = parseRange(rangeInput, this.props.dateEnv);\n if (range) {\n range = computeVisibleDayRange(range);\n }\n return range;\n }\n return null;\n };\n /* Hidden Days\n ------------------------------------------------------------------------------------------------------------------*/\n // Initializes internal variables related to calculating hidden days-of-week\n DateProfileGenerator.prototype.initHiddenDays = function () {\n var hiddenDays = this.props.hiddenDays || []; // array of day-of-week indices that are hidden\n var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool)\n var dayCnt = 0;\n var i;\n if (this.props.weekends === false) {\n hiddenDays.push(0, 6); // 0=sunday, 6=saturday\n }\n for (i = 0; i < 7; i += 1) {\n if (!(isHiddenDayHash[i] = hiddenDays.indexOf(i) !== -1)) {\n dayCnt += 1;\n }\n }\n if (!dayCnt) {\n throw new Error('invalid hiddenDays'); // all days were hidden? bad.\n }\n this.isHiddenDayHash = isHiddenDayHash;\n };\n // Remove days from the beginning and end of the range that are computed as hidden.\n // If the whole range is trimmed off, returns null\n DateProfileGenerator.prototype.trimHiddenDays = function (range) {\n var start = range.start, end = range.end;\n if (start) {\n start = this.skipHiddenDays(start);\n }\n if (end) {\n end = this.skipHiddenDays(end, -1, true);\n }\n if (start == null || end == null || start < end) {\n return { start: start, end: end };\n }\n return null;\n };\n // Is the current day hidden?\n // `day` is a day-of-week index (0-6), or a Date (used for UTC)\n DateProfileGenerator.prototype.isHiddenDay = function (day) {\n if (day instanceof Date) {\n day = day.getUTCDay();\n }\n return this.isHiddenDayHash[day];\n };\n // Incrementing the current day until it is no longer a hidden day, returning a copy.\n // DOES NOT CONSIDER validRange!\n // If the initial value of `date` is not a hidden day, don't do anything.\n // Pass `isExclusive` as `true` if you are dealing with an end date.\n // `inc` defaults to `1` (increment one day forward each time)\n DateProfileGenerator.prototype.skipHiddenDays = function (date, inc, isExclusive) {\n if (inc === void 0) { inc = 1; }\n if (isExclusive === void 0) { isExclusive = false; }\n while (this.isHiddenDayHash[(date.getUTCDay() + (isExclusive ? inc : 0) + 7) % 7]) {\n date = addDays(date, inc);\n }\n return date;\n };\n return DateProfileGenerator;\n}());\n\nfunction reduceViewType(viewType, action) {\n switch (action.type) {\n case 'CHANGE_VIEW_TYPE':\n viewType = action.viewType;\n }\n return viewType;\n}\n\nfunction reduceDynamicOptionOverrides(dynamicOptionOverrides, action) {\n var _a;\n switch (action.type) {\n case 'SET_OPTION':\n return __assign(__assign({}, dynamicOptionOverrides), (_a = {}, _a[action.optionName] = action.rawOptionValue, _a));\n default:\n return dynamicOptionOverrides;\n }\n}\n\nfunction reduceDateProfile(currentDateProfile, action, currentDate, dateProfileGenerator) {\n var dp;\n switch (action.type) {\n case 'CHANGE_VIEW_TYPE':\n return dateProfileGenerator.build(action.dateMarker || currentDate);\n case 'CHANGE_DATE':\n return dateProfileGenerator.build(action.dateMarker);\n case 'PREV':\n dp = dateProfileGenerator.buildPrev(currentDateProfile, currentDate);\n if (dp.isValid) {\n return dp;\n }\n break;\n case 'NEXT':\n dp = dateProfileGenerator.buildNext(currentDateProfile, currentDate);\n if (dp.isValid) {\n return dp;\n }\n break;\n }\n return currentDateProfile;\n}\n\nfunction initEventSources(calendarOptions, dateProfile, context) {\n var activeRange = dateProfile ? dateProfile.activeRange : null;\n return addSources({}, parseInitialSources(calendarOptions, context), activeRange, context);\n}\nfunction reduceEventSources(eventSources, action, dateProfile, context) {\n var activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?\n switch (action.type) {\n case 'ADD_EVENT_SOURCES': // already parsed\n return addSources(eventSources, action.sources, activeRange, context);\n case 'REMOVE_EVENT_SOURCE':\n return removeSource(eventSources, action.sourceId);\n case 'PREV': // TODO: how do we track all actions that affect dateProfile :(\n case 'NEXT':\n case 'CHANGE_DATE':\n case 'CHANGE_VIEW_TYPE':\n if (dateProfile) {\n return fetchDirtySources(eventSources, activeRange, context);\n }\n return eventSources;\n case 'FETCH_EVENT_SOURCES':\n return fetchSourcesByIds(eventSources, action.sourceIds ? // why no type?\n arrayToHash(action.sourceIds) :\n excludeStaticSources(eventSources, context), activeRange, action.isRefetch || false, context);\n case 'RECEIVE_EVENTS':\n case 'RECEIVE_EVENT_ERROR':\n return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange);\n case 'REMOVE_ALL_EVENT_SOURCES':\n return {};\n default:\n return eventSources;\n }\n}\nfunction reduceEventSourcesNewTimeZone(eventSources, dateProfile, context) {\n var activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?\n return fetchSourcesByIds(eventSources, excludeStaticSources(eventSources, context), activeRange, true, context);\n}\nfunction computeEventSourcesLoading(eventSources) {\n for (var sourceId in eventSources) {\n if (eventSources[sourceId].isFetching) {\n return true;\n }\n }\n return false;\n}\nfunction addSources(eventSourceHash, sources, fetchRange, context) {\n var hash = {};\n for (var _i = 0, sources_1 = sources; _i < sources_1.length; _i++) {\n var source = sources_1[_i];\n hash[source.sourceId] = source;\n }\n if (fetchRange) {\n hash = fetchDirtySources(hash, fetchRange, context);\n }\n return __assign(__assign({}, eventSourceHash), hash);\n}\nfunction removeSource(eventSourceHash, sourceId) {\n return filterHash(eventSourceHash, function (eventSource) { return eventSource.sourceId !== sourceId; });\n}\nfunction fetchDirtySources(sourceHash, fetchRange, context) {\n return fetchSourcesByIds(sourceHash, filterHash(sourceHash, function (eventSource) { return isSourceDirty(eventSource, fetchRange, context); }), fetchRange, false, context);\n}\nfunction isSourceDirty(eventSource, fetchRange, context) {\n if (!doesSourceNeedRange(eventSource, context)) {\n return !eventSource.latestFetchId;\n }\n return !context.options.lazyFetching ||\n !eventSource.fetchRange ||\n eventSource.isFetching || // always cancel outdated in-progress fetches\n fetchRange.start < eventSource.fetchRange.start ||\n fetchRange.end > eventSource.fetchRange.end;\n}\nfunction fetchSourcesByIds(prevSources, sourceIdHash, fetchRange, isRefetch, context) {\n var nextSources = {};\n for (var sourceId in prevSources) {\n var source = prevSources[sourceId];\n if (sourceIdHash[sourceId]) {\n nextSources[sourceId] = fetchSource(source, fetchRange, isRefetch, context);\n }\n else {\n nextSources[sourceId] = source;\n }\n }\n return nextSources;\n}\nfunction fetchSource(eventSource, fetchRange, isRefetch, context) {\n var options = context.options, calendarApi = context.calendarApi;\n var sourceDef = context.pluginHooks.eventSourceDefs[eventSource.sourceDefId];\n var fetchId = guid();\n sourceDef.fetch({\n eventSource: eventSource,\n range: fetchRange,\n isRefetch: isRefetch,\n context: context,\n }, function (res) {\n var rawEvents = res.rawEvents;\n if (options.eventSourceSuccess) {\n rawEvents = options.eventSourceSuccess.call(calendarApi, rawEvents, res.xhr) || rawEvents;\n }\n if (eventSource.success) {\n rawEvents = eventSource.success.call(calendarApi, rawEvents, res.xhr) || rawEvents;\n }\n context.dispatch({\n type: 'RECEIVE_EVENTS',\n sourceId: eventSource.sourceId,\n fetchId: fetchId,\n fetchRange: fetchRange,\n rawEvents: rawEvents,\n });\n }, function (error) {\n console.warn(error.message, error);\n if (options.eventSourceFailure) {\n options.eventSourceFailure.call(calendarApi, error);\n }\n if (eventSource.failure) {\n eventSource.failure(error);\n }\n context.dispatch({\n type: 'RECEIVE_EVENT_ERROR',\n sourceId: eventSource.sourceId,\n fetchId: fetchId,\n fetchRange: fetchRange,\n error: error,\n });\n });\n return __assign(__assign({}, eventSource), { isFetching: true, latestFetchId: fetchId });\n}\nfunction receiveResponse(sourceHash, sourceId, fetchId, fetchRange) {\n var _a;\n var eventSource = sourceHash[sourceId];\n if (eventSource && // not already removed\n fetchId === eventSource.latestFetchId) {\n return __assign(__assign({}, sourceHash), (_a = {}, _a[sourceId] = __assign(__assign({}, eventSource), { isFetching: false, fetchRange: fetchRange }), _a));\n }\n return sourceHash;\n}\nfunction excludeStaticSources(eventSources, context) {\n return filterHash(eventSources, function (eventSource) { return doesSourceNeedRange(eventSource, context); });\n}\nfunction parseInitialSources(rawOptions, context) {\n var refiners = buildEventSourceRefiners(context);\n var rawSources = [].concat(rawOptions.eventSources || []);\n var sources = []; // parsed\n if (rawOptions.initialEvents) {\n rawSources.unshift(rawOptions.initialEvents);\n }\n if (rawOptions.events) {\n rawSources.unshift(rawOptions.events);\n }\n for (var _i = 0, rawSources_1 = rawSources; _i < rawSources_1.length; _i++) {\n var rawSource = rawSources_1[_i];\n var source = parseEventSource(rawSource, context, refiners);\n if (source) {\n sources.push(source);\n }\n }\n return sources;\n}\nfunction doesSourceNeedRange(eventSource, context) {\n var defs = context.pluginHooks.eventSourceDefs;\n return !defs[eventSource.sourceDefId].ignoreRange;\n}\n\nfunction reduceEventStore(eventStore, action, eventSources, dateProfile, context) {\n switch (action.type) {\n case 'RECEIVE_EVENTS': // raw\n return receiveRawEvents(eventStore, eventSources[action.sourceId], action.fetchId, action.fetchRange, action.rawEvents, context);\n case 'ADD_EVENTS': // already parsed, but not expanded\n return addEvent(eventStore, action.eventStore, // new ones\n dateProfile ? dateProfile.activeRange : null, context);\n case 'RESET_EVENTS':\n return action.eventStore;\n case 'MERGE_EVENTS': // already parsed and expanded\n return mergeEventStores(eventStore, action.eventStore);\n case 'PREV': // TODO: how do we track all actions that affect dateProfile :(\n case 'NEXT':\n case 'CHANGE_DATE':\n case 'CHANGE_VIEW_TYPE':\n if (dateProfile) {\n return expandRecurring(eventStore, dateProfile.activeRange, context);\n }\n return eventStore;\n case 'REMOVE_EVENTS':\n return excludeSubEventStore(eventStore, action.eventStore);\n case 'REMOVE_EVENT_SOURCE':\n return excludeEventsBySourceId(eventStore, action.sourceId);\n case 'REMOVE_ALL_EVENT_SOURCES':\n return filterEventStoreDefs(eventStore, function (eventDef) { return (!eventDef.sourceId // only keep events with no source id\n ); });\n case 'REMOVE_ALL_EVENTS':\n return createEmptyEventStore();\n default:\n return eventStore;\n }\n}\nfunction receiveRawEvents(eventStore, eventSource, fetchId, fetchRange, rawEvents, context) {\n if (eventSource && // not already removed\n fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources\n ) {\n var subset = parseEvents(transformRawEvents(rawEvents, eventSource, context), eventSource, context);\n if (fetchRange) {\n subset = expandRecurring(subset, fetchRange, context);\n }\n return mergeEventStores(excludeEventsBySourceId(eventStore, eventSource.sourceId), subset);\n }\n return eventStore;\n}\nfunction transformRawEvents(rawEvents, eventSource, context) {\n var calEachTransform = context.options.eventDataTransform;\n var sourceEachTransform = eventSource ? eventSource.eventDataTransform : null;\n if (sourceEachTransform) {\n rawEvents = transformEachRawEvent(rawEvents, sourceEachTransform);\n }\n if (calEachTransform) {\n rawEvents = transformEachRawEvent(rawEvents, calEachTransform);\n }\n return rawEvents;\n}\nfunction transformEachRawEvent(rawEvents, func) {\n var refinedEvents;\n if (!func) {\n refinedEvents = rawEvents;\n }\n else {\n refinedEvents = [];\n for (var _i = 0, rawEvents_1 = rawEvents; _i < rawEvents_1.length; _i++) {\n var rawEvent = rawEvents_1[_i];\n var refinedEvent = func(rawEvent);\n if (refinedEvent) {\n refinedEvents.push(refinedEvent);\n }\n else if (refinedEvent == null) {\n refinedEvents.push(rawEvent);\n } // if a different falsy value, do nothing\n }\n }\n return refinedEvents;\n}\nfunction addEvent(eventStore, subset, expandRange, context) {\n if (expandRange) {\n subset = expandRecurring(subset, expandRange, context);\n }\n return mergeEventStores(eventStore, subset);\n}\nfunction rezoneEventStoreDates(eventStore, oldDateEnv, newDateEnv) {\n var defs = eventStore.defs;\n var instances = mapHash(eventStore.instances, function (instance) {\n var def = defs[instance.defId];\n if (def.allDay || def.recurringDef) {\n return instance; // isn't dependent on timezone\n }\n return __assign(__assign({}, instance), { range: {\n start: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.start, instance.forcedStartTzo)),\n end: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.end, instance.forcedEndTzo)),\n }, forcedStartTzo: newDateEnv.canComputeOffset ? null : instance.forcedStartTzo, forcedEndTzo: newDateEnv.canComputeOffset ? null : instance.forcedEndTzo });\n });\n return { defs: defs, instances: instances };\n}\nfunction excludeEventsBySourceId(eventStore, sourceId) {\n return filterEventStoreDefs(eventStore, function (eventDef) { return eventDef.sourceId !== sourceId; });\n}\n// QUESTION: why not just return instances? do a general object-property-exclusion util\nfunction excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) { return !removals[instance.instanceId]; }),\n };\n}\n\nfunction reduceDateSelection(currentSelection, action) {\n switch (action.type) {\n case 'UNSELECT_DATES':\n return null;\n case 'SELECT_DATES':\n return action.selection;\n default:\n return currentSelection;\n }\n}\n\nfunction reduceSelectedEvent(currentInstanceId, action) {\n switch (action.type) {\n case 'UNSELECT_EVENT':\n return '';\n case 'SELECT_EVENT':\n return action.eventInstanceId;\n default:\n return currentInstanceId;\n }\n}\n\nfunction reduceEventDrag(currentDrag, action) {\n var newDrag;\n switch (action.type) {\n case 'UNSET_EVENT_DRAG':\n return null;\n case 'SET_EVENT_DRAG':\n newDrag = action.state;\n return {\n affectedEvents: newDrag.affectedEvents,\n mutatedEvents: newDrag.mutatedEvents,\n isEvent: newDrag.isEvent,\n };\n default:\n return currentDrag;\n }\n}\n\nfunction reduceEventResize(currentResize, action) {\n var newResize;\n switch (action.type) {\n case 'UNSET_EVENT_RESIZE':\n return null;\n case 'SET_EVENT_RESIZE':\n newResize = action.state;\n return {\n affectedEvents: newResize.affectedEvents,\n mutatedEvents: newResize.mutatedEvents,\n isEvent: newResize.isEvent,\n };\n default:\n return currentResize;\n }\n}\n\nfunction parseToolbars(calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) {\n var header = calendarOptions.headerToolbar ? parseToolbar(calendarOptions.headerToolbar, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) : null;\n var footer = calendarOptions.footerToolbar ? parseToolbar(calendarOptions.footerToolbar, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) : null;\n return { header: header, footer: footer };\n}\nfunction parseToolbar(sectionStrHash, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) {\n var sectionWidgets = {};\n var viewsWithButtons = [];\n var hasTitle = false;\n for (var sectionName in sectionStrHash) {\n var sectionStr = sectionStrHash[sectionName];\n var sectionRes = parseSection(sectionStr, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi);\n sectionWidgets[sectionName] = sectionRes.widgets;\n viewsWithButtons.push.apply(viewsWithButtons, sectionRes.viewsWithButtons);\n hasTitle = hasTitle || sectionRes.hasTitle;\n }\n return { sectionWidgets: sectionWidgets, viewsWithButtons: viewsWithButtons, hasTitle: hasTitle };\n}\n/*\nBAD: querying icons and text here. should be done at render time\n*/\nfunction parseSection(sectionStr, calendarOptions, // defaults+overrides, then refined\ncalendarOptionOverrides, // overrides only!, unrefined :(\ntheme, viewSpecs, calendarApi) {\n var isRtl = calendarOptions.direction === 'rtl';\n var calendarCustomButtons = calendarOptions.customButtons || {};\n var calendarButtonTextOverrides = calendarOptionOverrides.buttonText || {};\n var calendarButtonText = calendarOptions.buttonText || {};\n var calendarButtonHintOverrides = calendarOptionOverrides.buttonHints || {};\n var calendarButtonHints = calendarOptions.buttonHints || {};\n var sectionSubstrs = sectionStr ? sectionStr.split(' ') : [];\n var viewsWithButtons = [];\n var hasTitle = false;\n var widgets = sectionSubstrs.map(function (buttonGroupStr) { return (buttonGroupStr.split(',').map(function (buttonName) {\n if (buttonName === 'title') {\n hasTitle = true;\n return { buttonName: buttonName };\n }\n var customButtonProps;\n var viewSpec;\n var buttonClick;\n var buttonIcon; // only one of these will be set\n var buttonText; // \"\n var buttonHint;\n // ^ for the title=\"\" attribute, for accessibility\n if ((customButtonProps = calendarCustomButtons[buttonName])) {\n buttonClick = function (ev) {\n if (customButtonProps.click) {\n customButtonProps.click.call(ev.target, ev, ev.target); // TODO: use Calendar this context?\n }\n };\n (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) ||\n (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||\n (buttonText = customButtonProps.text);\n buttonHint = customButtonProps.hint || customButtonProps.text;\n }\n else if ((viewSpec = viewSpecs[buttonName])) {\n viewsWithButtons.push(buttonName);\n buttonClick = function () {\n calendarApi.changeView(buttonName);\n };\n (buttonText = viewSpec.buttonTextOverride) ||\n (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||\n (buttonText = viewSpec.buttonTextDefault);\n var textFallback = viewSpec.buttonTextOverride ||\n viewSpec.buttonTextDefault;\n buttonHint = formatWithOrdinals(viewSpec.buttonTitleOverride ||\n viewSpec.buttonTitleDefault ||\n calendarOptions.viewHint, [textFallback, buttonName], // view-name = buttonName\n textFallback);\n }\n else if (calendarApi[buttonName]) { // a calendarApi method\n buttonClick = function () {\n calendarApi[buttonName]();\n };\n (buttonText = calendarButtonTextOverrides[buttonName]) ||\n (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||\n (buttonText = calendarButtonText[buttonName]); // everything else is considered default\n if (buttonName === 'prevYear' || buttonName === 'nextYear') {\n var prevOrNext = buttonName === 'prevYear' ? 'prev' : 'next';\n buttonHint = formatWithOrdinals(calendarButtonHintOverrides[prevOrNext] ||\n calendarButtonHints[prevOrNext], [\n calendarButtonText.year || 'year',\n 'year',\n ], calendarButtonText[buttonName]);\n }\n else {\n buttonHint = function (navUnit) { return formatWithOrdinals(calendarButtonHintOverrides[buttonName] ||\n calendarButtonHints[buttonName], [\n calendarButtonText[navUnit] || navUnit,\n navUnit,\n ], calendarButtonText[buttonName]); };\n }\n }\n return { buttonName: buttonName, buttonClick: buttonClick, buttonIcon: buttonIcon, buttonText: buttonText, buttonHint: buttonHint };\n })); });\n return { widgets: widgets, viewsWithButtons: viewsWithButtons, hasTitle: hasTitle };\n}\n\nvar eventSourceDef$2 = {\n ignoreRange: true,\n parseMeta: function (refined) {\n if (Array.isArray(refined.events)) {\n return refined.events;\n }\n return null;\n },\n fetch: function (arg, success) {\n success({\n rawEvents: arg.eventSource.meta,\n });\n },\n};\nvar arrayEventSourcePlugin = createPlugin({\n eventSourceDefs: [eventSourceDef$2],\n});\n\nvar eventSourceDef$1 = {\n parseMeta: function (refined) {\n if (typeof refined.events === 'function') {\n return refined.events;\n }\n return null;\n },\n fetch: function (arg, success, failure) {\n var dateEnv = arg.context.dateEnv;\n var func = arg.eventSource.meta;\n unpromisify(func.bind(null, buildRangeApiWithTimeZone(arg.range, dateEnv)), function (rawEvents) {\n success({ rawEvents: rawEvents }); // needs an object response\n }, failure);\n },\n};\nvar funcEventSourcePlugin = createPlugin({\n eventSourceDefs: [eventSourceDef$1],\n});\n\nfunction requestJson(method, url, params, successCallback, failureCallback) {\n method = method.toUpperCase();\n var body = null;\n if (method === 'GET') {\n url = injectQueryStringParams(url, params);\n }\n else {\n body = encodeParams(params);\n }\n var xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n if (method !== 'GET') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n }\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 400) {\n var parsed = false;\n var res = void 0;\n try {\n res = JSON.parse(xhr.responseText);\n parsed = true;\n }\n catch (err) {\n // will handle parsed=false\n }\n if (parsed) {\n successCallback(res, xhr);\n }\n else {\n failureCallback('Failure parsing JSON', xhr);\n }\n }\n else {\n failureCallback('Request failed', xhr);\n }\n };\n xhr.onerror = function () {\n failureCallback('Request failed', xhr);\n };\n xhr.send(body);\n}\nfunction injectQueryStringParams(url, params) {\n return url +\n (url.indexOf('?') === -1 ? '?' : '&') +\n encodeParams(params);\n}\nfunction encodeParams(params) {\n var parts = [];\n for (var key in params) {\n parts.push(encodeURIComponent(key) + \"=\" + encodeURIComponent(params[key]));\n }\n return parts.join('&');\n}\n\nvar JSON_FEED_EVENT_SOURCE_REFINERS = {\n method: String,\n extraParams: identity,\n startParam: String,\n endParam: String,\n timeZoneParam: String,\n};\n\nvar eventSourceDef = {\n parseMeta: function (refined) {\n if (refined.url && (refined.format === 'json' || !refined.format)) {\n return {\n url: refined.url,\n format: 'json',\n method: (refined.method || 'GET').toUpperCase(),\n extraParams: refined.extraParams,\n startParam: refined.startParam,\n endParam: refined.endParam,\n timeZoneParam: refined.timeZoneParam,\n };\n }\n return null;\n },\n fetch: function (arg, success, failure) {\n var meta = arg.eventSource.meta;\n var requestParams = buildRequestParams(meta, arg.range, arg.context);\n requestJson(meta.method, meta.url, requestParams, function (rawEvents, xhr) {\n success({ rawEvents: rawEvents, xhr: xhr });\n }, function (errorMessage, xhr) {\n failure({ message: errorMessage, xhr: xhr });\n });\n },\n};\nvar jsonFeedEventSourcePlugin = createPlugin({\n eventSourceRefiners: JSON_FEED_EVENT_SOURCE_REFINERS,\n eventSourceDefs: [eventSourceDef],\n});\nfunction buildRequestParams(meta, range, context) {\n var dateEnv = context.dateEnv, options = context.options;\n var startParam;\n var endParam;\n var timeZoneParam;\n var customRequestParams;\n var params = {};\n startParam = meta.startParam;\n if (startParam == null) {\n startParam = options.startParam;\n }\n endParam = meta.endParam;\n if (endParam == null) {\n endParam = options.endParam;\n }\n timeZoneParam = meta.timeZoneParam;\n if (timeZoneParam == null) {\n timeZoneParam = options.timeZoneParam;\n }\n // retrieve any outbound GET/POST data from the options\n if (typeof meta.extraParams === 'function') {\n // supplied as a function that returns a key/value object\n customRequestParams = meta.extraParams();\n }\n else {\n // probably supplied as a straight key/value object\n customRequestParams = meta.extraParams || {};\n }\n __assign(params, customRequestParams);\n params[startParam] = dateEnv.formatIso(range.start);\n params[endParam] = dateEnv.formatIso(range.end);\n if (dateEnv.timeZone !== 'local') {\n params[timeZoneParam] = dateEnv.timeZone;\n }\n return params;\n}\n\nvar SIMPLE_RECURRING_REFINERS = {\n daysOfWeek: identity,\n startTime: createDuration,\n endTime: createDuration,\n duration: createDuration,\n startRecur: identity,\n endRecur: identity,\n};\n\nvar recurring = {\n parse: function (refined, dateEnv) {\n if (refined.daysOfWeek || refined.startTime || refined.endTime || refined.startRecur || refined.endRecur) {\n var recurringData = {\n daysOfWeek: refined.daysOfWeek || null,\n startTime: refined.startTime || null,\n endTime: refined.endTime || null,\n startRecur: refined.startRecur ? dateEnv.createMarker(refined.startRecur) : null,\n endRecur: refined.endRecur ? dateEnv.createMarker(refined.endRecur) : null,\n };\n var duration = void 0;\n if (refined.duration) {\n duration = refined.duration;\n }\n if (!duration && refined.startTime && refined.endTime) {\n duration = subtractDurations(refined.endTime, refined.startTime);\n }\n return {\n allDayGuess: Boolean(!refined.startTime && !refined.endTime),\n duration: duration,\n typeData: recurringData, // doesn't need endTime anymore but oh well\n };\n }\n return null;\n },\n expand: function (typeData, framingRange, dateEnv) {\n var clippedFramingRange = intersectRanges(framingRange, { start: typeData.startRecur, end: typeData.endRecur });\n if (clippedFramingRange) {\n return expandRanges(typeData.daysOfWeek, typeData.startTime, clippedFramingRange, dateEnv);\n }\n return [];\n },\n};\nvar simpleRecurringEventsPlugin = createPlugin({\n recurringTypes: [recurring],\n eventRefiners: SIMPLE_RECURRING_REFINERS,\n});\nfunction expandRanges(daysOfWeek, startTime, framingRange, dateEnv) {\n var dowHash = daysOfWeek ? arrayToHash(daysOfWeek) : null;\n var dayMarker = startOfDay(framingRange.start);\n var endMarker = framingRange.end;\n var instanceStarts = [];\n while (dayMarker < endMarker) {\n var instanceStart \n // if everyday, or this particular day-of-week\n = void 0;\n // if everyday, or this particular day-of-week\n if (!dowHash || dowHash[dayMarker.getUTCDay()]) {\n if (startTime) {\n instanceStart = dateEnv.add(dayMarker, startTime);\n }\n else {\n instanceStart = dayMarker;\n }\n instanceStarts.push(instanceStart);\n }\n dayMarker = addDays(dayMarker, 1);\n }\n return instanceStarts;\n}\n\nvar changeHandlerPlugin = createPlugin({\n optionChangeHandlers: {\n events: function (events, context) {\n handleEventSources([events], context);\n },\n eventSources: handleEventSources,\n },\n});\n/*\nBUG: if `event` was supplied, all previously-given `eventSources` will be wiped out\n*/\nfunction handleEventSources(inputs, context) {\n var unfoundSources = hashValuesToArray(context.getCurrentData().eventSources);\n var newInputs = [];\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n var inputFound = false;\n for (var i = 0; i < unfoundSources.length; i += 1) {\n if (unfoundSources[i]._raw === input) {\n unfoundSources.splice(i, 1); // delete\n inputFound = true;\n break;\n }\n }\n if (!inputFound) {\n newInputs.push(input);\n }\n }\n for (var _a = 0, unfoundSources_1 = unfoundSources; _a < unfoundSources_1.length; _a++) {\n var unfoundSource = unfoundSources_1[_a];\n context.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: unfoundSource.sourceId,\n });\n }\n for (var _b = 0, newInputs_1 = newInputs; _b < newInputs_1.length; _b++) {\n var newInput = newInputs_1[_b];\n context.calendarApi.addEventSource(newInput);\n }\n}\n\nfunction handleDateProfile(dateProfile, context) {\n context.emitter.trigger('datesSet', __assign(__assign({}, buildRangeApiWithTimeZone(dateProfile.activeRange, context.dateEnv)), { view: context.viewApi }));\n}\n\nfunction handleEventStore(eventStore, context) {\n var emitter = context.emitter;\n if (emitter.hasHandlers('eventsSet')) {\n emitter.trigger('eventsSet', buildEventApis(eventStore, context));\n }\n}\n\n/*\nthis array is exposed on the root namespace so that UMD plugins can add to it.\nsee the rollup-bundles script.\n*/\nvar globalPlugins = [\n arrayEventSourcePlugin,\n funcEventSourcePlugin,\n jsonFeedEventSourcePlugin,\n simpleRecurringEventsPlugin,\n changeHandlerPlugin,\n createPlugin({\n isLoadingFuncs: [\n function (state) { return computeEventSourcesLoading(state.eventSources); },\n ],\n contentTypeHandlers: {\n html: buildHtmlRenderer,\n domNodes: buildDomNodeRenderer,\n },\n propSetHandlers: {\n dateProfile: handleDateProfile,\n eventStore: handleEventStore,\n },\n }),\n];\nfunction buildHtmlRenderer() {\n var currentEl = null;\n var currentHtml = '';\n function render(el, html) {\n if (el !== currentEl || html !== currentHtml) {\n el.innerHTML = html;\n }\n currentEl = el;\n currentHtml = html;\n }\n function destroy() {\n currentEl.innerHTML = '';\n currentEl = null;\n currentHtml = '';\n }\n return { render: render, destroy: destroy };\n}\nfunction buildDomNodeRenderer() {\n var currentEl = null;\n var currentDomNodes = [];\n function render(el, domNodes) {\n var newDomNodes = Array.prototype.slice.call(domNodes);\n if (el !== currentEl || !isArraysEqual(currentDomNodes, newDomNodes)) {\n // append first, remove second (for scroll resetting)\n for (var _i = 0, newDomNodes_1 = newDomNodes; _i < newDomNodes_1.length; _i++) {\n var newNode = newDomNodes_1[_i];\n el.appendChild(newNode);\n }\n destroy();\n }\n currentEl = el;\n currentDomNodes = newDomNodes;\n }\n function destroy() {\n currentDomNodes.forEach(removeElement);\n currentDomNodes = [];\n currentEl = null;\n }\n return { render: render, destroy: destroy };\n}\n\nvar DelayedRunner = /** @class */ (function () {\n function DelayedRunner(drainedOption) {\n this.drainedOption = drainedOption;\n this.isRunning = false;\n this.isDirty = false;\n this.pauseDepths = {};\n this.timeoutId = 0;\n }\n DelayedRunner.prototype.request = function (delay) {\n this.isDirty = true;\n if (!this.isPaused()) {\n this.clearTimeout();\n if (delay == null) {\n this.tryDrain();\n }\n else {\n this.timeoutId = setTimeout(// NOT OPTIMAL! TODO: look at debounce\n this.tryDrain.bind(this), delay);\n }\n }\n };\n DelayedRunner.prototype.pause = function (scope) {\n if (scope === void 0) { scope = ''; }\n var pauseDepths = this.pauseDepths;\n pauseDepths[scope] = (pauseDepths[scope] || 0) + 1;\n this.clearTimeout();\n };\n DelayedRunner.prototype.resume = function (scope, force) {\n if (scope === void 0) { scope = ''; }\n var pauseDepths = this.pauseDepths;\n if (scope in pauseDepths) {\n if (force) {\n delete pauseDepths[scope];\n }\n else {\n pauseDepths[scope] -= 1;\n var depth = pauseDepths[scope];\n if (depth <= 0) {\n delete pauseDepths[scope];\n }\n }\n this.tryDrain();\n }\n };\n DelayedRunner.prototype.isPaused = function () {\n return Object.keys(this.pauseDepths).length;\n };\n DelayedRunner.prototype.tryDrain = function () {\n if (!this.isRunning && !this.isPaused()) {\n this.isRunning = true;\n while (this.isDirty) {\n this.isDirty = false;\n this.drained(); // might set isDirty to true again\n }\n this.isRunning = false;\n }\n };\n DelayedRunner.prototype.clear = function () {\n this.clearTimeout();\n this.isDirty = false;\n this.pauseDepths = {};\n };\n DelayedRunner.prototype.clearTimeout = function () {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n this.timeoutId = 0;\n }\n };\n DelayedRunner.prototype.drained = function () {\n if (this.drainedOption) {\n this.drainedOption();\n }\n };\n return DelayedRunner;\n}());\n\nvar TaskRunner = /** @class */ (function () {\n function TaskRunner(runTaskOption, drainedOption) {\n this.runTaskOption = runTaskOption;\n this.drainedOption = drainedOption;\n this.queue = [];\n this.delayedRunner = new DelayedRunner(this.drain.bind(this));\n }\n TaskRunner.prototype.request = function (task, delay) {\n this.queue.push(task);\n this.delayedRunner.request(delay);\n };\n TaskRunner.prototype.pause = function (scope) {\n this.delayedRunner.pause(scope);\n };\n TaskRunner.prototype.resume = function (scope, force) {\n this.delayedRunner.resume(scope, force);\n };\n TaskRunner.prototype.drain = function () {\n var queue = this.queue;\n while (queue.length) {\n var completedTasks = [];\n var task = void 0;\n while ((task = queue.shift())) {\n this.runTask(task);\n completedTasks.push(task);\n }\n this.drained(completedTasks);\n } // keep going, in case new tasks were added in the drained handler\n };\n TaskRunner.prototype.runTask = function (task) {\n if (this.runTaskOption) {\n this.runTaskOption(task);\n }\n };\n TaskRunner.prototype.drained = function (completedTasks) {\n if (this.drainedOption) {\n this.drainedOption(completedTasks);\n }\n };\n return TaskRunner;\n}());\n\n// Computes what the title at the top of the calendarApi should be for this view\nfunction buildTitle(dateProfile, viewOptions, dateEnv) {\n var range;\n // for views that span a large unit of time, show the proper interval, ignoring stray days before and after\n if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) {\n range = dateProfile.currentRange;\n }\n else { // for day units or smaller, use the actual day range\n range = dateProfile.activeRange;\n }\n return dateEnv.formatRange(range.start, range.end, createFormatter(viewOptions.titleFormat || buildTitleFormat(dateProfile)), {\n isEndExclusive: dateProfile.isRangeAllDay,\n defaultSeparator: viewOptions.titleRangeSeparator,\n });\n}\n// Generates the format string that should be used to generate the title for the current date range.\n// Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.\nfunction buildTitleFormat(dateProfile) {\n var currentRangeUnit = dateProfile.currentRangeUnit;\n if (currentRangeUnit === 'year') {\n return { year: 'numeric' };\n }\n if (currentRangeUnit === 'month') {\n return { year: 'numeric', month: 'long' }; // like \"September 2014\"\n }\n var days = diffWholeDays(dateProfile.currentRange.start, dateProfile.currentRange.end);\n if (days !== null && days > 1) {\n // multi-day range. shorter, like \"Sep 9 - 10 2014\"\n return { year: 'numeric', month: 'short', day: 'numeric' };\n }\n // one day. longer, like \"September 9 2014\"\n return { year: 'numeric', month: 'long', day: 'numeric' };\n}\n\n// in future refactor, do the redux-style function(state=initial) for initial-state\n// also, whatever is happening in constructor, have it happen in action queue too\nvar CalendarDataManager = /** @class */ (function () {\n function CalendarDataManager(props) {\n var _this = this;\n this.computeOptionsData = memoize(this._computeOptionsData);\n this.computeCurrentViewData = memoize(this._computeCurrentViewData);\n this.organizeRawLocales = memoize(organizeRawLocales);\n this.buildLocale = memoize(buildLocale);\n this.buildPluginHooks = buildBuildPluginHooks();\n this.buildDateEnv = memoize(buildDateEnv);\n this.buildTheme = memoize(buildTheme);\n this.parseToolbars = memoize(parseToolbars);\n this.buildViewSpecs = memoize(buildViewSpecs);\n this.buildDateProfileGenerator = memoizeObjArg(buildDateProfileGenerator);\n this.buildViewApi = memoize(buildViewApi);\n this.buildViewUiProps = memoizeObjArg(buildViewUiProps);\n this.buildEventUiBySource = memoize(buildEventUiBySource, isPropsEqual);\n this.buildEventUiBases = memoize(buildEventUiBases);\n this.parseContextBusinessHours = memoizeObjArg(parseContextBusinessHours);\n this.buildTitle = memoize(buildTitle);\n this.emitter = new Emitter();\n this.actionRunner = new TaskRunner(this._handleAction.bind(this), this.updateData.bind(this));\n this.currentCalendarOptionsInput = {};\n this.currentCalendarOptionsRefined = {};\n this.currentViewOptionsInput = {};\n this.currentViewOptionsRefined = {};\n this.currentCalendarOptionsRefiners = {};\n this.getCurrentData = function () { return _this.data; };\n this.dispatch = function (action) {\n _this.actionRunner.request(action); // protects against recursive calls to _handleAction\n };\n this.props = props;\n this.actionRunner.pause();\n var dynamicOptionOverrides = {};\n var optionsData = this.computeOptionsData(props.optionOverrides, dynamicOptionOverrides, props.calendarApi);\n var currentViewType = optionsData.calendarOptions.initialView || optionsData.pluginHooks.initialView;\n var currentViewData = this.computeCurrentViewData(currentViewType, optionsData, props.optionOverrides, dynamicOptionOverrides);\n // wire things up\n // TODO: not DRY\n props.calendarApi.currentDataManager = this;\n this.emitter.setThisContext(props.calendarApi);\n this.emitter.setOptions(currentViewData.options);\n var currentDate = getInitialDate(optionsData.calendarOptions, optionsData.dateEnv);\n var dateProfile = currentViewData.dateProfileGenerator.build(currentDate);\n if (!rangeContainsMarker(dateProfile.activeRange, currentDate)) {\n currentDate = dateProfile.currentRange.start;\n }\n var calendarContext = {\n dateEnv: optionsData.dateEnv,\n options: optionsData.calendarOptions,\n pluginHooks: optionsData.pluginHooks,\n calendarApi: props.calendarApi,\n dispatch: this.dispatch,\n emitter: this.emitter,\n getCurrentData: this.getCurrentData,\n };\n // needs to be after setThisContext\n for (var _i = 0, _a = optionsData.pluginHooks.contextInit; _i < _a.length; _i++) {\n var callback = _a[_i];\n callback(calendarContext);\n }\n // NOT DRY\n var eventSources = initEventSources(optionsData.calendarOptions, dateProfile, calendarContext);\n var initialState = {\n dynamicOptionOverrides: dynamicOptionOverrides,\n currentViewType: currentViewType,\n currentDate: currentDate,\n dateProfile: dateProfile,\n businessHours: this.parseContextBusinessHours(calendarContext),\n eventSources: eventSources,\n eventUiBases: {},\n eventStore: createEmptyEventStore(),\n renderableEventStore: createEmptyEventStore(),\n dateSelection: null,\n eventSelection: '',\n eventDrag: null,\n eventResize: null,\n selectionConfig: this.buildViewUiProps(calendarContext).selectionConfig,\n };\n var contextAndState = __assign(__assign({}, calendarContext), initialState);\n for (var _b = 0, _c = optionsData.pluginHooks.reducers; _b < _c.length; _b++) {\n var reducer = _c[_b];\n __assign(initialState, reducer(null, null, contextAndState));\n }\n if (computeIsLoading(initialState, calendarContext)) {\n this.emitter.trigger('loading', true); // NOT DRY\n }\n this.state = initialState;\n this.updateData();\n this.actionRunner.resume();\n }\n CalendarDataManager.prototype.resetOptions = function (optionOverrides, append) {\n var props = this.props;\n props.optionOverrides = append\n ? __assign(__assign({}, props.optionOverrides), optionOverrides) : optionOverrides;\n this.actionRunner.request({\n type: 'NOTHING',\n });\n };\n CalendarDataManager.prototype._handleAction = function (action) {\n var _a = this, props = _a.props, state = _a.state, emitter = _a.emitter;\n var dynamicOptionOverrides = reduceDynamicOptionOverrides(state.dynamicOptionOverrides, action);\n var optionsData = this.computeOptionsData(props.optionOverrides, dynamicOptionOverrides, props.calendarApi);\n var currentViewType = reduceViewType(state.currentViewType, action);\n var currentViewData = this.computeCurrentViewData(currentViewType, optionsData, props.optionOverrides, dynamicOptionOverrides);\n // wire things up\n // TODO: not DRY\n props.calendarApi.currentDataManager = this;\n emitter.setThisContext(props.calendarApi);\n emitter.setOptions(currentViewData.options);\n var calendarContext = {\n dateEnv: optionsData.dateEnv,\n options: optionsData.calendarOptions,\n pluginHooks: optionsData.pluginHooks,\n calendarApi: props.calendarApi,\n dispatch: this.dispatch,\n emitter: emitter,\n getCurrentData: this.getCurrentData,\n };\n var currentDate = state.currentDate, dateProfile = state.dateProfile;\n if (this.data && this.data.dateProfileGenerator !== currentViewData.dateProfileGenerator) { // hack\n dateProfile = currentViewData.dateProfileGenerator.build(currentDate);\n }\n currentDate = reduceCurrentDate(currentDate, action);\n dateProfile = reduceDateProfile(dateProfile, action, currentDate, currentViewData.dateProfileGenerator);\n if (action.type === 'PREV' || // TODO: move this logic into DateProfileGenerator\n action.type === 'NEXT' || // \"\n !rangeContainsMarker(dateProfile.currentRange, currentDate)) {\n currentDate = dateProfile.currentRange.start;\n }\n var eventSources = reduceEventSources(state.eventSources, action, dateProfile, calendarContext);\n var eventStore = reduceEventStore(state.eventStore, action, eventSources, dateProfile, calendarContext);\n var isEventsLoading = computeEventSourcesLoading(eventSources); // BAD. also called in this func in computeIsLoading\n var renderableEventStore = (isEventsLoading && !currentViewData.options.progressiveEventRendering) ?\n (state.renderableEventStore || eventStore) : // try from previous state\n eventStore;\n var _b = this.buildViewUiProps(calendarContext), eventUiSingleBase = _b.eventUiSingleBase, selectionConfig = _b.selectionConfig; // will memoize obj\n var eventUiBySource = this.buildEventUiBySource(eventSources);\n var eventUiBases = this.buildEventUiBases(renderableEventStore.defs, eventUiSingleBase, eventUiBySource);\n var newState = {\n dynamicOptionOverrides: dynamicOptionOverrides,\n currentViewType: currentViewType,\n currentDate: currentDate,\n dateProfile: dateProfile,\n eventSources: eventSources,\n eventStore: eventStore,\n renderableEventStore: renderableEventStore,\n selectionConfig: selectionConfig,\n eventUiBases: eventUiBases,\n businessHours: this.parseContextBusinessHours(calendarContext),\n dateSelection: reduceDateSelection(state.dateSelection, action),\n eventSelection: reduceSelectedEvent(state.eventSelection, action),\n eventDrag: reduceEventDrag(state.eventDrag, action),\n eventResize: reduceEventResize(state.eventResize, action),\n };\n var contextAndState = __assign(__assign({}, calendarContext), newState);\n for (var _i = 0, _c = optionsData.pluginHooks.reducers; _i < _c.length; _i++) {\n var reducer = _c[_i];\n __assign(newState, reducer(state, action, contextAndState)); // give the OLD state, for old value\n }\n var wasLoading = computeIsLoading(state, calendarContext);\n var isLoading = computeIsLoading(newState, calendarContext);\n // TODO: use propSetHandlers in plugin system\n if (!wasLoading && isLoading) {\n emitter.trigger('loading', true);\n }\n else if (wasLoading && !isLoading) {\n emitter.trigger('loading', false);\n }\n this.state = newState;\n if (props.onAction) {\n props.onAction(action);\n }\n };\n CalendarDataManager.prototype.updateData = function () {\n var _a = this, props = _a.props, state = _a.state;\n var oldData = this.data;\n var optionsData = this.computeOptionsData(props.optionOverrides, state.dynamicOptionOverrides, props.calendarApi);\n var currentViewData = this.computeCurrentViewData(state.currentViewType, optionsData, props.optionOverrides, state.dynamicOptionOverrides);\n var data = this.data = __assign(__assign(__assign({ viewTitle: this.buildTitle(state.dateProfile, currentViewData.options, optionsData.dateEnv), calendarApi: props.calendarApi, dispatch: this.dispatch, emitter: this.emitter, getCurrentData: this.getCurrentData }, optionsData), currentViewData), state);\n var changeHandlers = optionsData.pluginHooks.optionChangeHandlers;\n var oldCalendarOptions = oldData && oldData.calendarOptions;\n var newCalendarOptions = optionsData.calendarOptions;\n if (oldCalendarOptions && oldCalendarOptions !== newCalendarOptions) {\n if (oldCalendarOptions.timeZone !== newCalendarOptions.timeZone) {\n // hack\n state.eventSources = data.eventSources = reduceEventSourcesNewTimeZone(data.eventSources, state.dateProfile, data);\n state.eventStore = data.eventStore = rezoneEventStoreDates(data.eventStore, oldData.dateEnv, data.dateEnv);\n }\n for (var optionName in changeHandlers) {\n if (oldCalendarOptions[optionName] !== newCalendarOptions[optionName]) {\n changeHandlers[optionName](newCalendarOptions[optionName], data);\n }\n }\n }\n if (props.onData) {\n props.onData(data);\n }\n };\n CalendarDataManager.prototype._computeOptionsData = function (optionOverrides, dynamicOptionOverrides, calendarApi) {\n // TODO: blacklist options that are handled by optionChangeHandlers\n var _a = this.processRawCalendarOptions(optionOverrides, dynamicOptionOverrides), refinedOptions = _a.refinedOptions, pluginHooks = _a.pluginHooks, localeDefaults = _a.localeDefaults, availableLocaleData = _a.availableLocaleData, extra = _a.extra;\n warnUnknownOptions(extra);\n var dateEnv = this.buildDateEnv(refinedOptions.timeZone, refinedOptions.locale, refinedOptions.weekNumberCalculation, refinedOptions.firstDay, refinedOptions.weekText, pluginHooks, availableLocaleData, refinedOptions.defaultRangeSeparator);\n var viewSpecs = this.buildViewSpecs(pluginHooks.views, optionOverrides, dynamicOptionOverrides, localeDefaults);\n var theme = this.buildTheme(refinedOptions, pluginHooks);\n var toolbarConfig = this.parseToolbars(refinedOptions, optionOverrides, theme, viewSpecs, calendarApi);\n return {\n calendarOptions: refinedOptions,\n pluginHooks: pluginHooks,\n dateEnv: dateEnv,\n viewSpecs: viewSpecs,\n theme: theme,\n toolbarConfig: toolbarConfig,\n localeDefaults: localeDefaults,\n availableRawLocales: availableLocaleData.map,\n };\n };\n // always called from behind a memoizer\n CalendarDataManager.prototype.processRawCalendarOptions = function (optionOverrides, dynamicOptionOverrides) {\n var _a = mergeRawOptions([\n BASE_OPTION_DEFAULTS,\n optionOverrides,\n dynamicOptionOverrides,\n ]), locales = _a.locales, locale = _a.locale;\n var availableLocaleData = this.organizeRawLocales(locales);\n var availableRawLocales = availableLocaleData.map;\n var localeDefaults = this.buildLocale(locale || availableLocaleData.defaultCode, availableRawLocales).options;\n var pluginHooks = this.buildPluginHooks(optionOverrides.plugins || [], globalPlugins);\n var refiners = this.currentCalendarOptionsRefiners = __assign(__assign(__assign(__assign(__assign({}, BASE_OPTION_REFINERS), CALENDAR_LISTENER_REFINERS), CALENDAR_OPTION_REFINERS), pluginHooks.listenerRefiners), pluginHooks.optionRefiners);\n var extra = {};\n var raw = mergeRawOptions([\n BASE_OPTION_DEFAULTS,\n localeDefaults,\n optionOverrides,\n dynamicOptionOverrides,\n ]);\n var refined = {};\n var currentRaw = this.currentCalendarOptionsInput;\n var currentRefined = this.currentCalendarOptionsRefined;\n var anyChanges = false;\n for (var optionName in raw) {\n if (optionName !== 'plugins') { // because plugins is special-cased\n if (raw[optionName] === currentRaw[optionName] ||\n (COMPLEX_OPTION_COMPARATORS[optionName] &&\n (optionName in currentRaw) &&\n COMPLEX_OPTION_COMPARATORS[optionName](currentRaw[optionName], raw[optionName]))) {\n refined[optionName] = currentRefined[optionName];\n }\n else if (refiners[optionName]) {\n refined[optionName] = refiners[optionName](raw[optionName]);\n anyChanges = true;\n }\n else {\n extra[optionName] = currentRaw[optionName];\n }\n }\n }\n if (anyChanges) {\n this.currentCalendarOptionsInput = raw;\n this.currentCalendarOptionsRefined = refined;\n }\n return {\n rawOptions: this.currentCalendarOptionsInput,\n refinedOptions: this.currentCalendarOptionsRefined,\n pluginHooks: pluginHooks,\n availableLocaleData: availableLocaleData,\n localeDefaults: localeDefaults,\n extra: extra,\n };\n };\n CalendarDataManager.prototype._computeCurrentViewData = function (viewType, optionsData, optionOverrides, dynamicOptionOverrides) {\n var viewSpec = optionsData.viewSpecs[viewType];\n if (!viewSpec) {\n throw new Error(\"viewType \\\"\" + viewType + \"\\\" is not available. Please make sure you've loaded all neccessary plugins\");\n }\n var _a = this.processRawViewOptions(viewSpec, optionsData.pluginHooks, optionsData.localeDefaults, optionOverrides, dynamicOptionOverrides), refinedOptions = _a.refinedOptions, extra = _a.extra;\n warnUnknownOptions(extra);\n var dateProfileGenerator = this.buildDateProfileGenerator({\n dateProfileGeneratorClass: viewSpec.optionDefaults.dateProfileGeneratorClass,\n duration: viewSpec.duration,\n durationUnit: viewSpec.durationUnit,\n usesMinMaxTime: viewSpec.optionDefaults.usesMinMaxTime,\n dateEnv: optionsData.dateEnv,\n calendarApi: this.props.calendarApi,\n slotMinTime: refinedOptions.slotMinTime,\n slotMaxTime: refinedOptions.slotMaxTime,\n showNonCurrentDates: refinedOptions.showNonCurrentDates,\n dayCount: refinedOptions.dayCount,\n dateAlignment: refinedOptions.dateAlignment,\n dateIncrement: refinedOptions.dateIncrement,\n hiddenDays: refinedOptions.hiddenDays,\n weekends: refinedOptions.weekends,\n nowInput: refinedOptions.now,\n validRangeInput: refinedOptions.validRange,\n visibleRangeInput: refinedOptions.visibleRange,\n monthMode: refinedOptions.monthMode,\n fixedWeekCount: refinedOptions.fixedWeekCount,\n });\n var viewApi = this.buildViewApi(viewType, this.getCurrentData, optionsData.dateEnv);\n return { viewSpec: viewSpec, options: refinedOptions, dateProfileGenerator: dateProfileGenerator, viewApi: viewApi };\n };\n CalendarDataManager.prototype.processRawViewOptions = function (viewSpec, pluginHooks, localeDefaults, optionOverrides, dynamicOptionOverrides) {\n var raw = mergeRawOptions([\n BASE_OPTION_DEFAULTS,\n viewSpec.optionDefaults,\n localeDefaults,\n optionOverrides,\n viewSpec.optionOverrides,\n dynamicOptionOverrides,\n ]);\n var refiners = __assign(__assign(__assign(__assign(__assign(__assign({}, BASE_OPTION_REFINERS), CALENDAR_LISTENER_REFINERS), CALENDAR_OPTION_REFINERS), VIEW_OPTION_REFINERS), pluginHooks.listenerRefiners), pluginHooks.optionRefiners);\n var refined = {};\n var currentRaw = this.currentViewOptionsInput;\n var currentRefined = this.currentViewOptionsRefined;\n var anyChanges = false;\n var extra = {};\n for (var optionName in raw) {\n if (raw[optionName] === currentRaw[optionName] ||\n (COMPLEX_OPTION_COMPARATORS[optionName] &&\n COMPLEX_OPTION_COMPARATORS[optionName](raw[optionName], currentRaw[optionName]))) {\n refined[optionName] = currentRefined[optionName];\n }\n else {\n if (raw[optionName] === this.currentCalendarOptionsInput[optionName] ||\n (COMPLEX_OPTION_COMPARATORS[optionName] &&\n COMPLEX_OPTION_COMPARATORS[optionName](raw[optionName], this.currentCalendarOptionsInput[optionName]))) {\n if (optionName in this.currentCalendarOptionsRefined) { // might be an \"extra\" prop\n refined[optionName] = this.currentCalendarOptionsRefined[optionName];\n }\n }\n else if (refiners[optionName]) {\n refined[optionName] = refiners[optionName](raw[optionName]);\n }\n else {\n extra[optionName] = raw[optionName];\n }\n anyChanges = true;\n }\n }\n if (anyChanges) {\n this.currentViewOptionsInput = raw;\n this.currentViewOptionsRefined = refined;\n }\n return {\n rawOptions: this.currentViewOptionsInput,\n refinedOptions: this.currentViewOptionsRefined,\n extra: extra,\n };\n };\n return CalendarDataManager;\n}());\nfunction buildDateEnv(timeZone, explicitLocale, weekNumberCalculation, firstDay, weekText, pluginHooks, availableLocaleData, defaultSeparator) {\n var locale = buildLocale(explicitLocale || availableLocaleData.defaultCode, availableLocaleData.map);\n return new DateEnv({\n calendarSystem: 'gregory',\n timeZone: timeZone,\n namedTimeZoneImpl: pluginHooks.namedTimeZonedImpl,\n locale: locale,\n weekNumberCalculation: weekNumberCalculation,\n firstDay: firstDay,\n weekText: weekText,\n cmdFormatter: pluginHooks.cmdFormatter,\n defaultSeparator: defaultSeparator,\n });\n}\nfunction buildTheme(options, pluginHooks) {\n var ThemeClass = pluginHooks.themeClasses[options.themeSystem] || StandardTheme;\n return new ThemeClass(options);\n}\nfunction buildDateProfileGenerator(props) {\n var DateProfileGeneratorClass = props.dateProfileGeneratorClass || DateProfileGenerator;\n return new DateProfileGeneratorClass(props);\n}\nfunction buildViewApi(type, getCurrentData, dateEnv) {\n return new ViewApi(type, getCurrentData, dateEnv);\n}\nfunction buildEventUiBySource(eventSources) {\n return mapHash(eventSources, function (eventSource) { return eventSource.ui; });\n}\nfunction buildEventUiBases(eventDefs, eventUiSingleBase, eventUiBySource) {\n var eventUiBases = { '': eventUiSingleBase };\n for (var defId in eventDefs) {\n var def = eventDefs[defId];\n if (def.sourceId && eventUiBySource[def.sourceId]) {\n eventUiBases[defId] = eventUiBySource[def.sourceId];\n }\n }\n return eventUiBases;\n}\nfunction buildViewUiProps(calendarContext) {\n var options = calendarContext.options;\n return {\n eventUiSingleBase: createEventUi({\n display: options.eventDisplay,\n editable: options.editable,\n startEditable: options.eventStartEditable,\n durationEditable: options.eventDurationEditable,\n constraint: options.eventConstraint,\n overlap: typeof options.eventOverlap === 'boolean' ? options.eventOverlap : undefined,\n allow: options.eventAllow,\n backgroundColor: options.eventBackgroundColor,\n borderColor: options.eventBorderColor,\n textColor: options.eventTextColor,\n color: options.eventColor,\n // classNames: options.eventClassNames // render hook will handle this\n }, calendarContext),\n selectionConfig: createEventUi({\n constraint: options.selectConstraint,\n overlap: typeof options.selectOverlap === 'boolean' ? options.selectOverlap : undefined,\n allow: options.selectAllow,\n }, calendarContext),\n };\n}\nfunction computeIsLoading(state, context) {\n for (var _i = 0, _a = context.pluginHooks.isLoadingFuncs; _i < _a.length; _i++) {\n var isLoadingFunc = _a[_i];\n if (isLoadingFunc(state)) {\n return true;\n }\n }\n return false;\n}\nfunction parseContextBusinessHours(calendarContext) {\n return parseBusinessHours(calendarContext.options.businessHours, calendarContext);\n}\nfunction warnUnknownOptions(options, viewName) {\n for (var optionName in options) {\n console.warn(\"Unknown option '\" + optionName + \"'\" +\n (viewName ? \" for view '\" + viewName + \"'\" : ''));\n }\n}\n\n// TODO: move this to react plugin?\nvar CalendarDataProvider = /** @class */ (function (_super) {\n __extends(CalendarDataProvider, _super);\n function CalendarDataProvider(props) {\n var _this = _super.call(this, props) || this;\n _this.handleData = function (data) {\n if (!_this.dataManager) { // still within initial run, before assignment in constructor\n // eslint-disable-next-line react/no-direct-mutation-state\n _this.state = data; // can't use setState yet\n }\n else {\n _this.setState(data);\n }\n };\n _this.dataManager = new CalendarDataManager({\n optionOverrides: props.optionOverrides,\n calendarApi: props.calendarApi,\n onData: _this.handleData,\n });\n return _this;\n }\n CalendarDataProvider.prototype.render = function () {\n return this.props.children(this.state);\n };\n CalendarDataProvider.prototype.componentDidUpdate = function (prevProps) {\n var newOptionOverrides = this.props.optionOverrides;\n if (newOptionOverrides !== prevProps.optionOverrides) { // prevent recursive handleData\n this.dataManager.resetOptions(newOptionOverrides);\n }\n };\n return CalendarDataProvider;\n}(Component));\n\n// HELPERS\n/*\nif nextDayThreshold is specified, slicing is done in an all-day fashion.\nyou can get nextDayThreshold from context.nextDayThreshold\n*/\nfunction sliceEvents(props, allDay) {\n return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;\n}\n\nvar NamedTimeZoneImpl = /** @class */ (function () {\n function NamedTimeZoneImpl(timeZoneName) {\n this.timeZoneName = timeZoneName;\n }\n return NamedTimeZoneImpl;\n}());\n\nvar SegHierarchy = /** @class */ (function () {\n function SegHierarchy() {\n // settings\n this.strictOrder = false;\n this.allowReslicing = false;\n this.maxCoord = -1; // -1 means no max\n this.maxStackCnt = -1; // -1 means no max\n this.levelCoords = []; // ordered\n this.entriesByLevel = []; // parallel with levelCoords\n this.stackCnts = {}; // TODO: use better technique!?\n }\n SegHierarchy.prototype.addSegs = function (inputs) {\n var hiddenEntries = [];\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n this.insertEntry(input, hiddenEntries);\n }\n return hiddenEntries;\n };\n SegHierarchy.prototype.insertEntry = function (entry, hiddenEntries) {\n var insertion = this.findInsertion(entry);\n if (this.isInsertionValid(insertion, entry)) {\n this.insertEntryAt(entry, insertion);\n return 1;\n }\n return this.handleInvalidInsertion(insertion, entry, hiddenEntries);\n };\n SegHierarchy.prototype.isInsertionValid = function (insertion, entry) {\n return (this.maxCoord === -1 || insertion.levelCoord + entry.thickness <= this.maxCoord) &&\n (this.maxStackCnt === -1 || insertion.stackCnt < this.maxStackCnt);\n };\n // returns number of new entries inserted\n SegHierarchy.prototype.handleInvalidInsertion = function (insertion, entry, hiddenEntries) {\n if (this.allowReslicing && insertion.touchingEntry) {\n return this.splitEntry(entry, insertion.touchingEntry, hiddenEntries);\n }\n hiddenEntries.push(entry);\n return 0;\n };\n SegHierarchy.prototype.splitEntry = function (entry, barrier, hiddenEntries) {\n var partCnt = 0;\n var splitHiddenEntries = [];\n var entrySpan = entry.span;\n var barrierSpan = barrier.span;\n if (entrySpan.start < barrierSpan.start) {\n partCnt += this.insertEntry({\n index: entry.index,\n thickness: entry.thickness,\n span: { start: entrySpan.start, end: barrierSpan.start },\n }, splitHiddenEntries);\n }\n if (entrySpan.end > barrierSpan.end) {\n partCnt += this.insertEntry({\n index: entry.index,\n thickness: entry.thickness,\n span: { start: barrierSpan.end, end: entrySpan.end },\n }, splitHiddenEntries);\n }\n if (partCnt) {\n hiddenEntries.push.apply(hiddenEntries, __spreadArray([{\n index: entry.index,\n thickness: entry.thickness,\n span: intersectSpans(barrierSpan, entrySpan), // guaranteed to intersect\n }], splitHiddenEntries));\n return partCnt;\n }\n hiddenEntries.push(entry);\n return 0;\n };\n SegHierarchy.prototype.insertEntryAt = function (entry, insertion) {\n var _a = this, entriesByLevel = _a.entriesByLevel, levelCoords = _a.levelCoords;\n if (insertion.lateral === -1) {\n // create a new level\n insertAt(levelCoords, insertion.level, insertion.levelCoord);\n insertAt(entriesByLevel, insertion.level, [entry]);\n }\n else {\n // insert into existing level\n insertAt(entriesByLevel[insertion.level], insertion.lateral, entry);\n }\n this.stackCnts[buildEntryKey(entry)] = insertion.stackCnt;\n };\n SegHierarchy.prototype.findInsertion = function (newEntry) {\n var _a = this, levelCoords = _a.levelCoords, entriesByLevel = _a.entriesByLevel, strictOrder = _a.strictOrder, stackCnts = _a.stackCnts;\n var levelCnt = levelCoords.length;\n var candidateCoord = 0;\n var touchingLevel = -1;\n var touchingLateral = -1;\n var touchingEntry = null;\n var stackCnt = 0;\n for (var trackingLevel = 0; trackingLevel < levelCnt; trackingLevel += 1) {\n var trackingCoord = levelCoords[trackingLevel];\n // if the current level is past the placed entry, we have found a good empty space and can stop.\n // if strictOrder, keep finding more lateral intersections.\n if (!strictOrder && trackingCoord >= candidateCoord + newEntry.thickness) {\n break;\n }\n var trackingEntries = entriesByLevel[trackingLevel];\n var trackingEntry = void 0;\n var searchRes = binarySearch(trackingEntries, newEntry.span.start, getEntrySpanEnd); // find first entry after newEntry's end\n var lateralIndex = searchRes[0] + searchRes[1]; // if exact match (which doesn't collide), go to next one\n while ( // loop through entries that horizontally intersect\n (trackingEntry = trackingEntries[lateralIndex]) && // but not past the whole entry list\n trackingEntry.span.start < newEntry.span.end // and not entirely past newEntry\n ) {\n var trackingEntryBottom = trackingCoord + trackingEntry.thickness;\n // intersects into the top of the candidate?\n if (trackingEntryBottom > candidateCoord) {\n candidateCoord = trackingEntryBottom;\n touchingEntry = trackingEntry;\n touchingLevel = trackingLevel;\n touchingLateral = lateralIndex;\n }\n // butts up against top of candidate? (will happen if just intersected as well)\n if (trackingEntryBottom === candidateCoord) {\n // accumulate the highest possible stackCnt of the trackingEntries that butt up\n stackCnt = Math.max(stackCnt, stackCnts[buildEntryKey(trackingEntry)] + 1);\n }\n lateralIndex += 1;\n }\n }\n // the destination level will be after touchingEntry's level. find it\n var destLevel = 0;\n if (touchingEntry) {\n destLevel = touchingLevel + 1;\n while (destLevel < levelCnt && levelCoords[destLevel] < candidateCoord) {\n destLevel += 1;\n }\n }\n // if adding to an existing level, find where to insert\n var destLateral = -1;\n if (destLevel < levelCnt && levelCoords[destLevel] === candidateCoord) {\n destLateral = binarySearch(entriesByLevel[destLevel], newEntry.span.end, getEntrySpanEnd)[0];\n }\n return {\n touchingLevel: touchingLevel,\n touchingLateral: touchingLateral,\n touchingEntry: touchingEntry,\n stackCnt: stackCnt,\n levelCoord: candidateCoord,\n level: destLevel,\n lateral: destLateral,\n };\n };\n // sorted by levelCoord (lowest to highest)\n SegHierarchy.prototype.toRects = function () {\n var _a = this, entriesByLevel = _a.entriesByLevel, levelCoords = _a.levelCoords;\n var levelCnt = entriesByLevel.length;\n var rects = [];\n for (var level = 0; level < levelCnt; level += 1) {\n var entries = entriesByLevel[level];\n var levelCoord = levelCoords[level];\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n rects.push(__assign(__assign({}, entry), { levelCoord: levelCoord }));\n }\n }\n return rects;\n };\n return SegHierarchy;\n}());\nfunction getEntrySpanEnd(entry) {\n return entry.span.end;\n}\nfunction buildEntryKey(entry) {\n return entry.index + ':' + entry.span.start;\n}\n// returns groups with entries sorted by input order\nfunction groupIntersectingEntries(entries) {\n var merges = [];\n for (var _i = 0, entries_2 = entries; _i < entries_2.length; _i++) {\n var entry = entries_2[_i];\n var filteredMerges = [];\n var hungryMerge = {\n span: entry.span,\n entries: [entry],\n };\n for (var _a = 0, merges_1 = merges; _a < merges_1.length; _a++) {\n var merge = merges_1[_a];\n if (intersectSpans(merge.span, hungryMerge.span)) {\n hungryMerge = {\n entries: merge.entries.concat(hungryMerge.entries),\n span: joinSpans(merge.span, hungryMerge.span),\n };\n }\n else {\n filteredMerges.push(merge);\n }\n }\n filteredMerges.push(hungryMerge);\n merges = filteredMerges;\n }\n return merges;\n}\nfunction joinSpans(span0, span1) {\n return {\n start: Math.min(span0.start, span1.start),\n end: Math.max(span0.end, span1.end),\n };\n}\nfunction intersectSpans(span0, span1) {\n var start = Math.max(span0.start, span1.start);\n var end = Math.min(span0.end, span1.end);\n if (start < end) {\n return { start: start, end: end };\n }\n return null;\n}\n// general util\n// ---------------------------------------------------------------------------------------------------------------------\nfunction insertAt(arr, index, item) {\n arr.splice(index, 0, item);\n}\nfunction binarySearch(a, searchVal, getItemVal) {\n var startIndex = 0;\n var endIndex = a.length; // exclusive\n if (!endIndex || searchVal < getItemVal(a[startIndex])) { // no items OR before first item\n return [0, 0];\n }\n if (searchVal > getItemVal(a[endIndex - 1])) { // after last item\n return [endIndex, 0];\n }\n while (startIndex < endIndex) {\n var middleIndex = Math.floor(startIndex + (endIndex - startIndex) / 2);\n var middleVal = getItemVal(a[middleIndex]);\n if (searchVal < middleVal) {\n endIndex = middleIndex;\n }\n else if (searchVal > middleVal) {\n startIndex = middleIndex + 1;\n }\n else { // equal!\n return [middleIndex, 1];\n }\n }\n return [startIndex, 0];\n}\n\nvar Interaction = /** @class */ (function () {\n function Interaction(settings) {\n this.component = settings.component;\n this.isHitComboAllowed = settings.isHitComboAllowed || null;\n }\n Interaction.prototype.destroy = function () {\n };\n return Interaction;\n}());\nfunction parseInteractionSettings(component, input) {\n return {\n component: component,\n el: input.el,\n useEventCenter: input.useEventCenter != null ? input.useEventCenter : true,\n isHitComboAllowed: input.isHitComboAllowed || null,\n };\n}\nfunction interactionSettingsToStore(settings) {\n var _a;\n return _a = {},\n _a[settings.component.uid] = settings,\n _a;\n}\n// global state\nvar interactionSettingsStore = {};\n\n/*\nAn abstraction for a dragging interaction originating on an event.\nDoes higher-level things than PointerDragger, such as possibly:\n- a \"mirror\" that moves with the pointer\n- a minimum number of pixels or other criteria for a true drag to begin\n\nsubclasses must emit:\n- pointerdown\n- dragstart\n- dragmove\n- pointerup\n- dragend\n*/\nvar ElementDragging = /** @class */ (function () {\n function ElementDragging(el, selector) {\n this.emitter = new Emitter();\n }\n ElementDragging.prototype.destroy = function () {\n };\n ElementDragging.prototype.setMirrorIsVisible = function (bool) {\n // optional if subclass doesn't want to support a mirror\n };\n ElementDragging.prototype.setMirrorNeedsRevert = function (bool) {\n // optional if subclass doesn't want to support a mirror\n };\n ElementDragging.prototype.setAutoScrollEnabled = function (bool) {\n // optional\n };\n return ElementDragging;\n}());\n\n// TODO: get rid of this in favor of options system,\n// tho it's really easy to access this globally rather than pass thru options.\nvar config = {};\n\n/*\nInformation about what will happen when an external element is dragged-and-dropped\nonto a calendar. Contains information for creating an event.\n*/\nvar DRAG_META_REFINERS = {\n startTime: createDuration,\n duration: createDuration,\n create: Boolean,\n sourceId: String,\n};\nfunction parseDragMeta(raw) {\n var _a = refineProps(raw, DRAG_META_REFINERS), refined = _a.refined, extra = _a.extra;\n return {\n startTime: refined.startTime || null,\n duration: refined.duration || null,\n create: refined.create != null ? refined.create : true,\n sourceId: refined.sourceId,\n leftoverProps: extra,\n };\n}\n\nvar ToolbarSection = /** @class */ (function (_super) {\n __extends(ToolbarSection, _super);\n function ToolbarSection() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ToolbarSection.prototype.render = function () {\n var _this = this;\n var children = this.props.widgetGroups.map(function (widgetGroup) { return _this.renderWidgetGroup(widgetGroup); });\n return createElement.apply(void 0, __spreadArray(['div', { className: 'fc-toolbar-chunk' }], children));\n };\n ToolbarSection.prototype.renderWidgetGroup = function (widgetGroup) {\n var props = this.props;\n var theme = this.context.theme;\n var children = [];\n var isOnlyButtons = true;\n for (var _i = 0, widgetGroup_1 = widgetGroup; _i < widgetGroup_1.length; _i++) {\n var widget = widgetGroup_1[_i];\n var buttonName = widget.buttonName, buttonClick = widget.buttonClick, buttonText = widget.buttonText, buttonIcon = widget.buttonIcon, buttonHint = widget.buttonHint;\n if (buttonName === 'title') {\n isOnlyButtons = false;\n children.push(createElement(\"h2\", { className: \"fc-toolbar-title\", id: props.titleId }, props.title));\n }\n else {\n var isPressed = buttonName === props.activeButton;\n var isDisabled = (!props.isTodayEnabled && buttonName === 'today') ||\n (!props.isPrevEnabled && buttonName === 'prev') ||\n (!props.isNextEnabled && buttonName === 'next');\n var buttonClasses = [\"fc-\" + buttonName + \"-button\", theme.getClass('button')];\n if (isPressed) {\n buttonClasses.push(theme.getClass('buttonActive'));\n }\n children.push(createElement(\"button\", { type: \"button\", title: typeof buttonHint === 'function' ? buttonHint(props.navUnit) : buttonHint, disabled: isDisabled, \"aria-pressed\": isPressed, className: buttonClasses.join(' '), onClick: buttonClick }, buttonText || (buttonIcon ? createElement(\"span\", { className: buttonIcon }) : '')));\n }\n }\n if (children.length > 1) {\n var groupClassName = (isOnlyButtons && theme.getClass('buttonGroup')) || '';\n return createElement.apply(void 0, __spreadArray(['div', { className: groupClassName }], children));\n }\n return children[0];\n };\n return ToolbarSection;\n}(BaseComponent));\n\nvar Toolbar = /** @class */ (function (_super) {\n __extends(Toolbar, _super);\n function Toolbar() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Toolbar.prototype.render = function () {\n var _a = this.props, model = _a.model, extraClassName = _a.extraClassName;\n var forceLtr = false;\n var startContent;\n var endContent;\n var sectionWidgets = model.sectionWidgets;\n var centerContent = sectionWidgets.center;\n if (sectionWidgets.left) {\n forceLtr = true;\n startContent = sectionWidgets.left;\n }\n else {\n startContent = sectionWidgets.start;\n }\n if (sectionWidgets.right) {\n forceLtr = true;\n endContent = sectionWidgets.right;\n }\n else {\n endContent = sectionWidgets.end;\n }\n var classNames = [\n extraClassName || '',\n 'fc-toolbar',\n forceLtr ? 'fc-toolbar-ltr' : '',\n ];\n return (createElement(\"div\", { className: classNames.join(' ') },\n this.renderSection('start', startContent || []),\n this.renderSection('center', centerContent || []),\n this.renderSection('end', endContent || [])));\n };\n Toolbar.prototype.renderSection = function (key, widgetGroups) {\n var props = this.props;\n return (createElement(ToolbarSection, { key: key, widgetGroups: widgetGroups, title: props.title, navUnit: props.navUnit, activeButton: props.activeButton, isTodayEnabled: props.isTodayEnabled, isPrevEnabled: props.isPrevEnabled, isNextEnabled: props.isNextEnabled, titleId: props.titleId }));\n };\n return Toolbar;\n}(BaseComponent));\n\n// TODO: do function component?\nvar ViewContainer = /** @class */ (function (_super) {\n __extends(ViewContainer, _super);\n function ViewContainer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n availableWidth: null,\n };\n _this.handleEl = function (el) {\n _this.el = el;\n setRef(_this.props.elRef, el);\n _this.updateAvailableWidth();\n };\n _this.handleResize = function () {\n _this.updateAvailableWidth();\n };\n return _this;\n }\n ViewContainer.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state;\n var aspectRatio = props.aspectRatio;\n var classNames = [\n 'fc-view-harness',\n (aspectRatio || props.liquid || props.height)\n ? 'fc-view-harness-active' // harness controls the height\n : 'fc-view-harness-passive', // let the view do the height\n ];\n var height = '';\n var paddingBottom = '';\n if (aspectRatio) {\n if (state.availableWidth !== null) {\n height = state.availableWidth / aspectRatio;\n }\n else {\n // while waiting to know availableWidth, we can't set height to *zero*\n // because will cause lots of unnecessary scrollbars within scrollgrid.\n // BETTER: don't start rendering ANYTHING yet until we know container width\n // NOTE: why not always use paddingBottom? Causes height oscillation (issue 5606)\n paddingBottom = (1 / aspectRatio) * 100 + \"%\";\n }\n }\n else {\n height = props.height || '';\n }\n return (createElement(\"div\", { \"aria-labelledby\": props.labeledById, ref: this.handleEl, className: classNames.join(' '), style: { height: height, paddingBottom: paddingBottom } }, props.children));\n };\n ViewContainer.prototype.componentDidMount = function () {\n this.context.addResizeHandler(this.handleResize);\n };\n ViewContainer.prototype.componentWillUnmount = function () {\n this.context.removeResizeHandler(this.handleResize);\n };\n ViewContainer.prototype.updateAvailableWidth = function () {\n if (this.el && // needed. but why?\n this.props.aspectRatio // aspectRatio is the only height setting that needs availableWidth\n ) {\n this.setState({ availableWidth: this.el.offsetWidth });\n }\n };\n return ViewContainer;\n}(BaseComponent));\n\n/*\nDetects when the user clicks on an event within a DateComponent\n*/\nvar EventClicking = /** @class */ (function (_super) {\n __extends(EventClicking, _super);\n function EventClicking(settings) {\n var _this = _super.call(this, settings) || this;\n _this.handleSegClick = function (ev, segEl) {\n var component = _this.component;\n var context = component.context;\n var seg = getElSeg(segEl);\n if (seg && // might be the
surrounding the more link\n component.isValidSegDownEl(ev.target)) {\n // our way to simulate a link click for elements that can't be tags\n // grab before trigger fired in case trigger trashes DOM thru rerendering\n var hasUrlContainer = elementClosest(ev.target, '.fc-event-forced-url');\n var url = hasUrlContainer ? hasUrlContainer.querySelector('a[href]').href : '';\n context.emitter.trigger('eventClick', {\n el: segEl,\n event: new EventApi(component.context, seg.eventRange.def, seg.eventRange.instance),\n jsEvent: ev,\n view: context.viewApi,\n });\n if (url && !ev.defaultPrevented) {\n window.location.href = url;\n }\n }\n };\n _this.destroy = listenBySelector(settings.el, 'click', '.fc-event', // on both fg and bg events\n _this.handleSegClick);\n return _this;\n }\n return EventClicking;\n}(Interaction));\n\n/*\nTriggers events and adds/removes core classNames when the user's pointer\nenters/leaves event-elements of a component.\n*/\nvar EventHovering = /** @class */ (function (_super) {\n __extends(EventHovering, _super);\n function EventHovering(settings) {\n var _this = _super.call(this, settings) || this;\n // for simulating an eventMouseLeave when the event el is destroyed while mouse is over it\n _this.handleEventElRemove = function (el) {\n if (el === _this.currentSegEl) {\n _this.handleSegLeave(null, _this.currentSegEl);\n }\n };\n _this.handleSegEnter = function (ev, segEl) {\n if (getElSeg(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper\n _this.currentSegEl = segEl;\n _this.triggerEvent('eventMouseEnter', ev, segEl);\n }\n };\n _this.handleSegLeave = function (ev, segEl) {\n if (_this.currentSegEl) {\n _this.currentSegEl = null;\n _this.triggerEvent('eventMouseLeave', ev, segEl);\n }\n };\n _this.removeHoverListeners = listenToHoverBySelector(settings.el, '.fc-event', // on both fg and bg events\n _this.handleSegEnter, _this.handleSegLeave);\n return _this;\n }\n EventHovering.prototype.destroy = function () {\n this.removeHoverListeners();\n };\n EventHovering.prototype.triggerEvent = function (publicEvName, ev, segEl) {\n var component = this.component;\n var context = component.context;\n var seg = getElSeg(segEl);\n if (!ev || component.isValidSegDownEl(ev.target)) {\n context.emitter.trigger(publicEvName, {\n el: segEl,\n event: new EventApi(context, seg.eventRange.def, seg.eventRange.instance),\n jsEvent: ev,\n view: context.viewApi,\n });\n }\n };\n return EventHovering;\n}(Interaction));\n\nvar CalendarContent = /** @class */ (function (_super) {\n __extends(CalendarContent, _super);\n function CalendarContent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildViewContext = memoize(buildViewContext);\n _this.buildViewPropTransformers = memoize(buildViewPropTransformers);\n _this.buildToolbarProps = memoize(buildToolbarProps);\n _this.headerRef = createRef();\n _this.footerRef = createRef();\n _this.interactionsStore = {};\n // eslint-disable-next-line\n _this.state = {\n viewLabelId: getUniqueDomId(),\n };\n // Component Registration\n // -----------------------------------------------------------------------------------------------------------------\n _this.registerInteractiveComponent = function (component, settingsInput) {\n var settings = parseInteractionSettings(component, settingsInput);\n var DEFAULT_INTERACTIONS = [\n EventClicking,\n EventHovering,\n ];\n var interactionClasses = DEFAULT_INTERACTIONS.concat(_this.props.pluginHooks.componentInteractions);\n var interactions = interactionClasses.map(function (TheInteractionClass) { return new TheInteractionClass(settings); });\n _this.interactionsStore[component.uid] = interactions;\n interactionSettingsStore[component.uid] = settings;\n };\n _this.unregisterInteractiveComponent = function (component) {\n var listeners = _this.interactionsStore[component.uid];\n if (listeners) {\n for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {\n var listener = listeners_1[_i];\n listener.destroy();\n }\n delete _this.interactionsStore[component.uid];\n }\n delete interactionSettingsStore[component.uid];\n };\n // Resizing\n // -----------------------------------------------------------------------------------------------------------------\n _this.resizeRunner = new DelayedRunner(function () {\n _this.props.emitter.trigger('_resize', true); // should window resizes be considered \"forced\" ?\n _this.props.emitter.trigger('windowResize', { view: _this.props.viewApi });\n });\n _this.handleWindowResize = function (ev) {\n var options = _this.props.options;\n if (options.handleWindowResize &&\n ev.target === window // avoid jqui events\n ) {\n _this.resizeRunner.request(options.windowResizeDelay);\n }\n };\n return _this;\n }\n /*\n renders INSIDE of an outer div\n */\n CalendarContent.prototype.render = function () {\n var props = this.props;\n var toolbarConfig = props.toolbarConfig, options = props.options;\n var toolbarProps = this.buildToolbarProps(props.viewSpec, props.dateProfile, props.dateProfileGenerator, props.currentDate, getNow(props.options.now, props.dateEnv), // TODO: use NowTimer????\n props.viewTitle);\n var viewVGrow = false;\n var viewHeight = '';\n var viewAspectRatio;\n if (props.isHeightAuto || props.forPrint) {\n viewHeight = '';\n }\n else if (options.height != null) {\n viewVGrow = true;\n }\n else if (options.contentHeight != null) {\n viewHeight = options.contentHeight;\n }\n else {\n viewAspectRatio = Math.max(options.aspectRatio, 0.5); // prevent from getting too tall\n }\n var viewContext = this.buildViewContext(props.viewSpec, props.viewApi, props.options, props.dateProfileGenerator, props.dateEnv, props.theme, props.pluginHooks, props.dispatch, props.getCurrentData, props.emitter, props.calendarApi, this.registerInteractiveComponent, this.unregisterInteractiveComponent);\n var viewLabelId = (toolbarConfig.header && toolbarConfig.header.hasTitle)\n ? this.state.viewLabelId\n : '';\n return (createElement(ViewContextType.Provider, { value: viewContext },\n toolbarConfig.header && (createElement(Toolbar, __assign({ ref: this.headerRef, extraClassName: \"fc-header-toolbar\", model: toolbarConfig.header, titleId: viewLabelId }, toolbarProps))),\n createElement(ViewContainer, { liquid: viewVGrow, height: viewHeight, aspectRatio: viewAspectRatio, labeledById: viewLabelId },\n this.renderView(props),\n this.buildAppendContent()),\n toolbarConfig.footer && (createElement(Toolbar, __assign({ ref: this.footerRef, extraClassName: \"fc-footer-toolbar\", model: toolbarConfig.footer, titleId: \"\" }, toolbarProps)))));\n };\n CalendarContent.prototype.componentDidMount = function () {\n var props = this.props;\n this.calendarInteractions = props.pluginHooks.calendarInteractions\n .map(function (CalendarInteractionClass) { return new CalendarInteractionClass(props); });\n window.addEventListener('resize', this.handleWindowResize);\n var propSetHandlers = props.pluginHooks.propSetHandlers;\n for (var propName in propSetHandlers) {\n propSetHandlers[propName](props[propName], props);\n }\n };\n CalendarContent.prototype.componentDidUpdate = function (prevProps) {\n var props = this.props;\n var propSetHandlers = props.pluginHooks.propSetHandlers;\n for (var propName in propSetHandlers) {\n if (props[propName] !== prevProps[propName]) {\n propSetHandlers[propName](props[propName], props);\n }\n }\n };\n CalendarContent.prototype.componentWillUnmount = function () {\n window.removeEventListener('resize', this.handleWindowResize);\n this.resizeRunner.clear();\n for (var _i = 0, _a = this.calendarInteractions; _i < _a.length; _i++) {\n var interaction = _a[_i];\n interaction.destroy();\n }\n this.props.emitter.trigger('_unmount');\n };\n CalendarContent.prototype.buildAppendContent = function () {\n var props = this.props;\n var children = props.pluginHooks.viewContainerAppends.map(function (buildAppendContent) { return buildAppendContent(props); });\n return createElement.apply(void 0, __spreadArray([Fragment, {}], children));\n };\n CalendarContent.prototype.renderView = function (props) {\n var pluginHooks = props.pluginHooks;\n var viewSpec = props.viewSpec;\n var viewProps = {\n dateProfile: props.dateProfile,\n businessHours: props.businessHours,\n eventStore: props.renderableEventStore,\n eventUiBases: props.eventUiBases,\n dateSelection: props.dateSelection,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize,\n isHeightAuto: props.isHeightAuto,\n forPrint: props.forPrint,\n };\n var transformers = this.buildViewPropTransformers(pluginHooks.viewPropsTransformers);\n for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) {\n var transformer = transformers_1[_i];\n __assign(viewProps, transformer.transform(viewProps, props));\n }\n var ViewComponent = viewSpec.component;\n return (createElement(ViewComponent, __assign({}, viewProps)));\n };\n return CalendarContent;\n}(PureComponent));\nfunction buildToolbarProps(viewSpec, dateProfile, dateProfileGenerator, currentDate, now, title) {\n // don't force any date-profiles to valid date profiles (the `false`) so that we can tell if it's invalid\n var todayInfo = dateProfileGenerator.build(now, undefined, false); // TODO: need `undefined` or else INFINITE LOOP for some reason\n var prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate, false);\n var nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate, false);\n return {\n title: title,\n activeButton: viewSpec.type,\n navUnit: viewSpec.singleUnit,\n isTodayEnabled: todayInfo.isValid && !rangeContainsMarker(dateProfile.currentRange, now),\n isPrevEnabled: prevInfo.isValid,\n isNextEnabled: nextInfo.isValid,\n };\n}\n// Plugin\n// -----------------------------------------------------------------------------------------------------------------\nfunction buildViewPropTransformers(theClasses) {\n return theClasses.map(function (TheClass) { return new TheClass(); });\n}\n\nvar CalendarRoot = /** @class */ (function (_super) {\n __extends(CalendarRoot, _super);\n function CalendarRoot() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n forPrint: false,\n };\n _this.handleBeforePrint = function () {\n _this.setState({ forPrint: true });\n };\n _this.handleAfterPrint = function () {\n _this.setState({ forPrint: false });\n };\n return _this;\n }\n CalendarRoot.prototype.render = function () {\n var props = this.props;\n var options = props.options;\n var forPrint = this.state.forPrint;\n var isHeightAuto = forPrint || options.height === 'auto' || options.contentHeight === 'auto';\n var height = (!isHeightAuto && options.height != null) ? options.height : '';\n var classNames = [\n 'fc',\n forPrint ? 'fc-media-print' : 'fc-media-screen',\n \"fc-direction-\" + options.direction,\n props.theme.getClass('root'),\n ];\n if (!getCanVGrowWithinCell()) {\n classNames.push('fc-liquid-hack');\n }\n return props.children(classNames, height, isHeightAuto, forPrint);\n };\n CalendarRoot.prototype.componentDidMount = function () {\n var emitter = this.props.emitter;\n emitter.on('_beforeprint', this.handleBeforePrint);\n emitter.on('_afterprint', this.handleAfterPrint);\n };\n CalendarRoot.prototype.componentWillUnmount = function () {\n var emitter = this.props.emitter;\n emitter.off('_beforeprint', this.handleBeforePrint);\n emitter.off('_afterprint', this.handleAfterPrint);\n };\n return CalendarRoot;\n}(BaseComponent));\n\n// Computes a default column header formatting string if `colFormat` is not explicitly defined\nfunction computeFallbackHeaderFormat(datesRepDistinctDays, dayCnt) {\n // if more than one week row, or if there are a lot of columns with not much space,\n // put just the day numbers will be in each cell\n if (!datesRepDistinctDays || dayCnt > 10) {\n return createFormatter({ weekday: 'short' }); // \"Sat\"\n }\n if (dayCnt > 1) {\n return createFormatter({ weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true }); // \"Sat 11/12\"\n }\n return createFormatter({ weekday: 'long' }); // \"Saturday\"\n}\n\nvar CLASS_NAME = 'fc-col-header-cell'; // do the cushion too? no\nfunction renderInner$1(hookProps) {\n return hookProps.text;\n}\n\nvar TableDateCell = /** @class */ (function (_super) {\n __extends(TableDateCell, _super);\n function TableDateCell() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TableDateCell.prototype.render = function () {\n var _a = this.context, dateEnv = _a.dateEnv, options = _a.options, theme = _a.theme, viewApi = _a.viewApi;\n var props = this.props;\n var date = props.date, dateProfile = props.dateProfile;\n var dayMeta = getDateMeta(date, props.todayRange, null, dateProfile);\n var classNames = [CLASS_NAME].concat(getDayClassNames(dayMeta, theme));\n var text = dateEnv.format(date, props.dayHeaderFormat);\n // if colCnt is 1, we are already in a day-view and don't need a navlink\n var navLinkAttrs = (!dayMeta.isDisabled && props.colCnt > 1)\n ? buildNavLinkAttrs(this.context, date)\n : {};\n var hookProps = __assign(__assign(__assign({ date: dateEnv.toDate(date), view: viewApi }, props.extraHookProps), { text: text }), dayMeta);\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInner$1, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement(\"th\", __assign({ ref: rootElRef, role: \"columnheader\", className: classNames.concat(customClassNames).join(' '), \"data-date\": !dayMeta.isDisabled ? formatDayString(date) : undefined, colSpan: props.colSpan }, props.extraDataAttrs),\n createElement(\"div\", { className: \"fc-scrollgrid-sync-inner\" }, !dayMeta.isDisabled && (createElement(\"a\", __assign({ ref: innerElRef, className: [\n 'fc-col-header-cell-cushion',\n props.isSticky ? 'fc-sticky' : '',\n ].join(' ') }, navLinkAttrs), innerContent))))); }));\n };\n return TableDateCell;\n}(BaseComponent));\n\nvar WEEKDAY_FORMAT = createFormatter({ weekday: 'long' });\nvar TableDowCell = /** @class */ (function (_super) {\n __extends(TableDowCell, _super);\n function TableDowCell() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TableDowCell.prototype.render = function () {\n var props = this.props;\n var _a = this.context, dateEnv = _a.dateEnv, theme = _a.theme, viewApi = _a.viewApi, options = _a.options;\n var date = addDays(new Date(259200000), props.dow); // start with Sun, 04 Jan 1970 00:00:00 GMT\n var dateMeta = {\n dow: props.dow,\n isDisabled: false,\n isFuture: false,\n isPast: false,\n isToday: false,\n isOther: false,\n };\n var classNames = [CLASS_NAME].concat(getDayClassNames(dateMeta, theme), props.extraClassNames || []);\n var text = dateEnv.format(date, props.dayHeaderFormat);\n var hookProps = __assign(__assign(__assign(__assign({ // TODO: make this public?\n date: date }, dateMeta), { view: viewApi }), props.extraHookProps), { text: text });\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInner$1, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement(\"th\", __assign({ ref: rootElRef, role: \"columnheader\", className: classNames.concat(customClassNames).join(' '), colSpan: props.colSpan }, props.extraDataAttrs),\n createElement(\"div\", { className: \"fc-scrollgrid-sync-inner\" },\n createElement(\"a\", { \"aria-label\": dateEnv.format(date, WEEKDAY_FORMAT), className: [\n 'fc-col-header-cell-cushion',\n props.isSticky ? 'fc-sticky' : '',\n ].join(' '), ref: innerElRef }, innerContent)))); }));\n };\n return TableDowCell;\n}(BaseComponent));\n\nvar NowTimer = /** @class */ (function (_super) {\n __extends(NowTimer, _super);\n function NowTimer(props, context) {\n var _this = _super.call(this, props, context) || this;\n _this.initialNowDate = getNow(context.options.now, context.dateEnv);\n _this.initialNowQueriedMs = new Date().valueOf();\n _this.state = _this.computeTiming().currentState;\n return _this;\n }\n NowTimer.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state;\n return props.children(state.nowDate, state.todayRange);\n };\n NowTimer.prototype.componentDidMount = function () {\n this.setTimeout();\n };\n NowTimer.prototype.componentDidUpdate = function (prevProps) {\n if (prevProps.unit !== this.props.unit) {\n this.clearTimeout();\n this.setTimeout();\n }\n };\n NowTimer.prototype.componentWillUnmount = function () {\n this.clearTimeout();\n };\n NowTimer.prototype.computeTiming = function () {\n var _a = this, props = _a.props, context = _a.context;\n var unroundedNow = addMs(this.initialNowDate, new Date().valueOf() - this.initialNowQueriedMs);\n var currentUnitStart = context.dateEnv.startOf(unroundedNow, props.unit);\n var nextUnitStart = context.dateEnv.add(currentUnitStart, createDuration(1, props.unit));\n var waitMs = nextUnitStart.valueOf() - unroundedNow.valueOf();\n // there is a max setTimeout ms value (https://stackoverflow.com/a/3468650/96342)\n // ensure no longer than a day\n waitMs = Math.min(1000 * 60 * 60 * 24, waitMs);\n return {\n currentState: { nowDate: currentUnitStart, todayRange: buildDayRange(currentUnitStart) },\n nextState: { nowDate: nextUnitStart, todayRange: buildDayRange(nextUnitStart) },\n waitMs: waitMs,\n };\n };\n NowTimer.prototype.setTimeout = function () {\n var _this = this;\n var _a = this.computeTiming(), nextState = _a.nextState, waitMs = _a.waitMs;\n this.timeoutId = setTimeout(function () {\n _this.setState(nextState, function () {\n _this.setTimeout();\n });\n }, waitMs);\n };\n NowTimer.prototype.clearTimeout = function () {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n };\n NowTimer.contextType = ViewContextType;\n return NowTimer;\n}(Component));\nfunction buildDayRange(date) {\n var start = startOfDay(date);\n var end = addDays(start, 1);\n return { start: start, end: end };\n}\n\nvar DayHeader = /** @class */ (function (_super) {\n __extends(DayHeader, _super);\n function DayHeader() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.createDayHeaderFormatter = memoize(createDayHeaderFormatter);\n return _this;\n }\n DayHeader.prototype.render = function () {\n var context = this.context;\n var _a = this.props, dates = _a.dates, dateProfile = _a.dateProfile, datesRepDistinctDays = _a.datesRepDistinctDays, renderIntro = _a.renderIntro;\n var dayHeaderFormat = this.createDayHeaderFormatter(context.options.dayHeaderFormat, datesRepDistinctDays, dates.length);\n return (createElement(NowTimer, { unit: \"day\" }, function (nowDate, todayRange) { return (createElement(\"tr\", { role: \"row\" },\n renderIntro && renderIntro('day'),\n dates.map(function (date) { return (datesRepDistinctDays ? (createElement(TableDateCell, { key: date.toISOString(), date: date, dateProfile: dateProfile, todayRange: todayRange, colCnt: dates.length, dayHeaderFormat: dayHeaderFormat })) : (createElement(TableDowCell, { key: date.getUTCDay(), dow: date.getUTCDay(), dayHeaderFormat: dayHeaderFormat }))); }))); }));\n };\n return DayHeader;\n}(BaseComponent));\nfunction createDayHeaderFormatter(explicitFormat, datesRepDistinctDays, dateCnt) {\n return explicitFormat || computeFallbackHeaderFormat(datesRepDistinctDays, dateCnt);\n}\n\nvar DaySeriesModel = /** @class */ (function () {\n function DaySeriesModel(range, dateProfileGenerator) {\n var date = range.start;\n var end = range.end;\n var indices = [];\n var dates = [];\n var dayIndex = -1;\n while (date < end) { // loop each day from start to end\n if (dateProfileGenerator.isHiddenDay(date)) {\n indices.push(dayIndex + 0.5); // mark that it's between indices\n }\n else {\n dayIndex += 1;\n indices.push(dayIndex);\n dates.push(date);\n }\n date = addDays(date, 1);\n }\n this.dates = dates;\n this.indices = indices;\n this.cnt = dates.length;\n }\n DaySeriesModel.prototype.sliceRange = function (range) {\n var firstIndex = this.getDateDayIndex(range.start); // inclusive first index\n var lastIndex = this.getDateDayIndex(addDays(range.end, -1)); // inclusive last index\n var clippedFirstIndex = Math.max(0, firstIndex);\n var clippedLastIndex = Math.min(this.cnt - 1, lastIndex);\n // deal with in-between indices\n clippedFirstIndex = Math.ceil(clippedFirstIndex); // in-between starts round to next cell\n clippedLastIndex = Math.floor(clippedLastIndex); // in-between ends round to prev cell\n if (clippedFirstIndex <= clippedLastIndex) {\n return {\n firstIndex: clippedFirstIndex,\n lastIndex: clippedLastIndex,\n isStart: firstIndex === clippedFirstIndex,\n isEnd: lastIndex === clippedLastIndex,\n };\n }\n return null;\n };\n // Given a date, returns its chronolocial cell-index from the first cell of the grid.\n // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.\n // If before the first offset, returns a negative number.\n // If after the last offset, returns an offset past the last cell offset.\n // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.\n DaySeriesModel.prototype.getDateDayIndex = function (date) {\n var indices = this.indices;\n var dayOffset = Math.floor(diffDays(this.dates[0], date));\n if (dayOffset < 0) {\n return indices[0] - 1;\n }\n if (dayOffset >= indices.length) {\n return indices[indices.length - 1] + 1;\n }\n return indices[dayOffset];\n };\n return DaySeriesModel;\n}());\n\nvar DayTableModel = /** @class */ (function () {\n function DayTableModel(daySeries, breakOnWeeks) {\n var dates = daySeries.dates;\n var daysPerRow;\n var firstDay;\n var rowCnt;\n if (breakOnWeeks) {\n // count columns until the day-of-week repeats\n firstDay = dates[0].getUTCDay();\n for (daysPerRow = 1; daysPerRow < dates.length; daysPerRow += 1) {\n if (dates[daysPerRow].getUTCDay() === firstDay) {\n break;\n }\n }\n rowCnt = Math.ceil(dates.length / daysPerRow);\n }\n else {\n rowCnt = 1;\n daysPerRow = dates.length;\n }\n this.rowCnt = rowCnt;\n this.colCnt = daysPerRow;\n this.daySeries = daySeries;\n this.cells = this.buildCells();\n this.headerDates = this.buildHeaderDates();\n }\n DayTableModel.prototype.buildCells = function () {\n var rows = [];\n for (var row = 0; row < this.rowCnt; row += 1) {\n var cells = [];\n for (var col = 0; col < this.colCnt; col += 1) {\n cells.push(this.buildCell(row, col));\n }\n rows.push(cells);\n }\n return rows;\n };\n DayTableModel.prototype.buildCell = function (row, col) {\n var date = this.daySeries.dates[row * this.colCnt + col];\n return {\n key: date.toISOString(),\n date: date,\n };\n };\n DayTableModel.prototype.buildHeaderDates = function () {\n var dates = [];\n for (var col = 0; col < this.colCnt; col += 1) {\n dates.push(this.cells[0][col].date);\n }\n return dates;\n };\n DayTableModel.prototype.sliceRange = function (range) {\n var colCnt = this.colCnt;\n var seriesSeg = this.daySeries.sliceRange(range);\n var segs = [];\n if (seriesSeg) {\n var firstIndex = seriesSeg.firstIndex, lastIndex = seriesSeg.lastIndex;\n var index = firstIndex;\n while (index <= lastIndex) {\n var row = Math.floor(index / colCnt);\n var nextIndex = Math.min((row + 1) * colCnt, lastIndex + 1);\n segs.push({\n row: row,\n firstCol: index % colCnt,\n lastCol: (nextIndex - 1) % colCnt,\n isStart: seriesSeg.isStart && index === firstIndex,\n isEnd: seriesSeg.isEnd && (nextIndex - 1) === lastIndex,\n });\n index = nextIndex;\n }\n }\n return segs;\n };\n return DayTableModel;\n}());\n\nvar Slicer = /** @class */ (function () {\n function Slicer() {\n this.sliceBusinessHours = memoize(this._sliceBusinessHours);\n this.sliceDateSelection = memoize(this._sliceDateSpan);\n this.sliceEventStore = memoize(this._sliceEventStore);\n this.sliceEventDrag = memoize(this._sliceInteraction);\n this.sliceEventResize = memoize(this._sliceInteraction);\n this.forceDayIfListItem = false; // hack\n }\n Slicer.prototype.sliceProps = function (props, dateProfile, nextDayThreshold, context) {\n var extraArgs = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n extraArgs[_i - 4] = arguments[_i];\n }\n var eventUiBases = props.eventUiBases;\n var eventSegs = this.sliceEventStore.apply(this, __spreadArray([props.eventStore, eventUiBases, dateProfile, nextDayThreshold], extraArgs));\n return {\n dateSelectionSegs: this.sliceDateSelection.apply(this, __spreadArray([props.dateSelection, eventUiBases, context], extraArgs)),\n businessHourSegs: this.sliceBusinessHours.apply(this, __spreadArray([props.businessHours, dateProfile, nextDayThreshold, context], extraArgs)),\n fgEventSegs: eventSegs.fg,\n bgEventSegs: eventSegs.bg,\n eventDrag: this.sliceEventDrag.apply(this, __spreadArray([props.eventDrag, eventUiBases, dateProfile, nextDayThreshold], extraArgs)),\n eventResize: this.sliceEventResize.apply(this, __spreadArray([props.eventResize, eventUiBases, dateProfile, nextDayThreshold], extraArgs)),\n eventSelection: props.eventSelection,\n }; // TODO: give interactionSegs?\n };\n Slicer.prototype.sliceNowDate = function (// does not memoize\n date, context) {\n var extraArgs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n extraArgs[_i - 2] = arguments[_i];\n }\n return this._sliceDateSpan.apply(this, __spreadArray([{ range: { start: date, end: addMs(date, 1) }, allDay: false },\n {},\n context], extraArgs));\n };\n Slicer.prototype._sliceBusinessHours = function (businessHours, dateProfile, nextDayThreshold, context) {\n var extraArgs = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n extraArgs[_i - 4] = arguments[_i];\n }\n if (!businessHours) {\n return [];\n }\n return this._sliceEventStore.apply(this, __spreadArray([expandRecurring(businessHours, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), context),\n {},\n dateProfile,\n nextDayThreshold], extraArgs)).bg;\n };\n Slicer.prototype._sliceEventStore = function (eventStore, eventUiBases, dateProfile, nextDayThreshold) {\n var extraArgs = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n extraArgs[_i - 4] = arguments[_i];\n }\n if (eventStore) {\n var rangeRes = sliceEventStore(eventStore, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold);\n return {\n bg: this.sliceEventRanges(rangeRes.bg, extraArgs),\n fg: this.sliceEventRanges(rangeRes.fg, extraArgs),\n };\n }\n return { bg: [], fg: [] };\n };\n Slicer.prototype._sliceInteraction = function (interaction, eventUiBases, dateProfile, nextDayThreshold) {\n var extraArgs = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n extraArgs[_i - 4] = arguments[_i];\n }\n if (!interaction) {\n return null;\n }\n var rangeRes = sliceEventStore(interaction.mutatedEvents, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold);\n return {\n segs: this.sliceEventRanges(rangeRes.fg, extraArgs),\n affectedInstances: interaction.affectedEvents.instances,\n isEvent: interaction.isEvent,\n };\n };\n Slicer.prototype._sliceDateSpan = function (dateSpan, eventUiBases, context) {\n var extraArgs = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n extraArgs[_i - 3] = arguments[_i];\n }\n if (!dateSpan) {\n return [];\n }\n var eventRange = fabricateEventRange(dateSpan, eventUiBases, context);\n var segs = this.sliceRange.apply(this, __spreadArray([dateSpan.range], extraArgs));\n for (var _a = 0, segs_1 = segs; _a < segs_1.length; _a++) {\n var seg = segs_1[_a];\n seg.eventRange = eventRange;\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRanges = function (eventRanges, extraArgs) {\n var segs = [];\n for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) {\n var eventRange = eventRanges_1[_i];\n segs.push.apply(segs, this.sliceEventRange(eventRange, extraArgs));\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRange = function (eventRange, extraArgs) {\n var dateRange = eventRange.range;\n // hack to make multi-day events that are being force-displayed as list-items to take up only one day\n if (this.forceDayIfListItem && eventRange.ui.display === 'list-item') {\n dateRange = {\n start: dateRange.start,\n end: addDays(dateRange.start, 1),\n };\n }\n var segs = this.sliceRange.apply(this, __spreadArray([dateRange], extraArgs));\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n seg.eventRange = eventRange;\n seg.isStart = eventRange.isStart && seg.isStart;\n seg.isEnd = eventRange.isEnd && seg.isEnd;\n }\n return segs;\n };\n return Slicer;\n}());\n/*\nfor incorporating slotMinTime/slotMaxTime if appropriate\nTODO: should be part of DateProfile!\nTimelineDateProfile already does this btw\n*/\nfunction computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.slotMinTime.milliseconds),\n end: addMs(range.end, dateProfile.slotMaxTime.milliseconds - 864e5), // 864e5 = ms in a day\n };\n}\n\n// high-level segmenting-aware tester functions\n// ------------------------------------------------------------------------------------------------------------------------\nfunction isInteractionValid(interaction, dateProfile, context) {\n var instances = interaction.mutatedEvents.instances;\n for (var instanceId in instances) {\n if (!rangeContainsRange(dateProfile.validRange, instances[instanceId].range)) {\n return false;\n }\n }\n return isNewPropsValid({ eventDrag: interaction }, context); // HACK: the eventDrag props is used for ALL interactions\n}\nfunction isDateSelectionValid(dateSelection, dateProfile, context) {\n if (!rangeContainsRange(dateProfile.validRange, dateSelection.range)) {\n return false;\n }\n return isNewPropsValid({ dateSelection: dateSelection }, context);\n}\nfunction isNewPropsValid(newProps, context) {\n var calendarState = context.getCurrentData();\n var props = __assign({ businessHours: calendarState.businessHours, dateSelection: '', eventStore: calendarState.eventStore, eventUiBases: calendarState.eventUiBases, eventSelection: '', eventDrag: null, eventResize: null }, newProps);\n return (context.pluginHooks.isPropsValid || isPropsValid)(props, context);\n}\nfunction isPropsValid(state, context, dateSpanMeta, filterConfig) {\n if (dateSpanMeta === void 0) { dateSpanMeta = {}; }\n if (state.eventDrag && !isInteractionPropsValid(state, context, dateSpanMeta, filterConfig)) {\n return false;\n }\n if (state.dateSelection && !isDateSelectionPropsValid(state, context, dateSpanMeta, filterConfig)) {\n return false;\n }\n return true;\n}\n// Moving Event Validation\n// ------------------------------------------------------------------------------------------------------------------------\nfunction isInteractionPropsValid(state, context, dateSpanMeta, filterConfig) {\n var currentState = context.getCurrentData();\n var interaction = state.eventDrag; // HACK: the eventDrag props is used for ALL interactions\n var subjectEventStore = interaction.mutatedEvents;\n var subjectDefs = subjectEventStore.defs;\n var subjectInstances = subjectEventStore.instances;\n var subjectConfigs = compileEventUis(subjectDefs, interaction.isEvent ?\n state.eventUiBases :\n { '': currentState.selectionConfig });\n if (filterConfig) {\n subjectConfigs = mapHash(subjectConfigs, filterConfig);\n }\n // exclude the subject events. TODO: exclude defs too?\n var otherEventStore = excludeInstances(state.eventStore, interaction.affectedEvents.instances);\n var otherDefs = otherEventStore.defs;\n var otherInstances = otherEventStore.instances;\n var otherConfigs = compileEventUis(otherDefs, state.eventUiBases);\n for (var subjectInstanceId in subjectInstances) {\n var subjectInstance = subjectInstances[subjectInstanceId];\n var subjectRange = subjectInstance.range;\n var subjectConfig = subjectConfigs[subjectInstance.defId];\n var subjectDef = subjectDefs[subjectInstance.defId];\n // constraint\n if (!allConstraintsPass(subjectConfig.constraints, subjectRange, otherEventStore, state.businessHours, context)) {\n return false;\n }\n // overlap\n var eventOverlap = context.options.eventOverlap;\n var eventOverlapFunc = typeof eventOverlap === 'function' ? eventOverlap : null;\n for (var otherInstanceId in otherInstances) {\n var otherInstance = otherInstances[otherInstanceId];\n // intersect! evaluate\n if (rangesIntersect(subjectRange, otherInstance.range)) {\n var otherOverlap = otherConfigs[otherInstance.defId].overlap;\n // consider the other event's overlap. only do this if the subject event is a \"real\" event\n if (otherOverlap === false && interaction.isEvent) {\n return false;\n }\n if (subjectConfig.overlap === false) {\n return false;\n }\n if (eventOverlapFunc && !eventOverlapFunc(new EventApi(context, otherDefs[otherInstance.defId], otherInstance), // still event\n new EventApi(context, subjectDef, subjectInstance))) {\n return false;\n }\n }\n }\n // allow (a function)\n var calendarEventStore = currentState.eventStore; // need global-to-calendar, not local to component (splittable)state\n for (var _i = 0, _a = subjectConfig.allows; _i < _a.length; _i++) {\n var subjectAllow = _a[_i];\n var subjectDateSpan = __assign(__assign({}, dateSpanMeta), { range: subjectInstance.range, allDay: subjectDef.allDay });\n var origDef = calendarEventStore.defs[subjectDef.defId];\n var origInstance = calendarEventStore.instances[subjectInstanceId];\n var eventApi = void 0;\n if (origDef) { // was previously in the calendar\n eventApi = new EventApi(context, origDef, origInstance);\n }\n else { // was an external event\n eventApi = new EventApi(context, subjectDef); // no instance, because had no dates\n }\n if (!subjectAllow(buildDateSpanApiWithContext(subjectDateSpan, context), eventApi)) {\n return false;\n }\n }\n }\n return true;\n}\n// Date Selection Validation\n// ------------------------------------------------------------------------------------------------------------------------\nfunction isDateSelectionPropsValid(state, context, dateSpanMeta, filterConfig) {\n var relevantEventStore = state.eventStore;\n var relevantDefs = relevantEventStore.defs;\n var relevantInstances = relevantEventStore.instances;\n var selection = state.dateSelection;\n var selectionRange = selection.range;\n var selectionConfig = context.getCurrentData().selectionConfig;\n if (filterConfig) {\n selectionConfig = filterConfig(selectionConfig);\n }\n // constraint\n if (!allConstraintsPass(selectionConfig.constraints, selectionRange, relevantEventStore, state.businessHours, context)) {\n return false;\n }\n // overlap\n var selectOverlap = context.options.selectOverlap;\n var selectOverlapFunc = typeof selectOverlap === 'function' ? selectOverlap : null;\n for (var relevantInstanceId in relevantInstances) {\n var relevantInstance = relevantInstances[relevantInstanceId];\n // intersect! evaluate\n if (rangesIntersect(selectionRange, relevantInstance.range)) {\n if (selectionConfig.overlap === false) {\n return false;\n }\n if (selectOverlapFunc && !selectOverlapFunc(new EventApi(context, relevantDefs[relevantInstance.defId], relevantInstance), null)) {\n return false;\n }\n }\n }\n // allow (a function)\n for (var _i = 0, _a = selectionConfig.allows; _i < _a.length; _i++) {\n var selectionAllow = _a[_i];\n var fullDateSpan = __assign(__assign({}, dateSpanMeta), selection);\n if (!selectionAllow(buildDateSpanApiWithContext(fullDateSpan, context), null)) {\n return false;\n }\n }\n return true;\n}\n// Constraint Utils\n// ------------------------------------------------------------------------------------------------------------------------\nfunction allConstraintsPass(constraints, subjectRange, otherEventStore, businessHoursUnexpanded, context) {\n for (var _i = 0, constraints_1 = constraints; _i < constraints_1.length; _i++) {\n var constraint = constraints_1[_i];\n if (!anyRangesContainRange(constraintToRanges(constraint, subjectRange, otherEventStore, businessHoursUnexpanded, context), subjectRange)) {\n return false;\n }\n }\n return true;\n}\nfunction constraintToRanges(constraint, subjectRange, // for expanding a recurring constraint, or expanding business hours\notherEventStore, // for if constraint is an even group ID\nbusinessHoursUnexpanded, // for if constraint is 'businessHours'\ncontext) {\n if (constraint === 'businessHours') {\n return eventStoreToRanges(expandRecurring(businessHoursUnexpanded, subjectRange, context));\n }\n if (typeof constraint === 'string') { // an group ID\n return eventStoreToRanges(filterEventStoreDefs(otherEventStore, function (eventDef) { return eventDef.groupId === constraint; }));\n }\n if (typeof constraint === 'object' && constraint) { // non-null object\n return eventStoreToRanges(expandRecurring(constraint, subjectRange, context));\n }\n return []; // if it's false\n}\n// TODO: move to event-store file?\nfunction eventStoreToRanges(eventStore) {\n var instances = eventStore.instances;\n var ranges = [];\n for (var instanceId in instances) {\n ranges.push(instances[instanceId].range);\n }\n return ranges;\n}\n// TODO: move to geom file?\nfunction anyRangesContainRange(outerRanges, innerRange) {\n for (var _i = 0, outerRanges_1 = outerRanges; _i < outerRanges_1.length; _i++) {\n var outerRange = outerRanges_1[_i];\n if (rangeContainsRange(outerRange, innerRange)) {\n return true;\n }\n }\n return false;\n}\n\nvar VISIBLE_HIDDEN_RE = /^(visible|hidden)$/;\nvar Scroller = /** @class */ (function (_super) {\n __extends(Scroller, _super);\n function Scroller() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handleEl = function (el) {\n _this.el = el;\n setRef(_this.props.elRef, el);\n };\n return _this;\n }\n Scroller.prototype.render = function () {\n var props = this.props;\n var liquid = props.liquid, liquidIsAbsolute = props.liquidIsAbsolute;\n var isAbsolute = liquid && liquidIsAbsolute;\n var className = ['fc-scroller'];\n if (liquid) {\n if (liquidIsAbsolute) {\n className.push('fc-scroller-liquid-absolute');\n }\n else {\n className.push('fc-scroller-liquid');\n }\n }\n return (createElement(\"div\", { ref: this.handleEl, className: className.join(' '), style: {\n overflowX: props.overflowX,\n overflowY: props.overflowY,\n left: (isAbsolute && -(props.overcomeLeft || 0)) || '',\n right: (isAbsolute && -(props.overcomeRight || 0)) || '',\n bottom: (isAbsolute && -(props.overcomeBottom || 0)) || '',\n marginLeft: (!isAbsolute && -(props.overcomeLeft || 0)) || '',\n marginRight: (!isAbsolute && -(props.overcomeRight || 0)) || '',\n marginBottom: (!isAbsolute && -(props.overcomeBottom || 0)) || '',\n maxHeight: props.maxHeight || '',\n } }, props.children));\n };\n Scroller.prototype.needsXScrolling = function () {\n if (VISIBLE_HIDDEN_RE.test(this.props.overflowX)) {\n return false;\n }\n // testing scrollWidth>clientWidth is unreliable cross-browser when pixel heights aren't integers.\n // much more reliable to see if children are taller than the scroller, even tho doesn't account for\n // inner-child margins and absolute positioning\n var el = this.el;\n var realClientWidth = this.el.getBoundingClientRect().width - this.getYScrollbarWidth();\n var children = el.children;\n for (var i = 0; i < children.length; i += 1) {\n var childEl = children[i];\n if (childEl.getBoundingClientRect().width > realClientWidth) {\n return true;\n }\n }\n return false;\n };\n Scroller.prototype.needsYScrolling = function () {\n if (VISIBLE_HIDDEN_RE.test(this.props.overflowY)) {\n return false;\n }\n // testing scrollHeight>clientHeight is unreliable cross-browser when pixel heights aren't integers.\n // much more reliable to see if children are taller than the scroller, even tho doesn't account for\n // inner-child margins and absolute positioning\n var el = this.el;\n var realClientHeight = this.el.getBoundingClientRect().height - this.getXScrollbarWidth();\n var children = el.children;\n for (var i = 0; i < children.length; i += 1) {\n var childEl = children[i];\n if (childEl.getBoundingClientRect().height > realClientHeight) {\n return true;\n }\n }\n return false;\n };\n Scroller.prototype.getXScrollbarWidth = function () {\n if (VISIBLE_HIDDEN_RE.test(this.props.overflowX)) {\n return 0;\n }\n return this.el.offsetHeight - this.el.clientHeight; // only works because we guarantee no borders. TODO: add to CSS with important?\n };\n Scroller.prototype.getYScrollbarWidth = function () {\n if (VISIBLE_HIDDEN_RE.test(this.props.overflowY)) {\n return 0;\n }\n return this.el.offsetWidth - this.el.clientWidth; // only works because we guarantee no borders. TODO: add to CSS with important?\n };\n return Scroller;\n}(BaseComponent));\n\n/*\nTODO: somehow infer OtherArgs from masterCallback?\nTODO: infer RefType from masterCallback if provided\n*/\nvar RefMap = /** @class */ (function () {\n function RefMap(masterCallback) {\n var _this = this;\n this.masterCallback = masterCallback;\n this.currentMap = {};\n this.depths = {};\n this.callbackMap = {};\n this.handleValue = function (val, key) {\n var _a = _this, depths = _a.depths, currentMap = _a.currentMap;\n var removed = false;\n var added = false;\n if (val !== null) {\n // for bug... ACTUALLY: can probably do away with this now that callers don't share numeric indices anymore\n removed = (key in currentMap);\n currentMap[key] = val;\n depths[key] = (depths[key] || 0) + 1;\n added = true;\n }\n else {\n depths[key] -= 1;\n if (!depths[key]) {\n delete currentMap[key];\n delete _this.callbackMap[key];\n removed = true;\n }\n }\n if (_this.masterCallback) {\n if (removed) {\n _this.masterCallback(null, String(key));\n }\n if (added) {\n _this.masterCallback(val, String(key));\n }\n }\n };\n }\n RefMap.prototype.createRef = function (key) {\n var _this = this;\n var refCallback = this.callbackMap[key];\n if (!refCallback) {\n refCallback = this.callbackMap[key] = function (val) {\n _this.handleValue(val, String(key));\n };\n }\n return refCallback;\n };\n // TODO: check callers that don't care about order. should use getAll instead\n // NOTE: this method has become less valuable now that we are encouraged to map order by some other index\n // TODO: provide ONE array-export function, buildArray, which fails on non-numeric indexes. caller can manipulate and \"collect\"\n RefMap.prototype.collect = function (startIndex, endIndex, step) {\n return collectFromHash(this.currentMap, startIndex, endIndex, step);\n };\n RefMap.prototype.getAll = function () {\n return hashValuesToArray(this.currentMap);\n };\n return RefMap;\n}());\n\nfunction computeShrinkWidth(chunkEls) {\n var shrinkCells = findElements(chunkEls, '.fc-scrollgrid-shrink');\n var largestWidth = 0;\n for (var _i = 0, shrinkCells_1 = shrinkCells; _i < shrinkCells_1.length; _i++) {\n var shrinkCell = shrinkCells_1[_i];\n largestWidth = Math.max(largestWidth, computeSmallestCellWidth(shrinkCell));\n }\n return Math.ceil(largestWidth); // elements work best with integers. round up to ensure contents fits\n}\nfunction getSectionHasLiquidHeight(props, sectionConfig) {\n return props.liquid && sectionConfig.liquid; // does the section do liquid-height? (need to have whole scrollgrid liquid-height as well)\n}\nfunction getAllowYScrolling(props, sectionConfig) {\n return sectionConfig.maxHeight != null || // if its possible for the height to max out, we might need scrollbars\n getSectionHasLiquidHeight(props, sectionConfig); // if the section is liquid height, it might condense enough to require scrollbars\n}\n// TODO: ONLY use `arg`. force out internal function to use same API\nfunction renderChunkContent(sectionConfig, chunkConfig, arg, isHeader) {\n var expandRows = arg.expandRows;\n var content = typeof chunkConfig.content === 'function' ?\n chunkConfig.content(arg) :\n createElement('table', {\n role: 'presentation',\n className: [\n chunkConfig.tableClassName,\n sectionConfig.syncRowHeights ? 'fc-scrollgrid-sync-table' : '',\n ].join(' '),\n style: {\n minWidth: arg.tableMinWidth,\n width: arg.clientWidth,\n height: expandRows ? arg.clientHeight : '', // css `height` on a
serves as a min-height\n },\n }, arg.tableColGroupNode, createElement(isHeader ? 'thead' : 'tbody', {\n role: 'presentation',\n }, typeof chunkConfig.rowContent === 'function'\n ? chunkConfig.rowContent(arg)\n : chunkConfig.rowContent));\n return content;\n}\nfunction isColPropsEqual(cols0, cols1) {\n return isArraysEqual(cols0, cols1, isPropsEqual);\n}\nfunction renderMicroColGroup(cols, shrinkWidth) {\n var colNodes = [];\n /*\n for ColProps with spans, it would have been great to make a single \n HOWEVER, Chrome was getting messing up distributing the width to elements makes Chrome behave.\n */\n for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) {\n var colProps = cols_1[_i];\n var span = colProps.span || 1;\n for (var i = 0; i < span; i += 1) {\n colNodes.push(createElement(\"col\", { style: {\n width: colProps.width === 'shrink' ? sanitizeShrinkWidth(shrinkWidth) : (colProps.width || ''),\n minWidth: colProps.minWidth || '',\n } }));\n }\n }\n return createElement.apply(void 0, __spreadArray(['colgroup', {}], colNodes));\n}\nfunction sanitizeShrinkWidth(shrinkWidth) {\n /* why 4? if we do 0, it will kill any border, which are needed for computeSmallestCellWidth\n 4 accounts for 2 2-pixel borders. TODO: better solution? */\n return shrinkWidth == null ? 4 : shrinkWidth;\n}\nfunction hasShrinkWidth(cols) {\n for (var _i = 0, cols_2 = cols; _i < cols_2.length; _i++) {\n var col = cols_2[_i];\n if (col.width === 'shrink') {\n return true;\n }\n }\n return false;\n}\nfunction getScrollGridClassNames(liquid, context) {\n var classNames = [\n 'fc-scrollgrid',\n context.theme.getClass('table'),\n ];\n if (liquid) {\n classNames.push('fc-scrollgrid-liquid');\n }\n return classNames;\n}\nfunction getSectionClassNames(sectionConfig, wholeTableVGrow) {\n var classNames = [\n 'fc-scrollgrid-section',\n \"fc-scrollgrid-section-\" + sectionConfig.type,\n sectionConfig.className, // used?\n ];\n if (wholeTableVGrow && sectionConfig.liquid && sectionConfig.maxHeight == null) {\n classNames.push('fc-scrollgrid-section-liquid');\n }\n if (sectionConfig.isSticky) {\n classNames.push('fc-scrollgrid-section-sticky');\n }\n return classNames;\n}\nfunction renderScrollShim(arg) {\n return (createElement(\"div\", { className: \"fc-scrollgrid-sticky-shim\", style: {\n width: arg.clientWidth,\n minWidth: arg.tableMinWidth,\n } }));\n}\nfunction getStickyHeaderDates(options) {\n var stickyHeaderDates = options.stickyHeaderDates;\n if (stickyHeaderDates == null || stickyHeaderDates === 'auto') {\n stickyHeaderDates = options.height === 'auto' || options.viewHeight === 'auto';\n }\n return stickyHeaderDates;\n}\nfunction getStickyFooterScrollbar(options) {\n var stickyFooterScrollbar = options.stickyFooterScrollbar;\n if (stickyFooterScrollbar == null || stickyFooterScrollbar === 'auto') {\n stickyFooterScrollbar = options.height === 'auto' || options.viewHeight === 'auto';\n }\n return stickyFooterScrollbar;\n}\n\nvar SimpleScrollGrid = /** @class */ (function (_super) {\n __extends(SimpleScrollGrid, _super);\n function SimpleScrollGrid() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.processCols = memoize(function (a) { return a; }, isColPropsEqual); // so we get same `cols` props every time\n // yucky to memoize VNodes, but much more efficient for consumers\n _this.renderMicroColGroup = memoize(renderMicroColGroup);\n _this.scrollerRefs = new RefMap();\n _this.scrollerElRefs = new RefMap(_this._handleScrollerEl.bind(_this));\n _this.state = {\n shrinkWidth: null,\n forceYScrollbars: false,\n scrollerClientWidths: {},\n scrollerClientHeights: {},\n };\n // TODO: can do a really simple print-view. dont need to join rows\n _this.handleSizing = function () {\n _this.safeSetState(__assign({ shrinkWidth: _this.computeShrinkWidth() }, _this.computeScrollerDims()));\n };\n return _this;\n }\n SimpleScrollGrid.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var sectionConfigs = props.sections || [];\n var cols = this.processCols(props.cols);\n var microColGroupNode = this.renderMicroColGroup(cols, state.shrinkWidth);\n var classNames = getScrollGridClassNames(props.liquid, context);\n if (props.collapsibleWidth) {\n classNames.push('fc-scrollgrid-collapsible');\n }\n // TODO: make DRY\n var configCnt = sectionConfigs.length;\n var configI = 0;\n var currentConfig;\n var headSectionNodes = [];\n var bodySectionNodes = [];\n var footSectionNodes = [];\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'header') {\n headSectionNodes.push(this.renderSection(currentConfig, microColGroupNode, true));\n configI += 1;\n }\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'body') {\n bodySectionNodes.push(this.renderSection(currentConfig, microColGroupNode, false));\n configI += 1;\n }\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'footer') {\n footSectionNodes.push(this.renderSection(currentConfig, microColGroupNode, true));\n configI += 1;\n }\n // firefox bug: when setting height on table and there is a thead or tfoot,\n // the necessary height:100% on the liquid-height body section forces the *whole* table to be taller. (bug #5524)\n // use getCanVGrowWithinCell as a way to detect table-stupid firefox.\n // if so, use a simpler dom structure, jam everything into a lone tbody.\n var isBuggy = !getCanVGrowWithinCell();\n var roleAttrs = { role: 'rowgroup' };\n return createElement('table', {\n role: 'grid',\n className: classNames.join(' '),\n style: { height: props.height },\n }, Boolean(!isBuggy && headSectionNodes.length) && createElement.apply(void 0, __spreadArray(['thead', roleAttrs], headSectionNodes)), Boolean(!isBuggy && bodySectionNodes.length) && createElement.apply(void 0, __spreadArray(['tbody', roleAttrs], bodySectionNodes)), Boolean(!isBuggy && footSectionNodes.length) && createElement.apply(void 0, __spreadArray(['tfoot', roleAttrs], footSectionNodes)), isBuggy && createElement.apply(void 0, __spreadArray(__spreadArray(__spreadArray(['tbody', roleAttrs], headSectionNodes), bodySectionNodes), footSectionNodes)));\n };\n SimpleScrollGrid.prototype.renderSection = function (sectionConfig, microColGroupNode, isHeader) {\n if ('outerContent' in sectionConfig) {\n return (createElement(Fragment, { key: sectionConfig.key }, sectionConfig.outerContent));\n }\n return (createElement(\"tr\", { key: sectionConfig.key, role: \"presentation\", className: getSectionClassNames(sectionConfig, this.props.liquid).join(' ') }, this.renderChunkTd(sectionConfig, microColGroupNode, sectionConfig.chunk, isHeader)));\n };\n SimpleScrollGrid.prototype.renderChunkTd = function (sectionConfig, microColGroupNode, chunkConfig, isHeader) {\n if ('outerContent' in chunkConfig) {\n return chunkConfig.outerContent;\n }\n var props = this.props;\n var _a = this.state, forceYScrollbars = _a.forceYScrollbars, scrollerClientWidths = _a.scrollerClientWidths, scrollerClientHeights = _a.scrollerClientHeights;\n var needsYScrolling = getAllowYScrolling(props, sectionConfig); // TODO: do lazily. do in section config?\n var isLiquid = getSectionHasLiquidHeight(props, sectionConfig);\n // for `!props.liquid` - is WHOLE scrollgrid natural height?\n // TODO: do same thing in advanced scrollgrid? prolly not b/c always has horizontal scrollbars\n var overflowY = !props.liquid ? 'visible' :\n forceYScrollbars ? 'scroll' :\n !needsYScrolling ? 'hidden' :\n 'auto';\n var sectionKey = sectionConfig.key;\n var content = renderChunkContent(sectionConfig, chunkConfig, {\n tableColGroupNode: microColGroupNode,\n tableMinWidth: '',\n clientWidth: (!props.collapsibleWidth && scrollerClientWidths[sectionKey] !== undefined) ? scrollerClientWidths[sectionKey] : null,\n clientHeight: scrollerClientHeights[sectionKey] !== undefined ? scrollerClientHeights[sectionKey] : null,\n expandRows: sectionConfig.expandRows,\n syncRowHeights: false,\n rowSyncHeights: [],\n reportRowHeightChange: function () { },\n }, isHeader);\n return createElement(isHeader ? 'th' : 'td', {\n ref: chunkConfig.elRef,\n role: 'presentation',\n }, createElement(\"div\", { className: \"fc-scroller-harness\" + (isLiquid ? ' fc-scroller-harness-liquid' : '') },\n createElement(Scroller, { ref: this.scrollerRefs.createRef(sectionKey), elRef: this.scrollerElRefs.createRef(sectionKey), overflowY: overflowY, overflowX: !props.liquid ? 'visible' : 'hidden' /* natural height? */, maxHeight: sectionConfig.maxHeight, liquid: isLiquid, liquidIsAbsolute // because its within a harness\n : true }, content)));\n };\n SimpleScrollGrid.prototype._handleScrollerEl = function (scrollerEl, key) {\n var section = getSectionByKey(this.props.sections, key);\n if (section) {\n setRef(section.chunk.scrollerElRef, scrollerEl);\n }\n };\n SimpleScrollGrid.prototype.componentDidMount = function () {\n this.handleSizing();\n this.context.addResizeHandler(this.handleSizing);\n };\n SimpleScrollGrid.prototype.componentDidUpdate = function () {\n // TODO: need better solution when state contains non-sizing things\n this.handleSizing();\n };\n SimpleScrollGrid.prototype.componentWillUnmount = function () {\n this.context.removeResizeHandler(this.handleSizing);\n };\n SimpleScrollGrid.prototype.computeShrinkWidth = function () {\n return hasShrinkWidth(this.props.cols)\n ? computeShrinkWidth(this.scrollerElRefs.getAll())\n : 0;\n };\n SimpleScrollGrid.prototype.computeScrollerDims = function () {\n var scrollbarWidth = getScrollbarWidths();\n var _a = this, scrollerRefs = _a.scrollerRefs, scrollerElRefs = _a.scrollerElRefs;\n var forceYScrollbars = false;\n var scrollerClientWidths = {};\n var scrollerClientHeights = {};\n for (var sectionKey in scrollerRefs.currentMap) {\n var scroller = scrollerRefs.currentMap[sectionKey];\n if (scroller && scroller.needsYScrolling()) {\n forceYScrollbars = true;\n break;\n }\n }\n for (var _i = 0, _b = this.props.sections; _i < _b.length; _i++) {\n var section = _b[_i];\n var sectionKey = section.key;\n var scrollerEl = scrollerElRefs.currentMap[sectionKey];\n if (scrollerEl) {\n var harnessEl = scrollerEl.parentNode; // TODO: weird way to get this. need harness b/c doesn't include table borders\n scrollerClientWidths[sectionKey] = Math.floor(harnessEl.getBoundingClientRect().width - (forceYScrollbars\n ? scrollbarWidth.y // use global because scroller might not have scrollbars yet but will need them in future\n : 0));\n scrollerClientHeights[sectionKey] = Math.floor(harnessEl.getBoundingClientRect().height);\n }\n }\n return { forceYScrollbars: forceYScrollbars, scrollerClientWidths: scrollerClientWidths, scrollerClientHeights: scrollerClientHeights };\n };\n return SimpleScrollGrid;\n}(BaseComponent));\nSimpleScrollGrid.addStateEquality({\n scrollerClientWidths: isPropsEqual,\n scrollerClientHeights: isPropsEqual,\n});\nfunction getSectionByKey(sections, key) {\n for (var _i = 0, sections_1 = sections; _i < sections_1.length; _i++) {\n var section = sections_1[_i];\n if (section.key === key) {\n return section;\n }\n }\n return null;\n}\n\nvar EventRoot = /** @class */ (function (_super) {\n __extends(EventRoot, _super);\n function EventRoot() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.elRef = createRef();\n return _this;\n }\n EventRoot.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var seg = props.seg;\n var eventRange = seg.eventRange;\n var ui = eventRange.ui;\n var hookProps = {\n event: new EventApi(context, eventRange.def, eventRange.instance),\n view: context.viewApi,\n timeText: props.timeText,\n textColor: ui.textColor,\n backgroundColor: ui.backgroundColor,\n borderColor: ui.borderColor,\n isDraggable: !props.disableDragging && computeSegDraggable(seg, context),\n isStartResizable: !props.disableResizing && computeSegStartResizable(seg, context),\n isEndResizable: !props.disableResizing && computeSegEndResizable(seg),\n isMirror: Boolean(props.isDragging || props.isResizing || props.isDateSelecting),\n isStart: Boolean(seg.isStart),\n isEnd: Boolean(seg.isEnd),\n isPast: Boolean(props.isPast),\n isFuture: Boolean(props.isFuture),\n isToday: Boolean(props.isToday),\n isSelected: Boolean(props.isSelected),\n isDragging: Boolean(props.isDragging),\n isResizing: Boolean(props.isResizing),\n };\n var standardClassNames = getEventClassNames(hookProps).concat(ui.classNames);\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.eventClassNames, content: options.eventContent, defaultContent: props.defaultContent, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount, elRef: this.elRef }, function (rootElRef, customClassNames, innerElRef, innerContent) { return props.children(rootElRef, standardClassNames.concat(customClassNames), innerElRef, innerContent, hookProps); }));\n };\n EventRoot.prototype.componentDidMount = function () {\n setElSeg(this.elRef.current, this.props.seg);\n };\n /*\n need to re-assign seg to the element if seg changes, even if the element is the same\n */\n EventRoot.prototype.componentDidUpdate = function (prevProps) {\n var seg = this.props.seg;\n if (seg !== prevProps.seg) {\n setElSeg(this.elRef.current, seg);\n }\n };\n return EventRoot;\n}(BaseComponent));\n\n// should not be a purecomponent\nvar StandardEvent = /** @class */ (function (_super) {\n __extends(StandardEvent, _super);\n function StandardEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StandardEvent.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var seg = props.seg;\n var timeFormat = context.options.eventTimeFormat || props.defaultTimeFormat;\n var timeText = buildSegTimeText(seg, timeFormat, context, props.defaultDisplayEventTime, props.defaultDisplayEventEnd);\n return (createElement(EventRoot, { seg: seg, timeText: timeText, disableDragging: props.disableDragging, disableResizing: props.disableResizing, defaultContent: props.defaultContent || renderInnerContent$1, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting, isSelected: props.isSelected, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (createElement(\"a\", __assign({ className: props.extraClassNames.concat(classNames).join(' '), style: {\n borderColor: hookProps.borderColor,\n backgroundColor: hookProps.backgroundColor,\n }, ref: rootElRef }, getSegAnchorAttrs(seg, context)),\n createElement(\"div\", { className: \"fc-event-main\", ref: innerElRef, style: { color: hookProps.textColor } }, innerContent),\n hookProps.isStartResizable &&\n createElement(\"div\", { className: \"fc-event-resizer fc-event-resizer-start\" }),\n hookProps.isEndResizable &&\n createElement(\"div\", { className: \"fc-event-resizer fc-event-resizer-end\" }))); }));\n };\n return StandardEvent;\n}(BaseComponent));\nfunction renderInnerContent$1(innerProps) {\n return (createElement(\"div\", { className: \"fc-event-main-frame\" },\n innerProps.timeText && (createElement(\"div\", { className: \"fc-event-time\" }, innerProps.timeText)),\n createElement(\"div\", { className: \"fc-event-title-container\" },\n createElement(\"div\", { className: \"fc-event-title fc-sticky\" }, innerProps.event.title || createElement(Fragment, null, \"\\u00A0\")))));\n}\n\nvar NowIndicatorRoot = function (props) { return (createElement(ViewContextType.Consumer, null, function (context) {\n var options = context.options;\n var hookProps = {\n isAxis: props.isAxis,\n date: context.dateEnv.toDate(props.date),\n view: context.viewApi,\n };\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.nowIndicatorClassNames, content: options.nowIndicatorContent, didMount: options.nowIndicatorDidMount, willUnmount: options.nowIndicatorWillUnmount }, props.children));\n})); };\n\nvar DAY_NUM_FORMAT = createFormatter({ day: 'numeric' });\nvar DayCellContent = /** @class */ (function (_super) {\n __extends(DayCellContent, _super);\n function DayCellContent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayCellContent.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var hookProps = refineDayCellHookProps({\n date: props.date,\n dateProfile: props.dateProfile,\n todayRange: props.todayRange,\n showDayNumber: props.showDayNumber,\n extraProps: props.extraHookProps,\n viewApi: context.viewApi,\n dateEnv: context.dateEnv,\n });\n return (createElement(ContentHook, { hookProps: hookProps, content: options.dayCellContent, defaultContent: props.defaultContent }, props.children));\n };\n return DayCellContent;\n}(BaseComponent));\nfunction refineDayCellHookProps(raw) {\n var date = raw.date, dateEnv = raw.dateEnv;\n var dayMeta = getDateMeta(date, raw.todayRange, null, raw.dateProfile);\n return __assign(__assign(__assign({ date: dateEnv.toDate(date), view: raw.viewApi }, dayMeta), { dayNumberText: raw.showDayNumber ? dateEnv.format(date, DAY_NUM_FORMAT) : '' }), raw.extraProps);\n}\n\nvar DayCellRoot = /** @class */ (function (_super) {\n __extends(DayCellRoot, _super);\n function DayCellRoot() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.refineHookProps = memoizeObjArg(refineDayCellHookProps);\n _this.normalizeClassNames = buildClassNameNormalizer();\n return _this;\n }\n DayCellRoot.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var hookProps = this.refineHookProps({\n date: props.date,\n dateProfile: props.dateProfile,\n todayRange: props.todayRange,\n showDayNumber: props.showDayNumber,\n extraProps: props.extraHookProps,\n viewApi: context.viewApi,\n dateEnv: context.dateEnv,\n });\n var classNames = getDayClassNames(hookProps, context.theme).concat(hookProps.isDisabled\n ? [] // don't use custom classNames if disabled\n : this.normalizeClassNames(options.dayCellClassNames, hookProps));\n var dataAttrs = hookProps.isDisabled ? {} : {\n 'data-date': formatDayString(props.date),\n };\n return (createElement(MountHook, { hookProps: hookProps, didMount: options.dayCellDidMount, willUnmount: options.dayCellWillUnmount, elRef: props.elRef }, function (rootElRef) { return props.children(rootElRef, classNames, dataAttrs, hookProps.isDisabled); }));\n };\n return DayCellRoot;\n}(BaseComponent));\n\nfunction renderFill(fillType) {\n return (createElement(\"div\", { className: \"fc-\" + fillType }));\n}\nvar BgEvent = function (props) { return (createElement(EventRoot, { defaultContent: renderInnerContent, seg: props.seg /* uselesss i think */, timeText: \"\", disableDragging: true, disableResizing: true, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-bg-event'].concat(classNames).join(' '), style: {\n backgroundColor: hookProps.backgroundColor,\n } }, innerContent)); })); };\nfunction renderInnerContent(props) {\n var title = props.event.title;\n return title && (createElement(\"div\", { className: \"fc-event-title\" }, props.event.title));\n}\n\nvar WeekNumberRoot = function (props) { return (createElement(ViewContextType.Consumer, null, function (context) {\n var dateEnv = context.dateEnv, options = context.options;\n var date = props.date;\n var format = options.weekNumberFormat || props.defaultFormat;\n var num = dateEnv.computeWeekNumber(date); // TODO: somehow use for formatting as well?\n var text = dateEnv.format(date, format);\n var hookProps = { num: num, text: text, date: date };\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.weekNumberClassNames, content: options.weekNumberContent, defaultContent: renderInner, didMount: options.weekNumberDidMount, willUnmount: options.weekNumberWillUnmount }, props.children));\n})); };\nfunction renderInner(innerProps) {\n return innerProps.text;\n}\n\nvar PADDING_FROM_VIEWPORT = 10;\nvar Popover = /** @class */ (function (_super) {\n __extends(Popover, _super);\n function Popover() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n titleId: getUniqueDomId(),\n };\n _this.handleRootEl = function (el) {\n _this.rootEl = el;\n if (_this.props.elRef) {\n setRef(_this.props.elRef, el);\n }\n };\n // Triggered when the user clicks *anywhere* in the document, for the autoHide feature\n _this.handleDocumentMouseDown = function (ev) {\n // only hide the popover if the click happened outside the popover\n var target = getEventTargetViaRoot(ev);\n if (!_this.rootEl.contains(target)) {\n _this.handleCloseClick();\n }\n };\n _this.handleDocumentKeyDown = function (ev) {\n if (ev.key === 'Escape') {\n _this.handleCloseClick();\n }\n };\n _this.handleCloseClick = function () {\n var onClose = _this.props.onClose;\n if (onClose) {\n onClose();\n }\n };\n return _this;\n }\n Popover.prototype.render = function () {\n var _a = this.context, theme = _a.theme, options = _a.options;\n var _b = this, props = _b.props, state = _b.state;\n var classNames = [\n 'fc-popover',\n theme.getClass('popover'),\n ].concat(props.extraClassNames || []);\n return createPortal(createElement(\"div\", __assign({ id: props.id, className: classNames.join(' '), \"aria-labelledby\": state.titleId }, props.extraAttrs, { ref: this.handleRootEl }),\n createElement(\"div\", { className: 'fc-popover-header ' + theme.getClass('popoverHeader') },\n createElement(\"span\", { className: \"fc-popover-title\", id: state.titleId }, props.title),\n createElement(\"span\", { className: 'fc-popover-close ' + theme.getIconClass('close'), title: options.closeHint, onClick: this.handleCloseClick })),\n createElement(\"div\", { className: 'fc-popover-body ' + theme.getClass('popoverContent') }, props.children)), props.parentEl);\n };\n Popover.prototype.componentDidMount = function () {\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n this.updateSize();\n };\n Popover.prototype.componentWillUnmount = function () {\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n };\n Popover.prototype.updateSize = function () {\n var isRtl = this.context.isRtl;\n var _a = this.props, alignmentEl = _a.alignmentEl, alignGridTop = _a.alignGridTop;\n var rootEl = this.rootEl;\n var alignmentRect = computeClippedClientRect(alignmentEl);\n if (alignmentRect) {\n var popoverDims = rootEl.getBoundingClientRect();\n // position relative to viewport\n var popoverTop = alignGridTop\n ? elementClosest(alignmentEl, '.fc-scrollgrid').getBoundingClientRect().top\n : alignmentRect.top;\n var popoverLeft = isRtl ? alignmentRect.right - popoverDims.width : alignmentRect.left;\n // constrain\n popoverTop = Math.max(popoverTop, PADDING_FROM_VIEWPORT);\n popoverLeft = Math.min(popoverLeft, document.documentElement.clientWidth - PADDING_FROM_VIEWPORT - popoverDims.width);\n popoverLeft = Math.max(popoverLeft, PADDING_FROM_VIEWPORT);\n var origin_1 = rootEl.offsetParent.getBoundingClientRect();\n applyStyle(rootEl, {\n top: popoverTop - origin_1.top,\n left: popoverLeft - origin_1.left,\n });\n }\n };\n return Popover;\n}(BaseComponent));\n\nvar MorePopover = /** @class */ (function (_super) {\n __extends(MorePopover, _super);\n function MorePopover() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handleRootEl = function (rootEl) {\n _this.rootEl = rootEl;\n if (rootEl) {\n _this.context.registerInteractiveComponent(_this, {\n el: rootEl,\n useEventCenter: false,\n });\n }\n else {\n _this.context.unregisterInteractiveComponent(_this);\n }\n };\n return _this;\n }\n MorePopover.prototype.render = function () {\n var _a = this.context, options = _a.options, dateEnv = _a.dateEnv;\n var props = this.props;\n var startDate = props.startDate, todayRange = props.todayRange, dateProfile = props.dateProfile;\n var title = dateEnv.format(startDate, options.dayPopoverFormat);\n return (createElement(DayCellRoot, { date: startDate, dateProfile: dateProfile, todayRange: todayRange, elRef: this.handleRootEl }, function (rootElRef, dayClassNames, dataAttrs) { return (createElement(Popover, { elRef: rootElRef, id: props.id, title: title, extraClassNames: ['fc-more-popover'].concat(dayClassNames), extraAttrs: dataAttrs /* TODO: make these time-based when not whole-day? */, parentEl: props.parentEl, alignmentEl: props.alignmentEl, alignGridTop: props.alignGridTop, onClose: props.onClose },\n createElement(DayCellContent, { date: startDate, dateProfile: dateProfile, todayRange: todayRange }, function (innerElRef, innerContent) { return (innerContent &&\n createElement(\"div\", { className: \"fc-more-popover-misc\", ref: innerElRef }, innerContent)); }),\n props.children)); }));\n };\n MorePopover.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n var _a = this, rootEl = _a.rootEl, props = _a.props;\n if (positionLeft >= 0 && positionLeft < elWidth &&\n positionTop >= 0 && positionTop < elHeight) {\n return {\n dateProfile: props.dateProfile,\n dateSpan: __assign({ allDay: true, range: {\n start: props.startDate,\n end: props.endDate,\n } }, props.extraDateSpan),\n dayEl: rootEl,\n rect: {\n left: 0,\n top: 0,\n right: elWidth,\n bottom: elHeight,\n },\n layer: 1, // important when comparing with hits from other components\n };\n }\n return null;\n };\n return MorePopover;\n}(DateComponent));\n\nvar MoreLinkRoot = /** @class */ (function (_super) {\n __extends(MoreLinkRoot, _super);\n function MoreLinkRoot() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.linkElRef = createRef();\n _this.state = {\n isPopoverOpen: false,\n popoverId: getUniqueDomId(),\n };\n _this.handleClick = function (ev) {\n var _a = _this, props = _a.props, context = _a.context;\n var moreLinkClick = context.options.moreLinkClick;\n var date = computeRange(props).start;\n function buildPublicSeg(seg) {\n var _a = seg.eventRange, def = _a.def, instance = _a.instance, range = _a.range;\n return {\n event: new EventApi(context, def, instance),\n start: context.dateEnv.toDate(range.start),\n end: context.dateEnv.toDate(range.end),\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n };\n }\n if (typeof moreLinkClick === 'function') {\n moreLinkClick = moreLinkClick({\n date: date,\n allDay: Boolean(props.allDayDate),\n allSegs: props.allSegs.map(buildPublicSeg),\n hiddenSegs: props.hiddenSegs.map(buildPublicSeg),\n jsEvent: ev,\n view: context.viewApi,\n });\n }\n if (!moreLinkClick || moreLinkClick === 'popover') {\n _this.setState({ isPopoverOpen: true });\n }\n else if (typeof moreLinkClick === 'string') { // a view name\n context.calendarApi.zoomTo(date, moreLinkClick);\n }\n };\n _this.handlePopoverClose = function () {\n _this.setState({ isPopoverOpen: false });\n };\n return _this;\n }\n MoreLinkRoot.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, state = _a.state;\n return (createElement(ViewContextType.Consumer, null, function (context) {\n var viewApi = context.viewApi, options = context.options, calendarApi = context.calendarApi;\n var moreLinkText = options.moreLinkText;\n var moreCnt = props.moreCnt;\n var range = computeRange(props);\n var text = typeof moreLinkText === 'function' // TODO: eventually use formatWithOrdinals\n ? moreLinkText.call(calendarApi, moreCnt)\n : \"+\" + moreCnt + \" \" + moreLinkText;\n var title = formatWithOrdinals(options.moreLinkHint, [moreCnt], text);\n var hookProps = {\n num: moreCnt,\n shortText: \"+\" + moreCnt,\n text: text,\n view: viewApi,\n };\n return (createElement(Fragment, null,\n Boolean(props.moreCnt) && (createElement(RenderHook, { elRef: _this.linkElRef, hookProps: hookProps, classNames: options.moreLinkClassNames, content: options.moreLinkContent, defaultContent: props.defaultContent || renderMoreLinkInner, didMount: options.moreLinkDidMount, willUnmount: options.moreLinkWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return props.children(rootElRef, ['fc-more-link'].concat(customClassNames), innerElRef, innerContent, _this.handleClick, title, state.isPopoverOpen, state.isPopoverOpen ? state.popoverId : ''); })),\n state.isPopoverOpen && (createElement(MorePopover, { id: state.popoverId, startDate: range.start, endDate: range.end, dateProfile: props.dateProfile, todayRange: props.todayRange, extraDateSpan: props.extraDateSpan, parentEl: _this.parentEl, alignmentEl: props.alignmentElRef.current, alignGridTop: props.alignGridTop, onClose: _this.handlePopoverClose }, props.popoverContent()))));\n }));\n };\n MoreLinkRoot.prototype.componentDidMount = function () {\n this.updateParentEl();\n };\n MoreLinkRoot.prototype.componentDidUpdate = function () {\n this.updateParentEl();\n };\n MoreLinkRoot.prototype.updateParentEl = function () {\n if (this.linkElRef.current) {\n this.parentEl = elementClosest(this.linkElRef.current, '.fc-view-harness');\n }\n };\n return MoreLinkRoot;\n}(BaseComponent));\nfunction renderMoreLinkInner(props) {\n return props.text;\n}\nfunction computeRange(props) {\n if (props.allDayDate) {\n return {\n start: props.allDayDate,\n end: addDays(props.allDayDate, 1),\n };\n }\n var hiddenSegs = props.hiddenSegs;\n return {\n start: computeEarliestSegStart(hiddenSegs),\n end: computeLatestSegEnd(hiddenSegs),\n };\n}\nfunction computeEarliestSegStart(segs) {\n return segs.reduce(pickEarliestStart).eventRange.range.start;\n}\nfunction pickEarliestStart(seg0, seg1) {\n return seg0.eventRange.range.start < seg1.eventRange.range.start ? seg0 : seg1;\n}\nfunction computeLatestSegEnd(segs) {\n return segs.reduce(pickLatestEnd).eventRange.range.end;\n}\nfunction pickLatestEnd(seg0, seg1) {\n return seg0.eventRange.range.end > seg1.eventRange.range.end ? seg0 : seg1;\n}\n\n// exports\n// --------------------------------------------------------------------------------------------------\nvar version = '5.11.3'; // important to type it, so .d.ts has generic string\n\nexport { BASE_OPTION_DEFAULTS, BASE_OPTION_REFINERS, BaseComponent, BgEvent, CalendarApi, CalendarContent, CalendarDataManager, CalendarDataProvider, CalendarRoot, ContentHook, CustomContentRenderContext, DateComponent, DateEnv, DateProfileGenerator, DayCellContent, DayCellRoot, DayHeader, DaySeriesModel, DayTableModel, DelayedRunner, ElementDragging, ElementScrollController, Emitter, EventApi, EventRoot, EventSourceApi, Interaction, MoreLinkRoot, MountHook, NamedTimeZoneImpl, NowIndicatorRoot, NowTimer, PositionCache, RefMap, RenderHook, ScrollController, ScrollResponder, Scroller, SegHierarchy, SimpleScrollGrid, Slicer, Splitter, StandardEvent, TableDateCell, TableDowCell, Theme, ViewApi, ViewContextType, ViewRoot, WeekNumberRoot, WindowScrollController, addDays, addDurations, addMs, addWeeks, allowContextMenu, allowSelection, applyMutationToEventStore, applyStyle, applyStyleProp, asCleanDays, asRoughMinutes, asRoughMs, asRoughSeconds, binarySearch, buildClassNameNormalizer, buildEntryKey, buildEventApis, buildEventRangeKey, buildHashFromArray, buildIsoString, buildNavLinkAttrs, buildSegCompareObj, buildSegTimeText, collectFromHash, combineEventUis, compareByFieldSpec, compareByFieldSpecs, compareNumbers, compareObjs, computeEarliestSegStart, computeEdges, computeFallbackHeaderFormat, computeHeightAndMargins, computeInnerRect, computeRect, computeSegDraggable, computeSegEndResizable, computeSegStartResizable, computeShrinkWidth, computeSmallestCellWidth, computeVisibleDayRange, config, constrainPoint, createAriaClickAttrs, createDuration, createEmptyEventStore, createEventInstance, createEventUi, createFormatter, createPlugin, diffDates, diffDayAndTime, diffDays, diffPoints, diffWeeks, diffWholeDays, diffWholeWeeks, disableCursor, elementClosest, elementMatches, enableCursor, eventTupleToStore, filterEventStoreDefs, filterHash, findDirectChildren, findElements, flexibleCompare, formatDate, formatDayString, formatIsoTimeString, formatRange, getAllowYScrolling, getCanVGrowWithinCell, getClippingParents, getDateMeta, getDayClassNames, getDefaultEventEnd, getElRoot, getElSeg, getEntrySpanEnd, getEventClassNames, getEventTargetViaRoot, getIsRtlScrollbarOnLeft, getRectCenter, getRelevantEvents, getScrollGridClassNames, getScrollbarWidths, getSectionClassNames, getSectionHasLiquidHeight, getSegAnchorAttrs, getSegMeta, getSlotClassNames, getStickyFooterScrollbar, getStickyHeaderDates, getUnequalProps, getUniqueDomId, globalLocales, globalPlugins, greatestDurationDenominator, groupIntersectingEntries, guid, hasBgRendering, hasShrinkWidth, identity, interactionSettingsStore, interactionSettingsToStore, intersectRanges, intersectRects, intersectSpans, isArraysEqual, isColPropsEqual, isDateSelectionValid, isDateSpansEqual, isInt, isInteractionValid, isMultiDayRange, isPropsEqual, isPropsValid, isValidDate, joinSpans, listenBySelector, mapHash, memoize, memoizeArraylike, memoizeHashlike, memoizeObjArg, mergeEventStores, multiplyDuration, padStart, parseBusinessHours, parseClassNames, parseDragMeta, parseEventDef, parseFieldSpecs, parse as parseMarker, pointInsideRect, preventContextMenu, preventDefault, preventSelection, rangeContainsMarker, rangeContainsRange, rangesEqual, rangesIntersect, refineEventDef, refineProps, removeElement, removeExact, renderChunkContent, renderFill, renderMicroColGroup, renderScrollShim, requestJson, sanitizeShrinkWidth, setElSeg, setRef, sliceEventStore, sliceEvents, sortEventSegs, startOfDay, translateRect, triggerDateSelect, unpromisify, version, whenTransitionDone, wholeDivideDurations };\n//# sourceMappingURL=main.js.map\n","/*!\nFullCalendar v5.11.3\nDocs & License: https://fullcalendar.io/\n(c) 2022 Adam Shaw\n*/\nimport './vdom.js';\nimport { __extends, __assign } from 'tslib';\nimport { flushSync, render, createElement, CalendarRoot, CustomContentRenderContext, CalendarContent, unmountComponentAtNode, DelayedRunner, CalendarDataManager, isArraysEqual, applyStyleProp, CalendarApi } from '@fullcalendar/common';\nexport * from '@fullcalendar/common';\n\nvar Calendar = /** @class */ (function (_super) {\n __extends(Calendar, _super);\n function Calendar(el, optionOverrides) {\n if (optionOverrides === void 0) { optionOverrides = {}; }\n var _this = _super.call(this) || this;\n _this.isRendering = false;\n _this.isRendered = false;\n _this.currentClassNames = [];\n _this.customContentRenderId = 0; // will affect custom generated classNames?\n _this.handleAction = function (action) {\n // actions we know we want to render immediately\n switch (action.type) {\n case 'SET_EVENT_DRAG':\n case 'SET_EVENT_RESIZE':\n _this.renderRunner.tryDrain();\n }\n };\n _this.handleData = function (data) {\n _this.currentData = data;\n _this.renderRunner.request(data.calendarOptions.rerenderDelay);\n };\n _this.handleRenderRequest = function () {\n if (_this.isRendering) {\n _this.isRendered = true;\n var currentData_1 = _this.currentData;\n flushSync(function () {\n render(createElement(CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {\n _this.setClassNames(classNames);\n _this.setHeight(height);\n return (createElement(CustomContentRenderContext.Provider, { value: _this.customContentRenderId },\n createElement(CalendarContent, __assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));\n }), _this.el);\n });\n }\n else if (_this.isRendered) {\n _this.isRendered = false;\n unmountComponentAtNode(_this.el);\n _this.setClassNames([]);\n _this.setHeight('');\n }\n };\n _this.el = el;\n _this.renderRunner = new DelayedRunner(_this.handleRenderRequest);\n new CalendarDataManager({\n optionOverrides: optionOverrides,\n calendarApi: _this,\n onAction: _this.handleAction,\n onData: _this.handleData,\n });\n return _this;\n }\n Object.defineProperty(Calendar.prototype, \"view\", {\n get: function () { return this.currentData.viewApi; } // for public API\n ,\n enumerable: false,\n configurable: true\n });\n Calendar.prototype.render = function () {\n var wasRendering = this.isRendering;\n if (!wasRendering) {\n this.isRendering = true;\n }\n else {\n this.customContentRenderId += 1;\n }\n this.renderRunner.request();\n if (wasRendering) {\n this.updateSize();\n }\n };\n Calendar.prototype.destroy = function () {\n if (this.isRendering) {\n this.isRendering = false;\n this.renderRunner.request();\n }\n };\n Calendar.prototype.updateSize = function () {\n var _this = this;\n flushSync(function () {\n _super.prototype.updateSize.call(_this);\n });\n };\n Calendar.prototype.batchRendering = function (func) {\n this.renderRunner.pause('batchRendering');\n func();\n this.renderRunner.resume('batchRendering');\n };\n Calendar.prototype.pauseRendering = function () {\n this.renderRunner.pause('pauseRendering');\n };\n Calendar.prototype.resumeRendering = function () {\n this.renderRunner.resume('pauseRendering', true);\n };\n Calendar.prototype.resetOptions = function (optionOverrides, append) {\n this.currentDataManager.resetOptions(optionOverrides, append);\n };\n Calendar.prototype.setClassNames = function (classNames) {\n if (!isArraysEqual(classNames, this.currentClassNames)) {\n var classList = this.el.classList;\n for (var _i = 0, _a = this.currentClassNames; _i < _a.length; _i++) {\n var className = _a[_i];\n classList.remove(className);\n }\n for (var _b = 0, classNames_1 = classNames; _b < classNames_1.length; _b++) {\n var className = classNames_1[_b];\n classList.add(className);\n }\n this.currentClassNames = classNames;\n }\n };\n Calendar.prototype.setHeight = function (height) {\n applyStyleProp(this.el, 'height', height);\n };\n return Calendar;\n}(CalendarApi));\n\nexport { Calendar };\n//# sourceMappingURL=main.js.map\n","/*!\nFullCalendar Scheduler v5.11.3\nDocs & License: https://fullcalendar.io/scheduler\n(c) 2022 Adam Shaw\n*/\nimport { createElement, Fragment, config, isValidDate, addDays, createPlugin } from '@fullcalendar/common';\n\nvar RELEASE_DATE = '2022-08-23'; // for Scheduler\nvar UPGRADE_WINDOW = 365 + 7; // days. 1 week leeway, for tz shift reasons too\nvar INVALID_LICENSE_URL = 'http://fullcalendar.io/docs/schedulerLicenseKey#invalid';\nvar OUTDATED_LICENSE_URL = 'http://fullcalendar.io/docs/schedulerLicenseKey#outdated';\nvar PRESET_LICENSE_KEYS = [\n 'GPL-My-Project-Is-Open-Source',\n 'CC-Attribution-NonCommercial-NoDerivatives',\n];\nvar CSS = {\n position: 'absolute',\n zIndex: 99999,\n bottom: '1px',\n left: '1px',\n background: '#eee',\n borderColor: '#ddd',\n borderStyle: 'solid',\n borderWidth: '1px 1px 0 0',\n padding: '2px 4px',\n fontSize: '12px',\n borderTopRightRadius: '3px',\n};\nfunction buildLicenseWarning(context) {\n var key = context.options.schedulerLicenseKey;\n var currentUrl = typeof window !== 'undefined' ? window.location.href : '';\n if (!isImmuneUrl(currentUrl)) {\n var status_1 = processLicenseKey(key);\n if (status_1 !== 'valid') {\n return (createElement(\"div\", { className: \"fc-license-message\", style: CSS }, (status_1 === 'outdated') ? (createElement(Fragment, null,\n 'Your license key is too old to work with this version. ',\n createElement(\"a\", { href: OUTDATED_LICENSE_URL }, \"More Info\"))) : (createElement(Fragment, null,\n 'Your license key is invalid. ',\n createElement(\"a\", { href: INVALID_LICENSE_URL }, \"More Info\")))));\n }\n }\n return null;\n}\n/*\nThis decryption is not meant to be bulletproof. Just a way to remind about an upgrade.\n*/\nfunction processLicenseKey(key) {\n if (PRESET_LICENSE_KEYS.indexOf(key) !== -1) {\n return 'valid';\n }\n var parts = (key || '').match(/^(\\d+)-fcs-(\\d+)$/);\n if (parts && (parts[1].length === 10)) {\n var purchaseDate = new Date(parseInt(parts[2], 10) * 1000);\n var releaseDate = new Date(config.mockSchedulerReleaseDate || RELEASE_DATE);\n if (isValidDate(releaseDate)) { // token won't be replaced in dev mode\n var minPurchaseDate = addDays(releaseDate, -UPGRADE_WINDOW);\n if (minPurchaseDate < purchaseDate) {\n return 'valid';\n }\n return 'outdated';\n }\n }\n return 'invalid';\n}\nfunction isImmuneUrl(url) {\n return /\\w+:\\/\\/fullcalendar\\.io\\/|\\/examples\\/[\\w-]+\\.html$/.test(url);\n}\n\nvar OPTION_REFINERS = {\n schedulerLicenseKey: String,\n};\n\nvar main = createPlugin({\n optionRefiners: OPTION_REFINERS,\n viewContainerAppends: [buildLicenseWarning],\n});\n\nexport default main;\n//# sourceMappingURL=main.js.map\n","/*!\nFullCalendar Scheduler v5.11.3\nDocs & License: https://fullcalendar.io/scheduler\n(c) 2022 Adam Shaw\n*/\nimport { Emitter, DelayedRunner, removeElement, computeEdges, findElements, translateRect, computeInnerRect, applyStyle, createRef, setRef, getIsRtlScrollbarOnLeft, createElement, Scroller, isPropsEqual, BaseComponent, memoizeArraylike, renderMicroColGroup, RefMap, getScrollGridClassNames, getCanVGrowWithinCell, Fragment, getSectionClassNames, getAllowYScrolling, getSectionHasLiquidHeight, renderChunkContent, memoizeHashlike, config, computeShrinkWidth, getScrollbarWidths, collectFromHash, mapHash, isArraysEqual, sanitizeShrinkWidth, hasShrinkWidth, compareObjs, isColPropsEqual, createPlugin } from '@fullcalendar/common';\nimport premiumCommonPlugin from '@fullcalendar/premium-common';\nimport { __extends, __assign, __spreadArray } from 'tslib';\n\nvar WHEEL_EVENT_NAMES = 'wheel mousewheel DomMouseScroll MozMousePixelScroll'.split(' ');\n/*\nALSO, with the ability to disable touch\n*/\nvar ScrollListener = /** @class */ (function () {\n function ScrollListener(el) {\n var _this = this;\n this.el = el;\n this.emitter = new Emitter();\n this.isScrolling = false;\n this.isTouching = false; // user currently has finger down?\n this.isRecentlyWheeled = false;\n this.isRecentlyScrolled = false;\n this.wheelWaiter = new DelayedRunner(this._handleWheelWaited.bind(this));\n this.scrollWaiter = new DelayedRunner(this._handleScrollWaited.bind(this));\n // Handlers\n // ----------------------------------------------------------------------------------------------\n this.handleScroll = function () {\n _this.startScroll();\n _this.emitter.trigger('scroll', _this.isRecentlyWheeled, _this.isTouching);\n _this.isRecentlyScrolled = true;\n _this.scrollWaiter.request(500);\n };\n // will fire *before* the scroll event is fired (might not cause a scroll)\n this.handleWheel = function () {\n _this.isRecentlyWheeled = true;\n _this.wheelWaiter.request(500);\n };\n // will fire *before* the scroll event is fired (might not cause a scroll)\n this.handleTouchStart = function () {\n _this.isTouching = true;\n };\n this.handleTouchEnd = function () {\n _this.isTouching = false;\n // if the user ended their touch, and the scroll area wasn't moving,\n // we consider this to be the end of the scroll.\n if (!_this.isRecentlyScrolled) {\n _this.endScroll(); // won't fire if already ended\n }\n };\n el.addEventListener('scroll', this.handleScroll);\n el.addEventListener('touchstart', this.handleTouchStart, { passive: true });\n el.addEventListener('touchend', this.handleTouchEnd);\n for (var _i = 0, WHEEL_EVENT_NAMES_1 = WHEEL_EVENT_NAMES; _i < WHEEL_EVENT_NAMES_1.length; _i++) {\n var eventName = WHEEL_EVENT_NAMES_1[_i];\n el.addEventListener(eventName, this.handleWheel);\n }\n }\n ScrollListener.prototype.destroy = function () {\n var el = this.el;\n el.removeEventListener('scroll', this.handleScroll);\n el.removeEventListener('touchstart', this.handleTouchStart, { passive: true });\n el.removeEventListener('touchend', this.handleTouchEnd);\n for (var _i = 0, WHEEL_EVENT_NAMES_2 = WHEEL_EVENT_NAMES; _i < WHEEL_EVENT_NAMES_2.length; _i++) {\n var eventName = WHEEL_EVENT_NAMES_2[_i];\n el.removeEventListener(eventName, this.handleWheel);\n }\n };\n // Start / Stop\n // ----------------------------------------------------------------------------------------------\n ScrollListener.prototype.startScroll = function () {\n if (!this.isScrolling) {\n this.isScrolling = true;\n this.emitter.trigger('scrollStart', this.isRecentlyWheeled, this.isTouching);\n }\n };\n ScrollListener.prototype.endScroll = function () {\n if (this.isScrolling) {\n this.emitter.trigger('scrollEnd');\n this.isScrolling = false;\n this.isRecentlyScrolled = true;\n this.isRecentlyWheeled = false;\n this.scrollWaiter.clear();\n this.wheelWaiter.clear();\n }\n };\n ScrollListener.prototype._handleScrollWaited = function () {\n this.isRecentlyScrolled = false;\n // only end the scroll if not currently touching.\n // if touching, the scrolling will end later, on touchend.\n if (!this.isTouching) {\n this.endScroll(); // won't fire if already ended\n }\n };\n ScrollListener.prototype._handleWheelWaited = function () {\n this.isRecentlyWheeled = false;\n };\n return ScrollListener;\n}());\n\n// TODO: assume the el has no borders?\nfunction getScrollCanvasOrigin(scrollEl) {\n var rect = scrollEl.getBoundingClientRect();\n var edges = computeEdges(scrollEl); // TODO: pass in isRtl?\n return {\n left: rect.left + edges.borderLeft + edges.scrollbarLeft - getScrollFromLeftEdge(scrollEl),\n top: rect.top + edges.borderTop - scrollEl.scrollTop,\n };\n}\nfunction getScrollFromLeftEdge(el) {\n var scrollLeft = el.scrollLeft;\n var computedStyles = window.getComputedStyle(el); // TODO: pass in isRtl instead?\n if (computedStyles.direction === 'rtl') {\n switch (getRtlScrollSystem()) {\n case 'negative':\n scrollLeft *= -1; // convert to 'reverse'. fall through...\n case 'reverse': // scrollLeft is distance between scrollframe's right edge scrollcanvas's right edge\n scrollLeft = el.scrollWidth - scrollLeft - el.clientWidth;\n }\n }\n return scrollLeft;\n}\nfunction setScrollFromLeftEdge(el, scrollLeft) {\n var computedStyles = window.getComputedStyle(el); // TODO: pass in isRtl instead?\n if (computedStyles.direction === 'rtl') {\n switch (getRtlScrollSystem()) {\n case 'reverse':\n scrollLeft = el.scrollWidth - scrollLeft;\n break;\n case 'negative':\n scrollLeft = -(el.scrollWidth - scrollLeft);\n break;\n }\n }\n el.scrollLeft = scrollLeft;\n}\n// Horizontal Scroll System Detection\n// ----------------------------------------------------------------------------------------------\nvar _rtlScrollSystem;\nfunction getRtlScrollSystem() {\n return _rtlScrollSystem || (_rtlScrollSystem = detectRtlScrollSystem());\n}\nfunction detectRtlScrollSystem() {\n var el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.top = '-1000px';\n el.style.width = '1px';\n el.style.height = '1px';\n el.style.overflow = 'scroll';\n el.style.direction = 'rtl';\n el.style.fontSize = '100px';\n el.innerHTML = 'A';\n document.body.appendChild(el);\n var system;\n if (el.scrollLeft > 0) {\n system = 'positive'; // scroll is a positive number from the left edge\n }\n else {\n el.scrollLeft = 1;\n if (el.scrollLeft > 0) {\n system = 'reverse'; // scroll is a positive number from the right edge\n }\n else {\n system = 'negative'; // scroll is a negative number from the right edge\n }\n }\n removeElement(el);\n return system;\n}\n\nvar IS_MS_EDGE = typeof navigator !== 'undefined' && /Edge/.test(navigator.userAgent); // TODO: what about Chromeum-based Edge?\nvar STICKY_SELECTOR = '.fc-sticky';\n/*\nuseful beyond the native position:sticky for these reasons:\n- support in IE11\n- nice centering support\n\nREQUIREMENT: fc-sticky elements, if the fc-sticky className is taken away, should NOT have relative or absolute positioning.\nThis is because we attach the coords with JS, and the VDOM might take away the fc-sticky class but doesn't know kill the positioning.\n\nTODO: don't query text-align:center. isn't compatible with flexbox centering. instead, check natural X coord within parent container\n*/\nvar StickyScrolling = /** @class */ (function () {\n function StickyScrolling(scrollEl, isRtl) {\n var _this = this;\n this.scrollEl = scrollEl;\n this.isRtl = isRtl;\n this.usingRelative = null;\n this.updateSize = function () {\n var scrollEl = _this.scrollEl;\n var els = findElements(scrollEl, STICKY_SELECTOR);\n var elGeoms = _this.queryElGeoms(els);\n var viewportWidth = scrollEl.clientWidth;\n var viewportHeight = scrollEl.clientHeight;\n if (_this.usingRelative) {\n var elDestinations = _this.computeElDestinations(elGeoms, viewportWidth); // read before prepPositioning\n assignRelativePositions(els, elGeoms, elDestinations, viewportWidth, viewportHeight);\n }\n else {\n assignStickyPositions(els, elGeoms, viewportWidth);\n }\n };\n this.usingRelative =\n !getStickySupported() || // IE11\n // https://stackoverflow.com/questions/56835658/in-microsoft-edge-sticky-positioning-doesnt-work-when-combined-with-dir-rtl\n (IS_MS_EDGE && isRtl);\n if (this.usingRelative) {\n this.listener = new ScrollListener(scrollEl);\n this.listener.emitter.on('scrollEnd', this.updateSize);\n }\n }\n StickyScrolling.prototype.destroy = function () {\n if (this.listener) {\n this.listener.destroy();\n }\n };\n StickyScrolling.prototype.queryElGeoms = function (els) {\n var _a = this, scrollEl = _a.scrollEl, isRtl = _a.isRtl;\n var canvasOrigin = getScrollCanvasOrigin(scrollEl);\n var elGeoms = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n var parentBound = translateRect(computeInnerRect(el.parentNode, true, true), // weird way to call this!!!\n -canvasOrigin.left, -canvasOrigin.top);\n var elRect = el.getBoundingClientRect();\n var computedStyles = window.getComputedStyle(el);\n var textAlign = window.getComputedStyle(el.parentNode).textAlign; // ask the parent\n var naturalBound = null;\n if (textAlign === 'start') {\n textAlign = isRtl ? 'right' : 'left';\n }\n else if (textAlign === 'end') {\n textAlign = isRtl ? 'left' : 'right';\n }\n if (computedStyles.position !== 'sticky') {\n naturalBound = translateRect(elRect, -canvasOrigin.left - (parseFloat(computedStyles.left) || 0), // could be 'auto'\n -canvasOrigin.top - (parseFloat(computedStyles.top) || 0));\n }\n elGeoms.push({\n parentBound: parentBound,\n naturalBound: naturalBound,\n elWidth: elRect.width,\n elHeight: elRect.height,\n textAlign: textAlign,\n });\n }\n return elGeoms;\n };\n // only for IE\n StickyScrolling.prototype.computeElDestinations = function (elGeoms, viewportWidth) {\n var scrollEl = this.scrollEl;\n var viewportTop = scrollEl.scrollTop;\n var viewportLeft = getScrollFromLeftEdge(scrollEl);\n var viewportRight = viewportLeft + viewportWidth;\n return elGeoms.map(function (elGeom) {\n var elWidth = elGeom.elWidth, elHeight = elGeom.elHeight, parentBound = elGeom.parentBound, naturalBound = elGeom.naturalBound;\n var destLeft; // relative to canvas topleft\n var destTop; // \"\n switch (elGeom.textAlign) {\n case 'left':\n destLeft = viewportLeft;\n break;\n case 'right':\n destLeft = viewportRight - elWidth;\n break;\n case 'center':\n destLeft = (viewportLeft + viewportRight) / 2 - elWidth / 2; /// noooo, use half-width insteadddddddd\n break;\n }\n destLeft = Math.min(destLeft, parentBound.right - elWidth);\n destLeft = Math.max(destLeft, parentBound.left);\n destTop = viewportTop;\n destTop = Math.min(destTop, parentBound.bottom - elHeight);\n destTop = Math.max(destTop, naturalBound.top); // better to use natural top for upper bound\n return { left: destLeft, top: destTop };\n });\n };\n return StickyScrolling;\n}());\nfunction assignRelativePositions(els, elGeoms, elDestinations, viewportWidth, viewportHeight) {\n els.forEach(function (el, i) {\n var _a = elGeoms[i], naturalBound = _a.naturalBound, parentBound = _a.parentBound;\n var parentWidth = parentBound.right - parentBound.left;\n var parentHeight = parentBound.bottom - parentBound.bottom;\n var left;\n var top;\n if (parentWidth > viewportWidth ||\n parentHeight > viewportHeight) {\n left = elDestinations[i].left - naturalBound.left;\n top = elDestinations[i].top - naturalBound.top;\n }\n else { // if parent container can be completely in view, we don't need stickiness\n left = '';\n top = '';\n }\n applyStyle(el, {\n position: 'relative',\n left: left,\n right: -left,\n top: top,\n });\n });\n}\nfunction assignStickyPositions(els, elGeoms, viewportWidth) {\n els.forEach(function (el, i) {\n var _a = elGeoms[i], textAlign = _a.textAlign, elWidth = _a.elWidth, parentBound = _a.parentBound;\n var parentWidth = parentBound.right - parentBound.left;\n var left;\n if (textAlign === 'center' &&\n parentWidth > viewportWidth) {\n left = (viewportWidth - elWidth) / 2;\n }\n else { // if parent container can be completely in view, we don't need stickiness\n left = '';\n }\n applyStyle(el, {\n left: left,\n right: left,\n top: 0,\n });\n });\n}\nvar _isStickySupported;\nfunction getStickySupported() {\n if (_isStickySupported == null) {\n _isStickySupported = computeStickySupported();\n }\n return _isStickySupported;\n}\nfunction computeStickySupported() {\n var el = document.createElement('div');\n el.style.position = 'sticky';\n document.body.appendChild(el);\n var val = window.getComputedStyle(el).position;\n removeElement(el);\n return val === 'sticky';\n}\n\nvar ClippedScroller = /** @class */ (function (_super) {\n __extends(ClippedScroller, _super);\n function ClippedScroller() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.elRef = createRef();\n _this.state = {\n xScrollbarWidth: 0,\n yScrollbarWidth: 0,\n };\n _this.handleScroller = function (scroller) {\n _this.scroller = scroller;\n setRef(_this.props.scrollerRef, scroller);\n };\n _this.handleSizing = function () {\n var props = _this.props;\n if (props.overflowY === 'scroll-hidden') {\n _this.setState({ yScrollbarWidth: _this.scroller.getYScrollbarWidth() });\n }\n if (props.overflowX === 'scroll-hidden') {\n _this.setState({ xScrollbarWidth: _this.scroller.getXScrollbarWidth() });\n }\n };\n return _this;\n }\n ClippedScroller.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var isScrollbarOnLeft = context.isRtl && getIsRtlScrollbarOnLeft();\n var overcomeLeft = 0;\n var overcomeRight = 0;\n var overcomeBottom = 0;\n if (props.overflowX === 'scroll-hidden') {\n overcomeBottom = state.xScrollbarWidth;\n }\n if (props.overflowY === 'scroll-hidden') {\n if (state.yScrollbarWidth != null) {\n if (isScrollbarOnLeft) {\n overcomeLeft = state.yScrollbarWidth;\n }\n else {\n overcomeRight = state.yScrollbarWidth;\n }\n }\n }\n return (createElement(\"div\", { ref: this.elRef, className: 'fc-scroller-harness' + (props.liquid ? ' fc-scroller-harness-liquid' : '') },\n createElement(Scroller, { ref: this.handleScroller, elRef: this.props.scrollerElRef, overflowX: props.overflowX === 'scroll-hidden' ? 'scroll' : props.overflowX, overflowY: props.overflowY === 'scroll-hidden' ? 'scroll' : props.overflowY, overcomeLeft: overcomeLeft, overcomeRight: overcomeRight, overcomeBottom: overcomeBottom, maxHeight: typeof props.maxHeight === 'number'\n ? (props.maxHeight + (props.overflowX === 'scroll-hidden' ? state.xScrollbarWidth : 0))\n : '', liquid: props.liquid, liquidIsAbsolute: true }, props.children)));\n };\n ClippedScroller.prototype.componentDidMount = function () {\n this.handleSizing();\n this.context.addResizeHandler(this.handleSizing);\n };\n ClippedScroller.prototype.componentDidUpdate = function (prevProps) {\n if (!isPropsEqual(prevProps, this.props)) { // an external change?\n this.handleSizing();\n }\n };\n ClippedScroller.prototype.componentWillUnmount = function () {\n this.context.removeResizeHandler(this.handleSizing);\n };\n ClippedScroller.prototype.needsXScrolling = function () {\n return this.scroller.needsXScrolling();\n };\n ClippedScroller.prototype.needsYScrolling = function () {\n return this.scroller.needsYScrolling();\n };\n return ClippedScroller;\n}(BaseComponent));\n\nvar ScrollSyncer = /** @class */ (function () {\n function ScrollSyncer(isVertical, scrollEls) {\n var _this = this;\n this.isVertical = isVertical;\n this.scrollEls = scrollEls;\n this.isPaused = false;\n this.scrollListeners = scrollEls.map(function (el) { return _this.bindScroller(el); });\n }\n ScrollSyncer.prototype.destroy = function () {\n for (var _i = 0, _a = this.scrollListeners; _i < _a.length; _i++) {\n var scrollListener = _a[_i];\n scrollListener.destroy();\n }\n };\n ScrollSyncer.prototype.bindScroller = function (el) {\n var _this = this;\n var _a = this, scrollEls = _a.scrollEls, isVertical = _a.isVertical;\n var scrollListener = new ScrollListener(el);\n var onScroll = function (isWheel, isTouch) {\n if (!_this.isPaused) {\n if (!_this.masterEl || (_this.masterEl !== el && (isWheel || isTouch))) {\n _this.assignMaster(el);\n }\n if (_this.masterEl === el) { // dealing with current\n for (var _i = 0, scrollEls_1 = scrollEls; _i < scrollEls_1.length; _i++) {\n var otherEl = scrollEls_1[_i];\n if (otherEl !== el) {\n if (isVertical) {\n otherEl.scrollTop = el.scrollTop;\n }\n else {\n otherEl.scrollLeft = el.scrollLeft;\n }\n }\n }\n }\n }\n };\n var onScrollEnd = function () {\n if (_this.masterEl === el) {\n _this.masterEl = null;\n }\n };\n scrollListener.emitter.on('scroll', onScroll);\n scrollListener.emitter.on('scrollEnd', onScrollEnd);\n return scrollListener;\n };\n ScrollSyncer.prototype.assignMaster = function (el) {\n this.masterEl = el;\n for (var _i = 0, _a = this.scrollListeners; _i < _a.length; _i++) {\n var scrollListener = _a[_i];\n if (scrollListener.el !== el) {\n scrollListener.endScroll(); // to prevent residual scrolls from reclaiming master\n }\n }\n };\n /*\n will normalize the scrollLeft value\n */\n ScrollSyncer.prototype.forceScrollLeft = function (scrollLeft) {\n this.isPaused = true;\n for (var _i = 0, _a = this.scrollListeners; _i < _a.length; _i++) {\n var listener = _a[_i];\n setScrollFromLeftEdge(listener.el, scrollLeft);\n }\n this.isPaused = false;\n };\n ScrollSyncer.prototype.forceScrollTop = function (top) {\n this.isPaused = true;\n for (var _i = 0, _a = this.scrollListeners; _i < _a.length; _i++) {\n var listener = _a[_i];\n listener.el.scrollTop = top;\n }\n this.isPaused = false;\n };\n return ScrollSyncer;\n}());\n\n/*\nTODO: make subcomponent\nNOTE: doesn't support collapsibleWidth (which is sortof a hack anyway)\n*/\nvar ScrollGrid = /** @class */ (function (_super) {\n __extends(ScrollGrid, _super);\n function ScrollGrid() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.compileColGroupStats = memoizeArraylike(compileColGroupStat, isColGroupStatsEqual);\n _this.renderMicroColGroups = memoizeArraylike(renderMicroColGroup); // yucky to memoize VNodes, but much more efficient for consumers\n _this.clippedScrollerRefs = new RefMap();\n // doesn't hold non-scrolling els used just for padding\n _this.scrollerElRefs = new RefMap(_this._handleScrollerEl.bind(_this));\n _this.chunkElRefs = new RefMap(_this._handleChunkEl.bind(_this));\n _this.stickyScrollings = [];\n _this.scrollSyncersBySection = {};\n _this.scrollSyncersByColumn = {};\n // for row-height-syncing\n _this.rowUnstableMap = new Map(); // no need to groom. always self-cancels\n _this.rowInnerMaxHeightMap = new Map();\n _this.anyRowHeightsChanged = false;\n _this.recentSizingCnt = 0;\n _this.state = {\n shrinkWidths: [],\n forceYScrollbars: false,\n forceXScrollbars: false,\n scrollerClientWidths: {},\n scrollerClientHeights: {},\n sectionRowMaxHeights: [],\n };\n _this.handleSizing = function (isForcedResize, sectionRowMaxHeightsChanged) {\n if (!_this.allowSizing()) {\n return;\n }\n if (!sectionRowMaxHeightsChanged) { // something else changed, probably external\n _this.anyRowHeightsChanged = true;\n }\n var otherState = {};\n // if reacting to self-change of sectionRowMaxHeightsChanged, or not stable, don't do anything\n if (isForcedResize || (!sectionRowMaxHeightsChanged && !_this.rowUnstableMap.size)) {\n otherState.sectionRowMaxHeights = _this.computeSectionRowMaxHeights();\n }\n _this.setState(__assign(__assign({ shrinkWidths: _this.computeShrinkWidths() }, _this.computeScrollerDims()), otherState), function () {\n if (!_this.rowUnstableMap.size) {\n _this.updateStickyScrolling(); // needs to happen AFTER final positioning committed to DOM\n }\n });\n };\n _this.handleRowHeightChange = function (rowEl, isStable) {\n var _a = _this, rowUnstableMap = _a.rowUnstableMap, rowInnerMaxHeightMap = _a.rowInnerMaxHeightMap;\n if (!isStable) {\n rowUnstableMap.set(rowEl, true);\n }\n else {\n rowUnstableMap.delete(rowEl);\n var innerMaxHeight = getRowInnerMaxHeight(rowEl);\n if (!rowInnerMaxHeightMap.has(rowEl) || rowInnerMaxHeightMap.get(rowEl) !== innerMaxHeight) {\n rowInnerMaxHeightMap.set(rowEl, innerMaxHeight);\n _this.anyRowHeightsChanged = true;\n }\n if (!rowUnstableMap.size && _this.anyRowHeightsChanged) {\n _this.anyRowHeightsChanged = false;\n _this.setState({\n sectionRowMaxHeights: _this.computeSectionRowMaxHeights(),\n });\n }\n }\n };\n return _this;\n }\n ScrollGrid.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var shrinkWidths = state.shrinkWidths;\n var colGroupStats = this.compileColGroupStats(props.colGroups.map(function (colGroup) { return [colGroup]; }));\n var microColGroupNodes = this.renderMicroColGroups(colGroupStats.map(function (stat, i) { return [stat.cols, shrinkWidths[i]]; }));\n var classNames = getScrollGridClassNames(props.liquid, context);\n var _b = this.getDims(); _b[0]; _b[1];\n // TODO: make DRY\n var sectionConfigs = props.sections;\n var configCnt = sectionConfigs.length;\n var configI = 0;\n var currentConfig;\n var headSectionNodes = [];\n var bodySectionNodes = [];\n var footSectionNodes = [];\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'header') {\n headSectionNodes.push(this.renderSection(currentConfig, configI, colGroupStats, microColGroupNodes, state.sectionRowMaxHeights, true));\n configI += 1;\n }\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'body') {\n bodySectionNodes.push(this.renderSection(currentConfig, configI, colGroupStats, microColGroupNodes, state.sectionRowMaxHeights, false));\n configI += 1;\n }\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'footer') {\n footSectionNodes.push(this.renderSection(currentConfig, configI, colGroupStats, microColGroupNodes, state.sectionRowMaxHeights, true));\n configI += 1;\n }\n var isBuggy = !getCanVGrowWithinCell(); // see NOTE in SimpleScrollGrid\n var roleAttrs = { role: 'rowgroup' };\n return createElement('table', {\n ref: props.elRef,\n role: 'grid',\n className: classNames.join(' '),\n }, renderMacroColGroup(colGroupStats, shrinkWidths), Boolean(!isBuggy && headSectionNodes.length) && createElement.apply(void 0, __spreadArray(['thead', roleAttrs], headSectionNodes)), Boolean(!isBuggy && bodySectionNodes.length) && createElement.apply(void 0, __spreadArray(['tbody', roleAttrs], bodySectionNodes)), Boolean(!isBuggy && footSectionNodes.length) && createElement.apply(void 0, __spreadArray(['tfoot', roleAttrs], footSectionNodes)), isBuggy && createElement.apply(void 0, __spreadArray(__spreadArray(__spreadArray(['tbody', roleAttrs], headSectionNodes), bodySectionNodes), footSectionNodes)));\n };\n ScrollGrid.prototype.renderSection = function (sectionConfig, sectionIndex, colGroupStats, microColGroupNodes, sectionRowMaxHeights, isHeader) {\n var _this = this;\n if ('outerContent' in sectionConfig) {\n return (createElement(Fragment, { key: sectionConfig.key }, sectionConfig.outerContent));\n }\n return (createElement(\"tr\", { key: sectionConfig.key, role: \"presentation\", className: getSectionClassNames(sectionConfig, this.props.liquid).join(' ') }, sectionConfig.chunks.map(function (chunkConfig, i) { return _this.renderChunk(sectionConfig, sectionIndex, colGroupStats[i], microColGroupNodes[i], chunkConfig, i, (sectionRowMaxHeights[sectionIndex] || [])[i] || [], isHeader); })));\n };\n ScrollGrid.prototype.renderChunk = function (sectionConfig, sectionIndex, colGroupStat, microColGroupNode, chunkConfig, chunkIndex, rowHeights, isHeader) {\n if ('outerContent' in chunkConfig) {\n return (createElement(Fragment, { key: chunkConfig.key }, chunkConfig.outerContent));\n }\n var state = this.state;\n var scrollerClientWidths = state.scrollerClientWidths, scrollerClientHeights = state.scrollerClientHeights;\n var _a = this.getDims(), sectionCnt = _a[0], chunksPerSection = _a[1];\n var index = sectionIndex * chunksPerSection + chunkIndex;\n var sideScrollIndex = (!this.context.isRtl || getIsRtlScrollbarOnLeft()) ? chunksPerSection - 1 : 0;\n var isVScrollSide = chunkIndex === sideScrollIndex;\n var isLastSection = sectionIndex === sectionCnt - 1;\n var forceXScrollbars = isLastSection && state.forceXScrollbars; // NOOOO can result in `null`\n var forceYScrollbars = isVScrollSide && state.forceYScrollbars; // NOOOO can result in `null`\n var allowXScrolling = colGroupStat && colGroupStat.allowXScrolling; // rename?\n var allowYScrolling = getAllowYScrolling(this.props, sectionConfig); // rename? do in section func?\n var chunkVGrow = getSectionHasLiquidHeight(this.props, sectionConfig); // do in section func?\n var expandRows = sectionConfig.expandRows && chunkVGrow;\n var tableMinWidth = (colGroupStat && colGroupStat.totalColMinWidth) || '';\n var content = renderChunkContent(sectionConfig, chunkConfig, {\n tableColGroupNode: microColGroupNode,\n tableMinWidth: tableMinWidth,\n clientWidth: scrollerClientWidths[index] !== undefined ? scrollerClientWidths[index] : null,\n clientHeight: scrollerClientHeights[index] !== undefined ? scrollerClientHeights[index] : null,\n expandRows: expandRows,\n syncRowHeights: Boolean(sectionConfig.syncRowHeights),\n rowSyncHeights: rowHeights,\n reportRowHeightChange: this.handleRowHeightChange,\n }, isHeader);\n var overflowX = forceXScrollbars ? (isLastSection ? 'scroll' : 'scroll-hidden') :\n !allowXScrolling ? 'hidden' :\n (isLastSection ? 'auto' : 'scroll-hidden');\n var overflowY = forceYScrollbars ? (isVScrollSide ? 'scroll' : 'scroll-hidden') :\n !allowYScrolling ? 'hidden' :\n (isVScrollSide ? 'auto' : 'scroll-hidden');\n // it *could* be possible to reduce DOM wrappers by only doing a ClippedScroller when allowXScrolling or allowYScrolling,\n // but if these values were to change, the inner components would be unmounted/remounted because of the parent change.\n content = (createElement(ClippedScroller, { ref: this.clippedScrollerRefs.createRef(index), scrollerElRef: this.scrollerElRefs.createRef(index), overflowX: overflowX, overflowY: overflowY, liquid: chunkVGrow, maxHeight: sectionConfig.maxHeight }, content));\n return createElement(isHeader ? 'th' : 'td', {\n key: chunkConfig.key,\n ref: this.chunkElRefs.createRef(index),\n role: 'presentation',\n }, content);\n };\n ScrollGrid.prototype.componentDidMount = function () {\n this.getStickyScrolling = memoizeArraylike(initStickyScrolling, null, destroyStickyScrolling);\n this.getScrollSyncersBySection = memoizeHashlike(initScrollSyncer.bind(this, true), null, destroyScrollSyncer);\n this.getScrollSyncersByColumn = memoizeHashlike(initScrollSyncer.bind(this, false), null, destroyScrollSyncer);\n this.updateScrollSyncers();\n this.handleSizing(false);\n this.context.addResizeHandler(this.handleSizing);\n };\n ScrollGrid.prototype.componentDidUpdate = function (prevProps, prevState) {\n this.updateScrollSyncers();\n // TODO: need better solution when state contains non-sizing things\n this.handleSizing(false, prevState.sectionRowMaxHeights !== this.state.sectionRowMaxHeights);\n };\n ScrollGrid.prototype.componentWillUnmount = function () {\n this.context.removeResizeHandler(this.handleSizing);\n this.destroyStickyScrolling();\n this.destroyScrollSyncers();\n };\n ScrollGrid.prototype.allowSizing = function () {\n var now = new Date();\n if (!this.lastSizingDate ||\n now.valueOf() > this.lastSizingDate.valueOf() + config.SCROLLGRID_RESIZE_INTERVAL) {\n this.lastSizingDate = now;\n this.recentSizingCnt = 0;\n return true;\n }\n return (this.recentSizingCnt += 1) <= 10;\n };\n ScrollGrid.prototype.computeShrinkWidths = function () {\n var _this = this;\n var colGroupStats = this.compileColGroupStats(this.props.colGroups.map(function (colGroup) { return [colGroup]; }));\n var _a = this.getDims(), sectionCnt = _a[0], chunksPerSection = _a[1];\n var cnt = sectionCnt * chunksPerSection;\n var shrinkWidths = [];\n colGroupStats.forEach(function (colGroupStat, i) {\n if (colGroupStat.hasShrinkCol) {\n var chunkEls = _this.chunkElRefs.collect(i, cnt, chunksPerSection); // in one col\n shrinkWidths[i] = computeShrinkWidth(chunkEls);\n }\n });\n return shrinkWidths;\n };\n // has the side effect of grooming rowInnerMaxHeightMap\n // TODO: somehow short-circuit if there are no new height changes\n ScrollGrid.prototype.computeSectionRowMaxHeights = function () {\n var newHeightMap = new Map();\n var _a = this.getDims(), sectionCnt = _a[0], chunksPerSection = _a[1];\n var sectionRowMaxHeights = [];\n for (var sectionI = 0; sectionI < sectionCnt; sectionI += 1) {\n var sectionConfig = this.props.sections[sectionI];\n var assignableHeights = []; // chunk, row\n if (sectionConfig && sectionConfig.syncRowHeights) {\n var rowHeightsByChunk = [];\n for (var chunkI = 0; chunkI < chunksPerSection; chunkI += 1) {\n var index = sectionI * chunksPerSection + chunkI;\n var rowHeights = [];\n var chunkEl = this.chunkElRefs.currentMap[index];\n if (chunkEl) {\n rowHeights = findElements(chunkEl, '.fc-scrollgrid-sync-table tr').map(function (rowEl) {\n var max = getRowInnerMaxHeight(rowEl);\n newHeightMap.set(rowEl, max);\n return max;\n });\n }\n else {\n rowHeights = [];\n }\n rowHeightsByChunk.push(rowHeights);\n }\n var rowCnt = rowHeightsByChunk[0].length;\n var isEqualRowCnt = true;\n for (var chunkI = 1; chunkI < chunksPerSection; chunkI += 1) {\n var isOuterContent = sectionConfig.chunks[chunkI] && sectionConfig.chunks[chunkI].outerContent !== undefined; // can be null\n if (!isOuterContent && rowHeightsByChunk[chunkI].length !== rowCnt) { // skip outer content\n isEqualRowCnt = false;\n break;\n }\n }\n if (!isEqualRowCnt) {\n var chunkHeightSums = [];\n for (var chunkI = 0; chunkI < chunksPerSection; chunkI += 1) {\n chunkHeightSums.push(sumNumbers(rowHeightsByChunk[chunkI]) + rowHeightsByChunk[chunkI].length);\n }\n var maxTotalSum = Math.max.apply(Math, chunkHeightSums);\n for (var chunkI = 0; chunkI < chunksPerSection; chunkI += 1) {\n var rowInChunkCnt = rowHeightsByChunk[chunkI].length;\n var rowInChunkTotalHeight = maxTotalSum - rowInChunkCnt; // subtract border\n // height of non-first row. we do this to avoid rounding, because it's unreliable within a table\n var rowInChunkHeightOthers = Math.floor(rowInChunkTotalHeight / rowInChunkCnt);\n // whatever is leftover goes to the first row\n var rowInChunkHeightFirst = rowInChunkTotalHeight - rowInChunkHeightOthers * (rowInChunkCnt - 1);\n var rowInChunkHeights = [];\n var row = 0;\n if (row < rowInChunkCnt) {\n rowInChunkHeights.push(rowInChunkHeightFirst);\n row += 1;\n }\n while (row < rowInChunkCnt) {\n rowInChunkHeights.push(rowInChunkHeightOthers);\n row += 1;\n }\n assignableHeights.push(rowInChunkHeights);\n }\n }\n else {\n for (var chunkI = 0; chunkI < chunksPerSection; chunkI += 1) {\n assignableHeights.push([]);\n }\n for (var row = 0; row < rowCnt; row += 1) {\n var rowHeightsAcrossChunks = [];\n for (var chunkI = 0; chunkI < chunksPerSection; chunkI += 1) {\n var h = rowHeightsByChunk[chunkI][row];\n if (h != null) { // protect against outerContent\n rowHeightsAcrossChunks.push(h);\n }\n }\n var maxHeight = Math.max.apply(Math, rowHeightsAcrossChunks);\n for (var chunkI = 0; chunkI < chunksPerSection; chunkI += 1) {\n assignableHeights[chunkI].push(maxHeight);\n }\n }\n }\n }\n sectionRowMaxHeights.push(assignableHeights);\n }\n this.rowInnerMaxHeightMap = newHeightMap;\n return sectionRowMaxHeights;\n };\n ScrollGrid.prototype.computeScrollerDims = function () {\n var scrollbarWidth = getScrollbarWidths();\n var _a = this.getDims(), sectionCnt = _a[0], chunksPerSection = _a[1];\n var sideScrollI = (!this.context.isRtl || getIsRtlScrollbarOnLeft()) ? chunksPerSection - 1 : 0;\n var lastSectionI = sectionCnt - 1;\n var currentScrollers = this.clippedScrollerRefs.currentMap;\n var scrollerEls = this.scrollerElRefs.currentMap;\n var forceYScrollbars = false;\n var forceXScrollbars = false;\n var scrollerClientWidths = {};\n var scrollerClientHeights = {};\n for (var sectionI = 0; sectionI < sectionCnt; sectionI += 1) { // along edge\n var index = sectionI * chunksPerSection + sideScrollI;\n var scroller = currentScrollers[index];\n if (scroller && scroller.needsYScrolling()) {\n forceYScrollbars = true;\n break;\n }\n }\n for (var chunkI = 0; chunkI < chunksPerSection; chunkI += 1) { // along last row\n var index = lastSectionI * chunksPerSection + chunkI;\n var scroller = currentScrollers[index];\n if (scroller && scroller.needsXScrolling()) {\n forceXScrollbars = true;\n break;\n }\n }\n for (var sectionI = 0; sectionI < sectionCnt; sectionI += 1) {\n for (var chunkI = 0; chunkI < chunksPerSection; chunkI += 1) {\n var index = sectionI * chunksPerSection + chunkI;\n var scrollerEl = scrollerEls[index];\n if (scrollerEl) {\n // TODO: weird way to get this. need harness b/c doesn't include table borders\n var harnessEl = scrollerEl.parentNode;\n scrollerClientWidths[index] = Math.floor(harnessEl.getBoundingClientRect().width - ((chunkI === sideScrollI && forceYScrollbars)\n ? scrollbarWidth.y // use global because scroller might not have scrollbars yet but will need them in future\n : 0));\n scrollerClientHeights[index] = Math.floor(harnessEl.getBoundingClientRect().height - ((sectionI === lastSectionI && forceXScrollbars)\n ? scrollbarWidth.x // use global because scroller might not have scrollbars yet but will need them in future\n : 0));\n }\n }\n }\n return { forceYScrollbars: forceYScrollbars, forceXScrollbars: forceXScrollbars, scrollerClientWidths: scrollerClientWidths, scrollerClientHeights: scrollerClientHeights };\n };\n ScrollGrid.prototype.updateStickyScrolling = function () {\n var isRtl = this.context.isRtl;\n var argsByKey = this.scrollerElRefs.getAll().map(function (scrollEl) { return [scrollEl, isRtl]; });\n var stickyScrollings = this.getStickyScrolling(argsByKey);\n stickyScrollings.forEach(function (stickyScrolling) { return stickyScrolling.updateSize(); });\n this.stickyScrollings = stickyScrollings;\n };\n ScrollGrid.prototype.destroyStickyScrolling = function () {\n this.stickyScrollings.forEach(destroyStickyScrolling);\n };\n ScrollGrid.prototype.updateScrollSyncers = function () {\n var _a = this.getDims(), sectionCnt = _a[0], chunksPerSection = _a[1];\n var cnt = sectionCnt * chunksPerSection;\n var scrollElsBySection = {};\n var scrollElsByColumn = {};\n var scrollElMap = this.scrollerElRefs.currentMap;\n for (var sectionI = 0; sectionI < sectionCnt; sectionI += 1) {\n var startIndex = sectionI * chunksPerSection;\n var endIndex = startIndex + chunksPerSection;\n scrollElsBySection[sectionI] = collectFromHash(scrollElMap, startIndex, endIndex, 1); // use the filtered\n }\n for (var col = 0; col < chunksPerSection; col += 1) {\n scrollElsByColumn[col] = this.scrollerElRefs.collect(col, cnt, chunksPerSection); // DON'T use the filtered\n }\n this.scrollSyncersBySection = this.getScrollSyncersBySection(scrollElsBySection);\n this.scrollSyncersByColumn = this.getScrollSyncersByColumn(scrollElsByColumn);\n };\n ScrollGrid.prototype.destroyScrollSyncers = function () {\n mapHash(this.scrollSyncersBySection, destroyScrollSyncer);\n mapHash(this.scrollSyncersByColumn, destroyScrollSyncer);\n };\n ScrollGrid.prototype.getChunkConfigByIndex = function (index) {\n var chunksPerSection = this.getDims()[1];\n var sectionI = Math.floor(index / chunksPerSection);\n var chunkI = index % chunksPerSection;\n var sectionConfig = this.props.sections[sectionI];\n return sectionConfig && sectionConfig.chunks[chunkI];\n };\n ScrollGrid.prototype.forceScrollLeft = function (col, scrollLeft) {\n var scrollSyncer = this.scrollSyncersByColumn[col];\n if (scrollSyncer) {\n scrollSyncer.forceScrollLeft(scrollLeft);\n }\n };\n ScrollGrid.prototype.forceScrollTop = function (sectionI, scrollTop) {\n var scrollSyncer = this.scrollSyncersBySection[sectionI];\n if (scrollSyncer) {\n scrollSyncer.forceScrollTop(scrollTop);\n }\n };\n ScrollGrid.prototype._handleChunkEl = function (chunkEl, key) {\n var chunkConfig = this.getChunkConfigByIndex(parseInt(key, 10));\n if (chunkConfig) { // null if section disappeared. bad, b/c won't null-set the elRef\n setRef(chunkConfig.elRef, chunkEl);\n }\n };\n ScrollGrid.prototype._handleScrollerEl = function (scrollerEl, key) {\n var chunkConfig = this.getChunkConfigByIndex(parseInt(key, 10));\n if (chunkConfig) { // null if section disappeared. bad, b/c won't null-set the elRef\n setRef(chunkConfig.scrollerElRef, scrollerEl);\n }\n };\n ScrollGrid.prototype.getDims = function () {\n var sectionCnt = this.props.sections.length;\n var chunksPerSection = sectionCnt ? this.props.sections[0].chunks.length : 0;\n return [sectionCnt, chunksPerSection];\n };\n return ScrollGrid;\n}(BaseComponent));\nScrollGrid.addStateEquality({\n shrinkWidths: isArraysEqual,\n scrollerClientWidths: isPropsEqual,\n scrollerClientHeights: isPropsEqual,\n});\nfunction sumNumbers(numbers) {\n var sum = 0;\n for (var _i = 0, numbers_1 = numbers; _i < numbers_1.length; _i++) {\n var n = numbers_1[_i];\n sum += n;\n }\n return sum;\n}\nfunction getRowInnerMaxHeight(rowEl) {\n var innerHeights = findElements(rowEl, '.fc-scrollgrid-sync-inner').map(getElHeight);\n if (innerHeights.length) {\n return Math.max.apply(Math, innerHeights);\n }\n return 0;\n}\nfunction getElHeight(el) {\n return el.offsetHeight; // better to deal with integers, for rounding, for PureComponent\n}\nfunction renderMacroColGroup(colGroupStats, shrinkWidths) {\n var children = colGroupStats.map(function (colGroupStat, i) {\n var width = colGroupStat.width;\n if (width === 'shrink') {\n width = colGroupStat.totalColWidth + sanitizeShrinkWidth(shrinkWidths[i]) + 1; // +1 for border :(\n }\n return ( // eslint-disable-next-line react/jsx-key\n createElement(\"col\", { style: { width: width } }));\n });\n return createElement.apply(void 0, __spreadArray(['colgroup', {}], children));\n}\nfunction compileColGroupStat(colGroupConfig) {\n var totalColWidth = sumColProp(colGroupConfig.cols, 'width'); // excludes \"shrink\"\n var totalColMinWidth = sumColProp(colGroupConfig.cols, 'minWidth');\n var hasShrinkCol = hasShrinkWidth(colGroupConfig.cols);\n var allowXScrolling = colGroupConfig.width !== 'shrink' && Boolean(totalColWidth || totalColMinWidth || hasShrinkCol);\n return {\n hasShrinkCol: hasShrinkCol,\n totalColWidth: totalColWidth,\n totalColMinWidth: totalColMinWidth,\n allowXScrolling: allowXScrolling,\n cols: colGroupConfig.cols,\n width: colGroupConfig.width,\n };\n}\nfunction sumColProp(cols, propName) {\n var total = 0;\n for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) {\n var col = cols_1[_i];\n var val = col[propName];\n if (typeof val === 'number') {\n total += val * (col.span || 1);\n }\n }\n return total;\n}\nvar COL_GROUP_STAT_EQUALITY = {\n cols: isColPropsEqual,\n};\nfunction isColGroupStatsEqual(stat0, stat1) {\n return compareObjs(stat0, stat1, COL_GROUP_STAT_EQUALITY);\n}\n// for memoizers...\nfunction initScrollSyncer(isVertical) {\n var scrollEls = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n scrollEls[_i - 1] = arguments[_i];\n }\n return new ScrollSyncer(isVertical, scrollEls);\n}\nfunction destroyScrollSyncer(scrollSyncer) {\n scrollSyncer.destroy();\n}\nfunction initStickyScrolling(scrollEl, isRtl) {\n return new StickyScrolling(scrollEl, isRtl);\n}\nfunction destroyStickyScrolling(stickyScrolling) {\n stickyScrolling.destroy();\n}\n\nvar main = createPlugin({\n deps: [\n premiumCommonPlugin,\n ],\n scrollGridImpl: ScrollGrid,\n});\nconfig.SCROLLGRID_RESIZE_INTERVAL = 500;\n\nexport default main;\nexport { ScrollGrid, setScrollFromLeftEdge };\n//# sourceMappingURL=main.js.map\n","/*!\nFullCalendar Scheduler v5.11.3\nDocs & License: https://fullcalendar.io/scheduler\n(c) 2022 Adam Shaw\n*/\nimport './main.css';\n\nimport { config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, padStart, createElement, ContentHook, BaseComponent, memoizeObjArg, buildClassNameNormalizer, memoize, getDateMeta, getSlotClassNames, getDayClassNames, MountHook, buildNavLinkAttrs, Fragment, rangeContainsMarker, PositionCache, findDirectChildren, createRef, NowTimer, NowIndicatorRoot, findElements, RenderHook, RefMap, multiplyDuration, SegHierarchy, groupIntersectingEntries, buildIsoString, computeEarliestSegStart, buildEventRangeKey, BgEvent, getSegMeta, renderFill, intersectRanges, addMs, Slicer, StandardEvent, MoreLinkRoot, setRef, sortEventSegs, mapHash, isPropsEqual, DateComponent, getStickyHeaderDates, getStickyFooterScrollbar, ViewRoot, renderScrollShim, createPlugin } from '@fullcalendar/common';\nimport premiumCommonPlugin from '@fullcalendar/premium-common';\nimport { __extends, __assign } from 'tslib';\nimport { ScrollGrid } from '@fullcalendar/scrollgrid';\n\nvar MIN_AUTO_LABELS = 18; // more than `12` months but less that `24` hours\nvar MAX_AUTO_SLOTS_PER_LABEL = 6; // allows 6 10-min slots in an hour\nvar MAX_AUTO_CELLS = 200; // allows 4-days to have a :30 slot duration\nconfig.MAX_TIMELINE_SLOTS = 1000;\n// potential nice values for slot-duration and interval-duration\nvar STOCK_SUB_DURATIONS = [\n { years: 1 },\n { months: 1 },\n { days: 1 },\n { hours: 1 },\n { minutes: 30 },\n { minutes: 15 },\n { minutes: 10 },\n { minutes: 5 },\n { minutes: 1 },\n { seconds: 30 },\n { seconds: 15 },\n { seconds: 10 },\n { seconds: 5 },\n { seconds: 1 },\n { milliseconds: 500 },\n { milliseconds: 100 },\n { milliseconds: 10 },\n { milliseconds: 1 },\n];\nfunction buildTimelineDateProfile(dateProfile, dateEnv, allOptions, dateProfileGenerator) {\n var tDateProfile = {\n labelInterval: allOptions.slotLabelInterval,\n slotDuration: allOptions.slotDuration,\n };\n validateLabelAndSlot(tDateProfile, dateProfile, dateEnv); // validate after computed grid duration\n ensureLabelInterval(tDateProfile, dateProfile, dateEnv);\n ensureSlotDuration(tDateProfile, dateProfile, dateEnv);\n var input = allOptions.slotLabelFormat;\n var rawFormats = Array.isArray(input) ? input :\n (input != null) ? [input] :\n computeHeaderFormats(tDateProfile, dateProfile, dateEnv, allOptions);\n tDateProfile.headerFormats = rawFormats.map(function (rawFormat) { return createFormatter(rawFormat); });\n tDateProfile.isTimeScale = Boolean(tDateProfile.slotDuration.milliseconds);\n var largeUnit = null;\n if (!tDateProfile.isTimeScale) {\n var slotUnit = greatestDurationDenominator(tDateProfile.slotDuration).unit;\n if (/year|month|week/.test(slotUnit)) {\n largeUnit = slotUnit;\n }\n }\n tDateProfile.largeUnit = largeUnit;\n tDateProfile.emphasizeWeeks =\n asCleanDays(tDateProfile.slotDuration) === 1 &&\n currentRangeAs('weeks', dateProfile, dateEnv) >= 2 &&\n !allOptions.businessHours;\n /*\n console.log('label interval =', timelineView.labelInterval.humanize())\n console.log('slot duration =', timelineView.slotDuration.humanize())\n console.log('header formats =', timelineView.headerFormats)\n console.log('isTimeScale', timelineView.isTimeScale)\n console.log('largeUnit', timelineView.largeUnit)\n */\n var rawSnapDuration = allOptions.snapDuration;\n var snapDuration;\n var snapsPerSlot;\n if (rawSnapDuration) {\n snapDuration = createDuration(rawSnapDuration);\n snapsPerSlot = wholeDivideDurations(tDateProfile.slotDuration, snapDuration);\n // ^ TODO: warning if not whole?\n }\n if (snapsPerSlot == null) {\n snapDuration = tDateProfile.slotDuration;\n snapsPerSlot = 1;\n }\n tDateProfile.snapDuration = snapDuration;\n tDateProfile.snapsPerSlot = snapsPerSlot;\n // more...\n var timeWindowMs = asRoughMs(dateProfile.slotMaxTime) - asRoughMs(dateProfile.slotMinTime);\n // TODO: why not use normalizeRange!?\n var normalizedStart = normalizeDate(dateProfile.renderRange.start, tDateProfile, dateEnv);\n var normalizedEnd = normalizeDate(dateProfile.renderRange.end, tDateProfile, dateEnv);\n // apply slotMinTime/slotMaxTime\n // TODO: View should be responsible.\n if (tDateProfile.isTimeScale) {\n normalizedStart = dateEnv.add(normalizedStart, dateProfile.slotMinTime);\n normalizedEnd = dateEnv.add(addDays(normalizedEnd, -1), dateProfile.slotMaxTime);\n }\n tDateProfile.timeWindowMs = timeWindowMs;\n tDateProfile.normalizedRange = { start: normalizedStart, end: normalizedEnd };\n var slotDates = [];\n var date = normalizedStart;\n while (date < normalizedEnd) {\n if (isValidDate(date, tDateProfile, dateProfile, dateProfileGenerator)) {\n slotDates.push(date);\n }\n date = dateEnv.add(date, tDateProfile.slotDuration);\n }\n tDateProfile.slotDates = slotDates;\n // more...\n var snapIndex = -1;\n var snapDiff = 0; // index of the diff :(\n var snapDiffToIndex = [];\n var snapIndexToDiff = [];\n date = normalizedStart;\n while (date < normalizedEnd) {\n if (isValidDate(date, tDateProfile, dateProfile, dateProfileGenerator)) {\n snapIndex += 1;\n snapDiffToIndex.push(snapIndex);\n snapIndexToDiff.push(snapDiff);\n }\n else {\n snapDiffToIndex.push(snapIndex + 0.5);\n }\n date = dateEnv.add(date, tDateProfile.snapDuration);\n snapDiff += 1;\n }\n tDateProfile.snapDiffToIndex = snapDiffToIndex;\n tDateProfile.snapIndexToDiff = snapIndexToDiff;\n tDateProfile.snapCnt = snapIndex + 1; // is always one behind\n tDateProfile.slotCnt = tDateProfile.snapCnt / tDateProfile.snapsPerSlot;\n // more...\n tDateProfile.isWeekStarts = buildIsWeekStarts(tDateProfile, dateEnv);\n tDateProfile.cellRows = buildCellRows(tDateProfile, dateEnv);\n tDateProfile.slotsPerLabel = wholeDivideDurations(tDateProfile.labelInterval, tDateProfile.slotDuration);\n return tDateProfile;\n}\n/*\nsnaps to appropriate unit\n*/\nfunction normalizeDate(date, tDateProfile, dateEnv) {\n var normalDate = date;\n if (!tDateProfile.isTimeScale) {\n normalDate = startOfDay(normalDate);\n if (tDateProfile.largeUnit) {\n normalDate = dateEnv.startOf(normalDate, tDateProfile.largeUnit);\n }\n }\n return normalDate;\n}\n/*\nsnaps to appropriate unit\n*/\nfunction normalizeRange(range, tDateProfile, dateEnv) {\n if (!tDateProfile.isTimeScale) {\n range = computeVisibleDayRange(range);\n if (tDateProfile.largeUnit) {\n var dayRange = range; // preserve original result\n range = {\n start: dateEnv.startOf(range.start, tDateProfile.largeUnit),\n end: dateEnv.startOf(range.end, tDateProfile.largeUnit),\n };\n // if date is partially through the interval, or is in the same interval as the start,\n // make the exclusive end be the *next* interval\n if (range.end.valueOf() !== dayRange.end.valueOf() || range.end <= range.start) {\n range = {\n start: range.start,\n end: dateEnv.add(range.end, tDateProfile.slotDuration),\n };\n }\n }\n }\n return range;\n}\nfunction isValidDate(date, tDateProfile, dateProfile, dateProfileGenerator) {\n if (dateProfileGenerator.isHiddenDay(date)) {\n return false;\n }\n if (tDateProfile.isTimeScale) {\n // determine if the time is within slotMinTime/slotMaxTime, which may have wacky values\n var day = startOfDay(date);\n var timeMs = date.valueOf() - day.valueOf();\n var ms = timeMs - asRoughMs(dateProfile.slotMinTime); // milliseconds since slotMinTime\n ms = ((ms % 86400000) + 86400000) % 86400000; // make negative values wrap to 24hr clock\n return ms < tDateProfile.timeWindowMs; // before the slotMaxTime?\n }\n return true;\n}\nfunction validateLabelAndSlot(tDateProfile, dateProfile, dateEnv) {\n var currentRange = dateProfile.currentRange;\n // make sure labelInterval doesn't exceed the max number of cells\n if (tDateProfile.labelInterval) {\n var labelCnt = dateEnv.countDurationsBetween(currentRange.start, currentRange.end, tDateProfile.labelInterval);\n if (labelCnt > config.MAX_TIMELINE_SLOTS) {\n console.warn('slotLabelInterval results in too many cells');\n tDateProfile.labelInterval = null;\n }\n }\n // make sure slotDuration doesn't exceed the maximum number of cells\n if (tDateProfile.slotDuration) {\n var slotCnt = dateEnv.countDurationsBetween(currentRange.start, currentRange.end, tDateProfile.slotDuration);\n if (slotCnt > config.MAX_TIMELINE_SLOTS) {\n console.warn('slotDuration results in too many cells');\n tDateProfile.slotDuration = null;\n }\n }\n // make sure labelInterval is a multiple of slotDuration\n if (tDateProfile.labelInterval && tDateProfile.slotDuration) {\n var slotsPerLabel = wholeDivideDurations(tDateProfile.labelInterval, tDateProfile.slotDuration);\n if (slotsPerLabel === null || slotsPerLabel < 1) {\n console.warn('slotLabelInterval must be a multiple of slotDuration');\n tDateProfile.slotDuration = null;\n }\n }\n}\nfunction ensureLabelInterval(tDateProfile, dateProfile, dateEnv) {\n var currentRange = dateProfile.currentRange;\n var labelInterval = tDateProfile.labelInterval;\n if (!labelInterval) {\n // compute based off the slot duration\n // find the largest label interval with an acceptable slots-per-label\n var input = void 0;\n if (tDateProfile.slotDuration) {\n for (var _i = 0, STOCK_SUB_DURATIONS_1 = STOCK_SUB_DURATIONS; _i < STOCK_SUB_DURATIONS_1.length; _i++) {\n input = STOCK_SUB_DURATIONS_1[_i];\n var tryLabelInterval = createDuration(input);\n var slotsPerLabel = wholeDivideDurations(tryLabelInterval, tDateProfile.slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel <= MAX_AUTO_SLOTS_PER_LABEL) {\n labelInterval = tryLabelInterval;\n break;\n }\n }\n // use the slot duration as a last resort\n if (!labelInterval) {\n labelInterval = tDateProfile.slotDuration;\n }\n // compute based off the view's duration\n // find the largest label interval that yields the minimum number of labels\n }\n else {\n for (var _a = 0, STOCK_SUB_DURATIONS_2 = STOCK_SUB_DURATIONS; _a < STOCK_SUB_DURATIONS_2.length; _a++) {\n input = STOCK_SUB_DURATIONS_2[_a];\n labelInterval = createDuration(input);\n var labelCnt = dateEnv.countDurationsBetween(currentRange.start, currentRange.end, labelInterval);\n if (labelCnt >= MIN_AUTO_LABELS) {\n break;\n }\n }\n }\n tDateProfile.labelInterval = labelInterval;\n }\n return labelInterval;\n}\nfunction ensureSlotDuration(tDateProfile, dateProfile, dateEnv) {\n var currentRange = dateProfile.currentRange;\n var slotDuration = tDateProfile.slotDuration;\n if (!slotDuration) {\n var labelInterval = ensureLabelInterval(tDateProfile, dateProfile, dateEnv); // will compute if necessary\n // compute based off the label interval\n // find the largest slot duration that is different from labelInterval, but still acceptable\n for (var _i = 0, STOCK_SUB_DURATIONS_3 = STOCK_SUB_DURATIONS; _i < STOCK_SUB_DURATIONS_3.length; _i++) {\n var input = STOCK_SUB_DURATIONS_3[_i];\n var trySlotDuration = createDuration(input);\n var slotsPerLabel = wholeDivideDurations(labelInterval, trySlotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1 && slotsPerLabel <= MAX_AUTO_SLOTS_PER_LABEL) {\n slotDuration = trySlotDuration;\n break;\n }\n }\n // only allow the value if it won't exceed the view's # of slots limit\n if (slotDuration) {\n var slotCnt = dateEnv.countDurationsBetween(currentRange.start, currentRange.end, slotDuration);\n if (slotCnt > MAX_AUTO_CELLS) {\n slotDuration = null;\n }\n }\n // use the label interval as a last resort\n if (!slotDuration) {\n slotDuration = labelInterval;\n }\n tDateProfile.slotDuration = slotDuration;\n }\n return slotDuration;\n}\nfunction computeHeaderFormats(tDateProfile, dateProfile, dateEnv, allOptions) {\n var format1;\n var format2;\n var labelInterval = tDateProfile.labelInterval;\n var unit = greatestDurationDenominator(labelInterval).unit;\n var weekNumbersVisible = allOptions.weekNumbers;\n var format0 = (format1 = (format2 = null));\n // NOTE: weekNumber computation function wont work\n if ((unit === 'week') && !weekNumbersVisible) {\n unit = 'day';\n }\n switch (unit) {\n case 'year':\n format0 = { year: 'numeric' }; // '2015'\n break;\n case 'month':\n if (currentRangeAs('years', dateProfile, dateEnv) > 1) {\n format0 = { year: 'numeric' }; // '2015'\n }\n format1 = { month: 'short' }; // 'Jan'\n break;\n case 'week':\n if (currentRangeAs('years', dateProfile, dateEnv) > 1) {\n format0 = { year: 'numeric' }; // '2015'\n }\n format1 = { week: 'narrow' }; // 'Wk4'\n break;\n case 'day':\n if (currentRangeAs('years', dateProfile, dateEnv) > 1) {\n format0 = { year: 'numeric', month: 'long' }; // 'January 2014'\n }\n else if (currentRangeAs('months', dateProfile, dateEnv) > 1) {\n format0 = { month: 'long' }; // 'January'\n }\n if (weekNumbersVisible) {\n format1 = { week: 'short' }; // 'Wk 4'\n }\n format2 = { weekday: 'narrow', day: 'numeric' }; // 'Su 9'\n break;\n case 'hour':\n if (weekNumbersVisible) {\n format0 = { week: 'short' }; // 'Wk 4'\n }\n if (currentRangeAs('days', dateProfile, dateEnv) > 1) {\n format1 = { weekday: 'short', day: 'numeric', month: 'numeric', omitCommas: true }; // Sat 4/7\n }\n format2 = {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'short',\n };\n break;\n case 'minute':\n // sufficiently large number of different minute cells?\n if ((asRoughMinutes(labelInterval) / 60) >= MAX_AUTO_SLOTS_PER_LABEL) {\n format0 = {\n hour: 'numeric',\n meridiem: 'short',\n };\n format1 = function (params) { return (':' + padStart(params.date.minute, 2) // ':30'\n ); };\n }\n else {\n format0 = {\n hour: 'numeric',\n minute: 'numeric',\n meridiem: 'short',\n };\n }\n break;\n case 'second':\n // sufficiently large number of different second cells?\n if ((asRoughSeconds(labelInterval) / 60) >= MAX_AUTO_SLOTS_PER_LABEL) {\n format0 = { hour: 'numeric', minute: '2-digit', meridiem: 'lowercase' }; // '8:30 PM'\n format1 = function (params) { return (':' + padStart(params.date.second, 2) // ':30'\n ); };\n }\n else {\n format0 = { hour: 'numeric', minute: '2-digit', second: '2-digit', meridiem: 'lowercase' }; // '8:30:45 PM'\n }\n break;\n case 'millisecond':\n format0 = { hour: 'numeric', minute: '2-digit', second: '2-digit', meridiem: 'lowercase' }; // '8:30:45 PM'\n format1 = function (params) { return ('.' + padStart(params.millisecond, 3)); };\n break;\n }\n return [].concat(format0 || [], format1 || [], format2 || []);\n}\n// Compute the number of the give units in the \"current\" range.\n// Won't go more precise than days.\n// Will return `0` if there's not a clean whole interval.\nfunction currentRangeAs(unit, dateProfile, dateEnv) {\n var range = dateProfile.currentRange;\n var res = null;\n if (unit === 'years') {\n res = dateEnv.diffWholeYears(range.start, range.end);\n }\n else if (unit === 'months') {\n res = dateEnv.diffWholeMonths(range.start, range.end);\n }\n else if (unit === 'weeks') {\n res = dateEnv.diffWholeMonths(range.start, range.end);\n }\n else if (unit === 'days') {\n res = diffWholeDays(range.start, range.end);\n }\n return res || 0;\n}\nfunction buildIsWeekStarts(tDateProfile, dateEnv) {\n var slotDates = tDateProfile.slotDates, emphasizeWeeks = tDateProfile.emphasizeWeeks;\n var prevWeekNumber = null;\n var isWeekStarts = [];\n for (var _i = 0, slotDates_1 = slotDates; _i < slotDates_1.length; _i++) {\n var slotDate = slotDates_1[_i];\n var weekNumber = dateEnv.computeWeekNumber(slotDate);\n var isWeekStart = emphasizeWeeks && (prevWeekNumber !== null) && (prevWeekNumber !== weekNumber);\n prevWeekNumber = weekNumber;\n isWeekStarts.push(isWeekStart);\n }\n return isWeekStarts;\n}\nfunction buildCellRows(tDateProfile, dateEnv) {\n var slotDates = tDateProfile.slotDates;\n var formats = tDateProfile.headerFormats;\n var cellRows = formats.map(function () { return []; }); // indexed by row,col\n var slotAsDays = asCleanDays(tDateProfile.slotDuration);\n var guessedSlotUnit = slotAsDays === 7 ? 'week' :\n slotAsDays === 1 ? 'day' :\n null;\n // specifically for navclicks\n var rowUnitsFromFormats = formats.map(function (format) { return (format.getLargestUnit ? format.getLargestUnit() : null); });\n // builds cellRows and slotCells\n for (var i = 0; i < slotDates.length; i += 1) {\n var date = slotDates[i];\n var isWeekStart = tDateProfile.isWeekStarts[i];\n for (var row = 0; row < formats.length; row += 1) {\n var format = formats[row];\n var rowCells = cellRows[row];\n var leadingCell = rowCells[rowCells.length - 1];\n var isLastRow = row === formats.length - 1;\n var isSuperRow = formats.length > 1 && !isLastRow; // more than one row and not the last\n var newCell = null;\n var rowUnit = rowUnitsFromFormats[row] || (isLastRow ? guessedSlotUnit : null);\n if (isSuperRow) {\n var text = dateEnv.format(date, format);\n if (!leadingCell || (leadingCell.text !== text)) {\n newCell = buildCellObject(date, text, rowUnit);\n }\n else {\n leadingCell.colspan += 1;\n }\n }\n else if (!leadingCell ||\n isInt(dateEnv.countDurationsBetween(tDateProfile.normalizedRange.start, date, tDateProfile.labelInterval))) {\n var text = dateEnv.format(date, format);\n newCell = buildCellObject(date, text, rowUnit);\n }\n else {\n leadingCell.colspan += 1;\n }\n if (newCell) {\n newCell.weekStart = isWeekStart;\n rowCells.push(newCell);\n }\n }\n }\n return cellRows;\n}\nfunction buildCellObject(date, text, rowUnit) {\n return { date: date, text: text, rowUnit: rowUnit, colspan: 1, isWeekStart: false };\n}\n\nvar TimelineHeaderThInner = /** @class */ (function (_super) {\n __extends(TimelineHeaderThInner, _super);\n function TimelineHeaderThInner() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimelineHeaderThInner.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n return (createElement(ContentHook, { hookProps: props.hookProps, content: context.options.slotLabelContent, defaultContent: renderInnerContent }, function (innerElRef, innerContent) { return (createElement(\"a\", __assign({ ref: innerElRef, className: 'fc-timeline-slot-cushion fc-scrollgrid-sync-inner' + (props.isSticky ? ' fc-sticky' : '') }, props.navLinkAttrs), innerContent)); }));\n };\n return TimelineHeaderThInner;\n}(BaseComponent));\nfunction renderInnerContent(props) {\n return props.text;\n}\nfunction refineHookProps(input) {\n return {\n level: input.level,\n date: input.dateEnv.toDate(input.dateMarker),\n view: input.viewApi,\n text: input.text,\n };\n}\n\nvar TimelineHeaderTh = /** @class */ (function (_super) {\n __extends(TimelineHeaderTh, _super);\n function TimelineHeaderTh() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.refineHookProps = memoizeObjArg(refineHookProps);\n _this.normalizeClassNames = buildClassNameNormalizer();\n _this.buildCellNavLinkAttrs = memoize(buildCellNavLinkAttrs);\n return _this;\n }\n TimelineHeaderTh.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var dateEnv = context.dateEnv, options = context.options;\n var cell = props.cell, dateProfile = props.dateProfile, tDateProfile = props.tDateProfile;\n // the cell.rowUnit is f'd\n // giving 'month' for a 3-day view\n // workaround: to infer day, do NOT time\n var dateMeta = getDateMeta(cell.date, props.todayRange, props.nowDate, dateProfile);\n var classNames = ['fc-timeline-slot', 'fc-timeline-slot-label'].concat(cell.rowUnit === 'time' // TODO: so slot classnames for week/month/bigger. see note above about rowUnit\n ? getSlotClassNames(dateMeta, context.theme)\n : getDayClassNames(dateMeta, context.theme));\n if (cell.isWeekStart) {\n classNames.push('fc-timeline-slot-em');\n }\n var hookProps = this.refineHookProps({\n level: props.rowLevel,\n dateMarker: cell.date,\n text: cell.text,\n dateEnv: context.dateEnv,\n viewApi: context.viewApi,\n });\n var customClassNames = this.normalizeClassNames(options.slotLabelClassNames, hookProps);\n return (createElement(MountHook, { hookProps: hookProps, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, function (rootElRef) { return (createElement(\"th\", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), \"data-date\": dateEnv.formatIso(cell.date, { omitTime: !tDateProfile.isTimeScale, omitTimeZoneOffset: true }), colSpan: cell.colspan },\n createElement(\"div\", { className: \"fc-timeline-slot-frame\", style: { height: props.rowInnerHeight } },\n createElement(TimelineHeaderThInner, { hookProps: hookProps, isSticky: props.isSticky, navLinkAttrs: _this.buildCellNavLinkAttrs(context, cell.date, cell.rowUnit) })))); }));\n };\n return TimelineHeaderTh;\n}(BaseComponent));\nfunction buildCellNavLinkAttrs(context, cellDate, rowUnit) {\n return (rowUnit && rowUnit !== 'time')\n ? buildNavLinkAttrs(context, cellDate, rowUnit)\n : {};\n}\n\nvar TimelineHeaderRows = /** @class */ (function (_super) {\n __extends(TimelineHeaderRows, _super);\n function TimelineHeaderRows() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimelineHeaderRows.prototype.render = function () {\n var _a = this.props, dateProfile = _a.dateProfile, tDateProfile = _a.tDateProfile, rowInnerHeights = _a.rowInnerHeights, todayRange = _a.todayRange, nowDate = _a.nowDate;\n var cellRows = tDateProfile.cellRows;\n return (createElement(Fragment, null, cellRows.map(function (rowCells, rowLevel) {\n var isLast = rowLevel === cellRows.length - 1;\n var isChrono = tDateProfile.isTimeScale && isLast; // the final row, with times?\n var classNames = [\n 'fc-timeline-header-row',\n isChrono ? 'fc-timeline-header-row-chrono' : '',\n ];\n return ( // eslint-disable-next-line react/no-array-index-key\n createElement(\"tr\", { key: rowLevel, className: classNames.join(' ') }, rowCells.map(function (cell) { return (createElement(TimelineHeaderTh, { key: cell.date.toISOString(), cell: cell, rowLevel: rowLevel, dateProfile: dateProfile, tDateProfile: tDateProfile, todayRange: todayRange, nowDate: nowDate, rowInnerHeight: rowInnerHeights && rowInnerHeights[rowLevel], isSticky: !isLast })); })));\n })));\n };\n return TimelineHeaderRows;\n}(BaseComponent));\n\nvar TimelineCoords = /** @class */ (function () {\n function TimelineCoords(slatRootEl, // okay to expose?\n slatEls, dateProfile, tDateProfile, dateEnv, isRtl) {\n this.slatRootEl = slatRootEl;\n this.dateProfile = dateProfile;\n this.tDateProfile = tDateProfile;\n this.dateEnv = dateEnv;\n this.isRtl = isRtl;\n this.outerCoordCache = new PositionCache(slatRootEl, slatEls, true, // isHorizontal\n false);\n // for the inner divs within the slats\n // used for event rendering and scrollTime, to disregard slat border\n this.innerCoordCache = new PositionCache(slatRootEl, findDirectChildren(slatEls, 'div'), true, // isHorizontal\n false);\n }\n TimelineCoords.prototype.isDateInRange = function (date) {\n return rangeContainsMarker(this.dateProfile.currentRange, date);\n };\n // results range from negative width of area to 0\n TimelineCoords.prototype.dateToCoord = function (date) {\n var tDateProfile = this.tDateProfile;\n var snapCoverage = this.computeDateSnapCoverage(date);\n var slotCoverage = snapCoverage / tDateProfile.snapsPerSlot;\n var slotIndex = Math.floor(slotCoverage);\n slotIndex = Math.min(slotIndex, tDateProfile.slotCnt - 1);\n var partial = slotCoverage - slotIndex;\n var _a = this, innerCoordCache = _a.innerCoordCache, outerCoordCache = _a.outerCoordCache;\n if (this.isRtl) {\n return outerCoordCache.originClientRect.width - (outerCoordCache.rights[slotIndex] -\n (innerCoordCache.getWidth(slotIndex) * partial));\n }\n return (outerCoordCache.lefts[slotIndex] +\n (innerCoordCache.getWidth(slotIndex) * partial));\n };\n TimelineCoords.prototype.rangeToCoords = function (range) {\n return {\n start: this.dateToCoord(range.start),\n end: this.dateToCoord(range.end),\n };\n };\n TimelineCoords.prototype.durationToCoord = function (duration) {\n var _a = this, dateProfile = _a.dateProfile, tDateProfile = _a.tDateProfile, dateEnv = _a.dateEnv, isRtl = _a.isRtl;\n var coord = 0;\n if (dateProfile) {\n var date = dateEnv.add(dateProfile.activeRange.start, duration);\n if (!tDateProfile.isTimeScale) {\n date = startOfDay(date);\n }\n coord = this.dateToCoord(date);\n // hack to overcome the left borders of non-first slat\n if (!isRtl && coord) {\n coord += 1;\n }\n }\n return coord;\n };\n TimelineCoords.prototype.coordFromLeft = function (coord) {\n if (this.isRtl) {\n return this.outerCoordCache.originClientRect.width - coord;\n }\n return coord;\n };\n // returned value is between 0 and the number of snaps\n TimelineCoords.prototype.computeDateSnapCoverage = function (date) {\n return computeDateSnapCoverage(date, this.tDateProfile, this.dateEnv);\n };\n return TimelineCoords;\n}());\n// returned value is between 0 and the number of snaps\nfunction computeDateSnapCoverage(date, tDateProfile, dateEnv) {\n var snapDiff = dateEnv.countDurationsBetween(tDateProfile.normalizedRange.start, date, tDateProfile.snapDuration);\n if (snapDiff < 0) {\n return 0;\n }\n if (snapDiff >= tDateProfile.snapDiffToIndex.length) {\n return tDateProfile.snapCnt;\n }\n var snapDiffInt = Math.floor(snapDiff);\n var snapCoverage = tDateProfile.snapDiffToIndex[snapDiffInt];\n if (isInt(snapCoverage)) { // not an in-between value\n snapCoverage += snapDiff - snapDiffInt; // add the remainder\n }\n else {\n // a fractional value, meaning the date is not visible\n // always round up in this case. works for start AND end dates in a range.\n snapCoverage = Math.ceil(snapCoverage);\n }\n return snapCoverage;\n}\nfunction coordToCss(hcoord, isRtl) {\n if (hcoord === null) {\n return { left: '', right: '' };\n }\n if (isRtl) {\n return { right: hcoord, left: '' };\n }\n return { left: hcoord, right: '' };\n}\nfunction coordsToCss(hcoords, isRtl) {\n if (!hcoords) {\n return { left: '', right: '' };\n }\n if (isRtl) {\n return { right: hcoords.start, left: -hcoords.end };\n }\n return { left: hcoords.start, right: -hcoords.end };\n}\n\nvar TimelineHeader = /** @class */ (function (_super) {\n __extends(TimelineHeader, _super);\n function TimelineHeader() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rootElRef = createRef();\n return _this;\n }\n TimelineHeader.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n // TODO: very repetitive\n // TODO: make part of tDateProfile?\n var timerUnit = greatestDurationDenominator(props.tDateProfile.slotDuration).unit;\n // WORKAROUND: make ignore slatCoords when out of sync with dateProfile\n var slatCoords = props.slatCoords && props.slatCoords.dateProfile === props.dateProfile ? props.slatCoords : null;\n return (createElement(NowTimer, { unit: timerUnit }, function (nowDate, todayRange) { return (createElement(\"div\", { className: \"fc-timeline-header\", ref: _this.rootElRef },\n createElement(\"table\", { \"aria-hidden\": true, className: \"fc-scrollgrid-sync-table\", style: { minWidth: props.tableMinWidth, width: props.clientWidth } },\n props.tableColGroupNode,\n createElement(\"tbody\", null,\n createElement(TimelineHeaderRows, { dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, nowDate: nowDate, todayRange: todayRange, rowInnerHeights: props.rowInnerHeights }))),\n context.options.nowIndicator && (\n // need to have a container regardless of whether the current view has a visible now indicator\n // because apparently removal of the element resets the scroll for some reasons (issue #5351).\n // this issue doesn't happen for the timeline body however (\n createElement(\"div\", { className: \"fc-timeline-now-indicator-container\" }, (slatCoords && slatCoords.isDateInRange(nowDate)) && (createElement(NowIndicatorRoot, { isAxis: true, date: nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-timeline-now-indicator-arrow'].concat(classNames).join(' '), style: coordToCss(slatCoords.dateToCoord(nowDate), context.isRtl) }, innerContent)); })))))); }));\n };\n TimelineHeader.prototype.componentDidMount = function () {\n this.updateSize();\n };\n TimelineHeader.prototype.componentDidUpdate = function () {\n this.updateSize();\n };\n TimelineHeader.prototype.updateSize = function () {\n if (this.props.onMaxCushionWidth) {\n this.props.onMaxCushionWidth(this.computeMaxCushionWidth());\n }\n };\n TimelineHeader.prototype.computeMaxCushionWidth = function () {\n return Math.max.apply(Math, findElements(this.rootElRef.current, '.fc-timeline-header-row:last-child .fc-timeline-slot-cushion').map(function (el) { return el.getBoundingClientRect().width; }));\n };\n return TimelineHeader;\n}(BaseComponent));\n\nvar TimelineSlatCell = /** @class */ (function (_super) {\n __extends(TimelineSlatCell, _super);\n function TimelineSlatCell() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimelineSlatCell.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var dateEnv = context.dateEnv, options = context.options, theme = context.theme;\n var date = props.date, tDateProfile = props.tDateProfile, isEm = props.isEm;\n var dateMeta = getDateMeta(props.date, props.todayRange, props.nowDate, props.dateProfile);\n var classNames = ['fc-timeline-slot', 'fc-timeline-slot-lane'];\n var dataAttrs = { 'data-date': dateEnv.formatIso(date, { omitTimeZoneOffset: true, omitTime: !tDateProfile.isTimeScale }) };\n var hookProps = __assign(__assign({ date: dateEnv.toDate(props.date) }, dateMeta), { view: context.viewApi });\n if (isEm) {\n classNames.push('fc-timeline-slot-em');\n }\n if (tDateProfile.isTimeScale) {\n classNames.push(isInt(dateEnv.countDurationsBetween(tDateProfile.normalizedRange.start, props.date, tDateProfile.labelInterval)) ?\n 'fc-timeline-slot-major' :\n 'fc-timeline-slot-minor');\n }\n classNames.push.apply(classNames, (props.isDay\n ? getDayClassNames(dateMeta, theme)\n : getSlotClassNames(dateMeta, theme)));\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.slotLaneClassNames, content: options.slotLaneContent, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount, elRef: props.elRef }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement(\"td\", __assign({ ref: rootElRef, className: classNames.concat(customClassNames).join(' ') }, dataAttrs),\n createElement(\"div\", { ref: innerElRef }, innerContent))); }));\n };\n return TimelineSlatCell;\n}(BaseComponent));\n\nvar TimelineSlatsBody = /** @class */ (function (_super) {\n __extends(TimelineSlatsBody, _super);\n function TimelineSlatsBody() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimelineSlatsBody.prototype.render = function () {\n var props = this.props;\n var tDateProfile = props.tDateProfile, cellElRefs = props.cellElRefs;\n var slotDates = tDateProfile.slotDates, isWeekStarts = tDateProfile.isWeekStarts;\n var isDay = !tDateProfile.isTimeScale && !tDateProfile.largeUnit;\n return (createElement(\"tbody\", null,\n createElement(\"tr\", null, slotDates.map(function (slotDate, i) {\n var key = slotDate.toISOString();\n return (createElement(TimelineSlatCell, { key: key, elRef: cellElRefs.createRef(key), date: slotDate, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isEm: isWeekStarts[i], isDay: isDay }));\n }))));\n };\n return TimelineSlatsBody;\n}(BaseComponent));\n\nvar TimelineSlats = /** @class */ (function (_super) {\n __extends(TimelineSlats, _super);\n function TimelineSlats() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rootElRef = createRef();\n _this.cellElRefs = new RefMap();\n _this.handleScrollRequest = function (request) {\n var onScrollLeftRequest = _this.props.onScrollLeftRequest;\n var coords = _this.coords;\n if (onScrollLeftRequest && coords) {\n if (request.time) {\n var scrollLeft = coords.coordFromLeft(coords.durationToCoord(request.time));\n onScrollLeftRequest(scrollLeft);\n }\n return true;\n }\n return null; // best?\n };\n return _this;\n }\n TimelineSlats.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n return (createElement(\"div\", { className: \"fc-timeline-slots\", ref: this.rootElRef },\n createElement(\"table\", { \"aria-hidden\": true, className: context.theme.getClass('table'), style: {\n minWidth: props.tableMinWidth,\n width: props.clientWidth,\n } },\n props.tableColGroupNode,\n createElement(TimelineSlatsBody, { cellElRefs: this.cellElRefs, dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange }))));\n };\n TimelineSlats.prototype.componentDidMount = function () {\n this.updateSizing();\n this.scrollResponder = this.context.createScrollResponder(this.handleScrollRequest);\n };\n TimelineSlats.prototype.componentDidUpdate = function (prevProps) {\n this.updateSizing();\n this.scrollResponder.update(prevProps.dateProfile !== this.props.dateProfile);\n };\n TimelineSlats.prototype.componentWillUnmount = function () {\n this.scrollResponder.detach();\n if (this.props.onCoords) {\n this.props.onCoords(null);\n }\n };\n TimelineSlats.prototype.updateSizing = function () {\n var _a = this, props = _a.props, context = _a.context;\n if (props.clientWidth !== null && // is sizing stable?\n this.scrollResponder\n // ^it's possible to have clientWidth immediately after mount (when returning from print view), but w/o scrollResponder\n ) {\n var rootEl = this.rootElRef.current;\n if (rootEl.offsetWidth) { // not hidden by css\n this.coords = new TimelineCoords(this.rootElRef.current, collectCellEls(this.cellElRefs.currentMap, props.tDateProfile.slotDates), props.dateProfile, props.tDateProfile, context.dateEnv, context.isRtl);\n if (props.onCoords) {\n props.onCoords(this.coords);\n }\n this.scrollResponder.update(false); // TODO: wouldn't have to do this if coords were in state\n }\n }\n };\n TimelineSlats.prototype.positionToHit = function (leftPosition) {\n var outerCoordCache = this.coords.outerCoordCache;\n var _a = this.context, dateEnv = _a.dateEnv, isRtl = _a.isRtl;\n var tDateProfile = this.props.tDateProfile;\n var slatIndex = outerCoordCache.leftToIndex(leftPosition);\n if (slatIndex != null) {\n // somewhat similar to what TimeGrid does. consolidate?\n var slatWidth = outerCoordCache.getWidth(slatIndex);\n var partial = isRtl ?\n (outerCoordCache.rights[slatIndex] - leftPosition) / slatWidth :\n (leftPosition - outerCoordCache.lefts[slatIndex]) / slatWidth;\n var localSnapIndex = Math.floor(partial * tDateProfile.snapsPerSlot);\n var start = dateEnv.add(tDateProfile.slotDates[slatIndex], multiplyDuration(tDateProfile.snapDuration, localSnapIndex));\n var end = dateEnv.add(start, tDateProfile.snapDuration);\n return {\n dateSpan: {\n range: { start: start, end: end },\n allDay: !this.props.tDateProfile.isTimeScale,\n },\n dayEl: this.cellElRefs.currentMap[slatIndex],\n left: outerCoordCache.lefts[slatIndex],\n right: outerCoordCache.rights[slatIndex],\n };\n }\n return null;\n };\n return TimelineSlats;\n}(BaseComponent));\nfunction collectCellEls(elMap, slotDates) {\n return slotDates.map(function (slotDate) {\n var key = slotDate.toISOString();\n return elMap[key];\n });\n}\n\nfunction computeSegHCoords(segs, minWidth, timelineCoords) {\n var hcoords = [];\n if (timelineCoords) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var res = timelineCoords.rangeToCoords(seg);\n var start = Math.round(res.start); // for barely-overlapping collisions\n var end = Math.round(res.end); //\n if (end - start < minWidth) {\n end = start + minWidth;\n }\n hcoords.push({ start: start, end: end });\n }\n }\n return hcoords;\n}\nfunction computeFgSegPlacements(segs, segHCoords, // might not have for every seg\neventInstanceHeights, // might not have for every seg\nmoreLinkHeights, // might not have for every more-link\nstrictOrder, maxStackCnt) {\n var segInputs = [];\n var crudePlacements = []; // when we don't know dims\n for (var i = 0; i < segs.length; i += 1) {\n var seg = segs[i];\n var instanceId = seg.eventRange.instance.instanceId;\n var height = eventInstanceHeights[instanceId];\n var hcoords = segHCoords[i];\n if (height && hcoords) {\n segInputs.push({\n index: i,\n span: hcoords,\n thickness: height,\n });\n }\n else {\n crudePlacements.push({\n seg: seg,\n hcoords: hcoords,\n top: null,\n });\n }\n }\n var hierarchy = new SegHierarchy();\n if (strictOrder != null) {\n hierarchy.strictOrder = strictOrder;\n }\n if (maxStackCnt != null) {\n hierarchy.maxStackCnt = maxStackCnt;\n }\n var hiddenEntries = hierarchy.addSegs(segInputs);\n var hiddenPlacements = hiddenEntries.map(function (entry) { return ({\n seg: segs[entry.index],\n hcoords: entry.span,\n top: null,\n }); });\n var hiddenGroups = groupIntersectingEntries(hiddenEntries);\n var moreLinkInputs = [];\n var moreLinkCrudePlacements = [];\n var extractSeg = function (entry) { return segs[entry.index]; };\n for (var i = 0; i < hiddenGroups.length; i += 1) {\n var hiddenGroup = hiddenGroups[i];\n var sortedSegs = hiddenGroup.entries.map(extractSeg);\n var height = moreLinkHeights[buildIsoString(computeEarliestSegStart(sortedSegs))]; // not optimal :(\n if (height != null) {\n // NOTE: the hiddenGroup's spanStart/spanEnd are already computed by rangeToCoords. computed during input.\n moreLinkInputs.push({\n index: segs.length + i,\n thickness: height,\n span: hiddenGroup.span,\n });\n }\n else {\n moreLinkCrudePlacements.push({\n seg: sortedSegs,\n hcoords: hiddenGroup.span,\n top: null,\n });\n }\n }\n // add more-links into the hierarchy, but don't limit\n hierarchy.maxStackCnt = -1;\n hierarchy.addSegs(moreLinkInputs);\n var visibleRects = hierarchy.toRects();\n var visiblePlacements = [];\n var maxHeight = 0;\n for (var _i = 0, visibleRects_1 = visibleRects; _i < visibleRects_1.length; _i++) {\n var rect = visibleRects_1[_i];\n var segIndex = rect.index;\n visiblePlacements.push({\n seg: segIndex < segs.length\n ? segs[segIndex] // a real seg\n : hiddenGroups[segIndex - segs.length].entries.map(extractSeg),\n hcoords: rect.span,\n top: rect.levelCoord,\n });\n maxHeight = Math.max(maxHeight, rect.levelCoord + rect.thickness);\n }\n return [\n visiblePlacements.concat(crudePlacements, hiddenPlacements, moreLinkCrudePlacements),\n maxHeight,\n ];\n}\n\nvar TimelineLaneBg = /** @class */ (function (_super) {\n __extends(TimelineLaneBg, _super);\n function TimelineLaneBg() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimelineLaneBg.prototype.render = function () {\n var props = this.props;\n var highlightSeg = [].concat(props.eventResizeSegs, props.dateSelectionSegs);\n return props.timelineCoords && (createElement(\"div\", { className: \"fc-timeline-bg\" },\n this.renderSegs(props.businessHourSegs || [], props.timelineCoords, 'non-business'),\n this.renderSegs(props.bgEventSegs || [], props.timelineCoords, 'bg-event'),\n this.renderSegs(highlightSeg, props.timelineCoords, 'highlight')));\n };\n TimelineLaneBg.prototype.renderSegs = function (segs, timelineCoords, fillType) {\n var _a = this.props, todayRange = _a.todayRange, nowDate = _a.nowDate;\n var isRtl = this.context.isRtl;\n var segHCoords = computeSegHCoords(segs, 0, timelineCoords);\n var children = segs.map(function (seg, i) {\n var hcoords = segHCoords[i];\n var hStyle = coordsToCss(hcoords, isRtl);\n return (createElement(\"div\", { key: buildEventRangeKey(seg.eventRange), className: \"fc-timeline-bg-harness\", style: hStyle }, fillType === 'bg-event' ?\n createElement(BgEvent, __assign({ seg: seg }, getSegMeta(seg, todayRange, nowDate))) :\n renderFill(fillType)));\n });\n return createElement(Fragment, null, children);\n };\n return TimelineLaneBg;\n}(BaseComponent));\n\nvar TimelineLaneSlicer = /** @class */ (function (_super) {\n __extends(TimelineLaneSlicer, _super);\n function TimelineLaneSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimelineLaneSlicer.prototype.sliceRange = function (origRange, dateProfile, dateProfileGenerator, tDateProfile, dateEnv) {\n var normalRange = normalizeRange(origRange, tDateProfile, dateEnv);\n var segs = [];\n // protect against when the span is entirely in an invalid date region\n if (computeDateSnapCoverage(normalRange.start, tDateProfile, dateEnv)\n < computeDateSnapCoverage(normalRange.end, tDateProfile, dateEnv)) {\n // intersect the footprint's range with the grid's range\n var slicedRange = intersectRanges(normalRange, tDateProfile.normalizedRange);\n if (slicedRange) {\n segs.push({\n start: slicedRange.start,\n end: slicedRange.end,\n isStart: slicedRange.start.valueOf() === normalRange.start.valueOf()\n && isValidDate(slicedRange.start, tDateProfile, dateProfile, dateProfileGenerator),\n isEnd: slicedRange.end.valueOf() === normalRange.end.valueOf()\n && isValidDate(addMs(slicedRange.end, -1), tDateProfile, dateProfile, dateProfileGenerator),\n });\n }\n }\n return segs;\n };\n return TimelineLaneSlicer;\n}(Slicer));\n\nvar DEFAULT_TIME_FORMAT = createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'narrow',\n});\nvar TimelineEvent = /** @class */ (function (_super) {\n __extends(TimelineEvent, _super);\n function TimelineEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimelineEvent.prototype.render = function () {\n var props = this.props;\n return (createElement(StandardEvent, __assign({}, props, { extraClassNames: ['fc-timeline-event', 'fc-h-event'], defaultTimeFormat: DEFAULT_TIME_FORMAT, defaultDisplayEventTime: !props.isTimeScale })));\n };\n return TimelineEvent;\n}(BaseComponent));\n\nvar TimelineLaneMoreLink = /** @class */ (function (_super) {\n __extends(TimelineLaneMoreLink, _super);\n function TimelineLaneMoreLink() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rootElRef = createRef();\n return _this;\n }\n TimelineLaneMoreLink.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var hiddenSegs = props.hiddenSegs, elRef = props.elRef, placement = props.placement, resourceId = props.resourceId;\n var top = placement.top, hcoords = placement.hcoords;\n var isVisible = hcoords && top !== null;\n var hStyle = coordsToCss(hcoords, context.isRtl);\n var extraDateSpan = resourceId ? { resourceId: resourceId } : {};\n return (createElement(MoreLinkRoot, { allDayDate: null, moreCnt: hiddenSegs.length, allSegs: hiddenSegs, hiddenSegs: hiddenSegs, alignmentElRef: this.rootElRef, dateProfile: props.dateProfile, todayRange: props.todayRange, extraDateSpan: extraDateSpan, popoverContent: function () { return (createElement(Fragment, null, hiddenSegs.map(function (seg) {\n var instanceId = seg.eventRange.instance.instanceId;\n return (createElement(\"div\", { key: instanceId, style: { visibility: props.isForcedInvisible[instanceId] ? 'hidden' : '' } },\n createElement(TimelineEvent, __assign({ isTimeScale: props.isTimeScale, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection }, getSegMeta(seg, props.todayRange, props.nowDate)))));\n }))); } }, function (rootElRef, classNames, innerElRef, innerContent, handleClick, title, isExpanded, popoverId) { return (createElement(\"a\", { ref: function (el) {\n setRef(rootElRef, el); // for MoreLinkRoot\n setRef(elRef, el); // for props props\n setRef(_this.rootElRef, el); // for this component\n }, className: ['fc-timeline-more-link'].concat(classNames).join(' '), style: __assign({ visibility: isVisible ? '' : 'hidden', top: top || 0 }, hStyle), onClick: handleClick, title: title, \"aria-expanded\": isExpanded, \"aria-controls\": popoverId },\n createElement(\"div\", { ref: innerElRef, className: \"fc-timeline-more-link-inner fc-sticky\" }, innerContent))); }));\n };\n return TimelineLaneMoreLink;\n}(BaseComponent));\n\nvar TimelineLane = /** @class */ (function (_super) {\n __extends(TimelineLane, _super);\n function TimelineLane() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.slicer = new TimelineLaneSlicer();\n _this.sortEventSegs = memoize(sortEventSegs);\n _this.harnessElRefs = new RefMap();\n _this.moreElRefs = new RefMap();\n _this.innerElRef = createRef();\n // TODO: memoize event positioning\n _this.state = {\n eventInstanceHeights: {},\n moreLinkHeights: {},\n };\n return _this;\n }\n TimelineLane.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var options = context.options;\n var dateProfile = props.dateProfile, tDateProfile = props.tDateProfile;\n var slicedProps = this.slicer.sliceProps(props, dateProfile, tDateProfile.isTimeScale ? null : props.nextDayThreshold, context, // wish we didn't have to pass in the rest of the args...\n dateProfile, context.dateProfileGenerator, tDateProfile, context.dateEnv);\n var mirrorSegs = (slicedProps.eventDrag ? slicedProps.eventDrag.segs : null) ||\n (slicedProps.eventResize ? slicedProps.eventResize.segs : null) ||\n [];\n var fgSegs = this.sortEventSegs(slicedProps.fgEventSegs, options.eventOrder);\n var fgSegHCoords = computeSegHCoords(fgSegs, options.eventMinWidth, props.timelineCoords);\n var _b = computeFgSegPlacements(fgSegs, fgSegHCoords, state.eventInstanceHeights, state.moreLinkHeights, options.eventOrderStrict, options.eventMaxStack), fgPlacements = _b[0], fgHeight = _b[1];\n var isForcedInvisible = // TODO: more convenient\n (slicedProps.eventDrag ? slicedProps.eventDrag.affectedInstances : null) ||\n (slicedProps.eventResize ? slicedProps.eventResize.affectedInstances : null) ||\n {};\n return (createElement(Fragment, null,\n createElement(TimelineLaneBg, { businessHourSegs: slicedProps.businessHourSegs, bgEventSegs: slicedProps.bgEventSegs, timelineCoords: props.timelineCoords, eventResizeSegs: slicedProps.eventResize ? slicedProps.eventResize.segs : [] /* bad new empty array? */, dateSelectionSegs: slicedProps.dateSelectionSegs, nowDate: props.nowDate, todayRange: props.todayRange }),\n createElement(\"div\", { className: \"fc-timeline-events fc-scrollgrid-sync-inner\", ref: this.innerElRef, style: { height: fgHeight } },\n this.renderFgSegs(fgPlacements, isForcedInvisible, false, false, false),\n this.renderFgSegs(buildMirrorPlacements(mirrorSegs, props.timelineCoords, fgPlacements), {}, Boolean(slicedProps.eventDrag), Boolean(slicedProps.eventResize), false))));\n };\n TimelineLane.prototype.componentDidMount = function () {\n this.updateSize();\n };\n TimelineLane.prototype.componentDidUpdate = function (prevProps, prevState) {\n if (prevProps.eventStore !== this.props.eventStore || // external thing changed?\n prevProps.timelineCoords !== this.props.timelineCoords || // external thing changed?\n prevState.moreLinkHeights !== this.state.moreLinkHeights // HACK. see addStateEquality\n ) {\n this.updateSize();\n }\n };\n TimelineLane.prototype.updateSize = function () {\n var props = this.props;\n var timelineCoords = props.timelineCoords;\n var innerEl = this.innerElRef.current;\n if (props.onHeightChange) {\n props.onHeightChange(innerEl, false);\n }\n if (timelineCoords) {\n this.setState({\n eventInstanceHeights: mapHash(this.harnessElRefs.currentMap, function (harnessEl) { return (Math.round(harnessEl.getBoundingClientRect().height)); }),\n moreLinkHeights: mapHash(this.moreElRefs.currentMap, function (moreEl) { return (Math.round(moreEl.getBoundingClientRect().height)); }),\n }, function () {\n if (props.onHeightChange) {\n props.onHeightChange(innerEl, true);\n }\n });\n }\n // hack\n if (props.syncParentMinHeight) {\n innerEl.parentElement.style.minHeight = innerEl.style.height;\n }\n };\n TimelineLane.prototype.renderFgSegs = function (segPlacements, isForcedInvisible, isDragging, isResizing, isDateSelecting) {\n var _a = this, harnessElRefs = _a.harnessElRefs, moreElRefs = _a.moreElRefs, props = _a.props, context = _a.context;\n var isMirror = isDragging || isResizing || isDateSelecting;\n return (createElement(Fragment, null, segPlacements.map(function (segPlacement) {\n var seg = segPlacement.seg, hcoords = segPlacement.hcoords, top = segPlacement.top;\n if (Array.isArray(seg)) { // a more-link\n var isoStr = buildIsoString(computeEarliestSegStart(seg));\n return (createElement(TimelineLaneMoreLink, { key: 'm:' + isoStr /* \"m\" for \"more\" */, elRef: moreElRefs.createRef(isoStr), hiddenSegs: seg, placement: segPlacement, dateProfile: props.dateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isTimeScale: props.tDateProfile.isTimeScale, eventSelection: props.eventSelection, resourceId: props.resourceId, isForcedInvisible: isForcedInvisible }));\n }\n var instanceId = seg.eventRange.instance.instanceId;\n var isVisible = isMirror || Boolean(!isForcedInvisible[instanceId] && hcoords && top !== null);\n var hStyle = coordsToCss(hcoords, context.isRtl);\n return (createElement(\"div\", { key: 'e:' + instanceId /* \"e\" for \"event\" */, ref: isMirror ? null : harnessElRefs.createRef(instanceId), className: \"fc-timeline-event-harness\", style: __assign({ visibility: isVisible ? '' : 'hidden', top: top || 0 }, hStyle) },\n createElement(TimelineEvent, __assign({ isTimeScale: props.tDateProfile.isTimeScale, seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === props.eventSelection /* TODO: bad for mirror? */ }, getSegMeta(seg, props.todayRange, props.nowDate)))));\n })));\n };\n return TimelineLane;\n}(BaseComponent));\nTimelineLane.addStateEquality({\n eventInstanceHeights: isPropsEqual,\n moreLinkHeights: isPropsEqual,\n});\nfunction buildMirrorPlacements(mirrorSegs, timelineCoords, fgPlacements) {\n if (!mirrorSegs.length || !timelineCoords) {\n return [];\n }\n var topsByInstanceId = buildAbsoluteTopHash(fgPlacements); // TODO: cache this at first render?\n return mirrorSegs.map(function (seg) { return ({\n seg: seg,\n hcoords: timelineCoords.rangeToCoords(seg),\n top: topsByInstanceId[seg.eventRange.instance.instanceId],\n }); });\n}\nfunction buildAbsoluteTopHash(placements) {\n var topsByInstanceId = {};\n for (var _i = 0, placements_1 = placements; _i < placements_1.length; _i++) {\n var placement = placements_1[_i];\n var seg = placement.seg;\n if (!Array.isArray(seg)) { // doesn't represent a more-link\n topsByInstanceId[seg.eventRange.instance.instanceId] = placement.top;\n }\n }\n return topsByInstanceId;\n}\n\nvar TimelineGrid = /** @class */ (function (_super) {\n __extends(TimelineGrid, _super);\n function TimelineGrid() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.slatsRef = createRef();\n _this.state = {\n coords: null,\n };\n _this.handeEl = function (el) {\n if (el) {\n _this.context.registerInteractiveComponent(_this, { el: el });\n }\n else {\n _this.context.unregisterInteractiveComponent(_this);\n }\n };\n _this.handleCoords = function (coords) {\n _this.setState({ coords: coords });\n if (_this.props.onSlatCoords) {\n _this.props.onSlatCoords(coords);\n }\n };\n return _this;\n }\n TimelineGrid.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var options = context.options;\n var dateProfile = props.dateProfile, tDateProfile = props.tDateProfile;\n var timerUnit = greatestDurationDenominator(tDateProfile.slotDuration).unit;\n return (createElement(\"div\", { className: \"fc-timeline-body\", ref: this.handeEl, style: {\n minWidth: props.tableMinWidth,\n height: props.clientHeight,\n width: props.clientWidth,\n } },\n createElement(NowTimer, { unit: timerUnit }, function (nowDate, todayRange) { return (createElement(Fragment, null,\n createElement(TimelineSlats, { ref: _this.slatsRef, dateProfile: dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, clientWidth: props.clientWidth, tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, onCoords: _this.handleCoords, onScrollLeftRequest: props.onScrollLeftRequest }),\n createElement(TimelineLane, { dateProfile: dateProfile, tDateProfile: props.tDateProfile, nowDate: nowDate, todayRange: todayRange, nextDayThreshold: options.nextDayThreshold, businessHours: props.businessHours, eventStore: props.eventStore, eventUiBases: props.eventUiBases, dateSelection: props.dateSelection, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, timelineCoords: state.coords, syncParentMinHeight: true }),\n (options.nowIndicator && state.coords && state.coords.isDateInRange(nowDate)) && (createElement(\"div\", { className: \"fc-timeline-now-indicator-container\" },\n createElement(NowIndicatorRoot, { isAxis: false, date: nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-timeline-now-indicator-line'].concat(classNames).join(' '), style: coordToCss(state.coords.dateToCoord(nowDate), context.isRtl) }, innerContent)); }))))); })));\n };\n // Hit System\n // ------------------------------------------------------------------------------------------\n TimelineGrid.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n var slats = this.slatsRef.current;\n var slatHit = slats.positionToHit(positionLeft);\n if (slatHit) {\n return {\n dateProfile: this.props.dateProfile,\n dateSpan: slatHit.dateSpan,\n rect: {\n left: slatHit.left,\n right: slatHit.right,\n top: 0,\n bottom: elHeight,\n },\n dayEl: slatHit.dayEl,\n layer: 0,\n };\n }\n return null;\n };\n return TimelineGrid;\n}(DateComponent));\n\nvar TimelineView = /** @class */ (function (_super) {\n __extends(TimelineView, _super);\n function TimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildTimelineDateProfile = memoize(buildTimelineDateProfile);\n _this.scrollGridRef = createRef();\n _this.state = {\n slatCoords: null,\n slotCushionMaxWidth: null,\n };\n _this.handleSlatCoords = function (slatCoords) {\n _this.setState({ slatCoords: slatCoords });\n };\n _this.handleScrollLeftRequest = function (scrollLeft) {\n var scrollGrid = _this.scrollGridRef.current;\n scrollGrid.forceScrollLeft(0, scrollLeft);\n };\n _this.handleMaxCushionWidth = function (slotCushionMaxWidth) {\n _this.setState({\n slotCushionMaxWidth: Math.ceil(slotCushionMaxWidth), // for less rerendering TODO: DRY\n });\n };\n return _this;\n }\n TimelineView.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var options = context.options;\n var stickyHeaderDates = !props.forPrint && getStickyHeaderDates(options);\n var stickyFooterScrollbar = !props.forPrint && getStickyFooterScrollbar(options);\n var tDateProfile = this.buildTimelineDateProfile(props.dateProfile, context.dateEnv, options, context.dateProfileGenerator);\n var extraClassNames = [\n 'fc-timeline',\n options.eventOverlap === false ? 'fc-timeline-overlap-disabled' : '',\n ];\n var slotMinWidth = options.slotMinWidth;\n var slatCols = buildSlatCols(tDateProfile, slotMinWidth || this.computeFallbackSlotMinWidth(tDateProfile));\n var sections = [\n {\n type: 'header',\n key: 'header',\n isSticky: stickyHeaderDates,\n chunks: [{\n key: 'timeline',\n content: function (contentArg) { return (createElement(TimelineHeader, { dateProfile: props.dateProfile, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, tableMinWidth: contentArg.tableMinWidth, tableColGroupNode: contentArg.tableColGroupNode, tDateProfile: tDateProfile, slatCoords: state.slatCoords, onMaxCushionWidth: slotMinWidth ? null : _this.handleMaxCushionWidth })); },\n }],\n },\n {\n type: 'body',\n key: 'body',\n liquid: true,\n chunks: [{\n key: 'timeline',\n content: function (contentArg) { return (createElement(TimelineGrid, __assign({}, props, { clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, tableMinWidth: contentArg.tableMinWidth, tableColGroupNode: contentArg.tableColGroupNode, tDateProfile: tDateProfile, onSlatCoords: _this.handleSlatCoords, onScrollLeftRequest: _this.handleScrollLeftRequest }))); },\n }],\n },\n ];\n if (stickyFooterScrollbar) {\n sections.push({\n type: 'footer',\n key: 'footer',\n isSticky: true,\n chunks: [{\n key: 'timeline',\n content: renderScrollShim,\n }],\n });\n }\n return (createElement(ViewRoot, { viewSpec: context.viewSpec }, function (rootElRef, classNames) { return (createElement(\"div\", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') },\n createElement(ScrollGrid, { ref: _this.scrollGridRef, liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: false, colGroups: [\n { cols: slatCols },\n ], sections: sections }))); }));\n };\n TimelineView.prototype.computeFallbackSlotMinWidth = function (tDateProfile) {\n return Math.max(30, ((this.state.slotCushionMaxWidth || 0) / tDateProfile.slotsPerLabel));\n };\n return TimelineView;\n}(DateComponent));\nfunction buildSlatCols(tDateProfile, slotMinWidth) {\n return [{\n span: tDateProfile.slotCnt,\n minWidth: slotMinWidth || 1, // needs to be a non-zero number to trigger horizontal scrollbars!??????\n }];\n}\n\nvar main = createPlugin({\n deps: [\n premiumCommonPlugin,\n ],\n initialView: 'timelineDay',\n views: {\n timeline: {\n component: TimelineView,\n usesMinMaxTime: true,\n eventResizableFromStart: true, // how is this consumed for TimelineView tho?\n },\n timelineDay: {\n type: 'timeline',\n duration: { days: 1 },\n },\n timelineWeek: {\n type: 'timeline',\n duration: { weeks: 1 },\n },\n timelineMonth: {\n type: 'timeline',\n duration: { months: 1 },\n },\n timelineYear: {\n type: 'timeline',\n duration: { years: 1 },\n },\n },\n});\n\nexport default main;\nexport { TimelineCoords, TimelineHeader, TimelineHeaderRows, TimelineLane, TimelineLaneBg, TimelineLaneSlicer, TimelineSlats, TimelineView, buildSlatCols, buildTimelineDateProfile, coordToCss, coordsToCss };\n//# sourceMappingURL=main.js.map\n","/*!\nFullCalendar Scheduler v5.11.3\nDocs & License: https://fullcalendar.io/scheduler\n(c) 2022 Adam Shaw\n*/\nimport { memoize, filterHash, rangesIntersect, isPropsEqual, mapHash, combineEventUis, refineProps, guid, identity, rangesEqual, parseBusinessHours, createEventUi, parseClassNames, EventApi, CalendarApi, Splitter, mergeEventStores, isPropsValid, parseFieldSpecs, unpromisify, requestJson, createElement, ViewContextType, formatDayString, RenderHook, BaseComponent, NowTimer, Fragment, TableDateCell, TableDowCell, computeFallbackHeaderFormat, flexibleCompare, compareByFieldSpecs, createPlugin } from '@fullcalendar/common';\nimport premiumCommonPlugin from '@fullcalendar/premium-common';\nimport { __assign, __extends, __spreadArray } from 'tslib';\n\nfunction massageEventDragMutation(eventMutation, hit0, hit1) {\n var resource0 = hit0.dateSpan.resourceId;\n var resource1 = hit1.dateSpan.resourceId;\n if (resource0 && resource1 &&\n resource0 !== resource1) {\n eventMutation.resourceMutation = {\n matchResourceId: resource0,\n setResourceId: resource1,\n };\n }\n}\n/*\nTODO: all this would be much easier if we were using a hash!\n*/\nfunction applyEventDefMutation(eventDef, mutation, context) {\n var resourceMutation = mutation.resourceMutation;\n if (resourceMutation && computeResourceEditable(eventDef, context)) {\n var index = eventDef.resourceIds.indexOf(resourceMutation.matchResourceId);\n if (index !== -1) {\n var resourceIds = eventDef.resourceIds.slice(); // copy\n resourceIds.splice(index, 1); // remove\n if (resourceIds.indexOf(resourceMutation.setResourceId) === -1) { // not already in there\n resourceIds.push(resourceMutation.setResourceId); // add\n }\n eventDef.resourceIds = resourceIds;\n }\n }\n}\n/*\nHACK\nTODO: use EventUi system instead of this\n*/\nfunction computeResourceEditable(eventDef, context) {\n var resourceEditable = eventDef.resourceEditable;\n if (resourceEditable == null) {\n var source = eventDef.sourceId && context.getCurrentData().eventSources[eventDef.sourceId];\n if (source) {\n resourceEditable = source.extendedProps.resourceEditable; // used the Source::extendedProps hack\n }\n if (resourceEditable == null) {\n resourceEditable = context.options.eventResourceEditable;\n if (resourceEditable == null) {\n resourceEditable = context.options.editable; // TODO: use defaults system instead\n }\n }\n }\n return resourceEditable;\n}\nfunction transformEventDrop(mutation, context) {\n var resourceMutation = mutation.resourceMutation;\n if (resourceMutation) {\n var calendarApi = context.calendarApi;\n return {\n oldResource: calendarApi.getResourceById(resourceMutation.matchResourceId),\n newResource: calendarApi.getResourceById(resourceMutation.setResourceId),\n };\n }\n return {\n oldResource: null,\n newResource: null,\n };\n}\n\nvar ResourceDataAdder = /** @class */ (function () {\n function ResourceDataAdder() {\n this.filterResources = memoize(filterResources);\n }\n ResourceDataAdder.prototype.transform = function (viewProps, calendarProps) {\n if (calendarProps.viewSpec.optionDefaults.needsResourceData) {\n return {\n resourceStore: this.filterResources(calendarProps.resourceStore, calendarProps.options.filterResourcesWithEvents, calendarProps.eventStore, calendarProps.dateProfile.activeRange),\n resourceEntityExpansions: calendarProps.resourceEntityExpansions,\n };\n }\n return null;\n };\n return ResourceDataAdder;\n}());\nfunction filterResources(resourceStore, doFilterResourcesWithEvents, eventStore, activeRange) {\n if (doFilterResourcesWithEvents) {\n var instancesInRange = filterEventInstancesInRange(eventStore.instances, activeRange);\n var hasEvents_1 = computeHasEvents(instancesInRange, eventStore.defs);\n __assign(hasEvents_1, computeAncestorHasEvents(hasEvents_1, resourceStore));\n return filterHash(resourceStore, function (resource, resourceId) { return hasEvents_1[resourceId]; });\n }\n return resourceStore;\n}\nfunction filterEventInstancesInRange(eventInstances, activeRange) {\n return filterHash(eventInstances, function (eventInstance) { return rangesIntersect(eventInstance.range, activeRange); });\n}\nfunction computeHasEvents(eventInstances, eventDefs) {\n var hasEvents = {};\n for (var instanceId in eventInstances) {\n var instance = eventInstances[instanceId];\n for (var _i = 0, _a = eventDefs[instance.defId].resourceIds; _i < _a.length; _i++) {\n var resourceId = _a[_i];\n hasEvents[resourceId] = true;\n }\n }\n return hasEvents;\n}\n/*\nmark resources as having events if any of their ancestors have them\nNOTE: resourceStore might not have all the resources that hasEvents{} has keyed\n*/\nfunction computeAncestorHasEvents(hasEvents, resourceStore) {\n var res = {};\n for (var resourceId in hasEvents) {\n var resource = void 0;\n while ((resource = resourceStore[resourceId])) {\n resourceId = resource.parentId; // now functioning as the parentId\n if (resourceId) {\n res[resourceId] = true;\n }\n else {\n break;\n }\n }\n }\n return res;\n}\n/*\nfor making sure events that have editable resources are always draggable in resource views\n*/\nfunction transformIsDraggable(val, eventDef, eventUi, context) {\n if (!val) {\n var state = context.getCurrentData();\n var viewSpec = state.viewSpecs[state.currentViewType];\n if (viewSpec.optionDefaults.needsResourceData) {\n if (computeResourceEditable(eventDef, context)) {\n return true;\n }\n }\n }\n return val;\n}\n\n// for when non-resource view should be given EventUi info (for event coloring/constraints based off of resource data)\nvar ResourceEventConfigAdder = /** @class */ (function () {\n function ResourceEventConfigAdder() {\n this.buildResourceEventUis = memoize(buildResourceEventUis, isPropsEqual);\n this.injectResourceEventUis = memoize(injectResourceEventUis);\n }\n ResourceEventConfigAdder.prototype.transform = function (viewProps, calendarProps) {\n if (!calendarProps.viewSpec.optionDefaults.needsResourceData) {\n return {\n eventUiBases: this.injectResourceEventUis(viewProps.eventUiBases, viewProps.eventStore.defs, this.buildResourceEventUis(calendarProps.resourceStore)),\n };\n }\n return null;\n };\n return ResourceEventConfigAdder;\n}());\nfunction buildResourceEventUis(resourceStore) {\n return mapHash(resourceStore, function (resource) { return resource.ui; });\n}\nfunction injectResourceEventUis(eventUiBases, eventDefs, resourceEventUis) {\n return mapHash(eventUiBases, function (eventUi, defId) {\n if (defId) { // not the '' key\n return injectResourceEventUi(eventUi, eventDefs[defId], resourceEventUis);\n }\n return eventUi;\n });\n}\nfunction injectResourceEventUi(origEventUi, eventDef, resourceEventUis) {\n var parts = [];\n // first resource takes precedence, which fights with the ordering of combineEventUis, thus the unshifts\n for (var _i = 0, _a = eventDef.resourceIds; _i < _a.length; _i++) {\n var resourceId = _a[_i];\n if (resourceEventUis[resourceId]) {\n parts.unshift(resourceEventUis[resourceId]);\n }\n }\n parts.unshift(origEventUi);\n return combineEventUis(parts);\n}\n\nvar defs = []; // TODO: use plugin system\nfunction registerResourceSourceDef(def) {\n defs.push(def);\n}\nfunction getResourceSourceDef(id) {\n return defs[id];\n}\nfunction getResourceSourceDefs() {\n return defs;\n}\n\n// TODO: make this a plugin-able parser\n// TODO: success/failure\nvar RESOURCE_SOURCE_REFINERS = {\n id: String,\n // for array. TODO: move to resource-array\n resources: identity,\n // for json feed. TODO: move to resource-json-feed\n url: String,\n method: String,\n startParam: String,\n endParam: String,\n timeZoneParam: String,\n extraParams: identity,\n};\nfunction parseResourceSource(input) {\n var inputObj;\n if (typeof input === 'string') {\n inputObj = { url: input };\n }\n else if (typeof input === 'function' || Array.isArray(input)) {\n inputObj = { resources: input };\n }\n else if (typeof input === 'object' && input) { // non-null object\n inputObj = input;\n }\n if (inputObj) {\n var _a = refineProps(inputObj, RESOURCE_SOURCE_REFINERS), refined = _a.refined, extra = _a.extra;\n warnUnknownProps(extra);\n var metaRes = buildResourceSourceMeta(refined);\n if (metaRes) {\n return {\n _raw: input,\n sourceId: guid(),\n sourceDefId: metaRes.sourceDefId,\n meta: metaRes.meta,\n publicId: refined.id || '',\n isFetching: false,\n latestFetchId: '',\n fetchRange: null,\n };\n }\n }\n return null;\n}\nfunction buildResourceSourceMeta(refined) {\n var defs = getResourceSourceDefs();\n for (var i = defs.length - 1; i >= 0; i -= 1) { // later-added plugins take precedence\n var def = defs[i];\n var meta = def.parseMeta(refined);\n if (meta) {\n return { meta: meta, sourceDefId: i };\n }\n }\n return null;\n}\nfunction warnUnknownProps(props) {\n for (var propName in props) {\n console.warn(\"Unknown resource prop '\" + propName + \"'\");\n }\n}\n\nfunction reduceResourceSource(source, action, context) {\n var options = context.options, dateProfile = context.dateProfile;\n if (!source || !action) {\n return createSource(options.initialResources || options.resources, dateProfile.activeRange, options.refetchResourcesOnNavigate, context);\n }\n switch (action.type) {\n case 'RESET_RESOURCE_SOURCE':\n return createSource(action.resourceSourceInput, dateProfile.activeRange, options.refetchResourcesOnNavigate, context);\n case 'PREV': // TODO: how do we track all actions that affect dateProfile :(\n case 'NEXT':\n case 'CHANGE_DATE':\n case 'CHANGE_VIEW_TYPE':\n return handleRangeChange(source, dateProfile.activeRange, options.refetchResourcesOnNavigate, context);\n case 'RECEIVE_RESOURCES':\n case 'RECEIVE_RESOURCE_ERROR':\n return receiveResponse(source, action.fetchId, action.fetchRange);\n case 'REFETCH_RESOURCES':\n return fetchSource(source, dateProfile.activeRange, context);\n default:\n return source;\n }\n}\nfunction createSource(input, activeRange, refetchResourcesOnNavigate, context) {\n if (input) {\n var source = parseResourceSource(input);\n source = fetchSource(source, refetchResourcesOnNavigate ? activeRange : null, context);\n return source;\n }\n return null;\n}\nfunction handleRangeChange(source, activeRange, refetchResourcesOnNavigate, context) {\n if (refetchResourcesOnNavigate &&\n !doesSourceIgnoreRange(source) &&\n (!source.fetchRange || !rangesEqual(source.fetchRange, activeRange))) {\n return fetchSource(source, activeRange, context);\n }\n return source;\n}\nfunction doesSourceIgnoreRange(source) {\n return Boolean(getResourceSourceDef(source.sourceDefId).ignoreRange);\n}\nfunction fetchSource(source, fetchRange, context) {\n var sourceDef = getResourceSourceDef(source.sourceDefId);\n var fetchId = guid();\n sourceDef.fetch({\n resourceSource: source,\n range: fetchRange,\n context: context,\n }, function (res) {\n context.dispatch({\n type: 'RECEIVE_RESOURCES',\n fetchId: fetchId,\n fetchRange: fetchRange,\n rawResources: res.rawResources,\n });\n }, function (error) {\n context.dispatch({\n type: 'RECEIVE_RESOURCE_ERROR',\n fetchId: fetchId,\n fetchRange: fetchRange,\n error: error,\n });\n });\n return __assign(__assign({}, source), { isFetching: true, latestFetchId: fetchId });\n}\nfunction receiveResponse(source, fetchId, fetchRange) {\n if (fetchId === source.latestFetchId) {\n return __assign(__assign({}, source), { isFetching: false, fetchRange: fetchRange });\n }\n return source;\n}\n\nvar PRIVATE_ID_PREFIX = '_fc:';\nvar RESOURCE_REFINERS = {\n id: String,\n parentId: String,\n children: identity,\n title: String,\n businessHours: identity,\n extendedProps: identity,\n // event-ui\n eventEditable: Boolean,\n eventStartEditable: Boolean,\n eventDurationEditable: Boolean,\n eventConstraint: identity,\n eventOverlap: Boolean,\n eventAllow: identity,\n eventClassNames: parseClassNames,\n eventBackgroundColor: String,\n eventBorderColor: String,\n eventTextColor: String,\n eventColor: String,\n};\n/*\nneeds a full store so that it can populate children too\n*/\nfunction parseResource(raw, parentId, store, context) {\n if (parentId === void 0) { parentId = ''; }\n var _a = refineProps(raw, RESOURCE_REFINERS), refined = _a.refined, extra = _a.extra;\n var resource = {\n id: refined.id || (PRIVATE_ID_PREFIX + guid()),\n parentId: refined.parentId || parentId,\n title: refined.title || '',\n businessHours: refined.businessHours ? parseBusinessHours(refined.businessHours, context) : null,\n ui: createEventUi({\n editable: refined.eventEditable,\n startEditable: refined.eventStartEditable,\n durationEditable: refined.eventDurationEditable,\n constraint: refined.eventConstraint,\n overlap: refined.eventOverlap,\n allow: refined.eventAllow,\n classNames: refined.eventClassNames,\n backgroundColor: refined.eventBackgroundColor,\n borderColor: refined.eventBorderColor,\n textColor: refined.eventTextColor,\n color: refined.eventColor,\n }, context),\n extendedProps: __assign(__assign({}, extra), refined.extendedProps),\n };\n // help out ResourceApi from having user modify props\n Object.freeze(resource.ui.classNames);\n Object.freeze(resource.extendedProps);\n if (store[resource.id]) ;\n else {\n store[resource.id] = resource;\n if (refined.children) {\n for (var _i = 0, _b = refined.children; _i < _b.length; _i++) {\n var childInput = _b[_i];\n parseResource(childInput, resource.id, store, context);\n }\n }\n }\n return resource;\n}\n/*\nTODO: use this in more places\n*/\nfunction getPublicId(id) {\n if (id.indexOf(PRIVATE_ID_PREFIX) === 0) {\n return '';\n }\n return id;\n}\n\nfunction reduceResourceStore(store, action, source, context) {\n if (!store || !action) {\n return {};\n }\n switch (action.type) {\n case 'RECEIVE_RESOURCES':\n return receiveRawResources(store, action.rawResources, action.fetchId, source, context);\n case 'ADD_RESOURCE':\n return addResource(store, action.resourceHash);\n case 'REMOVE_RESOURCE':\n return removeResource(store, action.resourceId);\n case 'SET_RESOURCE_PROP':\n return setResourceProp(store, action.resourceId, action.propName, action.propValue);\n case 'SET_RESOURCE_EXTENDED_PROP':\n return setResourceExtendedProp(store, action.resourceId, action.propName, action.propValue);\n default:\n return store;\n }\n}\nfunction receiveRawResources(existingStore, inputs, fetchId, source, context) {\n if (source.latestFetchId === fetchId) {\n var nextStore = {};\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n parseResource(input, '', nextStore, context);\n }\n return nextStore;\n }\n return existingStore;\n}\nfunction addResource(existingStore, additions) {\n // TODO: warn about duplicate IDs\n return __assign(__assign({}, existingStore), additions);\n}\nfunction removeResource(existingStore, resourceId) {\n var newStore = __assign({}, existingStore);\n delete newStore[resourceId];\n // promote children\n for (var childResourceId in newStore) { // a child, *maybe* but probably not\n if (newStore[childResourceId].parentId === resourceId) {\n newStore[childResourceId] = __assign(__assign({}, newStore[childResourceId]), { parentId: '' });\n }\n }\n return newStore;\n}\nfunction setResourceProp(existingStore, resourceId, name, value) {\n var _a, _b;\n var existingResource = existingStore[resourceId];\n // TODO: sanitization\n if (existingResource) {\n return __assign(__assign({}, existingStore), (_a = {}, _a[resourceId] = __assign(__assign({}, existingResource), (_b = {}, _b[name] = value, _b)), _a));\n }\n return existingStore;\n}\nfunction setResourceExtendedProp(existingStore, resourceId, name, value) {\n var _a, _b;\n var existingResource = existingStore[resourceId];\n if (existingResource) {\n return __assign(__assign({}, existingStore), (_a = {}, _a[resourceId] = __assign(__assign({}, existingResource), { extendedProps: __assign(__assign({}, existingResource.extendedProps), (_b = {}, _b[name] = value, _b)) }), _a));\n }\n return existingStore;\n}\n\nfunction reduceResourceEntityExpansions(expansions, action) {\n var _a;\n if (!expansions || !action) {\n return {};\n }\n switch (action.type) {\n case 'SET_RESOURCE_ENTITY_EXPANDED':\n return __assign(__assign({}, expansions), (_a = {}, _a[action.id] = action.isExpanded, _a));\n default:\n return expansions;\n }\n}\n\nfunction reduceResources(state, action, context) {\n var resourceSource = reduceResourceSource(state && state.resourceSource, action, context);\n var resourceStore = reduceResourceStore(state && state.resourceStore, action, resourceSource, context);\n var resourceEntityExpansions = reduceResourceEntityExpansions(state && state.resourceEntityExpansions, action);\n return {\n resourceSource: resourceSource,\n resourceStore: resourceStore,\n resourceEntityExpansions: resourceEntityExpansions,\n };\n}\n\nvar EVENT_REFINERS = {\n resourceId: String,\n resourceIds: identity,\n resourceEditable: Boolean,\n};\nfunction generateEventDefResourceMembers(refined) {\n return {\n resourceIds: ensureStringArray(refined.resourceIds)\n .concat(refined.resourceId ? [refined.resourceId] : []),\n resourceEditable: refined.resourceEditable,\n };\n}\nfunction ensureStringArray(items) {\n return (items || []).map(function (item) { return String(item); });\n}\n\nfunction transformDateSelectionJoin(hit0, hit1) {\n var resourceId0 = hit0.dateSpan.resourceId;\n var resourceId1 = hit1.dateSpan.resourceId;\n if (resourceId0 && resourceId1) {\n return { resourceId: resourceId0 };\n }\n return null;\n}\n\nvar ResourceApi = /** @class */ (function () {\n function ResourceApi(_context, _resource) {\n this._context = _context;\n this._resource = _resource;\n }\n ResourceApi.prototype.setProp = function (name, value) {\n var oldResource = this._resource;\n this._context.dispatch({\n type: 'SET_RESOURCE_PROP',\n resourceId: oldResource.id,\n propName: name,\n propValue: value,\n });\n this.sync(oldResource);\n };\n ResourceApi.prototype.setExtendedProp = function (name, value) {\n var oldResource = this._resource;\n this._context.dispatch({\n type: 'SET_RESOURCE_EXTENDED_PROP',\n resourceId: oldResource.id,\n propName: name,\n propValue: value,\n });\n this.sync(oldResource);\n };\n ResourceApi.prototype.sync = function (oldResource) {\n var context = this._context;\n var resourceId = oldResource.id;\n // TODO: what if dispatch didn't complete synchronously?\n this._resource = context.getCurrentData().resourceStore[resourceId];\n context.emitter.trigger('resourceChange', {\n oldResource: new ResourceApi(context, oldResource),\n resource: this,\n revert: function () {\n var _a;\n context.dispatch({\n type: 'ADD_RESOURCE',\n resourceHash: (_a = {},\n _a[resourceId] = oldResource,\n _a),\n });\n },\n });\n };\n ResourceApi.prototype.remove = function () {\n var context = this._context;\n var internalResource = this._resource;\n var resourceId = internalResource.id;\n context.dispatch({\n type: 'REMOVE_RESOURCE',\n resourceId: resourceId,\n });\n context.emitter.trigger('resourceRemove', {\n resource: this,\n revert: function () {\n var _a;\n context.dispatch({\n type: 'ADD_RESOURCE',\n resourceHash: (_a = {},\n _a[resourceId] = internalResource,\n _a),\n });\n },\n });\n };\n ResourceApi.prototype.getParent = function () {\n var context = this._context;\n var parentId = this._resource.parentId;\n if (parentId) {\n return new ResourceApi(context, context.getCurrentData().resourceSource[parentId]);\n }\n return null;\n };\n ResourceApi.prototype.getChildren = function () {\n var thisResourceId = this._resource.id;\n var context = this._context;\n var resourceStore = context.getCurrentData().resourceStore;\n var childApis = [];\n for (var resourceId in resourceStore) {\n if (resourceStore[resourceId].parentId === thisResourceId) {\n childApis.push(new ResourceApi(context, resourceStore[resourceId]));\n }\n }\n return childApis;\n };\n /*\n this is really inefficient!\n TODO: make EventApi::resourceIds a hash or keep an index in the Calendar's state\n */\n ResourceApi.prototype.getEvents = function () {\n var thisResourceId = this._resource.id;\n var context = this._context;\n var _a = context.getCurrentData().eventStore, defs = _a.defs, instances = _a.instances;\n var eventApis = [];\n for (var instanceId in instances) {\n var instance = instances[instanceId];\n var def = defs[instance.defId];\n if (def.resourceIds.indexOf(thisResourceId) !== -1) { // inefficient!!!\n eventApis.push(new EventApi(context, def, instance));\n }\n }\n return eventApis;\n };\n Object.defineProperty(ResourceApi.prototype, \"id\", {\n get: function () { return getPublicId(this._resource.id); },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"title\", {\n get: function () { return this._resource.title; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"eventConstraint\", {\n get: function () { return this._resource.ui.constraints[0] || null; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"eventOverlap\", {\n get: function () { return this._resource.ui.overlap; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"eventAllow\", {\n get: function () { return this._resource.ui.allows[0] || null; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"eventBackgroundColor\", {\n get: function () { return this._resource.ui.backgroundColor; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"eventBorderColor\", {\n get: function () { return this._resource.ui.borderColor; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"eventTextColor\", {\n get: function () { return this._resource.ui.textColor; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"eventClassNames\", {\n // NOTE: user can't modify these because Object.freeze was called in event-def parsing\n get: function () { return this._resource.ui.classNames; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ResourceApi.prototype, \"extendedProps\", {\n get: function () { return this._resource.extendedProps; },\n enumerable: false,\n configurable: true\n });\n ResourceApi.prototype.toPlainObject = function (settings) {\n if (settings === void 0) { settings = {}; }\n var internal = this._resource;\n var ui = internal.ui;\n var publicId = this.id;\n var res = {};\n if (publicId) {\n res.id = publicId;\n }\n if (internal.title) {\n res.title = internal.title;\n }\n if (settings.collapseEventColor && ui.backgroundColor && ui.backgroundColor === ui.borderColor) {\n res.eventColor = ui.backgroundColor;\n }\n else {\n if (ui.backgroundColor) {\n res.eventBackgroundColor = ui.backgroundColor;\n }\n if (ui.borderColor) {\n res.eventBorderColor = ui.borderColor;\n }\n }\n if (ui.textColor) {\n res.eventTextColor = ui.textColor;\n }\n if (ui.classNames.length) {\n res.eventClassNames = ui.classNames;\n }\n if (Object.keys(internal.extendedProps).length) {\n if (settings.collapseExtendedProps) {\n __assign(res, internal.extendedProps);\n }\n else {\n res.extendedProps = internal.extendedProps;\n }\n }\n return res;\n };\n ResourceApi.prototype.toJSON = function () {\n return this.toPlainObject();\n };\n return ResourceApi;\n}());\nfunction buildResourceApis(resourceStore, context) {\n var resourceApis = [];\n for (var resourceId in resourceStore) {\n resourceApis.push(new ResourceApi(context, resourceStore[resourceId]));\n }\n return resourceApis;\n}\n\nCalendarApi.prototype.addResource = function (input, scrollTo) {\n var _a;\n var _this = this;\n if (scrollTo === void 0) { scrollTo = true; }\n var currentState = this.getCurrentData();\n var resourceHash;\n var resource;\n if (input instanceof ResourceApi) {\n resource = input._resource;\n resourceHash = (_a = {}, _a[resource.id] = resource, _a);\n }\n else {\n resourceHash = {};\n resource = parseResource(input, '', resourceHash, currentState);\n }\n this.dispatch({\n type: 'ADD_RESOURCE',\n resourceHash: resourceHash,\n });\n if (scrollTo) {\n // TODO: wait til dispatch completes somehow\n this.trigger('_scrollRequest', { resourceId: resource.id });\n }\n var resourceApi = new ResourceApi(currentState, resource);\n currentState.emitter.trigger('resourceAdd', {\n resource: resourceApi,\n revert: function () {\n _this.dispatch({\n type: 'REMOVE_RESOURCE',\n resourceId: resource.id,\n });\n },\n });\n return resourceApi;\n};\nCalendarApi.prototype.getResourceById = function (id) {\n id = String(id);\n var currentState = this.getCurrentData(); // eslint-disable-line react/no-this-in-sfc\n if (currentState.resourceStore) { // guard against calendar with no resource functionality\n var rawResource = currentState.resourceStore[id];\n if (rawResource) {\n return new ResourceApi(currentState, rawResource);\n }\n }\n return null;\n};\nCalendarApi.prototype.getResources = function () {\n var currentState = this.getCurrentData();\n var resourceStore = currentState.resourceStore;\n var resourceApis = [];\n if (resourceStore) { // guard against calendar with no resource functionality\n for (var resourceId in resourceStore) {\n resourceApis.push(new ResourceApi(currentState, resourceStore[resourceId]));\n }\n }\n return resourceApis;\n};\nCalendarApi.prototype.getTopLevelResources = function () {\n var currentState = this.getCurrentData();\n var resourceStore = currentState.resourceStore;\n var resourceApis = [];\n if (resourceStore) { // guard against calendar with no resource functionality\n for (var resourceId in resourceStore) {\n if (!resourceStore[resourceId].parentId) {\n resourceApis.push(new ResourceApi(currentState, resourceStore[resourceId]));\n }\n }\n }\n return resourceApis;\n};\nCalendarApi.prototype.refetchResources = function () {\n this.dispatch({\n type: 'REFETCH_RESOURCES',\n });\n};\nfunction transformDatePoint(dateSpan, context) {\n return dateSpan.resourceId ?\n { resource: context.calendarApi.getResourceById(dateSpan.resourceId) } :\n {};\n}\nfunction transformDateSpan(dateSpan, context) {\n return dateSpan.resourceId ?\n { resource: context.calendarApi.getResourceById(dateSpan.resourceId) } :\n {};\n}\n\n/*\nsplits things BASED OFF OF which resources they are associated with.\ncreates a '' entry which is when something has NO resource.\n*/\nvar ResourceSplitter = /** @class */ (function (_super) {\n __extends(ResourceSplitter, _super);\n function ResourceSplitter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ResourceSplitter.prototype.getKeyInfo = function (props) {\n return __assign({ '': {} }, props.resourceStore);\n };\n ResourceSplitter.prototype.getKeysForDateSpan = function (dateSpan) {\n return [dateSpan.resourceId || ''];\n };\n ResourceSplitter.prototype.getKeysForEventDef = function (eventDef) {\n var resourceIds = eventDef.resourceIds;\n if (!resourceIds.length) {\n return [''];\n }\n return resourceIds;\n };\n return ResourceSplitter;\n}(Splitter));\n\nfunction isPropsValidWithResources(combinedProps, context) {\n var splitter = new ResourceSplitter();\n var sets = splitter.splitProps(__assign(__assign({}, combinedProps), { resourceStore: context.getCurrentData().resourceStore }));\n for (var resourceId in sets) {\n var props = sets[resourceId];\n // merge in event data from the non-resource segment\n if (resourceId && sets['']) { // current segment is not the non-resource one, and there IS a non-resource one\n props = __assign(__assign({}, props), { eventStore: mergeEventStores(sets[''].eventStore, props.eventStore), eventUiBases: __assign(__assign({}, sets[''].eventUiBases), props.eventUiBases) });\n }\n if (!isPropsValid(props, context, { resourceId: resourceId }, filterConfig.bind(null, resourceId))) {\n return false;\n }\n }\n return true;\n}\nfunction filterConfig(resourceId, config) {\n return __assign(__assign({}, config), { constraints: filterConstraints(resourceId, config.constraints) });\n}\nfunction filterConstraints(resourceId, constraints) {\n return constraints.map(function (constraint) {\n var defs = constraint.defs;\n if (defs) { // we are dealing with an EventStore\n // if any of the events define constraints to resources that are NOT this resource,\n // then this resource is unconditionally prohibited, which is what a `false` value does.\n for (var defId in defs) {\n var resourceIds = defs[defId].resourceIds;\n if (resourceIds.length && resourceIds.indexOf(resourceId) === -1) { // TODO: use a hash?!!! (for other reasons too)\n return false;\n }\n }\n }\n return constraint;\n });\n}\n\nfunction transformExternalDef(dateSpan) {\n return dateSpan.resourceId ?\n { resourceId: dateSpan.resourceId } :\n {};\n}\n\nEventApi.prototype.getResources = function () {\n var calendarApi = this._context.calendarApi;\n return this._def.resourceIds.map(function (resourceId) { return calendarApi.getResourceById(resourceId); });\n};\nEventApi.prototype.setResources = function (resources) {\n var resourceIds = [];\n // massage resources -> resourceIds\n for (var _i = 0, resources_1 = resources; _i < resources_1.length; _i++) {\n var resource = resources_1[_i];\n var resourceId = null;\n if (typeof resource === 'string') {\n resourceId = resource;\n }\n else if (typeof resource === 'number') {\n resourceId = String(resource);\n }\n else if (resource instanceof ResourceApi) {\n resourceId = resource.id; // guaranteed to always have an ID. hmmm\n }\n else {\n console.warn('unknown resource type: ' + resource);\n }\n if (resourceId) {\n resourceIds.push(resourceId);\n }\n }\n this.mutate({\n standardProps: {\n resourceIds: resourceIds,\n },\n });\n};\n\nvar optionChangeHandlers = {\n resources: handleResources,\n};\nfunction handleResources(newSourceInput, context) {\n var oldSourceInput = context.getCurrentData().resourceSource._raw;\n if (oldSourceInput !== newSourceInput) {\n context.dispatch({\n type: 'RESET_RESOURCE_SOURCE',\n resourceSourceInput: newSourceInput,\n });\n }\n}\n\nvar DEFAULT_RESOURCE_ORDER = parseFieldSpecs('id,title');\nfunction handleResourceStore(resourceStore, calendarData) {\n var emitter = calendarData.emitter;\n if (emitter.hasHandlers('resourcesSet')) {\n emitter.trigger('resourcesSet', buildResourceApis(resourceStore, calendarData));\n }\n}\n\nvar OPTION_REFINERS = {\n initialResources: identity,\n resources: identity,\n eventResourceEditable: Boolean,\n refetchResourcesOnNavigate: Boolean,\n resourceOrder: parseFieldSpecs,\n filterResourcesWithEvents: Boolean,\n resourceGroupField: String,\n resourceAreaWidth: identity,\n resourceAreaColumns: identity,\n resourcesInitiallyExpanded: Boolean,\n datesAboveResources: Boolean,\n needsResourceData: Boolean,\n resourceAreaHeaderClassNames: identity,\n resourceAreaHeaderContent: identity,\n resourceAreaHeaderDidMount: identity,\n resourceAreaHeaderWillUnmount: identity,\n resourceGroupLabelClassNames: identity,\n resourceGroupLabelContent: identity,\n resourceGroupLabelDidMount: identity,\n resourceGroupLabelWillUnmount: identity,\n resourceLabelClassNames: identity,\n resourceLabelContent: identity,\n resourceLabelDidMount: identity,\n resourceLabelWillUnmount: identity,\n resourceLaneClassNames: identity,\n resourceLaneContent: identity,\n resourceLaneDidMount: identity,\n resourceLaneWillUnmount: identity,\n resourceGroupLaneClassNames: identity,\n resourceGroupLaneContent: identity,\n resourceGroupLaneDidMount: identity,\n resourceGroupLaneWillUnmount: identity,\n};\nvar LISTENER_REFINERS = {\n resourcesSet: identity,\n resourceAdd: identity,\n resourceChange: identity,\n resourceRemove: identity,\n};\n\nregisterResourceSourceDef({\n ignoreRange: true,\n parseMeta: function (refined) {\n if (Array.isArray(refined.resources)) {\n return refined.resources;\n }\n return null;\n },\n fetch: function (arg, successCallback) {\n successCallback({\n rawResources: arg.resourceSource.meta,\n });\n },\n});\n\nregisterResourceSourceDef({\n parseMeta: function (refined) {\n if (typeof refined.resources === 'function') {\n return refined.resources;\n }\n return null;\n },\n fetch: function (arg, success, failure) {\n var dateEnv = arg.context.dateEnv;\n var func = arg.resourceSource.meta;\n var publicArg = arg.range ? {\n start: dateEnv.toDate(arg.range.start),\n end: dateEnv.toDate(arg.range.end),\n startStr: dateEnv.formatIso(arg.range.start),\n endStr: dateEnv.formatIso(arg.range.end),\n timeZone: dateEnv.timeZone,\n } : {};\n // TODO: make more dry with EventSourceFunc\n // TODO: accept a response?\n unpromisify(func.bind(null, publicArg), function (rawResources) {\n success({ rawResources: rawResources }); // needs an object response\n }, failure);\n },\n});\n\nregisterResourceSourceDef({\n parseMeta: function (refined) {\n if (refined.url) {\n return {\n url: refined.url,\n method: (refined.method || 'GET').toUpperCase(),\n extraParams: refined.extraParams,\n };\n }\n return null;\n },\n fetch: function (arg, successCallback, failureCallback) {\n var meta = arg.resourceSource.meta;\n var requestParams = buildRequestParams(meta, arg.range, arg.context);\n requestJson(meta.method, meta.url, requestParams, function (rawResources, xhr) {\n successCallback({ rawResources: rawResources, xhr: xhr });\n }, function (message, xhr) {\n failureCallback({ message: message, xhr: xhr });\n });\n },\n});\n// TODO: somehow consolidate with event json feed\nfunction buildRequestParams(meta, range, context) {\n var dateEnv = context.dateEnv, options = context.options;\n var startParam;\n var endParam;\n var timeZoneParam;\n var customRequestParams;\n var params = {};\n if (range) {\n startParam = meta.startParam;\n if (startParam == null) {\n startParam = options.startParam;\n }\n endParam = meta.endParam;\n if (endParam == null) {\n endParam = options.endParam;\n }\n timeZoneParam = meta.timeZoneParam;\n if (timeZoneParam == null) {\n timeZoneParam = options.timeZoneParam;\n }\n params[startParam] = dateEnv.formatIso(range.start);\n params[endParam] = dateEnv.formatIso(range.end);\n if (dateEnv.timeZone !== 'local') {\n params[timeZoneParam] = dateEnv.timeZone;\n }\n }\n // retrieve any outbound GET/POST data from the options\n if (typeof meta.extraParams === 'function') {\n // supplied as a function that returns a key/value object\n customRequestParams = meta.extraParams();\n }\n else {\n // probably supplied as a straight key/value object\n customRequestParams = meta.extraParams || {};\n }\n __assign(params, customRequestParams);\n return params;\n}\n\n// TODO: not used for Spreadsheet. START USING. difficult because of col-specific rendering props\nfunction ResourceLabelRoot(props) {\n return (createElement(ViewContextType.Consumer, null, function (context) {\n var options = context.options;\n var hookProps = {\n resource: new ResourceApi(context, props.resource),\n date: props.date ? context.dateEnv.toDate(props.date) : null,\n view: context.viewApi,\n };\n var dataAttrs = {\n 'data-resource-id': props.resource.id,\n 'data-date': props.date ? formatDayString(props.date) : undefined,\n };\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.resourceLabelClassNames, content: options.resourceLabelContent, defaultContent: renderInnerContent, didMount: options.resourceLabelDidMount, willUnmount: options.resourceLabelWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return props.children(rootElRef, classNames, // TODO: pass in 'fc-resource' ?\n dataAttrs, innerElRef, innerContent); }));\n }));\n}\nfunction renderInnerContent(props) {\n return props.resource.title || props.resource.id;\n}\n\nvar ResourceCell = /** @class */ (function (_super) {\n __extends(ResourceCell, _super);\n function ResourceCell() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ResourceCell.prototype.render = function () {\n var props = this.props;\n return (createElement(ResourceLabelRoot, { resource: props.resource, date: props.date }, function (elRef, customClassNames, dataAttrs, innerElRef, innerContent) { return (createElement(\"th\", __assign({ ref: elRef, role: \"columnheader\", className: ['fc-col-header-cell', 'fc-resource'].concat(customClassNames).join(' '), colSpan: props.colSpan }, dataAttrs),\n createElement(\"div\", { className: \"fc-scrollgrid-sync-inner\" },\n createElement(\"span\", { className: [\n 'fc-col-header-cell-cushion',\n props.isSticky ? 'fc-sticky' : '',\n ].join(' '), ref: innerElRef }, innerContent)))); }));\n };\n return ResourceCell;\n}(BaseComponent));\n\nvar ResourceDayHeader = /** @class */ (function (_super) {\n __extends(ResourceDayHeader, _super);\n function ResourceDayHeader() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDateFormat = memoize(buildDateFormat);\n return _this;\n }\n ResourceDayHeader.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var dateFormat = this.buildDateFormat(context.options.dayHeaderFormat, props.datesRepDistinctDays, props.dates.length);\n return (createElement(NowTimer, { unit: \"day\" }, function (nowDate, todayRange) {\n if (props.dates.length === 1) {\n return _this.renderResourceRow(props.resources, props.dates[0]);\n }\n if (context.options.datesAboveResources) {\n return _this.renderDayAndResourceRows(props.dates, dateFormat, todayRange, props.resources);\n }\n return _this.renderResourceAndDayRows(props.resources, props.dates, dateFormat, todayRange);\n }));\n };\n ResourceDayHeader.prototype.renderResourceRow = function (resources, date) {\n var resourceCells = resources.map(function (resource) { return (createElement(ResourceCell, { key: resource.id, resource: resource, colSpan: 1, date: date })); });\n return this.buildTr(resourceCells, 'resources');\n };\n ResourceDayHeader.prototype.renderDayAndResourceRows = function (dates, dateFormat, todayRange, resources) {\n var dateCells = [];\n var resourceCells = [];\n for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {\n var date = dates_1[_i];\n dateCells.push(this.renderDateCell(date, dateFormat, todayRange, resources.length, null, true));\n for (var _a = 0, resources_1 = resources; _a < resources_1.length; _a++) {\n var resource = resources_1[_a];\n resourceCells.push(createElement(ResourceCell, { key: resource.id + ':' + date.toISOString(), resource: resource, colSpan: 1, date: date }));\n }\n }\n return (createElement(Fragment, null,\n this.buildTr(dateCells, 'day'),\n this.buildTr(resourceCells, 'resources')));\n };\n ResourceDayHeader.prototype.renderResourceAndDayRows = function (resources, dates, dateFormat, todayRange) {\n var resourceCells = [];\n var dateCells = [];\n for (var _i = 0, resources_2 = resources; _i < resources_2.length; _i++) {\n var resource = resources_2[_i];\n resourceCells.push(createElement(ResourceCell, { key: resource.id, resource: resource, colSpan: dates.length, isSticky: true }));\n for (var _a = 0, dates_2 = dates; _a < dates_2.length; _a++) {\n var date = dates_2[_a];\n dateCells.push(this.renderDateCell(date, dateFormat, todayRange, 1, resource));\n }\n }\n return (createElement(Fragment, null,\n this.buildTr(resourceCells, 'resources'),\n this.buildTr(dateCells, 'day')));\n };\n // a cell with date text. might have a resource associated with it\n ResourceDayHeader.prototype.renderDateCell = function (date, dateFormat, todayRange, colSpan, resource, isSticky) {\n var props = this.props;\n var keyPostfix = resource ? \":\" + resource.id : '';\n var extraHookProps = resource ? { resource: new ResourceApi(this.context, resource) } : {};\n var extraDataAttrs = resource ? { 'data-resource-id': resource.id } : {};\n return props.datesRepDistinctDays ? (createElement(TableDateCell, { key: date.toISOString() + keyPostfix, date: date, dateProfile: props.dateProfile, todayRange: todayRange, colCnt: props.dates.length * props.resources.length, dayHeaderFormat: dateFormat, colSpan: colSpan, isSticky: isSticky, extraHookProps: extraHookProps, extraDataAttrs: extraDataAttrs })) : (createElement(TableDowCell // we can't leverage the pure-componentness becausae the extra* props are new every time :(\n , { key: date.getUTCDay() + keyPostfix, dow: date.getUTCDay(), dayHeaderFormat: dateFormat, colSpan: colSpan, isSticky: isSticky, extraHookProps: extraHookProps, extraDataAttrs: extraDataAttrs }));\n };\n ResourceDayHeader.prototype.buildTr = function (cells, key) {\n var renderIntro = this.props.renderIntro;\n if (!cells.length) {\n cells = [createElement(\"td\", { key: 0 }, \"\\u00A0\")];\n }\n return (createElement(\"tr\", { key: key, role: \"row\" },\n renderIntro && renderIntro(key),\n cells));\n };\n return ResourceDayHeader;\n}(BaseComponent));\nfunction buildDateFormat(dayHeaderFormat, datesRepDistinctDays, dayCnt) {\n return dayHeaderFormat || computeFallbackHeaderFormat(datesRepDistinctDays, dayCnt);\n}\n\nvar ResourceIndex = /** @class */ (function () {\n function ResourceIndex(resources) {\n var indicesById = {};\n var ids = [];\n for (var i = 0; i < resources.length; i += 1) {\n var id = resources[i].id;\n ids.push(id);\n indicesById[id] = i;\n }\n this.ids = ids;\n this.indicesById = indicesById;\n this.length = resources.length;\n }\n return ResourceIndex;\n}());\n\nvar AbstractResourceDayTableModel = /** @class */ (function () {\n function AbstractResourceDayTableModel(dayTableModel, resources, context) {\n this.dayTableModel = dayTableModel;\n this.resources = resources;\n this.context = context;\n this.resourceIndex = new ResourceIndex(resources);\n this.rowCnt = dayTableModel.rowCnt;\n this.colCnt = dayTableModel.colCnt * resources.length;\n this.cells = this.buildCells();\n }\n AbstractResourceDayTableModel.prototype.buildCells = function () {\n var _a = this, rowCnt = _a.rowCnt, dayTableModel = _a.dayTableModel, resources = _a.resources;\n var rows = [];\n for (var row = 0; row < rowCnt; row += 1) {\n var rowCells = [];\n for (var dateCol = 0; dateCol < dayTableModel.colCnt; dateCol += 1) {\n for (var resourceCol = 0; resourceCol < resources.length; resourceCol += 1) {\n var resource = resources[resourceCol];\n var extraHookProps = { resource: new ResourceApi(this.context, resource) };\n var extraDataAttrs = { 'data-resource-id': resource.id };\n var extraClassNames = ['fc-resource'];\n var extraDateSpan = { resourceId: resource.id };\n var date = dayTableModel.cells[row][dateCol].date;\n rowCells[this.computeCol(dateCol, resourceCol)] = {\n key: resource.id + ':' + date.toISOString(),\n date: date,\n extraHookProps: extraHookProps,\n extraDataAttrs: extraDataAttrs,\n extraClassNames: extraClassNames,\n extraDateSpan: extraDateSpan,\n };\n }\n }\n rows.push(rowCells);\n }\n return rows;\n };\n return AbstractResourceDayTableModel;\n}());\n\n/*\nresources over dates\n*/\nvar ResourceDayTableModel = /** @class */ (function (_super) {\n __extends(ResourceDayTableModel, _super);\n function ResourceDayTableModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ResourceDayTableModel.prototype.computeCol = function (dateI, resourceI) {\n return resourceI * this.dayTableModel.colCnt + dateI;\n };\n /*\n all date ranges are intact\n */\n ResourceDayTableModel.prototype.computeColRanges = function (dateStartI, dateEndI, resourceI) {\n return [\n {\n firstCol: this.computeCol(dateStartI, resourceI),\n lastCol: this.computeCol(dateEndI, resourceI),\n isStart: true,\n isEnd: true,\n },\n ];\n };\n return ResourceDayTableModel;\n}(AbstractResourceDayTableModel));\n\n/*\ndates over resources\n*/\nvar DayResourceTableModel = /** @class */ (function (_super) {\n __extends(DayResourceTableModel, _super);\n function DayResourceTableModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayResourceTableModel.prototype.computeCol = function (dateI, resourceI) {\n return dateI * this.resources.length + resourceI;\n };\n /*\n every single day is broken up\n */\n DayResourceTableModel.prototype.computeColRanges = function (dateStartI, dateEndI, resourceI) {\n var segs = [];\n for (var i = dateStartI; i <= dateEndI; i += 1) {\n var col = this.computeCol(i, resourceI);\n segs.push({\n firstCol: col,\n lastCol: col,\n isStart: i === dateStartI,\n isEnd: i === dateEndI,\n });\n }\n return segs;\n };\n return DayResourceTableModel;\n}(AbstractResourceDayTableModel));\n\nvar NO_SEGS = []; // for memoizing\nvar VResourceJoiner = /** @class */ (function () {\n function VResourceJoiner() {\n this.joinDateSelection = memoize(this.joinSegs);\n this.joinBusinessHours = memoize(this.joinSegs);\n this.joinFgEvents = memoize(this.joinSegs);\n this.joinBgEvents = memoize(this.joinSegs);\n this.joinEventDrags = memoize(this.joinInteractions);\n this.joinEventResizes = memoize(this.joinInteractions);\n }\n /*\n propSets also has a '' key for things with no resource\n */\n VResourceJoiner.prototype.joinProps = function (propSets, resourceDayTable) {\n var dateSelectionSets = [];\n var businessHoursSets = [];\n var fgEventSets = [];\n var bgEventSets = [];\n var eventDrags = [];\n var eventResizes = [];\n var eventSelection = '';\n var keys = resourceDayTable.resourceIndex.ids.concat(['']); // add in the all-resource key\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n var props = propSets[key];\n dateSelectionSets.push(props.dateSelectionSegs);\n businessHoursSets.push(key ? props.businessHourSegs : NO_SEGS); // don't include redundant all-resource businesshours\n fgEventSets.push(key ? props.fgEventSegs : NO_SEGS); // don't include fg all-resource segs\n bgEventSets.push(props.bgEventSegs);\n eventDrags.push(props.eventDrag);\n eventResizes.push(props.eventResize);\n eventSelection = eventSelection || props.eventSelection;\n }\n return {\n dateSelectionSegs: this.joinDateSelection.apply(this, __spreadArray([resourceDayTable], dateSelectionSets)),\n businessHourSegs: this.joinBusinessHours.apply(this, __spreadArray([resourceDayTable], businessHoursSets)),\n fgEventSegs: this.joinFgEvents.apply(this, __spreadArray([resourceDayTable], fgEventSets)),\n bgEventSegs: this.joinBgEvents.apply(this, __spreadArray([resourceDayTable], bgEventSets)),\n eventDrag: this.joinEventDrags.apply(this, __spreadArray([resourceDayTable], eventDrags)),\n eventResize: this.joinEventResizes.apply(this, __spreadArray([resourceDayTable], eventResizes)),\n eventSelection: eventSelection,\n };\n };\n VResourceJoiner.prototype.joinSegs = function (resourceDayTable) {\n var segGroups = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n segGroups[_i - 1] = arguments[_i];\n }\n var resourceCnt = resourceDayTable.resources.length;\n var transformedSegs = [];\n for (var i = 0; i < resourceCnt; i += 1) {\n for (var _a = 0, _b = segGroups[i]; _a < _b.length; _a++) {\n var seg = _b[_a];\n transformedSegs.push.apply(transformedSegs, this.transformSeg(seg, resourceDayTable, i));\n }\n for (var _c = 0, _d = segGroups[resourceCnt]; _c < _d.length; _c++) { // one beyond. the all-resource\n var seg = _d[_c];\n transformedSegs.push.apply(// one beyond. the all-resource\n transformedSegs, this.transformSeg(seg, resourceDayTable, i));\n }\n }\n return transformedSegs;\n };\n /*\n for expanding non-resource segs to all resources.\n only for public use.\n no memoizing.\n */\n VResourceJoiner.prototype.expandSegs = function (resourceDayTable, segs) {\n var resourceCnt = resourceDayTable.resources.length;\n var transformedSegs = [];\n for (var i = 0; i < resourceCnt; i += 1) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n transformedSegs.push.apply(transformedSegs, this.transformSeg(seg, resourceDayTable, i));\n }\n }\n return transformedSegs;\n };\n VResourceJoiner.prototype.joinInteractions = function (resourceDayTable) {\n var interactions = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n interactions[_i - 1] = arguments[_i];\n }\n var resourceCnt = resourceDayTable.resources.length;\n var affectedInstances = {};\n var transformedSegs = [];\n var anyInteractions = false;\n var isEvent = false;\n for (var i = 0; i < resourceCnt; i += 1) {\n var interaction = interactions[i];\n if (interaction) {\n anyInteractions = true;\n for (var _a = 0, _b = interaction.segs; _a < _b.length; _a++) {\n var seg = _b[_a];\n transformedSegs.push.apply(transformedSegs, this.transformSeg(seg, resourceDayTable, i));\n }\n __assign(affectedInstances, interaction.affectedInstances);\n isEvent = isEvent || interaction.isEvent;\n }\n if (interactions[resourceCnt]) { // one beyond. the all-resource\n for (var _c = 0, _d = interactions[resourceCnt].segs; _c < _d.length; _c++) {\n var seg = _d[_c];\n transformedSegs.push.apply(transformedSegs, this.transformSeg(seg, resourceDayTable, i));\n }\n }\n }\n if (anyInteractions) {\n return {\n affectedInstances: affectedInstances,\n segs: transformedSegs,\n isEvent: isEvent,\n };\n }\n return null;\n };\n return VResourceJoiner;\n}());\n\n/*\nTODO: just use ResourceHash somehow? could then use the generic ResourceSplitter\n*/\nvar VResourceSplitter = /** @class */ (function (_super) {\n __extends(VResourceSplitter, _super);\n function VResourceSplitter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n VResourceSplitter.prototype.getKeyInfo = function (props) {\n var resourceDayTableModel = props.resourceDayTableModel;\n var hash = mapHash(resourceDayTableModel.resourceIndex.indicesById, function (i) { return resourceDayTableModel.resources[i]; }); // :(\n hash[''] = {};\n return hash;\n };\n VResourceSplitter.prototype.getKeysForDateSpan = function (dateSpan) {\n return [dateSpan.resourceId || ''];\n };\n VResourceSplitter.prototype.getKeysForEventDef = function (eventDef) {\n var resourceIds = eventDef.resourceIds;\n if (!resourceIds.length) {\n return [''];\n }\n return resourceIds;\n };\n return VResourceSplitter;\n}(Splitter));\n\n/*\ndoesn't accept grouping\n*/\nfunction flattenResources(resourceStore, orderSpecs) {\n return buildRowNodes(resourceStore, [], orderSpecs, false, {}, true)\n .map(function (node) { return node.resource; });\n}\nfunction buildRowNodes(resourceStore, groupSpecs, orderSpecs, isVGrouping, expansions, expansionDefault) {\n var complexNodes = buildHierarchy(resourceStore, isVGrouping ? -1 : 1, groupSpecs, orderSpecs);\n var flatNodes = [];\n flattenNodes(complexNodes, flatNodes, isVGrouping, [], 0, expansions, expansionDefault);\n return flatNodes;\n}\nfunction flattenNodes(complexNodes, res, isVGrouping, rowSpans, depth, expansions, expansionDefault) {\n for (var i = 0; i < complexNodes.length; i += 1) {\n var complexNode = complexNodes[i];\n var group = complexNode.group;\n if (group) {\n if (isVGrouping) {\n var firstRowIndex = res.length;\n var rowSpanIndex = rowSpans.length;\n flattenNodes(complexNode.children, res, isVGrouping, rowSpans.concat(0), depth, expansions, expansionDefault);\n if (firstRowIndex < res.length) {\n var firstRow = res[firstRowIndex];\n var firstRowSpans = firstRow.rowSpans = firstRow.rowSpans.slice();\n firstRowSpans[rowSpanIndex] = res.length - firstRowIndex;\n }\n }\n else {\n var id = group.spec.field + ':' + group.value;\n var isExpanded = expansions[id] != null ? expansions[id] : expansionDefault;\n res.push({ id: id, group: group, isExpanded: isExpanded });\n if (isExpanded) {\n flattenNodes(complexNode.children, res, isVGrouping, rowSpans, depth + 1, expansions, expansionDefault);\n }\n }\n }\n else if (complexNode.resource) {\n var id = complexNode.resource.id;\n var isExpanded = expansions[id] != null ? expansions[id] : expansionDefault;\n res.push({\n id: id,\n rowSpans: rowSpans,\n depth: depth,\n isExpanded: isExpanded,\n hasChildren: Boolean(complexNode.children.length),\n resource: complexNode.resource,\n resourceFields: complexNode.resourceFields,\n });\n if (isExpanded) {\n flattenNodes(complexNode.children, res, isVGrouping, rowSpans, depth + 1, expansions, expansionDefault);\n }\n }\n }\n}\nfunction buildHierarchy(resourceStore, maxDepth, groupSpecs, orderSpecs) {\n var resourceNodes = buildResourceNodes(resourceStore, orderSpecs);\n var builtNodes = [];\n for (var resourceId in resourceNodes) {\n var resourceNode = resourceNodes[resourceId];\n if (!resourceNode.resource.parentId) {\n insertResourceNode(resourceNode, builtNodes, groupSpecs, 0, maxDepth, orderSpecs);\n }\n }\n return builtNodes;\n}\nfunction buildResourceNodes(resourceStore, orderSpecs) {\n var nodeHash = {};\n for (var resourceId in resourceStore) {\n var resource = resourceStore[resourceId];\n nodeHash[resourceId] = {\n resource: resource,\n resourceFields: buildResourceFields(resource),\n children: [],\n };\n }\n for (var resourceId in resourceStore) {\n var resource = resourceStore[resourceId];\n if (resource.parentId) {\n var parentNode = nodeHash[resource.parentId];\n if (parentNode) {\n insertResourceNodeInSiblings(nodeHash[resourceId], parentNode.children, orderSpecs);\n }\n }\n }\n return nodeHash;\n}\nfunction insertResourceNode(resourceNode, nodes, groupSpecs, depth, maxDepth, orderSpecs) {\n if (groupSpecs.length && (maxDepth === -1 || depth <= maxDepth)) {\n var groupNode = ensureGroupNodes(resourceNode, nodes, groupSpecs[0]);\n insertResourceNode(resourceNode, groupNode.children, groupSpecs.slice(1), depth + 1, maxDepth, orderSpecs);\n }\n else {\n insertResourceNodeInSiblings(resourceNode, nodes, orderSpecs);\n }\n}\nfunction ensureGroupNodes(resourceNode, nodes, groupSpec) {\n var groupValue = resourceNode.resourceFields[groupSpec.field];\n var groupNode;\n var newGroupIndex;\n // find an existing group that matches, or determine the position for a new group\n if (groupSpec.order) {\n for (newGroupIndex = 0; newGroupIndex < nodes.length; newGroupIndex += 1) {\n var node = nodes[newGroupIndex];\n if (node.group) {\n var cmp = flexibleCompare(groupValue, node.group.value) * groupSpec.order;\n if (cmp === 0) {\n groupNode = node;\n break;\n }\n else if (cmp < 0) {\n break;\n }\n }\n }\n }\n else { // the groups are unordered\n for (newGroupIndex = 0; newGroupIndex < nodes.length; newGroupIndex += 1) {\n var node = nodes[newGroupIndex];\n if (node.group && groupValue === node.group.value) {\n groupNode = node;\n break;\n }\n }\n }\n if (!groupNode) {\n groupNode = {\n group: {\n value: groupValue,\n spec: groupSpec,\n },\n children: [],\n };\n nodes.splice(newGroupIndex, 0, groupNode);\n }\n return groupNode;\n}\nfunction insertResourceNodeInSiblings(resourceNode, siblings, orderSpecs) {\n var i;\n for (i = 0; i < siblings.length; i += 1) {\n var cmp = compareByFieldSpecs(siblings[i].resourceFields, resourceNode.resourceFields, orderSpecs); // TODO: pass in ResourceApi?\n if (cmp > 0) { // went 1 past. insert at i\n break;\n }\n }\n siblings.splice(i, 0, resourceNode);\n}\nfunction buildResourceFields(resource) {\n var obj = __assign(__assign(__assign({}, resource.extendedProps), resource.ui), resource);\n delete obj.ui;\n delete obj.extendedProps;\n return obj;\n}\nfunction isGroupsEqual(group0, group1) {\n return group0.spec === group1.spec && group0.value === group1.value;\n}\n\nvar main = createPlugin({\n deps: [\n premiumCommonPlugin,\n ],\n reducers: [\n reduceResources,\n ],\n isLoadingFuncs: [\n function (state) { return state.resourceSource && state.resourceSource.isFetching; },\n ],\n eventRefiners: EVENT_REFINERS,\n eventDefMemberAdders: [generateEventDefResourceMembers],\n isDraggableTransformers: [transformIsDraggable],\n eventDragMutationMassagers: [massageEventDragMutation],\n eventDefMutationAppliers: [applyEventDefMutation],\n dateSelectionTransformers: [transformDateSelectionJoin],\n datePointTransforms: [transformDatePoint],\n dateSpanTransforms: [transformDateSpan],\n viewPropsTransformers: [ResourceDataAdder, ResourceEventConfigAdder],\n isPropsValid: isPropsValidWithResources,\n externalDefTransforms: [transformExternalDef],\n eventDropTransformers: [transformEventDrop],\n optionChangeHandlers: optionChangeHandlers,\n optionRefiners: OPTION_REFINERS,\n listenerRefiners: LISTENER_REFINERS,\n propSetHandlers: { resourceStore: handleResourceStore },\n});\n\nexport default main;\nexport { AbstractResourceDayTableModel, DEFAULT_RESOURCE_ORDER, DayResourceTableModel, ResourceApi, ResourceDayHeader, ResourceDayTableModel, ResourceLabelRoot, ResourceSplitter, VResourceJoiner, VResourceSplitter, buildResourceFields, buildRowNodes, flattenResources, getPublicId, isGroupsEqual };\n//# sourceMappingURL=main.js.map\n","/*!\nFullCalendar Scheduler v5.11.3\nDocs & License: https://fullcalendar.io/scheduler\n(c) 2022 Adam Shaw\n*/\nimport './main.css';\n\nimport { createElement, Fragment, ContentHook, BaseComponent, memoizeObjArg, buildClassNameNormalizer, MountHook, RenderHook, isArraysEqual, createRef, RefMap, findElements, elementClosest, PositionCache, memoize, greatestDurationDenominator, NowTimer, NowIndicatorRoot, DateComponent, config, getStickyHeaderDates, getStickyFooterScrollbar, renderScrollShim, ViewRoot, createPlugin } from '@fullcalendar/common';\nimport premiumCommonPlugin from '@fullcalendar/premium-common';\nimport timelinePlugin, { TimelineLane, TimelineLaneSlicer, TimelineSlats, TimelineLaneBg, coordToCss, buildTimelineDateProfile, buildSlatCols, TimelineHeader } from '@fullcalendar/timeline';\nimport resourceCommonPlugin, { ResourceApi, buildResourceFields, getPublicId, isGroupsEqual, ResourceSplitter, buildRowNodes, DEFAULT_RESOURCE_ORDER } from '@fullcalendar/resource-common';\nimport { __spreadArray, __extends, __assign } from 'tslib';\nimport { ScrollGrid } from '@fullcalendar/scrollgrid';\n\n/*\nRenders the DOM responsible for the subrow expander area,\nas well as the space before it (used to align expanders of similar depths)\n*/\nfunction ExpanderIcon(_a) {\n var depth = _a.depth, hasChildren = _a.hasChildren, isExpanded = _a.isExpanded, onExpanderClick = _a.onExpanderClick;\n var nodes = [];\n for (var i = 0; i < depth; i += 1) {\n nodes.push(createElement(\"span\", { className: \"fc-icon\" }));\n }\n var iconClassNames = ['fc-icon'];\n if (hasChildren) {\n if (isExpanded) {\n iconClassNames.push('fc-icon-minus-square');\n }\n else {\n iconClassNames.push('fc-icon-plus-square');\n }\n }\n nodes.push(createElement(\"span\", { className: 'fc-datagrid-expander' + (hasChildren ? '' : ' fc-datagrid-expander-placeholder'), onClick: onExpanderClick },\n createElement(\"span\", { className: iconClassNames.join(' ') })));\n return createElement.apply(void 0, __spreadArray([Fragment, {}], nodes));\n}\n\nfunction refineHookProps$1(raw) {\n return {\n resource: new ResourceApi(raw.context, raw.resource),\n fieldValue: raw.fieldValue,\n view: raw.context.viewApi,\n };\n}\n\nvar SpreadsheetIndividualCellInner = /** @class */ (function (_super) {\n __extends(SpreadsheetIndividualCellInner, _super);\n function SpreadsheetIndividualCellInner() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SpreadsheetIndividualCellInner.prototype.render = function () {\n var props = this.props;\n return (createElement(ContentHook, { hookProps: props.hookProps, content: props.colSpec.cellContent, defaultContent: renderResourceInner }, function (innerElRef, innerContent) { return (createElement(\"span\", { className: \"fc-datagrid-cell-main\", ref: innerElRef }, innerContent)); }));\n };\n return SpreadsheetIndividualCellInner;\n}(BaseComponent));\nfunction renderResourceInner(hookProps) {\n return hookProps.fieldValue || createElement(Fragment, null, \"\\u00A0\");\n}\n\n// worth making a PureComponent? (because of innerHeight)\nvar SpreadsheetIndividualCell = /** @class */ (function (_super) {\n __extends(SpreadsheetIndividualCell, _super);\n function SpreadsheetIndividualCell() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.refineHookProps = memoizeObjArg(refineHookProps$1);\n _this.normalizeClassNames = buildClassNameNormalizer();\n _this.onExpanderClick = function (ev) {\n var props = _this.props;\n if (props.hasChildren) {\n _this.context.dispatch({\n type: 'SET_RESOURCE_ENTITY_EXPANDED',\n id: props.resource.id,\n isExpanded: !props.isExpanded,\n });\n }\n };\n return _this;\n }\n SpreadsheetIndividualCell.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var colSpec = props.colSpec;\n var hookProps = this.refineHookProps({\n resource: props.resource,\n fieldValue: props.fieldValue,\n context: context,\n });\n var customClassNames = this.normalizeClassNames(colSpec.cellClassNames, hookProps);\n return (createElement(MountHook, { hookProps: hookProps, didMount: colSpec.cellDidMount, willUnmount: colSpec.cellWillUnmount }, function (rootElRef) { return (createElement(\"td\", { ref: rootElRef, role: \"gridcell\", \"data-resource-id\": props.resource.id, className: [\n 'fc-datagrid-cell',\n 'fc-resource',\n ].concat(customClassNames).join(' ') },\n createElement(\"div\", { className: \"fc-datagrid-cell-frame\", style: { height: props.innerHeight } },\n createElement(\"div\", { className: \"fc-datagrid-cell-cushion fc-scrollgrid-sync-inner\" },\n colSpec.isMain && (createElement(ExpanderIcon, { depth: props.depth, hasChildren: props.hasChildren, isExpanded: props.isExpanded, onExpanderClick: _this.onExpanderClick })),\n createElement(SpreadsheetIndividualCellInner, { hookProps: hookProps, colSpec: colSpec }))))); }));\n };\n return SpreadsheetIndividualCell;\n}(BaseComponent));\n\n// for VERTICAL cell grouping, in spreadsheet area\nvar SpreadsheetGroupCell = /** @class */ (function (_super) {\n __extends(SpreadsheetGroupCell, _super);\n function SpreadsheetGroupCell() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SpreadsheetGroupCell.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var colSpec = props.colSpec;\n var hookProps = {\n groupValue: props.fieldValue,\n view: context.viewApi,\n };\n // a grouped cell. no data that is specific to this specific resource\n // `colSpec` is for the group. a GroupSpec :(\n return (createElement(RenderHook, { hookProps: hookProps, classNames: colSpec.cellClassNames, content: colSpec.cellContent, defaultContent: renderGroupInner, didMount: colSpec.cellDidMount, willUnmount: colSpec.cellWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (\n // TODO: make data-attr with group value?\n createElement(\"td\", { ref: rootElRef, role: \"gridcell\", rowSpan: props.rowSpan, className: ['fc-datagrid-cell', 'fc-resource-group'].concat(classNames).join(' ') },\n createElement(\"div\", { className: \"fc-datagrid-cell-frame fc-datagrid-cell-frame-liquid\" },\n createElement(\"div\", { className: \"fc-datagrid-cell-cushion fc-sticky\", ref: innerElRef }, innerContent)))); }));\n };\n return SpreadsheetGroupCell;\n}(BaseComponent));\nfunction renderGroupInner(hookProps) {\n return hookProps.groupValue || createElement(Fragment, null, \"\\u00A0\");\n}\n\nvar SpreadsheetRow = /** @class */ (function (_super) {\n __extends(SpreadsheetRow, _super);\n function SpreadsheetRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SpreadsheetRow.prototype.render = function () {\n var props = this.props;\n var resource = props.resource, rowSpans = props.rowSpans, depth = props.depth;\n var resourceFields = buildResourceFields(resource); // slightly inefficient. already done up the call stack\n return (createElement(\"tr\", { role: \"row\" }, props.colSpecs.map(function (colSpec, i) {\n var rowSpan = rowSpans[i];\n if (rowSpan === 0) { // not responsible for group-based rows. VRowGroup is\n return null;\n }\n if (rowSpan == null) {\n rowSpan = 1;\n }\n var fieldValue = colSpec.field ? resourceFields[colSpec.field] :\n (resource.title || getPublicId(resource.id));\n if (rowSpan > 1) {\n return (createElement(SpreadsheetGroupCell, { key: i, colSpec: colSpec, fieldValue: fieldValue, rowSpan: rowSpan }));\n }\n return (createElement(SpreadsheetIndividualCell, { key: i, colSpec: colSpec, resource: resource, fieldValue: fieldValue, depth: depth, hasChildren: props.hasChildren, isExpanded: props.isExpanded, innerHeight: props.innerHeight }));\n })));\n };\n return SpreadsheetRow;\n}(BaseComponent));\nSpreadsheetRow.addPropsEquality({\n rowSpans: isArraysEqual,\n});\n\n// for HORIZONTAL cell grouping, in spreadsheet area\nvar SpreadsheetGroupRow = /** @class */ (function (_super) {\n __extends(SpreadsheetGroupRow, _super);\n function SpreadsheetGroupRow() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.innerInnerRef = createRef();\n _this.onExpanderClick = function () {\n var props = _this.props;\n _this.context.dispatch({\n type: 'SET_RESOURCE_ENTITY_EXPANDED',\n id: props.id,\n isExpanded: !props.isExpanded,\n });\n };\n return _this;\n }\n SpreadsheetGroupRow.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var hookProps = { groupValue: props.group.value, view: context.viewApi };\n var spec = props.group.spec;\n return (createElement(\"tr\", { role: \"row\" },\n createElement(RenderHook, { hookProps: hookProps, classNames: spec.labelClassNames, content: spec.labelContent, defaultContent: renderCellInner, didMount: spec.labelDidMount, willUnmount: spec.labelWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"th\", { ref: rootElRef, \n // ARIA TODO: not really a columnheader\n // extremely tedious to make this aria-compliant,\n // to assign multiple headers to each cell\n // https://www.w3.org/WAI/tutorials/tables/multi-level/\n role: \"columnheader\", scope: \"colgroup\", colSpan: props.spreadsheetColCnt, className: [\n 'fc-datagrid-cell',\n 'fc-resource-group',\n context.theme.getClass('tableCellShaded'),\n ].concat(classNames).join(' ') },\n createElement(\"div\", { className: \"fc-datagrid-cell-frame\", style: { height: props.innerHeight } },\n createElement(\"div\", { className: \"fc-datagrid-cell-cushion fc-scrollgrid-sync-inner\", ref: _this.innerInnerRef },\n createElement(ExpanderIcon, { depth: 0, hasChildren: true, isExpanded: props.isExpanded, onExpanderClick: _this.onExpanderClick }),\n createElement(\"span\", { className: \"fc-datagrid-cell-main\", ref: innerElRef }, innerContent))))); })));\n };\n return SpreadsheetGroupRow;\n}(BaseComponent));\nSpreadsheetGroupRow.addPropsEquality({\n group: isGroupsEqual,\n});\nfunction renderCellInner(hookProps) {\n return hookProps.groupValue || createElement(Fragment, null, \"\\u00A0\");\n}\n\nvar SPREADSHEET_COL_MIN_WIDTH = 20;\nvar SpreadsheetHeader = /** @class */ (function (_super) {\n __extends(SpreadsheetHeader, _super);\n function SpreadsheetHeader() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.resizerElRefs = new RefMap(_this._handleColResizerEl.bind(_this));\n _this.colDraggings = {};\n return _this;\n }\n SpreadsheetHeader.prototype.render = function () {\n var _this = this;\n var _a = this.props, colSpecs = _a.colSpecs, superHeaderRendering = _a.superHeaderRendering, rowInnerHeights = _a.rowInnerHeights;\n var hookProps = { view: this.context.viewApi };\n var rowNodes = [];\n rowInnerHeights = rowInnerHeights.slice(); // copy, because we're gonna pop\n if (superHeaderRendering) {\n var rowInnerHeight_1 = rowInnerHeights.shift();\n rowNodes.push(createElement(\"tr\", { key: \"row-super\", role: \"row\" },\n createElement(RenderHook, { hookProps: hookProps, classNames: superHeaderRendering.headerClassNames, content: superHeaderRendering.headerContent, didMount: superHeaderRendering.headerDidMount, willUnmount: superHeaderRendering.headerWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"th\", { ref: rootElRef, role: \"columnheader\", scope: \"colgroup\", colSpan: colSpecs.length, className: [\n 'fc-datagrid-cell',\n 'fc-datagrid-cell-super',\n ].concat(classNames).join(' ') },\n createElement(\"div\", { className: \"fc-datagrid-cell-frame\", style: { height: rowInnerHeight_1 } },\n createElement(\"div\", { className: \"fc-datagrid-cell-cushion fc-scrollgrid-sync-inner\", ref: innerElRef }, innerContent)))); })));\n }\n var rowInnerHeight = rowInnerHeights.shift();\n rowNodes.push(createElement(\"tr\", { key: \"row\", role: \"row\" }, colSpecs.map(function (colSpec, i) {\n var isLastCol = i === (colSpecs.length - 1);\n // need empty inner div for abs positioning for resizer\n return (createElement(RenderHook, { key: i, hookProps: hookProps, classNames: colSpec.headerClassNames, content: colSpec.headerContent, didMount: colSpec.headerDidMount, willUnmount: colSpec.headerWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"th\", { ref: rootElRef, role: \"columnheader\", className: ['fc-datagrid-cell'].concat(classNames).join(' ') },\n createElement(\"div\", { className: \"fc-datagrid-cell-frame\", style: { height: rowInnerHeight } },\n createElement(\"div\", { className: \"fc-datagrid-cell-cushion fc-scrollgrid-sync-inner\" },\n colSpec.isMain && (createElement(\"span\", { className: \"fc-datagrid-expander fc-datagrid-expander-placeholder\" },\n createElement(\"span\", { className: \"fc-icon\" }))),\n createElement(\"span\", { className: \"fc-datagrid-cell-main\", ref: innerElRef }, innerContent)),\n !isLastCol &&\n createElement(\"div\", { className: \"fc-datagrid-cell-resizer\", ref: _this.resizerElRefs.createRef(i) })))); }));\n })));\n return (createElement(Fragment, null, rowNodes));\n };\n SpreadsheetHeader.prototype._handleColResizerEl = function (resizerEl, index) {\n var colDraggings = this.colDraggings;\n if (!resizerEl) {\n var dragging = colDraggings[index];\n if (dragging) {\n dragging.destroy();\n delete colDraggings[index];\n }\n }\n else {\n var dragging = this.initColResizing(resizerEl, parseInt(index, 10));\n if (dragging) {\n colDraggings[index] = dragging;\n }\n }\n };\n SpreadsheetHeader.prototype.initColResizing = function (resizerEl, index) {\n var _a = this.context, pluginHooks = _a.pluginHooks, isRtl = _a.isRtl;\n var onColWidthChange = this.props.onColWidthChange;\n var ElementDraggingImpl = pluginHooks.elementDraggingImpl;\n if (ElementDraggingImpl) {\n var dragging = new ElementDraggingImpl(resizerEl);\n var startWidth_1; // of just the single column\n var currentWidths_1; // of all columns\n dragging.emitter.on('dragstart', function () {\n var allCells = findElements(elementClosest(resizerEl, 'tr'), 'th');\n currentWidths_1 = allCells.map(function (cellEl) { return (cellEl.getBoundingClientRect().width); });\n startWidth_1 = currentWidths_1[index];\n });\n dragging.emitter.on('dragmove', function (pev) {\n currentWidths_1[index] = Math.max(startWidth_1 + pev.deltaX * (isRtl ? -1 : 1), SPREADSHEET_COL_MIN_WIDTH);\n if (onColWidthChange) {\n onColWidthChange(currentWidths_1.slice()); // send a copy since currentWidths continues to be mutated\n }\n });\n dragging.setAutoScrollEnabled(false); // because gets weird with auto-scrolling time area\n return dragging;\n }\n return null;\n };\n return SpreadsheetHeader;\n}(BaseComponent));\n\nvar ResourceTimelineLaneMisc = /** @class */ (function (_super) {\n __extends(ResourceTimelineLaneMisc, _super);\n function ResourceTimelineLaneMisc() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ResourceTimelineLaneMisc.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var hookProps = { resource: new ResourceApi(context, props.resource) }; // just easier to make directly\n return (createElement(ContentHook, { hookProps: hookProps, content: context.options.resourceLaneContent }, function (innerElRef, innerContent) { return (innerContent && // TODO: test how this would interfere with height\n createElement(\"div\", { className: \"fc-timeline-lane-misc\", ref: innerElRef }, innerContent)); }));\n };\n return ResourceTimelineLaneMisc;\n}(BaseComponent));\n\nvar ResourceTimelineLane = /** @class */ (function (_super) {\n __extends(ResourceTimelineLane, _super);\n function ResourceTimelineLane() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.refineHookProps = memoizeObjArg(refineHookProps);\n _this.normalizeClassNames = buildClassNameNormalizer();\n _this.handleHeightChange = function (innerEl, isStable) {\n if (_this.props.onHeightChange) {\n _this.props.onHeightChange(\n // would want to use own ref, but not guaranteed to be ready when this fires\n elementClosest(innerEl, 'tr'), isStable);\n }\n };\n return _this;\n }\n ResourceTimelineLane.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var hookProps = this.refineHookProps({ resource: props.resource, context: context });\n var customClassNames = this.normalizeClassNames(options.resourceLaneClassNames, hookProps);\n return (createElement(\"tr\", { ref: props.elRef },\n createElement(MountHook, { hookProps: hookProps, didMount: options.resourceLaneDidMount, willUnmount: options.resourceLaneWillUnmount }, function (rootElRef) { return (createElement(\"td\", { ref: rootElRef, className: ['fc-timeline-lane', 'fc-resource'].concat(customClassNames).join(' '), \"data-resource-id\": props.resource.id },\n createElement(\"div\", { className: \"fc-timeline-lane-frame\", style: { height: props.innerHeight } },\n createElement(ResourceTimelineLaneMisc, { resource: props.resource }),\n createElement(TimelineLane, { dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, nextDayThreshold: props.nextDayThreshold, businessHours: props.businessHours, eventStore: props.eventStore, eventUiBases: props.eventUiBases, dateSelection: props.dateSelection, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, timelineCoords: props.timelineCoords, onHeightChange: _this.handleHeightChange, resourceId: props.resource.id })))); }))); // important NOT to do liquid-height. dont want to shrink height smaller than content\n };\n return ResourceTimelineLane;\n}(BaseComponent));\nfunction refineHookProps(raw) {\n return {\n resource: new ResourceApi(raw.context, raw.resource),\n };\n}\n\n/*\nparallels the SpreadsheetGroupRow\n*/\nvar DividerRow = /** @class */ (function (_super) {\n __extends(DividerRow, _super);\n function DividerRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DividerRow.prototype.render = function () {\n var _this = this;\n var props = this.props;\n var renderingHooks = this.props.renderingHooks;\n var hookProps = { groupValue: props.groupValue, view: this.context.viewApi };\n return (createElement(\"tr\", { ref: props.elRef },\n createElement(RenderHook, { hookProps: hookProps, classNames: renderingHooks.laneClassNames, content: renderingHooks.laneContent, didMount: renderingHooks.laneDidMount, willUnmount: renderingHooks.laneWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"td\", { ref: rootElRef, className: [\n 'fc-timeline-lane',\n 'fc-resource-group',\n _this.context.theme.getClass('tableCellShaded'),\n ].concat(classNames).join(' ') },\n createElement(\"div\", { style: { height: props.innerHeight }, ref: innerElRef }, innerContent))); })));\n };\n return DividerRow;\n}(BaseComponent));\n\nvar ResourceTimelineLanesBody = /** @class */ (function (_super) {\n __extends(ResourceTimelineLanesBody, _super);\n function ResourceTimelineLanesBody() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ResourceTimelineLanesBody.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var rowElRefs = props.rowElRefs, innerHeights = props.innerHeights;\n return (createElement(\"tbody\", null, props.rowNodes.map(function (node, index) {\n if (node.group) {\n return (createElement(DividerRow, { key: node.id, elRef: rowElRefs.createRef(node.id), groupValue: node.group.value, renderingHooks: node.group.spec, innerHeight: innerHeights[index] || '' }));\n }\n if (node.resource) {\n var resource = node.resource;\n return (createElement(ResourceTimelineLane, __assign({ key: node.id, elRef: rowElRefs.createRef(node.id) }, props.splitProps[resource.id], { resource: resource, dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, nextDayThreshold: context.options.nextDayThreshold, businessHours: resource.businessHours || props.fallbackBusinessHours, innerHeight: innerHeights[index] || '', timelineCoords: props.slatCoords, onHeightChange: props.onRowHeightChange })));\n }\n return null;\n })));\n };\n return ResourceTimelineLanesBody;\n}(BaseComponent));\n\nvar ResourceTimelineLanes = /** @class */ (function (_super) {\n __extends(ResourceTimelineLanes, _super);\n function ResourceTimelineLanes() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rootElRef = createRef();\n _this.rowElRefs = new RefMap();\n return _this;\n }\n ResourceTimelineLanes.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n return (createElement(\"table\", { ref: this.rootElRef, \"aria-hidden\": true, className: 'fc-scrollgrid-sync-table ' + context.theme.getClass('table'), style: {\n minWidth: props.tableMinWidth,\n width: props.clientWidth,\n height: props.minHeight,\n } },\n createElement(ResourceTimelineLanesBody, { rowElRefs: this.rowElRefs, rowNodes: props.rowNodes, dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, splitProps: props.splitProps, fallbackBusinessHours: props.fallbackBusinessHours, slatCoords: props.slatCoords, innerHeights: props.innerHeights, onRowHeightChange: props.onRowHeightChange })));\n };\n ResourceTimelineLanes.prototype.componentDidMount = function () {\n this.updateCoords();\n };\n ResourceTimelineLanes.prototype.componentDidUpdate = function () {\n this.updateCoords();\n };\n ResourceTimelineLanes.prototype.componentWillUnmount = function () {\n if (this.props.onRowCoords) {\n this.props.onRowCoords(null);\n }\n };\n ResourceTimelineLanes.prototype.updateCoords = function () {\n var props = this.props;\n if (props.onRowCoords && props.clientWidth !== null) { // a populated clientWidth means sizing has stabilized\n this.props.onRowCoords(new PositionCache(this.rootElRef.current, collectRowEls(this.rowElRefs.currentMap, props.rowNodes), false, true));\n }\n };\n return ResourceTimelineLanes;\n}(BaseComponent));\nfunction collectRowEls(elMap, rowNodes) {\n return rowNodes.map(function (rowNode) { return elMap[rowNode.id]; });\n}\n\nvar ResourceTimelineGrid = /** @class */ (function (_super) {\n __extends(ResourceTimelineGrid, _super);\n function ResourceTimelineGrid() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.computeHasResourceBusinessHours = memoize(computeHasResourceBusinessHours);\n _this.resourceSplitter = new ResourceSplitter(); // doesn't let it do businessHours tho\n _this.bgSlicer = new TimelineLaneSlicer();\n _this.slatsRef = createRef(); // needed for Hit creation :(\n _this.state = {\n slatCoords: null,\n };\n _this.handleEl = function (el) {\n if (el) {\n _this.context.registerInteractiveComponent(_this, { el: el });\n }\n else {\n _this.context.unregisterInteractiveComponent(_this);\n }\n };\n _this.handleSlatCoords = function (slatCoords) {\n _this.setState({ slatCoords: slatCoords });\n if (_this.props.onSlatCoords) {\n _this.props.onSlatCoords(slatCoords);\n }\n };\n _this.handleRowCoords = function (rowCoords) {\n _this.rowCoords = rowCoords;\n if (_this.props.onRowCoords) {\n _this.props.onRowCoords(rowCoords);\n }\n };\n return _this;\n }\n ResourceTimelineGrid.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var dateProfile = props.dateProfile, tDateProfile = props.tDateProfile;\n var timerUnit = greatestDurationDenominator(tDateProfile.slotDuration).unit;\n var hasResourceBusinessHours = this.computeHasResourceBusinessHours(props.rowNodes);\n var splitProps = this.resourceSplitter.splitProps(props);\n var bgLaneProps = splitProps[''];\n var bgSlicedProps = this.bgSlicer.sliceProps(bgLaneProps, dateProfile, tDateProfile.isTimeScale ? null : props.nextDayThreshold, context, // wish we didn't need to pass in the rest of these args...\n dateProfile, context.dateProfileGenerator, tDateProfile, context.dateEnv);\n // WORKAROUND: make ignore slatCoords when out of sync with dateProfile\n var slatCoords = state.slatCoords && state.slatCoords.dateProfile === props.dateProfile ? state.slatCoords : null;\n return (createElement(\"div\", { ref: this.handleEl, className: [\n 'fc-timeline-body',\n props.expandRows ? 'fc-timeline-body-expandrows' : '',\n ].join(' '), style: { minWidth: props.tableMinWidth } },\n createElement(NowTimer, { unit: timerUnit }, function (nowDate, todayRange) { return (createElement(Fragment, null,\n createElement(TimelineSlats, { ref: _this.slatsRef, dateProfile: dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, clientWidth: props.clientWidth, tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, onCoords: _this.handleSlatCoords, onScrollLeftRequest: props.onScrollLeftRequest }),\n createElement(TimelineLaneBg, { businessHourSegs: hasResourceBusinessHours ? null : bgSlicedProps.businessHourSegs, bgEventSegs: bgSlicedProps.bgEventSegs, timelineCoords: slatCoords, \n // empty array will result in unnecessary rerenders?\n eventResizeSegs: (bgSlicedProps.eventResize ? bgSlicedProps.eventResize.segs : []), dateSelectionSegs: bgSlicedProps.dateSelectionSegs, nowDate: nowDate, todayRange: todayRange }),\n createElement(ResourceTimelineLanes, { rowNodes: props.rowNodes, dateProfile: dateProfile, tDateProfile: props.tDateProfile, nowDate: nowDate, todayRange: todayRange, splitProps: splitProps, fallbackBusinessHours: hasResourceBusinessHours ? props.businessHours : null, clientWidth: props.clientWidth, minHeight: props.expandRows ? props.clientHeight : '', tableMinWidth: props.tableMinWidth, innerHeights: props.rowInnerHeights, slatCoords: slatCoords, onRowCoords: _this.handleRowCoords, onRowHeightChange: props.onRowHeightChange }),\n (context.options.nowIndicator && slatCoords && slatCoords.isDateInRange(nowDate)) && (createElement(\"div\", { className: \"fc-timeline-now-indicator-container\" },\n createElement(NowIndicatorRoot, { isAxis: false, date: nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-timeline-now-indicator-line'].concat(classNames).join(' '), style: coordToCss(slatCoords.dateToCoord(nowDate), context.isRtl) }, innerContent)); }))))); })));\n };\n // Hit System\n // ------------------------------------------------------------------------------------------\n ResourceTimelineGrid.prototype.queryHit = function (positionLeft, positionTop) {\n var rowCoords = this.rowCoords;\n var rowIndex = rowCoords.topToIndex(positionTop);\n if (rowIndex != null) {\n var resource = this.props.rowNodes[rowIndex].resource;\n if (resource) { // not a group\n var slatHit = this.slatsRef.current.positionToHit(positionLeft);\n if (slatHit) {\n return {\n dateProfile: this.props.dateProfile,\n dateSpan: {\n range: slatHit.dateSpan.range,\n allDay: slatHit.dateSpan.allDay,\n resourceId: resource.id,\n },\n rect: {\n left: slatHit.left,\n right: slatHit.right,\n top: rowCoords.tops[rowIndex],\n bottom: rowCoords.bottoms[rowIndex],\n },\n dayEl: slatHit.dayEl,\n layer: 0,\n };\n }\n }\n }\n return null;\n };\n return ResourceTimelineGrid;\n}(DateComponent));\nfunction computeHasResourceBusinessHours(rowNodes) {\n for (var _i = 0, rowNodes_1 = rowNodes; _i < rowNodes_1.length; _i++) {\n var node = rowNodes_1[_i];\n var resource = node.resource;\n if (resource && resource.businessHours) {\n return true;\n }\n }\n return false;\n}\n\nvar MIN_RESOURCE_AREA_WIDTH = 30; // definitely bigger than scrollbars\n// RENAME?\nvar ResourceTimelineViewLayout = /** @class */ (function (_super) {\n __extends(ResourceTimelineViewLayout, _super);\n function ResourceTimelineViewLayout() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.scrollGridRef = createRef();\n _this.timeBodyScrollerElRef = createRef();\n _this.spreadsheetHeaderChunkElRef = createRef();\n _this.rootElRef = createRef();\n _this.ensureScrollGridResizeId = 0;\n _this.state = {\n resourceAreaWidthOverride: null,\n };\n /*\n ghetto debounce. don't race with ScrollGrid's resizing delay. solves #6140\n */\n _this.ensureScrollGridResize = function () {\n if (_this.ensureScrollGridResizeId) {\n clearTimeout(_this.ensureScrollGridResizeId);\n }\n _this.ensureScrollGridResizeId = setTimeout(function () {\n _this.scrollGridRef.current.handleSizing(false);\n }, config.SCROLLGRID_RESIZE_INTERVAL + 1);\n };\n return _this;\n }\n ResourceTimelineViewLayout.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var options = context.options;\n var stickyHeaderDates = !props.forPrint && getStickyHeaderDates(options);\n var stickyFooterScrollbar = !props.forPrint && getStickyFooterScrollbar(options);\n var sections = [\n {\n type: 'header',\n key: 'header',\n syncRowHeights: true,\n isSticky: stickyHeaderDates,\n chunks: [\n {\n key: 'datagrid',\n elRef: this.spreadsheetHeaderChunkElRef,\n // TODO: allow the content to specify this. have general-purpose 'content' with obj with keys\n tableClassName: 'fc-datagrid-header',\n rowContent: props.spreadsheetHeaderRows,\n },\n {\n key: 'divider',\n outerContent: (createElement(\"td\", { role: \"presentation\", className: 'fc-resource-timeline-divider ' + context.theme.getClass('tableCellShaded') })),\n },\n {\n key: 'timeline',\n content: props.timeHeaderContent,\n },\n ],\n },\n {\n type: 'body',\n key: 'body',\n syncRowHeights: true,\n liquid: true,\n expandRows: Boolean(options.expandRows),\n chunks: [\n {\n key: 'datagrid',\n tableClassName: 'fc-datagrid-body',\n rowContent: props.spreadsheetBodyRows,\n },\n {\n key: 'divider',\n outerContent: (createElement(\"td\", { role: \"presentation\", className: 'fc-resource-timeline-divider ' + context.theme.getClass('tableCellShaded') })),\n },\n {\n key: 'timeline',\n scrollerElRef: this.timeBodyScrollerElRef,\n content: props.timeBodyContent,\n },\n ],\n },\n ];\n if (stickyFooterScrollbar) {\n sections.push({\n type: 'footer',\n key: 'footer',\n isSticky: true,\n chunks: [\n {\n key: 'datagrid',\n content: renderScrollShim,\n },\n {\n key: 'divider',\n outerContent: (createElement(\"td\", { role: \"presentation\", className: 'fc-resource-timeline-divider ' + context.theme.getClass('tableCellShaded') })),\n },\n {\n key: 'timeline',\n content: renderScrollShim,\n },\n ],\n });\n }\n var resourceAreaWidth = state.resourceAreaWidthOverride != null\n ? state.resourceAreaWidthOverride\n : options.resourceAreaWidth;\n return (createElement(ScrollGrid, { ref: this.scrollGridRef, elRef: this.rootElRef, liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: false, colGroups: [\n { cols: props.spreadsheetCols, width: resourceAreaWidth },\n { cols: [] },\n { cols: props.timeCols },\n ], sections: sections }));\n };\n ResourceTimelineViewLayout.prototype.forceTimeScroll = function (left) {\n var scrollGrid = this.scrollGridRef.current;\n scrollGrid.forceScrollLeft(2, left); // 2 = the time area\n };\n ResourceTimelineViewLayout.prototype.forceResourceScroll = function (top) {\n var scrollGrid = this.scrollGridRef.current;\n scrollGrid.forceScrollTop(1, top); // 1 = the body\n };\n ResourceTimelineViewLayout.prototype.getResourceScroll = function () {\n var timeBodyScrollerEl = this.timeBodyScrollerElRef.current;\n return timeBodyScrollerEl.scrollTop;\n };\n // Resource Area Resizing\n // ------------------------------------------------------------------------------------------\n // NOTE: a callback Ref for the resizer was firing multiple times with same elements (Preact)\n // that's why we use spreadsheetResizerElRef instead\n ResourceTimelineViewLayout.prototype.componentDidMount = function () {\n this.initSpreadsheetResizing();\n };\n ResourceTimelineViewLayout.prototype.componentWillUnmount = function () {\n this.destroySpreadsheetResizing();\n };\n ResourceTimelineViewLayout.prototype.initSpreadsheetResizing = function () {\n var _this = this;\n var _a = this.context, isRtl = _a.isRtl, pluginHooks = _a.pluginHooks;\n var ElementDraggingImpl = pluginHooks.elementDraggingImpl;\n var spreadsheetHeadEl = this.spreadsheetHeaderChunkElRef.current;\n if (ElementDraggingImpl) {\n var rootEl_1 = this.rootElRef.current;\n var dragging = this.spreadsheetResizerDragging = new ElementDraggingImpl(rootEl_1, '.fc-resource-timeline-divider');\n var dragStartWidth_1;\n var viewWidth_1;\n dragging.emitter.on('dragstart', function () {\n dragStartWidth_1 = spreadsheetHeadEl.getBoundingClientRect().width;\n viewWidth_1 = rootEl_1.getBoundingClientRect().width;\n });\n dragging.emitter.on('dragmove', function (pev) {\n var newWidth = dragStartWidth_1 + pev.deltaX * (isRtl ? -1 : 1);\n newWidth = Math.max(newWidth, MIN_RESOURCE_AREA_WIDTH);\n newWidth = Math.min(newWidth, viewWidth_1 - MIN_RESOURCE_AREA_WIDTH);\n // scrollgrid will ignore resize requests if there are too many :|\n _this.setState({\n resourceAreaWidthOverride: newWidth,\n }, _this.ensureScrollGridResize);\n });\n dragging.setAutoScrollEnabled(false); // because gets weird with auto-scrolling time area\n }\n };\n ResourceTimelineViewLayout.prototype.destroySpreadsheetResizing = function () {\n if (this.spreadsheetResizerDragging) {\n this.spreadsheetResizerDragging.destroy();\n }\n };\n return ResourceTimelineViewLayout;\n}(BaseComponent));\n\nvar ResourceTimelineView = /** @class */ (function (_super) {\n __extends(ResourceTimelineView, _super);\n function ResourceTimelineView(props, context) {\n var _this = _super.call(this, props, context) || this;\n _this.processColOptions = memoize(processColOptions);\n _this.buildTimelineDateProfile = memoize(buildTimelineDateProfile);\n _this.hasNesting = memoize(hasNesting);\n _this.buildRowNodes = memoize(buildRowNodes);\n _this.layoutRef = createRef();\n _this.rowNodes = [];\n _this.renderedRowNodes = [];\n _this.buildRowIndex = memoize(buildRowIndex);\n _this.handleSlatCoords = function (slatCoords) {\n _this.setState({ slatCoords: slatCoords });\n };\n _this.handleRowCoords = function (rowCoords) {\n _this.rowCoords = rowCoords;\n _this.scrollResponder.update(false); // TODO: could eliminate this if rowCoords lived in state\n };\n _this.handleMaxCushionWidth = function (slotCushionMaxWidth) {\n _this.setState({\n slotCushionMaxWidth: Math.ceil(slotCushionMaxWidth), // for less rerendering TODO: DRY\n });\n };\n // Scrolling\n // ------------------------------------------------------------------------------------------------------------------\n // this is useful for scrolling prev/next dates while resource is scrolled down\n _this.handleScrollLeftRequest = function (scrollLeft) {\n var layout = _this.layoutRef.current;\n layout.forceTimeScroll(scrollLeft);\n };\n _this.handleScrollRequest = function (request) {\n var rowCoords = _this.rowCoords;\n var layout = _this.layoutRef.current;\n var rowId = request.rowId || request.resourceId;\n if (rowCoords) {\n if (rowId) {\n var rowIdToIndex = _this.buildRowIndex(_this.renderedRowNodes);\n var index = rowIdToIndex[rowId];\n if (index != null) {\n var scrollTop = (request.fromBottom != null ?\n rowCoords.bottoms[index] - request.fromBottom : // pixels from bottom edge\n rowCoords.tops[index] // just use top edge\n );\n layout.forceResourceScroll(scrollTop);\n }\n }\n return true;\n }\n return null;\n };\n // Resource INDIVIDUAL-Column Area Resizing\n // ------------------------------------------------------------------------------------------\n _this.handleColWidthChange = function (colWidths) {\n _this.setState({\n spreadsheetColWidths: colWidths,\n });\n };\n _this.state = {\n resourceAreaWidth: context.options.resourceAreaWidth,\n spreadsheetColWidths: [],\n };\n return _this;\n }\n ResourceTimelineView.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var options = context.options, viewSpec = context.viewSpec;\n var _b = this.processColOptions(context.options), superHeaderRendering = _b.superHeaderRendering, groupSpecs = _b.groupSpecs, orderSpecs = _b.orderSpecs, isVGrouping = _b.isVGrouping, colSpecs = _b.colSpecs;\n var tDateProfile = this.buildTimelineDateProfile(props.dateProfile, context.dateEnv, options, context.dateProfileGenerator);\n var rowNodes = this.rowNodes = this.buildRowNodes(props.resourceStore, groupSpecs, orderSpecs, isVGrouping, props.resourceEntityExpansions, options.resourcesInitiallyExpanded);\n var extraClassNames = [\n 'fc-resource-timeline',\n this.hasNesting(rowNodes) ? '' : 'fc-resource-timeline-flat',\n 'fc-timeline',\n options.eventOverlap === false ? 'fc-timeline-overlap-disabled' : 'fc-timeline-overlap-enabled',\n ];\n var slotMinWidth = options.slotMinWidth;\n var slatCols = buildSlatCols(tDateProfile, slotMinWidth || this.computeFallbackSlotMinWidth(tDateProfile));\n return (createElement(ViewRoot, { viewSpec: viewSpec }, function (rootElRef, classNames) { return (createElement(\"div\", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') },\n createElement(ResourceTimelineViewLayout, { ref: _this.layoutRef, forPrint: props.forPrint, isHeightAuto: props.isHeightAuto, spreadsheetCols: buildSpreadsheetCols(colSpecs, state.spreadsheetColWidths, ''), spreadsheetHeaderRows: function (contentArg) { return (createElement(SpreadsheetHeader // TODO: rename to SpreadsheetHeaderRows\n , { superHeaderRendering: superHeaderRendering, colSpecs: colSpecs, onColWidthChange: _this.handleColWidthChange, rowInnerHeights: contentArg.rowSyncHeights })); }, spreadsheetBodyRows: function (contentArg) { return (createElement(Fragment, null, _this.renderSpreadsheetRows(rowNodes, colSpecs, contentArg.rowSyncHeights))); }, timeCols: slatCols, timeHeaderContent: function (contentArg) { return (createElement(TimelineHeader, { clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, tableMinWidth: contentArg.tableMinWidth, tableColGroupNode: contentArg.tableColGroupNode, dateProfile: props.dateProfile, tDateProfile: tDateProfile, slatCoords: state.slatCoords, rowInnerHeights: contentArg.rowSyncHeights, onMaxCushionWidth: slotMinWidth ? null : _this.handleMaxCushionWidth })); }, timeBodyContent: function (contentArg) { return (createElement(ResourceTimelineGrid, { dateProfile: props.dateProfile, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, tableMinWidth: contentArg.tableMinWidth, tableColGroupNode: contentArg.tableColGroupNode, expandRows: contentArg.expandRows, tDateProfile: tDateProfile, rowNodes: rowNodes, businessHours: props.businessHours, dateSelection: props.dateSelection, eventStore: props.eventStore, eventUiBases: props.eventUiBases, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, resourceStore: props.resourceStore, nextDayThreshold: context.options.nextDayThreshold, rowInnerHeights: contentArg.rowSyncHeights, onSlatCoords: _this.handleSlatCoords, onRowCoords: _this.handleRowCoords, onScrollLeftRequest: _this.handleScrollLeftRequest, onRowHeightChange: contentArg.reportRowHeightChange })); } }))); }));\n };\n ResourceTimelineView.prototype.renderSpreadsheetRows = function (nodes, colSpecs, rowSyncHeights) {\n return nodes.map(function (node, index) {\n if (node.group) {\n return (createElement(SpreadsheetGroupRow, { key: node.id, id: node.id, spreadsheetColCnt: colSpecs.length, isExpanded: node.isExpanded, group: node.group, innerHeight: rowSyncHeights[index] || '' }));\n }\n if (node.resource) {\n return (createElement(SpreadsheetRow, { key: node.id, colSpecs: colSpecs, rowSpans: node.rowSpans, depth: node.depth, isExpanded: node.isExpanded, hasChildren: node.hasChildren, resource: node.resource, innerHeight: rowSyncHeights[index] || '' }));\n }\n return null;\n });\n };\n ResourceTimelineView.prototype.componentDidMount = function () {\n this.renderedRowNodes = this.rowNodes;\n this.scrollResponder = this.context.createScrollResponder(this.handleScrollRequest);\n };\n ResourceTimelineView.prototype.getSnapshotBeforeUpdate = function () {\n if (!this.props.forPrint) { // because print-view is always zero?\n return { resourceScroll: this.queryResourceScroll() };\n }\n return {};\n };\n ResourceTimelineView.prototype.componentDidUpdate = function (prevProps, prevState, snapshot) {\n this.renderedRowNodes = this.rowNodes;\n this.scrollResponder.update(prevProps.dateProfile !== this.props.dateProfile);\n if (snapshot.resourceScroll) {\n this.handleScrollRequest(snapshot.resourceScroll); // TODO: this gets triggered too often\n }\n };\n ResourceTimelineView.prototype.componentWillUnmount = function () {\n this.scrollResponder.detach();\n };\n ResourceTimelineView.prototype.computeFallbackSlotMinWidth = function (tDateProfile) {\n return Math.max(30, ((this.state.slotCushionMaxWidth || 0) / tDateProfile.slotsPerLabel));\n };\n ResourceTimelineView.prototype.queryResourceScroll = function () {\n var _a = this, rowCoords = _a.rowCoords, renderedRowNodes = _a.renderedRowNodes;\n if (rowCoords) {\n var layout = this.layoutRef.current;\n var trBottoms = rowCoords.bottoms;\n var scrollTop = layout.getResourceScroll();\n var scroll_1 = {};\n for (var i = 0; i < trBottoms.length; i += 1) {\n var rowNode = renderedRowNodes[i];\n var elBottom = trBottoms[i] - scrollTop; // from the top of the scroller\n if (elBottom > 0) {\n scroll_1.rowId = rowNode.id;\n scroll_1.fromBottom = elBottom;\n break;\n }\n }\n return scroll_1;\n }\n return null;\n };\n return ResourceTimelineView;\n}(BaseComponent));\nResourceTimelineView.addStateEquality({\n spreadsheetColWidths: isArraysEqual,\n});\nfunction buildRowIndex(rowNodes) {\n var rowIdToIndex = {};\n for (var i = 0; i < rowNodes.length; i += 1) {\n rowIdToIndex[rowNodes[i].id] = i;\n }\n return rowIdToIndex;\n}\nfunction buildSpreadsheetCols(colSpecs, forcedWidths, fallbackWidth) {\n if (fallbackWidth === void 0) { fallbackWidth = ''; }\n return colSpecs.map(function (colSpec, i) { return ({\n className: colSpec.isMain ? 'fc-main-col' : '',\n width: forcedWidths[i] || colSpec.width || fallbackWidth,\n }); });\n}\nfunction hasNesting(nodes) {\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n var node = nodes_1[_i];\n if (node.group) {\n return true;\n }\n if (node.resource) {\n if (node.hasChildren) {\n return true;\n }\n }\n }\n return false;\n}\nfunction processColOptions(options) {\n var allColSpecs = options.resourceAreaColumns || [];\n var superHeaderRendering = null;\n if (!allColSpecs.length) {\n allColSpecs.push({\n headerClassNames: options.resourceAreaHeaderClassNames,\n headerContent: options.resourceAreaHeaderContent || 'Resources',\n headerDidMount: options.resourceAreaHeaderDidMount,\n headerWillUnmount: options.resourceAreaHeaderWillUnmount,\n });\n }\n else if (options.resourceAreaHeaderContent) { // weird way to determine if content\n superHeaderRendering = {\n headerClassNames: options.resourceAreaHeaderClassNames,\n headerContent: options.resourceAreaHeaderContent,\n headerDidMount: options.resourceAreaHeaderDidMount,\n headerWillUnmount: options.resourceAreaHeaderWillUnmount,\n };\n }\n var plainColSpecs = [];\n var groupColSpecs = []; // part of the colSpecs, but filtered out in order to put first\n var groupSpecs = [];\n var isVGrouping = false;\n for (var _i = 0, allColSpecs_1 = allColSpecs; _i < allColSpecs_1.length; _i++) {\n var colSpec = allColSpecs_1[_i];\n if (colSpec.group) {\n groupColSpecs.push(__assign(__assign({}, colSpec), { cellClassNames: colSpec.cellClassNames || options.resourceGroupLabelClassNames, cellContent: colSpec.cellContent || options.resourceGroupLabelContent, cellDidMount: colSpec.cellDidMount || options.resourceGroupLabelDidMount, cellWillUnmount: colSpec.cellWillUnmount || options.resourceGroupLaneWillUnmount }));\n }\n else {\n plainColSpecs.push(colSpec);\n }\n }\n // BAD: mutates a user-supplied option\n var mainColSpec = plainColSpecs[0];\n mainColSpec.isMain = true;\n mainColSpec.cellClassNames = mainColSpec.cellClassNames || options.resourceLabelClassNames;\n mainColSpec.cellContent = mainColSpec.cellContent || options.resourceLabelContent;\n mainColSpec.cellDidMount = mainColSpec.cellDidMount || options.resourceLabelDidMount;\n mainColSpec.cellWillUnmount = mainColSpec.cellWillUnmount || options.resourceLabelWillUnmount;\n if (groupColSpecs.length) {\n groupSpecs = groupColSpecs;\n isVGrouping = true;\n }\n else {\n var hGroupField = options.resourceGroupField;\n if (hGroupField) {\n groupSpecs.push({\n field: hGroupField,\n labelClassNames: options.resourceGroupLabelClassNames,\n labelContent: options.resourceGroupLabelContent,\n labelDidMount: options.resourceGroupLabelDidMount,\n labelWillUnmount: options.resourceGroupLabelWillUnmount,\n laneClassNames: options.resourceGroupLaneClassNames,\n laneContent: options.resourceGroupLaneContent,\n laneDidMount: options.resourceGroupLaneDidMount,\n laneWillUnmount: options.resourceGroupLaneWillUnmount,\n });\n }\n }\n var allOrderSpecs = options.resourceOrder || DEFAULT_RESOURCE_ORDER;\n var plainOrderSpecs = [];\n for (var _a = 0, allOrderSpecs_1 = allOrderSpecs; _a < allOrderSpecs_1.length; _a++) {\n var orderSpec = allOrderSpecs_1[_a];\n var isGroup = false;\n for (var _b = 0, groupSpecs_1 = groupSpecs; _b < groupSpecs_1.length; _b++) {\n var groupSpec = groupSpecs_1[_b];\n if (groupSpec.field === orderSpec.field) {\n groupSpec.order = orderSpec.order; // -1, 0, 1\n isGroup = true;\n break;\n }\n }\n if (!isGroup) {\n plainOrderSpecs.push(orderSpec);\n }\n }\n return {\n superHeaderRendering: superHeaderRendering,\n isVGrouping: isVGrouping,\n groupSpecs: groupSpecs,\n colSpecs: groupColSpecs.concat(plainColSpecs),\n orderSpecs: plainOrderSpecs,\n };\n}\n\nvar main = createPlugin({\n deps: [\n premiumCommonPlugin,\n resourceCommonPlugin,\n timelinePlugin,\n ],\n initialView: 'resourceTimelineDay',\n views: {\n resourceTimeline: {\n type: 'timeline',\n component: ResourceTimelineView,\n needsResourceData: true,\n resourceAreaWidth: '30%',\n resourcesInitiallyExpanded: true,\n eventResizableFromStart: true, // TODO: not DRY with this same setting in the main timeline config\n },\n resourceTimelineDay: {\n type: 'resourceTimeline',\n duration: { days: 1 },\n },\n resourceTimelineWeek: {\n type: 'resourceTimeline',\n duration: { weeks: 1 },\n },\n resourceTimelineMonth: {\n type: 'resourceTimeline',\n duration: { months: 1 },\n },\n resourceTimelineYear: {\n type: 'resourceTimeline',\n duration: { years: 1 },\n },\n },\n});\n\nexport default main;\nexport { ResourceTimelineLane, ResourceTimelineView, SpreadsheetRow };\n//# sourceMappingURL=main.js.map\n","import { Modal } from './modal.js'\r\nimport { Calendar } from '@fullcalendar/core';\r\nimport resourceTimelineWeek from '@fullcalendar/resource-timeline';\r\nimport deLocale from '@fullcalendar/core/locales/de';\r\n\r\nclass BVKCalendar {\r\n _targetItemId = ''\r\n _initialView = ''\r\n _resourceUri = ''\r\n _resourceList = []\r\n _eventUri = ''\r\n _dialog = {}\r\n _isLoggedIn = false;\r\n _isAdmin = false;\r\n _userId = \"\";\r\n _data = null;\r\n\r\n /**\r\n * \r\n * @param {object} props \r\n * @param {string} props.targetItemId \r\n * @param {string} props.resourceUri \r\n * @param {string} props.resourceList \r\n * @param {string} props.eventUri \r\n * @param {string} props.initialView \r\n * @param {object} props.dialogOptions \r\n * @param {string} props.dialogOptions.domId \r\n * @param {object} props.dialogOptions.options \r\n \r\n * @param {object} props.dialogOptions2 \r\n * @param {string} props.dialogOptions2.domId \r\n * @param {object} props.dialogOptions2.options \r\n \r\n * @param {boolean} props.isLoggedIn\r\n * @param {boolean} props.isAdmin\r\n * @param {string} props.userId\r\n * @param {object} props.data\r\n */\r\n constructor(props) {\r\n this._targetItemId = props.targetItemId || 'calendar';\r\n this._resourceUri = props.resourceUri || null;\r\n this._resourceList = props.resourceList || null;\r\n this._eventUri = props.eventUri;\r\n this._initialView = props.initialView || 'resourceTimelineWeek';\r\n this._dialog = new Modal(props.dialogOptions);\r\n this._dialog2 = new Modal(props.dialogOptions2);\r\n this._isLoggedIn = props.isLoggedIn || false;\r\n this._isAdmin = props.isAdmin || false;\r\n this._userId = props.userId || false;\r\n this._data = props.data || null;\r\n }\r\n get Resources() {\r\n if (this._resourceUri == null) return this._resourceList;\r\n return this._resourceUri;\r\n }\r\n init = (targetItemId) => {\r\n try {\r\n const targetId = targetItemId || this._targetItemId;\r\n const calendarEl = document.getElementById(targetId);\r\n const calendar = new Calendar(calendarEl, {\r\n plugins: [resourceTimelineWeek],\r\n initialView: 'resourceTimelineWeek',\r\n locale: deLocale,\r\n timeZone: 'UTC',\r\n resourceAreaWidth: \"30%\",\r\n resources: this.Resources,\r\n events: this._eventUri,\r\n resourceOrder: \"number\",\r\n dateClick: this.dateClick,\r\n eventClick: this.eventClick,\r\n slotMinTime: \"08:00:00\",\r\n slotMaxTime: \"23:00:00\",\r\n schedulerLicenseKey: '0366132045-fcs-1638443135'\r\n\r\n });\r\n calendar.render();\r\n calendar.updateSize();\r\n try {\r\n\r\n\r\n document.getElementsByClassName(\"fc-today-button\")[0].addEventListener(\"click\", () => {\r\n setTimeout(\r\n () => {\r\n let date = new Date();\r\n let month = (date.getMonth() + 1) < 10 ? \"0\" + (date.getMonth() + 1) : (date.getMonth() + 1);\r\n let dateString = date.getFullYear() + \"-\" + month + \"-\" + date.getDate();\r\n document.querySelector(\"[data-date^='\" + dateString + \"']\").scrollIntoView({ block: 'nearest', inline: 'center' })\r\n\r\n }, 200);\r\n })\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n this._instance = calendar;\r\n try {\r\n setTimeout(\r\n () => {\r\n let date = new Date();\r\n let month = (date.getMonth() + 1) < 10 ? \"0\" + (date.getMonth() + 1) : (date.getMonth() + 1);\r\n let dateString = date.getFullYear() + \"-\" + month + \"-\" + date.getDate();\r\n document.querySelector(\"[data-date^='\" + dateString + \"']\").scrollIntoView({ block: 'nearest', inline: 'center' })\r\n\r\n }, 500);\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n\r\n\r\n dateClick = async (info) => {\r\n if (!this._isLoggedIn && !this._isAdmin) return;\r\n if (!this._isAdmin && info.resource.id == \"11000000-0000-0000-0000-000000000000\") return;\r\n const dateOptions = { weekday: 'long', year: 'numeric', month: 'short', day: 'numeric' };\r\n this._dialog.open(info);\r\n }\r\n eventClick = async (info) => {\r\n if (!this._isLoggedIn && !this._isAdmin) return;\r\n this._data.addEndpoint(\"bookings/\" + info.event.id);\r\n this._data.getData('bookings/' + info.event.id).then(booking => {\r\n if (!this._isAdmin && booking.createdBy.id != this._userId) return;\r\n // console.log(booking);\r\n info.booking = booking;\r\n this._dialog2.open(info);\r\n })\r\n /*\r\n // window.open('/forms/booking/delete/'+ info.event.id)\r\n if (confirm('Moechten sie den Termin wirklich loeschen?'))\r\n window.open('/forms/booking/delete/' + info.event.id);\r\n console.log(info)*/\r\n\r\n\r\n\r\n\r\n\r\n }\r\n\r\n}\r\n\r\nexport { BVKCalendar }\r\n","import { APIConnector } from './modules/api.js'\r\nimport { BVKCalendar } from './modules/calendar.js'\r\n\r\nconst connection = new APIConnector('/api/', ['fields', \"bookings\"]);\r\n\r\nlet isLoggedIn = false;\r\nlet isAdmin = false;\r\nlet user = null;\r\n\r\nconst preInit = async () => {\r\n try {\r\n return connection.getData('fields').then(fields => {\r\n connection.getData('bookings').then(bookings => {\r\n return connection.data;\r\n })\r\n });\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n}\r\n\r\nconst prepareFields = (fields) => {\r\n return fields.map((f) => {\r\n if (f.number != 0) f.title = f.resource;\r\n return f;\r\n })\r\n\r\n}\r\n\r\nconst init = async () => {\r\n try {\r\n await preInit();\r\n\r\n const fields = prepareFields(connection.data.fields);\r\n const dialogOptions = {\r\n domId: 'exampleModal',\r\n options: {\r\n startId: \"DialogStart\",\r\n startHourId: \"DialogStartHours\",\r\n fieldsId: \"DialogField\"\r\n\r\n\r\n }\r\n };\r\n const dialogOptions2 = {\r\n domId: 'otherModal',\r\n options: {\r\n startId: \"DialogStart2\",\r\n startHourId: \"DialogStartHours2\",\r\n fieldsId: \"DialogField2\"\r\n\r\n }\r\n }\r\n const calendarOptions = {\r\n targetItemId: 'calendar',\r\n resourceUri: null,\r\n resourceList: fields,\r\n eventUri: '/api/Bookings',\r\n initialView: null,\r\n dialogOptions: dialogOptions,\r\n dialogOptions2: dialogOptions2,\r\n isAdmin: isAdmin,\r\n isLoggedIn: isLoggedIn,\r\n userId: user,\r\n data: connection\r\n };\r\n const calendar = new BVKCalendar(calendarOptions);\r\n calendar.init('calendar');\r\n window.calendar = calendar;\r\n const button = document.createElement('button');\r\n button.type = \"button\";\r\n button.id = \"theButton\";\r\n button.innerHTML = \"Buchen\"\r\n document.getElementsByClassName(\"fc-today-button\")[0].parentElement.appendChild(button);\r\n button.classList.add(\"fc-today-button\")\r\n button.classList.add(\"fc-button\")\r\n button.classList.add(\"fc-button-primary\")\r\n button.addEventListener(\"click\", () => { calendar._dialog.open() })\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n\r\n}\r\nwindow.init = init;\r\nwindow.onClose = () => {\r\n calendar._dialog.close();\r\n calendar._instance.refetchEvents()\r\n\r\n\r\n}\r\nwindow.setAdmin = () => {\r\n isAdmin = !isAdmin;\r\n}\r\nwindow.setLoggedIn = () => {\r\n isLoggedIn = !isLoggedIn;\r\n}\r\nwindow.setUserId = (userId) => {\r\n user = userId;\r\n}\r\nexport default init;","class APIConnector {\r\n _url = '';\r\n _endpoints = []\r\n _data = {}\r\n constructor(url, endpoints) {\r\n this._url = url || '/api/';\r\n this._endpoints = endpoints || [];\r\n this._data = {}\r\n }\r\n get data() {\r\n return this._data;\r\n }\r\n get endpoints() {\r\n return this._endpoints;\r\n }\r\n getDataByEndpoint = (endpoint) => {\r\n\r\n }\r\n addEndpoint = (endpoint) => {\r\n if (!this.endpoints.includes(endpoint)) this.endpoints.push(endpoint);\r\n }\r\n\r\n getData = async (endpoint) => {\r\n try {\r\n return fetch(this._url + endpoint)\r\n .then((response) => response.json())\r\n .then((data) => {\r\n this._data[endpoint] = data;\r\n return (data);\r\n })\r\n .catch((error) => {\r\n console.error('Error:', error);\r\n });\r\n } catch (error) {\r\n console.error('Error:', error);\r\n\r\n }\r\n }\r\n}\r\n\r\nexport { APIConnector }"],"names":["affix","buttonText","de","code","week","dow","doy","prev","next","today","year","month","day","list","weekText","weekTextLong","allDayText","moreLinkText","n","noEventsText","buttonHints","concat","viewHint","navLinkHint","moreLinkHint","eventCnt","closeHint","timeHint","eventHint","exports","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","module","__webpack_modules__","Modal","_domId","_instance","_domInstance","_options","_info","constructor","props","this","domId","options","document","getElementById","init","bootstrap","addEventListener","onClose","onOpen","error","console","event","onSubmit","async","info","data","resourceId","resource","id","start","date","end","postData","then","open","startDate","startId","startHour","startHourId","dialogFields","fieldsId","value","booking","createdBy","userName","jsEvent","type","dateStr","split","fieldName","toString","toISOString","_def","resourceIds","Event","dispatchEvent","e","show","close","hide","rawResponse","fetch","method","headers","body","JSON","stringify","json","window","location","reload","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","create","assign","t","s","i","arguments","length","apply","__spreadArray","to","from","pack","ar","l","slice","u","o","r","f","c","a","parentNode","removeChild","h","children","defaultProps","v","key","ref","__k","__b","__e","__d","__c","__h","__v","vnode","context","_","indexOf","k","base","push","g","__r","debounceRendering","setTimeout","sort","some","__P","j","__n","ownerSVGElement","z","w","y","x","C","isArray","m","A","N","M","appendChild","nextSibling","insertBefore","$","setProperty","test","H","style","cssText","replace","toLowerCase","T","I","removeEventListener","removeAttribute","setAttribute","contextType","__E","render","O","sub","state","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","L","diffed","localName","nodeType","createTextNode","createElementNS","createElement","is","childNodes","dangerouslySetInnerHTML","attributes","name","__html","innerHTML","checked","current","unmount","componentWillUnmount","P","firstChild","getDerivedStateFromError","setState","componentDidCatch","forceUpdate","shift","__H","__N","__V","filter","requestAnimationFrame","clearTimeout","cancelAnimationFrame","isPureReactComponent","__f","Symbol","for","map","U","D","__u","__a","__R","__O","pop","fallback","W","delete","revealOrder","size","splice","get","Map","reverse","set","Z","defineProperty","configurable","writable","G","J","K","cancelBubble","Q","defaultPrevented","persist","isPropagationStopped","isDefaultPrevented","nativeEvent","nn","class","tn","multiple","selected","defaultValue","className","enumerable","$$typeof","en","globalObj","globalThis","FullCalendarVDom","warn","Component","createRef","Fragment","createContext","ContextType","Consumer","Provider","origProvider","_this","isNew","subs_1","_props","old","createPortal","containerInfo","flushSync","runBeforeFlush","oldDebounceRendering","callbackQ","callback","FakeComponent","unmountComponentAtNode","node","_super","Error","EventSourceApi","internalEventSource","remove","dispatch","sourceId","refetch","sourceIds","isRefetch","publicId","meta","url","format","removeElement","el","elementClosest","selector","closest","documentElement","contains","elementMatches","parentElement","matches","matchesSelector","msMatchesSelector","findElements","container","containers","HTMLElement","allMatches","querySelectorAll","PIXEL_PROP_RE","applyStyle","propName","applyStyleProp","val","getEventTargetViaRoot","ev","_a","_b","composedPath","target","guid$1","getUniqueDomId","listenBySelector","eventType","handler","attachedHandler","matchedChild","buildDelegationHandler","createAriaKeyboardAttrs","tabIndex","onKeyDown","preventDefault","guidNumber","guid","parseFieldSpecs","input","token","specs","tokens","charAt","field","substring","order","func","compareByFieldSpecs","obj0","obj1","fieldSpecs","cmp","compareByFieldSpec","fieldSpec","flexibleCompare","localeCompare","padStart","len","substr","formatWithOrdinals","formatter","args","fallbackText","reduce","str","arg","index","isInt","computeSmallestCellWidth","cellEl","allWidthEl","querySelector","contentWidthEl","getBoundingClientRect","width","DAY_IDS","addDays","dateToUtcArray","arrayToUtcDate","addMs","diffDays","m0","m1","valueOf","diffWholeDays","timeAsMs","Math","round","startOfDay","getUTCFullYear","getUTCMonth","getUTCDate","weekOfGivenYear","marker","firstWeekStart","firstWeekOffset","dayStart","days","floor","fwd","getUTCDay","dateToLocalArray","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","arrayToLocalDate","Date","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","UTC","isValidDate","isNaN","createEventInstance","defId","range","forcedStartTzo","forcedEndTzo","instanceId","mergeProps","propObjs","complexPropsMap","dest","name_1","complexObjs","unshift","name_2","filterHash","hash","filtered","mapHash","newHash","arrayToHash","_i","a_1","hashValuesToArray","obj","isPropsEqual","getUnequalProps","keys","compareObjs","oldProps","newProps","equalityFuncs","val0","val1","comparator","collectFromHash","startIndex","endIndex","step","res","expandRecurring","eventStore","framingRange","dateEnv","pluginHooks","defs","instances","instance","recurringDef","def","duration","allDay","defaultAllDayEventDuration","defaultTimedEventDuration","starts_1","expandRecurringRanges","recurringTypes","add","eventDef","markers","typeId","expand","typeData","subtract","INTERNAL_UNITS","PARSE_RE","createDuration","unit","exec","sign","years","months","parseInt","milliseconds","parseString","parseObject","hours","hour","minutes","minute","seconds","second","millisecond","ms","weeks","specifiedWeeks","asCleanDays","dur","asRoughDays","asRoughMs","wholeDivideDurations","numerator","denominator","localRes","greatestDurationDenominator","buildIsoString","timeZoneOffset","stripZeroTime","formatTimeZoneOffset","formatDayString","doIso","abs","mins","isArraysEqual","a0","a1","equalityFunc","memoize","workerFunc","resEquality","teardownFunc","currentArgs","currentRes","newArgs","memoizeObjArg","currentArg","newArg","memoizeArraylike","currentArgSets","currentResults","newArgSets","currentLen","newLen","memoizeHashlike","currentArgHash","currentResHash","newArgHash","newResHash","EXTENDED_SETTINGS_AND_SEVERITIES","separator","omitZeroMinute","meridiem","omitCommas","STANDARD_DATE_PROP_SEVERITIES","timeZoneName","era","weekday","MERIDIEM_RE","COMMA_RE","MULTI_SPACE_RE","LTR_RE","UTC_RE","NativeFormatter","formatSettings","standardDateProps","extendedSettings","severity","max","buildFormattingFunc","formatRange","betterDefaultSeparator","d0","d1","ca","diffSeverity","calendarSystem","getMarkerYear","getMarkerMonth","getMarkerDay","biggestUnitForPartial","full0","full1","partialFormattingFunc","biggestUnit","partialOptions","computePartialFormattingOptions","partial0","partial1","insertion","i0","found0","before0","after0","i1","found1","before1","after1","before","after","findCommonInsertion","defaultSeparator","getLargestUnit","standardDatePropCnt","num","computeWeekNumber","locale","display","parts","simpleNumberFormat","direction","join","sanitizeSettings","timeZone","zeroFormat","normalFormat","Intl","DateTimeFormat","codes","zeroProps","tzoStr","replaced","injectTzoStr","trim","toLocaleLowerCase","postProcess","buildNativeFormattingFunc","expandZonedMarker","dateInfo","markerToArray","array","createVerboseFormattingArg","startInfo","localeCodes","CmdFormatter","cmdStr","cmdFormatter","FuncFormatter","createFormatter","BASE_OPTION_REFINERS","navLinkDayClick","identity","navLinkWeekClick","bootstrapFontAwesome","buttonIcons","customButtons","nextDayThreshold","scrollTime","scrollTimeReset","Boolean","slotMinTime","slotMaxTime","dayPopoverFormat","slotDuration","snapDuration","headerToolbar","footerToolbar","defaultRangeSeparator","titleRangeSeparator","forceEventDuration","dayHeaders","dayHeaderFormat","dayHeaderClassNames","dayHeaderContent","dayHeaderDidMount","dayHeaderWillUnmount","dayCellClassNames","dayCellContent","dayCellDidMount","dayCellWillUnmount","initialView","aspectRatio","Number","weekends","weekNumberCalculation","weekNumbers","weekNumberClassNames","weekNumberContent","weekNumberDidMount","weekNumberWillUnmount","editable","viewClassNames","viewDidMount","viewWillUnmount","nowIndicator","nowIndicatorClassNames","nowIndicatorContent","nowIndicatorDidMount","nowIndicatorWillUnmount","showNonCurrentDates","lazyFetching","startParam","endParam","timeZoneParam","locales","themeSystem","dragRevertDuration","dragScroll","allDayMaintainDuration","unselectAuto","dropAccept","eventOrder","eventOrderStrict","handleWindowResize","windowResizeDelay","longPressDelay","eventDragMinDistance","expandRows","height","contentHeight","weekNumberFormat","eventResizableFromStart","displayEventTime","displayEventEnd","progressiveEventRendering","businessHours","initialDate","now","eventDataTransform","stickyHeaderDates","stickyFooterScrollbar","viewHeight","defaultAllDay","eventSourceFailure","eventSourceSuccess","eventDisplay","eventStartEditable","eventDurationEditable","eventOverlap","eventConstraint","eventAllow","eventBackgroundColor","eventBorderColor","eventTextColor","eventColor","eventClassNames","eventContent","eventDidMount","eventWillUnmount","selectConstraint","selectOverlap","selectAllow","droppable","unselectCancel","slotLabelFormat","slotLaneClassNames","slotLaneContent","slotLaneDidMount","slotLaneWillUnmount","slotLabelClassNames","slotLabelContent","slotLabelDidMount","slotLabelWillUnmount","dayMaxEvents","dayMaxEventRows","dayMinWidth","slotLabelInterval","allDayClassNames","allDayContent","allDayDidMount","allDayWillUnmount","slotMinWidth","navLinks","eventTimeFormat","rerenderDelay","selectMinDistance","selectable","selectLongPressDelay","eventLongPressDelay","selectMirror","eventMaxStack","eventMinHeight","eventMinWidth","eventShortHeight","slotEventOverlap","plugins","firstDay","dayCount","dateAlignment","dateIncrement","hiddenDays","monthMode","fixedWeekCount","validRange","visibleRange","titleFormat","eventInteractive","moreLinkClick","moreLinkClassNames","moreLinkContent","moreLinkDidMount","moreLinkWillUnmount","BASE_OPTION_DEFAULTS","center","CALENDAR_LISTENER_REFINERS","datesSet","eventsSet","eventAdd","eventChange","eventRemove","windowResize","eventClick","eventMouseEnter","eventMouseLeave","select","unselect","loading","_unmount","_beforeprint","_afterprint","_noEventDrop","_noEventResize","_resize","_scrollRequest","CALENDAR_OPTION_REFINERS","views","initialEvents","events","eventSources","COMPLEX_OPTION_COMPARATORS","isMaybeObjectsEqual","VIEW_OPTION_REFINERS","component","buttonTextKey","dateProfileGeneratorClass","usesMinMaxTime","classNames","content","didMount","willUnmount","mergeRawOptions","optionSets","refineProps","refiners","refined","extra","raw","parseEvents","rawEvents","eventSource","allowOpenRange","eventRefiners","buildEventRefiners","rawEvents_1","tuple","parseEvent","eventTupleToStore","mergeEventStores","store0","store1","filterEventStoreDefs","filterFunc","parseClassNames","EVENT_UI_REFINERS","startEditable","durationEditable","constraint","overlap","allow","color","backgroundColor","borderColor","textColor","EMPTY_EVENT_UI","constraints","allows","createEventUi","normalizeConstraint","combineEventUis","uis","combineTwoEventUis","item0","item1","EVENT_NON_DATE_REFINERS","groupId","title","interactive","EVENT_DATE_REFINERS","EVENT_REFINERS","extendedProps","refineEventDef","computeIsDefaultAllDay","recurringRes","parsed","parse","allDayGuess","parseRecurring","parseEventDef","singleRes","startMeta","endMeta","startMarker","hasEnd","endMarker","startInput","createMarkerMeta","isTimeUnspecified","forcedTzo","parseSingle","ui","eventDefMemberAdders","memberAdder","freeze","computeAlignedDayRange","timedRange","dayCnt","computeVisibleDayRange","startDay","endDay","endTimeMS","diffDates","date0","date1","largeUnit","diffWholeYears","diffWholeMonths","m0day","m1day","invertRanges","ranges","constraintRange","dateRange","invertedRanges","compareRanges","range0","range1","intersectRanges","newRange","min","rangesIntersect","rangeContainsRange","outerRange","innerRange","rangeContainsMarker","sliceEventStore","eventUiBases","inverseBgByGroupId","inverseBgByDefId","defByGroupId","bgRanges","fgRanges","eventUis","compileEventUis","origRange","normalRange","slicedRange","isStart","isEnd","invertedRanges_1","invertedRange","invertedRanges_2","bg","fg","setElSeg","seg","fcSeg","getElSeg","eventDefs","compileEventUi","sortEventSegs","segs","eventOrderSpecs","objs","buildSegCompareObj","_seg","eventRange","computeSegDraggable","transformers","isDraggableTransformers","transformers_1","transformer","computeSegStartResizable","computeSegEndResizable","getSegMeta","todayRange","nowDate","segRange","isPast","isFuture","isToday","STANDARD_PROPS","buildRangeApiWithTimeZone","omitTime","buildRangeApi","toDate","startStr","formatIso","endStr","fabricateEventRange","dateSpan","buildDateSpanApiWithContext","span","dateSpanTransforms","transform","getDefaultEventEnd","applyMutationToEventDef","eventConfig","mutation","standardProps","startDelta","endDelta","copy","eventDefMutationAppliers","applier","applyMutationToEventInstance","eventInstance","forceAllDay","clearEnd","datesDelta","ViewApi","getCurrentData","calendarApi","viewTitle","dateProfile","activeRange","currentRange","getOption","EVENT_SOURCE_REFINERS","success","failure","parseEventSource","rawObj","buildEventSourceRefiners","metaRes","eventSourceDefs","parseMeta","sourceDefId","buildEventSourceMeta","_raw","isFetching","latestFetchId","fetchRange","eventSourceRefiners","getNow","nowInput","createNowMarker","createMarker","CalendarApi","currentDataManager","action","viewApi","batchRendering","updateSize","trigger","setOption","optionName","rawOptionValue","currentCalendarOptionsInput","getAvailableLocaleCodes","availableRawLocales","on","handlerName","currentCalendarOptionsRefiners","emitter","off","changeView","viewType","dateOrRange","dateMarker","zoomTo","spec","viewSpecs","getUnitViewSpec","toolbarConfig","viewTypes","header","viewsWithButtons","footer","singleUnit","prevYear","addYears","currentDate","nextYear","calendarOptions","gotoDate","zonedDateInput","incrementDate","deltaInput","delta","formatDate","settings","dateOrObj","endDate","selectionInput","selection","defaultDuration","parseOpenDateSpan","parseDateSpan","pev","view","triggerDateSelect","dateSelection","origEvent","triggerDateUnselect","addEvent","eventInput","sourceInput","EventApi","triggerEventAdd","sourceApi","getEventSourceById","newEventApi","eventApi","relatedEvents","revert","eventApiToStore","getEventById","getEvents","currentData","buildEventApis","removeAllEvents","getEventSources","sourceHash","sourceApis","internalId","addEventSource","sources","removeAllEventSources","refetchEvents","scrollToTime","timeInput","time","_context","setProp","mutate","setExtendedProp","setStart","granularity","maintainDuration","setEnd","endInput","setDates","instanceRange","moveStart","moveEnd","moveDates","setAllDay","formatInput","context_1","eventStore_1","relevantEvents","def_1","newStore","lookDef","def0","def1","getRelevantEvents","eventConfigBase","eventConfigs","applyMutationToEventStore","oldEvent","asStore","toPlainObject","collapseColor","collapseExtendedProps","toJSON","excludeInstance","eventApis","excludeInstanceId","theClass","calendarSystemClassMap","GregorianCalendarSystem","arrayToMarker","arr","ISO_RE","DateEnv","isNamedTimeZone","namedTimeZoneImpl","canComputeOffset","weekDow","weekDoy","weekNumberFunc","timestampToMarker","getYear","addMonths","greatestWholeUnit","diffWholeWeeks","diffHours","diffMinutes","diffSeconds","countDurationsBetween","diff","startOf","startOfYear","startOfMonth","startOfWeek","startOfHour","startOfMinute","startOfSecond","nextW","weekOfYear","dateOptions","offsetForMarker","isEndExclusive","extraOptions","omitTimeZoneOffset","timestampToArray","getTimezoneOffset","offsetForArray","globalLocales","MINIMAL_RAW_EN_LOCALE","RAW_EN_LOCALE","organizeRawLocales","explicitRawLocales","defaultCode","allRawLocales","rawLocaleMap","allRawLocales_1","rawLocale","buildLocale","inputSingular","available","codeArg","simpleId","queryRawLocale","parseLocale","queryLocale","merged","NumberFormat","canVGrowWithinCell","DEF_DEFAULTS","startTime","endTime","daysOfWeek","parseBusinessHours","rawDef","refineInputs","translateRect","rect","deltaX","deltaY","left","right","top","bottom","getCanVGrowWithinCell","position","possible","offsetHeight","computeCanVGrowWithinCell","EMPTY_EVENT_STORE","Splitter","getKeysForEventDefs","_getKeysForEventDefs","splitDateSelection","_splitDateSpan","splitEventStore","_splitEventStore","splitIndividualUi","_splitIndividualUi","splitEventDrag","_splitInteraction","splitEventResize","eventUiBuilders","splitProps","keyInfos","getKeyInfo","defKeys","dateSelections","individualUi","eventStores","eventDrags","eventDrag","eventResizes","eventResize","buildEventUiForKey","keyInfo","buildEventUi","eventSelection","dateSpans","keys_1","getKeysForDateSpan","getKeysForEventDef","splitStores","_c","splitHashes","interaction","splitStates","affectedStores_1","affectedEvents","mutatedKeysByDefId","mutatedEvents","mutatedStores_1","populate","isEvent","allUi","eventUiForKey","baseParts","stuff","getDateMeta","isDisabled","isOther","getDayClassNames","theme","getClass","getSlotClassNames","DAY_FORMAT","WEEK_FORMAT","buildNavLinkAttrs","isTabbable","zonedDate","handleInteraction","customAction","onClick","_scrollbarWidths","_isRtlScrollbarOnLeft","getIsRtlScrollbarOnLeft","outerEl","border","padding","overflow","computeIsRtlScrollbarOnLeft","getScrollbarWidths","computeScrollbarWidthsForEl","computeScrollbarWidths","clientHeight","offsetWidth","clientWidth","computeEdges","getPadding","computedStyle","getComputedStyle","borderLeft","borderLeftWidth","borderRight","borderRightWidth","borderTop","borderTopWidth","borderBottom","borderBottomWidth","badScrollbarWidths","scrollbarLeftRight","scrollbarBottom","scrollbarLeft","scrollbarRight","paddingLeft","paddingRight","paddingTop","paddingBottom","computeInnerRect","goWithinPadding","doFromWindowViewport","outerRect","pageXOffset","pageYOffset","computeRect","edges","unpromisify","isResolved","wrappedSuccess","wrappedFailure","Emitter","handlers","thisContext","setThisContext","setOptions","addToHash","removeFromHash","attachedHandlers","optionHandler","handlers_1","hasHandlers","PositionCache","originEl","els","isHorizontal","isVertical","originClientRect","buildElHorizontals","buildElVerticals","originClientLeft","lefts","rights","originClientTop","tops","bottoms","leftToIndex","leftPosition","topToIndex","topPosition","getWidth","leftIndex","getHeight","topIndex","ScrollController","getMaxScrollTop","getScrollHeight","getClientHeight","getMaxScrollLeft","getScrollWidth","getClientWidth","canScrollVertically","canScrollHorizontally","canScrollUp","getScrollTop","canScrollDown","canScrollLeft","getScrollLeft","canScrollRight","Theme","ElementScrollController","scrollTop","scrollLeft","setScrollTop","setScrollLeft","scrollWidth","scrollHeight","WindowScrollController","scroll","iconOverrideOption","setIconOverride","iconOverrideHash","iconClassesCopy","buttonName","iconClasses","applyIconOverridePrefix","prefix","iconOverridePrefix","classes","getIconClass","isRtl","rtlIconClasses","baseIconClass","getCustomButtonIconClass","customButtonProps","iconOverrideCustomButtonOption","ScrollResponder","execFunc","handleScrollRequest","request","queuedRequest","drain","fireInitialScroll","detach","update","isDatesNew","ViewContextType","buildViewContext","viewSpec","viewOptions","dateProfileGenerator","registerInteractiveComponent","unregisterInteractiveComponent","addResizeHandler","removeResizeHandler","createScrollResponder","PureComponent","nextProps","nextState","debug","log","propEquality","stateEquality","safeSetState","newState","addPropsEquality","addStateEquality","BaseComponent","setRef","DateComponent","uid","prepareHits","queryHit","positionLeft","positionTop","elWidth","elHeight","isValidSegDownEl","isValidDateDownEl","createPlugin","deps","reducers","isLoadingFuncs","contextInit","eventDragMutationMassagers","dateSelectionTransformers","datePointTransforms","viewPropsTransformers","isPropsValid","externalDefTransforms","viewContainerAppends","eventDropTransformers","componentInteractions","calendarInteractions","themeClasses","namedTimeZonedImpl","elementDraggingImpl","optionChangeHandlers","scrollGridImpl","contentTypeHandlers","listenerRefiners","optionRefiners","propSetHandlers","StandardTheme","ensureViewDef","defaultConfigs","overrideConfigs","viewDef","defaultConfig","overrideConfig","queryProp","theComponent","superType","superDef","defaults","rawOptions","overrides","buildViewDef","root","tableCellShaded","buttonGroup","button","buttonActive","RenderHook","rootElRef","handleRootEl","elRef","hookProps","MountHook","ContentHook","defaultContent","backupElRef","innerElRef","innerContent","normalizeClassNames","CustomContentRenderContext","renderId","ContentHookInner","renderInnerContent","updateCustomContent","customContentInfo","destroy","getInnerContent","getContentMeta","contentKey","contentVal","buildLifecycleFuncs","normalizeContent","searchKey","rootEl","buildClassNameNormalizer","currentGenerator","currentHookProps","currentClassNames","generator","ViewRoot","customClassNames","parseViewConfigs","inputs","parseViewConfig","viewProps","viewElRef","buildViewSpecs","defaultInputs","optionOverrides","dynamicOptionOverrides","localeDefaults","viewDefs","compileViewDefs","durationInput","durationUnit","singleUnitOverrides","durationInputMap","createDurationCached","denom","queryButtonText","optionsSubset","buttonTextMap","queryButtonTitle","buttonKey","optionDefaults","buttonTextOverride","buttonTextDefault","buttonTitleOverride","buttonHint","buttonTitleDefault","buildViewSpec","DateProfileGenerator","initHiddenDays","buildPrev","currentDateProfile","forceToValid","prevDate","currentRangeUnit","build","buildNext","nextDate","currentInfo","isRangeAllDay","renderRange","isValid","buildValidRange","trimHiddenDays","buildCurrentRangeInfo","buildRenderRange","adjustActiveRange","buildDateIncrement","validRangeInput","simpleInput","refineRange","buildRangeFromDuration","buildRangeFromDayCount","buildCustomVisibleRange","getFallbackDuration","computeRes","isHiddenDay","skipHiddenDays","runningCount","visibleRangeInput","customAlignment","rangeInput","isHiddenDayHash","inc","isExclusive","computeEventSourcesLoading","addSources","eventSourceHash","sources_1","source","fetchDirtySources","fetchSourcesByIds","doesSourceNeedRange","isSourceDirty","prevSources","sourceIdHash","nextSources","fetchSource","sourceDef","fetchId","xhr","message","excludeStaticSources","ignoreRange","transformEachRawEvent","refinedEvents","rawEvent","refinedEvent","excludeEventsBySourceId","reduceDateSelection","currentSelection","reduceSelectedEvent","currentInstanceId","eventInstanceId","reduceEventDrag","currentDrag","newDrag","reduceEventResize","currentResize","newResize","parseToolbars","calendarOptionOverrides","parseToolbar","sectionStrHash","sectionWidgets","hasTitle","sectionName","sectionRes","parseSection","widgets","sectionStr","calendarCustomButtons","calendarButtonTextOverrides","calendarButtonText","calendarButtonHintOverrides","calendarButtonHints","sectionSubstrs","buttonGroupStr","buttonClick","buttonIcon","click","text","hint","textFallback","prevOrNext","navUnit","requestJson","params","successCallback","failureCallback","toUpperCase","encodeParams","injectQueryStringParams","XMLHttpRequest","setRequestHeader","onload","status","responseText","err","onerror","send","encodeURIComponent","handleEventSources","unfoundSources","newInputs","inputs_1","inputFound","unfoundSources_1","unfoundSource","newInputs_1","newInput","globalPlugins","bind","extraParams","requestParams","customRequestParams","buildRequestParams","errorMessage","startRecur","endRecur","recurringData","clippedFramingRange","dowHash","dayMarker","instanceStarts","instanceStart","expandRanges","html","currentEl","currentHtml","domNodes","currentDomNodes","newDomNodes","newDomNodes_1","newNode","DelayedRunner","drainedOption","isRunning","isDirty","pauseDepths","timeoutId","delay","isPaused","tryDrain","pause","scope","resume","force","drained","clear","TaskRunner","runTaskOption","queue","delayedRunner","task","completedTasks","runTask","buildTitle","buildTitleFormat","CalendarDataManager","currentHooks","currentOverrideDefs","currentGlobalDefs","computeOptionsData","_computeOptionsData","computeCurrentViewData","_computeCurrentViewData","buildPluginHooks","overrideDefs","globalDefs","pluginDefs","isAdded","hooks","addDefs","defs_1","hooks1","hooks0","buildDateEnv","buildTheme","buildDateProfileGenerator","buildViewApi","buildViewUiProps","buildEventUiBySource","buildEventUiBases","parseContextBusinessHours","actionRunner","_handleAction","updateData","currentCalendarOptionsRefined","currentViewOptionsInput","currentViewOptionsRefined","optionsData","currentViewType","currentViewData","initialDateInput","calendarContext","rawSources","rawSources_1","parseInitialSources","initEventSources","initialState","renderableEventStore","selectionConfig","contextAndState","reducer","computeIsLoading","resetOptions","append","reduceDynamicOptionOverrides","reduceViewType","reduceCurrentDate","dp","reduceDateProfile","receiveResponse","reduceEventSources","subset","calEachTransform","sourceEachTransform","transformRawEvents","receiveRawEvents","expandRange","master","filteredDefs","filteredInstances","excludeSubEventStore","reduceEventStore","eventUiSingleBase","eventUiBySource","wasLoading","isLoading","onAction","oldData","changeHandlers","oldCalendarOptions","newCalendarOptions","oldDateEnv","newDateEnv","rezoneEventStoreDates","onData","processRawCalendarOptions","refinedOptions","availableLocaleData","warnUnknownOptions","currentRaw","currentRefined","anyChanges","processRawViewOptions","explicitLocale","isLoadingFunc","viewName","CalendarDataProvider","handleData","dataManager","prevProps","newOptionOverrides","SegHierarchy","strictOrder","allowReslicing","maxCoord","maxStackCnt","levelCoords","entriesByLevel","stackCnts","addSegs","hiddenEntries","insertEntry","entry","findInsertion","isInsertionValid","insertEntryAt","handleInvalidInsertion","levelCoord","thickness","stackCnt","touchingEntry","splitEntry","barrier","partCnt","splitHiddenEntries","entrySpan","barrierSpan","intersectSpans","lateral","insertAt","level","buildEntryKey","newEntry","levelCnt","candidateCoord","touchingLevel","touchingLateral","trackingLevel","trackingCoord","trackingEntries","trackingEntry","searchRes","binarySearch","getEntrySpanEnd","lateralIndex","trackingEntryBottom","destLevel","destLateral","toRects","rects","entries","entries_1","span0","span1","item","searchVal","getItemVal","middleIndex","middleVal","Interaction","isHitComboAllowed","parseInteractionSettings","useEventCenter","interactionSettingsStore","config","ElementDragging","setMirrorIsVisible","bool","setMirrorNeedsRevert","setAutoScrollEnabled","ToolbarSection","widgetGroups","widgetGroup","renderWidgetGroup","isOnlyButtons","widgetGroup_1","widget","titleId","isPressed","activeButton","isTodayEnabled","isPrevEnabled","isNextEnabled","buttonClasses","disabled","groupClassName","Toolbar","startContent","endContent","model","extraClassName","forceLtr","centerContent","renderSection","ViewContainer","availableWidth","handleEl","updateAvailableWidth","handleResize","liquid","labeledById","EventClicking","handleSegClick","segEl","hasUrlContainer","href","EventHovering","onMouseEnter","onMouseLeave","currentMatchedChild","handleEventElRemove","currentSegEl","handleSegLeave","handleSegEnter","triggerEvent","removeHoverListeners","mouseOverEv","realOnMouseLeave_1","mouseLeaveEv","publicEvName","CalendarContent","buildViewPropTransformers","buildToolbarProps","headerRef","footerRef","interactionsStore","viewLabelId","settingsInput","interactions","TheInteractionClass","listeners","listeners_1","resizeRunner","viewAspectRatio","toolbarProps","viewVGrow","isHeightAuto","forPrint","viewContext","renderView","buildAppendContent","CalendarInteractionClass","ViewComponent","todayInfo","prevInfo","nextInfo","theClasses","TheClass","CalendarRoot","handleBeforePrint","handleAfterPrint","computeFallbackHeaderFormat","datesRepDistinctDays","CLASS_NAME","renderInner$1","TableDateCell","dayMeta","navLinkAttrs","colCnt","extraHookProps","role","colSpan","extraDataAttrs","isSticky","WEEKDAY_FORMAT","TableDowCell","dateMeta","extraClassNames","NowTimer","initialNowDate","initialNowQueriedMs","computeTiming","currentState","unroundedNow","currentUnitStart","nextUnitStart","waitMs","buildDayRange","createDayHeaderFormatter","explicitFormat","dateCnt","DayHeader","dates","renderIntro","DaySeriesModel","indices","dayIndex","cnt","sliceRange","firstIndex","getDateDayIndex","lastIndex","clippedFirstIndex","clippedLastIndex","ceil","dayOffset","DayTableModel","daySeries","breakOnWeeks","daysPerRow","rowCnt","cells","buildCells","headerDates","buildHeaderDates","rows","row","col","buildCell","seriesSeg","nextIndex","firstCol","lastCol","Slicer","sliceBusinessHours","_sliceBusinessHours","sliceDateSelection","_sliceDateSpan","_sliceEventStore","sliceEventDrag","_sliceInteraction","sliceEventResize","forceDayIfListItem","sliceProps","extraArgs","eventSegs","dateSelectionSegs","businessHourSegs","fgEventSegs","bgEventSegs","sliceNowDate","computeActiveRange","rangeRes","sliceEventRanges","affectedInstances","segs_1","eventRanges","eventRanges_1","sliceEventRange","segs_2","isComponentAllDay","dateSpanMeta","filterConfig","subjectEventStore","subjectDefs","subjectInstances","subjectConfigs","removals","otherEventStore","otherDefs","otherInstances","otherConfigs","subjectInstanceId","subjectInstance","subjectRange","subjectConfig","subjectDef","allConstraintsPass","eventOverlapFunc","otherInstanceId","otherInstance","calendarEventStore","subjectAllow","subjectDateSpan","origDef","origInstance","isInteractionPropsValid","relevantEventStore","relevantDefs","relevantInstances","selectionRange","selectOverlapFunc","relevantInstanceId","relevantInstance","selectionAllow","isDateSelectionPropsValid","businessHoursUnexpanded","constraints_1","anyRangesContainRange","constraintToRanges","eventStoreToRanges","outerRanges","outerRanges_1","VISIBLE_HIDDEN_RE","Scroller","liquidIsAbsolute","isAbsolute","overflowX","overflowY","overcomeLeft","overcomeRight","overcomeBottom","marginLeft","marginRight","marginBottom","maxHeight","needsXScrolling","realClientWidth","getYScrollbarWidth","needsYScrolling","realClientHeight","getXScrollbarWidth","RefMap","masterCallback","currentMap","depths","callbackMap","handleValue","removed","added","refCallback","collect","getAll","computeShrinkWidth","chunkEls","largestWidth","shrinkCells_1","shrinkCell","getSectionHasLiquidHeight","sectionConfig","getAllowYScrolling","renderChunkContent","chunkConfig","isHeader","tableClassName","syncRowHeights","minWidth","tableMinWidth","tableColGroupNode","rowContent","isColPropsEqual","cols0","cols1","renderMicroColGroup","cols","shrinkWidth","colNodes","cols_1","colProps","sanitizeShrinkWidth","hasShrinkWidth","cols_2","getScrollGridClassNames","getSectionClassNames","wholeTableVGrow","renderScrollShim","getStickyHeaderDates","getStickyFooterScrollbar","SimpleScrollGrid","processCols","scrollerRefs","scrollerElRefs","_handleScrollerEl","forceYScrollbars","scrollerClientWidths","scrollerClientHeights","handleSizing","computeScrollerDims","sectionConfigs","sections","microColGroupNode","collapsibleWidth","currentConfig","configCnt","configI","headSectionNodes","bodySectionNodes","footSectionNodes","isBuggy","roleAttrs","outerContent","renderChunkTd","chunk","isLiquid","sectionKey","rowSyncHeights","reportRowHeightChange","scrollerEl","section","sections_1","getSectionByKey","scrollerElRef","scrollbarWidth","scroller","harnessEl","EventRoot","timeText","isDraggable","disableDragging","isStartResizable","disableResizing","isEndResizable","isMirror","isDragging","isResizing","isDateSelecting","isSelected","standardClassNames","getEventClassNames","StandardEvent","timeFormat","defaultTimeFormat","defaultDisplayEventTime","defaultDisplayEventEnd","startOverride","endOverride","wholeEventStart","wholeEventEnd","segStart","segEnd","isStartDay","isEndDay","buildSegTimeText","renderInnerContent$1","getSegAnchorAttrs","innerProps","NowIndicatorRoot","isAxis","DAY_NUM_FORMAT","DayCellContent","refineDayCellHookProps","showDayNumber","extraProps","dayNumberText","DayCellRoot","refineHookProps","dataAttrs","BgEvent","Popover","handleDocumentMouseDown","handleCloseClick","handleDocumentKeyDown","extraAttrs","parentEl","alignmentEl","alignGridTop","alignmentRect","rect1","rect2","clippingParents","parents","getClippingParents","clippingParents_1","intersection","computeClippedClientRect","popoverDims","popoverTop","popoverLeft","origin_1","offsetParent","MorePopover","dayClassNames","extraDateSpan","dayEl","layer","MoreLinkRoot","linkElRef","isPopoverOpen","popoverId","handleClick","computeRange","buildPublicSeg","allDayDate","allSegs","hiddenSegs","handlePopoverClose","moreCnt","shortText","renderMoreLinkInner","alignmentElRef","popoverContent","updateParentEl","computeEarliestSegStart","pickLatestEnd","pickEarliestStart","seg0","seg1","Calendar","isRendering","isRendered","customContentRenderId","handleAction","renderRunner","handleRenderRequest","currentData_1","setClassNames","setHeight","wasRendering","pauseRendering","resumeRendering","classList","classNames_1","PRESET_LICENSE_KEYS","CSS","zIndex","background","borderStyle","borderWidth","fontSize","borderTopRightRadius","schedulerLicenseKey","currentUrl","status_1","match","purchaseDate","releaseDate","mockSchedulerReleaseDate","processLicenseKey","_rtlScrollSystem","WHEEL_EVENT_NAMES","ScrollListener","isScrolling","isTouching","isRecentlyWheeled","isRecentlyScrolled","wheelWaiter","_handleWheelWaited","scrollWaiter","_handleScrollWaited","handleScroll","startScroll","handleWheel","handleTouchStart","handleTouchEnd","endScroll","passive","WHEEL_EVENT_NAMES_1","eventName","WHEEL_EVENT_NAMES_2","getScrollFromLeftEdge","getRtlScrollSystem","setScrollFromLeftEdge","system","_isStickySupported","IS_MS_EDGE","navigator","userAgent","StickyScrolling","scrollEl","usingRelative","elGeoms","queryElGeoms","viewportWidth","viewportHeight","elDestinations","naturalBound","parentBound","parentWidth","parentHeight","assignRelativePositions","computeElDestinations","textAlign","assignStickyPositions","computeStickySupported","listener","canvasOrigin","getScrollCanvasOrigin","els_1","elRect","computedStyles","parseFloat","viewportTop","viewportLeft","viewportRight","elGeom","destLeft","destTop","ClippedScroller","xScrollbarWidth","yScrollbarWidth","handleScroller","scrollerRef","isScrollbarOnLeft","ScrollSyncer","scrollEls","scrollListeners","bindScroller","scrollListener","isWheel","isTouch","masterEl","assignMaster","scrollEls_1","otherEl","forceScrollLeft","forceScrollTop","ScrollGrid","compileColGroupStats","compileColGroupStat","isColGroupStatsEqual","renderMicroColGroups","clippedScrollerRefs","chunkElRefs","_handleChunkEl","stickyScrollings","scrollSyncersBySection","scrollSyncersByColumn","rowUnstableMap","rowInnerMaxHeightMap","anyRowHeightsChanged","recentSizingCnt","shrinkWidths","forceXScrollbars","sectionRowMaxHeights","isForcedResize","sectionRowMaxHeightsChanged","allowSizing","otherState","computeSectionRowMaxHeights","computeShrinkWidths","updateStickyScrolling","handleRowHeightChange","rowEl","isStable","innerMaxHeight","getRowInnerMaxHeight","has","colGroupStats","colGroups","colGroup","microColGroupNodes","stat","getDims","colGroupStat","totalColWidth","renderMacroColGroup","sectionIndex","chunks","renderChunk","chunkIndex","rowHeights","sectionCnt","chunksPerSection","isVScrollSide","isLastSection","allowXScrolling","allowYScrolling","chunkVGrow","totalColMinWidth","getStickyScrolling","initStickyScrolling","destroyStickyScrolling","getScrollSyncersBySection","initScrollSyncer","destroyScrollSyncer","getScrollSyncersByColumn","updateScrollSyncers","prevState","destroyScrollSyncers","lastSizingDate","SCROLLGRID_RESIZE_INTERVAL","hasShrinkCol","newHeightMap","sectionI","assignableHeights","rowHeightsByChunk","chunkI","chunkEl","isEqualRowCnt","rowHeightsAcrossChunks","chunkHeightSums","sumNumbers","maxTotalSum","rowInChunkCnt","rowInChunkTotalHeight","rowInChunkHeightOthers","rowInChunkHeightFirst","rowInChunkHeights","sideScrollI","lastSectionI","currentScrollers","scrollerEls","argsByKey","stickyScrolling","scrollElsBySection","scrollElsByColumn","scrollElMap","getChunkConfigByIndex","scrollSyncer","numbers","sum","numbers_1","innerHeights","getElHeight","colGroupConfig","sumColProp","total","COL_GROUP_STAT_EQUALITY","stat0","stat1","MAX_TIMELINE_SLOTS","STOCK_SUB_DURATIONS","buildTimelineDateProfile","allOptions","tDateProfile","labelInterval","slotsPerLabel","validateLabelAndSlot","ensureLabelInterval","STOCK_SUB_DURATIONS_3","trySlotDuration","ensureSlotDuration","rawFormats","format1","format2","weekNumbersVisible","format0","currentRangeAs","computeHeaderFormats","headerFormats","rawFormat","isTimeScale","slotUnit","emphasizeWeeks","snapsPerSlot","rawSnapDuration","timeWindowMs","normalizedStart","normalizeDate","normalizedEnd","normalizedRange","slotDates","snapIndex","snapDiff","snapDiffToIndex","snapIndexToDiff","snapCnt","slotCnt","isWeekStarts","prevWeekNumber","slotDates_1","slotDate","weekNumber","isWeekStart","buildIsWeekStarts","cellRows","formats","slotAsDays","guessedSlotUnit","rowUnitsFromFormats","rowCells","leadingCell","isLastRow","isSuperRow","newCell","rowUnit","colspan","buildCellObject","weekStart","buildCellRows","normalDate","STOCK_SUB_DURATIONS_1","tryLabelInterval","STOCK_SUB_DURATIONS_2","TimelineHeaderThInner","TimelineHeaderTh","buildCellNavLinkAttrs","cell","rowLevel","rowInnerHeight","cellDate","TimelineHeaderRows","rowInnerHeights","isLast","isChrono","TimelineCoords","slatRootEl","slatEls","outerCoordCache","innerCoordCache","parent","childNode","findDirectChildren","isDateInRange","dateToCoord","slotCoverage","computeDateSnapCoverage","slotIndex","partial","rangeToCoords","durationToCoord","coord","coordFromLeft","snapDiffInt","snapCoverage","coordToCss","hcoord","coordsToCss","hcoords","TimelineHeader","timerUnit","slatCoords","onMaxCushionWidth","computeMaxCushionWidth","TimelineSlatCell","isEm","isDay","TimelineSlatsBody","cellElRefs","TimelineSlats","onScrollLeftRequest","coords","updateSizing","scrollResponder","onCoords","elMap","positionToHit","slatIndex","slatWidth","localSnapIndex","multiplyDuration","computeSegHCoords","timelineCoords","TimelineLaneBg","highlightSeg","eventResizeSegs","renderSegs","fillType","segHCoords","hStyle","renderFill","TimelineLaneSlicer","dayRange","normalizeRange","DEFAULT_TIME_FORMAT","TimelineEvent","TimelineLaneMoreLink","placement","isVisible","visibility","isForcedInvisible","isExpanded","TimelineLane","slicer","harnessElRefs","moreElRefs","eventInstanceHeights","moreLinkHeights","slicedProps","mirrorSegs","fgSegs","segInputs","crudePlacements","hierarchy","hiddenPlacements","hiddenGroups","merges","entries_2","filteredMerges","hungryMerge","merges_1","merge","groupIntersectingEntries","moreLinkInputs","moreLinkCrudePlacements","extractSeg","hiddenGroup","sortedSegs","visiblePlacements","visibleRects_1","segIndex","computeFgSegPlacements","fgPlacements","fgHeight","renderFgSegs","topsByInstanceId","placements","placements_1","buildAbsoluteTopHash","buildMirrorPlacements","innerEl","onHeightChange","moreEl","syncParentMinHeight","minHeight","segPlacements","segPlacement","isoStr","TimelineGrid","slatsRef","handeEl","handleCoords","onSlatCoords","slatHit","buildSlatCols","timeline","TimelineView","scrollGridRef","slotCushionMaxWidth","handleSlatCoords","handleScrollLeftRequest","handleMaxCushionWidth","slatCols","computeFallbackSlotMinWidth","contentArg","timelineDay","timelineWeek","timelineMonth","timelineYear","computeResourceEditable","resourceEditable","eventResourceEditable","ResourceDataAdder","filterResources","calendarProps","needsResourceData","resourceStore","filterResourcesWithEvents","resourceEntityExpansions","doFilterResourcesWithEvents","instancesInRange","eventInstances","filterEventInstancesInRange","hasEvents_1","hasEvents","computeHasEvents","parentId","computeAncestorHasEvents","ResourceEventConfigAdder","buildResourceEventUis","injectResourceEventUis","resourceEventUis","eventUi","origEventUi","injectResourceEventUi","registerResourceSourceDef","getResourceSourceDef","getResourceSourceDefs","RESOURCE_SOURCE_REFINERS","resources","createSource","refetchResourcesOnNavigate","inputObj","warnUnknownProps","buildResourceSourceMeta","parseResourceSource","resourceSource","rawResources","PRIVATE_ID_PREFIX","RESOURCE_REFINERS","eventEditable","parseResource","store","getPublicId","ResourceApi","_resource","oldResource","propValue","sync","resourceHash","internalResource","getParent","getChildren","thisResourceId","childApis","internal","collapseEventColor","addResource","scrollTo","resourceApi","getResourceById","rawResource","getResources","resourceApis","getTopLevelResources","refetchResources","ResourceSplitter","filterConstraints","setResources","resources_1","DEFAULT_RESOURCE_ORDER","initialResources","resourceOrder","resourceGroupField","resourceAreaWidth","resourceAreaColumns","resourcesInitiallyExpanded","datesAboveResources","resourceAreaHeaderClassNames","resourceAreaHeaderContent","resourceAreaHeaderDidMount","resourceAreaHeaderWillUnmount","resourceGroupLabelClassNames","resourceGroupLabelContent","resourceGroupLabelDidMount","resourceGroupLabelWillUnmount","resourceLabelClassNames","resourceLabelContent","resourceLabelDidMount","resourceLabelWillUnmount","resourceLaneClassNames","resourceLaneContent","resourceLaneDidMount","resourceLaneWillUnmount","resourceGroupLaneClassNames","resourceGroupLaneContent","resourceGroupLaneDidMount","resourceGroupLaneWillUnmount","LISTENER_REFINERS","resourcesSet","resourceAdd","resourceChange","resourceRemove","ResourceLabelRoot","publicArg","ResourceCell","buildDateFormat","ResourceDayHeader","dateFormat","renderResourceRow","renderDayAndResourceRows","renderResourceAndDayRows","resourceCells","buildTr","dateCells","dates_1","renderDateCell","resources_2","dates_2","keyPostfix","ResourceIndex","indicesById","ids","AbstractResourceDayTableModel","dayTableModel","resourceIndex","dateCol","resourceCol","computeCol","NO_SEGS","ResourceDayTableModel","dateI","resourceI","computeColRanges","dateStartI","dateEndI","DayResourceTableModel","buildRowNodes","groupSpecs","orderSpecs","isVGrouping","expansions","expansionDefault","complexNodes","maxDepth","resourceNodes","nodeHash","resourceFields","buildResourceFields","insertResourceNodeInSiblings","buildResourceNodes","builtNodes","resourceNode","insertResourceNode","buildHierarchy","flatNodes","flattenNodes","rowSpans","depth","complexNode","group","firstRowIndex","rowSpanIndex","firstRow","hasChildren","nodes","groupNode","groupSpec","newGroupIndex","groupValue","ensureGroupNodes","siblings","VResourceJoiner","joinDateSelection","joinSegs","joinBusinessHours","joinFgEvents","joinBgEvents","joinEventDrags","joinInteractions","joinEventResizes","joinProps","propSets","resourceDayTable","dateSelectionSets","businessHoursSets","fgEventSets","bgEventSets","segGroups","resourceCnt","transformedSegs","transformSeg","_d","expandSegs","anyInteractions","VResourceSplitter","resourceDayTableModel","resourceSourceInput","doesSourceIgnoreRange","handleRangeChange","reduceResourceSource","existingStore","nextStore","receiveRawResources","additions","childResourceId","removeResource","existingResource","setResourceProp","setResourceExtendedProp","reduceResourceStore","reduceResourceEntityExpansions","items","eventMutation","hit0","hit1","resource0","resource1","resourceMutation","matchResourceId","setResourceId","resourceId0","resourceId1","combinedProps","sets","newResource","newSourceInput","calendarData","buildResourceApis","ExpanderIcon","onExpanderClick","iconClassNames","refineHookProps$1","fieldValue","SpreadsheetIndividualCellInner","colSpec","cellContent","renderResourceInner","SpreadsheetIndividualCell","cellClassNames","cellDidMount","cellWillUnmount","innerHeight","isMain","SpreadsheetGroupCell","renderGroupInner","rowSpan","SpreadsheetRow","colSpecs","SpreadsheetGroupRow","innerInnerRef","labelClassNames","labelContent","renderCellInner","labelDidMount","labelWillUnmount","spreadsheetColCnt","group0","group1","SpreadsheetHeader","resizerElRefs","_handleColResizerEl","colDraggings","superHeaderRendering","rowNodes","rowInnerHeight_1","headerClassNames","headerContent","headerDidMount","headerWillUnmount","isLastCol","resizerEl","dragging","initColResizing","onColWidthChange","ElementDraggingImpl","startWidth_1","currentWidths_1","allCells","ResourceTimelineLaneMisc","ResourceTimelineLane","handleHeightChange","DividerRow","renderingHooks","laneClassNames","laneContent","laneDidMount","laneWillUnmount","ResourceTimelineLanesBody","rowElRefs","fallbackBusinessHours","onRowHeightChange","ResourceTimelineLanes","updateCoords","onRowCoords","rowNode","ResourceTimelineGrid","computeHasResourceBusinessHours","resourceSplitter","bgSlicer","handleRowCoords","rowCoords","hasResourceBusinessHours","bgLaneProps","bgSlicedProps","rowIndex","rowNodes_1","ResourceTimelineViewLayout","timeBodyScrollerElRef","spreadsheetHeaderChunkElRef","ensureScrollGridResizeId","resourceAreaWidthOverride","ensureScrollGridResize","spreadsheetHeaderRows","timeHeaderContent","spreadsheetBodyRows","timeBodyContent","spreadsheetCols","timeCols","forceTimeScroll","forceResourceScroll","getResourceScroll","initSpreadsheetResizing","destroySpreadsheetResizing","spreadsheetHeadEl","dragStartWidth_1","viewWidth_1","rootEl_1","spreadsheetResizerDragging","newWidth","ResourceTimelineView","processColOptions","hasNesting","layoutRef","renderedRowNodes","buildRowIndex","layout","rowId","fromBottom","handleColWidthChange","colWidths","spreadsheetColWidths","buildSpreadsheetCols","renderSpreadsheetRows","resourceScroll","queryResourceScroll","snapshot","trBottoms","scroll_1","elBottom","rowIdToIndex","forcedWidths","fallbackWidth","nodes_1","allColSpecs","plainColSpecs","groupColSpecs","allColSpecs_1","mainColSpec","hGroupField","plainOrderSpecs","allOrderSpecs_1","orderSpec","isGroup","groupSpecs_1","resourceTimeline","resourceTimelineDay","resourceTimelineWeek","resourceTimelineMonth","resourceTimelineYear","BVKCalendar","_targetItemId","_initialView","_resourceUri","_resourceList","_eventUri","_dialog","_isLoggedIn","_isAdmin","_userId","_data","targetItemId","resourceUri","resourceList","eventUri","dialogOptions","_dialog2","dialogOptions2","isLoggedIn","isAdmin","userId","Resources","targetId","calendarEl","calendar","dateClick","getElementsByClassName","dateString","scrollIntoView","block","inline","addEndpoint","getData","connection","_url","_endpoints","endpoints","getDataByEndpoint","endpoint","includes","response","catch","user","fields","bookings","preInit","number","prepareFields","setAdmin","setLoggedIn","setUserId"],"sourceRoot":""}
/ elements with colspans.\n SOLUTION: making individual