{"version":3,"sources":["webpack:///./node_modules/@hotwired/stimulus/dist/stimulus.js","webpack:///./app/frontend/javascript/utils.js","webpack:///./app/frontend/javascript/flash-notifications.js","webpack:///./app/frontend/javascript/chartkick-utils.js","webpack:///./app/frontend/javascript/systems.js","webpack:///./node_modules/date-fns/esm/constants/index.js","webpack:///./node_modules/date-fns/esm/_lib/requiredArgs/index.js","webpack:///./node_modules/date-fns/esm/_lib/toInteger/index.js","webpack:///./node_modules/date-fns/esm/parseISO/index.js","webpack:///./node_modules/date-fns/esm/_lib/defaultOptions/index.js","webpack:///./node_modules/date-fns/esm/toDate/index.js","webpack:///./node_modules/date-fns/esm/compareAsc/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarMonths/index.js","webpack:///./node_modules/date-fns/esm/endOfDay/index.js","webpack:///./node_modules/date-fns/esm/endOfMonth/index.js","webpack:///./node_modules/date-fns/esm/isLastDayOfMonth/index.js","webpack:///./node_modules/date-fns/esm/differenceInMonths/index.js","webpack:///./node_modules/date-fns/esm/differenceInMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/_lib/roundingMethods/index.js","webpack:///./node_modules/date-fns/esm/differenceInSeconds/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","webpack:///./node_modules/date-fns/esm/_lib/defaultLocale/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/_lib/assign/index.js","webpack:///./node_modules/date-fns/esm/_lib/cloneObject/index.js","webpack:///./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/formatDistance/index.js","webpack:///./node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js","webpack:///./node_modules/date-fns-tz/esm/_lib/newDateUTC/index.js","webpack:///./node_modules/date-fns-tz/esm/_lib/tzParseTimezone/index.js","webpack:///./node_modules/date-fns-tz/esm/toDate/index.js","webpack:///./node_modules/date-fns-tz/esm/_lib/tzPattern/index.js","webpack:///./node_modules/date-fns-tz/esm/utcToZonedTime/index.js","webpack:///./app/frontend/javascript/datetime.js","webpack:///./node_modules/date-fns/esm/formatDistanceToNow/index.js","webpack:///./app/frontend/controllers/device_control_controller.js","webpack:///./node_modules/lodash.debounce/index.js","webpack:///./app/frontend/packs/highcharts.js","webpack:///./app/frontend/controllers/bulmahead_controller.js","webpack:///./app/frontend/javascript/dropdowns.js","webpack:///./app/frontend/javascript/modals.js","webpack:///./app/frontend/javascript/activity-feeds.js","webpack:///./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js","webpack:///./node_modules/bulma-toast/dist/bulma-toast.min.js","webpack:///./node_modules/date-fns/_lib/toInteger/index.js","webpack:///./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack:///./app/frontend/packs/application.js","webpack:///./app/frontend/controllers sync _controller\\.js$","webpack:///./app/frontend/controllers/ai_widget_controller.js","webpack:///./app/frontend/controllers/async_lock_controller.js","webpack:///./app/frontend/controllers/calendar_controller.js","webpack:///./app/frontend/controllers/charging_control_controller.js","webpack:///./app/frontend/controllers/charts_controller.js","webpack:///./app/frontend/controllers/charts_dashboard_controller.js","webpack:///./app/frontend/controllers/crm/proposal_form_controller.js","webpack:///./app/frontend/controllers/crm/proposals_list_controller.js","webpack:///./app/frontend/controllers/crm/prospect_search_controller.js","webpack:///./app/frontend/controllers/edge_lock_controller.js","webpack:///./app/frontend/controllers/generator_control_controller.js","webpack:///./app/frontend/controllers/grid_control_controller.js","webpack:///./app/frontend/controllers/installations_list_controller.js","webpack:///./app/frontend/controllers/nested_form_controller.js","webpack:///./app/frontend/controllers/no_data_controller.js","webpack:///./app/frontend/controllers/refetch_status_controller.js","webpack:///./app/frontend/controllers/refresh_state_controller.js","webpack:///./app/frontend/controllers/share_controller.js","webpack:///./app/frontend/controllers/system_configuration_form_controller.js","webpack:///./app/frontend/controllers/systems/edge_maintenance_mode_controller.js","webpack:///./app/frontend/controllers/systems/firmware_update_controller.js","webpack:///./app/frontend/controllers/tabs_controller.js","webpack:///./app/frontend/controllers/time_format_controller.js","webpack:///./app/frontend/controllers/timeline_controller.js","webpack:///./app/frontend/javascript/nav.js","webpack:///./app/frontend/javascript/organization-members.js","webpack:///./app/frontend/javascript/hotjar.js","webpack:///./app/frontend/javascript/forms.js","webpack:///./app/frontend/javascript/users.js","webpack:///./app/frontend/javascript/looker.js","webpack:///./app/frontend/javascript/tables.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindow.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","webpack:///./node_modules/@popperjs/core/lib/enums.js","webpack:///./node_modules/@popperjs/core/lib/utils/orderModifiers.js","webpack:///./node_modules/@popperjs/core/lib/createPopper.js","webpack:///./node_modules/@popperjs/core/lib/utils/debounce.js","webpack:///./node_modules/@popperjs/core/lib/utils/mergeByName.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/eventListeners.js","webpack:///./node_modules/@popperjs/core/lib/utils/getBasePlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/getVariation.js","webpack:///./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/computeOffsets.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","webpack:///./node_modules/@popperjs/core/lib/utils/math.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/computeStyles.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/applyStyles.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/offset.js","webpack:///./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/contains.js","webpack:///./node_modules/@popperjs/core/lib/utils/rectToClientRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","webpack:///./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","webpack:///./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","webpack:///./node_modules/@popperjs/core/lib/utils/expandToHashMap.js","webpack:///./node_modules/@popperjs/core/lib/utils/detectOverflow.js","webpack:///./node_modules/@popperjs/core/lib/utils/within.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/hide.js","webpack:///./node_modules/@popperjs/core/lib/popper.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/flip.js","webpack:///./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","webpack:///./node_modules/@popperjs/core/lib/utils/getAltAxis.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/arrow.js","webpack:///./node_modules/tippy.js/dist/tippy.esm.js","webpack:///./app/frontend/controllers/tooltip_controller.js","webpack:///./node_modules/@rails/actioncable/app/assets/javascripts/actioncable.esm.js","webpack:///./app/frontend/channels/consumer.js","webpack:///./app/frontend/channels/index.js","webpack:///./app/frontend/channels/organization_member_channel.js","webpack:///./app/frontend/controllers/index.js","webpack:///./node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js","webpack:///./app/frontend/javascript/vendors/bulmahead.js","webpack:///./app/frontend/javascript/customers.js"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_toConsumableArray","arr","Array","isArray","_arrayLikeToArray","_arrayWithoutHoles","iter","from","_iterableToArray","_unsupportedIterableToArray","TypeError","_nonIterableSpread","_inherits","subClass","superClass","Object","create","writable","configurable","_setPrototypeOf","o","p","setPrototypeOf","__proto__","_createSuper","Derived","hasNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","call","e","_isNativeReflectConstruct","result","Super","_getPrototypeOf","NewTarget","this","arguments","apply","_possibleConstructorReturn","self","ReferenceError","_assertThisInitialized","getPrototypeOf","_slicedToArray","i","_arrayWithHoles","_i","_s","_e","_arr","_n","_d","next","push","length","err","_iterableToArrayLimit","_nonIterableRest","_defineProperty","defineProperty","enumerable","_createForOfIteratorHelper","allowArrayLike","it","F","s","n","_e2","f","normalCompletion","didErr","step","_e3","return","minLen","toString","slice","name","test","len","arr2","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","_createClass","protoProps","staticProps","EventListener","eventTarget","eventName","eventOptions","unorderedBindings","Set","addEventListener","removeEventListener","binding","add","delete","event","_step","extendedEvent","_stopImmediatePropagation","stopImmediatePropagation","assign","immediatePropagationStopped","extendEvent","_iterator","bindings","handleEvent","size","get","sort","left","right","leftIndex","index","rightIndex","Dispatcher","application","eventListenerMaps","Map","started","eventListeners","forEach","eventListener","connect","disconnect","values","reduce","listeners","map","concat","fetchEventListenerForBinding","bindingConnected","clearEventListeners","undefined","bindingDisconnected","clearEventListenersForBinding","message","detail","handleError","hasBindings","removeMappedEventListenerFor","eventListenerMap","fetchEventListenerMapForEventTarget","cacheKey","fetchEventListener","createEventListener","set","parts","keys","join","defaultActionDescriptorFilters","stop","_ref","stopPropagation","prevent","_ref2","preventDefault","_ref3","element","descriptorPattern","parseEventTarget","eventTargetName","window","document","camelize","replace","_","char","toUpperCase","namespaceCamelize","capitalize","charAt","dasherize","toLowerCase","isSomething","object","hasProperty","property","hasOwnProperty","allModifiers","Action","schema","tagName","defaultEventNames","getDefaultEventNameForElement","identifier","methodName","keyFilter","eventFilter","filters","split","keyFilterDissatisfied","standardFilter","filter","includes","keyMappings","params","pattern","RegExp","_Array$from","attributes","_ref5","match","typecast","_allModifiers$map2","modifier","meta","ctrl","alt","shift","metaKey","ctrlKey","altKey","shiftKey","token","descriptorString","content","matches","trim","options","a","button","form","details","input","getAttribute","select","textarea","Error","JSON","parse","o_O","Binding","context","action","actionEvent","prepareActionEvent","willBeInvokedByEvent","applyEventModifiers","invokeWithEvent","method","controller","actionDescriptorFilters","passes","_i2","_Object$entries","entries","_ref7","currentTarget","logDebugActivity","KeyboardEvent","shouldIgnoreKeyboardEvent","MouseEvent","shouldIgnoreMouseEvent","Element","contains","scope","containsElement","ElementObserver","delegate","_this","mutationObserverInit","childList","subtree","elements","mutationObserver","MutationObserver","mutations","processMutations","observe","refresh","callback","takeRecords","matchElementsInTree","_i3","_Array$from2","has","removeElement","_i4","_Array$from3","_element2","addElement","_step2","_iterator2","mutation","processMutation","type","processAttributeChange","attributeName","processRemovedNodes","removedNodes","processAddedNodes","addedNodes","elementAttributeChanged","matchElement","nodes","_i5","_Array$from4","node","elementFromNode","processTree","_i6","_Array$from5","elementIsActive","tree","processor","_step3","_iterator3","nodeType","Node","ELEMENT_NODE","isConnected","elementMatched","elementUnmatched","AttributeObserver","elementObserver","start","pause","hasAttribute","querySelectorAll","selector","elementMatchedAttribute","elementUnmatchedAttribute","elementAttributeValueChanged","_add","fetch","del","prune","Multimap","valuesByKey","some","_ref9","_ref10","_ref11","_ref12","SelectorObserver","_selector","matchesByElement","selectorMatchElement","_this3","selectorMatched","_step4","_iterator4","getKeysForValue","selectorUnmatched","_attributeName","matchedBefore","StringMapObserver","_this4","stringMap","attributeOldValue","_step5","_iterator5","knownAttributeNames","refreshAttribute","_step6","_iterator6","oldValue","getStringMapKeyForAttribute","stringMapKeyAdded","stringMapValueChanged","_oldValue","stringMapKeyRemoved","currentAttributeNames","recordedAttributeNames","attribute","TokenListObserver","attributeObserver","tokensByElement","tokensMatched","readTokensForElement","_this$refreshTokensFo2","refreshTokensForElement","unmatchedTokens","matchedTokens","tokensUnmatched","getValuesForKey","tokens","_this5","tokenMatched","_this6","tokenUnmatched","previousTokens","currentTokens","firstDifferingIndex","Math","max","findIndex","_ref13","_ref14","tokensAreEqual","tokenString","parseTokenString","ValueListObserver","tokenListObserver","parseResultsByToken","WeakMap","valuesByTokenByElement","fetchParseResultForToken","fetchValuesByTokenForElement","elementMatchedValue","elementUnmatchedValue","parseResult","parseToken","valuesByToken","parseValueForToken","BindingObserver","bindingsByAction","valueListObserver","actionAttribute","disconnectAllActions","_this7","clear","forToken","connectAction","disconnectAction","ValueObserver","receiver","stringMapObserver","valueDescriptorMap","invokeChangedCallbacksForDefaultValues","hasValue","invokeChangedCallback","writer","defaultValue","valueDescriptorNameMap","_step7","_iterator7","valueDescriptors","_ref16","data","rawValue","rawOldValue","changedMethodName","changedMethod","reader","_this8","descriptors","hasMethodName","TargetObserver","targetsByName","disconnectAllTargets","_ref17","connectTarget","_ref18","disconnectTarget","_a","_this9","targetConnected","_this10","targetDisconnected","_step8","_iterator8","_step9","_iterator9","readInheritableStaticArrayValues","propertyName","ancestors","getAncestorsForConstructor","definition","getOwnStaticArrayValues","readInheritableStaticObjectPairs","pairs","getOwnStaticObjectPairs","reverse","OutletObserver","outletsByName","outletElementsByName","selectorObserverMap","attributeObserverMap","_this11","outletDefinitions","outletName","setupSelectorObserverForOutlet","setupAttributeObserverForOutlet","dependentContexts","observer","disconnectAllOutlets","stopSelectorObservers","stopAttributeObservers","_ref19","outlet","getOutlet","connectOutlet","_ref20","getOutletFromMap","disconnectOutlet","_ref21","hasOutlet","hasOutletController","controllerAttribute","_element","getOutletNameFromOutletAttributeName","updateSelectorObserverForOutlet","_this12","outletConnected","_this13","outletDisconnected","_step10","_iterator10","_step11","_iterator11","_step12","_iterator12","selectorObserver","body","attributeNameForOutletName","outlets","getSelectorForOutletName","outletAttributeForScope","_this14","find","dependencies","router","modules","module","controllerConstructor","outletDependencies","identifiers","dependentControllerIdentifiers","contexts","getControllerForElementAndIdentifier","Context","_this15","functionName","bindingObserver","dispatcher","valueObserver","targetObserver","outletObserver","initialize","parentElement","invokeControllerMethod","_len","args","_key2","bless","properties","shadowConstructor","extend","shadowProperties","getOwnKeys","shadowingDescriptor","getOwnPropertyDescriptor","getShadowedDescriptor","getShadowProperties","defineProperties","shadow","blessedProperties","blessing","getBlessedProperties","getOwnPropertySymbols","getOwnPropertyNames","extendWithReflect","extended","b","_constructor","_super2","Module","blessDefinition","contextsByScope","connectedContexts","fetchContextForScope","ClassMap","getDataKey","getAll","getAttributeNameForKey","DataMap","setAttribute","removeAttribute","Guide","logger","warnedKeysByObject","warnedKeys","warn","attributeValueContainsToken","TargetSet","targetName","_this16","_len2","targetNames","_key3","findTarget","findLegacyTarget","_this17","_len3","_key4","targets","findAllTargets","findAllLegacyTargets","getSelectorForTargetName","findElement","findAllElements","targetAttributeForScope","getLegacySelectorForTargetName","deprecate","_this18","targetDescriptor","targetAttribute","revisedAttributeName","guide","OutletSet","controllerElement","_this19","_len4","outletNames","_key5","findOutlet","_this20","_len5","_key6","findAllOutlets","_this21","queryElements","matchesElement","_this22","Scope","_this23","classes","closest","controllerSelector","documentScope","documentElement","isDocumentScope","ScopeObserver","scopesByIdentifierByElement","scopeReferenceCounts","parseValueForElementAndIdentifier","scopesByIdentifier","fetchScopesByIdentifierForElement","createScopeForElementAndIdentifier","referenceCount","scopeConnected","scopeDisconnected","Router","scopeObserver","modulesByIdentifier","unloadIdentifier","connectModule","afterLoad","disconnectModule","console","connectContextForScope","disconnectContextForScope","defaultSchema","enter","tab","esc","space","up","down","home","end","page_up","page_down","objectFromEntries","c","array","memo","_ref22","_ref23","k","v","Application","_this24","debug","logFormattedMessage","fn","_start","mark","_callee","wrap","_context","prev","readyState","load","head","_this25","_len6","rest","_key7","definitions","shouldLoad","loadDefinition","_this26","_len7","_key8","getContextForElementAndIdentifier","onerror","groupCollapsed","log","groupEnd","getOutletController","getControllerAndEnsureConnectedScope","outletController","proposeToConnectScopeForElementAndIdentifier","parseValueDefinitionPair","_ref28","_ref29","payload","typeDefinition","typeFromObject","typeObject","hasType","hasDefault","default","fullObject","onlyType","onlyDefault","parseValueTypeConstant","typeFromDefaultValue","parseValueTypeDefault","propertyPath","parseValueTypeObject","typeFromConstant","parseValueTypeDefinition","constant","defaultValuesByType","constantFromType","defaultValueForDefinition","readers","writers","valueDescriptorForTokenAndTypeDefinition","Number","String","boolean","number","string","writeJSON","stringify","Controller","_ref30","_ref30$target","_ref30$detail","_ref30$prefix","prefix","_ref30$bubbles","bubbles","_ref30$cancelable","cancelable","CustomEvent","dispatchEvent","_identifier","_application","blessings","classDefinition","_ref24","getAttributeName","targetDefinition","_ref26","findAll","valueDefinitionPairs","propertyDescriptorMap","_this28","valueDefinitionPair","valueDescriptor","_ref27","read","write","hasCustomDefaultValue","propertiesForValueDefinitionPair","outletDefinition","camelizedName","_ref25","outletElement","_this27","htmlToElement","html","template","createElement","innerHTML","firstChild","setCookie","expires","path","domain","secure","cookie","escape","toGMTString","truncate","str","findElementWithParent","className","toggle","classList","numberToHuman","uom","toFixed","TYPES","class","in","alert","success","notice","showNotification","duration","position","dismissible","notificationClass","_ref$absolute","absolute","opts","toast","pauseOnHover","animate","out","querySelector","parentNode","style","notifications","App","flash","$delete","$notification","removeChild","DATE_PATTERN","toDate","Date","toStr","year","parseInt","month","day","toFloat","parseFloat","processAlignMinOption","chart","yAxis","series","min","update","updateRangeParamsInURL","source","url","URL","param","searchParams","periodNum","periodType","id","closeAllDropdowns","_detail","lockActionLink","getElementById","_e$detail","dataset","mapUrl","iframe","src","_ref4","_detail2","closeModals","fetchSystemStatus","model","serialNumber","headers","credentials","_ref6","_ref6$target","pow","millisecondsInHour","requiredArgs","required","toInteger","dirtyNumber","NaN","isNaN","ceil","floor","parseISO","argument","_options$additionalDi","additionalDigits","RangeError","date","dateStrings","splitDateString","parseYearResult","parseYear","parseDate","restDateString","getTime","offset","timestamp","time","parseTime","timezone","dirtyDate","setFullYear","getUTCFullYear","getUTCMonth","getUTCDate","setHours","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","parseTimezone","patterns","dateTimeDelimiter","timeZoneDelimiter","dateRegex","timeRegex","timezoneRegex","dateString","timeString","substr","exec","regex","captures","century","isWeekDate","dayOfYear","parseDateUnit","week","dayOfWeek","_year","validateWeekDate","isoWeekYear","setUTCFullYear","fourthOfJanuaryDay","getUTCDay","diff","setUTCDate","dayOfISOWeekYear","daysInMonths","isLeapYearIndex","validateDate","validateDayOfYearDate","hours","parseTimeUnit","minutes","seconds","validateTime","timezoneString","sign","_hours","validateTimezone","getDefaultOptions","argStr","stack","compareAsc","dirtyDateLeft","dirtyDateRight","dateLeft","dateRight","differenceInCalendarMonths","yearDiff","getFullYear","monthDiff","getMonth","endOfDay","endOfMonth","isLastDayOfMonth","differenceInMonths","difference","abs","getDate","setDate","setMonth","isLastMonthNotFull","differenceInMilliseconds","roundingMap","round","trunc","getRoundingMethod","differenceInSeconds","roundingMethod","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","count","tokenValue","addSuffix","comparison","buildFormatLongFn","width","defaultWidth","format","formats","formatLong","full","long","medium","short","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","dirtyIndex","valuesArray","formattingValues","defaultFormattingWidth","_defaultWidth","_width","argumentCallback","buildMatchFn","matchPattern","matchPatterns","defaultMatchWidth","matchResult","matchedString","parsePatterns","defaultParseWidth","findKey","valueCallback","predicate","defaultLocale","code","formatDistance","formatRelative","_date","_baseDate","_options","localize","ordinalNumber","rem100","era","narrow","abbreviated","wide","quarter","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","any","weekStartsOn","firstWeekContainsDate","cloneObject","getTimezoneOffsetInMilliseconds","utcDate","UTC","getHours","getMinutes","getSeconds","getMilliseconds","MINUTES_IN_DAY","MINUTES_IN_MONTH","dirtyBaseDate","_options$locale","defaultOptions","locale","localizeOptions","months","offsetInSeconds","includeSeconds","days","nearestMonth","monthsSinceStartOfYear","years","tzTokenizeDate","timeZone","dtf","dtfCache","testDateFormatted","Intl","DateTimeFormat","hour12","hour","minute","second","hourCycleSupported","hourCycle","getDateTimeFormat","formatToParts","formatted","filled","pos","typeToPos","partsOffset","parsed","hackyOffset","newDateUTC","fullYear","millisecond","setUTCHours","MILLISECONDS_IN_HOUR","timezoneZ","timezoneHH","timezoneHHMM","tzParseTimezone","isUtcDate","absoluteOffset","timeZoneString","validIANATimezoneCache","isValidTimezoneIANAString","now","calcOffset","toUtcDate","utcGuess","o2","o3","fixOffset","asUTC","asTS","over","dateTimePattern","datePattern","plainTime","YY","YYY","YYYY","YYYYY","MM","DDD","MMDD","Www","WwwD","HH","HHMM","HHMMSS","patternYYY","patternYYYYY","yearString","centuryString","isLeapYear","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","utcToZonedTime","dirtyOptions","offsetMilliseconds","d","resultDate","DATE_FORMAT","TIME_FORMAT","formatDateTime","datetime","tz","dt","formatDistanceToNow","dateFnsFormatDistanceToNow","_default","_Controller","_sendReset","_resetSettings","_fetchSettings","_super","_key","_this2","fetchSettings","dirty","returnValue","statusFetchTimer","clearTimeout","systemSettingsValue","setHiddenEnabled","formTarget","checked","modeInput","toggleGeneratorMode","initialFormData","getFormValues","_asyncToGenerator","_regeneratorRuntime","res","stateValue","serialNumberValue","settingsMode","sent","json","ok","response","cacheSettings","t0","unreachableTarget","setTimeout","defaultMessage","_settings$mode","settings_mismatch","errorTarget","remove","r","settings","settingsSet","enabled","start_threshold","startThreshold","stop_threshold","stopThreshold","charging_current","chargingCurrent","mode","setSettingsForm","loaderTarget","toggleSubmitButton","toggleFormDisable","formData","FormData","disableFormFields","validateForm","disabled","stopThresholdEl","startThresholdEl","setCustomValidity","isEnabled","btn","formValues","resetModalTarget","_callee2","_context2","sendReset","closeResetModal","_callee3","newSettings","_context3","Accept","reset","enabledInput","toggleSubmitButtonText","xhr","resp","_event$detail2","disableWith","disableBtnWith","state","systemSettings","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","freeGlobal","global","freeSelf","root","Function","objectToString","nativeMax","nativeMin","isObject","isSymbol","isObjectLike","toNumber","isBinary","exports","func","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","thisArg","leadingEdge","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","remainingWait","debounced","isInvoking","cancel","flush","Highcharts","Exporting","DataExporting","require","Chartkick","use","Templating","helpers","localized","toLocaleString","round2","numbers","hide","menuTarget","display","label","inputTarget","onSelectEvent","toggleMenu","minLenValue","api","suggestions","li","appendChild","noResultsEl","childNodes","debounce","handleApi","delayValue","setValue","delay","el","hasModalCloseClass","modalCardBody","scrollTop","Event","modal","keyCode","item","recalculateTopNavFeed","recalculateFirstLast","feed","idx","list","notificationsContainer","placeholder","notificationsIcon","hasItems","hideTypes","typesChoice","choices","_baseId","disable","enable","g","getOwnPropertyDescriptors","h","l","closeOnClick","opacity","single","offsetTop","offsetBottom","offsetLeft","offsetRight","extraClasses","m","q","speed","onAnimationEnd","j","destroy","insertAdjacentElement","insertAdjacentHTML","resume","removeParent","children","animation","OAnimation","MozAnimation","WebkitAnimation","timer","remaining","resetDefaults","setDefaults","setDoc","appendTo","lastElementChild","channels","_document$querySelect","_document$querySelect2","resolvedOptions","cookiesBanner","evt","webpackContext","req","webpackContextResolve","__webpack_require__","widgetContainerTarget","initialized","widgetOptions","expandedWidth","expandedHeight","_fetchStatus","fetchStatus","toggleFormDisabled","buttonTarget","originalText","textContent","hasLoaderTarget","organization","calendarControlTarget","periodControlsTarget","enableUpdateButton","calendars","bulmaCalendar","attach","dateFormat","isRange","maxDate","showTodayButton","showClearButton","showFooter","calendar","on","onRangeChanged","bind","off","periodNumValue","periodTypeValue","updateButtonTarget","disableUpdateButton","periodOrRangeTarget","selectedIndex","startDateValue","endDateValue","dispatch","_event$data$date$star","_event$data$date$end","toLocaleDateString","startDate","endDate","_DeviceControlControl","DeviceControlController","_onTabChange","_onRangeChange","_initReport","_connect","reportUrlValue","lazyLoadValue","initReport","reportData","_loop","abrupt","charts","loading","fetchReportData","setChartError","updateData","color","statusText","dataSource","getDataSource","finish","_x","_callee4","_context4","_x2","reportUrl","lazyLoad","getElementsByClassName","component","componentData","setLoading","setError","dashboard_structure","setStructure","dashboardTarget","dashboard","mountedComponents","setChartData","loadingContainer","loadingEl","replaceChildren","showLoading","top","transform","fontSize","_serie$marker","serie","userOptions","marker","symbol","addSeries","hideLoading","Dashboards","board","optionsValue","resize","_loadPreview","_onNext","_switchToReview","selectedAppliances","row","applianceId","tile","tableSectionTarget","calculatePreview","nextTarget","isFirstTab","switchToAppliances","appliance","applianceRow","applianceTemplateTarget","tmp","previewTarget","potentialLoad","loadPerDay","power","quantity","potentialLoadTarget","loadPerDayTarget","prospect","first_name","last_name","email","phone","address","prospectTarget","appliancesTarget","reviewTarget","stepsTarget","backTarget","publishTarget","loadPreview","reportValidity","isSecondTab","switchToReview","switchToProspect","proposalPreviewTarget","proposalPreviewLoaderTarget","proposalIdValue","text","proposalId","timeout","requestSubmit","isLoading","_BulmaheadController","query","prospects","BulmaheadController","statusValue","lock_status","operatingTimeValue","operating_time","replaceAll","refetchButtonTarget","lockStatusTarget","lockFormTarget","unlockFormTarget","operatingTimeTarget","status","operatingTime","gridControlModalTimer","systemState","listTarget","mapTarget","socInput","templateTarget","formsCount","targetTarget","previousElementSibling","focus","toggleAddButton","wrapper","newRecord","hasMaxValue","addTarget","maxValue","noDataTarget","toggleUI","identifierValue","oldLastFetched","lastFetchedTarget","innerText","TIMEOUT","btnTarget","modelValue","loadingClass","refetchOnMount","navigator","share","shareData","title","clipboard","writeText","location","href","product","phase","devicesFormTarget","batteriesFormTarget","errors","field","toggleEdgeFields","toggleDevicePhases","toggleSerialNumber","toggleDevicePhase","removeDeviceBtnTargets","hiddenClass","devicePhaseTargets","threePhase","isEdge","serialNumberTarget","toggleInstallationPhase","edgeFieldsTargets","addDeviceBtnTarget","addBatteryBtnTarget","installationPhaseTarget","batteryLabelsTarget","batteryFieldsTargets","MAX_BATTERIES","_confirm","notSupported","maintenanceSettings","alohaStatusTarget","confirmButtonTarget","confirmModalTarget","closeConfirmModal","_fetchFirmwareVersions","_fetchSystemDetails","fetchFirmwareVersions","fetchSystemDetails","updateInProgress","startPolling","fetchTimeout","fetchInterval","clearInterval","_result$firmwareVersi","_result$deviceAddress","_result$desiredFirmwa","desiredVersion","updateLog","lastSucceededAt","lastFailedAt","lastAttemptedAt","currentVersionTarget","firmwareVersion","semanticVersionNumber","ipAddressTarget","deviceAddress","desiredFirmwareVersion","succeedAtTarget","failedAtTarget","failureReasonTarget","deviceCommunicationSummaries","summary","progressTarget","updateDetailsTarget","timeFormatTimezoneValue","lastFailureReason","desiredVersionTarget","attemptedAtTarget","successTarget","stateData","newFirmwareVersions","selectInput","productValue","version","localeCompare","option","detailsTarget","version_id","setInterval","tabTargets","btnTargets","selectedTab","t","x","link","hasCurrentTabTextTarget","currentTabTextTarget","trigger","currentTabIdx","timeAgoTargets","startRefreshingAgo","refreshTimer","timezoneValue","setTimeAgo","timeAgo","REFRESH_AGO_INTERVAL","indexOf","cmdPressed","open","responseText","hj","_e$target$parentEleme","parentField","help","editUserForm","feedCheckbox","tooltipTarget","contentWindow","origin","height","_prevSibling$classLis","prevSibling","rowTarget","rowToggle","handleTableRowClick","sorter","direction","getBoundingClientRect","includeScale","rect","bottom","y","getWindow","ownerDocument","defaultView","getWindowScroll","win","scrollLeft","pageXOffset","pageYOffset","isElement","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","getNodeName","nodeName","getDocumentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","_getComputedStyle","overflow","overflowX","overflowY","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","offsetParentIsScaled","scaleX","offsetWidth","scaleY","offsetHeight","isElementScaled","scroll","offsets","clientLeft","clientTop","getLayoutRect","clientRect","getParentNode","assignedSlot","host","getScrollParent","listScrollParents","_element$ownerDocumen","scrollParent","isBody","visualViewport","updatedList","isTableElement","getTrueOffsetParent","getOffsetParent","isFirefox","userAgent","currentNode","css","perspective","contain","willChange","getContainingBlock","auto","basePlacements","viewport","variationPlacements","acc","placement","modifierPhases","order","modifiers","visited","requires","requiresIfExists","dep","depModifier","DEFAULT_OPTIONS","strategy","areValidElements","popperGenerator","generatorOptions","_generatorOptions","_generatorOptions$def","defaultModifiers","_generatorOptions$def2","reference","popper","pending","orderedModifiers","modifiersData","styles","effectCleanupFns","isDestroyed","setOptions","setOptionsAction","cleanupModifierEffects","scrollParents","contextElement","orderModifiers","merged","current","existing","mergeByName","_ref3$options","effect","cleanupFn","noopFn","forceUpdate","_state$elements","rects","_state$orderedModifie","_state$orderedModifie2","onFirstUpdate","passive","_options$scroll","_options$resize","getBasePlacement","getVariation","getMainAxisFromPlacement","computeOffsets","basePlacement","variation","commonX","commonY","mainAxis","unsetSides","mapToStyles","_Object$assign2","popperRect","gpuAcceleration","adaptive","roundOffsets","dpr","devicePixelRatio","roundOffsetsByDPR","_ref3$x","_ref3$y","hasX","hasY","sideX","sideY","heightProp","widthProp","_Object$assign","commonStyles","initialStyles","margin","arrow","hash","getOppositePlacement","matched","getOppositeVariationPlacement","parent","child","rootNode","getRootNode","isSameNode","rectToClientRect","getClientRectFromMixedType","clippingParent","clientWidth","clientHeight","getViewportRect","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","getDocumentRect","getClippingRect","boundary","rootBoundary","mainClippingParents","clippingParents","clipperElement","getClippingParents","firstClippingParent","clippingRect","accRect","mergePaddingObject","paddingObject","expandToHashMap","hashMap","detectOverflow","_options$placement","_options$boundary","_options$rootBoundary","_options$elementConte","elementContext","_options$altBoundary","altBoundary","_options$padding","padding","altContext","clippingClientRect","referenceClientRect","popperOffsets","popperClientRect","elementClientRect","overflowOffsets","offsetData","multiply","axis","within","getSideOffsets","preventedOffsets","isAnySideFullyClipped","side","_options$gpuAccelerat","_options$adaptive","_options$roundOffsets","_options$offset","invertDistance","skidding","distance","distanceAndSkiddingToXY","_data$state$placement","_skip","_options$mainAxis","checkMainAxis","_options$altAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","_options$flipVariatio","flipVariations","allowedAutoPlacements","preferredPlacement","oppositePlacement","getExpandedFallbackPlacements","placements","_options$allowedAutoP","allowedPlacements","overflows","computeAutoPlacement","referenceRect","checksMap","makeFallbackChecks","firstFittingPlacement","_basePlacement","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","every","check","fittingPlacement","_options$tether","tether","_options$tetherOffset","tetherOffset","isBasePlacement","tetherOffsetValue","mainSide","altSide","additive","maxLen","arrowElement","arrowRect","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","arrowOffsetParent","clientOffset","offsetModifierValue","tetherMin","tetherMax","preventedOffset","_mainSide","_altSide","_offset","_min","_max","_preventedOffset","_state$modifiersData$","minProp","maxProp","endDiff","startDiff","clientSize","centerToReference","center","axisProp","centerOffset","_options$element","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","CONTENT_CLASS","BACKDROP_CLASS","ARROW_CLASS","SVG_ARROW_CLASS","TOUCH_OPTIONS","capture","TIPPY_DEFAULT_APPEND_TO","getValueAtIndexOrReturn","isType","invokeWithArgsOrReturn","ms","normalizeToArray","pushIfUnique","arrayFrom","removeUndefinedProps","div","isMouseEvent","isReferenceElement","_tippy","getArrayOfElements","isNodeList","setTransitionDuration","els","transitionDuration","setVisibilityState","getOwnerDocument","elementOrElements","updateTransitionEndListener","box","listener","actualContains","_target$getRootNode","currentInput","isTouch","lastMouseMoveTime","onDocumentTouchStart","performance","onDocumentMouseMove","onWindowBlur","activeElement","blur","isVisible","isIE11","msCrypto","pluginProps","animateFill","followCursor","inlinePositioning","sticky","defaultProps","aria","expanded","getReferenceClientRect","hideOnClick","ignoreAttributes","interactive","interactiveBorder","interactiveDebounce","moveTransition","onAfterUpdate","onBeforeUpdate","onCreate","onDestroy","onHidden","onHide","onMount","onShow","onShown","onTrigger","onUntrigger","onClickOutside","plugins","popperOptions","render","showOnCreate","touch","triggerTarget","allowHTML","inertia","maxWidth","role","theme","zIndex","defaultKeys","getExtendedPassedProps","passedProps","plugin","_name","evaluateProps","valueAsString","getDataAttributeProps","dangerouslySetInnerHTML","createArrowElement","getChildren","firstElementChild","boxChildren","backdrop","onUpdate","prevProps","nextProps","_getChildren","$$tippy","idCounter","mouseMoveListeners","mountedInstances","createTippy","showTimeout","hideTimeout","scheduleHideAnimationFrame","lastTriggerEvent","currentTransitionEndListener","isVisibleFromClick","didHideDueToDocumentMouseDown","didTouchMove","ignoreOnFirstUpdate","debouncedOnMouseMove","onMouseMove","popperInstance","isMounted","isShown","clearDelayTimeouts","cancelAnimationFrame","setProps","partialProps","invokeHook","removeListeners","addListeners","cleanupInteractiveMouseListeners","handleAriaExpandedAttribute","handleStyles","createPopperInstance","getNestedPopperTree","nestedPopper","requestAnimationFrame","setContent","show","isAlreadyVisible","isDisabled","isTouchAndTouchDisabled","getCurrentTarget","getIsDefaultRenderFn","visibility","addDocumentPress","transition","_getDefaultTemplateCh2","getDefaultTemplateChildren","_instance$popperInsta2","_getDefaultTemplateCh3","_box","_content","handleAriaContentAttribute","onTransitionEnd","onTransitionedIn","mount","isAlreadyHidden","removeDocumentPress","_getDefaultTemplateCh4","onTransitionedOut","unmount","hideWithInteractivity","getDocument","destroyPopperInstance","_props$render","pluginsHooks","hasAriaExpanded","scheduleShow","getNormalizedTouchSettings","getIsCustomTouchBehavior","_instance$props$rende","getDelay","isShow","fromHide","pointerEvents","hook","shouldInvokePropsHook","_instance$props","pluginHooks","attr","currentValue","nextValue","onDocumentPress","actualTarget","composedPath","onTouchMove","onTouchStart","doc","eventType","handler","onMouseLeave","onBlurOrFocusOut","_lastTriggerEvent","shouldScheduleClickHide","isEventListenerStopped","wasFocused","scheduleHide","isCursorOverReferenceOrPopper","popperTreeData","clientX","clientY","popperState","topDistance","bottomDistance","leftDistance","rightDistance","exceedsTop","exceedsBottom","exceedsLeft","exceedsRight","isCursorOutsideInteractiveBorder","_instance$popperInsta","relatedTarget","_instance$props2","computedReference","_getNormalizedTouchSe","touchValue","touchDelay","tippy","optionalProps","instances","setDefaultProps","initializeTooltip","tooltipPlacement","tooltipText","tooltipAllowHtml","adapters","WebSocket","_adapters$logger","messages","secondsSince","ConnectionMonitor","connection","visibilityDidChange","reconnectAttempts","isRunning","startedAt","stoppedAt","staleThreshold","stopPolling","pingedAt","recordPing","disconnectedAt","poll","pollTimeout","reconnectIfStale","getPollInterval","_this$constructor","reconnectionBackoffRate","random","connectionIsStale","refreshedAt","disconnectedRecently","reopen","visibilityState","isOpen","INTERNAL","message_types","welcome","ping","confirmation","rejection","protocols","supportedProtocols","Connection","consumer","subscriptions","monitor","disconnected","webSocket","send","isActive","getState","uninstallEventHandlers","installEventHandlers","allowReconnect","close","reopenDelay","protocol","isState","getProtocol","states","events","isProtocolSupported","_JSON$parse","reason","reconnect","recordConnect","reload","confirmSubscription","notify","recordDisconnect","notifyAll","willAttemptReconnect","Subscription","mixin","command","SubscriptionGuarantor","pendingSubscriptions","subscription","startGuaranteeing","stopGuaranteeing","retrySubscribing","retryTimeout","subscribe","Subscriptions","guarantor","channelName","channel","ensureActiveConnection","forget","sendCommand","callbackName","guarantee","Consumer","_url","createWebSocketURL","getConfig","_window$App","createConsumer","_window$App$channels$","currentOrganizationTag","organizationMember","unsubscribe","received","prepend","Stimulus","logicalName","identifierForContextKey","definitionForModuleAndIdentifier","definitionForModuleWithContextAndKey","definitionsFromContext","bulmahead","idMenu","onSelect","menuEl","suggEl","fetchCustomers","customers","customer","toggleCustomerFormPartial","customerSearch","targetIdKey","targetFieldsKey"],"mappings":";0FAAA,mGAASA,EAAQC,GAAmV,OAAtOD,EAArD,oBAAXE,QAAoD,kBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,oBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,GAEnX,SAASK,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GAAO,IAAM,IAAIC,EAAOP,EAAIK,GAAKC,GAAUE,EAAQD,EAAKC,MAAS,MAAOC,GAAwB,YAAfP,EAAOO,GAAsBF,EAAKG,KAAQT,EAAQO,GAAiBG,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AE1EoB,OAAOkP,QAAQo+B,EAAMxvC,KAAKuJ,SAAQ,SAAA+B,GAAa,IAADG,EAAAtH,EAAAmH,EAAA,GAAV6f,EAAC1f,EAAA,GAAE2f,EAAC3f,EAAA,GAChC7F,EAAIqG,SAASyqB,eAAe,GAAD3sB,OAAIgqE,EAAen9C,QAAQq9C,gBAAe,KAAAlqE,OAAIohB,IAC3EvlB,IAAGA,EAAE9E,MAAQsqB,QAI0D,IAAK,S","file":"js/application-7c571216ff654b0772c3.chunk.js","sourcesContent":["function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\nimport _regeneratorRuntime from \"@babel/runtime/regenerator\";\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n/*\nStimulus 3.2.1\nCopyright © 2023 Basecamp, LLC\n */\nvar EventListener = /*#__PURE__*/function () {\n function EventListener(eventTarget, eventName, eventOptions) {\n _classCallCheck(this, EventListener);\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n _createClass(EventListener, [{\n key: \"connect\",\n value: function connect() {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n }\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n }\n }, {\n key: \"bindingConnected\",\n value: function bindingConnected(binding) {\n this.unorderedBindings.add(binding);\n }\n }, {\n key: \"bindingDisconnected\",\n value: function bindingDisconnected(binding) {\n this.unorderedBindings.delete(binding);\n }\n }, {\n key: \"handleEvent\",\n value: function handleEvent(event) {\n var extendedEvent = extendEvent(event);\n var _iterator = _createForOfIteratorHelper(this.bindings),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var binding = _step.value;\n if (extendedEvent.immediatePropagationStopped) {\n break;\n } else {\n binding.handleEvent(extendedEvent);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }, {\n key: \"hasBindings\",\n value: function hasBindings() {\n return this.unorderedBindings.size > 0;\n }\n }, {\n key: \"bindings\",\n get: function get() {\n return Array.from(this.unorderedBindings).sort(function (left, right) {\n var leftIndex = left.index,\n rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n }\n }]);\n return EventListener;\n}();\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n } else {\n var _stopImmediatePropagation = event.stopImmediatePropagation;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation: function stopImmediatePropagation() {\n this.immediatePropagationStopped = true;\n _stopImmediatePropagation.call(this);\n }\n });\n }\n}\nvar Dispatcher = /*#__PURE__*/function () {\n function Dispatcher(application) {\n _classCallCheck(this, Dispatcher);\n this.application = application;\n this.eventListenerMaps = new Map();\n this.started = false;\n }\n _createClass(Dispatcher, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach(function (eventListener) {\n return eventListener.connect();\n });\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach(function (eventListener) {\n return eventListener.disconnect();\n });\n }\n }\n }, {\n key: \"eventListeners\",\n get: function get() {\n return Array.from(this.eventListenerMaps.values()).reduce(function (listeners, map) {\n return listeners.concat(Array.from(map.values()));\n }, []);\n }\n }, {\n key: \"bindingConnected\",\n value: function bindingConnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n }\n }, {\n key: \"bindingDisconnected\",\n value: function bindingDisconnected(binding) {\n var clearEventListeners = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n if (clearEventListeners) this.clearEventListenersForBinding(binding);\n }\n }, {\n key: \"handleError\",\n value: function handleError(error, message) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n this.application.handleError(error, \"Error \".concat(message), detail);\n }\n }, {\n key: \"clearEventListenersForBinding\",\n value: function clearEventListenersForBinding(binding) {\n var eventListener = this.fetchEventListenerForBinding(binding);\n if (!eventListener.hasBindings()) {\n eventListener.disconnect();\n this.removeMappedEventListenerFor(binding);\n }\n }\n }, {\n key: \"removeMappedEventListenerFor\",\n value: function removeMappedEventListenerFor(binding) {\n var eventTarget = binding.eventTarget,\n eventName = binding.eventName,\n eventOptions = binding.eventOptions;\n var eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n var cacheKey = this.cacheKey(eventName, eventOptions);\n eventListenerMap.delete(cacheKey);\n if (eventListenerMap.size == 0) this.eventListenerMaps.delete(eventTarget);\n }\n }, {\n key: \"fetchEventListenerForBinding\",\n value: function fetchEventListenerForBinding(binding) {\n var eventTarget = binding.eventTarget,\n eventName = binding.eventName,\n eventOptions = binding.eventOptions;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n }\n }, {\n key: \"fetchEventListener\",\n value: function fetchEventListener(eventTarget, eventName, eventOptions) {\n var eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n var cacheKey = this.cacheKey(eventName, eventOptions);\n var eventListener = eventListenerMap.get(cacheKey);\n if (!eventListener) {\n eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n eventListenerMap.set(cacheKey, eventListener);\n }\n return eventListener;\n }\n }, {\n key: \"createEventListener\",\n value: function createEventListener(eventTarget, eventName, eventOptions) {\n var eventListener = new EventListener(eventTarget, eventName, eventOptions);\n if (this.started) {\n eventListener.connect();\n }\n return eventListener;\n }\n }, {\n key: \"fetchEventListenerMapForEventTarget\",\n value: function fetchEventListenerMapForEventTarget(eventTarget) {\n var eventListenerMap = this.eventListenerMaps.get(eventTarget);\n if (!eventListenerMap) {\n eventListenerMap = new Map();\n this.eventListenerMaps.set(eventTarget, eventListenerMap);\n }\n return eventListenerMap;\n }\n }, {\n key: \"cacheKey\",\n value: function cacheKey(eventName, eventOptions) {\n var parts = [eventName];\n Object.keys(eventOptions).sort().forEach(function (key) {\n parts.push(\"\".concat(eventOptions[key] ? \"\" : \"!\").concat(key));\n });\n return parts.join(\":\");\n }\n }]);\n return Dispatcher;\n}();\nvar defaultActionDescriptorFilters = {\n stop: function stop(_ref) {\n var event = _ref.event,\n value = _ref.value;\n if (value) event.stopPropagation();\n return true;\n },\n prevent: function prevent(_ref2) {\n var event = _ref2.event,\n value = _ref2.value;\n if (value) event.preventDefault();\n return true;\n },\n self: function self(_ref3) {\n var event = _ref3.event,\n value = _ref3.value,\n element = _ref3.element;\n if (value) {\n return element === event.target;\n } else {\n return true;\n }\n }\n};\nvar descriptorPattern = /^(?:(?:([^.]+?)\\+)?(.+?)(?:\\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n var source = descriptorString.trim();\n var matches = source.match(descriptorPattern) || [];\n var eventName = matches[2];\n var keyFilter = matches[3];\n if (keyFilter && ![\"keydown\", \"keyup\", \"keypress\"].includes(eventName)) {\n eventName += \".\".concat(keyFilter);\n keyFilter = \"\";\n }\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName: eventName,\n eventOptions: matches[7] ? parseEventOptions(matches[7]) : {},\n identifier: matches[5],\n methodName: matches[6],\n keyFilter: matches[1] || keyFilter\n };\n}\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n } else if (eventTargetName == \"document\") {\n return document;\n }\n}\nfunction parseEventOptions(eventOptions) {\n return eventOptions.split(\":\").reduce(function (options, token) {\n return Object.assign(options, _defineProperty({}, token.replace(/^!/, \"\"), !/^!/.test(token)));\n }, {});\n}\nfunction stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n } else if (eventTarget == document) {\n return \"document\";\n }\n}\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, function (_, char) {\n return char.toUpperCase();\n });\n}\nfunction namespaceCamelize(value) {\n return camelize(value.replace(/--/g, \"-\").replace(/__/g, \"_\"));\n}\nfunction capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n return value.replace(/([A-Z])/g, function (_, char) {\n return \"-\".concat(char.toLowerCase());\n });\n}\nfunction tokenize(value) {\n return value.match(/[^\\s]+/g) || [];\n}\nfunction isSomething(object) {\n return object !== null && object !== undefined;\n}\nfunction hasProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\nvar allModifiers = [\"meta\", \"ctrl\", \"alt\", \"shift\"];\nvar Action = /*#__PURE__*/function () {\n function Action(element, index, descriptor, schema) {\n _classCallCheck(this, Action);\n this.element = element;\n this.index = index;\n this.eventTarget = descriptor.eventTarget || element;\n this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n this.eventOptions = descriptor.eventOptions || {};\n this.identifier = descriptor.identifier || error(\"missing identifier\");\n this.methodName = descriptor.methodName || error(\"missing method name\");\n this.keyFilter = descriptor.keyFilter || \"\";\n this.schema = schema;\n }\n _createClass(Action, [{\n key: \"toString\",\n value: function toString() {\n var eventFilter = this.keyFilter ? \".\".concat(this.keyFilter) : \"\";\n var eventTarget = this.eventTargetName ? \"@\".concat(this.eventTargetName) : \"\";\n return \"\".concat(this.eventName).concat(eventFilter).concat(eventTarget, \"->\").concat(this.identifier, \"#\").concat(this.methodName);\n }\n }, {\n key: \"shouldIgnoreKeyboardEvent\",\n value: function shouldIgnoreKeyboardEvent(event) {\n if (!this.keyFilter) {\n return false;\n }\n var filters = this.keyFilter.split(\"+\");\n if (this.keyFilterDissatisfied(event, filters)) {\n return true;\n }\n var standardFilter = filters.filter(function (key) {\n return !allModifiers.includes(key);\n })[0];\n if (!standardFilter) {\n return false;\n }\n if (!hasProperty(this.keyMappings, standardFilter)) {\n error(\"contains unknown key filter: \".concat(this.keyFilter));\n }\n return this.keyMappings[standardFilter].toLowerCase() !== event.key.toLowerCase();\n }\n }, {\n key: \"shouldIgnoreMouseEvent\",\n value: function shouldIgnoreMouseEvent(event) {\n if (!this.keyFilter) {\n return false;\n }\n var filters = [this.keyFilter];\n if (this.keyFilterDissatisfied(event, filters)) {\n return true;\n }\n return false;\n }\n }, {\n key: \"params\",\n get: function get() {\n var params = {};\n var pattern = new RegExp(\"^data-\".concat(this.identifier, \"-(.+)-param$\"), \"i\");\n for (var _i = 0, _Array$from = Array.from(this.element.attributes); _i < _Array$from.length; _i++) {\n var _ref5 = _Array$from[_i];\n var name = _ref5.name;\n var value = _ref5.value;\n var match = name.match(pattern);\n var key = match && match[1];\n if (key) {\n params[camelize(key)] = typecast(value);\n }\n }\n return params;\n }\n }, {\n key: \"eventTargetName\",\n get: function get() {\n return stringifyEventTarget(this.eventTarget);\n }\n }, {\n key: \"keyMappings\",\n get: function get() {\n return this.schema.keyMappings;\n }\n }, {\n key: \"keyFilterDissatisfied\",\n value: function keyFilterDissatisfied(event, filters) {\n var _allModifiers$map = allModifiers.map(function (modifier) {\n return filters.includes(modifier);\n }),\n _allModifiers$map2 = _slicedToArray(_allModifiers$map, 4),\n meta = _allModifiers$map2[0],\n ctrl = _allModifiers$map2[1],\n alt = _allModifiers$map2[2],\n shift = _allModifiers$map2[3];\n return event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== alt || event.shiftKey !== shift;\n }\n }], [{\n key: \"forToken\",\n value: function forToken(token, schema) {\n return new this(token.element, token.index, parseActionDescriptorString(token.content), schema);\n }\n }]);\n return Action;\n}();\nvar defaultEventNames = {\n a: function a() {\n return \"click\";\n },\n button: function button() {\n return \"click\";\n },\n form: function form() {\n return \"submit\";\n },\n details: function details() {\n return \"toggle\";\n },\n input: function input(e) {\n return e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\";\n },\n select: function select() {\n return \"change\";\n },\n textarea: function textarea() {\n return \"input\";\n }\n};\nfunction getDefaultEventNameForElement(element) {\n var tagName = element.tagName.toLowerCase();\n if (tagName in defaultEventNames) {\n return defaultEventNames[tagName](element);\n }\n}\nfunction error(message) {\n throw new Error(message);\n}\nfunction typecast(value) {\n try {\n return JSON.parse(value);\n } catch (o_O) {\n return value;\n }\n}\nvar Binding = /*#__PURE__*/function () {\n function Binding(context, action) {\n _classCallCheck(this, Binding);\n this.context = context;\n this.action = action;\n }\n _createClass(Binding, [{\n key: \"index\",\n get: function get() {\n return this.action.index;\n }\n }, {\n key: \"eventTarget\",\n get: function get() {\n return this.action.eventTarget;\n }\n }, {\n key: \"eventOptions\",\n get: function get() {\n return this.action.eventOptions;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.context.identifier;\n }\n }, {\n key: \"handleEvent\",\n value: function handleEvent(event) {\n var actionEvent = this.prepareActionEvent(event);\n if (this.willBeInvokedByEvent(event) && this.applyEventModifiers(actionEvent)) {\n this.invokeWithEvent(actionEvent);\n }\n }\n }, {\n key: \"eventName\",\n get: function get() {\n return this.action.eventName;\n }\n }, {\n key: \"method\",\n get: function get() {\n var method = this.controller[this.methodName];\n if (typeof method == \"function\") {\n return method;\n }\n throw new Error(\"Action \\\"\".concat(this.action, \"\\\" references undefined method \\\"\").concat(this.methodName, \"\\\"\"));\n }\n }, {\n key: \"applyEventModifiers\",\n value: function applyEventModifiers(event) {\n var element = this.action.element;\n var actionDescriptorFilters = this.context.application.actionDescriptorFilters;\n var controller = this.context.controller;\n var passes = true;\n for (var _i2 = 0, _Object$entries = Object.entries(this.eventOptions); _i2 < _Object$entries.length; _i2++) {\n var _ref8 = _Object$entries[_i2];\n var _ref7 = _slicedToArray(_ref8, 2);\n var name = _ref7[0];\n var value = _ref7[1];\n if (name in actionDescriptorFilters) {\n var filter = actionDescriptorFilters[name];\n passes = passes && filter({\n name: name,\n value: value,\n event: event,\n element: element,\n controller: controller\n });\n } else {\n continue;\n }\n }\n return passes;\n }\n }, {\n key: \"prepareActionEvent\",\n value: function prepareActionEvent(event) {\n return Object.assign(event, {\n params: this.action.params\n });\n }\n }, {\n key: \"invokeWithEvent\",\n value: function invokeWithEvent(event) {\n var target = event.target,\n currentTarget = event.currentTarget;\n try {\n this.method.call(this.controller, event);\n this.context.logDebugActivity(this.methodName, {\n event: event,\n target: target,\n currentTarget: currentTarget,\n action: this.methodName\n });\n } catch (error) {\n var identifier = this.identifier,\n controller = this.controller,\n element = this.element,\n index = this.index;\n var detail = {\n identifier: identifier,\n controller: controller,\n element: element,\n index: index,\n event: event\n };\n this.context.handleError(error, \"invoking action \\\"\".concat(this.action, \"\\\"\"), detail);\n }\n }\n }, {\n key: \"willBeInvokedByEvent\",\n value: function willBeInvokedByEvent(event) {\n var eventTarget = event.target;\n if (event instanceof KeyboardEvent && this.action.shouldIgnoreKeyboardEvent(event)) {\n return false;\n }\n if (event instanceof MouseEvent && this.action.shouldIgnoreMouseEvent(event)) {\n return false;\n }\n if (this.element === eventTarget) {\n return true;\n } else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n } else {\n return this.scope.containsElement(this.action.element);\n }\n }\n }, {\n key: \"controller\",\n get: function get() {\n return this.context.controller;\n }\n }, {\n key: \"methodName\",\n get: function get() {\n return this.action.methodName;\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"scope\",\n get: function get() {\n return this.context.scope;\n }\n }]);\n return Binding;\n}();\nvar ElementObserver = /*#__PURE__*/function () {\n function ElementObserver(element, delegate) {\n var _this = this;\n _classCallCheck(this, ElementObserver);\n this.mutationObserverInit = {\n attributes: true,\n childList: true,\n subtree: true\n };\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set();\n this.mutationObserver = new MutationObserver(function (mutations) {\n return _this.processMutations(mutations);\n });\n }\n _createClass(ElementObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.refresh();\n }\n }\n }, {\n key: \"pause\",\n value: function pause(callback) {\n if (this.started) {\n this.mutationObserver.disconnect();\n this.started = false;\n }\n callback();\n if (!this.started) {\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.started = true;\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n if (this.started) {\n var matches = new Set(this.matchElementsInTree());\n for (var _i3 = 0, _Array$from2 = Array.from(this.elements); _i3 < _Array$from2.length; _i3++) {\n var element = _Array$from2[_i3];\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n for (var _i4 = 0, _Array$from3 = Array.from(matches); _i4 < _Array$from3.length; _i4++) {\n var _element2 = _Array$from3[_i4];\n this.addElement(_element2);\n }\n }\n }\n }, {\n key: \"processMutations\",\n value: function processMutations(mutations) {\n if (this.started) {\n var _iterator2 = _createForOfIteratorHelper(mutations),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var mutation = _step2.value;\n this.processMutation(mutation);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n }\n }, {\n key: \"processMutation\",\n value: function processMutation(mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n } else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n }\n }, {\n key: \"processAttributeChange\",\n value: function processAttributeChange(element, attributeName) {\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n } else {\n this.removeElement(element);\n }\n } else if (this.matchElement(element)) {\n this.addElement(element);\n }\n }\n }, {\n key: \"processRemovedNodes\",\n value: function processRemovedNodes(nodes) {\n for (var _i5 = 0, _Array$from4 = Array.from(nodes); _i5 < _Array$from4.length; _i5++) {\n var node = _Array$from4[_i5];\n var element = this.elementFromNode(node);\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n }\n }, {\n key: \"processAddedNodes\",\n value: function processAddedNodes(nodes) {\n for (var _i6 = 0, _Array$from5 = Array.from(nodes); _i6 < _Array$from5.length; _i6++) {\n var node = _Array$from5[_i6];\n var element = this.elementFromNode(node);\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n }\n }, {\n key: \"matchElement\",\n value: function matchElement(element) {\n return this.delegate.matchElement(element);\n }\n }, {\n key: \"matchElementsInTree\",\n value: function matchElementsInTree() {\n var tree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n return this.delegate.matchElementsInTree(tree);\n }\n }, {\n key: \"processTree\",\n value: function processTree(tree, processor) {\n var _iterator3 = _createForOfIteratorHelper(this.matchElementsInTree(tree)),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var element = _step3.value;\n processor.call(this, element);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }, {\n key: \"elementFromNode\",\n value: function elementFromNode(node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n }\n }, {\n key: \"elementIsActive\",\n value: function elementIsActive(element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n } else {\n return this.element.contains(element);\n }\n }\n }, {\n key: \"addElement\",\n value: function addElement(element) {\n if (!this.elements.has(element)) {\n if (this.elementIsActive(element)) {\n this.elements.add(element);\n if (this.delegate.elementMatched) {\n this.delegate.elementMatched(element);\n }\n }\n }\n }\n }, {\n key: \"removeElement\",\n value: function removeElement(element) {\n if (this.elements.has(element)) {\n this.elements.delete(element);\n if (this.delegate.elementUnmatched) {\n this.delegate.elementUnmatched(element);\n }\n }\n }\n }]);\n return ElementObserver;\n}();\nvar AttributeObserver = /*#__PURE__*/function () {\n function AttributeObserver(element, attributeName, delegate) {\n _classCallCheck(this, AttributeObserver);\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new ElementObserver(element, this);\n }\n _createClass(AttributeObserver, [{\n key: \"element\",\n get: function get() {\n return this.elementObserver.element;\n }\n }, {\n key: \"selector\",\n get: function get() {\n return \"[\".concat(this.attributeName, \"]\");\n }\n }, {\n key: \"start\",\n value: function start() {\n this.elementObserver.start();\n }\n }, {\n key: \"pause\",\n value: function pause(callback) {\n this.elementObserver.pause(callback);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.elementObserver.stop();\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.elementObserver.refresh();\n }\n }, {\n key: \"started\",\n get: function get() {\n return this.elementObserver.started;\n }\n }, {\n key: \"matchElement\",\n value: function matchElement(element) {\n return element.hasAttribute(this.attributeName);\n }\n }, {\n key: \"matchElementsInTree\",\n value: function matchElementsInTree(tree) {\n var match = this.matchElement(tree) ? [tree] : [];\n var matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n }\n }, {\n key: \"elementMatched\",\n value: function elementMatched(element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n }\n }, {\n key: \"elementUnmatched\",\n value: function elementUnmatched(element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n }\n }, {\n key: \"elementAttributeChanged\",\n value: function elementAttributeChanged(element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n }\n }]);\n return AttributeObserver;\n}();\nfunction _add(map, key, value) {\n fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n fetch(map, key).delete(value);\n prune(map, key);\n}\nfunction fetch(map, key) {\n var values = map.get(key);\n if (!values) {\n values = new Set();\n map.set(key, values);\n }\n return values;\n}\nfunction prune(map, key) {\n var values = map.get(key);\n if (values != null && values.size == 0) {\n map.delete(key);\n }\n}\nvar Multimap = /*#__PURE__*/function () {\n function Multimap() {\n _classCallCheck(this, Multimap);\n this.valuesByKey = new Map();\n }\n _createClass(Multimap, [{\n key: \"keys\",\n get: function get() {\n return Array.from(this.valuesByKey.keys());\n }\n }, {\n key: \"values\",\n get: function get() {\n var sets = Array.from(this.valuesByKey.values());\n return sets.reduce(function (values, set) {\n return values.concat(Array.from(set));\n }, []);\n }\n }, {\n key: \"size\",\n get: function get() {\n var sets = Array.from(this.valuesByKey.values());\n return sets.reduce(function (size, set) {\n return size + set.size;\n }, 0);\n }\n }, {\n key: \"add\",\n value: function add(key, value) {\n _add(this.valuesByKey, key, value);\n }\n }, {\n key: \"delete\",\n value: function _delete(key, value) {\n del(this.valuesByKey, key, value);\n }\n }, {\n key: \"has\",\n value: function has(key, value) {\n var values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n }\n }, {\n key: \"hasKey\",\n value: function hasKey(key) {\n return this.valuesByKey.has(key);\n }\n }, {\n key: \"hasValue\",\n value: function hasValue(value) {\n var sets = Array.from(this.valuesByKey.values());\n return sets.some(function (set) {\n return set.has(value);\n });\n }\n }, {\n key: \"getValuesForKey\",\n value: function getValuesForKey(key) {\n var values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n }\n }, {\n key: \"getKeysForValue\",\n value: function getKeysForValue(value) {\n return Array.from(this.valuesByKey).filter(function (_ref9) {\n var _ref10 = _slicedToArray(_ref9, 2),\n _key = _ref10[0],\n values = _ref10[1];\n return values.has(value);\n }).map(function (_ref11) {\n var _ref12 = _slicedToArray(_ref11, 2),\n key = _ref12[0],\n _values = _ref12[1];\n return key;\n });\n }\n }]);\n return Multimap;\n}();\nvar IndexedMultimap = /*#__PURE__*/function (_Multimap) {\n _inherits(IndexedMultimap, _Multimap);\n var _super = _createSuper(IndexedMultimap);\n function IndexedMultimap() {\n var _this2;\n _classCallCheck(this, IndexedMultimap);\n _this2 = _super.call(this);\n _this2.keysByValue = new Map();\n return _this2;\n }\n _createClass(IndexedMultimap, [{\n key: \"values\",\n get: function get() {\n return Array.from(this.keysByValue.keys());\n }\n }, {\n key: \"add\",\n value: function add(key, value) {\n _get(_getPrototypeOf(IndexedMultimap.prototype), \"add\", this).call(this, key, value);\n _add(this.keysByValue, value, key);\n }\n }, {\n key: \"delete\",\n value: function _delete(key, value) {\n _get(_getPrototypeOf(IndexedMultimap.prototype), \"delete\", this).call(this, key, value);\n del(this.keysByValue, value, key);\n }\n }, {\n key: \"hasValue\",\n value: function hasValue(value) {\n return this.keysByValue.has(value);\n }\n }, {\n key: \"getKeysForValue\",\n value: function getKeysForValue(value) {\n var set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n }\n }]);\n return IndexedMultimap;\n}(Multimap);\nvar SelectorObserver = /*#__PURE__*/function () {\n function SelectorObserver(element, selector, delegate, details) {\n _classCallCheck(this, SelectorObserver);\n this._selector = selector;\n this.details = details;\n this.elementObserver = new ElementObserver(element, this);\n this.delegate = delegate;\n this.matchesByElement = new Multimap();\n }\n _createClass(SelectorObserver, [{\n key: \"started\",\n get: function get() {\n return this.elementObserver.started;\n }\n }, {\n key: \"selector\",\n get: function get() {\n return this._selector;\n },\n set: function set(selector) {\n this._selector = selector;\n this.refresh();\n }\n }, {\n key: \"start\",\n value: function start() {\n this.elementObserver.start();\n }\n }, {\n key: \"pause\",\n value: function pause(callback) {\n this.elementObserver.pause(callback);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.elementObserver.stop();\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.elementObserver.refresh();\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.elementObserver.element;\n }\n }, {\n key: \"matchElement\",\n value: function matchElement(element) {\n var selector = this.selector;\n if (selector) {\n var matches = element.matches(selector);\n if (this.delegate.selectorMatchElement) {\n return matches && this.delegate.selectorMatchElement(element, this.details);\n }\n return matches;\n } else {\n return false;\n }\n }\n }, {\n key: \"matchElementsInTree\",\n value: function matchElementsInTree(tree) {\n var _this3 = this;\n var selector = this.selector;\n if (selector) {\n var match = this.matchElement(tree) ? [tree] : [];\n var matches = Array.from(tree.querySelectorAll(selector)).filter(function (match) {\n return _this3.matchElement(match);\n });\n return match.concat(matches);\n } else {\n return [];\n }\n }\n }, {\n key: \"elementMatched\",\n value: function elementMatched(element) {\n var selector = this.selector;\n if (selector) {\n this.selectorMatched(element, selector);\n }\n }\n }, {\n key: \"elementUnmatched\",\n value: function elementUnmatched(element) {\n var selectors = this.matchesByElement.getKeysForValue(element);\n var _iterator4 = _createForOfIteratorHelper(selectors),\n _step4;\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var selector = _step4.value;\n this.selectorUnmatched(element, selector);\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n }\n }, {\n key: \"elementAttributeChanged\",\n value: function elementAttributeChanged(element, _attributeName) {\n var selector = this.selector;\n if (selector) {\n var matches = this.matchElement(element);\n var matchedBefore = this.matchesByElement.has(selector, element);\n if (matches && !matchedBefore) {\n this.selectorMatched(element, selector);\n } else if (!matches && matchedBefore) {\n this.selectorUnmatched(element, selector);\n }\n }\n }\n }, {\n key: \"selectorMatched\",\n value: function selectorMatched(element, selector) {\n this.delegate.selectorMatched(element, selector, this.details);\n this.matchesByElement.add(selector, element);\n }\n }, {\n key: \"selectorUnmatched\",\n value: function selectorUnmatched(element, selector) {\n this.delegate.selectorUnmatched(element, selector, this.details);\n this.matchesByElement.delete(selector, element);\n }\n }]);\n return SelectorObserver;\n}();\nvar StringMapObserver = /*#__PURE__*/function () {\n function StringMapObserver(element, delegate) {\n var _this4 = this;\n _classCallCheck(this, StringMapObserver);\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map();\n this.mutationObserver = new MutationObserver(function (mutations) {\n return _this4.processMutations(mutations);\n });\n }\n _createClass(StringMapObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, {\n attributes: true,\n attributeOldValue: true\n });\n this.refresh();\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n if (this.started) {\n var _iterator5 = _createForOfIteratorHelper(this.knownAttributeNames),\n _step5;\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var attributeName = _step5.value;\n this.refreshAttribute(attributeName, null);\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n }\n }\n }, {\n key: \"processMutations\",\n value: function processMutations(mutations) {\n if (this.started) {\n var _iterator6 = _createForOfIteratorHelper(mutations),\n _step6;\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var mutation = _step6.value;\n this.processMutation(mutation);\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n }\n }\n }, {\n key: \"processMutation\",\n value: function processMutation(mutation) {\n var attributeName = mutation.attributeName;\n if (attributeName) {\n this.refreshAttribute(attributeName, mutation.oldValue);\n }\n }\n }, {\n key: \"refreshAttribute\",\n value: function refreshAttribute(attributeName, oldValue) {\n var key = this.delegate.getStringMapKeyForAttribute(attributeName);\n if (key != null) {\n if (!this.stringMap.has(attributeName)) {\n this.stringMapKeyAdded(key, attributeName);\n }\n var value = this.element.getAttribute(attributeName);\n if (this.stringMap.get(attributeName) != value) {\n this.stringMapValueChanged(value, key, oldValue);\n }\n if (value == null) {\n var _oldValue = this.stringMap.get(attributeName);\n this.stringMap.delete(attributeName);\n if (_oldValue) this.stringMapKeyRemoved(key, attributeName, _oldValue);\n } else {\n this.stringMap.set(attributeName, value);\n }\n }\n }\n }, {\n key: \"stringMapKeyAdded\",\n value: function stringMapKeyAdded(key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n }\n }, {\n key: \"stringMapValueChanged\",\n value: function stringMapValueChanged(value, key, oldValue) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key, oldValue);\n }\n }\n }, {\n key: \"stringMapKeyRemoved\",\n value: function stringMapKeyRemoved(key, attributeName, oldValue) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n }\n }, {\n key: \"knownAttributeNames\",\n get: function get() {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n }\n }, {\n key: \"currentAttributeNames\",\n get: function get() {\n return Array.from(this.element.attributes).map(function (attribute) {\n return attribute.name;\n });\n }\n }, {\n key: \"recordedAttributeNames\",\n get: function get() {\n return Array.from(this.stringMap.keys());\n }\n }]);\n return StringMapObserver;\n}();\nvar TokenListObserver = /*#__PURE__*/function () {\n function TokenListObserver(element, attributeName, delegate) {\n _classCallCheck(this, TokenListObserver);\n this.attributeObserver = new AttributeObserver(element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new Multimap();\n }\n _createClass(TokenListObserver, [{\n key: \"started\",\n get: function get() {\n return this.attributeObserver.started;\n }\n }, {\n key: \"start\",\n value: function start() {\n this.attributeObserver.start();\n }\n }, {\n key: \"pause\",\n value: function pause(callback) {\n this.attributeObserver.pause(callback);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.attributeObserver.stop();\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.attributeObserver.refresh();\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.attributeObserver.element;\n }\n }, {\n key: \"attributeName\",\n get: function get() {\n return this.attributeObserver.attributeName;\n }\n }, {\n key: \"elementMatchedAttribute\",\n value: function elementMatchedAttribute(element) {\n this.tokensMatched(this.readTokensForElement(element));\n }\n }, {\n key: \"elementAttributeValueChanged\",\n value: function elementAttributeValueChanged(element) {\n var _this$refreshTokensFo = this.refreshTokensForElement(element),\n _this$refreshTokensFo2 = _slicedToArray(_this$refreshTokensFo, 2),\n unmatchedTokens = _this$refreshTokensFo2[0],\n matchedTokens = _this$refreshTokensFo2[1];\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n }\n }, {\n key: \"elementUnmatchedAttribute\",\n value: function elementUnmatchedAttribute(element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n }\n }, {\n key: \"tokensMatched\",\n value: function tokensMatched(tokens) {\n var _this5 = this;\n tokens.forEach(function (token) {\n return _this5.tokenMatched(token);\n });\n }\n }, {\n key: \"tokensUnmatched\",\n value: function tokensUnmatched(tokens) {\n var _this6 = this;\n tokens.forEach(function (token) {\n return _this6.tokenUnmatched(token);\n });\n }\n }, {\n key: \"tokenMatched\",\n value: function tokenMatched(token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n }\n }, {\n key: \"tokenUnmatched\",\n value: function tokenUnmatched(token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n }\n }, {\n key: \"refreshTokensForElement\",\n value: function refreshTokensForElement(element) {\n var previousTokens = this.tokensByElement.getValuesForKey(element);\n var currentTokens = this.readTokensForElement(element);\n var firstDifferingIndex = zip(previousTokens, currentTokens).findIndex(function (_ref13) {\n var _ref14 = _slicedToArray(_ref13, 2),\n previousToken = _ref14[0],\n currentToken = _ref14[1];\n return !tokensAreEqual(previousToken, currentToken);\n });\n if (firstDifferingIndex == -1) {\n return [[], []];\n } else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n }\n }, {\n key: \"readTokensForElement\",\n value: function readTokensForElement(element) {\n var attributeName = this.attributeName;\n var tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n }\n }]);\n return TokenListObserver;\n}();\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString.trim().split(/\\s+/).filter(function (content) {\n return content.length;\n }).map(function (content, index) {\n return {\n element: element,\n attributeName: attributeName,\n content: content,\n index: index\n };\n });\n}\nfunction zip(left, right) {\n var length = Math.max(left.length, right.length);\n return Array.from({\n length: length\n }, function (_, index) {\n return [left[index], right[index]];\n });\n}\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}\nvar ValueListObserver = /*#__PURE__*/function () {\n function ValueListObserver(element, attributeName, delegate) {\n _classCallCheck(this, ValueListObserver);\n this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap();\n this.valuesByTokenByElement = new WeakMap();\n }\n _createClass(ValueListObserver, [{\n key: \"started\",\n get: function get() {\n return this.tokenListObserver.started;\n }\n }, {\n key: \"start\",\n value: function start() {\n this.tokenListObserver.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.tokenListObserver.stop();\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.tokenListObserver.refresh();\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.tokenListObserver.element;\n }\n }, {\n key: \"attributeName\",\n get: function get() {\n return this.tokenListObserver.attributeName;\n }\n }, {\n key: \"tokenMatched\",\n value: function tokenMatched(token) {\n var element = token.element;\n var _this$fetchParseResul = this.fetchParseResultForToken(token),\n value = _this$fetchParseResul.value;\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n }\n }, {\n key: \"tokenUnmatched\",\n value: function tokenUnmatched(token) {\n var element = token.element;\n var _this$fetchParseResul2 = this.fetchParseResultForToken(token),\n value = _this$fetchParseResul2.value;\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n }\n }, {\n key: \"fetchParseResultForToken\",\n value: function fetchParseResultForToken(token) {\n var parseResult = this.parseResultsByToken.get(token);\n if (!parseResult) {\n parseResult = this.parseToken(token);\n this.parseResultsByToken.set(token, parseResult);\n }\n return parseResult;\n }\n }, {\n key: \"fetchValuesByTokenForElement\",\n value: function fetchValuesByTokenForElement(element) {\n var valuesByToken = this.valuesByTokenByElement.get(element);\n if (!valuesByToken) {\n valuesByToken = new Map();\n this.valuesByTokenByElement.set(element, valuesByToken);\n }\n return valuesByToken;\n }\n }, {\n key: \"parseToken\",\n value: function parseToken(token) {\n try {\n var value = this.delegate.parseValueForToken(token);\n return {\n value: value\n };\n } catch (error) {\n return {\n error: error\n };\n }\n }\n }]);\n return ValueListObserver;\n}();\nvar BindingObserver = /*#__PURE__*/function () {\n function BindingObserver(context, delegate) {\n _classCallCheck(this, BindingObserver);\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map();\n }\n _createClass(BindingObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.valueListObserver) {\n this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.context.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.context.identifier;\n }\n }, {\n key: \"actionAttribute\",\n get: function get() {\n return this.schema.actionAttribute;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.context.schema;\n }\n }, {\n key: \"bindings\",\n get: function get() {\n return Array.from(this.bindingsByAction.values());\n }\n }, {\n key: \"connectAction\",\n value: function connectAction(action) {\n var binding = new Binding(this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n }\n }, {\n key: \"disconnectAction\",\n value: function disconnectAction(action) {\n var binding = this.bindingsByAction.get(action);\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n }\n }, {\n key: \"disconnectAllActions\",\n value: function disconnectAllActions() {\n var _this7 = this;\n this.bindings.forEach(function (binding) {\n return _this7.delegate.bindingDisconnected(binding, true);\n });\n this.bindingsByAction.clear();\n }\n }, {\n key: \"parseValueForToken\",\n value: function parseValueForToken(token) {\n var action = Action.forToken(token, this.schema);\n if (action.identifier == this.identifier) {\n return action;\n }\n }\n }, {\n key: \"elementMatchedValue\",\n value: function elementMatchedValue(element, action) {\n this.connectAction(action);\n }\n }, {\n key: \"elementUnmatchedValue\",\n value: function elementUnmatchedValue(element, action) {\n this.disconnectAction(action);\n }\n }]);\n return BindingObserver;\n}();\nvar ValueObserver = /*#__PURE__*/function () {\n function ValueObserver(context, receiver) {\n _classCallCheck(this, ValueObserver);\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new StringMapObserver(this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n }\n _createClass(ValueObserver, [{\n key: \"start\",\n value: function start() {\n this.stringMapObserver.start();\n this.invokeChangedCallbacksForDefaultValues();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.stringMapObserver.stop();\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.context.element;\n }\n }, {\n key: \"controller\",\n get: function get() {\n return this.context.controller;\n }\n }, {\n key: \"getStringMapKeyForAttribute\",\n value: function getStringMapKeyForAttribute(attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n }\n }, {\n key: \"stringMapKeyAdded\",\n value: function stringMapKeyAdded(key, attributeName) {\n var descriptor = this.valueDescriptorMap[attributeName];\n if (!this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n }\n }\n }, {\n key: \"stringMapValueChanged\",\n value: function stringMapValueChanged(value, name, oldValue) {\n var descriptor = this.valueDescriptorNameMap[name];\n if (value === null) return;\n if (oldValue === null) {\n oldValue = descriptor.writer(descriptor.defaultValue);\n }\n this.invokeChangedCallback(name, value, oldValue);\n }\n }, {\n key: \"stringMapKeyRemoved\",\n value: function stringMapKeyRemoved(key, attributeName, oldValue) {\n var descriptor = this.valueDescriptorNameMap[key];\n if (this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n } else {\n this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n }\n }\n }, {\n key: \"invokeChangedCallbacksForDefaultValues\",\n value: function invokeChangedCallbacksForDefaultValues() {\n var _iterator7 = _createForOfIteratorHelper(this.valueDescriptors),\n _step7;\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var _ref16 = _step7.value;\n var key = _ref16.key;\n var name = _ref16.name;\n var defaultValue = _ref16.defaultValue;\n var writer = _ref16.writer;\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallback(name, writer(defaultValue), undefined);\n }\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n }\n }, {\n key: \"invokeChangedCallback\",\n value: function invokeChangedCallback(name, rawValue, rawOldValue) {\n var changedMethodName = \"\".concat(name, \"Changed\");\n var changedMethod = this.receiver[changedMethodName];\n if (typeof changedMethod == \"function\") {\n var descriptor = this.valueDescriptorNameMap[name];\n try {\n var value = descriptor.reader(rawValue);\n var oldValue = rawOldValue;\n if (rawOldValue) {\n oldValue = descriptor.reader(rawOldValue);\n }\n changedMethod.call(this.receiver, value, oldValue);\n } catch (error) {\n if (error instanceof TypeError) {\n error.message = \"Stimulus Value \\\"\".concat(this.context.identifier, \".\").concat(descriptor.name, \"\\\" - \").concat(error.message);\n }\n throw error;\n }\n }\n }\n }, {\n key: \"valueDescriptors\",\n get: function get() {\n var valueDescriptorMap = this.valueDescriptorMap;\n return Object.keys(valueDescriptorMap).map(function (key) {\n return valueDescriptorMap[key];\n });\n }\n }, {\n key: \"valueDescriptorNameMap\",\n get: function get() {\n var _this8 = this;\n var descriptors = {};\n Object.keys(this.valueDescriptorMap).forEach(function (key) {\n var descriptor = _this8.valueDescriptorMap[key];\n descriptors[descriptor.name] = descriptor;\n });\n return descriptors;\n }\n }, {\n key: \"hasValue\",\n value: function hasValue(attributeName) {\n var descriptor = this.valueDescriptorNameMap[attributeName];\n var hasMethodName = \"has\".concat(capitalize(descriptor.name));\n return this.receiver[hasMethodName];\n }\n }]);\n return ValueObserver;\n}();\nvar TargetObserver = /*#__PURE__*/function () {\n function TargetObserver(context, delegate) {\n _classCallCheck(this, TargetObserver);\n this.context = context;\n this.delegate = delegate;\n this.targetsByName = new Multimap();\n }\n _createClass(TargetObserver, [{\n key: \"start\",\n value: function start() {\n if (!this.tokenListObserver) {\n this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n this.tokenListObserver.start();\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.tokenListObserver) {\n this.disconnectAllTargets();\n this.tokenListObserver.stop();\n delete this.tokenListObserver;\n }\n }\n }, {\n key: \"tokenMatched\",\n value: function tokenMatched(_ref17) {\n var element = _ref17.element,\n name = _ref17.content;\n if (this.scope.containsElement(element)) {\n this.connectTarget(element, name);\n }\n }\n }, {\n key: \"tokenUnmatched\",\n value: function tokenUnmatched(_ref18) {\n var element = _ref18.element,\n name = _ref18.content;\n this.disconnectTarget(element, name);\n }\n }, {\n key: \"connectTarget\",\n value: function connectTarget(element, name) {\n var _this9 = this;\n var _a;\n if (!this.targetsByName.has(name, element)) {\n this.targetsByName.add(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(function () {\n return _this9.delegate.targetConnected(element, name);\n });\n }\n }\n }, {\n key: \"disconnectTarget\",\n value: function disconnectTarget(element, name) {\n var _this10 = this;\n var _a;\n if (this.targetsByName.has(name, element)) {\n this.targetsByName.delete(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(function () {\n return _this10.delegate.targetDisconnected(element, name);\n });\n }\n }\n }, {\n key: \"disconnectAllTargets\",\n value: function disconnectAllTargets() {\n var _iterator8 = _createForOfIteratorHelper(this.targetsByName.keys),\n _step8;\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var name = _step8.value;\n var _iterator9 = _createForOfIteratorHelper(this.targetsByName.getValuesForKey(name)),\n _step9;\n try {\n for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n var element = _step9.value;\n this.disconnectTarget(element, name);\n }\n } catch (err) {\n _iterator9.e(err);\n } finally {\n _iterator9.f();\n }\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n }\n }, {\n key: \"attributeName\",\n get: function get() {\n return \"data-\".concat(this.context.identifier, \"-target\");\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.context.element;\n }\n }, {\n key: \"scope\",\n get: function get() {\n return this.context.scope;\n }\n }]);\n return TargetObserver;\n}();\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n var ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce(function (values, constructor) {\n getOwnStaticArrayValues(constructor, propertyName).forEach(function (name) {\n return values.add(name);\n });\n return values;\n }, new Set()));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n var ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce(function (pairs, constructor) {\n pairs.push.apply(pairs, _toConsumableArray(getOwnStaticObjectPairs(constructor, propertyName)));\n return pairs;\n }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n var ancestors = [];\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n var definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n var definition = constructor[propertyName];\n return definition ? Object.keys(definition).map(function (key) {\n return [key, definition[key]];\n }) : [];\n}\nvar OutletObserver = /*#__PURE__*/function () {\n function OutletObserver(context, delegate) {\n _classCallCheck(this, OutletObserver);\n this.started = false;\n this.context = context;\n this.delegate = delegate;\n this.outletsByName = new Multimap();\n this.outletElementsByName = new Multimap();\n this.selectorObserverMap = new Map();\n this.attributeObserverMap = new Map();\n }\n _createClass(OutletObserver, [{\n key: \"start\",\n value: function start() {\n var _this11 = this;\n if (!this.started) {\n this.outletDefinitions.forEach(function (outletName) {\n _this11.setupSelectorObserverForOutlet(outletName);\n _this11.setupAttributeObserverForOutlet(outletName);\n });\n this.started = true;\n this.dependentContexts.forEach(function (context) {\n return context.refresh();\n });\n }\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.selectorObserverMap.forEach(function (observer) {\n return observer.refresh();\n });\n this.attributeObserverMap.forEach(function (observer) {\n return observer.refresh();\n });\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.started) {\n this.started = false;\n this.disconnectAllOutlets();\n this.stopSelectorObservers();\n this.stopAttributeObservers();\n }\n }\n }, {\n key: \"stopSelectorObservers\",\n value: function stopSelectorObservers() {\n if (this.selectorObserverMap.size > 0) {\n this.selectorObserverMap.forEach(function (observer) {\n return observer.stop();\n });\n this.selectorObserverMap.clear();\n }\n }\n }, {\n key: \"stopAttributeObservers\",\n value: function stopAttributeObservers() {\n if (this.attributeObserverMap.size > 0) {\n this.attributeObserverMap.forEach(function (observer) {\n return observer.stop();\n });\n this.attributeObserverMap.clear();\n }\n }\n }, {\n key: \"selectorMatched\",\n value: function selectorMatched(element, _selector, _ref19) {\n var outletName = _ref19.outletName;\n var outlet = this.getOutlet(element, outletName);\n if (outlet) {\n this.connectOutlet(outlet, element, outletName);\n }\n }\n }, {\n key: \"selectorUnmatched\",\n value: function selectorUnmatched(element, _selector, _ref20) {\n var outletName = _ref20.outletName;\n var outlet = this.getOutletFromMap(element, outletName);\n if (outlet) {\n this.disconnectOutlet(outlet, element, outletName);\n }\n }\n }, {\n key: \"selectorMatchElement\",\n value: function selectorMatchElement(element, _ref21) {\n var outletName = _ref21.outletName;\n var selector = this.selector(outletName);\n var hasOutlet = this.hasOutlet(element, outletName);\n var hasOutletController = element.matches(\"[\".concat(this.schema.controllerAttribute, \"~=\").concat(outletName, \"]\"));\n if (selector) {\n return hasOutlet && hasOutletController && element.matches(selector);\n } else {\n return false;\n }\n }\n }, {\n key: \"elementMatchedAttribute\",\n value: function elementMatchedAttribute(_element, attributeName) {\n var outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n }, {\n key: \"elementAttributeValueChanged\",\n value: function elementAttributeValueChanged(_element, attributeName) {\n var outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n }, {\n key: \"elementUnmatchedAttribute\",\n value: function elementUnmatchedAttribute(_element, attributeName) {\n var outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n if (outletName) {\n this.updateSelectorObserverForOutlet(outletName);\n }\n }\n }, {\n key: \"connectOutlet\",\n value: function connectOutlet(outlet, element, outletName) {\n var _this12 = this;\n var _a;\n if (!this.outletElementsByName.has(outletName, element)) {\n this.outletsByName.add(outletName, outlet);\n this.outletElementsByName.add(outletName, element);\n (_a = this.selectorObserverMap.get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(function () {\n return _this12.delegate.outletConnected(outlet, element, outletName);\n });\n }\n }\n }, {\n key: \"disconnectOutlet\",\n value: function disconnectOutlet(outlet, element, outletName) {\n var _this13 = this;\n var _a;\n if (this.outletElementsByName.has(outletName, element)) {\n this.outletsByName.delete(outletName, outlet);\n this.outletElementsByName.delete(outletName, element);\n (_a = this.selectorObserverMap.get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(function () {\n return _this13.delegate.outletDisconnected(outlet, element, outletName);\n });\n }\n }\n }, {\n key: \"disconnectAllOutlets\",\n value: function disconnectAllOutlets() {\n var _iterator10 = _createForOfIteratorHelper(this.outletElementsByName.keys),\n _step10;\n try {\n for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n var outletName = _step10.value;\n var _iterator11 = _createForOfIteratorHelper(this.outletElementsByName.getValuesForKey(outletName)),\n _step11;\n try {\n for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {\n var element = _step11.value;\n var _iterator12 = _createForOfIteratorHelper(this.outletsByName.getValuesForKey(outletName)),\n _step12;\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n var outlet = _step12.value;\n this.disconnectOutlet(outlet, element, outletName);\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n }\n } catch (err) {\n _iterator11.e(err);\n } finally {\n _iterator11.f();\n }\n }\n } catch (err) {\n _iterator10.e(err);\n } finally {\n _iterator10.f();\n }\n }\n }, {\n key: \"updateSelectorObserverForOutlet\",\n value: function updateSelectorObserverForOutlet(outletName) {\n var observer = this.selectorObserverMap.get(outletName);\n if (observer) {\n observer.selector = this.selector(outletName);\n }\n }\n }, {\n key: \"setupSelectorObserverForOutlet\",\n value: function setupSelectorObserverForOutlet(outletName) {\n var selector = this.selector(outletName);\n var selectorObserver = new SelectorObserver(document.body, selector, this, {\n outletName: outletName\n });\n this.selectorObserverMap.set(outletName, selectorObserver);\n selectorObserver.start();\n }\n }, {\n key: \"setupAttributeObserverForOutlet\",\n value: function setupAttributeObserverForOutlet(outletName) {\n var attributeName = this.attributeNameForOutletName(outletName);\n var attributeObserver = new AttributeObserver(this.scope.element, attributeName, this);\n this.attributeObserverMap.set(outletName, attributeObserver);\n attributeObserver.start();\n }\n }, {\n key: \"selector\",\n value: function selector(outletName) {\n return this.scope.outlets.getSelectorForOutletName(outletName);\n }\n }, {\n key: \"attributeNameForOutletName\",\n value: function attributeNameForOutletName(outletName) {\n return this.scope.schema.outletAttributeForScope(this.identifier, outletName);\n }\n }, {\n key: \"getOutletNameFromOutletAttributeName\",\n value: function getOutletNameFromOutletAttributeName(attributeName) {\n var _this14 = this;\n return this.outletDefinitions.find(function (outletName) {\n return _this14.attributeNameForOutletName(outletName) === attributeName;\n });\n }\n }, {\n key: \"outletDependencies\",\n get: function get() {\n var dependencies = new Multimap();\n this.router.modules.forEach(function (module) {\n var constructor = module.definition.controllerConstructor;\n var outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n outlets.forEach(function (outlet) {\n return dependencies.add(outlet, module.identifier);\n });\n });\n return dependencies;\n }\n }, {\n key: \"outletDefinitions\",\n get: function get() {\n return this.outletDependencies.getKeysForValue(this.identifier);\n }\n }, {\n key: \"dependentControllerIdentifiers\",\n get: function get() {\n return this.outletDependencies.getValuesForKey(this.identifier);\n }\n }, {\n key: \"dependentContexts\",\n get: function get() {\n var identifiers = this.dependentControllerIdentifiers;\n return this.router.contexts.filter(function (context) {\n return identifiers.includes(context.identifier);\n });\n }\n }, {\n key: \"hasOutlet\",\n value: function hasOutlet(element, outletName) {\n return !!this.getOutlet(element, outletName) || !!this.getOutletFromMap(element, outletName);\n }\n }, {\n key: \"getOutlet\",\n value: function getOutlet(element, outletName) {\n return this.application.getControllerForElementAndIdentifier(element, outletName);\n }\n }, {\n key: \"getOutletFromMap\",\n value: function getOutletFromMap(element, outletName) {\n return this.outletsByName.getValuesForKey(outletName).find(function (outlet) {\n return outlet.element === element;\n });\n }\n }, {\n key: \"scope\",\n get: function get() {\n return this.context.scope;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.context.schema;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.context.identifier;\n }\n }, {\n key: \"application\",\n get: function get() {\n return this.context.application;\n }\n }, {\n key: \"router\",\n get: function get() {\n return this.application.router;\n }\n }]);\n return OutletObserver;\n}();\nvar Context = /*#__PURE__*/function () {\n function Context(module, scope) {\n var _this15 = this;\n _classCallCheck(this, Context);\n this.logDebugActivity = function (functionName) {\n var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var identifier = _this15.identifier,\n controller = _this15.controller,\n element = _this15.element;\n detail = Object.assign({\n identifier: identifier,\n controller: controller,\n element: element\n }, detail);\n _this15.application.logDebugActivity(_this15.identifier, functionName, detail);\n };\n this.module = module;\n this.scope = scope;\n this.controller = new module.controllerConstructor(this);\n this.bindingObserver = new BindingObserver(this, this.dispatcher);\n this.valueObserver = new ValueObserver(this, this.controller);\n this.targetObserver = new TargetObserver(this, this);\n this.outletObserver = new OutletObserver(this, this);\n try {\n this.controller.initialize();\n this.logDebugActivity(\"initialize\");\n } catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n _createClass(Context, [{\n key: \"connect\",\n value: function connect() {\n this.bindingObserver.start();\n this.valueObserver.start();\n this.targetObserver.start();\n this.outletObserver.start();\n try {\n this.controller.connect();\n this.logDebugActivity(\"connect\");\n } catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n }\n }, {\n key: \"refresh\",\n value: function refresh() {\n this.outletObserver.refresh();\n }\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n try {\n this.controller.disconnect();\n this.logDebugActivity(\"disconnect\");\n } catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n this.outletObserver.stop();\n this.targetObserver.stop();\n this.valueObserver.stop();\n this.bindingObserver.stop();\n }\n }, {\n key: \"application\",\n get: function get() {\n return this.module.application;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.module.identifier;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.application.schema;\n }\n }, {\n key: \"dispatcher\",\n get: function get() {\n return this.application.dispatcher;\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"parentElement\",\n get: function get() {\n return this.element.parentElement;\n }\n }, {\n key: \"handleError\",\n value: function handleError(error, message) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var identifier = this.identifier,\n controller = this.controller,\n element = this.element;\n detail = Object.assign({\n identifier: identifier,\n controller: controller,\n element: element\n }, detail);\n this.application.handleError(error, \"Error \".concat(message), detail);\n }\n }, {\n key: \"targetConnected\",\n value: function targetConnected(element, name) {\n this.invokeControllerMethod(\"\".concat(name, \"TargetConnected\"), element);\n }\n }, {\n key: \"targetDisconnected\",\n value: function targetDisconnected(element, name) {\n this.invokeControllerMethod(\"\".concat(name, \"TargetDisconnected\"), element);\n }\n }, {\n key: \"outletConnected\",\n value: function outletConnected(outlet, element, name) {\n this.invokeControllerMethod(\"\".concat(namespaceCamelize(name), \"OutletConnected\"), outlet, element);\n }\n }, {\n key: \"outletDisconnected\",\n value: function outletDisconnected(outlet, element, name) {\n this.invokeControllerMethod(\"\".concat(namespaceCamelize(name), \"OutletDisconnected\"), outlet, element);\n }\n }, {\n key: \"invokeControllerMethod\",\n value: function invokeControllerMethod(methodName) {\n var controller = this.controller;\n if (typeof controller[methodName] == \"function\") {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key2 = 1; _key2 < _len; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n controller[methodName].apply(controller, args);\n }\n }\n }]);\n return Context;\n}();\nfunction bless(constructor) {\n return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n var shadowConstructor = extend(constructor);\n var shadowProperties = getShadowProperties(constructor.prototype, properties);\n Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n var blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n return blessings.reduce(function (blessedProperties, blessing) {\n var properties = blessing(constructor);\n for (var key in properties) {\n var descriptor = blessedProperties[key] || {};\n blessedProperties[key] = Object.assign(descriptor, properties[key]);\n }\n return blessedProperties;\n }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n return getOwnKeys(properties).reduce(function (shadowProperties, key) {\n var descriptor = getShadowedDescriptor(prototype, properties, key);\n if (descriptor) {\n Object.assign(shadowProperties, _defineProperty({}, key, descriptor));\n }\n return shadowProperties;\n }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n var shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n var shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n if (!shadowedByValue) {\n var descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n if (shadowingDescriptor) {\n descriptor.get = shadowingDescriptor.get || descriptor.get;\n descriptor.set = shadowingDescriptor.set || descriptor.set;\n }\n return descriptor;\n }\n}\nvar getOwnKeys = function () {\n if (typeof Object.getOwnPropertySymbols == \"function\") {\n return function (object) {\n return [].concat(_toConsumableArray(Object.getOwnPropertyNames(object)), _toConsumableArray(Object.getOwnPropertySymbols(object)));\n };\n } else {\n return Object.getOwnPropertyNames;\n }\n}();\nvar extend = function () {\n function extendWithReflect(constructor) {\n function extended() {\n return Reflect.construct(constructor, arguments, this instanceof extended ? this.constructor : void 0);\n }\n extended.prototype = Object.create(constructor.prototype, {\n constructor: {\n value: extended\n }\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n function testReflectExtension() {\n var a = function a() {\n this.a.call(this);\n };\n var b = extendWithReflect(a);\n b.prototype.a = function () {};\n return new b();\n }\n try {\n testReflectExtension();\n return extendWithReflect;\n } catch (error) {\n return function (constructor) {\n return /*#__PURE__*/function (_constructor) {\n _inherits(extended, _constructor);\n var _super2 = _createSuper(extended);\n function extended() {\n _classCallCheck(this, extended);\n return _super2.apply(this, arguments);\n }\n return extended;\n }(constructor);\n };\n }\n}();\nfunction blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: bless(definition.controllerConstructor)\n };\n}\nvar Module = /*#__PURE__*/function () {\n function Module(application, definition) {\n _classCallCheck(this, Module);\n this.application = application;\n this.definition = blessDefinition(definition);\n this.contextsByScope = new WeakMap();\n this.connectedContexts = new Set();\n }\n _createClass(Module, [{\n key: \"identifier\",\n get: function get() {\n return this.definition.identifier;\n }\n }, {\n key: \"controllerConstructor\",\n get: function get() {\n return this.definition.controllerConstructor;\n }\n }, {\n key: \"contexts\",\n get: function get() {\n return Array.from(this.connectedContexts);\n }\n }, {\n key: \"connectContextForScope\",\n value: function connectContextForScope(scope) {\n var context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n }\n }, {\n key: \"disconnectContextForScope\",\n value: function disconnectContextForScope(scope) {\n var context = this.contextsByScope.get(scope);\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n }\n }, {\n key: \"fetchContextForScope\",\n value: function fetchContextForScope(scope) {\n var context = this.contextsByScope.get(scope);\n if (!context) {\n context = new Context(this, scope);\n this.contextsByScope.set(scope, context);\n }\n return context;\n }\n }]);\n return Module;\n}();\nvar ClassMap = /*#__PURE__*/function () {\n function ClassMap(scope) {\n _classCallCheck(this, ClassMap);\n this.scope = scope;\n }\n _createClass(ClassMap, [{\n key: \"has\",\n value: function has(name) {\n return this.data.has(this.getDataKey(name));\n }\n }, {\n key: \"get\",\n value: function get(name) {\n return this.getAll(name)[0];\n }\n }, {\n key: \"getAll\",\n value: function getAll(name) {\n var tokenString = this.data.get(this.getDataKey(name)) || \"\";\n return tokenize(tokenString);\n }\n }, {\n key: \"getAttributeName\",\n value: function getAttributeName(name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n }\n }, {\n key: \"getDataKey\",\n value: function getDataKey(name) {\n return \"\".concat(name, \"-class\");\n }\n }, {\n key: \"data\",\n get: function get() {\n return this.scope.data;\n }\n }]);\n return ClassMap;\n}();\nvar DataMap = /*#__PURE__*/function () {\n function DataMap(scope) {\n _classCallCheck(this, DataMap);\n this.scope = scope;\n }\n _createClass(DataMap, [{\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.scope.identifier;\n }\n }, {\n key: \"get\",\n value: function get(key) {\n var name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n var name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n }\n }, {\n key: \"has\",\n value: function has(key) {\n var name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n if (this.has(key)) {\n var name = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name);\n return true;\n } else {\n return false;\n }\n }\n }, {\n key: \"getAttributeNameForKey\",\n value: function getAttributeNameForKey(key) {\n return \"data-\".concat(this.identifier, \"-\").concat(dasherize(key));\n }\n }]);\n return DataMap;\n}();\nvar Guide = /*#__PURE__*/function () {\n function Guide(logger) {\n _classCallCheck(this, Guide);\n this.warnedKeysByObject = new WeakMap();\n this.logger = logger;\n }\n _createClass(Guide, [{\n key: \"warn\",\n value: function warn(object, key, message) {\n var warnedKeys = this.warnedKeysByObject.get(object);\n if (!warnedKeys) {\n warnedKeys = new Set();\n this.warnedKeysByObject.set(object, warnedKeys);\n }\n if (!warnedKeys.has(key)) {\n warnedKeys.add(key);\n this.logger.warn(message, object);\n }\n }\n }]);\n return Guide;\n}();\nfunction attributeValueContainsToken(attributeName, token) {\n return \"[\".concat(attributeName, \"~=\\\"\").concat(token, \"\\\"]\");\n}\nvar TargetSet = /*#__PURE__*/function () {\n function TargetSet(scope) {\n _classCallCheck(this, TargetSet);\n this.scope = scope;\n }\n _createClass(TargetSet, [{\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.scope.identifier;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.scope.schema;\n }\n }, {\n key: \"has\",\n value: function has(targetName) {\n return this.find(targetName) != null;\n }\n }, {\n key: \"find\",\n value: function find() {\n var _this16 = this;\n for (var _len2 = arguments.length, targetNames = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {\n targetNames[_key3] = arguments[_key3];\n }\n return targetNames.reduce(function (target, targetName) {\n return target || _this16.findTarget(targetName) || _this16.findLegacyTarget(targetName);\n }, undefined);\n }\n }, {\n key: \"findAll\",\n value: function findAll() {\n var _this17 = this;\n for (var _len3 = arguments.length, targetNames = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {\n targetNames[_key4] = arguments[_key4];\n }\n return targetNames.reduce(function (targets, targetName) {\n return [].concat(_toConsumableArray(targets), _toConsumableArray(_this17.findAllTargets(targetName)), _toConsumableArray(_this17.findAllLegacyTargets(targetName)));\n }, []);\n }\n }, {\n key: \"findTarget\",\n value: function findTarget(targetName) {\n var selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n }\n }, {\n key: \"findAllTargets\",\n value: function findAllTargets(targetName) {\n var selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n }\n }, {\n key: \"getSelectorForTargetName\",\n value: function getSelectorForTargetName(targetName) {\n var attributeName = this.schema.targetAttributeForScope(this.identifier);\n return attributeValueContainsToken(attributeName, targetName);\n }\n }, {\n key: \"findLegacyTarget\",\n value: function findLegacyTarget(targetName) {\n var selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n }\n }, {\n key: \"findAllLegacyTargets\",\n value: function findAllLegacyTargets(targetName) {\n var _this18 = this;\n var selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map(function (element) {\n return _this18.deprecate(element, targetName);\n });\n }\n }, {\n key: \"getLegacySelectorForTargetName\",\n value: function getLegacySelectorForTargetName(targetName) {\n var targetDescriptor = \"\".concat(this.identifier, \".\").concat(targetName);\n return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n }\n }, {\n key: \"deprecate\",\n value: function deprecate(element, targetName) {\n if (element) {\n var identifier = this.identifier;\n var attributeName = this.schema.targetAttribute;\n var revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n this.guide.warn(element, \"target:\".concat(targetName), \"Please replace \".concat(attributeName, \"=\\\"\").concat(identifier, \".\").concat(targetName, \"\\\" with \").concat(revisedAttributeName, \"=\\\"\").concat(targetName, \"\\\". \") + \"The \".concat(attributeName, \" attribute is deprecated and will be removed in a future version of Stimulus.\"));\n }\n return element;\n }\n }, {\n key: \"guide\",\n get: function get() {\n return this.scope.guide;\n }\n }]);\n return TargetSet;\n}();\nvar OutletSet = /*#__PURE__*/function () {\n function OutletSet(scope, controllerElement) {\n _classCallCheck(this, OutletSet);\n this.scope = scope;\n this.controllerElement = controllerElement;\n }\n _createClass(OutletSet, [{\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.scope.identifier;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.scope.schema;\n }\n }, {\n key: \"has\",\n value: function has(outletName) {\n return this.find(outletName) != null;\n }\n }, {\n key: \"find\",\n value: function find() {\n var _this19 = this;\n for (var _len4 = arguments.length, outletNames = new Array(_len4), _key5 = 0; _key5 < _len4; _key5++) {\n outletNames[_key5] = arguments[_key5];\n }\n return outletNames.reduce(function (outlet, outletName) {\n return outlet || _this19.findOutlet(outletName);\n }, undefined);\n }\n }, {\n key: \"findAll\",\n value: function findAll() {\n var _this20 = this;\n for (var _len5 = arguments.length, outletNames = new Array(_len5), _key6 = 0; _key6 < _len5; _key6++) {\n outletNames[_key6] = arguments[_key6];\n }\n return outletNames.reduce(function (outlets, outletName) {\n return [].concat(_toConsumableArray(outlets), _toConsumableArray(_this20.findAllOutlets(outletName)));\n }, []);\n }\n }, {\n key: \"getSelectorForOutletName\",\n value: function getSelectorForOutletName(outletName) {\n var attributeName = this.schema.outletAttributeForScope(this.identifier, outletName);\n return this.controllerElement.getAttribute(attributeName);\n }\n }, {\n key: \"findOutlet\",\n value: function findOutlet(outletName) {\n var selector = this.getSelectorForOutletName(outletName);\n if (selector) return this.findElement(selector, outletName);\n }\n }, {\n key: \"findAllOutlets\",\n value: function findAllOutlets(outletName) {\n var selector = this.getSelectorForOutletName(outletName);\n return selector ? this.findAllElements(selector, outletName) : [];\n }\n }, {\n key: \"findElement\",\n value: function findElement(selector, outletName) {\n var _this21 = this;\n var elements = this.scope.queryElements(selector);\n return elements.filter(function (element) {\n return _this21.matchesElement(element, selector, outletName);\n })[0];\n }\n }, {\n key: \"findAllElements\",\n value: function findAllElements(selector, outletName) {\n var _this22 = this;\n var elements = this.scope.queryElements(selector);\n return elements.filter(function (element) {\n return _this22.matchesElement(element, selector, outletName);\n });\n }\n }, {\n key: \"matchesElement\",\n value: function matchesElement(element, selector, outletName) {\n var controllerAttribute = element.getAttribute(this.scope.schema.controllerAttribute) || \"\";\n return element.matches(selector) && controllerAttribute.split(\" \").includes(outletName);\n }\n }]);\n return OutletSet;\n}();\nvar Scope = /*#__PURE__*/function () {\n function Scope(schema, element, identifier, logger) {\n var _this23 = this;\n _classCallCheck(this, Scope);\n this.targets = new TargetSet(this);\n this.classes = new ClassMap(this);\n this.data = new DataMap(this);\n this.containsElement = function (element) {\n return element.closest(_this23.controllerSelector) === _this23.element;\n };\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new Guide(logger);\n this.outlets = new OutletSet(this.documentScope, element);\n }\n _createClass(Scope, [{\n key: \"findElement\",\n value: function findElement(selector) {\n return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);\n }\n }, {\n key: \"findAllElements\",\n value: function findAllElements(selector) {\n return [].concat(_toConsumableArray(this.element.matches(selector) ? [this.element] : []), _toConsumableArray(this.queryElements(selector).filter(this.containsElement)));\n }\n }, {\n key: \"queryElements\",\n value: function queryElements(selector) {\n return Array.from(this.element.querySelectorAll(selector));\n }\n }, {\n key: \"controllerSelector\",\n get: function get() {\n return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n }\n }, {\n key: \"isDocumentScope\",\n get: function get() {\n return this.element === document.documentElement;\n }\n }, {\n key: \"documentScope\",\n get: function get() {\n return this.isDocumentScope ? this : new Scope(this.schema, document.documentElement, this.identifier, this.guide.logger);\n }\n }]);\n return Scope;\n}();\nvar ScopeObserver = /*#__PURE__*/function () {\n function ScopeObserver(element, schema, delegate) {\n _classCallCheck(this, ScopeObserver);\n this.element = element;\n this.schema = schema;\n this.delegate = delegate;\n this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n this.scopesByIdentifierByElement = new WeakMap();\n this.scopeReferenceCounts = new WeakMap();\n }\n _createClass(ScopeObserver, [{\n key: \"start\",\n value: function start() {\n this.valueListObserver.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.valueListObserver.stop();\n }\n }, {\n key: \"controllerAttribute\",\n get: function get() {\n return this.schema.controllerAttribute;\n }\n }, {\n key: \"parseValueForToken\",\n value: function parseValueForToken(token) {\n var element = token.element,\n identifier = token.content;\n return this.parseValueForElementAndIdentifier(element, identifier);\n }\n }, {\n key: \"parseValueForElementAndIdentifier\",\n value: function parseValueForElementAndIdentifier(element, identifier) {\n var scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n var scope = scopesByIdentifier.get(identifier);\n if (!scope) {\n scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n scopesByIdentifier.set(identifier, scope);\n }\n return scope;\n }\n }, {\n key: \"elementMatchedValue\",\n value: function elementMatchedValue(element, value) {\n var referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n this.scopeReferenceCounts.set(value, referenceCount);\n if (referenceCount == 1) {\n this.delegate.scopeConnected(value);\n }\n }\n }, {\n key: \"elementUnmatchedValue\",\n value: function elementUnmatchedValue(element, value) {\n var referenceCount = this.scopeReferenceCounts.get(value);\n if (referenceCount) {\n this.scopeReferenceCounts.set(value, referenceCount - 1);\n if (referenceCount == 1) {\n this.delegate.scopeDisconnected(value);\n }\n }\n }\n }, {\n key: \"fetchScopesByIdentifierForElement\",\n value: function fetchScopesByIdentifierForElement(element) {\n var scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n if (!scopesByIdentifier) {\n scopesByIdentifier = new Map();\n this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n }\n return scopesByIdentifier;\n }\n }]);\n return ScopeObserver;\n}();\nvar Router = /*#__PURE__*/function () {\n function Router(application) {\n _classCallCheck(this, Router);\n this.application = application;\n this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n this.scopesByIdentifier = new Multimap();\n this.modulesByIdentifier = new Map();\n }\n _createClass(Router, [{\n key: \"element\",\n get: function get() {\n return this.application.element;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.application.schema;\n }\n }, {\n key: \"logger\",\n get: function get() {\n return this.application.logger;\n }\n }, {\n key: \"controllerAttribute\",\n get: function get() {\n return this.schema.controllerAttribute;\n }\n }, {\n key: \"modules\",\n get: function get() {\n return Array.from(this.modulesByIdentifier.values());\n }\n }, {\n key: \"contexts\",\n get: function get() {\n return this.modules.reduce(function (contexts, module) {\n return contexts.concat(module.contexts);\n }, []);\n }\n }, {\n key: \"start\",\n value: function start() {\n this.scopeObserver.start();\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.scopeObserver.stop();\n }\n }, {\n key: \"loadDefinition\",\n value: function loadDefinition(definition) {\n this.unloadIdentifier(definition.identifier);\n var module = new Module(this.application, definition);\n this.connectModule(module);\n var afterLoad = definition.controllerConstructor.afterLoad;\n if (afterLoad) {\n afterLoad.call(definition.controllerConstructor, definition.identifier, this.application);\n }\n }\n }, {\n key: \"unloadIdentifier\",\n value: function unloadIdentifier(identifier) {\n var module = this.modulesByIdentifier.get(identifier);\n if (module) {\n this.disconnectModule(module);\n }\n }\n }, {\n key: \"getContextForElementAndIdentifier\",\n value: function getContextForElementAndIdentifier(element, identifier) {\n var module = this.modulesByIdentifier.get(identifier);\n if (module) {\n return module.contexts.find(function (context) {\n return context.element == element;\n });\n }\n }\n }, {\n key: \"proposeToConnectScopeForElementAndIdentifier\",\n value: function proposeToConnectScopeForElementAndIdentifier(element, identifier) {\n var scope = this.scopeObserver.parseValueForElementAndIdentifier(element, identifier);\n if (scope) {\n this.scopeObserver.elementMatchedValue(scope.element, scope);\n } else {\n console.error(\"Couldn't find or create scope for identifier: \\\"\".concat(identifier, \"\\\" and element:\"), element);\n }\n }\n }, {\n key: \"handleError\",\n value: function handleError(error, message, detail) {\n this.application.handleError(error, message, detail);\n }\n }, {\n key: \"createScopeForElementAndIdentifier\",\n value: function createScopeForElementAndIdentifier(element, identifier) {\n return new Scope(this.schema, element, identifier, this.logger);\n }\n }, {\n key: \"scopeConnected\",\n value: function scopeConnected(scope) {\n this.scopesByIdentifier.add(scope.identifier, scope);\n var module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.connectContextForScope(scope);\n }\n }\n }, {\n key: \"scopeDisconnected\",\n value: function scopeDisconnected(scope) {\n this.scopesByIdentifier.delete(scope.identifier, scope);\n var module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.disconnectContextForScope(scope);\n }\n }\n }, {\n key: \"connectModule\",\n value: function connectModule(module) {\n this.modulesByIdentifier.set(module.identifier, module);\n var scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(function (scope) {\n return module.connectContextForScope(scope);\n });\n }\n }, {\n key: \"disconnectModule\",\n value: function disconnectModule(module) {\n this.modulesByIdentifier.delete(module.identifier);\n var scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(function (scope) {\n return module.disconnectContextForScope(scope);\n });\n }\n }]);\n return Router;\n}();\nvar defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\",\n targetAttributeForScope: function targetAttributeForScope(identifier) {\n return \"data-\".concat(identifier, \"-target\");\n },\n outletAttributeForScope: function outletAttributeForScope(identifier, outlet) {\n return \"data-\".concat(identifier, \"-\").concat(outlet, \"-outlet\");\n },\n keyMappings: Object.assign(Object.assign({\n enter: \"Enter\",\n tab: \"Tab\",\n esc: \"Escape\",\n space: \" \",\n up: \"ArrowUp\",\n down: \"ArrowDown\",\n left: \"ArrowLeft\",\n right: \"ArrowRight\",\n home: \"Home\",\n end: \"End\",\n page_up: \"PageUp\",\n page_down: \"PageDown\"\n }, objectFromEntries(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map(function (c) {\n return [c, c];\n }))), objectFromEntries(\"0123456789\".split(\"\").map(function (n) {\n return [n, n];\n })))\n};\nfunction objectFromEntries(array) {\n return array.reduce(function (memo, _ref22) {\n var _ref23 = _slicedToArray(_ref22, 2),\n k = _ref23[0],\n v = _ref23[1];\n return Object.assign(Object.assign({}, memo), _defineProperty({}, k, v));\n }, {});\n}\nvar Application = /*#__PURE__*/function () {\n function Application() {\n var _this24 = this;\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;\n var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultSchema;\n _classCallCheck(this, Application);\n this.logger = console;\n this.debug = false;\n this.logDebugActivity = function (identifier, functionName) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (_this24.debug) {\n _this24.logFormattedMessage(identifier, functionName, detail);\n }\n };\n this.element = element;\n this.schema = schema;\n this.dispatcher = new Dispatcher(this);\n this.router = new Router(this);\n this.actionDescriptorFilters = Object.assign({}, defaultActionDescriptorFilters);\n }\n _createClass(Application, [{\n key: \"start\",\n value: function () {\n var _start = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return domReady();\n case 2:\n this.logDebugActivity(\"application\", \"starting\");\n this.dispatcher.start();\n this.router.start();\n this.logDebugActivity(\"application\", \"start\");\n case 6:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function start() {\n return _start.apply(this, arguments);\n }\n return start;\n }()\n }, {\n key: \"stop\",\n value: function stop() {\n this.logDebugActivity(\"application\", \"stopping\");\n this.dispatcher.stop();\n this.router.stop();\n this.logDebugActivity(\"application\", \"stop\");\n }\n }, {\n key: \"register\",\n value: function register(identifier, controllerConstructor) {\n this.load({\n identifier: identifier,\n controllerConstructor: controllerConstructor\n });\n }\n }, {\n key: \"registerActionOption\",\n value: function registerActionOption(name, filter) {\n this.actionDescriptorFilters[name] = filter;\n }\n }, {\n key: \"load\",\n value: function load(head) {\n var _this25 = this;\n for (var _len6 = arguments.length, rest = new Array(_len6 > 1 ? _len6 - 1 : 0), _key7 = 1; _key7 < _len6; _key7++) {\n rest[_key7 - 1] = arguments[_key7];\n }\n var definitions = Array.isArray(head) ? head : [head].concat(rest);\n definitions.forEach(function (definition) {\n if (definition.controllerConstructor.shouldLoad) {\n _this25.router.loadDefinition(definition);\n }\n });\n }\n }, {\n key: \"unload\",\n value: function unload(head) {\n var _this26 = this;\n for (var _len7 = arguments.length, rest = new Array(_len7 > 1 ? _len7 - 1 : 0), _key8 = 1; _key8 < _len7; _key8++) {\n rest[_key8 - 1] = arguments[_key8];\n }\n var identifiers = Array.isArray(head) ? head : [head].concat(rest);\n identifiers.forEach(function (identifier) {\n return _this26.router.unloadIdentifier(identifier);\n });\n }\n }, {\n key: \"controllers\",\n get: function get() {\n return this.router.contexts.map(function (context) {\n return context.controller;\n });\n }\n }, {\n key: \"getControllerForElementAndIdentifier\",\n value: function getControllerForElementAndIdentifier(element, identifier) {\n var context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n }\n }, {\n key: \"handleError\",\n value: function handleError(error, message, detail) {\n var _a;\n this.logger.error(\"%s\\n\\n%o\\n\\n%o\", message, error, detail);\n (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n }\n }, {\n key: \"logFormattedMessage\",\n value: function logFormattedMessage(identifier, functionName) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n detail = Object.assign({\n application: this\n }, detail);\n this.logger.groupCollapsed(\"\".concat(identifier, \" #\").concat(functionName));\n this.logger.log(\"details:\", Object.assign({}, detail));\n this.logger.groupEnd();\n }\n }], [{\n key: \"start\",\n value: function start(element, schema) {\n var application = new this(element, schema);\n application.start();\n return application;\n }\n }]);\n return Application;\n}();\nfunction domReady() {\n return new Promise(function (resolve) {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", function () {\n return resolve();\n });\n } else {\n resolve();\n }\n });\n}\nfunction ClassPropertiesBlessing(constructor) {\n var classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce(function (properties, classDefinition) {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\nfunction propertiesForClassDefinition(key) {\n var _ref24;\n return _ref24 = {}, _defineProperty(_ref24, \"\".concat(key, \"Class\"), {\n get: function get() {\n var classes = this.classes;\n if (classes.has(key)) {\n return classes.get(key);\n } else {\n var attribute = classes.getAttributeName(key);\n throw new Error(\"Missing attribute \\\"\".concat(attribute, \"\\\"\"));\n }\n }\n }), _defineProperty(_ref24, \"\".concat(key, \"Classes\"), {\n get: function get() {\n return this.classes.getAll(key);\n }\n }), _defineProperty(_ref24, \"has\".concat(capitalize(key), \"Class\"), {\n get: function get() {\n return this.classes.has(key);\n }\n }), _ref24;\n}\nfunction OutletPropertiesBlessing(constructor) {\n var outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n return outlets.reduce(function (properties, outletDefinition) {\n return Object.assign(properties, propertiesForOutletDefinition(outletDefinition));\n }, {});\n}\nfunction getOutletController(controller, element, identifier) {\n return controller.application.getControllerForElementAndIdentifier(element, identifier);\n}\nfunction getControllerAndEnsureConnectedScope(controller, element, outletName) {\n var outletController = getOutletController(controller, element, outletName);\n if (outletController) return outletController;\n controller.application.router.proposeToConnectScopeForElementAndIdentifier(element, outletName);\n outletController = getOutletController(controller, element, outletName);\n if (outletController) return outletController;\n}\nfunction propertiesForOutletDefinition(name) {\n var _ref25;\n var camelizedName = namespaceCamelize(name);\n return _ref25 = {}, _defineProperty(_ref25, \"\".concat(camelizedName, \"Outlet\"), {\n get: function get() {\n var outletElement = this.outlets.find(name);\n var selector = this.outlets.getSelectorForOutletName(name);\n if (outletElement) {\n var outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n if (outletController) return outletController;\n throw new Error(\"The provided outlet element is missing an outlet controller \\\"\".concat(name, \"\\\" instance for host controller \\\"\").concat(this.identifier, \"\\\"\"));\n }\n throw new Error(\"Missing outlet element \\\"\".concat(name, \"\\\" for host controller \\\"\").concat(this.identifier, \"\\\". Stimulus couldn't find a matching outlet element using selector \\\"\").concat(selector, \"\\\".\"));\n }\n }), _defineProperty(_ref25, \"\".concat(camelizedName, \"Outlets\"), {\n get: function get() {\n var _this27 = this;\n var outlets = this.outlets.findAll(name);\n if (outlets.length > 0) {\n return outlets.map(function (outletElement) {\n var outletController = getControllerAndEnsureConnectedScope(_this27, outletElement, name);\n if (outletController) return outletController;\n console.warn(\"The provided outlet element is missing an outlet controller \\\"\".concat(name, \"\\\" instance for host controller \\\"\").concat(_this27.identifier, \"\\\"\"), outletElement);\n }).filter(function (controller) {\n return controller;\n });\n }\n return [];\n }\n }), _defineProperty(_ref25, \"\".concat(camelizedName, \"OutletElement\"), {\n get: function get() {\n var outletElement = this.outlets.find(name);\n var selector = this.outlets.getSelectorForOutletName(name);\n if (outletElement) {\n return outletElement;\n } else {\n throw new Error(\"Missing outlet element \\\"\".concat(name, \"\\\" for host controller \\\"\").concat(this.identifier, \"\\\". Stimulus couldn't find a matching outlet element using selector \\\"\").concat(selector, \"\\\".\"));\n }\n }\n }), _defineProperty(_ref25, \"\".concat(camelizedName, \"OutletElements\"), {\n get: function get() {\n return this.outlets.findAll(name);\n }\n }), _defineProperty(_ref25, \"has\".concat(capitalize(camelizedName), \"Outlet\"), {\n get: function get() {\n return this.outlets.has(name);\n }\n }), _ref25;\n}\nfunction TargetPropertiesBlessing(constructor) {\n var targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce(function (properties, targetDefinition) {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n var _ref26;\n return _ref26 = {}, _defineProperty(_ref26, \"\".concat(name, \"Target\"), {\n get: function get() {\n var target = this.targets.find(name);\n if (target) {\n return target;\n } else {\n throw new Error(\"Missing target element \\\"\".concat(name, \"\\\" for \\\"\").concat(this.identifier, \"\\\" controller\"));\n }\n }\n }), _defineProperty(_ref26, \"\".concat(name, \"Targets\"), {\n get: function get() {\n return this.targets.findAll(name);\n }\n }), _defineProperty(_ref26, \"has\".concat(capitalize(name), \"Target\"), {\n get: function get() {\n return this.targets.has(name);\n }\n }), _ref26;\n}\nfunction ValuePropertiesBlessing(constructor) {\n var valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n var propertyDescriptorMap = {\n valueDescriptorMap: {\n get: function get() {\n var _this28 = this;\n return valueDefinitionPairs.reduce(function (result, valueDefinitionPair) {\n var valueDescriptor = parseValueDefinitionPair(valueDefinitionPair, _this28.identifier);\n var attributeName = _this28.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, _defineProperty({}, attributeName, valueDescriptor));\n }, {});\n }\n }\n };\n return valueDefinitionPairs.reduce(function (properties, valueDefinitionPair) {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair, controller) {\n var _ref27;\n var definition = parseValueDefinitionPair(valueDefinitionPair, controller);\n var key = definition.key,\n name = definition.name,\n read = definition.reader,\n write = definition.writer;\n return _ref27 = {}, _defineProperty(_ref27, name, {\n get: function get() {\n var value = this.data.get(key);\n if (value !== null) {\n return read(value);\n } else {\n return definition.defaultValue;\n }\n },\n set: function set(value) {\n if (value === undefined) {\n this.data.delete(key);\n } else {\n this.data.set(key, write(value));\n }\n }\n }), _defineProperty(_ref27, \"has\".concat(capitalize(name)), {\n get: function get() {\n return this.data.has(key) || definition.hasCustomDefaultValue;\n }\n }), _ref27;\n}\nfunction parseValueDefinitionPair(_ref28, controller) {\n var _ref29 = _slicedToArray(_ref28, 2),\n token = _ref29[0],\n typeDefinition = _ref29[1];\n return valueDescriptorForTokenAndTypeDefinition({\n controller: controller,\n token: token,\n typeDefinition: typeDefinition\n });\n}\nfunction parseValueTypeConstant(constant) {\n switch (constant) {\n case Array:\n return \"array\";\n case Boolean:\n return \"boolean\";\n case Number:\n return \"number\";\n case Object:\n return \"object\";\n case String:\n return \"string\";\n }\n}\nfunction parseValueTypeDefault(defaultValue) {\n switch (_typeof(defaultValue)) {\n case \"boolean\":\n return \"boolean\";\n case \"number\":\n return \"number\";\n case \"string\":\n return \"string\";\n }\n if (Array.isArray(defaultValue)) return \"array\";\n if (Object.prototype.toString.call(defaultValue) === \"[object Object]\") return \"object\";\n}\nfunction parseValueTypeObject(payload) {\n var controller = payload.controller,\n token = payload.token,\n typeObject = payload.typeObject;\n var hasType = isSomething(typeObject.type);\n var hasDefault = isSomething(typeObject.default);\n var fullObject = hasType && hasDefault;\n var onlyType = hasType && !hasDefault;\n var onlyDefault = !hasType && hasDefault;\n var typeFromObject = parseValueTypeConstant(typeObject.type);\n var typeFromDefaultValue = parseValueTypeDefault(payload.typeObject.default);\n if (onlyType) return typeFromObject;\n if (onlyDefault) return typeFromDefaultValue;\n if (typeFromObject !== typeFromDefaultValue) {\n var propertyPath = controller ? \"\".concat(controller, \".\").concat(token) : token;\n throw new Error(\"The specified default value for the Stimulus Value \\\"\".concat(propertyPath, \"\\\" must match the defined type \\\"\").concat(typeFromObject, \"\\\". The provided default value of \\\"\").concat(typeObject.default, \"\\\" is of type \\\"\").concat(typeFromDefaultValue, \"\\\".\"));\n }\n if (fullObject) return typeFromObject;\n}\nfunction parseValueTypeDefinition(payload) {\n var controller = payload.controller,\n token = payload.token,\n typeDefinition = payload.typeDefinition;\n var typeObject = {\n controller: controller,\n token: token,\n typeObject: typeDefinition\n };\n var typeFromObject = parseValueTypeObject(typeObject);\n var typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n var typeFromConstant = parseValueTypeConstant(typeDefinition);\n var type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n if (type) return type;\n var propertyPath = controller ? \"\".concat(controller, \".\").concat(typeDefinition) : token;\n throw new Error(\"Unknown value type \\\"\".concat(propertyPath, \"\\\" for \\\"\").concat(token, \"\\\" value\"));\n}\nfunction defaultValueForDefinition(typeDefinition) {\n var constant = parseValueTypeConstant(typeDefinition);\n if (constant) return defaultValuesByType[constant];\n var hasDefault = hasProperty(typeDefinition, \"default\");\n var hasType = hasProperty(typeDefinition, \"type\");\n var typeObject = typeDefinition;\n if (hasDefault) return typeObject.default;\n if (hasType) {\n var type = typeObject.type;\n var constantFromType = parseValueTypeConstant(type);\n if (constantFromType) return defaultValuesByType[constantFromType];\n }\n return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(payload) {\n var token = payload.token,\n typeDefinition = payload.typeDefinition;\n var key = \"\".concat(dasherize(token), \"-value\");\n var type = parseValueTypeDefinition(payload);\n return {\n type: type,\n key: key,\n name: camelize(key),\n get defaultValue() {\n return defaultValueForDefinition(typeDefinition);\n },\n get hasCustomDefaultValue() {\n return parseValueTypeDefault(typeDefinition) !== undefined;\n },\n reader: readers[type],\n writer: writers[type] || writers.default\n };\n}\nvar defaultValuesByType = {\n get array() {\n return [];\n },\n boolean: false,\n number: 0,\n get object() {\n return {};\n },\n string: \"\"\n};\nvar readers = {\n array: function array(value) {\n var array = JSON.parse(value);\n if (!Array.isArray(array)) {\n throw new TypeError(\"expected value of type \\\"array\\\" but instead got value \\\"\".concat(value, \"\\\" of type \\\"\").concat(parseValueTypeDefault(array), \"\\\"\"));\n }\n return array;\n },\n boolean: function boolean(value) {\n return !(value == \"0\" || String(value).toLowerCase() == \"false\");\n },\n number: function number(value) {\n return Number(value.replace(/_/g, \"\"));\n },\n object: function object(value) {\n var object = JSON.parse(value);\n if (object === null || _typeof(object) != \"object\" || Array.isArray(object)) {\n throw new TypeError(\"expected value of type \\\"object\\\" but instead got value \\\"\".concat(value, \"\\\" of type \\\"\").concat(parseValueTypeDefault(object), \"\\\"\"));\n }\n return object;\n },\n string: function string(value) {\n return value;\n }\n};\nvar writers = {\n default: writeString,\n array: writeJSON,\n object: writeJSON\n};\nfunction writeJSON(value) {\n return JSON.stringify(value);\n}\nfunction writeString(value) {\n return \"\".concat(value);\n}\nvar Controller = /*#__PURE__*/function () {\n function Controller(context) {\n _classCallCheck(this, Controller);\n this.context = context;\n }\n _createClass(Controller, [{\n key: \"application\",\n get: function get() {\n return this.context.application;\n }\n }, {\n key: \"scope\",\n get: function get() {\n return this.context.scope;\n }\n }, {\n key: \"element\",\n get: function get() {\n return this.scope.element;\n }\n }, {\n key: \"identifier\",\n get: function get() {\n return this.scope.identifier;\n }\n }, {\n key: \"targets\",\n get: function get() {\n return this.scope.targets;\n }\n }, {\n key: \"outlets\",\n get: function get() {\n return this.scope.outlets;\n }\n }, {\n key: \"classes\",\n get: function get() {\n return this.scope.classes;\n }\n }, {\n key: \"data\",\n get: function get() {\n return this.scope.data;\n }\n }, {\n key: \"initialize\",\n value: function initialize() {}\n }, {\n key: \"connect\",\n value: function connect() {}\n }, {\n key: \"disconnect\",\n value: function disconnect() {}\n }, {\n key: \"dispatch\",\n value: function dispatch(eventName) {\n var _ref30 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref30$target = _ref30.target,\n target = _ref30$target === void 0 ? this.element : _ref30$target,\n _ref30$detail = _ref30.detail,\n detail = _ref30$detail === void 0 ? {} : _ref30$detail,\n _ref30$prefix = _ref30.prefix,\n prefix = _ref30$prefix === void 0 ? this.identifier : _ref30$prefix,\n _ref30$bubbles = _ref30.bubbles,\n bubbles = _ref30$bubbles === void 0 ? true : _ref30$bubbles,\n _ref30$cancelable = _ref30.cancelable,\n cancelable = _ref30$cancelable === void 0 ? true : _ref30$cancelable;\n var type = prefix ? \"\".concat(prefix, \":\").concat(eventName) : eventName;\n var event = new CustomEvent(type, {\n detail: detail,\n bubbles: bubbles,\n cancelable: cancelable\n });\n target.dispatchEvent(event);\n return event;\n }\n }], [{\n key: \"shouldLoad\",\n get: function get() {\n return true;\n }\n }, {\n key: \"afterLoad\",\n value: function afterLoad(_identifier, _application) {\n return;\n }\n }]);\n return Controller;\n}();\nController.blessings = [ClassPropertiesBlessing, TargetPropertiesBlessing, ValuePropertiesBlessing, OutletPropertiesBlessing];\nController.targets = [];\nController.outlets = [];\nController.values = {};\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, SelectorObserver, StringMapObserver, TokenListObserver, ValueListObserver, _add as add, defaultSchema, del, fetch, prune };","export const htmlToElement = (html) => {\n const template = document.createElement('template')\n html = html.trim() // Never return a text node of whitespace as the result\n template.innerHTML = html\n return template.content.firstChild\n}\n\nexport const setCookie = (name, value, expires, path, domain, secure) => {\n document.cookie =\n name +\n '=' +\n escape(value) +\n (expires ? '; expires=' + expires.toGMTString() : '') +\n (path ? '; path=' + path : '') +\n (domain ? '; domain=' + domain : '') +\n (secure ? '; secure' : '')\n}\n\nexport function truncate(str, max) {\n return str.length > max ? str.slice(0, max - 1) + '…' : str\n}\n\nexport function findElementWithParent(e, className) {\n const parentToggleTrigger = e.target.closest(`.${className}`)\n const toggle = parentToggleTrigger || e.target\n return toggle.classList.contains(className) ? toggle : null\n}\n\nexport function numberToHuman(value, uom) {\n if (!value) return\n\n if (value < 1000) return `${value} ${uom}`\n\n const result = value / 1000\n\n return `${result.toFixed(2)} k${uom}`\n}\n","import { toast, setDoc } from 'bulma-toast'\n\nconst TYPES = {\n error: {\n class: 'is-danger',\n in: 'shake',\n },\n alert: {\n class: 'is-danger',\n in: 'shake',\n },\n success: {\n class: 'is-success',\n },\n notice: {\n class: 'is-info',\n },\n}\n\nexport const showNotification = ({\n type,\n message,\n duration,\n position,\n dismissible,\n notificationClass,\n absolute = false,\n}) => {\n const opts = TYPES[type]\n\n toast({\n message: message,\n type: opts?.class,\n dismissible,\n duration: duration || 2000,\n pauseOnHover: true,\n position: position || 'top-right',\n animate: { in: opts?.in || 'fadeIn', out: 'fadeOut' },\n })\n\n if (notificationClass) document.querySelector(`.notification`).classList.add(notificationClass)\n\n if (absolute) document.querySelector('.notification').parentNode.style.position = 'absolute'\n}\n\nexport const showNotifications = (notifications) => {\n if (!notifications.length) return\n\n notifications.forEach(([type, message]) => showNotification({ type, message, dismissible: true }))\n}\n\ndocument.addEventListener('DOMContentLoaded', () => {\n if (window.App.flash) {\n showNotifications(window.App.flash)\n }\n\n Array.from(document.querySelectorAll('.notification .delete')).forEach(($delete) => {\n var $notification = $delete.parentNode\n\n $delete.addEventListener('click', () => {\n $notification.parentNode.removeChild($notification)\n })\n })\n})\n","var DATE_PATTERN = /^(\\d\\d\\d\\d)(?:-)?(\\d\\d)(?:-)?(\\d\\d)$/i\n\nfunction toStr(obj) {\n return '' + obj\n}\n\nexport function toDate(obj) {\n if (obj instanceof Date) {\n return obj\n } else if (typeof obj === 'number') {\n return new Date(obj * 1000) // ms\n } else {\n var s = toStr(obj)\n var matches = s.match(DATE_PATTERN)\n if (matches) {\n var year = parseInt(matches[1], 10)\n var month = parseInt(matches[2], 10) - 1\n var day = parseInt(matches[3], 10)\n return new Date(year, month, day)\n } else {\n // try our best to get the str into iso8601\n // TODO be smarter about this\n var str = s.replace(/ /, 'T').replace(' ', '').replace('UTC', 'Z')\n // Date.parse returns milliseconds if valid and NaN if invalid\n return new Date(Date.parse(str) || s)\n }\n }\n}\nexport function toFloat(obj) {\n return parseFloat(obj)\n}\n\nexport function processAlignMinOption(chart) {\n if (chart.yAxis.length < 2 || !chart.series.length) {\n return\n }\n\n for (let i = 0; i < 2; i++) {\n if (chart.yAxis[i]['options']['alignMin']) {\n const n = i ? 0 : 1\n const min = (chart.yAxis[n].min / chart.yAxis[n].max) * chart.yAxis[i].max\n if (typeof min === 'number') {\n chart.yAxis[i].update({ min })\n }\n break\n }\n }\n}\n\nexport function updateRangeParamsInURL(source, content) {\n const url = new URL(source)\n for (const param of ['start_date', 'end_date', 'period_num', 'period_type']) {\n url.searchParams.delete(param)\n }\n if (content.start && content.end) {\n url.searchParams.set('start_date', content.start)\n url.searchParams.set('end_date', content.end)\n } else if (content.periodNum && content.periodType) {\n url.searchParams.set('period_num', content.periodNum)\n url.searchParams.set('period_type', content.periodType)\n }\n return url.toString()\n}\n","import { showNotification } from './flash-notifications'\nimport { closeAllDropdowns } from './dropdowns'\nimport { closeModals } from './modals'\n\ndocument.addEventListener('ajax:beforeSend', ({ target }) => {\n if (target.id === 'system-lock-action-link' || target.id === 'fetch-config-link') closeAllDropdowns()\n\n if (target.id !== 'system-lock-action-link') return\n\n target.setAttribute('disabled', true)\n target.innerHTML = 'In progress...'\n})\n\ndocument.addEventListener('ajax:complete', ({ target, detail }) => {\n if (target.id !== 'fetch-config-link') return\n\n const [data, status, xhr] = detail\n\n if (data.error) {\n showNotification({ type: 'error', message: error, duration: 5000, position: 'bottom-right' })\n } else {\n showNotification({\n type: 'success',\n message: 'Request to fetch device config was sent',\n duration: 5000,\n })\n }\n})\n\n// keep lock link as-is because `ajax:complete` is not fired in document if target were removed\ndocument.addEventListener('DOMContentLoaded', () => {\n const lockActionLink = document.getElementById('system-lock-action-link')\n\n if (lockActionLink) {\n lockActionLink.addEventListener('ajax:complete', (e) => {\n const [data, status, xhr] = e.detail\n\n if (data.error) {\n lockActionLink.setAttribute('disabled', false)\n lockActionLink.innerHTML = lockActionLink.dataset.action === 'system-unlock' ? 'Unlock' : 'Lock'\n\n showNotification({ type: 'error', message: data.error, duration: 5000, position: 'bottom-right' })\n } else {\n showNotification({\n type: 'success',\n message:\n lockActionLink.dataset.action === 'system-unlock'\n ? 'Request to unlock device was sent'\n : 'Request to lock device was sent',\n duration: 5000,\n })\n }\n })\n }\n})\n\ndocument.addEventListener('modal:show', ({ target }) => {\n const mapUrl = target.dataset.mapUrl\n\n if (!mapUrl) return\n\n const iframe = target.querySelector('iframe')\n\n if (!iframe || iframe.src) return\n\n iframe.src = mapUrl\n})\n\ndocument.addEventListener('ajax:error', ({ target, detail }) => {\n switch (target.id) {\n case 'remove-system-form':\n case 'set-intertie-form':\n case 'send-passcode-email-form':\n const [data, status, xhr] = detail\n\n showNotification({ type: 'error', message: data.error, duration: 5000 })\n break\n }\n})\n\ndocument.addEventListener('ajax:success', ({ target }) => {\n let message\n\n switch (target.id) {\n case 'send-passcode-email-form':\n message = 'Email with passcode was sent'\n break\n case 'set-intertie-form':\n message = 'Request to set intertie schedule was sent'\n break\n case 'reboot-system-form':\n message = 'Request to reboot system was sent'\n break\n }\n\n if (message) {\n showNotification({\n type: 'success',\n message,\n duration: 5000,\n })\n\n closeModals()\n }\n})\n\nexport const fetchSystemStatus = (model = 'systems', serialNumber) => {\n return fetch(`/${model}/${serialNumber}/fetch_status`, {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n credentials: 'same-origin',\n })\n}\n\ndocument.addEventListener('change', ({ target: { id, value } }) => {\n if (id !== 'systems-filter-status-selector') return\n\n document.getElementById('soc-slider').classList.toggle('is-hidden', value === 'unreachable')\n\n Array.from(document.getElementById('soc-slider').querySelectorAll('input')).forEach((e) =>\n e.setAttribute('disabled', value === 'unreachable')\n )\n})\n","/**\n * Days in 1 week.\n *\n * @name daysInWeek\n * @constant\n * @type {number}\n * @default\n */\nexport var daysInWeek = 7;\n\n/**\n * Days in 1 year\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n *\n * @name daysInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var daysInYear = 365.2425;\n\n/**\n * Maximum allowed time.\n *\n * @name maxTime\n * @constant\n * @type {number}\n * @default\n */\nexport var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * Milliseconds in 1 minute\n *\n * @name millisecondsInMinute\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInMinute = 60000;\n\n/**\n * Milliseconds in 1 hour\n *\n * @name millisecondsInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInHour = 3600000;\n\n/**\n * Milliseconds in 1 second\n *\n * @name millisecondsInSecond\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInSecond = 1000;\n\n/**\n * Minimum allowed time.\n *\n * @name minTime\n * @constant\n * @type {number}\n * @default\n */\nexport var minTime = -maxTime;\n\n/**\n * Minutes in 1 hour\n *\n * @name minutesInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var minutesInHour = 60;\n\n/**\n * Months in 1 quarter\n *\n * @name monthsInQuarter\n * @constant\n * @type {number}\n * @default\n */\nexport var monthsInQuarter = 3;\n\n/**\n * Months in 1 year\n *\n * @name monthsInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var monthsInYear = 12;\n\n/**\n * Quarters in 1 year\n *\n * @name quartersInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var quartersInYear = 4;\n\n/**\n * Seconds in 1 hour\n *\n * @name secondsInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInHour = 3600;\n\n/**\n * Seconds in 1 minute\n *\n * @name secondsInMinute\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInMinute = 60;\n\n/**\n * Seconds in 1 day\n *\n * @name secondsInDay\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInDay = secondsInHour * 24;\n\n/**\n * Seconds in 1 week\n *\n * @name secondsInWeek\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInWeek = secondsInDay * 7;\n\n/**\n * Seconds in 1 year\n *\n * @name secondsInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInYear = secondsInDay * daysInYear;\n\n/**\n * Seconds in 1 month\n *\n * @name secondsInMonth\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInMonth = secondsInYear / 12;\n\n/**\n * Seconds in 1 quarter\n *\n * @name secondsInQuarter\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInQuarter = secondsInMonth * 3;","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n var number = Number(dirtyNumber);\n if (isNaN(number)) {\n return number;\n }\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","import { millisecondsInHour, millisecondsInMinute } from \"../constants/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name parseISO\n * @category Common Helpers\n * @summary Parse ISO string\n *\n * @description\n * Parse the given string in ISO 8601 format and return an instance of Date.\n *\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If the argument isn't a string, the function cannot parse the string or\n * the values are invalid, it returns Invalid Date.\n *\n * @param {String} argument - the value to convert\n * @param {Object} [options] - an object with options.\n * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * const result = parseISO('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * const result = parseISO('+02014101', { additionalDigits: 1 })\n * //=> Fri Apr 11 2014 00:00:00\n */\nexport default function parseISO(argument, options) {\n var _options$additionalDi;\n requiredArgs(1, arguments);\n var additionalDigits = toInteger((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);\n if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {\n throw new RangeError('additionalDigits must be 0, 1 or 2');\n }\n if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {\n return new Date(NaN);\n }\n var dateStrings = splitDateString(argument);\n var date;\n if (dateStrings.date) {\n var parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n if (!date || isNaN(date.getTime())) {\n return new Date(NaN);\n }\n var timestamp = date.getTime();\n var time = 0;\n var offset;\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n if (isNaN(time)) {\n return new Date(NaN);\n }\n }\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n if (isNaN(offset)) {\n return new Date(NaN);\n }\n } else {\n var dirtyDate = new Date(timestamp + time);\n // js parsed string assuming it's in UTC timezone\n // but we need it to be parsed in our timezone\n // so we use utc values to build date in our timezone.\n // Year values from 0 to 99 map to the years 1900 to 1999\n // so set year explicitly with setFullYear.\n var result = new Date(0);\n result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());\n result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());\n return result;\n }\n return new Date(timestamp + time + offset);\n}\nvar patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/\n};\nvar dateRegex = /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nvar timeRegex = /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nvar timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\nfunction splitDateString(dateString) {\n var dateStrings = {};\n var array = dateString.split(patterns.dateTimeDelimiter);\n var timeString;\n\n // The regex match should only return at maximum two array elements.\n // [date], [time], or [date, time].\n if (array.length > 2) {\n return dateStrings;\n }\n if (/:/.test(array[0])) {\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(dateStrings.date.length, dateString.length);\n }\n }\n if (timeString) {\n var token = patterns.timezone.exec(timeString);\n if (token) {\n dateStrings.time = timeString.replace(token[1], '');\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n return dateStrings;\n}\nfunction parseYear(dateString, additionalDigits) {\n var regex = new RegExp('^(?:(\\\\d{4}|[+-]\\\\d{' + (4 + additionalDigits) + '})|(\\\\d{2}|[+-]\\\\d{' + (2 + additionalDigits) + '})$)');\n var captures = dateString.match(regex);\n // Invalid ISO-formatted year\n if (!captures) return {\n year: NaN,\n restDateString: ''\n };\n var year = captures[1] ? parseInt(captures[1]) : null;\n var century = captures[2] ? parseInt(captures[2]) : null;\n\n // either year or century is null, not both\n return {\n year: century === null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length)\n };\n}\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) return new Date(NaN);\n var captures = dateString.match(dateRegex);\n // Invalid ISO-formatted string\n if (!captures) return new Date(NaN);\n var isWeekDate = !!captures[4];\n var dayOfYear = parseDateUnit(captures[1]);\n var month = parseDateUnit(captures[2]) - 1;\n var day = parseDateUnit(captures[3]);\n var week = parseDateUnit(captures[4]);\n var dayOfWeek = parseDateUnit(captures[5]) - 1;\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n var date = new Date(0);\n if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\nfunction parseTime(timeString) {\n var captures = timeString.match(timeRegex);\n if (!captures) return NaN; // Invalid ISO-formatted time\n\n var hours = parseTimeUnit(captures[1]);\n var minutes = parseTimeUnit(captures[2]);\n var seconds = parseTimeUnit(captures[3]);\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;\n}\nfunction parseTimeUnit(value) {\n return value && parseFloat(value.replace(',', '.')) || 0;\n}\nfunction parseTimezone(timezoneString) {\n if (timezoneString === 'Z') return 0;\n var captures = timezoneString.match(timezoneRegex);\n if (!captures) return 0;\n var sign = captures[1] === '+' ? -1 : 1;\n var hours = parseInt(captures[2]);\n var minutes = captures[3] && parseInt(captures[3]) || 0;\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);\n}\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n var date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n var fourthOfJanuaryDay = date.getUTCDay() || 7;\n var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}\n\n// Validation functions\n\n// February is null to handle the leap year (using ||)\nvar daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\nfunction validateDate(year, month, date) {\n return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));\n}\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\n}\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;\n}\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}","var defaultOptions = {};\nexport function getDefaultOptions() {\n return defaultOptions;\n}\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport default function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth();\n return yearDiff * 12 + monthDiff;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport default function endOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport endOfDay from \"../endOfDay/index.js\";\nimport endOfMonth from \"../endOfMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport default function isLastDayOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n return endOfDay(date).getTime() === endOfMonth(date).getTime();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarMonths from \"../differenceInCalendarMonths/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport isLastDayOfMonth from \"../isLastDayOfMonth/index.js\";\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport default function differenceInMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));\n var result;\n\n // Check for the difference of less than month\n if (difference < 1) {\n result = 0;\n } else {\n if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n dateLeft.setDate(30);\n }\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference);\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;\n\n // Check for cases of one full calendar month\n if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {\n isLastMonthNotFull = false;\n }\n result = sign * (difference - Number(isLastMonthNotFull));\n }\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n requiredArgs(2, arguments);\n return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","var roundingMap = {\n ceil: Math.ceil,\n round: Math.round,\n floor: Math.floor,\n trunc: function trunc(value) {\n return value < 0 ? Math.ceil(value) : Math.floor(value);\n } // Math.trunc is not supported by IE\n};\n\nvar defaultRoundingMethod = 'trunc';\nexport function getRoundingMethod(method) {\n return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];\n}","import differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of seconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport default function differenceInSeconds(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\nvar formatDistance = function formatDistance(token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === 'string') {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace('{{count}}', count.toString());\n }\n if (options !== null && options !== void 0 && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return 'in ' + result;\n } else {\n return result + ' ago';\n }\n }\n return result;\n};\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n full: 'h:mm:ss a zzzz',\n long: 'h:mm:ss a z',\n medium: 'h:mm:ss a',\n short: 'h:mm a'\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: 'P'\n};\nvar formatRelative = function formatRelative(token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, options) {\n var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';\n var valuesArray;\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;\n // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n if (!matchResult) {\n return null;\n }\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n return undefined;\n}\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],\n any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function valueCallback(value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function valueCallback(index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import defaultLocale from \"../../locale/en-US/index.js\";\nexport default defaultLocale;","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n }\n};\nvar ordinalNumber = function ordinalNumber(dirtyNumber, _options) {\n var number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n var rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n case 2:\n return number + 'nd';\n case 3:\n return number + 'rd';\n }\n }\n return number + 'th';\n};\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function argumentCallback(quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","export default function assign(target, object) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n for (var property in object) {\n if (Object.prototype.hasOwnProperty.call(object, property)) {\n ;\n target[property] = object[property];\n }\n }\n return target;\n}","import assign from \"../assign/index.js\";\nexport default function cloneObject(object) {\n return assign({}, object);\n}","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","import { getDefaultOptions } from \"../_lib/defaultOptions/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport differenceInMonths from \"../differenceInMonths/index.js\";\nimport differenceInSeconds from \"../differenceInSeconds/index.js\";\nimport defaultLocale from \"../_lib/defaultLocale/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport cloneObject from \"../_lib/cloneObject/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MINUTES_IN_DAY = 1440;\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520;\nvar MINUTES_IN_MONTH = 43200;\nvar MINUTES_IN_TWO_MONTHS = 86400;\n\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `baseDate` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistance(dirtyDate, dirtyBaseDate, options) {\n var _ref, _options$locale;\n requiredArgs(2, arguments);\n var defaultOptions = getDefaultOptions();\n var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;\n if (!locale.formatDistance) {\n throw new RangeError('locale must contain formatDistance property');\n }\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n if (isNaN(comparison)) {\n throw new RangeError('Invalid time value');\n }\n var localizeOptions = assign(cloneObject(options), {\n addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix),\n comparison: comparison\n });\n var dateLeft;\n var dateRight;\n if (comparison > 0) {\n dateLeft = toDate(dirtyBaseDate);\n dateRight = toDate(dirtyDate);\n } else {\n dateLeft = toDate(dirtyDate);\n dateRight = toDate(dirtyBaseDate);\n }\n var seconds = differenceInSeconds(dateRight, dateLeft);\n var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\n var minutes = Math.round((seconds - offsetInSeconds) / 60);\n var months;\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options !== null && options !== void 0 && options.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance('lessThanXSeconds', 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance('lessThanXSeconds', 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance('lessThanXSeconds', 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance('halfAMinute', 0, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', minutes, localizeOptions);\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return locale.formatDistance('xMinutes', minutes, localizeOptions);\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance('aboutXHours', 1, localizeOptions);\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < MINUTES_IN_DAY) {\n var hours = Math.round(minutes / 60);\n return locale.formatDistance('aboutXHours', hours, localizeOptions);\n\n // 1 day up to 1.75 days\n } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\n return locale.formatDistance('xDays', 1, localizeOptions);\n\n // 1.75 days up to 30 days\n } else if (minutes < MINUTES_IN_MONTH) {\n var days = Math.round(minutes / MINUTES_IN_DAY);\n return locale.formatDistance('xDays', days, localizeOptions);\n\n // 1 month up to 2 months\n } else if (minutes < MINUTES_IN_TWO_MONTHS) {\n months = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('aboutXMonths', months, localizeOptions);\n }\n months = differenceInMonths(dateRight, dateLeft);\n\n // 2 months up to 12 months\n if (months < 12) {\n var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('xMonths', nearestMonth, localizeOptions);\n\n // 1 year up to max Date\n } else {\n var monthsSinceStartOfYear = months % 12;\n var years = Math.floor(months / 12);\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance('aboutXYears', years, localizeOptions);\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance('overXYears', years, localizeOptions);\n\n // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance('almostXYears', years + 1, localizeOptions);\n }\n }\n}","/**\n * Returns the [year, month, day, hour, minute, seconds] tokens of the provided\n * `date` as it will be rendered in the `timeZone`.\n */\nexport default function tzTokenizeDate(date, timeZone) {\n var dtf = getDateTimeFormat(timeZone);\n return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);\n}\nvar typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n hour: 3,\n minute: 4,\n second: 5\n};\nfunction partsOffset(dtf, date) {\n try {\n var formatted = dtf.formatToParts(date);\n var filled = [];\n for (var i = 0; i < formatted.length; i++) {\n var pos = typeToPos[formatted[i].type];\n if (pos >= 0) {\n filled[pos] = parseInt(formatted[i].value, 10);\n }\n }\n return filled;\n } catch (error) {\n if (error instanceof RangeError) {\n return [NaN];\n }\n throw error;\n }\n}\nfunction hackyOffset(dtf, date) {\n var formatted = dtf.format(date).replace(/\\u200E/g, '');\n var parsed = /(\\d+)\\/(\\d+)\\/(\\d+),? (\\d+):(\\d+):(\\d+)/.exec(formatted);\n // var [, fMonth, fDay, fYear, fHour, fMinute, fSecond] = parsed\n // return [fYear, fMonth, fDay, fHour, fMinute, fSecond]\n return [parsed[3], parsed[1], parsed[2], parsed[4], parsed[5], parsed[6]];\n}\n\n// Get a cached Intl.DateTimeFormat instance for the IANA `timeZone`. This can be used\n// to get deterministic local date/time output according to the `en-US` locale which\n// can be used to extract local time parts as necessary.\nvar dtfCache = {};\nfunction getDateTimeFormat(timeZone) {\n if (!dtfCache[timeZone]) {\n // New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12`\n var testDateFormatted = new Intl.DateTimeFormat('en-US', {\n hour12: false,\n timeZone: 'America/New_York',\n year: 'numeric',\n month: 'numeric',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n }).format(new Date('2014-06-25T04:00:00.123Z'));\n var hourCycleSupported = testDateFormatted === '06/25/2014, 00:00:00' || testDateFormatted === '06/25/2014 00:00:00';\n dtfCache[timeZone] = hourCycleSupported ? new Intl.DateTimeFormat('en-US', {\n hour12: false,\n timeZone: timeZone,\n year: 'numeric',\n month: 'numeric',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n }) : new Intl.DateTimeFormat('en-US', {\n hourCycle: 'h23',\n timeZone: timeZone,\n year: 'numeric',\n month: 'numeric',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n });\n }\n return dtfCache[timeZone];\n}","/**\n * Use instead of `new Date(Date.UTC(...))` to support years below 100 which doesn't work\n * otherwise due to the nature of the\n * [`Date` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years.\n *\n * For `Date.UTC(...)`, use `newDateUTC(...).getTime()`.\n */\nexport default function newDateUTC(fullYear, month, day, hour, minute, second, millisecond) {\n var utcDate = new Date(0);\n utcDate.setUTCFullYear(fullYear, month, day);\n utcDate.setUTCHours(hour, minute, second, millisecond);\n return utcDate;\n}","import tzTokenizeDate from \"../tzTokenizeDate/index.js\";\nimport newDateUTC from \"../newDateUTC/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar patterns = {\n timezone: /([Z+-].*)$/,\n timezoneZ: /^(Z)$/,\n timezoneHH: /^([+-]\\d{2})$/,\n timezoneHHMM: /^([+-]\\d{2}):?(\\d{2})$/\n};\n\n// Parse various time zone offset formats to an offset in milliseconds\nexport default function tzParseTimezone(timezoneString, date, isUtcDate) {\n var token;\n var absoluteOffset;\n\n // Empty string\n if (!timezoneString) {\n return 0;\n }\n\n // Z\n token = patterns.timezoneZ.exec(timezoneString);\n if (token) {\n return 0;\n }\n var hours;\n\n // ±hh\n token = patterns.timezoneHH.exec(timezoneString);\n if (token) {\n hours = parseInt(token[1], 10);\n if (!validateTimezone(hours)) {\n return NaN;\n }\n return -(hours * MILLISECONDS_IN_HOUR);\n }\n\n // ±hh:mm or ±hhmm\n token = patterns.timezoneHHMM.exec(timezoneString);\n if (token) {\n hours = parseInt(token[1], 10);\n var minutes = parseInt(token[2], 10);\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;\n return hours > 0 ? -absoluteOffset : absoluteOffset;\n }\n\n // IANA time zone\n if (isValidTimezoneIANAString(timezoneString)) {\n date = new Date(date || Date.now());\n var utcDate = isUtcDate ? date : toUtcDate(date);\n var offset = calcOffset(utcDate, timezoneString);\n var fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);\n return -fixedOffset;\n }\n return NaN;\n}\nfunction toUtcDate(date) {\n return newDateUTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n}\nfunction calcOffset(date, timezoneString) {\n var tokens = tzTokenizeDate(date, timezoneString);\n\n // ms dropped because it's not provided by tzTokenizeDate\n var asUTC = newDateUTC(tokens[0], tokens[1] - 1, tokens[2], tokens[3] % 24, tokens[4], tokens[5], 0).getTime();\n var asTS = date.getTime();\n var over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return asUTC - asTS;\n}\nfunction fixOffset(date, offset, timezoneString) {\n var localTS = date.getTime();\n\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - offset;\n\n // Test whether the zone matches the offset for this ts\n var o2 = calcOffset(new Date(utcGuess), timezoneString);\n\n // If so, offset didn't change, and we're done\n if (offset === o2) {\n return offset;\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= o2 - offset;\n\n // If that gives us the local time we want, we're done\n var o3 = calcOffset(new Date(utcGuess), timezoneString);\n if (o2 === o3) {\n return o2;\n }\n\n // If it's different, we're in a hole time. The offset has changed, but we don't adjust the time\n return Math.max(o2, o3);\n}\nfunction validateTimezone(hours, minutes) {\n return -23 <= hours && hours <= 23 && (minutes == null || 0 <= minutes && minutes <= 59);\n}\nvar validIANATimezoneCache = {};\nfunction isValidTimezoneIANAString(timeZoneString) {\n if (validIANATimezoneCache[timeZoneString]) return true;\n try {\n new Intl.DateTimeFormat(undefined, {\n timeZone: timeZoneString\n });\n validIANATimezoneCache[timeZoneString] = true;\n return true;\n } catch (error) {\n return false;\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\nimport toInteger from 'date-fns/_lib/toInteger/index.js';\nimport getTimezoneOffsetInMilliseconds from 'date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js';\nimport tzParseTimezone from \"../_lib/tzParseTimezone/index.js\";\nimport tzPattern from \"../_lib/tzPattern/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar DEFAULT_ADDITIONAL_DIGITS = 2;\nvar patterns = {\n dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,\n datePattern: /^([0-9W+-]+)(.*)/,\n plainTime: /:/,\n // year tokens\n YY: /^(\\d{2})$/,\n YYY: [/^([+-]\\d{2})$/,\n // 0 additional digits\n /^([+-]\\d{3})$/,\n // 1 additional digit\n /^([+-]\\d{4})$/ // 2 additional digits\n ],\n\n YYYY: /^(\\d{4})/,\n YYYYY: [/^([+-]\\d{4})/,\n // 0 additional digits\n /^([+-]\\d{5})/,\n // 1 additional digit\n /^([+-]\\d{6})/ // 2 additional digits\n ],\n\n // date tokens\n MM: /^-(\\d{2})$/,\n DDD: /^-?(\\d{3})$/,\n MMDD: /^-?(\\d{2})-?(\\d{2})$/,\n Www: /^-?W(\\d{2})$/,\n WwwD: /^-?W(\\d{2})-?(\\d{1})$/,\n HH: /^(\\d{2}([.,]\\d*)?)$/,\n HHMM: /^(\\d{2}):?(\\d{2}([.,]\\d*)?)$/,\n HHMMSS: /^(\\d{2}):?(\\d{2}):?(\\d{2}([.,]\\d*)?)$/,\n // time zone tokens (to identify the presence of a tz)\n timeZone: tzPattern\n};\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If an argument is a string, the function tries to parse it.\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n * If the function cannot parse the string or the values are invalid, it returns Invalid Date.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n * All *date-fns* functions will throw `RangeError` if `options.additionalDigits` is not 0, 1, 2 or undefined.\n *\n * @param {Date|String|Number} argument - the value to convert\n * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options}\n * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String.\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * var result = toDate('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * var result = toDate('+02014101', {additionalDigits: 1})\n * //=> Fri Apr 11 2014 00:00:00\n */\nexport default function toDate(argument, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n if (argument === null) {\n return new Date(NaN);\n }\n var options = dirtyOptions || {};\n var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : toInteger(options.additionalDigits);\n if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {\n throw new RangeError('additionalDigits must be 0, 1 or 2');\n }\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && Object.prototype.toString.call(argument) === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || Object.prototype.toString.call(argument) === '[object Number]') {\n return new Date(argument);\n } else if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {\n return new Date(NaN);\n }\n var dateStrings = splitDateString(argument);\n var parseYearResult = parseYear(dateStrings.date, additionalDigits);\n var year = parseYearResult.year;\n var restDateString = parseYearResult.restDateString;\n var date = parseDate(restDateString, year);\n if (isNaN(date)) {\n return new Date(NaN);\n }\n if (date) {\n var timestamp = date.getTime();\n var time = 0;\n var offset;\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n if (isNaN(time)) {\n return new Date(NaN);\n }\n }\n if (dateStrings.timeZone || options.timeZone) {\n offset = tzParseTimezone(dateStrings.timeZone || options.timeZone, new Date(timestamp + time));\n if (isNaN(offset)) {\n return new Date(NaN);\n }\n } else {\n // get offset accurate to hour in time zones that change offset\n offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time));\n offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time + offset));\n }\n return new Date(timestamp + time + offset);\n } else {\n return new Date(NaN);\n }\n}\nfunction splitDateString(dateString) {\n var dateStrings = {};\n var parts = patterns.dateTimePattern.exec(dateString);\n var timeString;\n if (!parts) {\n parts = patterns.datePattern.exec(dateString);\n if (parts) {\n dateStrings.date = parts[1];\n timeString = parts[2];\n } else {\n dateStrings.date = null;\n timeString = dateString;\n }\n } else {\n dateStrings.date = parts[1];\n timeString = parts[3];\n }\n if (timeString) {\n var token = patterns.timeZone.exec(timeString);\n if (token) {\n dateStrings.time = timeString.replace(token[1], '');\n dateStrings.timeZone = token[1].trim();\n } else {\n dateStrings.time = timeString;\n }\n }\n return dateStrings;\n}\nfunction parseYear(dateString, additionalDigits) {\n var patternYYY = patterns.YYY[additionalDigits];\n var patternYYYYY = patterns.YYYYY[additionalDigits];\n var token;\n\n // YYYY or ±YYYYY\n token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString);\n if (token) {\n var yearString = token[1];\n return {\n year: parseInt(yearString, 10),\n restDateString: dateString.slice(yearString.length)\n };\n }\n\n // YY or ±YYY\n token = patterns.YY.exec(dateString) || patternYYY.exec(dateString);\n if (token) {\n var centuryString = token[1];\n return {\n year: parseInt(centuryString, 10) * 100,\n restDateString: dateString.slice(centuryString.length)\n };\n }\n\n // Invalid ISO-formatted year\n return {\n year: null\n };\n}\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) {\n return null;\n }\n var token;\n var date;\n var month;\n var week;\n\n // YYYY\n if (dateString.length === 0) {\n date = new Date(0);\n date.setUTCFullYear(year);\n return date;\n }\n\n // YYYY-MM\n token = patterns.MM.exec(dateString);\n if (token) {\n date = new Date(0);\n month = parseInt(token[1], 10) - 1;\n if (!validateDate(year, month)) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month);\n return date;\n }\n\n // YYYY-DDD or YYYYDDD\n token = patterns.DDD.exec(dateString);\n if (token) {\n date = new Date(0);\n var dayOfYear = parseInt(token[1], 10);\n if (!validateDayOfYearDate(year, dayOfYear)) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, 0, dayOfYear);\n return date;\n }\n\n // yyyy-MM-dd or YYYYMMDD\n token = patterns.MMDD.exec(dateString);\n if (token) {\n date = new Date(0);\n month = parseInt(token[1], 10) - 1;\n var day = parseInt(token[2], 10);\n if (!validateDate(year, month, day)) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month, day);\n return date;\n }\n\n // YYYY-Www or YYYYWww\n token = patterns.Www.exec(dateString);\n if (token) {\n week = parseInt(token[1], 10) - 1;\n if (!validateWeekDate(year, week)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week);\n }\n\n // YYYY-Www-D or YYYYWwwD\n token = patterns.WwwD.exec(dateString);\n if (token) {\n week = parseInt(token[1], 10) - 1;\n var dayOfWeek = parseInt(token[2], 10) - 1;\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week, dayOfWeek);\n }\n\n // Invalid ISO-formatted date\n return null;\n}\nfunction parseTime(timeString) {\n var token;\n var hours;\n var minutes;\n\n // hh\n token = patterns.HH.exec(timeString);\n if (token) {\n hours = parseFloat(token[1].replace(',', '.'));\n if (!validateTime(hours)) {\n return NaN;\n }\n return hours % 24 * MILLISECONDS_IN_HOUR;\n }\n\n // hh:mm or hhmm\n token = patterns.HHMM.exec(timeString);\n if (token) {\n hours = parseInt(token[1], 10);\n minutes = parseFloat(token[2].replace(',', '.'));\n if (!validateTime(hours, minutes)) {\n return NaN;\n }\n return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;\n }\n\n // hh:mm:ss or hhmmss\n token = patterns.HHMMSS.exec(timeString);\n if (token) {\n hours = parseInt(token[1], 10);\n minutes = parseInt(token[2], 10);\n var seconds = parseFloat(token[3].replace(',', '.'));\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000;\n }\n\n // Invalid ISO-formatted time\n return null;\n}\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n week = week || 0;\n day = day || 0;\n var date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n var fourthOfJanuaryDay = date.getUTCDay() || 7;\n var diff = week * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}\n\n// Validation functions\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\nfunction validateDate(year, month, date) {\n if (month < 0 || month > 11) {\n return false;\n }\n if (date != null) {\n if (date < 1) {\n return false;\n }\n var isLeapYear = isLeapYearIndex(year);\n if (isLeapYear && date > DAYS_IN_MONTH_LEAP_YEAR[month]) {\n return false;\n }\n if (!isLeapYear && date > DAYS_IN_MONTH[month]) {\n return false;\n }\n }\n return true;\n}\nfunction validateDayOfYearDate(year, dayOfYear) {\n if (dayOfYear < 1) {\n return false;\n }\n var isLeapYear = isLeapYearIndex(year);\n if (isLeapYear && dayOfYear > 366) {\n return false;\n }\n if (!isLeapYear && dayOfYear > 365) {\n return false;\n }\n return true;\n}\nfunction validateWeekDate(year, week, day) {\n if (week < 0 || week > 52) {\n return false;\n }\n if (day != null && (day < 0 || day > 6)) {\n return false;\n }\n return true;\n}\nfunction validateTime(hours, minutes, seconds) {\n if (hours != null && (hours < 0 || hours >= 25)) {\n return false;\n }\n if (minutes != null && (minutes < 0 || minutes >= 60)) {\n return false;\n }\n if (seconds != null && (seconds < 0 || seconds >= 60)) {\n return false;\n }\n return true;\n}","/** Regex to identify the presence of a time zone specifier in a date string */\nvar tzPattern = /(Z|[+-]\\d{2}(?::?\\d{2})?| UTC| [a-zA-Z]+\\/[a-zA-Z_]+(?:\\/[a-zA-Z_]+)?)$/;\nexport default tzPattern;","import tzParseTimezone from \"../_lib/tzParseTimezone/index.js\";\nimport toDate from \"../toDate/index.js\";\n\n/**\n * @name utcToZonedTime\n * @category Time Zone Helpers\n * @summary Get a date/time representing local time in a given time zone from the UTC date\n *\n * @description\n * Returns a date instance with values representing the local time in the time zone\n * specified of the UTC time from the date provided. In other words, when the new date\n * is formatted it will show the equivalent hours in the target time zone regardless\n * of the current system time zone.\n *\n * @param {Date|String|Number} date - the date with the relevant UTC time\n * @param {String} timeZone - the time zone to get local time for, can be an offset or IANA time zone\n * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options}\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * @returns {Date} the new date with the equivalent time in the time zone\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // In June 10am UTC is 6am in New York (-04:00)\n * const result = utcToZonedTime('2014-06-25T10:00:00.000Z', 'America/New_York')\n * //=> Jun 25 2014 06:00:00\n */\nexport default function utcToZonedTime(dirtyDate, timeZone, options) {\n var date = toDate(dirtyDate, options);\n var offsetMilliseconds = tzParseTimezone(timeZone, date, true);\n var d = new Date(date.getTime() - offsetMilliseconds);\n var resultDate = new Date(0);\n resultDate.setFullYear(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());\n resultDate.setHours(d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());\n return resultDate;\n}","import { formatDistanceToNow as dateFnsFormatDistanceToNow, parseISO } from 'date-fns'\nimport { utcToZonedTime } from 'date-fns-tz'\n\nconst DATE_FORMAT = new Intl.DateTimeFormat('default', {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n})\n\nconst TIME_FORMAT = new Intl.DateTimeFormat('default', {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n})\n\nexport const formatDateTime = (datetime, tz = null) => {\n if (!datetime) return null\n\n let dt = parseISO(datetime)\n\n if (tz) dt = utcToZonedTime(dt, tz)\n\n return `${DATE_FORMAT.format(dt)} ${TIME_FORMAT.format(dt)}`\n}\n\nexport const formatDistanceToNow = (datetime) => {\n if (!datetime) return null\n\n const parsed = parseISO(datetime)\n return dateFnsFormatDistanceToNow(parsed, { addSuffix: true })\n}\n\nexport const formatAllTimeAgo = () => {\n Array.from(document.querySelectorAll('[data-time-ago]')).forEach((el) => {\n if (el.dataset.timeAgo) el.innerHTML = formatDistanceToNow(el.dataset.timeAgo)\n })\n}\n\nexport const formatAllTime = () => {\n const tz = document.querySelector('[data-time-format-timezone-value]')?.dataset?.timeFormatTimezoneValue\n\n Array.from(document.querySelectorAll('[data-time]')).forEach((el) => {\n if (el.dataset.time) el.innerHTML = formatDateTime(el.dataset.time, tz)\n })\n}\n","import distanceInWords from \"../formatDistance/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result specifies if now is earlier or later than the passed date\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport default function formatDistanceToNow(dirtyDate, options) {\n requiredArgs(1, arguments);\n return distanceInWords(dirtyDate, Date.now(), options);\n}","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static values = {\n serialNumber: String,\n settingsSet: String,\n state: String,\n systemSettings: Object,\n }\n\n static targets = ['loader', 'unreachable', 'form', 'resetModal', 'error', 'settingsMismatch']\n\n initialFormData\n dirty = false\n\n connect() {\n this.fetchSettings()\n\n window.addEventListener('beforeunload', (event) => {\n if (this.dirty) {\n event.preventDefault()\n event.returnValue = ''\n }\n })\n }\n\n disconnect() {\n if (this.statusFetchTimer) {\n clearTimeout(this.statusFetchTimer)\n }\n }\n\n setSettingsForm() {\n for (const [key, value] of Object.entries(this.systemSettingsValue)) {\n if (key === 'mode') {\n const modeInput = this.formTarget.querySelector(`[name=\"${key}\"][value=\"${value}\"]`)\n if (modeInput) {\n modeInput.checked = true\n }\n this.toggleGeneratorMode(value)\n continue\n }\n\n if (key === 'enabled') {\n this.setHiddenEnabled(value)\n }\n\n const input = this.formTarget.querySelector(`[name=\"${key}\"]:not([type=\"hidden\"])`)\n\n if (input) {\n if (input.type === 'checkbox') {\n input.checked = value\n } else {\n input.value = value\n }\n }\n }\n\n this.initialFormData = this.getFormValues()\n }\n\n async fetchSettings() {\n this.stateValue = 'loading'\n\n try {\n const res = await fetch(\n `/systems/${this.serialNumberValue}/control/settings?settings_type=${this.settingsMode()}`\n )\n const result = await res.json()\n\n if (!res.ok) {\n throw new Error(result.response)\n }\n\n this.cacheSettings(result)\n\n this.stateValue = 'idle'\n } catch (err) {\n console.error(err)\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML = err.message\n this.stateValue = 'unreachable'\n }\n\n this.statusFetchTimer = setTimeout(() => {\n if (this.stateValue !== 'loading') return\n\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML =\n this.unreachableTarget.querySelector('.unreachable-title').dataset.defaultMessage\n this.stateValue = 'unreachable'\n }, 600)\n }\n\n settingsMode() {\n return this.formTarget.querySelector('[name=\"settings\"]').value\n }\n\n settingsSet() {\n return this.settingsMode() === 'charging' ? 'chargeSettings' : 'generatorSettings'\n }\n\n cacheSettings(result) {\n if (result.settings_mismatch) {\n this.errorTarget.classList.remove('is-hidden')\n this.errorTarget.innerHTML = result.settings_mismatch\n }\n\n const { response } = result\n\n if (!response) {\n throw new Error('Unable to fetch settings')\n }\n\n const err = response.find((r) => r.error)\n\n if (err) {\n throw new Error(err)\n }\n\n if (response.length === 0) {\n throw new Error('Unable to fetch settings')\n }\n\n const settings = response[0][this.settingsSet()]\n\n this.systemSettingsValue = {\n enabled: settings.enabled,\n start_threshold: settings.startThreshold,\n stop_threshold: settings.stopThreshold,\n charging_current: settings.chargingCurrent,\n mode: settings.mode?.toLowerCase(),\n }\n\n this.setSettingsForm()\n }\n\n stateValueChanged() {\n switch (this.stateValue) {\n case 'loading':\n this.loaderTarget.classList.remove('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n this.formTarget.classList.add('is-hidden')\n break\n case 'unreachable':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.remove('is-hidden')\n this.formTarget.classList.add('is-hidden')\n break\n case 'idle':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n this.formTarget.classList.remove('is-hidden')\n this.toggleSubmitButton()\n this.toggleFormDisable()\n break\n case 'updating':\n this.errorTarget.classList.add('is-hidden')\n this.toggleFormDisable(true)\n\n break\n }\n }\n\n getFormValues() {\n const formData = new FormData(this.formTarget.querySelector('form'))\n this.formTarget\n .querySelectorAll('input:not([disabled]):not([type=\"submit\"]):not([type=\"hidden\"]), select:not([disabled])')\n .forEach((input) => {\n const value = input.type === 'checkbox' || input.type === 'radio' ? input.checked : input.value\n formData.set(input.name, value)\n })\n return formData\n }\n\n onFormChange(event) {\n switch (event.target.name) {\n case 'enabled':\n this.disableFormFields(!event.target.checked)\n this.setHiddenEnabled(event.target.checked)\n break\n case 'mode':\n this.toggleGeneratorMode(event.target.value)\n break\n }\n\n this.toggleSubmitButton()\n\n this.validateForm(event)\n }\n\n setHiddenEnabled(enabled) {\n document.querySelector(`[name=\"enabled\"][type='hidden']`).disabled = enabled\n }\n\n toggleGeneratorMode(mode) {\n const disabled = mode === 'manual'\n\n ;['start_threshold', 'stop_threshold'].forEach((name) => {\n const input = this.formTarget.querySelector(`[name=\"${name}\"]`)\n input.disabled = disabled\n input.closest('.field').classList.toggle('is-disabled', disabled)\n })\n }\n\n validateForm(event) {\n if (event.target.name === 'start_threshold' || event.target.name === 'stop_threshold') {\n const stopThresholdEl = this.formTarget.querySelector('[name=\"stop_threshold\"]')\n const startThresholdEl = this.formTarget.querySelector('[name=\"start_threshold\"]')\n\n if (parseInt(stopThresholdEl.value, 10) <= parseInt(startThresholdEl.value, 10)) {\n stopThresholdEl.setCustomValidity('The Stop Threshold must be greater than the Start Threshold')\n } else {\n stopThresholdEl.setCustomValidity('')\n }\n }\n }\n\n isEnabled() {\n return this.formTarget.querySelector('[name=\"enabled\"]:not([type=\"hidden\"])').checked\n }\n\n disableFormFields(value) {\n const disabled = typeof value !== 'undefined' ? value : !this.isEnabled()\n\n this.formTarget\n .querySelectorAll(\n 'select:not([data-always-enabled]), input:not([name=\"enabled\"]):not([type=\"submit\"]):not([type=\"hidden\"])'\n )\n .forEach((input) => {\n input.disabled = disabled\n input.closest('.field').classList.toggle('is-disabled', disabled)\n })\n\n if (this.settingsMode() === 'generator' && !disabled)\n this.toggleGeneratorMode(this.formTarget.querySelector('[name=\"mode\"]:checked').value)\n }\n\n toggleSubmitButton(disabled) {\n const btn = this.formTarget.querySelector('[type=\"submit\"]')\n\n if (typeof disabled !== 'undefined') {\n btn.disabled = disabled\n return\n }\n\n const formValues = this.getFormValues()\n\n this.dirty = false\n\n for (const [key, value] of formValues.entries()) {\n if (this.initialFormData.get(key) !== value) {\n this.dirty = true\n break\n }\n }\n\n btn.disabled = !this.dirty\n }\n\n openResetModal() {\n this.resetModalTarget.classList.add('is-active')\n }\n\n closeResetModal() {\n this.resetModalTarget.classList.remove('is-active')\n }\n\n async resetSettings() {\n this.stateValue = 'updating'\n await this.sendReset()\n this.stateValue = 'idle'\n this.closeResetModal()\n }\n\n async sendReset() {\n try {\n const res = await fetch(`/systems/${this.serialNumberValue}/control/set_settings`, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content'),\n },\n body: JSON.stringify({ settings: this.settingsMode(), reset: true }),\n })\n\n if (!res.ok) {\n throw new Error('Unable to reset settings')\n }\n\n const newSettings = await res.json()\n\n this.cacheSettings(newSettings)\n } catch (err) {\n console.error(err)\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML = err.message\n this.stateValue = 'unreachable'\n }\n }\n\n toggleFormDisable(disabled) {\n this.disableFormFields(disabled)\n this.toggleSubmitButton(disabled)\n\n const enabledInput = this.formTarget.querySelector('input[name=\"enabled\"]')\n enabledInput.disabled = disabled || false\n enabledInput.closest('.field').classList.toggle('is-disabled', disabled || false)\n\n this.formTarget.querySelectorAll('button').forEach((btn) => {\n btn.disabled = disabled || false\n })\n }\n\n beforeSettingsSet() {\n this.stateValue = 'updating'\n\n this.toggleSubmitButtonText()\n }\n\n afterSettingsSet() {\n this.stateValue = 'idle'\n\n this.toggleSubmitButtonText()\n }\n\n onSetSuccess(event) {\n const [, , xhr] = event.detail\n const resp = JSON.parse(xhr.response)\n this.cacheSettings(resp)\n }\n\n onSetError(event) {\n let [data, status, xhr] = event.detail\n\n this.errorTarget.classList.remove('is-hidden')\n this.errorTarget.innerHTML = data.response\n }\n\n toggleSubmitButtonText() {\n const btn = this.formTarget.querySelector('[type=\"submit\"]')\n const disableWith = btn.dataset.disableBtnWith\n btn.dataset.disableBtnWith = btn.value\n btn.value = disableWith\n }\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = (typeof global === \"undefined\" ? \"undefined\" : _typeof(global)) == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = (typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function now() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;\n }\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = _typeof(value);\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && _typeof(value) == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? other + '' : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;\n}\nmodule.exports = debounce;","import '../stylesheets/highcharts.sass'\n\nimport Chartkick from 'chartkick'\nimport Highcharts from 'highcharts'\nwindow.Highcharts = Highcharts\n\nimport Exporting from 'highcharts/modules/exporting'\nExporting(Highcharts)\n\nimport DataExporting from 'highcharts/modules/export-data'\nDataExporting(Highcharts)\n\nimport '@highcharts/dashboards'\n// it's not working other way\nrequire('@highcharts/dashboards/modules/dashboards-plugin')\n\nChartkick.use(Highcharts)\n\nHighcharts.Templating.helpers.localized = (value) => value.toLocaleString()\nHighcharts.Templating.helpers.round2 = (value, numbers) => +value.toFixed(numbers)\n","import { Controller } from '@hotwired/stimulus'\nimport debounce from 'lodash.debounce'\n\nexport default class extends Controller {\n static values = { delay: { type: Number, default: 200 }, minLen: { type: Number, default: 2 } }\n static targets = ['input', 'menu']\n\n toggleMenu(hide) {\n this.menuTarget.style.display = hide ? 'none' : 'block'\n }\n\n setValue(event) {\n event.preventDefault()\n const label = event.target.innerHTML\n this.inputTarget.value = label\n\n const onSelectEvent = new CustomEvent('bulmahead:select', {\n detail: {\n label: label,\n value: event.target.dataset.value,\n obj: event.target.dataset.obj ? JSON.parse(event.target.dataset.obj) : undefined,\n },\n })\n window.dispatchEvent(onSelectEvent)\n\n this.toggleMenu(true)\n return event.target.dataset\n }\n\n api() {\n throw new Error('You must implement the `api` method')\n }\n\n handleApi(event) {\n const value = event.target.value\n\n if (value.length <= this.minLenValue) {\n return\n }\n\n this.menuTarget.innerHTML = ''\n\n // Assuming `api` is a function defined elsewhere that returns a Promise\n this.api(value).then((suggestions) => {\n this.menuTarget.innerHTML = ''\n\n suggestions.forEach(({ label, value, obj }) => {\n const li = document.createElement('li')\n li.classList.add('dropdown-item')\n li.innerHTML = label\n li.dataset.value = value\n if (obj) li.dataset.obj = JSON.stringify(obj)\n this.menuTarget.querySelector('ul').appendChild(li)\n })\n\n this.toggleMenu(false)\n\n if (!suggestions.length) {\n const noResultsEl = document.createElement('div')\n noResultsEl.classList.add('px-4')\n noResultsEl.classList.add('py-2')\n noResultsEl.innerHTML = 'No results'\n this.menuTarget.childNodes[0].appendChild(noResultsEl)\n }\n })\n }\n\n inputChanged(event) {\n debounce(() => this.handleApi(event), this.delayValue)()\n }\n\n focusIn() {\n this.toggleMenu(false)\n }\n\n clickOutside(event) {\n if (\n !event.target.closest('.dropdown') &&\n (event.target === null || !event.target.classList.contains('dropdown-item'))\n ) {\n this.toggleMenu(true)\n }\n }\n\n menuClick(event) {\n if (!event.target.classList.contains('dropdown-item')) return\n\n this.setValue(event)\n }\n}\n","// close all dropdowns that were open on click\nexport const closeAllDropdowns = () => {\n Array.from(document.querySelectorAll('.dropdown:not(.is-hoverable)')).forEach((el) => {\n el.classList.remove('is-active')\n })\n}\n\n// close all dropdowns that were open on click when user clicks anywhere outside of dropdown\ndocument.addEventListener('click', (e) => {\n const parentTrigger = e.target.closest('.dropdown-trigger')\n\n const target = parentTrigger || e.target\n\n if (!target.classList.contains('dropdown-trigger')) {\n return closeAllDropdowns()\n } else {\n e.stopPropagation()\n }\n\n const dropdown = target.closest('.dropdown:not(.is-hoverable)')\n dropdown.classList.toggle('is-active')\n})\n\n// close all dropdowns that were open on click when user clicks Esc\ndocument.addEventListener('keydown', (event) => {\n const e = event || window.event\n\n if (e.key === 'Esc' || e.key === 'Escape') {\n closeAllDropdowns()\n }\n})\n","const hasModalCloseClass = (el) => {\n if (\n el.classList.contains('modal-background') ||\n el.classList.contains('modal-close') ||\n el.hasAttribute('data-modal-close')\n )\n return true\n\n if (el.classList.contains('delete') && el.closest('.modal-card-head')) return true\n\n if (el.classList.contains('button') && el.closest('.modal-card-foot')) return true\n\n return false\n}\n\nexport const closeModals = () => {\n document.documentElement.classList.remove('is-clipped')\n\n Array.from(document.querySelectorAll('.modal')).forEach((el) => {\n const modalCardBody = el.querySelector('.modal-card-body')\n if (modalCardBody) {\n modalCardBody.scrollTop = 0\n }\n\n el.classList.remove('is-active')\n\n const event = new Event('modal:close', { bubbles: true })\n\n el.dispatchEvent(event)\n })\n}\n\ndocument.addEventListener('click', ({ target }) => {\n const el = target.classList.contains('modal-button') ? target : target.closest('.modal-button')\n\n if (!el || !el.classList.contains('modal-button')) return\n\n const modal = document.getElementById(el.dataset.target)\n document.documentElement.classList.add('is-clipped')\n modal.classList.add('is-active')\n\n if (el.dataset.modalCardBody) {\n modal.querySelector('.modal-card-body').innerHTML = el.dataset.modalCardBody\n }\n\n const event = new Event('modal:show', { bubbles: true })\n\n modal.dispatchEvent(event)\n})\n\ndocument.addEventListener('click', ({ target }) => {\n const el = hasModalCloseClass(target) ? target : target.closest('.modal-button')\n\n if (!el || !hasModalCloseClass(el)) return\n\n closeModals()\n})\n\ndocument.addEventListener('keydown', (event) => {\n var e = event || window.event\n if (e.keyCode === 27) {\n closeModals()\n }\n})\n","import { findElementWithParent } from '../javascript/utils'\n\ndocument.addEventListener('ajax:send', (e) => {\n const btn = findElementWithParent(e, 'activity-dismiss')\n\n if (!btn) return\n\n const item = btn.closest('.timeline-item')\n\n if (item) {\n item.remove()\n recalculateTopNavFeed()\n }\n})\n\nexport const recalculateFirstLast = (feed) => {\n Array.from(feed.querySelectorAll('.timeline-item')).forEach((el, idx, list) => {\n el.classList.remove('is-first', 'is-last')\n\n if (idx === 0) el.classList.add('is-first')\n if (idx === list.length - 1) el.classList.add('is-last')\n })\n}\n\nexport const recalculateTopNavFeed = () => {\n const notificationsContainer = document.getElementById('topnav-notifications')\n\n if (!notificationsContainer) return\n\n const placeholder = document.getElementById('topnav-notifications-placeholder')\n const notificationsIcon = notificationsContainer.querySelector('.fa-bell')\n\n const hasItems = !!notificationsContainer.querySelector('.timeline-item')\n\n placeholder.classList.toggle('is-hidden', hasItems)\n\n notificationsIcon.classList.toggle('has-notifications', hasItems)\n}\n\ndocument.addEventListener('change', (e) => {\n if (e.target.id !== 'activity-kind-select') return\n\n const hideTypes = e.target.value !== ''\n\n const typesChoice = window.choices.find((c) => c._baseId === 'choices--activity-types-select')\n\n hideTypes ? typesChoice.disable() : typesChoice.enable()\n\n document.getElementById('activity-type-select').classList.toggle('is-hidden', hideTypes)\n})\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getTimezoneOffsetInMilliseconds;\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nfunction getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\nmodule.exports = exports.default;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n/*!\n * bulma-toast 2.4.3 \n * (c) 2018-present @rfoel \n * Released under the MIT License.\n */\n(function (a, b) {\n \"object\" == (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) && \"undefined\" != typeof module ? b(exports) : \"function\" == typeof define && define.amd ? define([\"exports\"], b) : (a = \"undefined\" == typeof globalThis ? a || self : globalThis, b(a.bulmaToast = {}));\n})(this, function (a) {\n 'use strict';\n\n function b(a, b) {\n var c = Object.keys(a);\n if (Object.getOwnPropertySymbols) {\n var d = Object.getOwnPropertySymbols(a);\n b && (d = d.filter(function (b) {\n return Object.getOwnPropertyDescriptor(a, b).enumerable;\n })), c.push.apply(c, d);\n }\n return c;\n }\n function c(a) {\n for (var c, d = 1; d < arguments.length; d++) {\n c = null == arguments[d] ? {} : arguments[d], d % 2 ? b(Object(c), !0).forEach(function (b) {\n g(a, b, c[b]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(c)) : b(Object(c)).forEach(function (b) {\n Object.defineProperty(a, b, Object.getOwnPropertyDescriptor(c, b));\n });\n }\n return a;\n }\n function d(a, b) {\n if (!(a instanceof b)) throw new TypeError(\"Cannot call a class as a function\");\n }\n function e(a, b) {\n for (var c, d = 0; d < b.length; d++) {\n c = b[d], c.enumerable = c.enumerable || !1, c.configurable = !0, \"value\" in c && (c.writable = !0), Object.defineProperty(a, c.key, c);\n }\n }\n function f(a, b, c) {\n return b && e(a.prototype, b), c && e(a, c), a;\n }\n function g(a, b, c) {\n return b in a ? Object.defineProperty(a, b, {\n value: c,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : a[b] = c, a;\n }\n function h() {\n var a;\n return null !== (a = o) && void 0 !== a ? a : document;\n }\n function i(a, b, c, d, e, f) {\n if (n.position) return n.position;\n var g = h().createElement(\"div\");\n return g.setAttribute(\"style\", \"width:100%;z-index:99999;position:fixed;pointer-events:none;display:flex;flex-direction:column;padding:15px;\" + p(b, c, d, e, f)), a.appendChild(g), n.position = g, g;\n }\n function j(a) {\n for (var b in n) {\n n[b].remove();\n }\n n = {}, o = a;\n }\n function k(a) {\n if (!a.message) throw new Error(\"message is required\");\n var b = c(c({}, m), a),\n d = new q(b),\n e = i(b.appendTo || h().body, b.position || m.position, b.offsetTop || m.offsetTop, b.offsetBottom || m.offsetBottom, b.offsetLeft || m.offsetLeft, b.offsetRight || m.offsetRight);\n if (b.single) for (var f = e.lastElementChild; f;) {\n e.removeChild(f), f = e.lastElementChild;\n }\n e.appendChild(d.element);\n }\n var l = {\n duration: 2e3,\n position: \"top-right\",\n closeOnClick: !0,\n opacity: 1,\n single: !1,\n offsetTop: 0,\n offsetBottom: 0,\n offsetLeft: 0,\n offsetRight: 0,\n extraClasses: \"\"\n },\n m = c({}, l),\n n = {},\n o = null,\n p = function p(a, b, c, d, e) {\n return \"top-left\" === a ? \"left:\".concat(d, \";top:\").concat(b, \";text-align:left;align-items:flex-start;\") : \"top-right\" === a ? \"right:\".concat(e, \";top:\").concat(b, \";text-align:right;align-items:flex-end;\") : \"top-center\" === a ? \"top:\".concat(b, \";left:0;right:0;text-align:center;align-items:center;\") : \"bottom-left\" === a ? \"left:\".concat(d, \";bottom:\").concat(c, \";text-align:left;align-items:flex-start;\") : \"bottom-right\" === a ? \"right:\".concat(e, \";bottom:\").concat(c, \";text-align:right;align-items:flex-end;\") : \"bottom-center\" === a ? \"bottom:\".concat(c, \";left:0;right:0;text-align:center;align-items:center;\") : \"center\" === a ? \"top:0;left:0;right:0;bottom:0;flex-flow:column;justify-content:center;align-items:center;\" : void 0;\n },\n q = /*#__PURE__*/function () {\n function a(b) {\n var c = this;\n d(this, a), this.element = h().createElement(\"div\"), this.opacity = b.opacity, this.type = b.type, this.animate = b.animate, this.dismissible = b.dismissible, this.closeOnClick = b.closeOnClick, this.message = b.message, this.duration = b.duration, this.pauseOnHover = b.pauseOnHover, this.offsetTop = b.offsetTop, this.offsetBottom = b.offsetBottom, this.offsetLeft = b.offsetLeft, this.offsetRight = b.offsetRight, this.extraClasses = b.extraClasses;\n var e = \"width:auto;pointer-events:auto;display:inline-flex;white-space:pre-wrap;opacity:\".concat(this.opacity, \";\"),\n f = [\"notification\", this.extraClasses];\n if (this.type && f.push(this.type), this.animate && this.animate[\"in\"]) {\n var g = \"animate__\".concat(this.animate[\"in\"]),\n i = this.animate.speed ? \"animate__\".concat(this.animate.speed) : \"animate__faster\";\n f.push(\"animate__animated \".concat(g, \" \").concat(i)), this.onAnimationEnd(function () {\n return c.element.classList.remove(g);\n });\n }\n if (this.element.className = f.join(\" \"), this.dismissible) {\n var j = h().createElement(\"button\");\n j.className = \"delete\", j.addEventListener(\"click\", function () {\n c.destroy();\n }), this.element.insertAdjacentElement(\"afterbegin\", j);\n } else e += \"padding: 1.25rem 1.5rem\";\n this.closeOnClick && this.element.addEventListener(\"click\", function () {\n c.destroy();\n }), this.element.setAttribute(\"style\", e), \"string\" == typeof this.message ? this.element.insertAdjacentHTML(\"beforeend\", this.message) : this.element.appendChild(this.message);\n var k = new r(function () {\n c.destroy();\n }, this.duration);\n this.pauseOnHover && (this.element.addEventListener(\"mouseover\", function () {\n k.pause();\n }), this.element.addEventListener(\"mouseout\", function () {\n k.resume();\n }));\n }\n return f(a, [{\n key: \"destroy\",\n value: function value() {\n var a = this;\n this.animate && this.animate.out ? (this.element.classList.add(\"animate__\".concat(this.animate.out)), this.onAnimationEnd(function () {\n a.removeParent(a.element.parentNode), a.element.remove();\n })) : (this.removeParent(this.element.parentNode), this.element.remove());\n }\n }, {\n key: \"removeParent\",\n value: function value(a) {\n a && 1 >= a.children.length && (a.remove(), delete n.position);\n }\n }, {\n key: \"onAnimationEnd\",\n value: function value() {\n var a = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : function () {},\n b = {\n animation: \"animationend\",\n OAnimation: \"oAnimationEnd\",\n MozAnimation: \"mozAnimationEnd\",\n WebkitAnimation: \"webkitAnimationEnd\"\n };\n for (var c in b) {\n if (void 0 !== this.element.style[c]) {\n this.element.addEventListener(b[c], function () {\n return a();\n });\n break;\n }\n }\n }\n }]), a;\n }(),\n r = /*#__PURE__*/function () {\n function a(b, c) {\n d(this, a), this.timer, this.start, this.remaining = c, this.callback = b, this.resume();\n }\n return f(a, [{\n key: \"pause\",\n value: function value() {\n \"undefined\" == typeof document || (window.clearTimeout(this.timer), this.remaining -= new Date() - this.start);\n }\n }, {\n key: \"resume\",\n value: function value() {\n \"undefined\" == typeof document || (this.start = new Date(), window.clearTimeout(this.timer), this.timer = window.setTimeout(this.callback, this.remaining));\n }\n }]), a;\n }();\n a.resetDefaults = function () {\n m = c({}, l);\n }, a.setDefaults = function (a) {\n m = c(c({}, l), a);\n }, a.setDoc = j, a.toast = k, Object.defineProperty(a, \"__esModule\", {\n value: !0\n });\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toInteger;\nfunction toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n var number = Number(dirtyNumber);\n if (isNaN(number)) {\n return number;\n }\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}\nmodule.exports = exports.default;","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n\nimport '../stylesheets/application.sass'\n\nrequire('../controllers/index.js')\n\nrequire('../javascript/dropdowns')\nrequire('../javascript/nav')\n\nif (!window.App) window.App = {}\n\nwindow.App.channels = {}\n\nrequire('../javascript/organization-members')\nrequire('../javascript/systems')\nrequire('../javascript/hotjar')\nrequire('../javascript/modals')\nrequire('../javascript/forms')\nrequire('../channels')\nrequire('../javascript/activity-feeds')\nrequire('../javascript/customers')\nrequire('../javascript/users')\nrequire('../javascript/looker')\nrequire('../javascript/tables')\n\nimport { setCookie } from '../javascript/utils'\n\ndocument.addEventListener('DOMContentLoaded', () => {\n document.querySelector('.preload-transitions')?.classList?.remove('preload-transitions')\n\n const tz = Intl.DateTimeFormat().resolvedOptions().timeZone\n setCookie('timezone', tz)\n\n const cookiesBanner = document.getElementById('cookies-banner')\n\n if (cookiesBanner) {\n function checkCookiesSupport(evt) {\n if (evt.data === 'MM:3PCunsupported') cookiesBanner.classList.remove('is-hidden')\n }\n\n window.addEventListener('message', checkCookiesSupport, false)\n }\n})\n","var map = {\n\t\"./ai_widget_controller.js\": 74,\n\t\"./async_lock_controller.js\": 75,\n\t\"./bulmahead_controller.js\": 34,\n\t\"./calendar_controller.js\": 76,\n\t\"./charging_control_controller.js\": 77,\n\t\"./charts_controller.js\": 78,\n\t\"./charts_dashboard_controller.js\": 79,\n\t\"./crm/proposal_form_controller.js\": 80,\n\t\"./crm/proposals_list_controller.js\": 81,\n\t\"./crm/prospect_search_controller.js\": 82,\n\t\"./device_control_controller.js\": 23,\n\t\"./edge_lock_controller.js\": 83,\n\t\"./generator_control_controller.js\": 84,\n\t\"./grid_control_controller.js\": 85,\n\t\"./installations_list_controller.js\": 86,\n\t\"./nested_form_controller.js\": 87,\n\t\"./no_data_controller.js\": 88,\n\t\"./refetch_status_controller.js\": 89,\n\t\"./refresh_state_controller.js\": 90,\n\t\"./share_controller.js\": 91,\n\t\"./system_configuration_form_controller.js\": 92,\n\t\"./systems/edge_maintenance_mode_controller.js\": 93,\n\t\"./systems/firmware_update_controller.js\": 94,\n\t\"./tabs_controller.js\": 95,\n\t\"./time_format_controller.js\": 96,\n\t\"./timeline_controller.js\": 97,\n\t\"./tooltip_controller.js\": 111\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 73;","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['widgetContainer', 'widgetContent']\n\n initialized = false\n\n toggleWidget(e) {\n e.currentTarget.classList.toggle('is-active')\n\n this.widgetContainerTarget.classList.toggle('is-visible')\n\n if (this.initialized) return\n\n window.widgetOptions = {\n expandedWidth: '100%',\n expandedHeight: '100%',\n }\n\n this.initialize()\n }\n\n initialize() {\n this.initialized = true\n }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['error', 'loader', 'unreachable']\n\n static values = {\n serialNumber: String,\n organization: String,\n state: String,\n }\n\n connect() {\n this.fetchStatus()\n }\n\n disconnect() {\n if (this.statusFetchTimer) {\n clearTimeout(this.statusFetchTimer)\n }\n }\n\n toggleFormDisabled(disabled = true) {\n this.element.querySelectorAll('input, a, button').forEach((el) => {\n if (disabled) el.setAttribute('disabled', 'disabled')\n else el.removeAttribute('disabled')\n el.classList.toggle('is-disabled', disabled)\n })\n }\n\n beforeSend({ target }) {\n this.toggleFormDisabled()\n\n let buttonTarget = target\n\n if (buttonTarget.tagName === 'FORM') {\n buttonTarget = buttonTarget.querySelector('input[type=\"submit\"]')\n }\n\n if (!buttonTarget) {\n console.error('Button target not found')\n return\n }\n\n buttonTarget.dataset.originalText = buttonTarget.value\n buttonTarget.value = 'In progress...'\n\n this.errorTarget.textContent = ''\n this.errorTarget.classList.add('is-hidden')\n }\n\n onSendError({ detail, target }) {\n const [data, ,] = detail\n\n if (data.error) {\n this.errorTarget.textContent = data.error\n this.errorTarget.classList.remove('is-hidden')\n }\n\n this.toggleFormDisabled(false)\n\n let buttonTarget = target\n\n if (buttonTarget.tagName === 'FORM') {\n buttonTarget = buttonTarget.querySelector('input[type=\"submit\"]')\n }\n\n if (!buttonTarget) {\n console.error('Button target not found')\n return\n } else {\n buttonTarget.value = buttonTarget.dataset.originalText\n }\n }\n\n async fetchStatus() {\n this.stateValue = 'loading'\n\n try {\n const res = await fetch(`/systems/${this.serialNumberValue}/fetch_status`)\n const result = await res.json()\n\n if (!res.ok) {\n throw new Error(result.error)\n }\n\n this.stateValue = 'loading'\n } catch (err) {\n console.error(err)\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML = err.message\n this.stateValue = 'unreachable'\n }\n\n this.statusFetchTimer = setTimeout(() => {\n if (this.stateValue !== 'loading' || !this.hasLoaderTarget) return\n\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML =\n this.unreachableTarget.querySelector('.unreachable-title').dataset.defaultMessage\n this.stateValue = 'unreachable'\n }, 30000)\n }\n\n stateValueChanged() {\n switch (this.stateValue) {\n case 'loading':\n this.loaderTarget.classList.remove('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n break\n case 'unreachable':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.remove('is-hidden')\n break\n }\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport bulmaCalendar from 'bulma-calendar'\n\nexport default class extends Controller {\n static targets = ['calendar', 'calendarControl', 'periodControls', 'updateButton', 'periodOrRange']\n\n static values = {\n periodNum: Number,\n periodType: { type: String, default: 'hours' },\n startDate: String,\n endDate: String,\n }\n\n typeChanged(event) {\n this.calendarControlTarget.classList.toggle('is-hidden')\n this.periodControlsTarget.classList.toggle('is-hidden')\n this.enableUpdateButton()\n }\n\n calendarTargetConnected(target) {\n // TODO: options should be configurable from UI\n const calendars = bulmaCalendar.attach(target, {\n dateFormat: 'dd/MM/yyyy',\n type: 'date',\n isRange: true,\n maxDate: new Date(),\n showTodayButton: false,\n showClearButton: false,\n showFooter: false,\n })\n\n this.calendar = calendars[0]\n\n this.calendar.on('save', this.onRangeChanged.bind(this))\n }\n\n disconnect() {\n if (!this.calendar) return\n\n this.calendar.off('save', this.onRangeChanged.bind(this))\n this.calendar.destroy()\n }\n\n onPeriodNumChanged(event) {\n this.periodNumValue = Number(event.target.value) || 0\n this.enableUpdateButton()\n }\n\n onPeriodTypeChanged(event) {\n this.periodTypeValue = event.target.value\n }\n\n disableUpdateButton() {\n this.updateButtonTarget.setAttribute('disabled', 'true')\n }\n\n enableUpdateButton() {\n this.updateButtonTarget.removeAttribute('disabled')\n }\n\n onUpdateButtonClick() {\n this.disableUpdateButton()\n const content = {}\n if (this.periodOrRangeTarget.options.selectedIndex) {\n content['start'] = this.startDateValue\n content['end'] = this.endDateValue\n } else {\n content['periodNum'] = this.periodNumValue\n content['periodType'] = this.periodTypeValue\n }\n this.dispatch('change', { detail: { content: content } })\n }\n\n onRangeChanged(event) {\n this.startDateValue = event.data.date.start?.toLocaleDateString('sv')\n this.endDateValue = event.data.date.end?.toLocaleDateString('sv')\n\n this.enableUpdateButton()\n }\n}\n","import DeviceControlController from './device_control_controller'\n\nexport default class extends DeviceControlController {}\n","import { Controller } from '@hotwired/stimulus'\nimport Chartkick from 'chartkick'\nimport { processAlignMinOption, updateRangeParamsInURL } from '../javascript/chartkick-utils.js'\n\nexport default class extends Controller {\n static targets = ['chart', 'dateRange']\n static values = {\n reportUrl: String,\n lazyLoad: Boolean,\n }\n\n charts = []\n initialized = false\n\n async connect() {\n if (this.reportUrlValue && !this.lazyLoadValue) {\n await this.initReport()\n }\n }\n\n async initReport() {\n if (this.initialized) return\n\n this.initialized = true\n\n for (const chart of this.charts) {\n chart.element.innerHTML = chart.options.loading\n }\n\n const reportData = await this.fetchReportData()\n\n for (const chart of this.charts) {\n if (reportData.error) {\n this.setChartError(chart, reportData.error)\n } else {\n chart.updateData(reportData.filter((data) => data.chart === chart.element.id))\n processAlignMinOption(chart.chart)\n }\n }\n\n this.dispatch('loadingComplete')\n }\n\n setChartError(chart, message) {\n message = 'Error Loading Chart: ' + message\n chart.element.innerHTML = message\n chart.element.style.color = '#ff0000'\n }\n\n chartTargetConnected(target) {\n const data = target.dataset.data == 'report' ? null : target.dataset.data\n\n const chart = new Chartkick[target.dataset.type](target, data, JSON.parse(target.dataset.options))\n\n if (data === null) {\n chart.element.innerHTML = chart.options.loading\n }\n\n this.charts.push(chart)\n }\n\n fetchReportData() {\n return fetch(this.reportUrlValue).then((response) => {\n if (response.ok) {\n return response.json()\n }\n\n return { error: response.statusText }\n })\n }\n\n async onRangeChange({ detail: { content } }) {\n if (this.reportUrlValue) {\n this.initialized = false\n this.reportUrlValue = updateRangeParamsInURL(this.reportUrlValue, content)\n return this.initReport()\n }\n\n for (const chart of this.charts) {\n const dataSource = chart.getDataSource()\n\n if (typeof dataSource !== 'string') return\n\n chart.updateData(updateRangeParamsInURL(dataSource, content))\n processAlignMinOption(chart.chart)\n }\n }\n\n async onTabChange(event) {\n if (this.lazyLoadValue && event.detail.tab === event.params.tab) {\n await this.initReport()\n }\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport '../packs/highcharts.js'\nimport { toDate, toFloat, processAlignMinOption, updateRangeParamsInURL } from '../javascript/chartkick-utils.js'\n\nexport default class extends Controller {\n static targets = ['dashboard', 'dateRange']\n static values = {\n reportUrl: String,\n options: String,\n lazyLoad: Boolean,\n }\n\n dashboard = null\n initialized = false\n\n async connect() {\n for (const title of document.getElementsByClassName('highcharts-group-title')) {\n title.parentNode.parentNode.classList.add('no-shadow')\n }\n\n if (this.reportUrlValue && !this.lazyLoadValue) {\n await this.initReport()\n }\n }\n\n async initReport() {\n if (this.initialized) return\n\n this.initialized = true\n\n this.setLoading()\n\n const reportData = await this.fetchReportData()\n if (reportData.error) {\n console.error(reportData.error)\n this.setError()\n this.dispatch('loadingComplete')\n return\n }\n\n if (!reportData.data) {\n console.error('No data found in the report')\n return\n }\n\n if (reportData.dashboard_structure) {\n this.setStructure(this.dashboardTarget, reportData.dashboard_structure)\n }\n\n for (const { component } of this.dashboard.mountedComponents) {\n const componentData = reportData.data[component.id]\n\n if (component.type === 'KPI') {\n component.update({ value: toFloat(componentData) })\n } else if (component.type !== 'HTML') {\n const chart = component.chart\n while (chart.series.length) {\n chart.series[0].remove()\n }\n this.setChartData(chart, componentData)\n }\n }\n\n this.dispatch('loadingComplete')\n }\n\n async onRangeChange({ detail: { content } }) {\n if (this.reportUrlValue) {\n this.initialized = false\n this.reportUrlValue = updateRangeParamsInURL(this.reportUrlValue, content)\n return this.initReport()\n }\n }\n\n setError() {\n const loadingContainer = document.createElement('div')\n loadingContainer.classList.add('highcharts-placeholder')\n loadingContainer.classList.add('highcharts-error')\n\n const loadingEl = document.createElement('span')\n loadingEl.innerHTML = 'Something went wrong. Please try again later.'\n\n loadingContainer.appendChild(loadingEl)\n this.dashboardTarget.replaceChildren(loadingContainer)\n }\n\n setLoading() {\n if (!this.dashboard) {\n const loadingContainer = document.createElement('div')\n loadingContainer.classList.add('highcharts-placeholder')\n\n const loadingEl = document.createElement('span')\n loadingEl.classList.add('highcharts-loading-inner')\n loadingEl.innerHTML = 'Loading...'\n\n loadingContainer.appendChild(loadingEl)\n this.dashboardTarget.replaceChildren(loadingContainer)\n return\n }\n\n for (const { component } of this.dashboard.mountedComponents) {\n if (component.chart) {\n while (component.chart.series.length) {\n component.chart.series[0].remove()\n }\n component.chart.showLoading()\n } else if (component.type === 'KPI') {\n const loadingContainer = document.createElement('div')\n loadingContainer.classList.add('highcharts-loading')\n loadingContainer.style.position = 'absolute'\n loadingContainer.style.top = '50%'\n loadingContainer.style.left = '50%'\n loadingContainer.style.transform = 'translate(-50%, -50%)'\n loadingContainer.style.fontSize = '1rem'\n\n const loadingEl = document.createElement('span')\n loadingEl.classList.add('highcharts-loading-inner')\n loadingEl.innerHTML = 'Loading...'\n\n loadingContainer.appendChild(loadingEl)\n component.element.replaceChildren(loadingContainer)\n }\n }\n }\n\n setChartData(chart, data) {\n for (const serie of data) {\n if (chart.userOptions.chart.type === 'line' || chart.userOptions.chart.type === 'column') {\n serie.data = Object.entries(serie.data).map((d) => [toDate(d[0]).getTime(), toFloat(d[1])])\n }\n\n if (chart.userOptions.chart.type === 'line') {\n serie.marker ??= { symbol: 'circle', enabled: false }\n }\n\n chart.addSeries(serie)\n processAlignMinOption(chart)\n }\n\n chart.hideLoading()\n }\n\n setStructure(target, options) {\n if (this.dashboard) {\n this.dashboard.destroy()\n }\n const dashboard = Dashboards.board(target, options)\n this.dashboard = dashboard\n }\n\n dashboardTargetConnected(target) {\n if (!this.optionsValue) return\n this.setStructure(target, JSON.parse(this.optionsValue))\n }\n\n fetchReportData() {\n return fetch(this.reportUrlValue).then((response) => {\n if (response.ok) {\n return response.json()\n }\n\n return { error: response.statusText }\n })\n }\n\n async onTabChange(event) {\n if (event.detail.tab !== event.params.tab) return\n\n if (this.lazyLoadValue) {\n await this.initReport()\n }\n\n if (!this.dashboard) return\n\n this.dashboard.mountedComponents.forEach(({ component }) => {\n if (component.type === 'KPI') {\n component.resize()\n }\n })\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport { numberToHuman } from '../../javascript/utils'\nimport { showNotification } from '../../javascript/flash-notifications'\n\nexport default class extends Controller {\n static targets = [\n 'tableSection',\n 'applianceTemplate',\n 'prospect',\n 'appliances',\n 'review',\n 'next',\n 'back',\n 'publish',\n 'preview',\n 'potentialLoad',\n 'loadPerDay',\n 'steps',\n 'proposalPreview',\n 'proposalPreviewLoader',\n ]\n\n static values = {\n proposalId: String,\n }\n\n tableSectionTargetConnected() {\n this.selectedAppliances().forEach((row) => {\n const applianceId = row.querySelector('input[name*=\"[appliance_id]\"]').value\n const tile = this.element.querySelector(`[data-appliance-id=\"${applianceId}\"]`)\n\n if (tile) tile.classList.add('is-active')\n })\n\n this.tableSectionTarget.classList.toggle('is-hidden', !this.selectedAppliances().length)\n\n this.calculatePreview()\n }\n\n nextTargetConnected() {\n this.nextTarget.disabled = false\n\n if (!this.isFirstTab()) {\n this.switchToAppliances()\n }\n }\n\n selectAppliance(event) {\n let appliance = event.target.dataset.appliance\n\n if (!appliance) return\n\n appliance = JSON.parse(event.target.dataset.appliance)\n const applianceId = appliance['id']\n\n const applianceRow = this.tableSectionTarget.querySelector(\n `tbody tr input[name*=\"[appliance_id]\"][value=\"${applianceId}\"]`\n )\n\n if (applianceRow) {\n const row = applianceRow.closest('tr')\n\n // re-add previously removed appliance\n if (row.classList.contains('is-hidden')) {\n event.target.classList.add('is-active')\n\n row.querySelector('input[name*=\"_destroy\"]').value = 0\n row.querySelector('input[name*=\"[hours_per_day]\"]').value = appliance['hours_per_day']\n row.querySelector('input[name*=\"[quantity]\"]').value = 1\n row.parentNode.appendChild(row)\n row.classList.remove('is-hidden')\n } else {\n event.target.classList.remove('is-active')\n\n // if persisted appliance, mark for deletion\n if (row.querySelector(\"input[name*='[id]'][value]\")) {\n row.querySelector('input[name*=\"_destroy\"]').value = 1\n row.classList.add('is-hidden')\n } else {\n row.remove()\n }\n }\n } else {\n event.target.classList.add('is-active')\n\n const content = this.applianceTemplateTarget.innerHTML\n .replace(/NEW_RECORD/g, this.tableSectionTarget.querySelectorAll('tbody tr').length)\n .replace(/NAME/g, appliance['name'])\n .replace(/SUGGESTED_POWER/g, appliance['power_text'])\n\n // Create a temporary container for the content\n const tmp = document.createElement('tr')\n tmp.innerHTML = content\n\n tmp.querySelector('input[name*=\"[power]\"]').value = appliance['power']\n tmp.querySelector('input[name*=\"[appliance_id]\"]').value = appliance['id']\n tmp.querySelector('input[name*=\"[hours_per_day]\"]').value = appliance['hours_per_day']\n tmp.querySelector('input[name*=\"[quantity]\"]').value = 1\n\n this.tableSectionTarget.querySelector('tbody').appendChild(tmp)\n }\n\n this.tableSectionTarget.classList.toggle('is-hidden', !this.selectedAppliances().length)\n\n this.calculatePreview()\n }\n\n selectedAppliances() {\n return this.tableSectionTarget.querySelectorAll('tbody tr:not(.is-hidden)')\n }\n\n calculatePreview() {\n const selectedAppliances = this.selectedAppliances()\n\n if (!selectedAppliances.length) {\n this.previewTarget.classList.add('is-hidden')\n return\n }\n\n this.previewTarget.classList.remove('is-hidden')\n\n let potentialLoad = 0\n let loadPerDay = 0\n\n selectedAppliances.forEach((row) => {\n const power = parseFloat(row.querySelector('input[name*=\"[power]\"]').value) || 0\n const quantity = parseFloat(row.querySelector('input[name*=\"[quantity]\"]').value) || 0\n const hours = parseFloat(row.querySelector('input[name*=\"[hours_per_day]\"]').value) || 0\n\n potentialLoad += power * quantity\n loadPerDay += power * quantity * hours\n })\n\n this.potentialLoadTarget.textContent = numberToHuman(potentialLoad, 'W')\n this.loadPerDayTarget.textContent = numberToHuman(loadPerDay, 'Wh')\n }\n\n onProspectSelect(e) {\n const res = e.detail\n const prospect = res.obj\n\n this.element.querySelector('[name=\"crm_proposal[prospect_attributes][first_name]\"]').value = prospect.first_name\n this.element.querySelector('[name=\"crm_proposal[prospect_attributes][last_name]\"]').value = prospect.last_name\n this.element.querySelector('[name=\"crm_proposal[prospect_attributes][email]\"]').value = prospect.email\n this.element.querySelector('[name=\"crm_proposal[prospect_attributes][phone]\"]').value = prospect.phone\n this.element.querySelector('[name=\"crm_proposal[prospect_attributes][address]\"]').value = prospect.address\n }\n\n isFirstTab() {\n return !this.prospectTarget.classList.contains('is-hidden')\n }\n\n isSecondTab() {\n return !this.appliancesTarget.classList.contains('is-hidden')\n }\n\n switchToProspect() {\n this.element.classList.remove('is-9')\n this.element.classList.add('is-6')\n\n this.appliancesTarget.classList.add('is-hidden')\n this.reviewTarget.classList.add('is-hidden')\n this.prospectTarget.classList.remove('is-hidden')\n\n // inputs are disabled to prevent validation of hidden inputs\n this.appliancesTarget.querySelectorAll('input, select').forEach((input) => {\n input.disabled = true\n })\n\n this.stepsTarget.querySelectorAll('.step-item').forEach((step, i) => {\n step.classList.toggle('is-active', i === 0)\n step.classList.remove('is-completed')\n })\n }\n\n switchToAppliances() {\n this.element.classList.remove('is-6')\n this.element.classList.add('is-9')\n this.prospectTarget.classList.add('is-hidden')\n this.appliancesTarget.classList.remove('is-hidden')\n this.reviewTarget.classList.add('is-hidden')\n\n this.backTarget.textContent = 'Back'\n\n // inputs are disabled to prevent validation of hidden inputs\n this.appliancesTarget.querySelectorAll('input, select').forEach((input) => {\n input.disabled = false\n })\n\n this.stepsTarget.querySelectorAll('.step-item').forEach((step, i) => {\n step.classList.toggle('is-active', i === 1)\n step.classList.toggle('is-completed', i === 0)\n })\n\n this.publishTarget.classList.add('is-hidden')\n this.publishTarget.disabled = true\n }\n\n async switchToReview() {\n this.appliancesTarget.classList.add('is-hidden')\n this.reviewTarget.classList.remove('is-hidden')\n\n this.nextTarget.value = 'Save as draft'\n this.backTarget.textContent = 'Back'\n\n // inputs are disabled to prevent validation of hidden inputs\n this.reviewTarget.querySelectorAll('input').forEach((input) => {\n input.disabled = false\n })\n\n this.stepsTarget.querySelectorAll('.step-item').forEach((step, i) => {\n step.classList.toggle('is-active', i === 2)\n step.classList.toggle('is-completed', i < 2)\n })\n\n this.publishTarget.classList.remove('is-hidden')\n this.publishTarget.disabled = false\n\n await this.loadPreview()\n }\n\n async onNext(e) {\n if (this.isFirstTab()) {\n e.preventDefault()\n\n const valid = this.element.querySelector('form').reportValidity()\n\n if (!valid) return\n\n this.switchToAppliances()\n } else if (this.isSecondTab()) {\n e.preventDefault()\n\n const valid = this.element.querySelector('form').reportValidity()\n\n if (!valid) return\n\n const selectedAppliances = this.selectedAppliances()\n\n if (!selectedAppliances.length) {\n showNotification({ type: 'error', message: 'Please select at least one appliance' })\n return\n }\n\n await this.switchToReview()\n }\n }\n\n onBack(e) {\n if (this.isFirstTab()) return\n\n e.preventDefault()\n\n e.target.textContent = 'Cancel'\n\n this.nextTarget.value = 'Next'\n\n if (this.isSecondTab()) {\n this.switchToProspect()\n } else {\n this.switchToAppliances()\n }\n }\n\n async loadPreview() {\n this.proposalPreviewTarget.innerHTML = null\n this.proposalPreviewTarget.classList.add('is-hidden')\n this.proposalPreviewLoaderTarget.classList.remove('is-hidden')\n\n const formData = new FormData(this.element.querySelector('form'))\n\n formData.set('proposal_id', this.proposalIdValue)\n formData.delete('_method')\n\n const response = await fetch(`/crm/proposals/preview`, {\n method: 'POST',\n credentials: 'same-origin',\n body: formData,\n }).then((res) => res.text())\n\n this.proposalPreviewLoaderTarget.classList.add('is-hidden')\n this.proposalPreviewTarget.classList.remove('is-hidden')\n this.proposalPreviewTarget.innerHTML = response\n }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['form']\n\n isLoading = false\n\n search(e) {\n e.preventDefault()\n\n clearTimeout(this.timeout)\n this.timeout = setTimeout(() => {\n this.requestSubmit()\n }, 500)\n }\n\n requestSubmit() {\n this.formTarget.requestSubmit()\n }\n\n setLoading(e) {\n this.isLoading = !this.isLoading\n\n this.element.querySelector('.fa-spin').classList.toggle('is-hidden', !this.isLoading)\n this.element.querySelector('.fa-search').classList.toggle('is-hidden', this.isLoading)\n }\n}\n","import BulmaheadController from '../bulmahead_controller'\n\nexport default class extends BulmaheadController {\n api(query) {\n return fetch(`/crm/prospects/search?query=${query}&limit=10`, {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n credentials: 'same-origin',\n })\n .then(function (prospects) {\n return prospects.json()\n })\n .then(function (prospects) {\n return prospects.map(function (prospect) {\n return { label: `${prospect.first_name} ${prospect.last_name}`, value: prospect.id, obj: prospect }\n })\n })\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport { showNotification } from '../javascript/flash-notifications'\n\nexport default class extends Controller {\n static targets = [\n 'error',\n 'loader',\n 'unreachable',\n 'form',\n 'lockStatus',\n 'lockForm',\n 'unlockForm',\n 'refetchButton',\n 'operatingTime',\n ]\n\n static values = {\n serialNumber: String,\n state: String,\n status: String,\n operatingTime: String,\n }\n\n connect() {\n this.fetchStatus()\n }\n\n disconnect() {\n if (this.statusFetchTimer) {\n clearTimeout(this.statusFetchTimer)\n }\n }\n\n toggleFormDisabled(disabled = true) {\n this.element.querySelectorAll('input, a, button').forEach((el) => {\n if (disabled) el.setAttribute('disabled', 'disabled')\n else el.removeAttribute('disabled')\n el.classList.toggle('is-disabled', disabled)\n })\n }\n\n beforeSend({ target }) {\n this.toggleFormDisabled()\n\n let buttonTarget = target\n\n if (buttonTarget.tagName === 'FORM') {\n buttonTarget = buttonTarget.querySelector('button[type=\"submit\"]')\n }\n\n if (!buttonTarget) {\n console.error('Button target not found')\n return\n }\n\n buttonTarget.dataset.originalText = buttonTarget.textContent\n buttonTarget.textContent = 'In progress...'\n\n this.errorTarget.textContent = ''\n this.errorTarget.classList.add('is-hidden')\n }\n\n afterSend({ target }) {\n this.toggleFormDisabled(false)\n\n let buttonTarget = target\n\n if (buttonTarget.tagName === 'FORM') {\n buttonTarget = buttonTarget.querySelector('button[type=\"submit\"]')\n }\n\n if (!buttonTarget) {\n console.error('Button target not found')\n return\n }\n\n buttonTarget.removeAttribute('disabled')\n buttonTarget.classList.remove('is-disabled')\n\n buttonTarget.textContent = buttonTarget.dataset.originalText\n }\n\n onSendError(e) {\n const [data, ,] = e.detail\n\n if (data.response || data.error) {\n this.errorTarget.textContent = data.response || data.error\n this.errorTarget.classList.remove('is-hidden')\n }\n }\n\n onSendSuccess({ detail }) {\n const message = this.statusValue === 'locked' ? 'System successfully unlocked' : 'System successfully locked'\n\n showNotification({ type: 'success', message })\n\n const [, , xhr] = detail\n const result = JSON.parse(xhr.response)\n\n this.stateValue = 'idle'\n this.statusValue = result.lock_status\n this.operatingTimeValue = result.operating_time\n }\n\n async fetchStatus() {\n this.stateValue = 'loading'\n this.statusValue = undefined\n this.operatingTimeValue = undefined\n\n try {\n const res = await fetch(`/systems/${this.serialNumberValue}/fetch_lock_status`)\n const result = await res.json()\n\n if (!res.ok) {\n const error = result.error ? result.error.replaceAll('\\n', '
') : 'Unknown error'\n throw new Error(error)\n }\n\n this.stateValue = 'idle'\n this.statusValue = result.lock_status\n this.operatingTimeValue = result.operating_time\n } catch (err) {\n console.error(err)\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML = err.message\n this.stateValue = 'unreachable'\n }\n\n this.statusFetchTimer = setTimeout(() => {\n if (this.stateValue !== 'loading') return\n\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML =\n this.unreachableTarget.querySelector('.unreachable-title').dataset.defaultMessage\n this.stateValue = 'unreachable'\n }, 30000)\n }\n\n stateValueChanged() {\n switch (this.stateValue) {\n case 'loading':\n this.loaderTarget.classList.remove('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n this.refetchButtonTarget.classList.add('is-hidden')\n this.formTarget.classList.add('is-hidden')\n break\n case 'unreachable':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.remove('is-hidden')\n this.refetchButtonTarget.classList.remove('is-hidden')\n this.formTarget.classList.add('is-hidden')\n break\n case 'idle':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n this.formTarget.classList.remove('is-hidden')\n break\n case 'updating':\n this.errorTarget.classList.add('is-hidden')\n this.refetchButtonTarget.classList.add('is-hidden')\n break\n }\n }\n\n statusValueChanged() {\n switch (this.statusValue) {\n case 'locked':\n this.refetchButtonTarget.classList.add('is-hidden')\n this.lockStatusTarget.innerHTML = 'Locked'\n this.lockStatusTarget.classList.remove('has-text-success')\n this.lockStatusTarget.classList.add('has-text-danger')\n this.lockFormTarget.classList.add('is-hidden')\n this.unlockFormTarget.classList.remove('is-hidden')\n this.operatingTimeTarget.classList.add('is-hidden')\n break\n case 'unknown':\n this.refetchButtonTarget.classList.remove('is-hidden')\n this.lockStatusTarget.innerHTML = 'Unknown'\n this.lockStatusTarget.classList.remove('has-text-danger')\n this.lockStatusTarget.classList.remove('has-text-success')\n this.lockFormTarget.classList.add('is-hidden')\n this.unlockFormTarget.classList.add('is-hidden')\n this.operatingTimeTarget.classList.add('is-hidden')\n break\n case 'temporarily_unlocked':\n this.refetchButtonTarget.classList.add('is-hidden')\n this.lockStatusTarget.innerHTML = 'Unlocked'\n this.lockStatusTarget.classList.remove('has-text-danger')\n this.lockStatusTarget.classList.add('has-text-success')\n this.lockFormTarget.classList.remove('is-hidden')\n this.unlockFormTarget.classList.add('is-hidden')\n this.operatingTimeTarget.classList.remove('is-hidden')\n break\n case 'permanently_unlocked':\n this.refetchButtonTarget.classList.add('is-hidden')\n this.lockStatusTarget.innerHTML = 'Unlocked'\n this.lockStatusTarget.classList.remove('has-text-danger')\n this.lockStatusTarget.classList.add('has-text-success')\n this.lockFormTarget.classList.remove('is-hidden')\n this.unlockFormTarget.classList.add('is-hidden')\n this.operatingTimeTarget.classList.add('is-hidden')\n break\n }\n }\n\n operatingTimeValueChanged() {\n if (this.statusValue === 'locked' || this.statusValue === 'unknown') return\n\n if (this.operatingTimeValue) {\n this.operatingTimeTarget.querySelector('strong').innerHTML = this.operatingTimeValue\n }\n }\n}\n","import DeviceControlController from './device_control_controller'\n\nexport default class extends DeviceControlController {}\n","import { Controller } from '@hotwired/stimulus'\nimport { fetchSystemStatus } from '../javascript/systems'\n\nexport default class extends Controller {\n static values = {\n serialNumber: String,\n state: String,\n systemState: Object,\n }\n\n static targets = ['loader', 'unreachable', 'form']\n\n connect() {\n if (this.stateValue === 'loading') this.fetchStatus()\n }\n\n disconnect() {\n if (this.gridControlModalTimer) {\n clearTimeout(this.gridControlModalTimer)\n }\n }\n\n async fetchStatus() {\n await fetchSystemStatus('systems', this.serialNumberValue)\n\n this.gridControlModalTimer = setTimeout(() => {\n if (this.stateValue !== 'loading') return\n\n this.loaderTarget.classList.add('is-hidden')\n\n this.stateValue = 'unreachable'\n this.unreachableTarget.classList.remove('is-hidden')\n }, 60000)\n }\n\n beforePortSend(e) {\n this.loaderTarget.classList.remove('is-hidden')\n this.formTarget.remove()\n\n this.loaderTarget.querySelector('strong').textContent =\n e.target.textContent == 'Open port' ? 'Opening port...' : 'Closing port...'\n }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['form', 'list', 'map']\n\n openList() {\n this.listTarget.classList.remove('is-hidden')\n this.mapTarget.classList.add('is-hidden')\n }\n\n buttonClick(e) {\n Array.from(e.target.parentNode.children).forEach((button) => {\n button.classList.remove('is-primary')\n })\n e.target.classList.add('is-primary')\n const socInput = document.querySelector('input[name=\"soc\"]')\n const value = e.target.getAttribute('value')\n if (value) {\n socInput.setAttribute('value', value)\n } else {\n socInput.removeAttribute('value')\n }\n }\n\n search() {\n clearTimeout(this.timeout)\n this.timeout = setTimeout(() => {\n this.requestSubmit()\n }, 500)\n }\n\n requestSubmit() {\n this.formTarget.requestSubmit()\n }\n}\n","// https://github.com/stimulus-components/stimulus-rails-nested-form/blob/master/src/index.ts\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static values = {\n max: Number,\n }\n static targets = ['target', 'template', 'add']\n\n formsCount() {\n return this.element.querySelectorAll('.nested-form-wrapper').length\n }\n\n add(e) {\n e.preventDefault()\n\n const content = this.templateTarget.innerHTML.replace(/NEW_RECORD/g, this.formsCount())\n this.targetTarget.insertAdjacentHTML('beforebegin', content)\n this.targetTarget.previousElementSibling.querySelector('input').focus()\n\n this.toggleAddButton()\n }\n\n remove(e) {\n e.preventDefault()\n\n const wrapper = e.target.closest('.nested-form-wrapper')\n\n if (!wrapper.dataset.newRecord || wrapper.dataset.newRecord === 'true') {\n wrapper.remove()\n } else {\n wrapper.style.display = 'none'\n\n const input = wrapper.querySelector(\"input[name*='_destroy']\")\n if (input) input.value = '1'\n\n wrapper.querySelectorAll('input, select').forEach((input) => {\n if (input.name.match(/_destroy/) || input.name.match(/\\[id\\]/)) return\n\n input.disabled = true\n })\n }\n\n this.toggleAddButton()\n }\n\n toggleAddButton() {\n if (this.hasMaxValue) {\n this.addTarget.classList.toggle('is-hidden', this.formsCount() >= this.maxValue)\n }\n }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['noData', 'item']\n\n itemTargetConnected() {\n this.noDataTarget.remove()\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport { fetchSystemStatus } from '../javascript/systems'\n\nexport default class extends Controller {\n static values = {\n model: String,\n identifier: String,\n }\n static targets = ['loader', 'lastFetched', 'btn']\n static classes = ['loading']\n\n TIMEOUT = 30000\n\n oldLastFetched\n\n refresh(e) {\n e.preventDefault()\n\n e.stopPropagation()\n\n this.toggleUI()\n\n fetchSystemStatus('systems', this.identifierValue)\n .then(() => {\n if (typeof this.oldLastFetched !== 'undefined') {\n this.lastFetchedTarget.innerHTML = this.oldLastFetched\n } else {\n this.oldLastFetched = this.lastFetchedTarget.innerHTML\n }\n\n setTimeout(() => {\n this.toggleUI()\n this.lastFetchedTarget.innerText = `No response in ${this.TIMEOUT / 1000} seconds`\n delete this.lastFetchedTarget.dataset['timeFormatTarget']\n }, this.TIMEOUT)\n })\n .catch(() => {\n this.toggleUI()\n this.lastFetchedTarget.innerText = 'Error fetching status'\n delete this.lastFetchedTarget.dataset['timeFormatTarget']\n })\n }\n\n toggleUI() {\n this.btnTarget.classList.toggle('is-hidden')\n this.loaderTarget.classList.toggle('is-hidden')\n this.lastFetchedTarget.classList.toggle('is-hidden')\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport { fetchSystemStatus } from '../javascript/systems'\n\nexport default class extends Controller {\n static values = {\n model: String,\n identifier: String,\n refetchOnMount: Boolean,\n }\n static targets = ['loader', 'lastFetched']\n static classes = ['loading']\n\n TIMEOUT = 30000\n\n oldLastFetched\n disabled = false\n\n refresh(e) {\n e.preventDefault()\n\n e.stopPropagation()\n\n if (this.disabled) return\n\n this.disabled = true\n\n this.toggleUI()\n\n fetchSystemStatus(this.modelValue, this.identifierValue)\n .then(() => {\n if (typeof this.oldLastFetched !== 'undefined') {\n this.lastFetchedTarget.innerHTML = this.oldLastFetched\n } else {\n this.oldLastFetched = this.lastFetchedTarget.innerHTML\n }\n\n setTimeout(() => {\n this.toggleUI()\n this.lastFetchedTarget.innerText = `No response in ${this.TIMEOUT / 1000} seconds`\n delete this.lastFetchedTarget.dataset['timeFormatTarget']\n this.disabled = false\n }, this.TIMEOUT)\n })\n .catch(() => {\n this.toggleUI()\n this.lastFetchedTarget.innerText = 'Error fetching status'\n delete this.lastFetchedTarget.dataset['timeFormatTarget']\n this.disabled = false\n })\n }\n\n toggleUI() {\n if (this.loadingClass) this.loaderTarget.classList.toggle(this.loadingClass)\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport { showNotification } from '../javascript/flash-notifications'\n\n// this controller is used to provide ability to share links using native browser share dialog\n// link to share is passed to the dialog as title and url\nexport default class extends Controller {\n // it uses stimulus parameters passed to the share button action\n share(event) {\n if (navigator.share) {\n event.preventDefault()\n\n const shareData = {\n title: event.params.title,\n url: event.params.url,\n }\n\n navigator.share(shareData)\n } else if (navigator.clipboard) {\n event.preventDefault()\n\n navigator.clipboard.writeText(event.params.url)\n\n showNotification({\n type: 'success',\n message: 'Link copied to clipboard',\n duration: 2000,\n })\n } else {\n // redirect to share url\n if (event.target.tagName !== 'A') window.location.href = event.params.url\n }\n }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n hiddenClass = 'is-hidden'\n product\n phase\n\n static targets = [\n 'productSelector',\n 'phaseSelector',\n 'devicesForm',\n 'batteriesForm',\n 'batteryFields',\n 'serialNumber',\n 'addDeviceBtn',\n 'addBatteryBtn',\n 'installationPhase',\n 'devicePhase',\n 'edgeFields',\n 'removeDeviceBtn',\n 'batteryLabels',\n ]\n\n MAX_BATTERIES = 10\n\n isEdge() {\n return this.product === 'edge'\n }\n\n threePhase() {\n return this.phase === '3'\n }\n\n changeProduct(e) {\n this.product = e.target.value\n this.phase = undefined\n\n this.devicesFormTarget.querySelectorAll('input').forEach((input) => {\n input.value = ''\n input.checked = false\n input.classList.remove('is-danger')\n })\n\n this.batteriesFormTarget.querySelectorAll('input').forEach((input) => {\n input.value = ''\n })\n\n this.devicesFormTarget.querySelectorAll('.help').forEach((errors) => {\n errors.remove()\n })\n\n this.devicesFormTarget.querySelectorAll('.nested-form-wrapper ~ .nested-form-wrapper').forEach((field) => {\n field.remove()\n })\n\n this.batteriesFormTarget.querySelectorAll('.nested-form-wrapper ~ .nested-form-wrapper').forEach((field) => {\n field.remove()\n })\n\n this.toggleEdgeFields()\n this.toggleDevicePhases()\n this.toggleSerialNumber()\n }\n\n changePhase(e) {\n this.phase = e.target.value\n\n this.toggleDevicePhases()\n }\n\n productSelectorTargetConnected(element) {\n this.product = element.value\n }\n\n phaseSelectorTargetConnected(element) {\n if (element.checked) this.phase = element.value\n }\n\n devicePhaseTargetConnected(element) {\n this.toggleDevicePhase(element)\n }\n\n removeDeviceBtnTargetConnected(element) {\n if (element != this.removeDeviceBtnTargets[0]) {\n element.classList.remove(this.hiddenClass)\n }\n }\n\n toggleDevicePhases() {\n this.devicePhaseTargets.forEach((element) => this.toggleDevicePhase(element))\n }\n\n toggleDevicePhase(element) {\n const disabled = !this.threePhase()\n\n element.classList.toggle(this.hiddenClass, disabled)\n element.querySelectorAll('select').forEach((input) => {\n input.disabled = disabled\n input.classList.toggle('disabled', disabled)\n })\n }\n\n toggleSerialNumber() {\n const isEdge = this.isEdge()\n\n this.serialNumberTarget.classList.toggle(this.hiddenClass, isEdge)\n this.serialNumberTarget.querySelectorAll('input').forEach((input) => {\n if (input.name.includes('[id]')) return\n\n input.disabled = isEdge\n input.classList.toggle('disabled', isEdge)\n })\n }\n\n // TODO: dry following funcs\n toggleEdgeFields() {\n const isEdge = this.isEdge()\n\n this.toggleInstallationPhase(isEdge)\n\n this.edgeFieldsTargets.forEach((element) => {\n element.querySelectorAll('input, select').forEach((input) => {\n if (input.name.includes('[id]')) return\n\n input.disabled = !isEdge\n input.classList.toggle('disabled', !isEdge)\n })\n\n element.classList.toggle(this.hiddenClass, !isEdge)\n })\n\n this.devicesFormTarget.querySelectorAll('input').forEach((input) => {\n if (input.name.includes('[id]')) return\n\n input.disabled = !isEdge\n input.classList.toggle('disabled', !isEdge)\n })\n\n this.batteriesFormTarget.querySelectorAll('input').forEach((input) => {\n input.disabled = !isEdge\n input.classList.toggle('disabled', !isEdge)\n })\n\n this.devicesFormTarget.classList.toggle(this.hiddenClass, !isEdge)\n this.batteriesFormTarget.classList.toggle(this.hiddenClass, !isEdge)\n this.addDeviceBtnTarget.classList.toggle(this.hiddenClass, !isEdge)\n this.addBatteryBtnTarget.classList.toggle(this.hiddenClass, !isEdge)\n }\n\n toggleInstallationPhase(isEdge) {\n this.installationPhaseTarget.querySelectorAll('input').forEach((input) => {\n input.disabled = !isEdge\n input.classList.toggle('disabled', !isEdge)\n input.checked = input.value === '1'\n })\n this.installationPhaseTarget.classList.toggle(this.hiddenClass, !isEdge)\n }\n\n batteryFieldsTargetConnected() {\n this.batteryLabelsTarget.classList.remove(this.hiddenClass)\n\n if (this.batteryFieldsTargets.length >= this.MAX_BATTERIES) {\n this.addBatteryBtnTarget.classList.add(this.hiddenClass)\n }\n }\n\n batteryFieldsTargetDisconnected() {\n if (this.batteryFieldsTargets.length === 0) {\n this.batteryLabelsTarget.classList.add(this.hiddenClass)\n }\n }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static values = {\n serialNumber: String,\n state: String,\n }\n\n static targets = ['loader', 'unreachable', 'form', 'error', 'confirmModal', 'confirmButton', 'alohaStatus']\n\n enabled = false\n\n connect() {\n this.fetchSettings()\n }\n\n async fetchSettings() {\n this.stateValue = 'loading'\n\n try {\n const res = await fetch(`/systems/${this.serialNumberValue}/control/settings?settings_type=maintenance`)\n const result = await res.json()\n\n if (!res.ok) {\n throw new Error(result.response)\n }\n\n this.cacheSettings(result)\n\n this.stateValue = 'idle'\n } catch (err) {\n console.error(err)\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML = err.message\n const notSupported = err.message.includes('not supported by this system')\n this.unreachableTarget.querySelector('[data-tooltip-target]').classList.toggle('is-hidden', notSupported)\n this.stateValue = 'unreachable'\n }\n }\n\n cacheSettings(result) {\n if (result.settings_mismatch) {\n this.errorTarget.classList.remove('is-hidden')\n this.errorTarget.innerHTML = result.settings_mismatch\n }\n\n const { response } = result\n\n if (!response) {\n throw new Error('Unable to fetch settings')\n }\n\n const err = response.find((r) => r.error)\n\n if (err) {\n throw new Error(err)\n }\n\n if (response.length === 0) {\n throw new Error('Unable to fetch settings')\n }\n\n const settings = response[0].maintenanceSettings\n\n if (!settings) {\n throw new Error('Maintenance mode is not supported by this system')\n }\n\n this.enabled = settings.enabled\n\n this.alohaStatusTarget.classList.toggle('has-text-danger', settings.enabled)\n this.alohaStatusTarget.classList.toggle('has-text-success', !settings.enabled)\n\n this.confirmButtonTarget.classList.toggle('is-success', settings.enabled)\n this.confirmButtonTarget.classList.toggle('is-danger', !settings.enabled)\n\n if (settings.enabled) {\n this.alohaStatusTarget.textContent = 'OFF'\n\n this.confirmButtonTarget.textContent = 'Disable maintenance mode'\n\n this.confirmModalTarget.querySelectorAll('[data-disable]').forEach((el) => {\n el.dataset.enable = el.textContent\n el.textContent = el.dataset.disable\n })\n } else {\n this.alohaStatusTarget.textContent = 'ON'\n\n this.confirmButtonTarget.textContent = 'Enable maintenance mode'\n\n this.confirmModalTarget.querySelectorAll('[data-enable]').forEach((el) => {\n el.dataset.disable = el.textContent\n el.textContent = el.dataset.enable\n })\n }\n }\n\n stateValueChanged() {\n switch (this.stateValue) {\n case 'loading':\n this.loaderTarget.classList.remove('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n this.formTarget.classList.add('is-hidden')\n break\n case 'unreachable':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.remove('is-hidden')\n this.formTarget.classList.add('is-hidden')\n break\n case 'idle':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n this.formTarget.classList.remove('is-hidden')\n this.confirmButtonTarget.disabled = false\n break\n case 'updating':\n this.errorTarget.classList.add('is-hidden')\n this.confirmButtonTarget.textContent = 'Processing...'\n this.confirmButtonTarget.disabled = true\n break\n }\n }\n\n openConfirmModal() {\n this.confirmModalTarget.classList.add('is-active')\n }\n\n closeConfirmModal() {\n this.confirmModalTarget.classList.remove('is-active')\n }\n\n async confirm() {\n this.closeConfirmModal()\n\n this.stateValue = 'updating'\n\n try {\n const res = await fetch(`/systems/${this.serialNumberValue}/control/set_settings`, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content'),\n },\n body: JSON.stringify({ settings: 'maintenance', enabled: !this.enabled }),\n })\n\n if (!res.ok) {\n throw new Error(`Unable to ${this.enabled ? 'disable' : 'enable'} maintenance mode`)\n }\n\n const newSettings = await res.json()\n\n this.cacheSettings(newSettings)\n\n this.stateValue = 'idle'\n } catch (err) {\n console.error(err)\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML = err.message\n this.stateValue = 'unreachable'\n }\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport { formatDateTime } from '../../javascript/datetime'\n\nexport default class extends Controller {\n static values = {\n serialNumber: String,\n state: { type: String, default: 'initial' },\n product: String,\n }\n\n static targets = [\n 'loader',\n 'unreachable',\n 'error',\n 'success',\n 'details',\n 'updateDetails',\n 'currentVersion',\n 'ipAddress',\n 'desiredVersion',\n 'succeedAt',\n 'attemptedAt',\n 'failedAt',\n 'failureReason',\n 'form',\n 'progress',\n ]\n\n updateInProgress = false\n\n async connect() {\n await this.fetchFirmwareVersions()\n await this.fetchSystemDetails()\n\n if (this.updateInProgress) {\n this.startPolling()\n }\n }\n\n disconnect() {\n if (this.fetchTimeout) clearTimeout(this.fetchTimeout)\n if (this.fetchInterval) clearInterval(this.fetchInterval)\n }\n\n async fetchSystemDetails() {\n if (this.stateValue === 'loading') return\n\n this.stateValue = 'loading'\n\n try {\n const res = await fetch(`/systems/firmware/${this.serialNumberValue}/get_state`)\n const result = await res.json()\n\n if (!res.ok) {\n throw new Error(result.response)\n }\n\n this.currentVersionTarget.innerHTML = result.firmwareVersion?.semanticVersionNumber || 'N/A'\n this.ipAddressTarget.innerHTML = result.deviceAddress?.address || 'N/A'\n\n const desiredVersion = result.desiredFirmwareVersion?.semanticVersionNumber\n\n this.succeedAtTarget.classList.add('is-hidden')\n this.failedAtTarget.classList.add('is-hidden')\n this.failureReasonTarget.classList.add('is-hidden')\n\n const updateLog = result.deviceCommunicationSummaries\n .sort((a, b) => new Date(b.lastAttemptedAt) - new Date(a.lastAttemptedAt))\n .find((summary) => summary.type === 'UPDATE_FIRMWARE')\n\n if (!updateLog) {\n this.stateValue = 'idle'\n this.errorTarget.classList.remove('is-hidden')\n this.errorTarget.innerHTML = 'No update log found'\n this.progressTarget.classList.add('is-hidden')\n this.updateDetailsTarget.classList.add('is-hidden')\n return\n }\n\n const tz = document.querySelector('[data-time-format-timezone-value]')?.dataset?.timeFormatTimezoneValue\n\n const lastSucceededAt = new Date(updateLog.lastSucceededAt)\n const lastFailedAt = new Date(updateLog.lastFailedAt)\n const lastAttemptedAt = new Date(updateLog.lastAttemptedAt)\n\n if (lastSucceededAt > lastAttemptedAt) {\n this.succeedAtTarget.querySelector('strong').innerHTML = formatDateTime(updateLog.lastSucceededAt, tz)\n this.succeedAtTarget.classList.remove('is-hidden')\n } else if (lastFailedAt >= lastAttemptedAt) {\n this.failedAtTarget.querySelector('strong').innerHTML = formatDateTime(updateLog.lastFailedAt, tz)\n this.failedAtTarget.classList.remove('is-hidden')\n this.failureReasonTarget.querySelector('strong').innerHTML = updateLog.lastFailureReason\n this.failureReasonTarget.classList.remove('is-hidden')\n }\n\n this.progressTarget.classList.toggle('is-hidden', !desiredVersion)\n\n this.updateDetailsTarget.classList.toggle('is-hidden', !desiredVersion)\n\n if (desiredVersion) {\n // current attempt\n this.desiredVersionTarget.innerHTML = desiredVersion\n this.updateInProgress = true\n this.stateValue = 'idle'\n this.attemptedAtTarget.innerHTML = formatDateTime(updateLog.lastAttemptedAt, tz)\n this.startPolling()\n return\n }\n\n if (this.fetchInterval) clearInterval(this.fetchInterval)\n\n // failed or succeeded\n if (this.updateInProgress) {\n if (lastSucceededAt > lastFailedAt) {\n this.successTarget.classList.remove('is-hidden')\n this.successTarget.innerHTML = 'System was successfully updated'\n } else {\n this.errorTarget.classList.remove('is-hidden')\n this.errorTarget.innerHTML = 'System was not updated'\n }\n }\n\n this.updateInProgress = false\n\n this.stateValue = 'idle'\n } catch (err) {\n console.error(err)\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML = err.message\n this.stateValue = 'unreachable'\n }\n\n this.fetchTimeout = setTimeout(() => {\n if (this.stateValue !== 'loading') return\n\n this.unreachableTarget.querySelector('.unreachable-title').innerHTML =\n this.unreachableTarget.querySelector('.unreachable-title').dataset.defaultMessage\n this.stateValue = 'unreachable'\n }, 600)\n }\n\n async fetchFirmwareVersions() {\n try {\n const res = await fetch(`/systems/firmware/versions?product=${this.productValue}`)\n const result = await res.json()\n\n if (!res.ok) {\n throw new Error(result.response)\n }\n\n const stateData = result.map((version) => ({\n label: version.label,\n value: version.id,\n }))\n\n const newFirmwareVersions = stateData\n .sort((a, b) => {\n return a.label.localeCompare(b.label)\n })\n .slice(-2)\n\n const selectInput = this.formTarget.querySelector('select')\n\n newFirmwareVersions.forEach((version) => {\n const option = document.createElement('option')\n option.value = version.value\n option.text = version.label\n selectInput.appendChild(option)\n })\n } catch (err) {\n console.error(err)\n }\n }\n\n toggleFormDisable(disabled) {\n this.formTarget.querySelectorAll('select').forEach((input) => {\n input.disabled = disabled\n })\n\n this.toggleSubmitButton(disabled)\n }\n\n toggleSubmitButton(disabled) {\n const btn = this.formTarget.querySelector('button')\n\n btn.disabled = disabled\n }\n\n stateValueChanged() {\n switch (this.stateValue) {\n case 'initial':\n case 'loading':\n this.loaderTarget.classList.remove('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n this.detailsTarget.classList.add('is-hidden')\n break\n case 'unreachable':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.remove('is-hidden')\n this.detailsTarget.classList.add('is-hidden')\n break\n case 'idle':\n this.loaderTarget.classList.add('is-hidden')\n this.unreachableTarget.classList.add('is-hidden')\n this.detailsTarget.classList.remove('is-hidden')\n this.toggleSubmitButton()\n this.toggleFormDisable()\n this.formTarget.classList.toggle('is-hidden', this.updateInProgress)\n break\n case 'updating':\n this.errorTarget.classList.add('is-hidden')\n this.errorTarget.innerHTML = ''\n this.successTarget.classList.add('is-hidden')\n this.successTarget.innerHTML = ''\n this.toggleFormDisable(true)\n break\n }\n }\n\n updateFirmware(event) {\n event.preventDefault()\n\n this.stateValue = 'updating'\n\n const formData = new FormData(this.formTarget)\n const firmwareVersion = formData.get('version')\n\n fetch(`/systems/firmware/${this.serialNumberValue}`, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content'),\n },\n body: JSON.stringify({\n version_id: firmwareVersion,\n }),\n }).then((res) => {\n if (!res.ok) {\n res.json().then(({ error }) => {\n this.errorTarget.classList.remove('is-hidden')\n this.errorTarget.innerHTML = error\n\n this.stateValue = 'idle'\n })\n\n return\n }\n\n this.fetchSystemDetails()\n })\n }\n\n startPolling() {\n if (this.fetchInterval) return\n\n this.fetchInterval = setInterval(() => {\n this.fetchSystemDetails()\n }, 15000)\n }\n}\n","import { Controller } from '@hotwired/stimulus'\n\n// Connects to data-controller=\"tabs\"\n//\nexport default class extends Controller {\n static targets = ['btn', 'tab', 'currentTabText']\n static values = { currentTabIdx: Number }\n\n connect() {\n // then, show the default tab\n const selectedTab = this.tabTargets[0]\n selectedTab.classList.remove('is-hidden')\n\n // and activate the selected button\n const selectedBtn = this.btnTargets[0]\n selectedBtn.classList.add('is-active')\n }\n\n // add to your buttons: data-action=\"click->tabs#select\"\n select(event) {\n const selectedTab = this.tabTargets.find((t) => t.dataset['tabsTab'] == event.params.tab)\n\n if (!selectedTab) {\n console.error(\"Can't find tab\")\n return\n }\n\n this.tabTargets.map((x) => x.classList.add('is-hidden'))\n\n selectedTab.classList.remove('is-hidden')\n\n this.btnTargets.forEach((b) => {\n const link = b.tagName === 'A' ? b : b.querySelector('a')\n b.classList.toggle('is-active', link.dataset['tabsTabParam'] === event.params.tab)\n })\n\n if (this.hasCurrentTabTextTarget) this.currentTabTextTarget.textContent = event.target.textContent\n\n const trigger = new CustomEvent('tabs:change', { detail: { tab: event.params.tab } })\n window.dispatchEvent(trigger)\n }\n}\n","import { Controller } from '@hotwired/stimulus'\nimport { formatDateTime, formatDistanceToNow } from '../javascript/datetime'\n\nexport default class extends Controller {\n static targets = ['time', 'timeAgo']\n static values = {\n timezone: String,\n }\n\n REFRESH_AGO_INTERVAL = 10000\n\n connect() {\n if (this.timeAgoTargets.length > 0) {\n this.startRefreshingAgo()\n }\n }\n\n disconnect() {\n if (this.refreshTimer) {\n clearInterval(this.refreshTimer)\n }\n }\n\n timeTargetConnected(element) {\n element.innerHTML = formatDateTime(element.dataset.time, this.timezoneValue)\n }\n\n timeAgoTargetConnected(element) {\n this.setTimeAgo(element)\n }\n\n setTimeAgo(element) {\n element.innerHTML = formatDistanceToNow(element.dataset.timeAgo)\n }\n\n startRefreshingAgo() {\n this.refreshTimer = setInterval(() => {\n this.timeAgoTargets.forEach((element) => {\n this.setTimeAgo(element)\n })\n }, this.REFRESH_AGO_INTERVAL)\n }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['item']\n\n itemTargetConnected(element) {\n const list = [...this.element.children]\n const idx = list.indexOf(element)\n\n element.classList.toggle('is-first', idx === 0)\n element.classList.toggle('is-last', idx === list.length - 1)\n\n if (list.length > 1) {\n if (idx === 0) {\n list[1].classList.remove('is-first')\n } else if (idx === list.length - 1) {\n list[list.length - 2].classList.remove('is-last')\n }\n }\n }\n}\n","document.addEventListener('click', ({ target: el }) => {\n if (!el.classList.contains('navbar-burger')) return\n\n // Toggle the \"is-active\" class on both the \"navbar-burger\" and the \"navbar-menu\"\n el.classList.toggle('is-active')\n el.parentNode.classList.toggle('is-active')\n})\n\n// keeps track of whether user is pressing cmd/ctrl key\nlet cmdPressed = false\n\ndocument.addEventListener('keydown', (e) => {\n cmdPressed = e.ctrlKey || e.metaKey\n})\n\ndocument.addEventListener('keyup', function () {\n cmdPressed = false\n})\n\ndocument.addEventListener('click', ({ target }) => {\n if (target.tagName === 'A') return\n\n const el = target.dataset.href ? target : target.closest('[data-href]')\n\n if (!el || el.tagName === 'A') return\n\n if (cmdPressed) {\n window.open(el.dataset.href)\n } else {\n window.location = el.dataset.href\n }\n\n cmdPressed = false\n})\n","import { showNotification } from './flash-notifications'\n\ndocument.addEventListener('ajax:complete', ({ target, detail }) => {\n if (target.dataset.action !== 'resend_invitation') return\n\n const [data, status, xhr] = detail\n\n showNotification({\n type: data.error ? 'error' : 'notice',\n message: data.error || JSON.parse(data.responseText).notice,\n duration: 2000,\n })\n})\n","document.addEventListener('DOMContentLoaded', () => {\n if (typeof hj === 'function') hj('stateChange', window.location.href)\n})\n","document.addEventListener('input', (e) => {\n if (e.target.classList.contains('is-danger')) {\n e.target.classList.remove('is-danger')\n e.target.parentElement.querySelector('.help.is-danger')?.remove()\n }\n})\n\ndocument.addEventListener('DOMContentLoaded', () => {\n Array.from(document.querySelectorAll('input, textarea')).forEach((input) => {\n const parentField = input.closest('.field')\n\n if (!parentField) return\n\n const label = parentField.querySelector('label')\n const help = parentField.querySelector('.help')\n\n if (label) {\n input.addEventListener('focus', (e) => {\n label.classList.add('has-focus')\n })\n\n input.addEventListener('blur', (e) => {\n label.classList.remove('has-focus')\n })\n }\n\n if (help) {\n input.addEventListener('focus', (e) => {\n help.classList.add('has-focus')\n })\n\n input.addEventListener('blur', (e) => {\n help.classList.remove('has-focus')\n })\n }\n })\n})\n","document.addEventListener('DOMContentLoaded', () => {\n const editUserForm = document.querySelector('form.edit_user')\n\n if (!editUserForm) return\n\n document.addEventListener('change', (e) => {\n const el = e.target\n\n if (!el.classList.contains('is-checkradio') || el.value === 'feed') return\n\n const feedCheckbox = editUserForm.querySelector(`input.is-checkradio[name='${el.name}'][value='feed']`)\n\n if (el.checked) {\n feedCheckbox.checked = true\n }\n\n feedCheckbox.classList.toggle('is-disabled', el.checked)\n feedCheckbox.parentNode.dataset.tooltipTarget = el.checked ? 'tooltip' : ''\n })\n})\n","window.addEventListener('message', (event) => {\n const iframes = Array.from(document.querySelectorAll('[data-looker-src]'))\n const iframe = iframes.find((i) => i.contentWindow === event.source)\n\n if (iframe && event.origin === 'https://offgridelectric.eu.looker.com') {\n const { type, height } = JSON.parse(event.data) || {}\n\n if (type === 'page:changed') {\n const prevSibling = iframe.previousElementSibling\n if (prevSibling?.classList?.contains('loader')) prevSibling.remove()\n }\n\n if (type === 'page:properties:changed' && height) iframe.height = height\n }\n})\n","import { findElementWithParent } from './utils'\n\ndocument.addEventListener('click', (e) => {\n handleTableRowClick(e)\n\n const sorter = findElementWithParent(e, 'sorter')\n\n if (!sorter) return\n\n if (!sorter.dataset.direction) {\n sorter.dataset.direction = 'asc'\n } else if (sorter.dataset.direction === 'asc') {\n sorter.dataset.direction = 'desc'\n } else {\n delete sorter.dataset.direction\n }\n\n const url = new URL(window.location.href)\n const searchParams = url.searchParams\n\n if (!sorter.dataset.direction) {\n searchParams.delete('sort')\n searchParams.delete('direction')\n } else {\n searchParams.set('sort', sorter.dataset.sort)\n searchParams.set('direction', sorter.dataset.direction)\n }\n\n window.location = url.toString()\n})\n\nfunction handleTableRowClick(e) {\n const rowTarget = e.target.dataset.rowToggle\n\n if (!rowTarget) return\n\n e.preventDefault()\n\n const row = document.getElementById(rowTarget)\n row.classList.toggle('is-hidden')\n}\n","// import { isHTMLElement } from './instanceOf';\nexport default function getBoundingClientRect(element,\n// eslint-disable-next-line unused-imports/no-unused-vars\nincludeScale) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n var rect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1; // FIXME:\n // `offsetWidth` returns an integer while `getBoundingClientRect`\n // returns a float. This results in `scaleX` or `scaleY` being\n // non-1 when it should be for elements that aren't a full pixel in\n // width or height.\n // if (isHTMLElement(element) && includeScale) {\n // const offsetHeight = element.offsetHeight;\n // const offsetWidth = element.offsetWidth;\n // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // // Fallback to 1 in case both values are `0`\n // if (offsetWidth > 0) {\n // scaleX = rect.width / offsetWidth || 1;\n // }\n // if (offsetHeight > 0) {\n // scaleY = rect.height / offsetHeight || 1;\n // }\n // }\n\n return {\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n top: rect.top / scaleY,\n right: rect.right / scaleX,\n bottom: rect.bottom / scaleY,\n left: rect.left / scaleX,\n x: rect.left / scaleX,\n y: rect.top / scaleY\n };\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n return node;\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getWindow from \"./getWindow.js\";\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\nexport { isElement, isHTMLElement, isShadowRoot };","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument :\n // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = rect.width / element.offsetWidth || 1;\n var scaleY = rect.height / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' ||\n // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n return (\n // this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot ||\n // step into the shadow DOM of the parent of a slotted node\n element.parentNode || (\n // DOM Element detected\n isShadowRoot(element) ? element.host : null) ||\n // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n );\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n if (list === void 0) {\n list = [];\n }\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList :\n // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) ||\n // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\nfunction getContainingBlock(element) {\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n var isIE = navigator.userAgent.indexOf('Trident') !== -1;\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n var currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n return offsetParent || getContainingBlock(element) || window;\n}","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return instance;\n }\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n var noopFn = function noopFn() {};\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n default:\n }\n }\n return offsets;\n}","import computeOffsets from \"../utils/computeOffsets.js\";\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(round(x * dpr) / dpr) || 0,\n y: round(round(y * dpr) / dpr) || 0\n };\n}\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets;\n var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,\n _ref3$x = _ref3.x,\n x = _ref3$x === void 0 ? 0 : _ref3$x,\n _ref3$y = _ref3.y,\n y = _ref3$y === void 0 ? 0 : _ref3$y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n offsetParent = offsetParent;\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom; // $FlowFixMe[prop-missing]\n\n y -= offsetParent[heightProp] - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right; // $FlowFixMe[prop-missing]\n\n x -= offsetParent[widthProp] - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n if (gpuAcceleration) {\n var _Object$assign;\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\nfunction computeStyles(_ref4) {\n var state = _ref4.state,\n options = _ref4.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration\n };\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\";\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n return false;\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\nfunction getInnerBoundingClientRect(element) {\n var rect = getBoundingClientRect(element);\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\nexport default function getClippingRect(element, boundary, rootBoundary) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nexport default function getViewportRect(element) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n return overflowOffsets;\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport default function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n if (state.modifiersData[name]._skip) {\n return;\n }\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n var _basePlacement = getBasePlacement(placement);\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n checksMap.set(placement, checks);\n }\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n if (_ret === \"break\") break;\n }\n }\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport within from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { max as mathMax, min as mathMin } from \"../utils/math.js\";\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var data = {\n x: 0,\n y: 0\n };\n if (!popperOffsets) {\n return;\n }\n if (checkMainAxis || checkAltAxis) {\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = popperOffsets[mainAxis] + overflow[mainSide];\n var max = popperOffsets[mainAxis] - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;\n var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;\n if (checkMainAxis) {\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n if (checkAltAxis) {\n var _mainSide = mainAxis === 'x' ? top : left;\n var _altSide = mainAxis === 'x' ? bottom : right;\n var _offset = popperOffsets[altAxis];\n var _min = _offset + overflow[_mainSide];\n var _max = _offset - overflow[_altSide];\n var _preventedOffset = within(tether ? mathMin(_min, tetherMin) : _min, _offset, tether ? mathMax(_max, tetherMax) : _max);\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n }\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport within from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\nfunction arrow(_ref) {\n var _state$modifiersData$;\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n if (!arrowElement || !popperOffsets) {\n return;\n }\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n if (!arrowElement) {\n return;\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n return;\n }\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","/**!\n* tippy.js v6.3.7\n* (c) 2017-2021 atomiks\n* MIT License\n*/\nimport { createPopper, applyStyles } from '@popperjs/core';\nvar ROUND_ARROW = '';\nvar BOX_CLASS = \"tippy-box\";\nvar CONTENT_CLASS = \"tippy-content\";\nvar BACKDROP_CLASS = \"tippy-backdrop\";\nvar ARROW_CLASS = \"tippy-arrow\";\nvar SVG_ARROW_CLASS = \"tippy-svg-arrow\";\nvar TOUCH_OPTIONS = {\n passive: true,\n capture: true\n};\nvar TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {\n return document.body;\n};\nfunction hasOwnProperty(obj, key) {\n return {}.hasOwnProperty.call(obj, key);\n}\nfunction getValueAtIndexOrReturn(value, index, defaultValue) {\n if (Array.isArray(value)) {\n var v = value[index];\n return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;\n }\n return value;\n}\nfunction isType(value, type) {\n var str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(type + \"]\") > -1;\n}\nfunction invokeWithArgsOrReturn(value, args) {\n return typeof value === 'function' ? value.apply(void 0, args) : value;\n}\nfunction debounce(fn, ms) {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n var timeout;\n return function (arg) {\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n fn(arg);\n }, ms);\n };\n}\nfunction removeProperties(obj, keys) {\n var clone = Object.assign({}, obj);\n keys.forEach(function (key) {\n delete clone[key];\n });\n return clone;\n}\nfunction splitBySpaces(value) {\n return value.split(/\\s+/).filter(Boolean);\n}\nfunction normalizeToArray(value) {\n return [].concat(value);\n}\nfunction pushIfUnique(arr, value) {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n}\nfunction unique(arr) {\n return arr.filter(function (item, index) {\n return arr.indexOf(item) === index;\n });\n}\nfunction getBasePlacement(placement) {\n return placement.split('-')[0];\n}\nfunction arrayFrom(value) {\n return [].slice.call(value);\n}\nfunction removeUndefinedProps(obj) {\n return Object.keys(obj).reduce(function (acc, key) {\n if (obj[key] !== undefined) {\n acc[key] = obj[key];\n }\n return acc;\n }, {});\n}\nfunction div() {\n return document.createElement('div');\n}\nfunction isElement(value) {\n return ['Element', 'Fragment'].some(function (type) {\n return isType(value, type);\n });\n}\nfunction isNodeList(value) {\n return isType(value, 'NodeList');\n}\nfunction isMouseEvent(value) {\n return isType(value, 'MouseEvent');\n}\nfunction isReferenceElement(value) {\n return !!(value && value._tippy && value._tippy.reference === value);\n}\nfunction getArrayOfElements(value) {\n if (isElement(value)) {\n return [value];\n }\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n if (Array.isArray(value)) {\n return value;\n }\n return arrayFrom(document.querySelectorAll(value));\n}\nfunction setTransitionDuration(els, value) {\n els.forEach(function (el) {\n if (el) {\n el.style.transitionDuration = value + \"ms\";\n }\n });\n}\nfunction setVisibilityState(els, state) {\n els.forEach(function (el) {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\nfunction getOwnerDocument(elementOrElements) {\n var _element$ownerDocumen;\n var _normalizeToArray = normalizeToArray(elementOrElements),\n element = _normalizeToArray[0]; // Elements created via a have an ownerDocument with no reference to the body\n\n return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;\n}\nfunction isCursorOutsideInteractiveBorder(popperTreeData, event) {\n var clientX = event.clientX,\n clientY = event.clientY;\n return popperTreeData.every(function (_ref) {\n var popperRect = _ref.popperRect,\n popperState = _ref.popperState,\n props = _ref.props;\n var interactiveBorder = props.interactiveBorder;\n var basePlacement = getBasePlacement(popperState.placement);\n var offsetData = popperState.modifiersData.offset;\n if (!offsetData) {\n return true;\n }\n var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0;\n var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0;\n var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0;\n var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0;\n var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;\n var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;\n var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;\n var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;\n return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;\n });\n}\nfunction updateTransitionEndListener(box, action, listener) {\n var method = action + \"EventListener\"; // some browsers apparently support `transition` (unprefixed) but only fire\n // `webkitTransitionEnd`...\n\n ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {\n box[method](event, listener);\n });\n}\n/**\n * Compared to xxx.contains, this function works for dom structures with shadow\n * dom\n */\n\nfunction actualContains(parent, child) {\n var target = child;\n while (target) {\n var _target$getRootNode;\n if (parent.contains(target)) {\n return true;\n }\n target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;\n }\n return false;\n}\nvar currentInput = {\n isTouch: false\n};\nvar lastMouseMoveTime = 0;\n/**\n * When a `touchstart` event is fired, it's assumed the user is using touch\n * input. We'll bind a `mousemove` event listener to listen for mouse input in\n * the future. This way, the `isTouch` property is fully dynamic and will handle\n * hybrid devices that use a mix of touch + mouse input.\n */\n\nfunction onDocumentTouchStart() {\n if (currentInput.isTouch) {\n return;\n }\n currentInput.isTouch = true;\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}\n/**\n * When two `mousemove` event are fired consecutively within 20ms, it's assumed\n * the user is using mouse input again. `mousemove` can fire on touch devices as\n * well, but very rarely that quickly.\n */\n\nfunction onDocumentMouseMove() {\n var now = performance.now();\n if (now - lastMouseMoveTime < 20) {\n currentInput.isTouch = false;\n document.removeEventListener('mousemove', onDocumentMouseMove);\n }\n lastMouseMoveTime = now;\n}\n/**\n * When an element is in focus and has a tippy, leaving the tab/window and\n * returning causes it to show again. For mouse users this is unexpected, but\n * for keyboard use it makes sense.\n * TODO: find a better technique to solve this problem\n */\n\nfunction onWindowBlur() {\n var activeElement = document.activeElement;\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}\nfunction bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);\n window.addEventListener('blur', onWindowBlur);\n}\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\nvar isIE11 = isBrowser ?\n// @ts-ignore\n!!window.msCrypto : false;\nfunction createMemoryLeakWarning(method) {\n var txt = method === 'destroy' ? 'n already-' : ' ';\n return [method + \"() was called on a\" + txt + \"destroyed instance. This is a no-op but\", 'indicates a potential memory leak.'].join(' ');\n}\nfunction clean(value) {\n var spacesAndTabs = /[ \\t]{2,}/g;\n var lineStartWithSpaces = /^[ \\t]*/gm;\n return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();\n}\nfunction getDevMessage(message) {\n return clean(\"\\n %ctippy.js\\n\\n %c\" + clean(message) + \"\\n\\n %c\\uD83D\\uDC77\\u200D This is a development-only message. It will be removed in production.\\n \");\n}\nfunction getFormattedMessage(message) {\n return [getDevMessage(message),\n // title\n 'color: #00C584; font-size: 1.3em; font-weight: bold;',\n // message\n 'line-height: 1.5',\n // footer\n 'color: #a6a095;'];\n} // Assume warnings and errors never have the same message\n\nvar visitedMessages;\nif (process.env.NODE_ENV !== \"production\") {\n resetVisitedMessages();\n}\nfunction resetVisitedMessages() {\n visitedMessages = new Set();\n}\nfunction warnWhen(condition, message) {\n if (condition && !visitedMessages.has(message)) {\n var _console;\n visitedMessages.add(message);\n (_console = console).warn.apply(_console, getFormattedMessage(message));\n }\n}\nfunction errorWhen(condition, message) {\n if (condition && !visitedMessages.has(message)) {\n var _console2;\n visitedMessages.add(message);\n (_console2 = console).error.apply(_console2, getFormattedMessage(message));\n }\n}\nfunction validateTargets(targets) {\n var didPassFalsyValue = !targets;\n var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;\n errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));\n errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));\n}\nvar pluginProps = {\n animateFill: false,\n followCursor: false,\n inlinePositioning: false,\n sticky: false\n};\nvar renderProps = {\n allowHTML: false,\n animation: 'fade',\n arrow: true,\n content: '',\n inertia: false,\n maxWidth: 350,\n role: 'tooltip',\n theme: '',\n zIndex: 9999\n};\nvar defaultProps = Object.assign({\n appendTo: TIPPY_DEFAULT_APPEND_TO,\n aria: {\n content: 'auto',\n expanded: 'auto'\n },\n delay: 0,\n duration: [300, 250],\n getReferenceClientRect: null,\n hideOnClick: true,\n ignoreAttributes: false,\n interactive: false,\n interactiveBorder: 2,\n interactiveDebounce: 0,\n moveTransition: '',\n offset: [0, 10],\n onAfterUpdate: function onAfterUpdate() {},\n onBeforeUpdate: function onBeforeUpdate() {},\n onCreate: function onCreate() {},\n onDestroy: function onDestroy() {},\n onHidden: function onHidden() {},\n onHide: function onHide() {},\n onMount: function onMount() {},\n onShow: function onShow() {},\n onShown: function onShown() {},\n onTrigger: function onTrigger() {},\n onUntrigger: function onUntrigger() {},\n onClickOutside: function onClickOutside() {},\n placement: 'top',\n plugins: [],\n popperOptions: {},\n render: null,\n showOnCreate: false,\n touch: true,\n trigger: 'mouseenter focus',\n triggerTarget: null\n}, pluginProps, renderProps);\nvar defaultKeys = Object.keys(defaultProps);\nvar setDefaultProps = function setDefaultProps(partialProps) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n validateProps(partialProps, []);\n }\n var keys = Object.keys(partialProps);\n keys.forEach(function (key) {\n defaultProps[key] = partialProps[key];\n });\n};\nfunction getExtendedPassedProps(passedProps) {\n var plugins = passedProps.plugins || [];\n var pluginProps = plugins.reduce(function (acc, plugin) {\n var name = plugin.name,\n defaultValue = plugin.defaultValue;\n if (name) {\n var _name;\n acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;\n }\n return acc;\n }, {});\n return Object.assign({}, passedProps, pluginProps);\n}\nfunction getDataAttributeProps(reference, plugins) {\n var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {\n plugins: plugins\n }))) : defaultKeys;\n var props = propKeys.reduce(function (acc, key) {\n var valueAsString = (reference.getAttribute(\"data-tippy-\" + key) || '').trim();\n if (!valueAsString) {\n return acc;\n }\n if (key === 'content') {\n acc[key] = valueAsString;\n } else {\n try {\n acc[key] = JSON.parse(valueAsString);\n } catch (e) {\n acc[key] = valueAsString;\n }\n }\n return acc;\n }, {});\n return props;\n}\nfunction evaluateProps(reference, props) {\n var out = Object.assign({}, props, {\n content: invokeWithArgsOrReturn(props.content, [reference])\n }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));\n out.aria = Object.assign({}, defaultProps.aria, out.aria);\n out.aria = {\n expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,\n content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content\n };\n return out;\n}\nfunction validateProps(partialProps, plugins) {\n if (partialProps === void 0) {\n partialProps = {};\n }\n if (plugins === void 0) {\n plugins = [];\n }\n var keys = Object.keys(partialProps);\n keys.forEach(function (prop) {\n var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps));\n var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); // Check if the prop exists in `plugins`\n\n if (didPassUnknownProp) {\n didPassUnknownProp = plugins.filter(function (plugin) {\n return plugin.name === prop;\n }).length === 0;\n }\n warnWhen(didPassUnknownProp, [\"`\" + prop + \"`\", \"is not a valid prop. You may have spelled it incorrectly, or if it's\", 'a plugin, forgot to pass it in an array as props.plugins.', '\\n\\n', 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\\n', 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' '));\n });\n}\nvar innerHTML = function innerHTML() {\n return 'innerHTML';\n};\nfunction dangerouslySetInnerHTML(element, html) {\n element[innerHTML()] = html;\n}\nfunction createArrowElement(value) {\n var arrow = div();\n if (value === true) {\n arrow.className = ARROW_CLASS;\n } else {\n arrow.className = SVG_ARROW_CLASS;\n if (isElement(value)) {\n arrow.appendChild(value);\n } else {\n dangerouslySetInnerHTML(arrow, value);\n }\n }\n return arrow;\n}\nfunction setContent(content, props) {\n if (isElement(props.content)) {\n dangerouslySetInnerHTML(content, '');\n content.appendChild(props.content);\n } else if (typeof props.content !== 'function') {\n if (props.allowHTML) {\n dangerouslySetInnerHTML(content, props.content);\n } else {\n content.textContent = props.content;\n }\n }\n}\nfunction getChildren(popper) {\n var box = popper.firstElementChild;\n var boxChildren = arrayFrom(box.children);\n return {\n box: box,\n content: boxChildren.find(function (node) {\n return node.classList.contains(CONTENT_CLASS);\n }),\n arrow: boxChildren.find(function (node) {\n return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS);\n }),\n backdrop: boxChildren.find(function (node) {\n return node.classList.contains(BACKDROP_CLASS);\n })\n };\n}\nfunction render(instance) {\n var popper = div();\n var box = div();\n box.className = BOX_CLASS;\n box.setAttribute('data-state', 'hidden');\n box.setAttribute('tabindex', '-1');\n var content = div();\n content.className = CONTENT_CLASS;\n content.setAttribute('data-state', 'hidden');\n setContent(content, instance.props);\n popper.appendChild(box);\n box.appendChild(content);\n onUpdate(instance.props, instance.props);\n function onUpdate(prevProps, nextProps) {\n var _getChildren = getChildren(popper),\n box = _getChildren.box,\n content = _getChildren.content,\n arrow = _getChildren.arrow;\n if (nextProps.theme) {\n box.setAttribute('data-theme', nextProps.theme);\n } else {\n box.removeAttribute('data-theme');\n }\n if (typeof nextProps.animation === 'string') {\n box.setAttribute('data-animation', nextProps.animation);\n } else {\n box.removeAttribute('data-animation');\n }\n if (nextProps.inertia) {\n box.setAttribute('data-inertia', '');\n } else {\n box.removeAttribute('data-inertia');\n }\n box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + \"px\" : nextProps.maxWidth;\n if (nextProps.role) {\n box.setAttribute('role', nextProps.role);\n } else {\n box.removeAttribute('role');\n }\n if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {\n setContent(content, instance.props);\n }\n if (nextProps.arrow) {\n if (!arrow) {\n box.appendChild(createArrowElement(nextProps.arrow));\n } else if (prevProps.arrow !== nextProps.arrow) {\n box.removeChild(arrow);\n box.appendChild(createArrowElement(nextProps.arrow));\n }\n } else if (arrow) {\n box.removeChild(arrow);\n }\n }\n return {\n popper: popper,\n onUpdate: onUpdate\n };\n} // Runtime check to identify if the render function is the default one; this\n// way we can apply default CSS transitions logic and it can be tree-shaken away\n\nrender.$$tippy = true;\nvar idCounter = 1;\nvar mouseMoveListeners = []; // Used by `hideAll()`\n\nvar mountedInstances = [];\nfunction createTippy(reference, passedProps) {\n var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================\n // 🔒 Private members\n // ===========================================================================\n\n var showTimeout;\n var hideTimeout;\n var scheduleHideAnimationFrame;\n var isVisibleFromClick = false;\n var didHideDueToDocumentMouseDown = false;\n var didTouchMove = false;\n var ignoreOnFirstUpdate = false;\n var lastTriggerEvent;\n var currentTransitionEndListener;\n var onFirstUpdate;\n var listeners = [];\n var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);\n var currentTarget; // ===========================================================================\n // 🔑 Public members\n // ===========================================================================\n\n var id = idCounter++;\n var popperInstance = null;\n var plugins = unique(props.plugins);\n var state = {\n // Is the instance currently enabled?\n isEnabled: true,\n // Is the tippy currently showing and not transitioning out?\n isVisible: false,\n // Has the instance been destroyed?\n isDestroyed: false,\n // Is the tippy currently mounted to the DOM?\n isMounted: false,\n // Has the tippy finished transitioning in?\n isShown: false\n };\n var instance = {\n // properties\n id: id,\n reference: reference,\n popper: div(),\n popperInstance: popperInstance,\n props: props,\n state: state,\n plugins: plugins,\n // methods\n clearDelayTimeouts: clearDelayTimeouts,\n setProps: setProps,\n setContent: setContent,\n show: show,\n hide: hide,\n hideWithInteractivity: hideWithInteractivity,\n enable: enable,\n disable: disable,\n unmount: unmount,\n destroy: destroy\n }; // TODO: Investigate why this early return causes a TDZ error in the tests —\n // it doesn't seem to happen in the browser\n\n /* istanbul ignore if */\n\n if (!props.render) {\n if (process.env.NODE_ENV !== \"production\") {\n errorWhen(true, 'render() function has not been supplied.');\n }\n return instance;\n } // ===========================================================================\n // Initial mutations\n // ===========================================================================\n\n var _props$render = props.render(instance),\n popper = _props$render.popper,\n onUpdate = _props$render.onUpdate;\n popper.setAttribute('data-tippy-root', '');\n popper.id = \"tippy-\" + instance.id;\n instance.popper = popper;\n reference._tippy = instance;\n popper._tippy = instance;\n var pluginsHooks = plugins.map(function (plugin) {\n return plugin.fn(instance);\n });\n var hasAriaExpanded = reference.hasAttribute('aria-expanded');\n addListeners();\n handleAriaExpandedAttribute();\n handleStyles();\n invokeHook('onCreate', [instance]);\n if (props.showOnCreate) {\n scheduleShow();\n } // Prevent a tippy with a delay from hiding if the cursor left then returned\n // before it started hiding\n\n popper.addEventListener('mouseenter', function () {\n if (instance.props.interactive && instance.state.isVisible) {\n instance.clearDelayTimeouts();\n }\n });\n popper.addEventListener('mouseleave', function () {\n if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {\n getDocument().addEventListener('mousemove', debouncedOnMouseMove);\n }\n });\n return instance; // ===========================================================================\n // 🔒 Private methods\n // ===========================================================================\n\n function getNormalizedTouchSettings() {\n var touch = instance.props.touch;\n return Array.isArray(touch) ? touch : [touch, 0];\n }\n function getIsCustomTouchBehavior() {\n return getNormalizedTouchSettings()[0] === 'hold';\n }\n function getIsDefaultRenderFn() {\n var _instance$props$rende;\n\n // @ts-ignore\n return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);\n }\n function getCurrentTarget() {\n return currentTarget || reference;\n }\n function getDocument() {\n var parent = getCurrentTarget().parentNode;\n return parent ? getOwnerDocument(parent) : document;\n }\n function getDefaultTemplateChildren() {\n return getChildren(popper);\n }\n function getDelay(isShow) {\n // For touch or keyboard input, force `0` delay for UX reasons\n // Also if the instance is mounted but not visible (transitioning out),\n // ignore delay\n if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') {\n return 0;\n }\n return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);\n }\n function handleStyles(fromHide) {\n if (fromHide === void 0) {\n fromHide = false;\n }\n popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';\n popper.style.zIndex = \"\" + instance.props.zIndex;\n }\n function invokeHook(hook, args, shouldInvokePropsHook) {\n if (shouldInvokePropsHook === void 0) {\n shouldInvokePropsHook = true;\n }\n pluginsHooks.forEach(function (pluginHooks) {\n if (pluginHooks[hook]) {\n pluginHooks[hook].apply(pluginHooks, args);\n }\n });\n if (shouldInvokePropsHook) {\n var _instance$props;\n (_instance$props = instance.props)[hook].apply(_instance$props, args);\n }\n }\n function handleAriaContentAttribute() {\n var aria = instance.props.aria;\n if (!aria.content) {\n return;\n }\n var attr = \"aria-\" + aria.content;\n var id = popper.id;\n var nodes = normalizeToArray(instance.props.triggerTarget || reference);\n nodes.forEach(function (node) {\n var currentValue = node.getAttribute(attr);\n if (instance.state.isVisible) {\n node.setAttribute(attr, currentValue ? currentValue + \" \" + id : id);\n } else {\n var nextValue = currentValue && currentValue.replace(id, '').trim();\n if (nextValue) {\n node.setAttribute(attr, nextValue);\n } else {\n node.removeAttribute(attr);\n }\n }\n });\n }\n function handleAriaExpandedAttribute() {\n if (hasAriaExpanded || !instance.props.aria.expanded) {\n return;\n }\n var nodes = normalizeToArray(instance.props.triggerTarget || reference);\n nodes.forEach(function (node) {\n if (instance.props.interactive) {\n node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false');\n } else {\n node.removeAttribute('aria-expanded');\n }\n });\n }\n function cleanupInteractiveMouseListeners() {\n getDocument().removeEventListener('mousemove', debouncedOnMouseMove);\n mouseMoveListeners = mouseMoveListeners.filter(function (listener) {\n return listener !== debouncedOnMouseMove;\n });\n }\n function onDocumentPress(event) {\n // Moved finger to scroll instead of an intentional tap outside\n if (currentInput.isTouch) {\n if (didTouchMove || event.type === 'mousedown') {\n return;\n }\n }\n var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper\n\n if (instance.props.interactive && actualContains(popper, actualTarget)) {\n return;\n } // Clicked on the event listeners target\n\n if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {\n return actualContains(el, actualTarget);\n })) {\n if (currentInput.isTouch) {\n return;\n }\n if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) {\n return;\n }\n } else {\n invokeHook('onClickOutside', [instance, event]);\n }\n if (instance.props.hideOnClick === true) {\n instance.clearDelayTimeouts();\n instance.hide(); // `mousedown` event is fired right before `focus` if pressing the\n // currentTarget. This lets a tippy with `focus` trigger know that it\n // should not show\n\n didHideDueToDocumentMouseDown = true;\n setTimeout(function () {\n didHideDueToDocumentMouseDown = false;\n }); // The listener gets added in `scheduleShow()`, but this may be hiding it\n // before it shows, and hide()'s early bail-out behavior can prevent it\n // from being cleaned up\n\n if (!instance.state.isMounted) {\n removeDocumentPress();\n }\n }\n }\n function onTouchMove() {\n didTouchMove = true;\n }\n function onTouchStart() {\n didTouchMove = false;\n }\n function addDocumentPress() {\n var doc = getDocument();\n doc.addEventListener('mousedown', onDocumentPress, true);\n doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);\n doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);\n doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);\n }\n function removeDocumentPress() {\n var doc = getDocument();\n doc.removeEventListener('mousedown', onDocumentPress, true);\n doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);\n doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);\n doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);\n }\n function onTransitionedOut(duration, callback) {\n onTransitionEnd(duration, function () {\n if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {\n callback();\n }\n });\n }\n function onTransitionedIn(duration, callback) {\n onTransitionEnd(duration, callback);\n }\n function onTransitionEnd(duration, callback) {\n var box = getDefaultTemplateChildren().box;\n function listener(event) {\n if (event.target === box) {\n updateTransitionEndListener(box, 'remove', listener);\n callback();\n }\n } // Make callback synchronous if duration is 0\n // `transitionend` won't fire otherwise\n\n if (duration === 0) {\n return callback();\n }\n updateTransitionEndListener(box, 'remove', currentTransitionEndListener);\n updateTransitionEndListener(box, 'add', listener);\n currentTransitionEndListener = listener;\n }\n function on(eventType, handler, options) {\n if (options === void 0) {\n options = false;\n }\n var nodes = normalizeToArray(instance.props.triggerTarget || reference);\n nodes.forEach(function (node) {\n node.addEventListener(eventType, handler, options);\n listeners.push({\n node: node,\n eventType: eventType,\n handler: handler,\n options: options\n });\n });\n }\n function addListeners() {\n if (getIsCustomTouchBehavior()) {\n on('touchstart', onTrigger, {\n passive: true\n });\n on('touchend', onMouseLeave, {\n passive: true\n });\n }\n splitBySpaces(instance.props.trigger).forEach(function (eventType) {\n if (eventType === 'manual') {\n return;\n }\n on(eventType, onTrigger);\n switch (eventType) {\n case 'mouseenter':\n on('mouseleave', onMouseLeave);\n break;\n case 'focus':\n on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);\n break;\n case 'focusin':\n on('focusout', onBlurOrFocusOut);\n break;\n }\n });\n }\n function removeListeners() {\n listeners.forEach(function (_ref) {\n var node = _ref.node,\n eventType = _ref.eventType,\n handler = _ref.handler,\n options = _ref.options;\n node.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n function onTrigger(event) {\n var _lastTriggerEvent;\n var shouldScheduleClickHide = false;\n if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {\n return;\n }\n var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus';\n lastTriggerEvent = event;\n currentTarget = event.currentTarget;\n handleAriaExpandedAttribute();\n if (!instance.state.isVisible && isMouseEvent(event)) {\n // If scrolling, `mouseenter` events can be fired if the cursor lands\n // over a new target, but `mousemove` events don't get fired. This\n // causes interactive tooltips to get stuck open until the cursor is\n // moved\n mouseMoveListeners.forEach(function (listener) {\n return listener(event);\n });\n } // Toggle show/hide when clicking click-triggered tooltips\n\n if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {\n shouldScheduleClickHide = true;\n } else {\n scheduleShow(event);\n }\n if (event.type === 'click') {\n isVisibleFromClick = !shouldScheduleClickHide;\n }\n if (shouldScheduleClickHide && !wasFocused) {\n scheduleHide(event);\n }\n }\n function onMouseMove(event) {\n var target = event.target;\n var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target);\n if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {\n return;\n }\n var popperTreeData = getNestedPopperTree().concat(popper).map(function (popper) {\n var _instance$popperInsta;\n var instance = popper._tippy;\n var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state;\n if (state) {\n return {\n popperRect: popper.getBoundingClientRect(),\n popperState: state,\n props: props\n };\n }\n return null;\n }).filter(Boolean);\n if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {\n cleanupInteractiveMouseListeners();\n scheduleHide(event);\n }\n }\n function onMouseLeave(event) {\n var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick;\n if (shouldBail) {\n return;\n }\n if (instance.props.interactive) {\n instance.hideWithInteractivity(event);\n return;\n }\n scheduleHide(event);\n }\n function onBlurOrFocusOut(event) {\n if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) {\n return;\n } // If focus was moved to within the popper\n\n if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {\n return;\n }\n scheduleHide(event);\n }\n function isEventListenerStopped(event) {\n return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false;\n }\n function createPopperInstance() {\n destroyPopperInstance();\n var _instance$props2 = instance.props,\n popperOptions = _instance$props2.popperOptions,\n placement = _instance$props2.placement,\n offset = _instance$props2.offset,\n getReferenceClientRect = _instance$props2.getReferenceClientRect,\n moveTransition = _instance$props2.moveTransition;\n var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null;\n var computedReference = getReferenceClientRect ? {\n getBoundingClientRect: getReferenceClientRect,\n contextElement: getReferenceClientRect.contextElement || getCurrentTarget()\n } : reference;\n var tippyModifier = {\n name: '$$tippy',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: function fn(_ref2) {\n var state = _ref2.state;\n if (getIsDefaultRenderFn()) {\n var _getDefaultTemplateCh = getDefaultTemplateChildren(),\n box = _getDefaultTemplateCh.box;\n ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) {\n if (attr === 'placement') {\n box.setAttribute('data-placement', state.placement);\n } else {\n if (state.attributes.popper[\"data-popper-\" + attr]) {\n box.setAttribute(\"data-\" + attr, '');\n } else {\n box.removeAttribute(\"data-\" + attr);\n }\n }\n });\n state.attributes.popper = {};\n }\n }\n };\n var modifiers = [{\n name: 'offset',\n options: {\n offset: offset\n }\n }, {\n name: 'preventOverflow',\n options: {\n padding: {\n top: 2,\n bottom: 2,\n left: 5,\n right: 5\n }\n }\n }, {\n name: 'flip',\n options: {\n padding: 5\n }\n }, {\n name: 'computeStyles',\n options: {\n adaptive: !moveTransition\n }\n }, tippyModifier];\n if (getIsDefaultRenderFn() && arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrow,\n padding: 3\n }\n });\n }\n modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);\n instance.popperInstance = createPopper(computedReference, popper, Object.assign({}, popperOptions, {\n placement: placement,\n onFirstUpdate: onFirstUpdate,\n modifiers: modifiers\n }));\n }\n function destroyPopperInstance() {\n if (instance.popperInstance) {\n instance.popperInstance.destroy();\n instance.popperInstance = null;\n }\n }\n function mount() {\n var appendTo = instance.props.appendTo;\n var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so\n // it's directly after the reference element so the elements inside the\n // tippy can be tabbed to\n // If there are clipping issues, the user can specify a different appendTo\n // and ensure focus management is handled correctly manually\n\n var node = getCurrentTarget();\n if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {\n parentNode = node.parentNode;\n } else {\n parentNode = invokeWithArgsOrReturn(appendTo, [node]);\n } // The popper element needs to exist on the DOM before its position can be\n // updated as Popper needs to read its dimensions\n\n if (!parentNode.contains(popper)) {\n parentNode.appendChild(popper);\n }\n instance.state.isMounted = true;\n createPopperInstance();\n /* istanbul ignore else */\n\n if (process.env.NODE_ENV !== \"production\") {\n // Accessibility check\n warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ['Interactive tippy element may not be accessible via keyboard', 'navigation because it is not directly after the reference element', 'in the DOM source order.', '\\n\\n', 'Using a wrapper or
tag around the reference element', 'solves this by creating a new parentNode context.', '\\n\\n', 'Specifying `appendTo: document.body` silences this warning, but it', 'assumes you are using a focus management solution to handle', 'keyboard navigation.', '\\n\\n', 'See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity'].join(' '));\n }\n }\n function getNestedPopperTree() {\n return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));\n }\n function scheduleShow(event) {\n instance.clearDelayTimeouts();\n if (event) {\n invokeHook('onTrigger', [instance, event]);\n }\n addDocumentPress();\n var delay = getDelay(true);\n var _getNormalizedTouchSe = getNormalizedTouchSettings(),\n touchValue = _getNormalizedTouchSe[0],\n touchDelay = _getNormalizedTouchSe[1];\n if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {\n delay = touchDelay;\n }\n if (delay) {\n showTimeout = setTimeout(function () {\n instance.show();\n }, delay);\n } else {\n instance.show();\n }\n }\n function scheduleHide(event) {\n instance.clearDelayTimeouts();\n invokeHook('onUntrigger', [instance, event]);\n if (!instance.state.isVisible) {\n removeDocumentPress();\n return;\n } // For interactive tippies, scheduleHide is added to a document.body handler\n // from onMouseLeave so must intercept scheduled hides from mousemove/leave\n // events when trigger contains mouseenter and click, and the tip is\n // currently shown as a result of a click.\n\n if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) {\n return;\n }\n var delay = getDelay(false);\n if (delay) {\n hideTimeout = setTimeout(function () {\n if (instance.state.isVisible) {\n instance.hide();\n }\n }, delay);\n } else {\n // Fixes a `transitionend` problem when it fires 1 frame too\n // late sometimes, we don't want hide() to be called.\n scheduleHideAnimationFrame = requestAnimationFrame(function () {\n instance.hide();\n });\n }\n } // ===========================================================================\n // 🔑 Public methods\n // ===========================================================================\n\n function enable() {\n instance.state.isEnabled = true;\n }\n function disable() {\n // Disabling the instance should also hide it\n // https://github.com/atomiks/tippy.js-react/issues/106\n instance.hide();\n instance.state.isEnabled = false;\n }\n function clearDelayTimeouts() {\n clearTimeout(showTimeout);\n clearTimeout(hideTimeout);\n cancelAnimationFrame(scheduleHideAnimationFrame);\n }\n function setProps(partialProps) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));\n }\n if (instance.state.isDestroyed) {\n return;\n }\n invokeHook('onBeforeUpdate', [instance, partialProps]);\n removeListeners();\n var prevProps = instance.props;\n var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {\n ignoreAttributes: true\n }));\n instance.props = nextProps;\n addListeners();\n if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {\n cleanupInteractiveMouseListeners();\n debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);\n } // Ensure stale aria-expanded attributes are removed\n\n if (prevProps.triggerTarget && !nextProps.triggerTarget) {\n normalizeToArray(prevProps.triggerTarget).forEach(function (node) {\n node.removeAttribute('aria-expanded');\n });\n } else if (nextProps.triggerTarget) {\n reference.removeAttribute('aria-expanded');\n }\n handleAriaExpandedAttribute();\n handleStyles();\n if (onUpdate) {\n onUpdate(prevProps, nextProps);\n }\n if (instance.popperInstance) {\n createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered,\n // and the nested ones get re-rendered first.\n // https://github.com/atomiks/tippyjs-react/issues/177\n // TODO: find a cleaner / more efficient solution(!)\n\n getNestedPopperTree().forEach(function (nestedPopper) {\n // React (and other UI libs likely) requires a rAF wrapper as it flushes\n // its work in one\n requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);\n });\n }\n invokeHook('onAfterUpdate', [instance, partialProps]);\n }\n function setContent(content) {\n instance.setProps({\n content: content\n });\n }\n function show() {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));\n } // Early bail-out\n\n var isAlreadyVisible = instance.state.isVisible;\n var isDestroyed = instance.state.isDestroyed;\n var isDisabled = !instance.state.isEnabled;\n var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;\n var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);\n if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {\n return;\n } // Normalize `disabled` behavior across browsers.\n // Firefox allows events on disabled elements, but Chrome doesn't.\n // Using a wrapper element (i.e. ) is recommended.\n\n if (getCurrentTarget().hasAttribute('disabled')) {\n return;\n }\n invokeHook('onShow', [instance], false);\n if (instance.props.onShow(instance) === false) {\n return;\n }\n instance.state.isVisible = true;\n if (getIsDefaultRenderFn()) {\n popper.style.visibility = 'visible';\n }\n handleStyles();\n addDocumentPress();\n if (!instance.state.isMounted) {\n popper.style.transition = 'none';\n } // If flipping to the opposite side after hiding at least once, the\n // animation will use the wrong placement without resetting the duration\n\n if (getIsDefaultRenderFn()) {\n var _getDefaultTemplateCh2 = getDefaultTemplateChildren(),\n box = _getDefaultTemplateCh2.box,\n content = _getDefaultTemplateCh2.content;\n setTransitionDuration([box, content], 0);\n }\n onFirstUpdate = function onFirstUpdate() {\n var _instance$popperInsta2;\n if (!instance.state.isVisible || ignoreOnFirstUpdate) {\n return;\n }\n ignoreOnFirstUpdate = true; // reflow\n\n void popper.offsetHeight;\n popper.style.transition = instance.props.moveTransition;\n if (getIsDefaultRenderFn() && instance.props.animation) {\n var _getDefaultTemplateCh3 = getDefaultTemplateChildren(),\n _box = _getDefaultTemplateCh3.box,\n _content = _getDefaultTemplateCh3.content;\n setTransitionDuration([_box, _content], duration);\n setVisibilityState([_box, _content], 'visible');\n }\n handleAriaContentAttribute();\n handleAriaExpandedAttribute();\n pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the\n // popper has been positioned for the first time\n\n (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();\n invokeHook('onMount', [instance]);\n if (instance.props.animation && getIsDefaultRenderFn()) {\n onTransitionedIn(duration, function () {\n instance.state.isShown = true;\n invokeHook('onShown', [instance]);\n });\n }\n };\n mount();\n }\n function hide() {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));\n } // Early bail-out\n\n var isAlreadyHidden = !instance.state.isVisible;\n var isDestroyed = instance.state.isDestroyed;\n var isDisabled = !instance.state.isEnabled;\n var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);\n if (isAlreadyHidden || isDestroyed || isDisabled) {\n return;\n }\n invokeHook('onHide', [instance], false);\n if (instance.props.onHide(instance) === false) {\n return;\n }\n instance.state.isVisible = false;\n instance.state.isShown = false;\n ignoreOnFirstUpdate = false;\n isVisibleFromClick = false;\n if (getIsDefaultRenderFn()) {\n popper.style.visibility = 'hidden';\n }\n cleanupInteractiveMouseListeners();\n removeDocumentPress();\n handleStyles(true);\n if (getIsDefaultRenderFn()) {\n var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),\n box = _getDefaultTemplateCh4.box,\n content = _getDefaultTemplateCh4.content;\n if (instance.props.animation) {\n setTransitionDuration([box, content], duration);\n setVisibilityState([box, content], 'hidden');\n }\n }\n handleAriaContentAttribute();\n handleAriaExpandedAttribute();\n if (instance.props.animation) {\n if (getIsDefaultRenderFn()) {\n onTransitionedOut(duration, instance.unmount);\n }\n } else {\n instance.unmount();\n }\n }\n function hideWithInteractivity(event) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));\n }\n getDocument().addEventListener('mousemove', debouncedOnMouseMove);\n pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);\n debouncedOnMouseMove(event);\n }\n function unmount() {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));\n }\n if (instance.state.isVisible) {\n instance.hide();\n }\n if (!instance.state.isMounted) {\n return;\n }\n destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper\n // tree by default. This seems mainly for interactive tippies, but we should\n // find a workaround if possible\n\n getNestedPopperTree().forEach(function (nestedPopper) {\n nestedPopper._tippy.unmount();\n });\n if (popper.parentNode) {\n popper.parentNode.removeChild(popper);\n }\n mountedInstances = mountedInstances.filter(function (i) {\n return i !== instance;\n });\n instance.state.isMounted = false;\n invokeHook('onHidden', [instance]);\n }\n function destroy() {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));\n }\n if (instance.state.isDestroyed) {\n return;\n }\n instance.clearDelayTimeouts();\n instance.unmount();\n removeListeners();\n delete reference._tippy;\n instance.state.isDestroyed = true;\n invokeHook('onDestroy', [instance]);\n }\n}\nfunction tippy(targets, optionalProps) {\n if (optionalProps === void 0) {\n optionalProps = {};\n }\n var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);\n /* istanbul ignore else */\n\n if (process.env.NODE_ENV !== \"production\") {\n validateTargets(targets);\n validateProps(optionalProps, plugins);\n }\n bindGlobalEventListeners();\n var passedProps = Object.assign({}, optionalProps, {\n plugins: plugins\n });\n var elements = getArrayOfElements(targets);\n /* istanbul ignore else */\n\n if (process.env.NODE_ENV !== \"production\") {\n var isSingleContentElement = isElement(passedProps.content);\n var isMoreThanOneReferenceElement = elements.length > 1;\n warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ['tippy() was passed an Element as the `content` prop, but more than', 'one tippy instance was created by this invocation. This means the', 'content element will only be appended to the last tippy instance.', '\\n\\n', 'Instead, pass the .innerHTML of the element, or use a function that', 'returns a cloned version of the element instead.', '\\n\\n', '1) content: element.innerHTML\\n', '2) content: () => element.cloneNode(true)'].join(' '));\n }\n var instances = elements.reduce(function (acc, reference) {\n var instance = reference && createTippy(reference, passedProps);\n if (instance) {\n acc.push(instance);\n }\n return acc;\n }, []);\n return isElement(targets) ? instances[0] : instances;\n}\ntippy.defaultProps = defaultProps;\ntippy.setDefaultProps = setDefaultProps;\ntippy.currentInput = currentInput;\nvar hideAll = function hideAll(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n excludedReferenceOrInstance = _ref.exclude,\n duration = _ref.duration;\n mountedInstances.forEach(function (instance) {\n var isExcluded = false;\n if (excludedReferenceOrInstance) {\n isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper;\n }\n if (!isExcluded) {\n var originalDuration = instance.props.duration;\n instance.setProps({\n duration: duration\n });\n instance.hide();\n if (!instance.state.isDestroyed) {\n instance.setProps({\n duration: originalDuration\n });\n }\n }\n });\n};\n\n// every time the popper is destroyed (i.e. a new target), removing the styles\n// and causing transitions to break for singletons when the console is open, but\n// most notably for non-transform styles being used, `gpuAcceleration: false`.\n\nvar applyStylesModifier = Object.assign({}, applyStyles, {\n effect: function effect(_ref) {\n var state = _ref.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n } // intentionally return no cleanup function\n // return () => { ... }\n }\n});\n\nvar createSingleton = function createSingleton(tippyInstances, optionalProps) {\n var _optionalProps$popper;\n if (optionalProps === void 0) {\n optionalProps = {};\n }\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of', 'tippy instances. The passed value was', String(tippyInstances)].join(' '));\n }\n var individualInstances = tippyInstances;\n var references = [];\n var triggerTargets = [];\n var currentTarget;\n var overrides = optionalProps.overrides;\n var interceptSetPropsCleanups = [];\n var shownOnCreate = false;\n function setTriggerTargets() {\n triggerTargets = individualInstances.map(function (instance) {\n return normalizeToArray(instance.props.triggerTarget || instance.reference);\n }).reduce(function (acc, item) {\n return acc.concat(item);\n }, []);\n }\n function setReferences() {\n references = individualInstances.map(function (instance) {\n return instance.reference;\n });\n }\n function enableInstances(isEnabled) {\n individualInstances.forEach(function (instance) {\n if (isEnabled) {\n instance.enable();\n } else {\n instance.disable();\n }\n });\n }\n function interceptSetProps(singleton) {\n return individualInstances.map(function (instance) {\n var originalSetProps = instance.setProps;\n instance.setProps = function (props) {\n originalSetProps(props);\n if (instance.reference === currentTarget) {\n singleton.setProps(props);\n }\n };\n return function () {\n instance.setProps = originalSetProps;\n };\n });\n } // have to pass singleton, as it maybe undefined on first call\n\n function prepareInstance(singleton, target) {\n var index = triggerTargets.indexOf(target); // bail-out\n\n if (target === currentTarget) {\n return;\n }\n currentTarget = target;\n var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) {\n acc[prop] = individualInstances[index].props[prop];\n return acc;\n }, {});\n singleton.setProps(Object.assign({}, overrideProps, {\n getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () {\n var _references$index;\n return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();\n }\n }));\n }\n enableInstances(false);\n setReferences();\n setTriggerTargets();\n var plugin = {\n fn: function fn() {\n return {\n onDestroy: function onDestroy() {\n enableInstances(true);\n },\n onHidden: function onHidden() {\n currentTarget = null;\n },\n onClickOutside: function onClickOutside(instance) {\n if (instance.props.showOnCreate && !shownOnCreate) {\n shownOnCreate = true;\n currentTarget = null;\n }\n },\n onShow: function onShow(instance) {\n if (instance.props.showOnCreate && !shownOnCreate) {\n shownOnCreate = true;\n prepareInstance(instance, references[0]);\n }\n },\n onTrigger: function onTrigger(instance, event) {\n prepareInstance(instance, event.currentTarget);\n }\n };\n }\n };\n var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {\n plugins: [plugin].concat(optionalProps.plugins || []),\n triggerTarget: triggerTargets,\n popperOptions: Object.assign({}, optionalProps.popperOptions, {\n modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])\n })\n }));\n var originalShow = singleton.show;\n singleton.show = function (target) {\n originalShow(); // first time, showOnCreate or programmatic call with no params\n // default to showing first instance\n\n if (!currentTarget && target == null) {\n return prepareInstance(singleton, references[0]);\n } // triggered from event (do nothing as prepareInstance already called by onTrigger)\n // programmatic call with no params when already visible (do nothing again)\n\n if (currentTarget && target == null) {\n return;\n } // target is index of instance\n\n if (typeof target === 'number') {\n return references[target] && prepareInstance(singleton, references[target]);\n } // target is a child tippy instance\n\n if (individualInstances.indexOf(target) >= 0) {\n var ref = target.reference;\n return prepareInstance(singleton, ref);\n } // target is a ReferenceElement\n\n if (references.indexOf(target) >= 0) {\n return prepareInstance(singleton, target);\n }\n };\n singleton.showNext = function () {\n var first = references[0];\n if (!currentTarget) {\n return singleton.show(0);\n }\n var index = references.indexOf(currentTarget);\n singleton.show(references[index + 1] || first);\n };\n singleton.showPrevious = function () {\n var last = references[references.length - 1];\n if (!currentTarget) {\n return singleton.show(last);\n }\n var index = references.indexOf(currentTarget);\n var target = references[index - 1] || last;\n singleton.show(target);\n };\n var originalSetProps = singleton.setProps;\n singleton.setProps = function (props) {\n overrides = props.overrides || overrides;\n originalSetProps(props);\n };\n singleton.setInstances = function (nextInstances) {\n enableInstances(true);\n interceptSetPropsCleanups.forEach(function (fn) {\n return fn();\n });\n individualInstances = nextInstances;\n enableInstances(false);\n setReferences();\n setTriggerTargets();\n interceptSetPropsCleanups = interceptSetProps(singleton);\n singleton.setProps({\n triggerTarget: triggerTargets\n });\n };\n interceptSetPropsCleanups = interceptSetProps(singleton);\n return singleton;\n};\nvar BUBBLING_EVENTS_MAP = {\n mouseover: 'mouseenter',\n focusin: 'focus',\n click: 'click'\n};\n/**\n * Creates a delegate instance that controls the creation of tippy instances\n * for child elements (`target` CSS selector).\n */\n\nfunction delegate(targets, props) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n errorWhen(!(props && props.target), ['You must specity a `target` prop indicating a CSS selector string matching', 'the target elements that should receive a tippy.'].join(' '));\n }\n var listeners = [];\n var childTippyInstances = [];\n var disabled = false;\n var target = props.target;\n var nativeProps = removeProperties(props, ['target']);\n var parentProps = Object.assign({}, nativeProps, {\n trigger: 'manual',\n touch: false\n });\n var childProps = Object.assign({\n touch: defaultProps.touch\n }, nativeProps, {\n showOnCreate: true\n });\n var returnValue = tippy(targets, parentProps);\n var normalizedReturnValue = normalizeToArray(returnValue);\n function onTrigger(event) {\n if (!event.target || disabled) {\n return;\n }\n var targetNode = event.target.closest(target);\n if (!targetNode) {\n return;\n } // Get relevant trigger with fallbacks:\n // 1. Check `data-tippy-trigger` attribute on target node\n // 2. Fallback to `trigger` passed to `delegate()`\n // 3. Fallback to `defaultProps.trigger`\n\n var trigger = targetNode.getAttribute('data-tippy-trigger') || props.trigger || defaultProps.trigger; // @ts-ignore\n\n if (targetNode._tippy) {\n return;\n }\n if (event.type === 'touchstart' && typeof childProps.touch === 'boolean') {\n return;\n }\n if (event.type !== 'touchstart' && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0) {\n return;\n }\n var instance = tippy(targetNode, childProps);\n if (instance) {\n childTippyInstances = childTippyInstances.concat(instance);\n }\n }\n function on(node, eventType, handler, options) {\n if (options === void 0) {\n options = false;\n }\n node.addEventListener(eventType, handler, options);\n listeners.push({\n node: node,\n eventType: eventType,\n handler: handler,\n options: options\n });\n }\n function addEventListeners(instance) {\n var reference = instance.reference;\n on(reference, 'touchstart', onTrigger, TOUCH_OPTIONS);\n on(reference, 'mouseover', onTrigger);\n on(reference, 'focusin', onTrigger);\n on(reference, 'click', onTrigger);\n }\n function removeEventListeners() {\n listeners.forEach(function (_ref) {\n var node = _ref.node,\n eventType = _ref.eventType,\n handler = _ref.handler,\n options = _ref.options;\n node.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n function applyMutations(instance) {\n var originalDestroy = instance.destroy;\n var originalEnable = instance.enable;\n var originalDisable = instance.disable;\n instance.destroy = function (shouldDestroyChildInstances) {\n if (shouldDestroyChildInstances === void 0) {\n shouldDestroyChildInstances = true;\n }\n if (shouldDestroyChildInstances) {\n childTippyInstances.forEach(function (instance) {\n instance.destroy();\n });\n }\n childTippyInstances = [];\n removeEventListeners();\n originalDestroy();\n };\n instance.enable = function () {\n originalEnable();\n childTippyInstances.forEach(function (instance) {\n return instance.enable();\n });\n disabled = false;\n };\n instance.disable = function () {\n originalDisable();\n childTippyInstances.forEach(function (instance) {\n return instance.disable();\n });\n disabled = true;\n };\n addEventListeners(instance);\n }\n normalizedReturnValue.forEach(applyMutations);\n return returnValue;\n}\nvar animateFill = {\n name: 'animateFill',\n defaultValue: false,\n fn: function fn(instance) {\n var _instance$props$rende;\n\n // @ts-ignore\n if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {\n if (process.env.NODE_ENV !== \"production\") {\n errorWhen(instance.props.animateFill, 'The `animateFill` plugin requires the default render function.');\n }\n return {};\n }\n var _getChildren = getChildren(instance.popper),\n box = _getChildren.box,\n content = _getChildren.content;\n var backdrop = instance.props.animateFill ? createBackdropElement() : null;\n return {\n onCreate: function onCreate() {\n if (backdrop) {\n box.insertBefore(backdrop, box.firstElementChild);\n box.setAttribute('data-animatefill', '');\n box.style.overflow = 'hidden';\n instance.setProps({\n arrow: false,\n animation: 'shift-away'\n });\n }\n },\n onMount: function onMount() {\n if (backdrop) {\n var transitionDuration = box.style.transitionDuration;\n var duration = Number(transitionDuration.replace('ms', '')); // The content should fade in after the backdrop has mostly filled the\n // tooltip element. `clip-path` is the other alternative but is not\n // well-supported and is buggy on some devices.\n\n content.style.transitionDelay = Math.round(duration / 10) + \"ms\";\n backdrop.style.transitionDuration = transitionDuration;\n setVisibilityState([backdrop], 'visible');\n }\n },\n onShow: function onShow() {\n if (backdrop) {\n backdrop.style.transitionDuration = '0ms';\n }\n },\n onHide: function onHide() {\n if (backdrop) {\n setVisibilityState([backdrop], 'hidden');\n }\n }\n };\n }\n};\nfunction createBackdropElement() {\n var backdrop = div();\n backdrop.className = BACKDROP_CLASS;\n setVisibilityState([backdrop], 'hidden');\n return backdrop;\n}\nvar mouseCoords = {\n clientX: 0,\n clientY: 0\n};\nvar activeInstances = [];\nfunction storeMouseCoords(_ref) {\n var clientX = _ref.clientX,\n clientY = _ref.clientY;\n mouseCoords = {\n clientX: clientX,\n clientY: clientY\n };\n}\nfunction addMouseCoordsListener(doc) {\n doc.addEventListener('mousemove', storeMouseCoords);\n}\nfunction removeMouseCoordsListener(doc) {\n doc.removeEventListener('mousemove', storeMouseCoords);\n}\nvar followCursor = {\n name: 'followCursor',\n defaultValue: false,\n fn: function fn(instance) {\n var reference = instance.reference;\n var doc = getOwnerDocument(instance.props.triggerTarget || reference);\n var isInternalUpdate = false;\n var wasFocusEvent = false;\n var isUnmounted = true;\n var prevProps = instance.props;\n function getIsInitialBehavior() {\n return instance.props.followCursor === 'initial' && instance.state.isVisible;\n }\n function addListener() {\n doc.addEventListener('mousemove', onMouseMove);\n }\n function removeListener() {\n doc.removeEventListener('mousemove', onMouseMove);\n }\n function unsetGetReferenceClientRect() {\n isInternalUpdate = true;\n instance.setProps({\n getReferenceClientRect: null\n });\n isInternalUpdate = false;\n }\n function onMouseMove(event) {\n // If the instance is interactive, avoid updating the position unless it's\n // over the reference element\n var isCursorOverReference = event.target ? reference.contains(event.target) : true;\n var followCursor = instance.props.followCursor;\n var clientX = event.clientX,\n clientY = event.clientY;\n var rect = reference.getBoundingClientRect();\n var relativeX = clientX - rect.left;\n var relativeY = clientY - rect.top;\n if (isCursorOverReference || !instance.props.interactive) {\n instance.setProps({\n // @ts-ignore - unneeded DOMRect properties\n getReferenceClientRect: function getReferenceClientRect() {\n var rect = reference.getBoundingClientRect();\n var x = clientX;\n var y = clientY;\n if (followCursor === 'initial') {\n x = rect.left + relativeX;\n y = rect.top + relativeY;\n }\n var top = followCursor === 'horizontal' ? rect.top : y;\n var right = followCursor === 'vertical' ? rect.right : x;\n var bottom = followCursor === 'horizontal' ? rect.bottom : y;\n var left = followCursor === 'vertical' ? rect.left : x;\n return {\n width: right - left,\n height: bottom - top,\n top: top,\n right: right,\n bottom: bottom,\n left: left\n };\n }\n });\n }\n }\n function create() {\n if (instance.props.followCursor) {\n activeInstances.push({\n instance: instance,\n doc: doc\n });\n addMouseCoordsListener(doc);\n }\n }\n function destroy() {\n activeInstances = activeInstances.filter(function (data) {\n return data.instance !== instance;\n });\n if (activeInstances.filter(function (data) {\n return data.doc === doc;\n }).length === 0) {\n removeMouseCoordsListener(doc);\n }\n }\n return {\n onCreate: create,\n onDestroy: destroy,\n onBeforeUpdate: function onBeforeUpdate() {\n prevProps = instance.props;\n },\n onAfterUpdate: function onAfterUpdate(_, _ref2) {\n var followCursor = _ref2.followCursor;\n if (isInternalUpdate) {\n return;\n }\n if (followCursor !== undefined && prevProps.followCursor !== followCursor) {\n destroy();\n if (followCursor) {\n create();\n if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) {\n addListener();\n }\n } else {\n removeListener();\n unsetGetReferenceClientRect();\n }\n }\n },\n onMount: function onMount() {\n if (instance.props.followCursor && !wasFocusEvent) {\n if (isUnmounted) {\n onMouseMove(mouseCoords);\n isUnmounted = false;\n }\n if (!getIsInitialBehavior()) {\n addListener();\n }\n }\n },\n onTrigger: function onTrigger(_, event) {\n if (isMouseEvent(event)) {\n mouseCoords = {\n clientX: event.clientX,\n clientY: event.clientY\n };\n }\n wasFocusEvent = event.type === 'focus';\n },\n onHidden: function onHidden() {\n if (instance.props.followCursor) {\n unsetGetReferenceClientRect();\n removeListener();\n isUnmounted = true;\n }\n }\n };\n }\n};\nfunction getProps(props, modifier) {\n var _props$popperOptions;\n return {\n popperOptions: Object.assign({}, props.popperOptions, {\n modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function (_ref) {\n var name = _ref.name;\n return name !== modifier.name;\n }), [modifier])\n })\n };\n}\nvar inlinePositioning = {\n name: 'inlinePositioning',\n defaultValue: false,\n fn: function fn(instance) {\n var reference = instance.reference;\n function isEnabled() {\n return !!instance.props.inlinePositioning;\n }\n var placement;\n var cursorRectIndex = -1;\n var isInternalUpdate = false;\n var triedPlacements = [];\n var modifier = {\n name: 'tippyInlinePositioning',\n enabled: true,\n phase: 'afterWrite',\n fn: function fn(_ref2) {\n var state = _ref2.state;\n if (isEnabled()) {\n if (triedPlacements.indexOf(state.placement) !== -1) {\n triedPlacements = [];\n }\n if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {\n triedPlacements.push(state.placement);\n instance.setProps({\n // @ts-ignore - unneeded DOMRect properties\n getReferenceClientRect: function getReferenceClientRect() {\n return _getReferenceClientRect(state.placement);\n }\n });\n }\n placement = state.placement;\n }\n }\n };\n function _getReferenceClientRect(placement) {\n return getInlineBoundingClientRect(getBasePlacement(placement), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex);\n }\n function setInternalProps(partialProps) {\n isInternalUpdate = true;\n instance.setProps(partialProps);\n isInternalUpdate = false;\n }\n function addModifier() {\n if (!isInternalUpdate) {\n setInternalProps(getProps(instance.props, modifier));\n }\n }\n return {\n onCreate: addModifier,\n onAfterUpdate: addModifier,\n onTrigger: function onTrigger(_, event) {\n if (isMouseEvent(event)) {\n var rects = arrayFrom(instance.reference.getClientRects());\n var cursorRect = rects.find(function (rect) {\n return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY;\n });\n var index = rects.indexOf(cursorRect);\n cursorRectIndex = index > -1 ? index : cursorRectIndex;\n }\n },\n onHidden: function onHidden() {\n cursorRectIndex = -1;\n }\n };\n }\n};\nfunction getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) {\n // Not an inline element, or placement is not yet known\n if (clientRects.length < 2 || currentBasePlacement === null) {\n return boundingRect;\n } // There are two rects and they are disjoined\n\n if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) {\n return clientRects[cursorRectIndex] || boundingRect;\n }\n switch (currentBasePlacement) {\n case 'top':\n case 'bottom':\n {\n var firstRect = clientRects[0];\n var lastRect = clientRects[clientRects.length - 1];\n var isTop = currentBasePlacement === 'top';\n var top = firstRect.top;\n var bottom = lastRect.bottom;\n var left = isTop ? firstRect.left : lastRect.left;\n var right = isTop ? firstRect.right : lastRect.right;\n var width = right - left;\n var height = bottom - top;\n return {\n top: top,\n bottom: bottom,\n left: left,\n right: right,\n width: width,\n height: height\n };\n }\n case 'left':\n case 'right':\n {\n var minLeft = Math.min.apply(Math, clientRects.map(function (rects) {\n return rects.left;\n }));\n var maxRight = Math.max.apply(Math, clientRects.map(function (rects) {\n return rects.right;\n }));\n var measureRects = clientRects.filter(function (rect) {\n return currentBasePlacement === 'left' ? rect.left === minLeft : rect.right === maxRight;\n });\n var _top = measureRects[0].top;\n var _bottom = measureRects[measureRects.length - 1].bottom;\n var _left = minLeft;\n var _right = maxRight;\n var _width = _right - _left;\n var _height = _bottom - _top;\n return {\n top: _top,\n bottom: _bottom,\n left: _left,\n right: _right,\n width: _width,\n height: _height\n };\n }\n default:\n {\n return boundingRect;\n }\n }\n}\nvar sticky = {\n name: 'sticky',\n defaultValue: false,\n fn: function fn(instance) {\n var reference = instance.reference,\n popper = instance.popper;\n function getReference() {\n return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference;\n }\n function shouldCheck(value) {\n return instance.props.sticky === true || instance.props.sticky === value;\n }\n var prevRefRect = null;\n var prevPopRect = null;\n function updatePosition() {\n var currentRefRect = shouldCheck('reference') ? getReference().getBoundingClientRect() : null;\n var currentPopRect = shouldCheck('popper') ? popper.getBoundingClientRect() : null;\n if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) {\n if (instance.popperInstance) {\n instance.popperInstance.update();\n }\n }\n prevRefRect = currentRefRect;\n prevPopRect = currentPopRect;\n if (instance.state.isMounted) {\n requestAnimationFrame(updatePosition);\n }\n }\n return {\n onMount: function onMount() {\n if (instance.props.sticky) {\n updatePosition();\n }\n }\n };\n }\n};\nfunction areRectsDifferent(rectA, rectB) {\n if (rectA && rectB) {\n return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left;\n }\n return true;\n}\ntippy.setDefaultProps({\n render: render\n});\nexport default tippy;\nexport { animateFill, createSingleton, delegate, followCursor, hideAll, inlinePositioning, ROUND_ARROW as roundArrow, sticky };","import tippy from 'tippy.js'\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['tooltip']\n\n tooltipTargetConnected(element) {\n this.initializeTooltip(element)\n }\n\n tooltipTargetDisconnected(element) {\n element._tippy.destroy()\n }\n\n initializeTooltip(el) {\n return tippy(el, {\n theme: 'light',\n placement: el.dataset.tooltipPlacement,\n content: el.dataset.tooltipText,\n allowHTML: el.dataset.tooltipAllowHtml,\n })\n }\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\nvar adapters = {\n logger: self.console,\n WebSocket: self.WebSocket\n};\nvar logger = {\n log: function log() {\n if (this.enabled) {\n var _adapters$logger;\n for (var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++) {\n messages[_key] = arguments[_key];\n }\n messages.push(Date.now());\n (_adapters$logger = adapters.logger).log.apply(_adapters$logger, [\"[ActionCable]\"].concat(messages));\n }\n }\n};\nvar now = function now() {\n return new Date().getTime();\n};\nvar secondsSince = function secondsSince(time) {\n return (now() - time) / 1e3;\n};\nvar ConnectionMonitor = /*#__PURE__*/function () {\n function ConnectionMonitor(connection) {\n _classCallCheck(this, ConnectionMonitor);\n this.visibilityDidChange = this.visibilityDidChange.bind(this);\n this.connection = connection;\n this.reconnectAttempts = 0;\n }\n _createClass(ConnectionMonitor, [{\n key: \"start\",\n value: function start() {\n if (!this.isRunning()) {\n this.startedAt = now();\n delete this.stoppedAt;\n this.startPolling();\n addEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor started. stale threshold = \".concat(this.constructor.staleThreshold, \" s\"));\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.isRunning()) {\n this.stoppedAt = now();\n this.stopPolling();\n removeEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor stopped\");\n }\n }\n }, {\n key: \"isRunning\",\n value: function isRunning() {\n return this.startedAt && !this.stoppedAt;\n }\n }, {\n key: \"recordPing\",\n value: function recordPing() {\n this.pingedAt = now();\n }\n }, {\n key: \"recordConnect\",\n value: function recordConnect() {\n this.reconnectAttempts = 0;\n this.recordPing();\n delete this.disconnectedAt;\n logger.log(\"ConnectionMonitor recorded connect\");\n }\n }, {\n key: \"recordDisconnect\",\n value: function recordDisconnect() {\n this.disconnectedAt = now();\n logger.log(\"ConnectionMonitor recorded disconnect\");\n }\n }, {\n key: \"startPolling\",\n value: function startPolling() {\n this.stopPolling();\n this.poll();\n }\n }, {\n key: \"stopPolling\",\n value: function stopPolling() {\n clearTimeout(this.pollTimeout);\n }\n }, {\n key: \"poll\",\n value: function poll() {\n var _this = this;\n this.pollTimeout = setTimeout(function () {\n _this.reconnectIfStale();\n _this.poll();\n }, this.getPollInterval());\n }\n }, {\n key: \"getPollInterval\",\n value: function getPollInterval() {\n var _this$constructor = this.constructor,\n staleThreshold = _this$constructor.staleThreshold,\n reconnectionBackoffRate = _this$constructor.reconnectionBackoffRate;\n var backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10));\n var jitterMax = this.reconnectAttempts === 0 ? 1 : reconnectionBackoffRate;\n var jitter = jitterMax * Math.random();\n return staleThreshold * 1e3 * backoff * (1 + jitter);\n }\n }, {\n key: \"reconnectIfStale\",\n value: function reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(\"ConnectionMonitor detected stale connection. reconnectAttempts = \".concat(this.reconnectAttempts, \", time stale = \").concat(secondsSince(this.refreshedAt), \" s, stale threshold = \").concat(this.constructor.staleThreshold, \" s\"));\n this.reconnectAttempts++;\n if (this.disconnectedRecently()) {\n logger.log(\"ConnectionMonitor skipping reopening recent disconnect. time disconnected = \".concat(secondsSince(this.disconnectedAt), \" s\"));\n } else {\n logger.log(\"ConnectionMonitor reopening\");\n this.connection.reopen();\n }\n }\n }\n }, {\n key: \"refreshedAt\",\n get: function get() {\n return this.pingedAt ? this.pingedAt : this.startedAt;\n }\n }, {\n key: \"connectionIsStale\",\n value: function connectionIsStale() {\n return secondsSince(this.refreshedAt) > this.constructor.staleThreshold;\n }\n }, {\n key: \"disconnectedRecently\",\n value: function disconnectedRecently() {\n return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold;\n }\n }, {\n key: \"visibilityDidChange\",\n value: function visibilityDidChange() {\n var _this2 = this;\n if (document.visibilityState === \"visible\") {\n setTimeout(function () {\n if (_this2.connectionIsStale() || !_this2.connection.isOpen()) {\n logger.log(\"ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = \".concat(document.visibilityState));\n _this2.connection.reopen();\n }\n }, 200);\n }\n }\n }]);\n return ConnectionMonitor;\n}();\nConnectionMonitor.staleThreshold = 6;\nConnectionMonitor.reconnectionBackoffRate = .15;\nvar INTERNAL = {\n message_types: {\n welcome: \"welcome\",\n disconnect: \"disconnect\",\n ping: \"ping\",\n confirmation: \"confirm_subscription\",\n rejection: \"reject_subscription\"\n },\n disconnect_reasons: {\n unauthorized: \"unauthorized\",\n invalid_request: \"invalid_request\",\n server_restart: \"server_restart\"\n },\n default_mount_path: \"/cable\",\n protocols: [\"actioncable-v1-json\", \"actioncable-unsupported\"]\n};\nvar message_types = INTERNAL.message_types,\n protocols = INTERNAL.protocols;\nvar supportedProtocols = protocols.slice(0, protocols.length - 1);\nvar indexOf = [].indexOf;\nvar Connection = /*#__PURE__*/function () {\n function Connection(consumer) {\n _classCallCheck(this, Connection);\n this.open = this.open.bind(this);\n this.consumer = consumer;\n this.subscriptions = this.consumer.subscriptions;\n this.monitor = new ConnectionMonitor(this);\n this.disconnected = true;\n }\n _createClass(Connection, [{\n key: \"send\",\n value: function send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data));\n return true;\n } else {\n return false;\n }\n }\n }, {\n key: \"open\",\n value: function open() {\n if (this.isActive()) {\n logger.log(\"Attempted to open WebSocket, but existing socket is \".concat(this.getState()));\n return false;\n } else {\n logger.log(\"Opening WebSocket, current state is \".concat(this.getState(), \", subprotocols: \").concat(protocols));\n if (this.webSocket) {\n this.uninstallEventHandlers();\n }\n this.webSocket = new adapters.WebSocket(this.consumer.url, protocols);\n this.installEventHandlers();\n this.monitor.start();\n return true;\n }\n }\n }, {\n key: \"close\",\n value: function close() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n allowReconnect: true\n },\n allowReconnect = _ref.allowReconnect;\n if (!allowReconnect) {\n this.monitor.stop();\n }\n if (this.isOpen()) {\n return this.webSocket.close();\n }\n }\n }, {\n key: \"reopen\",\n value: function reopen() {\n logger.log(\"Reopening WebSocket, current state is \".concat(this.getState()));\n if (this.isActive()) {\n try {\n return this.close();\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error);\n } finally {\n logger.log(\"Reopening WebSocket in \".concat(this.constructor.reopenDelay, \"ms\"));\n setTimeout(this.open, this.constructor.reopenDelay);\n }\n } else {\n return this.open();\n }\n }\n }, {\n key: \"getProtocol\",\n value: function getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol;\n }\n }\n }, {\n key: \"isOpen\",\n value: function isOpen() {\n return this.isState(\"open\");\n }\n }, {\n key: \"isActive\",\n value: function isActive() {\n return this.isState(\"open\", \"connecting\");\n }\n }, {\n key: \"isProtocolSupported\",\n value: function isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0;\n }\n }, {\n key: \"isState\",\n value: function isState() {\n for (var _len2 = arguments.length, states = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n states[_key2] = arguments[_key2];\n }\n return indexOf.call(states, this.getState()) >= 0;\n }\n }, {\n key: \"getState\",\n value: function getState() {\n if (this.webSocket) {\n for (var state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase();\n }\n }\n }\n return null;\n }\n }, {\n key: \"installEventHandlers\",\n value: function installEventHandlers() {\n for (var eventName in this.events) {\n var handler = this.events[eventName].bind(this);\n this.webSocket[\"on\".concat(eventName)] = handler;\n }\n }\n }, {\n key: \"uninstallEventHandlers\",\n value: function uninstallEventHandlers() {\n for (var eventName in this.events) {\n this.webSocket[\"on\".concat(eventName)] = function () {};\n }\n }\n }]);\n return Connection;\n}();\nConnection.reopenDelay = 500;\nConnection.prototype.events = {\n message: function message(event) {\n if (!this.isProtocolSupported()) {\n return;\n }\n var _JSON$parse = JSON.parse(event.data),\n identifier = _JSON$parse.identifier,\n message = _JSON$parse.message,\n reason = _JSON$parse.reason,\n reconnect = _JSON$parse.reconnect,\n type = _JSON$parse.type;\n switch (type) {\n case message_types.welcome:\n this.monitor.recordConnect();\n return this.subscriptions.reload();\n case message_types.disconnect:\n logger.log(\"Disconnecting. Reason: \".concat(reason));\n return this.close({\n allowReconnect: reconnect\n });\n case message_types.ping:\n return this.monitor.recordPing();\n case message_types.confirmation:\n this.subscriptions.confirmSubscription(identifier);\n return this.subscriptions.notify(identifier, \"connected\");\n case message_types.rejection:\n return this.subscriptions.reject(identifier);\n default:\n return this.subscriptions.notify(identifier, \"received\", message);\n }\n },\n open: function open() {\n logger.log(\"WebSocket onopen event, using '\".concat(this.getProtocol(), \"' subprotocol\"));\n this.disconnected = false;\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\");\n return this.close({\n allowReconnect: false\n });\n }\n },\n close: function close(event) {\n logger.log(\"WebSocket onclose event\");\n if (this.disconnected) {\n return;\n }\n this.disconnected = true;\n this.monitor.recordDisconnect();\n return this.subscriptions.notifyAll(\"disconnected\", {\n willAttemptReconnect: this.monitor.isRunning()\n });\n },\n error: function error() {\n logger.log(\"WebSocket onerror event\");\n }\n};\nvar extend = function extend(object, properties) {\n if (properties != null) {\n for (var key in properties) {\n var value = properties[key];\n object[key] = value;\n }\n }\n return object;\n};\nvar Subscription = /*#__PURE__*/function () {\n function Subscription(consumer) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var mixin = arguments.length > 2 ? arguments[2] : undefined;\n _classCallCheck(this, Subscription);\n this.consumer = consumer;\n this.identifier = JSON.stringify(params);\n extend(this, mixin);\n }\n _createClass(Subscription, [{\n key: \"perform\",\n value: function perform(action) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data.action = action;\n return this.send(data);\n }\n }, {\n key: \"send\",\n value: function send(data) {\n return this.consumer.send({\n command: \"message\",\n identifier: this.identifier,\n data: JSON.stringify(data)\n });\n }\n }, {\n key: \"unsubscribe\",\n value: function unsubscribe() {\n return this.consumer.subscriptions.remove(this);\n }\n }]);\n return Subscription;\n}();\nvar SubscriptionGuarantor = /*#__PURE__*/function () {\n function SubscriptionGuarantor(subscriptions) {\n _classCallCheck(this, SubscriptionGuarantor);\n this.subscriptions = subscriptions;\n this.pendingSubscriptions = [];\n }\n _createClass(SubscriptionGuarantor, [{\n key: \"guarantee\",\n value: function guarantee(subscription) {\n if (this.pendingSubscriptions.indexOf(subscription) == -1) {\n logger.log(\"SubscriptionGuarantor guaranteeing \".concat(subscription.identifier));\n this.pendingSubscriptions.push(subscription);\n } else {\n logger.log(\"SubscriptionGuarantor already guaranteeing \".concat(subscription.identifier));\n }\n this.startGuaranteeing();\n }\n }, {\n key: \"forget\",\n value: function forget(subscription) {\n logger.log(\"SubscriptionGuarantor forgetting \".concat(subscription.identifier));\n this.pendingSubscriptions = this.pendingSubscriptions.filter(function (s) {\n return s !== subscription;\n });\n }\n }, {\n key: \"startGuaranteeing\",\n value: function startGuaranteeing() {\n this.stopGuaranteeing();\n this.retrySubscribing();\n }\n }, {\n key: \"stopGuaranteeing\",\n value: function stopGuaranteeing() {\n clearTimeout(this.retryTimeout);\n }\n }, {\n key: \"retrySubscribing\",\n value: function retrySubscribing() {\n var _this3 = this;\n this.retryTimeout = setTimeout(function () {\n if (_this3.subscriptions && typeof _this3.subscriptions.subscribe === \"function\") {\n _this3.pendingSubscriptions.map(function (subscription) {\n logger.log(\"SubscriptionGuarantor resubscribing \".concat(subscription.identifier));\n _this3.subscriptions.subscribe(subscription);\n });\n }\n }, 500);\n }\n }]);\n return SubscriptionGuarantor;\n}();\nvar Subscriptions = /*#__PURE__*/function () {\n function Subscriptions(consumer) {\n _classCallCheck(this, Subscriptions);\n this.consumer = consumer;\n this.guarantor = new SubscriptionGuarantor(this);\n this.subscriptions = [];\n }\n _createClass(Subscriptions, [{\n key: \"create\",\n value: function create(channelName, mixin) {\n var channel = channelName;\n var params = _typeof(channel) === \"object\" ? channel : {\n channel: channel\n };\n var subscription = new Subscription(this.consumer, params, mixin);\n return this.add(subscription);\n }\n }, {\n key: \"add\",\n value: function add(subscription) {\n this.subscriptions.push(subscription);\n this.consumer.ensureActiveConnection();\n this.notify(subscription, \"initialized\");\n this.subscribe(subscription);\n return subscription;\n }\n }, {\n key: \"remove\",\n value: function remove(subscription) {\n this.forget(subscription);\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\");\n }\n return subscription;\n }\n }, {\n key: \"reject\",\n value: function reject(identifier) {\n var _this4 = this;\n return this.findAll(identifier).map(function (subscription) {\n _this4.forget(subscription);\n _this4.notify(subscription, \"rejected\");\n return subscription;\n });\n }\n }, {\n key: \"forget\",\n value: function forget(subscription) {\n this.guarantor.forget(subscription);\n this.subscriptions = this.subscriptions.filter(function (s) {\n return s !== subscription;\n });\n return subscription;\n }\n }, {\n key: \"findAll\",\n value: function findAll(identifier) {\n return this.subscriptions.filter(function (s) {\n return s.identifier === identifier;\n });\n }\n }, {\n key: \"reload\",\n value: function reload() {\n var _this5 = this;\n return this.subscriptions.map(function (subscription) {\n return _this5.subscribe(subscription);\n });\n }\n }, {\n key: \"notifyAll\",\n value: function notifyAll(callbackName) {\n var _this6 = this;\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return this.subscriptions.map(function (subscription) {\n return _this6.notify.apply(_this6, [subscription, callbackName].concat(args));\n });\n }\n }, {\n key: \"notify\",\n value: function notify(subscription, callbackName) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {\n args[_key4 - 2] = arguments[_key4];\n }\n var subscriptions;\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription);\n } else {\n subscriptions = [subscription];\n }\n return subscriptions.map(function (subscription) {\n return typeof subscription[callbackName] === \"function\" ? subscription[callbackName].apply(subscription, args) : undefined;\n });\n }\n }, {\n key: \"subscribe\",\n value: function subscribe(subscription) {\n if (this.sendCommand(subscription, \"subscribe\")) {\n this.guarantor.guarantee(subscription);\n }\n }\n }, {\n key: \"confirmSubscription\",\n value: function confirmSubscription(identifier) {\n var _this7 = this;\n logger.log(\"Subscription confirmed \".concat(identifier));\n this.findAll(identifier).map(function (subscription) {\n return _this7.guarantor.forget(subscription);\n });\n }\n }, {\n key: \"sendCommand\",\n value: function sendCommand(subscription, command) {\n var identifier = subscription.identifier;\n return this.consumer.send({\n command: command,\n identifier: identifier\n });\n }\n }]);\n return Subscriptions;\n}();\nvar Consumer = /*#__PURE__*/function () {\n function Consumer(url) {\n _classCallCheck(this, Consumer);\n this._url = url;\n this.subscriptions = new Subscriptions(this);\n this.connection = new Connection(this);\n }\n _createClass(Consumer, [{\n key: \"url\",\n get: function get() {\n return createWebSocketURL(this._url);\n }\n }, {\n key: \"send\",\n value: function send(data) {\n return this.connection.send(data);\n }\n }, {\n key: \"connect\",\n value: function connect() {\n return this.connection.open();\n }\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n return this.connection.close({\n allowReconnect: false\n });\n }\n }, {\n key: \"ensureActiveConnection\",\n value: function ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open();\n }\n }\n }]);\n return Consumer;\n}();\nfunction createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url();\n }\n if (url && !/^wss?:/i.test(url)) {\n var a = document.createElement(\"a\");\n a.href = url;\n a.href = a.href;\n a.protocol = a.protocol.replace(\"http\", \"ws\");\n return a.href;\n } else {\n return url;\n }\n}\nfunction createConsumer() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getConfig(\"url\") || INTERNAL.default_mount_path;\n return new Consumer(url);\n}\nfunction getConfig(name) {\n var element = document.head.querySelector(\"meta[name='action-cable-\".concat(name, \"']\"));\n if (element) {\n return element.getAttribute(\"content\");\n }\n}\nexport { Connection, ConnectionMonitor, Consumer, INTERNAL, Subscription, SubscriptionGuarantor, Subscriptions, adapters, createConsumer, createWebSocketURL, getConfig, logger };","// Action Cable provides the framework to deal with WebSockets in Rails.\n// You can generate new channels where WebSocket features live using the `rails generate channel` command.\n\nimport { createConsumer } from '@rails/actioncable'\n\nif (!window.App?.channels) window.App = { channels: {} }\n\nif (!window.App.channels.consumer) window.App.channels.consumer = createConsumer()\n\nexport default window.App.channels.consumer\n","import { subscribeToOrganizationMember } from './organization_member_channel'\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const currentOrganizationTag = getOrganizationTag()\n\n if (currentOrganizationTag) {\n subscribeToOrganizationMember(currentOrganizationTag?.content)\n }\n})\n\nfunction getOrganizationTag() {\n return document.querySelector('meta[name=\"current-organization-id\"]')\n}\n","import consumer from './consumer'\nimport { htmlToElement } from '../javascript/utils'\nimport { recalculateTopNavFeed } from '../javascript/activity-feeds'\n\nexport const subscribeToOrganizationMember = (organization) => {\n const feed = document.querySelector('#topnav-notifications-list')\n\n if (!feed) return\n\n window.App.channels.organizationMember?.unsubscribe()\n\n window.App.channels.organizationMember = consumer.subscriptions.create(\n { channel: 'OrganizationMemberChannel', organization },\n {\n received({ notifications }) {\n if (notifications.feed) {\n feed.innerHTML = notifications.feed\n }\n\n if (notifications.item) {\n feed.prepend(htmlToElement(notifications.item))\n }\n\n recalculateTopNavFeed()\n },\n }\n )\n}\n","// Load all the controllers within this directory and all subdirectories.\n// Controller files must be named *_controller.js.\n\nimport { Application } from '@hotwired/stimulus'\nimport { definitionsFromContext } from '@hotwired/stimulus-webpack-helpers'\n\nwindow.Stimulus = Application.start()\nconst context = require.context('controllers', true, /_controller\\.js$/)\nStimulus.load(definitionsFromContext(context))\n\n// Configure Stimulus development experience\nStimulus.debug = false\n","/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n return context.keys().map(function (key) {\n return definitionForModuleWithContextAndKey(context, key);\n }).filter(function (value) {\n return value;\n });\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n var identifier = identifierForContextKey(key);\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n var controllerConstructor = module.default;\n if (typeof controllerConstructor == \"function\") {\n return {\n identifier: identifier,\n controllerConstructor: controllerConstructor\n };\n }\n}\nfunction identifierForContextKey(key) {\n var logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\nexport { definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey };","// github.com/mattmezza/bulmahead/blob/master/src/bulmahead.js\n\nimport debounce from 'lodash.debounce'\n\nconst bulmahead = (id, idMenu, api, onSelect, delay, minLen = 2) => {\n const input = document.getElementById(id)\n const menuEl = document.getElementById(idMenu)\n\n const toggleMenu = (hide) => {\n menuEl.style.display = hide ? 'none' : 'block'\n }\n\n toggleMenu(true)\n\n const setValue = (e) => {\n e.preventDefault()\n var label = e.target.innerHTML\n input.value = label\n\n if (onSelect) {\n const value = e.target.dataset.value\n const obj = e.target.dataset.obj\n onSelect({ label, value, obj: obj ? JSON.parse(obj) : undefined })\n }\n\n toggleMenu(true)\n\n return false\n }\n\n const handleApi = (e) => {\n const value = e.target.value\n\n if (value.length <= minLen) {\n return\n }\n\n api(value).then((suggestions) => {\n menuEl.innerHTML = ''\n\n const suggestionsEl = suggestions.map(({ label, value, obj }) => {\n const li = document.createElement('li')\n li.classList.add('dropdown-item')\n li.innerHTML = label\n li.dataset.value = value\n if (obj) li.dataset.obj = JSON.stringify(obj)\n return li\n })\n suggestionsEl.map((suggEl) => {\n menuEl.querySelector('ul').appendChild(suggEl)\n })\n\n toggleMenu()\n\n if (!suggestions.length) {\n const noResultsEl = document.createElement('div')\n noResultsEl.classList.add('dropdown-item')\n noResultsEl.innerHTML = 'No results'\n menuEl.childNodes[0].appendChild(noResultsEl)\n }\n })\n }\n input.addEventListener('input', debounce(handleApi, delay))\n\n input.addEventListener('focusin', () => toggleMenu())\n\n menuEl.addEventListener('click', (e) => {\n if (!e.target.classList.contains('dropdown-item')) return\n\n setValue(e)\n })\n\n document.addEventListener('click', (e) => {\n if (!e.target.closest('.dropdown') && (e.target === null || !e.target.classList.contains('dropdown-item'))) {\n toggleMenu(true)\n }\n })\n}\n\nexport default bulmahead\n","import { findElementWithParent } from './utils'\nimport bulmahead from './vendors/bulmahead'\n\nconst fetchCustomers = (query) =>\n fetch(`/customers/search?query=${query}&limit=10`, {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n credentials: 'same-origin',\n })\n .then(function (customers) {\n return customers.json()\n })\n .then(function (customers) {\n return customers.map(function (customer) {\n return { label: `${customer.first_name} ${customer.last_name}`, value: customer.id, obj: customer }\n })\n })\n\nconst toggleCustomerFormPartial = (id, hide) => {\n const el = document.getElementById(id)\n\n if (!el) return\n\n el.classList.toggle('is-hidden', hide)\n\n Array.from(el.querySelectorAll('input')).forEach((e, idx) => {\n if (!e.closest('.boolean')) e.value = null\n e.disabled = hide\n })\n\n el.querySelector(\"input:not([type='hidden'])\").focus()\n}\n\ndocument.addEventListener('click', (e) => {\n const target = findElementWithParent(e, 'customer-fields-button')\n\n if (!target) return\n\n e.preventDefault()\n\n toggleCustomerFormPartial('customer-fields', false)\n\n document.getElementById('customer-search').value = null\n})\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const customerSearch = document.getElementById('customer-search')\n\n if (!customerSearch) return\n\n const onSelect = (state) => {\n toggleCustomerFormPartial('customer-fields', false)\n\n document.getElementById(customerSearch.dataset.targetIdKey).value = state.value\n\n Object.entries(state.obj).forEach(([k, v]) => {\n const f = document.getElementById(`${customerSearch.dataset.targetFieldsKey}_${k}`)\n if (f) f.value = v\n })\n }\n\n bulmahead('customer-search', 'customer-search-menu', fetchCustomers, onSelect, 200, 0)\n})\n"],"sourceRoot":""}