{"version":3,"sources":["webpack:///./node_modules/@fullcalendar/core/main.esm.js","webpack:///./node_modules/ev-emitter/ev-emitter.js","webpack:///./node_modules/fizzy-ui-utils/utils.js","webpack:///./node_modules/desandro-matches-selector/matches-selector.js","webpack:///./node_modules/aos/dist/aos.js","webpack:///./node_modules/select-custom/index.js","webpack:///./node_modules/tabbyjs/dist/js/tabby.min.js","webpack:///./node_modules/isotope-layout/js/isotope.js","webpack:///./node_modules/@fullcalendar/daygrid/main.esm.js","webpack:///./node_modules/outlayer/item.js","webpack:///./node_modules/isotope-layout/js/item.js","webpack:///./node_modules/isotope-layout/js/layout-modes/masonry.js","webpack:///./node_modules/masonry-layout/masonry.js","webpack:///./node_modules/isotope-layout/js/layout-modes/fit-rows.js","webpack:///./node_modules/isotope-layout/js/layout-modes/vertical.js","webpack:///./node_modules/tiny-slider/src/helpers/Object.keys.js","webpack:///./node_modules/tiny-slider/src/helpers/childNode.remove.js","webpack:///../src/index.ts","webpack:///./node_modules/get-size/get-size.js","webpack:///./node_modules/outlayer/outlayer.js","webpack:///./node_modules/isotope-layout/js/layout-mode.js","webpack:///./node_modules/tiny-slider/src/helpers/raf.js","webpack:///./node_modules/tiny-slider/src/helpers/caf.js","webpack:///./node_modules/tiny-slider/src/helpers/extend.js","webpack:///./node_modules/tiny-slider/src/helpers/checkStorageValue.js","webpack:///./node_modules/tiny-slider/src/helpers/setLocalStorage.js","webpack:///./node_modules/tiny-slider/src/helpers/getBody.js","webpack:///./node_modules/tiny-slider/src/helpers/docElement.js","webpack:///./node_modules/tiny-slider/src/helpers/setFakeBody.js","webpack:///./node_modules/tiny-slider/src/helpers/resetFakeBody.js","webpack:///./node_modules/tiny-slider/src/helpers/addCSSRule.js","webpack:///./node_modules/tiny-slider/src/helpers/getCssRulesLength.js","webpack:///./node_modules/tiny-slider/src/helpers/forEach.js","webpack:///./node_modules/tiny-slider/src/helpers/classListSupport.js","webpack:///./node_modules/tiny-slider/src/helpers/hasClass.js","webpack:///./node_modules/tiny-slider/src/helpers/addClass.js","webpack:///./node_modules/tiny-slider/src/helpers/removeClass.js","webpack:///./node_modules/tiny-slider/src/helpers/hasAttr.js","webpack:///./node_modules/tiny-slider/src/helpers/getAttr.js","webpack:///./node_modules/tiny-slider/src/helpers/isNodeList.js","webpack:///./node_modules/tiny-slider/src/helpers/setAttrs.js","webpack:///./node_modules/tiny-slider/src/helpers/removeAttrs.js","webpack:///./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js","webpack:///./node_modules/tiny-slider/src/helpers/hideElement.js","webpack:///./node_modules/tiny-slider/src/helpers/showElement.js","webpack:///./node_modules/tiny-slider/src/helpers/isVisible.js","webpack:///./node_modules/tiny-slider/src/helpers/whichProperty.js","webpack:///./node_modules/tiny-slider/src/helpers/getEndProperty.js","webpack:///./node_modules/tiny-slider/src/helpers/passiveOption.js","webpack:///./node_modules/tiny-slider/src/helpers/addEvents.js","webpack:///./node_modules/tiny-slider/src/helpers/removeEvents.js","webpack:///./node_modules/tiny-slider/src/helpers/events.js","webpack:///./node_modules/tiny-slider/src/tiny-slider.js","webpack:///./node_modules/tiny-slider/src/helpers/calc.js","webpack:///./node_modules/tiny-slider/src/helpers/percentageLayout.js","webpack:///./node_modules/tiny-slider/src/helpers/mediaquerySupport.js","webpack:///./node_modules/tiny-slider/src/helpers/has3DTransforms.js","webpack:///./node_modules/tiny-slider/src/helpers/getSlideId.js","webpack:///./node_modules/tiny-slider/src/helpers/createStyleSheet.js","webpack:///./node_modules/tiny-slider/src/helpers/jsTransform.js","webpack:///./node_modules/tiny-slider/src/helpers/removeCSSRule.js","webpack:///./node_modules/tiny-slider/src/helpers/toDegree.js","webpack:///./node_modules/tiny-slider/src/helpers/getTouchDirection.js","webpack:///./node_modules/lazysizes/lazysizes.js","webpack:///./node_modules/lazysizes/plugins/artdirect/ls.artdirect.js","webpack:///./node_modules/lazysizes/plugins/unveilhooks/ls.unveilhooks.js","webpack:///./node_modules/lazysizes/plugins/bgset/ls.bgset.js","webpack:///(webpack)/buildin/global.js"],"names":["elementPropHash","className","colSpan","rowSpan","containerTagHash","createElement","tagName","attrs","content","el","document","attrName","applyStyle","setAttribute","innerHTML","appendToElement","htmlToElement","html","trim","container","computeContainerTag","firstChild","htmlToElements","Array","prototype","slice","call","childNodes","htmlToNodeList","substr","normalizeContent","i","length","appendChild","prependToElement","parent","newEls","afterEl","insertBefore","insertAfterElement","refEl","nextSibling","parentNode","Node","removeElement","removeChild","matchesMethod","Element","matches","matchesSelector","msMatchesSelector","closestMethod","closest","selector","this","documentElement","contains","elementMatches","parentElement","nodeType","elementClosest","findElements","containers","HTMLElement","allMatches","querySelectorAll","j","push","findChildren","parents","children","childNode","PIXEL_PROP_RE","props","propName","applyStyleProp","name","val","style","test","isRtlScrollbarOnLeft","getIsRtlScrollbarOnLeft","outerEl","position","top","left","border","padding","overflow","direction","body","res","getBoundingClientRect","computeIsRtlScrollbarOnLeft","sanitizeScrollbarWidth","width","Math","max","round","computeEdges","getPadding","computedStyle","window","getComputedStyle","borderLeft","parseInt","borderLeftWidth","borderRight","borderRightWidth","borderTop","borderTopWidth","borderBottom","borderBottomWidth","scrollbarLeftRight","offsetWidth","clientWidth","scrollbarBottom","offsetHeight","clientHeight","scrollbarLeft","scrollbarRight","paddingLeft","paddingRight","paddingTop","paddingBottom","computeRect","rect","pageXOffset","pageYOffset","right","bottom","computeHeightAndMargins","height","computeVMargins","computed","marginTop","marginBottom","computeClippingRect","overflowY","overflowX","getClippingParents","map","goWithinPadding","outerRect","edges","computeInnerRect","concat","reduce","rect0","rect1","rect2","min","intersectRects","listenBySelector","eventType","handler","realHandler","ev","matchedChild","target","addEventListener","removeEventListener","DAY_IDS","addWeeks","m","n","a","dateToUtcArray","arrayToUtcDate","addDays","addMs","diffWeeks","m0","m1","diffDays","valueOf","diffWholeDays","timeAsMs","startOfDay","getUTCFullYear","getUTCMonth","getUTCDate","weekOfGivenYear","marker","year","dow","doy","firstWeekStart","firstWeekOffset","dayStart","days","floor","fwd","getUTCDay","dateToLocalArray","date","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","arrayToLocalDate","Date","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","UTC","apply","isValidDate","isNaN","PARSE_RE","createDuration","input","unit","_a","s","exec","sign","years","months","milliseconds","parseString","normalizeObject","obj","month","day","getWeeksFromInput","hours","hour","minutes","minute","seconds","second","millisecond","ms","weeks","week","durationsEqual","d0","d1","asRoughDays","dur","asRoughMs","greatestDurationDenominator","dontReturnWeeks","value","compensateScroll","rowEl","scrollbarWidths","marginLeft","marginRight","uncompensateScroll","distributeHeight","els","availableHeight","shouldRedistribute","minOffset1","minOffset2","flexEls","flexOffsets","flexHeights","usedHeight","undistributeHeight","forEach","minOffset","naturalHeight","naturalOffset","newHeight","matchCellWidths","maxInnerWidth","innerEl","innerWidth_1","subtractInnerElHeight","reflowStyleProps","diff","resetStyleProps","compareByFieldSpec","obj0","obj1","fieldSpec","func","b","String","localeCompare","flexibleCompare","field","order","capitaliseFirstLetter","str","charAt","toUpperCase","padStart","len","isInt","applyAll","functions","thisObj","args","ret","firstDefined","_i","arguments","undefined","debounce","wait","timeout","context","timestamp","result","later","last","setTimeout","refineProps","rawProps","processors","defaults","leftoverProps","refined","key","processor","Function","Number","Boolean","computeAlignedDayRange","timedRange","dayCnt","start","end","computeVisibleDayRange","nextDayThreshold","startDay","endDay","endTimeMS","diffDates","date0","date1","dateEnv","largeUnit","diffWholeYears","diffWholeMonths","m0day","m1day","extendStatics","d","Object","setPrototypeOf","__proto__","p","hasOwnProperty","__extends","__","constructor","create","__assign","assign","t","expandRecurringRanges","eventDef","duration","framingRange","recurringTypes","markers","recurringDef","typeId","expand","typeData","subtract","allDay","mergeProps","propObjs","complexProps","complexObjs","dest","unshift","filterHash","hash","filtered","mapHash","newHash","arrayToHash","a_1","hashValuesToArray","isPropsEqual","parseEvents","rawEvents","sourceId","calendar","allowOpenRange","eventStore","defs","instances","rawEvents_1","tuple","parseEvent","eventTupleToStore","def","defId","instance","instanceId","expandRecurring","defaultAllDayEventDuration","defaultTimedEventDuration","starts_1","pluginSystem","hooks","createEventInstance","add","getRelevantEvents","def_1","newStore","filterEventStoreDefs","lookDef","def0","def1","groupId","transformEachRawEvent","refinedEvents","rawEvents_2","rawEvent","refinedEvent","mergeEventStores","store0","store1","filterFunc","parseRange","createMarker","invertRanges","ranges","constraintRange","dateRange","invertedRanges","sort","compareRanges","range0","range1","intersectRanges","newRange","rangesEqual","rangesIntersect","rangeContainsRange","outerRange","innerRange","rangeContainsMarker","range","isArraysEqual","a0","a1","memoize","workerFunc","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","name_1","buildFormattingFunc","format","formatRange","diffSeverity","ca","getMarkerYear","getMarkerMonth","getMarkerDay","computeMarkerDiffSeverity","calendarSystem","biggestUnitForPartial","full0","full1","partialFormattingFunc","options","biggestUnit","partialOptions","name_2","computePartialFormattingOptions","partial0","partial1","insertion","i0","found0","indexOf","before0","after0","i1","found1","before1","after1","before","after","findCommonInsertion","getLargestUnit","standardDatePropCnt","keys","formatTimeZoneOffset","timeZoneOffset","num","weekLabel","locale","display","parts","simpleNumberFormat","isRtl","reverse","join","formatWeekNumber","computeWeekNumber","sanitizeSettings","timeZone","zeroFormat","normalFormat","Intl","DateTimeFormat","codes","zeroProps","replace","tzoStr","replaced","injectTzoStr","toLocaleLowerCase","postProcess","buildNativeFormattingFunc","CmdFormatter","cmdStr","cmdFormatter","createVerboseFormattingArg","FuncFormatter","createFormatter","defaultSeparator","doIso","abs","mins","startInfo","expandZonedMarker","localeCodes","dateInfo","markerToArray","array","EventSourceApi","internalEventSource","remove","dispatch","type","refetch","sourceIds","defineProperty","get","publicId","enumerable","configurable","meta","url","EventApi","_calendar","_def","_instance","setProp","_b","DATE_PROPS","NON_DATE_PROPS","mutate","standardProps","UNSCOPED_EVENT_UI_PROPS","ui","backgroundColor","borderColor","startEditable","durationEditable","setExtendedProp","extendedProps","setStart","startInput","startDelta","granularity","maintainDuration","datesDelta","setEnd","endInput","endDelta","hasEnd","setDates","instanceRange","moveStart","deltaInput","delta","moveEnd","moveDates","setAllDay","opt","formatInput","formatter","forcedStartTzo","forcedEndTzo","forcedTzo","mutation","fromApi","state","eventSources","toDate","title","rendering","constraints","overlap","allows","textColor","classNames","sliceEventStore","eventUiBases","inverseBgByGroupId","inverseBgByDefId","defByGroupId","bgRanges","fgRanges","eventUis","compileEventUis","origRange","normalRange","slicedRange","isStart","isEnd","invertedRanges_1","invertedRange","invertedRanges_2","bg","fg","filterSegsViaEls","segs","isMirror","view","hasPublicHandlers","filter","seg","custom","publiclyTrigger","event","eventRange","segs_1","setElSeg","fcSeg","getElSeg","eventDefs","compileEventUi","uis","combineEventUis","triggerRenderedSegs","isMirrors","segs_2","publiclyTriggerAfterSizing","eventSourceLoadingLevel","afterSizingTriggers","_eventsPositioned","triggerWillRemoveSegs","segs_3","trigger","segs_4","computeEventDraggable","eventUi","transformers","isDraggableTransformers","transformers_1","transformer","computeEventStartResizable","eventResizableFromStart","computeEventEndResizable","applyMutationToEventDef","eventConfig","appliers","copy","appliers_1","applier","applyMutationToEventInstance","eventInstance","forceAllDay","clearEnd","getDefaultEventEnd","reduceEventStore","action","dateProfile","eventSource","fetchId","fetchRange","latestFetchId","subset","calEachTransform","sourceEachTransform","eventDataTransform","transformRawEvents","excludeEventsBySourceId","receiveRawEvents","expandRange","addEvent","activeRange","oldDateEnv","newDateEnv","canComputeOffset","rezoneDates","relevant","eventConfigBase","eventConfigs","eventDefMutationAppliers","applyMutationToEventStore","applyMutationToRelated","excludeInstances","removals","isNewPropsValid","newProps","businessHours","dateSelection","eventSelection","eventDrag","eventResize","isPropsValid","dateSpanMeta","filterConfig","interaction","subjectEventStore","mutatedEvents","subjectDefs","subjectInstances","subjectConfigs","isEvent","selectionConfig","otherEventStore","affectedEvents","otherDefs","otherInstances","otherConfigs","subjectInstanceId","subjectInstance","subjectRange","subjectConfig","subjectDef","allConstraintsPass","overlapFunc","otherInstanceId","otherInstance","calendarEventStore","subjectAllow","subjectDateSpan","origDef","origInstance","eventApi","buildDateSpanApi","isInteractionPropsValid","relevantEventStore","relevantDefs","relevantInstances","selection","selectionRange","relevantInstanceId","relevantInstance","selectionAllow","fullDateSpan","isDateSelectionPropsValid","businessHoursUnexpanded","constraints_1","anyRangesContainRange","constraintToRanges","constraint","eventStoreToRanges","outerRanges","outerRanges_1","htmlEscape","cssToStr","cssProps","statements","parseClassName","raw","isArray","split","editable","allow","color","processUnscopedUiProps","leftovers","normalizeConstraint","processScopedUiProps","prefix","rawScoped","rawUnscoped","wasFound","scopedKey","EMPTY_EVENT_UI","combineTwoEventUis","item0","item1","id","uid","allDayDefault","source","computeIsAllDayDefault","leftovers0","recurringRes","eventInput","localLeftovers","parsed","parse","allDayGuess","parseRecurring","parseEventDef","leftovers1","singleRes","startMeta","endMeta","pluckDateProps","startMarker","endMarker","createMarkerMeta","isTimeUnspecified","parseSingle","preLeftovers","pluckNonDateProps","eventDefParsers","newLeftovers","eventDefParser","freeze","DEF_DEFAULTS","startTime","endTime","daysOfWeek","parseBusinessHours","rawDefs","rawDef","refineInputs","memoizeRendering","renderFunc","unrenderFunc","dependencies","thisContext","prevArgs","dependents","unrender","dependents_1","dependencies_1","EMPTY_EVENT_STORE","Splitter","getKeysForEventDefs","_getKeysForEventDefs","splitDateSelection","_splitDateSpan","splitEventStore","_splitEventStore","splitIndividualUi","_splitIndividualUi","splitEventDrag","_splitInteraction","splitEventResize","eventUiBuilders","splitProps","_this","keyInfos","getKeyInfo","defKeys","dateSelections","individualUi","eventStores","eventDrags","eventResizes","info","buildEventUiForKey","keyInfo","buildEventUi","dateSpan","dateSpans","keys_1","getKeysForDateSpan","getKeysForEventDef","splitStores","_c","splitHashes","splitStates","affectedStores_1","mutatedKeysByDefId","mutatedStores_1","populate","origSeg","allUi","eventUiForKey","baseParts","stuff","buildGotoAnchorHtml","allOptions","gotoOptions","innerHtml","forceOff","finalOptions","formatIso","omitTime","attrsToStr","navLinks","JSON","stringify","getDayClasses","noThemeHighlight","todayStart","todayEnd","theme","classes","monthMode","currentRange","getNow","getClass","EmitterMixin","_super","on","addToHash","_handlers","one","_oneHandlers","off","removeFromHash","triggerWith","hasHandlers","Mixin","mixInto","destClass","mixIntoObj","destObj","getOwnPropertyNames","mixOver","PositionCache","originEl","isHorizontal","isVertical","build","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","ElementScrollController","scrollTop","scrollLeft","setScrollTop","setScrollLeft","scrollWidth","scrollHeight","ScrollComponent","WindowScrollController","scroll","applyOverflow","clear","setHeight","destroy","lockOverflow","getScrollbarWidths","Theme","calendarOptions","processIconOverride","iconOverrideOption","setIconOverride","iconOverrideHash","iconClassesCopy","buttonName","iconClasses","applyIconOverridePrefix","iconOverridePrefix","getIconClass","baseIconClass","getCustomButtonIconClass","customButtonProps","iconOverrideCustomButtonOption","guid","ComponentContext","dir","eventOrderSpecs","token","specs","tokens","substring","parseFieldSpecs","eventOrder","extend","Component","everRendered","addEqualityFuncs","newFuncs","equalityFuncs","receiveProps","receiveContext","oldProps","comboProps","anyChanges","recycleProps","beforeUpdate","render","afterUpdate","oldContext","firstContext","DateComponent","buildPositionCaches","queryHit","positionLeft","positionTop","elWidth","elHeight","isInteractionValid","validRange","isDateSelectionValid","isValidSegDownEl","isPopover","isInPopover","isValidDateDownEl","segEl","fgSegSelector","classList","bgSegSelector","uid$1","createPlugin","deps","reducers","eventDragMutationMassagers","dateSelectionTransformers","datePointTransforms","dateSpanTransforms","views","viewPropsTransformers","externalDefTransforms","eventResizeJoinTransforms","viewContainerModifiers","eventDropTransformers","componentInteractions","calendarInteractions","themeClasses","eventSourceDefs","namedTimeZonedImpl","defaultView","elementDraggingImpl","optionChangeHandlers","PluginSystem","addedHash","plugin","dep","hooks0","hooks1","ArrayEventSourcePlugin","ignoreRange","parseMeta","events","fetch","arg","success","FuncEventSourcePlugin","failure","isResolved","wrappedSuccess","wrappedFailure","then","unpromisify","bind","startStr","endStr","requestJson","method","params","successCallback","failureCallback","encodeParams","injectQueryStringParams","xhr","XMLHttpRequest","open","setRequestHeader","onload","status","responseText","err","onerror","send","encodeURIComponent","JsonFeedEventSourcePlugin","extraParams","startParam","endParam","timeZoneParam","requestParams","customRequestParams","buildRequestParams","errorMessage","message","SimpleRecurrencePlugin","startRecur","endRecur","anyValid","clippedFramingRange","dowHash","dayMarker","instanceStarts","instanceStart","expandRanges","DefaultOptionChangeHandlers","deepEqual","handleEventSources","plugins","inputs","addPluginInputs","unfoundSources","newInputs","inputs_1","inputFound","_raw","splice","unfoundSources_1","unfoundSource","newInputs_1","newInput","addEventSource","globalDefaults","defaultRangeSeparator","titleRangeSeparator","forceEventDuration","columnHeader","aspectRatio","header","center","weekends","weekNumbers","weekNumberCalculation","scrollTime","minTime","maxTime","showNonCurrentDates","lazyFetching","locales","timeGridEventMinHeight","themeSystem","dragRevertDuration","dragScroll","allDayMaintainDuration","unselectAuto","dropAccept","eventLimit","eventLimitClick","dayPopoverFormat","handleWindowResize","windowResizeDelay","longPressDelay","eventDragMinDistance","rtlDefaults","buttonIcons","prev","next","prevYear","nextYear","complexOptions","INTERNAL_PLUGINS","RAW_EN_LOCALE","code","buttonText","today","list","allDayText","eventLimitText","noEventsMessage","parseRawLocales","explicitRawLocales","defaultCode","globalArray","globalObject","allRawLocales","rawLocaleMap","en","allRawLocales_1","rawLocale","buildLocale","inputSingular","available","codeArg","simpleId","queryRawLocale","parseLocale","queryLocale","merged","NumberFormat","OptionsManager","overrides","dynamicOverrides","compute","updates","isDynamic","overrideHash","removals_1","localeDefaults","dirDefaults","calendarSystemClassMap","theClass","GregorianCalendarSystem","arrayToMarker","arr","ISO_RE","DateEnv","settings","isNamedTimeZone","namedTimeZoneImpl","createCalendarSystem","weekDow","weekDoy","firstDay","weekNumberFunc","createNowMarker","timestampToMarker","getYear","addYears","addMonths","greatestWholeUnit","diffWholeWeeks","diffHours","diffMinutes","diffSeconds","countDurationsBetween","asRoughMonths","startOf","startOfYear","startOfMonth","startOfWeek","startOfHour","startOfMinute","startOfSecond","y","w","nextW","weekOfYear","dateOptions","offsetForMarker","isEndExclusive","extraOptions","omitTimeZoneOffset","stripZeroTime","toISOString","buildIsoString","timestampToArray","getTimezoneOffset","offsetForArray","SIMPLE_SOURCE_PROPS","uid$2","doesSourceNeedRange","sourceDefId","parseEventSource","parseEventSourceProps","isFetching","reduceEventSources","eventSourceHash","sources","sources_1","fetchDirtySources","addSources","fetchSourcesByIds","excludeStaticSources","sourceHash","receiveResponse","uid$3","isSourceDirty","prevSources","sourceIdHash","nextSources","fetchSource","sourceDef","calSuccessRes","sourceSuccessRes","calSuccess","error","callFailure","console","warn","DateProfileGenerator","viewSpec","initHiddenDays","buildPrev","currentDateProfile","currentDate","prevDate","currentRangeUnit","dateIncrement","buildNext","nextDate","forceToValid","currentInfo","isRangeAllDay","renderRange","isValid","buildValidRange","trimHiddenDays","buildCurrentRangeInfo","buildRenderRange","adjustActiveRange","buildDateIncrement","getRangeOption","dayCount","durationUnit","buildRangeFromDuration","buildRangeFromDayCount","buildCustomVisibleRange","getFallbackDuration","class","usesMinMaxTime","dateIncrementInput","dateIncrementDuration","alignment","dateAlignment","computeRes","isHiddenDay","skipHiddenDays","customAlignment","runningCount","visibleRange","fallback","otherArgs","hiddenDays","isHiddenDayHash","Error","inc","isExclusive","viewType","currentViewType","reduceViewType","newDateProfile","dateProfileGenerators","dateMarker","generator","p0","p1","reduceDateProfile","nextState","reduceCurrentDate","reduceDateSelection","reduceSelectedEvent","reduceEventDrag","reduceEventResize","computeLoadingLevel","loadingLevel","reducerFunc","newDate","currentSelection","currentInstanceId","eventInstanceId","currentDrag","newDrag","currentResize","newResize","cnt","STANDARD_PROPS","parseDateSpan","defaultDuration","span","parseOpenDateSpan","fabricateEventRange","ensureViewDef","defaultConfigs","overrideConfigs","viewDef","defaultConfig","overrideConfig","queryProp","superType","findViewNameBySubclass","superDef","buildViewDef","viewSubclass","configs","superProto","getPrototypeOf","parseViewConfigs","parseViewConfig","VIEW_DEF_PROPS","buildViewSpecs","defaultInputs","optionsManager","compileViewDefs","durationInput","singleUnit","singleUnitOverrides","denom","queryButtonText","buttonTextMap","buttonTextKey","buttonTextOverride","buttonTextDefault","buildViewSpec","Toolbar","extraClassName","_renderLayout","renderLayout","unrenderLayout","_updateTitle","updateTitle","_updateActiveButton","updateActiveButton","_updateToday","updateToday","_updatePrev","updatePrev","_updateNext","updateNext","layout","activeButton","isTodayEnabled","isPrevEnabled","isNextEnabled","viewsWithButtons","renderSection","buttonStr","viewSpecs","sectionEl","calendarCustomButtons","customButtons","calendarButtonTextOverrides","calendarButtonText","buttonGroupStr","groupEl","groupChildren","isOnlyButtons","buttonClick","buttonIcon","buttonInnerHtml","buttonClasses","buttonEl","buttonAriaAttr","click","text","changeView","buttonGroupClassName","toggleButtonEnabled","titleEl","innerText","bool","disabled","CalendarComponent","elClassNames","renderSkeleton","_renderSkeleton","_unrenderSkeleton","renderToolbars","_renderToolbars","_unrenderToolbars","buildComponentContext","buildViewPropTransformers","computeTitle","freezeHeight","renderView","updateSize","thawHeight","footer","updateElClassNames","contentEl","modifyViewContainer","savedScroll","queryScroll","removeElClassNames","headerLayout","footerLayout","dateProfileGenerator","now","todayInfo","prevInfo","nextInfo","toolbarProps","addScroll","viewProps","transform","isResize","isHeightAuto","computeHeightVars","viewHeight","updateNowIndicator","popScroll","heightInput","contentHeightInput","queryToolbarsHeight","parentEl","viewOptions","titleFormat","computeTitleFormat","theClasses","Interaction","component","interactionSettingsStore","EventClicking","handleSegClick","hasUrlContainer","querySelector","href","jsEvent","defaultPrevented","location","EventHovering","handleEventElRemove","currentSegEl","handleSegLeave","handleSegEnter","triggerEvent","onMouseEnter","onMouseLeave","currentMatchedChild","removeHoverListeners","realOnMouseLeave_1","publicEvName","StandardTheme","widget","widgetHeader","widgetContent","buttonGroup","button","buttonActive","popoverHeader","popoverContent","headerRow","dayRow","listView","close","Calendar","equalityFunc","cachedRes","buildComponentContext$1","buildDateEnv","buildTheme","buildEventUiSingleBase","_buildEventUiSingleBase","buildSelectionConfig","_buildSelectionConfig","buildEventUiBySource","newRes","buildEventUiBases","interactionsStore","actionQueue","isReducing","needsRerender","isRendering","renderingPauseDepth","buildDelayedRerender","isViewUpdated","isDatesUpdated","isEventsUpdated","handleOptions","hydrate","calendarInteractionClass","pluginInputs","pluginDefs","pluginInputs_1","pluginInput","globalName","default","refinePluginDefs","pluginDefs_1","pluginDef","requestRerender","renderableEventStore","bindHandlers","executeRender","unbindHandlers","removeNavLinkListener","anchorEl","getAttribute","customAction","viewOpt","zoomTo","windowResizeProxy","windowResize","buildInitialState","rawSources","singleRawSource","rawSources_1","batchRendering","getInitialDate","oldState","shift","newState","delayedRerender","tryRerender","renderComponent","eventUiSingleBase","eventUiBySource","releaseAfterSizingTriggers","setOption","mutateOptions","getOption","viewOpts","changeHandlers","normalUpdates","specialUpdates","isTimeZoneDirty","isSizeDirty","anyDifficultOptions","name_3","pluginHooks","rerenderDelay","availableRawLocales","dateProfileGeneratorClass","getAvailableLocaleCodes","rawOpts","eventEditable","optHandler","name_4","isValidViewType","dateOrRange","unselect","spec","getUnitViewSpec","viewTypes","defaultDateInput","gotoDate","zonedDateInput","incrementDate","formatDate","isHandlingWindowResize","registerInteractiveComponent","settingsInput","useEventCenter","parseInteractionSettings","interactions","interactionClass","unregisterInteractiveComponent","select","dateOrObj","endDate","triggerDateSelect","pev","triggerDateUnselect","origEvent","triggerDateClick","dayEl","buildDatePointApi","dateStr","sourceInput","sourceApi","getEventSourceById","getEventById","getEvents","eventApis","removeAllEvents","rerenderEvents","getEventSources","sourceApis","internalId","removeAllEventSources","refetchEvents","scrollToTime","timeInput","scrollToDuration","View","renderDatesMem","renderDatesWrap","unrenderDatesWrap","renderBusinessHoursMem","renderBusinessHours","unrenderBusinessHours","renderDateSelectionMem","renderDateSelectionWrap","unrenderDateSelectionWrap","renderEventsMem","renderEvents","unrenderEvents","renderEventSelectionMem","renderEventSelectionWrap","unrenderEventSelectionWrap","renderEventDragMem","renderEventDragWrap","unrenderEventDragWrap","renderEventResizeMem","renderEventResizeWrap","unrenderEventResizeWrap","initialize","isAuto","updateBaseSize","renderDates","stopNowIndicator","unrenderDates","renderDateSelection","unrenderDateSelection","sliceEvents","renderEventSelection","unrenderEventSelection","renderEventDrag","unrenderEventDrag","renderEventResize","unrenderEventResize","startNowIndicator","update","delay","nowIndicator","initialNowDate","getNowIndicatorUnit","initialNowQueriedMs","nowIndicatorTimeoutID","nowIndicatorIntervalID","setInterval","unrenderNowIndicator","renderNowIndicator","isNowIndicatorRendered","clearTimeout","clearInterval","isForced","queuedScroll","applyQueuedScroll","applyScroll","queryDateScroll","computeDateScroll","applyDateScroll","FgEventRenderer","renderSegs","mirrorInfo","rangeUpdated","renderSegEls","attachSegs","_segs","detachSegs","displayEventTime","displayEventEnd","eventTimeFormat","computeEventTimeFormat","computeDisplayEventTime","computeDisplayEventEnd","renderSegHtml","getSegClasses","isDraggable","isResizable","isDragging","isResizing","getTimeText","displayEnd","_getTimeText","getSkinCss","sortEventSegs","objs","buildSegCompareObj","fieldSpecs","cmp","compareByFieldSpecs","c","_seg","computeSizes","force","computeSegSizes","assignSizes","assignSegSizes","hideByHash","visibility","showByHash","selectByInstanceId","unselectByInstanceId","FillRenderer","fillSegTag","dirtySizeFlags","containerElsByType","segsByType","getSegsByType","renderedSegs","containerEls","css","toLowerCase","ElementDragging","emitter","setMirrorIsVisible","setMirrorNeedsRevert","setAutoScrollEnabled","renderDateCell","datesRepDistinctDays","colCnt","colHeadFormat","colspan","otherAttrs","isDateValid","columnHeaderHtml","columnHeaderText","DayHeader","dates","renderIntroHtml","columnHeaderFormat","computeFallbackHeaderFormat","dates_1","thead","DaySeries","indices","dayIndex","sliceRange","firstIndex","getDateDayIndex","lastIndex","clippedFirstIndex","clippedLastIndex","ceil","dayOffset","DayTable","daySeries","breakOnWeeks","daysPerRow","rowCnt","cells","buildCells","headerDates","buildHeaderDates","rows","row","col","buildCell","seriesSeg","index","nextIndex","firstCol","lastCol","Slicer","sliceBusinessHours","_sliceBusinessHours","sliceDateSelection","_sliceDateSpan","_sliceEventStore","sliceEventDrag","_sliceInteraction","sliceEventResize","sliceProps","extraArgs","eventSegs","dateSelectionSegs","businessHourSegs","fgEventSegs","bgEventSegs","sliceNowDate","computeActiveRange","rangeRes","sliceEventRanges","affectedInstances","sourceSeg","eventRanges","eventRanges_1","sliceEventRange","isComponentAllDay","EvEmitter","proto","eventName","listener","_events","listeners","once","onceEvents","_onceEvents","emitEvent","onceListeners","allOff","factory","utils","prop","div","arraySlice","makeArray","removeFrom","ary","getParent","elem","getQueryElement","handleEvent","filterFindElements","elems","ffElems","childElems","debounceMethod","_class","methodName","threshold","timeoutName","docReady","callback","readyState","toDashed","match","$1","$2","htmlInit","WidgetClass","namespace","dashedNamespace","dataAttr","dataAttrElems","jsDashElems","dataOptionsAttr","jQuery","attr","data","ElemProto","prefixes","module","exports","e","o","loaded","__esModule","u","h","k","x","offset","easing","disable","startEvent","throttleDelay","debounceDelay","disableMutationObserver","O","init","all","atob","mobile","phone","tablet","S","node","removeAttribute","isSupported","ready","refresh","refreshHard","v","g","r","f","M","_","TypeError","leading","maxWait","trailing","cancel","flush","l","Symbol","iterator","NaN","self","toString","MutationObserver","WebKitMutationObserver","MozMutationObserver","addedNodes","removedNodes","dataset","aos","observe","childList","subtree","navigator","userAgent","vendor","opera","writable","innerHeight","anchor","anchorPlacement","offsetLeft","offsetTop","offsetParent","_defineProperties","_defineProperty","ownKeys","getOwnPropertySymbols","getOwnPropertyDescriptor","detectTouch","maxTouchPoints","hasAttribute","BEMblock","block","addMod","toggleMod","toggle","removeMod","containsMod","constants","wrap","opener","panel","option","optionsWrap","optgroup","panelItemClassName","openerLabel","IS_OPEN","IS_DISABLED","IS_MULTIPLE","IS_SELECTED","IS_ABOVE","HAS_CUSTOM_SELECT","HAS_UNUSED_CLOSE_FUNCTION","DATA_ALLOW_PANEL_CLICK","DATA_LABEL","DATA_VALUE","DATA_HAS_PANEL_ITEM","DATA_LABEL_INDEX","defaultParams","optionBuilder","panelItem","item","changeOpenerText","multipleSelectionOnSingleClick","multipleSelectOpenerText","labels","allowPanelClick","openOnHover","closeOnMouseleave","wrapDataAttributes","_createElements","cloneNode","label","E","addDataAttributes","addOptionItem","selected","L","checked","A","multiple","setSelectOptionsItems","wrapElements","_open","openSelectBind","openSelect","_close","closeSelectBind","closeSelect","closeSelectListenersAdded","_change","currentTarget","setSelectedOptions","clickedCustomOption","nativeOptionsList","customOptionsList","dispatchEvent","triggerCheckbox","getSelectOptionsText","_trigerCustomEvents","oldValue","onOpen","onClose","attributes","attributeOldValue","attributeFilter","_destroy","createDocumentFragment","replaceChild","unwrap","Select","_classCallCheck","getOwnPropertyDescriptors","defineProperties","_objectSpread2","_createClass","createEvent","initEvent","setPanelPosition","keyCode","ctrlKey","setSelectedOptionsMultiple","setSelectedOptionsDefault","preventDefault","webkitMatchesSelector","global","idPrefix","previousTab","previousContent","focus","tab","CustomEvent","bubbles","cancelable","detail","initCustomEvent","activeElement","tabs","setup","Outlayer","getSize","Item","LayoutMode","Isotope","layoutMode","isJQueryFiltering","sortAscending","_create","itemGUID","_sorters","_getSorters","modes","filteredItems","items","sortHistory","_initLayoutMode","reloadItems","_itemize","_updateItemsSortData","Mode","initialOpts","_isLayoutInited","_getOption","_layout","arrange","isInstant","_getIsInstant","_resetLayout","_manageStamps","layoutItems","opts","_filter","_bindArrangeComplete","_isInstant","_noTransition","_hideReveal","_sort","_init","reveal","needReveal","hide","needHide","isLayoutInstant","isLayoutComplete","isHideComplete","isRevealComplete","arrangeParallelCallback","hiddenMatched","visibleUnmatched","_getFilterTest","isIgnored","isMatched","isHidden","element","is","updateSortData","getItems","getSortData","sorter","mungeSorter","query","attrMatch","getValue","child","textContent","getValueGetter","parser","sortDataParsers","parseFloat","sortBy","sortBys","_getIsSameSortBy","itemSorter","sortAsc","itemA","itemB","sortData","getItemSorter","_mode","mode","_getItemLayoutPosition","_manageStamp","stamp","_getContainerSize","needsResizeLayout","appended","addItems","_filterRevealAdded","prepended","insert","filteredInsertItems","_remove","removeItems","shuffle","random","fn","transitionDuration","returnValue","getFilteredItemElements","DayGridDateProfileGenerator","endOfWeek","fixedWeekCount","Popover","margin","documentMousedown","show","autoHide","elDims","origin","clippingRect","SimpleDayGridEventRenderer","timeText","titleHtml","isResizableFromStart","isResizableFromEnd","skinCss","timeHtml","DayGridEventRenderer","dayGrid","rowStructs","renderSegRows","rowEls","rowNode","tbodyEl","removeSegPopover","rowStruct","pop","segRows","groupSegRows","renderSegRow","rowSegs","levelSegs","tr","td","segLevels","buildSegLevels","levelCnt","tbody","segMatrix","cellMatrix","loneCellMatrix","emptyCellsUntil","endCol","leftCol","rightCol","introHtml","renderProps","levels","isDaySegCollision","level","compareDaySegCols","otherSegs","otherSeg","DayGridMirrorRenderer","skeletonTopEl","skeletonTop","skeletonEl","DayGridFillRenderer","renderFillRow","trEl","startCol","getElementsByTagName","DayTile","eventRenderer","DayTileEventRenderer","renderFrame","_renderFrame","renderFgEvents","fgSegs","eventDragInstances","eventResizeInstances","segContainerEl","layer","dayTile","DayBgRow","renderHtml","cell","renderCellHtml","htmlAttrs","DAY_NUM_FORMAT","WEEK_NUM_FORMAT","DayGrid","bottomCoordPadding","isCellSizesDirty","fillRenderer","mirrorRenderer","renderCells","_renderCells","_unrenderCells","renderBgEvents","_renderEventDrag","_unrenderEventDrag","_renderEventResize","_unrenderEventResize","isRigid","segPopoverTile","updateSegPopoverTile","getCellRange","ownProps","renderDayRowHtml","cellEls","rowPositions","colPositions","getCellEl","bgRow","renderBgIntroHtml","getIsNumbersVisible","renderNumberTrHtml","getIsDayNumbersVisible","cellWeekNumbersVisible","colWeekNumbersVisible","intro","renderNumberIntroHtml","renderNumberCellsHtml","htmls","renderNumberCellHtml","weekCalcFirstDow","isDayNumberVisible","buildColPositions","buildRowPositions","positionToHit","relativeRect","segPopover","limitRows","levelLimit","rowLevelLimit","unlimitRow","computeRowLevelLimit","limitRow","rowBottom","trEls","limitedNodes","segsBelow","totalSegsBelow","colSegsBelow","segMoreNodes","moreTd","moreWrap","moreLink","moreNodes","getCellSegs","renderMoreLink","moreEls","limitedEls","limitedEl","hiddenSegs","getMoreLinkText","clickOption","_col","moreEl","allSegs","reslicedAllSegs","resliceDaySegs","reslicedHiddenSegs","showSegPopover","topEl","dayDate","dayRange","newSegs","startLevel","WEEK_NUM_FORMAT$1","AbstractDayGridView","processOptions","_processOptions","renderHeadIntroHtml","weekNumberStyleAttr","renderDayGridNumberIntroHtml","weekStart","renderDayGridBgIntroHtml","renderDayGridIntroHtml","weekNumbersWithinDays","renderSkeletonHtml","scroller","dayGridContainerEl","dayGridEl","weekNumberWidth","hasRigidRows","scrollerHeight","headRowEl","computeScrollerHeight","setGridHeight","SimpleDayGrid","slicer","DayGridSlicer","dayTable","rawHit","DayGridView","buildDayTable","simpleDayGrid","main","dayGridDay","dayGridWeek","dayGridMonth","docElemStyle","transitionProperty","transition","transformProperty","transitionEndEvent","WebkitTransition","vendorProperties","transitionDelay","_transn","ingProperties","clean","onEnd","size","elemStyle","getPosition","isOriginLeft","isOriginTop","xValue","yValue","layoutSize","layoutPosition","xPadding","xProperty","xResetProperty","getXValue","yPadding","yProperty","yResetProperty","getYValue","percentPosition","_transitionTo","curX","curY","didNotMove","setPosition","isTransitioning","transX","transY","transitionStyle","getTranslate","to","onTransitionEnd","isCleaning","goTo","moveTo","_nonTransition","_removeStyles","_transition","from","enableTransition","transitionProps","staggerDelay","onwebkitTransitionEnd","ontransitionend","onotransitionend","dashedVendorProperties","propertyName","isEmptyObj","disableTransition","removeTransitionStyles","cleanStyle","cleanTransitionStyle","stagger","removeElem","getHideRevealTransitionEndProperty","onRevealTransitionEnd","hiddenStyle","visibleStyle","styleProperty","optionStyle","opacity","onHideTransitionEnd","sorters","Masonry","MasonryMode","keepModeMethods","_getElementOffset","_getMeasurement","measureColumns","isotope","isFitWidth","fitWidth","compatOptions","colYs","cols","maxY","horizontalColIndex","getContainerWidth","columnWidth","firstItem","firstItemElem","outerWidth","containerWidth","gutter","excess","innerWidth","remainder","colPosition","horizontalOrder","outerHeight","setMax","_getTopColPosition","colGroup","_getTopColGroup","minimumY","groupCount","_getColGroupY","groupColYs","_getHorizontalColPosition","hasSize","stampSize","firstX","lastX","stampMaxY","_getContainerFitWidth","unusedCols","previousWidth","FitRows","itemWidth","Vertical","horizontalAlignment","object","getStyleSize","logError","measurements","measurementsLength","getStyle","isBoxSizeOuter","isSetup","borderStyle","borderWidth","boxSizing","getZeroSize","isBorderBox","measurement","paddingWidth","paddingHeight","marginWidth","marginHeight","borderHeight","isBorderBoxSizeOuter","styleWidth","styleHeight","noop","GUID","queryElement","$element","outlayerGUID","containerStyle","initLayout","originLeft","originTop","resize","resizeContainer","subclass","Parent","SubClass","oldOption","horizontal","layoutInstant","stamps","bindResize","itemElems","_filterFindItemElements","itemSelector","getItemElements","_getItemsForLayout","_layoutItems","_postLayout","_emitCompleteOnItems","queue","_processLayoutQueue","updateStagger","_positionItem","time","msUnits","_setContainerMeasure","measure","isWidth","elemSize","onComplete","count","doneCount","tick","emitArgs","$event","Event","ignore","getItem","unignore","_find","unstamp","_getBoundingRect","boundingRect","_boundingRect","thisRect","isResizeBound","unbindResize","onresize","previousItems","revealItemElements","hideItemElements","removeData","Layout","bridget","needsVerticalResizeLayout","getColumnWidth","getSegmentSize","getRowHeight","segment","segmentName","outerSize","firstItemSize","getFirstItemSize","raf","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","msRequestAnimationFrame","cb","caf","cancelAnimationFrame","mozCancelAnimationFrame","checkStorageValue","setLocalStorage","storage","access","setItem","getBody","doc","fake","docElement","setFakeBody","docOverflow","background","resetFakeBody","addCSSRule","sheet","rules","insertRule","addRule","getCssRulesLength","cssRules","scope","classListSupport","hasClass","addClass","removeClass","hasAttr","getAttr","isNodeList","setAttrs","removeAttrs","attrLength","arrayFromNodeList","nl","hideElement","forceHide","showElement","isVisible","whichProperty","Props","getEndProperty","propIn","propOut","endProp","supportsPassive","passiveOption","passive","addEvents","preventScrolling","removeEvents","Events","topics","emit","tns","axis","edgePadding","fixedWidth","autoWidth","viewportMax","slideBy","controls","controlsPosition","controlsText","controlsContainer","prevButton","nextButton","nav","navPosition","navContainer","navAsThumbnails","arrowKeys","speed","autoplay","autoplayPosition","autoplayTimeout","autoplayDirection","autoplayText","autoplayHoverPause","autoplayButton","autoplayButtonOutput","autoplayResetOnVisibility","animateIn","animateOut","animateNormal","animateDelay","loop","rewind","autoHeight","responsive","lazyload","lazyloadSelector","touch","mouseDrag","swipeAngle","nested","preventActionWhenRunning","preventScrollOnTouch","freezable","onInit","useLocalStorage","win","KEYS","ENTER","SPACE","LEFT","RIGHT","tnsStorage","localStorageAccess","browserInfo","localStorage","removeItem","CALC","vals","calc","PERCENTAGELAYOUT","supported","wrapper","outer","percentageLayout","CSSMQ","rule","styleSheet","cssText","createTextNode","currentStyle","mediaquerySupport","TRANSFORM","HAS3DTRANSFORMS","tf","has3d","cssTF","getPropertyValue","has3DTransforms","TRANSITIONDURATION","TRANSITIONDELAY","ANIMATIONDURATION","ANIMATIONDELAY","TRANSITIONEND","ANIMATIONEND","supportConsoleWarn","tnsList","optionsElements","nodeName","carousel","responsiveTem","updateOptions","middleWrapper","breakpointZone","outerWrapper","innerWrapper","containerParent","containerHTML","outerHTML","slideItems","slideCount","windowWidth","getWindowWidth","isOn","setBreakpointZone","slidePositions","imgsComplete","liveregionCurrent","itemsMax","media","viewport","getViewportWidth","fixedWidthViewportWidth","slideItemsOut","cloneCount","bp","tem","getItemsMax","hasOption","slideCountNew","hasRightDeadZone","rightBoundary","getRightBoundary","updateIndexBeforeTransform","transformAttr","transformPrefix","transformPostfix","getIndexMax","getStartIndex","indexCached","indexMin","getCurrentSlide","indexMax","moveDirectionExpected","running","newContainerClasses","slideId","tnsId","getFreeze","frozen","controlsEvents","onControlsClick","getEvent","keyIndex","navEvents","getTarget","navIndex","navClicked","targetIndexBase","pages","navCurrentIndex","animating","stopAutoplay","curElement","setFocus","navItems","hoverEvents","stopAutoplayTimer","autoplayHoverPaused","setAutoplayTimer","visibilityEvent","hidden","autoplayVisibilityPaused","docmentKeydownEvent","touchEvents","onPanStart","onPanMove","onPanEnd","dragEvents","hasControls","hasNav","hasAutoplay","hasTouch","hasMouseDrag","slideActiveClass","imgCompleteClass","imgEvents","imgLoaded","img","imgCompleted","preventScroll","prevIsButton","nextIsButton","controlsContainerHTML","prevButtonHTML","nextButtonHTML","navContainerHTML","getPages","pagesCached","getCurrentNavIndex","navCurrentIndexCached","navActiveClass","navStr","navStrCurrent","autoplayTimer","autoplayUserPaused","autoplayButtonHTML","autoplayHtmlStrings","translateInit","rafIndex","initPosition","lastPosition","panStart","getDist","resetVariblesWhenDisable","fragmentBefore","fragmentAfter","cloneFirst","cloneLast","initStructure","fontSize","slide","getSlideMarginLeft","getTransitionDurationStyle","getInnerWrapperStyles","getSlideWidthStyle","getSlideGutterStyle","getAnimationDurationStyle","update_carousel_transition_duration","middleWrapperStr","innerWrapperStr","containerStr","slideStr","itemsBP","fixedWidthBP","speedBP","edgePaddingBP","autoHeightBP","gutterBP","initSheet","initSliderTransform","updateIndex","leftEdge","rightEdge","transformCore","postfix","positionTick","resetDuration","doContainerTransform","getContainerTransformValue","moveElement","updateContentWrapperHeight","eve","animateSlide","version","getInfo","play","startAutoplay","pause","updateSliderHeight","updateInnerWrapperHeight","ownerNode","onResize","toggleAutoplay","htmlList","prevEl","previousElementSibling","nextElementSibling","firstElementChild","rebuild","condition","ind","getAbsIndex","absIndex","getInsertPosition","pos","gap","ww","edgePaddingTem","gutterTem","fixedWidthTem","speedTem","gutterTemUnit","itemsTem","dividend","getCSSPrefix","imgs","src","imgsLoadedCheck","getImageArray","initSliderTransformStyleCheck","doContainerTransformSilent","initTools","initEvents","stylesApplicationCheck","toFixed","initSliderTransformCore","setSlidePositions","updateSlideStatus","insertAdjacentHTML","getLiveRegionStr","txt","navHtml","hiddenStr","updateNavVisibility","isButton","updateControlsStatus","disableUI","resizeTasks","doAutoHeight","doLazyLoad","disableSlider","freezeSlider","additionalUpdates","bpChanged","breakpointZoneTem","needContainerTransform","indChanged","itemsChanged","disableTem","freezeTem","arrowKeysTem","controlsTem","navTem","touchTem","mouseDragTem","autoplayTem","autoplayHoverPauseTem","autoplayResetOnVisibilityTem","indexTem","autoHeightTem","controlsTextTem","centerTem","autoplayTextTem","classN","enableUI","enableSlider","unfreezeSlider","updateLiveRegion","updateGallerySlidePositions","autoheightTem","deleteRule","removeRule","removeCSSRule","vp","getVisibleSlideRange","rangestart","rangeend","point","stopPropagation","srcset","navPrev","navCurrent","updateNavStatus","getMaxSlideHeight","slideStart","slideRange","heights","maxHeight","wp","attr2","base","getLowerCaseNodeName","isAriaDisabled","disEnableElement","prevDisabled","nextDisabled","disablePrev","disableNext","getCenterGap","denominator","number","classOut","classIn","isOut","sliderMoved","strTrans","targetIndex","indexGap","factor","passEventObject","targetIn","updateAutoplayButton","isTouchEvent","changedTouches","srcElement","preventDefaultBehavior","getMoveDirectionExpected","angle","atan2","PI","$","clientX","clientY","panUpdate","dist","preventClick","indexMoved","moved","rough","displayIndex","lazySizes","lazysizes","lazySizesCfg","lazySizesDefaults","lazyClass","loadedClass","loadingClass","preloadClass","errorClass","autosizesClass","fastLoadedClass","iframeLoadMode","srcAttr","srcsetAttr","sizesAttr","minSize","customMedia","expFactor","hFac","loadMode","loadHidden","ricTimeout","lazySizesConfig","lazysizesConfig","getElementsByClassName","cfg","noSupport","docElem","supportPicture","HTMLPictureElement","requestIdleCallback","regPicture","loadEvents","regClassCache","ele","cls","RegExp","reg","addRemoveLoadEvents","dom","evt","noBubbles","noCancelable","updatePolyfill","full","polyfill","picturefill","pf","reevaluate","elements","getCSS","_lazysizesWidth","rAF","firstFns","secondFns","fns","run","runFns","waiting","rafBatch","_lsFlush","rAFIt","simple","that","loader","regImg","regIframe","supportScroll","currentExpand","isLoading","lowRuns","resetPreloading","isBodyHidden","isNestedVisible","elemExpand","visible","eLtop","eLbottom","eLleft","eLright","checkElements","eLlen","autoLoadElem","loadedSomething","elemNegativeExpand","elemExpandVal","beforeExpandVal","defaultExpand","preloadExpand","lazyloadElems","_lazyRace","prematureUnveil","unveilElement","_defEx","eLvW","elvH","isCompleted","preloadElems","preloadAfterLoad","throttledCheckElements","lastTime","gDelay","rICTimeout","idleCallback","isPriority","throttle","switchLoadingClass","_lazyCache","rafSwitchLoadingClass","rafedSwitchLoadingClass","handleSources","sourceSrcset","lazyUnveil","sizes","isImg","isPicture","firesLoad","resetPreloadingTimer","contentWindow","changeIframeSrc","isLoaded","complete","naturalWidth","loading","autoSizer","updateElem","afterScroll","altLoadmodeScrollListner","started","persisted","loadingElements","checkElems","unveil","_aLSL","sizeElement","getSizeElement","debouncedUpdateElementsSizes","autosizesElems","uP","aC","rC","hC","fire","gW","ElementPrototype","regArtDirect","regDescriptors","regArtDirectTags","regSplit","oMatchesSelector","imgCfg","picture","fontFamily","config","autoArtDirect","tags","toTagSelector","getArtDirectConfig","selectSource","tag","toSourceObj","ratio","isSelected","matchMedia","sortAspectRatio","source1","source2","setMedia","_lsMedia","imgAspectRatio","closestSource","aspecRatio","getClosestSource","bgLoad","regBgUrlEscape","uniqueUrls","addStyleScript","insertElem","rel","tmp","poster","preload","er","requireJs","backgroundImage","regWhite","regSplitSet","regSource","regType","allowedBackgroundSize","contain","cover","setTypeOrMedia","typeMatch","proxyLoad","_lazybgset","image","currentSrc","useSrc","fullSrc","_lazybgsetLoading","set","alt","sets","optimumx","createPicture","bgSize","backgroundSize","getBgSize","_lazysizesParentFit"],"mappings":";wFAAA,2jDAQA,IAAIA,EAAkB,CAClBC,WAAW,EACXC,SAAS,EACTC,SAAS,GAETC,EAAmB,CACnB,MAAO,QACP,MAAO,MAEX,SAASC,EAAcC,EAASC,EAAOC,GACnC,IAAIC,EAAKC,SAASL,cAAcC,GAChC,GAAIC,EACA,IAAK,IAAII,KAAYJ,EACA,UAAbI,EACAC,EAAWH,EAAIF,EAAMI,IAEhBX,EAAgBW,GACrBF,EAAGE,GAAYJ,EAAMI,GAGrBF,EAAGI,aAAaF,EAAUJ,EAAMI,IAU5C,MANuB,iBAAZH,EACPC,EAAGK,UAAYN,EAEC,MAAXA,GACLO,EAAgBN,EAAID,GAEjBC,EAEX,SAASO,EAAcC,GACnBA,EAAOA,EAAKC,OACZ,IAAIC,EAAYT,SAASL,cAAce,EAAoBH,IAE3D,OADAE,EAAUL,UAAYG,EACfE,EAAUE,WAErB,SAASC,EAAeL,GACpB,OAAOM,MAAMC,UAAUC,MAAMC,KAEjC,SAAwBT,GACpBA,EAAOA,EAAKC,OACZ,IAAIC,EAAYT,SAASL,cAAce,EAAoBH,IAE3D,OADAE,EAAUL,UAAYG,EACfE,EAAUQ,WANiBC,CAAeX,IASrD,SAASG,EAAoBH,GACzB,OAAOb,EAAiBa,EAAKY,OAAO,EAAG,KAClC,MAET,SAASd,EAAgBN,EAAID,GAEzB,IADA,IAAImB,EAAaG,EAAiBtB,GACzBuB,EAAI,EAAGA,EAAIJ,EAAWK,OAAQD,IACnCtB,EAAGwB,YAAYN,EAAWI,IAGlC,SAASG,EAAiBC,EAAQ3B,GAG9B,IAFA,IAAI4B,EAASN,EAAiBtB,GAC1B6B,EAAUF,EAAOd,YAAc,KAC1BU,EAAI,EAAGA,EAAIK,EAAOJ,OAAQD,IAC/BI,EAAOG,aAAaF,EAAOL,GAAIM,GAGvC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G,YAGjBN,EAAsBiB,KACxBx0C,EAAEnuD,OAAO8iG,oBAAsBH,EAE/B9M,EAAUoD,KAAI,WACb9qC,EAAEnuD,OAAOlJ,aAAa,kBAAmB6rG,GACtCx0C,EAAEnuD,OAAO8iG,4BACJ30C,EAAEnuD,OAAO8iG,4BAKlB,GAEHnsG,EAAS6C,gBAAgByG,iBAAiB,mBAAmB,SAASkuD,GA1KrD,IAASlC,EACrBjwD,GA0KDmyD,EAAE9Y,kBAAqB8Y,EAAEnuD,OAAOgiG,YAAc7zC,EAAEoL,OAAOtqD,UAAY4mF,IACtE1nC,EAAEoL,OAAOv9D,OA5KgBiwD,EA4KGkC,EAAEnuD,OAAOgiG,WA3KjChmG,EAAQ65F,EAAU+I,GAAG3yC,EAAMA,EAAKtzD,cAEhCszD,EAAK+sC,iBAAmBh9F,EAAQiwD,EAAK+sC,mBACxC/sC,EAAK+sC,gBAAkBh9F,GAEjBiwD,EAAK+sC,0B,iBClCd,IAAI/oC,EAGJA,EAAI,WACH,OAAO12D,KADJ,GAIJ,IAEC02D,EAAIA,GAAK,IAAI7lD,SAAS,cAAb,GACR,MAAO+jD,GAEc,iBAAX5xD,SAAqB0zD,EAAI1zD,QAOrC0xD,EAAOC,QAAU+B","file":"vendors.js","sourcesContent":["/*!\nFullCalendar Core Package v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n// Creating\n// ----------------------------------------------------------------------------------------------------------------\nvar elementPropHash = {\n className: true,\n colSpan: true,\n rowSpan: true\n};\nvar containerTagHash = {\n '= 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\n// Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side\nvar isRtlScrollbarOnLeft = null;\nfunction getIsRtlScrollbarOnLeft() {\n if (isRtlScrollbarOnLeft === null) {\n isRtlScrollbarOnLeft = computeIsRtlScrollbarOnLeft();\n }\n return isRtlScrollbarOnLeft;\n}\nfunction computeIsRtlScrollbarOnLeft() {\n var outerEl = createElement('div', {\n style: {\n position: 'absolute',\n top: -1000,\n left: 0,\n border: 0,\n padding: 0,\n overflow: 'scroll',\n direction: 'rtl'\n }\n }, '
');\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// The scrollbar width computations in computeEdges are sometimes flawed when it comes to\n// retina displays, rounding, and IE11. Massage them into a usable value.\nfunction sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n width = Math.round(width);\n return width;\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 // must use offset(Width|Height) because compatible with client(Width|Height)\n var scrollbarLeftRight = sanitizeScrollbarWidth(el.offsetWidth - el.clientWidth - borderLeft - borderRight);\n var scrollbarBottom = sanitizeScrollbarWidth(el.offsetHeight - el.clientHeight - 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) {\n if (goWithinPadding === void 0) { goWithinPadding = false; }\n var outerRect = 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 computeViewportRect() {\n return {\n left: window.pageXOffset,\n right: window.pageXOffset + document.documentElement.clientWidth,\n top: window.pageYOffset,\n bottom: window.pageYOffset + document.documentElement.clientHeight\n };\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}\nfunction computeClippingRect(el) {\n return getClippingParents(el)\n .map(function (el) {\n return computeInnerRect(el);\n })\n .concat(computeViewportRect())\n .reduce(function (rect0, rect1) {\n return intersectRects(rect0, rect1) || rect1; // should always intersect\n });\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 listenBySelector(container, eventType, selector, handler) {\n function realHandler(ev) {\n var matchedChild = elementClosest(ev.target, selector);\n if (matchedChild) {\n handler.call(matchedChild, ev, matchedChild);\n }\n }\n container.addEventListener(eventType, realHandler);\n return function () {\n container.removeEventListener(eventType, realHandler);\n };\n}\nfunction listenToHoverBySelector(container, selector, onMouseEnter, onMouseLeave) {\n var currentMatchedChild;\n return listenBySelector(container, 'mouseover', selector, function (ev, matchedChild) {\n if (matchedChild !== currentMatchedChild) {\n currentMatchedChild = matchedChild;\n onMouseEnter(ev, matchedChild);\n var realOnMouseLeave_1 = function (ev) {\n currentMatchedChild = null;\n onMouseLeave(ev, 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\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)\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\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 else if (typeof input === 'object' && input) { // non-null object\n return normalizeObject(input);\n }\n else if (typeof input === 'number') {\n return normalizeObject((_a = {}, _a[unit || 'milliseconds'] = input, _a));\n }\n else {\n return null;\n }\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 normalizeObject(obj) {\n return {\n years: obj.years || obj.year || 0,\n months: obj.months || obj.month || 0,\n days: (obj.days || obj.day || 0) +\n getWeeksFromInput(obj) * 7,\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}\nfunction getWeeksFromInput(obj) {\n return obj.weeks || obj.week || 0;\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 isSingleDay(dur) {\n return dur.years === 0 && dur.months === 0 && dur.days === 1 && dur.milliseconds === 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++) {\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, dontReturnWeeks) {\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 (!dontReturnWeeks && 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/* FullCalendar-specific DOM Utilities\n----------------------------------------------------------------------------------------------------------------------*/\n// Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left\n// and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.\nfunction compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n}\n// Undoes compensateScroll and restores all borders/margins\nfunction uncompensateScroll(rowEl) {\n applyStyle(rowEl, {\n marginLeft: '',\n marginRight: '',\n borderLeftWidth: '',\n borderRightWidth: ''\n });\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// Given a total available height to fill, have `els` (essentially child rows) expand to accomodate.\n// By default, all elements that are shorter than the recommended height are expanded uniformly, not considering\n// any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and\n// reduces the available height.\nfunction distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n}\n// Undoes distrubuteHeight, restoring all els to their natural height\nfunction undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n}\n// Given `els`, a set of cells, find the cell with the largest natural width and set the widths of all the\n// cells to be that width.\n// PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline\nfunction matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.forEach(function (el) {\n var innerEl = el.firstChild; // hopefully an element\n if (innerEl instanceof HTMLElement) {\n var innerWidth_1 = innerEl.getBoundingClientRect().width;\n if (innerWidth_1 > maxInnerWidth) {\n maxInnerWidth = innerWidth_1;\n }\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n els.forEach(function (el) {\n el.style.width = maxInnerWidth + 'px';\n });\n return maxInnerWidth;\n}\n// Given one element that resides inside another,\n// Subtracts the height of the inner element from the outer element.\nfunction subtractInnerElHeight(outerEl, innerEl) {\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n var reflowStyleProps = {\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n };\n applyStyle(outerEl, reflowStyleProps);\n applyStyle(innerEl, reflowStyleProps);\n var diff = // grab the dimensions\n outerEl.getBoundingClientRect().height -\n innerEl.getBoundingClientRect().height;\n // undo hack\n var resetStyleProps = { position: '', left: '' };\n applyStyle(outerEl, resetStyleProps);\n applyStyle(innerEl, resetStyleProps);\n return diff;\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}\n/* Object Ordering by Field\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++) {\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++) {\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 capitaliseFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nfunction padStart(val, len) {\n var s = String(val);\n return '000'.substr(0, len - s.length) + s;\n}\n/* Number Utilities\n----------------------------------------------------------------------------------------------------------------------*/\nfunction compareNumbers(a, b) {\n return a - b;\n}\nfunction isInt(n) {\n return n % 1 === 0;\n}\n/* Weird Utilities\n----------------------------------------------------------------------------------------------------------------------*/\nfunction applyAll(functions, thisObj, args) {\n if (typeof functions === 'function') { // supplied a single function\n functions = [functions];\n }\n if (functions) {\n var i = void 0;\n var ret = void 0;\n for (i = 0; i < functions.length; i++) {\n ret = functions[i].apply(thisObj, args) || ret;\n }\n return ret;\n }\n}\nfunction firstDefined() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n for (var i = 0; i < args.length; i++) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n}\n// Returns a function, that, as long as it continues to be invoked, will not\n// be triggered. The function will be called after it stops being called for\n// N milliseconds. If `immediate` is passed, trigger the function on the\n// leading edge, instead of the trailing.\n// https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714\nfunction debounce(func, wait) {\n var timeout;\n var args;\n var context;\n var timestamp;\n var result;\n var later = function () {\n var last = new Date().valueOf() - timestamp;\n if (last < wait) {\n timeout = setTimeout(later, wait - last);\n }\n else {\n timeout = null;\n result = func.apply(context, args);\n context = args = null;\n }\n };\n return function () {\n context = this;\n args = arguments;\n timestamp = new Date().valueOf();\n if (!timeout) {\n timeout = setTimeout(later, wait);\n }\n return result;\n };\n}\n// Number and Boolean are only types that defaults or not computed for\n// TODO: write more comments\nfunction refineProps(rawProps, processors, defaults, leftoverProps) {\n if (defaults === void 0) { defaults = {}; }\n var refined = {};\n for (var key in processors) {\n var processor = processors[key];\n if (rawProps[key] !== undefined) {\n // found\n if (processor === Function) {\n refined[key] = typeof rawProps[key] === 'function' ? rawProps[key] : null;\n }\n else if (processor) { // a refining function?\n refined[key] = processor(rawProps[key]);\n }\n else {\n refined[key] = rawProps[key];\n }\n }\n else if (defaults[key] !== undefined) {\n // there's an explicit default\n refined[key] = defaults[key];\n }\n else {\n // must compute a default\n if (processor === String) {\n refined[key] = ''; // empty string is default for String\n }\n else if (!processor || processor === Number || processor === Boolean || processor === Function) {\n refined[key] = null; // assign null for other non-custom processor funcs\n }\n else {\n refined[key] = processor(null); // run the custom processor func\n }\n }\n }\n if (leftoverProps) {\n for (var key in rawProps) {\n if (processors[key] === undefined) {\n leftoverProps[key] = rawProps[key];\n }\n }\n }\n return refined;\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 else if (largeUnit === 'month') {\n return createDuration(dateEnv.diffWholeMonths(date0, date1), 'month');\n }\n else {\n return diffDayAndTime(date0, date1); // returns a duration\n }\n}\n\n/*! *****************************************************************************\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 (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\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\nvar __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};\n\nfunction parseRecurring(eventInput, allDayDefault, dateEnv, recurringTypes, leftovers) {\n for (var i = 0; i < recurringTypes.length; i++) {\n var localLeftovers = {};\n var parsed = recurringTypes[i].parse(eventInput, localLeftovers, dateEnv);\n if (parsed) {\n var allDay = localLeftovers.allDay;\n delete localLeftovers.allDay; // remove from leftovers\n if (allDay == null) {\n allDay = allDayDefault;\n if (allDay == null) {\n allDay = parsed.allDayGuess;\n if (allDay == null) {\n allDay = false;\n }\n }\n }\n __assign(leftovers, localLeftovers);\n return {\n allDay: allDay,\n duration: parsed.duration,\n typeData: parsed.typeData,\n typeId: i\n };\n }\n }\n return null;\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 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, complexProps) {\n var dest = {};\n var i;\n var name;\n var complexObjs;\n var j;\n var val;\n var props;\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i];\n complexObjs = [];\n // collect the trailing object values, stopping when a non-object is discovered\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name];\n if (typeof val === 'object' && val) { // non-null object\n complexObjs.unshift(val);\n }\n else if (val !== undefined) {\n dest[name] = 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] = mergeProps(complexObjs);\n }\n }\n }\n // copy values into the destination, going from last to first\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i];\n for (name in props) {\n if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign\n dest[name] = props[name];\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 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 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}\n\nfunction parseEvents(rawEvents, sourceId, calendar, allowOpenRange) {\n var eventStore = createEmptyEventStore();\n for (var _i = 0, rawEvents_1 = rawEvents; _i < rawEvents_1.length; _i++) {\n var rawEvent = rawEvents_1[_i];\n var tuple = parseEvent(rawEvent, sourceId, calendar, allowOpenRange);\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}\nfunction expandRecurring(eventStore, framingRange, calendar) {\n var dateEnv = calendar.dateEnv;\n var defs = eventStore.defs, instances = eventStore.instances;\n // remove existing recurring instances\n instances = filterHash(instances, function (instance) {\n return !defs[instance.defId].recurringDef;\n });\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 calendar.defaultAllDayEventDuration :\n calendar.defaultTimedEventDuration;\n }\n var starts = expandRecurringRanges(def, duration, framingRange, calendar.dateEnv, calendar.pluginSystem.hooks.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// 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) {\n return isEventDefsGrouped(def_1, lookDef);\n });\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 transformRawEvents(rawEvents, eventSource, calendar) {\n var calEachTransform = calendar.opt('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_2 = rawEvents; _i < rawEvents_2.length; _i++) {\n var rawEvent = rawEvents_2[_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 createEmptyEventStore() {\n return { defs: {}, instances: {} };\n}\nfunction mergeEventStores(store0, store1) {\n return {\n defs: __assign({}, store0.defs, store1.defs),\n instances: __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) {\n return defs[instance.defId]; // still exists?\n });\n return { defs: defs, instances: instances };\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++) {\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;\n var 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\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++;\n }\n else {\n i++;\n }\n }\n return removeCnt;\n}\nfunction isArraysEqual(a0, a1) {\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++) {\n if (a0[i] !== a1[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction memoize(workerFunc) {\n var args;\n var res;\n return function () {\n if (!args || !isArraysEqual(args, arguments)) {\n args = arguments;\n res = workerFunc.apply(this, arguments);\n }\n return res;\n };\n}\n/*\nalways executes the workerFunc, but if the result is equal to the previous result,\nreturn the previous result instead.\n*/\nfunction memoizeOutput(workerFunc, equalityFunc) {\n var cachedRes = null;\n return function () {\n var newRes = workerFunc.apply(this, arguments);\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes;\n }\n return cachedRes;\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) {\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) {\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 || '';\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 default:\n return 'day';\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) {\n return formatTimeZoneOffset(date.timeZoneOffset);\n };\n }\n if (standardDatePropCnt === 0 && extendedSettings.week) {\n return function (date) {\n return formatWeekNumber(context.computeWeekNumber(date.marker), context.weekLabel, context.locale, extendedSettings.week);\n };\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) {\n return m1.toLocaleLowerCase();\n });\n }\n else if (extendedSettings.meridiem === 'short') { // am/pm\n s = s.replace(MERIDIEM_RE, function (m0, m1) {\n return m1.toLocaleLowerCase() + 'm';\n });\n }\n else if (extendedSettings.meridiem === 'lowercase') { // other meridiem transformers already converted to lowercase\n s = s.replace(MERIDIEM_RE, function (m0) {\n return m0.toLocaleLowerCase();\n });\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, weekLabel, locale, display) {\n var parts = [];\n if (display === 'narrow') {\n parts.push(weekLabel);\n }\n else if (display === 'short') {\n parts.push(weekLabel, ' ');\n }\n // otherwise, considered 'numeric'\n parts.push(locale.simpleNumberFormat.format(num));\n if (locale.options.isRtl) { // 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\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, separator) {\n this.cmdStr = cmdStr;\n this.separator = separator;\n }\n CmdFormatter.prototype.format = function (date, context) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(date, null, context, this.separator));\n };\n CmdFormatter.prototype.formatRange = function (start, end, context) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(start, end, context, this.separator));\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) {\n return this.func(createVerboseFormattingArg(date, null, context));\n };\n FuncFormatter.prototype.formatRange = function (start, end, context) {\n return this.func(createVerboseFormattingArg(start, end, context));\n };\n return FuncFormatter;\n}());\n\n// Formatter Object Creation\nfunction createFormatter(input, defaultSeparator) {\n if (typeof input === 'object' && input) { // non-null object\n if (typeof defaultSeparator === 'string') {\n input = __assign({ separator: defaultSeparator }, input);\n }\n return new NativeFormatter(input);\n }\n else if (typeof input === 'string') {\n return new CmdFormatter(input, defaultSeparator);\n }\n else if (typeof input === 'function') {\n return new FuncFormatter(input);\n }\n}\n// String Utils\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}\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 else {\n return 'GMT' + sign + hours + (mins ? ':' + padStart(mins, 2) : '');\n }\n}\n// Arg Utils\nfunction createVerboseFormattingArg(start, end, context, separator) {\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 separator: separator\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\nvar EventSourceApi = /** @class */ (function () {\n function EventSourceApi(calendar, internalEventSource) {\n this.calendar = calendar;\n this.internalEventSource = internalEventSource;\n }\n EventSourceApi.prototype.remove = function () {\n this.calendar.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: this.internalEventSource.sourceId\n });\n };\n EventSourceApi.prototype.refetch = function () {\n this.calendar.dispatch({\n type: 'FETCH_EVENT_SOURCES',\n sourceIds: [this.internalEventSource.sourceId]\n });\n };\n Object.defineProperty(EventSourceApi.prototype, \"id\", {\n get: function () {\n return this.internalEventSource.publicId;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventSourceApi.prototype, \"url\", {\n // only relevant to json-feed event sources\n get: function () {\n return this.internalEventSource.meta.url;\n },\n enumerable: true,\n configurable: true\n });\n return EventSourceApi;\n}());\n\nvar EventApi = /** @class */ (function () {\n function EventApi(calendar, def, instance) {\n this._calendar = calendar;\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 DATE_PROPS) ;\n else if (name in NON_DATE_PROPS) {\n if (typeof NON_DATE_PROPS[name] === 'function') {\n val = NON_DATE_PROPS[name](val);\n }\n this.mutate({\n standardProps: (_a = {}, _a[name] = val, _a)\n });\n }\n else if (name in UNSCOPED_EVENT_UI_PROPS) {\n var ui = void 0;\n if (typeof UNSCOPED_EVENT_UI_PROPS[name] === 'function') {\n val = UNSCOPED_EVENT_UI_PROPS[name](val);\n }\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 };\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._calendar.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._calendar.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._calendar.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._calendar.opt('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._calendar.dateEnv;\n var instance = this._instance;\n var formatter = createFormatter(formatInput, this._calendar.opt('defaultRangeSeparator'));\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 else {\n return dateEnv.format(instance.range.start, formatter, {\n forcedTzo: instance.forcedStartTzo\n });\n }\n };\n EventApi.prototype.mutate = function (mutation) {\n var def = this._def;\n var instance = this._instance;\n if (instance) {\n this._calendar.dispatch({\n type: 'MUTATE_EVENTS',\n instanceId: instance.instanceId,\n mutation: mutation,\n fromApi: true\n });\n var eventStore = this._calendar.state.eventStore;\n this._def = eventStore.defs[def.defId];\n this._instance = eventStore.instances[instance.instanceId];\n }\n };\n EventApi.prototype.remove = function () {\n this._calendar.dispatch({\n type: 'REMOVE_EVENT_DEF',\n defId: this._def.defId\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._calendar, this._calendar.state.eventSources[sourceId]);\n }\n return null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"start\", {\n get: function () {\n return this._instance ?\n this._calendar.dateEnv.toDate(this._instance.range.start) :\n null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"end\", {\n get: function () {\n return (this._instance && this._def.hasEnd) ?\n this._calendar.dateEnv.toDate(this._instance.range.end) :\n null;\n },\n enumerable: true,\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: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"groupId\", {\n get: function () { return this._def.groupId; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"allDay\", {\n get: function () { return this._def.allDay; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"title\", {\n get: function () { return this._def.title; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"url\", {\n get: function () { return this._def.url; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"rendering\", {\n get: function () { return this._def.rendering; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"startEditable\", {\n get: function () { return this._def.ui.startEditable; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"durationEditable\", {\n get: function () { return this._def.ui.durationEditable; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"constraint\", {\n get: function () { return this._def.ui.constraints[0] || null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"overlap\", {\n get: function () { return this._def.ui.overlap; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"allow\", {\n get: function () { return this._def.ui.allows[0] || null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"backgroundColor\", {\n get: function () { return this._def.ui.backgroundColor; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"borderColor\", {\n get: function () { return this._def.ui.borderColor; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"textColor\", {\n get: function () { return this._def.ui.textColor; },\n enumerable: true,\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: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"extendedProps\", {\n get: function () { return this._def.extendedProps; },\n enumerable: true,\n configurable: true\n });\n return EventApi;\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 if (def.rendering === '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 (def.rendering === '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 {\n (def.rendering === '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.rendering === 'background' || def.rendering === 'inverse-background';\n}\nfunction filterSegsViaEls(context, segs, isMirror) {\n var calendar = context.calendar, view = context.view;\n if (calendar.hasPublicHandlers('eventRender')) {\n segs = segs.filter(function (seg) {\n var custom = calendar.publiclyTrigger('eventRender', [\n {\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n isMirror: isMirror,\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n // TODO: include seg.range once all components consistently generate it\n el: seg.el,\n view: view\n }\n ]);\n if (custom === false) { // means don't render at all\n return false;\n }\n else if (custom && custom !== true) {\n seg.el = custom;\n }\n return true;\n });\n }\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n setElSeg(seg.el, seg);\n }\n return segs;\n}\nfunction setElSeg(el, seg) {\n el.fcSeg = seg;\n}\nfunction getElSeg(el) {\n return el.fcSeg || null;\n}\n// event ui computation\nfunction compileEventUis(eventDefs, eventUiBases) {\n return mapHash(eventDefs, function (eventDef) {\n return compileEventUi(eventDef, eventUiBases);\n });\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}\n// triggers\nfunction triggerRenderedSegs(context, segs, isMirrors) {\n var calendar = context.calendar, view = context.view;\n if (calendar.hasPublicHandlers('eventPositioned')) {\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n calendar.publiclyTriggerAfterSizing('eventPositioned', [\n {\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n isMirror: isMirrors,\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n el: seg.el,\n view: view\n }\n ]);\n }\n }\n if (!calendar.state.eventSourceLoadingLevel) { // avoid initial empty state while pending\n calendar.afterSizingTriggers._eventsPositioned = [null]; // fire once\n }\n}\nfunction triggerWillRemoveSegs(context, segs, isMirrors) {\n var calendar = context.calendar, view = context.view;\n for (var _i = 0, segs_3 = segs; _i < segs_3.length; _i++) {\n var seg = segs_3[_i];\n calendar.trigger('eventElRemove', seg.el);\n }\n if (calendar.hasPublicHandlers('eventDestroy')) {\n for (var _a = 0, segs_4 = segs; _a < segs_4.length; _a++) {\n var seg = segs_4[_a];\n calendar.publiclyTrigger('eventDestroy', [\n {\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n isMirror: isMirrors,\n el: seg.el,\n view: view\n }\n ]);\n }\n }\n}\n// is-interactable\nfunction computeEventDraggable(context, eventDef, eventUi) {\n var calendar = context.calendar, view = context.view;\n var transformers = calendar.pluginSystem.hooks.isDraggableTransformers;\n var val = eventUi.startEditable;\n for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) {\n var transformer = transformers_1[_i];\n val = transformer(val, eventDef, eventUi, view);\n }\n return val;\n}\nfunction computeEventStartResizable(context, eventDef, eventUi) {\n return eventUi.durationEditable && context.options.eventResizableFromStart;\n}\nfunction computeEventEndResizable(context, eventDef, eventUi) {\n return eventUi.durationEditable;\n}\n\n// applies the mutation to ALL defs/instances within the event store\nfunction applyMutationToEventStore(eventStore, eventConfigBase, mutation, calendar) {\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, calendar.pluginSystem.hooks.eventDefMutationAppliers, calendar);\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, calendar);\n }\n return dest;\n}\nfunction applyMutationToEventDef(eventDef, eventConfig, mutation, appliers, calendar) {\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({}, eventDef, standardProps, { ui: __assign({}, eventDef.ui, standardProps.ui) });\n if (mutation.extendedProps) {\n copy.extendedProps = __assign({}, copy.extendedProps, mutation.extendedProps);\n }\n for (var _i = 0, appliers_1 = appliers; _i < appliers_1.length; _i++) {\n var applier = appliers_1[_i];\n applier(copy, mutation, calendar);\n }\n if (!copy.hasEnd && calendar.opt('forceEventDuration')) {\n copy.hasEnd = true;\n }\n return copy;\n}\nfunction applyMutationToEventInstance(eventInstance, eventDef, // must first be modified by applyMutationToEventDef\neventConfig, mutation, calendar) {\n var dateEnv = calendar.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: calendar.getDefaultEventEnd(eventDef.allDay, copy.range.start)\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 = calendar.getDefaultEventEnd(eventDef.allDay, copy.range.start);\n }\n return copy;\n}\n\nfunction reduceEventStore (eventStore, action, eventSources, dateProfile, calendar) {\n switch (action.type) {\n case 'RECEIVE_EVENTS': // raw\n return receiveRawEvents(eventStore, eventSources[action.sourceId], action.fetchId, action.fetchRange, action.rawEvents, calendar);\n case 'ADD_EVENTS': // already parsed, but not expanded\n return addEvent(eventStore, action.eventStore, // new ones\n dateProfile ? dateProfile.activeRange : null, calendar);\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 'SET_DATE':\n case 'SET_VIEW_TYPE':\n if (dateProfile) {\n return expandRecurring(eventStore, dateProfile.activeRange, calendar);\n }\n else {\n return eventStore;\n }\n case 'CHANGE_TIMEZONE':\n return rezoneDates(eventStore, action.oldDateEnv, calendar.dateEnv);\n case 'MUTATE_EVENTS':\n return applyMutationToRelated(eventStore, action.instanceId, action.mutation, action.fromApi, calendar);\n case 'REMOVE_EVENT_INSTANCES':\n return excludeInstances(eventStore, action.instances);\n case 'REMOVE_EVENT_DEF':\n return filterEventStoreDefs(eventStore, function (eventDef) {\n return eventDef.defId !== action.defId;\n });\n case 'REMOVE_EVENT_SOURCE':\n return excludeEventsBySourceId(eventStore, action.sourceId);\n case 'REMOVE_ALL_EVENT_SOURCES':\n return filterEventStoreDefs(eventStore, function (eventDef) {\n return !eventDef.sourceId; // only keep events with no source id\n });\n case 'REMOVE_ALL_EVENTS':\n return createEmptyEventStore();\n case 'RESET_EVENTS':\n return {\n defs: eventStore.defs,\n instances: eventStore.instances\n };\n default:\n return eventStore;\n }\n}\nfunction receiveRawEvents(eventStore, eventSource, fetchId, fetchRange, rawEvents, calendar) {\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, calendar), eventSource.sourceId, calendar);\n if (fetchRange) {\n subset = expandRecurring(subset, fetchRange, calendar);\n }\n return mergeEventStores(excludeEventsBySourceId(eventStore, eventSource.sourceId), subset);\n }\n return eventStore;\n}\nfunction addEvent(eventStore, subset, expandRange, calendar) {\n if (expandRange) {\n subset = expandRecurring(subset, expandRange, calendar);\n }\n return mergeEventStores(eventStore, subset);\n}\nfunction rezoneDates(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 else {\n return __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 });\n return { defs: defs, instances: instances };\n}\nfunction applyMutationToRelated(eventStore, instanceId, mutation, fromApi, calendar) {\n var relevant = getRelevantEvents(eventStore, instanceId);\n var eventConfigBase = fromApi ?\n { '': {\n startEditable: true,\n durationEditable: true,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: []\n } } :\n calendar.eventUiBases;\n relevant = applyMutationToEventStore(relevant, eventConfigBase, mutation, calendar);\n return mergeEventStores(eventStore, relevant);\n}\nfunction excludeEventsBySourceId(eventStore, sourceId) {\n return filterEventStoreDefs(eventStore, function (eventDef) {\n return eventDef.sourceId !== sourceId;\n });\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) {\n return !removals[instance.instanceId];\n })\n };\n}\n\n// high-level segmenting-aware tester functions\n// ------------------------------------------------------------------------------------------------------------------------\nfunction isInteractionValid(interaction, calendar) {\n return isNewPropsValid({ eventDrag: interaction }, calendar); // HACK: the eventDrag props is used for ALL interactions\n}\nfunction isDateSelectionValid(dateSelection, calendar) {\n return isNewPropsValid({ dateSelection: dateSelection }, calendar);\n}\nfunction isNewPropsValid(newProps, calendar) {\n var view = calendar.view;\n var props = __assign({ businessHours: view ? view.props.businessHours : createEmptyEventStore(), dateSelection: '', eventStore: calendar.state.eventStore, eventUiBases: calendar.eventUiBases, eventSelection: '', eventDrag: null, eventResize: null }, newProps);\n return (calendar.pluginSystem.hooks.isPropsValid || isPropsValid)(props, calendar);\n}\nfunction isPropsValid(state, calendar, dateSpanMeta, filterConfig) {\n if (dateSpanMeta === void 0) { dateSpanMeta = {}; }\n if (state.eventDrag && !isInteractionPropsValid(state, calendar, dateSpanMeta, filterConfig)) {\n return false;\n }\n if (state.dateSelection && !isDateSelectionPropsValid(state, calendar, dateSpanMeta, filterConfig)) {\n return false;\n }\n return true;\n}\n// Moving Event Validation\n// ------------------------------------------------------------------------------------------------------------------------\nfunction isInteractionPropsValid(state, calendar, dateSpanMeta, filterConfig) {\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 { '': calendar.selectionConfig } // if not a real event, validate as a selection\n );\n if (filterConfig) {\n subjectConfigs = mapHash(subjectConfigs, filterConfig);\n }\n var otherEventStore = excludeInstances(state.eventStore, interaction.affectedEvents.instances); // exclude the subject events. TODO: exclude defs too?\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, calendar)) {\n return false;\n }\n // overlap\n var overlapFunc = calendar.opt('eventOverlap');\n if (typeof overlapFunc !== 'function') {\n overlapFunc = null;\n }\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 (overlapFunc && !overlapFunc(new EventApi(calendar, otherDefs[otherInstance.defId], otherInstance), // still event\n new EventApi(calendar, subjectDef, subjectInstance) // moving event\n )) {\n return false;\n }\n }\n }\n // allow (a function)\n var calendarEventStore = calendar.state.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({}, 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(calendar, origDef, origInstance);\n }\n else { // was an external event\n eventApi = new EventApi(calendar, subjectDef); // no instance, because had no dates\n }\n if (!subjectAllow(calendar.buildDateSpanApi(subjectDateSpan), eventApi)) {\n return false;\n }\n }\n }\n return true;\n}\n// Date Selection Validation\n// ------------------------------------------------------------------------------------------------------------------------\nfunction isDateSelectionPropsValid(state, calendar, 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 = calendar.selectionConfig;\n if (filterConfig) {\n selectionConfig = filterConfig(selectionConfig);\n }\n // constraint\n if (!allConstraintsPass(selectionConfig.constraints, selectionRange, relevantEventStore, state.businessHours, calendar)) {\n return false;\n }\n // overlap\n var overlapFunc = calendar.opt('selectOverlap');\n if (typeof overlapFunc !== 'function') {\n overlapFunc = null;\n }\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 (overlapFunc && !overlapFunc(new EventApi(calendar, relevantDefs[relevantInstance.defId], relevantInstance))) {\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({}, dateSpanMeta, selection);\n if (!selectionAllow(calendar.buildDateSpanApi(fullDateSpan), null)) {\n return false;\n }\n }\n return true;\n}\n// Constraint Utils\n// ------------------------------------------------------------------------------------------------------------------------\nfunction allConstraintsPass(constraints, subjectRange, otherEventStore, businessHoursUnexpanded, calendar) {\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, calendar), 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'\ncalendar // for expanding businesshours\n) {\n if (constraint === 'businessHours') {\n return eventStoreToRanges(expandRecurring(businessHoursUnexpanded, subjectRange, calendar));\n }\n else if (typeof constraint === 'string') { // an group ID\n return eventStoreToRanges(filterEventStoreDefs(otherEventStore, function (eventDef) {\n return eventDef.groupId === constraint;\n }));\n }\n else if (typeof constraint === 'object' && constraint) { // non-null object\n return eventStoreToRanges(expandRecurring(constraint, subjectRange, calendar));\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// Parsing\n// ------------------------------------------------------------------------------------------------------------------------\nfunction normalizeConstraint(input, calendar) {\n if (Array.isArray(input)) {\n return parseEvents(input, '', calendar, true); // allowOpenRange=true\n }\n else if (typeof input === 'object' && input) { // non-null object\n return parseEvents([input], '', calendar, true); // allowOpenRange=true\n }\n else if (input != null) {\n return String(input);\n }\n else {\n return null;\n }\n}\n\nfunction htmlEscape(s) {\n return (s + '').replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/'/g, ''')\n .replace(/\"/g, '"')\n .replace(/\\n/g, '
');\n}\n// Given a hash of CSS properties, returns a string of CSS.\n// Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values.\nfunction cssToStr(cssProps) {\n var statements = [];\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n return statements.join(';');\n}\n// Given an object hash of HTML attribute names to values,\n// generates a string that can be injected between < > in HTML\nfunction attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n}\nfunction parseClassName(raw) {\n if (Array.isArray(raw)) {\n return raw;\n }\n else if (typeof raw === 'string') {\n return raw.split(/\\s+/);\n }\n else {\n return [];\n }\n}\n\nvar UNSCOPED_EVENT_UI_PROPS = {\n editable: Boolean,\n startEditable: Boolean,\n durationEditable: Boolean,\n constraint: null,\n overlap: null,\n allow: null,\n className: parseClassName,\n classNames: parseClassName,\n color: String,\n backgroundColor: String,\n borderColor: String,\n textColor: String\n};\nfunction processUnscopedUiProps(rawProps, calendar, leftovers) {\n var props = refineProps(rawProps, UNSCOPED_EVENT_UI_PROPS, {}, leftovers);\n var constraint = normalizeConstraint(props.constraint, calendar);\n return {\n startEditable: props.startEditable != null ? props.startEditable : props.editable,\n durationEditable: props.durationEditable != null ? props.durationEditable : props.editable,\n constraints: constraint != null ? [constraint] : [],\n overlap: props.overlap,\n allows: props.allow != null ? [props.allow] : [],\n backgroundColor: props.backgroundColor || props.color,\n borderColor: props.borderColor || props.color,\n textColor: props.textColor,\n classNames: props.classNames.concat(props.className)\n };\n}\nfunction processScopedUiProps(prefix, rawScoped, calendar, leftovers) {\n var rawUnscoped = {};\n var wasFound = {};\n for (var key in UNSCOPED_EVENT_UI_PROPS) {\n var scopedKey = prefix + capitaliseFirstLetter(key);\n rawUnscoped[key] = rawScoped[scopedKey];\n wasFound[scopedKey] = true;\n }\n if (prefix === 'event') {\n rawUnscoped.editable = rawScoped.editable; // special case. there is no 'eventEditable', just 'editable'\n }\n if (leftovers) {\n for (var key in rawScoped) {\n if (!wasFound[key]) {\n leftovers[key] = rawScoped[key];\n }\n }\n }\n return processUnscopedUiProps(rawUnscoped, calendar);\n}\nvar EMPTY_EVENT_UI = {\n startEditable: null,\n durationEditable: null,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: []\n};\n// 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 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 NON_DATE_PROPS = {\n id: String,\n groupId: String,\n title: String,\n url: String,\n rendering: String,\n extendedProps: null\n};\nvar DATE_PROPS = {\n start: null,\n date: null,\n end: null,\n allDay: null\n};\nvar uid = 0;\nfunction parseEvent(raw, sourceId, calendar, allowOpenRange) {\n var allDayDefault = computeIsAllDayDefault(sourceId, calendar);\n var leftovers0 = {};\n var recurringRes = parseRecurring(raw, // raw, but with single-event stuff stripped out\n allDayDefault, calendar.dateEnv, calendar.pluginSystem.hooks.recurringTypes, leftovers0 // will populate with non-recurring props\n );\n if (recurringRes) {\n var def = parseEventDef(leftovers0, sourceId, recurringRes.allDay, Boolean(recurringRes.duration), calendar);\n def.recurringDef = {\n typeId: recurringRes.typeId,\n typeData: recurringRes.typeData,\n duration: recurringRes.duration\n };\n return { def: def, instance: null };\n }\n else {\n var leftovers1 = {};\n var singleRes = parseSingle(raw, allDayDefault, calendar, leftovers1, allowOpenRange);\n if (singleRes) {\n var def = parseEventDef(leftovers1, sourceId, singleRes.allDay, singleRes.hasEnd, calendar);\n var instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo);\n return { def: def, instance: instance };\n }\n }\n return null;\n}\n/*\nWill NOT populate extendedProps with the leftover properties.\nWill NOT populate date-related props.\nThe EventNonDateInput has been normalized (id => publicId, etc).\n*/\nfunction parseEventDef(raw, sourceId, allDay, hasEnd, calendar) {\n var leftovers = {};\n var def = pluckNonDateProps(raw, calendar, leftovers);\n def.defId = String(uid++);\n def.sourceId = sourceId;\n def.allDay = allDay;\n def.hasEnd = hasEnd;\n for (var _i = 0, _a = calendar.pluginSystem.hooks.eventDefParsers; _i < _a.length; _i++) {\n var eventDefParser = _a[_i];\n var newLeftovers = {};\n eventDefParser(def, leftovers, newLeftovers);\n leftovers = newLeftovers;\n }\n def.extendedProps = __assign(leftovers, def.extendedProps || {});\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 createEventInstance(defId, range, forcedStartTzo, forcedEndTzo) {\n return {\n instanceId: String(uid++),\n defId: defId,\n range: range,\n forcedStartTzo: forcedStartTzo == null ? null : forcedStartTzo,\n forcedEndTzo: forcedEndTzo == null ? null : forcedEndTzo\n };\n}\nfunction parseSingle(raw, allDayDefault, calendar, leftovers, allowOpenRange) {\n var props = pluckDateProps(raw, leftovers);\n var allDay = props.allDay;\n var startMeta;\n var startMarker = null;\n var hasEnd = false;\n var endMeta;\n var endMarker = null;\n startMeta = calendar.dateEnv.createMarkerMeta(props.start);\n if (startMeta) {\n startMarker = startMeta.marker;\n }\n else if (!allowOpenRange) {\n return null;\n }\n if (props.end != null) {\n endMeta = calendar.dateEnv.createMarkerMeta(props.end);\n }\n if (allDay == null) {\n if (allDayDefault != null) {\n allDay = allDayDefault;\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 = calendar.opt('forceEventDuration') || false;\n endMarker = calendar.dateEnv.add(startMarker, allDay ?\n calendar.defaultAllDayEventDuration :\n calendar.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 pluckDateProps(raw, leftovers) {\n var props = refineProps(raw, DATE_PROPS, {}, leftovers);\n props.start = (props.start !== null) ? props.start : props.date;\n delete props.date;\n return props;\n}\nfunction pluckNonDateProps(raw, calendar, leftovers) {\n var preLeftovers = {};\n var props = refineProps(raw, NON_DATE_PROPS, {}, preLeftovers);\n var ui = processUnscopedUiProps(preLeftovers, calendar, leftovers);\n props.publicId = props.id;\n delete props.id;\n props.ui = ui;\n return props;\n}\nfunction computeIsAllDayDefault(sourceId, calendar) {\n var res = null;\n if (sourceId) {\n var source = calendar.state.eventSources[sourceId];\n res = source.allDayDefault;\n }\n if (res == null) {\n res = calendar.opt('allDayDefault');\n }\n return res;\n}\n\nvar DEF_DEFAULTS = {\n startTime: '09:00',\n endTime: '17:00',\n daysOfWeek: [1, 2, 3, 4, 5],\n rendering: 'inverse-background',\n classNames: 'fc-nonbusiness',\n groupId: '_businessHours' // so multiple defs get grouped\n};\n/*\nTODO: pass around as EventDefHash!!!\n*/\nfunction parseBusinessHours(input, calendar) {\n return parseEvents(refineInputs(input), '', calendar);\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) {\n return rawDef.daysOfWeek;\n });\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) {\n return __assign({}, DEF_DEFAULTS, rawDef);\n });\n return rawDefs;\n}\n\nfunction memoizeRendering(renderFunc, unrenderFunc, dependencies) {\n if (dependencies === void 0) { dependencies = []; }\n var dependents = [];\n var thisContext;\n var prevArgs;\n function unrender() {\n if (prevArgs) {\n for (var _i = 0, dependents_1 = dependents; _i < dependents_1.length; _i++) {\n var dependent = dependents_1[_i];\n dependent.unrender();\n }\n if (unrenderFunc) {\n unrenderFunc.apply(thisContext, prevArgs);\n }\n prevArgs = null;\n }\n }\n function res() {\n if (!prevArgs || !isArraysEqual(prevArgs, arguments)) {\n unrender();\n thisContext = this;\n prevArgs = arguments;\n renderFunc.apply(this, arguments);\n }\n }\n res.dependents = dependents;\n res.unrender = unrender;\n for (var _i = 0, dependencies_1 = dependencies; _i < dependencies_1.length; _i++) {\n var dependency = dependencies_1[_i];\n dependency.dependents.push(res);\n }\n return res;\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) {\n return _this.eventUiBuilders[key] || memoize(buildEventUiForKey);\n });\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) {\n return _this.getKeysForEventDef(eventDef);\n });\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) // can't use cached. might be events from other calendar\n );\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 origSeg: interaction.origSeg\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\n// Generates HTML for an anchor to another view into the calendar.\n// Will either generate an tag or a non-clickable tag, depending on enabled settings.\n// `gotoOptions` can either be a DateMarker, or an object with the form:\n// { date, type, forceOff }\n// `type` is a view-type like \"day\" or \"week\". default value is \"day\".\n// `attrs` and `innerHtml` are use to generate the rest of the HTML tag.\nfunction buildGotoAnchorHtml(allOptions, dateEnv, gotoOptions, attrs, innerHtml) {\n var date;\n var type;\n var forceOff;\n var finalOptions;\n if (gotoOptions instanceof Date) {\n date = gotoOptions; // a single date-like input\n }\n else {\n date = gotoOptions.date;\n type = gotoOptions.type;\n forceOff = gotoOptions.forceOff;\n }\n finalOptions = {\n date: dateEnv.formatIso(date, { omitTime: true }),\n type: type || 'day'\n };\n if (typeof attrs === 'string') {\n innerHtml = attrs;\n attrs = null;\n }\n attrs = attrs ? ' ' + attrsToStr(attrs) : ''; // will have a leading space\n innerHtml = innerHtml || '';\n if (!forceOff && allOptions.navLinks) {\n return '' +\n innerHtml +\n '';\n }\n else {\n return '' +\n innerHtml +\n '';\n }\n}\nfunction getAllDayHtml(allOptions) {\n return allOptions.allDayHtml || htmlEscape(allOptions.allDayText);\n}\n// Computes HTML classNames for a single-day element\nfunction getDayClasses(date, dateProfile, context, noThemeHighlight) {\n var calendar = context.calendar, options = context.options, theme = context.theme, dateEnv = context.dateEnv;\n var classes = [];\n var todayStart;\n var todayEnd;\n if (!rangeContainsMarker(dateProfile.activeRange, date)) {\n classes.push('fc-disabled-day');\n }\n else {\n classes.push('fc-' + DAY_IDS[date.getUTCDay()]);\n if (options.monthMode &&\n dateEnv.getMonth(date) !== dateEnv.getMonth(dateProfile.currentRange.start)) {\n classes.push('fc-other-month');\n }\n todayStart = startOfDay(calendar.getNow());\n todayEnd = addDays(todayStart, 1);\n if (date < todayStart) {\n classes.push('fc-past');\n }\n else if (date >= todayEnd) {\n classes.push('fc-future');\n }\n else {\n classes.push('fc-today');\n if (noThemeHighlight !== true) {\n classes.push(theme.getClass('today'));\n }\n }\n }\n return classes;\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);\n }\n };\n var wrappedFailure = function () {\n if (!isResolved) {\n isResolved = true;\n if (failure) {\n failure.apply(this, arguments);\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 Mixin = /** @class */ (function () {\n function Mixin() {\n }\n // mix into a CLASS\n Mixin.mixInto = function (destClass) {\n this.mixIntoObj(destClass.prototype);\n };\n // mix into ANY object\n Mixin.mixIntoObj = function (destObj) {\n var _this = this;\n Object.getOwnPropertyNames(this.prototype).forEach(function (name) {\n if (!destObj[name]) { // if destination doesn't already define it\n destObj[name] = _this.prototype[name];\n }\n });\n };\n /*\n will override existing methods\n TODO: remove! not used anymore\n */\n Mixin.mixOver = function (destClass) {\n var _this = this;\n Object.getOwnPropertyNames(this.prototype).forEach(function (name) {\n destClass.prototype[name] = _this.prototype[name];\n });\n };\n return Mixin;\n}());\n\n/*\nUSAGE:\n import { default as EmitterMixin, EmitterInterface } from './EmitterMixin'\nin class:\n on: EmitterInterface['on']\n one: EmitterInterface['one']\n off: EmitterInterface['off']\n trigger: EmitterInterface['trigger']\n triggerWith: EmitterInterface['triggerWith']\n hasHandlers: EmitterInterface['hasHandlers']\nafter class:\n EmitterMixin.mixInto(TheClass)\n*/\nvar EmitterMixin = /** @class */ (function (_super) {\n __extends(EmitterMixin, _super);\n function EmitterMixin() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmitterMixin.prototype.on = function (type, handler) {\n addToHash(this._handlers || (this._handlers = {}), type, handler);\n return this; // for chaining\n };\n // todo: add comments\n EmitterMixin.prototype.one = function (type, handler) {\n addToHash(this._oneHandlers || (this._oneHandlers = {}), type, handler);\n return this; // for chaining\n };\n EmitterMixin.prototype.off = function (type, handler) {\n if (this._handlers) {\n removeFromHash(this._handlers, type, handler);\n }\n if (this._oneHandlers) {\n removeFromHash(this._oneHandlers, type, handler);\n }\n return this; // for chaining\n };\n EmitterMixin.prototype.trigger = function (type) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n this.triggerWith(type, this, args);\n return this; // for chaining\n };\n EmitterMixin.prototype.triggerWith = function (type, context, args) {\n if (this._handlers) {\n applyAll(this._handlers[type], context, args);\n }\n if (this._oneHandlers) {\n applyAll(this._oneHandlers[type], context, args);\n delete this._oneHandlers[type]; // will never fire again\n }\n return this; // for chaining\n };\n EmitterMixin.prototype.hasHandlers = function (type) {\n return (this._handlers && this._handlers[type] && this._handlers[type].length) ||\n (this._oneHandlers && this._oneHandlers[type] && this._oneHandlers[type].length);\n };\n return EmitterMixin;\n}(Mixin));\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) {\n return func !== handler;\n });\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.originEl = originEl;\n this.els = els;\n this.isHorizontal = isHorizontal;\n this.isVertical = isVertical;\n }\n // Queries the els for coordinates and stores them.\n // Call this method before using and of the get* methods below.\n PositionCache.prototype.build = function () {\n var originEl = this.originEl;\n var originClientRect = this.originClientRect =\n originEl.getBoundingClientRect(); // relative to viewport top-left\n if (this.isHorizontal) {\n this.buildElHorizontals(originClientRect.left);\n }\n if (this.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 lefts = this.lefts;\n var rights = this.rights;\n var len = lefts.length;\n var i;\n for (i = 0; i < len; i++) {\n if (leftPosition >= lefts[i] && leftPosition < rights[i]) {\n return i;\n }\n }\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 tops = this.tops;\n var bottoms = this.bottoms;\n var len = tops.length;\n var i;\n for (i = 0; i < len; i++) {\n if (topPosition >= tops[i] && topPosition < bottoms[i]) {\n return i;\n }\n }\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/*\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\n/*\nEmbodies a div that has potential scrollbars\n*/\nvar ScrollComponent = /** @class */ (function (_super) {\n __extends(ScrollComponent, _super);\n function ScrollComponent(overflowX, overflowY) {\n var _this = _super.call(this, createElement('div', {\n className: 'fc-scroller'\n })) || this;\n _this.overflowX = overflowX;\n _this.overflowY = overflowY;\n _this.applyOverflow();\n return _this;\n }\n // sets to natural height, unlocks overflow\n ScrollComponent.prototype.clear = function () {\n this.setHeight('auto');\n this.applyOverflow();\n };\n ScrollComponent.prototype.destroy = function () {\n removeElement(this.el);\n };\n // Overflow\n // -----------------------------------------------------------------------------------------------------------------\n ScrollComponent.prototype.applyOverflow = function () {\n applyStyle(this.el, {\n overflowX: this.overflowX,\n overflowY: this.overflowY\n });\n };\n // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'.\n // Useful for preserving scrollbar widths regardless of future resizes.\n // Can pass in scrollbarWidths for optimization.\n ScrollComponent.prototype.lockOverflow = function (scrollbarWidths) {\n var overflowX = this.overflowX;\n var overflowY = this.overflowY;\n scrollbarWidths = scrollbarWidths || this.getScrollbarWidths();\n if (overflowX === 'auto') {\n overflowX = (scrollbarWidths.bottom || // horizontal scrollbars?\n this.canScrollHorizontally() // OR scrolling pane with massless scrollbars?\n ) ? 'scroll' : 'hidden';\n }\n if (overflowY === 'auto') {\n overflowY = (scrollbarWidths.left || scrollbarWidths.right || // horizontal scrollbars?\n this.canScrollVertically() // OR scrolling pane with massless scrollbars?\n ) ? 'scroll' : 'hidden';\n }\n applyStyle(this.el, { overflowX: overflowX, overflowY: overflowY });\n };\n ScrollComponent.prototype.setHeight = function (height) {\n applyStyleProp(this.el, 'height', height);\n };\n ScrollComponent.prototype.getScrollbarWidths = function () {\n var edges = computeEdges(this.el);\n return {\n left: edges.scrollbarLeft,\n right: edges.scrollbarRight,\n bottom: edges.scrollbarBottom\n };\n };\n return ScrollComponent;\n}(ElementScrollController));\n\nvar Theme = /** @class */ (function () {\n function Theme(calendarOptions) {\n this.calendarOptions = calendarOptions;\n this.processIconOverride();\n }\n Theme.prototype.processIconOverride = function () {\n if (this.iconOverrideOption) {\n this.setIconOverride(this.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) {\n var className = this.iconClasses[buttonName];\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 guid = 0;\nvar ComponentContext = /** @class */ (function () {\n function ComponentContext(calendar, theme, dateEnv, options, view) {\n this.calendar = calendar;\n this.theme = theme;\n this.dateEnv = dateEnv;\n this.options = options;\n this.view = view;\n this.isRtl = options.dir === 'rtl';\n this.eventOrderSpecs = parseFieldSpecs(options.eventOrder);\n this.nextDayThreshold = createDuration(options.nextDayThreshold);\n }\n ComponentContext.prototype.extend = function (options, view) {\n return new ComponentContext(this.calendar, this.theme, this.dateEnv, options || this.options, view || this.view);\n };\n return ComponentContext;\n}());\nvar Component = /** @class */ (function () {\n function Component() {\n this.everRendered = false;\n this.uid = String(guid++);\n }\n Component.addEqualityFuncs = function (newFuncs) {\n this.prototype.equalityFuncs = __assign({}, this.prototype.equalityFuncs, newFuncs);\n };\n Component.prototype.receiveProps = function (props, context) {\n this.receiveContext(context);\n var _a = recycleProps(this.props || {}, props, this.equalityFuncs), anyChanges = _a.anyChanges, comboProps = _a.comboProps;\n this.props = comboProps;\n if (anyChanges) {\n if (this.everRendered) {\n this.beforeUpdate();\n }\n this.render(comboProps, context);\n if (this.everRendered) {\n this.afterUpdate();\n }\n }\n this.everRendered = true;\n };\n Component.prototype.receiveContext = function (context) {\n var oldContext = this.context;\n this.context = context;\n if (!oldContext) {\n this.firstContext(context);\n }\n };\n Component.prototype.render = function (props, context) {\n };\n Component.prototype.firstContext = function (context) {\n };\n Component.prototype.beforeUpdate = function () {\n };\n Component.prototype.afterUpdate = function () {\n };\n // after destroy is called, this component won't ever be used again\n Component.prototype.destroy = function () {\n };\n return Component;\n}());\nComponent.prototype.equalityFuncs = {};\n/*\nReuses old values when equal. If anything is unequal, returns newProps as-is.\nGreat for PureComponent, but won't be feasible with React, so just eliminate and use React's DOM diffing.\n*/\nfunction recycleProps(oldProps, newProps, equalityFuncs) {\n var comboProps = {}; // some old, some new\n var anyChanges = false;\n for (var key in newProps) {\n if (key in oldProps && (oldProps[key] === newProps[key] ||\n (equalityFuncs[key] && equalityFuncs[key](oldProps[key], newProps[key])))) {\n // equal to old? use old prop\n comboProps[key] = oldProps[key];\n }\n else {\n comboProps[key] = newProps[key];\n anyChanges = true;\n }\n }\n for (var key in oldProps) {\n if (!(key in newProps)) {\n anyChanges = true;\n break;\n }\n }\n return { anyChanges: anyChanges, comboProps: comboProps };\n}\n\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(el) {\n var _this = _super.call(this) || this;\n _this.el = el;\n return _this;\n }\n DateComponent.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n removeElement(this.el);\n };\n // Hit System\n // -----------------------------------------------------------------------------------------------------------------\n DateComponent.prototype.buildPositionCaches = function () {\n };\n DateComponent.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n return null; // this should be abstract\n };\n // Validation\n // -----------------------------------------------------------------------------------------------------------------\n DateComponent.prototype.isInteractionValid = function (interaction) {\n var calendar = this.context.calendar;\n var dateProfile = this.props.dateProfile; // HACK\n var instances = interaction.mutatedEvents.instances;\n if (dateProfile) { // HACK for DayTile\n for (var instanceId in instances) {\n if (!rangeContainsRange(dateProfile.validRange, instances[instanceId].range)) {\n return false;\n }\n }\n }\n return isInteractionValid(interaction, calendar);\n };\n DateComponent.prototype.isDateSelectionValid = function (selection) {\n var calendar = this.context.calendar;\n var dateProfile = this.props.dateProfile; // HACK\n if (dateProfile && // HACK for DayTile\n !rangeContainsRange(dateProfile.validRange, selection.range)) {\n return false;\n }\n return isDateSelectionValid(selection, calendar);\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-mirror') &&\n (this.isPopover() || !this.isInPopover(el));\n // ^above line ensures we don't detect a seg interaction within a nested component.\n // it's a HACK because it only supports a popover as the nested component.\n };\n DateComponent.prototype.isValidDateDownEl = function (el) {\n var segEl = elementClosest(el, this.fgSegSelector);\n return (!segEl || segEl.classList.contains('fc-mirror')) &&\n !elementClosest(el, '.fc-more') && // a \"more..\" link\n !elementClosest(el, 'a[data-goto]') && // a clickable nav link\n !this.isInPopover(el);\n };\n DateComponent.prototype.isPopover = function () {\n return this.el.classList.contains('fc-popover');\n };\n DateComponent.prototype.isInPopover = function (el) {\n return Boolean(elementClosest(el, '.fc-popover'));\n };\n return DateComponent;\n}(Component));\nDateComponent.prototype.fgSegSelector = '.fc-event-container > *';\nDateComponent.prototype.bgSegSelector = '.fc-bgevent:not(.fc-nonbusiness)';\n\nvar uid$1 = 0;\nfunction createPlugin(input) {\n return {\n id: String(uid$1++),\n deps: input.deps || [],\n reducers: input.reducers || [],\n eventDefParsers: input.eventDefParsers || [],\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 eventResizeJoinTransforms: input.eventResizeJoinTransforms || [],\n viewContainerModifiers: input.viewContainerModifiers || [],\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 defaultView: input.defaultView || '',\n elementDraggingImpl: input.elementDraggingImpl,\n optionChangeHandlers: input.optionChangeHandlers || {}\n };\n}\nvar PluginSystem = /** @class */ (function () {\n function PluginSystem() {\n this.hooks = {\n reducers: [],\n eventDefParsers: [],\n isDraggableTransformers: [],\n eventDragMutationMassagers: [],\n eventDefMutationAppliers: [],\n dateSelectionTransformers: [],\n datePointTransforms: [],\n dateSpanTransforms: [],\n views: {},\n viewPropsTransformers: [],\n isPropsValid: null,\n externalDefTransforms: [],\n eventResizeJoinTransforms: [],\n viewContainerModifiers: [],\n eventDropTransformers: [],\n componentInteractions: [],\n calendarInteractions: [],\n themeClasses: {},\n eventSourceDefs: [],\n cmdFormatter: null,\n recurringTypes: [],\n namedTimeZonedImpl: null,\n defaultView: '',\n elementDraggingImpl: null,\n optionChangeHandlers: {}\n };\n this.addedHash = {};\n }\n PluginSystem.prototype.add = function (plugin) {\n if (!this.addedHash[plugin.id]) {\n this.addedHash[plugin.id] = true;\n for (var _i = 0, _a = plugin.deps; _i < _a.length; _i++) {\n var dep = _a[_i];\n this.add(dep);\n }\n this.hooks = combineHooks(this.hooks, plugin);\n }\n };\n return PluginSystem;\n}());\nfunction combineHooks(hooks0, hooks1) {\n return {\n reducers: hooks0.reducers.concat(hooks1.reducers),\n eventDefParsers: hooks0.eventDefParsers.concat(hooks1.eventDefParsers),\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({}, 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 eventResizeJoinTransforms: hooks0.eventResizeJoinTransforms.concat(hooks1.eventResizeJoinTransforms),\n viewContainerModifiers: hooks0.viewContainerModifiers.concat(hooks1.viewContainerModifiers),\n eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),\n calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),\n componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),\n themeClasses: __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 defaultView: hooks0.defaultView || hooks1.defaultView,\n elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl,\n optionChangeHandlers: __assign({}, hooks0.optionChangeHandlers, hooks1.optionChangeHandlers)\n };\n}\n\nvar eventSourceDef = {\n ignoreRange: true,\n parseMeta: function (raw) {\n if (Array.isArray(raw)) { // short form\n return raw;\n }\n else if (Array.isArray(raw.events)) {\n return raw.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]\n});\n\nvar eventSourceDef$1 = {\n parseMeta: function (raw) {\n if (typeof raw === 'function') { // short form\n return raw;\n }\n else if (typeof raw.events === 'function') {\n return raw.events;\n }\n return null;\n },\n fetch: function (arg, success, failure) {\n var dateEnv = arg.calendar.dateEnv;\n var func = arg.eventSource.meta;\n unpromisify(func.bind(null, {\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 }), function (rawEvents) {\n success({ rawEvents: rawEvents }); // needs an object response\n }, failure // send errorObj directly to failure callback\n );\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 try {\n var res = JSON.parse(xhr.responseText);\n successCallback(res, xhr);\n }\n catch (err) {\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 eventSourceDef$2 = {\n parseMeta: function (raw) {\n if (typeof raw === 'string') { // short form\n raw = { url: raw };\n }\n else if (!raw || typeof raw !== 'object' || !raw.url) {\n return null;\n }\n return {\n url: raw.url,\n method: (raw.method || 'GET').toUpperCase(),\n extraParams: raw.extraParams,\n startParam: raw.startParam,\n endParam: raw.endParam,\n timeZoneParam: raw.timeZoneParam\n };\n },\n fetch: function (arg, success, failure) {\n var meta = arg.eventSource.meta;\n var requestParams = buildRequestParams(meta, arg.range, arg.calendar);\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 eventSourceDefs: [eventSourceDef$2]\n});\nfunction buildRequestParams(meta, range, calendar) {\n var dateEnv = calendar.dateEnv;\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 = calendar.opt('startParam');\n }\n endParam = meta.endParam;\n if (endParam == null) {\n endParam = calendar.opt('endParam');\n }\n timeZoneParam = meta.timeZoneParam;\n if (timeZoneParam == null) {\n timeZoneParam = calendar.opt('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 recurring = {\n parse: function (rawEvent, leftoverProps, dateEnv) {\n var createMarker = dateEnv.createMarker.bind(dateEnv);\n var processors = {\n daysOfWeek: null,\n startTime: createDuration,\n endTime: createDuration,\n startRecur: createMarker,\n endRecur: createMarker\n };\n var props = refineProps(rawEvent, processors, {}, leftoverProps);\n var anyValid = false;\n for (var propName in props) {\n if (props[propName] != null) {\n anyValid = true;\n break;\n }\n }\n if (anyValid) {\n var duration = null;\n if ('duration' in leftoverProps) {\n duration = createDuration(leftoverProps.duration);\n delete leftoverProps.duration;\n }\n if (!duration && props.startTime && props.endTime) {\n duration = subtractDurations(props.endTime, props.startTime);\n }\n return {\n allDayGuess: Boolean(!props.startTime && !props.endTime),\n duration: duration,\n typeData: props // 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 else {\n return [];\n }\n }\n};\nvar SimpleRecurrencePlugin = createPlugin({\n recurringTypes: [recurring]\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 DefaultOptionChangeHandlers = createPlugin({\n optionChangeHandlers: {\n events: function (events, calendar, deepEqual) {\n handleEventSources([events], calendar, deepEqual);\n },\n eventSources: handleEventSources,\n plugins: handlePlugins\n }\n});\nfunction handleEventSources(inputs, calendar, deepEqual) {\n var unfoundSources = hashValuesToArray(calendar.state.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++) {\n if (deepEqual(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 calendar.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 calendar.addEventSource(newInput);\n }\n}\n// shortcoming: won't remove plugins\nfunction handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n}\n\nvar config = {}; // TODO: make these options\nvar globalDefaults = {\n defaultRangeSeparator: ' - ',\n titleRangeSeparator: ' \\u2013 ',\n defaultTimedEventDuration: '01:00:00',\n defaultAllDayEventDuration: { day: 1 },\n forceEventDuration: false,\n nextDayThreshold: '00:00:00',\n // display\n columnHeader: true,\n defaultView: '',\n aspectRatio: 1.35,\n header: {\n left: 'title',\n center: '',\n right: '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 minTime: '00:00:00',\n maxTime: '24:00:00',\n showNonCurrentDates: true,\n // event ajax\n lazyFetching: true,\n startParam: 'start',\n endParam: 'end',\n timeZoneParam: 'timeZone',\n timeZone: 'local',\n // allDayDefault: undefined,\n // locale\n locales: [],\n locale: '',\n // dir: will get this from the default locale\n // buttonIcons: null,\n // allows setting a min-height to the event segment to prevent short events overlapping each other\n timeGridEventMinHeight: 0,\n themeSystem: 'standard',\n // eventResizableFromStart: false,\n dragRevertDuration: 500,\n dragScroll: true,\n allDayMaintainDuration: false,\n // selectable: false,\n unselectAuto: true,\n // selectMinDistance: 0,\n dropAccept: '*',\n eventOrder: 'start,-duration,allDay,title',\n // ^ if start tie, longer events go before shorter. final tie-breaker is title text\n // rerenderDelay: null,\n eventLimit: false,\n eventLimitClick: 'popover',\n dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' },\n handleWindowResize: true,\n windowResizeDelay: 100,\n longPressDelay: 1000,\n eventDragMinDistance: 5 // only applies to mouse\n};\nvar rtlDefaults = {\n header: {\n left: 'next,prev today',\n center: '',\n right: 'title'\n },\n buttonIcons: {\n // TODO: make RTL support the responibility of the theme\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 }\n};\nvar complexOptions = [\n 'header',\n 'footer',\n 'buttonText',\n 'buttonIcons'\n];\n// Merges an array of option objects into a single object\nfunction mergeOptions(optionObjs) {\n return mergeProps(optionObjs, complexOptions);\n}\n// TODO: move this stuff to a \"plugin\"-related file...\nvar INTERNAL_PLUGINS = [\n ArrayEventSourcePlugin,\n FuncEventSourcePlugin,\n JsonFeedEventSourcePlugin,\n SimpleRecurrencePlugin,\n DefaultOptionChangeHandlers\n];\nfunction refinePluginDefs(pluginInputs) {\n var plugins = [];\n for (var _i = 0, pluginInputs_1 = pluginInputs; _i < pluginInputs_1.length; _i++) {\n var pluginInput = pluginInputs_1[_i];\n if (typeof pluginInput === 'string') {\n var globalName = 'FullCalendar' + capitaliseFirstLetter(pluginInput);\n if (!window[globalName]) {\n console.warn('Plugin file not loaded for ' + pluginInput);\n }\n else {\n plugins.push(window[globalName].default); // is an ES6 module\n }\n }\n else {\n plugins.push(pluginInput);\n }\n }\n return INTERNAL_PLUGINS.concat(plugins);\n}\n\nvar 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 dir: '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 weekLabel: 'W',\n allDayText: 'all-day',\n eventLimitText: 'more',\n noEventsMessage: 'No events to display'\n};\nfunction parseRawLocales(explicitRawLocales) {\n var defaultCode = explicitRawLocales.length > 0 ? explicitRawLocales[0].code : 'en';\n var globalArray = window['FullCalendarLocalesAll'] || []; // from locales-all.js\n var globalObject = window['FullCalendarLocales'] || {}; // from locales/*.js. keys are meaningless\n var allRawLocales = globalArray.concat(// globalArray is low prio\n hashValuesToArray(globalObject), // medium prio\n explicitRawLocales // highest prio\n );\n var rawLocaleMap = {\n en: RAW_EN_LOCALE // necessary?\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 else {\n return queryLocale(inputSingular, available);\n }\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++) {\n var parts = codes[i].toLocaleLowerCase().split('-');\n for (var j = parts.length; j > 0; j--) {\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([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\nvar OptionsManager = /** @class */ (function () {\n function OptionsManager(overrides) {\n this.overrides = __assign({}, overrides); // make a copy\n this.dynamicOverrides = {};\n this.compute();\n }\n OptionsManager.prototype.mutate = function (updates, removals, isDynamic) {\n if (!Object.keys(updates).length && !removals.length) {\n return;\n }\n var overrideHash = isDynamic ? this.dynamicOverrides : this.overrides;\n __assign(overrideHash, updates);\n for (var _i = 0, removals_1 = removals; _i < removals_1.length; _i++) {\n var propName = removals_1[_i];\n delete overrideHash[propName];\n }\n this.compute();\n };\n // Computes the flattened options hash for the calendar and assigns to `this.options`.\n // Assumes this.overrides and this.dynamicOverrides have already been initialized.\n OptionsManager.prototype.compute = function () {\n // TODO: not a very efficient system\n var locales = firstDefined(// explicit locale option given?\n this.dynamicOverrides.locales, this.overrides.locales, globalDefaults.locales);\n var locale = firstDefined(// explicit locales option given?\n this.dynamicOverrides.locale, this.overrides.locale, globalDefaults.locale);\n var available = parseRawLocales(locales);\n var localeDefaults = buildLocale(locale || available.defaultCode, available.map).options;\n var dir = firstDefined(// based on options computed so far, is direction RTL?\n this.dynamicOverrides.dir, this.overrides.dir, localeDefaults.dir);\n var dirDefaults = dir === 'rtl' ? rtlDefaults : {};\n this.dirDefaults = dirDefaults;\n this.localeDefaults = localeDefaults;\n this.computed = mergeOptions([\n globalDefaults,\n dirDefaults,\n localeDefaults,\n this.overrides,\n this.dynamicOverrides\n ]);\n };\n return OptionsManager;\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.weekLabel = settings.weekLabel != null ? settings.weekLabel : settings.locale.options.weekLabel;\n this.cmdFormatter = settings.cmdFormatter;\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 else {\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 };\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 DateEnv.prototype.startOf = function (m, unit) {\n if (unit === 'year') {\n return this.startOfYear(m);\n }\n else if (unit === 'month') {\n return this.startOfMonth(m);\n }\n else if (unit === 'week') {\n return this.startOfWeek(m);\n }\n else if (unit === 'day') {\n return startOfDay(m);\n }\n else if (unit === 'hour') {\n return startOfHour(m);\n }\n else if (unit === 'minute') {\n return startOfMinute(m);\n }\n else if (unit === 'second') {\n return startOfSecond(m);\n }\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 else {\n return weekOfYear(marker, this.weekDow, this.weekDoy);\n }\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);\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 else if (this.timeZone === 'UTC' || !this.namedTimeZoneImpl) {\n return new Date(ms);\n }\n else {\n return arrayToUtcDate(this.namedTimeZoneImpl.timestampToArray(ms));\n }\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 else if (this.timeZone === 'UTC') {\n return 0;\n }\n else 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 else if (this.timeZone === 'UTC') {\n return new Date(m.valueOf()); // make sure it's a copy\n }\n else if (!this.namedTimeZoneImpl) {\n return new Date(m.valueOf() - (forcedTzo || 0));\n }\n else {\n return new Date(m.valueOf() -\n this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) * 1000 * 60 // convert minutes -> ms\n );\n }\n };\n return DateEnv;\n}());\n\nvar SIMPLE_SOURCE_PROPS = {\n id: String,\n allDayDefault: Boolean,\n eventDataTransform: Function,\n success: Function,\n failure: Function\n};\nvar uid$2 = 0;\nfunction doesSourceNeedRange(eventSource, calendar) {\n var defs = calendar.pluginSystem.hooks.eventSourceDefs;\n return !defs[eventSource.sourceDefId].ignoreRange;\n}\nfunction parseEventSource(raw, calendar) {\n var defs = calendar.pluginSystem.hooks.eventSourceDefs;\n for (var i = defs.length - 1; i >= 0; i--) { // later-added plugins take precedence\n var def = defs[i];\n var meta = def.parseMeta(raw);\n if (meta) {\n var res = parseEventSourceProps(typeof raw === 'object' ? raw : {}, meta, i, calendar);\n res._raw = raw;\n return res;\n }\n }\n return null;\n}\nfunction parseEventSourceProps(raw, meta, sourceDefId, calendar) {\n var leftovers0 = {};\n var props = refineProps(raw, SIMPLE_SOURCE_PROPS, {}, leftovers0);\n var leftovers1 = {};\n var ui = processUnscopedUiProps(leftovers0, calendar, leftovers1);\n props.isFetching = false;\n props.latestFetchId = '';\n props.fetchRange = null;\n props.publicId = String(raw.id || '');\n props.sourceId = String(uid$2++);\n props.sourceDefId = sourceDefId;\n props.meta = meta;\n props.ui = ui;\n props.extendedProps = leftovers1;\n return props;\n}\n\nfunction reduceEventSources (eventSources, action, dateProfile, calendar) {\n switch (action.type) {\n case 'ADD_EVENT_SOURCES': // already parsed\n return addSources(eventSources, action.sources, dateProfile ? dateProfile.activeRange : null, calendar);\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 'SET_DATE':\n case 'SET_VIEW_TYPE':\n if (dateProfile) {\n return fetchDirtySources(eventSources, dateProfile.activeRange, calendar);\n }\n else {\n return eventSources;\n }\n case 'FETCH_EVENT_SOURCES':\n case 'CHANGE_TIMEZONE':\n return fetchSourcesByIds(eventSources, action.sourceIds ?\n arrayToHash(action.sourceIds) :\n excludeStaticSources(eventSources, calendar), dateProfile ? dateProfile.activeRange : null, calendar);\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}\nvar uid$3 = 0;\nfunction addSources(eventSourceHash, sources, fetchRange, calendar) {\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, calendar);\n }\n return __assign({}, eventSourceHash, hash);\n}\nfunction removeSource(eventSourceHash, sourceId) {\n return filterHash(eventSourceHash, function (eventSource) {\n return eventSource.sourceId !== sourceId;\n });\n}\nfunction fetchDirtySources(sourceHash, fetchRange, calendar) {\n return fetchSourcesByIds(sourceHash, filterHash(sourceHash, function (eventSource) {\n return isSourceDirty(eventSource, fetchRange, calendar);\n }), fetchRange, calendar);\n}\nfunction isSourceDirty(eventSource, fetchRange, calendar) {\n if (!doesSourceNeedRange(eventSource, calendar)) {\n return !eventSource.latestFetchId;\n }\n else {\n return !calendar.opt('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 }\n}\nfunction fetchSourcesByIds(prevSources, sourceIdHash, fetchRange, calendar) {\n var nextSources = {};\n for (var sourceId in prevSources) {\n var source = prevSources[sourceId];\n if (sourceIdHash[sourceId]) {\n nextSources[sourceId] = fetchSource(source, fetchRange, calendar);\n }\n else {\n nextSources[sourceId] = source;\n }\n }\n return nextSources;\n}\nfunction fetchSource(eventSource, fetchRange, calendar) {\n var sourceDef = calendar.pluginSystem.hooks.eventSourceDefs[eventSource.sourceDefId];\n var fetchId = String(uid$3++);\n sourceDef.fetch({\n eventSource: eventSource,\n calendar: calendar,\n range: fetchRange\n }, function (res) {\n var rawEvents = res.rawEvents;\n var calSuccess = calendar.opt('eventSourceSuccess');\n var calSuccessRes;\n var sourceSuccessRes;\n if (eventSource.success) {\n sourceSuccessRes = eventSource.success(rawEvents, res.xhr);\n }\n if (calSuccess) {\n calSuccessRes = calSuccess(rawEvents, res.xhr);\n }\n rawEvents = sourceSuccessRes || calSuccessRes || rawEvents;\n calendar.dispatch({\n type: 'RECEIVE_EVENTS',\n sourceId: eventSource.sourceId,\n fetchId: fetchId,\n fetchRange: fetchRange,\n rawEvents: rawEvents\n });\n }, function (error) {\n var callFailure = calendar.opt('eventSourceFailure');\n console.warn(error.message, error);\n if (eventSource.failure) {\n eventSource.failure(error);\n }\n if (callFailure) {\n callFailure(error);\n }\n calendar.dispatch({\n type: 'RECEIVE_EVENT_ERROR',\n sourceId: eventSource.sourceId,\n fetchId: fetchId,\n fetchRange: fetchRange,\n error: error\n });\n });\n return __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({}, sourceHash, (_a = {}, _a[sourceId] = __assign({}, eventSource, { isFetching: false, fetchRange: fetchRange // also serves as a marker that at least one fetch has completed\n }), _a));\n }\n return sourceHash;\n}\nfunction excludeStaticSources(eventSources, calendar) {\n return filterHash(eventSources, function (eventSource) {\n return doesSourceNeedRange(eventSource, calendar);\n });\n}\n\nvar DateProfileGenerator = /** @class */ (function () {\n function DateProfileGenerator(viewSpec, calendar) {\n this.viewSpec = viewSpec;\n this.options = viewSpec.options;\n this.dateEnv = calendar.dateEnv;\n this.calendar = calendar;\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) {\n var dateEnv = this.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);\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) {\n var dateEnv = this.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);\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 = false; }\n var validRange;\n var minTime = null;\n var maxTime = null;\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 (!this.options.showNonCurrentDates) {\n activeRange = intersectRanges(activeRange, currentInfo.range);\n }\n minTime = createDuration(this.options.minTime);\n maxTime = createDuration(this.options.maxTime);\n activeRange = this.adjustActiveRange(activeRange, minTime, maxTime);\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 minTime: minTime,\n // Duration object that denotes the exclusive visible end time of any given day\n maxTime: maxTime,\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 return this.getRangeOption('validRange', this.calendar.getNow()) ||\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 _a = this, viewSpec = _a.viewSpec, dateEnv = _a.dateEnv;\n var duration = null;\n var unit = null;\n var range = null;\n var dayCount;\n if (viewSpec.duration) {\n duration = viewSpec.duration;\n unit = viewSpec.durationUnit;\n range = this.buildRangeFromDuration(date, direction, duration, unit);\n }\n else if ((dayCount = this.options.dayCount)) {\n unit = 'day';\n range = this.buildRangeFromDayCount(date, direction, dayCount);\n }\n else if ((range = this.buildCustomVisibleRange(date))) {\n unit = 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 // minTime or maxTime causes the range to expand.\n DateProfileGenerator.prototype.adjustActiveRange = function (range, minTime, maxTime) {\n var dateEnv = this.dateEnv;\n var start = range.start;\n var end = range.end;\n if (this.viewSpec.class.prototype.usesMinMaxTime) {\n // expand active range if minTime is negative (why not when positive?)\n if (asRoughDays(minTime) < 0) {\n start = startOfDay(start); // necessary?\n start = dateEnv.add(start, minTime);\n }\n // expand active range if maxTime is beyond one day (why not when positive?)\n if (asRoughDays(maxTime) > 1) {\n end = startOfDay(end); // necessary?\n end = addDays(end, -1);\n end = dateEnv.add(end, maxTime);\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 dateEnv = this.dateEnv;\n var alignment = this.options.dateAlignment;\n var dateIncrementInput;\n var dateIncrementDuration;\n var start;\n var end;\n var res;\n // compute what the alignment should be\n if (!alignment) {\n dateIncrementInput = this.options.dateIncrement;\n if (dateIncrementInput) {\n dateIncrementDuration = createDuration(dateIncrementInput);\n // use the smaller of the two units\n if (asRoughMs(dateIncrementDuration) < asRoughMs(duration)) {\n alignment = greatestDurationDenominator(dateIncrementDuration, !getWeeksFromInput(dateIncrementInput)).unit;\n }\n else {\n alignment = unit;\n }\n }\n else {\n alignment = 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, alignment);\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 dateEnv = this.dateEnv;\n var customAlignment = this.options.dateAlignment;\n var runningCount = 0;\n var start = date;\n var end;\n if (customAlignment) {\n start = dateEnv.startOf(start, customAlignment);\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++;\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 dateEnv = this.dateEnv;\n var visibleRange = this.getRangeOption('visibleRange', dateEnv.toDate(date));\n if (visibleRange && (visibleRange.start == null || visibleRange.end == null)) {\n return null;\n }\n return visibleRange;\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 dateIncrementInput = this.options.dateIncrement;\n var customAlignment;\n if (dateIncrementInput) {\n return createDuration(dateIncrementInput);\n }\n else if ((customAlignment = this.options.dateAlignment)) {\n return createDuration(1, customAlignment);\n }\n else if (fallback) {\n return fallback;\n }\n else {\n return createDuration({ days: 1 });\n }\n };\n // Arguments after name will be forwarded to a hypothetical function value\n // WARNING: passed-in arguments will be given to generator functions as-is and can cause side-effects.\n // Always clone your objects if you fear mutation.\n DateProfileGenerator.prototype.getRangeOption = function (name) {\n var otherArgs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n otherArgs[_i - 1] = arguments[_i];\n }\n var val = this.options[name];\n if (typeof val === 'function') {\n val = val.apply(null, otherArgs);\n }\n if (val) {\n val = parseRange(val, this.dateEnv);\n }\n if (val) {\n val = computeVisibleDayRange(val);\n }\n return val;\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.options.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.options.weekends === false) {\n hiddenDays.push(0, 6); // 0=sunday, 6=saturday\n }\n for (i = 0; i < 7; i++) {\n if (!(isHiddenDayHash[i] = hiddenDays.indexOf(i) !== -1)) {\n dayCnt++;\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;\n var 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// TODO: find a way to avoid comparing DateProfiles. it's tedious\nfunction isDateProfilesEqual(p0, p1) {\n return rangesEqual(p0.validRange, p1.validRange) &&\n rangesEqual(p0.activeRange, p1.activeRange) &&\n rangesEqual(p0.renderRange, p1.renderRange) &&\n durationsEqual(p0.minTime, p1.minTime) &&\n durationsEqual(p0.maxTime, p1.maxTime);\n /*\n TODO: compare more?\n currentRange: DateRange\n currentRangeUnit: string\n isRangeAllDay: boolean\n isValid: boolean\n dateIncrement: Duration\n */\n}\n\nfunction reduce (state, action, calendar) {\n var viewType = reduceViewType(state.viewType, action);\n var dateProfile = reduceDateProfile(state.dateProfile, action, state.currentDate, viewType, calendar);\n var eventSources = reduceEventSources(state.eventSources, action, dateProfile, calendar);\n var nextState = __assign({}, state, { viewType: viewType,\n dateProfile: dateProfile, currentDate: reduceCurrentDate(state.currentDate, action, dateProfile), eventSources: eventSources, eventStore: reduceEventStore(state.eventStore, action, eventSources, dateProfile, calendar), dateSelection: reduceDateSelection(state.dateSelection, action, calendar), eventSelection: reduceSelectedEvent(state.eventSelection, action), eventDrag: reduceEventDrag(state.eventDrag, action, eventSources, calendar), eventResize: reduceEventResize(state.eventResize, action, eventSources, calendar), eventSourceLoadingLevel: computeLoadingLevel(eventSources), loadingLevel: computeLoadingLevel(eventSources) });\n for (var _i = 0, _a = calendar.pluginSystem.hooks.reducers; _i < _a.length; _i++) {\n var reducerFunc = _a[_i];\n nextState = reducerFunc(nextState, action, calendar);\n }\n // console.log(action.type, nextState)\n return nextState;\n}\nfunction reduceViewType(currentViewType, action) {\n switch (action.type) {\n case 'SET_VIEW_TYPE':\n return action.viewType;\n default:\n return currentViewType;\n }\n}\nfunction reduceDateProfile(currentDateProfile, action, currentDate, viewType, calendar) {\n var newDateProfile;\n switch (action.type) {\n case 'PREV':\n newDateProfile = calendar.dateProfileGenerators[viewType].buildPrev(currentDateProfile, currentDate);\n break;\n case 'NEXT':\n newDateProfile = calendar.dateProfileGenerators[viewType].buildNext(currentDateProfile, currentDate);\n break;\n case 'SET_DATE':\n if (!currentDateProfile.activeRange ||\n !rangeContainsMarker(currentDateProfile.currentRange, action.dateMarker)) {\n newDateProfile = calendar.dateProfileGenerators[viewType].build(action.dateMarker, undefined, true // forceToValid\n );\n }\n break;\n case 'SET_VIEW_TYPE':\n var generator = calendar.dateProfileGenerators[viewType];\n if (!generator) {\n throw new Error(viewType ?\n 'The FullCalendar view \"' + viewType + '\" does not exist. Make sure your plugins are loaded correctly.' :\n 'No available FullCalendar view plugins.');\n }\n newDateProfile = generator.build(action.dateMarker || currentDate, undefined, true // forceToValid\n );\n break;\n }\n if (newDateProfile &&\n newDateProfile.isValid &&\n !(currentDateProfile && isDateProfilesEqual(currentDateProfile, newDateProfile))) {\n return newDateProfile;\n }\n else {\n return currentDateProfile;\n }\n}\nfunction reduceCurrentDate(currentDate, action, dateProfile) {\n switch (action.type) {\n case 'PREV':\n case 'NEXT':\n if (!rangeContainsMarker(dateProfile.currentRange, currentDate)) {\n return dateProfile.currentRange.start;\n }\n else {\n return currentDate;\n }\n case 'SET_DATE':\n case 'SET_VIEW_TYPE':\n var newDate = action.dateMarker || currentDate;\n if (dateProfile.activeRange && !rangeContainsMarker(dateProfile.activeRange, newDate)) {\n return dateProfile.currentRange.start;\n }\n else {\n return newDate;\n }\n default:\n return currentDate;\n }\n}\nfunction reduceDateSelection(currentSelection, action, calendar) {\n switch (action.type) {\n case 'SELECT_DATES':\n return action.selection;\n case 'UNSELECT_DATES':\n return null;\n default:\n return currentSelection;\n }\n}\nfunction reduceSelectedEvent(currentInstanceId, action) {\n switch (action.type) {\n case 'SELECT_EVENT':\n return action.eventInstanceId;\n case 'UNSELECT_EVENT':\n return '';\n default:\n return currentInstanceId;\n }\n}\nfunction reduceEventDrag(currentDrag, action, sources, calendar) {\n switch (action.type) {\n case 'SET_EVENT_DRAG':\n var newDrag = action.state;\n return {\n affectedEvents: newDrag.affectedEvents,\n mutatedEvents: newDrag.mutatedEvents,\n isEvent: newDrag.isEvent,\n origSeg: newDrag.origSeg\n };\n case 'UNSET_EVENT_DRAG':\n return null;\n default:\n return currentDrag;\n }\n}\nfunction reduceEventResize(currentResize, action, sources, calendar) {\n switch (action.type) {\n case 'SET_EVENT_RESIZE':\n var newResize = action.state;\n return {\n affectedEvents: newResize.affectedEvents,\n mutatedEvents: newResize.mutatedEvents,\n isEvent: newResize.isEvent,\n origSeg: newResize.origSeg\n };\n case 'UNSET_EVENT_RESIZE':\n return null;\n default:\n return currentResize;\n }\n}\nfunction computeLoadingLevel(eventSources) {\n var cnt = 0;\n for (var sourceId in eventSources) {\n if (eventSources[sourceId].isFetching) {\n cnt++;\n }\n }\n return cnt;\n}\n\nvar STANDARD_PROPS = {\n start: null,\n end: null,\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 else {\n range.end = dateEnv.add(range.start, defaultDuration);\n }\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 leftovers = {};\n var standardProps = refineProps(raw, STANDARD_PROPS, {}, leftovers);\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 // use this leftover object as the selection object\n leftovers.range = {\n start: startMeta ? startMeta.marker : null,\n end: endMeta ? endMeta.marker : null\n };\n leftovers.allDay = allDay;\n return leftovers;\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 {\n start: dateEnv.toDate(span.range.start),\n end: dateEnv.toDate(span.range.end),\n startStr: dateEnv.formatIso(span.range.start, { omitTime: span.allDay }),\n endStr: dateEnv.formatIso(span.range.end, { omitTime: span.allDay }),\n allDay: span.allDay\n };\n}\nfunction buildDatePointApi(span, dateEnv) {\n return {\n date: dateEnv.toDate(span.range.start),\n dateStr: dateEnv.formatIso(span.range.start, { omitTime: span.allDay }),\n allDay: span.allDay\n };\n}\nfunction fabricateEventRange(dateSpan, eventUiBases, calendar) {\n var def = parseEventDef({ editable: false }, '', // sourceId\n dateSpan.allDay, true, // hasEnd\n calendar);\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 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) {\n return (defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] :\n ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null);\n };\n var theClass = queryProp('class');\n var superType = queryProp('superType');\n if (!superType && theClass) {\n superType =\n findViewNameBySubclass(theClass, overrideConfigs) ||\n findViewNameBySubclass(theClass, defaultConfigs);\n }\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 (!theClass && superDef) {\n theClass = superDef.class;\n }\n if (!theClass) {\n return null; // don't throw a warning, might be settings for a single-unit view\n }\n return {\n type: viewType,\n class: theClass,\n defaults: __assign({}, (superDef ? superDef.defaults : {}), (defaultConfig ? defaultConfig.options : {})),\n overrides: __assign({}, (superDef ? superDef.overrides : {}), (overrideConfig ? overrideConfig.options : {}))\n };\n}\nfunction findViewNameBySubclass(viewSubclass, configs) {\n var superProto = Object.getPrototypeOf(viewSubclass.prototype);\n for (var viewType in configs) {\n var parsed = configs[viewType];\n // need DIRECT subclass, so instanceof won't do it\n if (parsed.class && parsed.class.prototype === superProto) {\n return viewType;\n }\n }\n return '';\n}\n\nfunction parseViewConfigs(inputs) {\n return mapHash(inputs, parseViewConfig);\n}\nvar VIEW_DEF_PROPS = {\n type: String,\n class: null\n};\nfunction parseViewConfig(input) {\n if (typeof input === 'function') {\n input = { class: input };\n }\n var options = {};\n var props = refineProps(input, VIEW_DEF_PROPS, {}, options);\n return {\n superType: props.type,\n class: props.class,\n options: options\n };\n}\n\nfunction buildViewSpecs(defaultInputs, optionsManager) {\n var defaultConfigs = parseViewConfigs(defaultInputs);\n var overrideConfigs = parseViewConfigs(optionsManager.overrides.views);\n var viewDefs = compileViewDefs(defaultConfigs, overrideConfigs);\n return mapHash(viewDefs, function (viewDef) {\n return buildViewSpec(viewDef, overrideConfigs, optionsManager);\n });\n}\nfunction buildViewSpec(viewDef, overrideConfigs, optionsManager) {\n var durationInput = viewDef.overrides.duration ||\n viewDef.defaults.duration ||\n optionsManager.dynamicOverrides.duration ||\n optionsManager.overrides.duration;\n var duration = null;\n var durationUnit = '';\n var singleUnit = '';\n var singleUnitOverrides = {};\n if (durationInput) {\n duration = createDuration(durationInput);\n if (duration) { // valid?\n var denom = greatestDurationDenominator(duration, !getWeeksFromInput(durationInput));\n durationUnit = denom.unit;\n if (denom.value === 1) {\n singleUnit = durationUnit;\n singleUnitOverrides = overrideConfigs[durationUnit] ? overrideConfigs[durationUnit].options : {};\n }\n }\n }\n var queryButtonText = function (options) {\n var buttonTextMap = options.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 };\n return {\n type: viewDef.type,\n class: viewDef.class,\n duration: duration,\n durationUnit: durationUnit,\n singleUnit: singleUnit,\n options: __assign({}, globalDefaults, viewDef.defaults, optionsManager.dirDefaults, optionsManager.localeDefaults, optionsManager.overrides, singleUnitOverrides, viewDef.overrides, optionsManager.dynamicOverrides),\n buttonTextOverride: queryButtonText(optionsManager.dynamicOverrides) ||\n queryButtonText(optionsManager.overrides) || // constructor-specified buttonText lookup hash takes precedence\n viewDef.overrides.buttonText,\n buttonTextDefault: queryButtonText(optionsManager.localeDefaults) ||\n queryButtonText(optionsManager.dirDefaults) ||\n viewDef.defaults.buttonText ||\n queryButtonText(globalDefaults) ||\n viewDef.type // fall back to given view name\n };\n}\n\nvar Toolbar = /** @class */ (function (_super) {\n __extends(Toolbar, _super);\n function Toolbar(extraClassName) {\n var _this = _super.call(this) || this;\n _this._renderLayout = memoizeRendering(_this.renderLayout, _this.unrenderLayout);\n _this._updateTitle = memoizeRendering(_this.updateTitle, null, [_this._renderLayout]);\n _this._updateActiveButton = memoizeRendering(_this.updateActiveButton, null, [_this._renderLayout]);\n _this._updateToday = memoizeRendering(_this.updateToday, null, [_this._renderLayout]);\n _this._updatePrev = memoizeRendering(_this.updatePrev, null, [_this._renderLayout]);\n _this._updateNext = memoizeRendering(_this.updateNext, null, [_this._renderLayout]);\n _this.el = createElement('div', { className: 'fc-toolbar ' + extraClassName });\n return _this;\n }\n Toolbar.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this._renderLayout.unrender(); // should unrender everything else\n removeElement(this.el);\n };\n Toolbar.prototype.render = function (props) {\n this._renderLayout(props.layout);\n this._updateTitle(props.title);\n this._updateActiveButton(props.activeButton);\n this._updateToday(props.isTodayEnabled);\n this._updatePrev(props.isPrevEnabled);\n this._updateNext(props.isNextEnabled);\n };\n Toolbar.prototype.renderLayout = function (layout) {\n var el = this.el;\n this.viewsWithButtons = [];\n appendToElement(el, this.renderSection('left', layout.left));\n appendToElement(el, this.renderSection('center', layout.center));\n appendToElement(el, this.renderSection('right', layout.right));\n };\n Toolbar.prototype.unrenderLayout = function () {\n this.el.innerHTML = '';\n };\n Toolbar.prototype.renderSection = function (position, buttonStr) {\n var _this = this;\n var _a = this.context, theme = _a.theme, calendar = _a.calendar;\n var optionsManager = calendar.optionsManager;\n var viewSpecs = calendar.viewSpecs;\n var sectionEl = createElement('div', { className: 'fc-' + position });\n var calendarCustomButtons = optionsManager.computed.customButtons || {};\n var calendarButtonTextOverrides = optionsManager.overrides.buttonText || {};\n var calendarButtonText = optionsManager.computed.buttonText || {};\n if (buttonStr) {\n buttonStr.split(' ').forEach(function (buttonGroupStr, i) {\n var groupChildren = [];\n var isOnlyButtons = true;\n var groupEl;\n buttonGroupStr.split(',').forEach(function (buttonName, j) {\n var customButtonProps;\n var viewSpec;\n var buttonClick;\n var buttonIcon; // only one of these will be set\n var buttonText; // \"\n var buttonInnerHtml;\n var buttonClasses;\n var buttonEl;\n var buttonAriaAttr;\n if (buttonName === 'title') {\n groupChildren.push(htmlToElement('

 

')); // we always want it to take up height\n isOnlyButtons = false;\n }\n else {\n if ((customButtonProps = calendarCustomButtons[buttonName])) {\n buttonClick = function (ev) {\n if (customButtonProps.click) {\n customButtonProps.click.call(buttonEl, ev);\n }\n };\n (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = customButtonProps.text);\n }\n else if ((viewSpec = viewSpecs[buttonName])) {\n _this.viewsWithButtons.push(buttonName);\n buttonClick = function () {\n calendar.changeView(buttonName);\n };\n (buttonText = viewSpec.buttonTextOverride) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = viewSpec.buttonTextDefault);\n }\n else if (calendar[buttonName]) { // a calendar method\n buttonClick = function () {\n calendar[buttonName]();\n };\n (buttonText = calendarButtonTextOverrides[buttonName]) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = calendarButtonText[buttonName]);\n // ^ everything else is considered default\n }\n if (buttonClick) {\n buttonClasses = [\n 'fc-' + buttonName + '-button',\n theme.getClass('button')\n ];\n if (buttonText) {\n buttonInnerHtml = htmlEscape(buttonText);\n buttonAriaAttr = '';\n }\n else if (buttonIcon) {\n buttonInnerHtml = \"\";\n buttonAriaAttr = ' aria-label=\"' + buttonName + '\"';\n }\n buttonEl = htmlToElement(// type=\"button\" so that it doesn't submit a form\n '');\n buttonEl.addEventListener('click', buttonClick);\n groupChildren.push(buttonEl);\n }\n }\n });\n if (groupChildren.length > 1) {\n groupEl = document.createElement('div');\n var buttonGroupClassName = theme.getClass('buttonGroup');\n if (isOnlyButtons && buttonGroupClassName) {\n groupEl.classList.add(buttonGroupClassName);\n }\n appendToElement(groupEl, groupChildren);\n sectionEl.appendChild(groupEl);\n }\n else {\n appendToElement(sectionEl, groupChildren); // 1 or 0 children\n }\n });\n }\n return sectionEl;\n };\n Toolbar.prototype.updateToday = function (isTodayEnabled) {\n this.toggleButtonEnabled('today', isTodayEnabled);\n };\n Toolbar.prototype.updatePrev = function (isPrevEnabled) {\n this.toggleButtonEnabled('prev', isPrevEnabled);\n };\n Toolbar.prototype.updateNext = function (isNextEnabled) {\n this.toggleButtonEnabled('next', isNextEnabled);\n };\n Toolbar.prototype.updateTitle = function (text) {\n findElements(this.el, 'h2').forEach(function (titleEl) {\n titleEl.innerText = text;\n });\n };\n Toolbar.prototype.updateActiveButton = function (buttonName) {\n var theme = this.context.theme;\n var className = theme.getClass('buttonActive');\n findElements(this.el, 'button').forEach(function (buttonEl) {\n if (buttonName && buttonEl.classList.contains('fc-' + buttonName + '-button')) {\n buttonEl.classList.add(className);\n }\n else {\n buttonEl.classList.remove(className);\n }\n });\n };\n Toolbar.prototype.toggleButtonEnabled = function (buttonName, bool) {\n findElements(this.el, '.fc-' + buttonName + '-button').forEach(function (buttonEl) {\n buttonEl.disabled = !bool;\n });\n };\n return Toolbar;\n}(Component));\n\nvar CalendarComponent = /** @class */ (function (_super) {\n __extends(CalendarComponent, _super);\n function CalendarComponent(el) {\n var _this = _super.call(this) || this;\n _this.elClassNames = [];\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n _this.renderToolbars = memoizeRendering(_this._renderToolbars, _this._unrenderToolbars, [_this.renderSkeleton]);\n _this.buildComponentContext = memoize(buildComponentContext);\n _this.buildViewPropTransformers = memoize(buildViewPropTransformers);\n _this.el = el;\n _this.computeTitle = memoize(computeTitle);\n _this.parseBusinessHours = memoize(function (input) {\n return parseBusinessHours(input, _this.context.calendar);\n });\n return _this;\n }\n CalendarComponent.prototype.render = function (props, context) {\n this.freezeHeight();\n var title = this.computeTitle(props.dateProfile, props.viewSpec.options);\n this.renderSkeleton(context);\n this.renderToolbars(props.viewSpec, props.dateProfile, props.currentDate, title);\n this.renderView(props, title);\n this.updateSize();\n this.thawHeight();\n };\n CalendarComponent.prototype.destroy = function () {\n if (this.header) {\n this.header.destroy();\n }\n if (this.footer) {\n this.footer.destroy();\n }\n this.renderSkeleton.unrender(); // will call destroyView\n _super.prototype.destroy.call(this);\n };\n CalendarComponent.prototype._renderSkeleton = function (context) {\n this.updateElClassNames(context);\n prependToElement(this.el, this.contentEl = createElement('div', { className: 'fc-view-container' }));\n var calendar = context.calendar;\n for (var _i = 0, _a = calendar.pluginSystem.hooks.viewContainerModifiers; _i < _a.length; _i++) {\n var modifyViewContainer = _a[_i];\n modifyViewContainer(this.contentEl, calendar);\n }\n };\n CalendarComponent.prototype._unrenderSkeleton = function () {\n // weird to have this here\n if (this.view) {\n this.savedScroll = this.view.queryScroll();\n this.view.destroy();\n this.view = null;\n }\n removeElement(this.contentEl);\n this.removeElClassNames();\n };\n CalendarComponent.prototype.removeElClassNames = function () {\n var classList = this.el.classList;\n for (var _i = 0, _a = this.elClassNames; _i < _a.length; _i++) {\n var className = _a[_i];\n classList.remove(className);\n }\n this.elClassNames = [];\n };\n CalendarComponent.prototype.updateElClassNames = function (context) {\n this.removeElClassNames();\n var theme = context.theme, options = context.options;\n this.elClassNames = [\n 'fc',\n 'fc-' + options.dir,\n theme.getClass('widget')\n ];\n var classList = this.el.classList;\n for (var _i = 0, _a = this.elClassNames; _i < _a.length; _i++) {\n var className = _a[_i];\n classList.add(className);\n }\n };\n CalendarComponent.prototype._renderToolbars = function (viewSpec, dateProfile, currentDate, title) {\n var _a = this, context = _a.context, header = _a.header, footer = _a.footer;\n var options = context.options, calendar = context.calendar;\n var headerLayout = options.header;\n var footerLayout = options.footer;\n var dateProfileGenerator = this.props.dateProfileGenerator;\n var now = calendar.getNow();\n var todayInfo = dateProfileGenerator.build(now);\n var prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate);\n var nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate);\n var toolbarProps = {\n title: title,\n activeButton: viewSpec.type,\n isTodayEnabled: todayInfo.isValid && !rangeContainsMarker(dateProfile.currentRange, now),\n isPrevEnabled: prevInfo.isValid,\n isNextEnabled: nextInfo.isValid\n };\n if (headerLayout) {\n if (!header) {\n header = this.header = new Toolbar('fc-header-toolbar');\n prependToElement(this.el, header.el);\n }\n header.receiveProps(__assign({ layout: headerLayout }, toolbarProps), context);\n }\n else if (header) {\n header.destroy();\n header = this.header = null;\n }\n if (footerLayout) {\n if (!footer) {\n footer = this.footer = new Toolbar('fc-footer-toolbar');\n appendToElement(this.el, footer.el);\n }\n footer.receiveProps(__assign({ layout: footerLayout }, toolbarProps), context);\n }\n else if (footer) {\n footer.destroy();\n footer = this.footer = null;\n }\n };\n CalendarComponent.prototype._unrenderToolbars = function () {\n if (this.header) {\n this.header.destroy();\n this.header = null;\n }\n if (this.footer) {\n this.footer.destroy();\n this.footer = null;\n }\n };\n CalendarComponent.prototype.renderView = function (props, title) {\n var view = this.view;\n var _a = this.context, calendar = _a.calendar, options = _a.options;\n var viewSpec = props.viewSpec, dateProfileGenerator = props.dateProfileGenerator;\n if (!view || view.viewSpec !== viewSpec) {\n if (view) {\n view.destroy();\n }\n view = this.view = new viewSpec['class'](viewSpec, this.contentEl);\n if (this.savedScroll) {\n view.addScroll(this.savedScroll, true);\n this.savedScroll = null;\n }\n }\n view.title = title; // for the API\n var viewProps = {\n dateProfileGenerator: dateProfileGenerator,\n dateProfile: props.dateProfile,\n businessHours: this.parseBusinessHours(viewSpec.options.businessHours),\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n dateSelection: props.dateSelection,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize\n };\n var transformers = this.buildViewPropTransformers(calendar.pluginSystem.hooks.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, viewSpec, props, options));\n }\n view.receiveProps(viewProps, this.buildComponentContext(this.context, viewSpec, view));\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n CalendarComponent.prototype.updateSize = function (isResize) {\n if (isResize === void 0) { isResize = false; }\n var view = this.view;\n if (!view) {\n return; // why?\n }\n if (isResize || this.isHeightAuto == null) {\n this.computeHeightVars();\n }\n view.updateSize(isResize, this.viewHeight, this.isHeightAuto);\n view.updateNowIndicator(); // we need to guarantee this will run after updateSize\n view.popScroll(isResize);\n };\n CalendarComponent.prototype.computeHeightVars = function () {\n var calendar = this.context.calendar; // yuck. need to handle dynamic options\n var heightInput = calendar.opt('height');\n var contentHeightInput = calendar.opt('contentHeight');\n this.isHeightAuto = heightInput === 'auto' || contentHeightInput === 'auto';\n if (typeof contentHeightInput === 'number') { // exists and not 'auto'\n this.viewHeight = contentHeightInput;\n }\n else if (typeof contentHeightInput === 'function') { // exists and is a function\n this.viewHeight = contentHeightInput();\n }\n else if (typeof heightInput === 'number') { // exists and not 'auto'\n this.viewHeight = heightInput - this.queryToolbarsHeight();\n }\n else if (typeof heightInput === 'function') { // exists and is a function\n this.viewHeight = heightInput() - this.queryToolbarsHeight();\n }\n else if (heightInput === 'parent') { // set to height of parent element\n var parentEl = this.el.parentNode;\n this.viewHeight = parentEl.getBoundingClientRect().height - this.queryToolbarsHeight();\n }\n else {\n this.viewHeight = Math.round(this.contentEl.getBoundingClientRect().width /\n Math.max(calendar.opt('aspectRatio'), .5));\n }\n };\n CalendarComponent.prototype.queryToolbarsHeight = function () {\n var height = 0;\n if (this.header) {\n height += computeHeightAndMargins(this.header.el);\n }\n if (this.footer) {\n height += computeHeightAndMargins(this.footer.el);\n }\n return height;\n };\n // Height \"Freezing\"\n // -----------------------------------------------------------------------------------------------------------------\n CalendarComponent.prototype.freezeHeight = function () {\n applyStyle(this.el, {\n height: this.el.getBoundingClientRect().height,\n overflow: 'hidden'\n });\n };\n CalendarComponent.prototype.thawHeight = function () {\n applyStyle(this.el, {\n height: '',\n overflow: ''\n });\n };\n return CalendarComponent;\n}(Component));\n// Title and Date Formatting\n// -----------------------------------------------------------------------------------------------------------------\n// Computes what the title at the top of the calendar should be for this view\nfunction computeTitle(dateProfile, viewOptions) {\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 this.context.dateEnv.formatRange(range.start, range.end, createFormatter(viewOptions.titleFormat || computeTitleFormat(dateProfile), viewOptions.titleRangeSeparator), { isEndExclusive: dateProfile.isRangeAllDay });\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 computeTitleFormat(dateProfile) {\n var currentRangeUnit = dateProfile.currentRangeUnit;\n if (currentRangeUnit === 'year') {\n return { year: 'numeric' };\n }\n else if (currentRangeUnit === 'month') {\n return { year: 'numeric', month: 'long' }; // like \"September 2014\"\n }\n else {\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 else {\n // one day. longer, like \"September 9 2014\"\n return { year: 'numeric', month: 'long', day: 'numeric' };\n }\n }\n}\n// build a context scoped to the view\nfunction buildComponentContext(context, viewSpec, view) {\n return context.extend(viewSpec.options, view);\n}\n// Plugin\n// -----------------------------------------------------------------------------------------------------------------\nfunction buildViewPropTransformers(theClasses) {\n return theClasses.map(function (theClass) {\n return new theClass();\n });\n}\n\nvar Interaction = /** @class */ (function () {\n function Interaction(settings) {\n this.component = settings.component;\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 };\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/*\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 _a = component.context, calendar = _a.calendar, view = _a.view;\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-has-url');\n var url = hasUrlContainer ? hasUrlContainer.querySelector('a[href]').href : '';\n calendar.publiclyTrigger('eventClick', [\n {\n el: segEl,\n event: new EventApi(component.context.calendar, seg.eventRange.def, seg.eventRange.instance),\n jsEvent: ev,\n view: view\n }\n ]);\n if (url && !ev.defaultPrevented) {\n window.location.href = url;\n }\n }\n };\n var component = settings.component;\n _this.destroy = listenBySelector(component.el, 'click', component.fgSegSelector + ',' + component.bgSegSelector, _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 segEl.classList.add('fc-allow-mouse-resize');\n _this.currentSegEl = segEl;\n _this.triggerEvent('eventMouseEnter', ev, segEl);\n }\n };\n _this.handleSegLeave = function (ev, segEl) {\n if (_this.currentSegEl) {\n segEl.classList.remove('fc-allow-mouse-resize');\n _this.currentSegEl = null;\n _this.triggerEvent('eventMouseLeave', ev, segEl);\n }\n };\n var component = settings.component;\n _this.removeHoverListeners = listenToHoverBySelector(component.el, component.fgSegSelector + ',' + component.bgSegSelector, _this.handleSegEnter, _this.handleSegLeave);\n // how to make sure component already has context?\n component.context.calendar.on('eventElRemove', _this.handleEventElRemove);\n return _this;\n }\n EventHovering.prototype.destroy = function () {\n this.removeHoverListeners();\n this.component.context.calendar.off('eventElRemove', this.handleEventElRemove);\n };\n EventHovering.prototype.triggerEvent = function (publicEvName, ev, segEl) {\n var component = this.component;\n var _a = component.context, calendar = _a.calendar, view = _a.view;\n var seg = getElSeg(segEl);\n if (!ev || component.isValidSegDownEl(ev.target)) {\n calendar.publiclyTrigger(publicEvName, [\n {\n el: segEl,\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n jsEvent: ev,\n view: view\n }\n ]);\n }\n };\n return EventHovering;\n}(Interaction));\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 widget: 'fc-unthemed',\n widgetHeader: 'fc-widget-header',\n widgetContent: 'fc-widget-content',\n buttonGroup: 'fc-button-group',\n button: 'fc-button fc-button-primary',\n buttonActive: 'fc-button-active',\n popoverHeader: 'fc-widget-header',\n popoverContent: 'fc-widget-content',\n // day grid\n headerRow: 'fc-widget-header',\n dayRow: 'fc-widget-content',\n // list view\n listView: 'fc-widget-content'\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.iconOverrideOption = 'buttonIcons';\nStandardTheme.prototype.iconOverrideCustomButtonOption = 'icon';\nStandardTheme.prototype.iconOverridePrefix = 'fc-icon-';\n\nvar Calendar = /** @class */ (function () {\n function Calendar(el, overrides) {\n var _this = this;\n this.buildComponentContext = memoize(buildComponentContext$1);\n this.parseRawLocales = memoize(parseRawLocales);\n this.buildLocale = memoize(buildLocale);\n this.buildDateEnv = memoize(buildDateEnv);\n this.buildTheme = memoize(buildTheme);\n this.buildEventUiSingleBase = memoize(this._buildEventUiSingleBase);\n this.buildSelectionConfig = memoize(this._buildSelectionConfig);\n this.buildEventUiBySource = memoizeOutput(buildEventUiBySource, isPropsEqual);\n this.buildEventUiBases = memoize(buildEventUiBases);\n this.interactionsStore = {};\n this.actionQueue = [];\n this.isReducing = false;\n // isDisplaying: boolean = false // installed in DOM? accepting renders?\n this.needsRerender = false; // needs a render?\n this.isRendering = false; // currently in the executeRender function?\n this.renderingPauseDepth = 0;\n this.buildDelayedRerender = memoize(buildDelayedRerender);\n this.afterSizingTriggers = {};\n this.isViewUpdated = false;\n this.isDatesUpdated = false;\n this.isEventsUpdated = false;\n this.el = el;\n this.optionsManager = new OptionsManager(overrides || {});\n this.pluginSystem = new PluginSystem();\n // only do once. don't do in handleOptions. because can't remove plugins\n this.addPluginInputs(this.optionsManager.computed.plugins || []);\n this.handleOptions(this.optionsManager.computed);\n this.publiclyTrigger('_init'); // for tests\n this.hydrate();\n this.calendarInteractions = this.pluginSystem.hooks.calendarInteractions\n .map(function (calendarInteractionClass) {\n return new calendarInteractionClass(_this);\n });\n }\n Calendar.prototype.addPluginInputs = function (pluginInputs) {\n var pluginDefs = refinePluginDefs(pluginInputs);\n for (var _i = 0, pluginDefs_1 = pluginDefs; _i < pluginDefs_1.length; _i++) {\n var pluginDef = pluginDefs_1[_i];\n this.pluginSystem.add(pluginDef);\n }\n };\n Object.defineProperty(Calendar.prototype, \"view\", {\n // public API\n get: function () {\n return this.component ? this.component.view : null;\n },\n enumerable: true,\n configurable: true\n });\n // Public API for rendering\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.render = function () {\n if (!this.component) {\n this.component = new CalendarComponent(this.el);\n this.renderableEventStore = createEmptyEventStore();\n this.bindHandlers();\n this.executeRender();\n }\n else {\n this.requestRerender();\n }\n };\n Calendar.prototype.destroy = function () {\n if (this.component) {\n this.unbindHandlers();\n this.component.destroy(); // don't null-out. in case API needs access\n this.component = null; // umm ???\n for (var _i = 0, _a = this.calendarInteractions; _i < _a.length; _i++) {\n var interaction = _a[_i];\n interaction.destroy();\n }\n this.publiclyTrigger('_destroyed');\n }\n };\n // Handlers\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.bindHandlers = function () {\n var _this = this;\n // event delegation for nav links\n this.removeNavLinkListener = listenBySelector(this.el, 'click', 'a[data-goto]', function (ev, anchorEl) {\n var gotoOptions = anchorEl.getAttribute('data-goto');\n gotoOptions = gotoOptions ? JSON.parse(gotoOptions) : {};\n var dateEnv = _this.dateEnv;\n var dateMarker = dateEnv.createMarker(gotoOptions.date);\n var viewType = gotoOptions.type;\n // property like \"navLinkDayClick\". might be a string or a function\n var customAction = _this.viewOpt('navLink' + capitaliseFirstLetter(viewType) + 'Click');\n if (typeof customAction === 'function') {\n customAction(dateEnv.toDate(dateMarker), ev);\n }\n else {\n if (typeof customAction === 'string') {\n viewType = customAction;\n }\n _this.zoomTo(dateMarker, viewType);\n }\n });\n if (this.opt('handleWindowResize')) {\n window.addEventListener('resize', this.windowResizeProxy = debounce(// prevents rapid calls\n this.windowResize.bind(this), this.opt('windowResizeDelay')));\n }\n };\n Calendar.prototype.unbindHandlers = function () {\n this.removeNavLinkListener();\n if (this.windowResizeProxy) {\n window.removeEventListener('resize', this.windowResizeProxy);\n this.windowResizeProxy = null;\n }\n };\n // Dispatcher\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.hydrate = function () {\n var _this = this;\n this.state = this.buildInitialState();\n var rawSources = this.opt('eventSources') || [];\n var singleRawSource = this.opt('events');\n var sources = []; // parsed\n if (singleRawSource) {\n rawSources.unshift(singleRawSource);\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, this);\n if (source) {\n sources.push(source);\n }\n }\n this.batchRendering(function () {\n _this.dispatch({ type: 'INIT' }); // pass in sources here?\n _this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: sources });\n _this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: _this.opt('defaultView') || _this.pluginSystem.hooks.defaultView\n });\n });\n };\n Calendar.prototype.buildInitialState = function () {\n return {\n viewType: null,\n loadingLevel: 0,\n eventSourceLoadingLevel: 0,\n currentDate: this.getInitialDate(),\n dateProfile: null,\n eventSources: {},\n eventStore: createEmptyEventStore(),\n dateSelection: null,\n eventSelection: '',\n eventDrag: null,\n eventResize: null\n };\n };\n Calendar.prototype.dispatch = function (action) {\n this.actionQueue.push(action);\n if (!this.isReducing) {\n this.isReducing = true;\n var oldState = this.state;\n while (this.actionQueue.length) {\n this.state = this.reduce(this.state, this.actionQueue.shift(), this);\n }\n var newState = this.state;\n this.isReducing = false;\n if (!oldState.loadingLevel && newState.loadingLevel) {\n this.publiclyTrigger('loading', [true]);\n }\n else if (oldState.loadingLevel && !newState.loadingLevel) {\n this.publiclyTrigger('loading', [false]);\n }\n var view = this.component && this.component.view;\n if (oldState.eventStore !== newState.eventStore) {\n if (oldState.eventStore) {\n this.isEventsUpdated = true;\n }\n }\n if (oldState.dateProfile !== newState.dateProfile) {\n if (oldState.dateProfile && view) { // why would view be null!?\n this.publiclyTrigger('datesDestroy', [\n {\n view: view,\n el: view.el\n }\n ]);\n }\n this.isDatesUpdated = true;\n }\n if (oldState.viewType !== newState.viewType) {\n if (oldState.viewType && view) { // why would view be null!?\n this.publiclyTrigger('viewSkeletonDestroy', [\n {\n view: view,\n el: view.el\n }\n ]);\n }\n this.isViewUpdated = true;\n }\n this.requestRerender();\n }\n };\n Calendar.prototype.reduce = function (state, action, calendar) {\n return reduce(state, action, calendar);\n };\n // Render Queue\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.requestRerender = function () {\n this.needsRerender = true;\n this.delayedRerender(); // will call a debounced-version of tryRerender\n };\n Calendar.prototype.tryRerender = function () {\n if (this.component && // must be accepting renders\n this.needsRerender && // indicates that a rerender was requested\n !this.renderingPauseDepth && // not paused\n !this.isRendering // not currently in the render loop\n ) {\n this.executeRender();\n }\n };\n Calendar.prototype.batchRendering = function (func) {\n this.renderingPauseDepth++;\n func();\n this.renderingPauseDepth--;\n if (this.needsRerender) {\n this.requestRerender();\n }\n };\n // Rendering\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.executeRender = function () {\n // clear these BEFORE the render so that new values will accumulate during render\n this.needsRerender = false;\n this.isRendering = true;\n this.renderComponent();\n this.isRendering = false;\n // received a rerender request while rendering\n if (this.needsRerender) {\n this.delayedRerender();\n }\n };\n /*\n don't call this directly. use executeRender instead\n */\n Calendar.prototype.renderComponent = function () {\n var _a = this, state = _a.state, component = _a.component;\n var viewType = state.viewType;\n var viewSpec = this.viewSpecs[viewType];\n if (!viewSpec) {\n throw new Error(\"View type \\\"\" + viewType + \"\\\" is not valid\");\n }\n // if event sources are still loading and progressive rendering hasn't been enabled,\n // keep rendering the last fully loaded set of events\n var renderableEventStore = this.renderableEventStore =\n (state.eventSourceLoadingLevel && !this.opt('progressiveEventRendering')) ?\n this.renderableEventStore :\n state.eventStore;\n var eventUiSingleBase = this.buildEventUiSingleBase(viewSpec.options);\n var eventUiBySource = this.buildEventUiBySource(state.eventSources);\n var eventUiBases = this.eventUiBases = this.buildEventUiBases(renderableEventStore.defs, eventUiSingleBase, eventUiBySource);\n component.receiveProps(__assign({}, state, { viewSpec: viewSpec, dateProfileGenerator: this.dateProfileGenerators[viewType], dateProfile: state.dateProfile, eventStore: renderableEventStore, eventUiBases: eventUiBases, dateSelection: state.dateSelection, eventSelection: state.eventSelection, eventDrag: state.eventDrag, eventResize: state.eventResize }), this.buildComponentContext(this.theme, this.dateEnv, this.optionsManager.computed));\n if (this.isViewUpdated) {\n this.isViewUpdated = false;\n this.publiclyTrigger('viewSkeletonRender', [\n {\n view: component.view,\n el: component.view.el\n }\n ]);\n }\n if (this.isDatesUpdated) {\n this.isDatesUpdated = false;\n this.publiclyTrigger('datesRender', [\n {\n view: component.view,\n el: component.view.el\n }\n ]);\n }\n if (this.isEventsUpdated) {\n this.isEventsUpdated = false;\n }\n this.releaseAfterSizingTriggers();\n };\n // Options\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.setOption = function (name, val) {\n var _a;\n this.mutateOptions((_a = {}, _a[name] = val, _a), [], true);\n };\n Calendar.prototype.getOption = function (name) {\n return this.optionsManager.computed[name];\n };\n Calendar.prototype.opt = function (name) {\n return this.optionsManager.computed[name];\n };\n Calendar.prototype.viewOpt = function (name) {\n return this.viewOpts()[name];\n };\n Calendar.prototype.viewOpts = function () {\n return this.viewSpecs[this.state.viewType].options;\n };\n /*\n handles option changes (like a diff)\n */\n Calendar.prototype.mutateOptions = function (updates, removals, isDynamic, deepEqual) {\n var _this = this;\n var changeHandlers = this.pluginSystem.hooks.optionChangeHandlers;\n var normalUpdates = {};\n var specialUpdates = {};\n var oldDateEnv = this.dateEnv; // do this before handleOptions\n var isTimeZoneDirty = false;\n var isSizeDirty = false;\n var anyDifficultOptions = Boolean(removals.length);\n for (var name_1 in updates) {\n if (changeHandlers[name_1]) {\n specialUpdates[name_1] = updates[name_1];\n }\n else {\n normalUpdates[name_1] = updates[name_1];\n }\n }\n for (var name_2 in normalUpdates) {\n if (/^(height|contentHeight|aspectRatio)$/.test(name_2)) {\n isSizeDirty = true;\n }\n else if (/^(defaultDate|defaultView)$/.test(name_2)) ;\n else {\n anyDifficultOptions = true;\n if (name_2 === 'timeZone') {\n isTimeZoneDirty = true;\n }\n }\n }\n this.optionsManager.mutate(normalUpdates, removals, isDynamic);\n if (anyDifficultOptions) {\n this.handleOptions(this.optionsManager.computed);\n }\n this.batchRendering(function () {\n if (anyDifficultOptions) {\n if (isTimeZoneDirty) {\n _this.dispatch({\n type: 'CHANGE_TIMEZONE',\n oldDateEnv: oldDateEnv\n });\n }\n /* HACK\n has the same effect as calling this.requestRerender()\n but recomputes the state's dateProfile\n */\n _this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: _this.state.viewType\n });\n }\n else if (isSizeDirty) {\n _this.updateSize();\n }\n // special updates\n if (deepEqual) {\n for (var name_3 in specialUpdates) {\n changeHandlers[name_3](specialUpdates[name_3], _this, deepEqual);\n }\n }\n });\n };\n /*\n rebuilds things based off of a complete set of refined options\n */\n Calendar.prototype.handleOptions = function (options) {\n var _this = this;\n var pluginHooks = this.pluginSystem.hooks;\n this.defaultAllDayEventDuration = createDuration(options.defaultAllDayEventDuration);\n this.defaultTimedEventDuration = createDuration(options.defaultTimedEventDuration);\n this.delayedRerender = this.buildDelayedRerender(options.rerenderDelay);\n this.theme = this.buildTheme(options);\n var available = this.parseRawLocales(options.locales);\n this.availableRawLocales = available.map;\n var locale = this.buildLocale(options.locale || available.defaultCode, available.map);\n this.dateEnv = this.buildDateEnv(locale, options.timeZone, pluginHooks.namedTimeZonedImpl, options.firstDay, options.weekNumberCalculation, options.weekLabel, pluginHooks.cmdFormatter);\n this.selectionConfig = this.buildSelectionConfig(options); // needs dateEnv. do after :(\n // ineffecient to do every time?\n this.viewSpecs = buildViewSpecs(pluginHooks.views, this.optionsManager);\n // ineffecient to do every time?\n this.dateProfileGenerators = mapHash(this.viewSpecs, function (viewSpec) {\n return new viewSpec.class.prototype.dateProfileGeneratorClass(viewSpec, _this);\n });\n };\n Calendar.prototype.getAvailableLocaleCodes = function () {\n return Object.keys(this.availableRawLocales);\n };\n Calendar.prototype._buildSelectionConfig = function (rawOpts) {\n return processScopedUiProps('select', rawOpts, this);\n };\n Calendar.prototype._buildEventUiSingleBase = function (rawOpts) {\n if (rawOpts.editable) { // so 'editable' affected events\n rawOpts = __assign({}, rawOpts, { eventEditable: true });\n }\n return processScopedUiProps('event', rawOpts, this);\n };\n // Trigger\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.hasPublicHandlers = function (name) {\n return this.hasHandlers(name) ||\n this.opt(name); // handler specified in options\n };\n Calendar.prototype.publiclyTrigger = function (name, args) {\n var optHandler = this.opt(name);\n this.triggerWith(name, this, args);\n if (optHandler) {\n return optHandler.apply(this, args);\n }\n };\n Calendar.prototype.publiclyTriggerAfterSizing = function (name, args) {\n var afterSizingTriggers = this.afterSizingTriggers;\n (afterSizingTriggers[name] || (afterSizingTriggers[name] = [])).push(args);\n };\n Calendar.prototype.releaseAfterSizingTriggers = function () {\n var afterSizingTriggers = this.afterSizingTriggers;\n for (var name_4 in afterSizingTriggers) {\n for (var _i = 0, _a = afterSizingTriggers[name_4]; _i < _a.length; _i++) {\n var args = _a[_i];\n this.publiclyTrigger(name_4, args);\n }\n }\n this.afterSizingTriggers = {};\n };\n // View\n // -----------------------------------------------------------------------------------------------------------------\n // Returns a boolean about whether the view is okay to instantiate at some point\n Calendar.prototype.isValidViewType = function (viewType) {\n return Boolean(this.viewSpecs[viewType]);\n };\n Calendar.prototype.changeView = function (viewType, dateOrRange) {\n var dateMarker = null;\n if (dateOrRange) {\n if (dateOrRange.start && dateOrRange.end) { // a range\n this.optionsManager.mutate({ visibleRange: dateOrRange }, []); // will not rerender\n this.handleOptions(this.optionsManager.computed); // ...but yuck\n }\n else { // a date\n dateMarker = this.dateEnv.createMarker(dateOrRange); // just like gotoDate\n }\n }\n this.unselect();\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: viewType,\n dateMarker: dateMarker\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 Calendar.prototype.zoomTo = function (dateMarker, viewType) {\n var spec;\n viewType = viewType || 'day'; // day is default zoom\n spec = this.viewSpecs[viewType] ||\n this.getUnitViewSpec(viewType);\n this.unselect();\n if (spec) {\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: spec.type,\n dateMarker: dateMarker\n });\n }\n else {\n this.dispatch({\n type: 'SET_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 Calendar.prototype.getUnitViewSpec = function (unit) {\n var component = this.component;\n var viewTypes = [];\n var i;\n var spec;\n // put views that have buttons first. there will be duplicates, but oh\n if (component.header) {\n viewTypes.push.apply(viewTypes, component.header.viewsWithButtons);\n }\n if (component.footer) {\n viewTypes.push.apply(viewTypes, component.footer.viewsWithButtons);\n }\n for (var viewType in this.viewSpecs) {\n viewTypes.push(viewType);\n }\n for (i = 0; i < viewTypes.length; i++) {\n spec = this.viewSpecs[viewTypes[i]];\n if (spec) {\n if (spec.singleUnit === unit) {\n return spec;\n }\n }\n }\n };\n // Current Date\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.getInitialDate = function () {\n var defaultDateInput = this.opt('defaultDate');\n // compute the initial ambig-timezone date\n if (defaultDateInput != null) {\n return this.dateEnv.createMarker(defaultDateInput);\n }\n else {\n return this.getNow(); // getNow already returns unzoned\n }\n };\n Calendar.prototype.prev = function () {\n this.unselect();\n this.dispatch({ type: 'PREV' });\n };\n Calendar.prototype.next = function () {\n this.unselect();\n this.dispatch({ type: 'NEXT' });\n };\n Calendar.prototype.prevYear = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.addYears(this.state.currentDate, -1)\n });\n };\n Calendar.prototype.nextYear = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.addYears(this.state.currentDate, 1)\n });\n };\n Calendar.prototype.today = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.getNow()\n });\n };\n Calendar.prototype.gotoDate = function (zonedDateInput) {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.createMarker(zonedDateInput)\n });\n };\n Calendar.prototype.incrementDate = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // else, warn about invalid input?\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.add(this.state.currentDate, delta)\n });\n }\n };\n // for external API\n Calendar.prototype.getDate = function () {\n return this.dateEnv.toDate(this.state.currentDate);\n };\n // Date Formatting Utils\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.formatDate = function (d, formatter) {\n var dateEnv = this.dateEnv;\n return dateEnv.format(dateEnv.createMarker(d), createFormatter(formatter));\n };\n // `settings` is for formatter AND isEndExclusive\n Calendar.prototype.formatRange = function (d0, d1, settings) {\n var dateEnv = this.dateEnv;\n return dateEnv.formatRange(dateEnv.createMarker(d0), dateEnv.createMarker(d1), createFormatter(settings, this.opt('defaultRangeSeparator')), settings);\n };\n Calendar.prototype.formatIso = function (d, omitTime) {\n var dateEnv = this.dateEnv;\n return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime: omitTime });\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.windowResize = function (ev) {\n if (!this.isHandlingWindowResize &&\n this.component && // why?\n ev.target === window // not a jqui resize event\n ) {\n this.isHandlingWindowResize = true;\n this.updateSize();\n this.publiclyTrigger('windowResize', [this.view]);\n this.isHandlingWindowResize = false;\n }\n };\n Calendar.prototype.updateSize = function () {\n if (this.component) { // when?\n this.component.updateSize(true);\n }\n };\n // Component Registration\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.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.pluginSystem.hooks.componentInteractions);\n var interactions = interactionClasses.map(function (interactionClass) {\n return new interactionClass(settings);\n });\n this.interactionsStore[component.uid] = interactions;\n interactionSettingsStore[component.uid] = settings;\n };\n Calendar.prototype.unregisterInteractiveComponent = function (component) {\n for (var _i = 0, _a = this.interactionsStore[component.uid]; _i < _a.length; _i++) {\n var listener = _a[_i];\n listener.destroy();\n }\n delete this.interactionsStore[component.uid];\n delete interactionSettingsStore[component.uid];\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 Calendar.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 selection = parseDateSpan(selectionInput, this.dateEnv, createDuration({ days: 1 }) // TODO: cache this?\n );\n if (selection) { // throw parse error otherwise?\n this.dispatch({ type: 'SELECT_DATES', selection: selection });\n this.triggerDateSelect(selection);\n }\n };\n // public method\n Calendar.prototype.unselect = function (pev) {\n if (this.state.dateSelection) {\n this.dispatch({ type: 'UNSELECT_DATES' });\n this.triggerDateUnselect(pev);\n }\n };\n Calendar.prototype.triggerDateSelect = function (selection, pev) {\n var arg = __assign({}, this.buildDateSpanApi(selection), { jsEvent: pev ? pev.origEvent : null, view: this.view });\n this.publiclyTrigger('select', [arg]);\n };\n Calendar.prototype.triggerDateUnselect = function (pev) {\n this.publiclyTrigger('unselect', [\n {\n jsEvent: pev ? pev.origEvent : null,\n view: this.view\n }\n ]);\n };\n // TODO: receive pev?\n Calendar.prototype.triggerDateClick = function (dateSpan, dayEl, view, ev) {\n var arg = __assign({}, this.buildDatePointApi(dateSpan), { dayEl: dayEl, jsEvent: ev, // Is this always a mouse event? See #4655\n view: view });\n this.publiclyTrigger('dateClick', [arg]);\n };\n Calendar.prototype.buildDatePointApi = function (dateSpan) {\n var props = {};\n for (var _i = 0, _a = this.pluginSystem.hooks.datePointTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(props, transform(dateSpan, this));\n }\n __assign(props, buildDatePointApi(dateSpan, this.dateEnv));\n return props;\n };\n Calendar.prototype.buildDateSpanApi = function (dateSpan) {\n var props = {};\n for (var _i = 0, _a = this.pluginSystem.hooks.dateSpanTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(props, transform(dateSpan, this));\n }\n __assign(props, buildDateSpanApi(dateSpan, this.dateEnv));\n return props;\n };\n // Date Utils\n // -----------------------------------------------------------------------------------------------------------------\n // Returns a DateMarker for the current date, as defined by the client's computer or from the `now` option\n Calendar.prototype.getNow = function () {\n var now = this.opt('now');\n if (typeof now === 'function') {\n now = now();\n }\n if (now == null) {\n return this.dateEnv.createNowMarker();\n }\n return this.dateEnv.createMarker(now);\n };\n // Event-Date Utilities\n // -----------------------------------------------------------------------------------------------------------------\n // Given an event's allDay status and start date, return what its fallback end date should be.\n // TODO: rename to computeDefaultEventEnd\n Calendar.prototype.getDefaultEventEnd = function (allDay, marker) {\n var end = marker;\n if (allDay) {\n end = startOfDay(end);\n end = this.dateEnv.add(end, this.defaultAllDayEventDuration);\n }\n else {\n end = this.dateEnv.add(end, this.defaultTimedEventDuration);\n }\n return end;\n };\n // Public Events API\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.addEvent = function (eventInput, sourceInput) {\n if (eventInput instanceof EventApi) {\n var def = eventInput._def;\n var instance = eventInput._instance;\n // not already present? don't want to add an old snapshot\n if (!this.state.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 }\n return eventInput;\n }\n var sourceId;\n if (sourceInput instanceof EventSourceApi) {\n sourceId = sourceInput.internalEventSource.sourceId;\n }\n else if (sourceInput != null) {\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 else {\n sourceId = sourceApi.internalEventSource.sourceId;\n }\n }\n var tuple = parseEvent(eventInput, sourceId, this);\n if (tuple) {\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore(tuple)\n });\n return new EventApi(this, tuple.def, tuple.def.recurringDef ? null : tuple.instance);\n }\n return null;\n };\n // TODO: optimize\n Calendar.prototype.getEventById = function (id) {\n var _a = this.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(this, def, null);\n }\n else {\n for (var instanceId in instances) {\n var instance = instances[instanceId];\n if (instance.defId === def.defId) {\n return new EventApi(this, def, instance);\n }\n }\n }\n }\n }\n return null;\n };\n Calendar.prototype.getEvents = function () {\n var _a = this.state.eventStore, defs = _a.defs, instances = _a.instances;\n var eventApis = [];\n for (var id in instances) {\n var instance = instances[id];\n var def = defs[instance.defId];\n eventApis.push(new EventApi(this, def, instance));\n }\n return eventApis;\n };\n Calendar.prototype.removeAllEvents = function () {\n this.dispatch({ type: 'REMOVE_ALL_EVENTS' });\n };\n Calendar.prototype.rerenderEvents = function () {\n this.dispatch({ type: 'RESET_EVENTS' });\n };\n // Public Event Sources API\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.getEventSources = function () {\n var sourceHash = this.state.eventSources;\n var sourceApis = [];\n for (var internalId in sourceHash) {\n sourceApis.push(new EventSourceApi(this, sourceHash[internalId]));\n }\n return sourceApis;\n };\n Calendar.prototype.getEventSourceById = function (id) {\n var sourceHash = this.state.eventSources;\n id = String(id);\n for (var sourceId in sourceHash) {\n if (sourceHash[sourceId].publicId === id) {\n return new EventSourceApi(this, sourceHash[sourceId]);\n }\n }\n return null;\n };\n Calendar.prototype.addEventSource = function (sourceInput) {\n if (sourceInput instanceof EventSourceApi) {\n // not already present? don't want to add an old snapshot\n if (!this.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, this);\n if (eventSource) { // TODO: error otherwise?\n this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [eventSource] });\n return new EventSourceApi(this, eventSource);\n }\n return null;\n };\n Calendar.prototype.removeAllEventSources = function () {\n this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' });\n };\n Calendar.prototype.refetchEvents = function () {\n this.dispatch({ type: 'FETCH_EVENT_SOURCES' });\n };\n // Scroll\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.scrollToTime = function (timeInput) {\n var duration = createDuration(timeInput);\n if (duration) {\n this.component.view.scrollToDuration(duration);\n }\n };\n return Calendar;\n}());\nEmitterMixin.mixInto(Calendar);\n// for memoizers\n// -----------------------------------------------------------------------------------------------------------------\nfunction buildComponentContext$1(theme, dateEnv, options) {\n return new ComponentContext(this, theme, dateEnv, options, null);\n}\nfunction buildDateEnv(locale, timeZone, namedTimeZoneImpl, firstDay, weekNumberCalculation, weekLabel, cmdFormatter) {\n return new DateEnv({\n calendarSystem: 'gregory',\n timeZone: timeZone,\n namedTimeZoneImpl: namedTimeZoneImpl,\n locale: locale,\n weekNumberCalculation: weekNumberCalculation,\n firstDay: firstDay,\n weekLabel: weekLabel,\n cmdFormatter: cmdFormatter\n });\n}\nfunction buildTheme(calendarOptions) {\n var themeClass = this.pluginSystem.hooks.themeClasses[calendarOptions.themeSystem] || StandardTheme;\n return new themeClass(calendarOptions);\n}\nfunction buildDelayedRerender(wait) {\n var func = this.tryRerender.bind(this);\n if (wait != null) {\n func = debounce(func, wait);\n }\n return func;\n}\nfunction buildEventUiBySource(eventSources) {\n return mapHash(eventSources, function (eventSource) {\n return eventSource.ui;\n });\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}\n\nvar View = /** @class */ (function (_super) {\n __extends(View, _super);\n function View(viewSpec, parentEl) {\n var _this = _super.call(this, createElement('div', { className: 'fc-view fc-' + viewSpec.type + '-view' })) || this;\n _this.renderDatesMem = memoizeRendering(_this.renderDatesWrap, _this.unrenderDatesWrap);\n _this.renderBusinessHoursMem = memoizeRendering(_this.renderBusinessHours, _this.unrenderBusinessHours, [_this.renderDatesMem]);\n _this.renderDateSelectionMem = memoizeRendering(_this.renderDateSelectionWrap, _this.unrenderDateSelectionWrap, [_this.renderDatesMem]);\n _this.renderEventsMem = memoizeRendering(_this.renderEvents, _this.unrenderEvents, [_this.renderDatesMem]);\n _this.renderEventSelectionMem = memoizeRendering(_this.renderEventSelectionWrap, _this.unrenderEventSelectionWrap, [_this.renderEventsMem]);\n _this.renderEventDragMem = memoizeRendering(_this.renderEventDragWrap, _this.unrenderEventDragWrap, [_this.renderDatesMem]);\n _this.renderEventResizeMem = memoizeRendering(_this.renderEventResizeWrap, _this.unrenderEventResizeWrap, [_this.renderDatesMem]);\n _this.viewSpec = viewSpec;\n _this.type = viewSpec.type;\n parentEl.appendChild(_this.el);\n _this.initialize();\n return _this;\n }\n View.prototype.initialize = function () {\n };\n Object.defineProperty(View.prototype, \"activeStart\", {\n // Date Setting/Unsetting\n // -----------------------------------------------------------------------------------------------------------------\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.activeRange.start);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"activeEnd\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.activeRange.end);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"currentStart\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.currentRange.start);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"currentEnd\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.currentRange.end);\n },\n enumerable: true,\n configurable: true\n });\n // General Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.render = function (props, context) {\n this.renderDatesMem(props.dateProfile);\n this.renderBusinessHoursMem(props.businessHours);\n this.renderDateSelectionMem(props.dateSelection);\n this.renderEventsMem(props.eventStore);\n this.renderEventSelectionMem(props.eventSelection);\n this.renderEventDragMem(props.eventDrag);\n this.renderEventResizeMem(props.eventResize);\n };\n View.prototype.beforeUpdate = function () {\n this.addScroll(this.queryScroll());\n };\n View.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderDatesMem.unrender(); // should unrender everything else\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n var calendar = this.context.calendar;\n if (isResize) {\n this.addScroll(this.queryScroll()); // NOTE: same code as in beforeUpdate\n }\n if (isResize || // HACKS...\n calendar.isViewUpdated ||\n calendar.isDatesUpdated ||\n calendar.isEventsUpdated) {\n // sort of the catch-all sizing\n // anything that might cause dimension changes\n this.updateBaseSize(isResize, viewHeight, isAuto);\n }\n // NOTE: popScroll is called by CalendarComponent\n };\n View.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n };\n // Date Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderDatesWrap = function (dateProfile) {\n this.renderDates(dateProfile);\n this.addScroll({\n duration: createDuration(this.context.options.scrollTime)\n });\n };\n View.prototype.unrenderDatesWrap = function () {\n this.stopNowIndicator();\n this.unrenderDates();\n };\n View.prototype.renderDates = function (dateProfile) { };\n View.prototype.unrenderDates = function () { };\n // Business Hours\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderBusinessHours = function (businessHours) { };\n View.prototype.unrenderBusinessHours = function () { };\n // Date Selection\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderDateSelectionWrap = function (selection) {\n if (selection) {\n this.renderDateSelection(selection);\n }\n };\n View.prototype.unrenderDateSelectionWrap = function (selection) {\n if (selection) {\n this.unrenderDateSelection(selection);\n }\n };\n View.prototype.renderDateSelection = function (selection) { };\n View.prototype.unrenderDateSelection = function (selection) { };\n // Event Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEvents = function (eventStore) { };\n View.prototype.unrenderEvents = function () { };\n // util for subclasses\n View.prototype.sliceEvents = function (eventStore, allDay) {\n var props = this.props;\n return sliceEventStore(eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? this.context.nextDayThreshold : null).fg;\n };\n // Event Selection\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventSelectionWrap = function (instanceId) {\n if (instanceId) {\n this.renderEventSelection(instanceId);\n }\n };\n View.prototype.unrenderEventSelectionWrap = function (instanceId) {\n if (instanceId) {\n this.unrenderEventSelection(instanceId);\n }\n };\n View.prototype.renderEventSelection = function (instanceId) { };\n View.prototype.unrenderEventSelection = function (instanceId) { };\n // Event Drag\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventDragWrap = function (state) {\n if (state) {\n this.renderEventDrag(state);\n }\n };\n View.prototype.unrenderEventDragWrap = function (state) {\n if (state) {\n this.unrenderEventDrag(state);\n }\n };\n View.prototype.renderEventDrag = function (state) { };\n View.prototype.unrenderEventDrag = function (state) { };\n // Event Resize\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventResizeWrap = function (state) {\n if (state) {\n this.renderEventResize(state);\n }\n };\n View.prototype.unrenderEventResizeWrap = function (state) {\n if (state) {\n this.unrenderEventResize(state);\n }\n };\n View.prototype.renderEventResize = function (state) { };\n View.prototype.unrenderEventResize = function (state) { };\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n // Immediately render the current time indicator and begins re-rendering it at an interval,\n // which is defined by this.getNowIndicatorUnit().\n // TODO: somehow do this for the current whole day's background too\n // USAGE: must be called manually from subclasses' render methods! don't need to call stopNowIndicator tho\n View.prototype.startNowIndicator = function (dateProfile, dateProfileGenerator) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, dateEnv = _a.dateEnv, options = _a.options;\n var unit;\n var update;\n var delay; // ms wait value\n if (options.nowIndicator && !this.initialNowDate) {\n unit = this.getNowIndicatorUnit(dateProfile, dateProfileGenerator);\n if (unit) {\n update = this.updateNowIndicator.bind(this);\n this.initialNowDate = calendar.getNow();\n this.initialNowQueriedMs = new Date().valueOf();\n // wait until the beginning of the next interval\n delay = dateEnv.add(dateEnv.startOf(this.initialNowDate, unit), createDuration(1, unit)).valueOf() - this.initialNowDate.valueOf();\n // TODO: maybe always use setTimeout, waiting until start of next unit\n this.nowIndicatorTimeoutID = setTimeout(function () {\n _this.nowIndicatorTimeoutID = null;\n update();\n if (unit === 'second') {\n delay = 1000; // every second\n }\n else {\n delay = 1000 * 60; // otherwise, every minute\n }\n _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval\n }, delay);\n }\n // rendering will be initiated in updateSize\n }\n };\n // rerenders the now indicator, computing the new current time from the amount of time that has passed\n // since the initial getNow call.\n View.prototype.updateNowIndicator = function () {\n if (this.props.dateProfile && // a way to determine if dates were rendered yet\n this.initialNowDate // activated before?\n ) {\n this.unrenderNowIndicator(); // won't unrender if unnecessary\n this.renderNowIndicator(addMs(this.initialNowDate, new Date().valueOf() - this.initialNowQueriedMs));\n this.isNowIndicatorRendered = true;\n }\n };\n // Immediately unrenders the view's current time indicator and stops any re-rendering timers.\n // Won't cause side effects if indicator isn't rendered.\n View.prototype.stopNowIndicator = function () {\n if (this.nowIndicatorTimeoutID) {\n clearTimeout(this.nowIndicatorTimeoutID);\n this.nowIndicatorTimeoutID = null;\n }\n if (this.nowIndicatorIntervalID) {\n clearInterval(this.nowIndicatorIntervalID);\n this.nowIndicatorIntervalID = null;\n }\n if (this.isNowIndicatorRendered) {\n this.unrenderNowIndicator();\n this.isNowIndicatorRendered = false;\n }\n };\n View.prototype.getNowIndicatorUnit = function (dateProfile, dateProfileGenerator) {\n // subclasses should implement\n };\n // Renders a current time indicator at the given datetime\n View.prototype.renderNowIndicator = function (date) {\n // SUBCLASSES MUST PASS TO CHILDREN!\n };\n // Undoes the rendering actions from renderNowIndicator\n View.prototype.unrenderNowIndicator = function () {\n // SUBCLASSES MUST PASS TO CHILDREN!\n };\n /* Scroller\n ------------------------------------------------------------------------------------------------------------------*/\n View.prototype.addScroll = function (scroll, isForced) {\n if (isForced) {\n scroll.isForced = isForced;\n }\n __assign(this.queuedScroll || (this.queuedScroll = {}), scroll);\n };\n View.prototype.popScroll = function (isResize) {\n this.applyQueuedScroll(isResize);\n this.queuedScroll = null;\n };\n View.prototype.applyQueuedScroll = function (isResize) {\n if (this.queuedScroll) {\n this.applyScroll(this.queuedScroll, isResize);\n }\n };\n View.prototype.queryScroll = function () {\n var scroll = {};\n if (this.props.dateProfile) { // dates rendered yet?\n __assign(scroll, this.queryDateScroll());\n }\n return scroll;\n };\n View.prototype.applyScroll = function (scroll, isResize) {\n var duration = scroll.duration, isForced = scroll.isForced;\n if (duration != null && !isForced) {\n delete scroll.duration;\n if (this.props.dateProfile) { // dates rendered yet?\n __assign(scroll, this.computeDateScroll(duration));\n }\n }\n if (this.props.dateProfile) { // dates rendered yet?\n this.applyDateScroll(scroll);\n }\n };\n View.prototype.computeDateScroll = function (duration) {\n return {}; // subclasses must implement\n };\n View.prototype.queryDateScroll = function () {\n return {}; // subclasses must implement\n };\n View.prototype.applyDateScroll = function (scroll) {\n // subclasses must implement\n };\n // for API\n View.prototype.scrollToDuration = function (duration) {\n this.applyScroll({ duration: duration }, false);\n };\n return View;\n}(DateComponent));\nEmitterMixin.mixInto(View);\nView.prototype.usesMinMaxTime = false;\nView.prototype.dateProfileGeneratorClass = DateProfileGenerator;\n\nvar FgEventRenderer = /** @class */ (function () {\n function FgEventRenderer() {\n this.segs = [];\n this.isSizeDirty = false;\n }\n FgEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) {\n this.context = context;\n this.rangeUpdated(); // called too frequently :(\n // render an `.el` on each seg\n // returns a subset of the segs. segs that were actually rendered\n segs = this.renderSegEls(segs, mirrorInfo);\n this.segs = segs;\n this.attachSegs(segs, mirrorInfo);\n this.isSizeDirty = true;\n triggerRenderedSegs(this.context, this.segs, Boolean(mirrorInfo));\n };\n FgEventRenderer.prototype.unrender = function (context, _segs, mirrorInfo) {\n triggerWillRemoveSegs(this.context, this.segs, Boolean(mirrorInfo));\n this.detachSegs(this.segs);\n this.segs = [];\n };\n // Updates values that rely on options and also relate to range\n FgEventRenderer.prototype.rangeUpdated = function () {\n var options = this.context.options;\n var displayEventTime;\n var displayEventEnd;\n this.eventTimeFormat = createFormatter(options.eventTimeFormat || this.computeEventTimeFormat(), options.defaultRangeSeparator);\n displayEventTime = options.displayEventTime;\n if (displayEventTime == null) {\n displayEventTime = this.computeDisplayEventTime(); // might be based off of range\n }\n displayEventEnd = options.displayEventEnd;\n if (displayEventEnd == null) {\n displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range\n }\n this.displayEventTime = displayEventTime;\n this.displayEventEnd = displayEventEnd;\n };\n // Renders and assigns an `el` property for each foreground event segment.\n // Only returns segments that successfully rendered.\n FgEventRenderer.prototype.renderSegEls = function (segs, mirrorInfo) {\n var html = '';\n var i;\n if (segs.length) { // don't build an empty html string\n // build a large concatenation of event segment HTML\n for (i = 0; i < segs.length; i++) {\n html += this.renderSegHtml(segs[i], mirrorInfo);\n }\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\n // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false.\n htmlToElements(html).forEach(function (el, i) {\n var seg = segs[i];\n if (el) {\n seg.el = el;\n }\n });\n segs = filterSegsViaEls(this.context, segs, Boolean(mirrorInfo));\n }\n return segs;\n };\n // Generic utility for generating the HTML classNames for an event segment's element\n FgEventRenderer.prototype.getSegClasses = function (seg, isDraggable, isResizable, mirrorInfo) {\n var classes = [\n 'fc-event',\n seg.isStart ? 'fc-start' : 'fc-not-start',\n seg.isEnd ? 'fc-end' : 'fc-not-end'\n ].concat(seg.eventRange.ui.classNames);\n if (isDraggable) {\n classes.push('fc-draggable');\n }\n if (isResizable) {\n classes.push('fc-resizable');\n }\n if (mirrorInfo) {\n classes.push('fc-mirror');\n if (mirrorInfo.isDragging) {\n classes.push('fc-dragging');\n }\n if (mirrorInfo.isResizing) {\n classes.push('fc-resizing');\n }\n }\n return classes;\n };\n // Compute the text that should be displayed on an event's element.\n // `range` can be the Event object itself, or something range-like, with at least a `start`.\n // If event times are disabled, or the event has no time, will return a blank string.\n // If not specified, formatter will default to the eventTimeFormat setting,\n // and displayEnd will default to the displayEventEnd setting.\n FgEventRenderer.prototype.getTimeText = function (eventRange, formatter, displayEnd) {\n var def = eventRange.def, instance = eventRange.instance;\n return this._getTimeText(instance.range.start, def.hasEnd ? instance.range.end : null, def.allDay, formatter, displayEnd, instance.forcedStartTzo, instance.forcedEndTzo);\n };\n FgEventRenderer.prototype._getTimeText = function (start, end, allDay, formatter, displayEnd, forcedStartTzo, forcedEndTzo) {\n var dateEnv = this.context.dateEnv;\n if (formatter == null) {\n formatter = this.eventTimeFormat;\n }\n if (displayEnd == null) {\n displayEnd = this.displayEventEnd;\n }\n if (this.displayEventTime && !allDay) {\n if (displayEnd && end) {\n return dateEnv.formatRange(start, end, formatter, {\n forcedStartTzo: forcedStartTzo,\n forcedEndTzo: forcedEndTzo\n });\n }\n else {\n return dateEnv.format(start, formatter, {\n forcedTzo: forcedStartTzo\n });\n }\n }\n return '';\n };\n FgEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true\n };\n };\n FgEventRenderer.prototype.computeDisplayEventTime = function () {\n return true;\n };\n FgEventRenderer.prototype.computeDisplayEventEnd = function () {\n return true;\n };\n // Utility for generating event skin-related CSS properties\n FgEventRenderer.prototype.getSkinCss = function (ui) {\n return {\n 'background-color': ui.backgroundColor,\n 'border-color': ui.borderColor,\n color: ui.textColor\n };\n };\n FgEventRenderer.prototype.sortEventSegs = function (segs) {\n var specs = this.context.eventOrderSpecs;\n var objs = segs.map(buildSegCompareObj);\n objs.sort(function (obj0, obj1) {\n return compareByFieldSpecs(obj0, obj1, specs);\n });\n return objs.map(function (c) {\n return c._seg;\n });\n };\n FgEventRenderer.prototype.computeSizes = function (force) {\n if (force || this.isSizeDirty) {\n this.computeSegSizes(this.segs);\n }\n };\n FgEventRenderer.prototype.assignSizes = function (force) {\n if (force || this.isSizeDirty) {\n this.assignSegSizes(this.segs);\n this.isSizeDirty = false;\n }\n };\n FgEventRenderer.prototype.computeSegSizes = function (segs) {\n };\n FgEventRenderer.prototype.assignSegSizes = function (segs) {\n };\n // Manipulation on rendered segs\n FgEventRenderer.prototype.hideByHash = function (hash) {\n if (hash) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (hash[seg.eventRange.instance.instanceId]) {\n seg.el.style.visibility = 'hidden';\n }\n }\n }\n };\n FgEventRenderer.prototype.showByHash = function (hash) {\n if (hash) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (hash[seg.eventRange.instance.instanceId]) {\n seg.el.style.visibility = '';\n }\n }\n }\n };\n FgEventRenderer.prototype.selectByInstanceId = function (instanceId) {\n if (instanceId) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n var eventInstance = seg.eventRange.instance;\n if (eventInstance && eventInstance.instanceId === instanceId &&\n seg.el // necessary?\n ) {\n seg.el.classList.add('fc-selected');\n }\n }\n }\n };\n FgEventRenderer.prototype.unselectByInstanceId = function (instanceId) {\n if (instanceId) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (seg.el) { // necessary?\n seg.el.classList.remove('fc-selected');\n }\n }\n }\n };\n return FgEventRenderer;\n}());\n// returns a object with all primitive props that can be compared\nfunction buildSegCompareObj(seg) {\n var eventDef = seg.eventRange.def;\n var range = seg.eventRange.instance.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({}, eventDef.extendedProps, eventDef, { id: eventDef.publicId, start: start,\n end: end, duration: end - start, allDay: Number(eventDef.allDay), _seg: seg // for later retrieval\n });\n}\n\n/*\nTODO: when refactoring this class, make a new FillRenderer instance for each `type`\n*/\nvar FillRenderer = /** @class */ (function () {\n function FillRenderer() {\n this.fillSegTag = 'div';\n this.dirtySizeFlags = {};\n this.containerElsByType = {};\n this.segsByType = {};\n }\n FillRenderer.prototype.getSegsByType = function (type) {\n return this.segsByType[type] || [];\n };\n FillRenderer.prototype.renderSegs = function (type, context, segs) {\n var _a;\n this.context = context;\n var renderedSegs = this.renderSegEls(type, segs); // assignes `.el` to each seg. returns successfully rendered segs\n var containerEls = this.attachSegs(type, renderedSegs);\n if (containerEls) {\n (_a = (this.containerElsByType[type] || (this.containerElsByType[type] = []))).push.apply(_a, containerEls);\n }\n this.segsByType[type] = renderedSegs;\n if (type === 'bgEvent') {\n triggerRenderedSegs(context, renderedSegs, false); // isMirror=false\n }\n this.dirtySizeFlags[type] = true;\n };\n // Unrenders a specific type of fill that is currently rendered on the grid\n FillRenderer.prototype.unrender = function (type, context) {\n var segs = this.segsByType[type];\n if (segs) {\n if (type === 'bgEvent') {\n triggerWillRemoveSegs(context, segs, false); // isMirror=false\n }\n this.detachSegs(type, segs);\n }\n };\n // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types.\n // Only returns segments that successfully rendered.\n FillRenderer.prototype.renderSegEls = function (type, segs) {\n var _this = this;\n var html = '';\n var i;\n if (segs.length) {\n // build a large concatenation of segment HTML\n for (i = 0; i < segs.length; i++) {\n html += this.renderSegHtml(type, segs[i]);\n }\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\n // Then, compute the 'el' for each segment.\n htmlToElements(html).forEach(function (el, i) {\n var seg = segs[i];\n if (el) {\n seg.el = el;\n }\n });\n if (type === 'bgEvent') {\n segs = filterSegsViaEls(this.context, segs, false // isMirror. background events can never be mirror elements\n );\n }\n // correct element type? (would be bad if a non-TD were inserted into a table for example)\n segs = segs.filter(function (seg) {\n return elementMatches(seg.el, _this.fillSegTag);\n });\n }\n return segs;\n };\n // Builds the HTML needed for one fill segment. Generic enough to work with different types.\n FillRenderer.prototype.renderSegHtml = function (type, seg) {\n var css = null;\n var classNames = [];\n if (type !== 'highlight' && type !== 'businessHours') {\n css = {\n 'background-color': seg.eventRange.ui.backgroundColor\n };\n }\n if (type !== 'highlight') {\n classNames = classNames.concat(seg.eventRange.ui.classNames);\n }\n if (type === 'businessHours') {\n classNames.push('fc-bgevent');\n }\n else {\n classNames.push('fc-' + type.toLowerCase());\n }\n return '<' + this.fillSegTag +\n (classNames.length ? ' class=\"' + classNames.join(' ') + '\"' : '') +\n (css ? ' style=\"' + cssToStr(css) + '\"' : '') +\n '>';\n };\n FillRenderer.prototype.detachSegs = function (type, segs) {\n var containerEls = this.containerElsByType[type];\n if (containerEls) {\n containerEls.forEach(removeElement);\n delete this.containerElsByType[type];\n }\n };\n FillRenderer.prototype.computeSizes = function (force) {\n for (var type in this.segsByType) {\n if (force || this.dirtySizeFlags[type]) {\n this.computeSegSizes(this.segsByType[type]);\n }\n }\n };\n FillRenderer.prototype.assignSizes = function (force) {\n for (var type in this.segsByType) {\n if (force || this.dirtySizeFlags[type]) {\n this.assignSegSizes(this.segsByType[type]);\n }\n }\n this.dirtySizeFlags = {};\n };\n FillRenderer.prototype.computeSegSizes = function (segs) {\n };\n FillRenderer.prototype.assignSegSizes = function (segs) {\n };\n return FillRenderer;\n}());\n\nvar NamedTimeZoneImpl = /** @class */ (function () {\n function NamedTimeZoneImpl(timeZoneName) {\n this.timeZoneName = timeZoneName;\n }\n return NamedTimeZoneImpl;\n}());\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) {\n this.emitter = new EmitterMixin();\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\nfunction formatDate(dateInput, settings) {\n if (settings === void 0) { settings = {}; }\n var dateEnv = buildDateEnv$1(settings);\n var formatter = createFormatter(settings);\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, settings // mixture of env and formatter settings\n) {\n var dateEnv = buildDateEnv$1(typeof settings === 'object' && settings ? settings : {}); // pass in if non-null object\n var formatter = createFormatter(settings, globalDefaults.defaultRangeSeparator);\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: settings.isEndExclusive\n });\n}\n// TODO: more DRY and optimized\nfunction buildDateEnv$1(settings) {\n var locale = buildLocale(settings.locale || 'en', parseRawLocales([]).map); // TODO: don't hardcode 'en' everywhere\n // ensure required settings\n settings = __assign({ timeZone: globalDefaults.timeZone, calendarSystem: 'gregory' }, settings, { locale: locale });\n return new DateEnv(settings);\n}\n\nvar DRAG_META_PROPS = {\n startTime: createDuration,\n duration: createDuration,\n create: Boolean,\n sourceId: String\n};\nvar DRAG_META_DEFAULTS = {\n create: true\n};\nfunction parseDragMeta(raw) {\n var leftoverProps = {};\n var refined = refineProps(raw, DRAG_META_PROPS, DRAG_META_DEFAULTS, leftoverProps);\n refined.leftoverProps = leftoverProps;\n return refined;\n}\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 { weekday: 'short' }; // \"Sat\"\n }\n else if (dayCnt > 1) {\n return { weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true }; // \"Sat 11/12\"\n }\n else {\n return { weekday: 'long' }; // \"Saturday\"\n }\n}\nfunction renderDateCell(dateMarker, dateProfile, datesRepDistinctDays, colCnt, colHeadFormat, context, colspan, otherAttrs) {\n var dateEnv = context.dateEnv, theme = context.theme, options = context.options;\n var isDateValid = rangeContainsMarker(dateProfile.activeRange, dateMarker); // TODO: called too frequently. cache somehow.\n var classNames = [\n 'fc-day-header',\n theme.getClass('widgetHeader')\n ];\n var innerHtml;\n if (typeof options.columnHeaderHtml === 'function') {\n innerHtml = options.columnHeaderHtml(dateEnv.toDate(dateMarker));\n }\n else if (typeof options.columnHeaderText === 'function') {\n innerHtml = htmlEscape(options.columnHeaderText(dateEnv.toDate(dateMarker)));\n }\n else {\n innerHtml = htmlEscape(dateEnv.format(dateMarker, colHeadFormat));\n }\n // if only one row of days, the classNames on the header can represent the specific days beneath\n if (datesRepDistinctDays) {\n classNames = classNames.concat(\n // includes the day-of-week class\n // noThemeHighlight=true (don't highlight the header)\n getDayClasses(dateMarker, dateProfile, context, true));\n }\n else {\n classNames.push('fc-' + DAY_IDS[dateMarker.getUTCDay()]); // only add the day-of-week class\n }\n return '' +\n ' 1 ?\n ' colspan=\"' + colspan + '\"' :\n '') +\n (otherAttrs ?\n ' ' + otherAttrs :\n '') +\n '>' +\n (isDateValid ?\n // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff)\n buildGotoAnchorHtml(options, dateEnv, { date: dateMarker, forceOff: !datesRepDistinctDays || colCnt === 1 }, innerHtml) :\n // if not valid, display text, but no link\n innerHtml) +\n '';\n}\n\nvar DayHeader = /** @class */ (function (_super) {\n __extends(DayHeader, _super);\n function DayHeader(parentEl) {\n var _this = _super.call(this) || this;\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n _this.parentEl = parentEl;\n return _this;\n }\n DayHeader.prototype.render = function (props, context) {\n var dates = props.dates, datesRepDistinctDays = props.datesRepDistinctDays;\n var parts = [];\n this.renderSkeleton(context);\n if (props.renderIntroHtml) {\n parts.push(props.renderIntroHtml());\n }\n var colHeadFormat = createFormatter(context.options.columnHeaderFormat ||\n computeFallbackHeaderFormat(datesRepDistinctDays, dates.length));\n for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {\n var date = dates_1[_i];\n parts.push(renderDateCell(date, props.dateProfile, datesRepDistinctDays, dates.length, colHeadFormat, context));\n }\n if (context.isRtl) {\n parts.reverse();\n }\n this.thead.innerHTML = '' + parts.join('') + '';\n };\n DayHeader.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n DayHeader.prototype._renderSkeleton = function (context) {\n var theme = context.theme;\n var parentEl = this.parentEl;\n parentEl.innerHTML = ''; // because might be nbsp\n parentEl.appendChild(this.el = htmlToElement('
' +\n '' +\n '' +\n '
' +\n '
'));\n this.thead = this.el.querySelector('thead');\n };\n DayHeader.prototype._unrenderSkeleton = function () {\n removeElement(this.el);\n };\n return DayHeader;\n}(Component));\n\nvar DaySeries = /** @class */ (function () {\n function DaySeries(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++;\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 DaySeries.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 else {\n return null;\n }\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 DaySeries.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 else if (dayOffset >= indices.length) {\n return indices[indices.length - 1] + 1;\n }\n else {\n return indices[dayOffset];\n }\n };\n return DaySeries;\n}());\n\nvar DayTable = /** @class */ (function () {\n function DayTable(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++) {\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 DayTable.prototype.buildCells = function () {\n var rows = [];\n for (var row = 0; row < this.rowCnt; row++) {\n var cells = [];\n for (var col = 0; col < this.colCnt; col++) {\n cells.push(this.buildCell(row, col));\n }\n rows.push(cells);\n }\n return rows;\n };\n DayTable.prototype.buildCell = function (row, col) {\n return {\n date: this.daySeries.dates[row * this.colCnt + col]\n };\n };\n DayTable.prototype.buildHeaderDates = function () {\n var dates = [];\n for (var col = 0; col < this.colCnt; col++) {\n dates.push(this.cells[0][col].date);\n }\n return dates;\n };\n DayTable.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 DayTable;\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 }\n Slicer.prototype.sliceProps = function (props, dateProfile, nextDayThreshold, calendar, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n var eventUiBases = props.eventUiBases;\n var eventSegs = this.sliceEventStore.apply(this, [props.eventStore, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs));\n return {\n dateSelectionSegs: this.sliceDateSelection.apply(this, [props.dateSelection, eventUiBases, component].concat(extraArgs)),\n businessHourSegs: this.sliceBusinessHours.apply(this, [props.businessHours, dateProfile, nextDayThreshold, calendar, component].concat(extraArgs)),\n fgEventSegs: eventSegs.fg,\n bgEventSegs: eventSegs.bg,\n eventDrag: this.sliceEventDrag.apply(this, [props.eventDrag, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n eventResize: this.sliceEventResize.apply(this, [props.eventResize, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n eventSelection: props.eventSelection\n }; // TODO: give interactionSegs?\n };\n Slicer.prototype.sliceNowDate = function (// does not memoize\n date, component) {\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, [{ range: { start: date, end: addMs(date, 1) }, allDay: false },\n {},\n component].concat(extraArgs));\n };\n Slicer.prototype._sliceBusinessHours = function (businessHours, dateProfile, nextDayThreshold, calendar, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (!businessHours) {\n return [];\n }\n return this._sliceEventStore.apply(this, [expandRecurring(businessHours, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), calendar),\n {},\n dateProfile,\n nextDayThreshold,\n component].concat(extraArgs)).bg;\n };\n Slicer.prototype._sliceEventStore = function (eventStore, eventUiBases, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = 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, component, extraArgs),\n fg: this.sliceEventRanges(rangeRes.fg, component, extraArgs)\n };\n }\n else {\n return { bg: [], fg: [] };\n }\n };\n Slicer.prototype._sliceInteraction = function (interaction, eventUiBases, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = 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, component, extraArgs),\n affectedInstances: interaction.affectedEvents.instances,\n isEvent: interaction.isEvent,\n sourceSeg: interaction.origSeg\n };\n };\n Slicer.prototype._sliceDateSpan = function (dateSpan, eventUiBases, component) {\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, component.context.calendar);\n var segs = this.sliceRange.apply(this, [dateSpan.range].concat(extraArgs));\n for (var _a = 0, segs_1 = segs; _a < segs_1.length; _a++) {\n var seg = segs_1[_a];\n seg.component = component;\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, component, // TODO: kill\n 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, component, extraArgs));\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRange = function (eventRange, component, // TODO: kill\n extraArgs) {\n var segs = this.sliceRange.apply(this, [eventRange.range].concat(extraArgs));\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n seg.component = component;\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 minTime/maxTime 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.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n}\n\n// exports\n// --------------------------------------------------------------------------------------------------\nvar version = '4.4.2';\n\nexport { Calendar, Component, ComponentContext, DateComponent, DateEnv, DateProfileGenerator, DayHeader, DaySeries, DayTable, ElementDragging, ElementScrollController, EmitterMixin, EventApi, FgEventRenderer, FillRenderer, Interaction, Mixin, NamedTimeZoneImpl, PositionCache, ScrollComponent, ScrollController, Slicer, Splitter, Theme, View, WindowScrollController, addDays, addDurations, addMs, addWeeks, allowContextMenu, allowSelection, appendToElement, applyAll, applyMutationToEventStore, applyStyle, applyStyleProp, asRoughMinutes, asRoughMs, asRoughSeconds, buildGotoAnchorHtml, buildSegCompareObj, capitaliseFirstLetter, combineEventUis, compareByFieldSpec, compareByFieldSpecs, compareNumbers, compensateScroll, computeClippingRect, computeEdges, computeEventDraggable, computeEventEndResizable, computeEventStartResizable, computeFallbackHeaderFormat, computeHeightAndMargins, computeInnerRect, computeRect, computeVisibleDayRange, config, constrainPoint, createDuration, createElement, createEmptyEventStore, createEventInstance, createFormatter, createPlugin, cssToStr, debounce, diffDates, diffDayAndTime, diffDays, diffPoints, diffWeeks, diffWholeDays, diffWholeWeeks, disableCursor, distributeHeight, elementClosest, elementMatches, enableCursor, eventTupleToStore, filterEventStoreDefs, filterHash, findChildren, findElements, flexibleCompare, forceClassName, formatDate, formatIsoTimeString, formatRange, getAllDayHtml, getClippingParents, getDayClasses, getElSeg, getRectCenter, getRelevantEvents, globalDefaults, greatestDurationDenominator, hasBgRendering, htmlEscape, htmlToElement, insertAfterElement, interactionSettingsStore, interactionSettingsToStore, intersectRanges, intersectRects, isArraysEqual, isDateSpansEqual, isInt, isInteractionValid, isMultiDayRange, isPropsEqual, isPropsValid, isSingleDay, isValidDate, listenBySelector, mapHash, matchCellWidths, memoize, memoizeOutput, memoizeRendering, mergeEventStores, multiplyDuration, padStart, parseBusinessHours, parseDragMeta, parseEventDef, parseFieldSpecs, parse as parseMarker, pointInsideRect, prependToElement, preventContextMenu, preventDefault, preventSelection, processScopedUiProps, rangeContainsMarker, rangeContainsRange, rangesEqual, rangesIntersect, refineProps, removeElement, removeExact, renderDateCell, requestJson, sliceEventStore, startOfDay, subtractInnerElHeight, translateRect, uncompensateScroll, undistributeHeight, unpromisify, version, whenTransitionDone, wholeDivideDurations };\n","/**\n * EvEmitter v1.1.0\n * Lil' event emitter\n * MIT License\n */\n\n/* jshint unused: true, undef: true, strict: true */\n\n( function( global, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, window */\n if ( typeof define == 'function' && define.amd ) {\n // AMD - RequireJS\n define( factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS - Browserify, Webpack\n module.exports = factory();\n } else {\n // Browser globals\n global.EvEmitter = factory();\n }\n\n}( typeof window != 'undefined' ? window : this, function() {\n\n\"use strict\";\n\nfunction EvEmitter() {}\n\nvar proto = EvEmitter.prototype;\n\nproto.on = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // set events hash\n var events = this._events = this._events || {};\n // set listeners array\n var listeners = events[ eventName ] = events[ eventName ] || [];\n // only add once\n if ( listeners.indexOf( listener ) == -1 ) {\n listeners.push( listener );\n }\n\n return this;\n};\n\nproto.once = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // add event\n this.on( eventName, listener );\n // set once flag\n // set onceEvents hash\n var onceEvents = this._onceEvents = this._onceEvents || {};\n // set onceListeners object\n var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};\n // set flag\n onceListeners[ listener ] = true;\n\n return this;\n};\n\nproto.off = function( eventName, listener ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n var index = listeners.indexOf( listener );\n if ( index != -1 ) {\n listeners.splice( index, 1 );\n }\n\n return this;\n};\n\nproto.emitEvent = function( eventName, args ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n // copy over to avoid interference if .off() in listener\n listeners = listeners.slice(0);\n args = args || [];\n // once stuff\n var onceListeners = this._onceEvents && this._onceEvents[ eventName ];\n\n for ( var i=0; i < listeners.length; i++ ) {\n var listener = listeners[i]\n var isOnce = onceListeners && onceListeners[ listener ];\n if ( isOnce ) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off( eventName, listener );\n // unset once flag\n delete onceListeners[ listener ];\n }\n // trigger listener\n listener.apply( this, args );\n }\n\n return this;\n};\n\nproto.allOff = function() {\n delete this._events;\n delete this._onceEvents;\n};\n\nreturn EvEmitter;\n\n}));\n","/**\n * Fizzy UI utils v2.0.7\n * MIT license\n */\n\n/*jshint browser: true, undef: true, unused: true, strict: true */\n\n( function( window, factory ) {\n // universal module definition\n /*jshint strict: false */ /*globals define, module, require */\n\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'desandro-matches-selector/matches-selector'\n ], function( matchesSelector ) {\n return factory( window, matchesSelector );\n });\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('desandro-matches-selector')\n );\n } else {\n // browser global\n window.fizzyUIUtils = factory(\n window,\n window.matchesSelector\n );\n }\n\n}( window, function factory( window, matchesSelector ) {\n\n'use strict';\n\nvar utils = {};\n\n// ----- extend ----- //\n\n// extends objects\nutils.extend = function( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n};\n\n// ----- modulo ----- //\n\nutils.modulo = function( num, div ) {\n return ( ( num % div ) + div ) % div;\n};\n\n// ----- makeArray ----- //\n\nvar arraySlice = Array.prototype.slice;\n\n// turn element or nodeList into an array\nutils.makeArray = function( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n // return empty array if undefined or null. #6\n if ( obj === null || obj === undefined ) {\n return [];\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n};\n\n// ----- removeFrom ----- //\n\nutils.removeFrom = function( ary, obj ) {\n var index = ary.indexOf( obj );\n if ( index != -1 ) {\n ary.splice( index, 1 );\n }\n};\n\n// ----- getParent ----- //\n\nutils.getParent = function( elem, selector ) {\n while ( elem.parentNode && elem != document.body ) {\n elem = elem.parentNode;\n if ( matchesSelector( elem, selector ) ) {\n return elem;\n }\n }\n};\n\n// ----- getQueryElement ----- //\n\n// use element as selector string\nutils.getQueryElement = function( elem ) {\n if ( typeof elem == 'string' ) {\n return document.querySelector( elem );\n }\n return elem;\n};\n\n// ----- handleEvent ----- //\n\n// enable .ontype to trigger from .addEventListener( elem, 'type' )\nutils.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\n// ----- filterFindElements ----- //\n\nutils.filterFindElements = function( elems, selector ) {\n // make array of elems\n elems = utils.makeArray( elems );\n var ffElems = [];\n\n elems.forEach( function( elem ) {\n // check that elem is an actual element\n if ( !( elem instanceof HTMLElement ) ) {\n return;\n }\n // add elem if no selector\n if ( !selector ) {\n ffElems.push( elem );\n return;\n }\n // filter & find items if we have a selector\n // filter\n if ( matchesSelector( elem, selector ) ) {\n ffElems.push( elem );\n }\n // find children\n var childElems = elem.querySelectorAll( selector );\n // concat childElems to filterFound array\n for ( var i=0; i < childElems.length; i++ ) {\n ffElems.push( childElems[i] );\n }\n });\n\n return ffElems;\n};\n\n// ----- debounceMethod ----- //\n\nutils.debounceMethod = function( _class, methodName, threshold ) {\n threshold = threshold || 100;\n // original method\n var method = _class.prototype[ methodName ];\n var timeoutName = methodName + 'Timeout';\n\n _class.prototype[ methodName ] = function() {\n var timeout = this[ timeoutName ];\n clearTimeout( timeout );\n\n var args = arguments;\n var _this = this;\n this[ timeoutName ] = setTimeout( function() {\n method.apply( _this, args );\n delete _this[ timeoutName ];\n }, threshold );\n };\n};\n\n// ----- docReady ----- //\n\nutils.docReady = function( callback ) {\n var readyState = document.readyState;\n if ( readyState == 'complete' || readyState == 'interactive' ) {\n // do async to allow for other scripts to run. metafizzy/flickity#441\n setTimeout( callback );\n } else {\n document.addEventListener( 'DOMContentLoaded', callback );\n }\n};\n\n// ----- htmlInit ----- //\n\n// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/\nutils.toDashed = function( str ) {\n return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {\n return $1 + '-' + $2;\n }).toLowerCase();\n};\n\nvar console = window.console;\n/**\n * allow user to initialize classes via [data-namespace] or .js-namespace class\n * htmlInit( Widget, 'widgetName' )\n * options are parsed from data-namespace-options\n */\nutils.htmlInit = function( WidgetClass, namespace ) {\n utils.docReady( function() {\n var dashedNamespace = utils.toDashed( namespace );\n var dataAttr = 'data-' + dashedNamespace;\n var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );\n var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );\n var elems = utils.makeArray( dataAttrElems )\n .concat( utils.makeArray( jsDashElems ) );\n var dataOptionsAttr = dataAttr + '-options';\n var jQuery = window.jQuery;\n\n elems.forEach( function( elem ) {\n var attr = elem.getAttribute( dataAttr ) ||\n elem.getAttribute( dataOptionsAttr );\n var options;\n try {\n options = attr && JSON.parse( attr );\n } catch ( error ) {\n // log error, do not initialize\n if ( console ) {\n console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +\n ': ' + error );\n }\n return;\n }\n // initialize\n var instance = new WidgetClass( elem, options );\n // make available via $().data('namespace')\n if ( jQuery ) {\n jQuery.data( elem, namespace, instance );\n }\n });\n\n });\n};\n\n// ----- ----- //\n\nreturn utils;\n\n}));\n","/**\n * matchesSelector v2.0.2\n * matchesSelector( element, '.selector' )\n * MIT license\n */\n\n/*jshint browser: true, strict: true, undef: true, unused: true */\n\n( function( window, factory ) {\n /*global define: false, module: false */\n 'use strict';\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory();\n } else {\n // browser global\n window.matchesSelector = factory();\n }\n\n}( window, function factory() {\n 'use strict';\n\n var matchesMethod = ( function() {\n var ElemProto = window.Element.prototype;\n // check for the standard method name first\n if ( ElemProto.matches ) {\n return 'matches';\n }\n // check un-prefixed\n if ( ElemProto.matchesSelector ) {\n return 'matchesSelector';\n }\n // check vendor prefixes\n var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];\n\n for ( var i=0; i < prefixes.length; i++ ) {\n var prefix = prefixes[i];\n var method = prefix + 'MatchesSelector';\n if ( ElemProto[ method ] ) {\n return method;\n }\n }\n })();\n\n return function matchesSelector( elem, selector ) {\n return elem[ matchesMethod ]( selector );\n };\n\n}));\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p=\"dist/\",t(0)}([function(e,t,n){\"use strict\";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},M=function(){w.forEach(function(e,t){e.node.removeAttribute(\"data-aos\"),e.node.removeAttribute(\"data-aos-easing\"),e.node.removeAttribute(\"data-aos-duration\"),e.node.removeAttribute(\"data-aos-delay\")})},S=function(e){return e===!0||\"mobile\"===e&&p.default.mobile()||\"phone\"===e&&p.default.phone()||\"tablet\"===e&&p.default.tablet()||\"function\"==typeof e&&e()===!0},_=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?M():(x.disableMutationObserver||d.default.isSupported()||(console.info('\\n aos: MutationObserver is not supported on this browser,\\n code mutations observing has been disabled.\\n You may have to call \"refreshHard()\" by yourself.\\n '),x.disableMutationObserver=!0),document.querySelector(\"body\").setAttribute(\"data-aos-easing\",x.easing),document.querySelector(\"body\").setAttribute(\"data-aos-duration\",x.duration),document.querySelector(\"body\").setAttribute(\"data-aos-delay\",x.delay),\"DOMContentLoaded\"===x.startEvent&&[\"complete\",\"interactive\"].indexOf(document.readyState)>-1?j(!0):\"load\"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener(\"resize\",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener(\"orientationchange\",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener(\"scroll\",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||d.default.ready(\"[data-aos]\",O),w)};e.exports={init:_,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){\"use strict\";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(f,t),M?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=O();return c(e)?d(e):void(h=setTimeout(f,a(e)))}function d(e){return h=void 0,_&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),o(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,k=0,M=!1,S=!1,_=!0;if(\"function\"!=typeof e)throw new TypeError(s);return t=u(t)||0,i(n)&&(M=!!n.leading,S=\"maxWait\"in n,y=S?x(u(n.maxWait)||0,t):y,_=\"trailing\"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if(\"function\"!=typeof e)throw new TypeError(s);return i(o)&&(r=\"leading\"in o?!!o.leading:r,a=\"trailing\"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t=\"undefined\"==typeof e?\"undefined\":c(e);return!!e&&(\"object\"==t||\"function\"==t)}function r(e){return!!e&&\"object\"==(\"undefined\"==typeof e?\"undefined\":c(e))}function a(e){return\"symbol\"==(\"undefined\"==typeof e?\"undefined\":c(e))||r(e)&&k.call(e)==d}function u(e){if(\"number\"==typeof e)return e;if(a(e))return f;if(i(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=e.replace(l,\"\");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?f:+e}var c=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},s=\"Expected a function\",f=NaN,d=\"[object Symbol]\",l=/^\\s+|\\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y=\"object\"==(\"undefined\"==typeof t?\"undefined\":c(t))&&t&&t.Object===Object&&t,g=\"object\"==(\"undefined\"==typeof self?\"undefined\":c(self))&&self&&self.Object===Object&&self,h=y||g||Function(\"return this\")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){\"use strict\";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(f,t),M?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function s(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=j();return s(e)?d(e):void(h=setTimeout(f,u(e)))}function d(e){return h=void 0,_&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=s(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),i(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,O=0,M=!1,S=!1,_=!0;if(\"function\"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(M=!!n.leading,S=\"maxWait\"in n,y=S?k(a(n.maxWait)||0,t):y,_=\"trailing\"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e){var t=\"undefined\"==typeof e?\"undefined\":u(e);return!!e&&(\"object\"==t||\"function\"==t)}function i(e){return!!e&&\"object\"==(\"undefined\"==typeof e?\"undefined\":u(e))}function r(e){return\"symbol\"==(\"undefined\"==typeof e?\"undefined\":u(e))||i(e)&&w.call(e)==f}function a(e){if(\"number\"==typeof e)return e;if(r(e))return s;if(o(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=e.replace(d,\"\");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?s:+e}var u=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},c=\"Expected a function\",s=NaN,f=\"[object Symbol]\",d=/^\\s+|\\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v=\"object\"==(\"undefined\"==typeof t?\"undefined\":u(t))&&t&&t.Object===Object&&t,y=\"object\"==(\"undefined\"==typeof self?\"undefined\":u(self))&&self&&self.Object===Object&&self,g=v||y||Function(\"return this\")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){\"use strict\";function n(e){var t=void 0,o=void 0,i=void 0;for(t=0;te.position?e.node.classList.add(\"aos-animate\"):\"undefined\"!=typeof o&&(\"false\"===o||!n&&\"true\"!==o)&&e.node.classList.remove(\"aos-animate\")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){\"use strict\";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,\"__esModule\",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add(\"aos-init\"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){\"use strict\";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,\"__esModule\",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute(\"data-aos-offset\"),anchor:e.getAttribute(\"data-aos-anchor\"),anchorPlacement:e.getAttribute(\"data-aos-anchor-placement\")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case\"top-bottom\":break;case\"center-bottom\":n+=e.offsetHeight/2;break;case\"bottom-bottom\":n+=e.offsetHeight;break;case\"top-center\":n+=i/2;break;case\"bottom-center\":n+=i/2+e.offsetHeight;break;case\"center-center\":n+=i/2+e.offsetHeight/2;break;case\"top-top\":n+=i;break;case\"bottom-top\":n+=e.offsetHeight+i;break;case\"center-top\":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-(\"BODY\"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-(\"BODY\"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e){return e=e||document.querySelectorAll(\"[data-aos]\"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])});","\"use strict\";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function _defineProperties(t,e){for(var n=0;n=window.innerHeight?BEMblock(this.panel,this.constants.panel).addMod(this.constants.IS_ABOVE):BEMblock(this.panel,this.constants.panel).removeMod(this.constants.IS_ABOVE)}},{key:\"getSelectOptionsText\",value:function(t){var e=[].slice.call(t.options),n=[];return e.forEach(function(t){t.selected&&n.push(t.innerText)}),n.join(\", \")}},{key:\"setSelectOptionsItems\",value:function(t,e,n){var s=this,o=[].slice.call(t.parentNode.children),i=[].slice.call(e.options),c=o.map(function(t,e){var n=document.createElement(\"span\");return n.className=s.constants.openerLabel,n.setAttribute(s.constants.DATA_LABEL_INDEX,e),n.innerHTML=\"\".concat(t.innerText,\"\"),n});o.forEach(function(t,e){t.setAttribute(s.constants.DATA_LABEL_INDEX,e)}),i.forEach(function(t,e){t.setAttribute(s.constants.DATA_LABEL_INDEX,e)});var a=+t.getAttribute(this.constants.DATA_LABEL_INDEX),l=n.querySelector(\"[\".concat(this.constants.DATA_LABEL_INDEX,'=\"').concat(a,'\"]'));BEMblock(t,this.constants.option).containsMod(this.constants.IS_SELECTED)?(n.children.length||(n.innerHTML=\"\"),n.appendChild(c[a])):l&&n.removeChild(l),c.forEach(function(t){t.querySelector(\"button\").addEventListener(\"click\",function(t){var e=this;t.preventDefault();var n=t.currentTarget.parentNode,s=n.getAttribute(this.constants.DATA_LABEL_INDEX),o=[].slice.call(this.select.querySelectorAll(\"[\".concat(this.constants.DATA_LABEL_INDEX,'=\"').concat(s,'\"]'))),i=o.filter(function(t){if(t.classList.contains(e.constants.option))return t})[0];o.forEach(function(t){t.selected&&(t.selected=!1),BEMblock(t,e.constants.option).containsMod(e.constants.IS_SELECTED)&&BEMblock(t,e.constants.option).removeMod(e.constants.IS_SELECTED)}),this.dispatchEvent(this.el),this.triggerCheckbox(i),n.parentNode&&n.parentNode.removeChild(n)}.bind(s))})}},{key:\"addDataAttributes\",value:function(t,e){var n=[].filter.call(t.attributes,function(t){return/^data-/.test(t.name)});n.length&&n.forEach(function(t){e.setAttribute(t.name,t.value)})}},{key:\"select\",get:function(){return this.el.parentNode}},{key:\"opener\",get:function(){return this.select.querySelector(\".\"+this.constants.opener)}},{key:\"panel\",get:function(){return this.select.querySelector(\".\"+this.constants.panel)}}]),n}();module.exports=Select;\n","/*! tabbyjs v12.0.3 | (c) 2019 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/tabby */\nElement.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),(function(e,t){\"function\"==typeof define&&define.amd?define([],(function(){return t(e)})):\"object\"==typeof exports?module.exports=t(e):e.Tabby=t(e)})(\"undefined\"!=typeof global?global:\"undefined\"!=typeof window?window:this,(function(e){\"use strict\";var t={idPrefix:\"tabby-toggle_\",default:\"[data-tabby-default]\"},r=function(t){if(t&&\"true\"!=t.getAttribute(\"aria-selected\")){var r=document.querySelector(t.hash);if(r){var o=(function(e){var t=e.closest('[role=\"tablist\"]');if(!t)return{};var r=t.querySelector('[role=\"tab\"][aria-selected=\"true\"]');if(!r)return{};var o=document.querySelector(r.hash);return r.setAttribute(\"aria-selected\",\"false\"),r.setAttribute(\"tabindex\",\"-1\"),o?(o.setAttribute(\"hidden\",\"hidden\"),{previousTab:r,previousContent:o}):{previousTab:r}})(t);!(function(e,t){e.setAttribute(\"aria-selected\",\"true\"),e.setAttribute(\"tabindex\",\"0\"),t.removeAttribute(\"hidden\"),e.focus()})(t,r),o.tab=t,o.content=r,(function(t,r){var o;\"function\"==typeof e.CustomEvent?o=new CustomEvent(\"tabby\",{bubbles:!0,cancelable:!0,detail:r}):(o=document.createEvent(\"CustomEvent\")).initCustomEvent(\"tabby\",!0,!0,r),t.dispatchEvent(o)})(t,o)}}},o=function(e,t){var o=(function(e){var t=e.closest('[role=\"tablist\"]'),r=t?t.querySelectorAll('[role=\"tab\"]'):null;if(r)return{tabs:r,index:Array.prototype.indexOf.call(r,e)}})(e);if(o){var n,i=o.tabs.length-1;[\"ArrowUp\",\"ArrowLeft\",\"Up\",\"Left\"].indexOf(t)>-1?n=o.index<1?i:o.index-1:[\"ArrowDown\",\"ArrowRight\",\"Down\",\"Right\"].indexOf(t)>-1?n=o.index===i?0:o.index+1:\"Home\"===t?n=0:\"End\"===t&&(n=i),r(o.tabs[n])}};return function(n,i){var a,u,l={};l.destroy=function(){var e=u.querySelectorAll(\"a\");Array.prototype.forEach.call(e,(function(e){var t=document.querySelector(e.hash);t&&(function(e,t,r){e.id.slice(0,r.idPrefix.length)===r.idPrefix&&(e.id=\"\"),e.removeAttribute(\"role\"),e.removeAttribute(\"aria-controls\"),e.removeAttribute(\"aria-selected\"),e.removeAttribute(\"tabindex\"),e.closest(\"li\").removeAttribute(\"role\"),t.removeAttribute(\"role\"),t.removeAttribute(\"aria-labelledby\"),t.removeAttribute(\"hidden\")})(e,t,a)})),u.removeAttribute(\"role\"),document.documentElement.removeEventListener(\"click\",c,!0),u.removeEventListener(\"keydown\",d,!0),a=null,u=null},l.setup=function(){if(u=document.querySelector(n)){var e=u.querySelectorAll(\"a\");u.setAttribute(\"role\",\"tablist\"),Array.prototype.forEach.call(e,(function(e){var t=document.querySelector(e.hash);t&&(function(e,t,r){e.id||(e.id=r.idPrefix+t.id),e.setAttribute(\"role\",\"tab\"),e.setAttribute(\"aria-controls\",t.id),e.closest(\"li\").setAttribute(\"role\",\"presentation\"),t.setAttribute(\"role\",\"tabpanel\"),t.setAttribute(\"aria-labelledby\",e.id),e.matches(r.default)?e.setAttribute(\"aria-selected\",\"true\"):(e.setAttribute(\"aria-selected\",\"false\"),e.setAttribute(\"tabindex\",\"-1\"),t.setAttribute(\"hidden\",\"hidden\"))})(e,t,a)}))}},l.toggle=function(e){var t=e;\"string\"==typeof e&&(t=document.querySelector(n+' [role=\"tab\"][href*=\"'+e+'\"]')),r(t)};var c=function(e){var t=e.target.closest(n+' [role=\"tab\"]');t&&(e.preventDefault(),r(t))},d=function(e){var t=document.activeElement;t.matches(n+' [role=\"tab\"]')&&([\"ArrowUp\",\"ArrowDown\",\"ArrowLeft\",\"ArrowRight\",\"Up\",\"Down\",\"Left\",\"Right\",\"Home\",\"End\"].indexOf(e.key)<0||o(t,e.key))};return a=(function(){var e={};return Array.prototype.forEach.call(arguments,(function(t){for(var r in t){if(!t.hasOwnProperty(r))return;e[r]=t[r]}})),e})(t,i||{}),l.setup(),(function(t){if(!(e.location.hash.length<1)){var o=document.querySelector(t+' [role=\"tab\"][href*=\"'+e.location.hash+'\"]');r(o)}})(n),document.documentElement.addEventListener(\"click\",c,!0),u.addEventListener(\"keydown\",d,!0),l}}));","/*!\n * Isotope v3.0.6\n *\n * Licensed GPLv3 for open source use\n * or Isotope Commercial License for commercial use\n *\n * https://isotope.metafizzy.co\n * Copyright 2010-2018 Metafizzy\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'outlayer/outlayer',\n 'get-size/get-size',\n 'desandro-matches-selector/matches-selector',\n 'fizzy-ui-utils/utils',\n './item',\n './layout-mode',\n // include default layout modes\n './layout-modes/masonry',\n './layout-modes/fit-rows',\n './layout-modes/vertical'\n ],\n function( Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ) {\n return factory( window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode );\n });\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('outlayer'),\n require('get-size'),\n require('desandro-matches-selector'),\n require('fizzy-ui-utils'),\n require('./item'),\n require('./layout-mode'),\n // include default layout modes\n require('./layout-modes/masonry'),\n require('./layout-modes/fit-rows'),\n require('./layout-modes/vertical')\n );\n } else {\n // browser global\n window.Isotope = factory(\n window,\n window.Outlayer,\n window.getSize,\n window.matchesSelector,\n window.fizzyUIUtils,\n window.Isotope.Item,\n window.Isotope.LayoutMode\n );\n }\n\n}( window, function factory( window, Outlayer, getSize, matchesSelector, utils,\n Item, LayoutMode ) {\n\n'use strict';\n\n// -------------------------- vars -------------------------- //\n\nvar jQuery = window.jQuery;\n\n// -------------------------- helpers -------------------------- //\n\nvar trim = String.prototype.trim ?\n function( str ) {\n return str.trim();\n } :\n function( str ) {\n return str.replace( /^\\s+|\\s+$/g, '' );\n };\n\n// -------------------------- isotopeDefinition -------------------------- //\n\n // create an Outlayer layout class\n var Isotope = Outlayer.create( 'isotope', {\n layoutMode: 'masonry',\n isJQueryFiltering: true,\n sortAscending: true\n });\n\n Isotope.Item = Item;\n Isotope.LayoutMode = LayoutMode;\n\n var proto = Isotope.prototype;\n\n proto._create = function() {\n this.itemGUID = 0;\n // functions that sort items\n this._sorters = {};\n this._getSorters();\n // call super\n Outlayer.prototype._create.call( this );\n\n // create layout modes\n this.modes = {};\n // start filteredItems with all items\n this.filteredItems = this.items;\n // keep of track of sortBys\n this.sortHistory = [ 'original-order' ];\n // create from registered layout modes\n for ( var name in LayoutMode.modes ) {\n this._initLayoutMode( name );\n }\n };\n\n proto.reloadItems = function() {\n // reset item ID counter\n this.itemGUID = 0;\n // call super\n Outlayer.prototype.reloadItems.call( this );\n };\n\n proto._itemize = function() {\n var items = Outlayer.prototype._itemize.apply( this, arguments );\n // assign ID for original-order\n for ( var i=0; i < items.length; i++ ) {\n var item = items[i];\n item.id = this.itemGUID++;\n }\n this._updateItemsSortData( items );\n return items;\n };\n\n\n // -------------------------- layout -------------------------- //\n\n proto._initLayoutMode = function( name ) {\n var Mode = LayoutMode.modes[ name ];\n // set mode options\n // HACK extend initial options, back-fill in default options\n var initialOpts = this.options[ name ] || {};\n this.options[ name ] = Mode.options ?\n utils.extend( Mode.options, initialOpts ) : initialOpts;\n // init layout mode instance\n this.modes[ name ] = new Mode( this );\n };\n\n\n proto.layout = function() {\n // if first time doing layout, do all magic\n if ( !this._isLayoutInited && this._getOption('initLayout') ) {\n this.arrange();\n return;\n }\n this._layout();\n };\n\n // private method to be used in layout() & magic()\n proto._layout = function() {\n // don't animate first layout\n var isInstant = this._getIsInstant();\n // layout flow\n this._resetLayout();\n this._manageStamps();\n this.layoutItems( this.filteredItems, isInstant );\n\n // flag for initalized\n this._isLayoutInited = true;\n };\n\n // filter + sort + layout\n proto.arrange = function( opts ) {\n // set any options pass\n this.option( opts );\n this._getIsInstant();\n // filter, sort, and layout\n\n // filter\n var filtered = this._filter( this.items );\n this.filteredItems = filtered.matches;\n\n this._bindArrangeComplete();\n\n if ( this._isInstant ) {\n this._noTransition( this._hideReveal, [ filtered ] );\n } else {\n this._hideReveal( filtered );\n }\n\n this._sort();\n this._layout();\n };\n // alias to _init for main plugin method\n proto._init = proto.arrange;\n\n proto._hideReveal = function( filtered ) {\n this.reveal( filtered.needReveal );\n this.hide( filtered.needHide );\n };\n\n // HACK\n // Don't animate/transition first layout\n // Or don't animate/transition other layouts\n proto._getIsInstant = function() {\n var isLayoutInstant = this._getOption('layoutInstant');\n var isInstant = isLayoutInstant !== undefined ? isLayoutInstant :\n !this._isLayoutInited;\n this._isInstant = isInstant;\n return isInstant;\n };\n\n // listen for layoutComplete, hideComplete and revealComplete\n // to trigger arrangeComplete\n proto._bindArrangeComplete = function() {\n // listen for 3 events to trigger arrangeComplete\n var isLayoutComplete, isHideComplete, isRevealComplete;\n var _this = this;\n function arrangeParallelCallback() {\n if ( isLayoutComplete && isHideComplete && isRevealComplete ) {\n _this.dispatchEvent( 'arrangeComplete', null, [ _this.filteredItems ] );\n }\n }\n this.once( 'layoutComplete', function() {\n isLayoutComplete = true;\n arrangeParallelCallback();\n });\n this.once( 'hideComplete', function() {\n isHideComplete = true;\n arrangeParallelCallback();\n });\n this.once( 'revealComplete', function() {\n isRevealComplete = true;\n arrangeParallelCallback();\n });\n };\n\n // -------------------------- filter -------------------------- //\n\n proto._filter = function( items ) {\n var filter = this.options.filter;\n filter = filter || '*';\n var matches = [];\n var hiddenMatched = [];\n var visibleUnmatched = [];\n\n var test = this._getFilterTest( filter );\n\n // test each item\n for ( var i=0; i < items.length; i++ ) {\n var item = items[i];\n if ( item.isIgnored ) {\n continue;\n }\n // add item to either matched or unmatched group\n var isMatched = test( item );\n // item.isFilterMatched = isMatched;\n // add to matches if its a match\n if ( isMatched ) {\n matches.push( item );\n }\n // add to additional group if item needs to be hidden or revealed\n if ( isMatched && item.isHidden ) {\n hiddenMatched.push( item );\n } else if ( !isMatched && !item.isHidden ) {\n visibleUnmatched.push( item );\n }\n }\n\n // return collections of items to be manipulated\n return {\n matches: matches,\n needReveal: hiddenMatched,\n needHide: visibleUnmatched\n };\n };\n\n // get a jQuery, function, or a matchesSelector test given the filter\n proto._getFilterTest = function( filter ) {\n if ( jQuery && this.options.isJQueryFiltering ) {\n // use jQuery\n return function( item ) {\n return jQuery( item.element ).is( filter );\n };\n }\n if ( typeof filter == 'function' ) {\n // use filter as function\n return function( item ) {\n return filter( item.element );\n };\n }\n // default, use filter as selector string\n return function( item ) {\n return matchesSelector( item.element, filter );\n };\n };\n\n // -------------------------- sorting -------------------------- //\n\n /**\n * @params {Array} elems\n * @public\n */\n proto.updateSortData = function( elems ) {\n // get items\n var items;\n if ( elems ) {\n elems = utils.makeArray( elems );\n items = this.getItems( elems );\n } else {\n // update all items if no elems provided\n items = this.items;\n }\n\n this._getSorters();\n this._updateItemsSortData( items );\n };\n\n proto._getSorters = function() {\n var getSortData = this.options.getSortData;\n for ( var key in getSortData ) {\n var sorter = getSortData[ key ];\n this._sorters[ key ] = mungeSorter( sorter );\n }\n };\n\n /**\n * @params {Array} items - of Isotope.Items\n * @private\n */\n proto._updateItemsSortData = function( items ) {\n // do not update if no items\n var len = items && items.length;\n\n for ( var i=0; len && i < len; i++ ) {\n var item = items[i];\n item.updateSortData();\n }\n };\n\n // ----- munge sorter ----- //\n\n // encapsulate this, as we just need mungeSorter\n // other functions in here are just for munging\n var mungeSorter = ( function() {\n // add a magic layer to sorters for convienent shorthands\n // `.foo-bar` will use the text of .foo-bar querySelector\n // `[foo-bar]` will use attribute\n // you can also add parser\n // `.foo-bar parseInt` will parse that as a number\n function mungeSorter( sorter ) {\n // if not a string, return function or whatever it is\n if ( typeof sorter != 'string' ) {\n return sorter;\n }\n // parse the sorter string\n var args = trim( sorter ).split(' ');\n var query = args[0];\n // check if query looks like [an-attribute]\n var attrMatch = query.match( /^\\[(.+)\\]$/ );\n var attr = attrMatch && attrMatch[1];\n var getValue = getValueGetter( attr, query );\n // use second argument as a parser\n var parser = Isotope.sortDataParsers[ args[1] ];\n // parse the value, if there was a parser\n sorter = parser ? function( elem ) {\n return elem && parser( getValue( elem ) );\n } :\n // otherwise just return value\n function( elem ) {\n return elem && getValue( elem );\n };\n\n return sorter;\n }\n\n // get an attribute getter, or get text of the querySelector\n function getValueGetter( attr, query ) {\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n return function getAttribute( elem ) {\n return elem.getAttribute( attr );\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText( elem ) {\n var child = elem.querySelector( query );\n return child && child.textContent;\n };\n }\n\n return mungeSorter;\n })();\n\n // parsers used in getSortData shortcut strings\n Isotope.sortDataParsers = {\n 'parseInt': function( val ) {\n return parseInt( val, 10 );\n },\n 'parseFloat': function( val ) {\n return parseFloat( val );\n }\n };\n\n // ----- sort method ----- //\n\n // sort filteredItem order\n proto._sort = function() {\n if ( !this.options.sortBy ) {\n return;\n }\n // keep track of sortBy History\n var sortBys = utils.makeArray( this.options.sortBy );\n if ( !this._getIsSameSortBy( sortBys ) ) {\n // concat all sortBy and sortHistory, add to front, oldest goes in last\n this.sortHistory = sortBys.concat( this.sortHistory );\n }\n // sort magic\n var itemSorter = getItemSorter( this.sortHistory, this.options.sortAscending );\n this.filteredItems.sort( itemSorter );\n };\n\n // check if sortBys is same as start of sortHistory\n proto._getIsSameSortBy = function( sortBys ) {\n for ( var i=0; i < sortBys.length; i++ ) {\n if ( sortBys[i] != this.sortHistory[i] ) {\n return false;\n }\n }\n return true;\n };\n\n // returns a function used for sorting\n function getItemSorter( sortBys, sortAsc ) {\n return function sorter( itemA, itemB ) {\n // cycle through all sortKeys\n for ( var i = 0; i < sortBys.length; i++ ) {\n var sortBy = sortBys[i];\n var a = itemA.sortData[ sortBy ];\n var b = itemB.sortData[ sortBy ];\n if ( a > b || a < b ) {\n // if sortAsc is an object, use the value given the sortBy key\n var isAscending = sortAsc[ sortBy ] !== undefined ? sortAsc[ sortBy ] : sortAsc;\n var direction = isAscending ? 1 : -1;\n return ( a > b ? 1 : -1 ) * direction;\n }\n }\n return 0;\n };\n }\n\n // -------------------------- methods -------------------------- //\n\n // get layout mode\n proto._mode = function() {\n var layoutMode = this.options.layoutMode;\n var mode = this.modes[ layoutMode ];\n if ( !mode ) {\n // TODO console.error\n throw new Error( 'No layout mode: ' + layoutMode );\n }\n // HACK sync mode's options\n // any options set after init for layout mode need to be synced\n mode.options = this.options[ layoutMode ];\n return mode;\n };\n\n proto._resetLayout = function() {\n // trigger original reset layout\n Outlayer.prototype._resetLayout.call( this );\n this._mode()._resetLayout();\n };\n\n proto._getItemLayoutPosition = function( item ) {\n return this._mode()._getItemLayoutPosition( item );\n };\n\n proto._manageStamp = function( stamp ) {\n this._mode()._manageStamp( stamp );\n };\n\n proto._getContainerSize = function() {\n return this._mode()._getContainerSize();\n };\n\n proto.needsResizeLayout = function() {\n return this._mode().needsResizeLayout();\n };\n\n // -------------------------- adding & removing -------------------------- //\n\n // HEADS UP overwrites default Outlayer appended\n proto.appended = function( elems ) {\n var items = this.addItems( elems );\n if ( !items.length ) {\n return;\n }\n // filter, layout, reveal new items\n var filteredItems = this._filterRevealAdded( items );\n // add to filteredItems\n this.filteredItems = this.filteredItems.concat( filteredItems );\n };\n\n // HEADS UP overwrites default Outlayer prepended\n proto.prepended = function( elems ) {\n var items = this._itemize( elems );\n if ( !items.length ) {\n return;\n }\n // start new layout\n this._resetLayout();\n this._manageStamps();\n // filter, layout, reveal new items\n var filteredItems = this._filterRevealAdded( items );\n // layout previous items\n this.layoutItems( this.filteredItems );\n // add to items and filteredItems\n this.filteredItems = filteredItems.concat( this.filteredItems );\n this.items = items.concat( this.items );\n };\n\n proto._filterRevealAdded = function( items ) {\n var filtered = this._filter( items );\n this.hide( filtered.needHide );\n // reveal all new items\n this.reveal( filtered.matches );\n // layout new items, no transition\n this.layoutItems( filtered.matches, true );\n return filtered.matches;\n };\n\n /**\n * Filter, sort, and layout newly-appended item elements\n * @param {Array or NodeList or Element} elems\n */\n proto.insert = function( elems ) {\n var items = this.addItems( elems );\n if ( !items.length ) {\n return;\n }\n // append item elements\n var i, item;\n var len = items.length;\n for ( i=0; i < len; i++ ) {\n item = items[i];\n this.element.appendChild( item.element );\n }\n // filter new stuff\n var filteredInsertItems = this._filter( items ).matches;\n // set flag\n for ( i=0; i < len; i++ ) {\n items[i].isLayoutInstant = true;\n }\n this.arrange();\n // reset flag\n for ( i=0; i < len; i++ ) {\n delete items[i].isLayoutInstant;\n }\n this.reveal( filteredInsertItems );\n };\n\n var _remove = proto.remove;\n proto.remove = function( elems ) {\n elems = utils.makeArray( elems );\n var removeItems = this.getItems( elems );\n // do regular thing\n _remove.call( this, elems );\n // bail if no items to remove\n var len = removeItems && removeItems.length;\n // remove elems from filteredItems\n for ( var i=0; len && i < len; i++ ) {\n var item = removeItems[i];\n // remove item from collection\n utils.removeFrom( this.filteredItems, item );\n }\n };\n\n proto.shuffle = function() {\n // update random sortData\n for ( var i=0; i < this.items.length; i++ ) {\n var item = this.items[i];\n item.sortData.random = Math.random();\n }\n this.options.sortBy = 'random';\n this._sort();\n this._layout();\n };\n\n /**\n * trigger fn without transition\n * kind of hacky to have this in the first place\n * @param {Function} fn\n * @param {Array} args\n * @returns ret\n * @private\n */\n proto._noTransition = function( fn, args ) {\n // save transitionDuration before disabling\n var transitionDuration = this.options.transitionDuration;\n // disable transition\n this.options.transitionDuration = 0;\n // do it\n var returnValue = fn.apply( this, args );\n // re-enable transition for reveal\n this.options.transitionDuration = transitionDuration;\n return returnValue;\n };\n\n // ----- helper methods ----- //\n\n /**\n * getter method for getting filtered item elements\n * @returns {Array} elems - collection of item elements\n */\n proto.getFilteredItemElements = function() {\n return this.filteredItems.map( function( item ) {\n return item.element;\n });\n };\n\n // ----- ----- //\n\n return Isotope;\n\n}));\n","/*!\nFullCalendar Day Grid Plugin v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\nimport { addWeeks, diffWeeks, DateProfileGenerator, createElement, listenBySelector, removeElement, computeRect, computeClippingRect, applyStyle, computeEventDraggable, computeEventStartResizable, computeEventEndResizable, cssToStr, htmlEscape, FgEventRenderer, appendToElement, prependToElement, htmlToElement, FillRenderer, memoizeRendering, createFormatter, addDays, DateComponent, rangeContainsMarker, getDayClasses, findElements, PositionCache, buildGotoAnchorHtml, findChildren, insertAfterElement, intersectRanges, memoize, ScrollComponent, matchCellWidths, uncompensateScroll, compensateScroll, subtractInnerElHeight, distributeHeight, undistributeHeight, View, Slicer, DayHeader, DaySeries, DayTable, createPlugin } from '@fullcalendar/core';\n\n/*! *****************************************************************************\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 (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\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\nvar __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};\n\nvar DayGridDateProfileGenerator = /** @class */ (function (_super) {\n __extends(DayGridDateProfileGenerator, _super);\n function DayGridDateProfileGenerator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Computes the date range that will be rendered.\n DayGridDateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) {\n var dateEnv = this.dateEnv;\n var renderRange = _super.prototype.buildRenderRange.call(this, currentRange, currentRangeUnit, isRangeAllDay);\n var start = renderRange.start;\n var end = renderRange.end;\n var endOfWeek;\n // year and month views should be aligned with weeks. this is already done for week\n if (/^(year|month)$/.test(currentRangeUnit)) {\n start = dateEnv.startOfWeek(start);\n // make end-of-week if not already\n endOfWeek = dateEnv.startOfWeek(end);\n if (endOfWeek.valueOf() !== end.valueOf()) {\n end = addWeeks(endOfWeek, 1);\n }\n }\n // ensure 6 weeks\n if (this.options.monthMode &&\n this.options.fixedWeekCount) {\n var rowCnt = Math.ceil(// could be partial weeks due to hiddenDays\n diffWeeks(start, end));\n end = addWeeks(end, 6 - rowCnt);\n }\n return { start: start, end: end };\n };\n return DayGridDateProfileGenerator;\n}(DateProfileGenerator));\n\n/* A rectangular panel that is absolutely positioned over other content\n------------------------------------------------------------------------------------------------------------------------\nOptions:\n - className (string)\n - content (HTML string, element, or element array)\n - parentEl\n - top\n - left\n - right (the x coord of where the right edge should be. not a \"CSS\" right)\n - autoHide (boolean)\n - show (callback)\n - hide (callback)\n*/\nvar Popover = /** @class */ (function () {\n function Popover(options) {\n var _this = this;\n this.isHidden = true;\n this.margin = 10; // the space required between the popover and the edges of the scroll container\n // Triggered when the user clicks *anywhere* in the document, for the autoHide feature\n this.documentMousedown = function (ev) {\n // only hide the popover if the click happened outside the popover\n if (_this.el && !_this.el.contains(ev.target)) {\n _this.hide();\n }\n };\n this.options = options;\n }\n // Shows the popover on the specified position. Renders it if not already\n Popover.prototype.show = function () {\n if (this.isHidden) {\n if (!this.el) {\n this.render();\n }\n this.el.style.display = '';\n this.position();\n this.isHidden = false;\n this.trigger('show');\n }\n };\n // Hides the popover, through CSS, but does not remove it from the DOM\n Popover.prototype.hide = function () {\n if (!this.isHidden) {\n this.el.style.display = 'none';\n this.isHidden = true;\n this.trigger('hide');\n }\n };\n // Creates `this.el` and renders content inside of it\n Popover.prototype.render = function () {\n var _this = this;\n var options = this.options;\n var el = this.el = createElement('div', {\n className: 'fc-popover ' + (options.className || ''),\n style: {\n top: '0',\n left: '0'\n }\n });\n if (typeof options.content === 'function') {\n options.content(el);\n }\n options.parentEl.appendChild(el);\n // when a click happens on anything inside with a 'fc-close' className, hide the popover\n listenBySelector(el, 'click', '.fc-close', function (ev) {\n _this.hide();\n });\n if (options.autoHide) {\n document.addEventListener('mousedown', this.documentMousedown);\n }\n };\n // Hides and unregisters any handlers\n Popover.prototype.destroy = function () {\n this.hide();\n if (this.el) {\n removeElement(this.el);\n this.el = null;\n }\n document.removeEventListener('mousedown', this.documentMousedown);\n };\n // Positions the popover optimally, using the top/left/right options\n Popover.prototype.position = function () {\n var options = this.options;\n var el = this.el;\n var elDims = el.getBoundingClientRect(); // only used for width,height\n var origin = computeRect(el.offsetParent);\n var clippingRect = computeClippingRect(options.parentEl);\n var top; // the \"position\" (not \"offset\") values for the popover\n var left; //\n // compute top and left\n top = options.top || 0;\n if (options.left !== undefined) {\n left = options.left;\n }\n else if (options.right !== undefined) {\n left = options.right - elDims.width; // derive the left value from the right value\n }\n else {\n left = 0;\n }\n // constrain to the view port. if constrained by two edges, give precedence to top/left\n top = Math.min(top, clippingRect.bottom - elDims.height - this.margin);\n top = Math.max(top, clippingRect.top + this.margin);\n left = Math.min(left, clippingRect.right - elDims.width - this.margin);\n left = Math.max(left, clippingRect.left + this.margin);\n applyStyle(el, {\n top: top - origin.top,\n left: left - origin.left\n });\n };\n // Triggers a callback. Calls a function in the option hash of the same name.\n // Arguments beyond the first `name` are forwarded on.\n // TODO: better code reuse for this. Repeat code\n // can kill this???\n Popover.prototype.trigger = function (name) {\n if (this.options[name]) {\n this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));\n }\n };\n return Popover;\n}());\n\n/* Event-rendering methods for the DayGrid class\n----------------------------------------------------------------------------------------------------------------------*/\n// \"Simple\" is bad a name. has nothing to do with SimpleDayGrid\nvar SimpleDayGridEventRenderer = /** @class */ (function (_super) {\n __extends(SimpleDayGridEventRenderer, _super);\n function SimpleDayGridEventRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Builds the HTML to be used for the default element for an individual segment\n SimpleDayGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {\n var context = this.context;\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventUi = eventRange.ui;\n var allDay = eventDef.allDay;\n var isDraggable = computeEventDraggable(context, eventDef, eventUi);\n var isResizableFromStart = allDay && seg.isStart && computeEventStartResizable(context, eventDef, eventUi);\n var isResizableFromEnd = allDay && seg.isEnd && computeEventEndResizable(context, eventDef, eventUi);\n var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);\n var skinCss = cssToStr(this.getSkinCss(eventUi));\n var timeHtml = '';\n var timeText;\n var titleHtml;\n classes.unshift('fc-day-grid-event', 'fc-h-event');\n // Only display a timed events time if it is the starting segment\n if (seg.isStart) {\n timeText = this.getTimeText(eventRange);\n if (timeText) {\n timeHtml = '' + htmlEscape(timeText) + '';\n }\n }\n titleHtml =\n '' +\n (htmlEscape(eventDef.title || '') || ' ') + // we always want one line of height\n '';\n return '
' +\n '
' +\n (context.options.dir === 'rtl' ?\n titleHtml + ' ' + timeHtml : // put a natural space in between\n timeHtml + ' ' + titleHtml //\n ) +\n '
' +\n (isResizableFromStart ?\n '
' :\n '') +\n (isResizableFromEnd ?\n '
' :\n '') +\n '
';\n };\n // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined\n SimpleDayGridEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'narrow'\n };\n };\n SimpleDayGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return false; // TODO: somehow consider the originating DayGrid's column count\n };\n return SimpleDayGridEventRenderer;\n}(FgEventRenderer));\n\n/* Event-rendering methods for the DayGrid class\n----------------------------------------------------------------------------------------------------------------------*/\nvar DayGridEventRenderer = /** @class */ (function (_super) {\n __extends(DayGridEventRenderer, _super);\n function DayGridEventRenderer(dayGrid) {\n var _this = _super.call(this) || this;\n _this.dayGrid = dayGrid;\n return _this;\n }\n // Renders the given foreground event segments onto the grid\n DayGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var rowStructs = this.rowStructs = this.renderSegRows(segs);\n // append to each row's content skeleton\n this.dayGrid.rowEls.forEach(function (rowNode, i) {\n rowNode.querySelector('.fc-content-skeleton > table').appendChild(rowStructs[i].tbodyEl);\n });\n // removes the \"more..\" events popover\n if (!mirrorInfo) {\n this.dayGrid.removeSegPopover();\n }\n };\n // Unrenders all currently rendered foreground event segments\n DayGridEventRenderer.prototype.detachSegs = function () {\n var rowStructs = this.rowStructs || [];\n var rowStruct;\n while ((rowStruct = rowStructs.pop())) {\n removeElement(rowStruct.tbodyEl);\n }\n this.rowStructs = null;\n };\n // Uses the given events array to generate elements that should be appended to each row's content skeleton.\n // Returns an array of rowStruct objects (see the bottom of `renderSegRow`).\n // PRECONDITION: each segment shoud already have a rendered and assigned `.el`\n DayGridEventRenderer.prototype.renderSegRows = function (segs) {\n var rowStructs = [];\n var segRows;\n var row;\n segRows = this.groupSegRows(segs); // group into nested arrays\n // iterate each row of segment groupings\n for (row = 0; row < segRows.length; row++) {\n rowStructs.push(this.renderSegRow(row, segRows[row]));\n }\n return rowStructs;\n };\n // Given a row # and an array of segments all in the same row, render a element, a skeleton that contains\n // the segments. Returns object with a bunch of internal data about how the render was calculated.\n // NOTE: modifies rowSegs\n DayGridEventRenderer.prototype.renderSegRow = function (row, rowSegs) {\n var isRtl = this.context.isRtl;\n var dayGrid = this.dayGrid;\n var colCnt = dayGrid.colCnt;\n var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels\n var levelCnt = Math.max(1, segLevels.length); // ensure at least one level\n var tbody = document.createElement('tbody');\n var segMatrix = []; // lookup for which segments are rendered into which level+col cells\n var cellMatrix = []; // lookup for all elements of the level+col matrix\n var loneCellMatrix = []; // lookup for elements that only take up a single column\n var i;\n var levelSegs;\n var col;\n var tr;\n var j;\n var seg;\n var td;\n // populates empty cells from the current column (`col`) to `endCol`\n function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }\n for (i = 0; i < levelCnt; i++) { // iterate through all levels\n levelSegs = segLevels[i];\n col = 0;\n tr = document.createElement('tr');\n segMatrix.push([]);\n cellMatrix.push([]);\n loneCellMatrix.push([]);\n // levelCnt might be 1 even though there are no actual levels. protect against this.\n // this single empty row is useful for styling.\n if (levelSegs) {\n for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level\n seg = levelSegs[j];\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n emptyCellsUntil(leftCol);\n // create a container that occupies or more columns. append the event element.\n td = createElement('td', { className: 'fc-event-container' }, seg.el);\n if (leftCol !== rightCol) {\n td.colSpan = rightCol - leftCol + 1;\n }\n else { // a single-column segment\n loneCellMatrix[i][col] = td;\n }\n while (col <= rightCol) {\n cellMatrix[i][col] = td;\n segMatrix[i][col] = seg;\n col++;\n }\n tr.appendChild(td);\n }\n }\n emptyCellsUntil(colCnt); // finish off the row\n var introHtml = dayGrid.renderProps.renderIntroHtml();\n if (introHtml) {\n if (isRtl) {\n appendToElement(tr, introHtml);\n }\n else {\n prependToElement(tr, introHtml);\n }\n }\n tbody.appendChild(tr);\n }\n return {\n row: row,\n tbodyEl: tbody,\n cellMatrix: cellMatrix,\n segMatrix: segMatrix,\n segLevels: segLevels,\n segs: rowSegs\n };\n };\n // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.\n // NOTE: modifies segs\n DayGridEventRenderer.prototype.buildSegLevels = function (segs) {\n var isRtl = this.context.isRtl;\n var colCnt = this.dayGrid.colCnt;\n var levels = [];\n var i;\n var seg;\n var j;\n // Give preference to elements with certain criteria, so they have\n // a chance to be closer to the top.\n segs = this.sortEventSegs(segs);\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n // loop through levels, starting with the topmost, until the segment doesn't collide with other segments\n for (j = 0; j < levels.length; j++) {\n if (!isDaySegCollision(seg, levels[j])) {\n break;\n }\n }\n // `j` now holds the desired subrow index\n seg.level = j;\n seg.leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol; // for sorting only\n seg.rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol // for sorting only\n ;\n (levels[j] || (levels[j] = [])).push(seg);\n }\n // order segments left-to-right. very important if calendar is RTL\n for (j = 0; j < levels.length; j++) {\n levels[j].sort(compareDaySegCols);\n }\n return levels;\n };\n // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row\n DayGridEventRenderer.prototype.groupSegRows = function (segs) {\n var segRows = [];\n var i;\n for (i = 0; i < this.dayGrid.rowCnt; i++) {\n segRows.push([]);\n }\n for (i = 0; i < segs.length; i++) {\n segRows[segs[i].row].push(segs[i]);\n }\n return segRows;\n };\n // Computes a default `displayEventEnd` value if one is not expliclty defined\n DayGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return this.dayGrid.colCnt === 1; // we'll likely have space if there's only one day\n };\n return DayGridEventRenderer;\n}(SimpleDayGridEventRenderer));\n// Computes whether two segments' columns collide. They are assumed to be in the same row.\nfunction isDaySegCollision(seg, otherSegs) {\n var i;\n var otherSeg;\n for (i = 0; i < otherSegs.length; i++) {\n otherSeg = otherSegs[i];\n if (otherSeg.firstCol <= seg.lastCol &&\n otherSeg.lastCol >= seg.firstCol) {\n return true;\n }\n }\n return false;\n}\n// A cmp function for determining the leftmost event\nfunction compareDaySegCols(a, b) {\n return a.leftCol - b.leftCol;\n}\n\nvar DayGridMirrorRenderer = /** @class */ (function (_super) {\n __extends(DayGridMirrorRenderer, _super);\n function DayGridMirrorRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var sourceSeg = mirrorInfo.sourceSeg;\n var rowStructs = this.rowStructs = this.renderSegRows(segs);\n // inject each new event skeleton into each associated row\n this.dayGrid.rowEls.forEach(function (rowNode, row) {\n var skeletonEl = htmlToElement('
'); // will be absolutely positioned\n var skeletonTopEl;\n var skeletonTop;\n // If there is an original segment, match the top position. Otherwise, put it at the row's top level\n if (sourceSeg && sourceSeg.row === row) {\n skeletonTopEl = sourceSeg.el;\n }\n else {\n skeletonTopEl = rowNode.querySelector('.fc-content-skeleton tbody');\n if (!skeletonTopEl) { // when no events\n skeletonTopEl = rowNode.querySelector('.fc-content-skeleton table');\n }\n }\n skeletonTop = skeletonTopEl.getBoundingClientRect().top -\n rowNode.getBoundingClientRect().top; // the offsetParent origin\n skeletonEl.style.top = skeletonTop + 'px';\n skeletonEl.querySelector('table').appendChild(rowStructs[row].tbodyEl);\n rowNode.appendChild(skeletonEl);\n });\n };\n return DayGridMirrorRenderer;\n}(DayGridEventRenderer));\n\nvar EMPTY_CELL_HTML = '';\nvar DayGridFillRenderer = /** @class */ (function (_super) {\n __extends(DayGridFillRenderer, _super);\n function DayGridFillRenderer(dayGrid) {\n var _this = _super.call(this) || this;\n _this.fillSegTag = 'td'; // override the default tag name\n _this.dayGrid = dayGrid;\n return _this;\n }\n DayGridFillRenderer.prototype.renderSegs = function (type, context, segs) {\n // don't render timed background events\n if (type === 'bgEvent') {\n segs = segs.filter(function (seg) {\n return seg.eventRange.def.allDay;\n });\n }\n _super.prototype.renderSegs.call(this, type, context, segs);\n };\n DayGridFillRenderer.prototype.attachSegs = function (type, segs) {\n var els = [];\n var i;\n var seg;\n var skeletonEl;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n skeletonEl = this.renderFillRow(type, seg);\n this.dayGrid.rowEls[seg.row].appendChild(skeletonEl);\n els.push(skeletonEl);\n }\n return els;\n };\n // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.\n DayGridFillRenderer.prototype.renderFillRow = function (type, seg) {\n var dayGrid = this.dayGrid;\n var isRtl = this.context.isRtl;\n var colCnt = dayGrid.colCnt;\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n var startCol = leftCol;\n var endCol = rightCol + 1;\n var className;\n var skeletonEl;\n var trEl;\n if (type === 'businessHours') {\n className = 'bgevent';\n }\n else {\n className = type.toLowerCase();\n }\n skeletonEl = htmlToElement('
' +\n '
' +\n '
');\n trEl = skeletonEl.getElementsByTagName('tr')[0];\n if (startCol > 0) {\n appendToElement(trEl, \n // will create (startCol + 1) td's\n new Array(startCol + 1).join(EMPTY_CELL_HTML));\n }\n seg.el.colSpan = endCol - startCol;\n trEl.appendChild(seg.el);\n if (endCol < colCnt) {\n appendToElement(trEl, \n // will create (colCnt - endCol) td's\n new Array(colCnt - endCol + 1).join(EMPTY_CELL_HTML));\n }\n var introHtml = dayGrid.renderProps.renderIntroHtml();\n if (introHtml) {\n if (isRtl) {\n appendToElement(trEl, introHtml);\n }\n else {\n prependToElement(trEl, introHtml);\n }\n }\n return skeletonEl;\n };\n return DayGridFillRenderer;\n}(FillRenderer));\n\nvar DayTile = /** @class */ (function (_super) {\n __extends(DayTile, _super);\n function DayTile(el) {\n var _this = _super.call(this, el) || this;\n var eventRenderer = _this.eventRenderer = new DayTileEventRenderer(_this);\n var renderFrame = _this.renderFrame = memoizeRendering(_this._renderFrame);\n _this.renderFgEvents = memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderFrame]);\n _this.renderEventSelection = memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);\n _this.renderEventResize = memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);\n return _this;\n }\n DayTile.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, {\n el: this.el,\n useEventCenter: false\n });\n };\n DayTile.prototype.render = function (props, context) {\n this.renderFrame(props.date);\n this.renderFgEvents(context, props.fgSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDragInstances);\n this.renderEventResize(props.eventResizeInstances);\n };\n DayTile.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderFrame.unrender(); // should unrender everything else\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n DayTile.prototype._renderFrame = function (date) {\n var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options;\n var title = dateEnv.format(date, createFormatter(options.dayPopoverFormat) // TODO: cache\n );\n this.el.innerHTML =\n '
' +\n '' +\n htmlEscape(title) +\n '' +\n '' +\n '
' +\n '
' +\n '
' +\n '
';\n this.segContainerEl = this.el.querySelector('.fc-event-container');\n };\n DayTile.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n var date = this.props.date; // HACK\n if (positionLeft < elWidth && positionTop < elHeight) {\n return {\n component: this,\n dateSpan: {\n allDay: true,\n range: { start: date, end: addDays(date, 1) }\n },\n dayEl: this.el,\n rect: {\n left: 0,\n top: 0,\n right: elWidth,\n bottom: elHeight\n },\n layer: 1\n };\n }\n };\n return DayTile;\n}(DateComponent));\nvar DayTileEventRenderer = /** @class */ (function (_super) {\n __extends(DayTileEventRenderer, _super);\n function DayTileEventRenderer(dayTile) {\n var _this = _super.call(this) || this;\n _this.dayTile = dayTile;\n return _this;\n }\n DayTileEventRenderer.prototype.attachSegs = function (segs) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n this.dayTile.segContainerEl.appendChild(seg.el);\n }\n };\n DayTileEventRenderer.prototype.detachSegs = function (segs) {\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n removeElement(seg.el);\n }\n };\n return DayTileEventRenderer;\n}(SimpleDayGridEventRenderer));\n\nvar DayBgRow = /** @class */ (function () {\n function DayBgRow(context) {\n this.context = context;\n }\n DayBgRow.prototype.renderHtml = function (props) {\n var parts = [];\n if (props.renderIntroHtml) {\n parts.push(props.renderIntroHtml());\n }\n for (var _i = 0, _a = props.cells; _i < _a.length; _i++) {\n var cell = _a[_i];\n parts.push(renderCellHtml(cell.date, props.dateProfile, this.context, cell.htmlAttrs));\n }\n if (!props.cells.length) {\n parts.push('');\n }\n if (this.context.options.dir === 'rtl') {\n parts.reverse();\n }\n return '' + parts.join('') + '';\n };\n return DayBgRow;\n}());\nfunction renderCellHtml(date, dateProfile, context, otherAttrs) {\n var dateEnv = context.dateEnv, theme = context.theme;\n var isDateValid = rangeContainsMarker(dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.\n var classes = getDayClasses(date, dateProfile, context);\n classes.unshift('fc-day', theme.getClass('widgetContent'));\n return '';\n}\n\nvar DAY_NUM_FORMAT = createFormatter({ day: 'numeric' });\nvar WEEK_NUM_FORMAT = createFormatter({ week: 'numeric' });\nvar DayGrid = /** @class */ (function (_super) {\n __extends(DayGrid, _super);\n function DayGrid(el, renderProps) {\n var _this = _super.call(this, el) || this;\n _this.bottomCoordPadding = 0; // hack for extending the hit area for the last row of the coordinate grid\n _this.isCellSizesDirty = false;\n _this.renderProps = renderProps;\n var eventRenderer = _this.eventRenderer = new DayGridEventRenderer(_this);\n var fillRenderer = _this.fillRenderer = new DayGridFillRenderer(_this);\n _this.mirrorRenderer = new DayGridMirrorRenderer(_this);\n var renderCells = _this.renderCells = memoizeRendering(_this._renderCells, _this._unrenderCells);\n _this.renderBusinessHours = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderCells]);\n _this.renderDateSelection = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'highlight'), fillRenderer.unrender.bind(fillRenderer, 'highlight'), [renderCells]);\n _this.renderBgEvents = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderCells]);\n _this.renderFgEvents = memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderCells]);\n _this.renderEventSelection = memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderCells]);\n _this.renderEventResize = memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderCells]);\n return _this;\n }\n DayGrid.prototype.render = function (props, context) {\n var cells = props.cells;\n this.rowCnt = cells.length;\n this.colCnt = cells[0].length;\n this.renderCells(cells, props.isRigid);\n this.renderBusinessHours(context, props.businessHourSegs);\n this.renderDateSelection(context, props.dateSelectionSegs);\n this.renderBgEvents(context, props.bgEventSegs);\n this.renderFgEvents(context, props.fgEventSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDrag);\n this.renderEventResize(props.eventResize);\n if (this.segPopoverTile) {\n this.updateSegPopoverTile();\n }\n };\n DayGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderCells.unrender(); // will unrender everything else\n };\n DayGrid.prototype.getCellRange = function (row, col) {\n var start = this.props.cells[row][col].date;\n var end = addDays(start, 1);\n return { start: start, end: end };\n };\n DayGrid.prototype.updateSegPopoverTile = function (date, segs) {\n var ownProps = this.props;\n this.segPopoverTile.receiveProps({\n date: date || this.segPopoverTile.props.date,\n fgSegs: segs || this.segPopoverTile.props.fgSegs,\n eventSelection: ownProps.eventSelection,\n eventDragInstances: ownProps.eventDrag ? ownProps.eventDrag.affectedInstances : null,\n eventResizeInstances: ownProps.eventResize ? ownProps.eventResize.affectedInstances : null\n }, this.context);\n };\n /* Date Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderCells = function (cells, isRigid) {\n var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, dateEnv = _a.dateEnv;\n var _b = this, rowCnt = _b.rowCnt, colCnt = _b.colCnt;\n var html = '';\n var row;\n var col;\n for (row = 0; row < rowCnt; row++) {\n html += this.renderDayRowHtml(row, isRigid);\n }\n this.el.innerHTML = html;\n this.rowEls = findElements(this.el, '.fc-row');\n this.cellEls = findElements(this.el, '.fc-day, .fc-disabled-day');\n if (isRtl) {\n this.cellEls.reverse();\n }\n this.rowPositions = new PositionCache(this.el, this.rowEls, false, true // vertical\n );\n this.colPositions = new PositionCache(this.el, this.cellEls.slice(0, colCnt), // only the first row\n true, false // horizontal\n );\n // trigger dayRender with each cell's element\n for (row = 0; row < rowCnt; row++) {\n for (col = 0; col < colCnt; col++) {\n calendar.publiclyTrigger('dayRender', [\n {\n date: dateEnv.toDate(cells[row][col].date),\n el: this.getCellEl(row, col),\n view: view\n }\n ]);\n }\n }\n this.isCellSizesDirty = true;\n };\n DayGrid.prototype._unrenderCells = function () {\n this.removeSegPopover();\n };\n // Generates the HTML for a single row, which is a div that wraps a table.\n // `row` is the row number.\n DayGrid.prototype.renderDayRowHtml = function (row, isRigid) {\n var theme = this.context.theme;\n var classes = ['fc-row', 'fc-week', theme.getClass('dayRow')];\n if (isRigid) {\n classes.push('fc-rigid');\n }\n var bgRow = new DayBgRow(this.context);\n return '' +\n '
' +\n '
' +\n '' +\n bgRow.renderHtml({\n cells: this.props.cells[row],\n dateProfile: this.props.dateProfile,\n renderIntroHtml: this.renderProps.renderBgIntroHtml\n }) +\n '
' +\n '
' +\n '
' +\n '' +\n (this.getIsNumbersVisible() ?\n '' +\n this.renderNumberTrHtml(row) +\n '' :\n '') +\n '
' +\n '
' +\n '
';\n };\n DayGrid.prototype.getIsNumbersVisible = function () {\n return this.getIsDayNumbersVisible() ||\n this.renderProps.cellWeekNumbersVisible ||\n this.renderProps.colWeekNumbersVisible;\n };\n DayGrid.prototype.getIsDayNumbersVisible = function () {\n return this.rowCnt > 1;\n };\n /* Grid Number Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.renderNumberTrHtml = function (row) {\n var isRtl = this.context.isRtl;\n var intro = this.renderProps.renderNumberIntroHtml(row, this);\n return '' +\n '' +\n (isRtl ? '' : intro) +\n this.renderNumberCellsHtml(row) +\n (isRtl ? intro : '') +\n '';\n };\n DayGrid.prototype.renderNumberCellsHtml = function (row) {\n var htmls = [];\n var col;\n var date;\n for (col = 0; col < this.colCnt; col++) {\n date = this.props.cells[row][col].date;\n htmls.push(this.renderNumberCellHtml(date));\n }\n if (this.context.isRtl) {\n htmls.reverse();\n }\n return htmls.join('');\n };\n // Generates the HTML for the s of the \"number\" row in the DayGrid's content skeleton.\n // The number row will only exist if either day numbers or week numbers are turned on.\n DayGrid.prototype.renderNumberCellHtml = function (date) {\n var _a = this.context, dateEnv = _a.dateEnv, options = _a.options;\n var html = '';\n var isDateValid = rangeContainsMarker(this.props.dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.\n var isDayNumberVisible = this.getIsDayNumbersVisible() && isDateValid;\n var classes;\n var weekCalcFirstDow;\n if (!isDayNumberVisible && !this.renderProps.cellWeekNumbersVisible) {\n // no numbers in day cell (week number must be along the side)\n return ''; // will create an empty space above events :(\n }\n classes = getDayClasses(date, this.props.dateProfile, this.context);\n classes.unshift('fc-day-top');\n if (this.renderProps.cellWeekNumbersVisible) {\n weekCalcFirstDow = dateEnv.weekDow;\n }\n html += '';\n if (this.renderProps.cellWeekNumbersVisible && (date.getUTCDay() === weekCalcFirstDow)) {\n html += buildGotoAnchorHtml(options, dateEnv, { date: date, type: 'week' }, { 'class': 'fc-week-number' }, dateEnv.format(date, WEEK_NUM_FORMAT) // inner HTML\n );\n }\n if (isDayNumberVisible) {\n html += buildGotoAnchorHtml(options, dateEnv, date, { 'class': 'fc-day-number' }, dateEnv.format(date, DAY_NUM_FORMAT) // inner HTML\n );\n }\n html += '';\n return html;\n };\n /* Sizing\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.updateSize = function (isResize) {\n var calendar = this.context.calendar;\n var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;\n if (isResize ||\n this.isCellSizesDirty ||\n calendar.isEventsUpdated // hack\n ) {\n this.buildPositionCaches();\n this.isCellSizesDirty = false;\n }\n fillRenderer.computeSizes(isResize);\n eventRenderer.computeSizes(isResize);\n mirrorRenderer.computeSizes(isResize);\n fillRenderer.assignSizes(isResize);\n eventRenderer.assignSizes(isResize);\n mirrorRenderer.assignSizes(isResize);\n };\n DayGrid.prototype.buildPositionCaches = function () {\n this.buildColPositions();\n this.buildRowPositions();\n };\n DayGrid.prototype.buildColPositions = function () {\n this.colPositions.build();\n };\n DayGrid.prototype.buildRowPositions = function () {\n this.rowPositions.build();\n this.rowPositions.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack\n };\n /* Hit System\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.positionToHit = function (leftPosition, topPosition) {\n var _a = this, colPositions = _a.colPositions, rowPositions = _a.rowPositions;\n var col = colPositions.leftToIndex(leftPosition);\n var row = rowPositions.topToIndex(topPosition);\n if (row != null && col != null) {\n return {\n row: row,\n col: col,\n dateSpan: {\n range: this.getCellRange(row, col),\n allDay: true\n },\n dayEl: this.getCellEl(row, col),\n relativeRect: {\n left: colPositions.lefts[col],\n right: colPositions.rights[col],\n top: rowPositions.tops[row],\n bottom: rowPositions.bottoms[row]\n }\n };\n }\n };\n /* Cell System\n ------------------------------------------------------------------------------------------------------------------*/\n // FYI: the first column is the leftmost column, regardless of date\n DayGrid.prototype.getCellEl = function (row, col) {\n return this.cellEls[row * this.colCnt + col];\n };\n /* Event Drag Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.fillRenderer.renderSegs('highlight', this.context, state.segs);\n }\n };\n DayGrid.prototype._unrenderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.fillRenderer.unrender('highlight', this.context);\n }\n };\n /* Event Resize Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderEventResize = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.fillRenderer.renderSegs('highlight', this.context, state.segs);\n this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n DayGrid.prototype._unrenderEventResize = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.fillRenderer.unrender('highlight', this.context);\n this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n /* More+ Link Popover\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.removeSegPopover = function () {\n if (this.segPopover) {\n this.segPopover.hide(); // in handler, will call segPopover's removeElement\n }\n };\n // Limits the number of \"levels\" (vertically stacking layers of events) for each row of the grid.\n // `levelLimit` can be false (don't limit), a number, or true (should be computed).\n DayGrid.prototype.limitRows = function (levelLimit) {\n var rowStructs = this.eventRenderer.rowStructs || [];\n var row; // row #\n var rowLevelLimit;\n for (row = 0; row < rowStructs.length; row++) {\n this.unlimitRow(row);\n if (!levelLimit) {\n rowLevelLimit = false;\n }\n else if (typeof levelLimit === 'number') {\n rowLevelLimit = levelLimit;\n }\n else {\n rowLevelLimit = this.computeRowLevelLimit(row);\n }\n if (rowLevelLimit !== false) {\n this.limitRow(row, rowLevelLimit);\n }\n }\n };\n // Computes the number of levels a row will accomodate without going outside its bounds.\n // Assumes the row is \"rigid\" (maintains a constant height regardless of what is inside).\n // `row` is the row number.\n DayGrid.prototype.computeRowLevelLimit = function (row) {\n var rowEl = this.rowEls[row]; // the containing \"fake\" row div\n var rowBottom = rowEl.getBoundingClientRect().bottom; // relative to viewport!\n var trEls = findChildren(this.eventRenderer.rowStructs[row].tbodyEl);\n var i;\n var trEl;\n // Reveal one level at a time and stop when we find one out of bounds\n for (i = 0; i < trEls.length; i++) {\n trEl = trEls[i];\n trEl.classList.remove('fc-limited'); // reset to original state (reveal)\n if (trEl.getBoundingClientRect().bottom > rowBottom) {\n return i;\n }\n }\n return false; // should not limit at all\n };\n // Limits the given grid row to the maximum number of levels and injects \"more\" links if necessary.\n // `row` is the row number.\n // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.\n DayGrid.prototype.limitRow = function (row, levelLimit) {\n var _this = this;\n var colCnt = this.colCnt;\n var isRtl = this.context.isRtl;\n var rowStruct = this.eventRenderer.rowStructs[row];\n var moreNodes = []; // array of \"more\" links and DOM nodes\n var col = 0; // col #, left-to-right (not chronologically)\n var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right\n var cellMatrix; // a matrix (by level, then column) of all elements in the row\n var limitedNodes; // array of temporarily hidden level and segment DOM nodes\n var i;\n var seg;\n var segsBelow; // array of segment objects below `seg` in the current `col`\n var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies\n var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)\n var td;\n var rowSpan;\n var segMoreNodes; // array of \"more\" cells that will stand-in for the current seg's cell\n var j;\n var moreTd;\n var moreWrap;\n var moreLink;\n // Iterates through empty level cells and places \"more\" links inside if need be\n var emptyCellsUntil = function (endCol) {\n while (col < endCol) {\n segsBelow = _this.getCellSegs(row, col, levelLimit);\n if (segsBelow.length) {\n td = cellMatrix[levelLimit - 1][col];\n moreLink = _this.renderMoreLink(row, col, segsBelow);\n moreWrap = createElement('div', null, moreLink);\n td.appendChild(moreWrap);\n moreNodes.push(moreWrap);\n }\n col++;\n }\n };\n if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit?\n levelSegs = rowStruct.segLevels[levelLimit - 1];\n cellMatrix = rowStruct.cellMatrix;\n limitedNodes = findChildren(rowStruct.tbodyEl).slice(levelLimit); // get level elements past the limit\n limitedNodes.forEach(function (node) {\n node.classList.add('fc-limited'); // hide elements and get a simple DOM-nodes array\n });\n // iterate though segments in the last allowable level\n for (i = 0; i < levelSegs.length; i++) {\n seg = levelSegs[i];\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n emptyCellsUntil(leftCol); // process empty cells before the segment\n // determine *all* segments below `seg` that occupy the same columns\n colSegsBelow = [];\n totalSegsBelow = 0;\n while (col <= rightCol) {\n segsBelow = this.getCellSegs(row, col, levelLimit);\n colSegsBelow.push(segsBelow);\n totalSegsBelow += segsBelow.length;\n col++;\n }\n if (totalSegsBelow) { // do we need to replace this segment with one or many \"more\" links?\n td = cellMatrix[levelLimit - 1][leftCol]; // the segment's parent cell\n rowSpan = td.rowSpan || 1;\n segMoreNodes = [];\n // make a replacement for each column the segment occupies. will be one for each colspan\n for (j = 0; j < colSegsBelow.length; j++) {\n moreTd = createElement('td', { className: 'fc-more-cell', rowSpan: rowSpan });\n segsBelow = colSegsBelow[j];\n moreLink = this.renderMoreLink(row, leftCol + j, [seg].concat(segsBelow) // count seg as hidden too\n );\n moreWrap = createElement('div', null, moreLink);\n moreTd.appendChild(moreWrap);\n segMoreNodes.push(moreTd);\n moreNodes.push(moreTd);\n }\n td.classList.add('fc-limited');\n insertAfterElement(td, segMoreNodes);\n limitedNodes.push(td);\n }\n }\n emptyCellsUntil(this.colCnt); // finish off the level\n rowStruct.moreEls = moreNodes; // for easy undoing later\n rowStruct.limitedEls = limitedNodes; // for easy undoing later\n }\n };\n // Reveals all levels and removes all \"more\"-related elements for a grid's row.\n // `row` is a row number.\n DayGrid.prototype.unlimitRow = function (row) {\n var rowStruct = this.eventRenderer.rowStructs[row];\n if (rowStruct.moreEls) {\n rowStruct.moreEls.forEach(removeElement);\n rowStruct.moreEls = null;\n }\n if (rowStruct.limitedEls) {\n rowStruct.limitedEls.forEach(function (limitedEl) {\n limitedEl.classList.remove('fc-limited');\n });\n rowStruct.limitedEls = null;\n }\n };\n // Renders an element that represents hidden event element for a cell.\n // Responsible for attaching click handler as well.\n DayGrid.prototype.renderMoreLink = function (row, col, hiddenSegs) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, view = _a.view, dateEnv = _a.dateEnv, options = _a.options, isRtl = _a.isRtl;\n var a = createElement('a', { className: 'fc-more' });\n a.innerText = this.getMoreLinkText(hiddenSegs.length);\n a.addEventListener('click', function (ev) {\n var clickOption = options.eventLimitClick;\n var _col = isRtl ? _this.colCnt - col - 1 : col; // HACK: props.cells has different dir system?\n var date = _this.props.cells[row][_col].date;\n var moreEl = ev.currentTarget;\n var dayEl = _this.getCellEl(row, col);\n var allSegs = _this.getCellSegs(row, col);\n // rescope the segments to be within the cell's date\n var reslicedAllSegs = _this.resliceDaySegs(allSegs, date);\n var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date);\n if (typeof clickOption === 'function') {\n // the returned value can be an atomic option\n clickOption = calendar.publiclyTrigger('eventLimitClick', [\n {\n date: dateEnv.toDate(date),\n allDay: true,\n dayEl: dayEl,\n moreEl: moreEl,\n segs: reslicedAllSegs,\n hiddenSegs: reslicedHiddenSegs,\n jsEvent: ev,\n view: view\n }\n ]);\n }\n if (clickOption === 'popover') {\n _this.showSegPopover(row, col, moreEl, reslicedAllSegs);\n }\n else if (typeof clickOption === 'string') { // a view name\n calendar.zoomTo(date, clickOption);\n }\n });\n return a;\n };\n // Reveals the popover that displays all events within a cell\n DayGrid.prototype.showSegPopover = function (row, col, moreLink, segs) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, view = _a.view, theme = _a.theme, isRtl = _a.isRtl;\n var _col = isRtl ? this.colCnt - col - 1 : col; // HACK: props.cells has different dir system?\n var moreWrap = moreLink.parentNode; // the
wrapper around the \n var topEl; // the element we want to match the top coordinate of\n var options;\n if (this.rowCnt === 1) {\n topEl = view.el; // will cause the popover to cover any sort of header\n }\n else {\n topEl = this.rowEls[row]; // will align with top of row\n }\n options = {\n className: 'fc-more-popover ' + theme.getClass('popover'),\n parentEl: view.el,\n top: computeRect(topEl).top,\n autoHide: true,\n content: function (el) {\n _this.segPopoverTile = new DayTile(el);\n _this.updateSegPopoverTile(_this.props.cells[row][_col].date, segs);\n },\n hide: function () {\n _this.segPopoverTile.destroy();\n _this.segPopoverTile = null;\n _this.segPopover.destroy();\n _this.segPopover = null;\n }\n };\n // Determine horizontal coordinate.\n // We use the moreWrap instead of the to avoid border confusion.\n if (isRtl) {\n options.right = computeRect(moreWrap).right + 1; // +1 to be over cell border\n }\n else {\n options.left = computeRect(moreWrap).left - 1; // -1 to be over cell border\n }\n this.segPopover = new Popover(options);\n this.segPopover.show();\n calendar.releaseAfterSizingTriggers(); // hack for eventPositioned\n };\n // Given the events within an array of segment objects, reslice them to be in a single day\n DayGrid.prototype.resliceDaySegs = function (segs, dayDate) {\n var dayStart = dayDate;\n var dayEnd = addDays(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = intersectRanges(origRange, dayRange);\n if (slicedRange) {\n newSegs.push(__assign({}, seg, { eventRange: {\n def: eventRange.def,\n ui: __assign({}, eventRange.ui, { durationEditable: false }),\n instance: eventRange.instance,\n range: slicedRange\n }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() }));\n }\n }\n return newSegs;\n };\n // Generates the text that should be inside a \"more\" link, given the number of events it represents\n DayGrid.prototype.getMoreLinkText = function (num) {\n var opt = this.context.options.eventLimitText;\n if (typeof opt === 'function') {\n return opt(num);\n }\n else {\n return '+' + num + ' ' + opt;\n }\n };\n // Returns segments within a given cell.\n // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.\n DayGrid.prototype.getCellSegs = function (row, col, startLevel) {\n var segMatrix = this.eventRenderer.rowStructs[row].segMatrix;\n var level = startLevel || 0;\n var segs = [];\n var seg;\n while (level < segMatrix.length) {\n seg = segMatrix[level][col];\n if (seg) {\n segs.push(seg);\n }\n level++;\n }\n return segs;\n };\n return DayGrid;\n}(DateComponent));\n\nvar WEEK_NUM_FORMAT$1 = createFormatter({ week: 'numeric' });\n/* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.\n----------------------------------------------------------------------------------------------------------------------*/\n// It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.\n// It is responsible for managing width/height.\nvar AbstractDayGridView = /** @class */ (function (_super) {\n __extends(AbstractDayGridView, _super);\n function AbstractDayGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.processOptions = memoize(_this._processOptions);\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n /* Header Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before the day-of week header cells\n _this.renderHeadIntroHtml = function () {\n var _a = _this.context, theme = _a.theme, options = _a.options;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '' +\n '' + // needed for matchCellWidths\n htmlEscape(options.weekLabel) +\n '' +\n '';\n }\n return '';\n };\n /* Day Grid Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before content-skeleton cells that display the day/week numbers\n _this.renderDayGridNumberIntroHtml = function (row, dayGrid) {\n var _a = _this.context, options = _a.options, dateEnv = _a.dateEnv;\n var weekStart = dayGrid.props.cells[row][0].date;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '' +\n buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n options, dateEnv, { date: weekStart, type: 'week', forceOff: dayGrid.colCnt === 1 }, dateEnv.format(weekStart, WEEK_NUM_FORMAT$1) // inner HTML\n ) +\n '';\n }\n return '';\n };\n // Generates the HTML that goes before the day bg cells for each day-row\n _this.renderDayGridBgIntroHtml = function () {\n var theme = _this.context.theme;\n if (_this.colWeekNumbersVisible) {\n return '';\n }\n return '';\n };\n // Generates the HTML that goes before every other type of row generated by DayGrid.\n // Affects mirror-skeleton and highlight-skeleton rows.\n _this.renderDayGridIntroHtml = function () {\n if (_this.colWeekNumbersVisible) {\n return '';\n }\n return '';\n };\n return _this;\n }\n AbstractDayGridView.prototype._processOptions = function (options) {\n if (options.weekNumbers) {\n if (options.weekNumbersWithinDays) {\n this.cellWeekNumbersVisible = true;\n this.colWeekNumbersVisible = false;\n }\n else {\n this.cellWeekNumbersVisible = false;\n this.colWeekNumbersVisible = true;\n }\n }\n else {\n this.colWeekNumbersVisible = false;\n this.cellWeekNumbersVisible = false;\n }\n };\n AbstractDayGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context);\n this.processOptions(context.options);\n this.renderSkeleton(context);\n };\n AbstractDayGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n AbstractDayGridView.prototype._renderSkeleton = function (context) {\n this.el.classList.add('fc-dayGrid-view');\n this.el.innerHTML = this.renderSkeletonHtml();\n this.scroller = new ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n var dayGridContainerEl = this.scroller.el;\n this.el.querySelector('.fc-body > tr > td').appendChild(dayGridContainerEl);\n dayGridContainerEl.classList.add('fc-day-grid-container');\n var dayGridEl = createElement('div', { className: 'fc-day-grid' });\n dayGridContainerEl.appendChild(dayGridEl);\n this.dayGrid = new DayGrid(dayGridEl, {\n renderNumberIntroHtml: this.renderDayGridNumberIntroHtml,\n renderBgIntroHtml: this.renderDayGridBgIntroHtml,\n renderIntroHtml: this.renderDayGridIntroHtml,\n colWeekNumbersVisible: this.colWeekNumbersVisible,\n cellWeekNumbersVisible: this.cellWeekNumbersVisible\n });\n };\n AbstractDayGridView.prototype._unrenderSkeleton = function () {\n this.el.classList.remove('fc-dayGrid-view');\n this.dayGrid.destroy();\n this.scroller.destroy();\n };\n // Builds the HTML skeleton for the view.\n // The day-grid component will render inside of a container defined by this HTML.\n AbstractDayGridView.prototype.renderSkeletonHtml = function () {\n var _a = this.context, theme = _a.theme, options = _a.options;\n return '' +\n '' +\n (options.columnHeader ?\n '' +\n '' +\n '' +\n '' +\n '' :\n '') +\n '' +\n '' +\n '' +\n '' +\n '' +\n '
 
';\n };\n // Generates an HTML attribute string for setting the width of the week number column, if it is known\n AbstractDayGridView.prototype.weekNumberStyleAttr = function () {\n if (this.weekNumberWidth != null) {\n return 'style=\"width:' + this.weekNumberWidth + 'px\"';\n }\n return '';\n };\n // Determines whether each row should have a constant height\n AbstractDayGridView.prototype.hasRigidRows = function () {\n var eventLimit = this.context.options.eventLimit;\n return eventLimit && typeof eventLimit !== 'number';\n };\n /* Dimensions\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractDayGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first\n this.dayGrid.updateSize(isResize);\n };\n // Refreshes the horizontal dimensions of the view\n AbstractDayGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n var dayGrid = this.dayGrid;\n var eventLimit = this.context.options.eventLimit;\n var headRowEl = this.header ? this.header.el : null; // HACK\n var scrollerHeight;\n var scrollbarWidths;\n // hack to give the view some height prior to dayGrid's columns being rendered\n // TODO: separate setting height from scroller VS dayGrid.\n if (!dayGrid.rowEls) {\n if (!isAuto) {\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n return;\n }\n if (this.colWeekNumbersVisible) {\n // Make sure all week number cells running down the side have the same width.\n this.weekNumberWidth = matchCellWidths(findElements(this.el, '.fc-week-number'));\n }\n // reset all heights to be natural\n this.scroller.clear();\n if (headRowEl) {\n uncompensateScroll(headRowEl);\n }\n dayGrid.removeSegPopover(); // kill the \"more\" popover if displayed\n // is the event limit a constant level number?\n if (eventLimit && typeof eventLimit === 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after\n }\n // distribute the height to the rows\n // (viewHeight is a \"recommended\" value if isAuto)\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.setGridHeight(scrollerHeight, isAuto);\n // is the event limit dynamically calculated?\n if (eventLimit && typeof eventLimit !== 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set\n }\n if (!isAuto) { // should we force dimensions of the scroll container?\n this.scroller.setHeight(scrollerHeight);\n scrollbarWidths = this.scroller.getScrollbarWidths();\n if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?\n if (headRowEl) {\n compensateScroll(headRowEl, scrollbarWidths);\n }\n // doing the scrollbar compensation might have created text overflow which created more height. redo\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n // guarantees the same scrollbar widths\n this.scroller.lockOverflow(scrollbarWidths);\n }\n };\n // given a desired total height of the view, returns what the height of the scroller should be\n AbstractDayGridView.prototype.computeScrollerHeight = function (viewHeight) {\n return viewHeight -\n subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller\n };\n // Sets the height of just the DayGrid component in this view\n AbstractDayGridView.prototype.setGridHeight = function (height, isAuto) {\n if (this.context.options.monthMode) {\n // if auto, make the height of each row the height that it would be if there were 6 weeks\n if (isAuto) {\n height *= this.dayGrid.rowCnt / 6;\n }\n distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows\n }\n else {\n if (isAuto) {\n undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding\n }\n else {\n distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows\n }\n }\n };\n /* Scroll\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractDayGridView.prototype.computeDateScroll = function (duration) {\n return { top: 0 };\n };\n AbstractDayGridView.prototype.queryDateScroll = function () {\n return { top: this.scroller.getScrollTop() };\n };\n AbstractDayGridView.prototype.applyDateScroll = function (scroll) {\n if (scroll.top !== undefined) {\n this.scroller.setScrollTop(scroll.top);\n }\n };\n return AbstractDayGridView;\n}(View));\nAbstractDayGridView.prototype.dateProfileGeneratorClass = DayGridDateProfileGenerator;\n\nvar SimpleDayGrid = /** @class */ (function (_super) {\n __extends(SimpleDayGrid, _super);\n function SimpleDayGrid(dayGrid) {\n var _this = _super.call(this, dayGrid.el) || this;\n _this.slicer = new DayGridSlicer();\n _this.dayGrid = dayGrid;\n return _this;\n }\n SimpleDayGrid.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, { el: this.dayGrid.el });\n };\n SimpleDayGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n SimpleDayGrid.prototype.render = function (props, context) {\n var dayGrid = this.dayGrid;\n var dateProfile = props.dateProfile, dayTable = props.dayTable;\n dayGrid.receiveContext(context); // hack because context is used in sliceProps\n dayGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, props.nextDayThreshold, context.calendar, dayGrid, dayTable), { dateProfile: dateProfile, cells: dayTable.cells, isRigid: props.isRigid }), context);\n };\n SimpleDayGrid.prototype.buildPositionCaches = function () {\n this.dayGrid.buildPositionCaches();\n };\n SimpleDayGrid.prototype.queryHit = function (positionLeft, positionTop) {\n var rawHit = this.dayGrid.positionToHit(positionLeft, positionTop);\n if (rawHit) {\n return {\n component: this.dayGrid,\n dateSpan: rawHit.dateSpan,\n dayEl: rawHit.dayEl,\n rect: {\n left: rawHit.relativeRect.left,\n right: rawHit.relativeRect.right,\n top: rawHit.relativeRect.top,\n bottom: rawHit.relativeRect.bottom\n },\n layer: 0\n };\n }\n };\n return SimpleDayGrid;\n}(DateComponent));\nvar DayGridSlicer = /** @class */ (function (_super) {\n __extends(DayGridSlicer, _super);\n function DayGridSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridSlicer.prototype.sliceRange = function (dateRange, dayTable) {\n return dayTable.sliceRange(dateRange);\n };\n return DayGridSlicer;\n}(Slicer));\n\nvar DayGridView = /** @class */ (function (_super) {\n __extends(DayGridView, _super);\n function DayGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDayTable = memoize(buildDayTable);\n return _this;\n }\n DayGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context); // will call _renderSkeleton/_unrenderSkeleton\n var dateProfile = this.props.dateProfile;\n var dayTable = this.dayTable =\n this.buildDayTable(dateProfile, props.dateProfileGenerator);\n if (this.header) {\n this.header.receiveProps({\n dateProfile: dateProfile,\n dates: dayTable.headerDates,\n datesRepDistinctDays: dayTable.rowCnt === 1,\n renderIntroHtml: this.renderHeadIntroHtml\n }, context);\n }\n this.simpleDayGrid.receiveProps({\n dateProfile: dateProfile,\n dayTable: dayTable,\n businessHours: props.businessHours,\n dateSelection: props.dateSelection,\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize,\n isRigid: this.hasRigidRows(),\n nextDayThreshold: this.context.nextDayThreshold\n }, context);\n };\n DayGridView.prototype._renderSkeleton = function (context) {\n _super.prototype._renderSkeleton.call(this, context);\n if (context.options.columnHeader) {\n this.header = new DayHeader(this.el.querySelector('.fc-head-container'));\n }\n this.simpleDayGrid = new SimpleDayGrid(this.dayGrid);\n };\n DayGridView.prototype._unrenderSkeleton = function () {\n _super.prototype._unrenderSkeleton.call(this);\n if (this.header) {\n this.header.destroy();\n }\n this.simpleDayGrid.destroy();\n };\n return DayGridView;\n}(AbstractDayGridView));\nfunction buildDayTable(dateProfile, dateProfileGenerator) {\n var daySeries = new DaySeries(dateProfile.renderRange, dateProfileGenerator);\n return new DayTable(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));\n}\n\nvar main = createPlugin({\n defaultView: 'dayGridMonth',\n views: {\n dayGrid: DayGridView,\n dayGridDay: {\n type: 'dayGrid',\n duration: { days: 1 }\n },\n dayGridWeek: {\n type: 'dayGrid',\n duration: { weeks: 1 }\n },\n dayGridMonth: {\n type: 'dayGrid',\n duration: { months: 1 },\n monthMode: true,\n fixedWeekCount: true\n }\n }\n});\n\nexport default main;\nexport { AbstractDayGridView, DayBgRow, DayGrid, DayGridSlicer, DayGridView, SimpleDayGrid, buildDayTable as buildBasicDayTable };\n","/**\n * Outlayer Item\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD - RequireJS\n define( [\n 'ev-emitter/ev-emitter',\n 'get-size/get-size'\n ],\n factory\n );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS - Browserify, Webpack\n module.exports = factory(\n require('ev-emitter'),\n require('get-size')\n );\n } else {\n // browser global\n window.Outlayer = {};\n window.Outlayer.Item = factory(\n window.EvEmitter,\n window.getSize\n );\n }\n\n}( window, function factory( EvEmitter, getSize ) {\n'use strict';\n\n// ----- helpers ----- //\n\nfunction isEmptyObj( obj ) {\n for ( var prop in obj ) {\n return false;\n }\n prop = null;\n return true;\n}\n\n// -------------------------- CSS3 support -------------------------- //\n\n\nvar docElemStyle = document.documentElement.style;\n\nvar transitionProperty = typeof docElemStyle.transition == 'string' ?\n 'transition' : 'WebkitTransition';\nvar transformProperty = typeof docElemStyle.transform == 'string' ?\n 'transform' : 'WebkitTransform';\n\nvar transitionEndEvent = {\n WebkitTransition: 'webkitTransitionEnd',\n transition: 'transitionend'\n}[ transitionProperty ];\n\n// cache all vendor properties that could have vendor prefix\nvar vendorProperties = {\n transform: transformProperty,\n transition: transitionProperty,\n transitionDuration: transitionProperty + 'Duration',\n transitionProperty: transitionProperty + 'Property',\n transitionDelay: transitionProperty + 'Delay'\n};\n\n// -------------------------- Item -------------------------- //\n\nfunction Item( element, layout ) {\n if ( !element ) {\n return;\n }\n\n this.element = element;\n // parent layout class, i.e. Masonry, Isotope, or Packery\n this.layout = layout;\n this.position = {\n x: 0,\n y: 0\n };\n\n this._create();\n}\n\n// inherit EvEmitter\nvar proto = Item.prototype = Object.create( EvEmitter.prototype );\nproto.constructor = Item;\n\nproto._create = function() {\n // transition objects\n this._transn = {\n ingProperties: {},\n clean: {},\n onEnd: {}\n };\n\n this.css({\n position: 'absolute'\n });\n};\n\n// trigger specified handler for event type\nproto.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\nproto.getSize = function() {\n this.size = getSize( this.element );\n};\n\n/**\n * apply CSS styles to element\n * @param {Object} style\n */\nproto.css = function( style ) {\n var elemStyle = this.element.style;\n\n for ( var prop in style ) {\n // use vendor property if available\n var supportedProp = vendorProperties[ prop ] || prop;\n elemStyle[ supportedProp ] = style[ prop ];\n }\n};\n\n // measure position, and sets it\nproto.getPosition = function() {\n var style = getComputedStyle( this.element );\n var isOriginLeft = this.layout._getOption('originLeft');\n var isOriginTop = this.layout._getOption('originTop');\n var xValue = style[ isOriginLeft ? 'left' : 'right' ];\n var yValue = style[ isOriginTop ? 'top' : 'bottom' ];\n var x = parseFloat( xValue );\n var y = parseFloat( yValue );\n // convert percent to pixels\n var layoutSize = this.layout.size;\n if ( xValue.indexOf('%') != -1 ) {\n x = ( x / 100 ) * layoutSize.width;\n }\n if ( yValue.indexOf('%') != -1 ) {\n y = ( y / 100 ) * layoutSize.height;\n }\n // clean up 'auto' or other non-integer values\n x = isNaN( x ) ? 0 : x;\n y = isNaN( y ) ? 0 : y;\n // remove padding from measurement\n x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight;\n y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom;\n\n this.position.x = x;\n this.position.y = y;\n};\n\n// set settled position, apply padding\nproto.layoutPosition = function() {\n var layoutSize = this.layout.size;\n var style = {};\n var isOriginLeft = this.layout._getOption('originLeft');\n var isOriginTop = this.layout._getOption('originTop');\n\n // x\n var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight';\n var xProperty = isOriginLeft ? 'left' : 'right';\n var xResetProperty = isOriginLeft ? 'right' : 'left';\n\n var x = this.position.x + layoutSize[ xPadding ];\n // set in percentage or pixels\n style[ xProperty ] = this.getXValue( x );\n // reset other property\n style[ xResetProperty ] = '';\n\n // y\n var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom';\n var yProperty = isOriginTop ? 'top' : 'bottom';\n var yResetProperty = isOriginTop ? 'bottom' : 'top';\n\n var y = this.position.y + layoutSize[ yPadding ];\n // set in percentage or pixels\n style[ yProperty ] = this.getYValue( y );\n // reset other property\n style[ yResetProperty ] = '';\n\n this.css( style );\n this.emitEvent( 'layout', [ this ] );\n};\n\nproto.getXValue = function( x ) {\n var isHorizontal = this.layout._getOption('horizontal');\n return this.layout.options.percentPosition && !isHorizontal ?\n ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px';\n};\n\nproto.getYValue = function( y ) {\n var isHorizontal = this.layout._getOption('horizontal');\n return this.layout.options.percentPosition && isHorizontal ?\n ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px';\n};\n\nproto._transitionTo = function( x, y ) {\n this.getPosition();\n // get current x & y from top/left\n var curX = this.position.x;\n var curY = this.position.y;\n\n var didNotMove = x == this.position.x && y == this.position.y;\n\n // save end position\n this.setPosition( x, y );\n\n // if did not move and not transitioning, just go to layout\n if ( didNotMove && !this.isTransitioning ) {\n this.layoutPosition();\n return;\n }\n\n var transX = x - curX;\n var transY = y - curY;\n var transitionStyle = {};\n transitionStyle.transform = this.getTranslate( transX, transY );\n\n this.transition({\n to: transitionStyle,\n onTransitionEnd: {\n transform: this.layoutPosition\n },\n isCleaning: true\n });\n};\n\nproto.getTranslate = function( x, y ) {\n // flip cooridinates if origin on right or bottom\n var isOriginLeft = this.layout._getOption('originLeft');\n var isOriginTop = this.layout._getOption('originTop');\n x = isOriginLeft ? x : -x;\n y = isOriginTop ? y : -y;\n return 'translate3d(' + x + 'px, ' + y + 'px, 0)';\n};\n\n// non transition + transform support\nproto.goTo = function( x, y ) {\n this.setPosition( x, y );\n this.layoutPosition();\n};\n\nproto.moveTo = proto._transitionTo;\n\nproto.setPosition = function( x, y ) {\n this.position.x = parseFloat( x );\n this.position.y = parseFloat( y );\n};\n\n// ----- transition ----- //\n\n/**\n * @param {Object} style - CSS\n * @param {Function} onTransitionEnd\n */\n\n// non transition, just trigger callback\nproto._nonTransition = function( args ) {\n this.css( args.to );\n if ( args.isCleaning ) {\n this._removeStyles( args.to );\n }\n for ( var prop in args.onTransitionEnd ) {\n args.onTransitionEnd[ prop ].call( this );\n }\n};\n\n/**\n * proper transition\n * @param {Object} args - arguments\n * @param {Object} to - style to transition to\n * @param {Object} from - style to start transition from\n * @param {Boolean} isCleaning - removes transition styles after transition\n * @param {Function} onTransitionEnd - callback\n */\nproto.transition = function( args ) {\n // redirect to nonTransition if no transition duration\n if ( !parseFloat( this.layout.options.transitionDuration ) ) {\n this._nonTransition( args );\n return;\n }\n\n var _transition = this._transn;\n // keep track of onTransitionEnd callback by css property\n for ( var prop in args.onTransitionEnd ) {\n _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ];\n }\n // keep track of properties that are transitioning\n for ( prop in args.to ) {\n _transition.ingProperties[ prop ] = true;\n // keep track of properties to clean up when transition is done\n if ( args.isCleaning ) {\n _transition.clean[ prop ] = true;\n }\n }\n\n // set from styles\n if ( args.from ) {\n this.css( args.from );\n // force redraw. http://blog.alexmaccaw.com/css-transitions\n var h = this.element.offsetHeight;\n // hack for JSHint to hush about unused var\n h = null;\n }\n // enable transition\n this.enableTransition( args.to );\n // set styles that are transitioning\n this.css( args.to );\n\n this.isTransitioning = true;\n\n};\n\n// dash before all cap letters, including first for\n// WebkitTransform => -webkit-transform\nfunction toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}\n\nvar transitionProps = 'opacity,' + toDashedAll( transformProperty );\n\nproto.enableTransition = function(/* style */) {\n // HACK changing transitionProperty during a transition\n // will cause transition to jump\n if ( this.isTransitioning ) {\n return;\n }\n\n // make `transition: foo, bar, baz` from style object\n // HACK un-comment this when enableTransition can work\n // while a transition is happening\n // var transitionValues = [];\n // for ( var prop in style ) {\n // // dash-ify camelCased properties like WebkitTransition\n // prop = vendorProperties[ prop ] || prop;\n // transitionValues.push( toDashedAll( prop ) );\n // }\n // munge number to millisecond, to match stagger\n var duration = this.layout.options.transitionDuration;\n duration = typeof duration == 'number' ? duration + 'ms' : duration;\n // enable transition styles\n this.css({\n transitionProperty: transitionProps,\n transitionDuration: duration,\n transitionDelay: this.staggerDelay || 0\n });\n // listen for transition end event\n this.element.addEventListener( transitionEndEvent, this, false );\n};\n\n// ----- events ----- //\n\nproto.onwebkitTransitionEnd = function( event ) {\n this.ontransitionend( event );\n};\n\nproto.onotransitionend = function( event ) {\n this.ontransitionend( event );\n};\n\n// properties that I munge to make my life easier\nvar dashedVendorProperties = {\n '-webkit-transform': 'transform'\n};\n\nproto.ontransitionend = function( event ) {\n // disregard bubbled events from children\n if ( event.target !== this.element ) {\n return;\n }\n var _transition = this._transn;\n // get property name of transitioned property, convert to prefix-free\n var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName;\n\n // remove property that has completed transitioning\n delete _transition.ingProperties[ propertyName ];\n // check if any properties are still transitioning\n if ( isEmptyObj( _transition.ingProperties ) ) {\n // all properties have completed transitioning\n this.disableTransition();\n }\n // clean style\n if ( propertyName in _transition.clean ) {\n // clean up style\n this.element.style[ event.propertyName ] = '';\n delete _transition.clean[ propertyName ];\n }\n // trigger onTransitionEnd callback\n if ( propertyName in _transition.onEnd ) {\n var onTransitionEnd = _transition.onEnd[ propertyName ];\n onTransitionEnd.call( this );\n delete _transition.onEnd[ propertyName ];\n }\n\n this.emitEvent( 'transitionEnd', [ this ] );\n};\n\nproto.disableTransition = function() {\n this.removeTransitionStyles();\n this.element.removeEventListener( transitionEndEvent, this, false );\n this.isTransitioning = false;\n};\n\n/**\n * removes style property from element\n * @param {Object} style\n**/\nproto._removeStyles = function( style ) {\n // clean up transition styles\n var cleanStyle = {};\n for ( var prop in style ) {\n cleanStyle[ prop ] = '';\n }\n this.css( cleanStyle );\n};\n\nvar cleanTransitionStyle = {\n transitionProperty: '',\n transitionDuration: '',\n transitionDelay: ''\n};\n\nproto.removeTransitionStyles = function() {\n // remove transition\n this.css( cleanTransitionStyle );\n};\n\n// ----- stagger ----- //\n\nproto.stagger = function( delay ) {\n delay = isNaN( delay ) ? 0 : delay;\n this.staggerDelay = delay + 'ms';\n};\n\n// ----- show/hide/remove ----- //\n\n// remove element from DOM\nproto.removeElem = function() {\n this.element.parentNode.removeChild( this.element );\n // remove display: none\n this.css({ display: '' });\n this.emitEvent( 'remove', [ this ] );\n};\n\nproto.remove = function() {\n // just remove element if no transition support or no transition\n if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) {\n this.removeElem();\n return;\n }\n\n // start transition\n this.once( 'transitionEnd', function() {\n this.removeElem();\n });\n this.hide();\n};\n\nproto.reveal = function() {\n delete this.isHidden;\n // remove display: none\n this.css({ display: '' });\n\n var options = this.layout.options;\n\n var onTransitionEnd = {};\n var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle');\n onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd;\n\n this.transition({\n from: options.hiddenStyle,\n to: options.visibleStyle,\n isCleaning: true,\n onTransitionEnd: onTransitionEnd\n });\n};\n\nproto.onRevealTransitionEnd = function() {\n // check if still visible\n // during transition, item may have been hidden\n if ( !this.isHidden ) {\n this.emitEvent('reveal');\n }\n};\n\n/**\n * get style property use for hide/reveal transition end\n * @param {String} styleProperty - hiddenStyle/visibleStyle\n * @returns {String}\n */\nproto.getHideRevealTransitionEndProperty = function( styleProperty ) {\n var optionStyle = this.layout.options[ styleProperty ];\n // use opacity\n if ( optionStyle.opacity ) {\n return 'opacity';\n }\n // get first property\n for ( var prop in optionStyle ) {\n return prop;\n }\n};\n\nproto.hide = function() {\n // set flag\n this.isHidden = true;\n // remove display: none\n this.css({ display: '' });\n\n var options = this.layout.options;\n\n var onTransitionEnd = {};\n var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle');\n onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd;\n\n this.transition({\n from: options.visibleStyle,\n to: options.hiddenStyle,\n // keep hidden stuff hidden\n isCleaning: true,\n onTransitionEnd: onTransitionEnd\n });\n};\n\nproto.onHideTransitionEnd = function() {\n // check if still hidden\n // during transition, item may have been un-hidden\n if ( this.isHidden ) {\n this.css({ display: 'none' });\n this.emitEvent('hide');\n }\n};\n\nproto.destroy = function() {\n this.css({\n position: '',\n left: '',\n right: '',\n top: '',\n bottom: '',\n transition: '',\n transform: ''\n });\n};\n\nreturn Item;\n\n}));\n","/**\n * Isotope Item\n**/\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'outlayer/outlayer'\n ],\n factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n require('outlayer')\n );\n } else {\n // browser global\n window.Isotope = window.Isotope || {};\n window.Isotope.Item = factory(\n window.Outlayer\n );\n }\n\n}( window, function factory( Outlayer ) {\n'use strict';\n\n// -------------------------- Item -------------------------- //\n\n// sub-class Outlayer Item\nfunction Item() {\n Outlayer.Item.apply( this, arguments );\n}\n\nvar proto = Item.prototype = Object.create( Outlayer.Item.prototype );\n\nvar _create = proto._create;\nproto._create = function() {\n // assign id, used for original-order sorting\n this.id = this.layout.itemGUID++;\n _create.call( this );\n this.sortData = {};\n};\n\nproto.updateSortData = function() {\n if ( this.isIgnored ) {\n return;\n }\n // default sorters\n this.sortData.id = this.id;\n // for backward compatibility\n this.sortData['original-order'] = this.id;\n this.sortData.random = Math.random();\n // go thru getSortData obj and apply the sorters\n var getSortData = this.layout.options.getSortData;\n var sorters = this.layout._sorters;\n for ( var key in getSortData ) {\n var sorter = sorters[ key ];\n this.sortData[ key ] = sorter( this.element, this );\n }\n};\n\nvar _destroy = proto.destroy;\nproto.destroy = function() {\n // call super\n _destroy.apply( this, arguments );\n // reset display, #741\n this.css({\n display: ''\n });\n};\n\nreturn Item;\n\n}));\n","/*!\n * Masonry layout mode\n * sub-classes Masonry\n * https://masonry.desandro.com\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n '../layout-mode',\n 'masonry-layout/masonry'\n ],\n factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n require('../layout-mode'),\n require('masonry-layout')\n );\n } else {\n // browser global\n factory(\n window.Isotope.LayoutMode,\n window.Masonry\n );\n }\n\n}( window, function factory( LayoutMode, Masonry ) {\n'use strict';\n\n// -------------------------- masonryDefinition -------------------------- //\n\n // create an Outlayer layout class\n var MasonryMode = LayoutMode.create('masonry');\n\n var proto = MasonryMode.prototype;\n\n var keepModeMethods = {\n _getElementOffset: true,\n layout: true,\n _getMeasurement: true\n };\n\n // inherit Masonry prototype\n for ( var method in Masonry.prototype ) {\n // do not inherit mode methods\n if ( !keepModeMethods[ method ] ) {\n proto[ method ] = Masonry.prototype[ method ];\n }\n }\n\n var measureColumns = proto.measureColumns;\n proto.measureColumns = function() {\n // set items, used if measuring first item\n this.items = this.isotope.filteredItems;\n measureColumns.call( this );\n };\n\n // point to mode options for fitWidth\n var _getOption = proto._getOption;\n proto._getOption = function( option ) {\n if ( option == 'fitWidth' ) {\n return this.options.isFitWidth !== undefined ?\n this.options.isFitWidth : this.options.fitWidth;\n }\n return _getOption.apply( this.isotope, arguments );\n };\n\n return MasonryMode;\n\n}));\n","/*!\n * Masonry v4.2.2\n * Cascading grid layout library\n * https://masonry.desandro.com\n * MIT License\n * by David DeSandro\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'outlayer/outlayer',\n 'get-size/get-size'\n ],\n factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n require('outlayer'),\n require('get-size')\n );\n } else {\n // browser global\n window.Masonry = factory(\n window.Outlayer,\n window.getSize\n );\n }\n\n}( window, function factory( Outlayer, getSize ) {\n\n'use strict';\n\n// -------------------------- masonryDefinition -------------------------- //\n\n // create an Outlayer layout class\n var Masonry = Outlayer.create('masonry');\n // isFitWidth -> fitWidth\n Masonry.compatOptions.fitWidth = 'isFitWidth';\n\n var proto = Masonry.prototype;\n\n proto._resetLayout = function() {\n this.getSize();\n this._getMeasurement( 'columnWidth', 'outerWidth' );\n this._getMeasurement( 'gutter', 'outerWidth' );\n this.measureColumns();\n\n // reset column Y\n this.colYs = [];\n for ( var i=0; i < this.cols; i++ ) {\n this.colYs.push( 0 );\n }\n\n this.maxY = 0;\n this.horizontalColIndex = 0;\n };\n\n proto.measureColumns = function() {\n this.getContainerWidth();\n // if columnWidth is 0, default to outerWidth of first item\n if ( !this.columnWidth ) {\n var firstItem = this.items[0];\n var firstItemElem = firstItem && firstItem.element;\n // columnWidth fall back to item of first element\n this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth ||\n // if first elem has no width, default to size of container\n this.containerWidth;\n }\n\n var columnWidth = this.columnWidth += this.gutter;\n\n // calculate columns\n var containerWidth = this.containerWidth + this.gutter;\n var cols = containerWidth / columnWidth;\n // fix rounding errors, typically with gutters\n var excess = columnWidth - containerWidth % columnWidth;\n // if overshoot is less than a pixel, round up, otherwise floor it\n var mathMethod = excess && excess < 1 ? 'round' : 'floor';\n cols = Math[ mathMethod ]( cols );\n this.cols = Math.max( cols, 1 );\n };\n\n proto.getContainerWidth = function() {\n // container is parent if fit width\n var isFitWidth = this._getOption('fitWidth');\n var container = isFitWidth ? this.element.parentNode : this.element;\n // check that this.size and size are there\n // IE8 triggers resize on body size change, so they might not be\n var size = getSize( container );\n this.containerWidth = size && size.innerWidth;\n };\n\n proto._getItemLayoutPosition = function( item ) {\n item.getSize();\n // how many columns does this brick span\n var remainder = item.size.outerWidth % this.columnWidth;\n var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil';\n // round if off by 1 pixel, otherwise use ceil\n var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth );\n colSpan = Math.min( colSpan, this.cols );\n // use horizontal or top column position\n var colPosMethod = this.options.horizontalOrder ?\n '_getHorizontalColPosition' : '_getTopColPosition';\n var colPosition = this[ colPosMethod ]( colSpan, item );\n // position the brick\n var position = {\n x: this.columnWidth * colPosition.col,\n y: colPosition.y\n };\n // apply setHeight to necessary columns\n var setHeight = colPosition.y + item.size.outerHeight;\n var setMax = colSpan + colPosition.col;\n for ( var i = colPosition.col; i < setMax; i++ ) {\n this.colYs[i] = setHeight;\n }\n\n return position;\n };\n\n proto._getTopColPosition = function( colSpan ) {\n var colGroup = this._getTopColGroup( colSpan );\n // get the minimum Y value from the columns\n var minimumY = Math.min.apply( Math, colGroup );\n\n return {\n col: colGroup.indexOf( minimumY ),\n y: minimumY,\n };\n };\n\n /**\n * @param {Number} colSpan - number of columns the element spans\n * @returns {Array} colGroup\n */\n proto._getTopColGroup = function( colSpan ) {\n if ( colSpan < 2 ) {\n // if brick spans only one column, use all the column Ys\n return this.colYs;\n }\n\n var colGroup = [];\n // how many different places could this brick fit horizontally\n var groupCount = this.cols + 1 - colSpan;\n // for each group potential horizontal position\n for ( var i = 0; i < groupCount; i++ ) {\n colGroup[i] = this._getColGroupY( i, colSpan );\n }\n return colGroup;\n };\n\n proto._getColGroupY = function( col, colSpan ) {\n if ( colSpan < 2 ) {\n return this.colYs[ col ];\n }\n // make an array of colY values for that one group\n var groupColYs = this.colYs.slice( col, col + colSpan );\n // and get the max value of the array\n return Math.max.apply( Math, groupColYs );\n };\n\n // get column position based on horizontal index. #873\n proto._getHorizontalColPosition = function( colSpan, item ) {\n var col = this.horizontalColIndex % this.cols;\n var isOver = colSpan > 1 && col + colSpan > this.cols;\n // shift to next row if item can't fit on current row\n col = isOver ? 0 : col;\n // don't let zero-size items take up space\n var hasSize = item.size.outerWidth && item.size.outerHeight;\n this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex;\n\n return {\n col: col,\n y: this._getColGroupY( col, colSpan ),\n };\n };\n\n proto._manageStamp = function( stamp ) {\n var stampSize = getSize( stamp );\n var offset = this._getElementOffset( stamp );\n // get the columns that this stamp affects\n var isOriginLeft = this._getOption('originLeft');\n var firstX = isOriginLeft ? offset.left : offset.right;\n var lastX = firstX + stampSize.outerWidth;\n var firstCol = Math.floor( firstX / this.columnWidth );\n firstCol = Math.max( 0, firstCol );\n var lastCol = Math.floor( lastX / this.columnWidth );\n // lastCol should not go over if multiple of columnWidth #425\n lastCol -= lastX % this.columnWidth ? 0 : 1;\n lastCol = Math.min( this.cols - 1, lastCol );\n // set colYs to bottom of the stamp\n\n var isOriginTop = this._getOption('originTop');\n var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) +\n stampSize.outerHeight;\n for ( var i = firstCol; i <= lastCol; i++ ) {\n this.colYs[i] = Math.max( stampMaxY, this.colYs[i] );\n }\n };\n\n proto._getContainerSize = function() {\n this.maxY = Math.max.apply( Math, this.colYs );\n var size = {\n height: this.maxY\n };\n\n if ( this._getOption('fitWidth') ) {\n size.width = this._getContainerFitWidth();\n }\n\n return size;\n };\n\n proto._getContainerFitWidth = function() {\n var unusedCols = 0;\n // count unused columns\n var i = this.cols;\n while ( --i ) {\n if ( this.colYs[i] !== 0 ) {\n break;\n }\n unusedCols++;\n }\n // fit container to columns that have been used\n return ( this.cols - unusedCols ) * this.columnWidth - this.gutter;\n };\n\n proto.needsResizeLayout = function() {\n var previousWidth = this.containerWidth;\n this.getContainerWidth();\n return previousWidth != this.containerWidth;\n };\n\n return Masonry;\n\n}));\n","/**\n * fitRows layout mode\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n '../layout-mode'\n ],\n factory );\n } else if ( typeof exports == 'object' ) {\n // CommonJS\n module.exports = factory(\n require('../layout-mode')\n );\n } else {\n // browser global\n factory(\n window.Isotope.LayoutMode\n );\n }\n\n}( window, function factory( LayoutMode ) {\n'use strict';\n\nvar FitRows = LayoutMode.create('fitRows');\n\nvar proto = FitRows.prototype;\n\nproto._resetLayout = function() {\n this.x = 0;\n this.y = 0;\n this.maxY = 0;\n this._getMeasurement( 'gutter', 'outerWidth' );\n};\n\nproto._getItemLayoutPosition = function( item ) {\n item.getSize();\n\n var itemWidth = item.size.outerWidth + this.gutter;\n // if this element cannot fit in the current row\n var containerWidth = this.isotope.size.innerWidth + this.gutter;\n if ( this.x !== 0 && itemWidth + this.x > containerWidth ) {\n this.x = 0;\n this.y = this.maxY;\n }\n\n var position = {\n x: this.x,\n y: this.y\n };\n\n this.maxY = Math.max( this.maxY, this.y + item.size.outerHeight );\n this.x += itemWidth;\n\n return position;\n};\n\nproto._getContainerSize = function() {\n return { height: this.maxY };\n};\n\nreturn FitRows;\n\n}));\n","/**\n * vertical layout mode\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n '../layout-mode'\n ],\n factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n require('../layout-mode')\n );\n } else {\n // browser global\n factory(\n window.Isotope.LayoutMode\n );\n }\n\n}( window, function factory( LayoutMode ) {\n'use strict';\n\nvar Vertical = LayoutMode.create( 'vertical', {\n horizontalAlignment: 0\n});\n\nvar proto = Vertical.prototype;\n\nproto._resetLayout = function() {\n this.y = 0;\n};\n\nproto._getItemLayoutPosition = function( item ) {\n item.getSize();\n var x = ( this.isotope.size.innerWidth - item.size.outerWidth ) *\n this.options.horizontalAlignment;\n var y = this.y;\n this.y += item.size.outerHeight;\n return { x: x, y: y };\n};\n\nproto._getContainerSize = function() {\n return { height: this.y };\n};\n\nreturn Vertical;\n\n}));\n","// Object.keys\nif (!Object.keys) {\n Object.keys = function(object) {\n var keys = [];\n for (var name in object) {\n if (Object.prototype.hasOwnProperty.call(object, name)) {\n keys.push(name);\n }\n }\n return keys;\n };\n}","// ChildNode.remove\nif(!(\"remove\" in Element.prototype)){\n Element.prototype.remove = function(){\n if(this.parentNode) {\n this.parentNode.removeChild(this);\n }\n };\n}","const defaults = {\n duration: 400,\n easing: (currentTime, startValue, diffValue, dureation) => {\n return -diffValue * (currentTime /= dureation) * (currentTime - 2) + startValue;\n }\n};\nconst directions = {\n OPEN: 1,\n CLOSE: 2\n};\nexport const slideUp = (element, args = {}) => {\n if (isInteger(args)) {\n args = { duration: args };\n }\n const options = extend(defaults, args);\n options.direction = directions.CLOSE;\n options.to = 0;\n options.startingHeight = element.scrollHeight;\n options.distanceHeight = -options.startingHeight;\n setElementAnimationStyles(element);\n window.requestAnimationFrame((timestamp) => animate(element, options, timestamp));\n};\nexport const slideDown = (element, args = {}) => {\n if (isInteger(args)) {\n args = { duration: args };\n }\n element.style.height = '0px';\n setElementAnimationStyles(element);\n const options = extend(defaults, args);\n options.direction = directions.OPEN;\n options.to = element.scrollHeight;\n options.startingHeight = 0;\n options.distanceHeight = options.to;\n window.requestAnimationFrame((timestamp) => animate(element, options, timestamp));\n};\nconst animate = (element, options, now) => {\n if (!options.startTime) {\n options.startTime = now;\n }\n const currentTime = now - options.startTime;\n let animationContinue = currentTime < options.duration;\n let newHeight = options.easing(currentTime, options.startingHeight, options.distanceHeight, options.duration);\n if (animationContinue) {\n element.style.height = `${newHeight.toFixed(2)}px`;\n window.requestAnimationFrame((timestamp) => animate(element, options, timestamp));\n }\n else {\n if (options.direction === directions.CLOSE) {\n element.style.display = 'none';\n }\n if (options.direction === directions.OPEN) {\n element.style.display = 'block';\n }\n removeElementAnimationStyles(element);\n }\n};\nconst setElementAnimationStyles = (element) => {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n element.style.marginTop = '0';\n element.style.marginBottom = '0';\n element.style.paddingTop = '0';\n element.style.paddingBottom = '0';\n};\nconst removeElementAnimationStyles = (element) => {\n element.style.height = null;\n element.style.overflow = null;\n element.style.marginTop = null;\n element.style.marginBottom = null;\n element.style.paddingTop = null;\n element.style.paddingBottom = null;\n};\nconst isInteger = (value) => {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n else {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n }\n};\nconst extend = (defaults, options) => {\n const extendedOptions = {};\n for (let key in defaults) {\n extendedOptions[key] = options[key] || defaults[key];\n }\n return extendedOptions;\n};\n//# sourceMappingURL=index.js.map","/*!\n * getSize v2.0.3\n * measure size of elements\n * MIT license\n */\n\n/* jshint browser: true, strict: true, undef: true, unused: true */\n/* globals console: false */\n\n( function( window, factory ) {\n /* jshint strict: false */ /* globals define, module */\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory();\n } else {\n // browser global\n window.getSize = factory();\n }\n\n})( window, function factory() {\n'use strict';\n\n// -------------------------- helpers -------------------------- //\n\n// get a number from a string, not a percentage\nfunction getStyleSize( value ) {\n var num = parseFloat( value );\n // not a percent like '100%', and a number\n var isValid = value.indexOf('%') == -1 && !isNaN( num );\n return isValid && num;\n}\n\nfunction noop() {}\n\nvar logError = typeof console == 'undefined' ? noop :\n function( message ) {\n console.error( message );\n };\n\n// -------------------------- measurements -------------------------- //\n\nvar measurements = [\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'marginBottom',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'borderBottomWidth'\n];\n\nvar measurementsLength = measurements.length;\n\nfunction getZeroSize() {\n var size = {\n width: 0,\n height: 0,\n innerWidth: 0,\n innerHeight: 0,\n outerWidth: 0,\n outerHeight: 0\n };\n for ( var i=0; i < measurementsLength; i++ ) {\n var measurement = measurements[i];\n size[ measurement ] = 0;\n }\n return size;\n}\n\n// -------------------------- getStyle -------------------------- //\n\n/**\n * getStyle, get style of element, check for Firefox bug\n * https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\nfunction getStyle( elem ) {\n var style = getComputedStyle( elem );\n if ( !style ) {\n logError( 'Style returned ' + style +\n '. Are you running this code in a hidden iframe on Firefox? ' +\n 'See https://bit.ly/getsizebug1' );\n }\n return style;\n}\n\n// -------------------------- setup -------------------------- //\n\nvar isSetup = false;\n\nvar isBoxSizeOuter;\n\n/**\n * setup\n * check isBoxSizerOuter\n * do on first getSize() rather than on page load for Firefox bug\n */\nfunction setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}\n\n// -------------------------- getSize -------------------------- //\n\nfunction getSize( elem ) {\n setup();\n\n // use querySeletor if elem is string\n if ( typeof elem == 'string' ) {\n elem = document.querySelector( elem );\n }\n\n // do not proceed on non-objects\n if ( !elem || typeof elem != 'object' || !elem.nodeType ) {\n return;\n }\n\n var style = getStyle( elem );\n\n // if hidden, everything is 0\n if ( style.display == 'none' ) {\n return getZeroSize();\n }\n\n var size = {};\n size.width = elem.offsetWidth;\n size.height = elem.offsetHeight;\n\n var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';\n\n // get all measurements\n for ( var i=0; i < measurementsLength; i++ ) {\n var measurement = measurements[i];\n var value = style[ measurement ];\n var num = parseFloat( value );\n // any 'auto', 'medium' value will be 0\n size[ measurement ] = !isNaN( num ) ? num : 0;\n }\n\n var paddingWidth = size.paddingLeft + size.paddingRight;\n var paddingHeight = size.paddingTop + size.paddingBottom;\n var marginWidth = size.marginLeft + size.marginRight;\n var marginHeight = size.marginTop + size.marginBottom;\n var borderWidth = size.borderLeftWidth + size.borderRightWidth;\n var borderHeight = size.borderTopWidth + size.borderBottomWidth;\n\n var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;\n\n // overwrite width and height if we can get it from style\n var styleWidth = getStyleSize( style.width );\n if ( styleWidth !== false ) {\n size.width = styleWidth +\n // add padding and border unless it's already including it\n ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );\n }\n\n var styleHeight = getStyleSize( style.height );\n if ( styleHeight !== false ) {\n size.height = styleHeight +\n // add padding and border unless it's already including it\n ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );\n }\n\n size.innerWidth = size.width - ( paddingWidth + borderWidth );\n size.innerHeight = size.height - ( paddingHeight + borderHeight );\n\n size.outerWidth = size.width + marginWidth;\n size.outerHeight = size.height + marginHeight;\n\n return size;\n}\n\nreturn getSize;\n\n});\n","/*!\n * Outlayer v2.1.1\n * the brains and guts of a layout library\n * MIT license\n */\n\n( function( window, factory ) {\n 'use strict';\n // universal module definition\n /* jshint strict: false */ /* globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD - RequireJS\n define( [\n 'ev-emitter/ev-emitter',\n 'get-size/get-size',\n 'fizzy-ui-utils/utils',\n './item'\n ],\n function( EvEmitter, getSize, utils, Item ) {\n return factory( window, EvEmitter, getSize, utils, Item);\n }\n );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS - Browserify, Webpack\n module.exports = factory(\n window,\n require('ev-emitter'),\n require('get-size'),\n require('fizzy-ui-utils'),\n require('./item')\n );\n } else {\n // browser global\n window.Outlayer = factory(\n window,\n window.EvEmitter,\n window.getSize,\n window.fizzyUIUtils,\n window.Outlayer.Item\n );\n }\n\n}( window, function factory( window, EvEmitter, getSize, utils, Item ) {\n'use strict';\n\n// ----- vars ----- //\n\nvar console = window.console;\nvar jQuery = window.jQuery;\nvar noop = function() {};\n\n// -------------------------- Outlayer -------------------------- //\n\n// globally unique identifiers\nvar GUID = 0;\n// internal store of all Outlayer intances\nvar instances = {};\n\n\n/**\n * @param {Element, String} element\n * @param {Object} options\n * @constructor\n */\nfunction Outlayer( element, options ) {\n var queryElement = utils.getQueryElement( element );\n if ( !queryElement ) {\n if ( console ) {\n console.error( 'Bad element for ' + this.constructor.namespace +\n ': ' + ( queryElement || element ) );\n }\n return;\n }\n this.element = queryElement;\n // add jQuery\n if ( jQuery ) {\n this.$element = jQuery( this.element );\n }\n\n // options\n this.options = utils.extend( {}, this.constructor.defaults );\n this.option( options );\n\n // add id for Outlayer.getFromElement\n var id = ++GUID;\n this.element.outlayerGUID = id; // expando\n instances[ id ] = this; // associate via id\n\n // kick it off\n this._create();\n\n var isInitLayout = this._getOption('initLayout');\n if ( isInitLayout ) {\n this.layout();\n }\n}\n\n// settings are for internal use only\nOutlayer.namespace = 'outlayer';\nOutlayer.Item = Item;\n\n// default options\nOutlayer.defaults = {\n containerStyle: {\n position: 'relative'\n },\n initLayout: true,\n originLeft: true,\n originTop: true,\n resize: true,\n resizeContainer: true,\n // item options\n transitionDuration: '0.4s',\n hiddenStyle: {\n opacity: 0,\n transform: 'scale(0.001)'\n },\n visibleStyle: {\n opacity: 1,\n transform: 'scale(1)'\n }\n};\n\nvar proto = Outlayer.prototype;\n// inherit EvEmitter\nutils.extend( proto, EvEmitter.prototype );\n\n/**\n * set options\n * @param {Object} opts\n */\nproto.option = function( opts ) {\n utils.extend( this.options, opts );\n};\n\n/**\n * get backwards compatible option value, check old name\n */\nproto._getOption = function( option ) {\n var oldOption = this.constructor.compatOptions[ option ];\n return oldOption && this.options[ oldOption ] !== undefined ?\n this.options[ oldOption ] : this.options[ option ];\n};\n\nOutlayer.compatOptions = {\n // currentName: oldName\n initLayout: 'isInitLayout',\n horizontal: 'isHorizontal',\n layoutInstant: 'isLayoutInstant',\n originLeft: 'isOriginLeft',\n originTop: 'isOriginTop',\n resize: 'isResizeBound',\n resizeContainer: 'isResizingContainer'\n};\n\nproto._create = function() {\n // get items from children\n this.reloadItems();\n // elements that affect layout, but are not laid out\n this.stamps = [];\n this.stamp( this.options.stamp );\n // set container style\n utils.extend( this.element.style, this.options.containerStyle );\n\n // bind resize method\n var canBindResize = this._getOption('resize');\n if ( canBindResize ) {\n this.bindResize();\n }\n};\n\n// goes through all children again and gets bricks in proper order\nproto.reloadItems = function() {\n // collection of item elements\n this.items = this._itemize( this.element.children );\n};\n\n\n/**\n * turn elements into Outlayer.Items to be used in layout\n * @param {Array or NodeList or HTMLElement} elems\n * @returns {Array} items - collection of new Outlayer Items\n */\nproto._itemize = function( elems ) {\n\n var itemElems = this._filterFindItemElements( elems );\n var Item = this.constructor.Item;\n\n // create new Outlayer Items for collection\n var items = [];\n for ( var i=0; i < itemElems.length; i++ ) {\n var elem = itemElems[i];\n var item = new Item( elem, this );\n items.push( item );\n }\n\n return items;\n};\n\n/**\n * get item elements to be used in layout\n * @param {Array or NodeList or HTMLElement} elems\n * @returns {Array} items - item elements\n */\nproto._filterFindItemElements = function( elems ) {\n return utils.filterFindElements( elems, this.options.itemSelector );\n};\n\n/**\n * getter method for getting item elements\n * @returns {Array} elems - collection of item elements\n */\nproto.getItemElements = function() {\n return this.items.map( function( item ) {\n return item.element;\n });\n};\n\n// ----- init & layout ----- //\n\n/**\n * lays out all items\n */\nproto.layout = function() {\n this._resetLayout();\n this._manageStamps();\n\n // don't animate first layout\n var layoutInstant = this._getOption('layoutInstant');\n var isInstant = layoutInstant !== undefined ?\n layoutInstant : !this._isLayoutInited;\n this.layoutItems( this.items, isInstant );\n\n // flag for initalized\n this._isLayoutInited = true;\n};\n\n// _init is alias for layout\nproto._init = proto.layout;\n\n/**\n * logic before any new layout\n */\nproto._resetLayout = function() {\n this.getSize();\n};\n\n\nproto.getSize = function() {\n this.size = getSize( this.element );\n};\n\n/**\n * get measurement from option, for columnWidth, rowHeight, gutter\n * if option is String -> get element from selector string, & get size of element\n * if option is Element -> get size of element\n * else use option as a number\n *\n * @param {String} measurement\n * @param {String} size - width or height\n * @private\n */\nproto._getMeasurement = function( measurement, size ) {\n var option = this.options[ measurement ];\n var elem;\n if ( !option ) {\n // default to 0\n this[ measurement ] = 0;\n } else {\n // use option as an element\n if ( typeof option == 'string' ) {\n elem = this.element.querySelector( option );\n } else if ( option instanceof HTMLElement ) {\n elem = option;\n }\n // use size of element, if element\n this[ measurement ] = elem ? getSize( elem )[ size ] : option;\n }\n};\n\n/**\n * layout a collection of item elements\n * @api public\n */\nproto.layoutItems = function( items, isInstant ) {\n items = this._getItemsForLayout( items );\n\n this._layoutItems( items, isInstant );\n\n this._postLayout();\n};\n\n/**\n * get the items to be laid out\n * you may want to skip over some items\n * @param {Array} items\n * @returns {Array} items\n */\nproto._getItemsForLayout = function( items ) {\n return items.filter( function( item ) {\n return !item.isIgnored;\n });\n};\n\n/**\n * layout items\n * @param {Array} items\n * @param {Boolean} isInstant\n */\nproto._layoutItems = function( items, isInstant ) {\n this._emitCompleteOnItems( 'layout', items );\n\n if ( !items || !items.length ) {\n // no items, emit event with empty array\n return;\n }\n\n var queue = [];\n\n items.forEach( function( item ) {\n // get x/y object from method\n var position = this._getItemLayoutPosition( item );\n // enqueue\n position.item = item;\n position.isInstant = isInstant || item.isLayoutInstant;\n queue.push( position );\n }, this );\n\n this._processLayoutQueue( queue );\n};\n\n/**\n * get item layout position\n * @param {Outlayer.Item} item\n * @returns {Object} x and y position\n */\nproto._getItemLayoutPosition = function( /* item */ ) {\n return {\n x: 0,\n y: 0\n };\n};\n\n/**\n * iterate over array and position each item\n * Reason being - separating this logic prevents 'layout invalidation'\n * thx @paul_irish\n * @param {Array} queue\n */\nproto._processLayoutQueue = function( queue ) {\n this.updateStagger();\n queue.forEach( function( obj, i ) {\n this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i );\n }, this );\n};\n\n// set stagger from option in milliseconds number\nproto.updateStagger = function() {\n var stagger = this.options.stagger;\n if ( stagger === null || stagger === undefined ) {\n this.stagger = 0;\n return;\n }\n this.stagger = getMilliseconds( stagger );\n return this.stagger;\n};\n\n/**\n * Sets position of item in DOM\n * @param {Outlayer.Item} item\n * @param {Number} x - horizontal position\n * @param {Number} y - vertical position\n * @param {Boolean} isInstant - disables transitions\n */\nproto._positionItem = function( item, x, y, isInstant, i ) {\n if ( isInstant ) {\n // if not transition, just set CSS\n item.goTo( x, y );\n } else {\n item.stagger( i * this.stagger );\n item.moveTo( x, y );\n }\n};\n\n/**\n * Any logic you want to do after each layout,\n * i.e. size the container\n */\nproto._postLayout = function() {\n this.resizeContainer();\n};\n\nproto.resizeContainer = function() {\n var isResizingContainer = this._getOption('resizeContainer');\n if ( !isResizingContainer ) {\n return;\n }\n var size = this._getContainerSize();\n if ( size ) {\n this._setContainerMeasure( size.width, true );\n this._setContainerMeasure( size.height, false );\n }\n};\n\n/**\n * Sets width or height of container if returned\n * @returns {Object} size\n * @param {Number} width\n * @param {Number} height\n */\nproto._getContainerSize = noop;\n\n/**\n * @param {Number} measure - size of width or height\n * @param {Boolean} isWidth\n */\nproto._setContainerMeasure = function( measure, isWidth ) {\n if ( measure === undefined ) {\n return;\n }\n\n var elemSize = this.size;\n // add padding and border width if border box\n if ( elemSize.isBorderBox ) {\n measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight +\n elemSize.borderLeftWidth + elemSize.borderRightWidth :\n elemSize.paddingBottom + elemSize.paddingTop +\n elemSize.borderTopWidth + elemSize.borderBottomWidth;\n }\n\n measure = Math.max( measure, 0 );\n this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px';\n};\n\n/**\n * emit eventComplete on a collection of items events\n * @param {String} eventName\n * @param {Array} items - Outlayer.Items\n */\nproto._emitCompleteOnItems = function( eventName, items ) {\n var _this = this;\n function onComplete() {\n _this.dispatchEvent( eventName + 'Complete', null, [ items ] );\n }\n\n var count = items.length;\n if ( !items || !count ) {\n onComplete();\n return;\n }\n\n var doneCount = 0;\n function tick() {\n doneCount++;\n if ( doneCount == count ) {\n onComplete();\n }\n }\n\n // bind callback\n items.forEach( function( item ) {\n item.once( eventName, tick );\n });\n};\n\n/**\n * emits events via EvEmitter and jQuery events\n * @param {String} type - name of event\n * @param {Event} event - original event\n * @param {Array} args - extra arguments\n */\nproto.dispatchEvent = function( type, event, args ) {\n // add original event to arguments\n var emitArgs = event ? [ event ].concat( args ) : args;\n this.emitEvent( type, emitArgs );\n\n if ( jQuery ) {\n // set this.$element\n this.$element = this.$element || jQuery( this.element );\n if ( event ) {\n // create jQuery event\n var $event = jQuery.Event( event );\n $event.type = type;\n this.$element.trigger( $event, args );\n } else {\n // just trigger with type if no event available\n this.$element.trigger( type, args );\n }\n }\n};\n\n// -------------------------- ignore & stamps -------------------------- //\n\n\n/**\n * keep item in collection, but do not lay it out\n * ignored items do not get skipped in layout\n * @param {Element} elem\n */\nproto.ignore = function( elem ) {\n var item = this.getItem( elem );\n if ( item ) {\n item.isIgnored = true;\n }\n};\n\n/**\n * return item to layout collection\n * @param {Element} elem\n */\nproto.unignore = function( elem ) {\n var item = this.getItem( elem );\n if ( item ) {\n delete item.isIgnored;\n }\n};\n\n/**\n * adds elements to stamps\n * @param {NodeList, Array, Element, or String} elems\n */\nproto.stamp = function( elems ) {\n elems = this._find( elems );\n if ( !elems ) {\n return;\n }\n\n this.stamps = this.stamps.concat( elems );\n // ignore\n elems.forEach( this.ignore, this );\n};\n\n/**\n * removes elements to stamps\n * @param {NodeList, Array, or Element} elems\n */\nproto.unstamp = function( elems ) {\n elems = this._find( elems );\n if ( !elems ){\n return;\n }\n\n elems.forEach( function( elem ) {\n // filter out removed stamp elements\n utils.removeFrom( this.stamps, elem );\n this.unignore( elem );\n }, this );\n};\n\n/**\n * finds child elements\n * @param {NodeList, Array, Element, or String} elems\n * @returns {Array} elems\n */\nproto._find = function( elems ) {\n if ( !elems ) {\n return;\n }\n // if string, use argument as selector string\n if ( typeof elems == 'string' ) {\n elems = this.element.querySelectorAll( elems );\n }\n elems = utils.makeArray( elems );\n return elems;\n};\n\nproto._manageStamps = function() {\n if ( !this.stamps || !this.stamps.length ) {\n return;\n }\n\n this._getBoundingRect();\n\n this.stamps.forEach( this._manageStamp, this );\n};\n\n// update boundingLeft / Top\nproto._getBoundingRect = function() {\n // get bounding rect for container element\n var boundingRect = this.element.getBoundingClientRect();\n var size = this.size;\n this._boundingRect = {\n left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,\n top: boundingRect.top + size.paddingTop + size.borderTopWidth,\n right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ),\n bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth )\n };\n};\n\n/**\n * @param {Element} stamp\n**/\nproto._manageStamp = noop;\n\n/**\n * get x/y position of element relative to container element\n * @param {Element} elem\n * @returns {Object} offset - has left, top, right, bottom\n */\nproto._getElementOffset = function( elem ) {\n var boundingRect = elem.getBoundingClientRect();\n var thisRect = this._boundingRect;\n var size = getSize( elem );\n var offset = {\n left: boundingRect.left - thisRect.left - size.marginLeft,\n top: boundingRect.top - thisRect.top - size.marginTop,\n right: thisRect.right - boundingRect.right - size.marginRight,\n bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom\n };\n return offset;\n};\n\n// -------------------------- resize -------------------------- //\n\n// enable event handlers for listeners\n// i.e. resize -> onresize\nproto.handleEvent = utils.handleEvent;\n\n/**\n * Bind layout to window resizing\n */\nproto.bindResize = function() {\n window.addEventListener( 'resize', this );\n this.isResizeBound = true;\n};\n\n/**\n * Unbind layout to window resizing\n */\nproto.unbindResize = function() {\n window.removeEventListener( 'resize', this );\n this.isResizeBound = false;\n};\n\nproto.onresize = function() {\n this.resize();\n};\n\nutils.debounceMethod( Outlayer, 'onresize', 100 );\n\nproto.resize = function() {\n // don't trigger if size did not change\n // or if resize was unbound. See #9\n if ( !this.isResizeBound || !this.needsResizeLayout() ) {\n return;\n }\n\n this.layout();\n};\n\n/**\n * check if layout is needed post layout\n * @returns Boolean\n */\nproto.needsResizeLayout = function() {\n var size = getSize( this.element );\n // check that this.size and size are there\n // IE8 triggers resize on body size change, so they might not be\n var hasSizes = this.size && size;\n return hasSizes && size.innerWidth !== this.size.innerWidth;\n};\n\n// -------------------------- methods -------------------------- //\n\n/**\n * add items to Outlayer instance\n * @param {Array or NodeList or Element} elems\n * @returns {Array} items - Outlayer.Items\n**/\nproto.addItems = function( elems ) {\n var items = this._itemize( elems );\n // add items to collection\n if ( items.length ) {\n this.items = this.items.concat( items );\n }\n return items;\n};\n\n/**\n * Layout newly-appended item elements\n * @param {Array or NodeList or Element} elems\n */\nproto.appended = function( elems ) {\n var items = this.addItems( elems );\n if ( !items.length ) {\n return;\n }\n // layout and reveal just the new items\n this.layoutItems( items, true );\n this.reveal( items );\n};\n\n/**\n * Layout prepended elements\n * @param {Array or NodeList or Element} elems\n */\nproto.prepended = function( elems ) {\n var items = this._itemize( elems );\n if ( !items.length ) {\n return;\n }\n // add items to beginning of collection\n var previousItems = this.items.slice(0);\n this.items = items.concat( previousItems );\n // start new layout\n this._resetLayout();\n this._manageStamps();\n // layout new stuff without transition\n this.layoutItems( items, true );\n this.reveal( items );\n // layout previous items\n this.layoutItems( previousItems );\n};\n\n/**\n * reveal a collection of items\n * @param {Array of Outlayer.Items} items\n */\nproto.reveal = function( items ) {\n this._emitCompleteOnItems( 'reveal', items );\n if ( !items || !items.length ) {\n return;\n }\n var stagger = this.updateStagger();\n items.forEach( function( item, i ) {\n item.stagger( i * stagger );\n item.reveal();\n });\n};\n\n/**\n * hide a collection of items\n * @param {Array of Outlayer.Items} items\n */\nproto.hide = function( items ) {\n this._emitCompleteOnItems( 'hide', items );\n if ( !items || !items.length ) {\n return;\n }\n var stagger = this.updateStagger();\n items.forEach( function( item, i ) {\n item.stagger( i * stagger );\n item.hide();\n });\n};\n\n/**\n * reveal item elements\n * @param {Array}, {Element}, {NodeList} items\n */\nproto.revealItemElements = function( elems ) {\n var items = this.getItems( elems );\n this.reveal( items );\n};\n\n/**\n * hide item elements\n * @param {Array}, {Element}, {NodeList} items\n */\nproto.hideItemElements = function( elems ) {\n var items = this.getItems( elems );\n this.hide( items );\n};\n\n/**\n * get Outlayer.Item, given an Element\n * @param {Element} elem\n * @param {Function} callback\n * @returns {Outlayer.Item} item\n */\nproto.getItem = function( elem ) {\n // loop through items to get the one that matches\n for ( var i=0; i < this.items.length; i++ ) {\n var item = this.items[i];\n if ( item.element == elem ) {\n // return item\n return item;\n }\n }\n};\n\n/**\n * get collection of Outlayer.Items, given Elements\n * @param {Array} elems\n * @returns {Array} items - Outlayer.Items\n */\nproto.getItems = function( elems ) {\n elems = utils.makeArray( elems );\n var items = [];\n elems.forEach( function( elem ) {\n var item = this.getItem( elem );\n if ( item ) {\n items.push( item );\n }\n }, this );\n\n return items;\n};\n\n/**\n * remove element(s) from instance and DOM\n * @param {Array or NodeList or Element} elems\n */\nproto.remove = function( elems ) {\n var removeItems = this.getItems( elems );\n\n this._emitCompleteOnItems( 'remove', removeItems );\n\n // bail if no items to remove\n if ( !removeItems || !removeItems.length ) {\n return;\n }\n\n removeItems.forEach( function( item ) {\n item.remove();\n // remove item from collection\n utils.removeFrom( this.items, item );\n }, this );\n};\n\n// ----- destroy ----- //\n\n// remove and disable Outlayer instance\nproto.destroy = function() {\n // clean up dynamic styles\n var style = this.element.style;\n style.height = '';\n style.position = '';\n style.width = '';\n // destroy items\n this.items.forEach( function( item ) {\n item.destroy();\n });\n\n this.unbindResize();\n\n var id = this.element.outlayerGUID;\n delete instances[ id ]; // remove reference to instance by id\n delete this.element.outlayerGUID;\n // remove data for jQuery\n if ( jQuery ) {\n jQuery.removeData( this.element, this.constructor.namespace );\n }\n\n};\n\n// -------------------------- data -------------------------- //\n\n/**\n * get Outlayer instance from element\n * @param {Element} elem\n * @returns {Outlayer}\n */\nOutlayer.data = function( elem ) {\n elem = utils.getQueryElement( elem );\n var id = elem && elem.outlayerGUID;\n return id && instances[ id ];\n};\n\n\n// -------------------------- create Outlayer class -------------------------- //\n\n/**\n * create a layout class\n * @param {String} namespace\n */\nOutlayer.create = function( namespace, options ) {\n // sub-class Outlayer\n var Layout = subclass( Outlayer );\n // apply new options and compatOptions\n Layout.defaults = utils.extend( {}, Outlayer.defaults );\n utils.extend( Layout.defaults, options );\n Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions );\n\n Layout.namespace = namespace;\n\n Layout.data = Outlayer.data;\n\n // sub-class Item\n Layout.Item = subclass( Item );\n\n // -------------------------- declarative -------------------------- //\n\n utils.htmlInit( Layout, namespace );\n\n // -------------------------- jQuery bridge -------------------------- //\n\n // make into jQuery plugin\n if ( jQuery && jQuery.bridget ) {\n jQuery.bridget( namespace, Layout );\n }\n\n return Layout;\n};\n\nfunction subclass( Parent ) {\n function SubClass() {\n Parent.apply( this, arguments );\n }\n\n SubClass.prototype = Object.create( Parent.prototype );\n SubClass.prototype.constructor = SubClass;\n\n return SubClass;\n}\n\n// ----- helpers ----- //\n\n// how many milliseconds are in each unit\nvar msUnits = {\n ms: 1,\n s: 1000\n};\n\n// munge time-like parameter into millisecond number\n// '0.4s' -> 40\nfunction getMilliseconds( time ) {\n if ( typeof time == 'number' ) {\n return time;\n }\n var matches = time.match( /(^\\d*\\.?\\d*)(\\w*)/ );\n var num = matches && matches[1];\n var unit = matches && matches[2];\n if ( !num.length ) {\n return 0;\n }\n num = parseFloat( num );\n var mult = msUnits[ unit ] || 1;\n return num * mult;\n}\n\n// ----- fin ----- //\n\n// back in global\nOutlayer.Item = Item;\n\nreturn Outlayer;\n\n}));\n","/**\n * Isotope LayoutMode\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'get-size/get-size',\n 'outlayer/outlayer'\n ],\n factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n require('get-size'),\n require('outlayer')\n );\n } else {\n // browser global\n window.Isotope = window.Isotope || {};\n window.Isotope.LayoutMode = factory(\n window.getSize,\n window.Outlayer\n );\n }\n\n}( window, function factory( getSize, Outlayer ) {\n 'use strict';\n\n // layout mode class\n function LayoutMode( isotope ) {\n this.isotope = isotope;\n // link properties\n if ( isotope ) {\n this.options = isotope.options[ this.namespace ];\n this.element = isotope.element;\n this.items = isotope.filteredItems;\n this.size = isotope.size;\n }\n }\n\n var proto = LayoutMode.prototype;\n\n /**\n * some methods should just defer to default Outlayer method\n * and reference the Isotope instance as `this`\n **/\n var facadeMethods = [\n '_resetLayout',\n '_getItemLayoutPosition',\n '_manageStamp',\n '_getContainerSize',\n '_getElementOffset',\n 'needsResizeLayout',\n '_getOption'\n ];\n\n facadeMethods.forEach( function( methodName ) {\n proto[ methodName ] = function() {\n return Outlayer.prototype[ methodName ].apply( this.isotope, arguments );\n };\n });\n\n // ----- ----- //\n\n // for horizontal layout modes, check vertical size\n proto.needsVerticalResizeLayout = function() {\n // don't trigger if size did not change\n var size = getSize( this.isotope.element );\n // check that this.size and size are there\n // IE8 triggers resize on body size change, so they might not be\n var hasSizes = this.isotope.size && size;\n return hasSizes && size.innerHeight != this.isotope.size.innerHeight;\n };\n\n // ----- measurements ----- //\n\n proto._getMeasurement = function() {\n this.isotope._getMeasurement.apply( this, arguments );\n };\n\n proto.getColumnWidth = function() {\n this.getSegmentSize( 'column', 'Width' );\n };\n\n proto.getRowHeight = function() {\n this.getSegmentSize( 'row', 'Height' );\n };\n\n /**\n * get columnWidth or rowHeight\n * segment: 'column' or 'row'\n * size 'Width' or 'Height'\n **/\n proto.getSegmentSize = function( segment, size ) {\n var segmentName = segment + size;\n var outerSize = 'outer' + size;\n // columnWidth / outerWidth // rowHeight / outerHeight\n this._getMeasurement( segmentName, outerSize );\n // got rowHeight or columnWidth, we can chill\n if ( this[ segmentName ] ) {\n return;\n }\n // fall back to item of first element\n var firstItemSize = this.getFirstItemSize();\n this[ segmentName ] = firstItemSize && firstItemSize[ outerSize ] ||\n // or size of container\n this.isotope.size[ 'inner' + size ];\n };\n\n proto.getFirstItemSize = function() {\n var firstItem = this.isotope.filteredItems[0];\n return firstItem && firstItem.element && getSize( firstItem.element );\n };\n\n // ----- methods that should reference isotope ----- //\n\n proto.layout = function() {\n this.isotope.layout.apply( this.isotope, arguments );\n };\n\n proto.getSize = function() {\n this.isotope.getSize();\n this.size = this.isotope.size;\n };\n\n // -------------------------- create -------------------------- //\n\n LayoutMode.modes = {};\n\n LayoutMode.create = function( namespace, options ) {\n\n function Mode() {\n LayoutMode.apply( this, arguments );\n }\n\n Mode.prototype = Object.create( proto );\n Mode.prototype.constructor = Mode;\n\n // default options\n if ( options ) {\n Mode.options = options;\n }\n\n Mode.prototype.namespace = namespace;\n // register in Isotope\n LayoutMode.modes[ namespace ] = Mode;\n\n return Mode;\n };\n\n return LayoutMode;\n\n}));\n","var win = window;\n\nexport var raf = win.requestAnimationFrame\n || win.webkitRequestAnimationFrame\n || win.mozRequestAnimationFrame\n || win.msRequestAnimationFrame\n || function(cb) { return setTimeout(cb, 16); };\n","var win = window;\n\nexport var caf = win.cancelAnimationFrame\n || win.mozCancelAnimationFrame\n || function(id){ clearTimeout(id); };\n","export function extend() {\n var obj, name, copy,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length;\n\n for (; i < length; i++) {\n if ((obj = arguments[i]) !== null) {\n for (name in obj) {\n copy = obj[name];\n\n if (target === copy) {\n continue;\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n return target;\n}","export function checkStorageValue (value) {\n return ['true', 'false'].indexOf(value) >= 0 ? JSON.parse(value) : value;\n}","export function setLocalStorage(storage, key, value, access) {\n if (access) {\n try { storage.setItem(key, value); } catch (e) {}\n }\n return value;\n}","export function getBody () {\n var doc = document,\n body = doc.body;\n\n if (!body) {\n body = doc.createElement('body');\n body.fake = true;\n }\n\n return body;\n}","export var docElement = document.documentElement;","import { docElement } from './docElement.js';\n\nexport function setFakeBody (body) {\n var docOverflow = '';\n if (body.fake) {\n docOverflow = docElement.style.overflow;\n //avoid crashing IE8, if background image is used\n body.style.background = '';\n //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible\n body.style.overflow = docElement.style.overflow = 'hidden';\n docElement.appendChild(body);\n }\n\n return docOverflow;\n}","import { docElement } from './docElement.js';\n\nexport function resetFakeBody (body, docOverflow) {\n if (body.fake) {\n body.remove();\n docElement.style.overflow = docOverflow;\n // Trigger layout so kinetic scrolling isn't disabled in iOS6+\n // eslint-disable-next-line\n docElement.offsetHeight;\n }\n}","// cross browsers addRule method\nimport { raf } from './raf.js';\nexport function addCSSRule(sheet, selector, rules, index) {\n // return raf(function() {\n 'insertRule' in sheet ?\n sheet.insertRule(selector + '{' + rules + '}', index) :\n sheet.addRule(selector, rules, index);\n // });\n}","export function getCssRulesLength(sheet) {\n var rule = ('insertRule' in sheet) ? sheet.cssRules : sheet.rules;\n return rule.length;\n}","// https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/\nexport function forEach (arr, callback, scope) {\n for (var i = 0, l = arr.length; i < l; i++) {\n callback.call(scope, arr[i], i);\n }\n}","export var classListSupport = 'classList' in document.createElement('_');","import { classListSupport } from './classListSupport.js';\n\nvar hasClass = classListSupport ?\n function (el, str) { return el.classList.contains(str); } :\n function (el, str) { return el.className.indexOf(str) >= 0; };\n\nexport { classListSupport, hasClass };","import { classListSupport, hasClass } from './hasClass.js';\nvar addClass = classListSupport ?\n function (el, str) {\n if (!hasClass(el, str)) { el.classList.add(str); }\n } :\n function (el, str) {\n if (!hasClass(el, str)) { el.className += ' ' + str; }\n };\n\nexport { addClass };","import { classListSupport, hasClass } from './hasClass.js';\nvar removeClass = classListSupport ?\n function (el, str) {\n if (hasClass(el, str)) { el.classList.remove(str); }\n } :\n function (el, str) {\n if (hasClass(el, str)) { el.className = el.className.replace(str, ''); }\n };\n\nexport { removeClass };","export function hasAttr(el, attr) {\n return el.hasAttribute(attr);\n}","export function getAttr(el, attr) {\n return el.getAttribute(attr);\n}","export function isNodeList(el) {\n // Only NodeList has the \"item()\" function\n return typeof el.item !== \"undefined\"; \n}","import { isNodeList } from \"./isNodeList.js\";\n\nexport function setAttrs(els, attrs) {\n els = (isNodeList(els) || els instanceof Array) ? els : [els];\n if (Object.prototype.toString.call(attrs) !== '[object Object]') { return; }\n\n for (var i = els.length; i--;) {\n for(var key in attrs) {\n els[i].setAttribute(key, attrs[key]);\n }\n }\n}","import { isNodeList } from \"./isNodeList.js\";\n\nexport function removeAttrs(els, attrs) {\n els = (isNodeList(els) || els instanceof Array) ? els : [els];\n attrs = (attrs instanceof Array) ? attrs : [attrs];\n\n var attrLength = attrs.length;\n for (var i = els.length; i--;) {\n for (var j = attrLength; j--;) {\n els[i].removeAttribute(attrs[j]);\n }\n }\n}","export function arrayFromNodeList (nl) {\n var arr = [];\n for (var i = 0, l = nl.length; i < l; i++) {\n arr.push(nl[i]);\n }\n return arr;\n}","export function hideElement(el, forceHide) {\n if (el.style.display !== 'none') { el.style.display = 'none'; }\n}","export function showElement(el, forceHide) {\n if (el.style.display === 'none') { el.style.display = ''; }\n}","export function isVisible(el) {\n return window.getComputedStyle(el).display !== 'none';\n}","export function whichProperty(props){\n if (typeof props === 'string') {\n var arr = [props],\n Props = props.charAt(0).toUpperCase() + props.substr(1),\n prefixes = ['Webkit', 'Moz', 'ms', 'O'];\n \n prefixes.forEach(function(prefix) {\n if (prefix !== 'ms' || props === 'transform') {\n arr.push(prefix + Props);\n }\n });\n\n props = arr;\n }\n\n var el = document.createElement('fakeelement'),\n len = props.length;\n for(var i = 0; i < props.length; i++){\n var prop = props[i];\n if( el.style[prop] !== undefined ){ return prop; }\n }\n\n return false; // explicit for ie9-\n}\n","// get transitionend, animationend based on transitionDuration\n// @propin: string\n// @propOut: string, first-letter uppercase\n// Usage: getEndProperty('WebkitTransitionDuration', 'Transition') => webkitTransitionEnd\nexport function getEndProperty(propIn, propOut) {\n var endProp = false;\n if (/^Webkit/.test(propIn)) {\n endProp = 'webkit' + propOut + 'End';\n } else if (/^O/.test(propIn)) {\n endProp = 'o' + propOut + 'End';\n } else if (propIn) {\n endProp = propOut.toLowerCase() + 'end';\n }\n return endProp;\n}","// Test via a getter in the options object to see if the passive property is accessed\nvar supportsPassive = false;\ntry {\n var opts = Object.defineProperty({}, 'passive', {\n get: function() {\n supportsPassive = true;\n }\n });\n window.addEventListener(\"test\", null, opts);\n} catch (e) {}\nexport var passiveOption = supportsPassive ? { passive: true } : false;","import { passiveOption } from './passiveOption.js';\n\nexport function addEvents(el, obj, preventScrolling) {\n for (var prop in obj) {\n var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 && !preventScrolling ? passiveOption : false;\n el.addEventListener(prop, obj[prop], option);\n }\n}","import { passiveOption } from './passiveOption.js';\n\nexport function removeEvents(el, obj) {\n for (var prop in obj) {\n var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 ? passiveOption : false;\n el.removeEventListener(prop, obj[prop], option);\n }\n}","export function Events() {\n return {\n topics: {},\n on: function (eventName, fn) {\n this.topics[eventName] = this.topics[eventName] || [];\n this.topics[eventName].push(fn);\n },\n off: function(eventName, fn) {\n if (this.topics[eventName]) {\n for (var i = 0; i < this.topics[eventName].length; i++) {\n if (this.topics[eventName][i] === fn) {\n this.topics[eventName].splice(i, 1);\n break;\n }\n }\n }\n },\n emit: function (eventName, data) {\n data.type = eventName;\n if (this.topics[eventName]) {\n this.topics[eventName].forEach(function(fn) {\n fn(data, eventName);\n });\n }\n }\n };\n};","import './helpers/Object.keys';\nimport './helpers/childNode.remove';\nimport { raf } from './helpers/raf.js';\nimport { caf } from './helpers/caf.js';\nimport { extend } from './helpers/extend.js';\nimport { checkStorageValue } from './helpers/checkStorageValue.js';\nimport { setLocalStorage } from './helpers/setLocalStorage.js';\nimport { getSlideId } from './helpers/getSlideId.js';\nimport { calc } from './helpers/calc.js';\nimport { percentageLayout } from './helpers/percentageLayout.js';\nimport { mediaquerySupport } from './helpers/mediaquerySupport.js';\nimport { createStyleSheet } from './helpers/createStyleSheet.js';\nimport { addCSSRule } from './helpers/addCSSRule.js';\nimport { removeCSSRule } from './helpers/removeCSSRule.js';\nimport { getCssRulesLength } from './helpers/getCssRulesLength.js';\nimport { toDegree } from './helpers/toDegree.js';\nimport { getTouchDirection } from './helpers/getTouchDirection.js';\nimport { forEach } from './helpers/forEach.js';\nimport { hasClass } from './helpers/hasClass.js';\nimport { addClass } from './helpers/addClass.js';\nimport { removeClass } from './helpers/removeClass.js';\nimport { hasAttr } from './helpers/hasAttr.js';\nimport { getAttr } from './helpers/getAttr.js';\nimport { setAttrs } from './helpers/setAttrs.js';\nimport { removeAttrs } from './helpers/removeAttrs.js';\nimport { arrayFromNodeList } from './helpers/arrayFromNodeList.js';\nimport { hideElement } from './helpers/hideElement.js';\nimport { showElement } from './helpers/showElement.js';\nimport { isVisible } from './helpers/isVisible.js';\nimport { whichProperty } from './helpers/whichProperty.js';\nimport { has3DTransforms } from './helpers/has3DTransforms.js';\nimport { getEndProperty } from './helpers/getEndProperty.js';\nimport { addEvents } from './helpers/addEvents.js';\nimport { removeEvents } from './helpers/removeEvents.js';\nimport { Events } from './helpers/events.js';\nimport { jsTransform } from './helpers/jsTransform.js';\n\nexport var tns = function(options) {\n options = extend({\n container: '.slider',\n mode: 'carousel',\n axis: 'horizontal',\n items: 1,\n gutter: 0,\n edgePadding: 0,\n fixedWidth: false,\n autoWidth: false,\n viewportMax: false,\n slideBy: 1,\n center: false,\n controls: true,\n controlsPosition: 'top',\n controlsText: ['prev', 'next'],\n controlsContainer: false,\n prevButton: false,\n nextButton: false,\n nav: true,\n navPosition: 'top',\n navContainer: false,\n navAsThumbnails: false,\n arrowKeys: false,\n speed: 300,\n autoplay: false,\n autoplayPosition: 'top',\n autoplayTimeout: 5000,\n autoplayDirection: 'forward',\n autoplayText: ['start', 'stop'],\n autoplayHoverPause: false,\n autoplayButton: false,\n autoplayButtonOutput: true,\n autoplayResetOnVisibility: true,\n animateIn: 'tns-fadeIn',\n animateOut: 'tns-fadeOut',\n animateNormal: 'tns-normal',\n animateDelay: false,\n loop: true,\n rewind: false,\n autoHeight: false,\n responsive: false,\n lazyload: false,\n lazyloadSelector: '.tns-lazy-img',\n touch: true,\n mouseDrag: false,\n swipeAngle: 15,\n nested: false,\n preventActionWhenRunning: false,\n preventScrollOnTouch: false,\n freezable: true,\n onInit: false,\n useLocalStorage: true\n }, options || {});\n \n var doc = document,\n win = window,\n KEYS = {\n ENTER: 13,\n SPACE: 32,\n LEFT: 37,\n RIGHT: 39\n },\n tnsStorage = {},\n localStorageAccess = options.useLocalStorage;\n\n if (localStorageAccess) {\n // check browser version and local storage access\n var browserInfo = navigator.userAgent;\n var uid = new Date;\n\n try {\n tnsStorage = win.localStorage;\n if (tnsStorage) {\n tnsStorage.setItem(uid, uid);\n localStorageAccess = tnsStorage.getItem(uid) == uid;\n tnsStorage.removeItem(uid);\n } else {\n localStorageAccess = false;\n }\n if (!localStorageAccess) { tnsStorage = {}; }\n } catch(e) {\n localStorageAccess = false;\n }\n\n if (localStorageAccess) {\n // remove storage when browser version changes\n if (tnsStorage['tnsApp'] && tnsStorage['tnsApp'] !== browserInfo) {\n ['tC', 'tPL', 'tMQ', 'tTf', 't3D', 'tTDu', 'tTDe', 'tADu', 'tADe', 'tTE', 'tAE'].forEach(function(item) { tnsStorage.removeItem(item); });\n }\n // update browserInfo\n localStorage['tnsApp'] = browserInfo;\n }\n }\n\n var CALC = tnsStorage['tC'] ? checkStorageValue(tnsStorage['tC']) : setLocalStorage(tnsStorage, 'tC', calc(), localStorageAccess),\n PERCENTAGELAYOUT = tnsStorage['tPL'] ? checkStorageValue(tnsStorage['tPL']) : setLocalStorage(tnsStorage, 'tPL', percentageLayout(), localStorageAccess),\n CSSMQ = tnsStorage['tMQ'] ? checkStorageValue(tnsStorage['tMQ']) : setLocalStorage(tnsStorage, 'tMQ', mediaquerySupport(), localStorageAccess),\n TRANSFORM = tnsStorage['tTf'] ? checkStorageValue(tnsStorage['tTf']) : setLocalStorage(tnsStorage, 'tTf', whichProperty('transform'), localStorageAccess),\n HAS3DTRANSFORMS = tnsStorage['t3D'] ? checkStorageValue(tnsStorage['t3D']) : setLocalStorage(tnsStorage, 't3D', has3DTransforms(TRANSFORM), localStorageAccess),\n TRANSITIONDURATION = tnsStorage['tTDu'] ? checkStorageValue(tnsStorage['tTDu']) : setLocalStorage(tnsStorage, 'tTDu', whichProperty('transitionDuration'), localStorageAccess),\n TRANSITIONDELAY = tnsStorage['tTDe'] ? checkStorageValue(tnsStorage['tTDe']) : setLocalStorage(tnsStorage, 'tTDe', whichProperty('transitionDelay'), localStorageAccess),\n ANIMATIONDURATION = tnsStorage['tADu'] ? checkStorageValue(tnsStorage['tADu']) : setLocalStorage(tnsStorage, 'tADu', whichProperty('animationDuration'), localStorageAccess),\n ANIMATIONDELAY = tnsStorage['tADe'] ? checkStorageValue(tnsStorage['tADe']) : setLocalStorage(tnsStorage, 'tADe', whichProperty('animationDelay'), localStorageAccess),\n TRANSITIONEND = tnsStorage['tTE'] ? checkStorageValue(tnsStorage['tTE']) : setLocalStorage(tnsStorage, 'tTE', getEndProperty(TRANSITIONDURATION, 'Transition'), localStorageAccess),\n ANIMATIONEND = tnsStorage['tAE'] ? checkStorageValue(tnsStorage['tAE']) : setLocalStorage(tnsStorage, 'tAE', getEndProperty(ANIMATIONDURATION, 'Animation'), localStorageAccess);\n\n // get element nodes from selectors\n var supportConsoleWarn = win.console && typeof win.console.warn === \"function\",\n tnsList = ['container', 'controlsContainer', 'prevButton', 'nextButton', 'navContainer', 'autoplayButton'], \n optionsElements = {};\n \n tnsList.forEach(function(item) {\n if (typeof options[item] === 'string') {\n var str = options[item],\n el = doc.querySelector(str);\n optionsElements[item] = str;\n\n if (el && el.nodeName) {\n options[item] = el;\n } else {\n if (supportConsoleWarn) { console.warn('Can\\'t find', options[item]); }\n return;\n }\n }\n });\n\n // make sure at least 1 slide\n if (options.container.children.length < 1) {\n if (supportConsoleWarn) { console.warn('No slides found in', options.container); }\n return;\n }\n\n // update options\n var responsive = options.responsive,\n nested = options.nested,\n carousel = options.mode === 'carousel' ? true : false;\n\n if (responsive) {\n // apply responsive[0] to options and remove it\n if (0 in responsive) {\n options = extend(options, responsive[0]);\n delete responsive[0];\n }\n\n var responsiveTem = {};\n for (var key in responsive) {\n var val = responsive[key];\n // update responsive\n // from: 300: 2\n // to: \n // 300: { \n // items: 2 \n // } \n val = typeof val === 'number' ? {items: val} : val;\n responsiveTem[key] = val;\n }\n responsive = responsiveTem;\n responsiveTem = null;\n }\n\n // update options\n function updateOptions (obj) {\n for (var key in obj) {\n if (!carousel) {\n if (key === 'slideBy') { obj[key] = 'page'; }\n if (key === 'edgePadding') { obj[key] = false; }\n if (key === 'autoHeight') { obj[key] = false; }\n }\n\n // update responsive options\n if (key === 'responsive') { updateOptions(obj[key]); }\n }\n }\n if (!carousel) { updateOptions(options); }\n\n\n // === define and set variables ===\n if (!carousel) {\n options.axis = 'horizontal';\n options.slideBy = 'page';\n options.edgePadding = false;\n\n var animateIn = options.animateIn,\n animateOut = options.animateOut,\n animateDelay = options.animateDelay,\n animateNormal = options.animateNormal;\n }\n\n var horizontal = options.axis === 'horizontal' ? true : false,\n outerWrapper = doc.createElement('div'),\n innerWrapper = doc.createElement('div'),\n middleWrapper,\n container = options.container,\n containerParent = container.parentNode,\n containerHTML = container.outerHTML,\n slideItems = container.children,\n slideCount = slideItems.length,\n breakpointZone,\n windowWidth = getWindowWidth(),\n isOn = false;\n if (responsive) { setBreakpointZone(); }\n if (carousel) { container.className += ' tns-vpfix'; }\n\n // fixedWidth: viewport > rightBoundary > indexMax\n var autoWidth = options.autoWidth,\n fixedWidth = getOption('fixedWidth'),\n edgePadding = getOption('edgePadding'),\n gutter = getOption('gutter'),\n viewport = getViewportWidth(),\n center = getOption('center'),\n items = !autoWidth ? Math.floor(getOption('items')) : 1,\n slideBy = getOption('slideBy'),\n viewportMax = options.viewportMax || options.fixedWidthViewportWidth,\n arrowKeys = getOption('arrowKeys'),\n speed = getOption('speed'),\n rewind = options.rewind,\n loop = rewind ? false : options.loop,\n autoHeight = getOption('autoHeight'),\n controls = getOption('controls'),\n controlsText = getOption('controlsText'),\n nav = getOption('nav'),\n touch = getOption('touch'),\n mouseDrag = getOption('mouseDrag'),\n autoplay = getOption('autoplay'),\n autoplayTimeout = getOption('autoplayTimeout'),\n autoplayText = getOption('autoplayText'),\n autoplayHoverPause = getOption('autoplayHoverPause'),\n autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'),\n sheet = createStyleSheet(),\n lazyload = options.lazyload,\n lazyloadSelector = options.lazyloadSelector,\n slidePositions, // collection of slide positions\n slideItemsOut = [],\n cloneCount = loop ? getCloneCountForLoop() : 0,\n slideCountNew = !carousel ? slideCount + cloneCount : slideCount + cloneCount * 2,\n hasRightDeadZone = (fixedWidth || autoWidth) && !loop ? true : false,\n rightBoundary = fixedWidth ? getRightBoundary() : null,\n updateIndexBeforeTransform = (!carousel || !loop) ? true : false,\n // transform\n transformAttr = horizontal ? 'left' : 'top',\n transformPrefix = '',\n transformPostfix = '',\n // index\n getIndexMax = (function () {\n if (fixedWidth) {\n return function() { return center && !loop ? slideCount - 1 : Math.ceil(- rightBoundary / (fixedWidth + gutter)); };\n } else if (autoWidth) {\n return function() {\n for (var i = slideCountNew; i--;) {\n if (slidePositions[i] >= - rightBoundary) { return i; }\n }\n };\n } else {\n return function() {\n if (center && carousel && !loop) {\n return slideCount - 1;\n } else {\n return loop || carousel ? Math.max(0, slideCountNew - Math.ceil(items)) : slideCountNew - 1;\n }\n };\n }\n })(),\n index = getStartIndex(getOption('startIndex')),\n indexCached = index,\n displayIndex = getCurrentSlide(),\n indexMin = 0,\n indexMax = !autoWidth ? getIndexMax() : null,\n // resize\n resizeTimer,\n preventActionWhenRunning = options.preventActionWhenRunning,\n swipeAngle = options.swipeAngle,\n moveDirectionExpected = swipeAngle ? '?' : true,\n running = false,\n onInit = options.onInit,\n events = new Events(),\n // id, class\n newContainerClasses = ' tns-slider tns-' + options.mode,\n slideId = container.id || getSlideId(),\n disable = getOption('disable'),\n disabled = false,\n freezable = options.freezable,\n freeze = freezable && !autoWidth ? getFreeze() : false,\n frozen = false,\n controlsEvents = {\n 'click': onControlsClick,\n 'keydown': onControlsKeydown\n },\n navEvents = {\n 'click': onNavClick,\n 'keydown': onNavKeydown\n },\n hoverEvents = {\n 'mouseover': mouseoverPause,\n 'mouseout': mouseoutRestart\n },\n visibilityEvent = {'visibilitychange': onVisibilityChange},\n docmentKeydownEvent = {'keydown': onDocumentKeydown},\n touchEvents = {\n 'touchstart': onPanStart,\n 'touchmove': onPanMove,\n 'touchend': onPanEnd,\n 'touchcancel': onPanEnd\n }, dragEvents = {\n 'mousedown': onPanStart,\n 'mousemove': onPanMove,\n 'mouseup': onPanEnd,\n 'mouseleave': onPanEnd\n },\n hasControls = hasOption('controls'),\n hasNav = hasOption('nav'),\n navAsThumbnails = autoWidth ? true : options.navAsThumbnails,\n hasAutoplay = hasOption('autoplay'),\n hasTouch = hasOption('touch'),\n hasMouseDrag = hasOption('mouseDrag'),\n slideActiveClass = 'tns-slide-active',\n imgCompleteClass = 'tns-complete',\n imgEvents = {\n 'load': onImgLoaded,\n 'error': onImgFailed\n },\n imgsComplete,\n liveregionCurrent,\n preventScroll = options.preventScrollOnTouch === 'force' ? true : false;\n\n // controls\n if (hasControls) {\n var controlsContainer = options.controlsContainer,\n controlsContainerHTML = options.controlsContainer ? options.controlsContainer.outerHTML : '',\n prevButton = options.prevButton,\n nextButton = options.nextButton,\n prevButtonHTML = options.prevButton ? options.prevButton.outerHTML : '',\n nextButtonHTML = options.nextButton ? options.nextButton.outerHTML : '',\n prevIsButton,\n nextIsButton;\n }\n\n // nav\n if (hasNav) {\n var navContainer = options.navContainer,\n navContainerHTML = options.navContainer ? options.navContainer.outerHTML : '',\n navItems,\n pages = autoWidth ? slideCount : getPages(),\n pagesCached = 0,\n navClicked = -1,\n navCurrentIndex = getCurrentNavIndex(),\n navCurrentIndexCached = navCurrentIndex,\n navActiveClass = 'tns-nav-active',\n navStr = 'Carousel Page ',\n navStrCurrent = ' (Current Slide)';\n }\n\n // autoplay\n if (hasAutoplay) {\n var autoplayDirection = options.autoplayDirection === 'forward' ? 1 : -1,\n autoplayButton = options.autoplayButton,\n autoplayButtonHTML = options.autoplayButton ? options.autoplayButton.outerHTML : '',\n autoplayHtmlStrings = ['', ' animation'],\n autoplayTimer,\n animating,\n autoplayHoverPaused,\n autoplayUserPaused,\n autoplayVisibilityPaused;\n }\n\n if (hasTouch || hasMouseDrag) {\n var initPosition = {},\n lastPosition = {},\n translateInit,\n disX,\n disY,\n panStart = false,\n rafIndex,\n getDist = horizontal ? \n function(a, b) { return a.x - b.x; } :\n function(a, b) { return a.y - b.y; };\n }\n \n // disable slider when slidecount <= items\n if (!autoWidth) { resetVariblesWhenDisable(disable || freeze); }\n\n if (TRANSFORM) {\n transformAttr = TRANSFORM;\n transformPrefix = 'translate';\n\n if (HAS3DTRANSFORMS) {\n transformPrefix += horizontal ? '3d(' : '3d(0px, ';\n transformPostfix = horizontal ? ', 0px, 0px)' : ', 0px)';\n } else {\n transformPrefix += horizontal ? 'X(' : 'Y(';\n transformPostfix = ')';\n }\n\n }\n\n if (carousel) { container.className = container.className.replace('tns-vpfix', ''); }\n initStructure();\n initSheet();\n initSliderTransform();\n\n // === COMMON FUNCTIONS === //\n function resetVariblesWhenDisable (condition) {\n if (condition) {\n controls = nav = touch = mouseDrag = arrowKeys = autoplay = autoplayHoverPause = autoplayResetOnVisibility = false;\n }\n }\n\n function getCurrentSlide () {\n var tem = carousel ? index - cloneCount : index;\n while (tem < 0) { tem += slideCount; }\n return tem%slideCount + 1;\n }\n\n function getStartIndex (ind) {\n ind = ind ? Math.max(0, Math.min(loop ? slideCount - 1 : slideCount - items, ind)) : 0;\n return carousel ? ind + cloneCount : ind;\n }\n\n function getAbsIndex (i) {\n if (i == null) { i = index; }\n\n if (carousel) { i -= cloneCount; }\n while (i < 0) { i += slideCount; }\n\n return Math.floor(i%slideCount);\n }\n\n function getCurrentNavIndex () {\n var absIndex = getAbsIndex(),\n result;\n\n result = navAsThumbnails ? absIndex : \n fixedWidth || autoWidth ? Math.ceil((absIndex + 1) * pages / slideCount - 1) : \n Math.floor(absIndex / items);\n\n // set active nav to the last one when reaches the right edge\n if (!loop && carousel && index === indexMax) { result = pages - 1; }\n\n return result;\n }\n\n function getItemsMax () {\n // fixedWidth or autoWidth while viewportMax is not available\n if (autoWidth || (fixedWidth && !viewportMax)) {\n return slideCount - 1;\n // most cases\n } else {\n var str = fixedWidth ? 'fixedWidth' : 'items',\n arr = [];\n\n if (fixedWidth || options[str] < slideCount) { arr.push(options[str]); }\n\n if (responsive) {\n for (var bp in responsive) {\n var tem = responsive[bp][str];\n if (tem && (fixedWidth || tem < slideCount)) { arr.push(tem); }\n }\n }\n\n if (!arr.length) { arr.push(0); }\n\n return Math.ceil(fixedWidth ? viewportMax / Math.min.apply(null, arr) : Math.max.apply(null, arr));\n }\n }\n\n function getCloneCountForLoop () {\n var itemsMax = getItemsMax(),\n result = carousel ? Math.ceil((itemsMax * 5 - slideCount)/2) : (itemsMax * 4 - slideCount);\n result = Math.max(itemsMax, result);\n\n return hasOption('edgePadding') ? result + 1 : result;\n }\n\n function getWindowWidth () {\n return win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth;\n }\n\n function getInsertPosition (pos) {\n return pos === 'top' ? 'afterbegin' : 'beforeend';\n }\n\n function getClientWidth (el) {\n var div = doc.createElement('div'), rect, width;\n el.appendChild(div);\n rect = div.getBoundingClientRect();\n width = rect.right - rect.left;\n div.remove();\n return width || getClientWidth(el.parentNode);\n }\n\n function getViewportWidth () {\n var gap = edgePadding ? edgePadding * 2 - gutter : 0;\n return getClientWidth(containerParent) - gap;\n }\n\n function hasOption (item) {\n if (options[item]) {\n return true;\n } else {\n if (responsive) {\n for (var bp in responsive) {\n if (responsive[bp][item]) { return true; }\n }\n }\n return false;\n }\n }\n\n // get option:\n // fixed width: viewport, fixedWidth, gutter => items\n // others: window width => all variables\n // all: items => slideBy\n function getOption (item, ww) {\n if (ww == null) { ww = windowWidth; }\n\n if (item === 'items' && fixedWidth) {\n return Math.floor((viewport + gutter) / (fixedWidth + gutter)) || 1;\n\n } else {\n var result = options[item];\n\n if (responsive) {\n for (var bp in responsive) {\n // bp: convert string to number\n if (ww >= parseInt(bp)) {\n if (item in responsive[bp]) { result = responsive[bp][item]; }\n }\n }\n }\n\n if (item === 'slideBy' && result === 'page') { result = getOption('items'); }\n if (!carousel && (item === 'slideBy' || item === 'items')) { result = Math.floor(result); }\n\n return result;\n }\n }\n\n function getSlideMarginLeft (i) {\n return CALC ? \n CALC + '(' + i * 100 + '% / ' + slideCountNew + ')' : \n i * 100 / slideCountNew + '%';\n }\n\n function getInnerWrapperStyles (edgePaddingTem, gutterTem, fixedWidthTem, speedTem, autoHeightBP) {\n var str = '';\n\n if (edgePaddingTem !== undefined) {\n var gap = edgePaddingTem;\n if (gutterTem) { gap -= gutterTem; }\n str = horizontal ?\n 'margin: 0 ' + gap + 'px 0 ' + edgePaddingTem + 'px;' :\n 'margin: ' + edgePaddingTem + 'px 0 ' + gap + 'px 0;';\n } else if (gutterTem && !fixedWidthTem) {\n var gutterTemUnit = '-' + gutterTem + 'px',\n dir = horizontal ? gutterTemUnit + ' 0 0' : '0 ' + gutterTemUnit + ' 0';\n str = 'margin: 0 ' + dir + ';'\n }\n\n if (!carousel && autoHeightBP && TRANSITIONDURATION && speedTem) { str += getTransitionDurationStyle(speedTem); }\n return str;\n }\n\n function getContainerWidth (fixedWidthTem, gutterTem, itemsTem) {\n if (fixedWidthTem) {\n return (fixedWidthTem + gutterTem) * slideCountNew + 'px';\n } else {\n return CALC ?\n CALC + '(' + slideCountNew * 100 + '% / ' + itemsTem + ')' :\n slideCountNew * 100 / itemsTem + '%';\n }\n }\n\n function getSlideWidthStyle (fixedWidthTem, gutterTem, itemsTem) {\n var width;\n\n if (fixedWidthTem) {\n width = (fixedWidthTem + gutterTem) + 'px';\n } else {\n if (!carousel) { itemsTem = Math.floor(itemsTem); }\n var dividend = carousel ? slideCountNew : itemsTem;\n width = CALC ? \n CALC + '(100% / ' + dividend + ')' : \n 100 / dividend + '%';\n }\n\n width = 'width:' + width;\n\n // inner slider: overwrite outer slider styles\n return nested !== 'inner' ? width + ';' : width + ' !important;';\n }\n\n function getSlideGutterStyle (gutterTem) {\n var str = '';\n\n // gutter maybe interger || 0\n // so can't use 'if (gutter)'\n if (gutterTem !== false) {\n var prop = horizontal ? 'padding-' : 'margin-',\n dir = horizontal ? 'right' : 'bottom';\n str = prop + dir + ': ' + gutterTem + 'px;';\n }\n\n return str;\n }\n\n function getCSSPrefix (name, num) {\n var prefix = name.substring(0, name.length - num).toLowerCase();\n if (prefix) { prefix = '-' + prefix + '-'; }\n\n return prefix;\n }\n\n function getTransitionDurationStyle (speed) {\n return getCSSPrefix(TRANSITIONDURATION, 18) + 'transition-duration:' + speed / 1000 + 's;';\n }\n\n function getAnimationDurationStyle (speed) {\n return getCSSPrefix(ANIMATIONDURATION, 17) + 'animation-duration:' + speed / 1000 + 's;';\n }\n\n function initStructure () {\n var classOuter = 'tns-outer',\n classInner = 'tns-inner',\n hasGutter = hasOption('gutter');\n\n outerWrapper.className = classOuter;\n innerWrapper.className = classInner;\n outerWrapper.id = slideId + '-ow';\n innerWrapper.id = slideId + '-iw';\n\n // set container properties\n if (container.id === '') { container.id = slideId; }\n newContainerClasses += PERCENTAGELAYOUT || autoWidth ? ' tns-subpixel' : ' tns-no-subpixel';\n newContainerClasses += CALC ? ' tns-calc' : ' tns-no-calc';\n if (autoWidth) { newContainerClasses += ' tns-autowidth'; }\n newContainerClasses += ' tns-' + options.axis;\n container.className += newContainerClasses;\n\n // add constrain layer for carousel\n if (carousel) {\n middleWrapper = doc.createElement('div');\n middleWrapper.id = slideId + '-mw';\n middleWrapper.className = 'tns-ovh';\n\n outerWrapper.appendChild(middleWrapper);\n middleWrapper.appendChild(innerWrapper);\n } else {\n outerWrapper.appendChild(innerWrapper);\n }\n\n if (autoHeight) {\n var wp = middleWrapper ? middleWrapper : innerWrapper;\n wp.className += ' tns-ah';\n }\n\n containerParent.insertBefore(outerWrapper, container);\n innerWrapper.appendChild(container);\n\n // add id, class, aria attributes \n // before clone slides\n forEach(slideItems, function(item, i) {\n addClass(item, 'tns-item');\n if (!item.id) { item.id = slideId + '-item' + i; }\n if (!carousel && animateNormal) { addClass(item, animateNormal); }\n setAttrs(item, {\n 'aria-hidden': 'true',\n 'tabindex': '-1'\n });\n });\n\n // ## clone slides\n // carousel: n + slides + n\n // gallery: slides + n\n if (cloneCount) {\n var fragmentBefore = doc.createDocumentFragment(), \n fragmentAfter = doc.createDocumentFragment();\n\n for (var j = cloneCount; j--;) {\n var num = j%slideCount,\n cloneFirst = slideItems[num].cloneNode(true);\n removeAttrs(cloneFirst, 'id');\n fragmentAfter.insertBefore(cloneFirst, fragmentAfter.firstChild);\n\n if (carousel) {\n var cloneLast = slideItems[slideCount - 1 - num].cloneNode(true);\n removeAttrs(cloneLast, 'id');\n fragmentBefore.appendChild(cloneLast);\n }\n }\n\n container.insertBefore(fragmentBefore, container.firstChild);\n container.appendChild(fragmentAfter);\n slideItems = container.children;\n }\n\n }\n\n function initSliderTransform () {\n // ## images loaded/failed\n if (hasOption('autoHeight') || autoWidth || !horizontal) {\n var imgs = container.querySelectorAll('img');\n\n // add complete class if all images are loaded/failed\n forEach(imgs, function(img) {\n var src = img.src;\n \n if (src && src.indexOf('data:image') < 0) {\n addEvents(img, imgEvents);\n img.src = '';\n img.src = src;\n addClass(img, 'loading');\n } else if (!lazyload) {\n imgLoaded(img);\n }\n });\n\n // All imgs are completed\n raf(function(){ imgsLoadedCheck(arrayFromNodeList(imgs), function() { imgsComplete = true; }); });\n\n // Check imgs in window only for auto height\n if (!autoWidth && horizontal) { imgs = getImageArray(index, Math.min(index + items - 1, slideCountNew - 1)); }\n\n lazyload ? initSliderTransformStyleCheck() : raf(function(){ imgsLoadedCheck(arrayFromNodeList(imgs), initSliderTransformStyleCheck); });\n\n } else {\n // set container transform property\n if (carousel) { doContainerTransformSilent(); }\n\n // update slider tools and events\n initTools();\n initEvents();\n }\n }\n\n function initSliderTransformStyleCheck () {\n if (autoWidth) {\n // check styles application\n var num = loop ? index : slideCount - 1;\n (function stylesApplicationCheck() {\n slideItems[num - 1].getBoundingClientRect().right.toFixed(2) === slideItems[num].getBoundingClientRect().left.toFixed(2) ?\n initSliderTransformCore() :\n setTimeout(function(){ stylesApplicationCheck() }, 16);\n })();\n } else {\n initSliderTransformCore();\n }\n }\n\n\n function initSliderTransformCore () {\n // run Fn()s which are rely on image loading\n if (!horizontal || autoWidth) {\n setSlidePositions();\n\n if (autoWidth) {\n rightBoundary = getRightBoundary();\n if (freezable) { freeze = getFreeze(); }\n indexMax = getIndexMax(); // <= slidePositions, rightBoundary <=\n resetVariblesWhenDisable(disable || freeze);\n } else {\n updateContentWrapperHeight();\n }\n }\n\n // set container transform property\n if (carousel) { doContainerTransformSilent(); }\n\n // update slider tools and events\n initTools();\n initEvents();\n }\n\n function initSheet () {\n // gallery:\n // set animation classes and left value for gallery slider\n if (!carousel) { \n for (var i = index, l = index + Math.min(slideCount, items); i < l; i++) {\n var item = slideItems[i];\n item.style.left = (i - index) * 100 / items + '%';\n addClass(item, animateIn);\n removeClass(item, animateNormal);\n }\n }\n\n // #### LAYOUT\n\n // ## INLINE-BLOCK VS FLOAT\n\n // ## PercentageLayout:\n // slides: inline-block\n // remove blank space between slides by set font-size: 0\n\n // ## Non PercentageLayout:\n // slides: float\n // margin-right: -100%\n // margin-left: ~\n\n // Resource: https://docs.google.com/spreadsheets/d/147up245wwTXeQYve3BRSAD4oVcvQmuGsFteJOeA5xNQ/edit?usp=sharing\n if (horizontal) {\n if (PERCENTAGELAYOUT || autoWidth) {\n addCSSRule(sheet, '#' + slideId + ' > .tns-item', 'font-size:' + win.getComputedStyle(slideItems[0]).fontSize + ';', getCssRulesLength(sheet));\n addCSSRule(sheet, '#' + slideId, 'font-size:0;', getCssRulesLength(sheet));\n } else if (carousel) {\n forEach(slideItems, function (slide, i) {\n slide.style.marginLeft = getSlideMarginLeft(i);\n });\n }\n }\n\n\n // ## BASIC STYLES\n if (CSSMQ) {\n // middle wrapper style\n if (TRANSITIONDURATION) {\n var str = middleWrapper && options.autoHeight ? getTransitionDurationStyle(options.speed) : '';\n addCSSRule(sheet, '#' + slideId + '-mw', str, getCssRulesLength(sheet));\n }\n\n // inner wrapper styles\n str = getInnerWrapperStyles(options.edgePadding, options.gutter, options.fixedWidth, options.speed, options.autoHeight);\n addCSSRule(sheet, '#' + slideId + '-iw', str, getCssRulesLength(sheet));\n\n // container styles\n if (carousel) {\n str = horizontal && !autoWidth ? 'width:' + getContainerWidth(options.fixedWidth, options.gutter, options.items) + ';' : '';\n if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); }\n addCSSRule(sheet, '#' + slideId, str, getCssRulesLength(sheet));\n }\n\n // slide styles\n str = horizontal && !autoWidth ? getSlideWidthStyle(options.fixedWidth, options.gutter, options.items) : '';\n if (options.gutter) { str += getSlideGutterStyle(options.gutter); }\n // set gallery items transition-duration\n if (!carousel) {\n if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); }\n if (ANIMATIONDURATION) { str += getAnimationDurationStyle(speed); }\n }\n if (str) { addCSSRule(sheet, '#' + slideId + ' > .tns-item', str, getCssRulesLength(sheet)); }\n\n // non CSS mediaqueries: IE8\n // ## update inner wrapper, container, slides if needed\n // set inline styles for inner wrapper & container\n // insert stylesheet (one line) for slides only (since slides are many)\n } else {\n // middle wrapper styles\n update_carousel_transition_duration();\n\n // inner wrapper styles\n innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, autoHeight);\n\n // container styles\n if (carousel && horizontal && !autoWidth) {\n container.style.width = getContainerWidth(fixedWidth, gutter, items);\n }\n\n // slide styles\n var str = horizontal && !autoWidth ? getSlideWidthStyle(fixedWidth, gutter, items) : '';\n if (gutter) { str += getSlideGutterStyle(gutter); }\n\n // append to the last line\n if (str) { addCSSRule(sheet, '#' + slideId + ' > .tns-item', str, getCssRulesLength(sheet)); }\n }\n\n // ## MEDIAQUERIES\n if (responsive && CSSMQ) {\n for (var bp in responsive) {\n // bp: convert string to number\n bp = parseInt(bp);\n\n var opts = responsive[bp],\n str = '',\n middleWrapperStr = '',\n innerWrapperStr = '',\n containerStr = '',\n slideStr = '',\n itemsBP = !autoWidth ? getOption('items', bp) : null,\n fixedWidthBP = getOption('fixedWidth', bp),\n speedBP = getOption('speed', bp),\n edgePaddingBP = getOption('edgePadding', bp),\n autoHeightBP = getOption('autoHeight', bp),\n gutterBP = getOption('gutter', bp);\n\n // middle wrapper string\n if (TRANSITIONDURATION && middleWrapper && getOption('autoHeight', bp) && 'speed' in opts) {\n middleWrapperStr = '#' + slideId + '-mw{' + getTransitionDurationStyle(speedBP) + '}';\n }\n\n // inner wrapper string\n if ('edgePadding' in opts || 'gutter' in opts) {\n innerWrapperStr = '#' + slideId + '-iw{' + getInnerWrapperStyles(edgePaddingBP, gutterBP, fixedWidthBP, speedBP, autoHeightBP) + '}';\n }\n\n // container string\n if (carousel && horizontal && !autoWidth && ('fixedWidth' in opts || 'items' in opts || (fixedWidth && 'gutter' in opts))) {\n containerStr = 'width:' + getContainerWidth(fixedWidthBP, gutterBP, itemsBP) + ';';\n }\n if (TRANSITIONDURATION && 'speed' in opts) {\n containerStr += getTransitionDurationStyle(speedBP);\n }\n if (containerStr) {\n containerStr = '#' + slideId + '{' + containerStr + '}';\n }\n\n // slide string\n if ('fixedWidth' in opts || (fixedWidth && 'gutter' in opts) || !carousel && 'items' in opts) {\n slideStr += getSlideWidthStyle(fixedWidthBP, gutterBP, itemsBP);\n }\n if ('gutter' in opts) {\n slideStr += getSlideGutterStyle(gutterBP);\n }\n // set gallery items transition-duration\n if (!carousel && 'speed' in opts) {\n if (TRANSITIONDURATION) { slideStr += getTransitionDurationStyle(speedBP); }\n if (ANIMATIONDURATION) { slideStr += getAnimationDurationStyle(speedBP); }\n }\n if (slideStr) { slideStr = '#' + slideId + ' > .tns-item{' + slideStr + '}'; }\n\n // add up\n str = middleWrapperStr + innerWrapperStr + containerStr + slideStr;\n\n if (str) {\n sheet.insertRule('@media (min-width: ' + bp / 16 + 'em) {' + str + '}', sheet.cssRules.length);\n }\n }\n }\n }\n\n function initTools () {\n // == slides ==\n updateSlideStatus();\n\n // == live region ==\n outerWrapper.insertAdjacentHTML('afterbegin', '
slide ' + getLiveRegionStr() + ' of ' + slideCount + '
');\n liveregionCurrent = outerWrapper.querySelector('.tns-liveregion .current');\n\n // == autoplayInit ==\n if (hasAutoplay) {\n var txt = autoplay ? 'stop' : 'start';\n if (autoplayButton) {\n setAttrs(autoplayButton, {'data-action': txt});\n } else if (options.autoplayButtonOutput) {\n outerWrapper.insertAdjacentHTML(getInsertPosition(options.autoplayPosition), '');\n autoplayButton = outerWrapper.querySelector('[data-action]');\n }\n\n // add event\n if (autoplayButton) {\n addEvents(autoplayButton, {'click': toggleAutoplay});\n }\n\n if (autoplay) {\n startAutoplay();\n if (autoplayHoverPause) { addEvents(container, hoverEvents); }\n if (autoplayResetOnVisibility) { addEvents(container, visibilityEvent); }\n }\n }\n \n // == navInit ==\n if (hasNav) {\n var initIndex = !carousel ? 0 : cloneCount;\n // customized nav\n // will not hide the navs in case they're thumbnails\n if (navContainer) {\n setAttrs(navContainer, {'aria-label': 'Carousel Pagination'});\n navItems = navContainer.children;\n forEach(navItems, function(item, i) {\n setAttrs(item, {\n 'data-nav': i,\n 'tabindex': '-1',\n 'aria-label': navStr + (i + 1),\n 'aria-controls': slideId,\n });\n });\n\n // generated nav \n } else {\n var navHtml = '',\n hiddenStr = navAsThumbnails ? '' : 'style=\"display:none\"';\n for (var i = 0; i < slideCount; i++) {\n // hide nav items by default\n navHtml += '';\n }\n navHtml = '
' + navHtml + '
';\n outerWrapper.insertAdjacentHTML(getInsertPosition(options.navPosition), navHtml);\n\n navContainer = outerWrapper.querySelector('.tns-nav');\n navItems = navContainer.children;\n }\n\n updateNavVisibility();\n\n // add transition\n if (TRANSITIONDURATION) {\n var prefix = TRANSITIONDURATION.substring(0, TRANSITIONDURATION.length - 18).toLowerCase(),\n str = 'transition: all ' + speed / 1000 + 's';\n\n if (prefix) {\n str = '-' + prefix + '-' + str;\n }\n\n addCSSRule(sheet, '[aria-controls^=' + slideId + '-item]', str, getCssRulesLength(sheet));\n }\n\n setAttrs(navItems[navCurrentIndex], {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent});\n removeAttrs(navItems[navCurrentIndex], 'tabindex');\n addClass(navItems[navCurrentIndex], navActiveClass);\n\n // add events\n addEvents(navContainer, navEvents);\n }\n\n\n\n // == controlsInit ==\n if (hasControls) {\n if (!controlsContainer && (!prevButton || !nextButton)) {\n outerWrapper.insertAdjacentHTML(getInsertPosition(options.controlsPosition), '
');\n\n controlsContainer = outerWrapper.querySelector('.tns-controls');\n }\n\n if (!prevButton || !nextButton) {\n prevButton = controlsContainer.children[0];\n nextButton = controlsContainer.children[1];\n }\n\n if (options.controlsContainer) {\n setAttrs(controlsContainer, {\n 'aria-label': 'Carousel Navigation',\n 'tabindex': '0'\n });\n }\n\n if (options.controlsContainer || (options.prevButton && options.nextButton)) {\n setAttrs([prevButton, nextButton], {\n 'aria-controls': slideId,\n 'tabindex': '-1',\n });\n }\n \n if (options.controlsContainer || (options.prevButton && options.nextButton)) {\n setAttrs(prevButton, {'data-controls' : 'prev'});\n setAttrs(nextButton, {'data-controls' : 'next'});\n }\n\n prevIsButton = isButton(prevButton);\n nextIsButton = isButton(nextButton);\n\n updateControlsStatus();\n\n // add events\n if (controlsContainer) {\n addEvents(controlsContainer, controlsEvents);\n } else {\n addEvents(prevButton, controlsEvents);\n addEvents(nextButton, controlsEvents);\n }\n }\n\n // hide tools if needed\n disableUI();\n }\n\n function initEvents () {\n // add events\n if (carousel && TRANSITIONEND) {\n var eve = {};\n eve[TRANSITIONEND] = onTransitionEnd;\n addEvents(container, eve);\n }\n\n if (touch) { addEvents(container, touchEvents, options.preventScrollOnTouch); }\n if (mouseDrag) { addEvents(container, dragEvents); }\n if (arrowKeys) { addEvents(doc, docmentKeydownEvent); }\n\n if (nested === 'inner') {\n events.on('outerResized', function () {\n resizeTasks();\n events.emit('innerLoaded', info());\n });\n } else if (responsive || fixedWidth || autoWidth || autoHeight || !horizontal) {\n addEvents(win, {'resize': onResize});\n }\n\n if (autoHeight) {\n if (nested === 'outer') {\n events.on('innerLoaded', doAutoHeight);\n } else if (!disable) { doAutoHeight(); }\n }\n\n doLazyLoad();\n if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); }\n\n events.on('indexChanged', additionalUpdates);\n if (nested === 'inner') { events.emit('innerLoaded', info()); }\n if (typeof onInit === 'function') { onInit(info()); }\n isOn = true;\n }\n\n function destroy () {\n // sheet\n sheet.disabled = true;\n if (sheet.ownerNode) { sheet.ownerNode.remove(); }\n\n // remove win event listeners\n removeEvents(win, {'resize': onResize});\n\n // arrowKeys, controls, nav\n if (arrowKeys) { removeEvents(doc, docmentKeydownEvent); }\n if (controlsContainer) { removeEvents(controlsContainer, controlsEvents); }\n if (navContainer) { removeEvents(navContainer, navEvents); }\n\n // autoplay\n removeEvents(container, hoverEvents);\n removeEvents(container, visibilityEvent);\n if (autoplayButton) { removeEvents(autoplayButton, {'click': toggleAutoplay}); }\n if (autoplay) { clearInterval(autoplayTimer); }\n\n // container\n if (carousel && TRANSITIONEND) {\n var eve = {};\n eve[TRANSITIONEND] = onTransitionEnd;\n removeEvents(container, eve);\n }\n if (touch) { removeEvents(container, touchEvents); }\n if (mouseDrag) { removeEvents(container, dragEvents); }\n\n // cache Object values in options && reset HTML\n var htmlList = [containerHTML, controlsContainerHTML, prevButtonHTML, nextButtonHTML, navContainerHTML, autoplayButtonHTML];\n\n tnsList.forEach(function(item, i) {\n var el = item === 'container' ? outerWrapper : options[item];\n\n if (typeof el === 'object') {\n var prevEl = el.previousElementSibling ? el.previousElementSibling : false,\n parentEl = el.parentNode;\n el.outerHTML = htmlList[i];\n options[item] = prevEl ? prevEl.nextElementSibling : parentEl.firstElementChild;\n }\n });\n\n\n // reset variables\n tnsList = animateIn = animateOut = animateDelay = animateNormal = horizontal = outerWrapper = innerWrapper = container = containerParent = containerHTML = slideItems = slideCount = breakpointZone = windowWidth = autoWidth = fixedWidth = edgePadding = gutter = viewport = items = slideBy = viewportMax = arrowKeys = speed = rewind = loop = autoHeight = sheet = lazyload = slidePositions = slideItemsOut = cloneCount = slideCountNew = hasRightDeadZone = rightBoundary = updateIndexBeforeTransform = transformAttr = transformPrefix = transformPostfix = getIndexMax = index = indexCached = indexMin = indexMax = resizeTimer = swipeAngle = moveDirectionExpected = running = onInit = events = newContainerClasses = slideId = disable = disabled = freezable = freeze = frozen = controlsEvents = navEvents = hoverEvents = visibilityEvent = docmentKeydownEvent = touchEvents = dragEvents = hasControls = hasNav = navAsThumbnails = hasAutoplay = hasTouch = hasMouseDrag = slideActiveClass = imgCompleteClass = imgEvents = imgsComplete = controls = controlsText = controlsContainer = controlsContainerHTML = prevButton = nextButton = prevIsButton = nextIsButton = nav = navContainer = navContainerHTML = navItems = pages = pagesCached = navClicked = navCurrentIndex = navCurrentIndexCached = navActiveClass = navStr = navStrCurrent = autoplay = autoplayTimeout = autoplayDirection = autoplayText = autoplayHoverPause = autoplayButton = autoplayButtonHTML = autoplayResetOnVisibility = autoplayHtmlStrings = autoplayTimer = animating = autoplayHoverPaused = autoplayUserPaused = autoplayVisibilityPaused = initPosition = lastPosition = translateInit = disX = disY = panStart = rafIndex = getDist = touch = mouseDrag = null;\n // check variables\n // [animateIn, animateOut, animateDelay, animateNormal, horizontal, outerWrapper, innerWrapper, container, containerParent, containerHTML, slideItems, slideCount, breakpointZone, windowWidth, autoWidth, fixedWidth, edgePadding, gutter, viewport, items, slideBy, viewportMax, arrowKeys, speed, rewind, loop, autoHeight, sheet, lazyload, slidePositions, slideItemsOut, cloneCount, slideCountNew, hasRightDeadZone, rightBoundary, updateIndexBeforeTransform, transformAttr, transformPrefix, transformPostfix, getIndexMax, index, indexCached, indexMin, indexMax, resizeTimer, swipeAngle, moveDirectionExpected, running, onInit, events, newContainerClasses, slideId, disable, disabled, freezable, freeze, frozen, controlsEvents, navEvents, hoverEvents, visibilityEvent, docmentKeydownEvent, touchEvents, dragEvents, hasControls, hasNav, navAsThumbnails, hasAutoplay, hasTouch, hasMouseDrag, slideActiveClass, imgCompleteClass, imgEvents, imgsComplete, controls, controlsText, controlsContainer, controlsContainerHTML, prevButton, nextButton, prevIsButton, nextIsButton, nav, navContainer, navContainerHTML, navItems, pages, pagesCached, navClicked, navCurrentIndex, navCurrentIndexCached, navActiveClass, navStr, navStrCurrent, autoplay, autoplayTimeout, autoplayDirection, autoplayText, autoplayHoverPause, autoplayButton, autoplayButtonHTML, autoplayResetOnVisibility, autoplayHtmlStrings, autoplayTimer, animating, autoplayHoverPaused, autoplayUserPaused, autoplayVisibilityPaused, initPosition, lastPosition, translateInit, disX, disY, panStart, rafIndex, getDist, touch, mouseDrag ].forEach(function(item) { if (item !== null) { console.log(item); } });\n\n for (var a in this) {\n if (a !== 'rebuild') { this[a] = null; }\n }\n isOn = false;\n }\n\n// === ON RESIZE ===\n // responsive || fixedWidth || autoWidth || !horizontal\n function onResize (e) {\n raf(function(){ resizeTasks(getEvent(e)); });\n }\n\n function resizeTasks (e) {\n if (!isOn) { return; }\n if (nested === 'outer') { events.emit('outerResized', info(e)); }\n windowWidth = getWindowWidth();\n var bpChanged,\n breakpointZoneTem = breakpointZone,\n needContainerTransform = false;\n\n if (responsive) {\n setBreakpointZone();\n bpChanged = breakpointZoneTem !== breakpointZone;\n // if (hasRightDeadZone) { needContainerTransform = true; } // *?\n if (bpChanged) { events.emit('newBreakpointStart', info(e)); }\n }\n\n var indChanged,\n itemsChanged,\n itemsTem = items,\n disableTem = disable,\n freezeTem = freeze,\n arrowKeysTem = arrowKeys,\n controlsTem = controls,\n navTem = nav,\n touchTem = touch,\n mouseDragTem = mouseDrag,\n autoplayTem = autoplay,\n autoplayHoverPauseTem = autoplayHoverPause,\n autoplayResetOnVisibilityTem = autoplayResetOnVisibility,\n indexTem = index;\n\n if (bpChanged) {\n var fixedWidthTem = fixedWidth,\n autoHeightTem = autoHeight,\n controlsTextTem = controlsText,\n centerTem = center,\n autoplayTextTem = autoplayText;\n\n if (!CSSMQ) {\n var gutterTem = gutter,\n edgePaddingTem = edgePadding;\n }\n }\n\n // get option:\n // fixed width: viewport, fixedWidth, gutter => items\n // others: window width => all variables\n // all: items => slideBy\n arrowKeys = getOption('arrowKeys');\n controls = getOption('controls');\n nav = getOption('nav');\n touch = getOption('touch');\n center = getOption('center');\n mouseDrag = getOption('mouseDrag');\n autoplay = getOption('autoplay');\n autoplayHoverPause = getOption('autoplayHoverPause');\n autoplayResetOnVisibility = getOption('autoplayResetOnVisibility');\n\n if (bpChanged) {\n disable = getOption('disable');\n fixedWidth = getOption('fixedWidth');\n speed = getOption('speed');\n autoHeight = getOption('autoHeight');\n controlsText = getOption('controlsText');\n autoplayText = getOption('autoplayText');\n autoplayTimeout = getOption('autoplayTimeout');\n\n if (!CSSMQ) {\n edgePadding = getOption('edgePadding');\n gutter = getOption('gutter');\n }\n }\n // update options\n resetVariblesWhenDisable(disable);\n\n viewport = getViewportWidth(); // <= edgePadding, gutter\n if ((!horizontal || autoWidth) && !disable) {\n setSlidePositions();\n if (!horizontal) {\n updateContentWrapperHeight(); // <= setSlidePositions\n needContainerTransform = true;\n }\n }\n if (fixedWidth || autoWidth) {\n rightBoundary = getRightBoundary(); // autoWidth: <= viewport, slidePositions, gutter\n // fixedWidth: <= viewport, fixedWidth, gutter\n indexMax = getIndexMax(); // autoWidth: <= rightBoundary, slidePositions\n // fixedWidth: <= rightBoundary, fixedWidth, gutter\n }\n\n if (bpChanged || fixedWidth) {\n items = getOption('items');\n slideBy = getOption('slideBy');\n itemsChanged = items !== itemsTem;\n\n if (itemsChanged) {\n if (!fixedWidth && !autoWidth) { indexMax = getIndexMax(); } // <= items\n // check index before transform in case\n // slider reach the right edge then items become bigger\n updateIndex();\n }\n }\n \n if (bpChanged) {\n if (disable !== disableTem) {\n if (disable) {\n disableSlider();\n } else {\n enableSlider(); // <= slidePositions, rightBoundary, indexMax\n }\n }\n }\n\n if (freezable && (bpChanged || fixedWidth || autoWidth)) {\n freeze = getFreeze(); // <= autoWidth: slidePositions, gutter, viewport, rightBoundary\n // <= fixedWidth: fixedWidth, gutter, rightBoundary\n // <= others: items\n\n if (freeze !== freezeTem) {\n if (freeze) {\n doContainerTransform(getContainerTransformValue(getStartIndex(0)));\n freezeSlider();\n } else {\n unfreezeSlider();\n needContainerTransform = true;\n }\n }\n }\n\n resetVariblesWhenDisable(disable || freeze); // controls, nav, touch, mouseDrag, arrowKeys, autoplay, autoplayHoverPause, autoplayResetOnVisibility\n if (!autoplay) { autoplayHoverPause = autoplayResetOnVisibility = false; }\n\n if (arrowKeys !== arrowKeysTem) {\n arrowKeys ?\n addEvents(doc, docmentKeydownEvent) :\n removeEvents(doc, docmentKeydownEvent);\n }\n if (controls !== controlsTem) {\n if (controls) {\n if (controlsContainer) {\n showElement(controlsContainer);\n } else {\n if (prevButton) { showElement(prevButton); }\n if (nextButton) { showElement(nextButton); }\n }\n } else {\n if (controlsContainer) {\n hideElement(controlsContainer);\n } else {\n if (prevButton) { hideElement(prevButton); }\n if (nextButton) { hideElement(nextButton); }\n }\n }\n }\n if (nav !== navTem) {\n nav ?\n showElement(navContainer) :\n hideElement(navContainer);\n }\n if (touch !== touchTem) {\n touch ?\n addEvents(container, touchEvents, options.preventScrollOnTouch) :\n removeEvents(container, touchEvents);\n }\n if (mouseDrag !== mouseDragTem) {\n mouseDrag ?\n addEvents(container, dragEvents) :\n removeEvents(container, dragEvents);\n }\n if (autoplay !== autoplayTem) {\n if (autoplay) {\n if (autoplayButton) { showElement(autoplayButton); }\n if (!animating && !autoplayUserPaused) { startAutoplay(); }\n } else {\n if (autoplayButton) { hideElement(autoplayButton); }\n if (animating) { stopAutoplay(); }\n }\n }\n if (autoplayHoverPause !== autoplayHoverPauseTem) {\n autoplayHoverPause ?\n addEvents(container, hoverEvents) :\n removeEvents(container, hoverEvents);\n }\n if (autoplayResetOnVisibility !== autoplayResetOnVisibilityTem) {\n autoplayResetOnVisibility ?\n addEvents(doc, visibilityEvent) :\n removeEvents(doc, visibilityEvent);\n }\n\n if (bpChanged) {\n if (fixedWidth !== fixedWidthTem || center !== centerTem) { needContainerTransform = true; }\n\n if (autoHeight !== autoHeightTem) {\n if (!autoHeight) { innerWrapper.style.height = ''; }\n }\n\n if (controls && controlsText !== controlsTextTem) {\n prevButton.innerHTML = controlsText[0];\n nextButton.innerHTML = controlsText[1];\n }\n\n if (autoplayButton && autoplayText !== autoplayTextTem) {\n var i = autoplay ? 1 : 0,\n html = autoplayButton.innerHTML,\n len = html.length - autoplayTextTem[i].length;\n if (html.substring(len) === autoplayTextTem[i]) {\n autoplayButton.innerHTML = html.substring(0, len) + autoplayText[i];\n }\n }\n } else {\n if (center && (fixedWidth || autoWidth)) { needContainerTransform = true; }\n }\n\n if (itemsChanged || fixedWidth && !autoWidth) {\n pages = getPages();\n updateNavVisibility();\n }\n\n indChanged = index !== indexTem;\n if (indChanged) { \n events.emit('indexChanged', info());\n needContainerTransform = true;\n } else if (itemsChanged) {\n if (!indChanged) { additionalUpdates(); }\n } else if (fixedWidth || autoWidth) {\n doLazyLoad(); \n updateSlideStatus();\n updateLiveRegion();\n }\n\n if (itemsChanged && !carousel) { updateGallerySlidePositions(); }\n\n if (!disable && !freeze) {\n // non-meduaqueries: IE8\n if (bpChanged && !CSSMQ) {\n // middle wrapper styles\n if (autoHeight !== autoheightTem || speed !== speedTem) {\n update_carousel_transition_duration();\n }\n\n // inner wrapper styles\n if (edgePadding !== edgePaddingTem || gutter !== gutterTem) {\n innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, speed, autoHeight);\n }\n\n if (horizontal) {\n // container styles\n if (carousel) {\n container.style.width = getContainerWidth(fixedWidth, gutter, items);\n }\n\n // slide styles\n var str = getSlideWidthStyle(fixedWidth, gutter, items) + \n getSlideGutterStyle(gutter);\n\n // remove the last line and\n // add new styles\n removeCSSRule(sheet, getCssRulesLength(sheet) - 1);\n addCSSRule(sheet, '#' + slideId + ' > .tns-item', str, getCssRulesLength(sheet));\n }\n }\n\n // auto height\n if (autoHeight) { doAutoHeight(); }\n\n if (needContainerTransform) {\n doContainerTransformSilent();\n indexCached = index;\n }\n }\n\n if (bpChanged) { events.emit('newBreakpointEnd', info(e)); }\n }\n\n\n\n\n\n // === INITIALIZATION FUNCTIONS === //\n function getFreeze () {\n if (!fixedWidth && !autoWidth) {\n var a = center ? items - (items - 1) / 2 : items;\n return slideCount <= a;\n }\n\n var width = fixedWidth ? (fixedWidth + gutter) * slideCount : slidePositions[slideCount],\n vp = edgePadding ? viewport + edgePadding * 2 : viewport + gutter;\n\n if (center) {\n vp -= fixedWidth ? (viewport - fixedWidth) / 2 : (viewport - (slidePositions[index + 1] - slidePositions[index] - gutter)) / 2;\n }\n\n return width <= vp;\n }\n\n function setBreakpointZone () {\n breakpointZone = 0;\n for (var bp in responsive) {\n bp = parseInt(bp); // convert string to number\n if (windowWidth >= bp) { breakpointZone = bp; }\n }\n }\n\n // (slideBy, indexMin, indexMax) => index\n var updateIndex = (function () {\n return loop ? \n carousel ?\n // loop + carousel\n function () {\n var leftEdge = indexMin,\n rightEdge = indexMax;\n\n leftEdge += slideBy;\n rightEdge -= slideBy;\n\n // adjust edges when has edge paddings\n // or fixed-width slider with extra space on the right side\n if (edgePadding) {\n leftEdge += 1;\n rightEdge -= 1;\n } else if (fixedWidth) {\n if ((viewport + gutter)%(fixedWidth + gutter)) { rightEdge -= 1; }\n }\n\n if (cloneCount) {\n if (index > rightEdge) {\n index -= slideCount;\n } else if (index < leftEdge) {\n index += slideCount;\n }\n }\n } :\n // loop + gallery\n function() {\n if (index > indexMax) {\n while (index >= indexMin + slideCount) { index -= slideCount; }\n } else if (index < indexMin) {\n while (index <= indexMax - slideCount) { index += slideCount; }\n }\n } :\n // non-loop\n function() {\n index = Math.max(indexMin, Math.min(indexMax, index));\n };\n })();\n\n function disableUI () {\n if (!autoplay && autoplayButton) { hideElement(autoplayButton); }\n if (!nav && navContainer) { hideElement(navContainer); }\n if (!controls) {\n if (controlsContainer) {\n hideElement(controlsContainer);\n } else {\n if (prevButton) { hideElement(prevButton); }\n if (nextButton) { hideElement(nextButton); }\n }\n }\n }\n\n function enableUI () {\n if (autoplay && autoplayButton) { showElement(autoplayButton); }\n if (nav && navContainer) { showElement(navContainer); }\n if (controls) {\n if (controlsContainer) {\n showElement(controlsContainer);\n } else {\n if (prevButton) { showElement(prevButton); }\n if (nextButton) { showElement(nextButton); }\n }\n }\n }\n\n function freezeSlider () {\n if (frozen) { return; }\n\n // remove edge padding from inner wrapper\n if (edgePadding) { innerWrapper.style.margin = '0px'; }\n\n // add class tns-transparent to cloned slides\n if (cloneCount) {\n var str = 'tns-transparent';\n for (var i = cloneCount; i--;) {\n if (carousel) { addClass(slideItems[i], str); }\n addClass(slideItems[slideCountNew - i - 1], str);\n }\n }\n\n // update tools\n disableUI();\n\n frozen = true;\n }\n\n function unfreezeSlider () {\n if (!frozen) { return; }\n\n // restore edge padding for inner wrapper\n // for mordern browsers\n if (edgePadding && CSSMQ) { innerWrapper.style.margin = ''; }\n\n // remove class tns-transparent to cloned slides\n if (cloneCount) {\n var str = 'tns-transparent';\n for (var i = cloneCount; i--;) {\n if (carousel) { removeClass(slideItems[i], str); }\n removeClass(slideItems[slideCountNew - i - 1], str);\n }\n }\n\n // update tools\n enableUI();\n\n frozen = false;\n }\n\n function disableSlider () {\n if (disabled) { return; }\n\n sheet.disabled = true;\n container.className = container.className.replace(newContainerClasses.substring(1), '');\n removeAttrs(container, ['style']);\n if (loop) {\n for (var j = cloneCount; j--;) {\n if (carousel) { hideElement(slideItems[j]); }\n hideElement(slideItems[slideCountNew - j - 1]);\n }\n }\n\n // vertical slider\n if (!horizontal || !carousel) { removeAttrs(innerWrapper, ['style']); }\n\n // gallery\n if (!carousel) { \n for (var i = index, l = index + slideCount; i < l; i++) {\n var item = slideItems[i];\n removeAttrs(item, ['style']);\n removeClass(item, animateIn);\n removeClass(item, animateNormal);\n }\n }\n\n // update tools\n disableUI();\n\n disabled = true;\n }\n\n function enableSlider () {\n if (!disabled) { return; }\n\n sheet.disabled = false;\n container.className += newContainerClasses;\n doContainerTransformSilent();\n\n if (loop) {\n for (var j = cloneCount; j--;) {\n if (carousel) { showElement(slideItems[j]); }\n showElement(slideItems[slideCountNew - j - 1]);\n }\n }\n\n // gallery\n if (!carousel) { \n for (var i = index, l = index + slideCount; i < l; i++) {\n var item = slideItems[i],\n classN = i < index + items ? animateIn : animateNormal;\n item.style.left = (i - index) * 100 / items + '%';\n addClass(item, classN);\n }\n }\n\n // update tools\n enableUI();\n\n disabled = false;\n }\n\n function updateLiveRegion () {\n var str = getLiveRegionStr();\n if (liveregionCurrent.innerHTML !== str) { liveregionCurrent.innerHTML = str; }\n }\n\n function getLiveRegionStr () {\n var arr = getVisibleSlideRange(),\n start = arr[0] + 1,\n end = arr[1] + 1;\n return start === end ? start + '' : start + ' to ' + end; \n }\n\n function getVisibleSlideRange (val) {\n if (val == null) { val = getContainerTransformValue(); }\n var start = index, end, rangestart, rangeend;\n\n // get range start, range end for autoWidth and fixedWidth\n if (center || edgePadding) {\n if (autoWidth || fixedWidth) {\n rangestart = - (parseFloat(val) + edgePadding);\n rangeend = rangestart + viewport + edgePadding * 2;\n }\n } else {\n if (autoWidth) {\n rangestart = slidePositions[index];\n rangeend = rangestart + viewport;\n }\n }\n\n // get start, end\n // - check auto width\n if (autoWidth) {\n slidePositions.forEach(function(point, i) {\n if (i < slideCountNew) {\n if ((center || edgePadding) && point <= rangestart + 0.5) { start = i; }\n if (rangeend - point >= 0.5) { end = i; }\n }\n });\n\n // - check percentage width, fixed width\n } else {\n\n if (fixedWidth) {\n var cell = fixedWidth + gutter;\n if (center || edgePadding) {\n start = Math.floor(rangestart/cell);\n end = Math.ceil(rangeend/cell - 1);\n } else {\n end = start + Math.ceil(viewport/cell) - 1;\n }\n\n } else {\n if (center || edgePadding) {\n var a = items - 1;\n if (center) {\n start -= a / 2;\n end = index + a / 2;\n } else {\n end = index + a;\n }\n\n if (edgePadding) {\n var b = edgePadding * items / viewport;\n start -= b;\n end += b;\n }\n\n start = Math.floor(start);\n end = Math.ceil(end);\n } else {\n end = start + items - 1;\n }\n }\n\n start = Math.max(start, 0);\n end = Math.min(end, slideCountNew - 1);\n }\n\n return [start, end];\n }\n\n function doLazyLoad () {\n if (lazyload && !disable) {\n getImageArray.apply(null, getVisibleSlideRange()).forEach(function (img) {\n if (!hasClass(img, imgCompleteClass)) {\n // stop propagation transitionend event to container\n var eve = {};\n eve[TRANSITIONEND] = function (e) { e.stopPropagation(); };\n addEvents(img, eve);\n\n addEvents(img, imgEvents);\n\n // update src\n img.src = getAttr(img, 'data-src');\n\n // update srcset\n var srcset = getAttr(img, 'data-srcset');\n if (srcset) { img.srcset = srcset; }\n\n addClass(img, 'loading');\n }\n });\n }\n }\n\n function onImgLoaded (e) {\n imgLoaded(getTarget(e));\n }\n\n function onImgFailed (e) {\n imgFailed(getTarget(e));\n }\n\n function imgLoaded (img) {\n addClass(img, 'loaded');\n imgCompleted(img);\n }\n\n function imgFailed (img) {\n addClass(img, 'failed');\n imgCompleted(img);\n }\n\n function imgCompleted (img) {\n addClass(img, 'tns-complete');\n removeClass(img, 'loading');\n removeEvents(img, imgEvents);\n }\n\n function getImageArray (start, end) {\n var imgs = [];\n while (start <= end) {\n forEach(slideItems[start].querySelectorAll('img'), function (img) { imgs.push(img); });\n start++;\n }\n\n return imgs;\n }\n\n // check if all visible images are loaded\n // and update container height if it's done\n function doAutoHeight () {\n var imgs = getImageArray.apply(null, getVisibleSlideRange());\n raf(function(){ imgsLoadedCheck(imgs, updateInnerWrapperHeight); });\n }\n\n function imgsLoadedCheck (imgs, cb) {\n // directly execute callback function if all images are complete\n if (imgsComplete) { return cb(); }\n\n // check selected image classes otherwise\n imgs.forEach(function (img, index) {\n if (hasClass(img, imgCompleteClass)) { imgs.splice(index, 1); }\n });\n\n // execute callback function if selected images are all complete\n if (!imgs.length) { return cb(); }\n\n // otherwise execute this functiona again\n raf(function(){ imgsLoadedCheck(imgs, cb); });\n } \n\n function additionalUpdates () {\n doLazyLoad(); \n updateSlideStatus();\n updateLiveRegion();\n updateControlsStatus();\n updateNavStatus();\n }\n\n\n function update_carousel_transition_duration () {\n if (carousel && autoHeight) {\n middleWrapper.style[TRANSITIONDURATION] = speed / 1000 + 's';\n }\n }\n\n function getMaxSlideHeight (slideStart, slideRange) {\n var heights = [];\n for (var i = slideStart, l = Math.min(slideStart + slideRange, slideCountNew); i < l; i++) {\n heights.push(slideItems[i].offsetHeight);\n }\n\n return Math.max.apply(null, heights);\n }\n\n // update inner wrapper height\n // 1. get the max-height of the visible slides\n // 2. set transitionDuration to speed\n // 3. update inner wrapper height to max-height\n // 4. set transitionDuration to 0s after transition done\n function updateInnerWrapperHeight () {\n var maxHeight = autoHeight ? getMaxSlideHeight(index, items) : getMaxSlideHeight(cloneCount, slideCount),\n wp = middleWrapper ? middleWrapper : innerWrapper;\n\n if (wp.style.height !== maxHeight) { wp.style.height = maxHeight + 'px'; }\n }\n\n // get the distance from the top edge of the first slide to each slide\n // (init) => slidePositions\n function setSlidePositions () {\n slidePositions = [0];\n var attr = horizontal ? 'left' : 'top',\n attr2 = horizontal ? 'right' : 'bottom',\n base = slideItems[0].getBoundingClientRect()[attr];\n\n forEach(slideItems, function(item, i) {\n // skip the first slide\n if (i) { slidePositions.push(item.getBoundingClientRect()[attr] - base); }\n // add the end edge\n if (i === slideCountNew - 1) { slidePositions.push(item.getBoundingClientRect()[attr2] - base); }\n });\n }\n\n // update slide\n function updateSlideStatus () {\n var range = getVisibleSlideRange(),\n start = range[0],\n end = range[1];\n\n forEach(slideItems, function(item, i) {\n // show slides\n if (i >= start && i <= end) {\n if (hasAttr(item, 'aria-hidden')) {\n removeAttrs(item, ['aria-hidden', 'tabindex']);\n addClass(item, slideActiveClass);\n }\n // hide slides\n } else {\n if (!hasAttr(item, 'aria-hidden')) {\n setAttrs(item, {\n 'aria-hidden': 'true',\n 'tabindex': '-1'\n });\n removeClass(item, slideActiveClass);\n }\n }\n });\n }\n\n // gallery: update slide position\n function updateGallerySlidePositions () {\n var l = index + Math.min(slideCount, items);\n for (var i = slideCountNew; i--;) {\n var item = slideItems[i];\n\n if (i >= index && i < l) {\n // add transitions to visible slides when adjusting their positions\n addClass(item, 'tns-moving');\n\n item.style.left = (i - index) * 100 / items + '%';\n addClass(item, animateIn);\n removeClass(item, animateNormal);\n } else if (item.style.left) {\n item.style.left = '';\n addClass(item, animateNormal);\n removeClass(item, animateIn);\n }\n\n // remove outlet animation\n removeClass(item, animateOut);\n }\n\n // removing '.tns-moving'\n setTimeout(function() {\n forEach(slideItems, function(el) {\n removeClass(el, 'tns-moving');\n });\n }, 300);\n }\n\n // set tabindex on Nav\n function updateNavStatus () {\n // get current nav\n if (nav) {\n navCurrentIndex = navClicked >= 0 ? navClicked : getCurrentNavIndex();\n navClicked = -1;\n\n if (navCurrentIndex !== navCurrentIndexCached) {\n var navPrev = navItems[navCurrentIndexCached],\n navCurrent = navItems[navCurrentIndex];\n\n setAttrs(navPrev, {\n 'tabindex': '-1',\n 'aria-label': navStr + (navCurrentIndexCached + 1)\n });\n removeClass(navPrev, navActiveClass);\n \n setAttrs(navCurrent, {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent});\n removeAttrs(navCurrent, 'tabindex');\n addClass(navCurrent, navActiveClass);\n\n navCurrentIndexCached = navCurrentIndex;\n }\n }\n }\n\n function getLowerCaseNodeName (el) {\n return el.nodeName.toLowerCase();\n }\n\n function isButton (el) {\n return getLowerCaseNodeName(el) === 'button';\n }\n\n function isAriaDisabled (el) {\n return el.getAttribute('aria-disabled') === 'true';\n }\n\n function disEnableElement (isButton, el, val) {\n if (isButton) {\n el.disabled = val;\n } else {\n el.setAttribute('aria-disabled', val.toString());\n }\n }\n\n // set 'disabled' to true on controls when reach the edges\n function updateControlsStatus () {\n if (!controls || rewind || loop) { return; }\n\n var prevDisabled = (prevIsButton) ? prevButton.disabled : isAriaDisabled(prevButton),\n nextDisabled = (nextIsButton) ? nextButton.disabled : isAriaDisabled(nextButton),\n disablePrev = (index <= indexMin) ? true : false,\n disableNext = (!rewind && index >= indexMax) ? true : false;\n\n if (disablePrev && !prevDisabled) {\n disEnableElement(prevIsButton, prevButton, true);\n }\n if (!disablePrev && prevDisabled) {\n disEnableElement(prevIsButton, prevButton, false);\n }\n if (disableNext && !nextDisabled) {\n disEnableElement(nextIsButton, nextButton, true);\n }\n if (!disableNext && nextDisabled) {\n disEnableElement(nextIsButton, nextButton, false);\n }\n }\n\n // set duration\n function resetDuration (el, str) {\n if (TRANSITIONDURATION) { el.style[TRANSITIONDURATION] = str; }\n }\n\n function getSliderWidth () {\n return fixedWidth ? (fixedWidth + gutter) * slideCountNew : slidePositions[slideCountNew];\n }\n\n function getCenterGap (num) {\n if (num == null) { num = index; }\n\n var gap = edgePadding ? gutter : 0;\n return autoWidth ? ((viewport - gap) - (slidePositions[num + 1] - slidePositions[num] - gutter))/2 :\n fixedWidth ? (viewport - fixedWidth) / 2 :\n (items - 1) / 2;\n }\n\n function getRightBoundary () {\n var gap = edgePadding ? gutter : 0,\n result = (viewport + gap) - getSliderWidth();\n\n if (center && !loop) {\n result = fixedWidth ? - (fixedWidth + gutter) * (slideCountNew - 1) - getCenterGap() :\n getCenterGap(slideCountNew - 1) - slidePositions[slideCountNew - 1];\n }\n if (result > 0) { result = 0; }\n\n return result;\n }\n\n function getContainerTransformValue (num) {\n if (num == null) { num = index; }\n\n var val;\n if (horizontal && !autoWidth) {\n if (fixedWidth) {\n val = - (fixedWidth + gutter) * num;\n if (center) { val += getCenterGap(); }\n } else {\n var denominator = TRANSFORM ? slideCountNew : items;\n if (center) { num -= getCenterGap(); }\n val = - num * 100 / denominator;\n }\n } else {\n val = - slidePositions[num];\n if (center && autoWidth) {\n val += getCenterGap();\n }\n }\n\n if (hasRightDeadZone) { val = Math.max(val, rightBoundary); }\n\n val += (horizontal && !autoWidth && !fixedWidth) ? '%' : 'px';\n\n return val;\n }\n\n function doContainerTransformSilent (val) {\n resetDuration(container, '0s');\n doContainerTransform(val);\n }\n\n function doContainerTransform (val) {\n if (val == null) { val = getContainerTransformValue(); }\n container.style[transformAttr] = transformPrefix + val + transformPostfix;\n }\n\n function animateSlide (number, classOut, classIn, isOut) {\n var l = number + items;\n if (!loop) { l = Math.min(l, slideCountNew); }\n\n for (var i = number; i < l; i++) {\n var item = slideItems[i];\n\n // set item positions\n if (!isOut) { item.style.left = (i - index) * 100 / items + '%'; }\n\n if (animateDelay && TRANSITIONDELAY) {\n item.style[TRANSITIONDELAY] = item.style[ANIMATIONDELAY] = animateDelay * (i - number) / 1000 + 's';\n }\n removeClass(item, classOut);\n addClass(item, classIn);\n \n if (isOut) { slideItemsOut.push(item); }\n }\n }\n\n // make transfer after click/drag:\n // 1. change 'transform' property for mordern browsers\n // 2. change 'left' property for legacy browsers\n var transformCore = (function () {\n return carousel ?\n function () {\n resetDuration(container, '');\n if (TRANSITIONDURATION || !speed) {\n // for morden browsers with non-zero duration or \n // zero duration for all browsers\n doContainerTransform();\n // run fallback function manually \n // when duration is 0 / container is hidden\n if (!speed || !isVisible(container)) { onTransitionEnd(); }\n\n } else {\n // for old browser with non-zero duration\n jsTransform(container, transformAttr, transformPrefix, transformPostfix, getContainerTransformValue(), speed, onTransitionEnd);\n }\n\n if (!horizontal) { updateContentWrapperHeight(); }\n } :\n function () {\n slideItemsOut = [];\n\n var eve = {};\n eve[TRANSITIONEND] = eve[ANIMATIONEND] = onTransitionEnd;\n removeEvents(slideItems[indexCached], eve);\n addEvents(slideItems[index], eve);\n\n animateSlide(indexCached, animateIn, animateOut, true);\n animateSlide(index, animateNormal, animateIn);\n\n // run fallback function manually \n // when transition or animation not supported / duration is 0\n if (!TRANSITIONEND || !ANIMATIONEND || !speed || !isVisible(container)) { onTransitionEnd(); }\n };\n })();\n\n function render (e, sliderMoved) {\n if (updateIndexBeforeTransform) { updateIndex(); }\n\n // render when slider was moved (touch or drag) even though index may not change\n if (index !== indexCached || sliderMoved) {\n // events\n events.emit('indexChanged', info());\n events.emit('transitionStart', info());\n if (autoHeight) { doAutoHeight(); }\n\n // pause autoplay when click or keydown from user\n if (animating && e && ['click', 'keydown'].indexOf(e.type) >= 0) { stopAutoplay(); }\n\n running = true;\n transformCore();\n }\n }\n\n /*\n * Transfer prefixed properties to the same format\n * CSS: -Webkit-Transform => webkittransform\n * JS: WebkitTransform => webkittransform\n * @param {string} str - property\n *\n */\n function strTrans (str) {\n return str.toLowerCase().replace(/-/g, '');\n }\n\n // AFTER TRANSFORM\n // Things need to be done after a transfer:\n // 1. check index\n // 2. add classes to visible slide\n // 3. disable controls buttons when reach the first/last slide in non-loop slider\n // 4. update nav status\n // 5. lazyload images\n // 6. update container height\n function onTransitionEnd (event) {\n // check running on gallery mode\n // make sure trantionend/animationend events run only once\n if (carousel || running) {\n events.emit('transitionEnd', info(event));\n\n if (!carousel && slideItemsOut.length > 0) {\n for (var i = 0; i < slideItemsOut.length; i++) {\n var item = slideItemsOut[i];\n // set item positions\n item.style.left = '';\n\n if (ANIMATIONDELAY && TRANSITIONDELAY) { \n item.style[ANIMATIONDELAY] = '';\n item.style[TRANSITIONDELAY] = '';\n }\n removeClass(item, animateOut);\n addClass(item, animateNormal);\n }\n }\n\n /* update slides, nav, controls after checking ...\n * => legacy browsers who don't support 'event' \n * have to check event first, otherwise event.target will cause an error \n * => or 'gallery' mode: \n * + event target is slide item\n * => or 'carousel' mode: \n * + event target is container, \n * + event.property is the same with transform attribute\n */\n if (!event || \n !carousel && event.target.parentNode === container || \n event.target === container && strTrans(event.propertyName) === strTrans(transformAttr)) {\n\n if (!updateIndexBeforeTransform) { \n var indexTem = index;\n updateIndex();\n if (index !== indexTem) { \n events.emit('indexChanged', info());\n\n doContainerTransformSilent();\n }\n } \n\n if (nested === 'inner') { events.emit('innerLoaded', info()); }\n running = false;\n indexCached = index;\n }\n }\n\n }\n\n // # ACTIONS\n function goTo (targetIndex, e) {\n if (freeze) { return; }\n\n // prev slideBy\n if (targetIndex === 'prev') {\n onControlsClick(e, -1);\n\n // next slideBy\n } else if (targetIndex === 'next') {\n onControlsClick(e, 1);\n\n // go to exact slide\n } else {\n if (running) {\n if (preventActionWhenRunning) { return; } else { onTransitionEnd(); }\n }\n\n var absIndex = getAbsIndex(), \n indexGap = 0;\n\n if (targetIndex === 'first') {\n indexGap = - absIndex;\n } else if (targetIndex === 'last') {\n indexGap = carousel ? slideCount - items - absIndex : slideCount - 1 - absIndex;\n } else {\n if (typeof targetIndex !== 'number') { targetIndex = parseInt(targetIndex); }\n\n if (!isNaN(targetIndex)) {\n // from directly called goTo function\n if (!e) { targetIndex = Math.max(0, Math.min(slideCount - 1, targetIndex)); }\n\n indexGap = targetIndex - absIndex;\n }\n }\n\n // gallery: make sure new page won't overlap with current page\n if (!carousel && indexGap && Math.abs(indexGap) < items) {\n var factor = indexGap > 0 ? 1 : -1;\n indexGap += (index + indexGap - slideCount) >= indexMin ? slideCount * factor : slideCount * 2 * factor * -1;\n }\n\n index += indexGap;\n\n // make sure index is in range\n if (carousel && loop) {\n if (index < indexMin) { index += slideCount; }\n if (index > indexMax) { index -= slideCount; }\n }\n\n // if index is changed, start rendering\n if (getAbsIndex(index) !== getAbsIndex(indexCached)) {\n render(e);\n }\n\n }\n }\n\n // on controls click\n function onControlsClick (e, dir) {\n if (running) {\n if (preventActionWhenRunning) { return; } else { onTransitionEnd(); }\n }\n var passEventObject;\n\n if (!dir) {\n e = getEvent(e);\n var target = getTarget(e);\n\n while (target !== controlsContainer && [prevButton, nextButton].indexOf(target) < 0) { target = target.parentNode; }\n\n var targetIn = [prevButton, nextButton].indexOf(target);\n if (targetIn >= 0) {\n passEventObject = true;\n dir = targetIn === 0 ? -1 : 1;\n }\n }\n\n if (rewind) {\n if (index === indexMin && dir === -1) {\n goTo('last', e);\n return;\n } else if (index === indexMax && dir === 1) {\n goTo('first', e);\n return;\n }\n }\n\n if (dir) {\n index += slideBy * dir;\n if (autoWidth) { index = Math.floor(index); }\n // pass e when click control buttons or keydown\n render((passEventObject || (e && e.type === 'keydown')) ? e : null);\n }\n }\n\n // on nav click\n function onNavClick (e) {\n if (running) {\n if (preventActionWhenRunning) { return; } else { onTransitionEnd(); }\n }\n \n e = getEvent(e);\n var target = getTarget(e), navIndex;\n\n // find the clicked nav item\n while (target !== navContainer && !hasAttr(target, 'data-nav')) { target = target.parentNode; }\n if (hasAttr(target, 'data-nav')) {\n var navIndex = navClicked = Number(getAttr(target, 'data-nav')),\n targetIndexBase = fixedWidth || autoWidth ? navIndex * slideCount / pages : navIndex * items,\n targetIndex = navAsThumbnails ? navIndex : Math.min(Math.ceil(targetIndexBase), slideCount - 1);\n goTo(targetIndex, e);\n\n if (navCurrentIndex === navIndex) {\n if (animating) { stopAutoplay(); }\n navClicked = -1; // reset navClicked\n }\n }\n }\n\n // autoplay functions\n function setAutoplayTimer () {\n autoplayTimer = setInterval(function () {\n onControlsClick(null, autoplayDirection);\n }, autoplayTimeout);\n\n animating = true;\n }\n\n function stopAutoplayTimer () {\n clearInterval(autoplayTimer);\n animating = false;\n }\n\n function updateAutoplayButton (action, txt) {\n setAttrs(autoplayButton, {'data-action': action});\n autoplayButton.innerHTML = autoplayHtmlStrings[0] + action + autoplayHtmlStrings[1] + txt;\n }\n\n function startAutoplay () {\n setAutoplayTimer();\n if (autoplayButton) { updateAutoplayButton('stop', autoplayText[1]); }\n }\n\n function stopAutoplay () {\n stopAutoplayTimer();\n if (autoplayButton) { updateAutoplayButton('start', autoplayText[0]); }\n }\n\n // programaitcally play/pause the slider\n function play () {\n if (autoplay && !animating) {\n startAutoplay();\n autoplayUserPaused = false;\n }\n }\n function pause () {\n if (animating) {\n stopAutoplay();\n autoplayUserPaused = true;\n }\n }\n\n function toggleAutoplay () {\n if (animating) {\n stopAutoplay();\n autoplayUserPaused = true;\n } else {\n startAutoplay();\n autoplayUserPaused = false;\n }\n }\n\n function onVisibilityChange () {\n if (doc.hidden) {\n if (animating) {\n stopAutoplayTimer();\n autoplayVisibilityPaused = true;\n }\n } else if (autoplayVisibilityPaused) {\n setAutoplayTimer();\n autoplayVisibilityPaused = false;\n }\n }\n\n function mouseoverPause () {\n if (animating) { \n stopAutoplayTimer();\n autoplayHoverPaused = true;\n }\n }\n\n function mouseoutRestart () {\n if (autoplayHoverPaused) { \n setAutoplayTimer();\n autoplayHoverPaused = false;\n }\n }\n\n // keydown events on document \n function onDocumentKeydown (e) {\n e = getEvent(e);\n var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode);\n\n if (keyIndex >= 0) {\n onControlsClick(e, keyIndex === 0 ? -1 : 1);\n }\n }\n\n // on key control\n function onControlsKeydown (e) {\n e = getEvent(e);\n var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode);\n\n if (keyIndex >= 0) {\n if (keyIndex === 0) {\n if (!prevButton.disabled) { onControlsClick(e, -1); }\n } else if (!nextButton.disabled) {\n onControlsClick(e, 1);\n }\n }\n }\n\n // set focus\n function setFocus (el) {\n el.focus();\n }\n\n // on key nav\n function onNavKeydown (e) {\n e = getEvent(e);\n var curElement = doc.activeElement;\n if (!hasAttr(curElement, 'data-nav')) { return; }\n\n // var code = e.keyCode,\n var keyIndex = [KEYS.LEFT, KEYS.RIGHT, KEYS.ENTER, KEYS.SPACE].indexOf(e.keyCode),\n navIndex = Number(getAttr(curElement, 'data-nav'));\n\n if (keyIndex >= 0) {\n if (keyIndex === 0) {\n if (navIndex > 0) { setFocus(navItems[navIndex - 1]); }\n } else if (keyIndex === 1) {\n if (navIndex < pages - 1) { setFocus(navItems[navIndex + 1]); }\n } else {\n navClicked = navIndex;\n goTo(navIndex, e);\n }\n }\n }\n\n function getEvent (e) {\n e = e || win.event;\n return isTouchEvent(e) ? e.changedTouches[0] : e;\n }\n function getTarget (e) {\n return e.target || win.event.srcElement;\n }\n\n function isTouchEvent (e) {\n return e.type.indexOf('touch') >= 0;\n }\n\n function preventDefaultBehavior (e) {\n e.preventDefault ? e.preventDefault() : e.returnValue = false;\n }\n\n function getMoveDirectionExpected () {\n return getTouchDirection(toDegree(lastPosition.y - initPosition.y, lastPosition.x - initPosition.x), swipeAngle) === options.axis;\n }\n\n function onPanStart (e) {\n if (running) {\n if (preventActionWhenRunning) { return; } else { onTransitionEnd(); }\n }\n\n if (autoplay && animating) { stopAutoplayTimer(); }\n \n panStart = true;\n if (rafIndex) {\n caf(rafIndex);\n rafIndex = null;\n }\n\n var $ = getEvent(e);\n events.emit(isTouchEvent(e) ? 'touchStart' : 'dragStart', info(e));\n\n if (!isTouchEvent(e) && ['img', 'a'].indexOf(getLowerCaseNodeName(getTarget(e))) >= 0) {\n preventDefaultBehavior(e);\n }\n\n lastPosition.x = initPosition.x = $.clientX;\n lastPosition.y = initPosition.y = $.clientY;\n if (carousel) {\n translateInit = parseFloat(container.style[transformAttr].replace(transformPrefix, ''));\n resetDuration(container, '0s');\n }\n }\n\n function onPanMove (e) {\n if (panStart) {\n var $ = getEvent(e);\n lastPosition.x = $.clientX;\n lastPosition.y = $.clientY;\n\n if (carousel) {\n if (!rafIndex) { rafIndex = raf(function(){ panUpdate(e); }); }\n } else {\n if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); }\n if (moveDirectionExpected) { preventScroll = true; }\n }\n\n if (preventScroll) { e.preventDefault(); }\n }\n }\n\n function panUpdate (e) {\n if (!moveDirectionExpected) {\n panStart = false;\n return;\n }\n caf(rafIndex);\n if (panStart) { rafIndex = raf(function(){ panUpdate(e); }); }\n\n if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); }\n if (moveDirectionExpected) {\n if (!preventScroll && isTouchEvent(e)) { preventScroll = true; }\n\n try {\n if (e.type) { events.emit(isTouchEvent(e) ? 'touchMove' : 'dragMove', info(e)); }\n } catch(err) {}\n\n var x = translateInit,\n dist = getDist(lastPosition, initPosition);\n if (!horizontal || fixedWidth || autoWidth) {\n x += dist;\n x += 'px';\n } else {\n var percentageX = TRANSFORM ? dist * items * 100 / ((viewport + gutter) * slideCountNew): dist * 100 / (viewport + gutter);\n x += percentageX;\n x += '%';\n }\n\n container.style[transformAttr] = transformPrefix + x + transformPostfix;\n }\n }\n\n function onPanEnd (e) {\n if (panStart) {\n if (rafIndex) {\n caf(rafIndex);\n rafIndex = null;\n }\n if (carousel) { resetDuration(container, ''); }\n panStart = false;\n\n var $ = getEvent(e);\n lastPosition.x = $.clientX;\n lastPosition.y = $.clientY;\n var dist = getDist(lastPosition, initPosition);\n\n if (Math.abs(dist)) {\n // drag vs click\n if (!isTouchEvent(e)) {\n // prevent \"click\"\n var target = getTarget(e);\n addEvents(target, {'click': function preventClick (e) {\n preventDefaultBehavior(e);\n removeEvents(target, {'click': preventClick});\n }}); \n }\n\n if (carousel) {\n rafIndex = raf(function() {\n if (horizontal && !autoWidth) {\n var indexMoved = - dist * items / (viewport + gutter);\n indexMoved = dist > 0 ? Math.floor(indexMoved) : Math.ceil(indexMoved);\n index += indexMoved;\n } else {\n var moved = - (translateInit + dist);\n if (moved <= 0) {\n index = indexMin;\n } else if (moved >= slidePositions[slideCountNew - 1]) {\n index = indexMax;\n } else {\n var i = 0;\n while (i < slideCountNew && moved >= slidePositions[i]) {\n index = i;\n if (moved > slidePositions[i] && dist < 0) { index += 1; }\n i++;\n }\n }\n }\n\n render(e, dist);\n events.emit(isTouchEvent(e) ? 'touchEnd' : 'dragEnd', info(e));\n });\n } else {\n if (moveDirectionExpected) {\n onControlsClick(e, dist > 0 ? -1 : 1);\n }\n }\n }\n }\n\n // reset\n if (options.preventScrollOnTouch === 'auto') { preventScroll = false; }\n if (swipeAngle) { moveDirectionExpected = '?'; } \n if (autoplay && !animating) { setAutoplayTimer(); }\n }\n\n // === RESIZE FUNCTIONS === //\n // (slidePositions, index, items) => vertical_conentWrapper.height\n function updateContentWrapperHeight () {\n var wp = middleWrapper ? middleWrapper : innerWrapper;\n wp.style.height = slidePositions[index + items] - slidePositions[index] + 'px';\n }\n\n function getPages () {\n var rough = fixedWidth ? (fixedWidth + gutter) * slideCount / viewport : slideCount / items;\n return Math.min(Math.ceil(rough), slideCount);\n }\n\n /*\n * 1. update visible nav items list\n * 2. add \"hidden\" attributes to previous visible nav items\n * 3. remove \"hidden\" attrubutes to new visible nav items\n */\n function updateNavVisibility () {\n if (!nav || navAsThumbnails) { return; }\n\n if (pages !== pagesCached) {\n var min = pagesCached,\n max = pages,\n fn = showElement;\n\n if (pagesCached > pages) {\n min = pages;\n max = pagesCached;\n fn = hideElement;\n }\n\n while (min < max) {\n fn(navItems[min]);\n min++;\n }\n\n // cache pages\n pagesCached = pages;\n }\n }\n\n function info (e) {\n return {\n container: container,\n slideItems: slideItems,\n navContainer: navContainer,\n navItems: navItems,\n controlsContainer: controlsContainer,\n hasControls: hasControls,\n prevButton: prevButton,\n nextButton: nextButton,\n items: items,\n slideBy: slideBy,\n cloneCount: cloneCount,\n slideCount: slideCount,\n slideCountNew: slideCountNew,\n index: index,\n indexCached: indexCached,\n displayIndex: getCurrentSlide(),\n navCurrentIndex: navCurrentIndex,\n navCurrentIndexCached: navCurrentIndexCached,\n pages: pages,\n pagesCached: pagesCached,\n sheet: sheet,\n isOn: isOn,\n event: e || {},\n };\n }\n\n return {\n version: '2.9.2',\n getInfo: info,\n events: events,\n goTo: goTo,\n play: play,\n pause: pause,\n isOn: isOn,\n updateSliderHeight: updateInnerWrapperHeight,\n refresh: initSliderTransform,\n destroy: destroy,\n rebuild: function() {\n return tns(extend(options, optionsElements));\n }\n };\n};\n","// get css-calc \n// @return - false | calc | -webkit-calc | -moz-calc\n// @usage - var calc = getCalc(); \nimport { getBody } from './getBody.js';\nimport { setFakeBody } from './setFakeBody.js';\nimport { resetFakeBody } from './resetFakeBody.js';\n\nexport function calc() {\n var doc = document, \n body = getBody(),\n docOverflow = setFakeBody(body),\n div = doc.createElement('div'), \n result = false;\n\n body.appendChild(div);\n try {\n var str = '(10px * 10)',\n vals = ['calc' + str, '-moz-calc' + str, '-webkit-calc' + str],\n val;\n for (var i = 0; i < 3; i++) {\n val = vals[i];\n div.style.width = val;\n if (div.offsetWidth === 100) { \n result = val.replace(str, ''); \n break;\n }\n }\n } catch (e) {}\n \n body.fake ? resetFakeBody(body, docOverflow) : div.remove();\n\n return result;\n}","// get subpixel support value\n// @return - boolean\nimport { getBody } from './getBody.js';\nimport { setFakeBody } from './setFakeBody.js';\nimport { resetFakeBody } from './resetFakeBody.js';\n\nexport function percentageLayout() {\n // check subpixel layout supporting\n var doc = document,\n body = getBody(),\n docOverflow = setFakeBody(body),\n wrapper = doc.createElement('div'),\n outer = doc.createElement('div'),\n str = '',\n count = 70,\n perPage = 3,\n supported = false;\n\n wrapper.className = \"tns-t-subp2\";\n outer.className = \"tns-t-ct\";\n\n for (var i = 0; i < count; i++) {\n str += '
';\n }\n\n outer.innerHTML = str;\n wrapper.appendChild(outer);\n body.appendChild(wrapper);\n\n supported = Math.abs(wrapper.getBoundingClientRect().left - outer.children[count - perPage].getBoundingClientRect().left) < 2;\n\n body.fake ? resetFakeBody(body, docOverflow) : wrapper.remove();\n\n return supported;\n}","import { getBody } from './getBody.js';\nimport { setFakeBody } from './setFakeBody.js';\nimport { resetFakeBody } from './resetFakeBody.js';\n\nexport function mediaquerySupport () {\n var doc = document,\n body = getBody(),\n docOverflow = setFakeBody(body),\n div = doc.createElement('div'),\n style = doc.createElement('style'),\n rule = '@media all and (min-width:1px){.tns-mq-test{position:absolute}}',\n position;\n\n style.type = 'text/css';\n div.className = 'tns-mq-test';\n\n body.appendChild(style);\n body.appendChild(div);\n\n if (style.styleSheet) {\n style.styleSheet.cssText = rule;\n } else {\n style.appendChild(doc.createTextNode(rule));\n }\n\n position = window.getComputedStyle ? window.getComputedStyle(div).position : div.currentStyle['position'];\n\n body.fake ? resetFakeBody(body, docOverflow) : div.remove();\n\n return position === \"absolute\";\n}","import { getBody } from './getBody.js';\nimport { setFakeBody } from './setFakeBody.js';\nimport { resetFakeBody } from './resetFakeBody.js';\n\nexport function has3DTransforms(tf){\n if (!tf) { return false; }\n if (!window.getComputedStyle) { return false; }\n \n var doc = document,\n body = getBody(),\n docOverflow = setFakeBody(body),\n el = doc.createElement('p'),\n has3d,\n cssTF = tf.length > 9 ? '-' + tf.slice(0, -9).toLowerCase() + '-' : '';\n\n cssTF += 'transform';\n\n // Add it to the body to get the computed style\n body.insertBefore(el, null);\n\n el.style[tf] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(cssTF);\n\n body.fake ? resetFakeBody(body, docOverflow) : el.remove();\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== \"none\");\n}\n","export function getSlideId() {\n var id = window.tnsId;\n window.tnsId = !id ? 1 : id + 1;\n \n return 'tns' + window.tnsId;\n}","// create and append style sheet\nexport function createStyleSheet (media) {\n // Create the