headmin 0.2.3 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.nvmrc +1 -1
- data/Gemfile.lock +3 -3
- data/README.md +10 -7
- data/app/helpers/headmin/admin_helper.rb +3 -59
- data/app/helpers/headmin/bootstrap_helper.rb +9 -0
- data/app/helpers/headmin/filter_helper.rb +7 -3
- data/app/helpers/headmin/form_helper.rb +36 -0
- data/app/helpers/headmin/request_helper.rb +39 -0
- data/app/models/concerns/headmin/fieldable.rb +53 -23
- data/app/services/block_service.rb +8 -4
- data/app/views/headmin/_blocks.html.erb +1 -1
- data/app/views/headmin/_filters.html.erb +1 -1
- data/app/views/headmin/_pagination.html.erb +4 -1
- data/app/views/headmin/dropdown/_devise.html.erb +20 -10
- data/app/views/headmin/dropdown/_list.html.erb +17 -7
- data/app/views/headmin/filters/_select.html.erb +3 -2
- data/app/views/headmin/filters/filter/_button.html.erb +0 -1
- data/app/views/headmin/forms/_blocks.html.erb +11 -4
- data/app/views/headmin/forms/_date.html.erb +1 -1
- data/app/views/headmin/forms/_label.html.erb +2 -2
- data/app/views/headmin/forms/_repeater.html.erb +6 -10
- data/app/views/headmin/table/_actions.html.erb +37 -11
- data/app/views/headmin/views/devise/confirmations/_new.html.erb +1 -1
- data/app/views/headmin/views/devise/passwords/_edit.html.erb +2 -2
- data/app/views/headmin/views/devise/passwords/_new.html.erb +1 -1
- data/app/views/headmin/views/devise/registrations/_edit.html.erb +4 -4
- data/app/views/headmin/views/devise/registrations/_new.html.erb +3 -3
- data/app/views/headmin/views/devise/shared/_links.html.erb +7 -7
- data/app/views/headmin/views/devise/unlocks/_new.html.erb +1 -1
- data/config/locales/activerecord/en.yml +9 -0
- data/config/locales/activerecord/nl.yml +9 -0
- data/config/locales/headmin/table/en.yml +5 -1
- data/config/locales/headmin/table/nl.yml +5 -1
- data/config/locales/headmin/views/en.yml +1 -1
- data/config/locales/headmin/views/nl.yml +14 -14
- data/dist/css/headmin.css +54 -13
- data/dist/js/headmin.js +45 -513
- data/docs/blocks-and-fields.md +54 -0
- data/docs/blocks.md +1 -54
- data/docs/devise.md +40 -2
- data/docs/fields.md +31 -9
- data/headmin.gemspec +1 -1
- data/lib/generators/headmin/blocks_generator.rb +4 -1
- data/lib/generators/headmin/devise_generator.rb +16 -0
- data/lib/generators/headmin/fields_generator.rb +5 -1
- data/lib/generators/templates/controllers/auth/confirmations_controller.rb +31 -0
- data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +31 -0
- data/lib/generators/templates/controllers/auth/passwords_controller.rb +35 -0
- data/lib/generators/templates/controllers/auth/registrations_controller.rb +63 -0
- data/lib/generators/templates/controllers/auth/sessions_controller.rb +28 -0
- data/lib/generators/templates/controllers/auth/unlocks_controller.rb +31 -0
- data/lib/generators/templates/migrations/create_field_hierarchies.rb +16 -0
- data/lib/generators/templates/views/auth/confirmations/new.html.erb +1 -0
- data/lib/generators/templates/views/auth/mailer/confirmation_instructions.html.erb +1 -0
- data/lib/generators/templates/views/auth/mailer/email_changed.html.erb +1 -0
- data/lib/generators/templates/views/auth/mailer/password_change.html.erb +1 -0
- data/lib/generators/templates/views/auth/mailer/reset_password_instructions.html.erb +1 -0
- data/lib/generators/templates/views/auth/mailer/unlock_instructions.html.erb +1 -0
- data/lib/generators/templates/views/auth/passwords/edit.html.erb +1 -0
- data/lib/generators/templates/views/auth/passwords/new.html.erb +1 -0
- data/lib/generators/templates/views/auth/registrations/edit.html.erb +1 -0
- data/lib/generators/templates/views/auth/registrations/new.html.erb +1 -0
- data/lib/generators/templates/views/auth/sessions/new.html.erb +1 -0
- data/lib/generators/templates/views/auth/unlocks/new.html.erb +1 -0
- data/lib/generators/templates/views/layouts/auth.html.erb +20 -0
- data/lib/headmin/version.rb +1 -1
- data/package.json +4 -3
- data/src/js/headmin/controllers/blocks_controller.js +1 -1
- data/src/js/headmin/controllers/filter_controller.js +1 -1
- data/src/js/headmin/controllers/filters_controller.js +1 -1
- data/src/js/headmin/controllers/popup_controller.js +1 -1
- data/src/js/headmin/controllers/repeater_controller.js +9 -10
- data/src/js/headmin/controllers/table_actions_controller.js +104 -9
- data/src/js/headmin/controllers/table_controller.js +28 -57
- data/src/js/headmin/headmin.js +2 -2
- data/src/scss/headmin/table.scss +1 -0
- data/yarn.lock +1159 -1237
- metadata +33 -7
- data/docs/README.md +0 -5
data/dist/js/headmin.js
CHANGED
@@ -86,6 +86,30 @@
|
|
86
86
|
/************************************************************************/
|
87
87
|
/******/ ({
|
88
88
|
|
89
|
+
/***/ "./node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js":
|
90
|
+
/*!******************************************************************************************!*\
|
91
|
+
!*** ./node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js ***!
|
92
|
+
\******************************************************************************************/
|
93
|
+
/*! exports provided: definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey */
|
94
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95
|
+
|
96
|
+
"use strict";
|
97
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"definitionForModuleAndIdentifier\", function() { return definitionForModuleAndIdentifier; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"definitionForModuleWithContextAndKey\", function() { return definitionForModuleWithContextAndKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"definitionsFromContext\", function() { return definitionsFromContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identifierForContextKey\", function() { return identifierForContextKey; });\n/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n return context.keys()\n .map((key) => definitionForModuleWithContextAndKey(context, key))\n .filter((value) => value);\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n const identifier = identifierForContextKey(key);\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n const controllerConstructor = module.default;\n if (typeof controllerConstructor == \"function\") {\n return { identifier, controllerConstructor };\n }\n}\nfunction identifierForContextKey(key) {\n const logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js?");
|
98
|
+
|
99
|
+
/***/ }),
|
100
|
+
|
101
|
+
/***/ "./node_modules/@hotwired/stimulus/dist/stimulus.js":
|
102
|
+
/*!**********************************************************!*\
|
103
|
+
!*** ./node_modules/@hotwired/stimulus/dist/stimulus.js ***!
|
104
|
+
\**********************************************************/
|
105
|
+
/*! exports provided: Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune */
|
106
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
107
|
+
|
108
|
+
"use strict";
|
109
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Application\", function() { return Application; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AttributeObserver\", function() { return AttributeObserver; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Context\", function() { return Context; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Controller\", function() { return Controller; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ElementObserver\", function() { return ElementObserver; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IndexedMultimap\", function() { return IndexedMultimap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Multimap\", function() { return Multimap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StringMapObserver\", function() { return StringMapObserver; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TokenListObserver\", function() { return TokenListObserver; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ValueListObserver\", function() { return ValueListObserver; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultSchema\", function() { return defaultSchema; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"del\", function() { return del; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fetch\", function() { return fetch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prune\", function() { return prune; });\n/*\nStimulus 3.0.1\nCopyright © 2021 Basecamp, LLC\n */\nclass EventListener {\n constructor(eventTarget, eventName, eventOptions) {\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n connect() {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n }\n disconnect() {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n }\n bindingConnected(binding) {\n this.unorderedBindings.add(binding);\n }\n bindingDisconnected(binding) {\n this.unorderedBindings.delete(binding);\n }\n handleEvent(event) {\n const extendedEvent = extendEvent(event);\n for (const binding of this.bindings) {\n if (extendedEvent.immediatePropagationStopped) {\n break;\n }\n else {\n binding.handleEvent(extendedEvent);\n }\n }\n }\n get bindings() {\n return Array.from(this.unorderedBindings).sort((left, right) => {\n const leftIndex = left.index, rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n }\n}\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n }\n else {\n const { stopImmediatePropagation } = event;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation() {\n this.immediatePropagationStopped = true;\n stopImmediatePropagation.call(this);\n }\n });\n }\n}\n\nclass Dispatcher {\n constructor(application) {\n this.application = application;\n this.eventListenerMaps = new Map;\n this.started = false;\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach(eventListener => eventListener.connect());\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach(eventListener => eventListener.disconnect());\n }\n }\n get eventListeners() {\n return Array.from(this.eventListenerMaps.values())\n .reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n }\n bindingConnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n }\n bindingDisconnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n }\n handleError(error, message, detail = {}) {\n this.application.handleError(error, `Error ${message}`, detail);\n }\n fetchEventListenerForBinding(binding) {\n const { eventTarget, eventName, eventOptions } = binding;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n }\n fetchEventListener(eventTarget, eventName, eventOptions) {\n const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n const cacheKey = this.cacheKey(eventName, eventOptions);\n let 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 createEventListener(eventTarget, eventName, eventOptions) {\n const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n if (this.started) {\n eventListener.connect();\n }\n return eventListener;\n }\n fetchEventListenerMapForEventTarget(eventTarget) {\n let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n if (!eventListenerMap) {\n eventListenerMap = new Map;\n this.eventListenerMaps.set(eventTarget, eventListenerMap);\n }\n return eventListenerMap;\n }\n cacheKey(eventName, eventOptions) {\n const parts = [eventName];\n Object.keys(eventOptions).sort().forEach(key => {\n parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n });\n return parts.join(\":\");\n }\n}\n\nconst descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n const source = descriptorString.trim();\n const matches = source.match(descriptorPattern) || [];\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName: matches[2],\n eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},\n identifier: matches[5],\n methodName: matches[7]\n };\n}\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n }\n else if (eventTargetName == \"document\") {\n return document;\n }\n}\nfunction parseEventOptions(eventOptions) {\n return eventOptions.split(\":\").reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n }\n else if (eventTarget == document) {\n return \"document\";\n }\n}\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n return value.match(/[^\\s]+/g) || [];\n}\n\nclass Action {\n constructor(element, index, descriptor) {\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 }\n static forToken(token) {\n return new this(token.element, token.index, parseActionDescriptorString(token.content));\n }\n toString() {\n const eventNameSuffix = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n return `${this.eventName}${eventNameSuffix}->${this.identifier}#${this.methodName}`;\n }\n get params() {\n if (this.eventTarget instanceof Element) {\n return this.getParamsFromEventTargetAttributes(this.eventTarget);\n }\n else {\n return {};\n }\n }\n getParamsFromEventTargetAttributes(eventTarget) {\n const params = {};\n const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`);\n const attributes = Array.from(eventTarget.attributes);\n attributes.forEach(({ name, value }) => {\n const match = name.match(pattern);\n const key = match && match[1];\n if (key) {\n Object.assign(params, { [camelize(key)]: typecast(value) });\n }\n });\n return params;\n }\n get eventTargetName() {\n return stringifyEventTarget(this.eventTarget);\n }\n}\nconst defaultEventNames = {\n \"a\": e => \"click\",\n \"button\": e => \"click\",\n \"form\": e => \"submit\",\n \"details\": e => \"toggle\",\n \"input\": e => e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\",\n \"select\": e => \"change\",\n \"textarea\": e => \"input\"\n};\nfunction getDefaultEventNameForElement(element) {\n const 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 }\n catch (o_O) {\n return value;\n }\n}\n\nclass Binding {\n constructor(context, action) {\n this.context = context;\n this.action = action;\n }\n get index() {\n return this.action.index;\n }\n get eventTarget() {\n return this.action.eventTarget;\n }\n get eventOptions() {\n return this.action.eventOptions;\n }\n get identifier() {\n return this.context.identifier;\n }\n handleEvent(event) {\n if (this.willBeInvokedByEvent(event)) {\n this.invokeWithEvent(event);\n }\n }\n get eventName() {\n return this.action.eventName;\n }\n get method() {\n const method = this.controller[this.methodName];\n if (typeof method == \"function\") {\n return method;\n }\n throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n }\n invokeWithEvent(event) {\n const { target, currentTarget } = event;\n try {\n const { params } = this.action;\n const actionEvent = Object.assign(event, { params });\n this.method.call(this.controller, actionEvent);\n this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n }\n catch (error) {\n const { identifier, controller, element, index } = this;\n const detail = { identifier, controller, element, index, event };\n this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n }\n }\n willBeInvokedByEvent(event) {\n const eventTarget = event.target;\n if (this.element === eventTarget) {\n return true;\n }\n else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n }\n else {\n return this.scope.containsElement(this.action.element);\n }\n }\n get controller() {\n return this.context.controller;\n }\n get methodName() {\n return this.action.methodName;\n }\n get element() {\n return this.scope.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nclass ElementObserver {\n constructor(element, delegate) {\n this.mutationObserverInit = { attributes: true, childList: true, subtree: true };\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set;\n this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.refresh();\n }\n }\n 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 stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n const matches = new Set(this.matchElementsInTree());\n for (const element of Array.from(this.elements)) {\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n for (const element of Array.from(matches)) {\n this.addElement(element);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n }\n else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n }\n processAttributeChange(node, attributeName) {\n const element = node;\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n }\n else {\n this.removeElement(element);\n }\n }\n else if (this.matchElement(element)) {\n this.addElement(element);\n }\n }\n processRemovedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n }\n processAddedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n }\n matchElement(element) {\n return this.delegate.matchElement(element);\n }\n matchElementsInTree(tree = this.element) {\n return this.delegate.matchElementsInTree(tree);\n }\n processTree(tree, processor) {\n for (const element of this.matchElementsInTree(tree)) {\n processor.call(this, element);\n }\n }\n elementFromNode(node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n }\n elementIsActive(element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n }\n else {\n return this.element.contains(element);\n }\n }\n 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 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\nclass AttributeObserver {\n constructor(element, attributeName, delegate) {\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new ElementObserver(element, this);\n }\n get element() {\n return this.elementObserver.element;\n }\n get selector() {\n return `[${this.attributeName}]`;\n }\n start() {\n this.elementObserver.start();\n }\n pause(callback) {\n this.elementObserver.pause(callback);\n }\n stop() {\n this.elementObserver.stop();\n }\n refresh() {\n this.elementObserver.refresh();\n }\n get started() {\n return this.elementObserver.started;\n }\n matchElement(element) {\n return element.hasAttribute(this.attributeName);\n }\n matchElementsInTree(tree) {\n const match = this.matchElement(tree) ? [tree] : [];\n const matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n }\n elementMatched(element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n }\n elementUnmatched(element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n }\n elementAttributeChanged(element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n }\n}\n\nclass StringMapObserver {\n constructor(element, delegate) {\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map;\n this.mutationObserver = new MutationObserver(mutations => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n this.refresh();\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n for (const attributeName of this.knownAttributeNames) {\n this.refreshAttribute(attributeName, null);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n const attributeName = mutation.attributeName;\n if (attributeName) {\n this.refreshAttribute(attributeName, mutation.oldValue);\n }\n }\n refreshAttribute(attributeName, oldValue) {\n const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n if (key != null) {\n if (!this.stringMap.has(attributeName)) {\n this.stringMapKeyAdded(key, attributeName);\n }\n const value = this.element.getAttribute(attributeName);\n if (this.stringMap.get(attributeName) != value) {\n this.stringMapValueChanged(value, key, oldValue);\n }\n if (value == null) {\n const oldValue = this.stringMap.get(attributeName);\n this.stringMap.delete(attributeName);\n if (oldValue)\n this.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n else {\n this.stringMap.set(attributeName, value);\n }\n }\n }\n stringMapKeyAdded(key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n }\n stringMapValueChanged(value, key, oldValue) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key, oldValue);\n }\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n }\n get knownAttributeNames() {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n }\n get currentAttributeNames() {\n return Array.from(this.element.attributes).map(attribute => attribute.name);\n }\n get recordedAttributeNames() {\n return Array.from(this.stringMap.keys());\n }\n}\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 let 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 const values = map.get(key);\n if (values != null && values.size == 0) {\n map.delete(key);\n }\n}\n\nclass Multimap {\n constructor() {\n this.valuesByKey = new Map();\n }\n get keys() {\n return Array.from(this.valuesByKey.keys());\n }\n get values() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n }\n get size() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((size, set) => size + set.size, 0);\n }\n add(key, value) {\n add(this.valuesByKey, key, value);\n }\n delete(key, value) {\n del(this.valuesByKey, key, value);\n }\n has(key, value) {\n const values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n }\n hasKey(key) {\n return this.valuesByKey.has(key);\n }\n hasValue(value) {\n const sets = Array.from(this.valuesByKey.values());\n return sets.some(set => set.has(value));\n }\n getValuesForKey(key) {\n const values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n }\n getKeysForValue(value) {\n return Array.from(this.valuesByKey)\n .filter(([key, values]) => values.has(value))\n .map(([key, values]) => key);\n }\n}\n\nclass IndexedMultimap extends Multimap {\n constructor() {\n super();\n this.keysByValue = new Map;\n }\n get values() {\n return Array.from(this.keysByValue.keys());\n }\n add(key, value) {\n super.add(key, value);\n add(this.keysByValue, value, key);\n }\n delete(key, value) {\n super.delete(key, value);\n del(this.keysByValue, value, key);\n }\n hasValue(value) {\n return this.keysByValue.has(value);\n }\n getKeysForValue(value) {\n const set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n }\n}\n\nclass TokenListObserver {\n constructor(element, attributeName, delegate) {\n this.attributeObserver = new AttributeObserver(element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new Multimap;\n }\n get started() {\n return this.attributeObserver.started;\n }\n start() {\n this.attributeObserver.start();\n }\n pause(callback) {\n this.attributeObserver.pause(callback);\n }\n stop() {\n this.attributeObserver.stop();\n }\n refresh() {\n this.attributeObserver.refresh();\n }\n get element() {\n return this.attributeObserver.element;\n }\n get attributeName() {\n return this.attributeObserver.attributeName;\n }\n elementMatchedAttribute(element) {\n this.tokensMatched(this.readTokensForElement(element));\n }\n elementAttributeValueChanged(element) {\n const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n }\n elementUnmatchedAttribute(element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n }\n tokensMatched(tokens) {\n tokens.forEach(token => this.tokenMatched(token));\n }\n tokensUnmatched(tokens) {\n tokens.forEach(token => this.tokenUnmatched(token));\n }\n tokenMatched(token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n }\n tokenUnmatched(token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n }\n refreshTokensForElement(element) {\n const previousTokens = this.tokensByElement.getValuesForKey(element);\n const currentTokens = this.readTokensForElement(element);\n const firstDifferingIndex = zip(previousTokens, currentTokens)\n .findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n if (firstDifferingIndex == -1) {\n return [[], []];\n }\n else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n }\n readTokensForElement(element) {\n const attributeName = this.attributeName;\n const tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString.trim().split(/\\s+/).filter(content => content.length)\n .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n const length = Math.max(left.length, right.length);\n return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n constructor(element, attributeName, delegate) {\n this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap;\n this.valuesByTokenByElement = new WeakMap;\n }\n get started() {\n return this.tokenListObserver.started;\n }\n start() {\n this.tokenListObserver.start();\n }\n stop() {\n this.tokenListObserver.stop();\n }\n refresh() {\n this.tokenListObserver.refresh();\n }\n get element() {\n return this.tokenListObserver.element;\n }\n get attributeName() {\n return this.tokenListObserver.attributeName;\n }\n tokenMatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n }\n tokenUnmatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n }\n fetchParseResultForToken(token) {\n let 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 fetchValuesByTokenForElement(element) {\n let valuesByToken = this.valuesByTokenByElement.get(element);\n if (!valuesByToken) {\n valuesByToken = new Map;\n this.valuesByTokenByElement.set(element, valuesByToken);\n }\n return valuesByToken;\n }\n parseToken(token) {\n try {\n const value = this.delegate.parseValueForToken(token);\n return { value };\n }\n catch (error) {\n return { error };\n }\n }\n}\n\nclass BindingObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map;\n }\n start() {\n if (!this.valueListObserver) {\n this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n }\n stop() {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n }\n get element() {\n return this.context.element;\n }\n get identifier() {\n return this.context.identifier;\n }\n get actionAttribute() {\n return this.schema.actionAttribute;\n }\n get schema() {\n return this.context.schema;\n }\n get bindings() {\n return Array.from(this.bindingsByAction.values());\n }\n connectAction(action) {\n const binding = new Binding(this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n }\n disconnectAction(action) {\n const binding = this.bindingsByAction.get(action);\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n }\n disconnectAllActions() {\n this.bindings.forEach(binding => this.delegate.bindingDisconnected(binding));\n this.bindingsByAction.clear();\n }\n parseValueForToken(token) {\n const action = Action.forToken(token);\n if (action.identifier == this.identifier) {\n return action;\n }\n }\n elementMatchedValue(element, action) {\n this.connectAction(action);\n }\n elementUnmatchedValue(element, action) {\n this.disconnectAction(action);\n }\n}\n\nclass ValueObserver {\n constructor(context, receiver) {\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new StringMapObserver(this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n this.invokeChangedCallbacksForDefaultValues();\n }\n start() {\n this.stringMapObserver.start();\n }\n stop() {\n this.stringMapObserver.stop();\n }\n get element() {\n return this.context.element;\n }\n get controller() {\n return this.context.controller;\n }\n getStringMapKeyForAttribute(attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n }\n stringMapKeyAdded(key, attributeName) {\n const 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 stringMapValueChanged(value, name, oldValue) {\n const descriptor = this.valueDescriptorNameMap[name];\n if (value === null)\n return;\n if (oldValue === null) {\n oldValue = descriptor.writer(descriptor.defaultValue);\n }\n this.invokeChangedCallback(name, value, oldValue);\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n const descriptor = this.valueDescriptorNameMap[key];\n if (this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n }\n else {\n this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n }\n }\n invokeChangedCallbacksForDefaultValues() {\n for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallback(name, writer(defaultValue), undefined);\n }\n }\n }\n invokeChangedCallback(name, rawValue, rawOldValue) {\n const changedMethodName = `${name}Changed`;\n const changedMethod = this.receiver[changedMethodName];\n if (typeof changedMethod == \"function\") {\n const descriptor = this.valueDescriptorNameMap[name];\n const value = descriptor.reader(rawValue);\n let oldValue = rawOldValue;\n if (rawOldValue) {\n oldValue = descriptor.reader(rawOldValue);\n }\n changedMethod.call(this.receiver, value, oldValue);\n }\n }\n get valueDescriptors() {\n const { valueDescriptorMap } = this;\n return Object.keys(valueDescriptorMap).map(key => valueDescriptorMap[key]);\n }\n get valueDescriptorNameMap() {\n const descriptors = {};\n Object.keys(this.valueDescriptorMap).forEach(key => {\n const descriptor = this.valueDescriptorMap[key];\n descriptors[descriptor.name] = descriptor;\n });\n return descriptors;\n }\n hasValue(attributeName) {\n const descriptor = this.valueDescriptorNameMap[attributeName];\n const hasMethodName = `has${capitalize(descriptor.name)}`;\n return this.receiver[hasMethodName];\n }\n}\n\nclass TargetObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.targetsByName = new Multimap;\n }\n start() {\n if (!this.tokenListObserver) {\n this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n this.tokenListObserver.start();\n }\n }\n stop() {\n if (this.tokenListObserver) {\n this.disconnectAllTargets();\n this.tokenListObserver.stop();\n delete this.tokenListObserver;\n }\n }\n tokenMatched({ element, content: name }) {\n if (this.scope.containsElement(element)) {\n this.connectTarget(element, name);\n }\n }\n tokenUnmatched({ element, content: name }) {\n this.disconnectTarget(element, name);\n }\n connectTarget(element, name) {\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(() => this.delegate.targetConnected(element, name));\n }\n }\n disconnectTarget(element, name) {\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(() => this.delegate.targetDisconnected(element, name));\n }\n }\n disconnectAllTargets() {\n for (const name of this.targetsByName.keys) {\n for (const element of this.targetsByName.getValuesForKey(name)) {\n this.disconnectTarget(element, name);\n }\n }\n }\n get attributeName() {\n return `data-${this.context.identifier}-target`;\n }\n get element() {\n return this.context.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nclass Context {\n constructor(module, scope) {\n this.logDebugActivity = (functionName, detail = {}) => {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.logDebugActivity(this.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 try {\n this.controller.initialize();\n this.logDebugActivity(\"initialize\");\n }\n catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n connect() {\n this.bindingObserver.start();\n this.valueObserver.start();\n this.targetObserver.start();\n try {\n this.controller.connect();\n this.logDebugActivity(\"connect\");\n }\n catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n }\n disconnect() {\n try {\n this.controller.disconnect();\n this.logDebugActivity(\"disconnect\");\n }\n catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n this.targetObserver.stop();\n this.valueObserver.stop();\n this.bindingObserver.stop();\n }\n get application() {\n return this.module.application;\n }\n get identifier() {\n return this.module.identifier;\n }\n get schema() {\n return this.application.schema;\n }\n get dispatcher() {\n return this.application.dispatcher;\n }\n get element() {\n return this.scope.element;\n }\n get parentElement() {\n return this.element.parentElement;\n }\n handleError(error, message, detail = {}) {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.handleError(error, `Error ${message}`, detail);\n }\n targetConnected(element, name) {\n this.invokeControllerMethod(`${name}TargetConnected`, element);\n }\n targetDisconnected(element, name) {\n this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n }\n invokeControllerMethod(methodName, ...args) {\n const controller = this.controller;\n if (typeof controller[methodName] == \"function\") {\n controller[methodName](...args);\n }\n }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce((values, constructor) => {\n getOwnStaticArrayValues(constructor, propertyName).forEach(name => values.add(name));\n return values;\n }, new Set));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce((pairs, constructor) => {\n pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n return pairs;\n }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n const ancestors = [];\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n const definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n const definition = constructor[propertyName];\n return definition ? Object.keys(definition).map(key => [key, definition[key]]) : [];\n}\n\nfunction bless(constructor) {\n return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n const shadowConstructor = extend(constructor);\n const shadowProperties = getShadowProperties(constructor.prototype, properties);\n Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n return blessings.reduce((blessedProperties, blessing) => {\n const properties = blessing(constructor);\n for (const key in properties) {\n const 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((shadowProperties, key) => {\n const descriptor = getShadowedDescriptor(prototype, properties, key);\n if (descriptor) {\n Object.assign(shadowProperties, { [key]: descriptor });\n }\n return shadowProperties;\n }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n if (!shadowedByValue) {\n const 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}\nconst getOwnKeys = (() => {\n if (typeof Object.getOwnPropertySymbols == \"function\") {\n return (object) => [\n ...Object.getOwnPropertyNames(object),\n ...Object.getOwnPropertySymbols(object)\n ];\n }\n else {\n return Object.getOwnPropertyNames;\n }\n})();\nconst extend = (() => {\n function extendWithReflect(constructor) {\n function extended() {\n return Reflect.construct(constructor, arguments, new.target);\n }\n extended.prototype = Object.create(constructor.prototype, {\n constructor: { value: extended }\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n function testReflectExtension() {\n const a = function () { this.a.call(this); };\n const b = extendWithReflect(a);\n b.prototype.a = function () { };\n return new b;\n }\n try {\n testReflectExtension();\n return extendWithReflect;\n }\n catch (error) {\n return (constructor) => class extended extends constructor {\n };\n }\n})();\n\nfunction blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: bless(definition.controllerConstructor)\n };\n}\n\nclass Module {\n constructor(application, definition) {\n this.application = application;\n this.definition = blessDefinition(definition);\n this.contextsByScope = new WeakMap;\n this.connectedContexts = new Set;\n }\n get identifier() {\n return this.definition.identifier;\n }\n get controllerConstructor() {\n return this.definition.controllerConstructor;\n }\n get contexts() {\n return Array.from(this.connectedContexts);\n }\n connectContextForScope(scope) {\n const context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n }\n disconnectContextForScope(scope) {\n const context = this.contextsByScope.get(scope);\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n }\n fetchContextForScope(scope) {\n let 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\nclass ClassMap {\n constructor(scope) {\n this.scope = scope;\n }\n has(name) {\n return this.data.has(this.getDataKey(name));\n }\n get(name) {\n return this.getAll(name)[0];\n }\n getAll(name) {\n const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n return tokenize(tokenString);\n }\n getAttributeName(name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n }\n getDataKey(name) {\n return `${name}-class`;\n }\n get data() {\n return this.scope.data;\n }\n}\n\nclass DataMap {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n }\n set(key, value) {\n const name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n }\n has(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n }\n delete(key) {\n if (this.has(key)) {\n const name = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name);\n return true;\n }\n else {\n return false;\n }\n }\n getAttributeNameForKey(key) {\n return `data-${this.identifier}-${dasherize(key)}`;\n }\n}\n\nclass Guide {\n constructor(logger) {\n this.warnedKeysByObject = new WeakMap;\n this.logger = logger;\n }\n warn(object, key, message) {\n let 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\nfunction attributeValueContainsToken(attributeName, token) {\n return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get schema() {\n return this.scope.schema;\n }\n has(targetName) {\n return this.find(targetName) != null;\n }\n find(...targetNames) {\n return targetNames.reduce((target, targetName) => target\n || this.findTarget(targetName)\n || this.findLegacyTarget(targetName), undefined);\n }\n findAll(...targetNames) {\n return targetNames.reduce((targets, targetName) => [\n ...targets,\n ...this.findAllTargets(targetName),\n ...this.findAllLegacyTargets(targetName)\n ], []);\n }\n findTarget(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n }\n findAllTargets(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n }\n getSelectorForTargetName(targetName) {\n const attributeName = this.schema.targetAttributeForScope(this.identifier);\n return attributeValueContainsToken(attributeName, targetName);\n }\n findLegacyTarget(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n }\n findAllLegacyTargets(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map(element => this.deprecate(element, targetName));\n }\n getLegacySelectorForTargetName(targetName) {\n const targetDescriptor = `${this.identifier}.${targetName}`;\n return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n }\n deprecate(element, targetName) {\n if (element) {\n const { identifier } = this;\n const attributeName = this.schema.targetAttribute;\n const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n }\n return element;\n }\n get guide() {\n return this.scope.guide;\n }\n}\n\nclass Scope {\n constructor(schema, element, identifier, logger) {\n this.targets = new TargetSet(this);\n this.classes = new ClassMap(this);\n this.data = new DataMap(this);\n this.containsElement = (element) => {\n return element.closest(this.controllerSelector) === this.element;\n };\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new Guide(logger);\n }\n findElement(selector) {\n return this.element.matches(selector)\n ? this.element\n : this.queryElements(selector).find(this.containsElement);\n }\n findAllElements(selector) {\n return [\n ...this.element.matches(selector) ? [this.element] : [],\n ...this.queryElements(selector).filter(this.containsElement)\n ];\n }\n queryElements(selector) {\n return Array.from(this.element.querySelectorAll(selector));\n }\n get controllerSelector() {\n return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n }\n}\n\nclass ScopeObserver {\n constructor(element, schema, delegate) {\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 start() {\n this.valueListObserver.start();\n }\n stop() {\n this.valueListObserver.stop();\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n parseValueForToken(token) {\n const { element, content: identifier } = token;\n const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n let 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 elementMatchedValue(element, value) {\n const 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 elementUnmatchedValue(element, value) {\n const 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 fetchScopesByIdentifierForElement(element) {\n let 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\nclass Router {\n constructor(application) {\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 get element() {\n return this.application.element;\n }\n get schema() {\n return this.application.schema;\n }\n get logger() {\n return this.application.logger;\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n get modules() {\n return Array.from(this.modulesByIdentifier.values());\n }\n get contexts() {\n return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n }\n start() {\n this.scopeObserver.start();\n }\n stop() {\n this.scopeObserver.stop();\n }\n loadDefinition(definition) {\n this.unloadIdentifier(definition.identifier);\n const module = new Module(this.application, definition);\n this.connectModule(module);\n }\n unloadIdentifier(identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n this.disconnectModule(module);\n }\n }\n getContextForElementAndIdentifier(element, identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n return module.contexts.find(context => context.element == element);\n }\n }\n handleError(error, message, detail) {\n this.application.handleError(error, message, detail);\n }\n createScopeForElementAndIdentifier(element, identifier) {\n return new Scope(this.schema, element, identifier, this.logger);\n }\n scopeConnected(scope) {\n this.scopesByIdentifier.add(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.connectContextForScope(scope);\n }\n }\n scopeDisconnected(scope) {\n this.scopesByIdentifier.delete(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.disconnectContextForScope(scope);\n }\n }\n connectModule(module) {\n this.modulesByIdentifier.set(module.identifier, module);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(scope => module.connectContextForScope(scope));\n }\n disconnectModule(module) {\n this.modulesByIdentifier.delete(module.identifier);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(scope => module.disconnectContextForScope(scope));\n }\n}\n\nconst defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\",\n targetAttributeForScope: identifier => `data-${identifier}-target`\n};\n\nclass Application {\n constructor(element = document.documentElement, schema = defaultSchema) {\n this.logger = console;\n this.debug = false;\n this.logDebugActivity = (identifier, functionName, detail = {}) => {\n if (this.debug) {\n this.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 }\n static start(element, schema) {\n const application = new Application(element, schema);\n application.start();\n return application;\n }\n async start() {\n await domReady();\n this.logDebugActivity(\"application\", \"starting\");\n this.dispatcher.start();\n this.router.start();\n this.logDebugActivity(\"application\", \"start\");\n }\n stop() {\n this.logDebugActivity(\"application\", \"stopping\");\n this.dispatcher.stop();\n this.router.stop();\n this.logDebugActivity(\"application\", \"stop\");\n }\n register(identifier, controllerConstructor) {\n if (controllerConstructor.shouldLoad) {\n this.load({ identifier, controllerConstructor });\n }\n }\n load(head, ...rest) {\n const definitions = Array.isArray(head) ? head : [head, ...rest];\n definitions.forEach(definition => this.router.loadDefinition(definition));\n }\n unload(head, ...rest) {\n const identifiers = Array.isArray(head) ? head : [head, ...rest];\n identifiers.forEach(identifier => this.router.unloadIdentifier(identifier));\n }\n get controllers() {\n return this.router.contexts.map(context => context.controller);\n }\n getControllerForElementAndIdentifier(element, identifier) {\n const context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n }\n 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 logFormattedMessage(identifier, functionName, detail = {}) {\n detail = Object.assign({ application: this }, detail);\n this.logger.groupCollapsed(`${identifier} #${functionName}`);\n this.logger.log(\"details:\", Object.assign({}, detail));\n this.logger.groupEnd();\n }\n}\nfunction domReady() {\n return new Promise(resolve => {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => resolve());\n }\n else {\n resolve();\n }\n });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce((properties, classDefinition) => {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\nfunction propertiesForClassDefinition(key) {\n return {\n [`${key}Class`]: {\n get() {\n const { classes } = this;\n if (classes.has(key)) {\n return classes.get(key);\n }\n else {\n const attribute = classes.getAttributeName(key);\n throw new Error(`Missing attribute \"${attribute}\"`);\n }\n }\n },\n [`${key}Classes`]: {\n get() {\n return this.classes.getAll(key);\n }\n },\n [`has${capitalize(key)}Class`]: {\n get() {\n return this.classes.has(key);\n }\n }\n };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce((properties, targetDefinition) => {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n return {\n [`${name}Target`]: {\n get() {\n const target = this.targets.find(name);\n if (target) {\n return target;\n }\n else {\n throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n }\n }\n },\n [`${name}Targets`]: {\n get() {\n return this.targets.findAll(name);\n }\n },\n [`has${capitalize(name)}Target`]: {\n get() {\n return this.targets.has(name);\n }\n }\n };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n const propertyDescriptorMap = {\n valueDescriptorMap: {\n get() {\n return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);\n const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, { [attributeName]: valueDescriptor });\n }, {});\n }\n }\n };\n return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair) {\n const definition = parseValueDefinitionPair(valueDefinitionPair);\n const { key, name, reader: read, writer: write } = definition;\n return {\n [name]: {\n get() {\n const value = this.data.get(key);\n if (value !== null) {\n return read(value);\n }\n else {\n return definition.defaultValue;\n }\n },\n set(value) {\n if (value === undefined) {\n this.data.delete(key);\n }\n else {\n this.data.set(key, write(value));\n }\n }\n },\n [`has${capitalize(name)}`]: {\n get() {\n return this.data.has(key) || definition.hasCustomDefaultValue;\n }\n }\n };\n}\nfunction parseValueDefinitionPair([token, typeDefinition]) {\n return valueDescriptorForTokenAndTypeDefinition(token, typeDefinition);\n}\nfunction parseValueTypeConstant(constant) {\n switch (constant) {\n case Array: return \"array\";\n case Boolean: return \"boolean\";\n case Number: return \"number\";\n case Object: return \"object\";\n case String: return \"string\";\n }\n}\nfunction parseValueTypeDefault(defaultValue) {\n switch (typeof defaultValue) {\n case \"boolean\": return \"boolean\";\n case \"number\": return \"number\";\n case \"string\": return \"string\";\n }\n if (Array.isArray(defaultValue))\n return \"array\";\n if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n return \"object\";\n}\nfunction parseValueTypeObject(typeObject) {\n const typeFromObject = parseValueTypeConstant(typeObject.type);\n if (typeFromObject) {\n const defaultValueType = parseValueTypeDefault(typeObject.default);\n if (typeFromObject !== defaultValueType) {\n throw new Error(`Type \"${typeFromObject}\" must match the type of the default value. Given default value: \"${typeObject.default}\" as \"${defaultValueType}\"`);\n }\n return typeFromObject;\n }\n}\nfunction parseValueTypeDefinition(typeDefinition) {\n const typeFromObject = parseValueTypeObject(typeDefinition);\n const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n const typeFromConstant = parseValueTypeConstant(typeDefinition);\n const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n if (type)\n return type;\n throw new Error(`Unknown value type \"${typeDefinition}\"`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n const constant = parseValueTypeConstant(typeDefinition);\n if (constant)\n return defaultValuesByType[constant];\n const defaultValue = typeDefinition.default;\n if (defaultValue !== undefined)\n return defaultValue;\n return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(token, typeDefinition) {\n const key = `${dasherize(token)}-value`;\n const type = parseValueTypeDefinition(typeDefinition);\n return {\n type,\n key,\n name: camelize(key),\n get defaultValue() { return defaultValueForDefinition(typeDefinition); },\n get hasCustomDefaultValue() { return parseValueTypeDefault(typeDefinition) !== undefined; },\n reader: readers[type],\n writer: writers[type] || writers.default\n };\n}\nconst defaultValuesByType = {\n get array() { return []; },\n boolean: false,\n number: 0,\n get object() { return {}; },\n string: \"\"\n};\nconst readers = {\n array(value) {\n const array = JSON.parse(value);\n if (!Array.isArray(array)) {\n throw new TypeError(\"Expected array\");\n }\n return array;\n },\n boolean(value) {\n return !(value == \"0\" || value == \"false\");\n },\n number(value) {\n return Number(value);\n },\n object(value) {\n const object = JSON.parse(value);\n if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n throw new TypeError(\"Expected object\");\n }\n return object;\n },\n string(value) {\n return value;\n }\n};\nconst 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 `${value}`;\n}\n\nclass Controller {\n constructor(context) {\n this.context = context;\n }\n static get shouldLoad() {\n return true;\n }\n get application() {\n return this.context.application;\n }\n get scope() {\n return this.context.scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get targets() {\n return this.scope.targets;\n }\n get classes() {\n return this.scope.classes;\n }\n get data() {\n return this.scope.data;\n }\n initialize() {\n }\n connect() {\n }\n disconnect() {\n }\n dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true } = {}) {\n const type = prefix ? `${prefix}:${eventName}` : eventName;\n const event = new CustomEvent(type, { detail, bubbles, cancelable });\n target.dispatchEvent(event);\n return event;\n }\n}\nController.blessings = [ClassPropertiesBlessing, TargetPropertiesBlessing, ValuePropertiesBlessing];\nController.targets = [];\nController.values = {};\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@hotwired/stimulus/dist/stimulus.js?");
|
110
|
+
|
111
|
+
/***/ }),
|
112
|
+
|
89
113
|
/***/ "./node_modules/@popperjs/core/lib/createPopper.js":
|
90
114
|
/*!*********************************************************!*\
|
91
115
|
!*** ./node_modules/@popperjs/core/lib/createPopper.js ***!
|
@@ -118,7 +142,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
118
142
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
119
143
|
|
120
144
|
"use strict";
|
121
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getBoundingClientRect; });\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n
|
145
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getBoundingClientRect; });\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\nfunction getBoundingClientRect(element, includeScale) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n var rect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__[\"isHTMLElement\"])(element) && includeScale) {\n var offsetHeight = element.offsetHeight;\n var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // Fallback to 1 in case both values are `0`\n\n if (offsetWidth > 0) {\n scaleX = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_1__[\"round\"])(rect.width) / offsetWidth || 1;\n }\n\n if (offsetHeight > 0) {\n scaleY = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_1__[\"round\"])(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}\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js?");
|
122
146
|
|
123
147
|
/***/ }),
|
124
148
|
|
@@ -130,7 +154,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
130
154
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
131
155
|
|
132
156
|
"use strict";
|
133
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getClippingRect; });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _getViewportRect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getViewportRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js\");\n/* harmony import */ var _getDocumentRect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js\");\n/* harmony import */ var _listScrollParents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./listScrollParents.js */ \"./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js\");\n/* harmony import */ var _getOffsetParent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./getParentNode.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js\");\n/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./contains.js */ \"./node_modules/@popperjs/core/lib/dom-utils/contains.js\");\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/rectToClientRect.js */ \"./node_modules/@popperjs/core/lib/utils/rectToClientRect.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction getInnerBoundingClientRect(element) {\n var rect = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(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}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"viewport\"] ? Object(_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(Object(_getViewportRect_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element)) : Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_7__[\"
|
157
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getClippingRect; });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _getViewportRect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getViewportRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js\");\n/* harmony import */ var _getDocumentRect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js\");\n/* harmony import */ var _listScrollParents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./listScrollParents.js */ \"./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js\");\n/* harmony import */ var _getOffsetParent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./getParentNode.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js\");\n/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./contains.js */ \"./node_modules/@popperjs/core/lib/dom-utils/contains.js\");\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/rectToClientRect.js */ \"./node_modules/@popperjs/core/lib/utils/rectToClientRect.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction getInnerBoundingClientRect(element) {\n var rect = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(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}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"viewport\"] ? Object(_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(Object(_getViewportRect_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element)) : Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_7__[\"isElement\"])(clippingParent) ? getInnerBoundingClientRect(clippingParent) : Object(_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(Object(_getDocumentRect_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(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\n\nfunction getClippingParents(element) {\n var clippingParents = Object(_listScrollParents_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Object(_getParentNode_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(element).position) >= 0;\n var clipperElement = canEscapeClipping && Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_7__[\"isHTMLElement\"])(element) ? Object(_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(element) : element;\n\n if (!Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_7__[\"isElement\"])(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_7__[\"isElement\"])(clippingParent) && Object(_contains_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(clippingParent, clipperElement) && Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"])(clippingParent) !== 'body' && (canEscapeClipping ? Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(clippingParent).position !== 'static' : true);\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nfunction 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 = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_13__[\"max\"])(rect.top, accRect.top);\n accRect.right = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_13__[\"min\"])(rect.right, accRect.right);\n accRect.bottom = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_13__[\"min\"])(rect.bottom, accRect.bottom);\n accRect.left = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_13__[\"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}\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js?");
|
134
158
|
|
135
159
|
/***/ }),
|
136
160
|
|
@@ -142,7 +166,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
142
166
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
143
167
|
|
144
168
|
"use strict";
|
145
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getCompositeRect; });\n/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n/* harmony import */ var _getNodeScroll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getNodeScroll.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js\");\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isScrollParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js\");\n\n\n\n\n\n\n\n\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\n\nfunction getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent);\n var offsetParentIsScaled = Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent) && isElementScaled(offsetParent);\n var documentElement = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(offsetParent);\n var rect = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elementOrVirtualElement, offsetParentIsScaled);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n Object(_isScrollParent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(documentElement)) {\n scroll = Object(_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent);\n }\n\n if (Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent)) {\n offsets = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(documentElement);\n }\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}\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js?");
|
169
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getCompositeRect; });\n/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n/* harmony import */ var _getNodeScroll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getNodeScroll.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js\");\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isScrollParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_7__[\"round\"])(rect.width) / element.offsetWidth || 1;\n var scaleY = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_7__[\"round\"])(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\n\nfunction getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent);\n var offsetParentIsScaled = Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent) && isElementScaled(offsetParent);\n var documentElement = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(offsetParent);\n var rect = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elementOrVirtualElement, offsetParentIsScaled);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n Object(_isScrollParent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(documentElement)) {\n scroll = Object(_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent);\n }\n\n if (Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent)) {\n offsets = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(documentElement);\n }\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}\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js?");
|
146
170
|
|
147
171
|
/***/ }),
|
148
172
|
|
@@ -406,7 +430,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dom
|
|
406
430
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
407
431
|
|
408
432
|
"use strict";
|
409
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js\");\n/* harmony import */ var _dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-utils/contains.js */ \"./node_modules/@popperjs/core/lib/dom-utils/contains.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js\");\n/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/within.js */ \"./node_modules/@popperjs/core/lib/utils/within.js\");\n/* harmony import */ var _utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/mergePaddingObject.js */ \"./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js\");\n/* harmony import */ var _utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/expandToHashMap.js */ \"./node_modules/@popperjs/core/lib/utils/expandToHashMap.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n\n\n\n\n\n\n\n\n\n // 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 Object(_utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(typeof padding !== 'number' ? padding : Object(_utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"basePlacements\"]));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\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 = Object(_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(state.placement);\n var axis = Object(_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(basePlacement);\n var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_8__[\"left\"], _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"right\"]].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = Object(_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arrowElement);\n var minProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"top\"] : _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"left\"];\n var maxProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"bottom\"] : _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"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 = Object(_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(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 = Object(_utils_within_js__WEBPACK_IMPORTED_MODULE_5__[\"
|
433
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js\");\n/* harmony import */ var _dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-utils/contains.js */ \"./node_modules/@popperjs/core/lib/dom-utils/contains.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js\");\n/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/within.js */ \"./node_modules/@popperjs/core/lib/utils/within.js\");\n/* harmony import */ var _utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/mergePaddingObject.js */ \"./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js\");\n/* harmony import */ var _utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/expandToHashMap.js */ \"./node_modules/@popperjs/core/lib/utils/expandToHashMap.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n\n\n\n\n\n\n\n\n\n // 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 Object(_utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(typeof padding !== 'number' ? padding : Object(_utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"basePlacements\"]));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\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 = Object(_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(state.placement);\n var axis = Object(_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(basePlacement);\n var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_8__[\"left\"], _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"right\"]].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = Object(_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arrowElement);\n var minProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"top\"] : _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"left\"];\n var maxProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"bottom\"] : _enums_js__WEBPACK_IMPORTED_MODULE_8__[\"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 = Object(_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(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 = Object(_utils_within_js__WEBPACK_IMPORTED_MODULE_5__[\"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}\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\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (true) {\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_9__[\"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\n if (!Object(_dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(state.elements.popper, arrowElement)) {\n if (true) {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n});\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/modifiers/arrow.js?");
|
410
434
|
|
411
435
|
/***/ }),
|
412
436
|
|
@@ -418,7 +442,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uti
|
|
418
442
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
419
443
|
|
420
444
|
"use strict";
|
421
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mapToStyles\", function() { return mapToStyles; });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n // 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: Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_7__[\"round\"])(
|
445
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mapToStyles\", function() { return mapToStyles; });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n // 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: Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_7__[\"round\"])(x * dpr) / dpr || 0,\n y: Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_7__[\"round\"])(y * dpr) / dpr || 0\n };\n}\n\nfunction mapToStyles(_ref2) {\n var _Object$assign2;\n\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 isFixed = _ref2.isFixed;\n\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\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"left\"];\n var sideY = _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"top\"];\n var win = window;\n\n if (adaptive) {\n var offsetParent = Object(_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === Object(_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(popper)) {\n offsetParent = Object(_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(popper);\n\n if (Object(_dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(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\n offsetParent = offsetParent;\n\n if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"top\"] || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"left\"] || placement === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"right\"]) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"end\"]) {\n sideY = _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"bottom\"];\n var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"left\"] || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"top\"] || placement === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"bottom\"]) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"end\"]) {\n sideX = _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"right\"];\n var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n if (gpuAcceleration) {\n var _Object$assign;\n\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\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}\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\n if (true) {\n var transitionProperty = Object(_dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(state.elements.popper).transitionProperty || '';\n\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\n var commonStyles = {\n placement: Object(_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(state.placement),\n variation: Object(_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\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\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\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\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n});\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/modifiers/computeStyles.js?");
|
422
446
|
|
423
447
|
/***/ }),
|
424
448
|
|
@@ -478,7 +502,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _app
|
|
478
502
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
479
503
|
|
480
504
|
"use strict";
|
481
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distanceAndSkiddingToXY\", function() { return distanceAndSkiddingToXY; });\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n\n\nfunction distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = Object(_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(placement);\n var invertDistance = [_enums_js__WEBPACK_IMPORTED_MODULE_1__[\"left\"], _enums_js__WEBPACK_IMPORTED_MODULE_1__[\"top\"]].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [_enums_js__WEBPACK_IMPORTED_MODULE_1__[\"left\"], _enums_js__WEBPACK_IMPORTED_MODULE_1__[\"right\"]].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\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 = _enums_js__WEBPACK_IMPORTED_MODULE_1__[\"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\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n});\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/modifiers/offset.js?");
|
505
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distanceAndSkiddingToXY\", function() { return distanceAndSkiddingToXY; });\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n\n // eslint-disable-next-line import/no-unused-modules\n\nfunction distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = Object(_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(placement);\n var invertDistance = [_enums_js__WEBPACK_IMPORTED_MODULE_1__[\"left\"], _enums_js__WEBPACK_IMPORTED_MODULE_1__[\"top\"]].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [_enums_js__WEBPACK_IMPORTED_MODULE_1__[\"left\"], _enums_js__WEBPACK_IMPORTED_MODULE_1__[\"right\"]].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\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 = _enums_js__WEBPACK_IMPORTED_MODULE_1__[\"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\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n});\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/modifiers/offset.js?");
|
482
506
|
|
483
507
|
/***/ }),
|
484
508
|
|
@@ -502,7 +526,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uti
|
|
502
526
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
503
527
|
|
504
528
|
"use strict";
|
505
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js\");\n/* harmony import */ var _utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getAltAxis.js */ \"./node_modules/@popperjs/core/lib/utils/getAltAxis.js\");\n/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/within.js */ \"./node_modules/@popperjs/core/lib/utils/within.js\");\n/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/detectOverflow.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n/* harmony import */ var _utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/getFreshSideObject.js */ \"./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n\n\n\n\n\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 = Object(_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = Object(_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(state.placement);\n var variation = Object(_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = Object(_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(basePlacement);\n var altAxis = Object(_utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(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\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis
|
529
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js\");\n/* harmony import */ var _utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getAltAxis.js */ \"./node_modules/@popperjs/core/lib/utils/getAltAxis.js\");\n/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/within.js */ \"./node_modules/@popperjs/core/lib/utils/within.js\");\n/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/detectOverflow.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n/* harmony import */ var _utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/getFreshSideObject.js */ \"./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n\n\n\n\n\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 = Object(_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = Object(_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(state.placement);\n var variation = Object(_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = Object(_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(basePlacement);\n var altAxis = Object(_utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(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 normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"top\"] : _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"left\"];\n var altSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"bottom\"] : _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"right\"];\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"start\"] ? referenceRect[len] : popperRect[len];\n var maxLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"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 ? Object(_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : Object(_utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"])();\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 = Object(_utils_within_js__WEBPACK_IMPORTED_MODULE_4__[\"within\"])(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && Object(_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = Object(_utils_within_js__WEBPACK_IMPORTED_MODULE_4__[\"within\"])(tether ? Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_10__[\"min\"])(min, tetherMin) : min, offset, tether ? Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_10__[\"max\"])(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"top\"] : _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"left\"];\n\n var _altSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"bottom\"] : _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"right\"];\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [_enums_js__WEBPACK_IMPORTED_MODULE_0__[\"top\"], _enums_js__WEBPACK_IMPORTED_MODULE_0__[\"left\"]].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? Object(_utils_within_js__WEBPACK_IMPORTED_MODULE_4__[\"withinMaxClamp\"])(_tetherMin, _offset, _tetherMax) : Object(_utils_within_js__WEBPACK_IMPORTED_MODULE_4__[\"within\"])(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\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\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n});\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js?");
|
506
530
|
|
507
531
|
/***/ }),
|
508
532
|
|
@@ -774,11 +798,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
774
798
|
/*!*********************************************************!*\
|
775
799
|
!*** ./node_modules/@popperjs/core/lib/utils/within.js ***!
|
776
800
|
\*********************************************************/
|
777
|
-
/*! exports provided:
|
801
|
+
/*! exports provided: within, withinMaxClamp */
|
778
802
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
779
803
|
|
780
804
|
"use strict";
|
781
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"
|
805
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"within\", function() { return within; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"withinMaxClamp\", function() { return withinMaxClamp; });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\nfunction within(min, value, max) {\n return Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"max\"])(min, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"min\"])(value, max));\n}\nfunction withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}\n\n//# sourceURL=webpack:///./node_modules/@popperjs/core/lib/utils/within.js?");
|
782
806
|
|
783
807
|
/***/ }),
|
784
808
|
|
@@ -789,475 +813,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
789
813
|
/*! no static exports found */
|
790
814
|
/***/ (function(module, exports, __webpack_require__) {
|
791
815
|
|
792
|
-
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/assets/javascripts\nReleased under the MIT license\n */;\n\n(function() {\n var context = this;\n\n (function() {\n (function() {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form',\n formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n\n }).call(this);\n }).call(context);\n\n var Rails = context.Rails;\n\n (function() {\n (function() {\n var nonce;\n\n nonce = null;\n\n Rails.loadCSPNonce = function() {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n\n Rails.cspNonce = function() {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n\n }).call(this);\n (function() {\n var expando, m;\n\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\n Rails.matches = function(element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n\n expando = '_ujsData';\n\n Rails.getData = function(element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n\n Rails.setData = function(element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n return element[expando][key] = value;\n };\n\n Rails.$ = function(selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n\n }).call(this);\n (function() {\n var $, csrfParam, csrfToken;\n\n $ = Rails.$;\n\n csrfToken = Rails.csrfToken = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n\n csrfParam = Rails.csrfParam = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n\n Rails.CSRFProtection = function(xhr) {\n var token;\n token = csrfToken();\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n\n Rails.refreshCSRFTokens = function() {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n if ((token != null) && (param != null)) {\n return $('form input[name=\"' + param + '\"]').forEach(function(input) {\n return input.value = token;\n });\n }\n };\n\n }).call(this);\n (function() {\n var CustomEvent, fire, matches, preventDefault;\n\n matches = Rails.matches;\n\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function(event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n CustomEvent.prototype.preventDefault = function() {\n var result;\n result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n }\n return result;\n };\n }\n\n fire = Rails.fire = function(obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n\n Rails.stopEverything = function(e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n\n Rails.delegate = function(element, selector, eventType, handler) {\n return element.addEventListener(eventType, function(e) {\n var target;\n target = e.target;\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n\n }).call(this);\n (function() {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n\n Rails.ajax = function(options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function() {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n if ((options.beforeSend != null) && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n return options;\n };\n\n createXHR = function(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n };\n\n processResponse = function(response, type) {\n var parser, script;\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n return response;\n };\n\n Rails.href = function(element) {\n return element.href;\n };\n\n Rails.isCrossDomain = function(url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n try {\n urlAnchor.href = url;\n return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || (originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host));\n } catch (error) {\n e = error;\n return true;\n }\n };\n\n }).call(this);\n (function() {\n var matches, toArray;\n\n matches = Rails.matches;\n\n toArray = function(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function(element, additionalParam) {\n var inputs, params;\n inputs = [element];\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n params = [];\n inputs.forEach(function(input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, 'fieldset[disabled] *')) {\n return;\n }\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function(option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map(function(param) {\n if (param.name != null) {\n return (encodeURIComponent(param.name)) + \"=\" + (encodeURIComponent(param.value));\n } else {\n return param;\n }\n }).join('&');\n };\n\n Rails.formElements = function(form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function(el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n\n }).call(this);\n (function() {\n var allowAction, fire, stopEverything;\n\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n\n Rails.handleConfirm = function(e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n\n Rails.confirm = function(message, element) {\n return confirm(message);\n };\n\n allowAction = function(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n if (!message) {\n return true;\n }\n answer = false;\n if (fire(element, 'confirm')) {\n try {\n answer = Rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, 'confirm:complete', [answer]);\n }\n return answer && callback;\n };\n\n }).call(this);\n (function() {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n\n Rails.handleDisabledElement = function(e) {\n var element;\n element = this;\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function(e) {\n var element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n\n Rails.disableElement = function(e) {\n var element;\n element = e instanceof Event ? e.target : e;\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n\n disableLinkElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, 'ujs:enable-with', null);\n }\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n\n isXhrRedirect = function(event) {\n var ref, xhr;\n xhr = (ref = event.detail) != null ? ref[0] : void 0;\n return (xhr != null ? xhr.getResponseHeader(\"X-Xhr-Redirect\") : void 0) != null;\n };\n\n }).call(this);\n (function() {\n var stopEverything;\n\n stopEverything = Rails.stopEverything;\n\n Rails.handleMethod = function(e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n if (!method) {\n return;\n }\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"<input name='_method' value='\" + method + \"' type='hidden' />\";\n if ((csrfParam != null) && (csrfToken != null) && !Rails.isCrossDomain(href)) {\n formContent += \"<input name='\" + csrfParam + \"' value='\" + csrfToken + \"' type='hidden' />\";\n }\n formContent += '<input type=\"submit\" />';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n\n }).call(this);\n (function() {\n var ajax, fire, getData, isCrossDomain, isRemote, matches, serializeElement, setData, stopEverything,\n slice = [].slice;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n\n isRemote = function(element) {\n var value;\n value = element.getAttribute('data-remote');\n return (value != null) && value !== 'false';\n };\n\n Rails.handleRemote = function(e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function(xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: (withCredentials != null) && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n\n Rails.formSubmitButtonClick = function(e) {\n var button, form;\n button = this;\n form = button.form;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n\n Rails.preventInsignificantClick = function(e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = (e.button != null) && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n\n }).call(this);\n (function() {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n\n if ((typeof jQuery !== \"undefined\" && jQuery !== null) && (jQuery.ajax != null)) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function(options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n\n Rails.start = function() {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n window.addEventListener('pageshow', function() {\n $(Rails.formEnableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function(e) {\n return setTimeout((function() {\n return disableElement(e);\n }), 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n\n }).call(this);\n }).call(this);\n\n if ( true && module.exports) {\n module.exports = Rails;\n } else if (true) {\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (Rails),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n}).call(this);\n\n\n//# sourceURL=webpack:///./node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js?");
|
793
|
-
|
794
|
-
/***/ }),
|
795
|
-
|
796
|
-
/***/ "./node_modules/@stimulus/core/dist/action.js":
|
797
|
-
/*!****************************************************!*\
|
798
|
-
!*** ./node_modules/@stimulus/core/dist/action.js ***!
|
799
|
-
\****************************************************/
|
800
|
-
/*! exports provided: Action, getDefaultEventNameForElement */
|
801
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
802
|
-
|
803
|
-
"use strict";
|
804
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Action\", function() { return Action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDefaultEventNameForElement\", function() { return getDefaultEventNameForElement; });\n/* harmony import */ var _action_descriptor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./action_descriptor */ \"./node_modules/@stimulus/core/dist/action_descriptor.js\");\n\nvar Action = /** @class */ (function () {\n function Action(element, index, descriptor) {\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 }\n Action.forToken = function (token) {\n return new this(token.element, token.index, Object(_action_descriptor__WEBPACK_IMPORTED_MODULE_0__[\"parseActionDescriptorString\"])(token.content));\n };\n Action.prototype.toString = function () {\n var eventNameSuffix = this.eventTargetName ? \"@\" + this.eventTargetName : \"\";\n return \"\" + this.eventName + eventNameSuffix + \"->\" + this.identifier + \"#\" + this.methodName;\n };\n Object.defineProperty(Action.prototype, \"eventTargetName\", {\n get: function () {\n return Object(_action_descriptor__WEBPACK_IMPORTED_MODULE_0__[\"stringifyEventTarget\"])(this.eventTarget);\n },\n enumerable: false,\n configurable: true\n });\n return Action;\n}());\n\nvar defaultEventNames = {\n \"a\": function (e) { return \"click\"; },\n \"button\": function (e) { return \"click\"; },\n \"form\": function (e) { return \"submit\"; },\n \"input\": function (e) { return e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\"; },\n \"select\": function (e) { return \"change\"; },\n \"textarea\": function (e) { return \"input\"; }\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}\n//# sourceMappingURL=action.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/action.js?");
|
805
|
-
|
806
|
-
/***/ }),
|
807
|
-
|
808
|
-
/***/ "./node_modules/@stimulus/core/dist/action_descriptor.js":
|
809
|
-
/*!***************************************************************!*\
|
810
|
-
!*** ./node_modules/@stimulus/core/dist/action_descriptor.js ***!
|
811
|
-
\***************************************************************/
|
812
|
-
/*! exports provided: parseActionDescriptorString, stringifyEventTarget */
|
813
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
814
|
-
|
815
|
-
"use strict";
|
816
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseActionDescriptorString\", function() { return parseActionDescriptorString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"stringifyEventTarget\", function() { return stringifyEventTarget; });\n// capture nos.: 12 23 4 43 1 5 56 7 768 9 98\nvar descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n var source = descriptorString.trim();\n var matches = source.match(descriptorPattern) || [];\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName: matches[2],\n eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},\n identifier: matches[5],\n methodName: matches[7]\n };\n}\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n }\n else if (eventTargetName == \"document\") {\n return document;\n }\n}\nfunction parseEventOptions(eventOptions) {\n return eventOptions.split(\":\").reduce(function (options, token) {\n var _a;\n return Object.assign(options, (_a = {}, _a[token.replace(/^!/, \"\")] = !/^!/.test(token), _a));\n }, {});\n}\nfunction stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n }\n else if (eventTarget == document) {\n return \"document\";\n }\n}\n//# sourceMappingURL=action_descriptor.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/action_descriptor.js?");
|
817
|
-
|
818
|
-
/***/ }),
|
819
|
-
|
820
|
-
/***/ "./node_modules/@stimulus/core/dist/application.js":
|
821
|
-
/*!*********************************************************!*\
|
822
|
-
!*** ./node_modules/@stimulus/core/dist/application.js ***!
|
823
|
-
\*********************************************************/
|
824
|
-
/*! exports provided: Application */
|
825
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
826
|
-
|
827
|
-
"use strict";
|
828
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Application\", function() { return Application; });\n/* harmony import */ var _dispatcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dispatcher */ \"./node_modules/@stimulus/core/dist/dispatcher.js\");\n/* harmony import */ var _router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./router */ \"./node_modules/@stimulus/core/dist/router.js\");\n/* harmony import */ var _schema__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schema */ \"./node_modules/@stimulus/core/dist/schema.js\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArrays = (undefined && undefined.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\n\n\n\nvar Application = /** @class */ (function () {\n function Application(element, schema) {\n if (element === void 0) { element = document.documentElement; }\n if (schema === void 0) { schema = _schema__WEBPACK_IMPORTED_MODULE_2__[\"defaultSchema\"]; }\n this.logger = console;\n this.element = element;\n this.schema = schema;\n this.dispatcher = new _dispatcher__WEBPACK_IMPORTED_MODULE_0__[\"Dispatcher\"](this);\n this.router = new _router__WEBPACK_IMPORTED_MODULE_1__[\"Router\"](this);\n }\n Application.start = function (element, schema) {\n var application = new Application(element, schema);\n application.start();\n return application;\n };\n Application.prototype.start = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, domReady()];\n case 1:\n _a.sent();\n this.dispatcher.start();\n this.router.start();\n return [2 /*return*/];\n }\n });\n });\n };\n Application.prototype.stop = function () {\n this.dispatcher.stop();\n this.router.stop();\n };\n Application.prototype.register = function (identifier, controllerConstructor) {\n this.load({ identifier: identifier, controllerConstructor: controllerConstructor });\n };\n Application.prototype.load = function (head) {\n var _this = this;\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n var definitions = Array.isArray(head) ? head : __spreadArrays([head], rest);\n definitions.forEach(function (definition) { return _this.router.loadDefinition(definition); });\n };\n Application.prototype.unload = function (head) {\n var _this = this;\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n var identifiers = Array.isArray(head) ? head : __spreadArrays([head], rest);\n identifiers.forEach(function (identifier) { return _this.router.unloadIdentifier(identifier); });\n };\n Object.defineProperty(Application.prototype, \"controllers\", {\n // Controllers\n get: function () {\n return this.router.contexts.map(function (context) { return context.controller; });\n },\n enumerable: false,\n configurable: true\n });\n Application.prototype.getControllerForElementAndIdentifier = function (element, identifier) {\n var context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n };\n // Error handling\n Application.prototype.handleError = function (error, message, detail) {\n this.logger.error(\"%s\\n\\n%o\\n\\n%o\", message, error, detail);\n };\n return Application;\n}());\n\nfunction domReady() {\n return new Promise(function (resolve) {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", resolve);\n }\n else {\n resolve();\n }\n });\n}\n//# sourceMappingURL=application.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/application.js?");
|
829
|
-
|
830
|
-
/***/ }),
|
831
|
-
|
832
|
-
/***/ "./node_modules/@stimulus/core/dist/binding.js":
|
833
|
-
/*!*****************************************************!*\
|
834
|
-
!*** ./node_modules/@stimulus/core/dist/binding.js ***!
|
835
|
-
\*****************************************************/
|
836
|
-
/*! exports provided: Binding */
|
837
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
838
|
-
|
839
|
-
"use strict";
|
840
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Binding\", function() { return Binding; });\nvar Binding = /** @class */ (function () {\n function Binding(context, action) {\n this.context = context;\n this.action = action;\n }\n Object.defineProperty(Binding.prototype, \"index\", {\n get: function () {\n return this.action.index;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"eventTarget\", {\n get: function () {\n return this.action.eventTarget;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"eventOptions\", {\n get: function () {\n return this.action.eventOptions;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"identifier\", {\n get: function () {\n return this.context.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Binding.prototype.handleEvent = function (event) {\n if (this.willBeInvokedByEvent(event)) {\n this.invokeWithEvent(event);\n }\n };\n Object.defineProperty(Binding.prototype, \"eventName\", {\n get: function () {\n return this.action.eventName;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"method\", {\n get: function () {\n var method = this.controller[this.methodName];\n if (typeof method == \"function\") {\n return method;\n }\n throw new Error(\"Action \\\"\" + this.action + \"\\\" references undefined method \\\"\" + this.methodName + \"\\\"\");\n },\n enumerable: false,\n configurable: true\n });\n Binding.prototype.invokeWithEvent = function (event) {\n try {\n this.method.call(this.controller, event);\n }\n catch (error) {\n var _a = this, identifier = _a.identifier, controller = _a.controller, element = _a.element, index = _a.index;\n var detail = { identifier: identifier, controller: controller, element: element, index: index, event: event };\n this.context.handleError(error, \"invoking action \\\"\" + this.action + \"\\\"\", detail);\n }\n };\n Binding.prototype.willBeInvokedByEvent = function (event) {\n var eventTarget = event.target;\n if (this.element === eventTarget) {\n return true;\n }\n else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n }\n else {\n return this.scope.containsElement(this.action.element);\n }\n };\n Object.defineProperty(Binding.prototype, \"controller\", {\n get: function () {\n return this.context.controller;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"methodName\", {\n get: function () {\n return this.action.methodName;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"scope\", {\n get: function () {\n return this.context.scope;\n },\n enumerable: false,\n configurable: true\n });\n return Binding;\n}());\n\n//# sourceMappingURL=binding.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/binding.js?");
|
841
|
-
|
842
|
-
/***/ }),
|
843
|
-
|
844
|
-
/***/ "./node_modules/@stimulus/core/dist/binding_observer.js":
|
845
|
-
/*!**************************************************************!*\
|
846
|
-
!*** ./node_modules/@stimulus/core/dist/binding_observer.js ***!
|
847
|
-
\**************************************************************/
|
848
|
-
/*! exports provided: BindingObserver */
|
849
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
850
|
-
|
851
|
-
"use strict";
|
852
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BindingObserver\", function() { return BindingObserver; });\n/* harmony import */ var _action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./action */ \"./node_modules/@stimulus/core/dist/action.js\");\n/* harmony import */ var _binding__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./binding */ \"./node_modules/@stimulus/core/dist/binding.js\");\n/* harmony import */ var _stimulus_mutation_observers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @stimulus/mutation-observers */ \"./node_modules/@stimulus/mutation-observers/dist/index.js\");\n\n\n\nvar BindingObserver = /** @class */ (function () {\n function BindingObserver(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map;\n }\n BindingObserver.prototype.start = function () {\n if (!this.valueListObserver) {\n this.valueListObserver = new _stimulus_mutation_observers__WEBPACK_IMPORTED_MODULE_2__[\"ValueListObserver\"](this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n };\n BindingObserver.prototype.stop = function () {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n };\n Object.defineProperty(BindingObserver.prototype, \"element\", {\n get: function () {\n return this.context.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BindingObserver.prototype, \"identifier\", {\n get: function () {\n return this.context.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BindingObserver.prototype, \"actionAttribute\", {\n get: function () {\n return this.schema.actionAttribute;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BindingObserver.prototype, \"schema\", {\n get: function () {\n return this.context.schema;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BindingObserver.prototype, \"bindings\", {\n get: function () {\n return Array.from(this.bindingsByAction.values());\n },\n enumerable: false,\n configurable: true\n });\n BindingObserver.prototype.connectAction = function (action) {\n var binding = new _binding__WEBPACK_IMPORTED_MODULE_1__[\"Binding\"](this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n };\n BindingObserver.prototype.disconnectAction = function (action) {\n var binding = this.bindingsByAction.get(action);\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n };\n BindingObserver.prototype.disconnectAllActions = function () {\n var _this = this;\n this.bindings.forEach(function (binding) { return _this.delegate.bindingDisconnected(binding); });\n this.bindingsByAction.clear();\n };\n // Value observer delegate\n BindingObserver.prototype.parseValueForToken = function (token) {\n var action = _action__WEBPACK_IMPORTED_MODULE_0__[\"Action\"].forToken(token);\n if (action.identifier == this.identifier) {\n return action;\n }\n };\n BindingObserver.prototype.elementMatchedValue = function (element, action) {\n this.connectAction(action);\n };\n BindingObserver.prototype.elementUnmatchedValue = function (element, action) {\n this.disconnectAction(action);\n };\n return BindingObserver;\n}());\n\n//# sourceMappingURL=binding_observer.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/binding_observer.js?");
|
853
|
-
|
854
|
-
/***/ }),
|
855
|
-
|
856
|
-
/***/ "./node_modules/@stimulus/core/dist/blessing.js":
|
857
|
-
/*!******************************************************!*\
|
858
|
-
!*** ./node_modules/@stimulus/core/dist/blessing.js ***!
|
859
|
-
\******************************************************/
|
860
|
-
/*! exports provided: bless */
|
861
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
862
|
-
|
863
|
-
"use strict";
|
864
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bless\", function() { return bless; });\n/* harmony import */ var _inheritable_statics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inheritable_statics */ \"./node_modules/@stimulus/core/dist/inheritable_statics.js\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __spreadArrays = (undefined && undefined.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\n\n/** @hidden */\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 = Object(_inheritable_statics__WEBPACK_IMPORTED_MODULE_0__[\"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 _a;\n var descriptor = getShadowedDescriptor(prototype, properties, key);\n if (descriptor) {\n Object.assign(shadowProperties, (_a = {}, _a[key] = descriptor, _a));\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) { return __spreadArrays(Object.getOwnPropertyNames(object), Object.getOwnPropertySymbols(object)); };\n }\n else {\n return Object.getOwnPropertyNames;\n }\n})();\nvar extend = (function () {\n function extendWithReflect(constructor) {\n function extended() {\n var _newTarget = this && this instanceof extended ? this.constructor : void 0;\n return Reflect.construct(constructor, arguments, _newTarget);\n }\n extended.prototype = Object.create(constructor.prototype, {\n constructor: { value: extended }\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n function testReflectExtension() {\n var a = function () { this.a.call(this); };\n var b = extendWithReflect(a);\n b.prototype.a = function () { };\n return new b;\n }\n try {\n testReflectExtension();\n return extendWithReflect;\n }\n catch (error) {\n return function (constructor) { return /** @class */ (function (_super) {\n __extends(extended, _super);\n function extended() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return extended;\n }(constructor)); };\n }\n})();\n//# sourceMappingURL=blessing.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/blessing.js?");
|
865
|
-
|
866
|
-
/***/ }),
|
867
|
-
|
868
|
-
/***/ "./node_modules/@stimulus/core/dist/class_map.js":
|
869
|
-
/*!*******************************************************!*\
|
870
|
-
!*** ./node_modules/@stimulus/core/dist/class_map.js ***!
|
871
|
-
\*******************************************************/
|
872
|
-
/*! exports provided: ClassMap */
|
873
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
874
|
-
|
875
|
-
"use strict";
|
876
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ClassMap\", function() { return ClassMap; });\nvar ClassMap = /** @class */ (function () {\n function ClassMap(scope) {\n this.scope = scope;\n }\n ClassMap.prototype.has = function (name) {\n return this.data.has(this.getDataKey(name));\n };\n ClassMap.prototype.get = function (name) {\n return this.data.get(this.getDataKey(name));\n };\n ClassMap.prototype.getAttributeName = function (name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n };\n ClassMap.prototype.getDataKey = function (name) {\n return name + \"-class\";\n };\n Object.defineProperty(ClassMap.prototype, \"data\", {\n get: function () {\n return this.scope.data;\n },\n enumerable: false,\n configurable: true\n });\n return ClassMap;\n}());\n\n//# sourceMappingURL=class_map.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/class_map.js?");
|
877
|
-
|
878
|
-
/***/ }),
|
879
|
-
|
880
|
-
/***/ "./node_modules/@stimulus/core/dist/class_properties.js":
|
881
|
-
/*!**************************************************************!*\
|
882
|
-
!*** ./node_modules/@stimulus/core/dist/class_properties.js ***!
|
883
|
-
\**************************************************************/
|
884
|
-
/*! exports provided: ClassPropertiesBlessing */
|
885
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
886
|
-
|
887
|
-
"use strict";
|
888
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ClassPropertiesBlessing\", function() { return ClassPropertiesBlessing; });\n/* harmony import */ var _inheritable_statics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inheritable_statics */ \"./node_modules/@stimulus/core/dist/inheritable_statics.js\");\n/* harmony import */ var _string_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string_helpers */ \"./node_modules/@stimulus/core/dist/string_helpers.js\");\n\n\n/** @hidden */\nfunction ClassPropertiesBlessing(constructor) {\n var classes = Object(_inheritable_statics__WEBPACK_IMPORTED_MODULE_0__[\"readInheritableStaticArrayValues\"])(constructor, \"classes\");\n return classes.reduce(function (properties, classDefinition) {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\nfunction propertiesForClassDefinition(key) {\n var _a;\n var name = key + \"Class\";\n return _a = {},\n _a[name] = {\n get: function () {\n var classes = this.classes;\n if (classes.has(key)) {\n return classes.get(key);\n }\n else {\n var attribute = classes.getAttributeName(key);\n throw new Error(\"Missing attribute \\\"\" + attribute + \"\\\"\");\n }\n }\n },\n _a[\"has\" + Object(_string_helpers__WEBPACK_IMPORTED_MODULE_1__[\"capitalize\"])(name)] = {\n get: function () {\n return this.classes.has(key);\n }\n },\n _a;\n}\n//# sourceMappingURL=class_properties.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/class_properties.js?");
|
889
|
-
|
890
|
-
/***/ }),
|
891
|
-
|
892
|
-
/***/ "./node_modules/@stimulus/core/dist/context.js":
|
893
|
-
/*!*****************************************************!*\
|
894
|
-
!*** ./node_modules/@stimulus/core/dist/context.js ***!
|
895
|
-
\*****************************************************/
|
896
|
-
/*! exports provided: Context */
|
897
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
898
|
-
|
899
|
-
"use strict";
|
900
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Context\", function() { return Context; });\n/* harmony import */ var _binding_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./binding_observer */ \"./node_modules/@stimulus/core/dist/binding_observer.js\");\n/* harmony import */ var _value_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./value_observer */ \"./node_modules/@stimulus/core/dist/value_observer.js\");\n\n\nvar Context = /** @class */ (function () {\n function Context(module, scope) {\n this.module = module;\n this.scope = scope;\n this.controller = new module.controllerConstructor(this);\n this.bindingObserver = new _binding_observer__WEBPACK_IMPORTED_MODULE_0__[\"BindingObserver\"](this, this.dispatcher);\n this.valueObserver = new _value_observer__WEBPACK_IMPORTED_MODULE_1__[\"ValueObserver\"](this, this.controller);\n try {\n this.controller.initialize();\n }\n catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n Context.prototype.connect = function () {\n this.bindingObserver.start();\n this.valueObserver.start();\n try {\n this.controller.connect();\n }\n catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n };\n Context.prototype.disconnect = function () {\n try {\n this.controller.disconnect();\n }\n catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n this.valueObserver.stop();\n this.bindingObserver.stop();\n };\n Object.defineProperty(Context.prototype, \"application\", {\n get: function () {\n return this.module.application;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"identifier\", {\n get: function () {\n return this.module.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"schema\", {\n get: function () {\n return this.application.schema;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"dispatcher\", {\n get: function () {\n return this.application.dispatcher;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"parentElement\", {\n get: function () {\n return this.element.parentElement;\n },\n enumerable: false,\n configurable: true\n });\n // Error handling\n Context.prototype.handleError = function (error, message, detail) {\n if (detail === void 0) { detail = {}; }\n var _a = this, identifier = _a.identifier, controller = _a.controller, element = _a.element;\n detail = Object.assign({ identifier: identifier, controller: controller, element: element }, detail);\n this.application.handleError(error, \"Error \" + message, detail);\n };\n return Context;\n}());\n\n//# sourceMappingURL=context.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/context.js?");
|
901
|
-
|
902
|
-
/***/ }),
|
903
|
-
|
904
|
-
/***/ "./node_modules/@stimulus/core/dist/controller.js":
|
905
|
-
/*!********************************************************!*\
|
906
|
-
!*** ./node_modules/@stimulus/core/dist/controller.js ***!
|
907
|
-
\********************************************************/
|
908
|
-
/*! exports provided: Controller */
|
909
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
910
|
-
|
911
|
-
"use strict";
|
912
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Controller\", function() { return Controller; });\n/* harmony import */ var _class_properties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./class_properties */ \"./node_modules/@stimulus/core/dist/class_properties.js\");\n/* harmony import */ var _target_properties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./target_properties */ \"./node_modules/@stimulus/core/dist/target_properties.js\");\n/* harmony import */ var _value_properties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./value_properties */ \"./node_modules/@stimulus/core/dist/value_properties.js\");\n\n\n\nvar Controller = /** @class */ (function () {\n function Controller(context) {\n this.context = context;\n }\n Object.defineProperty(Controller.prototype, \"application\", {\n get: function () {\n return this.context.application;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"scope\", {\n get: function () {\n return this.context.scope;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"identifier\", {\n get: function () {\n return this.scope.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"targets\", {\n get: function () {\n return this.scope.targets;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"classes\", {\n get: function () {\n return this.scope.classes;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"data\", {\n get: function () {\n return this.scope.data;\n },\n enumerable: false,\n configurable: true\n });\n Controller.prototype.initialize = function () {\n // Override in your subclass to set up initial controller state\n };\n Controller.prototype.connect = function () {\n // Override in your subclass to respond when the controller is connected to the DOM\n };\n Controller.prototype.disconnect = function () {\n // Override in your subclass to respond when the controller is disconnected from the DOM\n };\n Controller.blessings = [_class_properties__WEBPACK_IMPORTED_MODULE_0__[\"ClassPropertiesBlessing\"], _target_properties__WEBPACK_IMPORTED_MODULE_1__[\"TargetPropertiesBlessing\"], _value_properties__WEBPACK_IMPORTED_MODULE_2__[\"ValuePropertiesBlessing\"]];\n Controller.targets = [];\n Controller.values = {};\n return Controller;\n}());\n\n//# sourceMappingURL=controller.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/controller.js?");
|
913
|
-
|
914
|
-
/***/ }),
|
915
|
-
|
916
|
-
/***/ "./node_modules/@stimulus/core/dist/data_map.js":
|
917
|
-
/*!******************************************************!*\
|
918
|
-
!*** ./node_modules/@stimulus/core/dist/data_map.js ***!
|
919
|
-
\******************************************************/
|
920
|
-
/*! exports provided: DataMap */
|
921
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
922
|
-
|
923
|
-
"use strict";
|
924
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataMap\", function() { return DataMap; });\n/* harmony import */ var _string_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./string_helpers */ \"./node_modules/@stimulus/core/dist/string_helpers.js\");\n\nvar DataMap = /** @class */ (function () {\n function DataMap(scope) {\n this.scope = scope;\n }\n Object.defineProperty(DataMap.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataMap.prototype, \"identifier\", {\n get: function () {\n return this.scope.identifier;\n },\n enumerable: false,\n configurable: true\n });\n DataMap.prototype.get = function (key) {\n var name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n };\n DataMap.prototype.set = function (key, value) {\n var name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n };\n DataMap.prototype.has = function (key) {\n var name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n };\n DataMap.prototype.delete = function (key) {\n if (this.has(key)) {\n var name_1 = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name_1);\n return true;\n }\n else {\n return false;\n }\n };\n DataMap.prototype.getAttributeNameForKey = function (key) {\n return \"data-\" + this.identifier + \"-\" + Object(_string_helpers__WEBPACK_IMPORTED_MODULE_0__[\"dasherize\"])(key);\n };\n return DataMap;\n}());\n\n//# sourceMappingURL=data_map.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/data_map.js?");
|
925
|
-
|
926
|
-
/***/ }),
|
927
|
-
|
928
|
-
/***/ "./node_modules/@stimulus/core/dist/definition.js":
|
929
|
-
/*!********************************************************!*\
|
930
|
-
!*** ./node_modules/@stimulus/core/dist/definition.js ***!
|
931
|
-
\********************************************************/
|
932
|
-
/*! exports provided: blessDefinition */
|
933
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
934
|
-
|
935
|
-
"use strict";
|
936
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blessDefinition\", function() { return blessDefinition; });\n/* harmony import */ var _blessing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./blessing */ \"./node_modules/@stimulus/core/dist/blessing.js\");\n\n/** @hidden */\nfunction blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: Object(_blessing__WEBPACK_IMPORTED_MODULE_0__[\"bless\"])(definition.controllerConstructor)\n };\n}\n//# sourceMappingURL=definition.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/definition.js?");
|
937
|
-
|
938
|
-
/***/ }),
|
939
|
-
|
940
|
-
/***/ "./node_modules/@stimulus/core/dist/dispatcher.js":
|
941
|
-
/*!********************************************************!*\
|
942
|
-
!*** ./node_modules/@stimulus/core/dist/dispatcher.js ***!
|
943
|
-
\********************************************************/
|
944
|
-
/*! exports provided: Dispatcher */
|
945
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
946
|
-
|
947
|
-
"use strict";
|
948
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Dispatcher\", function() { return Dispatcher; });\n/* harmony import */ var _event_listener__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event_listener */ \"./node_modules/@stimulus/core/dist/event_listener.js\");\n\nvar Dispatcher = /** @class */ (function () {\n function Dispatcher(application) {\n this.application = application;\n this.eventListenerMaps = new Map;\n this.started = false;\n }\n Dispatcher.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach(function (eventListener) { return eventListener.connect(); });\n }\n };\n Dispatcher.prototype.stop = function () {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach(function (eventListener) { return eventListener.disconnect(); });\n }\n };\n Object.defineProperty(Dispatcher.prototype, \"eventListeners\", {\n get: function () {\n return Array.from(this.eventListenerMaps.values())\n .reduce(function (listeners, map) { return listeners.concat(Array.from(map.values())); }, []);\n },\n enumerable: false,\n configurable: true\n });\n // Binding observer delegate\n /** @hidden */\n Dispatcher.prototype.bindingConnected = function (binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n };\n /** @hidden */\n Dispatcher.prototype.bindingDisconnected = function (binding) {\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n };\n // Error handling\n Dispatcher.prototype.handleError = function (error, message, detail) {\n if (detail === void 0) { detail = {}; }\n this.application.handleError(error, \"Error \" + message, detail);\n };\n Dispatcher.prototype.fetchEventListenerForBinding = function (binding) {\n var eventTarget = binding.eventTarget, eventName = binding.eventName, eventOptions = binding.eventOptions;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n };\n Dispatcher.prototype.fetchEventListener = function (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 Dispatcher.prototype.createEventListener = function (eventTarget, eventName, eventOptions) {\n var eventListener = new _event_listener__WEBPACK_IMPORTED_MODULE_0__[\"EventListener\"](eventTarget, eventName, eventOptions);\n if (this.started) {\n eventListener.connect();\n }\n return eventListener;\n };\n Dispatcher.prototype.fetchEventListenerMapForEventTarget = function (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 Dispatcher.prototype.cacheKey = function (eventName, eventOptions) {\n var parts = [eventName];\n Object.keys(eventOptions).sort().forEach(function (key) {\n parts.push(\"\" + (eventOptions[key] ? \"\" : \"!\") + key);\n });\n return parts.join(\":\");\n };\n return Dispatcher;\n}());\n\n//# sourceMappingURL=dispatcher.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/dispatcher.js?");
|
949
|
-
|
950
|
-
/***/ }),
|
951
|
-
|
952
|
-
/***/ "./node_modules/@stimulus/core/dist/event_listener.js":
|
953
|
-
/*!************************************************************!*\
|
954
|
-
!*** ./node_modules/@stimulus/core/dist/event_listener.js ***!
|
955
|
-
\************************************************************/
|
956
|
-
/*! exports provided: EventListener */
|
957
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
958
|
-
|
959
|
-
"use strict";
|
960
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EventListener\", function() { return EventListener; });\nvar EventListener = /** @class */ (function () {\n function EventListener(eventTarget, eventName, eventOptions) {\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n EventListener.prototype.connect = function () {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n };\n EventListener.prototype.disconnect = function () {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n };\n // Binding observer delegate\n /** @hidden */\n EventListener.prototype.bindingConnected = function (binding) {\n this.unorderedBindings.add(binding);\n };\n /** @hidden */\n EventListener.prototype.bindingDisconnected = function (binding) {\n this.unorderedBindings.delete(binding);\n };\n EventListener.prototype.handleEvent = function (event) {\n var extendedEvent = extendEvent(event);\n for (var _i = 0, _a = this.bindings; _i < _a.length; _i++) {\n var binding = _a[_i];\n if (extendedEvent.immediatePropagationStopped) {\n break;\n }\n else {\n binding.handleEvent(extendedEvent);\n }\n }\n };\n Object.defineProperty(EventListener.prototype, \"bindings\", {\n get: function () {\n return Array.from(this.unorderedBindings).sort(function (left, right) {\n var leftIndex = left.index, rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n },\n enumerable: false,\n configurable: true\n });\n return EventListener;\n}());\n\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n }\n else {\n var stopImmediatePropagation_1 = event.stopImmediatePropagation;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation: function () {\n this.immediatePropagationStopped = true;\n stopImmediatePropagation_1.call(this);\n }\n });\n }\n}\n//# sourceMappingURL=event_listener.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/event_listener.js?");
|
961
|
-
|
962
|
-
/***/ }),
|
963
|
-
|
964
|
-
/***/ "./node_modules/@stimulus/core/dist/guide.js":
|
965
|
-
/*!***************************************************!*\
|
966
|
-
!*** ./node_modules/@stimulus/core/dist/guide.js ***!
|
967
|
-
\***************************************************/
|
968
|
-
/*! exports provided: Guide */
|
969
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
970
|
-
|
971
|
-
"use strict";
|
972
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Guide\", function() { return Guide; });\nvar Guide = /** @class */ (function () {\n function Guide(logger) {\n this.warnedKeysByObject = new WeakMap;\n this.logger = logger;\n }\n Guide.prototype.warn = function (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 return Guide;\n}());\n\n//# sourceMappingURL=guide.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/guide.js?");
|
973
|
-
|
974
|
-
/***/ }),
|
975
|
-
|
976
|
-
/***/ "./node_modules/@stimulus/core/dist/index.js":
|
977
|
-
/*!***************************************************!*\
|
978
|
-
!*** ./node_modules/@stimulus/core/dist/index.js ***!
|
979
|
-
\***************************************************/
|
980
|
-
/*! exports provided: Application, Context, Controller, defaultSchema */
|
981
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
982
|
-
|
983
|
-
"use strict";
|
984
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./application */ \"./node_modules/@stimulus/core/dist/application.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Application\", function() { return _application__WEBPACK_IMPORTED_MODULE_0__[\"Application\"]; });\n\n/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context */ \"./node_modules/@stimulus/core/dist/context.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Context\", function() { return _context__WEBPACK_IMPORTED_MODULE_1__[\"Context\"]; });\n\n/* harmony import */ var _controller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controller */ \"./node_modules/@stimulus/core/dist/controller.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Controller\", function() { return _controller__WEBPACK_IMPORTED_MODULE_2__[\"Controller\"]; });\n\n/* harmony import */ var _schema__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./schema */ \"./node_modules/@stimulus/core/dist/schema.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"defaultSchema\", function() { return _schema__WEBPACK_IMPORTED_MODULE_3__[\"defaultSchema\"]; });\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/index.js?");
|
985
|
-
|
986
|
-
/***/ }),
|
987
|
-
|
988
|
-
/***/ "./node_modules/@stimulus/core/dist/inheritable_statics.js":
|
989
|
-
/*!*****************************************************************!*\
|
990
|
-
!*** ./node_modules/@stimulus/core/dist/inheritable_statics.js ***!
|
991
|
-
\*****************************************************************/
|
992
|
-
/*! exports provided: readInheritableStaticArrayValues, readInheritableStaticObjectPairs */
|
993
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
994
|
-
|
995
|
-
"use strict";
|
996
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"readInheritableStaticArrayValues\", function() { return readInheritableStaticArrayValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"readInheritableStaticObjectPairs\", function() { return readInheritableStaticObjectPairs; });\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) { return values.add(name); });\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, 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) { return [key, definition[key]]; }) : [];\n}\n//# sourceMappingURL=inheritable_statics.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/inheritable_statics.js?");
|
997
|
-
|
998
|
-
/***/ }),
|
999
|
-
|
1000
|
-
/***/ "./node_modules/@stimulus/core/dist/module.js":
|
1001
|
-
/*!****************************************************!*\
|
1002
|
-
!*** ./node_modules/@stimulus/core/dist/module.js ***!
|
1003
|
-
\****************************************************/
|
1004
|
-
/*! exports provided: Module */
|
1005
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1006
|
-
|
1007
|
-
"use strict";
|
1008
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Module\", function() { return Module; });\n/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./context */ \"./node_modules/@stimulus/core/dist/context.js\");\n/* harmony import */ var _definition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./definition */ \"./node_modules/@stimulus/core/dist/definition.js\");\n\n\nvar Module = /** @class */ (function () {\n function Module(application, definition) {\n this.application = application;\n this.definition = Object(_definition__WEBPACK_IMPORTED_MODULE_1__[\"blessDefinition\"])(definition);\n this.contextsByScope = new WeakMap;\n this.connectedContexts = new Set;\n }\n Object.defineProperty(Module.prototype, \"identifier\", {\n get: function () {\n return this.definition.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Module.prototype, \"controllerConstructor\", {\n get: function () {\n return this.definition.controllerConstructor;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Module.prototype, \"contexts\", {\n get: function () {\n return Array.from(this.connectedContexts);\n },\n enumerable: false,\n configurable: true\n });\n Module.prototype.connectContextForScope = function (scope) {\n var context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n };\n Module.prototype.disconnectContextForScope = function (scope) {\n var context = this.contextsByScope.get(scope);\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n };\n Module.prototype.fetchContextForScope = function (scope) {\n var context = this.contextsByScope.get(scope);\n if (!context) {\n context = new _context__WEBPACK_IMPORTED_MODULE_0__[\"Context\"](this, scope);\n this.contextsByScope.set(scope, context);\n }\n return context;\n };\n return Module;\n}());\n\n//# sourceMappingURL=module.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/module.js?");
|
1009
|
-
|
1010
|
-
/***/ }),
|
1011
|
-
|
1012
|
-
/***/ "./node_modules/@stimulus/core/dist/router.js":
|
1013
|
-
/*!****************************************************!*\
|
1014
|
-
!*** ./node_modules/@stimulus/core/dist/router.js ***!
|
1015
|
-
\****************************************************/
|
1016
|
-
/*! exports provided: Router */
|
1017
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1018
|
-
|
1019
|
-
"use strict";
|
1020
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Router\", function() { return Router; });\n/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./module */ \"./node_modules/@stimulus/core/dist/module.js\");\n/* harmony import */ var _stimulus_multimap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @stimulus/multimap */ \"./node_modules/@stimulus/multimap/dist/index.js\");\n/* harmony import */ var _scope__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scope */ \"./node_modules/@stimulus/core/dist/scope.js\");\n/* harmony import */ var _scope_observer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scope_observer */ \"./node_modules/@stimulus/core/dist/scope_observer.js\");\n\n\n\n\nvar Router = /** @class */ (function () {\n function Router(application) {\n this.application = application;\n this.scopeObserver = new _scope_observer__WEBPACK_IMPORTED_MODULE_3__[\"ScopeObserver\"](this.element, this.schema, this);\n this.scopesByIdentifier = new _stimulus_multimap__WEBPACK_IMPORTED_MODULE_1__[\"Multimap\"];\n this.modulesByIdentifier = new Map;\n }\n Object.defineProperty(Router.prototype, \"element\", {\n get: function () {\n return this.application.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"schema\", {\n get: function () {\n return this.application.schema;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"logger\", {\n get: function () {\n return this.application.logger;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"controllerAttribute\", {\n get: function () {\n return this.schema.controllerAttribute;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"modules\", {\n get: function () {\n return Array.from(this.modulesByIdentifier.values());\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"contexts\", {\n get: function () {\n return this.modules.reduce(function (contexts, module) { return contexts.concat(module.contexts); }, []);\n },\n enumerable: false,\n configurable: true\n });\n Router.prototype.start = function () {\n this.scopeObserver.start();\n };\n Router.prototype.stop = function () {\n this.scopeObserver.stop();\n };\n Router.prototype.loadDefinition = function (definition) {\n this.unloadIdentifier(definition.identifier);\n var module = new _module__WEBPACK_IMPORTED_MODULE_0__[\"Module\"](this.application, definition);\n this.connectModule(module);\n };\n Router.prototype.unloadIdentifier = function (identifier) {\n var module = this.modulesByIdentifier.get(identifier);\n if (module) {\n this.disconnectModule(module);\n }\n };\n Router.prototype.getContextForElementAndIdentifier = function (element, identifier) {\n var module = this.modulesByIdentifier.get(identifier);\n if (module) {\n return module.contexts.find(function (context) { return context.element == element; });\n }\n };\n // Error handler delegate\n /** @hidden */\n Router.prototype.handleError = function (error, message, detail) {\n this.application.handleError(error, message, detail);\n };\n // Scope observer delegate\n /** @hidden */\n Router.prototype.createScopeForElementAndIdentifier = function (element, identifier) {\n return new _scope__WEBPACK_IMPORTED_MODULE_2__[\"Scope\"](this.schema, element, identifier, this.logger);\n };\n /** @hidden */\n Router.prototype.scopeConnected = function (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 /** @hidden */\n Router.prototype.scopeDisconnected = function (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 // Modules\n Router.prototype.connectModule = function (module) {\n this.modulesByIdentifier.set(module.identifier, module);\n var scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(function (scope) { return module.connectContextForScope(scope); });\n };\n Router.prototype.disconnectModule = function (module) {\n this.modulesByIdentifier.delete(module.identifier);\n var scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(function (scope) { return module.disconnectContextForScope(scope); });\n };\n return Router;\n}());\n\n//# sourceMappingURL=router.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/router.js?");
|
1021
|
-
|
1022
|
-
/***/ }),
|
1023
|
-
|
1024
|
-
/***/ "./node_modules/@stimulus/core/dist/schema.js":
|
1025
|
-
/*!****************************************************!*\
|
1026
|
-
!*** ./node_modules/@stimulus/core/dist/schema.js ***!
|
1027
|
-
\****************************************************/
|
1028
|
-
/*! exports provided: defaultSchema */
|
1029
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1030
|
-
|
1031
|
-
"use strict";
|
1032
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultSchema\", function() { return defaultSchema; });\nvar defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\"\n};\n//# sourceMappingURL=schema.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/schema.js?");
|
1033
|
-
|
1034
|
-
/***/ }),
|
1035
|
-
|
1036
|
-
/***/ "./node_modules/@stimulus/core/dist/scope.js":
|
1037
|
-
/*!***************************************************!*\
|
1038
|
-
!*** ./node_modules/@stimulus/core/dist/scope.js ***!
|
1039
|
-
\***************************************************/
|
1040
|
-
/*! exports provided: Scope */
|
1041
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1042
|
-
|
1043
|
-
"use strict";
|
1044
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Scope\", function() { return Scope; });\n/* harmony import */ var _class_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./class_map */ \"./node_modules/@stimulus/core/dist/class_map.js\");\n/* harmony import */ var _data_map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./data_map */ \"./node_modules/@stimulus/core/dist/data_map.js\");\n/* harmony import */ var _guide__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./guide */ \"./node_modules/@stimulus/core/dist/guide.js\");\n/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ \"./node_modules/@stimulus/core/dist/selectors.js\");\n/* harmony import */ var _target_set__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./target_set */ \"./node_modules/@stimulus/core/dist/target_set.js\");\nvar __spreadArrays = (undefined && undefined.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\n\n\n\n\n\nvar Scope = /** @class */ (function () {\n function Scope(schema, element, identifier, logger) {\n var _this = this;\n this.targets = new _target_set__WEBPACK_IMPORTED_MODULE_4__[\"TargetSet\"](this);\n this.classes = new _class_map__WEBPACK_IMPORTED_MODULE_0__[\"ClassMap\"](this);\n this.data = new _data_map__WEBPACK_IMPORTED_MODULE_1__[\"DataMap\"](this);\n this.containsElement = function (element) {\n return element.closest(_this.controllerSelector) === _this.element;\n };\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new _guide__WEBPACK_IMPORTED_MODULE_2__[\"Guide\"](logger);\n }\n Scope.prototype.findElement = function (selector) {\n return this.element.matches(selector)\n ? this.element\n : this.queryElements(selector).find(this.containsElement);\n };\n Scope.prototype.findAllElements = function (selector) {\n return __spreadArrays(this.element.matches(selector) ? [this.element] : [], this.queryElements(selector).filter(this.containsElement));\n };\n Scope.prototype.queryElements = function (selector) {\n return Array.from(this.element.querySelectorAll(selector));\n };\n Object.defineProperty(Scope.prototype, \"controllerSelector\", {\n get: function () {\n return Object(_selectors__WEBPACK_IMPORTED_MODULE_3__[\"attributeValueContainsToken\"])(this.schema.controllerAttribute, this.identifier);\n },\n enumerable: false,\n configurable: true\n });\n return Scope;\n}());\n\n//# sourceMappingURL=scope.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/scope.js?");
|
1045
|
-
|
1046
|
-
/***/ }),
|
1047
|
-
|
1048
|
-
/***/ "./node_modules/@stimulus/core/dist/scope_observer.js":
|
1049
|
-
/*!************************************************************!*\
|
1050
|
-
!*** ./node_modules/@stimulus/core/dist/scope_observer.js ***!
|
1051
|
-
\************************************************************/
|
1052
|
-
/*! exports provided: ScopeObserver */
|
1053
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1054
|
-
|
1055
|
-
"use strict";
|
1056
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ScopeObserver\", function() { return ScopeObserver; });\n/* harmony import */ var _stimulus_mutation_observers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @stimulus/mutation-observers */ \"./node_modules/@stimulus/mutation-observers/dist/index.js\");\n\nvar ScopeObserver = /** @class */ (function () {\n function ScopeObserver(element, schema, delegate) {\n this.element = element;\n this.schema = schema;\n this.delegate = delegate;\n this.valueListObserver = new _stimulus_mutation_observers__WEBPACK_IMPORTED_MODULE_0__[\"ValueListObserver\"](this.element, this.controllerAttribute, this);\n this.scopesByIdentifierByElement = new WeakMap;\n this.scopeReferenceCounts = new WeakMap;\n }\n ScopeObserver.prototype.start = function () {\n this.valueListObserver.start();\n };\n ScopeObserver.prototype.stop = function () {\n this.valueListObserver.stop();\n };\n Object.defineProperty(ScopeObserver.prototype, \"controllerAttribute\", {\n get: function () {\n return this.schema.controllerAttribute;\n },\n enumerable: false,\n configurable: true\n });\n // Value observer delegate\n /** @hidden */\n ScopeObserver.prototype.parseValueForToken = function (token) {\n var element = token.element, identifier = token.content;\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 /** @hidden */\n ScopeObserver.prototype.elementMatchedValue = function (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 /** @hidden */\n ScopeObserver.prototype.elementUnmatchedValue = function (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 ScopeObserver.prototype.fetchScopesByIdentifierForElement = function (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 return ScopeObserver;\n}());\n\n//# sourceMappingURL=scope_observer.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/scope_observer.js?");
|
1057
|
-
|
1058
|
-
/***/ }),
|
1059
|
-
|
1060
|
-
/***/ "./node_modules/@stimulus/core/dist/selectors.js":
|
1061
|
-
/*!*******************************************************!*\
|
1062
|
-
!*** ./node_modules/@stimulus/core/dist/selectors.js ***!
|
1063
|
-
\*******************************************************/
|
1064
|
-
/*! exports provided: attributeValueContainsToken */
|
1065
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1066
|
-
|
1067
|
-
"use strict";
|
1068
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"attributeValueContainsToken\", function() { return attributeValueContainsToken; });\n/** @hidden */\nfunction attributeValueContainsToken(attributeName, token) {\n return \"[\" + attributeName + \"~=\\\"\" + token + \"\\\"]\";\n}\n//# sourceMappingURL=selectors.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/selectors.js?");
|
1069
|
-
|
1070
|
-
/***/ }),
|
1071
|
-
|
1072
|
-
/***/ "./node_modules/@stimulus/core/dist/string_helpers.js":
|
1073
|
-
/*!************************************************************!*\
|
1074
|
-
!*** ./node_modules/@stimulus/core/dist/string_helpers.js ***!
|
1075
|
-
\************************************************************/
|
1076
|
-
/*! exports provided: camelize, capitalize, dasherize */
|
1077
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1078
|
-
|
1079
|
-
"use strict";
|
1080
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"camelize\", function() { return camelize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"capitalize\", function() { return capitalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dasherize\", function() { return dasherize; });\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, function (_, char) { return char.toUpperCase(); });\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) { return \"-\" + char.toLowerCase(); });\n}\n//# sourceMappingURL=string_helpers.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/string_helpers.js?");
|
1081
|
-
|
1082
|
-
/***/ }),
|
1083
|
-
|
1084
|
-
/***/ "./node_modules/@stimulus/core/dist/target_properties.js":
|
1085
|
-
/*!***************************************************************!*\
|
1086
|
-
!*** ./node_modules/@stimulus/core/dist/target_properties.js ***!
|
1087
|
-
\***************************************************************/
|
1088
|
-
/*! exports provided: TargetPropertiesBlessing */
|
1089
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1090
|
-
|
1091
|
-
"use strict";
|
1092
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TargetPropertiesBlessing\", function() { return TargetPropertiesBlessing; });\n/* harmony import */ var _inheritable_statics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inheritable_statics */ \"./node_modules/@stimulus/core/dist/inheritable_statics.js\");\n/* harmony import */ var _string_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string_helpers */ \"./node_modules/@stimulus/core/dist/string_helpers.js\");\n\n\n/** @hidden */\nfunction TargetPropertiesBlessing(constructor) {\n var targets = Object(_inheritable_statics__WEBPACK_IMPORTED_MODULE_0__[\"readInheritableStaticArrayValues\"])(constructor, \"targets\");\n return targets.reduce(function (properties, targetDefinition) {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n var _a;\n return _a = {},\n _a[name + \"Target\"] = {\n get: function () {\n var target = this.targets.find(name);\n if (target) {\n return target;\n }\n else {\n throw new Error(\"Missing target element \\\"\" + this.identifier + \".\" + name + \"\\\"\");\n }\n }\n },\n _a[name + \"Targets\"] = {\n get: function () {\n return this.targets.findAll(name);\n }\n },\n _a[\"has\" + Object(_string_helpers__WEBPACK_IMPORTED_MODULE_1__[\"capitalize\"])(name) + \"Target\"] = {\n get: function () {\n return this.targets.has(name);\n }\n },\n _a;\n}\n//# sourceMappingURL=target_properties.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/target_properties.js?");
|
1093
|
-
|
1094
|
-
/***/ }),
|
1095
|
-
|
1096
|
-
/***/ "./node_modules/@stimulus/core/dist/target_set.js":
|
1097
|
-
/*!********************************************************!*\
|
1098
|
-
!*** ./node_modules/@stimulus/core/dist/target_set.js ***!
|
1099
|
-
\********************************************************/
|
1100
|
-
/*! exports provided: TargetSet */
|
1101
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1102
|
-
|
1103
|
-
"use strict";
|
1104
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TargetSet\", function() { return TargetSet; });\n/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selectors */ \"./node_modules/@stimulus/core/dist/selectors.js\");\nvar __spreadArrays = (undefined && undefined.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\n\nvar TargetSet = /** @class */ (function () {\n function TargetSet(scope) {\n this.scope = scope;\n }\n Object.defineProperty(TargetSet.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TargetSet.prototype, \"identifier\", {\n get: function () {\n return this.scope.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TargetSet.prototype, \"schema\", {\n get: function () {\n return this.scope.schema;\n },\n enumerable: false,\n configurable: true\n });\n TargetSet.prototype.has = function (targetName) {\n return this.find(targetName) != null;\n };\n TargetSet.prototype.find = function () {\n var _this = this;\n var targetNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n targetNames[_i] = arguments[_i];\n }\n return targetNames.reduce(function (target, targetName) {\n return target\n || _this.findTarget(targetName)\n || _this.findLegacyTarget(targetName);\n }, undefined);\n };\n TargetSet.prototype.findAll = function () {\n var _this = this;\n var targetNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n targetNames[_i] = arguments[_i];\n }\n return targetNames.reduce(function (targets, targetName) { return __spreadArrays(targets, _this.findAllTargets(targetName), _this.findAllLegacyTargets(targetName)); }, []);\n };\n TargetSet.prototype.findTarget = function (targetName) {\n var selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n };\n TargetSet.prototype.findAllTargets = function (targetName) {\n var selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n };\n TargetSet.prototype.getSelectorForTargetName = function (targetName) {\n var attributeName = \"data-\" + this.identifier + \"-target\";\n return Object(_selectors__WEBPACK_IMPORTED_MODULE_0__[\"attributeValueContainsToken\"])(attributeName, targetName);\n };\n TargetSet.prototype.findLegacyTarget = function (targetName) {\n var selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n };\n TargetSet.prototype.findAllLegacyTargets = function (targetName) {\n var _this = this;\n var selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map(function (element) { return _this.deprecate(element, targetName); });\n };\n TargetSet.prototype.getLegacySelectorForTargetName = function (targetName) {\n var targetDescriptor = this.identifier + \".\" + targetName;\n return Object(_selectors__WEBPACK_IMPORTED_MODULE_0__[\"attributeValueContainsToken\"])(this.schema.targetAttribute, targetDescriptor);\n };\n TargetSet.prototype.deprecate = function (element, targetName) {\n if (element) {\n var identifier = this.identifier;\n var attributeName = this.schema.targetAttribute;\n this.guide.warn(element, \"target:\" + targetName, \"Please replace \" + attributeName + \"=\\\"\" + identifier + \".\" + targetName + \"\\\" with data-\" + identifier + \"-target=\\\"\" + targetName + \"\\\". \" +\n (\"The \" + attributeName + \" attribute is deprecated and will be removed in a future version of Stimulus.\"));\n }\n return element;\n };\n Object.defineProperty(TargetSet.prototype, \"guide\", {\n get: function () {\n return this.scope.guide;\n },\n enumerable: false,\n configurable: true\n });\n return TargetSet;\n}());\n\n//# sourceMappingURL=target_set.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/target_set.js?");
|
1105
|
-
|
1106
|
-
/***/ }),
|
1107
|
-
|
1108
|
-
/***/ "./node_modules/@stimulus/core/dist/value_observer.js":
|
1109
|
-
/*!************************************************************!*\
|
1110
|
-
!*** ./node_modules/@stimulus/core/dist/value_observer.js ***!
|
1111
|
-
\************************************************************/
|
1112
|
-
/*! exports provided: ValueObserver */
|
1113
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1114
|
-
|
1115
|
-
"use strict";
|
1116
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ValueObserver\", function() { return ValueObserver; });\n/* harmony import */ var _stimulus_mutation_observers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @stimulus/mutation-observers */ \"./node_modules/@stimulus/mutation-observers/dist/index.js\");\n\nvar ValueObserver = /** @class */ (function () {\n function ValueObserver(context, receiver) {\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new _stimulus_mutation_observers__WEBPACK_IMPORTED_MODULE_0__[\"StringMapObserver\"](this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n this.invokeChangedCallbacksForDefaultValues();\n }\n ValueObserver.prototype.start = function () {\n this.stringMapObserver.start();\n };\n ValueObserver.prototype.stop = function () {\n this.stringMapObserver.stop();\n };\n Object.defineProperty(ValueObserver.prototype, \"element\", {\n get: function () {\n return this.context.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ValueObserver.prototype, \"controller\", {\n get: function () {\n return this.context.controller;\n },\n enumerable: false,\n configurable: true\n });\n // String map observer delegate\n ValueObserver.prototype.getStringMapKeyForAttribute = function (attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n };\n ValueObserver.prototype.stringMapValueChanged = function (attributeValue, name) {\n this.invokeChangedCallbackForValue(name);\n };\n ValueObserver.prototype.invokeChangedCallbacksForDefaultValues = function () {\n for (var _i = 0, _a = this.valueDescriptors; _i < _a.length; _i++) {\n var _b = _a[_i], key = _b.key, name_1 = _b.name, defaultValue = _b.defaultValue;\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallbackForValue(name_1);\n }\n }\n };\n ValueObserver.prototype.invokeChangedCallbackForValue = function (name) {\n var methodName = name + \"Changed\";\n var method = this.receiver[methodName];\n if (typeof method == \"function\") {\n var value = this.receiver[name];\n method.call(this.receiver, value);\n }\n };\n Object.defineProperty(ValueObserver.prototype, \"valueDescriptors\", {\n get: function () {\n var valueDescriptorMap = this.valueDescriptorMap;\n return Object.keys(valueDescriptorMap).map(function (key) { return valueDescriptorMap[key]; });\n },\n enumerable: false,\n configurable: true\n });\n return ValueObserver;\n}());\n\n//# sourceMappingURL=value_observer.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/value_observer.js?");
|
1117
|
-
|
1118
|
-
/***/ }),
|
1119
|
-
|
1120
|
-
/***/ "./node_modules/@stimulus/core/dist/value_properties.js":
|
1121
|
-
/*!**************************************************************!*\
|
1122
|
-
!*** ./node_modules/@stimulus/core/dist/value_properties.js ***!
|
1123
|
-
\**************************************************************/
|
1124
|
-
/*! exports provided: ValuePropertiesBlessing, propertiesForValueDefinitionPair */
|
1125
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1126
|
-
|
1127
|
-
"use strict";
|
1128
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ValuePropertiesBlessing\", function() { return ValuePropertiesBlessing; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"propertiesForValueDefinitionPair\", function() { return propertiesForValueDefinitionPair; });\n/* harmony import */ var _inheritable_statics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inheritable_statics */ \"./node_modules/@stimulus/core/dist/inheritable_statics.js\");\n/* harmony import */ var _string_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string_helpers */ \"./node_modules/@stimulus/core/dist/string_helpers.js\");\n\n\n/** @hidden */\nfunction ValuePropertiesBlessing(constructor) {\n var valueDefinitionPairs = Object(_inheritable_statics__WEBPACK_IMPORTED_MODULE_0__[\"readInheritableStaticObjectPairs\"])(constructor, \"values\");\n var propertyDescriptorMap = {\n valueDescriptorMap: {\n get: function () {\n var _this = this;\n return valueDefinitionPairs.reduce(function (result, valueDefinitionPair) {\n var _a;\n var valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);\n var attributeName = _this.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, (_a = {}, _a[attributeName] = valueDescriptor, _a));\n }, {});\n }\n }\n };\n return valueDefinitionPairs.reduce(function (properties, valueDefinitionPair) {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\n/** @hidden */\nfunction propertiesForValueDefinitionPair(valueDefinitionPair) {\n var _a;\n var definition = parseValueDefinitionPair(valueDefinitionPair);\n var type = definition.type, key = definition.key, name = definition.name;\n var read = readers[type], write = writers[type] || writers.default;\n return _a = {},\n _a[name] = {\n get: function () {\n var value = this.data.get(key);\n if (value !== null) {\n return read(value);\n }\n else {\n return definition.defaultValue;\n }\n },\n set: function (value) {\n if (value === undefined) {\n this.data.delete(key);\n }\n else {\n this.data.set(key, write(value));\n }\n }\n },\n _a[\"has\" + Object(_string_helpers__WEBPACK_IMPORTED_MODULE_1__[\"capitalize\"])(name)] = {\n get: function () {\n return this.data.has(key);\n }\n },\n _a;\n}\nfunction parseValueDefinitionPair(_a) {\n var token = _a[0], typeConstant = _a[1];\n var type = parseValueTypeConstant(typeConstant);\n return valueDescriptorForTokenAndType(token, type);\n}\nfunction parseValueTypeConstant(typeConstant) {\n switch (typeConstant) {\n case Array: return \"array\";\n case Boolean: return \"boolean\";\n case Number: return \"number\";\n case Object: return \"object\";\n case String: return \"string\";\n }\n throw new Error(\"Unknown value type constant \\\"\" + typeConstant + \"\\\"\");\n}\nfunction valueDescriptorForTokenAndType(token, type) {\n var key = Object(_string_helpers__WEBPACK_IMPORTED_MODULE_1__[\"dasherize\"])(token) + \"-value\";\n return {\n type: type,\n key: key,\n name: Object(_string_helpers__WEBPACK_IMPORTED_MODULE_1__[\"camelize\"])(key),\n get defaultValue() { return defaultValuesByType[type]; }\n };\n}\nvar defaultValuesByType = {\n get array() { return []; },\n boolean: false,\n number: 0,\n get object() { return {}; },\n string: \"\"\n};\nvar readers = {\n array: function (value) {\n var array = JSON.parse(value);\n if (!Array.isArray(array)) {\n throw new TypeError(\"Expected array\");\n }\n return array;\n },\n boolean: function (value) {\n return !(value == \"0\" || value == \"false\");\n },\n number: function (value) {\n return parseFloat(value);\n },\n object: function (value) {\n var object = JSON.parse(value);\n if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n throw new TypeError(\"Expected object\");\n }\n return object;\n },\n string: function (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 \"\" + value;\n}\n//# sourceMappingURL=value_properties.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/core/dist/value_properties.js?");
|
1129
|
-
|
1130
|
-
/***/ }),
|
1131
|
-
|
1132
|
-
/***/ "./node_modules/@stimulus/multimap/dist/index.js":
|
1133
|
-
/*!*******************************************************!*\
|
1134
|
-
!*** ./node_modules/@stimulus/multimap/dist/index.js ***!
|
1135
|
-
\*******************************************************/
|
1136
|
-
/*! exports provided: IndexedMultimap, Multimap, add, del, fetch, prune */
|
1137
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1138
|
-
|
1139
|
-
"use strict";
|
1140
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _indexed_multimap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./indexed_multimap */ \"./node_modules/@stimulus/multimap/dist/indexed_multimap.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"IndexedMultimap\", function() { return _indexed_multimap__WEBPACK_IMPORTED_MODULE_0__[\"IndexedMultimap\"]; });\n\n/* harmony import */ var _multimap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multimap */ \"./node_modules/@stimulus/multimap/dist/multimap.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Multimap\", function() { return _multimap__WEBPACK_IMPORTED_MODULE_1__[\"Multimap\"]; });\n\n/* harmony import */ var _set_operations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./set_operations */ \"./node_modules/@stimulus/multimap/dist/set_operations.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return _set_operations__WEBPACK_IMPORTED_MODULE_2__[\"add\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"del\", function() { return _set_operations__WEBPACK_IMPORTED_MODULE_2__[\"del\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fetch\", function() { return _set_operations__WEBPACK_IMPORTED_MODULE_2__[\"fetch\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"prune\", function() { return _set_operations__WEBPACK_IMPORTED_MODULE_2__[\"prune\"]; });\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/multimap/dist/index.js?");
|
1141
|
-
|
1142
|
-
/***/ }),
|
1143
|
-
|
1144
|
-
/***/ "./node_modules/@stimulus/multimap/dist/indexed_multimap.js":
|
1145
|
-
/*!******************************************************************!*\
|
1146
|
-
!*** ./node_modules/@stimulus/multimap/dist/indexed_multimap.js ***!
|
1147
|
-
\******************************************************************/
|
1148
|
-
/*! exports provided: IndexedMultimap */
|
1149
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1150
|
-
|
1151
|
-
"use strict";
|
1152
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IndexedMultimap\", function() { return IndexedMultimap; });\n/* harmony import */ var _multimap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./multimap */ \"./node_modules/@stimulus/multimap/dist/multimap.js\");\n/* harmony import */ var _set_operations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./set_operations */ \"./node_modules/@stimulus/multimap/dist/set_operations.js\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar IndexedMultimap = /** @class */ (function (_super) {\n __extends(IndexedMultimap, _super);\n function IndexedMultimap() {\n var _this = _super.call(this) || this;\n _this.keysByValue = new Map;\n return _this;\n }\n Object.defineProperty(IndexedMultimap.prototype, \"values\", {\n get: function () {\n return Array.from(this.keysByValue.keys());\n },\n enumerable: false,\n configurable: true\n });\n IndexedMultimap.prototype.add = function (key, value) {\n _super.prototype.add.call(this, key, value);\n Object(_set_operations__WEBPACK_IMPORTED_MODULE_1__[\"add\"])(this.keysByValue, value, key);\n };\n IndexedMultimap.prototype.delete = function (key, value) {\n _super.prototype.delete.call(this, key, value);\n Object(_set_operations__WEBPACK_IMPORTED_MODULE_1__[\"del\"])(this.keysByValue, value, key);\n };\n IndexedMultimap.prototype.hasValue = function (value) {\n return this.keysByValue.has(value);\n };\n IndexedMultimap.prototype.getKeysForValue = function (value) {\n var set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n };\n return IndexedMultimap;\n}(_multimap__WEBPACK_IMPORTED_MODULE_0__[\"Multimap\"]));\n\n//# sourceMappingURL=indexed_multimap.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/multimap/dist/indexed_multimap.js?");
|
1153
|
-
|
1154
|
-
/***/ }),
|
1155
|
-
|
1156
|
-
/***/ "./node_modules/@stimulus/multimap/dist/multimap.js":
|
1157
|
-
/*!**********************************************************!*\
|
1158
|
-
!*** ./node_modules/@stimulus/multimap/dist/multimap.js ***!
|
1159
|
-
\**********************************************************/
|
1160
|
-
/*! exports provided: Multimap */
|
1161
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1162
|
-
|
1163
|
-
"use strict";
|
1164
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Multimap\", function() { return Multimap; });\n/* harmony import */ var _set_operations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./set_operations */ \"./node_modules/@stimulus/multimap/dist/set_operations.js\");\n\nvar Multimap = /** @class */ (function () {\n function Multimap() {\n this.valuesByKey = new Map();\n }\n Object.defineProperty(Multimap.prototype, \"values\", {\n get: function () {\n var sets = Array.from(this.valuesByKey.values());\n return sets.reduce(function (values, set) { return values.concat(Array.from(set)); }, []);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Multimap.prototype, \"size\", {\n get: function () {\n var sets = Array.from(this.valuesByKey.values());\n return sets.reduce(function (size, set) { return size + set.size; }, 0);\n },\n enumerable: false,\n configurable: true\n });\n Multimap.prototype.add = function (key, value) {\n Object(_set_operations__WEBPACK_IMPORTED_MODULE_0__[\"add\"])(this.valuesByKey, key, value);\n };\n Multimap.prototype.delete = function (key, value) {\n Object(_set_operations__WEBPACK_IMPORTED_MODULE_0__[\"del\"])(this.valuesByKey, key, value);\n };\n Multimap.prototype.has = function (key, value) {\n var values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n };\n Multimap.prototype.hasKey = function (key) {\n return this.valuesByKey.has(key);\n };\n Multimap.prototype.hasValue = function (value) {\n var sets = Array.from(this.valuesByKey.values());\n return sets.some(function (set) { return set.has(value); });\n };\n Multimap.prototype.getValuesForKey = function (key) {\n var values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n };\n Multimap.prototype.getKeysForValue = function (value) {\n return Array.from(this.valuesByKey)\n .filter(function (_a) {\n var key = _a[0], values = _a[1];\n return values.has(value);\n })\n .map(function (_a) {\n var key = _a[0], values = _a[1];\n return key;\n });\n };\n return Multimap;\n}());\n\n//# sourceMappingURL=multimap.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/multimap/dist/multimap.js?");
|
1165
|
-
|
1166
|
-
/***/ }),
|
1167
|
-
|
1168
|
-
/***/ "./node_modules/@stimulus/multimap/dist/set_operations.js":
|
1169
|
-
/*!****************************************************************!*\
|
1170
|
-
!*** ./node_modules/@stimulus/multimap/dist/set_operations.js ***!
|
1171
|
-
\****************************************************************/
|
1172
|
-
/*! exports provided: add, del, fetch, prune */
|
1173
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1174
|
-
|
1175
|
-
"use strict";
|
1176
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"del\", function() { return del; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fetch\", function() { return fetch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prune\", function() { return prune; });\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}\n//# sourceMappingURL=set_operations.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/multimap/dist/set_operations.js?");
|
1177
|
-
|
1178
|
-
/***/ }),
|
1179
|
-
|
1180
|
-
/***/ "./node_modules/@stimulus/mutation-observers/dist/attribute_observer.js":
|
1181
|
-
/*!******************************************************************************!*\
|
1182
|
-
!*** ./node_modules/@stimulus/mutation-observers/dist/attribute_observer.js ***!
|
1183
|
-
\******************************************************************************/
|
1184
|
-
/*! exports provided: AttributeObserver */
|
1185
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1186
|
-
|
1187
|
-
"use strict";
|
1188
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AttributeObserver\", function() { return AttributeObserver; });\n/* harmony import */ var _element_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element_observer */ \"./node_modules/@stimulus/mutation-observers/dist/element_observer.js\");\n\nvar AttributeObserver = /** @class */ (function () {\n function AttributeObserver(element, attributeName, delegate) {\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new _element_observer__WEBPACK_IMPORTED_MODULE_0__[\"ElementObserver\"](element, this);\n }\n Object.defineProperty(AttributeObserver.prototype, \"element\", {\n get: function () {\n return this.elementObserver.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AttributeObserver.prototype, \"selector\", {\n get: function () {\n return \"[\" + this.attributeName + \"]\";\n },\n enumerable: false,\n configurable: true\n });\n AttributeObserver.prototype.start = function () {\n this.elementObserver.start();\n };\n AttributeObserver.prototype.stop = function () {\n this.elementObserver.stop();\n };\n AttributeObserver.prototype.refresh = function () {\n this.elementObserver.refresh();\n };\n Object.defineProperty(AttributeObserver.prototype, \"started\", {\n get: function () {\n return this.elementObserver.started;\n },\n enumerable: false,\n configurable: true\n });\n // Element observer delegate\n AttributeObserver.prototype.matchElement = function (element) {\n return element.hasAttribute(this.attributeName);\n };\n AttributeObserver.prototype.matchElementsInTree = function (tree) {\n var match = this.matchElement(tree) ? [tree] : [];\n var matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n };\n AttributeObserver.prototype.elementMatched = function (element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n };\n AttributeObserver.prototype.elementUnmatched = function (element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n };\n AttributeObserver.prototype.elementAttributeChanged = function (element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n };\n return AttributeObserver;\n}());\n\n//# sourceMappingURL=attribute_observer.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/mutation-observers/dist/attribute_observer.js?");
|
1189
|
-
|
1190
|
-
/***/ }),
|
1191
|
-
|
1192
|
-
/***/ "./node_modules/@stimulus/mutation-observers/dist/element_observer.js":
|
1193
|
-
/*!****************************************************************************!*\
|
1194
|
-
!*** ./node_modules/@stimulus/mutation-observers/dist/element_observer.js ***!
|
1195
|
-
\****************************************************************************/
|
1196
|
-
/*! exports provided: ElementObserver */
|
1197
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1198
|
-
|
1199
|
-
"use strict";
|
1200
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ElementObserver\", function() { return ElementObserver; });\nvar ElementObserver = /** @class */ (function () {\n function ElementObserver(element, delegate) {\n var _this = this;\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set;\n this.mutationObserver = new MutationObserver(function (mutations) { return _this.processMutations(mutations); });\n }\n ElementObserver.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, { attributes: true, childList: true, subtree: true });\n this.refresh();\n }\n };\n ElementObserver.prototype.stop = function () {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n };\n ElementObserver.prototype.refresh = function () {\n if (this.started) {\n var matches = new Set(this.matchElementsInTree());\n for (var _i = 0, _a = Array.from(this.elements); _i < _a.length; _i++) {\n var element = _a[_i];\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n for (var _b = 0, _c = Array.from(matches); _b < _c.length; _b++) {\n var element = _c[_b];\n this.addElement(element);\n }\n }\n };\n // Mutation record processing\n ElementObserver.prototype.processMutations = function (mutations) {\n if (this.started) {\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\n var mutation = mutations_1[_i];\n this.processMutation(mutation);\n }\n }\n };\n ElementObserver.prototype.processMutation = function (mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n }\n else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n };\n ElementObserver.prototype.processAttributeChange = function (node, attributeName) {\n var element = node;\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n }\n else {\n this.removeElement(element);\n }\n }\n else if (this.matchElement(element)) {\n this.addElement(element);\n }\n };\n ElementObserver.prototype.processRemovedNodes = function (nodes) {\n for (var _i = 0, _a = Array.from(nodes); _i < _a.length; _i++) {\n var node = _a[_i];\n var element = this.elementFromNode(node);\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n };\n ElementObserver.prototype.processAddedNodes = function (nodes) {\n for (var _i = 0, _a = Array.from(nodes); _i < _a.length; _i++) {\n var node = _a[_i];\n var element = this.elementFromNode(node);\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n };\n // Element matching\n ElementObserver.prototype.matchElement = function (element) {\n return this.delegate.matchElement(element);\n };\n ElementObserver.prototype.matchElementsInTree = function (tree) {\n if (tree === void 0) { tree = this.element; }\n return this.delegate.matchElementsInTree(tree);\n };\n ElementObserver.prototype.processTree = function (tree, processor) {\n for (var _i = 0, _a = this.matchElementsInTree(tree); _i < _a.length; _i++) {\n var element = _a[_i];\n processor.call(this, element);\n }\n };\n ElementObserver.prototype.elementFromNode = function (node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n };\n ElementObserver.prototype.elementIsActive = function (element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n }\n else {\n return this.element.contains(element);\n }\n };\n // Element tracking\n ElementObserver.prototype.addElement = function (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 ElementObserver.prototype.removeElement = function (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 return ElementObserver;\n}());\n\n//# sourceMappingURL=element_observer.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/mutation-observers/dist/element_observer.js?");
|
1201
|
-
|
1202
|
-
/***/ }),
|
1203
|
-
|
1204
|
-
/***/ "./node_modules/@stimulus/mutation-observers/dist/index.js":
|
1205
|
-
/*!*****************************************************************!*\
|
1206
|
-
!*** ./node_modules/@stimulus/mutation-observers/dist/index.js ***!
|
1207
|
-
\*****************************************************************/
|
1208
|
-
/*! exports provided: AttributeObserver, ElementObserver, StringMapObserver, TokenListObserver, ValueListObserver */
|
1209
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1210
|
-
|
1211
|
-
"use strict";
|
1212
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _attribute_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attribute_observer */ \"./node_modules/@stimulus/mutation-observers/dist/attribute_observer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AttributeObserver\", function() { return _attribute_observer__WEBPACK_IMPORTED_MODULE_0__[\"AttributeObserver\"]; });\n\n/* harmony import */ var _element_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element_observer */ \"./node_modules/@stimulus/mutation-observers/dist/element_observer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ElementObserver\", function() { return _element_observer__WEBPACK_IMPORTED_MODULE_1__[\"ElementObserver\"]; });\n\n/* harmony import */ var _string_map_observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./string_map_observer */ \"./node_modules/@stimulus/mutation-observers/dist/string_map_observer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"StringMapObserver\", function() { return _string_map_observer__WEBPACK_IMPORTED_MODULE_2__[\"StringMapObserver\"]; });\n\n/* harmony import */ var _token_list_observer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./token_list_observer */ \"./node_modules/@stimulus/mutation-observers/dist/token_list_observer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TokenListObserver\", function() { return _token_list_observer__WEBPACK_IMPORTED_MODULE_3__[\"TokenListObserver\"]; });\n\n/* harmony import */ var _value_list_observer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./value_list_observer */ \"./node_modules/@stimulus/mutation-observers/dist/value_list_observer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ValueListObserver\", function() { return _value_list_observer__WEBPACK_IMPORTED_MODULE_4__[\"ValueListObserver\"]; });\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/mutation-observers/dist/index.js?");
|
1213
|
-
|
1214
|
-
/***/ }),
|
1215
|
-
|
1216
|
-
/***/ "./node_modules/@stimulus/mutation-observers/dist/string_map_observer.js":
|
1217
|
-
/*!*******************************************************************************!*\
|
1218
|
-
!*** ./node_modules/@stimulus/mutation-observers/dist/string_map_observer.js ***!
|
1219
|
-
\*******************************************************************************/
|
1220
|
-
/*! exports provided: StringMapObserver */
|
1221
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1222
|
-
|
1223
|
-
"use strict";
|
1224
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StringMapObserver\", function() { return StringMapObserver; });\nvar StringMapObserver = /** @class */ (function () {\n function StringMapObserver(element, delegate) {\n var _this = this;\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map;\n this.mutationObserver = new MutationObserver(function (mutations) { return _this.processMutations(mutations); });\n }\n StringMapObserver.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, { attributes: true });\n this.refresh();\n }\n };\n StringMapObserver.prototype.stop = function () {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n };\n StringMapObserver.prototype.refresh = function () {\n if (this.started) {\n for (var _i = 0, _a = this.knownAttributeNames; _i < _a.length; _i++) {\n var attributeName = _a[_i];\n this.refreshAttribute(attributeName);\n }\n }\n };\n // Mutation record processing\n StringMapObserver.prototype.processMutations = function (mutations) {\n if (this.started) {\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\n var mutation = mutations_1[_i];\n this.processMutation(mutation);\n }\n }\n };\n StringMapObserver.prototype.processMutation = function (mutation) {\n var attributeName = mutation.attributeName;\n if (attributeName) {\n this.refreshAttribute(attributeName);\n }\n };\n // State tracking\n StringMapObserver.prototype.refreshAttribute = function (attributeName) {\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);\n }\n if (value == null) {\n this.stringMap.delete(attributeName);\n this.stringMapKeyRemoved(key, attributeName);\n }\n else {\n this.stringMap.set(attributeName, value);\n }\n }\n };\n StringMapObserver.prototype.stringMapKeyAdded = function (key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n };\n StringMapObserver.prototype.stringMapValueChanged = function (value, key) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key);\n }\n };\n StringMapObserver.prototype.stringMapKeyRemoved = function (key, attributeName) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName);\n }\n };\n Object.defineProperty(StringMapObserver.prototype, \"knownAttributeNames\", {\n get: function () {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StringMapObserver.prototype, \"currentAttributeNames\", {\n get: function () {\n return Array.from(this.element.attributes).map(function (attribute) { return attribute.name; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StringMapObserver.prototype, \"recordedAttributeNames\", {\n get: function () {\n return Array.from(this.stringMap.keys());\n },\n enumerable: false,\n configurable: true\n });\n return StringMapObserver;\n}());\n\n//# sourceMappingURL=string_map_observer.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/mutation-observers/dist/string_map_observer.js?");
|
1225
|
-
|
1226
|
-
/***/ }),
|
1227
|
-
|
1228
|
-
/***/ "./node_modules/@stimulus/mutation-observers/dist/token_list_observer.js":
|
1229
|
-
/*!*******************************************************************************!*\
|
1230
|
-
!*** ./node_modules/@stimulus/mutation-observers/dist/token_list_observer.js ***!
|
1231
|
-
\*******************************************************************************/
|
1232
|
-
/*! exports provided: TokenListObserver */
|
1233
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1234
|
-
|
1235
|
-
"use strict";
|
1236
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TokenListObserver\", function() { return TokenListObserver; });\n/* harmony import */ var _attribute_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attribute_observer */ \"./node_modules/@stimulus/mutation-observers/dist/attribute_observer.js\");\n/* harmony import */ var _stimulus_multimap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @stimulus/multimap */ \"./node_modules/@stimulus/multimap/dist/index.js\");\n\n\nvar TokenListObserver = /** @class */ (function () {\n function TokenListObserver(element, attributeName, delegate) {\n this.attributeObserver = new _attribute_observer__WEBPACK_IMPORTED_MODULE_0__[\"AttributeObserver\"](element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new _stimulus_multimap__WEBPACK_IMPORTED_MODULE_1__[\"Multimap\"];\n }\n Object.defineProperty(TokenListObserver.prototype, \"started\", {\n get: function () {\n return this.attributeObserver.started;\n },\n enumerable: false,\n configurable: true\n });\n TokenListObserver.prototype.start = function () {\n this.attributeObserver.start();\n };\n TokenListObserver.prototype.stop = function () {\n this.attributeObserver.stop();\n };\n TokenListObserver.prototype.refresh = function () {\n this.attributeObserver.refresh();\n };\n Object.defineProperty(TokenListObserver.prototype, \"element\", {\n get: function () {\n return this.attributeObserver.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TokenListObserver.prototype, \"attributeName\", {\n get: function () {\n return this.attributeObserver.attributeName;\n },\n enumerable: false,\n configurable: true\n });\n // Attribute observer delegate\n TokenListObserver.prototype.elementMatchedAttribute = function (element) {\n this.tokensMatched(this.readTokensForElement(element));\n };\n TokenListObserver.prototype.elementAttributeValueChanged = function (element) {\n var _a = this.refreshTokensForElement(element), unmatchedTokens = _a[0], matchedTokens = _a[1];\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n };\n TokenListObserver.prototype.elementUnmatchedAttribute = function (element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n };\n TokenListObserver.prototype.tokensMatched = function (tokens) {\n var _this = this;\n tokens.forEach(function (token) { return _this.tokenMatched(token); });\n };\n TokenListObserver.prototype.tokensUnmatched = function (tokens) {\n var _this = this;\n tokens.forEach(function (token) { return _this.tokenUnmatched(token); });\n };\n TokenListObserver.prototype.tokenMatched = function (token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n };\n TokenListObserver.prototype.tokenUnmatched = function (token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n };\n TokenListObserver.prototype.refreshTokensForElement = function (element) {\n var previousTokens = this.tokensByElement.getValuesForKey(element);\n var currentTokens = this.readTokensForElement(element);\n var firstDifferingIndex = zip(previousTokens, currentTokens)\n .findIndex(function (_a) {\n var previousToken = _a[0], currentToken = _a[1];\n return !tokensAreEqual(previousToken, currentToken);\n });\n if (firstDifferingIndex == -1) {\n return [[], []];\n }\n else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n };\n TokenListObserver.prototype.readTokensForElement = function (element) {\n var attributeName = this.attributeName;\n var tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n };\n return TokenListObserver;\n}());\n\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString.trim().split(/\\s+/).filter(function (content) { return content.length; })\n .map(function (content, index) { return ({ element: element, attributeName: attributeName, content: content, index: index }); });\n}\nfunction zip(left, right) {\n var length = Math.max(left.length, right.length);\n return Array.from({ length: length }, function (_, index) { return [left[index], right[index]]; });\n}\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}\n//# sourceMappingURL=token_list_observer.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/mutation-observers/dist/token_list_observer.js?");
|
1237
|
-
|
1238
|
-
/***/ }),
|
1239
|
-
|
1240
|
-
/***/ "./node_modules/@stimulus/mutation-observers/dist/value_list_observer.js":
|
1241
|
-
/*!*******************************************************************************!*\
|
1242
|
-
!*** ./node_modules/@stimulus/mutation-observers/dist/value_list_observer.js ***!
|
1243
|
-
\*******************************************************************************/
|
1244
|
-
/*! exports provided: ValueListObserver */
|
1245
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1246
|
-
|
1247
|
-
"use strict";
|
1248
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ValueListObserver\", function() { return ValueListObserver; });\n/* harmony import */ var _token_list_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./token_list_observer */ \"./node_modules/@stimulus/mutation-observers/dist/token_list_observer.js\");\n\nvar ValueListObserver = /** @class */ (function () {\n function ValueListObserver(element, attributeName, delegate) {\n this.tokenListObserver = new _token_list_observer__WEBPACK_IMPORTED_MODULE_0__[\"TokenListObserver\"](element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap;\n this.valuesByTokenByElement = new WeakMap;\n }\n Object.defineProperty(ValueListObserver.prototype, \"started\", {\n get: function () {\n return this.tokenListObserver.started;\n },\n enumerable: false,\n configurable: true\n });\n ValueListObserver.prototype.start = function () {\n this.tokenListObserver.start();\n };\n ValueListObserver.prototype.stop = function () {\n this.tokenListObserver.stop();\n };\n ValueListObserver.prototype.refresh = function () {\n this.tokenListObserver.refresh();\n };\n Object.defineProperty(ValueListObserver.prototype, \"element\", {\n get: function () {\n return this.tokenListObserver.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ValueListObserver.prototype, \"attributeName\", {\n get: function () {\n return this.tokenListObserver.attributeName;\n },\n enumerable: false,\n configurable: true\n });\n ValueListObserver.prototype.tokenMatched = function (token) {\n var element = token.element;\n var value = this.fetchParseResultForToken(token).value;\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n };\n ValueListObserver.prototype.tokenUnmatched = function (token) {\n var element = token.element;\n var value = this.fetchParseResultForToken(token).value;\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n };\n ValueListObserver.prototype.fetchParseResultForToken = function (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 ValueListObserver.prototype.fetchValuesByTokenForElement = function (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 ValueListObserver.prototype.parseToken = function (token) {\n try {\n var value = this.delegate.parseValueForToken(token);\n return { value: value };\n }\n catch (error) {\n return { error: error };\n }\n };\n return ValueListObserver;\n}());\n\n//# sourceMappingURL=value_list_observer.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/mutation-observers/dist/value_list_observer.js?");
|
1249
|
-
|
1250
|
-
/***/ }),
|
1251
|
-
|
1252
|
-
/***/ "./node_modules/@stimulus/webpack-helpers/dist/index.js":
|
1253
|
-
/*!**************************************************************!*\
|
1254
|
-
!*** ./node_modules/@stimulus/webpack-helpers/dist/index.js ***!
|
1255
|
-
\**************************************************************/
|
1256
|
-
/*! exports provided: definitionsFromContext, identifierForContextKey */
|
1257
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1258
|
-
|
1259
|
-
"use strict";
|
1260
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"definitionsFromContext\", function() { return definitionsFromContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identifierForContextKey\", function() { return identifierForContextKey; });\nfunction definitionsFromContext(context) {\n return context.keys()\n .map(function (key) { return definitionForModuleWithContextAndKey(context, key); })\n .filter(function (value) { return value; });\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 { identifier: identifier, controllerConstructor: controllerConstructor };\n }\n}\nfunction identifierForContextKey(key) {\n var logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@stimulus/webpack-helpers/dist/index.js?");
|
816
|
+
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/assets/javascripts\nReleased under the MIT license\n */;\n\n(function() {\n var context = this;\n\n (function() {\n (function() {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form:not([data-turbo=true])',\n formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n\n }).call(this);\n }).call(context);\n\n var Rails = context.Rails;\n\n (function() {\n (function() {\n var nonce;\n\n nonce = null;\n\n Rails.loadCSPNonce = function() {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n\n Rails.cspNonce = function() {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n\n }).call(this);\n (function() {\n var expando, m;\n\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\n Rails.matches = function(element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n\n expando = '_ujsData';\n\n Rails.getData = function(element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n\n Rails.setData = function(element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n return element[expando][key] = value;\n };\n\n Rails.$ = function(selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n\n }).call(this);\n (function() {\n var $, csrfParam, csrfToken;\n\n $ = Rails.$;\n\n csrfToken = Rails.csrfToken = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n\n csrfParam = Rails.csrfParam = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n\n Rails.CSRFProtection = function(xhr) {\n var token;\n token = csrfToken();\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n\n Rails.refreshCSRFTokens = function() {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n if ((token != null) && (param != null)) {\n return $('form input[name=\"' + param + '\"]').forEach(function(input) {\n return input.value = token;\n });\n }\n };\n\n }).call(this);\n (function() {\n var CustomEvent, fire, matches, preventDefault;\n\n matches = Rails.matches;\n\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function(event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n CustomEvent.prototype.preventDefault = function() {\n var result;\n result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n }\n return result;\n };\n }\n\n fire = Rails.fire = function(obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n\n Rails.stopEverything = function(e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n\n Rails.delegate = function(element, selector, eventType, handler) {\n return element.addEventListener(eventType, function(e) {\n var target;\n target = e.target;\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n\n }).call(this);\n (function() {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n\n Rails.ajax = function(options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function() {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n if ((options.beforeSend != null) && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n return options;\n };\n\n createXHR = function(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n };\n\n processResponse = function(response, type) {\n var parser, script;\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n return response;\n };\n\n Rails.href = function(element) {\n return element.href;\n };\n\n Rails.isCrossDomain = function(url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n try {\n urlAnchor.href = url;\n return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || (originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host));\n } catch (error) {\n e = error;\n return true;\n }\n };\n\n }).call(this);\n (function() {\n var matches, toArray;\n\n matches = Rails.matches;\n\n toArray = function(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function(element, additionalParam) {\n var inputs, params;\n inputs = [element];\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n params = [];\n inputs.forEach(function(input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, 'fieldset[disabled] *')) {\n return;\n }\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function(option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map(function(param) {\n if (param.name != null) {\n return (encodeURIComponent(param.name)) + \"=\" + (encodeURIComponent(param.value));\n } else {\n return param;\n }\n }).join('&');\n };\n\n Rails.formElements = function(form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function(el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n\n }).call(this);\n (function() {\n var allowAction, fire, stopEverything;\n\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n\n Rails.handleConfirm = function(e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n\n Rails.confirm = function(message, element) {\n return confirm(message);\n };\n\n allowAction = function(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n if (!message) {\n return true;\n }\n answer = false;\n if (fire(element, 'confirm')) {\n try {\n answer = Rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, 'confirm:complete', [answer]);\n }\n return answer && callback;\n };\n\n }).call(this);\n (function() {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n\n Rails.handleDisabledElement = function(e) {\n var element;\n element = this;\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function(e) {\n var element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n\n Rails.disableElement = function(e) {\n var element;\n element = e instanceof Event ? e.target : e;\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n\n disableLinkElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, 'ujs:enable-with', null);\n }\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n\n isXhrRedirect = function(event) {\n var ref, xhr;\n xhr = (ref = event.detail) != null ? ref[0] : void 0;\n return (xhr != null ? xhr.getResponseHeader(\"X-Xhr-Redirect\") : void 0) != null;\n };\n\n }).call(this);\n (function() {\n var stopEverything;\n\n stopEverything = Rails.stopEverything;\n\n Rails.handleMethod = function(e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n if (!method) {\n return;\n }\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"<input name='_method' value='\" + method + \"' type='hidden' />\";\n if ((csrfParam != null) && (csrfToken != null) && !Rails.isCrossDomain(href)) {\n formContent += \"<input name='\" + csrfParam + \"' value='\" + csrfToken + \"' type='hidden' />\";\n }\n formContent += '<input type=\"submit\" />';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n\n }).call(this);\n (function() {\n var ajax, fire, getData, isCrossDomain, isRemote, matches, serializeElement, setData, stopEverything,\n slice = [].slice;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n\n isRemote = function(element) {\n var value;\n value = element.getAttribute('data-remote');\n return (value != null) && value !== 'false';\n };\n\n Rails.handleRemote = function(e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function(xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: (withCredentials != null) && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n\n Rails.formSubmitButtonClick = function(e) {\n var button, form;\n button = this;\n form = button.form;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n\n Rails.preventInsignificantClick = function(e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = (e.button != null) && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n\n }).call(this);\n (function() {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n\n if ((typeof jQuery !== \"undefined\" && jQuery !== null) && (jQuery.ajax != null)) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function(options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n\n Rails.start = function() {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n window.addEventListener('pageshow', function() {\n $(Rails.formEnableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function(e) {\n return setTimeout((function() {\n return disableElement(e);\n }), 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n\n }).call(this);\n }).call(this);\n\n if ( true && module.exports) {\n module.exports = Rails;\n } else if (true) {\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (Rails),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n}).call(this);\n\n\n//# sourceURL=webpack:///./node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js?");
|
1261
817
|
|
1262
818
|
/***/ }),
|
1263
819
|
|
@@ -1268,7 +824,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1268
824
|
/*! no static exports found */
|
1269
825
|
/***/ (function(module, exports, __webpack_require__) {
|
1270
826
|
|
1271
|
-
eval("/*!\n * Bootstrap v5.1.1 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\n(function (global, factory) {\n true ? module.exports = factory() :\n undefined;\n}(this, (function () { 'use strict';\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const MAX_UID = 1000000;\n const MILLISECONDS_MULTIPLIER = 1000;\n const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n const toType = obj => {\n if (obj === null || obj === undefined) {\n return `${obj}`;\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n };\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n const getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID);\n } while (document.getElementById(prefix));\n\n return prefix;\n };\n\n const getSelector = element => {\n let selector = element.getAttribute('data-bs-target');\n\n if (!selector || selector === '#') {\n let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n\n if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {\n return null;\n } // Just in case some CMS puts out a full URL with the anchor appended\n\n\n if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {\n hrefAttr = `#${hrefAttr.split('#')[1]}`;\n }\n\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;\n }\n\n return selector;\n };\n\n const getSelectorFromElement = element => {\n const selector = getSelector(element);\n\n if (selector) {\n return document.querySelector(selector) ? selector : null;\n }\n\n return null;\n };\n\n const getElementFromSelector = element => {\n const selector = getSelector(element);\n return selector ? document.querySelector(selector) : null;\n };\n\n const getTransitionDurationFromElement = element => {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n let {\n transitionDuration,\n transitionDelay\n } = window.getComputedStyle(element);\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n };\n\n const triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END));\n };\n\n const isElement$1 = obj => {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n if (typeof obj.jquery !== 'undefined') {\n obj = obj[0];\n }\n\n return typeof obj.nodeType !== 'undefined';\n };\n\n const getElement = obj => {\n if (isElement$1(obj)) {\n // it's a jQuery object or a node element\n return obj.jquery ? obj[0] : obj;\n }\n\n if (typeof obj === 'string' && obj.length > 0) {\n return document.querySelector(obj);\n }\n\n return null;\n };\n\n const typeCheckConfig = (componentName, config, configTypes) => {\n Object.keys(configTypes).forEach(property => {\n const expectedTypes = configTypes[property];\n const value = config[property];\n const valueType = value && isElement$1(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(`${componentName.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`);\n }\n });\n };\n\n const isVisible = element => {\n if (!isElement$1(element) || element.getClientRects().length === 0) {\n return false;\n }\n\n return getComputedStyle(element).getPropertyValue('visibility') === 'visible';\n };\n\n const isDisabled = element => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n\n if (element.classList.contains('disabled')) {\n return true;\n }\n\n if (typeof element.disabled !== 'undefined') {\n return element.disabled;\n }\n\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';\n };\n\n const findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null;\n } // Can find the shadow root otherwise it'll return the document\n\n\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n\n if (element instanceof ShadowRoot) {\n return element;\n } // when we don't find a shadow root\n\n\n if (!element.parentNode) {\n return null;\n }\n\n return findShadowRoot(element.parentNode);\n };\n\n const noop = () => {};\n /**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\n\n\n const reflow = element => {\n // eslint-disable-next-line no-unused-expressions\n element.offsetHeight;\n };\n\n const getjQuery = () => {\n const {\n jQuery\n } = window;\n\n if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return jQuery;\n }\n\n return null;\n };\n\n const DOMContentLoadedCallbacks = [];\n\n const onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n DOMContentLoadedCallbacks.forEach(callback => callback());\n });\n }\n\n DOMContentLoadedCallbacks.push(callback);\n } else {\n callback();\n }\n };\n\n const isRTL = () => document.documentElement.dir === 'rtl';\n\n const defineJQueryPlugin = plugin => {\n onDOMContentLoaded(() => {\n const $ = getjQuery();\n /* istanbul ignore if */\n\n if ($) {\n const name = plugin.NAME;\n const JQUERY_NO_CONFLICT = $.fn[name];\n $.fn[name] = plugin.jQueryInterface;\n $.fn[name].Constructor = plugin;\n\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT;\n return plugin.jQueryInterface;\n };\n }\n });\n };\n\n const execute = callback => {\n if (typeof callback === 'function') {\n callback();\n }\n };\n\n const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback);\n return;\n }\n\n const durationPadding = 5;\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;\n let called = false;\n\n const handler = ({\n target\n }) => {\n if (target !== transitionElement) {\n return;\n }\n\n called = true;\n transitionElement.removeEventListener(TRANSITION_END, handler);\n execute(callback);\n };\n\n transitionElement.addEventListener(TRANSITION_END, handler);\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement);\n }\n }, emulatedDuration);\n };\n /**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\n\n\n const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n let index = list.indexOf(activeElement); // if the element does not exist in the list return an element depending on the direction and if cycle is allowed\n\n if (index === -1) {\n return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0];\n }\n\n const listLength = list.length;\n index += shouldGetNext ? 1 : -1;\n\n if (isCycleAllowed) {\n index = (index + listLength) % listLength;\n }\n\n return list[Math.max(0, Math.min(index, listLength - 1))];\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const namespaceRegex = /[^.]*(?=\\..*)\\.|.*/;\n const stripNameRegex = /\\..*/;\n const stripUidRegex = /::\\d+$/;\n const eventRegistry = {}; // Events storage\n\n let uidEvent = 1;\n const customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n };\n const customEventsRegex = /^(mouseenter|mouseleave)/i;\n const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);\n /**\n * ------------------------------------------------------------------------\n * Private methods\n * ------------------------------------------------------------------------\n */\n\n function getUidEvent(element, uid) {\n return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;\n }\n\n function getEvent(element) {\n const uid = getUidEvent(element);\n element.uidEvent = uid;\n eventRegistry[uid] = eventRegistry[uid] || {};\n return eventRegistry[uid];\n }\n\n function bootstrapHandler(element, fn) {\n return function handler(event) {\n event.delegateTarget = element;\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn);\n }\n\n return fn.apply(element, [event]);\n };\n }\n\n function bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector);\n\n for (let {\n target\n } = event; target && target !== this; target = target.parentNode) {\n for (let i = domElements.length; i--;) {\n if (domElements[i] === target) {\n event.delegateTarget = target;\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, selector, fn);\n }\n\n return fn.apply(target, [event]);\n }\n }\n } // To please ESLint\n\n\n return null;\n };\n }\n\n function findHandler(events, handler, delegationSelector = null) {\n const uidEventList = Object.keys(events);\n\n for (let i = 0, len = uidEventList.length; i < len; i++) {\n const event = events[uidEventList[i]];\n\n if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {\n return event;\n }\n }\n\n return null;\n }\n\n function normalizeParams(originalTypeEvent, handler, delegationFn) {\n const delegation = typeof handler === 'string';\n const originalHandler = delegation ? delegationFn : handler;\n let typeEvent = getTypeEvent(originalTypeEvent);\n const isNative = nativeEvents.has(typeEvent);\n\n if (!isNative) {\n typeEvent = originalTypeEvent;\n }\n\n return [delegation, originalHandler, typeEvent];\n }\n\n function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n\n if (!handler) {\n handler = delegationFn;\n delegationFn = null;\n } // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n\n\n if (customEventsRegex.test(originalTypeEvent)) {\n const wrapFn = fn => {\n return function (event) {\n if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {\n return fn.call(this, event);\n }\n };\n };\n\n if (delegationFn) {\n delegationFn = wrapFn(delegationFn);\n } else {\n handler = wrapFn(handler);\n }\n }\n\n const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);\n const events = getEvent(element);\n const handlers = events[typeEvent] || (events[typeEvent] = {});\n const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);\n\n if (previousFn) {\n previousFn.oneOff = previousFn.oneOff && oneOff;\n return;\n }\n\n const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));\n const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);\n fn.delegationSelector = delegation ? handler : null;\n fn.originalHandler = originalHandler;\n fn.oneOff = oneOff;\n fn.uidEvent = uid;\n handlers[uid] = fn;\n element.addEventListener(typeEvent, fn, delegation);\n }\n\n function removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector);\n\n if (!fn) {\n return;\n }\n\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));\n delete events[typeEvent][fn.uidEvent];\n }\n\n function removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {};\n Object.keys(storeElementEvent).forEach(handlerKey => {\n if (handlerKey.includes(namespace)) {\n const event = storeElementEvent[handlerKey];\n removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);\n }\n });\n }\n\n function getTypeEvent(event) {\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n event = event.replace(stripNameRegex, '');\n return customEvents[event] || event;\n }\n\n const EventHandler = {\n on(element, event, handler, delegationFn) {\n addHandler(element, event, handler, delegationFn, false);\n },\n\n one(element, event, handler, delegationFn) {\n addHandler(element, event, handler, delegationFn, true);\n },\n\n off(element, originalTypeEvent, handler, delegationFn) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n\n const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);\n const inNamespace = typeEvent !== originalTypeEvent;\n const events = getEvent(element);\n const isNamespace = originalTypeEvent.startsWith('.');\n\n if (typeof originalHandler !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!events || !events[typeEvent]) {\n return;\n }\n\n removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);\n return;\n }\n\n if (isNamespace) {\n Object.keys(events).forEach(elementEvent => {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));\n });\n }\n\n const storeElementEvent = events[typeEvent] || {};\n Object.keys(storeElementEvent).forEach(keyHandlers => {\n const handlerKey = keyHandlers.replace(stripUidRegex, '');\n\n if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n const event = storeElementEvent[keyHandlers];\n removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);\n }\n });\n },\n\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null;\n }\n\n const $ = getjQuery();\n const typeEvent = getTypeEvent(event);\n const inNamespace = event !== typeEvent;\n const isNative = nativeEvents.has(typeEvent);\n let jQueryEvent;\n let bubbles = true;\n let nativeDispatch = true;\n let defaultPrevented = false;\n let evt = null;\n\n if (inNamespace && $) {\n jQueryEvent = $.Event(event, args);\n $(element).trigger(jQueryEvent);\n bubbles = !jQueryEvent.isPropagationStopped();\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();\n defaultPrevented = jQueryEvent.isDefaultPrevented();\n }\n\n if (isNative) {\n evt = document.createEvent('HTMLEvents');\n evt.initEvent(typeEvent, bubbles, true);\n } else {\n evt = new CustomEvent(event, {\n bubbles,\n cancelable: true\n });\n } // merge custom information in our event\n\n\n if (typeof args !== 'undefined') {\n Object.keys(args).forEach(key => {\n Object.defineProperty(evt, key, {\n get() {\n return args[key];\n }\n\n });\n });\n }\n\n if (defaultPrevented) {\n evt.preventDefault();\n }\n\n if (nativeDispatch) {\n element.dispatchEvent(evt);\n }\n\n if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {\n jQueryEvent.preventDefault();\n }\n\n return evt;\n }\n\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const elementMap = new Map();\n var Data = {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map());\n }\n\n const instanceMap = elementMap.get(element); // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);\n return;\n }\n\n instanceMap.set(key, instance);\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null;\n }\n\n return null;\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return;\n }\n\n const instanceMap = elementMap.get(element);\n instanceMap.delete(key); // free up element references if there are no instances left for an element\n\n if (instanceMap.size === 0) {\n elementMap.delete(element);\n }\n }\n\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const VERSION = '5.1.1';\n\n class BaseComponent {\n constructor(element) {\n element = getElement(element);\n\n if (!element) {\n return;\n }\n\n this._element = element;\n Data.set(this._element, this.constructor.DATA_KEY, this);\n }\n\n dispose() {\n Data.remove(this._element, this.constructor.DATA_KEY);\n EventHandler.off(this._element, this.constructor.EVENT_KEY);\n Object.getOwnPropertyNames(this).forEach(propertyName => {\n this[propertyName] = null;\n });\n }\n\n _queueCallback(callback, element, isAnimated = true) {\n executeAfterTransition(callback, element, isAnimated);\n }\n /** Static */\n\n\n static getInstance(element) {\n return Data.get(getElement(element), this.DATA_KEY);\n }\n\n static getOrCreateInstance(element, config = {}) {\n return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);\n }\n\n static get VERSION() {\n return VERSION;\n }\n\n static get NAME() {\n throw new Error('You have to implement the static method \"NAME\", for each component!');\n }\n\n static get DATA_KEY() {\n return `bs.${this.NAME}`;\n }\n\n static get EVENT_KEY() {\n return `.${this.DATA_KEY}`;\n }\n\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n const enableDismissTrigger = (component, method = 'hide') => {\n const clickEvent = `click.dismiss${component.EVENT_KEY}`;\n const name = component.NAME;\n EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n\n if (isDisabled(this)) {\n return;\n }\n\n const target = getElementFromSelector(this) || this.closest(`.${name}`);\n const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n\n instance[method]();\n });\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$d = 'alert';\n const DATA_KEY$c = 'bs.alert';\n const EVENT_KEY$c = `.${DATA_KEY$c}`;\n const EVENT_CLOSE = `close${EVENT_KEY$c}`;\n const EVENT_CLOSED = `closed${EVENT_KEY$c}`;\n const CLASS_NAME_FADE$5 = 'fade';\n const CLASS_NAME_SHOW$8 = 'show';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Alert extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$d;\n } // Public\n\n\n close() {\n const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);\n\n if (closeEvent.defaultPrevented) {\n return;\n }\n\n this._element.classList.remove(CLASS_NAME_SHOW$8);\n\n const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);\n\n this._queueCallback(() => this._destroyElement(), this._element, isAnimated);\n } // Private\n\n\n _destroyElement() {\n this._element.remove();\n\n EventHandler.trigger(this._element, EVENT_CLOSED);\n this.dispose();\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Alert.getOrCreateInstance(this);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config](this);\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n enableDismissTrigger(Alert, 'close');\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Alert to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Alert);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$c = 'button';\n const DATA_KEY$b = 'bs.button';\n const EVENT_KEY$b = `.${DATA_KEY$b}`;\n const DATA_API_KEY$7 = '.data-api';\n const CLASS_NAME_ACTIVE$3 = 'active';\n const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle=\"button\"]';\n const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Button extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$c;\n } // Public\n\n\n toggle() {\n // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Button.getOrCreateInstance(this);\n\n if (config === 'toggle') {\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {\n event.preventDefault();\n const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);\n const data = Button.getOrCreateInstance(button);\n data.toggle();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Button to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Button);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n }\n\n function normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);\n }\n\n const Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {};\n }\n\n const attributes = {};\n Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {\n let pureKey = key.replace(/^bs/, '');\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);\n attributes[pureKey] = normalizeData(element.dataset[key]);\n });\n return attributes;\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect();\n return {\n top: rect.top + window.pageYOffset,\n left: rect.left + window.pageXOffset\n };\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n };\n }\n\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const NODE_TEXT = 3;\n const SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector));\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector);\n },\n\n children(element, selector) {\n return [].concat(...element.children).filter(child => child.matches(selector));\n },\n\n parents(element, selector) {\n const parents = [];\n let ancestor = element.parentNode;\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (ancestor.matches(selector)) {\n parents.push(ancestor);\n }\n\n ancestor = ancestor.parentNode;\n }\n\n return parents;\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling;\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous];\n }\n\n previous = previous.previousElementSibling;\n }\n\n return [];\n },\n\n next(element, selector) {\n let next = element.nextElementSibling;\n\n while (next) {\n if (next.matches(selector)) {\n return [next];\n }\n\n next = next.nextElementSibling;\n }\n\n return [];\n },\n\n focusableChildren(element) {\n const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable=\"true\"]'].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(', ');\n return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));\n }\n\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$b = 'carousel';\n const DATA_KEY$a = 'bs.carousel';\n const EVENT_KEY$a = `.${DATA_KEY$a}`;\n const DATA_API_KEY$6 = '.data-api';\n const ARROW_LEFT_KEY = 'ArrowLeft';\n const ARROW_RIGHT_KEY = 'ArrowRight';\n const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n const SWIPE_THRESHOLD = 40;\n const Default$a = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true,\n touch: true\n };\n const DefaultType$a = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean',\n touch: 'boolean'\n };\n const ORDER_NEXT = 'next';\n const ORDER_PREV = 'prev';\n const DIRECTION_LEFT = 'left';\n const DIRECTION_RIGHT = 'right';\n const KEY_TO_DIRECTION = {\n [ARROW_LEFT_KEY]: DIRECTION_RIGHT,\n [ARROW_RIGHT_KEY]: DIRECTION_LEFT\n };\n const EVENT_SLIDE = `slide${EVENT_KEY$a}`;\n const EVENT_SLID = `slid${EVENT_KEY$a}`;\n const EVENT_KEYDOWN = `keydown${EVENT_KEY$a}`;\n const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$a}`;\n const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$a}`;\n const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$a}`;\n const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$a}`;\n const EVENT_TOUCHEND = `touchend${EVENT_KEY$a}`;\n const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$a}`;\n const EVENT_POINTERUP = `pointerup${EVENT_KEY$a}`;\n const EVENT_DRAG_START = `dragstart${EVENT_KEY$a}`;\n const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$a}${DATA_API_KEY$6}`;\n const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;\n const CLASS_NAME_CAROUSEL = 'carousel';\n const CLASS_NAME_ACTIVE$2 = 'active';\n const CLASS_NAME_SLIDE = 'slide';\n const CLASS_NAME_END = 'carousel-item-end';\n const CLASS_NAME_START = 'carousel-item-start';\n const CLASS_NAME_NEXT = 'carousel-item-next';\n const CLASS_NAME_PREV = 'carousel-item-prev';\n const CLASS_NAME_POINTER_EVENT = 'pointer-event';\n const SELECTOR_ACTIVE$1 = '.active';\n const SELECTOR_ACTIVE_ITEM = '.active.carousel-item';\n const SELECTOR_ITEM = '.carousel-item';\n const SELECTOR_ITEM_IMG = '.carousel-item img';\n const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';\n const SELECTOR_INDICATORS = '.carousel-indicators';\n const SELECTOR_INDICATOR = '[data-bs-target]';\n const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';\n const SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]';\n const POINTER_TYPE_TOUCH = 'touch';\n const POINTER_TYPE_PEN = 'pen';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Carousel extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this.touchStartX = 0;\n this.touchDeltaX = 0;\n this._config = this._getConfig(config);\n this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n this._pointerEvent = Boolean(window.PointerEvent);\n\n this._addEventListeners();\n } // Getters\n\n\n static get Default() {\n return Default$a;\n }\n\n static get NAME() {\n return NAME$b;\n } // Public\n\n\n next() {\n this._slide(ORDER_NEXT);\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && isVisible(this._element)) {\n this.next();\n }\n }\n\n prev() {\n this._slide(ORDER_PREV);\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {\n triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config && this._config.interval && !this._isPaused) {\n this._updateInterval();\n\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n }\n\n to(index) {\n this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n\n const activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.to(index));\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;\n\n this._slide(order, this._items[index]);\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default$a,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n };\n typeCheckConfig(NAME$b, config, DefaultType$a);\n return config;\n }\n\n _handleSwipe() {\n const absDeltax = Math.abs(this.touchDeltaX);\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return;\n }\n\n const direction = absDeltax / this.touchDeltaX;\n this.touchDeltaX = 0;\n\n if (!direction) {\n return;\n }\n\n this._slide(direction > 0 ? DIRECTION_RIGHT : DIRECTION_LEFT);\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));\n }\n\n if (this._config.pause === 'hover') {\n EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event));\n EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event));\n }\n\n if (this._config.touch && this._touchSupported) {\n this._addTouchEventListeners();\n }\n }\n\n _addTouchEventListeners() {\n const hasPointerPenTouch = event => {\n return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);\n };\n\n const start = event => {\n if (hasPointerPenTouch(event)) {\n this.touchStartX = event.clientX;\n } else if (!this._pointerEvent) {\n this.touchStartX = event.touches[0].clientX;\n }\n };\n\n const move = event => {\n // ensure swiping with one touch and not pinching\n this.touchDeltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this.touchStartX;\n };\n\n const end = event => {\n if (hasPointerPenTouch(event)) {\n this.touchDeltaX = event.clientX - this.touchStartX;\n }\n\n this._handleSwipe();\n\n if (this._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n this.pause();\n\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout);\n }\n\n this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval);\n }\n };\n\n SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {\n EventHandler.on(itemImg, EVENT_DRAG_START, e => e.preventDefault());\n });\n\n if (this._pointerEvent) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event));\n EventHandler.on(this._element, EVENT_POINTERUP, event => end(event));\n\n this._element.classList.add(CLASS_NAME_POINTER_EVENT);\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, event => start(event));\n EventHandler.on(this._element, EVENT_TOUCHMOVE, event => move(event));\n EventHandler.on(this._element, EVENT_TOUCHEND, event => end(event));\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n const direction = KEY_TO_DIRECTION[event.key];\n\n if (direction) {\n event.preventDefault();\n\n this._slide(direction);\n }\n }\n\n _getItemIndex(element) {\n this._items = element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : [];\n return this._items.indexOf(element);\n }\n\n _getItemByOrder(order, activeElement) {\n const isNext = order === ORDER_NEXT;\n return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap);\n }\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget);\n\n const fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element));\n\n return EventHandler.trigger(this._element, EVENT_SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement);\n activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);\n activeIndicator.removeAttribute('aria-current');\n const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement);\n\n for (let i = 0; i < indicators.length; i++) {\n if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {\n indicators[i].classList.add(CLASS_NAME_ACTIVE$2);\n indicators[i].setAttribute('aria-current', 'true');\n break;\n }\n }\n }\n }\n\n _updateInterval() {\n const element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n\n if (!element) {\n return;\n }\n\n const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);\n\n if (elementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval;\n this._config.interval = elementInterval;\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval;\n }\n }\n\n _slide(directionOrOrder, element) {\n const order = this._directionToOrder(directionOrOrder);\n\n const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n\n const activeElementIndex = this._getItemIndex(activeElement);\n\n const nextElement = element || this._getItemByOrder(order, activeElement);\n\n const nextElementIndex = this._getItemIndex(nextElement);\n\n const isCycling = Boolean(this._interval);\n const isNext = order === ORDER_NEXT;\n const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;\n const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;\n\n const eventDirectionName = this._orderToDirection(order);\n\n if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE$2)) {\n this._isSliding = false;\n return;\n }\n\n if (this._isSliding) {\n return;\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.defaultPrevented) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n this._activeElement = nextElement;\n\n const triggerSlidEvent = () => {\n EventHandler.trigger(this._element, EVENT_SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n };\n\n if (this._element.classList.contains(CLASS_NAME_SLIDE)) {\n nextElement.classList.add(orderClassName);\n reflow(nextElement);\n activeElement.classList.add(directionalClassName);\n nextElement.classList.add(directionalClassName);\n\n const completeCallBack = () => {\n nextElement.classList.remove(directionalClassName, orderClassName);\n nextElement.classList.add(CLASS_NAME_ACTIVE$2);\n activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);\n this._isSliding = false;\n setTimeout(triggerSlidEvent, 0);\n };\n\n this._queueCallback(completeCallBack, activeElement, true);\n } else {\n activeElement.classList.remove(CLASS_NAME_ACTIVE$2);\n nextElement.classList.add(CLASS_NAME_ACTIVE$2);\n this._isSliding = false;\n triggerSlidEvent();\n }\n\n if (isCycling) {\n this.cycle();\n }\n }\n\n _directionToOrder(direction) {\n if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) {\n return direction;\n }\n\n if (isRTL()) {\n return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;\n }\n\n return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;\n }\n\n _orderToDirection(order) {\n if (![ORDER_NEXT, ORDER_PREV].includes(order)) {\n return order;\n }\n\n if (isRTL()) {\n return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n\n return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;\n } // Static\n\n\n static carouselInterface(element, config) {\n const data = Carousel.getOrCreateInstance(element, config);\n let {\n _config\n } = data;\n\n if (typeof config === 'object') {\n _config = { ..._config,\n ...config\n };\n }\n\n const action = typeof config === 'string' ? config : _config.slide;\n\n if (typeof config === 'number') {\n data.to(config);\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(`No method named \"${action}\"`);\n }\n\n data[action]();\n } else if (_config.interval && _config.ride) {\n data.pause();\n data.cycle();\n }\n }\n\n static jQueryInterface(config) {\n return this.each(function () {\n Carousel.carouselInterface(this, config);\n });\n }\n\n static dataApiClickHandler(event) {\n const target = getElementFromSelector(this);\n\n if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n return;\n }\n\n const config = { ...Manipulator.getDataAttributes(target),\n ...Manipulator.getDataAttributes(this)\n };\n const slideIndex = this.getAttribute('data-bs-slide-to');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel.carouselInterface(target, config);\n\n if (slideIndex) {\n Carousel.getInstance(target).to(slideIndex);\n }\n\n event.preventDefault();\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler);\n EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {\n const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);\n\n for (let i = 0, len = carousels.length; i < len; i++) {\n Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]));\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Carousel to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Carousel);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$a = 'collapse';\n const DATA_KEY$9 = 'bs.collapse';\n const EVENT_KEY$9 = `.${DATA_KEY$9}`;\n const DATA_API_KEY$5 = '.data-api';\n const Default$9 = {\n toggle: true,\n parent: null\n };\n const DefaultType$9 = {\n toggle: 'boolean',\n parent: '(null|element)'\n };\n const EVENT_SHOW$5 = `show${EVENT_KEY$9}`;\n const EVENT_SHOWN$5 = `shown${EVENT_KEY$9}`;\n const EVENT_HIDE$5 = `hide${EVENT_KEY$9}`;\n const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$9}`;\n const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`;\n const CLASS_NAME_SHOW$7 = 'show';\n const CLASS_NAME_COLLAPSE = 'collapse';\n const CLASS_NAME_COLLAPSING = 'collapsing';\n const CLASS_NAME_COLLAPSED = 'collapsed';\n const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';\n const WIDTH = 'width';\n const HEIGHT = 'height';\n const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';\n const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle=\"collapse\"]';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._isTransitioning = false;\n this._config = this._getConfig(config);\n this._triggerArray = [];\n const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);\n\n for (let i = 0, len = toggleList.length; i < len; i++) {\n const elem = toggleList[i];\n const selector = getSelectorFromElement(elem);\n const filterElement = SelectorEngine.find(selector).filter(foundElem => foundElem === this._element);\n\n if (selector !== null && filterElement.length) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._initializeChildren();\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n static get Default() {\n return Default$9;\n }\n\n static get NAME() {\n return NAME$a;\n } // Public\n\n\n toggle() {\n if (this._isShown()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n show() {\n if (this._isTransitioning || this._isShown()) {\n return;\n }\n\n let actives = [];\n let activesData;\n\n if (this._config.parent) {\n const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent);\n actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth\n }\n\n const container = SelectorEngine.findOne(this._selector);\n\n if (actives.length) {\n const tempActiveData = actives.find(elem => container !== elem);\n activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$5);\n\n if (startEvent.defaultPrevented) {\n return;\n }\n\n actives.forEach(elemActive => {\n if (container !== elemActive) {\n Collapse.getOrCreateInstance(elemActive, {\n toggle: false\n }).hide();\n }\n\n if (!activesData) {\n Data.set(elemActive, DATA_KEY$9, null);\n }\n });\n\n const dimension = this._getDimension();\n\n this._element.classList.remove(CLASS_NAME_COLLAPSE);\n\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n\n this._element.style[dimension] = 0;\n\n this._addAriaAndCollapsedClass(this._triggerArray, true);\n\n this._isTransitioning = true;\n\n const complete = () => {\n this._isTransitioning = false;\n\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n\n this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n\n this._element.style[dimension] = '';\n EventHandler.trigger(this._element, EVENT_SHOWN$5);\n };\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n const scrollSize = `scroll${capitalizedDimension}`;\n\n this._queueCallback(complete, this._element, true);\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`;\n }\n\n hide() {\n if (this._isTransitioning || !this._isShown()) {\n return;\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$5);\n\n if (startEvent.defaultPrevented) {\n return;\n }\n\n const dimension = this._getDimension();\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;\n reflow(this._element);\n\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n\n this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n\n const triggerArrayLength = this._triggerArray.length;\n\n for (let i = 0; i < triggerArrayLength; i++) {\n const trigger = this._triggerArray[i];\n const elem = getElementFromSelector(trigger);\n\n if (elem && !this._isShown(elem)) {\n this._addAriaAndCollapsedClass([trigger], false);\n }\n }\n\n this._isTransitioning = true;\n\n const complete = () => {\n this._isTransitioning = false;\n\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n\n this._element.classList.add(CLASS_NAME_COLLAPSE);\n\n EventHandler.trigger(this._element, EVENT_HIDDEN$5);\n };\n\n this._element.style[dimension] = '';\n\n this._queueCallback(complete, this._element, true);\n }\n\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW$7);\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default$9,\n ...Manipulator.getDataAttributes(this._element),\n ...config\n };\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n config.parent = getElement(config.parent);\n typeCheckConfig(NAME$a, config, DefaultType$9);\n return config;\n }\n\n _getDimension() {\n return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;\n }\n\n _initializeChildren() {\n if (!this._config.parent) {\n return;\n }\n\n const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent);\n SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {\n const selected = getElementFromSelector(element);\n\n if (selected) {\n this._addAriaAndCollapsedClass([element], this._isShown(selected));\n }\n });\n }\n\n _addAriaAndCollapsedClass(triggerArray, isOpen) {\n if (!triggerArray.length) {\n return;\n }\n\n triggerArray.forEach(elem => {\n if (isOpen) {\n elem.classList.remove(CLASS_NAME_COLLAPSED);\n } else {\n elem.classList.add(CLASS_NAME_COLLAPSED);\n }\n\n elem.setAttribute('aria-expanded', isOpen);\n });\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const _config = {};\n\n if (typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n const data = Collapse.getOrCreateInstance(this, _config);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {\n event.preventDefault();\n }\n\n const selector = getSelectorFromElement(this);\n const selectorElements = SelectorEngine.find(selector);\n selectorElements.forEach(element => {\n Collapse.getOrCreateInstance(element, {\n toggle: false\n }).toggle();\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Collapse to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Collapse);\n\n var top = 'top';\n var bottom = 'bottom';\n var right = 'right';\n var left = 'left';\n var auto = 'auto';\n var basePlacements = [top, bottom, right, left];\n var start = 'start';\n var end = 'end';\n var clippingParents = 'clippingParents';\n var viewport = 'viewport';\n var popper = 'popper';\n var reference = 'reference';\n var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n }, []);\n 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\n var beforeRead = 'beforeRead';\n var read = 'read';\n var afterRead = 'afterRead'; // pure-logic modifiers\n\n var beforeMain = 'beforeMain';\n var main = 'main';\n var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\n var beforeWrite = 'beforeWrite';\n var write = 'write';\n var afterWrite = 'afterWrite';\n var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];\n\n function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n }\n\n function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n }\n\n function isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n }\n\n function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n }\n\n function isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n }\n\n // and applies them to the HTMLElements such as popper and arrow\n\n function 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\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }\n\n function effect$2(_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\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\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\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\n\n var applyStyles$1 = {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect$2,\n requires: ['computeStyles']\n };\n\n function getBasePlacement(placement) {\n return placement.split('-')[0];\n }\n\n var round$1 = Math.round;\n function getBoundingClientRect(element, includeScale) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n var rect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (isHTMLElement(element) && includeScale) {\n var offsetHeight = element.offsetHeight;\n var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // Fallback to 1 in case both values are `0`\n\n if (offsetWidth > 0) {\n scaleX = rect.width / offsetWidth || 1;\n }\n\n if (offsetHeight > 0) {\n scaleY = rect.height / offsetHeight || 1;\n }\n }\n\n return {\n width: round$1(rect.width / scaleX),\n height: round$1(rect.height / scaleY),\n top: round$1(rect.top / scaleY),\n right: round$1(rect.right / scaleX),\n bottom: round$1(rect.bottom / scaleY),\n left: round$1(rect.left / scaleX),\n x: round$1(rect.left / scaleX),\n y: round$1(rect.top / scaleY)\n };\n }\n\n // means it doesn't take into account transforms.\n\n 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\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n }\n\n 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\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n }\n\n function getComputedStyle$1(element) {\n return getWindow(element).getComputedStyle(element);\n }\n\n function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n }\n\n function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n }\n\n function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// 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 || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n }\n\n function getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n } // `.offsetParent` reports `null` for fixed elements, while absolute elements\n // return the containing block\n\n\n function getContainingBlock(element) {\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n var isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\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$1(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle$1(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\n return null;\n } // Gets the closest ancestor positioned element. Handles some edge cases,\n // such as table ancestors and cross browser bugs.\n\n\n function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n }\n\n function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n }\n\n var max = Math.max;\n var min = Math.min;\n var round = Math.round;\n\n function within(min$1, value, max$1) {\n return max(min$1, min(value, max$1));\n }\n\n function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n }\n\n function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n }\n\n function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n }\n\n var 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 };\n\n function arrow(_ref) {\n var _state$modifiersData$;\n\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\n if (!arrowElement || !popperOffsets) {\n return;\n }\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 }\n\n function effect$1(_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\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n } // eslint-disable-next-line import/no-unused-modules\n\n\n var arrow$1 = {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect$1,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n };\n\n function getVariation(placement) {\n return placement.split('-')[1];\n }\n\n var 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\n function 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 }\n\n function mapToStyles(_ref2) {\n var _Object$assign2;\n\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\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\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\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle$1(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\n offsetParent = offsetParent;\n\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\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\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n if (gpuAcceleration) {\n var _Object$assign;\n\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\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 }\n\n function 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\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\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\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\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\n\n var computeStyles$1 = {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n };\n\n var passive = {\n passive: true\n };\n\n function 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\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n } // eslint-disable-next-line import/no-unused-modules\n\n\n var eventListeners = {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n };\n\n var hash$1 = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n };\n function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash$1[matched];\n });\n }\n\n var hash = {\n start: 'end',\n end: 'start'\n };\n function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n }\n\n 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 }\n\n function getWindowScrollBarX(element) {\n // If <html> 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 <html>\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 }\n\n 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\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n }\n\n // of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\n function getDocumentRect(element) {\n var _element$ownerDocumen;\n\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\n if (getComputedStyle$1(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n }\n\n function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle$1(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n }\n\n 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\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n }\n\n /*\n given a DOM element, return the list of all scroll parents, up the list of ancesors\n until we get to the top window object. This list is what we attach scroll listeners\n to, because if any of these parent elements scroll, we'll need to re-calculate the\n reference element's position.\n */\n\n function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\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 : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n }\n\n 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 }\n\n function 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 }\n\n function 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\n\n function getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\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\n\n 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 }\n\n 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\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n }\n }\n\n return offsets;\n }\n\n function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\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\n return overflowOffsets;\n }\n\n function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\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 ? placements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements$1.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements$1;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\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 }\n\n function getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n }\n\n function flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\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\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\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\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\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\n\n var flip$1 = {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n };\n\n function getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\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 }\n\n function isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n }\n\n function 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\n\n var hide$1 = {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n };\n\n function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\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 }\n\n function 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\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n } // eslint-disable-next-line import/no-unused-modules\n\n\n var offset$1 = {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n };\n\n function 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\n\n var popperOffsets$1 = {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n };\n\n function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n }\n\n function 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\n if (!popperOffsets) {\n return;\n }\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$1 = popperOffsets[mainAxis] + overflow[mainSide];\n var max$1 = 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\n if (checkMainAxis) {\n var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n }\n\n state.modifiersData[name] = data;\n } // eslint-disable-next-line import/no-unused-modules\n\n\n var preventOverflow$1 = {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n };\n\n function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n\n function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n }\n\n function 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\n\n function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\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\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\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\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 }\n\n function 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\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\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 }\n\n 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 }\n\n 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\n return pending;\n };\n }\n\n 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 }\n\n var DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n };\n\n function areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n }\n\n function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\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\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\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\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\n return;\n } // Store the reference and popper rects to be read by modifiers\n\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\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\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\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\n if (!areValidElements(reference, popper)) {\n\n return instance;\n }\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\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n }\n var createPopper$2 = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\n var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];\n var createPopper$1 = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers$1\n }); // eslint-disable-next-line import/no-unused-modules\n\n var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];\n var createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n }); // eslint-disable-next-line import/no-unused-modules\n\n var Popper = /*#__PURE__*/Object.freeze({\n __proto__: null,\n popperGenerator: popperGenerator,\n detectOverflow: detectOverflow,\n createPopperBase: createPopper$2,\n createPopper: createPopper,\n createPopperLite: createPopper$1,\n top: top,\n bottom: bottom,\n right: right,\n left: left,\n auto: auto,\n basePlacements: basePlacements,\n start: start,\n end: end,\n clippingParents: clippingParents,\n viewport: viewport,\n popper: popper,\n reference: reference,\n variationPlacements: variationPlacements,\n placements: placements,\n beforeRead: beforeRead,\n read: read,\n afterRead: afterRead,\n beforeMain: beforeMain,\n main: main,\n afterMain: afterMain,\n beforeWrite: beforeWrite,\n write: write,\n afterWrite: afterWrite,\n modifierPhases: modifierPhases,\n applyStyles: applyStyles$1,\n arrow: arrow$1,\n computeStyles: computeStyles$1,\n eventListeners: eventListeners,\n flip: flip$1,\n hide: hide$1,\n offset: offset$1,\n popperOffsets: popperOffsets$1,\n preventOverflow: preventOverflow$1\n });\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$9 = 'dropdown';\n const DATA_KEY$8 = 'bs.dropdown';\n const EVENT_KEY$8 = `.${DATA_KEY$8}`;\n const DATA_API_KEY$4 = '.data-api';\n const ESCAPE_KEY$2 = 'Escape';\n const SPACE_KEY = 'Space';\n const TAB_KEY$1 = 'Tab';\n const ARROW_UP_KEY = 'ArrowUp';\n const ARROW_DOWN_KEY = 'ArrowDown';\n const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button\n\n const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);\n const EVENT_HIDE$4 = `hide${EVENT_KEY$8}`;\n const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;\n const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;\n const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;\n const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$8}${DATA_API_KEY$4}`;\n const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$8}${DATA_API_KEY$4}`;\n const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$8}${DATA_API_KEY$4}`;\n const CLASS_NAME_SHOW$6 = 'show';\n const CLASS_NAME_DROPUP = 'dropup';\n const CLASS_NAME_DROPEND = 'dropend';\n const CLASS_NAME_DROPSTART = 'dropstart';\n const CLASS_NAME_NAVBAR = 'navbar';\n const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle=\"dropdown\"]';\n const SELECTOR_MENU = '.dropdown-menu';\n const SELECTOR_NAVBAR_NAV = '.navbar-nav';\n const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';\n const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';\n const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';\n const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';\n const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';\n const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';\n const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';\n const Default$8 = {\n offset: [0, 2],\n boundary: 'clippingParents',\n reference: 'toggle',\n display: 'dynamic',\n popperConfig: null,\n autoClose: true\n };\n const DefaultType$8 = {\n offset: '(array|string|function)',\n boundary: '(string|element)',\n reference: '(string|element|object)',\n display: 'string',\n popperConfig: '(null|object|function)',\n autoClose: '(boolean|string)'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Dropdown extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n } // Getters\n\n\n static get Default() {\n return Default$8;\n }\n\n static get DefaultType() {\n return DefaultType$8;\n }\n\n static get NAME() {\n return NAME$9;\n } // Public\n\n\n toggle() {\n return this._isShown() ? this.hide() : this.show();\n }\n\n show() {\n if (isDisabled(this._element) || this._isShown(this._menu)) {\n return;\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n };\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, relatedTarget);\n\n if (showEvent.defaultPrevented) {\n return;\n }\n\n const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar\n\n if (this._inNavbar) {\n Manipulator.setDataAttribute(this._menu, 'popper', 'none');\n } else {\n this._createPopper(parent);\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) {\n [].concat(...document.body.children).forEach(elem => EventHandler.on(elem, 'mouseover', noop));\n }\n\n this._element.focus();\n\n this._element.setAttribute('aria-expanded', true);\n\n this._menu.classList.add(CLASS_NAME_SHOW$6);\n\n this._element.classList.add(CLASS_NAME_SHOW$6);\n\n EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget);\n }\n\n hide() {\n if (isDisabled(this._element) || !this._isShown(this._menu)) {\n return;\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n };\n\n this._completeHide(relatedTarget);\n }\n\n dispose() {\n if (this._popper) {\n this._popper.destroy();\n }\n\n super.dispose();\n }\n\n update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper) {\n this._popper.update();\n }\n } // Private\n\n\n _completeHide(relatedTarget) {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);\n\n if (hideEvent.defaultPrevented) {\n return;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children).forEach(elem => EventHandler.off(elem, 'mouseover', noop));\n }\n\n if (this._popper) {\n this._popper.destroy();\n }\n\n this._menu.classList.remove(CLASS_NAME_SHOW$6);\n\n this._element.classList.remove(CLASS_NAME_SHOW$6);\n\n this._element.setAttribute('aria-expanded', 'false');\n\n Manipulator.removeDataAttribute(this._menu, 'popper');\n EventHandler.trigger(this._element, EVENT_HIDDEN$4, relatedTarget);\n }\n\n _getConfig(config) {\n config = { ...this.constructor.Default,\n ...Manipulator.getDataAttributes(this._element),\n ...config\n };\n typeCheckConfig(NAME$9, config, this.constructor.DefaultType);\n\n if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {\n // Popper virtual elements require a getBoundingClientRect method\n throw new TypeError(`${NAME$9.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`);\n }\n\n return config;\n }\n\n _createPopper(parent) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)');\n }\n\n let referenceElement = this._element;\n\n if (this._config.reference === 'parent') {\n referenceElement = parent;\n } else if (isElement$1(this._config.reference)) {\n referenceElement = getElement(this._config.reference);\n } else if (typeof this._config.reference === 'object') {\n referenceElement = this._config.reference;\n }\n\n const popperConfig = this._getPopperConfig();\n\n const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);\n this._popper = createPopper(referenceElement, this._menu, popperConfig);\n\n if (isDisplayStatic) {\n Manipulator.setDataAttribute(this._menu, 'popper', 'static');\n }\n }\n\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW$6);\n }\n\n _getMenuElement() {\n return SelectorEngine.next(this._element, SELECTOR_MENU)[0];\n }\n\n _getPlacement() {\n const parentDropdown = this._element.parentNode;\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n return PLACEMENT_RIGHT;\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n return PLACEMENT_LEFT;\n } // We need to trim the value because custom properties can also include spaces\n\n\n const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;\n }\n\n return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;\n }\n\n _detectNavbar() {\n return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null;\n }\n\n _getOffset() {\n const {\n offset\n } = this._config;\n\n if (typeof offset === 'string') {\n return offset.split(',').map(val => Number.parseInt(val, 10));\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n\n return offset;\n }\n\n _getPopperConfig() {\n const defaultBsPopperConfig = {\n placement: this._getPlacement(),\n modifiers: [{\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }]\n }; // Disable Popper if we have a static display\n\n if (this._config.display === 'static') {\n defaultBsPopperConfig.modifiers = [{\n name: 'applyStyles',\n enabled: false\n }];\n }\n\n return { ...defaultBsPopperConfig,\n ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)\n };\n }\n\n _selectMenuItem({\n key,\n target\n }) {\n const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible);\n\n if (!items.length) {\n return;\n } // if target isn't included in items (e.g. when expanding the dropdown)\n // allow cycling to get the last item in case key equals ARROW_UP_KEY\n\n\n getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Dropdown.getOrCreateInstance(this, config);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n });\n }\n\n static clearMenus(event) {\n if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {\n return;\n }\n\n const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$3);\n\n for (let i = 0, len = toggles.length; i < len; i++) {\n const context = Dropdown.getInstance(toggles[i]);\n\n if (!context || context._config.autoClose === false) {\n continue;\n }\n\n if (!context._isShown()) {\n continue;\n }\n\n const relatedTarget = {\n relatedTarget: context._element\n };\n\n if (event) {\n const composedPath = event.composedPath();\n const isMenuTarget = composedPath.includes(context._menu);\n\n if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {\n continue;\n } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n\n\n if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n continue;\n }\n\n if (event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n }\n\n context._completeHide(relatedTarget);\n }\n }\n\n static getParentFromElement(element) {\n return getElementFromSelector(element) || element.parentNode;\n }\n\n static dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.key === SPACE_KEY || event.key !== ESCAPE_KEY$2 && (event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY || event.target.closest(SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.key)) {\n return;\n }\n\n const isActive = this.classList.contains(CLASS_NAME_SHOW$6);\n\n if (!isActive && event.key === ESCAPE_KEY$2) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (isDisabled(this)) {\n return;\n }\n\n const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];\n const instance = Dropdown.getOrCreateInstance(getToggleButton);\n\n if (event.key === ESCAPE_KEY$2) {\n instance.hide();\n return;\n }\n\n if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {\n if (!isActive) {\n instance.show();\n }\n\n instance._selectMenuItem(event);\n\n return;\n }\n\n if (!isActive || event.key === SPACE_KEY) {\n Dropdown.clearMenus();\n }\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler);\n EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);\n EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus);\n EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);\n EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {\n event.preventDefault();\n Dropdown.getOrCreateInstance(this).toggle();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Dropdown to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Dropdown);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';\n const SELECTOR_STICKY_CONTENT = '.sticky-top';\n\n class ScrollBarHelper {\n constructor() {\n this._element = document.body;\n }\n\n getWidth() {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = document.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n }\n\n hide() {\n const width = this.getWidth();\n\n this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width\n\n\n this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n\n\n this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);\n\n this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);\n }\n\n _disableOverFlow() {\n this._saveInitialAttribute(this._element, 'overflow');\n\n this._element.style.overflow = 'hidden';\n }\n\n _setElementAttributes(selector, styleProp, callback) {\n const scrollbarWidth = this.getWidth();\n\n const manipulationCallBack = element => {\n if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n return;\n }\n\n this._saveInitialAttribute(element, styleProp);\n\n const calculatedValue = window.getComputedStyle(element)[styleProp];\n element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;\n };\n\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n\n reset() {\n this._resetElementAttributes(this._element, 'overflow');\n\n this._resetElementAttributes(this._element, 'paddingRight');\n\n this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');\n\n this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');\n }\n\n _saveInitialAttribute(element, styleProp) {\n const actualValue = element.style[styleProp];\n\n if (actualValue) {\n Manipulator.setDataAttribute(element, styleProp, actualValue);\n }\n }\n\n _resetElementAttributes(selector, styleProp) {\n const manipulationCallBack = element => {\n const value = Manipulator.getDataAttribute(element, styleProp);\n\n if (typeof value === 'undefined') {\n element.style.removeProperty(styleProp);\n } else {\n Manipulator.removeDataAttribute(element, styleProp);\n element.style[styleProp] = value;\n }\n };\n\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n\n _applyManipulationCallback(selector, callBack) {\n if (isElement$1(selector)) {\n callBack(selector);\n } else {\n SelectorEngine.find(selector, this._element).forEach(callBack);\n }\n }\n\n isOverflowing() {\n return this.getWidth() > 0;\n }\n\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n const Default$7 = {\n className: 'modal-backdrop',\n isVisible: true,\n // if false, we use the backdrop helper without adding any element to the dom\n isAnimated: false,\n rootElement: 'body',\n // give the choice to place backdrop under different elements\n clickCallback: null\n };\n const DefaultType$7 = {\n className: 'string',\n isVisible: 'boolean',\n isAnimated: 'boolean',\n rootElement: '(element|string)',\n clickCallback: '(function|null)'\n };\n const NAME$8 = 'backdrop';\n const CLASS_NAME_FADE$4 = 'fade';\n const CLASS_NAME_SHOW$5 = 'show';\n const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$8}`;\n\n class Backdrop {\n constructor(config) {\n this._config = this._getConfig(config);\n this._isAppended = false;\n this._element = null;\n }\n\n show(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n\n this._append();\n\n if (this._config.isAnimated) {\n reflow(this._getElement());\n }\n\n this._getElement().classList.add(CLASS_NAME_SHOW$5);\n\n this._emulateAnimation(() => {\n execute(callback);\n });\n }\n\n hide(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n\n this._getElement().classList.remove(CLASS_NAME_SHOW$5);\n\n this._emulateAnimation(() => {\n this.dispose();\n execute(callback);\n });\n } // Private\n\n\n _getElement() {\n if (!this._element) {\n const backdrop = document.createElement('div');\n backdrop.className = this._config.className;\n\n if (this._config.isAnimated) {\n backdrop.classList.add(CLASS_NAME_FADE$4);\n }\n\n this._element = backdrop;\n }\n\n return this._element;\n }\n\n _getConfig(config) {\n config = { ...Default$7,\n ...(typeof config === 'object' ? config : {})\n }; // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n\n config.rootElement = getElement(config.rootElement);\n typeCheckConfig(NAME$8, config, DefaultType$7);\n return config;\n }\n\n _append() {\n if (this._isAppended) {\n return;\n }\n\n this._config.rootElement.append(this._getElement());\n\n EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {\n execute(this._config.clickCallback);\n });\n this._isAppended = true;\n }\n\n dispose() {\n if (!this._isAppended) {\n return;\n }\n\n EventHandler.off(this._element, EVENT_MOUSEDOWN);\n\n this._element.remove();\n\n this._isAppended = false;\n }\n\n _emulateAnimation(callback) {\n executeAfterTransition(callback, this._getElement(), this._config.isAnimated);\n }\n\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n const Default$6 = {\n trapElement: null,\n // The element to trap focus inside of\n autofocus: true\n };\n const DefaultType$6 = {\n trapElement: 'element',\n autofocus: 'boolean'\n };\n const NAME$7 = 'focustrap';\n const DATA_KEY$7 = 'bs.focustrap';\n const EVENT_KEY$7 = `.${DATA_KEY$7}`;\n const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$7}`;\n const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$7}`;\n const TAB_KEY = 'Tab';\n const TAB_NAV_FORWARD = 'forward';\n const TAB_NAV_BACKWARD = 'backward';\n\n class FocusTrap {\n constructor(config) {\n this._config = this._getConfig(config);\n this._isActive = false;\n this._lastTabNavDirection = null;\n }\n\n activate() {\n const {\n trapElement,\n autofocus\n } = this._config;\n\n if (this._isActive) {\n return;\n }\n\n if (autofocus) {\n trapElement.focus();\n }\n\n EventHandler.off(document, EVENT_KEY$7); // guard against infinite focus loop\n\n EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));\n EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));\n this._isActive = true;\n }\n\n deactivate() {\n if (!this._isActive) {\n return;\n }\n\n this._isActive = false;\n EventHandler.off(document, EVENT_KEY$7);\n } // Private\n\n\n _handleFocusin(event) {\n const {\n target\n } = event;\n const {\n trapElement\n } = this._config;\n\n if (target === document || target === trapElement || trapElement.contains(target)) {\n return;\n }\n\n const elements = SelectorEngine.focusableChildren(trapElement);\n\n if (elements.length === 0) {\n trapElement.focus();\n } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n elements[elements.length - 1].focus();\n } else {\n elements[0].focus();\n }\n }\n\n _handleKeydown(event) {\n if (event.key !== TAB_KEY) {\n return;\n }\n\n this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;\n }\n\n _getConfig(config) {\n config = { ...Default$6,\n ...(typeof config === 'object' ? config : {})\n };\n typeCheckConfig(NAME$7, config, DefaultType$6);\n return config;\n }\n\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$6 = 'modal';\n const DATA_KEY$6 = 'bs.modal';\n const EVENT_KEY$6 = `.${DATA_KEY$6}`;\n const DATA_API_KEY$3 = '.data-api';\n const ESCAPE_KEY$1 = 'Escape';\n const Default$5 = {\n backdrop: true,\n keyboard: true,\n focus: true\n };\n const DefaultType$5 = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean'\n };\n const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;\n const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$6}`;\n const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;\n const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;\n const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;\n const EVENT_RESIZE = `resize${EVENT_KEY$6}`;\n const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$6}`;\n const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;\n const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`;\n const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;\n const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;\n const CLASS_NAME_OPEN = 'modal-open';\n const CLASS_NAME_FADE$3 = 'fade';\n const CLASS_NAME_SHOW$4 = 'show';\n const CLASS_NAME_STATIC = 'modal-static';\n const OPEN_SELECTOR$1 = '.modal.show';\n const SELECTOR_DIALOG = '.modal-dialog';\n const SELECTOR_MODAL_BODY = '.modal-body';\n const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle=\"modal\"]';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Modal extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._config = this._getConfig(config);\n this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n this._isShown = false;\n this._ignoreBackdropClick = false;\n this._isTransitioning = false;\n this._scrollBar = new ScrollBarHelper();\n } // Getters\n\n\n static get Default() {\n return Default$5;\n }\n\n static get NAME() {\n return NAME$6;\n } // Public\n\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return;\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {\n relatedTarget\n });\n\n if (showEvent.defaultPrevented) {\n return;\n }\n\n this._isShown = true;\n\n if (this._isAnimated()) {\n this._isTransitioning = true;\n }\n\n this._scrollBar.hide();\n\n document.body.classList.add(CLASS_NAME_OPEN);\n\n this._adjustDialog();\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {\n EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {\n if (event.target === this._element) {\n this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(() => this._showElement(relatedTarget));\n }\n\n hide() {\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n this._isShown = false;\n\n const isAnimated = this._isAnimated();\n\n if (isAnimated) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n this._focustrap.deactivate();\n\n this._element.classList.remove(CLASS_NAME_SHOW$4);\n\n EventHandler.off(this._element, EVENT_CLICK_DISMISS);\n EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);\n\n this._queueCallback(() => this._hideModal(), this._element, isAnimated);\n }\n\n dispose() {\n [window, this._dialog].forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY$6));\n\n this._backdrop.dispose();\n\n this._focustrap.deactivate();\n\n super.dispose();\n }\n\n handleUpdate() {\n this._adjustDialog();\n } // Private\n\n\n _initializeBackDrop() {\n return new Backdrop({\n isVisible: Boolean(this._config.backdrop),\n // 'static' option will be translated to true, and booleans will keep their value\n isAnimated: this._isAnimated()\n });\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n\n _getConfig(config) {\n config = { ...Default$5,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n };\n typeCheckConfig(NAME$6, config, DefaultType$5);\n return config;\n }\n\n _showElement(relatedTarget) {\n const isAnimated = this._isAnimated();\n\n const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.append(this._element);\n }\n\n this._element.style.display = 'block';\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.setAttribute('aria-modal', true);\n\n this._element.setAttribute('role', 'dialog');\n\n this._element.scrollTop = 0;\n\n if (modalBody) {\n modalBody.scrollTop = 0;\n }\n\n if (isAnimated) {\n reflow(this._element);\n }\n\n this._element.classList.add(CLASS_NAME_SHOW$4);\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._focustrap.activate();\n }\n\n this._isTransitioning = false;\n EventHandler.trigger(this._element, EVENT_SHOWN$3, {\n relatedTarget\n });\n };\n\n this._queueCallback(transitionComplete, this._dialog, isAnimated);\n }\n\n _setEscapeEvent() {\n if (this._isShown) {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {\n if (this._config.keyboard && event.key === ESCAPE_KEY$1) {\n event.preventDefault();\n this.hide();\n } else if (!this._config.keyboard && event.key === ESCAPE_KEY$1) {\n this._triggerBackdropTransition();\n }\n });\n } else {\n EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS$1);\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n EventHandler.on(window, EVENT_RESIZE, () => this._adjustDialog());\n } else {\n EventHandler.off(window, EVENT_RESIZE);\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none';\n\n this._element.setAttribute('aria-hidden', true);\n\n this._element.removeAttribute('aria-modal');\n\n this._element.removeAttribute('role');\n\n this._isTransitioning = false;\n\n this._backdrop.hide(() => {\n document.body.classList.remove(CLASS_NAME_OPEN);\n\n this._resetAdjustments();\n\n this._scrollBar.reset();\n\n EventHandler.trigger(this._element, EVENT_HIDDEN$3);\n });\n }\n\n _showBackdrop(callback) {\n EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n if (this._config.backdrop === true) {\n this.hide();\n } else if (this._config.backdrop === 'static') {\n this._triggerBackdropTransition();\n }\n });\n\n this._backdrop.show(callback);\n }\n\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_FADE$3);\n }\n\n _triggerBackdropTransition() {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n const {\n classList,\n scrollHeight,\n style\n } = this._element;\n const isModalOverflowing = scrollHeight > document.documentElement.clientHeight; // return if the following background transition hasn't yet completed\n\n if (!isModalOverflowing && style.overflowY === 'hidden' || classList.contains(CLASS_NAME_STATIC)) {\n return;\n }\n\n if (!isModalOverflowing) {\n style.overflowY = 'hidden';\n }\n\n classList.add(CLASS_NAME_STATIC);\n\n this._queueCallback(() => {\n classList.remove(CLASS_NAME_STATIC);\n\n if (!isModalOverflowing) {\n this._queueCallback(() => {\n style.overflowY = '';\n }, this._dialog);\n }\n }, this._dialog);\n\n this._element.focus();\n } // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // ----------------------------------------------------------------------\n\n\n _adjustDialog() {\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n const scrollbarWidth = this._scrollBar.getWidth();\n\n const isBodyOverflowing = scrollbarWidth > 0;\n\n if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) {\n this._element.style.paddingLeft = `${scrollbarWidth}px`;\n }\n\n if (isBodyOverflowing && !isModalOverflowing && !isRTL() || !isBodyOverflowing && isModalOverflowing && isRTL()) {\n this._element.style.paddingRight = `${scrollbarWidth}px`;\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n } // Static\n\n\n static jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n const data = Modal.getOrCreateInstance(this, config);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config](relatedTarget);\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {\n const target = getElementFromSelector(this);\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n\n EventHandler.one(target, EVENT_SHOW$3, showEvent => {\n if (showEvent.defaultPrevented) {\n // only register focus restorer if modal will actually get shown\n return;\n }\n\n EventHandler.one(target, EVENT_HIDDEN$3, () => {\n if (isVisible(this)) {\n this.focus();\n }\n });\n }); // avoid conflict when clicking moddal toggler while another one is open\n\n const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);\n\n if (allReadyOpen) {\n Modal.getInstance(allReadyOpen).hide();\n }\n\n const data = Modal.getOrCreateInstance(target);\n data.toggle(this);\n });\n enableDismissTrigger(Modal);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Modal to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Modal);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$5 = 'offcanvas';\n const DATA_KEY$5 = 'bs.offcanvas';\n const EVENT_KEY$5 = `.${DATA_KEY$5}`;\n const DATA_API_KEY$2 = '.data-api';\n const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$5}${DATA_API_KEY$2}`;\n const ESCAPE_KEY = 'Escape';\n const Default$4 = {\n backdrop: true,\n keyboard: true,\n scroll: false\n };\n const DefaultType$4 = {\n backdrop: 'boolean',\n keyboard: 'boolean',\n scroll: 'boolean'\n };\n const CLASS_NAME_SHOW$3 = 'show';\n const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';\n const OPEN_SELECTOR = '.offcanvas.show';\n const EVENT_SHOW$2 = `show${EVENT_KEY$5}`;\n const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;\n const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;\n const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`;\n const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;\n const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;\n const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle=\"offcanvas\"]';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Offcanvas extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._config = this._getConfig(config);\n this._isShown = false;\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n\n this._addEventListeners();\n } // Getters\n\n\n static get NAME() {\n return NAME$5;\n }\n\n static get Default() {\n return Default$4;\n } // Public\n\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n\n show(relatedTarget) {\n if (this._isShown) {\n return;\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$2, {\n relatedTarget\n });\n\n if (showEvent.defaultPrevented) {\n return;\n }\n\n this._isShown = true;\n this._element.style.visibility = 'visible';\n\n this._backdrop.show();\n\n if (!this._config.scroll) {\n new ScrollBarHelper().hide();\n }\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.setAttribute('aria-modal', true);\n\n this._element.setAttribute('role', 'dialog');\n\n this._element.classList.add(CLASS_NAME_SHOW$3);\n\n const completeCallBack = () => {\n if (!this._config.scroll) {\n this._focustrap.activate();\n }\n\n EventHandler.trigger(this._element, EVENT_SHOWN$2, {\n relatedTarget\n });\n };\n\n this._queueCallback(completeCallBack, this._element, true);\n }\n\n hide() {\n if (!this._isShown) {\n return;\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$2);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n this._focustrap.deactivate();\n\n this._element.blur();\n\n this._isShown = false;\n\n this._element.classList.remove(CLASS_NAME_SHOW$3);\n\n this._backdrop.hide();\n\n const completeCallback = () => {\n this._element.setAttribute('aria-hidden', true);\n\n this._element.removeAttribute('aria-modal');\n\n this._element.removeAttribute('role');\n\n this._element.style.visibility = 'hidden';\n\n if (!this._config.scroll) {\n new ScrollBarHelper().reset();\n }\n\n EventHandler.trigger(this._element, EVENT_HIDDEN$2);\n };\n\n this._queueCallback(completeCallback, this._element, true);\n }\n\n dispose() {\n this._backdrop.dispose();\n\n this._focustrap.deactivate();\n\n super.dispose();\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default$4,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n };\n typeCheckConfig(NAME$5, config, DefaultType$4);\n return config;\n }\n\n _initializeBackDrop() {\n return new Backdrop({\n className: CLASS_NAME_BACKDROP,\n isVisible: this._config.backdrop,\n isAnimated: true,\n rootElement: this._element.parentNode,\n clickCallback: () => this.hide()\n });\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (this._config.keyboard && event.key === ESCAPE_KEY) {\n this.hide();\n }\n });\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Offcanvas.getOrCreateInstance(this, config);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config](this);\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {\n const target = getElementFromSelector(this);\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n\n if (isDisabled(this)) {\n return;\n }\n\n EventHandler.one(target, EVENT_HIDDEN$2, () => {\n // focus on trigger when it is closed\n if (isVisible(this)) {\n this.focus();\n }\n }); // avoid conflict when clicking a toggler of an offcanvas, while another is open\n\n const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);\n\n if (allReadyOpen && allReadyOpen !== target) {\n Offcanvas.getInstance(allReadyOpen).hide();\n }\n\n const data = Offcanvas.getOrCreateInstance(target);\n data.toggle(this);\n });\n EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));\n enableDismissTrigger(Offcanvas);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n defineJQueryPlugin(Offcanvas);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);\n const ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\n /**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;\n /**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n const DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[\\d+/a-z]+=*$/i;\n\n const allowedAttribute = (attr, allowedAttributeList) => {\n const attrName = attr.nodeName.toLowerCase();\n\n if (allowedAttributeList.includes(attrName)) {\n if (uriAttrs.has(attrName)) {\n return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));\n }\n\n return true;\n }\n\n const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp); // Check if a regular expression validates the attribute.\n\n for (let i = 0, len = regExp.length; i < len; i++) {\n if (regExp[i].test(attrName)) {\n return true;\n }\n }\n\n return false;\n };\n\n const DefaultAllowlist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n };\n function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {\n if (!unsafeHtml.length) {\n return unsafeHtml;\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml);\n }\n\n const domParser = new window.DOMParser();\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n const allowlistKeys = Object.keys(allowList);\n const elements = [].concat(...createdDocument.body.querySelectorAll('*'));\n\n for (let i = 0, len = elements.length; i < len; i++) {\n const el = elements[i];\n const elName = el.nodeName.toLowerCase();\n\n if (!allowlistKeys.includes(elName)) {\n el.remove();\n continue;\n }\n\n const attributeList = [].concat(...el.attributes);\n const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);\n attributeList.forEach(attr => {\n if (!allowedAttribute(attr, allowedAttributes)) {\n el.removeAttribute(attr.nodeName);\n }\n });\n }\n\n return createdDocument.body.innerHTML;\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$4 = 'tooltip';\n const DATA_KEY$4 = 'bs.tooltip';\n const EVENT_KEY$4 = `.${DATA_KEY$4}`;\n const CLASS_PREFIX$1 = 'bs-tooltip';\n const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);\n const DefaultType$3 = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(array|string|function)',\n container: '(string|element|boolean)',\n fallbackPlacements: 'array',\n boundary: '(string|element)',\n customClass: '(string|function)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n allowList: 'object',\n popperConfig: '(null|object|function)'\n };\n const AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: isRTL() ? 'left' : 'right',\n BOTTOM: 'bottom',\n LEFT: isRTL() ? 'right' : 'left'\n };\n const Default$3 = {\n animation: true,\n template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"tooltip-arrow\"></div>' + '<div class=\"tooltip-inner\"></div>' + '</div>',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: [0, 0],\n container: false,\n fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n boundary: 'clippingParents',\n customClass: '',\n sanitize: true,\n sanitizeFn: null,\n allowList: DefaultAllowlist,\n popperConfig: null\n };\n const Event$2 = {\n HIDE: `hide${EVENT_KEY$4}`,\n HIDDEN: `hidden${EVENT_KEY$4}`,\n SHOW: `show${EVENT_KEY$4}`,\n SHOWN: `shown${EVENT_KEY$4}`,\n INSERTED: `inserted${EVENT_KEY$4}`,\n CLICK: `click${EVENT_KEY$4}`,\n FOCUSIN: `focusin${EVENT_KEY$4}`,\n FOCUSOUT: `focusout${EVENT_KEY$4}`,\n MOUSEENTER: `mouseenter${EVENT_KEY$4}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY$4}`\n };\n const CLASS_NAME_FADE$2 = 'fade';\n const CLASS_NAME_MODAL = 'modal';\n const CLASS_NAME_SHOW$2 = 'show';\n const HOVER_STATE_SHOW = 'show';\n const HOVER_STATE_OUT = 'out';\n const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';\n const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;\n const EVENT_MODAL_HIDE = 'hide.bs.modal';\n const TRIGGER_HOVER = 'hover';\n const TRIGGER_FOCUS = 'focus';\n const TRIGGER_CLICK = 'click';\n const TRIGGER_MANUAL = 'manual';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip extends BaseComponent {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)');\n }\n\n super(element); // private\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this._config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n static get Default() {\n return Default$3;\n }\n\n static get NAME() {\n return NAME$4;\n }\n\n static get Event() {\n return Event$2;\n }\n\n static get DefaultType() {\n return DefaultType$3;\n } // Public\n\n\n enable() {\n this._isEnabled = true;\n }\n\n disable() {\n this._isEnabled = false;\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n }\n\n toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n const context = this._initializeOnDelegatedTarget(event);\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$2)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n }\n\n dispose() {\n clearTimeout(this._timeout);\n EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n\n if (this.tip) {\n this.tip.remove();\n }\n\n this._disposePopper();\n\n super.dispose();\n }\n\n show() {\n if (this._element.style.display === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n if (!(this.isWithContent() && this._isEnabled)) {\n return;\n }\n\n const showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW);\n const shadowRoot = findShadowRoot(this._element);\n const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);\n\n if (showEvent.defaultPrevented || !isInTheDom) {\n return;\n } // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title`\n // This will be removed later in favor of a `setContent` method\n\n\n if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {\n this._disposePopper();\n\n this.tip.remove();\n this.tip = null;\n }\n\n const tip = this.getTipElement();\n const tipId = getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n\n this._element.setAttribute('aria-describedby', tipId);\n\n if (this._config.animation) {\n tip.classList.add(CLASS_NAME_FADE$2);\n }\n\n const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;\n\n const attachment = this._getAttachment(placement);\n\n this._addAttachmentClass(attachment);\n\n const {\n container\n } = this._config;\n Data.set(tip, this.constructor.DATA_KEY, this);\n\n if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n container.append(tip);\n EventHandler.trigger(this._element, this.constructor.Event.INSERTED);\n }\n\n if (this._popper) {\n this._popper.update();\n } else {\n this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));\n }\n\n tip.classList.add(CLASS_NAME_SHOW$2);\n\n const customClass = this._resolvePossibleFunction(this._config.customClass);\n\n if (customClass) {\n tip.classList.add(...customClass.split(' '));\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children).forEach(element => {\n EventHandler.on(element, 'mouseover', noop);\n });\n }\n\n const complete = () => {\n const prevHoverState = this._hoverState;\n this._hoverState = null;\n EventHandler.trigger(this._element, this.constructor.Event.SHOWN);\n\n if (prevHoverState === HOVER_STATE_OUT) {\n this._leave(null, this);\n }\n };\n\n const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);\n\n this._queueCallback(complete, this.tip, isAnimated);\n }\n\n hide() {\n if (!this._popper) {\n return;\n }\n\n const tip = this.getTipElement();\n\n const complete = () => {\n if (this._isWithActiveTrigger()) {\n return;\n }\n\n if (this._hoverState !== HOVER_STATE_SHOW) {\n tip.remove();\n }\n\n this._cleanTipClass();\n\n this._element.removeAttribute('aria-describedby');\n\n EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);\n\n this._disposePopper();\n };\n\n const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n tip.classList.remove(CLASS_NAME_SHOW$2); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children).forEach(element => EventHandler.off(element, 'mouseover', noop));\n }\n\n this._activeTrigger[TRIGGER_CLICK] = false;\n this._activeTrigger[TRIGGER_FOCUS] = false;\n this._activeTrigger[TRIGGER_HOVER] = false;\n const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);\n\n this._queueCallback(complete, this.tip, isAnimated);\n\n this._hoverState = '';\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.update();\n }\n } // Protected\n\n\n isWithContent() {\n return Boolean(this.getTitle());\n }\n\n getTipElement() {\n if (this.tip) {\n return this.tip;\n }\n\n const element = document.createElement('div');\n element.innerHTML = this._config.template;\n const tip = element.children[0];\n this.setContent(tip);\n tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);\n this.tip = tip;\n return this.tip;\n }\n\n setContent(tip) {\n this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);\n }\n\n _sanitizeAndSetContent(template, content, selector) {\n const templateElement = SelectorEngine.findOne(selector, template);\n\n if (!content && templateElement) {\n templateElement.remove();\n return;\n } // we use append for html objects to maintain js events\n\n\n this.setElementContent(templateElement, content);\n }\n\n setElementContent(element, content) {\n if (element === null) {\n return;\n }\n\n if (isElement$1(content)) {\n content = getElement(content); // content is a DOM node or a jQuery\n\n if (this._config.html) {\n if (content.parentNode !== element) {\n element.innerHTML = '';\n element.append(content);\n }\n } else {\n element.textContent = content.textContent;\n }\n\n return;\n }\n\n if (this._config.html) {\n if (this._config.sanitize) {\n content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);\n }\n\n element.innerHTML = content;\n } else {\n element.textContent = content;\n }\n }\n\n getTitle() {\n const title = this._element.getAttribute('data-bs-original-title') || this._config.title;\n\n return this._resolvePossibleFunction(title);\n }\n\n updateAttachment(attachment) {\n if (attachment === 'right') {\n return 'end';\n }\n\n if (attachment === 'left') {\n return 'start';\n }\n\n return attachment;\n } // Private\n\n\n _initializeOnDelegatedTarget(event, context) {\n return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());\n }\n\n _getOffset() {\n const {\n offset\n } = this._config;\n\n if (typeof offset === 'string') {\n return offset.split(',').map(val => Number.parseInt(val, 10));\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n\n return offset;\n }\n\n _resolvePossibleFunction(content) {\n return typeof content === 'function' ? content.call(this._element) : content;\n }\n\n _getPopperConfig(attachment) {\n const defaultBsPopperConfig = {\n placement: attachment,\n modifiers: [{\n name: 'flip',\n options: {\n fallbackPlacements: this._config.fallbackPlacements\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }, {\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'arrow',\n options: {\n element: `.${this.constructor.NAME}-arrow`\n }\n }, {\n name: 'onChange',\n enabled: true,\n phase: 'afterWrite',\n fn: data => this._handlePopperPlacementChange(data)\n }],\n onFirstUpdate: data => {\n if (data.options.placement !== data.placement) {\n this._handlePopperPlacementChange(data);\n }\n }\n };\n return { ...defaultBsPopperConfig,\n ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)\n };\n }\n\n _addAttachmentClass(attachment) {\n this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);\n }\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n }\n\n _setListeners() {\n const triggers = this._config.trigger.split(' ');\n\n triggers.forEach(trigger => {\n if (trigger === 'click') {\n EventHandler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));\n } else if (trigger !== TRIGGER_MANUAL) {\n const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;\n const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;\n EventHandler.on(this._element, eventIn, this._config.selector, event => this._enter(event));\n EventHandler.on(this._element, eventOut, this._config.selector, event => this._leave(event));\n }\n });\n\n this._hideModalHandler = () => {\n if (this._element) {\n this.hide();\n }\n };\n\n EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n\n if (this._config.selector) {\n this._config = { ...this._config,\n trigger: 'manual',\n selector: ''\n };\n } else {\n this._fixTitle();\n }\n }\n\n _fixTitle() {\n const title = this._element.getAttribute('title');\n\n const originalTitleType = typeof this._element.getAttribute('data-bs-original-title');\n\n if (title || originalTitleType !== 'string') {\n this._element.setAttribute('data-bs-original-title', title || '');\n\n if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {\n this._element.setAttribute('aria-label', title);\n }\n\n this._element.setAttribute('title', '');\n }\n }\n\n _enter(event, context) {\n context = this._initializeOnDelegatedTarget(event, context);\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;\n }\n\n if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$2) || context._hoverState === HOVER_STATE_SHOW) {\n context._hoverState = HOVER_STATE_SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HOVER_STATE_SHOW;\n\n if (!context._config.delay || !context._config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HOVER_STATE_SHOW) {\n context.show();\n }\n }, context._config.delay.show);\n }\n\n _leave(event, context) {\n context = this._initializeOnDelegatedTarget(event, context);\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HOVER_STATE_OUT;\n\n if (!context._config.delay || !context._config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HOVER_STATE_OUT) {\n context.hide();\n }\n }, context._config.delay.hide);\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n }\n\n _getConfig(config) {\n const dataAttributes = Manipulator.getDataAttributes(this._element);\n Object.keys(dataAttributes).forEach(dataAttr => {\n if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {\n delete dataAttributes[dataAttr];\n }\n });\n config = { ...this.constructor.Default,\n ...dataAttributes,\n ...(typeof config === 'object' && config ? config : {})\n };\n config.container = config.container === false ? document.body : getElement(config.container);\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n typeCheckConfig(NAME$4, config, this.constructor.DefaultType);\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);\n }\n\n return config;\n }\n\n _getDelegateConfig() {\n const config = {};\n\n for (const key in this._config) {\n if (this.constructor.Default[key] !== this._config[key]) {\n config[key] = this._config[key];\n }\n } // In the future can be replaced with:\n // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n // `Object.fromEntries(keysWithDifferentValues)`\n\n\n return config;\n }\n\n _cleanTipClass() {\n const tip = this.getTipElement();\n const basicClassPrefixRegex = new RegExp(`(^|\\\\s)${this._getBasicClassPrefix()}\\\\S+`, 'g');\n const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);\n\n if (tabClass !== null && tabClass.length > 0) {\n tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));\n }\n }\n\n _getBasicClassPrefix() {\n return CLASS_PREFIX$1;\n }\n\n _handlePopperPlacementChange(popperData) {\n const {\n state\n } = popperData;\n\n if (!state) {\n return;\n }\n\n this.tip = state.elements.popper;\n\n this._cleanTipClass();\n\n this._addAttachmentClass(this._getAttachment(state.placement));\n }\n\n _disposePopper() {\n if (this._popper) {\n this._popper.destroy();\n\n this._popper = null;\n }\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tooltip.getOrCreateInstance(this, config);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Tooltip to jQuery only if jQuery is present\n */\n\n\n defineJQueryPlugin(Tooltip);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$3 = 'popover';\n const DATA_KEY$3 = 'bs.popover';\n const EVENT_KEY$3 = `.${DATA_KEY$3}`;\n const CLASS_PREFIX = 'bs-popover';\n const Default$2 = { ...Tooltip.Default,\n placement: 'right',\n offset: [0, 8],\n trigger: 'click',\n content: '',\n template: '<div class=\"popover\" role=\"tooltip\">' + '<div class=\"popover-arrow\"></div>' + '<h3 class=\"popover-header\"></h3>' + '<div class=\"popover-body\"></div>' + '</div>'\n };\n const DefaultType$2 = { ...Tooltip.DefaultType,\n content: '(string|element|function)'\n };\n const Event$1 = {\n HIDE: `hide${EVENT_KEY$3}`,\n HIDDEN: `hidden${EVENT_KEY$3}`,\n SHOW: `show${EVENT_KEY$3}`,\n SHOWN: `shown${EVENT_KEY$3}`,\n INSERTED: `inserted${EVENT_KEY$3}`,\n CLICK: `click${EVENT_KEY$3}`,\n FOCUSIN: `focusin${EVENT_KEY$3}`,\n FOCUSOUT: `focusout${EVENT_KEY$3}`,\n MOUSEENTER: `mouseenter${EVENT_KEY$3}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY$3}`\n };\n const SELECTOR_TITLE = '.popover-header';\n const SELECTOR_CONTENT = '.popover-body';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Popover extends Tooltip {\n // Getters\n static get Default() {\n return Default$2;\n }\n\n static get NAME() {\n return NAME$3;\n }\n\n static get Event() {\n return Event$1;\n }\n\n static get DefaultType() {\n return DefaultType$2;\n } // Overrides\n\n\n isWithContent() {\n return this.getTitle() || this._getContent();\n }\n\n setContent(tip) {\n this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);\n\n this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);\n } // Private\n\n\n _getContent() {\n return this._resolvePossibleFunction(this._config.content);\n }\n\n _getBasicClassPrefix() {\n return CLASS_PREFIX;\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Popover to jQuery only if jQuery is present\n */\n\n\n defineJQueryPlugin(Popover);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$2 = 'scrollspy';\n const DATA_KEY$2 = 'bs.scrollspy';\n const EVENT_KEY$2 = `.${DATA_KEY$2}`;\n const DATA_API_KEY$1 = '.data-api';\n const Default$1 = {\n offset: 10,\n method: 'auto',\n target: ''\n };\n const DefaultType$1 = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n };\n const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;\n const EVENT_SCROLL = `scroll${EVENT_KEY$2}`;\n const EVENT_LOAD_DATA_API = `load${EVENT_KEY$2}${DATA_API_KEY$1}`;\n const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';\n const CLASS_NAME_ACTIVE$1 = 'active';\n const SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]';\n const SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';\n const SELECTOR_NAV_LINKS = '.nav-link';\n const SELECTOR_NAV_ITEMS = '.nav-item';\n const SELECTOR_LIST_ITEMS = '.list-group-item';\n const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`;\n const SELECTOR_DROPDOWN$1 = '.dropdown';\n const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';\n const METHOD_OFFSET = 'offset';\n const METHOD_POSITION = 'position';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class ScrollSpy extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._scrollElement = this._element.tagName === 'BODY' ? window : this._element;\n this._config = this._getConfig(config);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n EventHandler.on(this._scrollElement, EVENT_SCROLL, () => this._process());\n this.refresh();\n\n this._process();\n } // Getters\n\n\n static get Default() {\n return Default$1;\n }\n\n static get NAME() {\n return NAME$2;\n } // Public\n\n\n refresh() {\n const autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;\n const offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;\n const offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target);\n targets.map(element => {\n const targetSelector = getSelectorFromElement(element);\n const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;\n\n if (target) {\n const targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(item => item).sort((a, b) => a[0] - b[0]).forEach(item => {\n this._offsets.push(item[0]);\n\n this._targets.push(item[1]);\n });\n }\n\n dispose() {\n EventHandler.off(this._scrollElement, EVENT_KEY$2);\n super.dispose();\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default$1,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' && config ? config : {})\n };\n config.target = getElement(config.target) || document.documentElement;\n typeCheckConfig(NAME$2, config, DefaultType$1);\n return config;\n }\n\n _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset;\n\n const scrollHeight = this._getScrollHeight();\n\n const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n for (let i = this._offsets.length; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n const queries = SELECTOR_LINK_ITEMS.split(',').map(selector => `${selector}[data-bs-target=\"${target}\"],${selector}[href=\"${target}\"]`);\n const link = SelectorEngine.findOne(queries.join(','), this._config.target);\n link.classList.add(CLASS_NAME_ACTIVE$1);\n\n if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1);\n } else {\n SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => {\n // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n SelectorEngine.prev(listGroup, `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1)); // Handle special case when .nav-link is inside .nav-item\n\n SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(navItem => {\n SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1));\n });\n });\n }\n\n EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {\n relatedTarget: target\n });\n }\n\n _clear() {\n SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1));\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = ScrollSpy.getOrCreateInstance(this, config);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n SelectorEngine.find(SELECTOR_DATA_SPY).forEach(spy => new ScrollSpy(spy));\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .ScrollSpy to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(ScrollSpy);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$1 = 'tab';\n const DATA_KEY$1 = 'bs.tab';\n const EVENT_KEY$1 = `.${DATA_KEY$1}`;\n const DATA_API_KEY = '.data-api';\n const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`;\n const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`;\n const EVENT_SHOW$1 = `show${EVENT_KEY$1}`;\n const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`;\n const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}${DATA_API_KEY}`;\n const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';\n const CLASS_NAME_ACTIVE = 'active';\n const CLASS_NAME_FADE$1 = 'fade';\n const CLASS_NAME_SHOW$1 = 'show';\n const SELECTOR_DROPDOWN = '.dropdown';\n const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';\n const SELECTOR_ACTIVE = '.active';\n const SELECTOR_ACTIVE_UL = ':scope > li > .active';\n const SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]';\n const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';\n const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tab extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$1;\n } // Public\n\n\n show() {\n if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE)) {\n return;\n }\n\n let previous;\n const target = getElementFromSelector(this._element);\n\n const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);\n\n if (listElement) {\n const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;\n previous = SelectorEngine.find(itemSelector, listElement);\n previous = previous[previous.length - 1];\n }\n\n const hideEvent = previous ? EventHandler.trigger(previous, EVENT_HIDE$1, {\n relatedTarget: this._element\n }) : null;\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$1, {\n relatedTarget: previous\n });\n\n if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {\n return;\n }\n\n this._activate(this._element, listElement);\n\n const complete = () => {\n EventHandler.trigger(previous, EVENT_HIDDEN$1, {\n relatedTarget: this._element\n });\n EventHandler.trigger(this._element, EVENT_SHOWN$1, {\n relatedTarget: previous\n });\n };\n\n if (target) {\n this._activate(target, target.parentNode, complete);\n } else {\n complete();\n }\n } // Private\n\n\n _activate(element, container, callback) {\n const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE);\n const active = activeElements[0];\n const isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$1);\n\n const complete = () => this._transitionComplete(element, active, callback);\n\n if (active && isTransitioning) {\n active.classList.remove(CLASS_NAME_SHOW$1);\n\n this._queueCallback(complete, element, true);\n } else {\n complete();\n }\n }\n\n _transitionComplete(element, active, callback) {\n if (active) {\n active.classList.remove(CLASS_NAME_ACTIVE);\n const dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);\n\n if (dropdownChild) {\n dropdownChild.classList.remove(CLASS_NAME_ACTIVE);\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false);\n }\n }\n\n element.classList.add(CLASS_NAME_ACTIVE);\n\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true);\n }\n\n reflow(element);\n\n if (element.classList.contains(CLASS_NAME_FADE$1)) {\n element.classList.add(CLASS_NAME_SHOW$1);\n }\n\n let parent = element.parentNode;\n\n if (parent && parent.nodeName === 'LI') {\n parent = parent.parentNode;\n }\n\n if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {\n const dropdownElement = element.closest(SELECTOR_DROPDOWN);\n\n if (dropdownElement) {\n SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));\n }\n\n element.setAttribute('aria-expanded', true);\n }\n\n if (callback) {\n callback();\n }\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tab.getOrCreateInstance(this);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n\n if (isDisabled(this)) {\n return;\n }\n\n const data = Tab.getOrCreateInstance(this);\n data.show();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Tab to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Tab);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'toast';\n const DATA_KEY = 'bs.toast';\n const EVENT_KEY = `.${DATA_KEY}`;\n const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;\n const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;\n const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;\n const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;\n const EVENT_HIDE = `hide${EVENT_KEY}`;\n const EVENT_HIDDEN = `hidden${EVENT_KEY}`;\n const EVENT_SHOW = `show${EVENT_KEY}`;\n const EVENT_SHOWN = `shown${EVENT_KEY}`;\n const CLASS_NAME_FADE = 'fade';\n const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility\n\n const CLASS_NAME_SHOW = 'show';\n const CLASS_NAME_SHOWING = 'showing';\n const DefaultType = {\n animation: 'boolean',\n autohide: 'boolean',\n delay: 'number'\n };\n const Default = {\n animation: true,\n autohide: true,\n delay: 5000\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Toast extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._config = this._getConfig(config);\n this._timeout = null;\n this._hasMouseInteraction = false;\n this._hasKeyboardInteraction = false;\n\n this._setListeners();\n } // Getters\n\n\n static get DefaultType() {\n return DefaultType;\n }\n\n static get Default() {\n return Default;\n }\n\n static get NAME() {\n return NAME;\n } // Public\n\n\n show() {\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW);\n\n if (showEvent.defaultPrevented) {\n return;\n }\n\n this._clearTimeout();\n\n if (this._config.animation) {\n this._element.classList.add(CLASS_NAME_FADE);\n }\n\n const complete = () => {\n this._element.classList.remove(CLASS_NAME_SHOWING);\n\n EventHandler.trigger(this._element, EVENT_SHOWN);\n\n this._maybeScheduleHide();\n };\n\n this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated\n\n\n reflow(this._element);\n\n this._element.classList.add(CLASS_NAME_SHOW);\n\n this._element.classList.add(CLASS_NAME_SHOWING);\n\n this._queueCallback(complete, this._element, this._config.animation);\n }\n\n hide() {\n if (!this._element.classList.contains(CLASS_NAME_SHOW)) {\n return;\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n const complete = () => {\n this._element.classList.add(CLASS_NAME_HIDE); // @deprecated\n\n\n this._element.classList.remove(CLASS_NAME_SHOWING);\n\n this._element.classList.remove(CLASS_NAME_SHOW);\n\n EventHandler.trigger(this._element, EVENT_HIDDEN);\n };\n\n this._element.classList.add(CLASS_NAME_SHOWING);\n\n this._queueCallback(complete, this._element, this._config.animation);\n }\n\n dispose() {\n this._clearTimeout();\n\n if (this._element.classList.contains(CLASS_NAME_SHOW)) {\n this._element.classList.remove(CLASS_NAME_SHOW);\n }\n\n super.dispose();\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' && config ? config : {})\n };\n typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n }\n\n _maybeScheduleHide() {\n if (!this._config.autohide) {\n return;\n }\n\n if (this._hasMouseInteraction || this._hasKeyboardInteraction) {\n return;\n }\n\n this._timeout = setTimeout(() => {\n this.hide();\n }, this._config.delay);\n }\n\n _onInteraction(event, isInteracting) {\n switch (event.type) {\n case 'mouseover':\n case 'mouseout':\n this._hasMouseInteraction = isInteracting;\n break;\n\n case 'focusin':\n case 'focusout':\n this._hasKeyboardInteraction = isInteracting;\n break;\n }\n\n if (isInteracting) {\n this._clearTimeout();\n\n return;\n }\n\n const nextElement = event.relatedTarget;\n\n if (this._element === nextElement || this._element.contains(nextElement)) {\n return;\n }\n\n this._maybeScheduleHide();\n }\n\n _setListeners() {\n EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));\n EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));\n EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));\n EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));\n }\n\n _clearTimeout() {\n clearTimeout(this._timeout);\n this._timeout = null;\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Toast.getOrCreateInstance(this, config);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config](this);\n }\n });\n }\n\n }\n\n enableDismissTrigger(Toast);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Toast to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Toast);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.1): index.umd.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n var index_umd = {\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Offcanvas,\n Popover,\n ScrollSpy,\n Tab,\n Toast,\n Tooltip\n };\n\n return index_umd;\n\n})));\n//# sourceMappingURL=bootstrap.bundle.js.map\n\n\n//# sourceURL=webpack:///./node_modules/bootstrap/dist/js/bootstrap.bundle.js?");
|
827
|
+
eval("/*!\n * Bootstrap v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\n(function (global, factory) {\n true ? module.exports = factory() :\n undefined;\n})(this, (function () { 'use strict';\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const MAX_UID = 1000000;\n const MILLISECONDS_MULTIPLIER = 1000;\n const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n const toType = obj => {\n if (obj === null || obj === undefined) {\n return `${obj}`;\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n };\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n const getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID);\n } while (document.getElementById(prefix));\n\n return prefix;\n };\n\n const getSelector = element => {\n let selector = element.getAttribute('data-bs-target');\n\n if (!selector || selector === '#') {\n let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n\n if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {\n return null;\n } // Just in case some CMS puts out a full URL with the anchor appended\n\n\n if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {\n hrefAttr = `#${hrefAttr.split('#')[1]}`;\n }\n\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;\n }\n\n return selector;\n };\n\n const getSelectorFromElement = element => {\n const selector = getSelector(element);\n\n if (selector) {\n return document.querySelector(selector) ? selector : null;\n }\n\n return null;\n };\n\n const getElementFromSelector = element => {\n const selector = getSelector(element);\n return selector ? document.querySelector(selector) : null;\n };\n\n const getTransitionDurationFromElement = element => {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n let {\n transitionDuration,\n transitionDelay\n } = window.getComputedStyle(element);\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n };\n\n const triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END));\n };\n\n const isElement$1 = obj => {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n if (typeof obj.jquery !== 'undefined') {\n obj = obj[0];\n }\n\n return typeof obj.nodeType !== 'undefined';\n };\n\n const getElement = obj => {\n if (isElement$1(obj)) {\n // it's a jQuery object or a node element\n return obj.jquery ? obj[0] : obj;\n }\n\n if (typeof obj === 'string' && obj.length > 0) {\n return document.querySelector(obj);\n }\n\n return null;\n };\n\n const typeCheckConfig = (componentName, config, configTypes) => {\n Object.keys(configTypes).forEach(property => {\n const expectedTypes = configTypes[property];\n const value = config[property];\n const valueType = value && isElement$1(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(`${componentName.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`);\n }\n });\n };\n\n const isVisible = element => {\n if (!isElement$1(element) || element.getClientRects().length === 0) {\n return false;\n }\n\n return getComputedStyle(element).getPropertyValue('visibility') === 'visible';\n };\n\n const isDisabled = element => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n\n if (element.classList.contains('disabled')) {\n return true;\n }\n\n if (typeof element.disabled !== 'undefined') {\n return element.disabled;\n }\n\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';\n };\n\n const findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null;\n } // Can find the shadow root otherwise it'll return the document\n\n\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n\n if (element instanceof ShadowRoot) {\n return element;\n } // when we don't find a shadow root\n\n\n if (!element.parentNode) {\n return null;\n }\n\n return findShadowRoot(element.parentNode);\n };\n\n const noop = () => {};\n /**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\n\n\n const reflow = element => {\n // eslint-disable-next-line no-unused-expressions\n element.offsetHeight;\n };\n\n const getjQuery = () => {\n const {\n jQuery\n } = window;\n\n if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return jQuery;\n }\n\n return null;\n };\n\n const DOMContentLoadedCallbacks = [];\n\n const onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n DOMContentLoadedCallbacks.forEach(callback => callback());\n });\n }\n\n DOMContentLoadedCallbacks.push(callback);\n } else {\n callback();\n }\n };\n\n const isRTL = () => document.documentElement.dir === 'rtl';\n\n const defineJQueryPlugin = plugin => {\n onDOMContentLoaded(() => {\n const $ = getjQuery();\n /* istanbul ignore if */\n\n if ($) {\n const name = plugin.NAME;\n const JQUERY_NO_CONFLICT = $.fn[name];\n $.fn[name] = plugin.jQueryInterface;\n $.fn[name].Constructor = plugin;\n\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT;\n return plugin.jQueryInterface;\n };\n }\n });\n };\n\n const execute = callback => {\n if (typeof callback === 'function') {\n callback();\n }\n };\n\n const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback);\n return;\n }\n\n const durationPadding = 5;\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;\n let called = false;\n\n const handler = ({\n target\n }) => {\n if (target !== transitionElement) {\n return;\n }\n\n called = true;\n transitionElement.removeEventListener(TRANSITION_END, handler);\n execute(callback);\n };\n\n transitionElement.addEventListener(TRANSITION_END, handler);\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement);\n }\n }, emulatedDuration);\n };\n /**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\n\n\n const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n let index = list.indexOf(activeElement); // if the element does not exist in the list return an element depending on the direction and if cycle is allowed\n\n if (index === -1) {\n return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0];\n }\n\n const listLength = list.length;\n index += shouldGetNext ? 1 : -1;\n\n if (isCycleAllowed) {\n index = (index + listLength) % listLength;\n }\n\n return list[Math.max(0, Math.min(index, listLength - 1))];\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const namespaceRegex = /[^.]*(?=\\..*)\\.|.*/;\n const stripNameRegex = /\\..*/;\n const stripUidRegex = /::\\d+$/;\n const eventRegistry = {}; // Events storage\n\n let uidEvent = 1;\n const customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n };\n const customEventsRegex = /^(mouseenter|mouseleave)/i;\n const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);\n /**\n * ------------------------------------------------------------------------\n * Private methods\n * ------------------------------------------------------------------------\n */\n\n function getUidEvent(element, uid) {\n return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;\n }\n\n function getEvent(element) {\n const uid = getUidEvent(element);\n element.uidEvent = uid;\n eventRegistry[uid] = eventRegistry[uid] || {};\n return eventRegistry[uid];\n }\n\n function bootstrapHandler(element, fn) {\n return function handler(event) {\n event.delegateTarget = element;\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn);\n }\n\n return fn.apply(element, [event]);\n };\n }\n\n function bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector);\n\n for (let {\n target\n } = event; target && target !== this; target = target.parentNode) {\n for (let i = domElements.length; i--;) {\n if (domElements[i] === target) {\n event.delegateTarget = target;\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, selector, fn);\n }\n\n return fn.apply(target, [event]);\n }\n }\n } // To please ESLint\n\n\n return null;\n };\n }\n\n function findHandler(events, handler, delegationSelector = null) {\n const uidEventList = Object.keys(events);\n\n for (let i = 0, len = uidEventList.length; i < len; i++) {\n const event = events[uidEventList[i]];\n\n if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {\n return event;\n }\n }\n\n return null;\n }\n\n function normalizeParams(originalTypeEvent, handler, delegationFn) {\n const delegation = typeof handler === 'string';\n const originalHandler = delegation ? delegationFn : handler;\n let typeEvent = getTypeEvent(originalTypeEvent);\n const isNative = nativeEvents.has(typeEvent);\n\n if (!isNative) {\n typeEvent = originalTypeEvent;\n }\n\n return [delegation, originalHandler, typeEvent];\n }\n\n function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n\n if (!handler) {\n handler = delegationFn;\n delegationFn = null;\n } // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n\n\n if (customEventsRegex.test(originalTypeEvent)) {\n const wrapFn = fn => {\n return function (event) {\n if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {\n return fn.call(this, event);\n }\n };\n };\n\n if (delegationFn) {\n delegationFn = wrapFn(delegationFn);\n } else {\n handler = wrapFn(handler);\n }\n }\n\n const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);\n const events = getEvent(element);\n const handlers = events[typeEvent] || (events[typeEvent] = {});\n const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);\n\n if (previousFn) {\n previousFn.oneOff = previousFn.oneOff && oneOff;\n return;\n }\n\n const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));\n const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);\n fn.delegationSelector = delegation ? handler : null;\n fn.originalHandler = originalHandler;\n fn.oneOff = oneOff;\n fn.uidEvent = uid;\n handlers[uid] = fn;\n element.addEventListener(typeEvent, fn, delegation);\n }\n\n function removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector);\n\n if (!fn) {\n return;\n }\n\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));\n delete events[typeEvent][fn.uidEvent];\n }\n\n function removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {};\n Object.keys(storeElementEvent).forEach(handlerKey => {\n if (handlerKey.includes(namespace)) {\n const event = storeElementEvent[handlerKey];\n removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);\n }\n });\n }\n\n function getTypeEvent(event) {\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n event = event.replace(stripNameRegex, '');\n return customEvents[event] || event;\n }\n\n const EventHandler = {\n on(element, event, handler, delegationFn) {\n addHandler(element, event, handler, delegationFn, false);\n },\n\n one(element, event, handler, delegationFn) {\n addHandler(element, event, handler, delegationFn, true);\n },\n\n off(element, originalTypeEvent, handler, delegationFn) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n\n const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);\n const inNamespace = typeEvent !== originalTypeEvent;\n const events = getEvent(element);\n const isNamespace = originalTypeEvent.startsWith('.');\n\n if (typeof originalHandler !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!events || !events[typeEvent]) {\n return;\n }\n\n removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);\n return;\n }\n\n if (isNamespace) {\n Object.keys(events).forEach(elementEvent => {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));\n });\n }\n\n const storeElementEvent = events[typeEvent] || {};\n Object.keys(storeElementEvent).forEach(keyHandlers => {\n const handlerKey = keyHandlers.replace(stripUidRegex, '');\n\n if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n const event = storeElementEvent[keyHandlers];\n removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);\n }\n });\n },\n\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null;\n }\n\n const $ = getjQuery();\n const typeEvent = getTypeEvent(event);\n const inNamespace = event !== typeEvent;\n const isNative = nativeEvents.has(typeEvent);\n let jQueryEvent;\n let bubbles = true;\n let nativeDispatch = true;\n let defaultPrevented = false;\n let evt = null;\n\n if (inNamespace && $) {\n jQueryEvent = $.Event(event, args);\n $(element).trigger(jQueryEvent);\n bubbles = !jQueryEvent.isPropagationStopped();\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();\n defaultPrevented = jQueryEvent.isDefaultPrevented();\n }\n\n if (isNative) {\n evt = document.createEvent('HTMLEvents');\n evt.initEvent(typeEvent, bubbles, true);\n } else {\n evt = new CustomEvent(event, {\n bubbles,\n cancelable: true\n });\n } // merge custom information in our event\n\n\n if (typeof args !== 'undefined') {\n Object.keys(args).forEach(key => {\n Object.defineProperty(evt, key, {\n get() {\n return args[key];\n }\n\n });\n });\n }\n\n if (defaultPrevented) {\n evt.preventDefault();\n }\n\n if (nativeDispatch) {\n element.dispatchEvent(evt);\n }\n\n if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {\n jQueryEvent.preventDefault();\n }\n\n return evt;\n }\n\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const elementMap = new Map();\n const Data = {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map());\n }\n\n const instanceMap = elementMap.get(element); // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);\n return;\n }\n\n instanceMap.set(key, instance);\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null;\n }\n\n return null;\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return;\n }\n\n const instanceMap = elementMap.get(element);\n instanceMap.delete(key); // free up element references if there are no instances left for an element\n\n if (instanceMap.size === 0) {\n elementMap.delete(element);\n }\n }\n\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const VERSION = '5.1.3';\n\n class BaseComponent {\n constructor(element) {\n element = getElement(element);\n\n if (!element) {\n return;\n }\n\n this._element = element;\n Data.set(this._element, this.constructor.DATA_KEY, this);\n }\n\n dispose() {\n Data.remove(this._element, this.constructor.DATA_KEY);\n EventHandler.off(this._element, this.constructor.EVENT_KEY);\n Object.getOwnPropertyNames(this).forEach(propertyName => {\n this[propertyName] = null;\n });\n }\n\n _queueCallback(callback, element, isAnimated = true) {\n executeAfterTransition(callback, element, isAnimated);\n }\n /** Static */\n\n\n static getInstance(element) {\n return Data.get(getElement(element), this.DATA_KEY);\n }\n\n static getOrCreateInstance(element, config = {}) {\n return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);\n }\n\n static get VERSION() {\n return VERSION;\n }\n\n static get NAME() {\n throw new Error('You have to implement the static method \"NAME\", for each component!');\n }\n\n static get DATA_KEY() {\n return `bs.${this.NAME}`;\n }\n\n static get EVENT_KEY() {\n return `.${this.DATA_KEY}`;\n }\n\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n const enableDismissTrigger = (component, method = 'hide') => {\n const clickEvent = `click.dismiss${component.EVENT_KEY}`;\n const name = component.NAME;\n EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n\n if (isDisabled(this)) {\n return;\n }\n\n const target = getElementFromSelector(this) || this.closest(`.${name}`);\n const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n\n instance[method]();\n });\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$d = 'alert';\n const DATA_KEY$c = 'bs.alert';\n const EVENT_KEY$c = `.${DATA_KEY$c}`;\n const EVENT_CLOSE = `close${EVENT_KEY$c}`;\n const EVENT_CLOSED = `closed${EVENT_KEY$c}`;\n const CLASS_NAME_FADE$5 = 'fade';\n const CLASS_NAME_SHOW$8 = 'show';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Alert extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$d;\n } // Public\n\n\n close() {\n const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);\n\n if (closeEvent.defaultPrevented) {\n return;\n }\n\n this._element.classList.remove(CLASS_NAME_SHOW$8);\n\n const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);\n\n this._queueCallback(() => this._destroyElement(), this._element, isAnimated);\n } // Private\n\n\n _destroyElement() {\n this._element.remove();\n\n EventHandler.trigger(this._element, EVENT_CLOSED);\n this.dispose();\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Alert.getOrCreateInstance(this);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config](this);\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n enableDismissTrigger(Alert, 'close');\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Alert to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Alert);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$c = 'button';\n const DATA_KEY$b = 'bs.button';\n const EVENT_KEY$b = `.${DATA_KEY$b}`;\n const DATA_API_KEY$7 = '.data-api';\n const CLASS_NAME_ACTIVE$3 = 'active';\n const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle=\"button\"]';\n const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Button extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$c;\n } // Public\n\n\n toggle() {\n // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Button.getOrCreateInstance(this);\n\n if (config === 'toggle') {\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {\n event.preventDefault();\n const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);\n const data = Button.getOrCreateInstance(button);\n data.toggle();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Button to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Button);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n }\n\n function normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);\n }\n\n const Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {};\n }\n\n const attributes = {};\n Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {\n let pureKey = key.replace(/^bs/, '');\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);\n attributes[pureKey] = normalizeData(element.dataset[key]);\n });\n return attributes;\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect();\n return {\n top: rect.top + window.pageYOffset,\n left: rect.left + window.pageXOffset\n };\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n };\n }\n\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const NODE_TEXT = 3;\n const SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector));\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector);\n },\n\n children(element, selector) {\n return [].concat(...element.children).filter(child => child.matches(selector));\n },\n\n parents(element, selector) {\n const parents = [];\n let ancestor = element.parentNode;\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (ancestor.matches(selector)) {\n parents.push(ancestor);\n }\n\n ancestor = ancestor.parentNode;\n }\n\n return parents;\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling;\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous];\n }\n\n previous = previous.previousElementSibling;\n }\n\n return [];\n },\n\n next(element, selector) {\n let next = element.nextElementSibling;\n\n while (next) {\n if (next.matches(selector)) {\n return [next];\n }\n\n next = next.nextElementSibling;\n }\n\n return [];\n },\n\n focusableChildren(element) {\n const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable=\"true\"]'].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(', ');\n return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));\n }\n\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$b = 'carousel';\n const DATA_KEY$a = 'bs.carousel';\n const EVENT_KEY$a = `.${DATA_KEY$a}`;\n const DATA_API_KEY$6 = '.data-api';\n const ARROW_LEFT_KEY = 'ArrowLeft';\n const ARROW_RIGHT_KEY = 'ArrowRight';\n const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n const SWIPE_THRESHOLD = 40;\n const Default$a = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true,\n touch: true\n };\n const DefaultType$a = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean',\n touch: 'boolean'\n };\n const ORDER_NEXT = 'next';\n const ORDER_PREV = 'prev';\n const DIRECTION_LEFT = 'left';\n const DIRECTION_RIGHT = 'right';\n const KEY_TO_DIRECTION = {\n [ARROW_LEFT_KEY]: DIRECTION_RIGHT,\n [ARROW_RIGHT_KEY]: DIRECTION_LEFT\n };\n const EVENT_SLIDE = `slide${EVENT_KEY$a}`;\n const EVENT_SLID = `slid${EVENT_KEY$a}`;\n const EVENT_KEYDOWN = `keydown${EVENT_KEY$a}`;\n const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$a}`;\n const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$a}`;\n const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$a}`;\n const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$a}`;\n const EVENT_TOUCHEND = `touchend${EVENT_KEY$a}`;\n const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$a}`;\n const EVENT_POINTERUP = `pointerup${EVENT_KEY$a}`;\n const EVENT_DRAG_START = `dragstart${EVENT_KEY$a}`;\n const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$a}${DATA_API_KEY$6}`;\n const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;\n const CLASS_NAME_CAROUSEL = 'carousel';\n const CLASS_NAME_ACTIVE$2 = 'active';\n const CLASS_NAME_SLIDE = 'slide';\n const CLASS_NAME_END = 'carousel-item-end';\n const CLASS_NAME_START = 'carousel-item-start';\n const CLASS_NAME_NEXT = 'carousel-item-next';\n const CLASS_NAME_PREV = 'carousel-item-prev';\n const CLASS_NAME_POINTER_EVENT = 'pointer-event';\n const SELECTOR_ACTIVE$1 = '.active';\n const SELECTOR_ACTIVE_ITEM = '.active.carousel-item';\n const SELECTOR_ITEM = '.carousel-item';\n const SELECTOR_ITEM_IMG = '.carousel-item img';\n const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';\n const SELECTOR_INDICATORS = '.carousel-indicators';\n const SELECTOR_INDICATOR = '[data-bs-target]';\n const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';\n const SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]';\n const POINTER_TYPE_TOUCH = 'touch';\n const POINTER_TYPE_PEN = 'pen';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Carousel extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this.touchStartX = 0;\n this.touchDeltaX = 0;\n this._config = this._getConfig(config);\n this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n this._pointerEvent = Boolean(window.PointerEvent);\n\n this._addEventListeners();\n } // Getters\n\n\n static get Default() {\n return Default$a;\n }\n\n static get NAME() {\n return NAME$b;\n } // Public\n\n\n next() {\n this._slide(ORDER_NEXT);\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && isVisible(this._element)) {\n this.next();\n }\n }\n\n prev() {\n this._slide(ORDER_PREV);\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {\n triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config && this._config.interval && !this._isPaused) {\n this._updateInterval();\n\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n }\n\n to(index) {\n this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n\n const activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.to(index));\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;\n\n this._slide(order, this._items[index]);\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default$a,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n };\n typeCheckConfig(NAME$b, config, DefaultType$a);\n return config;\n }\n\n _handleSwipe() {\n const absDeltax = Math.abs(this.touchDeltaX);\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return;\n }\n\n const direction = absDeltax / this.touchDeltaX;\n this.touchDeltaX = 0;\n\n if (!direction) {\n return;\n }\n\n this._slide(direction > 0 ? DIRECTION_RIGHT : DIRECTION_LEFT);\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));\n }\n\n if (this._config.pause === 'hover') {\n EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event));\n EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event));\n }\n\n if (this._config.touch && this._touchSupported) {\n this._addTouchEventListeners();\n }\n }\n\n _addTouchEventListeners() {\n const hasPointerPenTouch = event => {\n return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);\n };\n\n const start = event => {\n if (hasPointerPenTouch(event)) {\n this.touchStartX = event.clientX;\n } else if (!this._pointerEvent) {\n this.touchStartX = event.touches[0].clientX;\n }\n };\n\n const move = event => {\n // ensure swiping with one touch and not pinching\n this.touchDeltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this.touchStartX;\n };\n\n const end = event => {\n if (hasPointerPenTouch(event)) {\n this.touchDeltaX = event.clientX - this.touchStartX;\n }\n\n this._handleSwipe();\n\n if (this._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n this.pause();\n\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout);\n }\n\n this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval);\n }\n };\n\n SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {\n EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());\n });\n\n if (this._pointerEvent) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event));\n EventHandler.on(this._element, EVENT_POINTERUP, event => end(event));\n\n this._element.classList.add(CLASS_NAME_POINTER_EVENT);\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, event => start(event));\n EventHandler.on(this._element, EVENT_TOUCHMOVE, event => move(event));\n EventHandler.on(this._element, EVENT_TOUCHEND, event => end(event));\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n const direction = KEY_TO_DIRECTION[event.key];\n\n if (direction) {\n event.preventDefault();\n\n this._slide(direction);\n }\n }\n\n _getItemIndex(element) {\n this._items = element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : [];\n return this._items.indexOf(element);\n }\n\n _getItemByOrder(order, activeElement) {\n const isNext = order === ORDER_NEXT;\n return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap);\n }\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget);\n\n const fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element));\n\n return EventHandler.trigger(this._element, EVENT_SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement);\n activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);\n activeIndicator.removeAttribute('aria-current');\n const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement);\n\n for (let i = 0; i < indicators.length; i++) {\n if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {\n indicators[i].classList.add(CLASS_NAME_ACTIVE$2);\n indicators[i].setAttribute('aria-current', 'true');\n break;\n }\n }\n }\n }\n\n _updateInterval() {\n const element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n\n if (!element) {\n return;\n }\n\n const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);\n\n if (elementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval;\n this._config.interval = elementInterval;\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval;\n }\n }\n\n _slide(directionOrOrder, element) {\n const order = this._directionToOrder(directionOrOrder);\n\n const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n\n const activeElementIndex = this._getItemIndex(activeElement);\n\n const nextElement = element || this._getItemByOrder(order, activeElement);\n\n const nextElementIndex = this._getItemIndex(nextElement);\n\n const isCycling = Boolean(this._interval);\n const isNext = order === ORDER_NEXT;\n const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;\n const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;\n\n const eventDirectionName = this._orderToDirection(order);\n\n if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE$2)) {\n this._isSliding = false;\n return;\n }\n\n if (this._isSliding) {\n return;\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.defaultPrevented) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n this._activeElement = nextElement;\n\n const triggerSlidEvent = () => {\n EventHandler.trigger(this._element, EVENT_SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n };\n\n if (this._element.classList.contains(CLASS_NAME_SLIDE)) {\n nextElement.classList.add(orderClassName);\n reflow(nextElement);\n activeElement.classList.add(directionalClassName);\n nextElement.classList.add(directionalClassName);\n\n const completeCallBack = () => {\n nextElement.classList.remove(directionalClassName, orderClassName);\n nextElement.classList.add(CLASS_NAME_ACTIVE$2);\n activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);\n this._isSliding = false;\n setTimeout(triggerSlidEvent, 0);\n };\n\n this._queueCallback(completeCallBack, activeElement, true);\n } else {\n activeElement.classList.remove(CLASS_NAME_ACTIVE$2);\n nextElement.classList.add(CLASS_NAME_ACTIVE$2);\n this._isSliding = false;\n triggerSlidEvent();\n }\n\n if (isCycling) {\n this.cycle();\n }\n }\n\n _directionToOrder(direction) {\n if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) {\n return direction;\n }\n\n if (isRTL()) {\n return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;\n }\n\n return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;\n }\n\n _orderToDirection(order) {\n if (![ORDER_NEXT, ORDER_PREV].includes(order)) {\n return order;\n }\n\n if (isRTL()) {\n return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n\n return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;\n } // Static\n\n\n static carouselInterface(element, config) {\n const data = Carousel.getOrCreateInstance(element, config);\n let {\n _config\n } = data;\n\n if (typeof config === 'object') {\n _config = { ..._config,\n ...config\n };\n }\n\n const action = typeof config === 'string' ? config : _config.slide;\n\n if (typeof config === 'number') {\n data.to(config);\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(`No method named \"${action}\"`);\n }\n\n data[action]();\n } else if (_config.interval && _config.ride) {\n data.pause();\n data.cycle();\n }\n }\n\n static jQueryInterface(config) {\n return this.each(function () {\n Carousel.carouselInterface(this, config);\n });\n }\n\n static dataApiClickHandler(event) {\n const target = getElementFromSelector(this);\n\n if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n return;\n }\n\n const config = { ...Manipulator.getDataAttributes(target),\n ...Manipulator.getDataAttributes(this)\n };\n const slideIndex = this.getAttribute('data-bs-slide-to');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel.carouselInterface(target, config);\n\n if (slideIndex) {\n Carousel.getInstance(target).to(slideIndex);\n }\n\n event.preventDefault();\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler);\n EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {\n const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);\n\n for (let i = 0, len = carousels.length; i < len; i++) {\n Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]));\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Carousel to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Carousel);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$a = 'collapse';\n const DATA_KEY$9 = 'bs.collapse';\n const EVENT_KEY$9 = `.${DATA_KEY$9}`;\n const DATA_API_KEY$5 = '.data-api';\n const Default$9 = {\n toggle: true,\n parent: null\n };\n const DefaultType$9 = {\n toggle: 'boolean',\n parent: '(null|element)'\n };\n const EVENT_SHOW$5 = `show${EVENT_KEY$9}`;\n const EVENT_SHOWN$5 = `shown${EVENT_KEY$9}`;\n const EVENT_HIDE$5 = `hide${EVENT_KEY$9}`;\n const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$9}`;\n const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`;\n const CLASS_NAME_SHOW$7 = 'show';\n const CLASS_NAME_COLLAPSE = 'collapse';\n const CLASS_NAME_COLLAPSING = 'collapsing';\n const CLASS_NAME_COLLAPSED = 'collapsed';\n const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;\n const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';\n const WIDTH = 'width';\n const HEIGHT = 'height';\n const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';\n const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle=\"collapse\"]';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._isTransitioning = false;\n this._config = this._getConfig(config);\n this._triggerArray = [];\n const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);\n\n for (let i = 0, len = toggleList.length; i < len; i++) {\n const elem = toggleList[i];\n const selector = getSelectorFromElement(elem);\n const filterElement = SelectorEngine.find(selector).filter(foundElem => foundElem === this._element);\n\n if (selector !== null && filterElement.length) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._initializeChildren();\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n static get Default() {\n return Default$9;\n }\n\n static get NAME() {\n return NAME$a;\n } // Public\n\n\n toggle() {\n if (this._isShown()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n show() {\n if (this._isTransitioning || this._isShown()) {\n return;\n }\n\n let actives = [];\n let activesData;\n\n if (this._config.parent) {\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);\n actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth\n }\n\n const container = SelectorEngine.findOne(this._selector);\n\n if (actives.length) {\n const tempActiveData = actives.find(elem => container !== elem);\n activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$5);\n\n if (startEvent.defaultPrevented) {\n return;\n }\n\n actives.forEach(elemActive => {\n if (container !== elemActive) {\n Collapse.getOrCreateInstance(elemActive, {\n toggle: false\n }).hide();\n }\n\n if (!activesData) {\n Data.set(elemActive, DATA_KEY$9, null);\n }\n });\n\n const dimension = this._getDimension();\n\n this._element.classList.remove(CLASS_NAME_COLLAPSE);\n\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n\n this._element.style[dimension] = 0;\n\n this._addAriaAndCollapsedClass(this._triggerArray, true);\n\n this._isTransitioning = true;\n\n const complete = () => {\n this._isTransitioning = false;\n\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n\n this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n\n this._element.style[dimension] = '';\n EventHandler.trigger(this._element, EVENT_SHOWN$5);\n };\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n const scrollSize = `scroll${capitalizedDimension}`;\n\n this._queueCallback(complete, this._element, true);\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`;\n }\n\n hide() {\n if (this._isTransitioning || !this._isShown()) {\n return;\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$5);\n\n if (startEvent.defaultPrevented) {\n return;\n }\n\n const dimension = this._getDimension();\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;\n reflow(this._element);\n\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n\n this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n\n const triggerArrayLength = this._triggerArray.length;\n\n for (let i = 0; i < triggerArrayLength; i++) {\n const trigger = this._triggerArray[i];\n const elem = getElementFromSelector(trigger);\n\n if (elem && !this._isShown(elem)) {\n this._addAriaAndCollapsedClass([trigger], false);\n }\n }\n\n this._isTransitioning = true;\n\n const complete = () => {\n this._isTransitioning = false;\n\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n\n this._element.classList.add(CLASS_NAME_COLLAPSE);\n\n EventHandler.trigger(this._element, EVENT_HIDDEN$5);\n };\n\n this._element.style[dimension] = '';\n\n this._queueCallback(complete, this._element, true);\n }\n\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW$7);\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default$9,\n ...Manipulator.getDataAttributes(this._element),\n ...config\n };\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n config.parent = getElement(config.parent);\n typeCheckConfig(NAME$a, config, DefaultType$9);\n return config;\n }\n\n _getDimension() {\n return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;\n }\n\n _initializeChildren() {\n if (!this._config.parent) {\n return;\n }\n\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);\n SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {\n const selected = getElementFromSelector(element);\n\n if (selected) {\n this._addAriaAndCollapsedClass([element], this._isShown(selected));\n }\n });\n }\n\n _addAriaAndCollapsedClass(triggerArray, isOpen) {\n if (!triggerArray.length) {\n return;\n }\n\n triggerArray.forEach(elem => {\n if (isOpen) {\n elem.classList.remove(CLASS_NAME_COLLAPSED);\n } else {\n elem.classList.add(CLASS_NAME_COLLAPSED);\n }\n\n elem.setAttribute('aria-expanded', isOpen);\n });\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const _config = {};\n\n if (typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n const data = Collapse.getOrCreateInstance(this, _config);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {\n event.preventDefault();\n }\n\n const selector = getSelectorFromElement(this);\n const selectorElements = SelectorEngine.find(selector);\n selectorElements.forEach(element => {\n Collapse.getOrCreateInstance(element, {\n toggle: false\n }).toggle();\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Collapse to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Collapse);\n\n var top = 'top';\n var bottom = 'bottom';\n var right = 'right';\n var left = 'left';\n var auto = 'auto';\n var basePlacements = [top, bottom, right, left];\n var start = 'start';\n var end = 'end';\n var clippingParents = 'clippingParents';\n var viewport = 'viewport';\n var popper = 'popper';\n var reference = 'reference';\n var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n }, []);\n 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\n var beforeRead = 'beforeRead';\n var read = 'read';\n var afterRead = 'afterRead'; // pure-logic modifiers\n\n var beforeMain = 'beforeMain';\n var main = 'main';\n var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\n var beforeWrite = 'beforeWrite';\n var write = 'write';\n var afterWrite = 'afterWrite';\n var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];\n\n function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n }\n\n function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n }\n\n function isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n }\n\n function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n }\n\n function isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n }\n\n // and applies them to the HTMLElements such as popper and arrow\n\n function 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\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }\n\n function effect$2(_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\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\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\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\n\n const applyStyles$1 = {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect$2,\n requires: ['computeStyles']\n };\n\n function getBasePlacement(placement) {\n return placement.split('-')[0];\n }\n\n // import { isHTMLElement } from './instanceOf';\n function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars\n includeScale) {\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 }\n\n // means it doesn't take into account transforms.\n\n 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\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n }\n\n 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\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n }\n\n function getComputedStyle$1(element) {\n return getWindow(element).getComputedStyle(element);\n }\n\n function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n }\n\n function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n }\n\n function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// 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 || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n }\n\n function getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n } // `.offsetParent` reports `null` for fixed elements, while absolute elements\n // return the containing block\n\n\n function getContainingBlock(element) {\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n var isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\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$1(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle$1(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\n return null;\n } // Gets the closest ancestor positioned element. Handles some edge cases,\n // such as table ancestors and cross browser bugs.\n\n\n function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n }\n\n function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n }\n\n var max = Math.max;\n var min = Math.min;\n var round = Math.round;\n\n function within(min$1, value, max$1) {\n return max(min$1, min(value, max$1));\n }\n\n function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n }\n\n function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n }\n\n function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n }\n\n var 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 };\n\n function arrow(_ref) {\n var _state$modifiersData$;\n\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\n if (!arrowElement || !popperOffsets) {\n return;\n }\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 }\n\n function effect$1(_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\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n } // eslint-disable-next-line import/no-unused-modules\n\n\n const arrow$1 = {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect$1,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n };\n\n function getVariation(placement) {\n return placement.split('-')[1];\n }\n\n var 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\n function 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 }\n\n function mapToStyles(_ref2) {\n var _Object$assign2;\n\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\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\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\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle$1(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\n offsetParent = offsetParent;\n\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\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\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n if (gpuAcceleration) {\n var _Object$assign;\n\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\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 }\n\n function 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\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\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\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\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\n\n const computeStyles$1 = {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n };\n\n var passive = {\n passive: true\n };\n\n function 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\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n } // eslint-disable-next-line import/no-unused-modules\n\n\n const eventListeners = {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n };\n\n var hash$1 = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n };\n function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash$1[matched];\n });\n }\n\n var hash = {\n start: 'end',\n end: 'start'\n };\n function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n }\n\n 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 }\n\n function getWindowScrollBarX(element) {\n // If <html> 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 <html>\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 }\n\n 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\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n }\n\n // of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\n function getDocumentRect(element) {\n var _element$ownerDocumen;\n\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\n if (getComputedStyle$1(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n }\n\n function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle$1(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n }\n\n 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\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n }\n\n /*\n given a DOM element, return the list of all scroll parents, up the list of ancesors\n until we get to the top window object. This list is what we attach scroll listeners\n to, because if any of these parent elements scroll, we'll need to re-calculate the\n reference element's position.\n */\n\n function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\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 : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n }\n\n 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 }\n\n function 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 }\n\n function 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\n\n function getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\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\n\n 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 }\n\n 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\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n }\n }\n\n return offsets;\n }\n\n function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\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\n return overflowOffsets;\n }\n\n function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\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 ? placements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements$1.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements$1;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\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 }\n\n function getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n }\n\n function flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\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\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\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\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\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\n\n const flip$1 = {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n };\n\n function getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\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 }\n\n function isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n }\n\n function 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\n\n const hide$1 = {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n };\n\n function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\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 }\n\n function 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\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n } // eslint-disable-next-line import/no-unused-modules\n\n\n const offset$1 = {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n };\n\n function 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\n\n const popperOffsets$1 = {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n };\n\n function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n }\n\n function 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\n if (!popperOffsets) {\n return;\n }\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$1 = popperOffsets[mainAxis] + overflow[mainSide];\n var max$1 = 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\n if (checkMainAxis) {\n var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n }\n\n state.modifiersData[name] = data;\n } // eslint-disable-next-line import/no-unused-modules\n\n\n const preventOverflow$1 = {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n };\n\n function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n\n function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n }\n\n function 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\n\n function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\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 }\n\n function 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\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\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 }\n\n 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 }\n\n 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\n return pending;\n };\n }\n\n 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 }\n\n var DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n };\n\n function areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n }\n\n function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\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\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\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\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\n return;\n } // Store the reference and popper rects to be read by modifiers\n\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\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\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\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\n if (!areValidElements(reference, popper)) {\n\n return instance;\n }\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\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n }\n var createPopper$2 = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\n var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];\n var createPopper$1 = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers$1\n }); // eslint-disable-next-line import/no-unused-modules\n\n var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];\n var createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n }); // eslint-disable-next-line import/no-unused-modules\n\n const Popper = /*#__PURE__*/Object.freeze({\n __proto__: null,\n popperGenerator,\n detectOverflow,\n createPopperBase: createPopper$2,\n createPopper,\n createPopperLite: createPopper$1,\n top,\n bottom,\n right,\n left,\n auto,\n basePlacements,\n start,\n end,\n clippingParents,\n viewport,\n popper,\n reference,\n variationPlacements,\n placements,\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n modifierPhases,\n applyStyles: applyStyles$1,\n arrow: arrow$1,\n computeStyles: computeStyles$1,\n eventListeners,\n flip: flip$1,\n hide: hide$1,\n offset: offset$1,\n popperOffsets: popperOffsets$1,\n preventOverflow: preventOverflow$1\n });\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$9 = 'dropdown';\n const DATA_KEY$8 = 'bs.dropdown';\n const EVENT_KEY$8 = `.${DATA_KEY$8}`;\n const DATA_API_KEY$4 = '.data-api';\n const ESCAPE_KEY$2 = 'Escape';\n const SPACE_KEY = 'Space';\n const TAB_KEY$1 = 'Tab';\n const ARROW_UP_KEY = 'ArrowUp';\n const ARROW_DOWN_KEY = 'ArrowDown';\n const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button\n\n const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);\n const EVENT_HIDE$4 = `hide${EVENT_KEY$8}`;\n const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;\n const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;\n const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;\n const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$8}${DATA_API_KEY$4}`;\n const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$8}${DATA_API_KEY$4}`;\n const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$8}${DATA_API_KEY$4}`;\n const CLASS_NAME_SHOW$6 = 'show';\n const CLASS_NAME_DROPUP = 'dropup';\n const CLASS_NAME_DROPEND = 'dropend';\n const CLASS_NAME_DROPSTART = 'dropstart';\n const CLASS_NAME_NAVBAR = 'navbar';\n const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle=\"dropdown\"]';\n const SELECTOR_MENU = '.dropdown-menu';\n const SELECTOR_NAVBAR_NAV = '.navbar-nav';\n const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';\n const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';\n const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';\n const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';\n const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';\n const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';\n const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';\n const Default$8 = {\n offset: [0, 2],\n boundary: 'clippingParents',\n reference: 'toggle',\n display: 'dynamic',\n popperConfig: null,\n autoClose: true\n };\n const DefaultType$8 = {\n offset: '(array|string|function)',\n boundary: '(string|element)',\n reference: '(string|element|object)',\n display: 'string',\n popperConfig: '(null|object|function)',\n autoClose: '(boolean|string)'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Dropdown extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n } // Getters\n\n\n static get Default() {\n return Default$8;\n }\n\n static get DefaultType() {\n return DefaultType$8;\n }\n\n static get NAME() {\n return NAME$9;\n } // Public\n\n\n toggle() {\n return this._isShown() ? this.hide() : this.show();\n }\n\n show() {\n if (isDisabled(this._element) || this._isShown(this._menu)) {\n return;\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n };\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, relatedTarget);\n\n if (showEvent.defaultPrevented) {\n return;\n }\n\n const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar\n\n if (this._inNavbar) {\n Manipulator.setDataAttribute(this._menu, 'popper', 'none');\n } else {\n this._createPopper(parent);\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) {\n [].concat(...document.body.children).forEach(elem => EventHandler.on(elem, 'mouseover', noop));\n }\n\n this._element.focus();\n\n this._element.setAttribute('aria-expanded', true);\n\n this._menu.classList.add(CLASS_NAME_SHOW$6);\n\n this._element.classList.add(CLASS_NAME_SHOW$6);\n\n EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget);\n }\n\n hide() {\n if (isDisabled(this._element) || !this._isShown(this._menu)) {\n return;\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n };\n\n this._completeHide(relatedTarget);\n }\n\n dispose() {\n if (this._popper) {\n this._popper.destroy();\n }\n\n super.dispose();\n }\n\n update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper) {\n this._popper.update();\n }\n } // Private\n\n\n _completeHide(relatedTarget) {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);\n\n if (hideEvent.defaultPrevented) {\n return;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children).forEach(elem => EventHandler.off(elem, 'mouseover', noop));\n }\n\n if (this._popper) {\n this._popper.destroy();\n }\n\n this._menu.classList.remove(CLASS_NAME_SHOW$6);\n\n this._element.classList.remove(CLASS_NAME_SHOW$6);\n\n this._element.setAttribute('aria-expanded', 'false');\n\n Manipulator.removeDataAttribute(this._menu, 'popper');\n EventHandler.trigger(this._element, EVENT_HIDDEN$4, relatedTarget);\n }\n\n _getConfig(config) {\n config = { ...this.constructor.Default,\n ...Manipulator.getDataAttributes(this._element),\n ...config\n };\n typeCheckConfig(NAME$9, config, this.constructor.DefaultType);\n\n if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {\n // Popper virtual elements require a getBoundingClientRect method\n throw new TypeError(`${NAME$9.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`);\n }\n\n return config;\n }\n\n _createPopper(parent) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)');\n }\n\n let referenceElement = this._element;\n\n if (this._config.reference === 'parent') {\n referenceElement = parent;\n } else if (isElement$1(this._config.reference)) {\n referenceElement = getElement(this._config.reference);\n } else if (typeof this._config.reference === 'object') {\n referenceElement = this._config.reference;\n }\n\n const popperConfig = this._getPopperConfig();\n\n const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);\n this._popper = createPopper(referenceElement, this._menu, popperConfig);\n\n if (isDisplayStatic) {\n Manipulator.setDataAttribute(this._menu, 'popper', 'static');\n }\n }\n\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW$6);\n }\n\n _getMenuElement() {\n return SelectorEngine.next(this._element, SELECTOR_MENU)[0];\n }\n\n _getPlacement() {\n const parentDropdown = this._element.parentNode;\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n return PLACEMENT_RIGHT;\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n return PLACEMENT_LEFT;\n } // We need to trim the value because custom properties can also include spaces\n\n\n const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;\n }\n\n return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;\n }\n\n _detectNavbar() {\n return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null;\n }\n\n _getOffset() {\n const {\n offset\n } = this._config;\n\n if (typeof offset === 'string') {\n return offset.split(',').map(val => Number.parseInt(val, 10));\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n\n return offset;\n }\n\n _getPopperConfig() {\n const defaultBsPopperConfig = {\n placement: this._getPlacement(),\n modifiers: [{\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }]\n }; // Disable Popper if we have a static display\n\n if (this._config.display === 'static') {\n defaultBsPopperConfig.modifiers = [{\n name: 'applyStyles',\n enabled: false\n }];\n }\n\n return { ...defaultBsPopperConfig,\n ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)\n };\n }\n\n _selectMenuItem({\n key,\n target\n }) {\n const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible);\n\n if (!items.length) {\n return;\n } // if target isn't included in items (e.g. when expanding the dropdown)\n // allow cycling to get the last item in case key equals ARROW_UP_KEY\n\n\n getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Dropdown.getOrCreateInstance(this, config);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n });\n }\n\n static clearMenus(event) {\n if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {\n return;\n }\n\n const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$3);\n\n for (let i = 0, len = toggles.length; i < len; i++) {\n const context = Dropdown.getInstance(toggles[i]);\n\n if (!context || context._config.autoClose === false) {\n continue;\n }\n\n if (!context._isShown()) {\n continue;\n }\n\n const relatedTarget = {\n relatedTarget: context._element\n };\n\n if (event) {\n const composedPath = event.composedPath();\n const isMenuTarget = composedPath.includes(context._menu);\n\n if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {\n continue;\n } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n\n\n if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n continue;\n }\n\n if (event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n }\n\n context._completeHide(relatedTarget);\n }\n }\n\n static getParentFromElement(element) {\n return getElementFromSelector(element) || element.parentNode;\n }\n\n static dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.key === SPACE_KEY || event.key !== ESCAPE_KEY$2 && (event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY || event.target.closest(SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.key)) {\n return;\n }\n\n const isActive = this.classList.contains(CLASS_NAME_SHOW$6);\n\n if (!isActive && event.key === ESCAPE_KEY$2) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (isDisabled(this)) {\n return;\n }\n\n const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];\n const instance = Dropdown.getOrCreateInstance(getToggleButton);\n\n if (event.key === ESCAPE_KEY$2) {\n instance.hide();\n return;\n }\n\n if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {\n if (!isActive) {\n instance.show();\n }\n\n instance._selectMenuItem(event);\n\n return;\n }\n\n if (!isActive || event.key === SPACE_KEY) {\n Dropdown.clearMenus();\n }\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler);\n EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);\n EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus);\n EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);\n EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {\n event.preventDefault();\n Dropdown.getOrCreateInstance(this).toggle();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Dropdown to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Dropdown);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';\n const SELECTOR_STICKY_CONTENT = '.sticky-top';\n\n class ScrollBarHelper {\n constructor() {\n this._element = document.body;\n }\n\n getWidth() {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = document.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n }\n\n hide() {\n const width = this.getWidth();\n\n this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width\n\n\n this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n\n\n this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);\n\n this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);\n }\n\n _disableOverFlow() {\n this._saveInitialAttribute(this._element, 'overflow');\n\n this._element.style.overflow = 'hidden';\n }\n\n _setElementAttributes(selector, styleProp, callback) {\n const scrollbarWidth = this.getWidth();\n\n const manipulationCallBack = element => {\n if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n return;\n }\n\n this._saveInitialAttribute(element, styleProp);\n\n const calculatedValue = window.getComputedStyle(element)[styleProp];\n element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;\n };\n\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n\n reset() {\n this._resetElementAttributes(this._element, 'overflow');\n\n this._resetElementAttributes(this._element, 'paddingRight');\n\n this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');\n\n this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');\n }\n\n _saveInitialAttribute(element, styleProp) {\n const actualValue = element.style[styleProp];\n\n if (actualValue) {\n Manipulator.setDataAttribute(element, styleProp, actualValue);\n }\n }\n\n _resetElementAttributes(selector, styleProp) {\n const manipulationCallBack = element => {\n const value = Manipulator.getDataAttribute(element, styleProp);\n\n if (typeof value === 'undefined') {\n element.style.removeProperty(styleProp);\n } else {\n Manipulator.removeDataAttribute(element, styleProp);\n element.style[styleProp] = value;\n }\n };\n\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n\n _applyManipulationCallback(selector, callBack) {\n if (isElement$1(selector)) {\n callBack(selector);\n } else {\n SelectorEngine.find(selector, this._element).forEach(callBack);\n }\n }\n\n isOverflowing() {\n return this.getWidth() > 0;\n }\n\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const Default$7 = {\n className: 'modal-backdrop',\n isVisible: true,\n // if false, we use the backdrop helper without adding any element to the dom\n isAnimated: false,\n rootElement: 'body',\n // give the choice to place backdrop under different elements\n clickCallback: null\n };\n const DefaultType$7 = {\n className: 'string',\n isVisible: 'boolean',\n isAnimated: 'boolean',\n rootElement: '(element|string)',\n clickCallback: '(function|null)'\n };\n const NAME$8 = 'backdrop';\n const CLASS_NAME_FADE$4 = 'fade';\n const CLASS_NAME_SHOW$5 = 'show';\n const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$8}`;\n\n class Backdrop {\n constructor(config) {\n this._config = this._getConfig(config);\n this._isAppended = false;\n this._element = null;\n }\n\n show(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n\n this._append();\n\n if (this._config.isAnimated) {\n reflow(this._getElement());\n }\n\n this._getElement().classList.add(CLASS_NAME_SHOW$5);\n\n this._emulateAnimation(() => {\n execute(callback);\n });\n }\n\n hide(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n\n this._getElement().classList.remove(CLASS_NAME_SHOW$5);\n\n this._emulateAnimation(() => {\n this.dispose();\n execute(callback);\n });\n } // Private\n\n\n _getElement() {\n if (!this._element) {\n const backdrop = document.createElement('div');\n backdrop.className = this._config.className;\n\n if (this._config.isAnimated) {\n backdrop.classList.add(CLASS_NAME_FADE$4);\n }\n\n this._element = backdrop;\n }\n\n return this._element;\n }\n\n _getConfig(config) {\n config = { ...Default$7,\n ...(typeof config === 'object' ? config : {})\n }; // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n\n config.rootElement = getElement(config.rootElement);\n typeCheckConfig(NAME$8, config, DefaultType$7);\n return config;\n }\n\n _append() {\n if (this._isAppended) {\n return;\n }\n\n this._config.rootElement.append(this._getElement());\n\n EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {\n execute(this._config.clickCallback);\n });\n this._isAppended = true;\n }\n\n dispose() {\n if (!this._isAppended) {\n return;\n }\n\n EventHandler.off(this._element, EVENT_MOUSEDOWN);\n\n this._element.remove();\n\n this._isAppended = false;\n }\n\n _emulateAnimation(callback) {\n executeAfterTransition(callback, this._getElement(), this._config.isAnimated);\n }\n\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const Default$6 = {\n trapElement: null,\n // The element to trap focus inside of\n autofocus: true\n };\n const DefaultType$6 = {\n trapElement: 'element',\n autofocus: 'boolean'\n };\n const NAME$7 = 'focustrap';\n const DATA_KEY$7 = 'bs.focustrap';\n const EVENT_KEY$7 = `.${DATA_KEY$7}`;\n const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$7}`;\n const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$7}`;\n const TAB_KEY = 'Tab';\n const TAB_NAV_FORWARD = 'forward';\n const TAB_NAV_BACKWARD = 'backward';\n\n class FocusTrap {\n constructor(config) {\n this._config = this._getConfig(config);\n this._isActive = false;\n this._lastTabNavDirection = null;\n }\n\n activate() {\n const {\n trapElement,\n autofocus\n } = this._config;\n\n if (this._isActive) {\n return;\n }\n\n if (autofocus) {\n trapElement.focus();\n }\n\n EventHandler.off(document, EVENT_KEY$7); // guard against infinite focus loop\n\n EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));\n EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));\n this._isActive = true;\n }\n\n deactivate() {\n if (!this._isActive) {\n return;\n }\n\n this._isActive = false;\n EventHandler.off(document, EVENT_KEY$7);\n } // Private\n\n\n _handleFocusin(event) {\n const {\n target\n } = event;\n const {\n trapElement\n } = this._config;\n\n if (target === document || target === trapElement || trapElement.contains(target)) {\n return;\n }\n\n const elements = SelectorEngine.focusableChildren(trapElement);\n\n if (elements.length === 0) {\n trapElement.focus();\n } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n elements[elements.length - 1].focus();\n } else {\n elements[0].focus();\n }\n }\n\n _handleKeydown(event) {\n if (event.key !== TAB_KEY) {\n return;\n }\n\n this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;\n }\n\n _getConfig(config) {\n config = { ...Default$6,\n ...(typeof config === 'object' ? config : {})\n };\n typeCheckConfig(NAME$7, config, DefaultType$6);\n return config;\n }\n\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$6 = 'modal';\n const DATA_KEY$6 = 'bs.modal';\n const EVENT_KEY$6 = `.${DATA_KEY$6}`;\n const DATA_API_KEY$3 = '.data-api';\n const ESCAPE_KEY$1 = 'Escape';\n const Default$5 = {\n backdrop: true,\n keyboard: true,\n focus: true\n };\n const DefaultType$5 = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean'\n };\n const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;\n const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$6}`;\n const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;\n const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;\n const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;\n const EVENT_RESIZE = `resize${EVENT_KEY$6}`;\n const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$6}`;\n const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;\n const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`;\n const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;\n const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;\n const CLASS_NAME_OPEN = 'modal-open';\n const CLASS_NAME_FADE$3 = 'fade';\n const CLASS_NAME_SHOW$4 = 'show';\n const CLASS_NAME_STATIC = 'modal-static';\n const OPEN_SELECTOR$1 = '.modal.show';\n const SELECTOR_DIALOG = '.modal-dialog';\n const SELECTOR_MODAL_BODY = '.modal-body';\n const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle=\"modal\"]';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Modal extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._config = this._getConfig(config);\n this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n this._isShown = false;\n this._ignoreBackdropClick = false;\n this._isTransitioning = false;\n this._scrollBar = new ScrollBarHelper();\n } // Getters\n\n\n static get Default() {\n return Default$5;\n }\n\n static get NAME() {\n return NAME$6;\n } // Public\n\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return;\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {\n relatedTarget\n });\n\n if (showEvent.defaultPrevented) {\n return;\n }\n\n this._isShown = true;\n\n if (this._isAnimated()) {\n this._isTransitioning = true;\n }\n\n this._scrollBar.hide();\n\n document.body.classList.add(CLASS_NAME_OPEN);\n\n this._adjustDialog();\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {\n EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {\n if (event.target === this._element) {\n this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(() => this._showElement(relatedTarget));\n }\n\n hide() {\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n this._isShown = false;\n\n const isAnimated = this._isAnimated();\n\n if (isAnimated) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n this._focustrap.deactivate();\n\n this._element.classList.remove(CLASS_NAME_SHOW$4);\n\n EventHandler.off(this._element, EVENT_CLICK_DISMISS);\n EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);\n\n this._queueCallback(() => this._hideModal(), this._element, isAnimated);\n }\n\n dispose() {\n [window, this._dialog].forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY$6));\n\n this._backdrop.dispose();\n\n this._focustrap.deactivate();\n\n super.dispose();\n }\n\n handleUpdate() {\n this._adjustDialog();\n } // Private\n\n\n _initializeBackDrop() {\n return new Backdrop({\n isVisible: Boolean(this._config.backdrop),\n // 'static' option will be translated to true, and booleans will keep their value\n isAnimated: this._isAnimated()\n });\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n\n _getConfig(config) {\n config = { ...Default$5,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n };\n typeCheckConfig(NAME$6, config, DefaultType$5);\n return config;\n }\n\n _showElement(relatedTarget) {\n const isAnimated = this._isAnimated();\n\n const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.append(this._element);\n }\n\n this._element.style.display = 'block';\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.setAttribute('aria-modal', true);\n\n this._element.setAttribute('role', 'dialog');\n\n this._element.scrollTop = 0;\n\n if (modalBody) {\n modalBody.scrollTop = 0;\n }\n\n if (isAnimated) {\n reflow(this._element);\n }\n\n this._element.classList.add(CLASS_NAME_SHOW$4);\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._focustrap.activate();\n }\n\n this._isTransitioning = false;\n EventHandler.trigger(this._element, EVENT_SHOWN$3, {\n relatedTarget\n });\n };\n\n this._queueCallback(transitionComplete, this._dialog, isAnimated);\n }\n\n _setEscapeEvent() {\n if (this._isShown) {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {\n if (this._config.keyboard && event.key === ESCAPE_KEY$1) {\n event.preventDefault();\n this.hide();\n } else if (!this._config.keyboard && event.key === ESCAPE_KEY$1) {\n this._triggerBackdropTransition();\n }\n });\n } else {\n EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS$1);\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n EventHandler.on(window, EVENT_RESIZE, () => this._adjustDialog());\n } else {\n EventHandler.off(window, EVENT_RESIZE);\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none';\n\n this._element.setAttribute('aria-hidden', true);\n\n this._element.removeAttribute('aria-modal');\n\n this._element.removeAttribute('role');\n\n this._isTransitioning = false;\n\n this._backdrop.hide(() => {\n document.body.classList.remove(CLASS_NAME_OPEN);\n\n this._resetAdjustments();\n\n this._scrollBar.reset();\n\n EventHandler.trigger(this._element, EVENT_HIDDEN$3);\n });\n }\n\n _showBackdrop(callback) {\n EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n if (this._config.backdrop === true) {\n this.hide();\n } else if (this._config.backdrop === 'static') {\n this._triggerBackdropTransition();\n }\n });\n\n this._backdrop.show(callback);\n }\n\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_FADE$3);\n }\n\n _triggerBackdropTransition() {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n const {\n classList,\n scrollHeight,\n style\n } = this._element;\n const isModalOverflowing = scrollHeight > document.documentElement.clientHeight; // return if the following background transition hasn't yet completed\n\n if (!isModalOverflowing && style.overflowY === 'hidden' || classList.contains(CLASS_NAME_STATIC)) {\n return;\n }\n\n if (!isModalOverflowing) {\n style.overflowY = 'hidden';\n }\n\n classList.add(CLASS_NAME_STATIC);\n\n this._queueCallback(() => {\n classList.remove(CLASS_NAME_STATIC);\n\n if (!isModalOverflowing) {\n this._queueCallback(() => {\n style.overflowY = '';\n }, this._dialog);\n }\n }, this._dialog);\n\n this._element.focus();\n } // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // ----------------------------------------------------------------------\n\n\n _adjustDialog() {\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n const scrollbarWidth = this._scrollBar.getWidth();\n\n const isBodyOverflowing = scrollbarWidth > 0;\n\n if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) {\n this._element.style.paddingLeft = `${scrollbarWidth}px`;\n }\n\n if (isBodyOverflowing && !isModalOverflowing && !isRTL() || !isBodyOverflowing && isModalOverflowing && isRTL()) {\n this._element.style.paddingRight = `${scrollbarWidth}px`;\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n } // Static\n\n\n static jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n const data = Modal.getOrCreateInstance(this, config);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config](relatedTarget);\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {\n const target = getElementFromSelector(this);\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n\n EventHandler.one(target, EVENT_SHOW$3, showEvent => {\n if (showEvent.defaultPrevented) {\n // only register focus restorer if modal will actually get shown\n return;\n }\n\n EventHandler.one(target, EVENT_HIDDEN$3, () => {\n if (isVisible(this)) {\n this.focus();\n }\n });\n }); // avoid conflict when clicking moddal toggler while another one is open\n\n const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);\n\n if (allReadyOpen) {\n Modal.getInstance(allReadyOpen).hide();\n }\n\n const data = Modal.getOrCreateInstance(target);\n data.toggle(this);\n });\n enableDismissTrigger(Modal);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Modal to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Modal);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$5 = 'offcanvas';\n const DATA_KEY$5 = 'bs.offcanvas';\n const EVENT_KEY$5 = `.${DATA_KEY$5}`;\n const DATA_API_KEY$2 = '.data-api';\n const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$5}${DATA_API_KEY$2}`;\n const ESCAPE_KEY = 'Escape';\n const Default$4 = {\n backdrop: true,\n keyboard: true,\n scroll: false\n };\n const DefaultType$4 = {\n backdrop: 'boolean',\n keyboard: 'boolean',\n scroll: 'boolean'\n };\n const CLASS_NAME_SHOW$3 = 'show';\n const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';\n const OPEN_SELECTOR = '.offcanvas.show';\n const EVENT_SHOW$2 = `show${EVENT_KEY$5}`;\n const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;\n const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;\n const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`;\n const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;\n const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;\n const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle=\"offcanvas\"]';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Offcanvas extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._config = this._getConfig(config);\n this._isShown = false;\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n\n this._addEventListeners();\n } // Getters\n\n\n static get NAME() {\n return NAME$5;\n }\n\n static get Default() {\n return Default$4;\n } // Public\n\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n\n show(relatedTarget) {\n if (this._isShown) {\n return;\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$2, {\n relatedTarget\n });\n\n if (showEvent.defaultPrevented) {\n return;\n }\n\n this._isShown = true;\n this._element.style.visibility = 'visible';\n\n this._backdrop.show();\n\n if (!this._config.scroll) {\n new ScrollBarHelper().hide();\n }\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.setAttribute('aria-modal', true);\n\n this._element.setAttribute('role', 'dialog');\n\n this._element.classList.add(CLASS_NAME_SHOW$3);\n\n const completeCallBack = () => {\n if (!this._config.scroll) {\n this._focustrap.activate();\n }\n\n EventHandler.trigger(this._element, EVENT_SHOWN$2, {\n relatedTarget\n });\n };\n\n this._queueCallback(completeCallBack, this._element, true);\n }\n\n hide() {\n if (!this._isShown) {\n return;\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$2);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n this._focustrap.deactivate();\n\n this._element.blur();\n\n this._isShown = false;\n\n this._element.classList.remove(CLASS_NAME_SHOW$3);\n\n this._backdrop.hide();\n\n const completeCallback = () => {\n this._element.setAttribute('aria-hidden', true);\n\n this._element.removeAttribute('aria-modal');\n\n this._element.removeAttribute('role');\n\n this._element.style.visibility = 'hidden';\n\n if (!this._config.scroll) {\n new ScrollBarHelper().reset();\n }\n\n EventHandler.trigger(this._element, EVENT_HIDDEN$2);\n };\n\n this._queueCallback(completeCallback, this._element, true);\n }\n\n dispose() {\n this._backdrop.dispose();\n\n this._focustrap.deactivate();\n\n super.dispose();\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default$4,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n };\n typeCheckConfig(NAME$5, config, DefaultType$4);\n return config;\n }\n\n _initializeBackDrop() {\n return new Backdrop({\n className: CLASS_NAME_BACKDROP,\n isVisible: this._config.backdrop,\n isAnimated: true,\n rootElement: this._element.parentNode,\n clickCallback: () => this.hide()\n });\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (this._config.keyboard && event.key === ESCAPE_KEY) {\n this.hide();\n }\n });\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Offcanvas.getOrCreateInstance(this, config);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config](this);\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {\n const target = getElementFromSelector(this);\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n\n if (isDisabled(this)) {\n return;\n }\n\n EventHandler.one(target, EVENT_HIDDEN$2, () => {\n // focus on trigger when it is closed\n if (isVisible(this)) {\n this.focus();\n }\n }); // avoid conflict when clicking a toggler of an offcanvas, while another is open\n\n const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);\n\n if (allReadyOpen && allReadyOpen !== target) {\n Offcanvas.getInstance(allReadyOpen).hide();\n }\n\n const data = Offcanvas.getOrCreateInstance(target);\n data.toggle(this);\n });\n EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));\n enableDismissTrigger(Offcanvas);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n defineJQueryPlugin(Offcanvas);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);\n const ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\n /**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;\n /**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n const DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[\\d+/a-z]+=*$/i;\n\n const allowedAttribute = (attribute, allowedAttributeList) => {\n const attributeName = attribute.nodeName.toLowerCase();\n\n if (allowedAttributeList.includes(attributeName)) {\n if (uriAttributes.has(attributeName)) {\n return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));\n }\n\n return true;\n }\n\n const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.\n\n for (let i = 0, len = regExp.length; i < len; i++) {\n if (regExp[i].test(attributeName)) {\n return true;\n }\n }\n\n return false;\n };\n\n const DefaultAllowlist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n };\n function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {\n if (!unsafeHtml.length) {\n return unsafeHtml;\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml);\n }\n\n const domParser = new window.DOMParser();\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n const elements = [].concat(...createdDocument.body.querySelectorAll('*'));\n\n for (let i = 0, len = elements.length; i < len; i++) {\n const element = elements[i];\n const elementName = element.nodeName.toLowerCase();\n\n if (!Object.keys(allowList).includes(elementName)) {\n element.remove();\n continue;\n }\n\n const attributeList = [].concat(...element.attributes);\n const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);\n attributeList.forEach(attribute => {\n if (!allowedAttribute(attribute, allowedAttributes)) {\n element.removeAttribute(attribute.nodeName);\n }\n });\n }\n\n return createdDocument.body.innerHTML;\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$4 = 'tooltip';\n const DATA_KEY$4 = 'bs.tooltip';\n const EVENT_KEY$4 = `.${DATA_KEY$4}`;\n const CLASS_PREFIX$1 = 'bs-tooltip';\n const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);\n const DefaultType$3 = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(array|string|function)',\n container: '(string|element|boolean)',\n fallbackPlacements: 'array',\n boundary: '(string|element)',\n customClass: '(string|function)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n allowList: 'object',\n popperConfig: '(null|object|function)'\n };\n const AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: isRTL() ? 'left' : 'right',\n BOTTOM: 'bottom',\n LEFT: isRTL() ? 'right' : 'left'\n };\n const Default$3 = {\n animation: true,\n template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"tooltip-arrow\"></div>' + '<div class=\"tooltip-inner\"></div>' + '</div>',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: [0, 0],\n container: false,\n fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n boundary: 'clippingParents',\n customClass: '',\n sanitize: true,\n sanitizeFn: null,\n allowList: DefaultAllowlist,\n popperConfig: null\n };\n const Event$2 = {\n HIDE: `hide${EVENT_KEY$4}`,\n HIDDEN: `hidden${EVENT_KEY$4}`,\n SHOW: `show${EVENT_KEY$4}`,\n SHOWN: `shown${EVENT_KEY$4}`,\n INSERTED: `inserted${EVENT_KEY$4}`,\n CLICK: `click${EVENT_KEY$4}`,\n FOCUSIN: `focusin${EVENT_KEY$4}`,\n FOCUSOUT: `focusout${EVENT_KEY$4}`,\n MOUSEENTER: `mouseenter${EVENT_KEY$4}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY$4}`\n };\n const CLASS_NAME_FADE$2 = 'fade';\n const CLASS_NAME_MODAL = 'modal';\n const CLASS_NAME_SHOW$2 = 'show';\n const HOVER_STATE_SHOW = 'show';\n const HOVER_STATE_OUT = 'out';\n const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';\n const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;\n const EVENT_MODAL_HIDE = 'hide.bs.modal';\n const TRIGGER_HOVER = 'hover';\n const TRIGGER_FOCUS = 'focus';\n const TRIGGER_CLICK = 'click';\n const TRIGGER_MANUAL = 'manual';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip extends BaseComponent {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)');\n }\n\n super(element); // private\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this._config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n static get Default() {\n return Default$3;\n }\n\n static get NAME() {\n return NAME$4;\n }\n\n static get Event() {\n return Event$2;\n }\n\n static get DefaultType() {\n return DefaultType$3;\n } // Public\n\n\n enable() {\n this._isEnabled = true;\n }\n\n disable() {\n this._isEnabled = false;\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n }\n\n toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n const context = this._initializeOnDelegatedTarget(event);\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$2)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n }\n\n dispose() {\n clearTimeout(this._timeout);\n EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n\n if (this.tip) {\n this.tip.remove();\n }\n\n this._disposePopper();\n\n super.dispose();\n }\n\n show() {\n if (this._element.style.display === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n if (!(this.isWithContent() && this._isEnabled)) {\n return;\n }\n\n const showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW);\n const shadowRoot = findShadowRoot(this._element);\n const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);\n\n if (showEvent.defaultPrevented || !isInTheDom) {\n return;\n } // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title`\n // This will be removed later in favor of a `setContent` method\n\n\n if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {\n this._disposePopper();\n\n this.tip.remove();\n this.tip = null;\n }\n\n const tip = this.getTipElement();\n const tipId = getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n\n this._element.setAttribute('aria-describedby', tipId);\n\n if (this._config.animation) {\n tip.classList.add(CLASS_NAME_FADE$2);\n }\n\n const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;\n\n const attachment = this._getAttachment(placement);\n\n this._addAttachmentClass(attachment);\n\n const {\n container\n } = this._config;\n Data.set(tip, this.constructor.DATA_KEY, this);\n\n if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n container.append(tip);\n EventHandler.trigger(this._element, this.constructor.Event.INSERTED);\n }\n\n if (this._popper) {\n this._popper.update();\n } else {\n this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));\n }\n\n tip.classList.add(CLASS_NAME_SHOW$2);\n\n const customClass = this._resolvePossibleFunction(this._config.customClass);\n\n if (customClass) {\n tip.classList.add(...customClass.split(' '));\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children).forEach(element => {\n EventHandler.on(element, 'mouseover', noop);\n });\n }\n\n const complete = () => {\n const prevHoverState = this._hoverState;\n this._hoverState = null;\n EventHandler.trigger(this._element, this.constructor.Event.SHOWN);\n\n if (prevHoverState === HOVER_STATE_OUT) {\n this._leave(null, this);\n }\n };\n\n const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);\n\n this._queueCallback(complete, this.tip, isAnimated);\n }\n\n hide() {\n if (!this._popper) {\n return;\n }\n\n const tip = this.getTipElement();\n\n const complete = () => {\n if (this._isWithActiveTrigger()) {\n return;\n }\n\n if (this._hoverState !== HOVER_STATE_SHOW) {\n tip.remove();\n }\n\n this._cleanTipClass();\n\n this._element.removeAttribute('aria-describedby');\n\n EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);\n\n this._disposePopper();\n };\n\n const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n tip.classList.remove(CLASS_NAME_SHOW$2); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children).forEach(element => EventHandler.off(element, 'mouseover', noop));\n }\n\n this._activeTrigger[TRIGGER_CLICK] = false;\n this._activeTrigger[TRIGGER_FOCUS] = false;\n this._activeTrigger[TRIGGER_HOVER] = false;\n const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);\n\n this._queueCallback(complete, this.tip, isAnimated);\n\n this._hoverState = '';\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.update();\n }\n } // Protected\n\n\n isWithContent() {\n return Boolean(this.getTitle());\n }\n\n getTipElement() {\n if (this.tip) {\n return this.tip;\n }\n\n const element = document.createElement('div');\n element.innerHTML = this._config.template;\n const tip = element.children[0];\n this.setContent(tip);\n tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);\n this.tip = tip;\n return this.tip;\n }\n\n setContent(tip) {\n this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);\n }\n\n _sanitizeAndSetContent(template, content, selector) {\n const templateElement = SelectorEngine.findOne(selector, template);\n\n if (!content && templateElement) {\n templateElement.remove();\n return;\n } // we use append for html objects to maintain js events\n\n\n this.setElementContent(templateElement, content);\n }\n\n setElementContent(element, content) {\n if (element === null) {\n return;\n }\n\n if (isElement$1(content)) {\n content = getElement(content); // content is a DOM node or a jQuery\n\n if (this._config.html) {\n if (content.parentNode !== element) {\n element.innerHTML = '';\n element.append(content);\n }\n } else {\n element.textContent = content.textContent;\n }\n\n return;\n }\n\n if (this._config.html) {\n if (this._config.sanitize) {\n content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);\n }\n\n element.innerHTML = content;\n } else {\n element.textContent = content;\n }\n }\n\n getTitle() {\n const title = this._element.getAttribute('data-bs-original-title') || this._config.title;\n\n return this._resolvePossibleFunction(title);\n }\n\n updateAttachment(attachment) {\n if (attachment === 'right') {\n return 'end';\n }\n\n if (attachment === 'left') {\n return 'start';\n }\n\n return attachment;\n } // Private\n\n\n _initializeOnDelegatedTarget(event, context) {\n return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());\n }\n\n _getOffset() {\n const {\n offset\n } = this._config;\n\n if (typeof offset === 'string') {\n return offset.split(',').map(val => Number.parseInt(val, 10));\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n\n return offset;\n }\n\n _resolvePossibleFunction(content) {\n return typeof content === 'function' ? content.call(this._element) : content;\n }\n\n _getPopperConfig(attachment) {\n const defaultBsPopperConfig = {\n placement: attachment,\n modifiers: [{\n name: 'flip',\n options: {\n fallbackPlacements: this._config.fallbackPlacements\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }, {\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'arrow',\n options: {\n element: `.${this.constructor.NAME}-arrow`\n }\n }, {\n name: 'onChange',\n enabled: true,\n phase: 'afterWrite',\n fn: data => this._handlePopperPlacementChange(data)\n }],\n onFirstUpdate: data => {\n if (data.options.placement !== data.placement) {\n this._handlePopperPlacementChange(data);\n }\n }\n };\n return { ...defaultBsPopperConfig,\n ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)\n };\n }\n\n _addAttachmentClass(attachment) {\n this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);\n }\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n }\n\n _setListeners() {\n const triggers = this._config.trigger.split(' ');\n\n triggers.forEach(trigger => {\n if (trigger === 'click') {\n EventHandler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));\n } else if (trigger !== TRIGGER_MANUAL) {\n const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;\n const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;\n EventHandler.on(this._element, eventIn, this._config.selector, event => this._enter(event));\n EventHandler.on(this._element, eventOut, this._config.selector, event => this._leave(event));\n }\n });\n\n this._hideModalHandler = () => {\n if (this._element) {\n this.hide();\n }\n };\n\n EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n\n if (this._config.selector) {\n this._config = { ...this._config,\n trigger: 'manual',\n selector: ''\n };\n } else {\n this._fixTitle();\n }\n }\n\n _fixTitle() {\n const title = this._element.getAttribute('title');\n\n const originalTitleType = typeof this._element.getAttribute('data-bs-original-title');\n\n if (title || originalTitleType !== 'string') {\n this._element.setAttribute('data-bs-original-title', title || '');\n\n if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {\n this._element.setAttribute('aria-label', title);\n }\n\n this._element.setAttribute('title', '');\n }\n }\n\n _enter(event, context) {\n context = this._initializeOnDelegatedTarget(event, context);\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;\n }\n\n if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$2) || context._hoverState === HOVER_STATE_SHOW) {\n context._hoverState = HOVER_STATE_SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HOVER_STATE_SHOW;\n\n if (!context._config.delay || !context._config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HOVER_STATE_SHOW) {\n context.show();\n }\n }, context._config.delay.show);\n }\n\n _leave(event, context) {\n context = this._initializeOnDelegatedTarget(event, context);\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HOVER_STATE_OUT;\n\n if (!context._config.delay || !context._config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HOVER_STATE_OUT) {\n context.hide();\n }\n }, context._config.delay.hide);\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n }\n\n _getConfig(config) {\n const dataAttributes = Manipulator.getDataAttributes(this._element);\n Object.keys(dataAttributes).forEach(dataAttr => {\n if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {\n delete dataAttributes[dataAttr];\n }\n });\n config = { ...this.constructor.Default,\n ...dataAttributes,\n ...(typeof config === 'object' && config ? config : {})\n };\n config.container = config.container === false ? document.body : getElement(config.container);\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n typeCheckConfig(NAME$4, config, this.constructor.DefaultType);\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);\n }\n\n return config;\n }\n\n _getDelegateConfig() {\n const config = {};\n\n for (const key in this._config) {\n if (this.constructor.Default[key] !== this._config[key]) {\n config[key] = this._config[key];\n }\n } // In the future can be replaced with:\n // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n // `Object.fromEntries(keysWithDifferentValues)`\n\n\n return config;\n }\n\n _cleanTipClass() {\n const tip = this.getTipElement();\n const basicClassPrefixRegex = new RegExp(`(^|\\\\s)${this._getBasicClassPrefix()}\\\\S+`, 'g');\n const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);\n\n if (tabClass !== null && tabClass.length > 0) {\n tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));\n }\n }\n\n _getBasicClassPrefix() {\n return CLASS_PREFIX$1;\n }\n\n _handlePopperPlacementChange(popperData) {\n const {\n state\n } = popperData;\n\n if (!state) {\n return;\n }\n\n this.tip = state.elements.popper;\n\n this._cleanTipClass();\n\n this._addAttachmentClass(this._getAttachment(state.placement));\n }\n\n _disposePopper() {\n if (this._popper) {\n this._popper.destroy();\n\n this._popper = null;\n }\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tooltip.getOrCreateInstance(this, config);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Tooltip to jQuery only if jQuery is present\n */\n\n\n defineJQueryPlugin(Tooltip);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$3 = 'popover';\n const DATA_KEY$3 = 'bs.popover';\n const EVENT_KEY$3 = `.${DATA_KEY$3}`;\n const CLASS_PREFIX = 'bs-popover';\n const Default$2 = { ...Tooltip.Default,\n placement: 'right',\n offset: [0, 8],\n trigger: 'click',\n content: '',\n template: '<div class=\"popover\" role=\"tooltip\">' + '<div class=\"popover-arrow\"></div>' + '<h3 class=\"popover-header\"></h3>' + '<div class=\"popover-body\"></div>' + '</div>'\n };\n const DefaultType$2 = { ...Tooltip.DefaultType,\n content: '(string|element|function)'\n };\n const Event$1 = {\n HIDE: `hide${EVENT_KEY$3}`,\n HIDDEN: `hidden${EVENT_KEY$3}`,\n SHOW: `show${EVENT_KEY$3}`,\n SHOWN: `shown${EVENT_KEY$3}`,\n INSERTED: `inserted${EVENT_KEY$3}`,\n CLICK: `click${EVENT_KEY$3}`,\n FOCUSIN: `focusin${EVENT_KEY$3}`,\n FOCUSOUT: `focusout${EVENT_KEY$3}`,\n MOUSEENTER: `mouseenter${EVENT_KEY$3}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY$3}`\n };\n const SELECTOR_TITLE = '.popover-header';\n const SELECTOR_CONTENT = '.popover-body';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Popover extends Tooltip {\n // Getters\n static get Default() {\n return Default$2;\n }\n\n static get NAME() {\n return NAME$3;\n }\n\n static get Event() {\n return Event$1;\n }\n\n static get DefaultType() {\n return DefaultType$2;\n } // Overrides\n\n\n isWithContent() {\n return this.getTitle() || this._getContent();\n }\n\n setContent(tip) {\n this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);\n\n this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);\n } // Private\n\n\n _getContent() {\n return this._resolvePossibleFunction(this._config.content);\n }\n\n _getBasicClassPrefix() {\n return CLASS_PREFIX;\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Popover to jQuery only if jQuery is present\n */\n\n\n defineJQueryPlugin(Popover);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$2 = 'scrollspy';\n const DATA_KEY$2 = 'bs.scrollspy';\n const EVENT_KEY$2 = `.${DATA_KEY$2}`;\n const DATA_API_KEY$1 = '.data-api';\n const Default$1 = {\n offset: 10,\n method: 'auto',\n target: ''\n };\n const DefaultType$1 = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n };\n const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;\n const EVENT_SCROLL = `scroll${EVENT_KEY$2}`;\n const EVENT_LOAD_DATA_API = `load${EVENT_KEY$2}${DATA_API_KEY$1}`;\n const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';\n const CLASS_NAME_ACTIVE$1 = 'active';\n const SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]';\n const SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';\n const SELECTOR_NAV_LINKS = '.nav-link';\n const SELECTOR_NAV_ITEMS = '.nav-item';\n const SELECTOR_LIST_ITEMS = '.list-group-item';\n const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`;\n const SELECTOR_DROPDOWN$1 = '.dropdown';\n const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';\n const METHOD_OFFSET = 'offset';\n const METHOD_POSITION = 'position';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class ScrollSpy extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._scrollElement = this._element.tagName === 'BODY' ? window : this._element;\n this._config = this._getConfig(config);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n EventHandler.on(this._scrollElement, EVENT_SCROLL, () => this._process());\n this.refresh();\n\n this._process();\n } // Getters\n\n\n static get Default() {\n return Default$1;\n }\n\n static get NAME() {\n return NAME$2;\n } // Public\n\n\n refresh() {\n const autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;\n const offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;\n const offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target);\n targets.map(element => {\n const targetSelector = getSelectorFromElement(element);\n const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;\n\n if (target) {\n const targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(item => item).sort((a, b) => a[0] - b[0]).forEach(item => {\n this._offsets.push(item[0]);\n\n this._targets.push(item[1]);\n });\n }\n\n dispose() {\n EventHandler.off(this._scrollElement, EVENT_KEY$2);\n super.dispose();\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default$1,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' && config ? config : {})\n };\n config.target = getElement(config.target) || document.documentElement;\n typeCheckConfig(NAME$2, config, DefaultType$1);\n return config;\n }\n\n _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset;\n\n const scrollHeight = this._getScrollHeight();\n\n const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n for (let i = this._offsets.length; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n const queries = SELECTOR_LINK_ITEMS.split(',').map(selector => `${selector}[data-bs-target=\"${target}\"],${selector}[href=\"${target}\"]`);\n const link = SelectorEngine.findOne(queries.join(','), this._config.target);\n link.classList.add(CLASS_NAME_ACTIVE$1);\n\n if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1);\n } else {\n SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => {\n // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n SelectorEngine.prev(listGroup, `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1)); // Handle special case when .nav-link is inside .nav-item\n\n SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(navItem => {\n SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1));\n });\n });\n }\n\n EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {\n relatedTarget: target\n });\n }\n\n _clear() {\n SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1));\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = ScrollSpy.getOrCreateInstance(this, config);\n\n if (typeof config !== 'string') {\n return;\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n SelectorEngine.find(SELECTOR_DATA_SPY).forEach(spy => new ScrollSpy(spy));\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .ScrollSpy to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(ScrollSpy);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME$1 = 'tab';\n const DATA_KEY$1 = 'bs.tab';\n const EVENT_KEY$1 = `.${DATA_KEY$1}`;\n const DATA_API_KEY = '.data-api';\n const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`;\n const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`;\n const EVENT_SHOW$1 = `show${EVENT_KEY$1}`;\n const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`;\n const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}${DATA_API_KEY}`;\n const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';\n const CLASS_NAME_ACTIVE = 'active';\n const CLASS_NAME_FADE$1 = 'fade';\n const CLASS_NAME_SHOW$1 = 'show';\n const SELECTOR_DROPDOWN = '.dropdown';\n const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';\n const SELECTOR_ACTIVE = '.active';\n const SELECTOR_ACTIVE_UL = ':scope > li > .active';\n const SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]';\n const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';\n const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tab extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$1;\n } // Public\n\n\n show() {\n if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE)) {\n return;\n }\n\n let previous;\n const target = getElementFromSelector(this._element);\n\n const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);\n\n if (listElement) {\n const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;\n previous = SelectorEngine.find(itemSelector, listElement);\n previous = previous[previous.length - 1];\n }\n\n const hideEvent = previous ? EventHandler.trigger(previous, EVENT_HIDE$1, {\n relatedTarget: this._element\n }) : null;\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$1, {\n relatedTarget: previous\n });\n\n if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {\n return;\n }\n\n this._activate(this._element, listElement);\n\n const complete = () => {\n EventHandler.trigger(previous, EVENT_HIDDEN$1, {\n relatedTarget: this._element\n });\n EventHandler.trigger(this._element, EVENT_SHOWN$1, {\n relatedTarget: previous\n });\n };\n\n if (target) {\n this._activate(target, target.parentNode, complete);\n } else {\n complete();\n }\n } // Private\n\n\n _activate(element, container, callback) {\n const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE);\n const active = activeElements[0];\n const isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$1);\n\n const complete = () => this._transitionComplete(element, active, callback);\n\n if (active && isTransitioning) {\n active.classList.remove(CLASS_NAME_SHOW$1);\n\n this._queueCallback(complete, element, true);\n } else {\n complete();\n }\n }\n\n _transitionComplete(element, active, callback) {\n if (active) {\n active.classList.remove(CLASS_NAME_ACTIVE);\n const dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);\n\n if (dropdownChild) {\n dropdownChild.classList.remove(CLASS_NAME_ACTIVE);\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false);\n }\n }\n\n element.classList.add(CLASS_NAME_ACTIVE);\n\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true);\n }\n\n reflow(element);\n\n if (element.classList.contains(CLASS_NAME_FADE$1)) {\n element.classList.add(CLASS_NAME_SHOW$1);\n }\n\n let parent = element.parentNode;\n\n if (parent && parent.nodeName === 'LI') {\n parent = parent.parentNode;\n }\n\n if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {\n const dropdownElement = element.closest(SELECTOR_DROPDOWN);\n\n if (dropdownElement) {\n SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));\n }\n\n element.setAttribute('aria-expanded', true);\n }\n\n if (callback) {\n callback();\n }\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tab.getOrCreateInstance(this);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config]();\n }\n });\n }\n\n }\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n\n if (isDisabled(this)) {\n return;\n }\n\n const data = Tab.getOrCreateInstance(this);\n data.show();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Tab to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Tab);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'toast';\n const DATA_KEY = 'bs.toast';\n const EVENT_KEY = `.${DATA_KEY}`;\n const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;\n const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;\n const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;\n const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;\n const EVENT_HIDE = `hide${EVENT_KEY}`;\n const EVENT_HIDDEN = `hidden${EVENT_KEY}`;\n const EVENT_SHOW = `show${EVENT_KEY}`;\n const EVENT_SHOWN = `shown${EVENT_KEY}`;\n const CLASS_NAME_FADE = 'fade';\n const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility\n\n const CLASS_NAME_SHOW = 'show';\n const CLASS_NAME_SHOWING = 'showing';\n const DefaultType = {\n animation: 'boolean',\n autohide: 'boolean',\n delay: 'number'\n };\n const Default = {\n animation: true,\n autohide: true,\n delay: 5000\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Toast extends BaseComponent {\n constructor(element, config) {\n super(element);\n this._config = this._getConfig(config);\n this._timeout = null;\n this._hasMouseInteraction = false;\n this._hasKeyboardInteraction = false;\n\n this._setListeners();\n } // Getters\n\n\n static get DefaultType() {\n return DefaultType;\n }\n\n static get Default() {\n return Default;\n }\n\n static get NAME() {\n return NAME;\n } // Public\n\n\n show() {\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW);\n\n if (showEvent.defaultPrevented) {\n return;\n }\n\n this._clearTimeout();\n\n if (this._config.animation) {\n this._element.classList.add(CLASS_NAME_FADE);\n }\n\n const complete = () => {\n this._element.classList.remove(CLASS_NAME_SHOWING);\n\n EventHandler.trigger(this._element, EVENT_SHOWN);\n\n this._maybeScheduleHide();\n };\n\n this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated\n\n\n reflow(this._element);\n\n this._element.classList.add(CLASS_NAME_SHOW);\n\n this._element.classList.add(CLASS_NAME_SHOWING);\n\n this._queueCallback(complete, this._element, this._config.animation);\n }\n\n hide() {\n if (!this._element.classList.contains(CLASS_NAME_SHOW)) {\n return;\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);\n\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n const complete = () => {\n this._element.classList.add(CLASS_NAME_HIDE); // @deprecated\n\n\n this._element.classList.remove(CLASS_NAME_SHOWING);\n\n this._element.classList.remove(CLASS_NAME_SHOW);\n\n EventHandler.trigger(this._element, EVENT_HIDDEN);\n };\n\n this._element.classList.add(CLASS_NAME_SHOWING);\n\n this._queueCallback(complete, this._element, this._config.animation);\n }\n\n dispose() {\n this._clearTimeout();\n\n if (this._element.classList.contains(CLASS_NAME_SHOW)) {\n this._element.classList.remove(CLASS_NAME_SHOW);\n }\n\n super.dispose();\n } // Private\n\n\n _getConfig(config) {\n config = { ...Default,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' && config ? config : {})\n };\n typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n }\n\n _maybeScheduleHide() {\n if (!this._config.autohide) {\n return;\n }\n\n if (this._hasMouseInteraction || this._hasKeyboardInteraction) {\n return;\n }\n\n this._timeout = setTimeout(() => {\n this.hide();\n }, this._config.delay);\n }\n\n _onInteraction(event, isInteracting) {\n switch (event.type) {\n case 'mouseover':\n case 'mouseout':\n this._hasMouseInteraction = isInteracting;\n break;\n\n case 'focusin':\n case 'focusout':\n this._hasKeyboardInteraction = isInteracting;\n break;\n }\n\n if (isInteracting) {\n this._clearTimeout();\n\n return;\n }\n\n const nextElement = event.relatedTarget;\n\n if (this._element === nextElement || this._element.contains(nextElement)) {\n return;\n }\n\n this._maybeScheduleHide();\n }\n\n _setListeners() {\n EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));\n EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));\n EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));\n EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));\n }\n\n _clearTimeout() {\n clearTimeout(this._timeout);\n this._timeout = null;\n } // Static\n\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Toast.getOrCreateInstance(this, config);\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n\n data[config](this);\n }\n });\n }\n\n }\n\n enableDismissTrigger(Toast);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Toast to jQuery only if jQuery is present\n */\n\n defineJQueryPlugin(Toast);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): index.umd.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n const index_umd = {\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Offcanvas,\n Popover,\n ScrollSpy,\n Tab,\n Toast,\n Tooltip\n };\n\n return index_umd;\n\n}));\n//# sourceMappingURL=bootstrap.bundle.js.map\n\n\n//# sourceURL=webpack:///./node_modules/bootstrap/dist/js/bootstrap.bundle.js?");
|
1272
828
|
|
1273
829
|
/***/ }),
|
1274
830
|
|
@@ -1387,31 +943,7 @@ eval("\nif (typeof Object.assign !== \"function\") {\n Object.assign = functi
|
|
1387
943
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1388
944
|
|
1389
945
|
"use strict";
|
1390
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MultiDrag\", function() { return MultiDragPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Sortable\", function() { return Sortable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Swap\", function() { return SwapPlugin; });\n/**!\n * Sortable 1.13.0\n * @author\tRubaXa <trash@rubaxa.org>\n * @author\towenm <owen23355@gmail.com>\n * @license MIT\n */\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nvar version = \"1.13.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !!\n /*@__PURE__*/\n navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && children[i] !== Sortable.dragged && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread({}, extraEventProperties, PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, [\"evt\"]);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\n * @param {Number} x X position\n * @param {Number} y Y position\n * @return {HTMLElement} Element of the first found nearest Sortable\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n if (lastChild(sortable)) return;\n var rect = getRect(sortable),\n threshold = sortable[expando].options.emptyInsertThreshold,\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (threshold && insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\n * @class Sortable\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // assign target only if condition is true\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n el.appendChild(dragEl);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\n * Serializes the item into an array of string.\n * @returns {String[]}\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\n * Sorts the elements according to the array.\n * @param {String[]} order order of the items\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\n * Save the current sorting\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\n * @param {HTMLElement} el\n * @param {String} [selector] default: `options.draggable`\n * @returns {HTMLElement|null}\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\n * Set/get option\n * @param {string} name\n * @param {*} [value]\n * @returns {*}\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\n * Destroy\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\n * Gets the direction dragEl must be swapped relative to target in order to make it\n * seem that dragEl has been \"inserted\" into that element's position\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\n * @return {Number} Direction dragEl must be swapped\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\n * Generate id\n * @param {HTMLElement} el\n * @returns {String}\n * @private\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\n * Get the Sortable instance of an element\n * @param {HTMLElement} element The element\n * @return {Sortable|undefined} The instance of Sortable\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\n * Mount a plugin to Sortable\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread({}, Sortable.utils, plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\n * Create sortable instance\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvt: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvt: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvt: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvt: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Sortable);\n\n\n\n//# sourceURL=webpack:///./node_modules/sortablejs/modular/sortable.esm.js?");
|
1391
|
-
|
1392
|
-
/***/ }),
|
1393
|
-
|
1394
|
-
/***/ "./node_modules/stimulus/index.js":
|
1395
|
-
/*!****************************************!*\
|
1396
|
-
!*** ./node_modules/stimulus/index.js ***!
|
1397
|
-
\****************************************/
|
1398
|
-
/*! exports provided: Application, Context, Controller, defaultSchema */
|
1399
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1400
|
-
|
1401
|
-
"use strict";
|
1402
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _stimulus_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @stimulus/core */ \"./node_modules/@stimulus/core/dist/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Application\", function() { return _stimulus_core__WEBPACK_IMPORTED_MODULE_0__[\"Application\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Context\", function() { return _stimulus_core__WEBPACK_IMPORTED_MODULE_0__[\"Context\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Controller\", function() { return _stimulus_core__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"defaultSchema\", function() { return _stimulus_core__WEBPACK_IMPORTED_MODULE_0__[\"defaultSchema\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/stimulus/index.js?");
|
1403
|
-
|
1404
|
-
/***/ }),
|
1405
|
-
|
1406
|
-
/***/ "./node_modules/stimulus/webpack-helpers.js":
|
1407
|
-
/*!**************************************************!*\
|
1408
|
-
!*** ./node_modules/stimulus/webpack-helpers.js ***!
|
1409
|
-
\**************************************************/
|
1410
|
-
/*! exports provided: definitionsFromContext, identifierForContextKey */
|
1411
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1412
|
-
|
1413
|
-
"use strict";
|
1414
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _stimulus_webpack_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @stimulus/webpack-helpers */ \"./node_modules/@stimulus/webpack-helpers/dist/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"definitionsFromContext\", function() { return _stimulus_webpack_helpers__WEBPACK_IMPORTED_MODULE_0__[\"definitionsFromContext\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"identifierForContextKey\", function() { return _stimulus_webpack_helpers__WEBPACK_IMPORTED_MODULE_0__[\"identifierForContextKey\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/stimulus/webpack-helpers.js?");
|
946
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MultiDrag\", function() { return MultiDragPlugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Sortable\", function() { return Sortable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Swap\", function() { return SwapPlugin; });\n/**!\n * Sortable 1.14.0\n * @author\tRubaXa <trash@rubaxa.org>\n * @author\towenm <owen23355@gmail.com>\n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.14.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\n * @param {Number} x X position\n * @param {Number} y Y position\n * @return {HTMLElement} Element of the first found nearest Sortable\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\n * @class Sortable\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // if there is a last element, it is the target\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n el.appendChild(dragEl);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n\n if (firstChild === dragEl) {\n return completed(false);\n }\n\n target = firstChild;\n targetRect = getRect(target);\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\n * Serializes the item into an array of string.\n * @returns {String[]}\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\n * Sorts the elements according to the array.\n * @param {String[]} order order of the items\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\n * Save the current sorting\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\n * @param {HTMLElement} el\n * @param {String} [selector] default: `options.draggable`\n * @returns {HTMLElement|null}\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\n * Set/get option\n * @param {string} name\n * @param {*} [value]\n * @returns {*}\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\n * Destroy\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var rect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var spacer = 10;\n return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\n * Gets the direction dragEl must be swapped relative to target in order to make it\n * seem that dragEl has been \"inserted\" into that element's position\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\n * @return {Number} Direction dragEl must be swapped\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\n * Generate id\n * @param {HTMLElement} el\n * @returns {String}\n * @private\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\n * Get the Sortable instance of an element\n * @param {HTMLElement} element The element\n * @return {Sortable|undefined} The instance of Sortable\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\n * Mount a plugin to Sortable\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\n * Create sortable instance\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvt: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvt: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvt: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n folding = false; // Do not \"unfold\" after around dragEl if reverted\n\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvt: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\n * Selects the provided multi-drag item\n * @param {HTMLElement} el The element to be selected\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\n * Deselects the provided multi-drag item\n * @param {HTMLElement} el The element to be deselected\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\n * Insert multi-drag clones\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\n * @param {HTMLElement} rootEl\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Sortable);\n\n\n\n//# sourceURL=webpack:///./node_modules/sortablejs/modular/sortable.esm.js?");
|
1415
947
|
|
1416
948
|
/***/ }),
|
1417
949
|
|
@@ -1422,7 +954,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sti
|
|
1422
954
|
/*! no static exports found */
|
1423
955
|
/***/ (function(module, exports, __webpack_require__) {
|
1424
956
|
|
1425
|
-
eval("/**\n* Tom Select v2.0.0-rc.4\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n*/\n\n(function (global, factory) {\n\t true ? module.exports = factory() :\n\tundefined;\n}(this, (function () { 'use strict';\n\n\t/**\n\t * MicroEvent - to make any js object an event emitter\n\t *\n\t * - pure javascript - server compatible, browser compatible\n\t * - dont rely on the browser doms\n\t * - super simple - you get it immediatly, no mistery, no magic involved\n\t *\n\t * @author Jerome Etienne (https://github.com/jeromeetienne)\n\t */\n\n\t/**\n\t * Execute callback for each event in space separated list of event names\n\t *\n\t */\n\tfunction forEvents(events, callback) {\n\t events.split(/\\s+/).forEach(event => {\n\t callback(event);\n\t });\n\t}\n\n\tclass MicroEvent {\n\t constructor() {\n\t this._events = {};\n\t }\n\n\t on(events, fct) {\n\t forEvents(events, event => {\n\t this._events[event] = this._events[event] || [];\n\n\t this._events[event].push(fct);\n\t });\n\t }\n\n\t off(events, fct) {\n\t var n = arguments.length;\n\n\t if (n === 0) {\n\t this._events = {};\n\t return;\n\t }\n\n\t forEvents(events, event => {\n\t if (n === 1) return delete this._events[event];\n\t if (event in this._events === false) return;\n\n\t this._events[event].splice(this._events[event].indexOf(fct), 1);\n\t });\n\t }\n\n\t trigger(events, ...args) {\n\t var self = this;\n\t forEvents(events, event => {\n\t if (event in self._events === false) return;\n\n\t for (let fct of self._events[event]) {\n\t fct.apply(self, args);\n\t }\n\t });\n\t }\n\n\t}\n\n\t/**\n\t * microplugin.js\n\t * Copyright (c) 2013 Brian Reavis & contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t * @author Brian Reavis <brian@thirdroute.com>\n\t */\n\tfunction MicroPlugin(Interface) {\n\t Interface.plugins = {};\n\t return class extends Interface {\n\t constructor(...args) {\n\t super(...args);\n\t this.plugins = {\n\t names: [],\n\t settings: {},\n\t requested: {},\n\t loaded: {}\n\t };\n\t }\n\n\t /**\n\t * Registers a plugin.\n\t *\n\t * @param {function} fn\n\t */\n\t static define(name, fn) {\n\t Interface.plugins[name] = {\n\t 'name': name,\n\t 'fn': fn\n\t };\n\t }\n\t /**\n\t * Initializes the listed plugins (with options).\n\t * Acceptable formats:\n\t *\n\t * List (without options):\n\t * ['a', 'b', 'c']\n\t *\n\t * List (with options):\n\t * [{'name': 'a', options: {}}, {'name': 'b', options: {}}]\n\t *\n\t * Hash (with options):\n\t * {'a': { ... }, 'b': { ... }, 'c': { ... }}\n\t *\n\t * @param {array|object} plugins\n\t */\n\n\n\t initializePlugins(plugins) {\n\t var key, name;\n\t const self = this;\n\t const queue = [];\n\n\t if (Array.isArray(plugins)) {\n\t plugins.forEach(plugin => {\n\t if (typeof plugin === 'string') {\n\t queue.push(plugin);\n\t } else {\n\t self.plugins.settings[plugin.name] = plugin.options;\n\t queue.push(plugin.name);\n\t }\n\t });\n\t } else if (plugins) {\n\t for (key in plugins) {\n\t if (plugins.hasOwnProperty(key)) {\n\t self.plugins.settings[key] = plugins[key];\n\t queue.push(key);\n\t }\n\t }\n\t }\n\n\t while (name = queue.shift()) {\n\t self.require(name);\n\t }\n\t }\n\n\t loadPlugin(name) {\n\t var self = this;\n\t var plugins = self.plugins;\n\t var plugin = Interface.plugins[name];\n\n\t if (!Interface.plugins.hasOwnProperty(name)) {\n\t throw new Error('Unable to find \"' + name + '\" plugin');\n\t }\n\n\t plugins.requested[name] = true;\n\t plugins.loaded[name] = plugin.fn.apply(self, [self.plugins.settings[name] || {}]);\n\t plugins.names.push(name);\n\t }\n\t /**\n\t * Initializes a plugin.\n\t *\n\t */\n\n\n\t require(name) {\n\t var self = this;\n\t var plugins = self.plugins;\n\n\t if (!self.plugins.loaded.hasOwnProperty(name)) {\n\t if (plugins.requested[name]) {\n\t throw new Error('Plugin has circular dependency (\"' + name + '\")');\n\t }\n\n\t self.loadPlugin(name);\n\t }\n\n\t return plugins.loaded[name];\n\t }\n\n\t };\n\t}\n\n\t// https://github.com/andrewrk/node-diacritics/blob/master/index.js\n\tvar latin_pat;\n\tconst accent_pat = '[\\u0300-\\u036F\\u{b7}\\u{2be}]'; // \\u{2bc}\n\n\tconst accent_reg = new RegExp(accent_pat, 'g');\n\tvar diacritic_patterns;\n\tconst latin_convert = {\n\t 'æ': 'ae',\n\t 'ⱥ': 'a',\n\t 'ø': 'o'\n\t};\n\tconst convert_pat = new RegExp(Object.keys(latin_convert).join('|'), 'g');\n\t/**\n\t * code points generated from toCodePoints();\n\t * removed 65339 to 65345\n\t */\n\n\tconst code_points = [[67, 67], [160, 160], [192, 438], [452, 652], [961, 961], [1019, 1019], [1083, 1083], [1281, 1289], [1984, 1984], [5095, 5095], [7429, 7441], [7545, 7549], [7680, 7935], [8580, 8580], [9398, 9449], [11360, 11391], [42792, 42793], [42802, 42851], [42873, 42897], [42912, 42922], [64256, 64260], [65313, 65338], [65345, 65370]];\n\t/**\n\t * Remove accents\n\t * via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703\n\t *\n\t */\n\n\tconst asciifold = str => {\n\t return str.normalize('NFKD').replace(accent_reg, '').toLowerCase().replace(convert_pat, function (foreignletter) {\n\t return latin_convert[foreignletter];\n\t });\n\t};\n\t/**\n\t * Convert array of strings to a regular expression\n\t *\tex ['ab','a'] => (?:ab|a)\n\t * \tex ['a','b'] => [ab]\n\t *\n\t */\n\n\n\tconst arrayToPattern = (chars, glue = '|') => {\n\t if (chars.length == 1) {\n\t return chars[0];\n\t }\n\n\t var longest = 1;\n\t chars.forEach(a => {\n\t longest = Math.max(longest, a.length);\n\t });\n\n\t if (longest == 1) {\n\t return '[' + chars.join('') + ']';\n\t }\n\n\t return '(?:' + chars.join(glue) + ')';\n\t};\n\t/**\n\t * Get all possible combinations of substrings that add up to the given string\n\t * https://stackoverflow.com/questions/30169587/find-all-the-combination-of-substrings-that-add-up-to-the-given-string\n\t *\n\t */\n\n\tconst allSubstrings = input => {\n\t if (input.length === 1) return [[input]];\n\t var result = [];\n\t allSubstrings(input.substring(1)).forEach(function (subresult) {\n\t var tmp = subresult.slice(0);\n\t tmp[0] = input.charAt(0) + tmp[0];\n\t result.push(tmp);\n\t tmp = subresult.slice(0);\n\t tmp.unshift(input.charAt(0));\n\t result.push(tmp);\n\t });\n\t return result;\n\t};\n\t/**\n\t * Generate a list of diacritics from the list of code points\n\t *\n\t */\n\n\tconst generateDiacritics = () => {\n\t var diacritics = {};\n\t code_points.forEach(code_range => {\n\t for (let i = code_range[0]; i <= code_range[1]; i++) {\n\t let diacritic = String.fromCharCode(i);\n\t let latin = asciifold(diacritic);\n\n\t if (latin == diacritic.toLowerCase()) {\n\t continue;\n\t }\n\n\t if (!(latin in diacritics)) {\n\t diacritics[latin] = [latin];\n\t }\n\n\t var patt = new RegExp(arrayToPattern(diacritics[latin]), 'iu');\n\n\t if (diacritic.match(patt)) {\n\t continue;\n\t }\n\n\t diacritics[latin].push(diacritic);\n\t }\n\t });\n\t var latin_chars = Object.keys(diacritics); // latin character pattern\n\t // match longer substrings first\n\n\t latin_chars = latin_chars.sort((a, b) => b.length - a.length);\n\t latin_pat = new RegExp('(' + arrayToPattern(latin_chars) + accent_pat + '*)', 'g'); // build diacritic patterns\n\t // ae needs: \n\t //\t(?:(?:ae|Æ|Ǽ|Ǣ)|(?:A|Ⓐ|A...)(?:E|ɛ|Ⓔ...))\n\n\t var diacritic_patterns = {};\n\t latin_chars.sort((a, b) => a.length - b.length).forEach(latin => {\n\t var substrings = allSubstrings(latin);\n\t var pattern = substrings.map(sub_pat => {\n\t sub_pat = sub_pat.map(l => {\n\t if (diacritics.hasOwnProperty(l)) {\n\t return arrayToPattern(diacritics[l]);\n\t }\n\n\t return l;\n\t });\n\t return arrayToPattern(sub_pat, '');\n\t });\n\t diacritic_patterns[latin] = arrayToPattern(pattern);\n\t });\n\t return diacritic_patterns;\n\t};\n\t/**\n\t * Expand a regular expression pattern to include diacritics\n\t * \teg /a/ becomes /aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐɑAⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ/\n\t *\n\t */\n\n\tconst diacriticRegexPoints = regex => {\n\t if (diacritic_patterns === undefined) {\n\t diacritic_patterns = generateDiacritics();\n\t }\n\n\t const decomposed = regex.normalize('NFKD').toLowerCase();\n\t return decomposed.split(latin_pat).map(part => {\n\t if (part == '') {\n\t return '';\n\t } // \"ffl\" or \"ffl\"\n\n\n\t const no_accent = asciifold(part);\n\n\t if (diacritic_patterns.hasOwnProperty(no_accent)) {\n\t return diacritic_patterns[no_accent];\n\t } // 'أهلا' (\\u{623}\\u{647}\\u{644}\\u{627}) or 'أهلا' (\\u{627}\\u{654}\\u{647}\\u{644}\\u{627})\n\n\n\t const composed_part = part.normalize('NFC');\n\n\t if (composed_part != part) {\n\t return arrayToPattern([part, composed_part]);\n\t }\n\n\t return part;\n\t }).join('');\n\t};\n\n\t// @ts-ignore TS2691 \"An import path cannot end with a '.ts' extension\"\n\n\t/**\n\t * A property getter resolving dot-notation\n\t * @param {Object} obj The root object to fetch property on\n\t * @param {String} name The optionally dotted property name to fetch\n\t * @return {Object} The resolved property value\n\t */\n\tconst getAttr = (obj, name) => {\n\t if (!obj) return;\n\t return obj[name];\n\t};\n\t/**\n\t * A property getter resolving dot-notation\n\t * @param {Object} obj The root object to fetch property on\n\t * @param {String} name The optionally dotted property name to fetch\n\t * @return {Object} The resolved property value\n\t */\n\n\tconst getAttrNesting = (obj, name) => {\n\t if (!obj) return;\n\t var part,\n\t names = name.split(\".\");\n\n\t while ((part = names.shift()) && (obj = obj[part]));\n\n\t return obj;\n\t};\n\t/**\n\t * Calculates how close of a match the\n\t * given value is against a search token.\n\t *\n\t */\n\n\tconst scoreValue = (value, token, weight) => {\n\t var score, pos;\n\t if (!value) return 0;\n\t value = value + '';\n\t pos = value.search(token.regex);\n\t if (pos === -1) return 0;\n\t score = token.string.length / value.length;\n\t if (pos === 0) score += 0.5;\n\t return score * weight;\n\t};\n\t/**\n\t *\n\t * https://stackoverflow.com/questions/63006601/why-does-u-throw-an-invalid-escape-error\n\t */\n\n\tconst escape_regex = str => {\n\t return (str + '').replace(/([\\$\\(-\\+\\.\\?\\[-\\^\\{-\\}])/g, '\\\\$1');\n\t};\n\t/**\n\t * Cast object property to an array if it exists and has a value\n\t *\n\t */\n\n\tconst propToArray = (obj, key) => {\n\t var value = obj[key];\n\t if (typeof value == 'function') return value;\n\n\t if (value && !Array.isArray(value)) {\n\t obj[key] = [value];\n\t }\n\t};\n\t/**\n\t * Iterates over arrays and hashes.\n\t *\n\t * ```\n\t * iterate(this.items, function(item, id) {\n\t * // invoked for each item\n\t * });\n\t * ```\n\t *\n\t */\n\n\tconst iterate = (object, callback) => {\n\t if (Array.isArray(object)) {\n\t object.forEach(callback);\n\t } else {\n\t for (var key in object) {\n\t if (object.hasOwnProperty(key)) {\n\t callback(object[key], key);\n\t }\n\t }\n\t }\n\t};\n\tconst cmp = (a, b) => {\n\t if (typeof a === 'number' && typeof b === 'number') {\n\t return a > b ? 1 : a < b ? -1 : 0;\n\t }\n\n\t a = asciifold(a + '').toLowerCase();\n\t b = asciifold(b + '').toLowerCase();\n\t if (a > b) return 1;\n\t if (b > a) return -1;\n\t return 0;\n\t};\n\n\t/**\n\t * sifter.js\n\t * Copyright (c) 2013–2020 Brian Reavis & contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t * @author Brian Reavis <brian@thirdroute.com>\n\t */\n\n\tclass Sifter {\n\t // []|{};\n\n\t /**\n\t * Textually searches arrays and hashes of objects\n\t * by property (or multiple properties). Designed\n\t * specifically for autocomplete.\n\t *\n\t */\n\t constructor(items, settings) {\n\t this.items = items;\n\t this.settings = settings || {\n\t diacritics: true\n\t };\n\t }\n\n\t /**\n\t * Splits a search string into an array of individual\n\t * regexps to be used to match results.\n\t *\n\t */\n\t tokenize(query, respect_word_boundaries, weights) {\n\t if (!query || !query.length) return [];\n\t const tokens = [];\n\t const words = query.split(/\\s+/);\n\t var field_regex;\n\n\t if (weights) {\n\t field_regex = new RegExp('^(' + Object.keys(weights).map(escape_regex).join('|') + ')\\:(.*)$');\n\t }\n\n\t words.forEach(word => {\n\t let field_match;\n\t let field = null;\n\t let regex = null; // look for \"field:query\" tokens\n\n\t if (field_regex && (field_match = word.match(field_regex))) {\n\t field = field_match[1];\n\t word = field_match[2];\n\t }\n\n\t if (word.length > 0) {\n\t regex = escape_regex(word);\n\n\t if (this.settings.diacritics) {\n\t regex = diacriticRegexPoints(regex);\n\t }\n\n\t if (respect_word_boundaries) regex = \"\\\\b\" + regex;\n\t }\n\n\t tokens.push({\n\t string: word,\n\t regex: regex ? new RegExp(regex, 'iu') : null,\n\t field: field\n\t });\n\t });\n\t return tokens;\n\t }\n\n\t /**\n\t * Returns a function to be used to score individual results.\n\t *\n\t * Good matches will have a higher score than poor matches.\n\t * If an item is not a match, 0 will be returned by the function.\n\t *\n\t * @returns {function}\n\t */\n\t getScoreFunction(query, options) {\n\t var search = this.prepareSearch(query, options);\n\t return this._getScoreFunction(search);\n\t }\n\n\t _getScoreFunction(search) {\n\t const tokens = search.tokens,\n\t token_count = tokens.length;\n\n\t if (!token_count) {\n\t return function () {\n\t return 0;\n\t };\n\t }\n\n\t const fields = search.options.fields,\n\t weights = search.weights,\n\t field_count = fields.length,\n\t getAttrFn = search.getAttrFn;\n\n\t if (!field_count) {\n\t return function () {\n\t return 1;\n\t };\n\t }\n\t /**\n\t * Calculates the score of an object\n\t * against the search query.\n\t *\n\t */\n\n\n\t const scoreObject = function () {\n\t if (field_count === 1) {\n\t return function (token, data) {\n\t const field = fields[0].field;\n\t return scoreValue(getAttrFn(data, field), token, weights[field]);\n\t };\n\t }\n\n\t return function (token, data) {\n\t var sum = 0; // is the token specific to a field?\n\n\t if (token.field) {\n\t const value = getAttrFn(data, token.field);\n\n\t if (!token.regex && value) {\n\t sum += 1 / field_count;\n\t } else {\n\t sum += scoreValue(value, token, 1);\n\t }\n\t } else {\n\t iterate(weights, (weight, field) => {\n\t sum += scoreValue(getAttrFn(data, field), token, weight);\n\t });\n\t }\n\n\t return sum / field_count;\n\t };\n\t }();\n\n\t if (token_count === 1) {\n\t return function (data) {\n\t return scoreObject(tokens[0], data);\n\t };\n\t }\n\n\t if (search.options.conjunction === 'and') {\n\t return function (data) {\n\t var i = 0,\n\t score,\n\t sum = 0;\n\n\t for (; i < token_count; i++) {\n\t score = scoreObject(tokens[i], data);\n\t if (score <= 0) return 0;\n\t sum += score;\n\t }\n\n\t return sum / token_count;\n\t };\n\t } else {\n\t return function (data) {\n\t var sum = 0;\n\t iterate(tokens, token => {\n\t sum += scoreObject(token, data);\n\t });\n\t return sum / token_count;\n\t };\n\t }\n\t }\n\n\t /**\n\t * Returns a function that can be used to compare two\n\t * results, for sorting purposes. If no sorting should\n\t * be performed, `null` will be returned.\n\t *\n\t * @return function(a,b)\n\t */\n\t getSortFunction(query, options) {\n\t var search = this.prepareSearch(query, options);\n\t return this._getSortFunction(search);\n\t }\n\n\t _getSortFunction(search) {\n\t var i, n, implicit_score;\n\t const self = this,\n\t options = search.options,\n\t sort = !search.query && options.sort_empty ? options.sort_empty : options.sort,\n\t sort_flds = [],\n\t multipliers = [];\n\n\t if (typeof sort == 'function') {\n\t return sort.bind(this);\n\t }\n\t /**\n\t * Fetches the specified sort field value\n\t * from a search result item.\n\t *\n\t */\n\n\n\t const get_field = function get_field(name, result) {\n\t if (name === '$score') return result.score;\n\t return search.getAttrFn(self.items[result.id], name);\n\t }; // parse options\n\n\n\t if (sort) {\n\t for (i = 0, n = sort.length; i < n; i++) {\n\t if (search.query || sort[i].field !== '$score') {\n\t sort_flds.push(sort[i]);\n\t }\n\t }\n\t } // the \"$score\" field is implied to be the primary\n\t // sort field, unless it's manually specified\n\n\n\t if (search.query) {\n\t implicit_score = true;\n\n\t for (i = 0, n = sort_flds.length; i < n; i++) {\n\t if (sort_flds[i].field === '$score') {\n\t implicit_score = false;\n\t break;\n\t }\n\t }\n\n\t if (implicit_score) {\n\t sort_flds.unshift({\n\t field: '$score',\n\t direction: 'desc'\n\t });\n\t }\n\t } else {\n\t for (i = 0, n = sort_flds.length; i < n; i++) {\n\t if (sort_flds[i].field === '$score') {\n\t sort_flds.splice(i, 1);\n\t break;\n\t }\n\t }\n\t }\n\n\t for (i = 0, n = sort_flds.length; i < n; i++) {\n\t multipliers.push(sort_flds[i].direction === 'desc' ? -1 : 1);\n\t } // build function\n\n\n\t const sort_flds_count = sort_flds.length;\n\n\t if (!sort_flds_count) {\n\t return null;\n\t } else if (sort_flds_count === 1) {\n\t const sort_fld = sort_flds[0].field;\n\t const multiplier = multipliers[0];\n\t return function (a, b) {\n\t return multiplier * cmp(get_field(sort_fld, a), get_field(sort_fld, b));\n\t };\n\t } else {\n\t return function (a, b) {\n\t var i, result, field;\n\n\t for (i = 0; i < sort_flds_count; i++) {\n\t field = sort_flds[i].field;\n\t result = multipliers[i] * cmp(get_field(field, a), get_field(field, b));\n\t if (result) return result;\n\t }\n\n\t return 0;\n\t };\n\t }\n\t }\n\n\t /**\n\t * Parses a search query and returns an object\n\t * with tokens and fields ready to be populated\n\t * with results.\n\t *\n\t */\n\t prepareSearch(query, optsUser) {\n\t const weights = {};\n\t var options = Object.assign({}, optsUser);\n\t propToArray(options, 'sort');\n\t propToArray(options, 'sort_empty'); // convert fields to new format\n\n\t if (options.fields) {\n\t propToArray(options, 'fields');\n\t const fields = [];\n\t options.fields.forEach(field => {\n\t if (typeof field == 'string') {\n\t field = {\n\t field: field,\n\t weight: 1\n\t };\n\t }\n\n\t fields.push(field);\n\t weights[field.field] = 'weight' in field ? field.weight : 1;\n\t });\n\t options.fields = fields;\n\t }\n\n\t return {\n\t options: options,\n\t query: query.toLowerCase().trim(),\n\t tokens: this.tokenize(query, options.respect_word_boundaries, weights),\n\t total: 0,\n\t items: [],\n\t weights: weights,\n\t getAttrFn: options.nesting ? getAttrNesting : getAttr\n\t };\n\t }\n\n\t /**\n\t * Searches through all items and returns a sorted array of matches.\n\t *\n\t */\n\t search(query, options) {\n\t var self = this,\n\t score,\n\t search;\n\t search = this.prepareSearch(query, options);\n\t options = search.options;\n\t query = search.query; // generate result scoring function\n\n\t const fn_score = options.score || self._getScoreFunction(search); // perform search and sort\n\n\n\t if (query.length) {\n\t iterate(self.items, (item, id) => {\n\t score = fn_score(item);\n\n\t if (options.filter === false || score > 0) {\n\t search.items.push({\n\t 'score': score,\n\t 'id': id\n\t });\n\t }\n\t });\n\t } else {\n\t iterate(self.items, (item, id) => {\n\t search.items.push({\n\t 'score': 1,\n\t 'id': id\n\t });\n\t });\n\t }\n\n\t const fn_sort = self._getSortFunction(search);\n\n\t if (fn_sort) search.items.sort(fn_sort); // apply limits\n\n\t search.total = search.items.length;\n\n\t if (typeof options.limit === 'number') {\n\t search.items = search.items.slice(0, options.limit);\n\t }\n\n\t return search;\n\t }\n\n\t}\n\n\t/**\n\t * Return a dom element from either a dom query string, jQuery object, a dom element or html string\n\t * https://stackoverflow.com/questions/494143/creating-a-new-dom-element-from-an-html-string-using-built-in-dom-methods-or-pro/35385518#35385518\n\t *\n\t * param query should be {}\n\t */\n\n\tconst getDom = query => {\n\t if (query.jquery) {\n\t return query[0];\n\t }\n\n\t if (query instanceof HTMLElement) {\n\t return query;\n\t }\n\n\t if (query.indexOf('<') > -1) {\n\t let div = document.createElement('div');\n\t div.innerHTML = query.trim(); // Never return a text node of whitespace as the result\n\n\t return div.firstChild;\n\t }\n\n\t return document.querySelector(query);\n\t};\n\tconst escapeQuery = query => {\n\t return query.replace(/['\"\\\\]/g, '\\\\$&');\n\t};\n\t/**\n\t * Dispatch an event\n\t *\n\t */\n\n\tconst triggerEvent = (dom_el, event_name) => {\n\t var event = document.createEvent('HTMLEvents');\n\t event.initEvent(event_name, true, false);\n\t dom_el.dispatchEvent(event);\n\t};\n\t/**\n\t * Apply CSS rules to a dom element\n\t *\n\t */\n\n\tconst applyCSS = (dom_el, css) => {\n\t Object.assign(dom_el.style, css);\n\t};\n\t/**\n\t * Add css classes\n\t *\n\t */\n\n\tconst addClasses = (elmts, ...classes) => {\n\t var norm_classes = classesArray(classes);\n\t elmts = castAsArray(elmts);\n\t elmts.map(el => {\n\t norm_classes.map(cls => {\n\t el.classList.add(cls);\n\t });\n\t });\n\t};\n\t/**\n\t * Remove css classes\n\t *\n\t */\n\n\tconst removeClasses = (elmts, ...classes) => {\n\t var norm_classes = classesArray(classes);\n\t elmts = castAsArray(elmts);\n\t elmts.map(el => {\n\t norm_classes.map(cls => {\n\t el.classList.remove(cls);\n\t });\n\t });\n\t};\n\t/**\n\t * Return arguments\n\t *\n\t */\n\n\tconst classesArray = args => {\n\t var classes = [];\n\t iterate(args, _classes => {\n\t if (typeof _classes === 'string') {\n\t _classes = _classes.trim().split(/[\\11\\12\\14\\15\\40]/);\n\t }\n\n\t if (Array.isArray(_classes)) {\n\t classes = classes.concat(_classes);\n\t }\n\t });\n\t return classes.filter(Boolean);\n\t};\n\t/**\n\t * Create an array from arg if it's not already an array\n\t *\n\t */\n\n\tconst castAsArray = arg => {\n\t if (!Array.isArray(arg)) {\n\t arg = [arg];\n\t }\n\n\t return arg;\n\t};\n\t/**\n\t * Get the closest node to the evt.target matching the selector\n\t * Stops at wrapper\n\t *\n\t */\n\n\tconst parentMatch = (target, selector, wrapper) => {\n\t if (wrapper && !wrapper.contains(target)) {\n\t return;\n\t }\n\n\t while (target && target.matches) {\n\t if (target.matches(selector)) {\n\t return target;\n\t }\n\n\t target = target.parentNode;\n\t }\n\t};\n\t/**\n\t * Get the first or last item from an array\n\t *\n\t * > 0 - right (last)\n\t * <= 0 - left (first)\n\t *\n\t */\n\n\tconst getTail = (list, direction = 0) => {\n\t if (direction > 0) {\n\t return list[list.length - 1];\n\t }\n\n\t return list[0];\n\t};\n\t/**\n\t * Return true if an object is empty\n\t *\n\t */\n\n\tconst isEmptyObject = obj => {\n\t return Object.keys(obj).length === 0;\n\t};\n\t/**\n\t * Get the index of an element amongst sibling nodes of the same type\n\t *\n\t */\n\n\tconst nodeIndex = (el, amongst) => {\n\t if (!el) return -1;\n\t amongst = amongst || el.nodeName;\n\t var i = 0;\n\n\t while (el = el.previousElementSibling) {\n\t if (el.matches(amongst)) {\n\t i++;\n\t }\n\t }\n\n\t return i;\n\t};\n\t/**\n\t * Set attributes of an element\n\t *\n\t */\n\n\tconst setAttr = (el, attrs) => {\n\t iterate(attrs, (val, attr) => {\n\t if (val == null) {\n\t el.removeAttribute(attr);\n\t } else {\n\t el.setAttribute(attr, '' + val);\n\t }\n\t });\n\t};\n\t/**\n\t * Replace a node\n\t */\n\n\tconst replaceNode = (existing, replacement) => {\n\t if (existing.parentNode) existing.parentNode.replaceChild(replacement, existing);\n\t};\n\n\t/**\n\t * highlight v3 | MIT license | Johann Burkard <jb@eaio.com>\n\t * Highlights arbitrary terms in a node.\n\t *\n\t * - Modified by Marshal <beatgates@gmail.com> 2011-6-24 (added regex)\n\t * - Modified by Brian Reavis <brian@thirdroute.com> 2012-8-27 (cleanup)\n\t */\n\tconst highlight = (element, regex) => {\n\t if (regex === null) return; // convet string to regex\n\n\t if (typeof regex === 'string') {\n\t if (!regex.length) return;\n\t regex = new RegExp(regex, 'i');\n\t } // Wrap matching part of text node with highlighting <span>, e.g.\n\t // Soccer -> <span class=\"highlight\">Soc</span>cer for regex = /soc/i\n\n\n\t const highlightText = node => {\n\t var match = node.data.match(regex);\n\n\t if (match && node.data.length > 0) {\n\t var spannode = document.createElement('span');\n\t spannode.className = 'highlight';\n\t var middlebit = node.splitText(match.index);\n\t middlebit.splitText(match[0].length);\n\t var middleclone = middlebit.cloneNode(true);\n\t spannode.appendChild(middleclone);\n\t replaceNode(middlebit, spannode);\n\t return 1;\n\t }\n\n\t return 0;\n\t }; // Recurse element node, looking for child text nodes to highlight, unless element\n\t // is childless, <script>, <style>, or already highlighted: <span class=\"hightlight\">\n\n\n\t const highlightChildren = node => {\n\t if (node.nodeType === 1 && node.childNodes && !/(script|style)/i.test(node.tagName) && (node.className !== 'highlight' || node.tagName !== 'SPAN')) {\n\t for (var i = 0; i < node.childNodes.length; ++i) {\n\t i += highlightRecursive(node.childNodes[i]);\n\t }\n\t }\n\t };\n\n\t const highlightRecursive = node => {\n\t if (node.nodeType === 3) {\n\t return highlightText(node);\n\t }\n\n\t highlightChildren(node);\n\t return 0;\n\t };\n\n\t highlightRecursive(element);\n\t};\n\t/**\n\t * removeHighlight fn copied from highlight v5 and\n\t * edited to remove with(), pass js strict mode, and use without jquery\n\t */\n\n\tconst removeHighlight = el => {\n\t var elements = el.querySelectorAll(\"span.highlight\");\n\t Array.prototype.forEach.call(elements, function (el) {\n\t var parent = el.parentNode;\n\t parent.replaceChild(el.firstChild, el);\n\t parent.normalize();\n\t });\n\t};\n\n\tconst KEY_A = 65;\n\tconst KEY_RETURN = 13;\n\tconst KEY_ESC = 27;\n\tconst KEY_LEFT = 37;\n\tconst KEY_UP = 38;\n\tconst KEY_RIGHT = 39;\n\tconst KEY_DOWN = 40;\n\tconst KEY_BACKSPACE = 8;\n\tconst KEY_DELETE = 46;\n\tconst KEY_TAB = 9;\n\tconst IS_MAC = typeof navigator === 'undefined' ? false : /Mac/.test(navigator.userAgent);\n\tconst KEY_SHORTCUT = IS_MAC ? 'metaKey' : 'ctrlKey'; // ctrl key or apple key for ma\n\n\tvar defaults = {\n\t options: [],\n\t optgroups: [],\n\t plugins: [],\n\t delimiter: ',',\n\t splitOn: null,\n\t // regexp or string for splitting up values from a paste command\n\t persist: true,\n\t diacritics: true,\n\t create: null,\n\t createOnBlur: false,\n\t createFilter: null,\n\t highlight: true,\n\t openOnFocus: true,\n\t shouldOpen: null,\n\t maxOptions: 50,\n\t maxItems: null,\n\t hideSelected: null,\n\t duplicates: false,\n\t addPrecedence: false,\n\t selectOnTab: false,\n\t preload: null,\n\t allowEmptyOption: false,\n\t //closeAfterSelect: false,\n\t loadThrottle: 300,\n\t loadingClass: 'loading',\n\t dataAttr: null,\n\t //'data-data',\n\t optgroupField: 'optgroup',\n\t valueField: 'value',\n\t labelField: 'text',\n\t disabledField: 'disabled',\n\t optgroupLabelField: 'label',\n\t optgroupValueField: 'value',\n\t lockOptgroupOrder: false,\n\t sortField: '$order',\n\t searchField: ['text'],\n\t searchConjunction: 'and',\n\t mode: null,\n\t wrapperClass: 'ts-wrapper',\n\t controlClass: 'ts-control',\n\t dropdownClass: 'ts-dropdown',\n\t dropdownContentClass: 'ts-dropdown-content',\n\t itemClass: 'item',\n\t optionClass: 'option',\n\t dropdownParent: null,\n\t //controlInput: null,\n\t copyClassesToDropdown: false,\n\t placeholder: null,\n\t hidePlaceholder: null,\n\t shouldLoad: function (query) {\n\t return query.length > 0;\n\t },\n\n\t /*\n\t load : null, // function(query, callback) { ... }\n\t score : null, // function(search) { ... }\n\t onInitialize : null, // function() { ... }\n\t onChange : null, // function(value) { ... }\n\t onItemAdd : null, // function(value, $item) { ... }\n\t onItemRemove : null, // function(value) { ... }\n\t onClear : null, // function() { ... }\n\t onOptionAdd : null, // function(value, data) { ... }\n\t onOptionRemove : null, // function(value) { ... }\n\t onOptionClear : null, // function() { ... }\n\t onOptionGroupAdd : null, // function(id, data) { ... }\n\t onOptionGroupRemove : null, // function(id) { ... }\n\t onOptionGroupClear : null, // function() { ... }\n\t onDropdownOpen : null, // function(dropdown) { ... }\n\t onDropdownClose : null, // function(dropdown) { ... }\n\t onType : null, // function(str) { ... }\n\t onDelete : null, // function(values) { ... }\n\t */\n\t render: {\n\t /*\n\t item: null,\n\t optgroup: null,\n\t optgroup_header: null,\n\t option: null,\n\t option_create: null\n\t */\n\t }\n\t};\n\n\t/**\n\t * Converts a scalar to its best string representation\n\t * for hash keys and HTML attribute values.\n\t *\n\t * Transformations:\n\t * 'str' -> 'str'\n\t * null -> ''\n\t * undefined -> ''\n\t * true -> '1'\n\t * false -> '0'\n\t * 0 -> '0'\n\t * 1 -> '1'\n\t *\n\t */\n\tconst hash_key = value => {\n\t if (typeof value === 'undefined' || value === null) return null;\n\t return get_hash(value);\n\t};\n\tconst get_hash = value => {\n\t if (typeof value === 'boolean') return value ? '1' : '0';\n\t return value + '';\n\t};\n\t/**\n\t * Escapes a string for use within HTML.\n\t *\n\t */\n\n\tconst escape_html = str => {\n\t return (str + '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"');\n\t};\n\t/**\n\t * Debounce the user provided load function\n\t *\n\t */\n\n\tconst loadDebounce = (fn, delay) => {\n\t var timeout;\n\t return function (value, callback) {\n\t var self = this;\n\n\t if (timeout) {\n\t self.loading = Math.max(self.loading - 1, 0);\n\t clearTimeout(timeout);\n\t }\n\n\t timeout = setTimeout(function () {\n\t timeout = null;\n\t self.loadedSearches[value] = true;\n\t fn.call(self, value, callback);\n\t }, delay);\n\t };\n\t};\n\t/**\n\t * Debounce all fired events types listed in `types`\n\t * while executing the provided `fn`.\n\t *\n\t */\n\n\tconst debounce_events = (self, types, fn) => {\n\t var type;\n\t var trigger = self.trigger;\n\t var event_args = {}; // override trigger method\n\n\t self.trigger = function () {\n\t var type = arguments[0];\n\n\t if (types.indexOf(type) !== -1) {\n\t event_args[type] = arguments;\n\t } else {\n\t return trigger.apply(self, arguments);\n\t }\n\t }; // invoke provided function\n\n\n\t fn.apply(self, []);\n\t self.trigger = trigger; // trigger queued events\n\n\t for (type in event_args) {\n\t trigger.apply(self, event_args[type]);\n\t }\n\t};\n\t/**\n\t * Determines the current selection within a text input control.\n\t * Returns an object containing:\n\t * - start\n\t * - length\n\t *\n\t */\n\n\tconst getSelection = input => {\n\t return {\n\t start: input.selectionStart || 0,\n\t length: (input.selectionEnd || 0) - (input.selectionStart || 0)\n\t };\n\t};\n\t/**\n\t * Prevent default\n\t *\n\t */\n\n\tconst preventDefault = (evt, stop = false) => {\n\t if (evt) {\n\t evt.preventDefault();\n\n\t if (stop) {\n\t evt.stopPropagation();\n\t }\n\t }\n\t};\n\t/**\n\t * Prevent default\n\t *\n\t */\n\n\tconst addEvent = (target, type, callback, options) => {\n\t target.addEventListener(type, callback, options);\n\t};\n\t/**\n\t * Return true if the requested key is down\n\t * Will return false if more than one control character is pressed ( when [ctrl+shift+a] != [ctrl+a] )\n\t * The current evt may not always set ( eg calling advanceSelection() )\n\t *\n\t */\n\n\tconst isKeyDown = (key_name, evt) => {\n\t if (!evt) {\n\t return false;\n\t }\n\n\t if (!evt[key_name]) {\n\t return false;\n\t }\n\n\t var count = (evt.altKey ? 1 : 0) + (evt.ctrlKey ? 1 : 0) + (evt.shiftKey ? 1 : 0) + (evt.metaKey ? 1 : 0);\n\n\t if (count === 1) {\n\t return true;\n\t }\n\n\t return false;\n\t};\n\t/**\n\t * Get the id of an element\n\t * If the id attribute is not set, set the attribute with the given id\n\t *\n\t */\n\n\tconst getId = (el, id) => {\n\t const existing_id = el.getAttribute('id');\n\n\t if (existing_id) {\n\t return existing_id;\n\t }\n\n\t el.setAttribute('id', id);\n\t return id;\n\t};\n\t/**\n\t * Returns a string with backslashes added before characters that need to be escaped.\n\t */\n\n\tconst addSlashes = str => {\n\t return str.replace(/[\\\\\"']/g, '\\\\$&');\n\t};\n\t/**\n\t *\n\t */\n\n\tconst append = (parent, node) => {\n\t if (node) parent.append(node);\n\t};\n\n\tfunction getSettings(input, settings_user) {\n\t var settings = Object.assign({}, defaults, settings_user);\n\t var attr_data = settings.dataAttr;\n\t var field_label = settings.labelField;\n\t var field_value = settings.valueField;\n\t var field_disabled = settings.disabledField;\n\t var field_optgroup = settings.optgroupField;\n\t var field_optgroup_label = settings.optgroupLabelField;\n\t var field_optgroup_value = settings.optgroupValueField;\n\t var tag_name = input.tagName.toLowerCase();\n\t var placeholder = input.getAttribute('placeholder') || input.getAttribute('data-placeholder');\n\n\t if (!placeholder && !settings.allowEmptyOption) {\n\t let option = input.querySelector('option[value=\"\"]');\n\n\t if (option) {\n\t placeholder = option.textContent;\n\t }\n\t }\n\n\t var settings_element = {\n\t placeholder: placeholder,\n\t options: [],\n\t optgroups: [],\n\t items: [],\n\t maxItems: null\n\t };\n\t /**\n\t * Initialize from a <select> element.\n\t *\n\t */\n\n\t var init_select = () => {\n\t var tagName;\n\t var options = settings_element.options;\n\t var optionsMap = {};\n\t var group_count = 1;\n\n\t var readData = el => {\n\t var data = Object.assign({}, el.dataset); // get plain object from DOMStringMap\n\n\t var json = attr_data && data[attr_data];\n\n\t if (typeof json === 'string' && json.length) {\n\t data = Object.assign(data, JSON.parse(json));\n\t }\n\n\t return data;\n\t };\n\n\t var addOption = (option, group) => {\n\t var value = hash_key(option.value);\n\t if (value == null) return;\n\t if (!value && !settings.allowEmptyOption) return; // if the option already exists, it's probably been\n\t // duplicated in another optgroup. in this case, push\n\t // the current group to the \"optgroup\" property on the\n\t // existing option so that it's rendered in both places.\n\n\t if (optionsMap.hasOwnProperty(value)) {\n\t if (group) {\n\t var arr = optionsMap[value][field_optgroup];\n\n\t if (!arr) {\n\t optionsMap[value][field_optgroup] = group;\n\t } else if (!Array.isArray(arr)) {\n\t optionsMap[value][field_optgroup] = [arr, group];\n\t } else {\n\t arr.push(group);\n\t }\n\t }\n\t } else {\n\t var option_data = readData(option);\n\t option_data[field_label] = option_data[field_label] || option.textContent;\n\t option_data[field_value] = option_data[field_value] || value;\n\t option_data[field_disabled] = option_data[field_disabled] || option.disabled;\n\t option_data[field_optgroup] = option_data[field_optgroup] || group;\n\t option_data.$option = option;\n\t optionsMap[value] = option_data;\n\t options.push(option_data);\n\t }\n\n\t if (option.selected) {\n\t settings_element.items.push(value);\n\t }\n\t };\n\n\t var addGroup = optgroup => {\n\t var id, optgroup_data;\n\t optgroup_data = readData(optgroup);\n\t optgroup_data[field_optgroup_label] = optgroup_data[field_optgroup_label] || optgroup.getAttribute('label') || '';\n\t optgroup_data[field_optgroup_value] = optgroup_data[field_optgroup_value] || group_count++;\n\t optgroup_data[field_disabled] = optgroup_data[field_disabled] || optgroup.disabled;\n\t settings_element.optgroups.push(optgroup_data);\n\t id = optgroup_data[field_optgroup_value];\n\t iterate(optgroup.children, option => {\n\t addOption(option, id);\n\t });\n\t };\n\n\t settings_element.maxItems = input.hasAttribute('multiple') ? null : 1;\n\t iterate(input.children, child => {\n\t tagName = child.tagName.toLowerCase();\n\n\t if (tagName === 'optgroup') {\n\t addGroup(child);\n\t } else if (tagName === 'option') {\n\t addOption(child);\n\t }\n\t });\n\t };\n\t /**\n\t * Initialize from a <input type=\"text\"> element.\n\t *\n\t */\n\n\n\t var init_textbox = () => {\n\t const data_raw = input.getAttribute(attr_data);\n\n\t if (!data_raw) {\n\t var value = input.value.trim() || '';\n\t if (!settings.allowEmptyOption && !value.length) return;\n\t const values = value.split(settings.delimiter);\n\t iterate(values, value => {\n\t const option = {};\n\t option[field_label] = value;\n\t option[field_value] = value;\n\t settings_element.options.push(option);\n\t });\n\t settings_element.items = values;\n\t } else {\n\t settings_element.options = JSON.parse(data_raw);\n\t iterate(settings_element.options, opt => {\n\t settings_element.items.push(opt[field_value]);\n\t });\n\t }\n\t };\n\n\t if (tag_name === 'select') {\n\t init_select();\n\t } else {\n\t init_textbox();\n\t }\n\n\t return Object.assign({}, defaults, settings_element, settings_user);\n\t}\n\n\tvar instance_i = 0;\n\tclass TomSelect extends MicroPlugin(MicroEvent) {\n\t // @deprecated 1.8\n\t constructor(input_arg, user_settings) {\n\t super();\n\t this.order = 0;\n\t this.isOpen = false;\n\t this.isDisabled = false;\n\t this.isInvalid = false;\n\t this.isValid = true;\n\t this.isLocked = false;\n\t this.isFocused = false;\n\t this.isInputHidden = false;\n\t this.isSetup = false;\n\t this.ignoreFocus = false;\n\t this.hasOptions = false;\n\t this.lastValue = '';\n\t this.caretPos = 0;\n\t this.loading = 0;\n\t this.loadedSearches = {};\n\t this.activeOption = null;\n\t this.activeItems = [];\n\t this.optgroups = {};\n\t this.options = {};\n\t this.userOptions = {};\n\t this.items = [];\n\t instance_i++;\n\t var dir;\n\t var input = getDom(input_arg);\n\n\t if (input.tomselect) {\n\t throw new Error('Tom Select already initialized on this element');\n\t }\n\n\t input.tomselect = this; // detect rtl environment\n\n\t var computedStyle = window.getComputedStyle && window.getComputedStyle(input, null);\n\t dir = computedStyle.getPropertyValue('direction'); // setup default state\n\n\t const settings = getSettings(input, user_settings);\n\t this.settings = settings;\n\t this.input = input;\n\t this.tabIndex = input.tabIndex || 0;\n\t this.is_select_tag = input.tagName.toLowerCase() === 'select';\n\t this.rtl = /rtl/i.test(dir);\n\t this.inputId = getId(input, 'tomselect-' + instance_i);\n\t this.isRequired = input.required; // search system\n\n\t this.sifter = new Sifter(this.options, {\n\t diacritics: settings.diacritics\n\t }); // option-dependent defaults\n\n\t settings.mode = settings.mode || (settings.maxItems === 1 ? 'single' : 'multi');\n\n\t if (typeof settings.hideSelected !== 'boolean') {\n\t settings.hideSelected = settings.mode === 'multi';\n\t }\n\n\t if (typeof settings.hidePlaceholder !== 'boolean') {\n\t settings.hidePlaceholder = settings.mode !== 'multi';\n\t } // set up createFilter callback\n\n\n\t var filter = settings.createFilter;\n\n\t if (typeof filter !== 'function') {\n\t if (typeof filter === 'string') {\n\t filter = new RegExp(filter);\n\t }\n\n\t if (filter instanceof RegExp) {\n\t settings.createFilter = input => filter.test(input);\n\t } else {\n\t settings.createFilter = () => true;\n\t }\n\t }\n\n\t this.initializePlugins(settings.plugins);\n\t this.setupCallbacks();\n\t this.setupTemplates(); // Create all elements\n\n\t const wrapper = getDom('<div>');\n\t const control = getDom('<div>');\n\n\t const dropdown = this._render('dropdown');\n\n\t const dropdown_content = getDom(`<div role=\"listbox\" tabindex=\"-1\">`);\n\t const classes = this.input.getAttribute('class') || '';\n\t const inputMode = settings.mode;\n\t var control_input;\n\t addClasses(wrapper, settings.wrapperClass, classes, inputMode);\n\t addClasses(control, settings.controlClass);\n\t append(wrapper, control);\n\t addClasses(dropdown, settings.dropdownClass, inputMode);\n\n\t if (settings.copyClassesToDropdown) {\n\t addClasses(dropdown, classes);\n\t }\n\n\t addClasses(dropdown_content, settings.dropdownContentClass);\n\t append(dropdown, dropdown_content);\n\t getDom(settings.dropdownParent || wrapper).appendChild(dropdown); // default controlInput\n\n\t if (!settings.hasOwnProperty('controlInput')) {\n\t control_input = getDom('<input type=\"text\" autocomplete=\"off\" size=\"1\" />'); // set attributes\n\n\t var attrs = ['autocorrect', 'autocapitalize', 'autocomplete'];\n\t iterate(attrs, attr => {\n\t if (input.getAttribute(attr)) {\n\t setAttr(control_input, {\n\t [attr]: input.getAttribute(attr)\n\t });\n\t }\n\t });\n\t control_input.tabIndex = -1;\n\t control.appendChild(control_input);\n\t this.focus_node = control_input; // custom controlInput\n\t } else if (settings.controlInput) {\n\t control_input = getDom(settings.controlInput);\n\t this.focus_node = control_input; // controlInput = null\n\t } else {\n\t control_input = getDom('<input/>');\n\t this.focus_node = control;\n\t }\n\n\t this.wrapper = wrapper;\n\t this.dropdown = dropdown;\n\t this.dropdown_content = dropdown_content;\n\t this.control = control;\n\t this.control_input = control_input;\n\t this.setup();\n\t }\n\t /**\n\t * set up event bindings.\n\t *\n\t */\n\n\n\t setup() {\n\t const self = this;\n\t const settings = self.settings;\n\t const control_input = self.control_input;\n\t const dropdown = self.dropdown;\n\t const dropdown_content = self.dropdown_content;\n\t const wrapper = self.wrapper;\n\t const control = self.control;\n\t const input = self.input;\n\t const focus_node = self.focus_node;\n\t const passive_event = {\n\t passive: true\n\t };\n\t const listboxId = self.inputId + '-ts-dropdown';\n\t setAttr(dropdown_content, {\n\t id: listboxId\n\t });\n\t setAttr(focus_node, {\n\t role: 'combobox',\n\t 'aria-haspopup': 'listbox',\n\t 'aria-expanded': 'false',\n\t 'aria-controls': listboxId\n\t });\n\t const control_id = getId(focus_node, self.inputId + '-ts-control');\n\t const query = \"label[for='\" + escapeQuery(self.inputId) + \"']\";\n\t const label = document.querySelector(query);\n\t const label_click = self.focus.bind(self);\n\n\t if (label) {\n\t addEvent(label, 'click', label_click);\n\t setAttr(label, {\n\t for: control_id\n\t });\n\t const label_id = getId(label, self.inputId + '-ts-label');\n\t setAttr(focus_node, {\n\t 'aria-labelledby': label_id\n\t });\n\t setAttr(dropdown_content, {\n\t 'aria-labelledby': label_id\n\t });\n\t }\n\n\t wrapper.style.width = input.style.width;\n\n\t if (self.plugins.names.length) {\n\t const classes_plugins = 'plugin-' + self.plugins.names.join(' plugin-');\n\t addClasses([wrapper, dropdown], classes_plugins);\n\t }\n\n\t if ((settings.maxItems === null || settings.maxItems > 1) && self.is_select_tag) {\n\t setAttr(input, {\n\t multiple: 'multiple'\n\t });\n\t }\n\n\t if (self.settings.placeholder) {\n\t setAttr(control_input, {\n\t placeholder: settings.placeholder\n\t });\n\t } // if splitOn was not passed in, construct it from the delimiter to allow pasting universally\n\n\n\t if (!self.settings.splitOn && self.settings.delimiter) {\n\t self.settings.splitOn = new RegExp('\\\\s*' + escape_regex(self.settings.delimiter) + '+\\\\s*');\n\t } // debounce user defined load() if loadThrottle > 0\n\t // after initializePlugins() so plugins can create/modify user defined loaders\n\n\n\t if (settings.load && settings.loadThrottle) {\n\t settings.load = loadDebounce(settings.load, settings.loadThrottle);\n\t }\n\n\t self.control_input.type = input.type; // clicking on an option should select it\n\n\t addEvent(dropdown, 'click', evt => {\n\t const option = parentMatch(evt.target, '[data-selectable]');\n\n\t if (option) {\n\t self.onOptionSelect(evt, option);\n\t preventDefault(evt, true);\n\t }\n\t });\n\t addEvent(control, 'click', evt => {\n\t var target_match = parentMatch(evt.target, '[data-ts-item]', control);\n\n\t if (target_match && self.onItemSelect(evt, target_match)) {\n\t preventDefault(evt, true);\n\t return;\n\t } // retain focus (see control_input mousedown)\n\n\n\t if (control_input.value != '') {\n\t return;\n\t }\n\n\t self.onClick();\n\t preventDefault(evt, true);\n\t }); // retain focus by preventing native handling. if the\n\t // event target is the input it should not be modified.\n\t // otherwise, text selection within the input won't work.\n\n\t addEvent(control_input, 'mousedown', e => {\n\t if (control_input.value !== '') {\n\t e.stopPropagation();\n\t }\n\t }); // keydown on focus_node for arrow_down/arrow_up\n\n\t addEvent(focus_node, 'keydown', e => self.onKeyDown(e)); // keypress and input/keyup\n\n\t addEvent(control_input, 'keypress', e => self.onKeyPress(e));\n\t addEvent(control_input, 'input', e => self.onInput(e));\n\t addEvent(focus_node, 'resize', () => self.positionDropdown(), passive_event);\n\t addEvent(focus_node, 'blur', e => self.onBlur(e));\n\t addEvent(focus_node, 'focus', e => self.onFocus(e));\n\t addEvent(focus_node, 'paste', e => self.onPaste(e));\n\n\t const doc_mousedown = evt => {\n\t // blur if target is outside of this instance\n\t // dropdown is not always inside wrapper\n\t const target = evt.composedPath()[0];\n\n\t if (!wrapper.contains(target) && !dropdown.contains(target)) {\n\t if (self.isFocused) {\n\t self.blur();\n\t }\n\n\t self.inputState();\n\t return;\n\t } // clicking anywhere in the control should not blur the control_input & close the dropdown\n\n\n\t preventDefault(evt, true);\n\t };\n\n\t var win_scroll = () => {\n\t if (self.isOpen) {\n\t self.positionDropdown();\n\t }\n\t };\n\n\t addEvent(document, 'mousedown', doc_mousedown);\n\t addEvent(window, 'scroll', win_scroll, passive_event);\n\t addEvent(window, 'resize', win_scroll, passive_event);\n\n\t this._destroy = () => {\n\t document.removeEventListener('mousedown', doc_mousedown);\n\t window.removeEventListener('sroll', win_scroll);\n\t window.removeEventListener('resize', win_scroll);\n\t if (label) label.removeEventListener('click', label_click);\n\t }; // store original html and tab index so that they can be\n\t // restored when the destroy() method is called.\n\n\n\t this.revertSettings = {\n\t innerHTML: input.innerHTML,\n\t tabIndex: input.tabIndex\n\t };\n\t input.tabIndex = -1;\n\t input.insertAdjacentElement('afterend', self.wrapper);\n\t self.sync(false);\n\t settings.items = [];\n\t delete settings.optgroups;\n\t delete settings.options;\n\t addEvent(input, 'invalid', e => {\n\t if (self.isValid) {\n\t self.isValid = false;\n\t self.isInvalid = true;\n\t self.refreshState();\n\t }\n\t });\n\t self.updateOriginalInput();\n\t self.refreshItems();\n\t self.close(false);\n\t self.inputState();\n\t self.isSetup = true;\n\n\t if (input.disabled) {\n\t self.disable();\n\t } else {\n\t self.enable(); //sets tabIndex\n\t }\n\n\t self.on('change', this.onChange);\n\t addClasses(input, 'tomselected', 'ts-hidden-accessible');\n\t self.trigger('initialize'); // preload options\n\n\t if (settings.preload === true) {\n\t self.preload();\n\t }\n\t }\n\t /**\n\t * Register options and optgroups\n\t *\n\t */\n\n\n\t setupOptions(options = [], optgroups = []) {\n\t // build options table\n\t this.addOptions(options); // build optgroup table\n\n\t iterate(optgroups, optgroup => {\n\t this.registerOptionGroup(optgroup);\n\t });\n\t }\n\t /**\n\t * Sets up default rendering functions.\n\t */\n\n\n\t setupTemplates() {\n\t var self = this;\n\t var field_label = self.settings.labelField;\n\t var field_optgroup = self.settings.optgroupLabelField;\n\t var templates = {\n\t 'optgroup': data => {\n\t let optgroup = document.createElement('div');\n\t optgroup.className = 'optgroup';\n\t optgroup.appendChild(data.options);\n\t return optgroup;\n\t },\n\t 'optgroup_header': (data, escape) => {\n\t return '<div class=\"optgroup-header\">' + escape(data[field_optgroup]) + '</div>';\n\t },\n\t 'option': (data, escape) => {\n\t return '<div>' + escape(data[field_label]) + '</div>';\n\t },\n\t 'item': (data, escape) => {\n\t return '<div>' + escape(data[field_label]) + '</div>';\n\t },\n\t 'option_create': (data, escape) => {\n\t return '<div class=\"create\">Add <strong>' + escape(data.input) + '</strong>…</div>';\n\t },\n\t 'no_results': () => {\n\t return '<div class=\"no-results\">No results found</div>';\n\t },\n\t 'loading': () => {\n\t return '<div class=\"spinner\"></div>';\n\t },\n\t 'not_loading': () => {},\n\t 'dropdown': () => {\n\t return '<div></div>';\n\t }\n\t };\n\t self.settings.render = Object.assign({}, templates, self.settings.render);\n\t }\n\t /**\n\t * Maps fired events to callbacks provided\n\t * in the settings used when creating the control.\n\t */\n\n\n\t setupCallbacks() {\n\t var key, fn;\n\t var callbacks = {\n\t 'initialize': 'onInitialize',\n\t 'change': 'onChange',\n\t 'item_add': 'onItemAdd',\n\t 'item_remove': 'onItemRemove',\n\t 'item_select': 'onItemSelect',\n\t 'clear': 'onClear',\n\t 'option_add': 'onOptionAdd',\n\t 'option_remove': 'onOptionRemove',\n\t 'option_clear': 'onOptionClear',\n\t 'optgroup_add': 'onOptionGroupAdd',\n\t 'optgroup_remove': 'onOptionGroupRemove',\n\t 'optgroup_clear': 'onOptionGroupClear',\n\t 'dropdown_open': 'onDropdownOpen',\n\t 'dropdown_close': 'onDropdownClose',\n\t 'type': 'onType',\n\t 'load': 'onLoad',\n\t 'focus': 'onFocus',\n\t 'blur': 'onBlur'\n\t };\n\n\t for (key in callbacks) {\n\t fn = this.settings[callbacks[key]];\n\t if (fn) this.on(key, fn);\n\t }\n\t }\n\t /**\n\t * Sync the Tom Select instance with the original input or select\n\t *\n\t */\n\n\n\t sync(get_settings = true) {\n\t const self = this;\n\t const settings = get_settings ? getSettings(self.input, {\n\t delimiter: self.settings.delimiter\n\t }) : self.settings;\n\t self.setupOptions(settings.options, settings.optgroups);\n\t self.setValue(settings.items, true); // silent prevents recursion\n\n\t self.lastQuery = null; // so updated options will be displayed in dropdown\n\t }\n\t /**\n\t * Triggered when the main control element\n\t * has a click event.\n\t *\n\t */\n\n\n\t onClick() {\n\t var self = this;\n\n\t if (self.activeItems.length > 0) {\n\t self.clearActiveItems();\n\t self.focus();\n\t return;\n\t }\n\n\t if (self.isFocused && self.isOpen) {\n\t self.blur();\n\t } else {\n\t self.focus();\n\t }\n\t }\n\t /**\n\t * @deprecated v1.7\n\t *\n\t */\n\n\n\t onMouseDown() {}\n\t /**\n\t * Triggered when the value of the control has been changed.\n\t * This should propagate the event to the original DOM\n\t * input / select element.\n\t */\n\n\n\t onChange() {\n\t triggerEvent(this.input, 'input');\n\t triggerEvent(this.input, 'change');\n\t }\n\t /**\n\t * Triggered on <input> paste.\n\t *\n\t */\n\n\n\t onPaste(e) {\n\t var self = this;\n\n\t if (self.isFull() || self.isInputHidden || self.isLocked) {\n\t preventDefault(e);\n\t return;\n\t } // If a regex or string is included, this will split the pasted\n\t // input and create Items for each separate value\n\n\n\t if (self.settings.splitOn) {\n\t // Wait for pasted text to be recognized in value\n\t setTimeout(() => {\n\t var pastedText = self.inputValue();\n\n\t if (!pastedText.match(self.settings.splitOn)) {\n\t return;\n\t }\n\n\t var splitInput = pastedText.trim().split(self.settings.splitOn);\n\t iterate(splitInput, piece => {\n\t self.createItem(piece);\n\t });\n\t }, 0);\n\t }\n\t }\n\t /**\n\t * Triggered on <input> keypress.\n\t *\n\t */\n\n\n\t onKeyPress(e) {\n\t var self = this;\n\n\t if (self.isLocked) {\n\t preventDefault(e);\n\t return;\n\t }\n\n\t var character = String.fromCharCode(e.keyCode || e.which);\n\n\t if (self.settings.create && self.settings.mode === 'multi' && character === self.settings.delimiter) {\n\t self.createItem();\n\t preventDefault(e);\n\t return;\n\t }\n\t }\n\t /**\n\t * Triggered on <input> keydown.\n\t *\n\t */\n\n\n\t onKeyDown(e) {\n\t var self = this;\n\n\t if (self.isLocked) {\n\t if (e.keyCode !== KEY_TAB) {\n\t preventDefault(e);\n\t }\n\n\t return;\n\t }\n\n\t switch (e.keyCode) {\n\t // ctrl+A: select all\n\t case KEY_A:\n\t if (isKeyDown(KEY_SHORTCUT, e)) {\n\t preventDefault(e);\n\t self.selectAll();\n\t return;\n\t }\n\n\t break;\n\t // esc: close dropdown\n\n\t case KEY_ESC:\n\t if (self.isOpen) {\n\t preventDefault(e, true);\n\t self.close();\n\t }\n\n\t self.clearActiveItems();\n\t return;\n\t // down: open dropdown or move selection down\n\n\t case KEY_DOWN:\n\t if (!self.isOpen && self.hasOptions) {\n\t self.open();\n\t } else if (self.activeOption) {\n\t let next = self.getAdjacent(self.activeOption, 1);\n\t if (next) self.setActiveOption(next);\n\t }\n\n\t preventDefault(e);\n\t return;\n\t // up: move selection up\n\n\t case KEY_UP:\n\t if (self.activeOption) {\n\t let prev = self.getAdjacent(self.activeOption, -1);\n\t if (prev) self.setActiveOption(prev);\n\t }\n\n\t preventDefault(e);\n\t return;\n\t // return: select active option\n\n\t case KEY_RETURN:\n\t if (self.isOpen && self.activeOption) {\n\t self.onOptionSelect(e, self.activeOption);\n\t preventDefault(e); // if the option_create=null, the dropdown might be closed\n\t } else if (self.settings.create && self.createItem()) {\n\t preventDefault(e);\n\t }\n\n\t return;\n\t // left: modifiy item selection to the left\n\n\t case KEY_LEFT:\n\t self.advanceSelection(-1, e);\n\t return;\n\t // right: modifiy item selection to the right\n\n\t case KEY_RIGHT:\n\t self.advanceSelection(1, e);\n\t return;\n\t // tab: select active option and/or create item\n\n\t case KEY_TAB:\n\t if (self.settings.selectOnTab) {\n\t if (self.isOpen && self.activeOption) {\n\t self.onOptionSelect(e, self.activeOption); // prevent default [tab] behaviour of jump to the next field\n\t // if select isFull, then the dropdown won't be open and [tab] will work normally\n\n\t preventDefault(e);\n\t }\n\n\t if (self.settings.create && self.createItem()) {\n\t preventDefault(e);\n\t }\n\t }\n\n\t return;\n\t // delete|backspace: delete items\n\n\t case KEY_BACKSPACE:\n\t case KEY_DELETE:\n\t self.deleteSelection(e);\n\t return;\n\t } // don't enter text in the control_input when active items are selected\n\n\n\t if (self.isInputHidden && !isKeyDown(KEY_SHORTCUT, e)) {\n\t preventDefault(e);\n\t }\n\t }\n\t /**\n\t * Triggered on <input> keyup.\n\t *\n\t */\n\n\n\t onInput(e) {\n\t var self = this;\n\n\t if (self.isLocked) {\n\t return;\n\t }\n\n\t var value = self.inputValue();\n\n\t if (self.lastValue !== value) {\n\t self.lastValue = value;\n\n\t if (self.settings.shouldLoad.call(self, value)) {\n\t self.load(value);\n\t }\n\n\t self.refreshOptions();\n\t self.trigger('type', value);\n\t }\n\t }\n\t /**\n\t * Triggered on <input> focus.\n\t *\n\t */\n\n\n\t onFocus(e) {\n\t var self = this;\n\t var wasFocused = self.isFocused;\n\n\t if (self.isDisabled) {\n\t self.blur();\n\t preventDefault(e);\n\t return;\n\t }\n\n\t if (self.ignoreFocus) return;\n\t self.isFocused = true;\n\t if (self.settings.preload === 'focus') self.preload();\n\t if (!wasFocused) self.trigger('focus');\n\n\t if (!self.activeItems.length) {\n\t self.showInput();\n\t self.refreshOptions(!!self.settings.openOnFocus);\n\t }\n\n\t self.refreshState();\n\t }\n\t /**\n\t * Triggered on <input> blur.\n\t *\n\t */\n\n\n\t onBlur(e) {\n\t if (document.hasFocus() === false) return;\n\t var self = this;\n\t if (!self.isFocused) return;\n\t self.isFocused = false;\n\t self.ignoreFocus = false;\n\n\t var deactivate = () => {\n\t self.close();\n\t self.setActiveItem();\n\t self.setCaret(self.items.length);\n\t self.trigger('blur');\n\t };\n\n\t if (self.settings.create && self.settings.createOnBlur) {\n\t self.createItem(null, false, deactivate);\n\t } else {\n\t deactivate();\n\t }\n\t }\n\t /**\n\t * Triggered when the user clicks on an option\n\t * in the autocomplete dropdown menu.\n\t *\n\t */\n\n\n\t onOptionSelect(evt, option) {\n\t var value,\n\t self = this;\n\n\t if (!option) {\n\t return;\n\t } // should not be possible to trigger a option under a disabled optgroup\n\n\n\t if (option.parentElement && option.parentElement.matches('[data-disabled]')) {\n\t return;\n\t }\n\n\t if (option.classList.contains('create')) {\n\t self.createItem(null, true, () => {\n\t if (self.settings.closeAfterSelect) {\n\t self.close();\n\t }\n\t });\n\t } else {\n\t value = option.dataset.value;\n\n\t if (typeof value !== 'undefined') {\n\t self.lastQuery = null;\n\t self.addItem(value);\n\n\t if (self.settings.closeAfterSelect) {\n\t self.close();\n\t }\n\n\t if (!self.settings.hideSelected && evt.type && /click/.test(evt.type)) {\n\t self.setActiveOption(option);\n\t }\n\t }\n\t }\n\t }\n\t /**\n\t * Triggered when the user clicks on an item\n\t * that has been selected.\n\t *\n\t */\n\n\n\t onItemSelect(evt, item) {\n\t var self = this;\n\n\t if (!self.isLocked && self.settings.mode === 'multi') {\n\t preventDefault(evt);\n\t self.setActiveItem(item, evt);\n\t return true;\n\t }\n\n\t return false;\n\t }\n\t /**\n\t * Determines whether or not to invoke\n\t * the user-provided option provider / loader\n\t *\n\t * Note, there is a subtle difference between\n\t * this.canLoad() and this.settings.shouldLoad();\n\t *\n\t *\t- settings.shouldLoad() is a user-input validator.\n\t *\tWhen false is returned, the not_loading template\n\t *\twill be added to the dropdown\n\t *\n\t *\t- canLoad() is lower level validator that checks\n\t * \tthe Tom Select instance. There is no inherent user\n\t *\tfeedback when canLoad returns false\n\t *\n\t */\n\n\n\t canLoad(value) {\n\t if (!this.settings.load) return false;\n\t if (this.loadedSearches.hasOwnProperty(value)) return false;\n\t return true;\n\t }\n\t /**\n\t * Invokes the user-provided option provider / loader.\n\t *\n\t */\n\n\n\t load(value) {\n\t const self = this;\n\t if (!self.canLoad(value)) return;\n\t addClasses(self.wrapper, self.settings.loadingClass);\n\t self.loading++;\n\t const callback = self.loadCallback.bind(self);\n\t self.settings.load.call(self, value, callback);\n\t }\n\t /**\n\t * Invoked by the user-provided option provider\n\t *\n\t */\n\n\n\t loadCallback(options, optgroups) {\n\t const self = this;\n\t self.loading = Math.max(self.loading - 1, 0);\n\t self.lastQuery = null;\n\t self.clearActiveOption(); // when new results load, focus should be on first option\n\n\t self.setupOptions(options, optgroups);\n\t self.refreshOptions(self.isFocused && !self.isInputHidden);\n\n\t if (!self.loading) {\n\t removeClasses(self.wrapper, self.settings.loadingClass);\n\t }\n\n\t self.trigger('load', options, optgroups);\n\t }\n\n\t preload() {\n\t var classList = this.wrapper.classList;\n\t if (classList.contains('preloaded')) return;\n\t classList.add('preloaded');\n\t this.load('');\n\t }\n\t /**\n\t * Sets the input field of the control to the specified value.\n\t *\n\t */\n\n\n\t setTextboxValue(value = '') {\n\t var input = this.control_input;\n\t var changed = input.value !== value;\n\n\t if (changed) {\n\t input.value = value;\n\t triggerEvent(input, 'update');\n\t this.lastValue = value;\n\t }\n\t }\n\t /**\n\t * Returns the value of the control. If multiple items\n\t * can be selected (e.g. <select multiple>), this returns\n\t * an array. If only one item can be selected, this\n\t * returns a string.\n\t *\n\t */\n\n\n\t getValue() {\n\t if (this.is_select_tag && this.input.hasAttribute('multiple')) {\n\t return this.items;\n\t }\n\n\t return this.items.join(this.settings.delimiter);\n\t }\n\t /**\n\t * Resets the selected items to the given value.\n\t *\n\t */\n\n\n\t setValue(value, silent) {\n\t var events = silent ? [] : ['change'];\n\t debounce_events(this, events, () => {\n\t this.clear(silent);\n\t this.addItems(value, silent);\n\t });\n\t }\n\t /**\n\t * Resets the number of max items to the given value\n\t *\n\t */\n\n\n\t setMaxItems(value) {\n\t if (value === 0) value = null; //reset to unlimited items.\n\n\t this.settings.maxItems = value;\n\t this.refreshState();\n\t }\n\t /**\n\t * Sets the selected item.\n\t *\n\t */\n\n\n\t setActiveItem(item, e) {\n\t var self = this;\n\t var eventName;\n\t var i, begin, end, swap;\n\t var last;\n\t if (self.settings.mode === 'single') return; // clear the active selection\n\n\t if (!item) {\n\t self.clearActiveItems();\n\n\t if (self.isFocused) {\n\t self.showInput();\n\t }\n\n\t return;\n\t } // modify selection\n\n\n\t eventName = e && e.type.toLowerCase();\n\n\t if (eventName === 'click' && isKeyDown('shiftKey', e) && self.activeItems.length) {\n\t last = self.getLastActive();\n\t begin = Array.prototype.indexOf.call(self.control.children, last);\n\t end = Array.prototype.indexOf.call(self.control.children, item);\n\n\t if (begin > end) {\n\t swap = begin;\n\t begin = end;\n\t end = swap;\n\t }\n\n\t for (i = begin; i <= end; i++) {\n\t item = self.control.children[i];\n\n\t if (self.activeItems.indexOf(item) === -1) {\n\t self.setActiveItemClass(item);\n\t }\n\t }\n\n\t preventDefault(e);\n\t } else if (eventName === 'click' && isKeyDown(KEY_SHORTCUT, e) || eventName === 'keydown' && isKeyDown('shiftKey', e)) {\n\t if (item.classList.contains('active')) {\n\t self.removeActiveItem(item);\n\t } else {\n\t self.setActiveItemClass(item);\n\t }\n\t } else {\n\t self.clearActiveItems();\n\t self.setActiveItemClass(item);\n\t } // ensure control has focus\n\n\n\t self.hideInput();\n\n\t if (!self.isFocused) {\n\t self.focus();\n\t }\n\t }\n\t /**\n\t * Set the active and last-active classes\n\t *\n\t */\n\n\n\t setActiveItemClass(item) {\n\t const self = this;\n\t const last_active = self.control.querySelector('.last-active');\n\t if (last_active) removeClasses(last_active, 'last-active');\n\t addClasses(item, 'active last-active');\n\t self.trigger('item_select', item);\n\n\t if (self.activeItems.indexOf(item) == -1) {\n\t self.activeItems.push(item);\n\t }\n\t }\n\t /**\n\t * Remove active item\n\t *\n\t */\n\n\n\t removeActiveItem(item) {\n\t var idx = this.activeItems.indexOf(item);\n\t this.activeItems.splice(idx, 1);\n\t removeClasses(item, 'active');\n\t }\n\t /**\n\t * Clears all the active items\n\t *\n\t */\n\n\n\t clearActiveItems() {\n\t removeClasses(this.activeItems, 'active');\n\t this.activeItems = [];\n\t }\n\t /**\n\t * Sets the selected item in the dropdown menu\n\t * of available options.\n\t *\n\t */\n\n\n\t setActiveOption(option) {\n\t if (option === this.activeOption) {\n\t return;\n\t }\n\n\t this.clearActiveOption();\n\t if (!option) return;\n\t this.activeOption = option;\n\t setAttr(this.focus_node, {\n\t 'aria-activedescendant': option.getAttribute('id')\n\t });\n\t setAttr(option, {\n\t 'aria-selected': 'true'\n\t });\n\t addClasses(option, 'active');\n\t this.scrollToOption(option);\n\t }\n\t /**\n\t * Sets the dropdown_content scrollTop to display the option\n\t *\n\t */\n\n\n\t scrollToOption(option, behavior) {\n\t if (!option) return;\n\t const content = this.dropdown_content;\n\t const height_menu = content.clientHeight;\n\t const scrollTop = content.scrollTop || 0;\n\t const height_item = option.offsetHeight;\n\t const y = option.getBoundingClientRect().top - content.getBoundingClientRect().top + scrollTop;\n\n\t if (y + height_item > height_menu + scrollTop) {\n\t this.scroll(y - height_menu + height_item, behavior);\n\t } else if (y < scrollTop) {\n\t this.scroll(y, behavior);\n\t }\n\t }\n\t /**\n\t * Scroll the dropdown to the given position\n\t *\n\t */\n\n\n\t scroll(scrollTop, behavior) {\n\t const content = this.dropdown_content;\n\n\t if (behavior) {\n\t content.style.scrollBehavior = behavior;\n\t }\n\n\t content.scrollTop = scrollTop;\n\t content.style.scrollBehavior = '';\n\t }\n\t /**\n\t * Clears the active option\n\t *\n\t */\n\n\n\t clearActiveOption() {\n\t if (this.activeOption) {\n\t removeClasses(this.activeOption, 'active');\n\t setAttr(this.activeOption, {\n\t 'aria-selected': null\n\t });\n\t }\n\n\t this.activeOption = null;\n\t setAttr(this.focus_node, {\n\t 'aria-activedescendant': null\n\t });\n\t }\n\t /**\n\t * Selects all items (CTRL + A).\n\t */\n\n\n\t selectAll() {\n\t if (this.settings.mode === 'single') return;\n\t const activeItems = this.controlChildren();\n\t if (!activeItems.length) return;\n\t this.hideInput();\n\t this.close();\n\t this.activeItems = activeItems;\n\t addClasses(activeItems, 'active');\n\t }\n\t /**\n\t * Determines if the control_input should be in a hidden or visible state\n\t *\n\t */\n\n\n\t inputState() {\n\t var self = this;\n\t if (!self.control.contains(self.control_input)) return;\n\t setAttr(self.control_input, {\n\t placeholder: self.settings.placeholder\n\t });\n\n\t if (self.activeItems.length > 0 || !self.isFocused && self.settings.hidePlaceholder && self.items.length > 0) {\n\t self.setTextboxValue();\n\t self.isInputHidden = true;\n\t } else {\n\t if (self.settings.hidePlaceholder && self.items.length > 0) {\n\t setAttr(self.control_input, {\n\t placeholder: ''\n\t });\n\t }\n\n\t self.isInputHidden = false;\n\t }\n\n\t self.wrapper.classList.toggle('input-hidden', self.isInputHidden);\n\t }\n\t /**\n\t * Hides the input element out of view, while\n\t * retaining its focus.\n\t * @deprecated 1.3\n\t */\n\n\n\t hideInput() {\n\t this.inputState();\n\t }\n\t /**\n\t * Restores input visibility.\n\t * @deprecated 1.3\n\t */\n\n\n\t showInput() {\n\t this.inputState();\n\t }\n\t /**\n\t * Get the input value\n\t */\n\n\n\t inputValue() {\n\t return this.control_input.value.trim();\n\t }\n\t /**\n\t * Gives the control focus.\n\t */\n\n\n\t focus() {\n\t var self = this;\n\t if (self.isDisabled) return;\n\t self.ignoreFocus = true;\n\n\t if (self.control_input.offsetWidth) {\n\t self.control_input.focus();\n\t } else {\n\t self.focus_node.focus();\n\t }\n\n\t setTimeout(() => {\n\t self.ignoreFocus = false;\n\t self.onFocus();\n\t }, 0);\n\t }\n\t /**\n\t * Forces the control out of focus.\n\t *\n\t */\n\n\n\t blur() {\n\t this.focus_node.blur();\n\t this.onBlur();\n\t }\n\t /**\n\t * Returns a function that scores an object\n\t * to show how good of a match it is to the\n\t * provided query.\n\t *\n\t * @return {function}\n\t */\n\n\n\t getScoreFunction(query) {\n\t return this.sifter.getScoreFunction(query, this.getSearchOptions());\n\t }\n\t /**\n\t * Returns search options for sifter (the system\n\t * for scoring and sorting results).\n\t *\n\t * @see https://github.com/orchidjs/sifter.js\n\t * @return {object}\n\t */\n\n\n\t getSearchOptions() {\n\t var settings = this.settings;\n\t var sort = settings.sortField;\n\n\t if (typeof settings.sortField === 'string') {\n\t sort = [{\n\t field: settings.sortField\n\t }];\n\t }\n\n\t return {\n\t fields: settings.searchField,\n\t conjunction: settings.searchConjunction,\n\t sort: sort,\n\t nesting: settings.nesting\n\t };\n\t }\n\t /**\n\t * Searches through available options and returns\n\t * a sorted array of matches.\n\t *\n\t */\n\n\n\t search(query) {\n\t var i, result, calculateScore;\n\t var self = this;\n\t var options = this.getSearchOptions(); // validate user-provided result scoring function\n\n\t if (self.settings.score) {\n\t calculateScore = self.settings.score.call(self, query);\n\n\t if (typeof calculateScore !== 'function') {\n\t throw new Error('Tom Select \"score\" setting must be a function that returns a function');\n\t }\n\t } // perform search\n\n\n\t if (query !== self.lastQuery) {\n\t self.lastQuery = query;\n\t result = self.sifter.search(query, Object.assign(options, {\n\t score: calculateScore\n\t }));\n\t self.currentResults = result;\n\t } else {\n\t result = Object.assign({}, self.currentResults);\n\t } // filter out selected items\n\n\n\t if (self.settings.hideSelected) {\n\t for (i = result.items.length - 1; i >= 0; i--) {\n\t let hashed = hash_key(result.items[i].id);\n\n\t if (hashed && self.items.indexOf(hashed) !== -1) {\n\t result.items.splice(i, 1);\n\t }\n\t }\n\t }\n\n\t return result;\n\t }\n\t /**\n\t * Refreshes the list of available options shown\n\t * in the autocomplete dropdown menu.\n\t *\n\t */\n\n\n\t refreshOptions(triggerDropdown = true) {\n\t var i, j, k, n, optgroup, optgroups, html, has_create_option, active_value, active_group;\n\t var create;\n\t const groups = {};\n\t const groups_order = [];\n\t var self = this;\n\t var query = self.inputValue();\n\t var results = self.search(query);\n\t var active_option = self.activeOption;\n\t var show_dropdown = self.settings.shouldOpen || false;\n\t var dropdown_content = self.dropdown_content;\n\n\t if (active_option) {\n\t active_value = active_option.dataset.value;\n\t active_group = active_option.closest('[data-group]');\n\t } // build markup\n\n\n\t n = results.items.length;\n\n\t if (typeof self.settings.maxOptions === 'number') {\n\t n = Math.min(n, self.settings.maxOptions);\n\t }\n\n\t if (n > 0) {\n\t show_dropdown = true;\n\t } // render and group available options individually\n\n\n\t for (i = 0; i < n; i++) {\n\t // get option dom element\n\t let opt_value = results.items[i].id;\n\t let option = self.options[opt_value];\n\t let option_el = self.getOption(opt_value, true); // toggle 'selected' class\n\n\t if (!self.settings.hideSelected) {\n\t option_el.classList.toggle('selected', self.items.includes(opt_value));\n\t }\n\n\t optgroup = option[self.settings.optgroupField] || '';\n\t optgroups = Array.isArray(optgroup) ? optgroup : [optgroup];\n\n\t for (j = 0, k = optgroups && optgroups.length; j < k; j++) {\n\t optgroup = optgroups[j];\n\n\t if (!self.optgroups.hasOwnProperty(optgroup)) {\n\t optgroup = '';\n\t }\n\n\t if (!groups.hasOwnProperty(optgroup)) {\n\t groups[optgroup] = document.createDocumentFragment();\n\t groups_order.push(optgroup);\n\t } // nodes can only have one parent, so if the option is in mutple groups, we need a clone\n\n\n\t if (j > 0) {\n\t option_el = option_el.cloneNode(true);\n\t setAttr(option_el, {\n\t id: option.$id + '-clone-' + j,\n\t 'aria-selected': null\n\t });\n\t option_el.classList.add('ts-cloned');\n\t removeClasses(option_el, 'active');\n\t } // make sure we keep the activeOption in the same group\n\n\n\t if (active_value == opt_value && active_group && active_group.dataset.group === optgroup) {\n\t active_option = option_el;\n\t }\n\n\t groups[optgroup].appendChild(option_el);\n\t }\n\t } // sort optgroups\n\n\n\t if (this.settings.lockOptgroupOrder) {\n\t groups_order.sort((a, b) => {\n\t var a_order = self.optgroups[a] && self.optgroups[a].$order || 0;\n\t var b_order = self.optgroups[b] && self.optgroups[b].$order || 0;\n\t return a_order - b_order;\n\t });\n\t } // render optgroup headers & join groups\n\n\n\t html = document.createDocumentFragment();\n\t iterate(groups_order, optgroup => {\n\t if (self.optgroups.hasOwnProperty(optgroup) && groups[optgroup].children.length) {\n\t let group_options = document.createDocumentFragment();\n\t let header = self.render('optgroup_header', self.optgroups[optgroup]);\n\t append(group_options, header);\n\t append(group_options, groups[optgroup]);\n\t let group_html = self.render('optgroup', {\n\t group: self.optgroups[optgroup],\n\t options: group_options\n\t });\n\t append(html, group_html);\n\t } else {\n\t append(html, groups[optgroup]);\n\t }\n\t });\n\t dropdown_content.innerHTML = '';\n\t append(dropdown_content, html); // highlight matching terms inline\n\n\t if (self.settings.highlight) {\n\t removeHighlight(dropdown_content);\n\n\t if (results.query.length && results.tokens.length) {\n\t iterate(results.tokens, tok => {\n\t highlight(dropdown_content, tok.regex);\n\t });\n\t }\n\t } // helper method for adding templates to dropdown\n\n\n\t var add_template = template => {\n\t let content = self.render(template, {\n\t input: query\n\t });\n\n\t if (content) {\n\t show_dropdown = true;\n\t dropdown_content.insertBefore(content, dropdown_content.firstChild);\n\t }\n\n\t return content;\n\t }; // add loading message\n\n\n\t if (self.loading) {\n\t add_template('loading'); // invalid query\n\t } else if (!self.settings.shouldLoad.call(self, query)) {\n\t add_template('not_loading'); // add no_results message\n\t } else if (results.items.length === 0) {\n\t add_template('no_results');\n\t } // add create option\n\n\n\t has_create_option = self.canCreate(query);\n\n\t if (has_create_option) {\n\t create = add_template('option_create');\n\t } // activate\n\n\n\t self.hasOptions = results.items.length > 0 || has_create_option;\n\n\t if (show_dropdown) {\n\t if (results.items.length > 0) {\n\t if (!dropdown_content.contains(active_option) && self.settings.mode === 'single' && self.items.length) {\n\t active_option = self.getOption(self.items[0]);\n\t }\n\n\t if (!dropdown_content.contains(active_option)) {\n\t let active_index = 0;\n\n\t if (create && !self.settings.addPrecedence) {\n\t active_index = 1;\n\t }\n\n\t active_option = self.selectable()[active_index];\n\t }\n\t } else if (create) {\n\t active_option = create;\n\t }\n\n\t if (triggerDropdown && !self.isOpen) {\n\t self.open();\n\t self.scrollToOption(active_option, 'auto');\n\t }\n\n\t self.setActiveOption(active_option);\n\t } else {\n\t self.clearActiveOption();\n\n\t if (triggerDropdown && self.isOpen) {\n\t self.close(false); // if create_option=null, we want the dropdown to close but not reset the textbox value\n\t }\n\t }\n\t }\n\t /**\n\t * Return list of selectable options\n\t *\n\t */\n\n\n\t selectable() {\n\t return this.dropdown_content.querySelectorAll('[data-selectable]');\n\t }\n\t /**\n\t * Adds an available option. If it already exists,\n\t * nothing will happen. Note: this does not refresh\n\t * the options list dropdown (use `refreshOptions`\n\t * for that).\n\t *\n\t * Usage:\n\t *\n\t * this.addOption(data)\n\t *\n\t */\n\n\n\t addOption(data, user_created = false) {\n\t const self = this; // @deprecated 1.7.7\n\t // use addOptions( array, user_created ) for adding multiple options\n\n\t if (Array.isArray(data)) {\n\t self.addOptions(data, user_created);\n\t return false;\n\t }\n\n\t const key = hash_key(data[self.settings.valueField]);\n\n\t if (key === null || self.options.hasOwnProperty(key)) {\n\t return false;\n\t }\n\n\t data.$order = data.$order || ++self.order;\n\t data.$id = self.inputId + '-opt-' + data.$order;\n\t self.options[key] = data;\n\t self.lastQuery = null;\n\n\t if (user_created) {\n\t self.userOptions[key] = user_created;\n\t self.trigger('option_add', key, data);\n\t }\n\n\t return key;\n\t }\n\t /**\n\t * Add multiple options\n\t *\n\t */\n\n\n\t addOptions(data, user_created = false) {\n\t iterate(data, dat => {\n\t this.addOption(dat, user_created);\n\t });\n\t }\n\t /**\n\t * @deprecated 1.7.7\n\t */\n\n\n\t registerOption(data) {\n\t return this.addOption(data);\n\t }\n\t /**\n\t * Registers an option group to the pool of option groups.\n\t *\n\t * @return {boolean|string}\n\t */\n\n\n\t registerOptionGroup(data) {\n\t var key = hash_key(data[this.settings.optgroupValueField]);\n\t if (key === null) return false;\n\t data.$order = data.$order || ++this.order;\n\t this.optgroups[key] = data;\n\t return key;\n\t }\n\t /**\n\t * Registers a new optgroup for options\n\t * to be bucketed into.\n\t *\n\t */\n\n\n\t addOptionGroup(id, data) {\n\t var hashed_id;\n\t data[this.settings.optgroupValueField] = id;\n\n\t if (hashed_id = this.registerOptionGroup(data)) {\n\t this.trigger('optgroup_add', hashed_id, data);\n\t }\n\t }\n\t /**\n\t * Removes an existing option group.\n\t *\n\t */\n\n\n\t removeOptionGroup(id) {\n\t if (this.optgroups.hasOwnProperty(id)) {\n\t delete this.optgroups[id];\n\t this.clearCache();\n\t this.trigger('optgroup_remove', id);\n\t }\n\t }\n\t /**\n\t * Clears all existing option groups.\n\t */\n\n\n\t clearOptionGroups() {\n\t this.optgroups = {};\n\t this.clearCache();\n\t this.trigger('optgroup_clear');\n\t }\n\t /**\n\t * Updates an option available for selection. If\n\t * it is visible in the selected items or options\n\t * dropdown, it will be re-rendered automatically.\n\t *\n\t */\n\n\n\t updateOption(value, data) {\n\t const self = this;\n\t var item_new;\n\t var index_item;\n\t const value_old = hash_key(value);\n\t const value_new = hash_key(data[self.settings.valueField]); // sanity checks\n\n\t if (value_old === null) return;\n\t if (!self.options.hasOwnProperty(value_old)) return;\n\t if (typeof value_new !== 'string') throw new Error('Value must be set in option data');\n\t const option = self.getOption(value_old);\n\t const item = self.getItem(value_old);\n\t data.$order = data.$order || self.options[value_old].$order;\n\t delete self.options[value_old]; // invalidate render cache\n\t // don't remove existing node yet, we'll remove it after replacing it\n\n\t self.uncacheValue(value_new);\n\t self.options[value_new] = data; // update the option if it's in the dropdown\n\n\t if (option) {\n\t if (self.dropdown_content.contains(option)) {\n\t const option_new = self._render('option', data);\n\n\t replaceNode(option, option_new);\n\n\t if (self.activeOption === option) {\n\t self.setActiveOption(option_new);\n\t }\n\t }\n\n\t option.remove();\n\t } // update the item if we have one\n\n\n\t if (item) {\n\t index_item = self.items.indexOf(value_old);\n\n\t if (index_item !== -1) {\n\t self.items.splice(index_item, 1, value_new);\n\t }\n\n\t item_new = self._render('item', data);\n\t if (item.classList.contains('active')) addClasses(item_new, 'active');\n\t replaceNode(item, item_new);\n\t } // invalidate last query because we might have updated the sortField\n\n\n\t self.lastQuery = null;\n\t }\n\t /**\n\t * Removes a single option.\n\t *\n\t */\n\n\n\t removeOption(value, silent) {\n\t const self = this;\n\t value = get_hash(value);\n\t self.uncacheValue(value);\n\t delete self.userOptions[value];\n\t delete self.options[value];\n\t self.lastQuery = null;\n\t self.trigger('option_remove', value);\n\t self.removeItem(value, silent);\n\t }\n\t /**\n\t * Clears all options.\n\t */\n\n\n\t clearOptions() {\n\t this.loadedSearches = {};\n\t this.userOptions = {};\n\t this.clearCache();\n\t var selected = {};\n\t iterate(this.options, (option, key) => {\n\t if (this.items.indexOf(key) >= 0) {\n\t selected[key] = this.options[key];\n\t }\n\t });\n\t this.options = this.sifter.items = selected;\n\t this.lastQuery = null;\n\t this.trigger('option_clear');\n\t }\n\t /**\n\t * Returns the dom element of the option\n\t * matching the given value.\n\t *\n\t */\n\n\n\t getOption(value, create = false) {\n\t const hashed = hash_key(value);\n\n\t if (hashed !== null && this.options.hasOwnProperty(hashed)) {\n\t const option = this.options[hashed];\n\n\t if (option.$div) {\n\t return option.$div;\n\t }\n\n\t if (create) {\n\t return this._render('option', option);\n\t }\n\t }\n\n\t return null;\n\t }\n\t /**\n\t * Returns the dom element of the next or previous dom element of the same type\n\t * Note: adjacent options may not be adjacent DOM elements (optgroups)\n\t *\n\t */\n\n\n\t getAdjacent(option, direction, type = 'option') {\n\t var self = this,\n\t all;\n\n\t if (!option) {\n\t return null;\n\t }\n\n\t if (type == 'item') {\n\t all = self.controlChildren();\n\t } else {\n\t all = self.dropdown_content.querySelectorAll('[data-selectable]');\n\t }\n\n\t for (let i = 0; i < all.length; i++) {\n\t if (all[i] != option) {\n\t continue;\n\t }\n\n\t if (direction > 0) {\n\t return all[i + 1];\n\t }\n\n\t return all[i - 1];\n\t }\n\n\t return null;\n\t }\n\t /**\n\t * Returns the dom element of the item\n\t * matching the given value.\n\t *\n\t */\n\n\n\t getItem(item) {\n\t if (typeof item == 'object') {\n\t return item;\n\t }\n\n\t var value = hash_key(item);\n\t return value !== null ? this.control.querySelector(`[data-value=\"${addSlashes(value)}\"]`) : null;\n\t }\n\t /**\n\t * \"Selects\" multiple items at once. Adds them to the list\n\t * at the current caret position.\n\t *\n\t */\n\n\n\t addItems(values, silent) {\n\t var self = this;\n\t var items = Array.isArray(values) ? values : [values];\n\t items = items.filter(x => self.items.indexOf(x) === -1);\n\n\t for (let i = 0, n = items.length; i < n; i++) {\n\t self.isPending = i < n - 1;\n\t self.addItem(items[i], silent);\n\t }\n\t }\n\t /**\n\t * \"Selects\" an item. Adds it to the list\n\t * at the current caret position.\n\t *\n\t */\n\n\n\t addItem(value, silent) {\n\t var events = silent ? [] : ['change'];\n\t debounce_events(this, events, () => {\n\t var item, wasFull;\n\t const self = this;\n\t const inputMode = self.settings.mode;\n\t const hashed = hash_key(value);\n\n\t if (hashed && self.items.indexOf(hashed) !== -1) {\n\t if (inputMode === 'single') {\n\t self.close();\n\t }\n\n\t if (inputMode === 'single' || !self.settings.duplicates) {\n\t return;\n\t }\n\t }\n\n\t if (hashed === null || !self.options.hasOwnProperty(hashed)) return;\n\t if (inputMode === 'single') self.clear(silent);\n\t if (inputMode === 'multi' && self.isFull()) return;\n\t item = self._render('item', self.options[hashed]);\n\n\t if (self.control.contains(item)) {\n\t // duplicates\n\t item = item.cloneNode(true);\n\t }\n\n\t wasFull = self.isFull();\n\t self.items.splice(self.caretPos, 0, hashed);\n\t self.insertAtCaret(item);\n\n\t if (self.isSetup) {\n\t // update menu / remove the option (if this is not one item being added as part of series)\n\t if (!self.isPending && self.settings.hideSelected) {\n\t let option = self.getOption(hashed);\n\t let next = self.getAdjacent(option, 1);\n\n\t if (next) {\n\t self.setActiveOption(next);\n\t }\n\t } // refreshOptions after setActiveOption(),\n\t // otherwise setActiveOption() will be called by refreshOptions() with the wrong value\n\n\n\t if (!self.isPending) {\n\t self.refreshOptions(self.isFocused && inputMode !== 'single');\n\t } // hide the menu if the maximum number of items have been selected or no options are left\n\n\n\t if (self.settings.closeAfterSelect != false && self.isFull()) {\n\t self.close();\n\t } else if (!self.isPending) {\n\t self.positionDropdown();\n\t }\n\n\t self.trigger('item_add', hashed, item);\n\n\t if (!self.isPending) {\n\t self.updateOriginalInput({\n\t silent: silent\n\t });\n\t }\n\t }\n\n\t if (!self.isPending || !wasFull && self.isFull()) {\n\t self.inputState();\n\t self.refreshState();\n\t }\n\t });\n\t }\n\t /**\n\t * Removes the selected item matching\n\t * the provided value.\n\t *\n\t */\n\n\n\t removeItem(item = null, silent) {\n\t const self = this;\n\t item = self.getItem(item);\n\t if (!item) return;\n\t var i, idx;\n\t const value = item.dataset.value;\n\t i = nodeIndex(item);\n\t item.remove();\n\n\t if (item.classList.contains('active')) {\n\t idx = self.activeItems.indexOf(item);\n\t self.activeItems.splice(idx, 1);\n\t removeClasses(item, 'active');\n\t }\n\n\t self.items.splice(i, 1);\n\t self.lastQuery = null;\n\n\t if (!self.settings.persist && self.userOptions.hasOwnProperty(value)) {\n\t self.removeOption(value, silent);\n\t }\n\n\t if (i < self.caretPos) {\n\t self.setCaret(self.caretPos - 1);\n\t }\n\n\t self.updateOriginalInput({\n\t silent: silent\n\t });\n\t self.refreshState();\n\t self.positionDropdown();\n\t self.trigger('item_remove', value, item);\n\t }\n\t /**\n\t * Invokes the `create` method provided in the\n\t * TomSelect options that should provide the data\n\t * for the new item, given the user input.\n\t *\n\t * Once this completes, it will be added\n\t * to the item list.\n\t *\n\t */\n\n\n\t createItem(input = null, triggerDropdown = true, callback = () => {}) {\n\t var self = this;\n\t var caret = self.caretPos;\n\t var output;\n\t input = input || self.inputValue();\n\n\t if (!self.canCreate(input)) {\n\t callback();\n\t return false;\n\t }\n\n\t self.lock();\n\t var created = false;\n\n\t var create = data => {\n\t self.unlock();\n\t if (!data || typeof data !== 'object') return callback();\n\t var value = hash_key(data[self.settings.valueField]);\n\n\t if (typeof value !== 'string') {\n\t return callback();\n\t }\n\n\t self.setTextboxValue();\n\t self.addOption(data, true);\n\t self.setCaret(caret);\n\t self.addItem(value);\n\t self.refreshOptions(triggerDropdown && self.settings.mode !== 'single');\n\t callback(data);\n\t created = true;\n\t };\n\n\t if (typeof self.settings.create === 'function') {\n\t output = self.settings.create.call(this, input, create);\n\t } else {\n\t output = {\n\t [self.settings.labelField]: input,\n\t [self.settings.valueField]: input\n\t };\n\t }\n\n\t if (!created) {\n\t create(output);\n\t }\n\n\t return true;\n\t }\n\t /**\n\t * Re-renders the selected item lists.\n\t */\n\n\n\t refreshItems() {\n\t var self = this;\n\t self.lastQuery = null;\n\n\t if (self.isSetup) {\n\t self.addItems(self.items);\n\t }\n\n\t self.updateOriginalInput();\n\t self.refreshState();\n\t }\n\t /**\n\t * Updates all state-dependent attributes\n\t * and CSS classes.\n\t */\n\n\n\t refreshState() {\n\t const self = this;\n\t self.refreshValidityState();\n\t const isFull = self.isFull();\n\t const isLocked = self.isLocked;\n\t self.wrapper.classList.toggle('rtl', self.rtl);\n\t const wrap_classList = self.wrapper.classList;\n\t wrap_classList.toggle('focus', self.isFocused);\n\t wrap_classList.toggle('disabled', self.isDisabled);\n\t wrap_classList.toggle('required', self.isRequired);\n\t wrap_classList.toggle('invalid', !self.isValid);\n\t wrap_classList.toggle('locked', isLocked);\n\t wrap_classList.toggle('full', isFull);\n\t wrap_classList.toggle('input-active', self.isFocused && !self.isInputHidden);\n\t wrap_classList.toggle('dropdown-active', self.isOpen);\n\t wrap_classList.toggle('has-options', isEmptyObject(self.options));\n\t wrap_classList.toggle('has-items', self.items.length > 0);\n\t }\n\t /**\n\t * Update the `required` attribute of both input and control input.\n\t *\n\t * The `required` property needs to be activated on the control input\n\t * for the error to be displayed at the right place. `required` also\n\t * needs to be temporarily deactivated on the input since the input is\n\t * hidden and can't show errors.\n\t */\n\n\n\t refreshValidityState() {\n\t var self = this;\n\n\t if (!self.input.checkValidity) {\n\t return;\n\t }\n\n\t self.isValid = self.input.checkValidity();\n\t self.isInvalid = !self.isValid;\n\t }\n\t /**\n\t * Determines whether or not more items can be added\n\t * to the control without exceeding the user-defined maximum.\n\t *\n\t * @returns {boolean}\n\t */\n\n\n\t isFull() {\n\t return this.settings.maxItems !== null && this.items.length >= this.settings.maxItems;\n\t }\n\t /**\n\t * Refreshes the original <select> or <input>\n\t * element to reflect the current state.\n\t *\n\t */\n\n\n\t updateOriginalInput(opts = {}) {\n\t const self = this;\n\t var option, label;\n\t const empty_option = self.input.querySelector('option[value=\"\"]');\n\n\t if (self.is_select_tag) {\n\t const selected = [];\n\n\t function AddSelected(option_el, value, label) {\n\t if (!option_el) {\n\t option_el = getDom('<option value=\"' + escape_html(value) + '\">' + escape_html(label) + '</option>');\n\t } // don't move empty option from top of list\n\t // fixes bug in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1725293\t\t\t\t\n\n\n\t if (option_el != empty_option) {\n\t self.input.append(option_el);\n\t }\n\n\t selected.push(option_el);\n\t option_el.selected = true;\n\t return option_el;\n\t } // unselect all selected options\n\n\n\t self.input.querySelectorAll('option:checked').forEach(option_el => {\n\t option_el.selected = false;\n\t }); // nothing selected?\n\n\t if (self.items.length == 0 && self.settings.mode == 'single') {\n\t AddSelected(empty_option, \"\", \"\"); // order selected <option> tags for values in self.items\n\t } else {\n\t self.items.forEach(value => {\n\t option = self.options[value];\n\t label = option[self.settings.labelField] || '';\n\n\t if (selected.includes(option.$option)) {\n\t const reuse_opt = self.input.querySelector(`option[value=\"${addSlashes(value)}\"]:not(:checked)`);\n\t AddSelected(reuse_opt, value, label);\n\t } else {\n\t option.$option = AddSelected(option.$option, value, label);\n\t }\n\t });\n\t }\n\t } else {\n\t self.input.value = self.getValue();\n\t }\n\n\t if (self.isSetup) {\n\t if (!opts.silent) {\n\t self.trigger('change', self.getValue());\n\t }\n\t }\n\t }\n\t /**\n\t * Shows the autocomplete dropdown containing\n\t * the available options.\n\t */\n\n\n\t open() {\n\t var self = this;\n\t if (self.isLocked || self.isOpen || self.settings.mode === 'multi' && self.isFull()) return;\n\t self.isOpen = true;\n\t setAttr(self.focus_node, {\n\t 'aria-expanded': 'true'\n\t });\n\t self.refreshState();\n\t applyCSS(self.dropdown, {\n\t visibility: 'hidden',\n\t display: 'block'\n\t });\n\t self.positionDropdown();\n\t applyCSS(self.dropdown, {\n\t visibility: 'visible',\n\t display: 'block'\n\t });\n\t self.focus();\n\t self.trigger('dropdown_open', self.dropdown);\n\t }\n\t /**\n\t * Closes the autocomplete dropdown menu.\n\t */\n\n\n\t close(setTextboxValue = true) {\n\t var self = this;\n\t var trigger = self.isOpen;\n\n\t if (setTextboxValue) {\n\t // before blur() to prevent form onchange event\n\t self.setTextboxValue();\n\n\t if (self.settings.mode === 'single' && self.items.length) {\n\t self.hideInput();\n\t }\n\t }\n\n\t self.isOpen = false;\n\t setAttr(self.focus_node, {\n\t 'aria-expanded': 'false'\n\t });\n\t applyCSS(self.dropdown, {\n\t display: 'none'\n\t });\n\n\t if (self.settings.hideSelected) {\n\t self.clearActiveOption();\n\t }\n\n\t self.refreshState();\n\t if (trigger) self.trigger('dropdown_close', self.dropdown);\n\t }\n\t /**\n\t * Calculates and applies the appropriate\n\t * position of the dropdown if dropdownParent = 'body'.\n\t * Otherwise, position is determined by css\n\t */\n\n\n\t positionDropdown() {\n\t if (this.settings.dropdownParent !== 'body') {\n\t return;\n\t }\n\n\t var context = this.control;\n\t var rect = context.getBoundingClientRect();\n\t var top = context.offsetHeight + rect.top + window.scrollY;\n\t var left = rect.left + window.scrollX;\n\t applyCSS(this.dropdown, {\n\t width: rect.width + 'px',\n\t top: top + 'px',\n\t left: left + 'px'\n\t });\n\t }\n\t /**\n\t * Resets / clears all selected items\n\t * from the control.\n\t *\n\t */\n\n\n\t clear(silent) {\n\t var self = this;\n\t if (!self.items.length) return;\n\t var items = self.controlChildren();\n\t iterate(items, item => {\n\t self.removeItem(item, true);\n\t });\n\t self.showInput();\n\t if (!silent) self.updateOriginalInput();\n\t self.trigger('clear');\n\t }\n\t /**\n\t * A helper method for inserting an element\n\t * at the current caret position.\n\t *\n\t */\n\n\n\t insertAtCaret(el) {\n\t const self = this;\n\t const caret = self.caretPos;\n\t const target = self.control;\n\t target.insertBefore(el, target.children[caret]);\n\t self.setCaret(caret + 1);\n\t }\n\t /**\n\t * Removes the current selected item(s).\n\t *\n\t */\n\n\n\t deleteSelection(e) {\n\t var direction, selection, caret, tail;\n\t var self = this;\n\t direction = e && e.keyCode === KEY_BACKSPACE ? -1 : 1;\n\t selection = getSelection(self.control_input); // determine items that will be removed\n\n\t const rm_items = [];\n\n\t if (self.activeItems.length) {\n\t tail = getTail(self.activeItems, direction);\n\t caret = nodeIndex(tail);\n\n\t if (direction > 0) {\n\t caret++;\n\t }\n\n\t iterate(self.activeItems, item => rm_items.push(item));\n\t } else if ((self.isFocused || self.settings.mode === 'single') && self.items.length) {\n\t const items = self.controlChildren();\n\n\t if (direction < 0 && selection.start === 0 && selection.length === 0) {\n\t rm_items.push(items[self.caretPos - 1]);\n\t } else if (direction > 0 && selection.start === self.inputValue().length) {\n\t rm_items.push(items[self.caretPos]);\n\t }\n\t }\n\n\t const values = rm_items.map(item => item.dataset.value); // allow the callback to abort\n\n\t if (!values.length || typeof self.settings.onDelete === 'function' && self.settings.onDelete.call(self, values, e) === false) {\n\t return false;\n\t }\n\n\t preventDefault(e, true); // perform removal\n\n\t if (typeof caret !== 'undefined') {\n\t self.setCaret(caret);\n\t }\n\n\t while (rm_items.length) {\n\t self.removeItem(rm_items.pop());\n\t }\n\n\t self.showInput();\n\t self.positionDropdown();\n\t self.refreshOptions(false);\n\t return true;\n\t }\n\t /**\n\t * Selects the previous / next item (depending on the `direction` argument).\n\t *\n\t * > 0 - right\n\t * < 0 - left\n\t *\n\t */\n\n\n\t advanceSelection(direction, e) {\n\t var last_active,\n\t adjacent,\n\t self = this;\n\t if (self.rtl) direction *= -1;\n\t if (self.inputValue().length) return; // add or remove to active items\n\n\t if (isKeyDown(KEY_SHORTCUT, e) || isKeyDown('shiftKey', e)) {\n\t last_active = self.getLastActive(direction);\n\n\t if (last_active) {\n\t if (!last_active.classList.contains('active')) {\n\t adjacent = last_active;\n\t } else {\n\t adjacent = self.getAdjacent(last_active, direction, 'item');\n\t } // if no active item, get items adjacent to the control input\n\n\t } else if (direction > 0) {\n\t adjacent = self.control_input.nextElementSibling;\n\t } else {\n\t adjacent = self.control_input.previousElementSibling;\n\t }\n\n\t if (adjacent) {\n\t if (adjacent.classList.contains('active')) {\n\t self.removeActiveItem(last_active);\n\t }\n\n\t self.setActiveItemClass(adjacent); // mark as last_active !! after removeActiveItem() on last_active\n\t } // move caret to the left or right\n\n\t } else {\n\t self.moveCaret(direction);\n\t }\n\t }\n\n\t moveCaret(direction) {}\n\t /**\n\t * Get the last active item\n\t *\n\t */\n\n\n\t getLastActive(direction) {\n\t let last_active = this.control.querySelector('.last-active');\n\n\t if (last_active) {\n\t return last_active;\n\t }\n\n\t var result = this.control.querySelectorAll('.active');\n\n\t if (result) {\n\t return getTail(result, direction);\n\t }\n\t }\n\t /**\n\t * Moves the caret to the specified index.\n\t *\n\t * The input must be moved by leaving it in place and moving the\n\t * siblings, due to the fact that focus cannot be restored once lost\n\t * on mobile webkit devices\n\t *\n\t */\n\n\n\t setCaret(new_pos) {\n\t this.caretPos = this.items.length;\n\t }\n\t /**\n\t * Return list of item dom elements\n\t *\n\t */\n\n\n\t controlChildren() {\n\t return Array.from(this.control.querySelectorAll('[data-ts-item]'));\n\t }\n\t /**\n\t * Disables user input on the control. Used while\n\t * items are being asynchronously created.\n\t */\n\n\n\t lock() {\n\t this.close();\n\t this.isLocked = true;\n\t this.refreshState();\n\t }\n\t /**\n\t * Re-enables user input on the control.\n\t */\n\n\n\t unlock() {\n\t this.isLocked = false;\n\t this.refreshState();\n\t }\n\t /**\n\t * Disables user input on the control completely.\n\t * While disabled, it cannot receive focus.\n\t */\n\n\n\t disable() {\n\t var self = this;\n\t self.input.disabled = true;\n\t self.control_input.disabled = true;\n\t self.focus_node.tabIndex = -1;\n\t self.isDisabled = true;\n\t self.lock();\n\t }\n\t /**\n\t * Enables the control so that it can respond\n\t * to focus and user input.\n\t */\n\n\n\t enable() {\n\t var self = this;\n\t self.input.disabled = false;\n\t self.control_input.disabled = false;\n\t self.focus_node.tabIndex = self.tabIndex;\n\t self.isDisabled = false;\n\t self.unlock();\n\t }\n\t /**\n\t * Completely destroys the control and\n\t * unbinds all event listeners so that it can\n\t * be garbage collected.\n\t */\n\n\n\t destroy() {\n\t var self = this;\n\t var revertSettings = self.revertSettings;\n\t self.trigger('destroy');\n\t self.off();\n\t self.wrapper.remove();\n\t self.dropdown.remove();\n\t self.input.innerHTML = revertSettings.innerHTML;\n\t self.input.tabIndex = revertSettings.tabIndex;\n\t removeClasses(self.input, 'tomselected', 'ts-hidden-accessible');\n\n\t self._destroy();\n\n\t delete self.input.tomselect;\n\t }\n\t /**\n\t * A helper method for rendering \"item\" and\n\t * \"option\" templates, given the data.\n\t *\n\t */\n\n\n\t render(templateName, data) {\n\t if (typeof this.settings.render[templateName] !== 'function') {\n\t return null;\n\t }\n\n\t return this._render(templateName, data);\n\t }\n\t /**\n\t * _render() can be called directly when we know we don't want to hit the cache\n\t * return type could be null for some templates, we need https://github.com/microsoft/TypeScript/issues/33014\n\t */\n\n\n\t _render(templateName, data) {\n\t var value = '',\n\t id,\n\t html;\n\t const self = this;\n\n\t if (templateName === 'option' || templateName == 'item') {\n\t value = get_hash(data[self.settings.valueField]);\n\t } // render markup\n\n\n\t html = self.settings.render[templateName].call(this, data, escape_html);\n\n\t if (html == null) {\n\t return html;\n\t }\n\n\t html = getDom(html); // add mandatory attributes\n\n\t if (templateName === 'option' || templateName === 'option_create') {\n\t if (data[self.settings.disabledField]) {\n\t setAttr(html, {\n\t 'aria-disabled': 'true'\n\t });\n\t } else {\n\t setAttr(html, {\n\t 'data-selectable': ''\n\t });\n\t }\n\t } else if (templateName === 'optgroup') {\n\t id = data.group[self.settings.optgroupValueField];\n\t setAttr(html, {\n\t 'data-group': id\n\t });\n\n\t if (data.group[self.settings.disabledField]) {\n\t setAttr(html, {\n\t 'data-disabled': ''\n\t });\n\t }\n\t }\n\n\t if (templateName === 'option' || templateName === 'item') {\n\t setAttr(html, {\n\t 'data-value': value\n\t }); // make sure we have some classes if a template is overwritten\n\n\t if (templateName === 'item') {\n\t addClasses(html, self.settings.itemClass);\n\t setAttr(html, {\n\t 'data-ts-item': ''\n\t });\n\t } else {\n\t addClasses(html, self.settings.optionClass);\n\t setAttr(html, {\n\t role: 'option',\n\t id: data.$id\n\t }); // update cache\n\n\t self.options[value].$div = html;\n\t }\n\t }\n\n\t return html;\n\t }\n\t /**\n\t * Clears the render cache for a template. If\n\t * no template is given, clears all render\n\t * caches.\n\t *\n\t */\n\n\n\t clearCache() {\n\t iterate(this.options, (option, value) => {\n\t if (option.$div) {\n\t option.$div.remove();\n\t delete option.$div;\n\t }\n\t });\n\t }\n\t /**\n\t * Removes a value from item and option caches\n\t *\n\t */\n\n\n\t uncacheValue(value) {\n\t const option_el = this.getOption(value);\n\t if (option_el) option_el.remove();\n\t }\n\t /**\n\t * Determines whether or not to display the\n\t * create item prompt, given a user input.\n\t *\n\t */\n\n\n\t canCreate(input) {\n\t return this.settings.create && input.length > 0 && this.settings.createFilter.call(this, input);\n\t }\n\t /**\n\t * Wraps this.`method` so that `new_fn` can be invoked 'before', 'after', or 'instead' of the original method\n\t *\n\t * this.hook('instead','onKeyDown',function( arg1, arg2 ...){\n\t *\n\t * });\n\t */\n\n\n\t hook(when, method, new_fn) {\n\t var self = this;\n\t var orig_method = self[method];\n\n\t self[method] = function () {\n\t var result, result_new;\n\n\t if (when === 'after') {\n\t result = orig_method.apply(self, arguments);\n\t }\n\n\t result_new = new_fn.apply(self, arguments);\n\n\t if (when === 'instead') {\n\t return result_new;\n\t }\n\n\t if (when === 'before') {\n\t result = orig_method.apply(self, arguments);\n\t }\n\n\t return result;\n\t };\n\t }\n\n\t}\n\n\t/**\n\t * Plugin: \"change_listener\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('change_listener', function () {\n\t addEvent(this.input, 'change', () => {\n\t this.sync();\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"restore_on_backspace\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('checkbox_options', function () {\n\t var self = this;\n\t var orig_onOptionSelect = self.onOptionSelect;\n\t self.settings.hideSelected = false; // update the checkbox for an option\n\n\t var UpdateCheckbox = function UpdateCheckbox(option) {\n\t setTimeout(() => {\n\t var checkbox = option.querySelector('input');\n\n\t if (option.classList.contains('selected')) {\n\t checkbox.checked = true;\n\t } else {\n\t checkbox.checked = false;\n\t }\n\t }, 1);\n\t }; // add checkbox to option template\n\n\n\t self.hook('after', 'setupTemplates', () => {\n\t var orig_render_option = self.settings.render.option;\n\n\t self.settings.render.option = (data, escape_html) => {\n\t var rendered = getDom(orig_render_option.call(self, data, escape_html));\n\t var checkbox = document.createElement('input');\n\t checkbox.addEventListener('click', function (evt) {\n\t preventDefault(evt);\n\t });\n\t checkbox.type = 'checkbox';\n\t const hashed = hash_key(data[self.settings.valueField]);\n\n\t if (hashed && self.items.indexOf(hashed) > -1) {\n\t checkbox.checked = true;\n\t }\n\n\t rendered.prepend(checkbox);\n\t return rendered;\n\t };\n\t }); // uncheck when item removed\n\n\t self.on('item_remove', value => {\n\t var option = self.getOption(value);\n\n\t if (option) {\n\t // if dropdown hasn't been opened yet, the option won't exist\n\t option.classList.remove('selected'); // selected class won't be removed yet\n\n\t UpdateCheckbox(option);\n\t }\n\t }); // remove items when selected option is clicked\n\n\t self.hook('instead', 'onOptionSelect', (evt, option) => {\n\t if (option.classList.contains('selected')) {\n\t option.classList.remove('selected');\n\t self.removeItem(option.dataset.value);\n\t self.refreshOptions();\n\t preventDefault(evt, true);\n\t return;\n\t }\n\n\t orig_onOptionSelect.call(self, evt, option);\n\t UpdateCheckbox(option);\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"dropdown_header\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('clear_button', function (userOptions) {\n\t const self = this;\n\t const options = Object.assign({\n\t className: 'clear-button',\n\t title: 'Clear All',\n\t html: data => {\n\t return `<div class=\"${data.className}\" title=\"${data.title}\">×</div>`;\n\t }\n\t }, userOptions);\n\t self.on('initialize', () => {\n\t var button = getDom(options.html(options));\n\t button.addEventListener('click', evt => {\n\t self.clear();\n\n\t if (self.settings.mode === 'single' && self.settings.allowEmptyOption) {\n\t self.addItem('');\n\t }\n\n\t evt.preventDefault();\n\t evt.stopPropagation();\n\t });\n\t self.control.appendChild(button);\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"drag_drop\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('drag_drop', function () {\n\t var self = this;\n\t if (!$.fn.sortable) throw new Error('The \"drag_drop\" plugin requires jQuery UI \"sortable\".');\n\t if (self.settings.mode !== 'multi') return;\n\t var orig_lock = self.lock;\n\t var orig_unlock = self.unlock;\n\t self.hook('instead', 'lock', () => {\n\t var sortable = $(self.control).data('sortable');\n\t if (sortable) sortable.disable();\n\t return orig_lock.call(self);\n\t });\n\t self.hook('instead', 'unlock', () => {\n\t var sortable = $(self.control).data('sortable');\n\t if (sortable) sortable.enable();\n\t return orig_unlock.call(self);\n\t });\n\t self.on('initialize', () => {\n\t var $control = $(self.control).sortable({\n\t items: '[data-value]',\n\t forcePlaceholderSize: true,\n\t disabled: self.isLocked,\n\t start: (e, ui) => {\n\t ui.placeholder.css('width', ui.helper.css('width'));\n\t $control.css({\n\t overflow: 'visible'\n\t });\n\t },\n\t stop: () => {\n\t $control.css({\n\t overflow: 'hidden'\n\t });\n\t var values = [];\n\t $control.children('[data-value]').each(function () {\n\t if (this.dataset.value) values.push(this.dataset.value);\n\t });\n\t self.setValue(values);\n\t }\n\t });\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"dropdown_header\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('dropdown_header', function (userOptions) {\n\t const self = this;\n\t const options = Object.assign({\n\t title: 'Untitled',\n\t headerClass: 'dropdown-header',\n\t titleRowClass: 'dropdown-header-title',\n\t labelClass: 'dropdown-header-label',\n\t closeClass: 'dropdown-header-close',\n\t html: data => {\n\t return '<div class=\"' + data.headerClass + '\">' + '<div class=\"' + data.titleRowClass + '\">' + '<span class=\"' + data.labelClass + '\">' + data.title + '</span>' + '<a class=\"' + data.closeClass + '\">×</a>' + '</div>' + '</div>';\n\t }\n\t }, userOptions);\n\t self.on('initialize', () => {\n\t var header = getDom(options.html(options));\n\t var close_link = header.querySelector('.' + options.closeClass);\n\n\t if (close_link) {\n\t close_link.addEventListener('click', evt => {\n\t preventDefault(evt, true);\n\t self.close();\n\t });\n\t }\n\n\t self.dropdown.insertBefore(header, self.dropdown.firstChild);\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"dropdown_input\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('caret_position', function () {\n\t var self = this;\n\t /**\n\t * Moves the caret to the specified index.\n\t *\n\t * The input must be moved by leaving it in place and moving the\n\t * siblings, due to the fact that focus cannot be restored once lost\n\t * on mobile webkit devices\n\t *\n\t */\n\n\t self.hook('instead', 'setCaret', new_pos => {\n\t if (self.settings.mode === 'single' || !self.control.contains(self.control_input)) {\n\t new_pos = self.items.length;\n\t } else {\n\t new_pos = Math.max(0, Math.min(self.items.length, new_pos));\n\n\t if (new_pos != self.caretPos && !self.isPending) {\n\t self.controlChildren().forEach((child, j) => {\n\t if (j < new_pos) {\n\t self.control_input.insertAdjacentElement('beforebegin', child);\n\t } else {\n\t self.control.appendChild(child);\n\t }\n\t });\n\t }\n\t }\n\n\t self.caretPos = new_pos;\n\t });\n\t self.hook('instead', 'moveCaret', direction => {\n\t if (!self.isFocused) return; // move caret before or after selected items\n\n\t const last_active = self.getLastActive(direction);\n\n\t if (last_active) {\n\t const idx = nodeIndex(last_active);\n\t self.setCaret(direction > 0 ? idx + 1 : idx);\n\t self.setActiveItem(); // move caret left or right of current position\n\t } else {\n\t self.setCaret(self.caretPos + direction);\n\t }\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"dropdown_input\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('dropdown_input', function () {\n\t var self = this;\n\t self.settings.shouldOpen = true; // make sure the input is shown even if there are no options to display in the dropdown\n\n\t self.hook('before', 'setup', () => {\n\t self.focus_node = self.control;\n\t addClasses(self.control_input, 'dropdown-input');\n\t const div = getDom('<div class=\"dropdown-input-wrap\">');\n\t div.append(self.control_input);\n\t self.dropdown.insertBefore(div, self.dropdown.firstChild);\n\t });\n\t self.on('initialize', () => {\n\t // set tabIndex on control to -1, otherwise [shift+tab] will put focus right back on control_input\n\t self.control_input.addEventListener('keydown', evt => {\n\t //addEvent(self.control_input,'keydown' as const,(evt:KeyboardEvent) =>{\n\t switch (evt.keyCode) {\n\t case KEY_ESC:\n\t if (self.isOpen) {\n\t preventDefault(evt, true);\n\t self.close();\n\t }\n\n\t self.clearActiveItems();\n\t return;\n\n\t case KEY_TAB:\n\t self.focus_node.tabIndex = -1;\n\t break;\n\t }\n\n\t return self.onKeyDown.call(self, evt);\n\t });\n\t self.on('blur', () => {\n\t self.focus_node.tabIndex = self.isDisabled ? -1 : self.tabIndex;\n\t }); // give the control_input focus when the dropdown is open\n\n\t self.on('dropdown_open', () => {\n\t self.control_input.focus();\n\t }); // prevent onBlur from closing when focus is on the control_input\n\n\t const orig_onBlur = self.onBlur;\n\t self.hook('instead', 'onBlur', evt => {\n\t if (evt && evt.relatedTarget == self.control_input) return;\n\t return orig_onBlur.call(self);\n\t });\n\t addEvent(self.control_input, 'blur', () => self.onBlur()); // return focus to control to allow further keyboard input\n\n\t self.hook('before', 'close', () => {\n\t if (!self.isOpen) return;\n\t self.focus_node.focus();\n\t });\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"input_autogrow\" (Tom Select)\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('input_autogrow', function () {\n\t var self = this;\n\t self.on('initialize', () => {\n\t var test_input = document.createElement('span');\n\t var control = self.control_input;\n\t test_input.style.cssText = 'position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ';\n\t self.wrapper.appendChild(test_input);\n\t var transfer_styles = ['letterSpacing', 'fontSize', 'fontFamily', 'fontWeight', 'textTransform'];\n\n\t for (const style_name of transfer_styles) {\n\t // @ts-ignore TS7015 https://stackoverflow.com/a/50506154/697576\n\t test_input.style[style_name] = control.style[style_name];\n\t }\n\t /**\n\t * Set the control width\n\t *\n\t */\n\n\n\t var resize = () => {\n\t if (self.items.length > 0) {\n\t test_input.textContent = control.value;\n\t control.style.width = test_input.clientWidth + 'px';\n\t } else {\n\t control.style.width = '';\n\t }\n\t };\n\n\t resize();\n\t self.on('update item_add item_remove', resize);\n\t addEvent(control, 'input', resize);\n\t addEvent(control, 'keyup', resize);\n\t addEvent(control, 'blur', resize);\n\t addEvent(control, 'update', resize);\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"input_autogrow\" (Tom Select)\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('no_backspace_delete', function () {\n\t var self = this;\n\t var orig_deleteSelection = self.deleteSelection;\n\t this.hook('instead', 'deleteSelection', evt => {\n\t if (self.activeItems.length) {\n\t return orig_deleteSelection.call(self, evt);\n\t }\n\n\t return false;\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"input_autogrow\" (Tom Select)\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('no_active_items', function () {\n\t this.hook('instead', 'setActiveItem', () => {});\n\t this.hook('instead', 'selectAll', () => {});\n\t});\n\n\t/**\n\t * Plugin: \"optgroup_columns\" (Tom Select.js)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('optgroup_columns', function () {\n\t var self = this;\n\t var orig_keydown = self.onKeyDown;\n\t self.hook('instead', 'onKeyDown', evt => {\n\t var index, option, options, optgroup;\n\n\t if (!self.isOpen || !(evt.keyCode === KEY_LEFT || evt.keyCode === KEY_RIGHT)) {\n\t return orig_keydown.call(self, evt);\n\t }\n\n\t optgroup = parentMatch(self.activeOption, '[data-group]');\n\t index = nodeIndex(self.activeOption, '[data-selectable]');\n\n\t if (!optgroup) {\n\t return;\n\t }\n\n\t if (evt.keyCode === KEY_LEFT) {\n\t optgroup = optgroup.previousSibling;\n\t } else {\n\t optgroup = optgroup.nextSibling;\n\t }\n\n\t if (!optgroup) {\n\t return;\n\t }\n\n\t options = optgroup.querySelectorAll('[data-selectable]');\n\t option = options[Math.min(options.length - 1, index)];\n\n\t if (option) {\n\t self.setActiveOption(option);\n\t }\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"remove_button\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('remove_button', function (userOptions) {\n\t const options = Object.assign({\n\t label: '×',\n\t title: 'Remove',\n\t className: 'remove',\n\t append: true\n\t }, userOptions); //options.className = 'remove-single';\n\n\t var self = this; // override the render method to add remove button to each item\n\n\t if (!options.append) {\n\t return;\n\t }\n\n\t var html = '<a href=\"javascript:void(0)\" class=\"' + options.className + '\" tabindex=\"-1\" title=\"' + escape_html(options.title) + '\">' + options.label + '</a>';\n\t self.hook('after', 'setupTemplates', () => {\n\t var orig_render_item = self.settings.render.item;\n\n\t self.settings.render.item = (data, escape) => {\n\t var rendered = getDom(orig_render_item.call(self, data, escape));\n\t var close_button = getDom(html);\n\t rendered.appendChild(close_button);\n\t addEvent(close_button, 'mousedown', evt => {\n\t preventDefault(evt, true);\n\t });\n\t addEvent(close_button, 'click', evt => {\n\t // propagating will trigger the dropdown to show for single mode\n\t preventDefault(evt, true);\n\t if (self.isLocked) return;\n\t var value = rendered.dataset.value;\n\t self.removeItem(value);\n\t self.refreshOptions(false);\n\t });\n\t return rendered;\n\t };\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"restore_on_backspace\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('restore_on_backspace', function (userOptions) {\n\t const self = this;\n\t const options = Object.assign({\n\t text: option => {\n\t return option[self.settings.labelField];\n\t }\n\t }, userOptions);\n\t self.on('item_remove', function (value) {\n\t if (self.control_input.value.trim() === '') {\n\t var option = self.options[value];\n\n\t if (option) {\n\t self.setTextboxValue(options.text.call(self, option));\n\t }\n\t }\n\t });\n\t});\n\n\t/**\n\t * Plugin: \"restore_on_backspace\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tTomSelect.define('virtual_scroll', function () {\n\t const self = this;\n\t const orig_canLoad = self.canLoad;\n\t const orig_clearActiveOption = self.clearActiveOption;\n\t const orig_loadCallback = self.loadCallback;\n\t var pagination = {};\n\t var dropdown_content;\n\t var loading_more = false;\n\n\t if (!self.settings.firstUrl) {\n\t throw 'virtual_scroll plugin requires a firstUrl() method';\n\t } // in order for virtual scrolling to work,\n\t // options need to be ordered the same way they're returned from the remote data source\n\n\n\t self.settings.sortField = [{\n\t field: '$order'\n\t }, {\n\t field: '$score'\n\t }]; // can we load more results for given query?\n\n\t function canLoadMore(query) {\n\t if (typeof self.settings.maxOptions === 'number' && dropdown_content.children.length >= self.settings.maxOptions) {\n\t return false;\n\t }\n\n\t if (query in pagination && pagination[query]) {\n\t return true;\n\t }\n\n\t return false;\n\t } // set the next url that will be\n\n\n\t self.setNextUrl = function (value, next_url) {\n\t pagination[value] = next_url;\n\t }; // getUrl() to be used in settings.load()\n\n\n\t self.getUrl = function (query) {\n\t if (query in pagination) {\n\t const next_url = pagination[query];\n\t pagination[query] = false;\n\t return next_url;\n\t } // if the user goes back to a previous query\n\t // we need to load the first page again\n\n\n\t pagination = {};\n\t return self.settings.firstUrl(query);\n\t }; // don't clear the active option (and cause unwanted dropdown scroll)\n\t // while loading more results\n\n\n\t self.hook('instead', 'clearActiveOption', () => {\n\t if (loading_more) {\n\t return;\n\t }\n\n\t return orig_clearActiveOption.call(self);\n\t }); // override the canLoad method\n\n\t self.hook('instead', 'canLoad', query => {\n\t // first time the query has been seen\n\t if (!(query in pagination)) {\n\t return orig_canLoad.call(self, query);\n\t }\n\n\t return canLoadMore(query);\n\t }); // wrap the load\n\n\t self.hook('instead', 'loadCallback', (options, optgroups) => {\n\t if (!loading_more) {\n\t self.clearOptions();\n\t }\n\n\t orig_loadCallback.call(self, options, optgroups);\n\t loading_more = false;\n\t }); // add templates to dropdown\n\t //\tloading_more if we have another url in the queue\n\t //\tno_more_results if we don't have another url in the queue\n\n\t self.hook('after', 'refreshOptions', () => {\n\t const query = self.lastValue;\n\t var option;\n\n\t if (canLoadMore(query)) {\n\t option = self.render('loading_more', {\n\t query: query\n\t });\n\t if (option) option.setAttribute('data-selectable', ''); // so that navigating dropdown with [down] keypresses can navigate to this node\n\t } else if (query in pagination && !dropdown_content.querySelector('.no-results')) {\n\t option = self.render('no_more_results', {\n\t query: query\n\t });\n\t }\n\n\t if (option) {\n\t addClasses(option, self.settings.optionClass);\n\t dropdown_content.append(option);\n\t }\n\t }); // add scroll listener and default templates\n\n\t self.on('initialize', () => {\n\t dropdown_content = self.dropdown_content; // default templates\n\n\t self.settings.render = Object.assign({}, {\n\t loading_more: function () {\n\t return `<div class=\"loading-more-results\">Loading more results ... </div>`;\n\t },\n\t no_more_results: function () {\n\t return `<div class=\"no-more-results\">No more results</div>`;\n\t }\n\t }, self.settings.render); // watch dropdown content scroll position\n\n\t dropdown_content.addEventListener('scroll', function () {\n\t const scroll_percent = dropdown_content.clientHeight / (dropdown_content.scrollHeight - dropdown_content.scrollTop);\n\n\t if (scroll_percent < 0.95) {\n\t return;\n\t } // !important: this will get checked again in load() but we still need to check here otherwise loading_more will be set to true\n\n\n\t if (!canLoadMore(self.lastValue)) {\n\t return;\n\t } // don't call load() too much\n\n\n\t if (loading_more) return;\n\t loading_more = true;\n\t self.load.call(self, self.lastValue);\n\t });\n\t });\n\t});\n\n\treturn TomSelect;\n\n})));\nvar tomSelect=function(el,opts){return new TomSelect(el,opts);} \n//# sourceMappingURL=tom-select.complete.js.map\n\n\n//# sourceURL=webpack:///./node_modules/tom-select/dist/js/tom-select.complete.js?");
|
957
|
+
eval("/**\n* Tom Select v2.0.0\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n*/\n\n(function (global, factory) {\n\t true ? module.exports = factory() :\n\tundefined;\n}(this, (function () { 'use strict';\n\n\t/**\n\t * MicroEvent - to make any js object an event emitter\n\t *\n\t * - pure javascript - server compatible, browser compatible\n\t * - dont rely on the browser doms\n\t * - super simple - you get it immediatly, no mistery, no magic involved\n\t *\n\t * @author Jerome Etienne (https://github.com/jeromeetienne)\n\t */\n\n\t/**\n\t * Execute callback for each event in space separated list of event names\n\t *\n\t */\n\tfunction forEvents(events, callback) {\n\t events.split(/\\s+/).forEach(event => {\n\t callback(event);\n\t });\n\t}\n\n\tclass MicroEvent {\n\t constructor() {\n\t this._events = {};\n\t }\n\n\t on(events, fct) {\n\t forEvents(events, event => {\n\t this._events[event] = this._events[event] || [];\n\n\t this._events[event].push(fct);\n\t });\n\t }\n\n\t off(events, fct) {\n\t var n = arguments.length;\n\n\t if (n === 0) {\n\t this._events = {};\n\t return;\n\t }\n\n\t forEvents(events, event => {\n\t if (n === 1) return delete this._events[event];\n\t if (event in this._events === false) return;\n\n\t this._events[event].splice(this._events[event].indexOf(fct), 1);\n\t });\n\t }\n\n\t trigger(events, ...args) {\n\t var self = this;\n\t forEvents(events, event => {\n\t if (event in self._events === false) return;\n\n\t for (let fct of self._events[event]) {\n\t fct.apply(self, args);\n\t }\n\t });\n\t }\n\n\t}\n\n\t/**\n\t * microplugin.js\n\t * Copyright (c) 2013 Brian Reavis & contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t * @author Brian Reavis <brian@thirdroute.com>\n\t */\n\tfunction MicroPlugin(Interface) {\n\t Interface.plugins = {};\n\t return class extends Interface {\n\t constructor(...args) {\n\t super(...args);\n\t this.plugins = {\n\t names: [],\n\t settings: {},\n\t requested: {},\n\t loaded: {}\n\t };\n\t }\n\n\t /**\n\t * Registers a plugin.\n\t *\n\t * @param {function} fn\n\t */\n\t static define(name, fn) {\n\t Interface.plugins[name] = {\n\t 'name': name,\n\t 'fn': fn\n\t };\n\t }\n\t /**\n\t * Initializes the listed plugins (with options).\n\t * Acceptable formats:\n\t *\n\t * List (without options):\n\t * ['a', 'b', 'c']\n\t *\n\t * List (with options):\n\t * [{'name': 'a', options: {}}, {'name': 'b', options: {}}]\n\t *\n\t * Hash (with options):\n\t * {'a': { ... }, 'b': { ... }, 'c': { ... }}\n\t *\n\t * @param {array|object} plugins\n\t */\n\n\n\t initializePlugins(plugins) {\n\t var key, name;\n\t const self = this;\n\t const queue = [];\n\n\t if (Array.isArray(plugins)) {\n\t plugins.forEach(plugin => {\n\t if (typeof plugin === 'string') {\n\t queue.push(plugin);\n\t } else {\n\t self.plugins.settings[plugin.name] = plugin.options;\n\t queue.push(plugin.name);\n\t }\n\t });\n\t } else if (plugins) {\n\t for (key in plugins) {\n\t if (plugins.hasOwnProperty(key)) {\n\t self.plugins.settings[key] = plugins[key];\n\t queue.push(key);\n\t }\n\t }\n\t }\n\n\t while (name = queue.shift()) {\n\t self.require(name);\n\t }\n\t }\n\n\t loadPlugin(name) {\n\t var self = this;\n\t var plugins = self.plugins;\n\t var plugin = Interface.plugins[name];\n\n\t if (!Interface.plugins.hasOwnProperty(name)) {\n\t throw new Error('Unable to find \"' + name + '\" plugin');\n\t }\n\n\t plugins.requested[name] = true;\n\t plugins.loaded[name] = plugin.fn.apply(self, [self.plugins.settings[name] || {}]);\n\t plugins.names.push(name);\n\t }\n\t /**\n\t * Initializes a plugin.\n\t *\n\t */\n\n\n\t require(name) {\n\t var self = this;\n\t var plugins = self.plugins;\n\n\t if (!self.plugins.loaded.hasOwnProperty(name)) {\n\t if (plugins.requested[name]) {\n\t throw new Error('Plugin has circular dependency (\"' + name + '\")');\n\t }\n\n\t self.loadPlugin(name);\n\t }\n\n\t return plugins.loaded[name];\n\t }\n\n\t };\n\t}\n\n\t// https://github.com/andrewrk/node-diacritics/blob/master/index.js\n\tvar latin_pat;\n\tconst accent_pat = '[\\u0300-\\u036F\\u{b7}\\u{2be}]'; // \\u{2bc}\n\n\tconst accent_reg = new RegExp(accent_pat, 'g');\n\tvar diacritic_patterns;\n\tconst latin_convert = {\n\t 'æ': 'ae',\n\t 'ⱥ': 'a',\n\t 'ø': 'o'\n\t};\n\tconst convert_pat = new RegExp(Object.keys(latin_convert).join('|'), 'g');\n\t/**\n\t * code points generated from toCodePoints();\n\t * removed 65339 to 65345\n\t */\n\n\tconst code_points = [[67, 67], [160, 160], [192, 438], [452, 652], [961, 961], [1019, 1019], [1083, 1083], [1281, 1289], [1984, 1984], [5095, 5095], [7429, 7441], [7545, 7549], [7680, 7935], [8580, 8580], [9398, 9449], [11360, 11391], [42792, 42793], [42802, 42851], [42873, 42897], [42912, 42922], [64256, 64260], [65313, 65338], [65345, 65370]];\n\t/**\n\t * Remove accents\n\t * via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703\n\t *\n\t */\n\n\tconst asciifold = str => {\n\t return str.normalize('NFKD').replace(accent_reg, '').toLowerCase().replace(convert_pat, function (foreignletter) {\n\t return latin_convert[foreignletter];\n\t });\n\t};\n\t/**\n\t * Convert array of strings to a regular expression\n\t *\tex ['ab','a'] => (?:ab|a)\n\t * \tex ['a','b'] => [ab]\n\t *\n\t */\n\n\n\tconst arrayToPattern = (chars, glue = '|') => {\n\t if (chars.length == 1) {\n\t return chars[0];\n\t }\n\n\t var longest = 1;\n\t chars.forEach(a => {\n\t longest = Math.max(longest, a.length);\n\t });\n\n\t if (longest == 1) {\n\t return '[' + chars.join('') + ']';\n\t }\n\n\t return '(?:' + chars.join(glue) + ')';\n\t};\n\t/**\n\t * Get all possible combinations of substrings that add up to the given string\n\t * https://stackoverflow.com/questions/30169587/find-all-the-combination-of-substrings-that-add-up-to-the-given-string\n\t *\n\t */\n\n\tconst allSubstrings = input => {\n\t if (input.length === 1) return [[input]];\n\t var result = [];\n\t allSubstrings(input.substring(1)).forEach(function (subresult) {\n\t var tmp = subresult.slice(0);\n\t tmp[0] = input.charAt(0) + tmp[0];\n\t result.push(tmp);\n\t tmp = subresult.slice(0);\n\t tmp.unshift(input.charAt(0));\n\t result.push(tmp);\n\t });\n\t return result;\n\t};\n\t/**\n\t * Generate a list of diacritics from the list of code points\n\t *\n\t */\n\n\tconst generateDiacritics = () => {\n\t var diacritics = {};\n\t code_points.forEach(code_range => {\n\t for (let i = code_range[0]; i <= code_range[1]; i++) {\n\t let diacritic = String.fromCharCode(i);\n\t let latin = asciifold(diacritic);\n\n\t if (latin == diacritic.toLowerCase()) {\n\t continue;\n\t }\n\n\t if (!(latin in diacritics)) {\n\t diacritics[latin] = [latin];\n\t }\n\n\t var patt = new RegExp(arrayToPattern(diacritics[latin]), 'iu');\n\n\t if (diacritic.match(patt)) {\n\t continue;\n\t }\n\n\t diacritics[latin].push(diacritic);\n\t }\n\t });\n\t var latin_chars = Object.keys(diacritics); // latin character pattern\n\t // match longer substrings first\n\n\t latin_chars = latin_chars.sort((a, b) => b.length - a.length);\n\t latin_pat = new RegExp('(' + arrayToPattern(latin_chars) + accent_pat + '*)', 'g'); // build diacritic patterns\n\t // ae needs: \n\t //\t(?:(?:ae|Æ|Ǽ|Ǣ)|(?:A|Ⓐ|A...)(?:E|ɛ|Ⓔ...))\n\n\t var diacritic_patterns = {};\n\t latin_chars.sort((a, b) => a.length - b.length).forEach(latin => {\n\t var substrings = allSubstrings(latin);\n\t var pattern = substrings.map(sub_pat => {\n\t sub_pat = sub_pat.map(l => {\n\t if (diacritics.hasOwnProperty(l)) {\n\t return arrayToPattern(diacritics[l]);\n\t }\n\n\t return l;\n\t });\n\t return arrayToPattern(sub_pat, '');\n\t });\n\t diacritic_patterns[latin] = arrayToPattern(pattern);\n\t });\n\t return diacritic_patterns;\n\t};\n\t/**\n\t * Expand a regular expression pattern to include diacritics\n\t * \teg /a/ becomes /aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐɑAⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ/\n\t *\n\t */\n\n\tconst diacriticRegexPoints = regex => {\n\t if (diacritic_patterns === undefined) {\n\t diacritic_patterns = generateDiacritics();\n\t }\n\n\t const decomposed = regex.normalize('NFKD').toLowerCase();\n\t return decomposed.split(latin_pat).map(part => {\n\t if (part == '') {\n\t return '';\n\t } // \"ffl\" or \"ffl\"\n\n\n\t const no_accent = asciifold(part);\n\n\t if (diacritic_patterns.hasOwnProperty(no_accent)) {\n\t return diacritic_patterns[no_accent];\n\t } // 'أهلا' (\\u{623}\\u{647}\\u{644}\\u{627}) or 'أهلا' (\\u{627}\\u{654}\\u{647}\\u{644}\\u{627})\n\n\n\t const composed_part = part.normalize('NFC');\n\n\t if (composed_part != part) {\n\t return arrayToPattern([part, composed_part]);\n\t }\n\n\t return part;\n\t }).join('');\n\t};\n\n\t// @ts-ignore TS2691 \"An import path cannot end with a '.ts' extension\"\n\n\t/**\n\t * A property getter resolving dot-notation\n\t * @param {Object} obj The root object to fetch property on\n\t * @param {String} name The optionally dotted property name to fetch\n\t * @return {Object} The resolved property value\n\t */\n\tconst getAttr = (obj, name) => {\n\t if (!obj) return;\n\t return obj[name];\n\t};\n\t/**\n\t * A property getter resolving dot-notation\n\t * @param {Object} obj The root object to fetch property on\n\t * @param {String} name The optionally dotted property name to fetch\n\t * @return {Object} The resolved property value\n\t */\n\n\tconst getAttrNesting = (obj, name) => {\n\t if (!obj) return;\n\t var part,\n\t names = name.split(\".\");\n\n\t while ((part = names.shift()) && (obj = obj[part]));\n\n\t return obj;\n\t};\n\t/**\n\t * Calculates how close of a match the\n\t * given value is against a search token.\n\t *\n\t */\n\n\tconst scoreValue = (value, token, weight) => {\n\t var score, pos;\n\t if (!value) return 0;\n\t value = value + '';\n\t pos = value.search(token.regex);\n\t if (pos === -1) return 0;\n\t score = token.string.length / value.length;\n\t if (pos === 0) score += 0.5;\n\t return score * weight;\n\t};\n\t/**\n\t *\n\t * https://stackoverflow.com/questions/63006601/why-does-u-throw-an-invalid-escape-error\n\t */\n\n\tconst escape_regex = str => {\n\t return (str + '').replace(/([\\$\\(-\\+\\.\\?\\[-\\^\\{-\\}])/g, '\\\\$1');\n\t};\n\t/**\n\t * Cast object property to an array if it exists and has a value\n\t *\n\t */\n\n\tconst propToArray = (obj, key) => {\n\t var value = obj[key];\n\t if (typeof value == 'function') return value;\n\n\t if (value && !Array.isArray(value)) {\n\t obj[key] = [value];\n\t }\n\t};\n\t/**\n\t * Iterates over arrays and hashes.\n\t *\n\t * ```\n\t * iterate(this.items, function(item, id) {\n\t * // invoked for each item\n\t * });\n\t * ```\n\t *\n\t */\n\n\tconst iterate = (object, callback) => {\n\t if (Array.isArray(object)) {\n\t object.forEach(callback);\n\t } else {\n\t for (var key in object) {\n\t if (object.hasOwnProperty(key)) {\n\t callback(object[key], key);\n\t }\n\t }\n\t }\n\t};\n\tconst cmp = (a, b) => {\n\t if (typeof a === 'number' && typeof b === 'number') {\n\t return a > b ? 1 : a < b ? -1 : 0;\n\t }\n\n\t a = asciifold(a + '').toLowerCase();\n\t b = asciifold(b + '').toLowerCase();\n\t if (a > b) return 1;\n\t if (b > a) return -1;\n\t return 0;\n\t};\n\n\t/**\n\t * sifter.js\n\t * Copyright (c) 2013–2020 Brian Reavis & contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t * @author Brian Reavis <brian@thirdroute.com>\n\t */\n\n\tclass Sifter {\n\t // []|{};\n\n\t /**\n\t * Textually searches arrays and hashes of objects\n\t * by property (or multiple properties). Designed\n\t * specifically for autocomplete.\n\t *\n\t */\n\t constructor(items, settings) {\n\t this.items = items;\n\t this.settings = settings || {\n\t diacritics: true\n\t };\n\t }\n\n\t /**\n\t * Splits a search string into an array of individual\n\t * regexps to be used to match results.\n\t *\n\t */\n\t tokenize(query, respect_word_boundaries, weights) {\n\t if (!query || !query.length) return [];\n\t const tokens = [];\n\t const words = query.split(/\\s+/);\n\t var field_regex;\n\n\t if (weights) {\n\t field_regex = new RegExp('^(' + Object.keys(weights).map(escape_regex).join('|') + ')\\:(.*)$');\n\t }\n\n\t words.forEach(word => {\n\t let field_match;\n\t let field = null;\n\t let regex = null; // look for \"field:query\" tokens\n\n\t if (field_regex && (field_match = word.match(field_regex))) {\n\t field = field_match[1];\n\t word = field_match[2];\n\t }\n\n\t if (word.length > 0) {\n\t regex = escape_regex(word);\n\n\t if (this.settings.diacritics) {\n\t regex = diacriticRegexPoints(regex);\n\t }\n\n\t if (respect_word_boundaries) regex = \"\\\\b\" + regex;\n\t }\n\n\t tokens.push({\n\t string: word,\n\t regex: regex ? new RegExp(regex, 'iu') : null,\n\t field: field\n\t });\n\t });\n\t return tokens;\n\t }\n\n\t /**\n\t * Returns a function to be used to score individual results.\n\t *\n\t * Good matches will have a higher score than poor matches.\n\t * If an item is not a match, 0 will be returned by the function.\n\t *\n\t * @returns {function}\n\t */\n\t getScoreFunction(query, options) {\n\t var search = this.prepareSearch(query, options);\n\t return this._getScoreFunction(search);\n\t }\n\n\t _getScoreFunction(search) {\n\t const tokens = search.tokens,\n\t token_count = tokens.length;\n\n\t if (!token_count) {\n\t return function () {\n\t return 0;\n\t };\n\t }\n\n\t const fields = search.options.fields,\n\t weights = search.weights,\n\t field_count = fields.length,\n\t getAttrFn = search.getAttrFn;\n\n\t if (!field_count) {\n\t return function () {\n\t return 1;\n\t };\n\t }\n\t /**\n\t * Calculates the score of an object\n\t * against the search query.\n\t *\n\t */\n\n\n\t const scoreObject = function () {\n\t if (field_count === 1) {\n\t return function (token, data) {\n\t const field = fields[0].field;\n\t return scoreValue(getAttrFn(data, field), token, weights[field]);\n\t };\n\t }\n\n\t return function (token, data) {\n\t var sum = 0; // is the token specific to a field?\n\n\t if (token.field) {\n\t const value = getAttrFn(data, token.field);\n\n\t if (!token.regex && value) {\n\t sum += 1 / field_count;\n\t } else {\n\t sum += scoreValue(value, token, 1);\n\t }\n\t } else {\n\t iterate(weights, (weight, field) => {\n\t sum += scoreValue(getAttrFn(data, field), token, weight);\n\t });\n\t }\n\n\t return sum / field_count;\n\t };\n\t }();\n\n\t if (token_count === 1) {\n\t return function (data) {\n\t return scoreObject(tokens[0], data);\n\t };\n\t }\n\n\t if (search.options.conjunction === 'and') {\n\t return function (data) {\n\t var i = 0,\n\t score,\n\t sum = 0;\n\n\t for (; i < token_count; i++) {\n\t score = scoreObject(tokens[i], data);\n\t if (score <= 0) return 0;\n\t sum += score;\n\t }\n\n\t return sum / token_count;\n\t };\n\t } else {\n\t return function (data) {\n\t var sum = 0;\n\t iterate(tokens, token => {\n\t sum += scoreObject(token, data);\n\t });\n\t return sum / token_count;\n\t };\n\t }\n\t }\n\n\t /**\n\t * Returns a function that can be used to compare two\n\t * results, for sorting purposes. If no sorting should\n\t * be performed, `null` will be returned.\n\t *\n\t * @return function(a,b)\n\t */\n\t getSortFunction(query, options) {\n\t var search = this.prepareSearch(query, options);\n\t return this._getSortFunction(search);\n\t }\n\n\t _getSortFunction(search) {\n\t var i, n, implicit_score;\n\t const self = this,\n\t options = search.options,\n\t sort = !search.query && options.sort_empty ? options.sort_empty : options.sort,\n\t sort_flds = [],\n\t multipliers = [];\n\n\t if (typeof sort == 'function') {\n\t return sort.bind(this);\n\t }\n\t /**\n\t * Fetches the specified sort field value\n\t * from a search result item.\n\t *\n\t */\n\n\n\t const get_field = function get_field(name, result) {\n\t if (name === '$score') return result.score;\n\t return search.getAttrFn(self.items[result.id], name);\n\t }; // parse options\n\n\n\t if (sort) {\n\t for (i = 0, n = sort.length; i < n; i++) {\n\t if (search.query || sort[i].field !== '$score') {\n\t sort_flds.push(sort[i]);\n\t }\n\t }\n\t } // the \"$score\" field is implied to be the primary\n\t // sort field, unless it's manually specified\n\n\n\t if (search.query) {\n\t implicit_score = true;\n\n\t for (i = 0, n = sort_flds.length; i < n; i++) {\n\t if (sort_flds[i].field === '$score') {\n\t implicit_score = false;\n\t break;\n\t }\n\t }\n\n\t if (implicit_score) {\n\t sort_flds.unshift({\n\t field: '$score',\n\t direction: 'desc'\n\t });\n\t }\n\t } else {\n\t for (i = 0, n = sort_flds.length; i < n; i++) {\n\t if (sort_flds[i].field === '$score') {\n\t sort_flds.splice(i, 1);\n\t break;\n\t }\n\t }\n\t }\n\n\t for (i = 0, n = sort_flds.length; i < n; i++) {\n\t multipliers.push(sort_flds[i].direction === 'desc' ? -1 : 1);\n\t } // build function\n\n\n\t const sort_flds_count = sort_flds.length;\n\n\t if (!sort_flds_count) {\n\t return null;\n\t } else if (sort_flds_count === 1) {\n\t const sort_fld = sort_flds[0].field;\n\t const multiplier = multipliers[0];\n\t return function (a, b) {\n\t return multiplier * cmp(get_field(sort_fld, a), get_field(sort_fld, b));\n\t };\n\t } else {\n\t return function (a, b) {\n\t var i, result, field;\n\n\t for (i = 0; i < sort_flds_count; i++) {\n\t field = sort_flds[i].field;\n\t result = multipliers[i] * cmp(get_field(field, a), get_field(field, b));\n\t if (result) return result;\n\t }\n\n\t return 0;\n\t };\n\t }\n\t }\n\n\t /**\n\t * Parses a search query and returns an object\n\t * with tokens and fields ready to be populated\n\t * with results.\n\t *\n\t */\n\t prepareSearch(query, optsUser) {\n\t const weights = {};\n\t var options = Object.assign({}, optsUser);\n\t propToArray(options, 'sort');\n\t propToArray(options, 'sort_empty'); // convert fields to new format\n\n\t if (options.fields) {\n\t propToArray(options, 'fields');\n\t const fields = [];\n\t options.fields.forEach(field => {\n\t if (typeof field == 'string') {\n\t field = {\n\t field: field,\n\t weight: 1\n\t };\n\t }\n\n\t fields.push(field);\n\t weights[field.field] = 'weight' in field ? field.weight : 1;\n\t });\n\t options.fields = fields;\n\t }\n\n\t return {\n\t options: options,\n\t query: query.toLowerCase().trim(),\n\t tokens: this.tokenize(query, options.respect_word_boundaries, weights),\n\t total: 0,\n\t items: [],\n\t weights: weights,\n\t getAttrFn: options.nesting ? getAttrNesting : getAttr\n\t };\n\t }\n\n\t /**\n\t * Searches through all items and returns a sorted array of matches.\n\t *\n\t */\n\t search(query, options) {\n\t var self = this,\n\t score,\n\t search;\n\t search = this.prepareSearch(query, options);\n\t options = search.options;\n\t query = search.query; // generate result scoring function\n\n\t const fn_score = options.score || self._getScoreFunction(search); // perform search and sort\n\n\n\t if (query.length) {\n\t iterate(self.items, (item, id) => {\n\t score = fn_score(item);\n\n\t if (options.filter === false || score > 0) {\n\t search.items.push({\n\t 'score': score,\n\t 'id': id\n\t });\n\t }\n\t });\n\t } else {\n\t iterate(self.items, (item, id) => {\n\t search.items.push({\n\t 'score': 1,\n\t 'id': id\n\t });\n\t });\n\t }\n\n\t const fn_sort = self._getSortFunction(search);\n\n\t if (fn_sort) search.items.sort(fn_sort); // apply limits\n\n\t search.total = search.items.length;\n\n\t if (typeof options.limit === 'number') {\n\t search.items = search.items.slice(0, options.limit);\n\t }\n\n\t return search;\n\t }\n\n\t}\n\n\t/**\n\t * Return a dom element from either a dom query string, jQuery object, a dom element or html string\n\t * https://stackoverflow.com/questions/494143/creating-a-new-dom-element-from-an-html-string-using-built-in-dom-methods-or-pro/35385518#35385518\n\t *\n\t * param query should be {}\n\t */\n\n\tconst getDom = query => {\n\t if (query.jquery) {\n\t return query[0];\n\t }\n\n\t if (query instanceof HTMLElement) {\n\t return query;\n\t }\n\n\t if (isHtmlString(query)) {\n\t let div = document.createElement('div');\n\t div.innerHTML = query.trim(); // Never return a text node of whitespace as the result\n\n\t return div.firstChild;\n\t }\n\n\t return document.querySelector(query);\n\t};\n\tconst isHtmlString = arg => {\n\t if (typeof arg === 'string' && arg.indexOf('<') > -1) {\n\t return true;\n\t }\n\n\t return false;\n\t};\n\tconst escapeQuery = query => {\n\t return query.replace(/['\"\\\\]/g, '\\\\$&');\n\t};\n\t/**\n\t * Dispatch an event\n\t *\n\t */\n\n\tconst triggerEvent = (dom_el, event_name) => {\n\t var event = document.createEvent('HTMLEvents');\n\t event.initEvent(event_name, true, false);\n\t dom_el.dispatchEvent(event);\n\t};\n\t/**\n\t * Apply CSS rules to a dom element\n\t *\n\t */\n\n\tconst applyCSS = (dom_el, css) => {\n\t Object.assign(dom_el.style, css);\n\t};\n\t/**\n\t * Add css classes\n\t *\n\t */\n\n\tconst addClasses = (elmts, ...classes) => {\n\t var norm_classes = classesArray(classes);\n\t elmts = castAsArray(elmts);\n\t elmts.map(el => {\n\t norm_classes.map(cls => {\n\t el.classList.add(cls);\n\t });\n\t });\n\t};\n\t/**\n\t * Remove css classes\n\t *\n\t */\n\n\tconst removeClasses = (elmts, ...classes) => {\n\t var norm_classes = classesArray(classes);\n\t elmts = castAsArray(elmts);\n\t elmts.map(el => {\n\t norm_classes.map(cls => {\n\t el.classList.remove(cls);\n\t });\n\t });\n\t};\n\t/**\n\t * Return arguments\n\t *\n\t */\n\n\tconst classesArray = args => {\n\t var classes = [];\n\t iterate(args, _classes => {\n\t if (typeof _classes === 'string') {\n\t _classes = _classes.trim().split(/[\\11\\12\\14\\15\\40]/);\n\t }\n\n\t if (Array.isArray(_classes)) {\n\t classes = classes.concat(_classes);\n\t }\n\t });\n\t return classes.filter(Boolean);\n\t};\n\t/**\n\t * Create an array from arg if it's not already an array\n\t *\n\t */\n\n\tconst castAsArray = arg => {\n\t if (!Array.isArray(arg)) {\n\t arg = [arg];\n\t }\n\n\t return arg;\n\t};\n\t/**\n\t * Get the closest node to the evt.target matching the selector\n\t * Stops at wrapper\n\t *\n\t */\n\n\tconst parentMatch = (target, selector, wrapper) => {\n\t if (wrapper && !wrapper.contains(target)) {\n\t return;\n\t }\n\n\t while (target && target.matches) {\n\t if (target.matches(selector)) {\n\t return target;\n\t }\n\n\t target = target.parentNode;\n\t }\n\t};\n\t/**\n\t * Get the first or last item from an array\n\t *\n\t * > 0 - right (last)\n\t * <= 0 - left (first)\n\t *\n\t */\n\n\tconst getTail = (list, direction = 0) => {\n\t if (direction > 0) {\n\t return list[list.length - 1];\n\t }\n\n\t return list[0];\n\t};\n\t/**\n\t * Return true if an object is empty\n\t *\n\t */\n\n\tconst isEmptyObject = obj => {\n\t return Object.keys(obj).length === 0;\n\t};\n\t/**\n\t * Get the index of an element amongst sibling nodes of the same type\n\t *\n\t */\n\n\tconst nodeIndex = (el, amongst) => {\n\t if (!el) return -1;\n\t amongst = amongst || el.nodeName;\n\t var i = 0;\n\n\t while (el = el.previousElementSibling) {\n\t if (el.matches(amongst)) {\n\t i++;\n\t }\n\t }\n\n\t return i;\n\t};\n\t/**\n\t * Set attributes of an element\n\t *\n\t */\n\n\tconst setAttr = (el, attrs) => {\n\t iterate(attrs, (val, attr) => {\n\t if (val == null) {\n\t el.removeAttribute(attr);\n\t } else {\n\t el.setAttribute(attr, '' + val);\n\t }\n\t });\n\t};\n\t/**\n\t * Replace a node\n\t */\n\n\tconst replaceNode = (existing, replacement) => {\n\t if (existing.parentNode) existing.parentNode.replaceChild(replacement, existing);\n\t};\n\n\t/**\n\t * highlight v3 | MIT license | Johann Burkard <jb@eaio.com>\n\t * Highlights arbitrary terms in a node.\n\t *\n\t * - Modified by Marshal <beatgates@gmail.com> 2011-6-24 (added regex)\n\t * - Modified by Brian Reavis <brian@thirdroute.com> 2012-8-27 (cleanup)\n\t */\n\tconst highlight = (element, regex) => {\n\t if (regex === null) return; // convet string to regex\n\n\t if (typeof regex === 'string') {\n\t if (!regex.length) return;\n\t regex = new RegExp(regex, 'i');\n\t } // Wrap matching part of text node with highlighting <span>, e.g.\n\t // Soccer -> <span class=\"highlight\">Soc</span>cer for regex = /soc/i\n\n\n\t const highlightText = node => {\n\t var match = node.data.match(regex);\n\n\t if (match && node.data.length > 0) {\n\t var spannode = document.createElement('span');\n\t spannode.className = 'highlight';\n\t var middlebit = node.splitText(match.index);\n\t middlebit.splitText(match[0].length);\n\t var middleclone = middlebit.cloneNode(true);\n\t spannode.appendChild(middleclone);\n\t replaceNode(middlebit, spannode);\n\t return 1;\n\t }\n\n\t return 0;\n\t }; // Recurse element node, looking for child text nodes to highlight, unless element\n\t // is childless, <script>, <style>, or already highlighted: <span class=\"hightlight\">\n\n\n\t const highlightChildren = node => {\n\t if (node.nodeType === 1 && node.childNodes && !/(script|style)/i.test(node.tagName) && (node.className !== 'highlight' || node.tagName !== 'SPAN')) {\n\t for (var i = 0; i < node.childNodes.length; ++i) {\n\t i += highlightRecursive(node.childNodes[i]);\n\t }\n\t }\n\t };\n\n\t const highlightRecursive = node => {\n\t if (node.nodeType === 3) {\n\t return highlightText(node);\n\t }\n\n\t highlightChildren(node);\n\t return 0;\n\t };\n\n\t highlightRecursive(element);\n\t};\n\t/**\n\t * removeHighlight fn copied from highlight v5 and\n\t * edited to remove with(), pass js strict mode, and use without jquery\n\t */\n\n\tconst removeHighlight = el => {\n\t var elements = el.querySelectorAll(\"span.highlight\");\n\t Array.prototype.forEach.call(elements, function (el) {\n\t var parent = el.parentNode;\n\t parent.replaceChild(el.firstChild, el);\n\t parent.normalize();\n\t });\n\t};\n\n\tconst KEY_A = 65;\n\tconst KEY_RETURN = 13;\n\tconst KEY_ESC = 27;\n\tconst KEY_LEFT = 37;\n\tconst KEY_UP = 38;\n\tconst KEY_RIGHT = 39;\n\tconst KEY_DOWN = 40;\n\tconst KEY_BACKSPACE = 8;\n\tconst KEY_DELETE = 46;\n\tconst KEY_TAB = 9;\n\tconst IS_MAC = typeof navigator === 'undefined' ? false : /Mac/.test(navigator.userAgent);\n\tconst KEY_SHORTCUT = IS_MAC ? 'metaKey' : 'ctrlKey'; // ctrl key or apple key for ma\n\n\tvar defaults = {\n\t options: [],\n\t optgroups: [],\n\t plugins: [],\n\t delimiter: ',',\n\t splitOn: null,\n\t // regexp or string for splitting up values from a paste command\n\t persist: true,\n\t diacritics: true,\n\t create: null,\n\t createOnBlur: false,\n\t createFilter: null,\n\t highlight: true,\n\t openOnFocus: true,\n\t shouldOpen: null,\n\t maxOptions: 50,\n\t maxItems: null,\n\t hideSelected: null,\n\t duplicates: false,\n\t addPrecedence: false,\n\t selectOnTab: false,\n\t preload: null,\n\t allowEmptyOption: false,\n\t //closeAfterSelect: false,\n\t loadThrottle: 300,\n\t loadingClass: 'loading',\n\t dataAttr: null,\n\t //'data-data',\n\t optgroupField: 'optgroup',\n\t valueField: 'value',\n\t labelField: 'text',\n\t disabledField: 'disabled',\n\t optgroupLabelField: 'label',\n\t optgroupValueField: 'value',\n\t lockOptgroupOrder: false,\n\t sortField: '$order',\n\t searchField: ['text'],\n\t searchConjunction: 'and',\n\t mode: null,\n\t wrapperClass: 'ts-wrapper',\n\t controlClass: 'ts-control',\n\t dropdownClass: 'ts-dropdown',\n\t dropdownContentClass: 'ts-dropdown-content',\n\t itemClass: 'item',\n\t optionClass: 'option',\n\t dropdownParent: null,\n\t controlInput: '<input type=\"text\" autocomplete=\"off\" size=\"1\" />',\n\t copyClassesToDropdown: false,\n\t placeholder: null,\n\t hidePlaceholder: null,\n\t shouldLoad: function (query) {\n\t return query.length > 0;\n\t },\n\n\t /*\n\t load : null, // function(query, callback) { ... }\n\t score : null, // function(search) { ... }\n\t onInitialize : null, // function() { ... }\n\t onChange : null, // function(value) { ... }\n\t onItemAdd : null, // function(value, $item) { ... }\n\t onItemRemove : null, // function(value) { ... }\n\t onClear : null, // function() { ... }\n\t onOptionAdd : null, // function(value, data) { ... }\n\t onOptionRemove : null, // function(value) { ... }\n\t onOptionClear : null, // function() { ... }\n\t onOptionGroupAdd : null, // function(id, data) { ... }\n\t onOptionGroupRemove : null, // function(id) { ... }\n\t onOptionGroupClear : null, // function() { ... }\n\t onDropdownOpen : null, // function(dropdown) { ... }\n\t onDropdownClose : null, // function(dropdown) { ... }\n\t onType : null, // function(str) { ... }\n\t onDelete : null, // function(values) { ... }\n\t */\n\t render: {\n\t /*\n\t item: null,\n\t optgroup: null,\n\t optgroup_header: null,\n\t option: null,\n\t option_create: null\n\t */\n\t }\n\t};\n\n\t/**\n\t * Converts a scalar to its best string representation\n\t * for hash keys and HTML attribute values.\n\t *\n\t * Transformations:\n\t * 'str' -> 'str'\n\t * null -> ''\n\t * undefined -> ''\n\t * true -> '1'\n\t * false -> '0'\n\t * 0 -> '0'\n\t * 1 -> '1'\n\t *\n\t */\n\tconst hash_key = value => {\n\t if (typeof value === 'undefined' || value === null) return null;\n\t return get_hash(value);\n\t};\n\tconst get_hash = value => {\n\t if (typeof value === 'boolean') return value ? '1' : '0';\n\t return value + '';\n\t};\n\t/**\n\t * Escapes a string for use within HTML.\n\t *\n\t */\n\n\tconst escape_html = str => {\n\t return (str + '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"');\n\t};\n\t/**\n\t * Debounce the user provided load function\n\t *\n\t */\n\n\tconst loadDebounce = (fn, delay) => {\n\t var timeout;\n\t return function (value, callback) {\n\t var self = this;\n\n\t if (timeout) {\n\t self.loading = Math.max(self.loading - 1, 0);\n\t clearTimeout(timeout);\n\t }\n\n\t timeout = setTimeout(function () {\n\t timeout = null;\n\t self.loadedSearches[value] = true;\n\t fn.call(self, value, callback);\n\t }, delay);\n\t };\n\t};\n\t/**\n\t * Debounce all fired events types listed in `types`\n\t * while executing the provided `fn`.\n\t *\n\t */\n\n\tconst debounce_events = (self, types, fn) => {\n\t var type;\n\t var trigger = self.trigger;\n\t var event_args = {}; // override trigger method\n\n\t self.trigger = function () {\n\t var type = arguments[0];\n\n\t if (types.indexOf(type) !== -1) {\n\t event_args[type] = arguments;\n\t } else {\n\t return trigger.apply(self, arguments);\n\t }\n\t }; // invoke provided function\n\n\n\t fn.apply(self, []);\n\t self.trigger = trigger; // trigger queued events\n\n\t for (type of types) {\n\t if (type in event_args) {\n\t trigger.apply(self, event_args[type]);\n\t }\n\t }\n\t};\n\t/**\n\t * Determines the current selection within a text input control.\n\t * Returns an object containing:\n\t * - start\n\t * - length\n\t *\n\t */\n\n\tconst getSelection = input => {\n\t return {\n\t start: input.selectionStart || 0,\n\t length: (input.selectionEnd || 0) - (input.selectionStart || 0)\n\t };\n\t};\n\t/**\n\t * Prevent default\n\t *\n\t */\n\n\tconst preventDefault = (evt, stop = false) => {\n\t if (evt) {\n\t evt.preventDefault();\n\n\t if (stop) {\n\t evt.stopPropagation();\n\t }\n\t }\n\t};\n\t/**\n\t * Prevent default\n\t *\n\t */\n\n\tconst addEvent = (target, type, callback, options) => {\n\t target.addEventListener(type, callback, options);\n\t};\n\t/**\n\t * Return true if the requested key is down\n\t * Will return false if more than one control character is pressed ( when [ctrl+shift+a] != [ctrl+a] )\n\t * The current evt may not always set ( eg calling advanceSelection() )\n\t *\n\t */\n\n\tconst isKeyDown = (key_name, evt) => {\n\t if (!evt) {\n\t return false;\n\t }\n\n\t if (!evt[key_name]) {\n\t return false;\n\t }\n\n\t var count = (evt.altKey ? 1 : 0) + (evt.ctrlKey ? 1 : 0) + (evt.shiftKey ? 1 : 0) + (evt.metaKey ? 1 : 0);\n\n\t if (count === 1) {\n\t return true;\n\t }\n\n\t return false;\n\t};\n\t/**\n\t * Get the id of an element\n\t * If the id attribute is not set, set the attribute with the given id\n\t *\n\t */\n\n\tconst getId = (el, id) => {\n\t const existing_id = el.getAttribute('id');\n\n\t if (existing_id) {\n\t return existing_id;\n\t }\n\n\t el.setAttribute('id', id);\n\t return id;\n\t};\n\t/**\n\t * Returns a string with backslashes added before characters that need to be escaped.\n\t */\n\n\tconst addSlashes = str => {\n\t return str.replace(/[\\\\\"']/g, '\\\\$&');\n\t};\n\t/**\n\t *\n\t */\n\n\tconst append = (parent, node) => {\n\t if (node) parent.append(node);\n\t};\n\n\tfunction getSettings(input, settings_user) {\n\t var settings = Object.assign({}, defaults, settings_user);\n\t var attr_data = settings.dataAttr;\n\t var field_label = settings.labelField;\n\t var field_value = settings.valueField;\n\t var field_disabled = settings.disabledField;\n\t var field_optgroup = settings.optgroupField;\n\t var field_optgroup_label = settings.optgroupLabelField;\n\t var field_optgroup_value = settings.optgroupValueField;\n\t var tag_name = input.tagName.toLowerCase();\n\t var placeholder = input.getAttribute('placeholder') || input.getAttribute('data-placeholder');\n\n\t if (!placeholder && !settings.allowEmptyOption) {\n\t let option = input.querySelector('option[value=\"\"]');\n\n\t if (option) {\n\t placeholder = option.textContent;\n\t }\n\t }\n\n\t var settings_element = {\n\t placeholder: placeholder,\n\t options: [],\n\t optgroups: [],\n\t items: [],\n\t maxItems: null\n\t };\n\t /**\n\t * Initialize from a <select> element.\n\t *\n\t */\n\n\t var init_select = () => {\n\t var tagName;\n\t var options = settings_element.options;\n\t var optionsMap = {};\n\t var group_count = 1;\n\n\t var readData = el => {\n\t var data = Object.assign({}, el.dataset); // get plain object from DOMStringMap\n\n\t var json = attr_data && data[attr_data];\n\n\t if (typeof json === 'string' && json.length) {\n\t data = Object.assign(data, JSON.parse(json));\n\t }\n\n\t return data;\n\t };\n\n\t var addOption = (option, group) => {\n\t var value = hash_key(option.value);\n\t if (value == null) return;\n\t if (!value && !settings.allowEmptyOption) return; // if the option already exists, it's probably been\n\t // duplicated in another optgroup. in this case, push\n\t // the current group to the \"optgroup\" property on the\n\t // existing option so that it's rendered in both places.\n\n\t if (optionsMap.hasOwnProperty(value)) {\n\t if (group) {\n\t var arr = optionsMap[value][field_optgroup];\n\n\t if (!arr) {\n\t optionsMap[value][field_optgroup] = group;\n\t } else if (!Array.isArray(arr)) {\n\t optionsMap[value][field_optgroup] = [arr, group];\n\t } else {\n\t arr.push(group);\n\t }\n\t }\n\t } else {\n\t var option_data = readData(option);\n\t option_data[field_label] = option_data[field_label] || option.textContent;\n\t option_data[field_value] = option_data[field_value] || value;\n\t option_data[field_disabled] = option_data[field_disabled] || option.disabled;\n\t option_data[field_optgroup] = option_data[field_optgroup] || group;\n\t option_data.$option = option;\n\t optionsMap[value] = option_data;\n\t options.push(option_data);\n\t }\n\n\t if (option.selected) {\n\t settings_element.items.push(value);\n\t }\n\t };\n\n\t var addGroup = optgroup => {\n\t var id, optgroup_data;\n\t optgroup_data = readData(optgroup);\n\t optgroup_data[field_optgroup_label] = optgroup_data[field_optgroup_label] || optgroup.getAttribute('label') || '';\n\t optgroup_data[field_optgroup_value] = optgroup_data[field_optgroup_value] || group_count++;\n\t optgroup_data[field_disabled] = optgroup_data[field_disabled] || optgroup.disabled;\n\t settings_element.optgroups.push(optgroup_data);\n\t id = optgroup_data[field_optgroup_value];\n\t iterate(optgroup.children, option => {\n\t addOption(option, id);\n\t });\n\t };\n\n\t settings_element.maxItems = input.hasAttribute('multiple') ? null : 1;\n\t iterate(input.children, child => {\n\t tagName = child.tagName.toLowerCase();\n\n\t if (tagName === 'optgroup') {\n\t addGroup(child);\n\t } else if (tagName === 'option') {\n\t addOption(child);\n\t }\n\t });\n\t };\n\t /**\n\t * Initialize from a <input type=\"text\"> element.\n\t *\n\t */\n\n\n\t var init_textbox = () => {\n\t const data_raw = input.getAttribute(attr_data);\n\n\t if (!data_raw) {\n\t var value = input.value.trim() || '';\n\t if (!settings.allowEmptyOption && !value.length) return;\n\t const values = value.split(settings.delimiter);\n\t iterate(values, value => {\n\t const option = {};\n\t option[field_label] = value;\n\t option[field_value] = value;\n\t settings_element.options.push(option);\n\t });\n\t settings_element.items = values;\n\t } else {\n\t settings_element.options = JSON.parse(data_raw);\n\t iterate(settings_element.options, opt => {\n\t settings_element.items.push(opt[field_value]);\n\t });\n\t }\n\t };\n\n\t if (tag_name === 'select') {\n\t init_select();\n\t } else {\n\t init_textbox();\n\t }\n\n\t return Object.assign({}, defaults, settings_element, settings_user);\n\t}\n\n\tvar instance_i = 0;\n\tclass TomSelect extends MicroPlugin(MicroEvent) {\n\t // @deprecated 1.8\n\t constructor(input_arg, user_settings) {\n\t super();\n\t this.order = 0;\n\t this.isOpen = false;\n\t this.isDisabled = false;\n\t this.isInvalid = false;\n\t this.isValid = true;\n\t this.isLocked = false;\n\t this.isFocused = false;\n\t this.isInputHidden = false;\n\t this.isSetup = false;\n\t this.ignoreFocus = false;\n\t this.hasOptions = false;\n\t this.lastValue = '';\n\t this.caretPos = 0;\n\t this.loading = 0;\n\t this.loadedSearches = {};\n\t this.activeOption = null;\n\t this.activeItems = [];\n\t this.optgroups = {};\n\t this.options = {};\n\t this.userOptions = {};\n\t this.items = [];\n\t instance_i++;\n\t var dir;\n\t var input = getDom(input_arg);\n\n\t if (input.tomselect) {\n\t throw new Error('Tom Select already initialized on this element');\n\t }\n\n\t input.tomselect = this; // detect rtl environment\n\n\t var computedStyle = window.getComputedStyle && window.getComputedStyle(input, null);\n\t dir = computedStyle.getPropertyValue('direction'); // setup default state\n\n\t const settings = getSettings(input, user_settings);\n\t this.settings = settings;\n\t this.input = input;\n\t this.tabIndex = input.tabIndex || 0;\n\t this.is_select_tag = input.tagName.toLowerCase() === 'select';\n\t this.rtl = /rtl/i.test(dir);\n\t this.inputId = getId(input, 'tomselect-' + instance_i);\n\t this.isRequired = input.required; // search system\n\n\t this.sifter = new Sifter(this.options, {\n\t diacritics: settings.diacritics\n\t }); // option-dependent defaults\n\n\t settings.mode = settings.mode || (settings.maxItems === 1 ? 'single' : 'multi');\n\n\t if (typeof settings.hideSelected !== 'boolean') {\n\t settings.hideSelected = settings.mode === 'multi';\n\t }\n\n\t if (typeof settings.hidePlaceholder !== 'boolean') {\n\t settings.hidePlaceholder = settings.mode !== 'multi';\n\t } // set up createFilter callback\n\n\n\t var filter = settings.createFilter;\n\n\t if (typeof filter !== 'function') {\n\t if (typeof filter === 'string') {\n\t filter = new RegExp(filter);\n\t }\n\n\t if (filter instanceof RegExp) {\n\t settings.createFilter = input => filter.test(input);\n\t } else {\n\t settings.createFilter = () => true;\n\t }\n\t }\n\n\t this.initializePlugins(settings.plugins);\n\t this.setupCallbacks();\n\t this.setupTemplates(); // Create all elements\n\n\t const wrapper = getDom('<div>');\n\t const control = getDom('<div>');\n\n\t const dropdown = this._render('dropdown');\n\n\t const dropdown_content = getDom(`<div role=\"listbox\" tabindex=\"-1\">`);\n\t const classes = this.input.getAttribute('class') || '';\n\t const inputMode = settings.mode;\n\t var control_input;\n\t addClasses(wrapper, settings.wrapperClass, classes, inputMode);\n\t addClasses(control, settings.controlClass);\n\t append(wrapper, control);\n\t addClasses(dropdown, settings.dropdownClass, inputMode);\n\n\t if (settings.copyClassesToDropdown) {\n\t addClasses(dropdown, classes);\n\t }\n\n\t addClasses(dropdown_content, settings.dropdownContentClass);\n\t append(dropdown, dropdown_content);\n\t getDom(settings.dropdownParent || wrapper).appendChild(dropdown); // default controlInput\n\n\t if (isHtmlString(settings.controlInput)) {\n\t control_input = getDom(settings.controlInput); // set attributes\n\n\t var attrs = ['autocorrect', 'autocapitalize', 'autocomplete'];\n\t iterate(attrs, attr => {\n\t if (input.getAttribute(attr)) {\n\t setAttr(control_input, {\n\t [attr]: input.getAttribute(attr)\n\t });\n\t }\n\t });\n\t control_input.tabIndex = -1;\n\t control.appendChild(control_input);\n\t this.focus_node = control_input; // dom element\t\n\t } else if (settings.controlInput) {\n\t control_input = getDom(settings.controlInput);\n\t this.focus_node = control_input;\n\t } else {\n\t control_input = getDom('<input/>');\n\t this.focus_node = control;\n\t }\n\n\t this.wrapper = wrapper;\n\t this.dropdown = dropdown;\n\t this.dropdown_content = dropdown_content;\n\t this.control = control;\n\t this.control_input = control_input;\n\t this.setup();\n\t }\n\t /**\n\t * set up event bindings.\n\t *\n\t */\n\n\n\t setup() {\n\t const self = this;\n\t const settings = self.settings;\n\t const control_input = self.control_input;\n\t const dropdown = self.dropdown;\n\t const dropdown_content = self.dropdown_content;\n\t const wrapper = self.wrapper;\n\t const control = self.control;\n\t const input = self.input;\n\t const focus_node = self.focus_node;\n\t const passive_event = {\n\t passive: true\n\t };\n\t const listboxId = self.inputId + '-ts-dropdown';\n\t setAttr(dropdown_content, {\n\t id: listboxId\n\t });\n\t setAttr(focus_node, {\n\t role: 'combobox',\n\t 'aria-haspopup': 'listbox',\n\t 'aria-expanded': 'false',\n\t 'aria-controls': listboxId\n\t });\n\t const control_id = getId(focus_node, self.inputId + '-ts-control');\n\t const query = \"label[for='\" + escapeQuery(self.inputId) + \"']\";\n\t const label = document.querySelector(query);\n\t const label_click = self.focus.bind(self);\n\n\t if (label) {\n\t addEvent(label, 'click', label_click);\n\t setAttr(label, {\n\t for: control_id\n\t });\n\t const label_id = getId(label, self.inputId + '-ts-label');\n\t setAttr(focus_node, {\n\t 'aria-labelledby': label_id\n\t });\n\t setAttr(dropdown_content, {\n\t 'aria-labelledby': label_id\n\t });\n\t }\n\n\t wrapper.style.width = input.style.width;\n\n\t if (self.plugins.names.length) {\n\t const classes_plugins = 'plugin-' + self.plugins.names.join(' plugin-');\n\t addClasses([wrapper, dropdown], classes_plugins);\n\t }\n\n\t if ((settings.maxItems === null || settings.maxItems > 1) && self.is_select_tag) {\n\t setAttr(input, {\n\t multiple: 'multiple'\n\t });\n\t }\n\n\t if (self.settings.placeholder) {\n\t setAttr(control_input, {\n\t placeholder: settings.placeholder\n\t });\n\t } // if splitOn was not passed in, construct it from the delimiter to allow pasting universally\n\n\n\t if (!self.settings.splitOn && self.settings.delimiter) {\n\t self.settings.splitOn = new RegExp('\\\\s*' + escape_regex(self.settings.delimiter) + '+\\\\s*');\n\t } // debounce user defined load() if loadThrottle > 0\n\t // after initializePlugins() so plugins can create/modify user defined loaders\n\n\n\t if (settings.load && settings.loadThrottle) {\n\t settings.load = loadDebounce(settings.load, settings.loadThrottle);\n\t }\n\n\t self.control_input.type = input.type; // clicking on an option should select it\n\n\t addEvent(dropdown, 'click', evt => {\n\t const option = parentMatch(evt.target, '[data-selectable]');\n\n\t if (option) {\n\t self.onOptionSelect(evt, option);\n\t preventDefault(evt, true);\n\t }\n\t });\n\t addEvent(control, 'click', evt => {\n\t var target_match = parentMatch(evt.target, '[data-ts-item]', control);\n\n\t if (target_match && self.onItemSelect(evt, target_match)) {\n\t preventDefault(evt, true);\n\t return;\n\t } // retain focus (see control_input mousedown)\n\n\n\t if (control_input.value != '') {\n\t return;\n\t }\n\n\t self.onClick();\n\t preventDefault(evt, true);\n\t }); // keydown on focus_node for arrow_down/arrow_up\n\n\t addEvent(focus_node, 'keydown', e => self.onKeyDown(e)); // keypress and input/keyup\n\n\t addEvent(control_input, 'keypress', e => self.onKeyPress(e));\n\t addEvent(control_input, 'input', e => self.onInput(e));\n\t addEvent(focus_node, 'resize', () => self.positionDropdown(), passive_event);\n\t addEvent(focus_node, 'blur', e => self.onBlur(e));\n\t addEvent(focus_node, 'focus', e => self.onFocus(e));\n\t addEvent(focus_node, 'paste', e => self.onPaste(e));\n\n\t const doc_mousedown = evt => {\n\t // blur if target is outside of this instance\n\t // dropdown is not always inside wrapper\n\t const target = evt.composedPath()[0];\n\n\t if (!wrapper.contains(target) && !dropdown.contains(target)) {\n\t if (self.isFocused) {\n\t self.blur();\n\t }\n\n\t self.inputState();\n\t return;\n\t } // retain focus by preventing native handling. if the\n\t // event target is the input it should not be modified.\n\t // otherwise, text selection within the input won't work.\n\t // Fixes bug #212 which is no covered by tests\n\n\n\t if (target == control_input && self.isOpen) {\n\t evt.stopPropagation(); // clicking anywhere in the control should not blur the control_input (which would close the dropdown)\n\t } else {\n\t preventDefault(evt, true);\n\t }\n\t };\n\n\t var win_scroll = () => {\n\t if (self.isOpen) {\n\t self.positionDropdown();\n\t }\n\t };\n\n\t addEvent(document, 'mousedown', doc_mousedown);\n\t addEvent(window, 'scroll', win_scroll, passive_event);\n\t addEvent(window, 'resize', win_scroll, passive_event);\n\n\t this._destroy = () => {\n\t document.removeEventListener('mousedown', doc_mousedown);\n\t window.removeEventListener('sroll', win_scroll);\n\t window.removeEventListener('resize', win_scroll);\n\t if (label) label.removeEventListener('click', label_click);\n\t }; // store original html and tab index so that they can be\n\t // restored when the destroy() method is called.\n\n\n\t this.revertSettings = {\n\t innerHTML: input.innerHTML,\n\t tabIndex: input.tabIndex\n\t };\n\t input.tabIndex = -1;\n\t input.insertAdjacentElement('afterend', self.wrapper);\n\t self.sync(false);\n\t settings.items = [];\n\t delete settings.optgroups;\n\t delete settings.options;\n\t addEvent(input, 'invalid', e => {\n\t if (self.isValid) {\n\t self.isValid = false;\n\t self.isInvalid = true;\n\t self.refreshState();\n\t }\n\t });\n\t self.updateOriginalInput();\n\t self.refreshItems();\n\t self.close(false);\n\t self.inputState();\n\t self.isSetup = true;\n\n\t if (input.disabled) {\n\t self.disable();\n\t } else {\n\t self.enable(); //sets tabIndex\n\t }\n\n\t self.on('change', this.onChange);\n\t addClasses(input, 'tomselected', 'ts-hidden-accessible');\n\t self.trigger('initialize'); // preload options\n\n\t if (settings.preload === true) {\n\t self.preload();\n\t }\n\t }\n\t /**\n\t * Register options and optgroups\n\t *\n\t */\n\n\n\t setupOptions(options = [], optgroups = []) {\n\t // build options table\n\t this.addOptions(options); // build optgroup table\n\n\t iterate(optgroups, optgroup => {\n\t this.registerOptionGroup(optgroup);\n\t });\n\t }\n\t /**\n\t * Sets up default rendering functions.\n\t */\n\n\n\t setupTemplates() {\n\t var self = this;\n\t var field_label = self.settings.labelField;\n\t var field_optgroup = self.settings.optgroupLabelField;\n\t var templates = {\n\t 'optgroup': data => {\n\t let optgroup = document.createElement('div');\n\t optgroup.className = 'optgroup';\n\t optgroup.appendChild(data.options);\n\t return optgroup;\n\t },\n\t 'optgroup_header': (data, escape) => {\n\t return '<div class=\"optgroup-header\">' + escape(data[field_optgroup]) + '</div>';\n\t },\n\t 'option': (data, escape) => {\n\t return '<div>' + escape(data[field_label]) + '</div>';\n\t },\n\t 'item': (data, escape) => {\n\t return '<div>' + escape(data[field_label]) + '</div>';\n\t },\n\t 'option_create': (data, escape) => {\n\t return '<div class=\"create\">Add <strong>' + escape(data.input) + '</strong>…</div>';\n\t },\n\t 'no_results': () => {\n\t return '<div class=\"no-results\">No results found</div>';\n\t },\n\t 'loading': () => {\n\t return '<div class=\"spinner\"></div>';\n\t },\n\t 'not_loading': () => {},\n\t 'dropdown': () => {\n\t return '<div></div>';\n\t }\n\t };\n\t self.settings.render = Object.assign({}, templates, self.settings.render);\n\t }\n\t /**\n\t * Maps fired events to callbacks provided\n\t * in the settings used when creating the control.\n\t */\n\n\n\t setupCallbacks() {\n\t var key, fn;\n\t var callbacks = {\n\t 'initialize': 'onInitialize',\n\t 'change': 'onChange',\n\t 'item_add': 'onItemAdd',\n\t 'item_remove': 'onItemRemove',\n\t 'item_select': 'onItemSelect',\n\t 'clear': 'onClear',\n\t 'option_add': 'onOptionAdd',\n\t 'option_remove': 'onOptionRemove',\n\t 'option_clear': 'onOptionClear',\n\t 'optgroup_add': 'onOptionGroupAdd',\n\t 'optgroup_remove': 'onOptionGroupRemove',\n\t 'optgroup_clear': 'onOptionGroupClear',\n\t 'dropdown_open': 'onDropdownOpen',\n\t 'dropdown_close': 'onDropdownClose',\n\t 'type': 'onType',\n\t 'load': 'onLoad',\n\t 'focus': 'onFocus',\n\t 'blur': 'onBlur'\n\t };\n\n\t for (key in callbacks) {\n\t fn = this.settings[callbacks[key]];\n\t if (fn) this.on(key, fn);\n\t }\n\t }\n\t /**\n\t * Sync the Tom Select instance with the original input or select\n\t *\n\t */\n\n\n\t sync(get_settings = true) {\n\t const self = this;\n\t const settings = get_settings ? getSettings(self.input, {\n\t delimiter: self.settings.delimiter\n\t }) : self.settings;\n\t self.setupOptions(settings.options, settings.optgroups);\n\t self.setValue(settings.items, true); // silent prevents recursion\n\n\t self.lastQuery = null; // so updated options will be displayed in dropdown\n\t }\n\t /**\n\t * Triggered when the main control element\n\t * has a click event.\n\t *\n\t */\n\n\n\t onClick() {\n\t var self = this;\n\n\t if (self.activeItems.length > 0) {\n\t self.clearActiveItems();\n\t self.focus();\n\t return;\n\t }\n\n\t if (self.isFocused && self.isOpen) {\n\t self.blur();\n\t } else {\n\t self.focus();\n\t }\n\t }\n\t /**\n\t * @deprecated v1.7\n\t *\n\t */\n\n\n\t onMouseDown() {}\n\t /**\n\t * Triggered when the value of the control has been changed.\n\t * This should propagate the event to the original DOM\n\t * input / select element.\n\t */\n\n\n\t onChange() {\n\t triggerEvent(this.input, 'input');\n\t triggerEvent(this.input, 'change');\n\t }\n\t /**\n\t * Triggered on <input> paste.\n\t *\n\t */\n\n\n\t onPaste(e) {\n\t var self = this;\n\n\t if (self.isInputHidden || self.isLocked) {\n\t preventDefault(e);\n\t return;\n\t } // If a regex or string is included, this will split the pasted\n\t // input and create Items for each separate value\n\n\n\t if (self.settings.splitOn) {\n\t // Wait for pasted text to be recognized in value\n\t setTimeout(() => {\n\t var pastedText = self.inputValue();\n\n\t if (!pastedText.match(self.settings.splitOn)) {\n\t return;\n\t }\n\n\t var splitInput = pastedText.trim().split(self.settings.splitOn);\n\t iterate(splitInput, piece => {\n\t self.createItem(piece);\n\t });\n\t }, 0);\n\t }\n\t }\n\t /**\n\t * Triggered on <input> keypress.\n\t *\n\t */\n\n\n\t onKeyPress(e) {\n\t var self = this;\n\n\t if (self.isLocked) {\n\t preventDefault(e);\n\t return;\n\t }\n\n\t var character = String.fromCharCode(e.keyCode || e.which);\n\n\t if (self.settings.create && self.settings.mode === 'multi' && character === self.settings.delimiter) {\n\t self.createItem();\n\t preventDefault(e);\n\t return;\n\t }\n\t }\n\t /**\n\t * Triggered on <input> keydown.\n\t *\n\t */\n\n\n\t onKeyDown(e) {\n\t var self = this;\n\n\t if (self.isLocked) {\n\t if (e.keyCode !== KEY_TAB) {\n\t preventDefault(e);\n\t }\n\n\t return;\n\t }\n\n\t switch (e.keyCode) {\n\t // ctrl+A: select all\n\t case KEY_A:\n\t if (isKeyDown(KEY_SHORTCUT, e)) {\n\t if (self.control_input.value == '') {\n\t preventDefault(e);\n\t self.selectAll();\n\t return;\n\t }\n\t }\n\n\t break;\n\t // esc: close dropdown\n\n\t case KEY_ESC:\n\t if (self.isOpen) {\n\t preventDefault(e, true);\n\t self.close();\n\t }\n\n\t self.clearActiveItems();\n\t return;\n\t // down: open dropdown or move selection down\n\n\t case KEY_DOWN:\n\t if (!self.isOpen && self.hasOptions) {\n\t self.open();\n\t } else if (self.activeOption) {\n\t let next = self.getAdjacent(self.activeOption, 1);\n\t if (next) self.setActiveOption(next);\n\t }\n\n\t preventDefault(e);\n\t return;\n\t // up: move selection up\n\n\t case KEY_UP:\n\t if (self.activeOption) {\n\t let prev = self.getAdjacent(self.activeOption, -1);\n\t if (prev) self.setActiveOption(prev);\n\t }\n\n\t preventDefault(e);\n\t return;\n\t // return: select active option\n\n\t case KEY_RETURN:\n\t if (self.canSelect(self.activeOption)) {\n\t self.onOptionSelect(e, self.activeOption);\n\t preventDefault(e); // if the option_create=null, the dropdown might be closed\n\t } else if (self.settings.create && self.createItem()) {\n\t preventDefault(e);\n\t }\n\n\t return;\n\t // left: modifiy item selection to the left\n\n\t case KEY_LEFT:\n\t self.advanceSelection(-1, e);\n\t return;\n\t // right: modifiy item selection to the right\n\n\t case KEY_RIGHT:\n\t self.advanceSelection(1, e);\n\t return;\n\t // tab: select active option and/or create item\n\n\t case KEY_TAB:\n\t if (self.settings.selectOnTab) {\n\t if (self.canSelect(self.activeOption)) {\n\t self.onOptionSelect(e, self.activeOption); // prevent default [tab] behaviour of jump to the next field\n\t // if select isFull, then the dropdown won't be open and [tab] will work normally\n\n\t preventDefault(e);\n\t }\n\n\t if (self.settings.create && self.createItem()) {\n\t preventDefault(e);\n\t }\n\t }\n\n\t return;\n\t // delete|backspace: delete items\n\n\t case KEY_BACKSPACE:\n\t case KEY_DELETE:\n\t self.deleteSelection(e);\n\t return;\n\t } // don't enter text in the control_input when active items are selected\n\n\n\t if (self.isInputHidden && !isKeyDown(KEY_SHORTCUT, e)) {\n\t preventDefault(e);\n\t }\n\t }\n\t /**\n\t * Triggered on <input> keyup.\n\t *\n\t */\n\n\n\t onInput(e) {\n\t var self = this;\n\n\t if (self.isLocked) {\n\t return;\n\t }\n\n\t var value = self.inputValue();\n\n\t if (self.lastValue !== value) {\n\t self.lastValue = value;\n\n\t if (self.settings.shouldLoad.call(self, value)) {\n\t self.load(value);\n\t }\n\n\t self.refreshOptions();\n\t self.trigger('type', value);\n\t }\n\t }\n\t /**\n\t * Triggered on <input> focus.\n\t *\n\t */\n\n\n\t onFocus(e) {\n\t var self = this;\n\t var wasFocused = self.isFocused;\n\n\t if (self.isDisabled) {\n\t self.blur();\n\t preventDefault(e);\n\t return;\n\t }\n\n\t if (self.ignoreFocus) return;\n\t self.isFocused = true;\n\t if (self.settings.preload === 'focus') self.preload();\n\t if (!wasFocused) self.trigger('focus');\n\n\t if (!self.activeItems.length) {\n\t self.showInput();\n\t self.refreshOptions(!!self.settings.openOnFocus);\n\t }\n\n\t self.refreshState();\n\t }\n\t /**\n\t * Triggered on <input> blur.\n\t *\n\t */\n\n\n\t onBlur(e) {\n\t if (document.hasFocus() === false) return;\n\t var self = this;\n\t if (!self.isFocused) return;\n\t self.isFocused = false;\n\t self.ignoreFocus = false;\n\n\t var deactivate = () => {\n\t self.close();\n\t self.setActiveItem();\n\t self.setCaret(self.items.length);\n\t self.trigger('blur');\n\t };\n\n\t if (self.settings.create && self.settings.createOnBlur) {\n\t self.createItem(null, false, deactivate);\n\t } else {\n\t deactivate();\n\t }\n\t }\n\t /**\n\t * Triggered when the user clicks on an option\n\t * in the autocomplete dropdown menu.\n\t *\n\t */\n\n\n\t onOptionSelect(evt, option) {\n\t var value,\n\t self = this; // should not be possible to trigger a option under a disabled optgroup\n\n\t if (option.parentElement && option.parentElement.matches('[data-disabled]')) {\n\t return;\n\t }\n\n\t if (option.classList.contains('create')) {\n\t self.createItem(null, true, () => {\n\t if (self.settings.closeAfterSelect) {\n\t self.close();\n\t }\n\t });\n\t } else {\n\t value = option.dataset.value;\n\n\t if (typeof value !== 'undefined') {\n\t self.lastQuery = null;\n\t self.addItem(value);\n\n\t if (self.settings.closeAfterSelect) {\n\t self.close();\n\t }\n\n\t if (!self.settings.hideSelected && evt.type && /click/.test(evt.type)) {\n\t self.setActiveOption(option);\n\t }\n\t }\n\t }\n\t }\n\t /**\n\t * Return true if the given option can be selected\n\t *\n\t */\n\n\n\t canSelect(option) {\n\t if (this.isOpen && option && this.dropdown_content.contains(option)) {\n\t return true;\n\t }\n\n\t return false;\n\t }\n\t /**\n\t * Triggered when the user clicks on an item\n\t * that has been selected.\n\t *\n\t */\n\n\n\t onItemSelect(evt, item) {\n\t var self = this;\n\n\t if (!self.isLocked && self.settings.mode === 'multi') {\n\t preventDefault(evt);\n\t self.setActiveItem(item, evt);\n\t return true;\n\t }\n\n\t return false;\n\t }\n\t /**\n\t * Determines whether or not to invoke\n\t * the user-provided option provider / loader\n\t *\n\t * Note, there is a subtle difference between\n\t * this.canLoad() and this.settings.shouldLoad();\n\t *\n\t *\t- settings.shouldLoad() is a user-input validator.\n\t *\tWhen false is returned, the not_loading template\n\t *\twill be added to the dropdown\n\t *\n\t *\t- canLoad() is lower level validator that checks\n\t * \tthe Tom Select instance. There is no inherent user\n\t *\tfeedback when canLoad returns false\n\t *\n\t */\n\n\n\t canLoad(value) {\n\t if (!this.settings.load) return false;\n\t if (this.loadedSearches.hasOwnProperty(value)) return false;\n\t return true;\n\t }\n\t /**\n\t * Invokes the user-provided option provider / loader.\n\t *\n\t */\n\n\n\t load(value) {\n\t const self = this;\n\t if (!self.canLoad(value)) return;\n\t addClasses(self.wrapper, self.settings.loadingClass);\n\t self.loading++;\n\t const callback = self.loadCallback.bind(self);\n\t self.settings.load.call(self, value, callback);\n\t }\n\t /**\n\t * Invoked by the user-provided option provider\n\t *\n\t */\n\n\n\t loadCallback(options, optgroups) {\n\t const self = this;\n\t self.loading = Math.max(self.loading - 1, 0);\n\t self.lastQuery = null;\n\t self.clearActiveOption(); // when new results load, focus should be on first option\n\n\t self.setupOptions(options, optgroups);\n\t self.refreshOptions(self.isFocused && !self.isInputHidden);\n\n\t if (!self.loading) {\n\t removeClasses(self.wrapper, self.settings.loadingClass);\n\t }\n\n\t self.trigger('load', options, optgroups);\n\t }\n\n\t preload() {\n\t var classList = this.wrapper.classList;\n\t if (classList.contains('preloaded')) return;\n\t classList.add('preloaded');\n\t this.load('');\n\t }\n\t /**\n\t * Sets the input field of the control to the specified value.\n\t *\n\t */\n\n\n\t setTextboxValue(value = '') {\n\t var input = this.control_input;\n\t var changed = input.value !== value;\n\n\t if (changed) {\n\t input.value = value;\n\t triggerEvent(input, 'update');\n\t this.lastValue = value;\n\t }\n\t }\n\t /**\n\t * Returns the value of the control. If multiple items\n\t * can be selected (e.g. <select multiple>), this returns\n\t * an array. If only one item can be selected, this\n\t * returns a string.\n\t *\n\t */\n\n\n\t getValue() {\n\t if (this.is_select_tag && this.input.hasAttribute('multiple')) {\n\t return this.items;\n\t }\n\n\t return this.items.join(this.settings.delimiter);\n\t }\n\t /**\n\t * Resets the selected items to the given value.\n\t *\n\t */\n\n\n\t setValue(value, silent) {\n\t var events = silent ? [] : ['change'];\n\t debounce_events(this, events, () => {\n\t this.clear(silent);\n\t this.addItems(value, silent);\n\t });\n\t }\n\t /**\n\t * Resets the number of max items to the given value\n\t *\n\t */\n\n\n\t setMaxItems(value) {\n\t if (value === 0) value = null; //reset to unlimited items.\n\n\t this.settings.maxItems = value;\n\t this.refreshState();\n\t }\n\t /**\n\t * Sets the selected item.\n\t *\n\t */\n\n\n\t setActiveItem(item, e) {\n\t var self = this;\n\t var eventName;\n\t var i, begin, end, swap;\n\t var last;\n\t if (self.settings.mode === 'single') return; // clear the active selection\n\n\t if (!item) {\n\t self.clearActiveItems();\n\n\t if (self.isFocused) {\n\t self.showInput();\n\t }\n\n\t return;\n\t } // modify selection\n\n\n\t eventName = e && e.type.toLowerCase();\n\n\t if (eventName === 'click' && isKeyDown('shiftKey', e) && self.activeItems.length) {\n\t last = self.getLastActive();\n\t begin = Array.prototype.indexOf.call(self.control.children, last);\n\t end = Array.prototype.indexOf.call(self.control.children, item);\n\n\t if (begin > end) {\n\t swap = begin;\n\t begin = end;\n\t end = swap;\n\t }\n\n\t for (i = begin; i <= end; i++) {\n\t item = self.control.children[i];\n\n\t if (self.activeItems.indexOf(item) === -1) {\n\t self.setActiveItemClass(item);\n\t }\n\t }\n\n\t preventDefault(e);\n\t } else if (eventName === 'click' && isKeyDown(KEY_SHORTCUT, e) || eventName === 'keydown' && isKeyDown('shiftKey', e)) {\n\t if (item.classList.contains('active')) {\n\t self.removeActiveItem(item);\n\t } else {\n\t self.setActiveItemClass(item);\n\t }\n\t } else {\n\t self.clearActiveItems();\n\t self.setActiveItemClass(item);\n\t } // ensure control has focus\n\n\n\t self.hideInput();\n\n\t if (!self.isFocused) {\n\t self.focus();\n\t }\n\t }\n\t /**\n\t * Set the active and last-active classes\n\t *\n\t */\n\n\n\t setActiveItemClass(item) {\n\t const self = this;\n\t const last_active = self.control.querySelector('.last-active');\n\t if (last_active) removeClasses(last_active, 'last-active');\n\t addClasses(item, 'active last-active');\n\t self.trigger('item_select', item);\n\n\t if (self.activeItems.indexOf(item) == -1) {\n\t self.activeItems.push(item);\n\t }\n\t }\n\t /**\n\t * Remove active item\n\t *\n\t */\n\n\n\t removeActiveItem(item) {\n\t var idx = this.activeItems.indexOf(item);\n\t this.activeItems.splice(idx, 1);\n\t removeClasses(item, 'active');\n\t }\n\t /**\n\t * Clears all the active items\n\t *\n\t */\n\n\n\t clearActiveItems() {\n\t removeClasses(this.activeItems, 'active');\n\t this.activeItems = [];\n\t }\n\t /**\n\t * Sets the selected item in the dropdown menu\n\t * of available options.\n\t *\n\t */\n\n\n\t setActiveOption(option) {\n\t if (option === this.activeOption) {\n\t return;\n\t }\n\n\t this.clearActiveOption();\n\t if (!option) return;\n\t this.activeOption = option;\n\t setAttr(this.focus_node, {\n\t 'aria-activedescendant': option.getAttribute('id')\n\t });\n\t setAttr(option, {\n\t 'aria-selected': 'true'\n\t });\n\t addClasses(option, 'active');\n\t this.scrollToOption(option);\n\t }\n\t /**\n\t * Sets the dropdown_content scrollTop to display the option\n\t *\n\t */\n\n\n\t scrollToOption(option, behavior) {\n\t if (!option) return;\n\t const content = this.dropdown_content;\n\t const height_menu = content.clientHeight;\n\t const scrollTop = content.scrollTop || 0;\n\t const height_item = option.offsetHeight;\n\t const y = option.getBoundingClientRect().top - content.getBoundingClientRect().top + scrollTop;\n\n\t if (y + height_item > height_menu + scrollTop) {\n\t this.scroll(y - height_menu + height_item, behavior);\n\t } else if (y < scrollTop) {\n\t this.scroll(y, behavior);\n\t }\n\t }\n\t /**\n\t * Scroll the dropdown to the given position\n\t *\n\t */\n\n\n\t scroll(scrollTop, behavior) {\n\t const content = this.dropdown_content;\n\n\t if (behavior) {\n\t content.style.scrollBehavior = behavior;\n\t }\n\n\t content.scrollTop = scrollTop;\n\t content.style.scrollBehavior = '';\n\t }\n\t /**\n\t * Clears the active option\n\t *\n\t */\n\n\n\t clearActiveOption() {\n\t if (this.activeOption) {\n\t removeClasses(this.activeOption, 'active');\n\t setAttr(this.activeOption, {\n\t 'aria-selected': null\n\t });\n\t }\n\n\t this.activeOption = null;\n\t setAttr(this.focus_node, {\n\t 'aria-activedescendant': null\n\t });\n\t }\n\t /**\n\t * Selects all items (CTRL + A).\n\t */\n\n\n\t selectAll() {\n\t if (this.settings.mode === 'single') return;\n\t const activeItems = this.controlChildren();\n\t if (!activeItems.length) return;\n\t this.hideInput();\n\t this.close();\n\t this.activeItems = activeItems;\n\t addClasses(activeItems, 'active');\n\t }\n\t /**\n\t * Determines if the control_input should be in a hidden or visible state\n\t *\n\t */\n\n\n\t inputState() {\n\t var self = this;\n\t if (!self.control.contains(self.control_input)) return;\n\t setAttr(self.control_input, {\n\t placeholder: self.settings.placeholder\n\t });\n\n\t if (self.activeItems.length > 0 || !self.isFocused && self.settings.hidePlaceholder && self.items.length > 0) {\n\t self.setTextboxValue();\n\t self.isInputHidden = true;\n\t } else {\n\t if (self.settings.hidePlaceholder && self.items.length > 0) {\n\t setAttr(self.control_input, {\n\t placeholder: ''\n\t });\n\t }\n\n\t self.isInputHidden = false;\n\t }\n\n\t self.wrapper.classList.toggle('input-hidden', self.isInputHidden);\n\t }\n\t /**\n\t * Hides the input element out of view, while\n\t * retaining its focus.\n\t * @deprecated 1.3\n\t */\n\n\n\t hideInput() {\n\t this.inputState();\n\t }\n\t /**\n\t * Restores input visibility.\n\t * @deprecated 1.3\n\t */\n\n\n\t showInput() {\n\t this.inputState();\n\t }\n\t /**\n\t * Get the input value\n\t */\n\n\n\t inputValue() {\n\t return this.control_input.value.trim();\n\t }\n\t /**\n\t * Gives the control focus.\n\t */\n\n\n\t focus() {\n\t var self = this;\n\t if (self.isDisabled) return;\n\t self.ignoreFocus = true;\n\n\t if (self.control_input.offsetWidth) {\n\t self.control_input.focus();\n\t } else {\n\t self.focus_node.focus();\n\t }\n\n\t setTimeout(() => {\n\t self.ignoreFocus = false;\n\t self.onFocus();\n\t }, 0);\n\t }\n\t /**\n\t * Forces the control out of focus.\n\t *\n\t */\n\n\n\t blur() {\n\t this.focus_node.blur();\n\t this.onBlur();\n\t }\n\t /**\n\t * Returns a function that scores an object\n\t * to show how good of a match it is to the\n\t * provided query.\n\t *\n\t * @return {function}\n\t */\n\n\n\t getScoreFunction(query) {\n\t return this.sifter.getScoreFunction(query, this.getSearchOptions());\n\t }\n\t /**\n\t * Returns search options for sifter (the system\n\t * for scoring and sorting results).\n\t *\n\t * @see https://github.com/orchidjs/sifter.js\n\t * @return {object}\n\t */\n\n\n\t getSearchOptions() {\n\t var settings = this.settings;\n\t var sort = settings.sortField;\n\n\t if (typeof settings.sortField === 'string') {\n\t sort = [{\n\t field: settings.sortField\n\t }];\n\t }\n\n\t return {\n\t fields: settings.searchField,\n\t conjunction: settings.searchConjunction,\n\t sort: sort,\n\t nesting: settings.nesting\n\t };\n\t }\n\t /**\n\t * Searches through available options and returns\n\t * a sorted array of matches.\n\t *\n\t */\n\n\n\t search(query) {\n\t var i, result, calculateScore;\n\t var self = this;\n\t var options = this.getSearchOptions(); // validate user-provided result scoring function\n\n\t if (self.settings.score) {\n\t calculateScore = self.settings.score.call(self, query);\n\n\t if (typeof calculateScore !== 'function') {\n\t throw new Error('Tom Select \"score\" setting must be a function that returns a function');\n\t }\n\t } // perform search\n\n\n\t if (query !== self.lastQuery) {\n\t self.lastQuery = query;\n\t result = self.sifter.search(query, Object.assign(options, {\n\t score: calculateScore\n\t }));\n\t self.currentResults = result;\n\t } else {\n\t result = Object.assign({}, self.currentResults);\n\t } // filter out selected items\n\n\n\t if (self.settings.hideSelected) {\n\t for (i = result.items.length - 1; i >= 0; i--) {\n\t let hashed = hash_key(result.items[i].id);\n\n\t if (hashed && self.items.indexOf(hashed) !== -1) {\n\t result.items.splice(i, 1);\n\t }\n\t }\n\t }\n\n\t return result;\n\t }\n\t /**\n\t * Refreshes the list of available options shown\n\t * in the autocomplete dropdown menu.\n\t *\n\t */\n\n\n\t refreshOptions(triggerDropdown = true) {\n\t var i, j, k, n, optgroup, optgroups, html, has_create_option, active_value, active_group;\n\t var create;\n\t const groups = {};\n\t const groups_order = [];\n\t var self = this;\n\t var query = self.inputValue();\n\t var results = self.search(query);\n\t var active_option = self.activeOption;\n\t var show_dropdown = self.settings.shouldOpen || false;\n\t var dropdown_content = self.dropdown_content;\n\n\t if (active_option) {\n\t active_value = active_option.dataset.value;\n\t active_group = active_option.closest('[data-group]');\n\t } // build markup\n\n\n\t n = results.items.length;\n\n\t if (typeof self.settings.maxOptions === 'number') {\n\t n = Math.min(n, self.settings.maxOptions);\n\t }\n\n\t if (n > 0) {\n\t show_dropdown = true;\n\t } // render and group available options individually\n\n\n\t for (i = 0; i < n; i++) {\n\t // get option dom element\n\t let opt_value = results.items[i].id;\n\t let option = self.options[opt_value];\n\t let option_el = self.getOption(opt_value, true); // toggle 'selected' class\n\n\t if (!self.settings.hideSelected) {\n\t option_el.classList.toggle('selected', self.items.includes(opt_value));\n\t }\n\n\t optgroup = option[self.settings.optgroupField] || '';\n\t optgroups = Array.isArray(optgroup) ? optgroup : [optgroup];\n\n\t for (j = 0, k = optgroups && optgroups.length; j < k; j++) {\n\t optgroup = optgroups[j];\n\n\t if (!self.optgroups.hasOwnProperty(optgroup)) {\n\t optgroup = '';\n\t }\n\n\t if (!groups.hasOwnProperty(optgroup)) {\n\t groups[optgroup] = document.createDocumentFragment();\n\t groups_order.push(optgroup);\n\t } // nodes can only have one parent, so if the option is in mutple groups, we need a clone\n\n\n\t if (j > 0) {\n\t option_el = option_el.cloneNode(true);\n\t setAttr(option_el, {\n\t id: option.$id + '-clone-' + j,\n\t 'aria-selected': null\n\t });\n\t option_el.classList.add('ts-cloned');\n\t removeClasses(option_el, 'active');\n\t } // make sure we keep the activeOption in the same group\n\n\n\t if (active_value == opt_value && active_group && active_group.dataset.group === optgroup) {\n\t active_option = option_el;\n\t }\n\n\t groups[optgroup].appendChild(option_el);\n\t }\n\t } // sort optgroups\n\n\n\t if (this.settings.lockOptgroupOrder) {\n\t groups_order.sort((a, b) => {\n\t var a_order = self.optgroups[a] && self.optgroups[a].$order || 0;\n\t var b_order = self.optgroups[b] && self.optgroups[b].$order || 0;\n\t return a_order - b_order;\n\t });\n\t } // render optgroup headers & join groups\n\n\n\t html = document.createDocumentFragment();\n\t iterate(groups_order, optgroup => {\n\t if (self.optgroups.hasOwnProperty(optgroup) && groups[optgroup].children.length) {\n\t let group_options = document.createDocumentFragment();\n\t let header = self.render('optgroup_header', self.optgroups[optgroup]);\n\t append(group_options, header);\n\t append(group_options, groups[optgroup]);\n\t let group_html = self.render('optgroup', {\n\t group: self.optgroups[optgroup],\n\t options: group_options\n\t });\n\t append(html, group_html);\n\t } else {\n\t append(html, groups[optgroup]);\n\t }\n\t });\n\t dropdown_content.innerHTML = '';\n\t append(dropdown_content, html); // highlight matching terms inline\n\n\t if (self.settings.highlight) {\n\t removeHighlight(dropdown_content);\n\n\t if (results.query.length && results.tokens.length) {\n\t iterate(results.tokens, tok => {\n\t highlight(dropdown_content, tok.regex);\n\t });\n\t }\n\t } // helper method for adding templates to dropdown\n\n\n\t var add_template = template => {\n\t let content = self.render(template, {\n\t input: query\n\t });\n\n\t if (content) {\n\t show_dropdown = true;\n\t dropdown_content.insertBefore(content, dropdown_content.firstChild);\n\t }\n\n\t return content;\n\t }; // add loading message\n\n\n\t if (self.loading) {\n\t add_template('loading'); // invalid query\n\t } else if (!self.settings.shouldLoad.call(self, query)) {\n\t add_template('not_loading'); // add no_results message\n\t } else if (results.items.length === 0) {\n\t add_template('no_results');\n\t } // add create option\n\n\n\t has_create_option = self.canCreate(query);\n\n\t if (has_create_option) {\n\t create = add_template('option_create');\n\t } // activate\n\n\n\t self.hasOptions = results.items.length > 0 || has_create_option;\n\n\t if (show_dropdown) {\n\t if (results.items.length > 0) {\n\t if (!dropdown_content.contains(active_option) && self.settings.mode === 'single' && self.items.length) {\n\t active_option = self.getOption(self.items[0]);\n\t }\n\n\t if (!dropdown_content.contains(active_option)) {\n\t let active_index = 0;\n\n\t if (create && !self.settings.addPrecedence) {\n\t active_index = 1;\n\t }\n\n\t active_option = self.selectable()[active_index];\n\t }\n\t } else if (create) {\n\t active_option = create;\n\t }\n\n\t if (triggerDropdown && !self.isOpen) {\n\t self.open();\n\t self.scrollToOption(active_option, 'auto');\n\t }\n\n\t self.setActiveOption(active_option);\n\t } else {\n\t self.clearActiveOption();\n\n\t if (triggerDropdown && self.isOpen) {\n\t self.close(false); // if create_option=null, we want the dropdown to close but not reset the textbox value\n\t }\n\t }\n\t }\n\t /**\n\t * Return list of selectable options\n\t *\n\t */\n\n\n\t selectable() {\n\t return this.dropdown_content.querySelectorAll('[data-selectable]');\n\t }\n\t /**\n\t * Adds an available option. If it already exists,\n\t * nothing will happen. Note: this does not refresh\n\t * the options list dropdown (use `refreshOptions`\n\t * for that).\n\t *\n\t * Usage:\n\t *\n\t * this.addOption(data)\n\t *\n\t */\n\n\n\t addOption(data, user_created = false) {\n\t const self = this; // @deprecated 1.7.7\n\t // use addOptions( array, user_created ) for adding multiple options\n\n\t if (Array.isArray(data)) {\n\t self.addOptions(data, user_created);\n\t return false;\n\t }\n\n\t const key = hash_key(data[self.settings.valueField]);\n\n\t if (key === null || self.options.hasOwnProperty(key)) {\n\t return false;\n\t }\n\n\t data.$order = data.$order || ++self.order;\n\t data.$id = self.inputId + '-opt-' + data.$order;\n\t self.options[key] = data;\n\t self.lastQuery = null;\n\n\t if (user_created) {\n\t self.userOptions[key] = user_created;\n\t self.trigger('option_add', key, data);\n\t }\n\n\t return key;\n\t }\n\t /**\n\t * Add multiple options\n\t *\n\t */\n\n\n\t addOptions(data, user_created = false) {\n\t iterate(data, dat => {\n\t this.addOption(dat, user_created);\n\t });\n\t }\n\t /**\n\t * @deprecated 1.7.7\n\t */\n\n\n\t registerOption(data) {\n\t return this.addOption(data);\n\t }\n\t /**\n\t * Registers an option group to the pool of option groups.\n\t *\n\t * @return {boolean|string}\n\t */\n\n\n\t registerOptionGroup(data) {\n\t var key = hash_key(data[this.settings.optgroupValueField]);\n\t if (key === null) return false;\n\t data.$order = data.$order || ++this.order;\n\t this.optgroups[key] = data;\n\t return key;\n\t }\n\t /**\n\t * Registers a new optgroup for options\n\t * to be bucketed into.\n\t *\n\t */\n\n\n\t addOptionGroup(id, data) {\n\t var hashed_id;\n\t data[this.settings.optgroupValueField] = id;\n\n\t if (hashed_id = this.registerOptionGroup(data)) {\n\t this.trigger('optgroup_add', hashed_id, data);\n\t }\n\t }\n\t /**\n\t * Removes an existing option group.\n\t *\n\t */\n\n\n\t removeOptionGroup(id) {\n\t if (this.optgroups.hasOwnProperty(id)) {\n\t delete this.optgroups[id];\n\t this.clearCache();\n\t this.trigger('optgroup_remove', id);\n\t }\n\t }\n\t /**\n\t * Clears all existing option groups.\n\t */\n\n\n\t clearOptionGroups() {\n\t this.optgroups = {};\n\t this.clearCache();\n\t this.trigger('optgroup_clear');\n\t }\n\t /**\n\t * Updates an option available for selection. If\n\t * it is visible in the selected items or options\n\t * dropdown, it will be re-rendered automatically.\n\t *\n\t */\n\n\n\t updateOption(value, data) {\n\t const self = this;\n\t var item_new;\n\t var index_item;\n\t const value_old = hash_key(value);\n\t const value_new = hash_key(data[self.settings.valueField]); // sanity checks\n\n\t if (value_old === null) return;\n\t if (!self.options.hasOwnProperty(value_old)) return;\n\t if (typeof value_new !== 'string') throw new Error('Value must be set in option data');\n\t const option = self.getOption(value_old);\n\t const item = self.getItem(value_old);\n\t data.$order = data.$order || self.options[value_old].$order;\n\t delete self.options[value_old]; // invalidate render cache\n\t // don't remove existing node yet, we'll remove it after replacing it\n\n\t self.uncacheValue(value_new);\n\t self.options[value_new] = data; // update the option if it's in the dropdown\n\n\t if (option) {\n\t if (self.dropdown_content.contains(option)) {\n\t const option_new = self._render('option', data);\n\n\t replaceNode(option, option_new);\n\n\t if (self.activeOption === option) {\n\t self.setActiveOption(option_new);\n\t }\n\t }\n\n\t option.remove();\n\t } // update the item if we have one\n\n\n\t if (item) {\n\t index_item = self.items.indexOf(value_old);\n\n\t if (index_item !== -1) {\n\t self.items.splice(index_item, 1, value_new);\n\t }\n\n\t item_new = self._render('item', data);\n\t if (item.classList.contains('active')) addClasses(item_new, 'active');\n\t replaceNode(item, item_new);\n\t } // invalidate last query because we might have updated the sortField\n\n\n\t self.lastQuery = null;\n\t }\n\t /**\n\t * Removes a single option.\n\t *\n\t */\n\n\n\t removeOption(value, silent) {\n\t const self = this;\n\t value = get_hash(value);\n\t self.uncacheValue(value);\n\t delete self.userOptions[value];\n\t delete self.options[value];\n\t self.lastQuery = null;\n\t self.trigger('option_remove', value);\n\t self.removeItem(value, silent);\n\t }\n\t /**\n\t * Clears all options.\n\t */\n\n\n\t clearOptions() {\n\t this.loadedSearches = {};\n\t this.userOptions = {};\n\t this.clearCache();\n\t var selected = {};\n\t iterate(this.options, (option, key) => {\n\t if (this.items.indexOf(key) >= 0) {\n\t selected[key] = this.options[key];\n\t }\n\t });\n\t this.options = this.sifter.items = selected;\n\t this.lastQuery = null;\n\t this.trigger('option_clear');\n\t }\n\t /**\n\t * Returns the dom element of the option\n\t * matching the given value.\n\t *\n\t */\n\n\n\t getOption(value, create = false) {\n\t const hashed = hash_key(value);\n\n\t if (hashed !== null && this.options.hasOwnProperty(hashed)) {\n\t const option = this.options[hashed];\n\n\t if (option.$div) {\n\t return option.$div;\n\t }\n\n\t if (create) {\n\t return this._render('option', option);\n\t }\n\t }\n\n\t return null;\n\t }\n\t /**\n\t * Returns the dom element of the next or previous dom element of the same type\n\t * Note: adjacent options may not be adjacent DOM elements (optgroups)\n\t *\n\t */\n\n\n\t getAdjacent(option, direction, type = 'option') {\n\t var self = this,\n\t all;\n\n\t if (!option) {\n\t return null;\n\t }\n\n\t if (type == 'item') {\n\t all = self.controlChildren();\n\t } else {\n\t all = self.dropdown_content.querySelectorAll('[data-selectable]');\n\t }\n\n\t for (let i = 0; i < all.length; i++) {\n\t if (all[i] != option) {\n\t continue;\n\t }\n\n\t if (direction > 0) {\n\t return all[i + 1];\n\t }\n\n\t return all[i - 1];\n\t }\n\n\t return null;\n\t }\n\t /**\n\t * Returns the dom element of the item\n\t * matching the given value.\n\t *\n\t */\n\n\n\t getItem(item) {\n\t if (typeof item == 'object') {\n\t return item;\n\t }\n\n\t var value = hash_key(item);\n\t return value !== null ? this.control.querySelector(`[data-value=\"${addSlashes(value)}\"]`) : null;\n\t }\n\t /**\n\t * \"Selects\" multiple items at once. Adds them to the list\n\t * at the current caret position.\n\t *\n\t */\n\n\n\t addItems(values, silent) {\n\t var self = this;\n\t var items = Array.isArray(values) ? values : [values];\n\t items = items.filter(x => self.items.indexOf(x) === -1);\n\n\t for (let i = 0, n = items.length; i < n; i++) {\n\t self.isPending = i < n - 1;\n\t self.addItem(items[i], silent);\n\t }\n\t }\n\t /**\n\t * \"Selects\" an item. Adds it to the list\n\t * at the current caret position.\n\t *\n\t */\n\n\n\t addItem(value, silent) {\n\t var events = silent ? [] : ['change', 'dropdown_close'];\n\t debounce_events(this, events, () => {\n\t var item, wasFull;\n\t const self = this;\n\t const inputMode = self.settings.mode;\n\t const hashed = hash_key(value);\n\n\t if (hashed && self.items.indexOf(hashed) !== -1) {\n\t if (inputMode === 'single') {\n\t self.close();\n\t }\n\n\t if (inputMode === 'single' || !self.settings.duplicates) {\n\t return;\n\t }\n\t }\n\n\t if (hashed === null || !self.options.hasOwnProperty(hashed)) return;\n\t if (inputMode === 'single') self.clear(silent);\n\t if (inputMode === 'multi' && self.isFull()) return;\n\t item = self._render('item', self.options[hashed]);\n\n\t if (self.control.contains(item)) {\n\t // duplicates\n\t item = item.cloneNode(true);\n\t }\n\n\t wasFull = self.isFull();\n\t self.items.splice(self.caretPos, 0, hashed);\n\t self.insertAtCaret(item);\n\n\t if (self.isSetup) {\n\t // update menu / remove the option (if this is not one item being added as part of series)\n\t if (!self.isPending && self.settings.hideSelected) {\n\t let option = self.getOption(hashed);\n\t let next = self.getAdjacent(option, 1);\n\n\t if (next) {\n\t self.setActiveOption(next);\n\t }\n\t } // refreshOptions after setActiveOption(),\n\t // otherwise setActiveOption() will be called by refreshOptions() with the wrong value\n\n\n\t if (!self.isPending && !self.settings.closeAfterSelect) {\n\t self.refreshOptions(self.isFocused && inputMode !== 'single');\n\t } // hide the menu if the maximum number of items have been selected or no options are left\n\n\n\t if (self.settings.closeAfterSelect != false && self.isFull()) {\n\t self.close();\n\t } else if (!self.isPending) {\n\t self.positionDropdown();\n\t }\n\n\t self.trigger('item_add', hashed, item);\n\n\t if (!self.isPending) {\n\t self.updateOriginalInput({\n\t silent: silent\n\t });\n\t }\n\t }\n\n\t if (!self.isPending || !wasFull && self.isFull()) {\n\t self.inputState();\n\t self.refreshState();\n\t }\n\t });\n\t }\n\t /**\n\t * Removes the selected item matching\n\t * the provided value.\n\t *\n\t */\n\n\n\t removeItem(item = null, silent) {\n\t const self = this;\n\t item = self.getItem(item);\n\t if (!item) return;\n\t var i, idx;\n\t const value = item.dataset.value;\n\t i = nodeIndex(item);\n\t item.remove();\n\n\t if (item.classList.contains('active')) {\n\t idx = self.activeItems.indexOf(item);\n\t self.activeItems.splice(idx, 1);\n\t removeClasses(item, 'active');\n\t }\n\n\t self.items.splice(i, 1);\n\t self.lastQuery = null;\n\n\t if (!self.settings.persist && self.userOptions.hasOwnProperty(value)) {\n\t self.removeOption(value, silent);\n\t }\n\n\t if (i < self.caretPos) {\n\t self.setCaret(self.caretPos - 1);\n\t }\n\n\t self.updateOriginalInput({\n\t silent: silent\n\t });\n\t self.refreshState();\n\t self.positionDropdown();\n\t self.trigger('item_remove', value, item);\n\t }\n\t /**\n\t * Invokes the `create` method provided in the\n\t * TomSelect options that should provide the data\n\t * for the new item, given the user input.\n\t *\n\t * Once this completes, it will be added\n\t * to the item list.\n\t *\n\t */\n\n\n\t createItem(input = null, triggerDropdown = true, callback = () => {}) {\n\t var self = this;\n\t var caret = self.caretPos;\n\t var output;\n\t input = input || self.inputValue();\n\n\t if (!self.canCreate(input)) {\n\t callback();\n\t return false;\n\t }\n\n\t self.lock();\n\t var created = false;\n\n\t var create = data => {\n\t self.unlock();\n\t if (!data || typeof data !== 'object') return callback();\n\t var value = hash_key(data[self.settings.valueField]);\n\n\t if (typeof value !== 'string') {\n\t return callback();\n\t }\n\n\t self.setTextboxValue();\n\t self.addOption(data, true);\n\t self.setCaret(caret);\n\t self.addItem(value);\n\t callback(data);\n\t created = true;\n\t };\n\n\t if (typeof self.settings.create === 'function') {\n\t output = self.settings.create.call(this, input, create);\n\t } else {\n\t output = {\n\t [self.settings.labelField]: input,\n\t [self.settings.valueField]: input\n\t };\n\t }\n\n\t if (!created) {\n\t create(output);\n\t }\n\n\t return true;\n\t }\n\t /**\n\t * Re-renders the selected item lists.\n\t */\n\n\n\t refreshItems() {\n\t var self = this;\n\t self.lastQuery = null;\n\n\t if (self.isSetup) {\n\t self.addItems(self.items);\n\t }\n\n\t self.updateOriginalInput();\n\t self.refreshState();\n\t }\n\t /**\n\t * Updates all state-dependent attributes\n\t * and CSS classes.\n\t */\n\n\n\t refreshState() {\n\t const self = this;\n\t self.refreshValidityState();\n\t const isFull = self.isFull();\n\t const isLocked = self.isLocked;\n\t self.wrapper.classList.toggle('rtl', self.rtl);\n\t const wrap_classList = self.wrapper.classList;\n\t wrap_classList.toggle('focus', self.isFocused);\n\t wrap_classList.toggle('disabled', self.isDisabled);\n\t wrap_classList.toggle('required', self.isRequired);\n\t wrap_classList.toggle('invalid', !self.isValid);\n\t wrap_classList.toggle('locked', isLocked);\n\t wrap_classList.toggle('full', isFull);\n\t wrap_classList.toggle('input-active', self.isFocused && !self.isInputHidden);\n\t wrap_classList.toggle('dropdown-active', self.isOpen);\n\t wrap_classList.toggle('has-options', isEmptyObject(self.options));\n\t wrap_classList.toggle('has-items', self.items.length > 0);\n\t }\n\t /**\n\t * Update the `required` attribute of both input and control input.\n\t *\n\t * The `required` property needs to be activated on the control input\n\t * for the error to be displayed at the right place. `required` also\n\t * needs to be temporarily deactivated on the input since the input is\n\t * hidden and can't show errors.\n\t */\n\n\n\t refreshValidityState() {\n\t var self = this;\n\n\t if (!self.input.checkValidity) {\n\t return;\n\t }\n\n\t self.isValid = self.input.checkValidity();\n\t self.isInvalid = !self.isValid;\n\t }\n\t /**\n\t * Determines whether or not more items can be added\n\t * to the control without exceeding the user-defined maximum.\n\t *\n\t * @returns {boolean}\n\t */\n\n\n\t isFull() {\n\t return this.settings.maxItems !== null && this.items.length >= this.settings.maxItems;\n\t }\n\t /**\n\t * Refreshes the original <select> or <input>\n\t * element to reflect the current state.\n\t *\n\t */\n\n\n\t updateOriginalInput(opts = {}) {\n\t const self = this;\n\t var option, label;\n\t const empty_option = self.input.querySelector('option[value=\"\"]');\n\n\t if (self.is_select_tag) {\n\t const selected = [];\n\n\t function AddSelected(option_el, value, label) {\n\t if (!option_el) {\n\t option_el = getDom('<option value=\"' + escape_html(value) + '\">' + escape_html(label) + '</option>');\n\t } // don't move empty option from top of list\n\t // fixes bug in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1725293\t\t\t\t\n\n\n\t if (option_el != empty_option) {\n\t self.input.append(option_el);\n\t }\n\n\t selected.push(option_el);\n\t option_el.selected = true;\n\t return option_el;\n\t } // unselect all selected options\n\n\n\t self.input.querySelectorAll('option:checked').forEach(option_el => {\n\t option_el.selected = false;\n\t }); // nothing selected?\n\n\t if (self.items.length == 0 && self.settings.mode == 'single') {\n\t AddSelected(empty_option, \"\", \"\"); // order selected <option> tags for values in self.items\n\t } else {\n\t self.items.forEach(value => {\n\t option = self.options[value];\n\t label = option[self.settings.labelField] || '';\n\n\t if (selected.includes(option.$option)) {\n\t const reuse_opt = self.input.querySelector(`option[value=\"${addSlashes(value)}\"]:not(:checked)`);\n\t AddSelected(reuse_opt, value, label);\n\t } else {\n\t option.$option = AddSelected(option.$option, value, label);\n\t }\n\t });\n\t }\n\t } else {\n\t self.input.value = self.getValue();\n\t }\n\n\t if (self.isSetup) {\n\t if (!opts.silent) {\n\t self.trigger('change', self.getValue());\n\t }\n\t }\n\t }\n\t /**\n\t * Shows the autocomplete dropdown containing\n\t * the available options.\n\t */\n\n\n\t open() {\n\t var self = this;\n\t if (self.isLocked || self.isOpen || self.settings.mode === 'multi' && self.isFull()) return;\n\t self.isOpen = true;\n\t setAttr(self.focus_node, {\n\t 'aria-expanded': 'true'\n\t });\n\t self.refreshState();\n\t applyCSS(self.dropdown, {\n\t visibility: 'hidden',\n\t display: 'block'\n\t });\n\t self.positionDropdown();\n\t applyCSS(self.dropdown, {\n\t visibility: 'visible',\n\t display: 'block'\n\t });\n\t self.focus();\n\t self.trigger('dropdown_open', self.dropdown);\n\t }\n\t /**\n\t * Closes the autocomplete dropdown menu.\n\t */\n\n\n\t close(setTextboxValue = true) {\n\t var self = this;\n\t var trigger = self.isOpen;\n\n\t if (setTextboxValue) {\n\t // before blur() to prevent form onchange event\n\t self.setTextboxValue();\n\n\t if (self.settings.mode === 'single' && self.items.length) {\n\t self.hideInput();\n\t }\n\t }\n\n\t self.isOpen = false;\n\t setAttr(self.focus_node, {\n\t 'aria-expanded': 'false'\n\t });\n\t applyCSS(self.dropdown, {\n\t display: 'none'\n\t });\n\n\t if (self.settings.hideSelected) {\n\t self.clearActiveOption();\n\t }\n\n\t self.refreshState();\n\t if (trigger) self.trigger('dropdown_close', self.dropdown);\n\t }\n\t /**\n\t * Calculates and applies the appropriate\n\t * position of the dropdown if dropdownParent = 'body'.\n\t * Otherwise, position is determined by css\n\t */\n\n\n\t positionDropdown() {\n\t if (this.settings.dropdownParent !== 'body') {\n\t return;\n\t }\n\n\t var context = this.control;\n\t var rect = context.getBoundingClientRect();\n\t var top = context.offsetHeight + rect.top + window.scrollY;\n\t var left = rect.left + window.scrollX;\n\t applyCSS(this.dropdown, {\n\t width: rect.width + 'px',\n\t top: top + 'px',\n\t left: left + 'px'\n\t });\n\t }\n\t /**\n\t * Resets / clears all selected items\n\t * from the control.\n\t *\n\t */\n\n\n\t clear(silent) {\n\t var self = this;\n\t if (!self.items.length) return;\n\t var items = self.controlChildren();\n\t iterate(items, item => {\n\t self.removeItem(item, true);\n\t });\n\t self.showInput();\n\t if (!silent) self.updateOriginalInput();\n\t self.trigger('clear');\n\t }\n\t /**\n\t * A helper method for inserting an element\n\t * at the current caret position.\n\t *\n\t */\n\n\n\t insertAtCaret(el) {\n\t const self = this;\n\t const caret = self.caretPos;\n\t const target = self.control;\n\t target.insertBefore(el, target.children[caret]);\n\t self.setCaret(caret + 1);\n\t }\n\t /**\n\t * Removes the current selected item(s).\n\t *\n\t */\n\n\n\t deleteSelection(e) {\n\t var direction, selection, caret, tail;\n\t var self = this;\n\t direction = e && e.keyCode === KEY_BACKSPACE ? -1 : 1;\n\t selection = getSelection(self.control_input); // determine items that will be removed\n\n\t const rm_items = [];\n\n\t if (self.activeItems.length) {\n\t tail = getTail(self.activeItems, direction);\n\t caret = nodeIndex(tail);\n\n\t if (direction > 0) {\n\t caret++;\n\t }\n\n\t iterate(self.activeItems, item => rm_items.push(item));\n\t } else if ((self.isFocused || self.settings.mode === 'single') && self.items.length) {\n\t const items = self.controlChildren();\n\n\t if (direction < 0 && selection.start === 0 && selection.length === 0) {\n\t rm_items.push(items[self.caretPos - 1]);\n\t } else if (direction > 0 && selection.start === self.inputValue().length) {\n\t rm_items.push(items[self.caretPos]);\n\t }\n\t }\n\n\t const values = rm_items.map(item => item.dataset.value); // allow the callback to abort\n\n\t if (!values.length || typeof self.settings.onDelete === 'function' && self.settings.onDelete.call(self, values, e) === false) {\n\t return false;\n\t }\n\n\t preventDefault(e, true); // perform removal\n\n\t if (typeof caret !== 'undefined') {\n\t self.setCaret(caret);\n\t }\n\n\t while (rm_items.length) {\n\t self.removeItem(rm_items.pop());\n\t }\n\n\t self.showInput();\n\t self.positionDropdown();\n\t self.refreshOptions(false);\n\t return true;\n\t }\n\t /**\n\t * Selects the previous / next item (depending on the `direction` argument).\n\t *\n\t * > 0 - right\n\t * < 0 - left\n\t *\n\t */\n\n\n\t advanceSelection(direction, e) {\n\t var last_active,\n\t adjacent,\n\t self = this;\n\t if (self.rtl) direction *= -1;\n\t if (self.inputValue().length) return; // add or remove to active items\n\n\t if (isKeyDown(KEY_SHORTCUT, e) || isKeyDown('shiftKey', e)) {\n\t last_active = self.getLastActive(direction);\n\n\t if (last_active) {\n\t if (!last_active.classList.contains('active')) {\n\t adjacent = last_active;\n\t } else {\n\t adjacent = self.getAdjacent(last_active, direction, 'item');\n\t } // if no active item, get items adjacent to the control input\n\n\t } else if (direction > 0) {\n\t adjacent = self.control_input.nextElementSibling;\n\t } else {\n\t adjacent = self.control_input.previousElementSibling;\n\t }\n\n\t if (adjacent) {\n\t if (adjacent.classList.contains('active')) {\n\t self.removeActiveItem(last_active);\n\t }\n\n\t self.setActiveItemClass(adjacent); // mark as last_active !! after removeActiveItem() on last_active\n\t } // move caret to the left or right\n\n\t } else {\n\t self.moveCaret(direction);\n\t }\n\t }\n\n\t moveCaret(direction) {}\n\t /**\n\t * Get the last active item\n\t *\n\t */\n\n\n\t getLastActive(direction) {\n\t let last_active = this.control.querySelector('.last-active');\n\n\t if (last_active) {\n\t return last_active;\n\t }\n\n\t var result = this.control.querySelectorAll('.active');\n\n\t if (result) {\n\t return getTail(result, direction);\n\t }\n\t }\n\t /**\n\t * Moves the caret to the specified index.\n\t *\n\t * The input must be moved by leaving it in place and moving the\n\t * siblings, due to the fact that focus cannot be restored once lost\n\t * on mobile webkit devices\n\t *\n\t */\n\n\n\t setCaret(new_pos) {\n\t this.caretPos = this.items.length;\n\t }\n\t /**\n\t * Return list of item dom elements\n\t *\n\t */\n\n\n\t controlChildren() {\n\t return Array.from(this.control.querySelectorAll('[data-ts-item]'));\n\t }\n\t /**\n\t * Disables user input on the control. Used while\n\t * items are being asynchronously created.\n\t */\n\n\n\t lock() {\n\t this.isLocked = true;\n\t this.refreshState();\n\t }\n\t /**\n\t * Re-enables user input on the control.\n\t */\n\n\n\t unlock() {\n\t this.isLocked = false;\n\t this.refreshState();\n\t }\n\t /**\n\t * Disables user input on the control completely.\n\t * While disabled, it cannot receive focus.\n\t */\n\n\n\t disable() {\n\t var self = this;\n\t self.input.disabled = true;\n\t self.control_input.disabled = true;\n\t self.focus_node.tabIndex = -1;\n\t self.isDisabled = true;\n\t this.close();\n\t self.lock();\n\t }\n\t /**\n\t * Enables the control so that it can respond\n\t * to focus and user input.\n\t */\n\n\n\t enable() {\n\t var self = this;\n\t self.input.disabled = false;\n\t self.control_input.disabled = false;\n\t self.focus_node.tabIndex = self.tabIndex;\n\t self.isDisabled = false;\n\t self.unlock();\n\t }\n\t /**\n\t * Completely destroys the control and\n\t * unbinds all event listeners so that it can\n\t * be garbage collected.\n\t */\n\n\n\t destroy() {\n\t var self = this;\n\t var revertSettings = self.revertSettings;\n\t self.trigger('destroy');\n\t self.off();\n\t self.wrapper.remove();\n\t self.dropdown.remove();\n\t self.input.innerHTML = revertSettings.innerHTML;\n\t self.input.tabIndex = revertSettings.tabIndex;\n\t removeClasses(self.input, 'tomselected', 'ts-hidden-accessible');\n\n\t self._destroy();\n\n\t delete self.input.tomselect;\n\t }\n\t /**\n\t * A helper method for rendering \"item\" and\n\t * \"option\" templates, given the data.\n\t *\n\t */\n\n\n\t render(templateName, data) {\n\t if (typeof this.settings.render[templateName] !== 'function') {\n\t return null;\n\t }\n\n\t return this._render(templateName, data);\n\t }\n\t /**\n\t * _render() can be called directly when we know we don't want to hit the cache\n\t * return type could be null for some templates, we need https://github.com/microsoft/TypeScript/issues/33014\n\t */\n\n\n\t _render(templateName, data) {\n\t var value = '',\n\t id,\n\t html;\n\t const self = this;\n\n\t if (templateName === 'option' || templateName == 'item') {\n\t value = get_hash(data[self.settings.valueField]);\n\t } // render markup\n\n\n\t html = self.settings.render[templateName].call(this, data, escape_html);\n\n\t if (html == null) {\n\t return html;\n\t }\n\n\t html = getDom(html); // add mandatory attributes\n\n\t if (templateName === 'option' || templateName === 'option_create') {\n\t if (data[self.settings.disabledField]) {\n\t setAttr(html, {\n\t 'aria-disabled': 'true'\n\t });\n\t } else {\n\t setAttr(html, {\n\t 'data-selectable': ''\n\t });\n\t }\n\t } else if (templateName === 'optgroup') {\n\t id = data.group[self.settings.optgroupValueField];\n\t setAttr(html, {\n\t 'data-group': id\n\t });\n\n\t if (data.group[self.settings.disabledField]) {\n\t setAttr(html, {\n\t 'data-disabled': ''\n\t });\n\t }\n\t }\n\n\t if (templateName === 'option' || templateName === 'item') {\n\t setAttr(html, {\n\t 'data-value': value\n\t }); // make sure we have some classes if a template is overwritten\n\n\t if (templateName === 'item') {\n\t addClasses(html, self.settings.itemClass);\n\t setAttr(html, {\n\t 'data-ts-item': ''\n\t });\n\t } else {\n\t addClasses(html, self.settings.optionClass);\n\t setAttr(html, {\n\t role: 'option',\n\t id: data.$id\n\t }); // update cache\n\n\t self.options[value].$div = html;\n\t }\n\t }\n\n\t return html;\n\t }\n\t /**\n\t * Clears the render cache for a template. If\n\t * no template is given, clears all render\n\t * caches.\n\t *\n\t */\n\n\n\t clearCache() {\n\t iterate(this.options, (option, value) => {\n\t if (option.$div) {\n\t option.$div.remove();\n\t delete option.$div;\n\t }\n\t });\n\t }\n\t /**\n\t * Removes a value from item and option caches\n\t *\n\t */\n\n\n\t uncacheValue(value) {\n\t const option_el = this.getOption(value);\n\t if (option_el) option_el.remove();\n\t }\n\t /**\n\t * Determines whether or not to display the\n\t * create item prompt, given a user input.\n\t *\n\t */\n\n\n\t canCreate(input) {\n\t return this.settings.create && input.length > 0 && this.settings.createFilter.call(this, input);\n\t }\n\t /**\n\t * Wraps this.`method` so that `new_fn` can be invoked 'before', 'after', or 'instead' of the original method\n\t *\n\t * this.hook('instead','onKeyDown',function( arg1, arg2 ...){\n\t *\n\t * });\n\t */\n\n\n\t hook(when, method, new_fn) {\n\t var self = this;\n\t var orig_method = self[method];\n\n\t self[method] = function () {\n\t var result, result_new;\n\n\t if (when === 'after') {\n\t result = orig_method.apply(self, arguments);\n\t }\n\n\t result_new = new_fn.apply(self, arguments);\n\n\t if (when === 'instead') {\n\t return result_new;\n\t }\n\n\t if (when === 'before') {\n\t result = orig_method.apply(self, arguments);\n\t }\n\n\t return result;\n\t };\n\t }\n\n\t}\n\n\t/**\n\t * Plugin: \"change_listener\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction change_listener () {\n\t addEvent(this.input, 'change', () => {\n\t this.sync();\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"restore_on_backspace\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction checkbox_options () {\n\t var self = this;\n\t var orig_onOptionSelect = self.onOptionSelect;\n\t self.settings.hideSelected = false; // update the checkbox for an option\n\n\t var UpdateCheckbox = function UpdateCheckbox(option) {\n\t setTimeout(() => {\n\t var checkbox = option.querySelector('input');\n\n\t if (option.classList.contains('selected')) {\n\t checkbox.checked = true;\n\t } else {\n\t checkbox.checked = false;\n\t }\n\t }, 1);\n\t }; // add checkbox to option template\n\n\n\t self.hook('after', 'setupTemplates', () => {\n\t var orig_render_option = self.settings.render.option;\n\n\t self.settings.render.option = (data, escape_html) => {\n\t var rendered = getDom(orig_render_option.call(self, data, escape_html));\n\t var checkbox = document.createElement('input');\n\t checkbox.addEventListener('click', function (evt) {\n\t preventDefault(evt);\n\t });\n\t checkbox.type = 'checkbox';\n\t const hashed = hash_key(data[self.settings.valueField]);\n\n\t if (hashed && self.items.indexOf(hashed) > -1) {\n\t checkbox.checked = true;\n\t }\n\n\t rendered.prepend(checkbox);\n\t return rendered;\n\t };\n\t }); // uncheck when item removed\n\n\t self.on('item_remove', value => {\n\t var option = self.getOption(value);\n\n\t if (option) {\n\t // if dropdown hasn't been opened yet, the option won't exist\n\t option.classList.remove('selected'); // selected class won't be removed yet\n\n\t UpdateCheckbox(option);\n\t }\n\t }); // remove items when selected option is clicked\n\n\t self.hook('instead', 'onOptionSelect', (evt, option) => {\n\t if (option.classList.contains('selected')) {\n\t option.classList.remove('selected');\n\t self.removeItem(option.dataset.value);\n\t self.refreshOptions();\n\t preventDefault(evt, true);\n\t return;\n\t }\n\n\t orig_onOptionSelect.call(self, evt, option);\n\t UpdateCheckbox(option);\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"dropdown_header\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction clear_button (userOptions) {\n\t const self = this;\n\t const options = Object.assign({\n\t className: 'clear-button',\n\t title: 'Clear All',\n\t html: data => {\n\t return `<div class=\"${data.className}\" title=\"${data.title}\">×</div>`;\n\t }\n\t }, userOptions);\n\t self.on('initialize', () => {\n\t var button = getDom(options.html(options));\n\t button.addEventListener('click', evt => {\n\t self.clear();\n\n\t if (self.settings.mode === 'single' && self.settings.allowEmptyOption) {\n\t self.addItem('');\n\t }\n\n\t evt.preventDefault();\n\t evt.stopPropagation();\n\t });\n\t self.control.appendChild(button);\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"drag_drop\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction drag_drop () {\n\t var self = this;\n\t if (!$.fn.sortable) throw new Error('The \"drag_drop\" plugin requires jQuery UI \"sortable\".');\n\t if (self.settings.mode !== 'multi') return;\n\t var orig_lock = self.lock;\n\t var orig_unlock = self.unlock;\n\t self.hook('instead', 'lock', () => {\n\t var sortable = $(self.control).data('sortable');\n\t if (sortable) sortable.disable();\n\t return orig_lock.call(self);\n\t });\n\t self.hook('instead', 'unlock', () => {\n\t var sortable = $(self.control).data('sortable');\n\t if (sortable) sortable.enable();\n\t return orig_unlock.call(self);\n\t });\n\t self.on('initialize', () => {\n\t var $control = $(self.control).sortable({\n\t items: '[data-value]',\n\t forcePlaceholderSize: true,\n\t disabled: self.isLocked,\n\t start: (e, ui) => {\n\t ui.placeholder.css('width', ui.helper.css('width'));\n\t $control.css({\n\t overflow: 'visible'\n\t });\n\t },\n\t stop: () => {\n\t $control.css({\n\t overflow: 'hidden'\n\t });\n\t var values = [];\n\t $control.children('[data-value]').each(function () {\n\t if (this.dataset.value) values.push(this.dataset.value);\n\t });\n\t self.setValue(values);\n\t }\n\t });\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"dropdown_header\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction dropdown_header (userOptions) {\n\t const self = this;\n\t const options = Object.assign({\n\t title: 'Untitled',\n\t headerClass: 'dropdown-header',\n\t titleRowClass: 'dropdown-header-title',\n\t labelClass: 'dropdown-header-label',\n\t closeClass: 'dropdown-header-close',\n\t html: data => {\n\t return '<div class=\"' + data.headerClass + '\">' + '<div class=\"' + data.titleRowClass + '\">' + '<span class=\"' + data.labelClass + '\">' + data.title + '</span>' + '<a class=\"' + data.closeClass + '\">×</a>' + '</div>' + '</div>';\n\t }\n\t }, userOptions);\n\t self.on('initialize', () => {\n\t var header = getDom(options.html(options));\n\t var close_link = header.querySelector('.' + options.closeClass);\n\n\t if (close_link) {\n\t close_link.addEventListener('click', evt => {\n\t preventDefault(evt, true);\n\t self.close();\n\t });\n\t }\n\n\t self.dropdown.insertBefore(header, self.dropdown.firstChild);\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"dropdown_input\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction caret_position () {\n\t var self = this;\n\t /**\n\t * Moves the caret to the specified index.\n\t *\n\t * The input must be moved by leaving it in place and moving the\n\t * siblings, due to the fact that focus cannot be restored once lost\n\t * on mobile webkit devices\n\t *\n\t */\n\n\t self.hook('instead', 'setCaret', new_pos => {\n\t if (self.settings.mode === 'single' || !self.control.contains(self.control_input)) {\n\t new_pos = self.items.length;\n\t } else {\n\t new_pos = Math.max(0, Math.min(self.items.length, new_pos));\n\n\t if (new_pos != self.caretPos && !self.isPending) {\n\t self.controlChildren().forEach((child, j) => {\n\t if (j < new_pos) {\n\t self.control_input.insertAdjacentElement('beforebegin', child);\n\t } else {\n\t self.control.appendChild(child);\n\t }\n\t });\n\t }\n\t }\n\n\t self.caretPos = new_pos;\n\t });\n\t self.hook('instead', 'moveCaret', direction => {\n\t if (!self.isFocused) return; // move caret before or after selected items\n\n\t const last_active = self.getLastActive(direction);\n\n\t if (last_active) {\n\t const idx = nodeIndex(last_active);\n\t self.setCaret(direction > 0 ? idx + 1 : idx);\n\t self.setActiveItem(); // move caret left or right of current position\n\t } else {\n\t self.setCaret(self.caretPos + direction);\n\t }\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"dropdown_input\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction dropdown_input () {\n\t var self = this;\n\t self.settings.shouldOpen = true; // make sure the input is shown even if there are no options to display in the dropdown\n\n\t self.hook('before', 'setup', () => {\n\t self.focus_node = self.control;\n\t addClasses(self.control_input, 'dropdown-input');\n\t const div = getDom('<div class=\"dropdown-input-wrap\">');\n\t div.append(self.control_input);\n\t self.dropdown.insertBefore(div, self.dropdown.firstChild);\n\t });\n\t self.on('initialize', () => {\n\t // set tabIndex on control to -1, otherwise [shift+tab] will put focus right back on control_input\n\t self.control_input.addEventListener('keydown', evt => {\n\t //addEvent(self.control_input,'keydown' as const,(evt:KeyboardEvent) =>{\n\t switch (evt.keyCode) {\n\t case KEY_ESC:\n\t if (self.isOpen) {\n\t preventDefault(evt, true);\n\t self.close();\n\t }\n\n\t self.clearActiveItems();\n\t return;\n\n\t case KEY_TAB:\n\t self.focus_node.tabIndex = -1;\n\t break;\n\t }\n\n\t return self.onKeyDown.call(self, evt);\n\t });\n\t self.on('blur', () => {\n\t self.focus_node.tabIndex = self.isDisabled ? -1 : self.tabIndex;\n\t }); // give the control_input focus when the dropdown is open\n\n\t self.on('dropdown_open', () => {\n\t self.control_input.focus();\n\t }); // prevent onBlur from closing when focus is on the control_input\n\n\t const orig_onBlur = self.onBlur;\n\t self.hook('instead', 'onBlur', evt => {\n\t if (evt && evt.relatedTarget == self.control_input) return;\n\t return orig_onBlur.call(self);\n\t });\n\t addEvent(self.control_input, 'blur', () => self.onBlur()); // return focus to control to allow further keyboard input\n\n\t self.hook('before', 'close', () => {\n\t if (!self.isOpen) return;\n\t self.focus_node.focus();\n\t });\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"input_autogrow\" (Tom Select)\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction input_autogrow () {\n\t var self = this;\n\t self.on('initialize', () => {\n\t var test_input = document.createElement('span');\n\t var control = self.control_input;\n\t test_input.style.cssText = 'position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ';\n\t self.wrapper.appendChild(test_input);\n\t var transfer_styles = ['letterSpacing', 'fontSize', 'fontFamily', 'fontWeight', 'textTransform'];\n\n\t for (const style_name of transfer_styles) {\n\t // @ts-ignore TS7015 https://stackoverflow.com/a/50506154/697576\n\t test_input.style[style_name] = control.style[style_name];\n\t }\n\t /**\n\t * Set the control width\n\t *\n\t */\n\n\n\t var resize = () => {\n\t if (self.items.length > 0) {\n\t test_input.textContent = control.value;\n\t control.style.width = test_input.clientWidth + 'px';\n\t } else {\n\t control.style.width = '';\n\t }\n\t };\n\n\t resize();\n\t self.on('update item_add item_remove', resize);\n\t addEvent(control, 'input', resize);\n\t addEvent(control, 'keyup', resize);\n\t addEvent(control, 'blur', resize);\n\t addEvent(control, 'update', resize);\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"input_autogrow\" (Tom Select)\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction no_backspace_delete () {\n\t var self = this;\n\t var orig_deleteSelection = self.deleteSelection;\n\t this.hook('instead', 'deleteSelection', evt => {\n\t if (self.activeItems.length) {\n\t return orig_deleteSelection.call(self, evt);\n\t }\n\n\t return false;\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"input_autogrow\" (Tom Select)\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction no_active_items () {\n\t this.hook('instead', 'setActiveItem', () => {});\n\t this.hook('instead', 'selectAll', () => {});\n\t}\n\n\t/**\n\t * Plugin: \"optgroup_columns\" (Tom Select.js)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction optgroup_columns () {\n\t var self = this;\n\t var orig_keydown = self.onKeyDown;\n\t self.hook('instead', 'onKeyDown', evt => {\n\t var index, option, options, optgroup;\n\n\t if (!self.isOpen || !(evt.keyCode === KEY_LEFT || evt.keyCode === KEY_RIGHT)) {\n\t return orig_keydown.call(self, evt);\n\t }\n\n\t optgroup = parentMatch(self.activeOption, '[data-group]');\n\t index = nodeIndex(self.activeOption, '[data-selectable]');\n\n\t if (!optgroup) {\n\t return;\n\t }\n\n\t if (evt.keyCode === KEY_LEFT) {\n\t optgroup = optgroup.previousSibling;\n\t } else {\n\t optgroup = optgroup.nextSibling;\n\t }\n\n\t if (!optgroup) {\n\t return;\n\t }\n\n\t options = optgroup.querySelectorAll('[data-selectable]');\n\t option = options[Math.min(options.length - 1, index)];\n\n\t if (option) {\n\t self.setActiveOption(option);\n\t }\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"remove_button\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction remove_button (userOptions) {\n\t const options = Object.assign({\n\t label: '×',\n\t title: 'Remove',\n\t className: 'remove',\n\t append: true\n\t }, userOptions); //options.className = 'remove-single';\n\n\t var self = this; // override the render method to add remove button to each item\n\n\t if (!options.append) {\n\t return;\n\t }\n\n\t var html = '<a href=\"javascript:void(0)\" class=\"' + options.className + '\" tabindex=\"-1\" title=\"' + escape_html(options.title) + '\">' + options.label + '</a>';\n\t self.hook('after', 'setupTemplates', () => {\n\t var orig_render_item = self.settings.render.item;\n\n\t self.settings.render.item = (data, escape) => {\n\t var rendered = getDom(orig_render_item.call(self, data, escape));\n\t var close_button = getDom(html);\n\t rendered.appendChild(close_button);\n\t addEvent(close_button, 'mousedown', evt => {\n\t preventDefault(evt, true);\n\t });\n\t addEvent(close_button, 'click', evt => {\n\t // propagating will trigger the dropdown to show for single mode\n\t preventDefault(evt, true);\n\t if (self.isLocked) return;\n\t var value = rendered.dataset.value;\n\t self.removeItem(value);\n\t self.refreshOptions(false);\n\t });\n\t return rendered;\n\t };\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"restore_on_backspace\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction restore_on_backspace (userOptions) {\n\t const self = this;\n\t const options = Object.assign({\n\t text: option => {\n\t return option[self.settings.labelField];\n\t }\n\t }, userOptions);\n\t self.on('item_remove', function (value) {\n\t if (self.control_input.value.trim() === '') {\n\t var option = self.options[value];\n\n\t if (option) {\n\t self.setTextboxValue(options.text.call(self, option));\n\t }\n\t }\n\t });\n\t}\n\n\t/**\n\t * Plugin: \"restore_on_backspace\" (Tom Select)\n\t * Copyright (c) contributors\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n\t * file except in compliance with the License. You may obtain a copy of the License at:\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software distributed under\n\t * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n\t * ANY KIND, either express or implied. See the License for the specific language\n\t * governing permissions and limitations under the License.\n\t *\n\t */\n\tfunction virtual_scroll () {\n\t const self = this;\n\t const orig_canLoad = self.canLoad;\n\t const orig_clearActiveOption = self.clearActiveOption;\n\t const orig_loadCallback = self.loadCallback;\n\t var pagination = {};\n\t var dropdown_content;\n\t var loading_more = false;\n\n\t if (!self.settings.firstUrl) {\n\t throw 'virtual_scroll plugin requires a firstUrl() method';\n\t } // in order for virtual scrolling to work,\n\t // options need to be ordered the same way they're returned from the remote data source\n\n\n\t self.settings.sortField = [{\n\t field: '$order'\n\t }, {\n\t field: '$score'\n\t }]; // can we load more results for given query?\n\n\t function canLoadMore(query) {\n\t if (typeof self.settings.maxOptions === 'number' && dropdown_content.children.length >= self.settings.maxOptions) {\n\t return false;\n\t }\n\n\t if (query in pagination && pagination[query]) {\n\t return true;\n\t }\n\n\t return false;\n\t } // set the next url that will be\n\n\n\t self.setNextUrl = function (value, next_url) {\n\t pagination[value] = next_url;\n\t }; // getUrl() to be used in settings.load()\n\n\n\t self.getUrl = function (query) {\n\t if (query in pagination) {\n\t const next_url = pagination[query];\n\t pagination[query] = false;\n\t return next_url;\n\t } // if the user goes back to a previous query\n\t // we need to load the first page again\n\n\n\t pagination = {};\n\t return self.settings.firstUrl(query);\n\t }; // don't clear the active option (and cause unwanted dropdown scroll)\n\t // while loading more results\n\n\n\t self.hook('instead', 'clearActiveOption', () => {\n\t if (loading_more) {\n\t return;\n\t }\n\n\t return orig_clearActiveOption.call(self);\n\t }); // override the canLoad method\n\n\t self.hook('instead', 'canLoad', query => {\n\t // first time the query has been seen\n\t if (!(query in pagination)) {\n\t return orig_canLoad.call(self, query);\n\t }\n\n\t return canLoadMore(query);\n\t }); // wrap the load\n\n\t self.hook('instead', 'loadCallback', (options, optgroups) => {\n\t if (!loading_more) {\n\t self.clearOptions();\n\t }\n\n\t orig_loadCallback.call(self, options, optgroups);\n\t loading_more = false;\n\t }); // add templates to dropdown\n\t //\tloading_more if we have another url in the queue\n\t //\tno_more_results if we don't have another url in the queue\n\n\t self.hook('after', 'refreshOptions', () => {\n\t const query = self.lastValue;\n\t var option;\n\n\t if (canLoadMore(query)) {\n\t option = self.render('loading_more', {\n\t query: query\n\t });\n\t if (option) option.setAttribute('data-selectable', ''); // so that navigating dropdown with [down] keypresses can navigate to this node\n\t } else if (query in pagination && !dropdown_content.querySelector('.no-results')) {\n\t option = self.render('no_more_results', {\n\t query: query\n\t });\n\t }\n\n\t if (option) {\n\t addClasses(option, self.settings.optionClass);\n\t dropdown_content.append(option);\n\t }\n\t }); // add scroll listener and default templates\n\n\t self.on('initialize', () => {\n\t dropdown_content = self.dropdown_content; // default templates\n\n\t self.settings.render = Object.assign({}, {\n\t loading_more: function () {\n\t return `<div class=\"loading-more-results\">Loading more results ... </div>`;\n\t },\n\t no_more_results: function () {\n\t return `<div class=\"no-more-results\">No more results</div>`;\n\t }\n\t }, self.settings.render); // watch dropdown content scroll position\n\n\t dropdown_content.addEventListener('scroll', function () {\n\t const scroll_percent = dropdown_content.clientHeight / (dropdown_content.scrollHeight - dropdown_content.scrollTop);\n\n\t if (scroll_percent < 0.95) {\n\t return;\n\t } // !important: this will get checked again in load() but we still need to check here otherwise loading_more will be set to true\n\n\n\t if (!canLoadMore(self.lastValue)) {\n\t return;\n\t } // don't call load() too much\n\n\n\t if (loading_more) return;\n\t loading_more = true;\n\t self.load.call(self, self.lastValue);\n\t });\n\t });\n\t}\n\n\tTomSelect.define('change_listener', change_listener);\n\tTomSelect.define('checkbox_options', checkbox_options);\n\tTomSelect.define('clear_button', clear_button);\n\tTomSelect.define('drag_drop', drag_drop);\n\tTomSelect.define('dropdown_header', dropdown_header);\n\tTomSelect.define('caret_position', caret_position);\n\tTomSelect.define('dropdown_input', dropdown_input);\n\tTomSelect.define('input_autogrow', input_autogrow);\n\tTomSelect.define('no_backspace_delete', no_backspace_delete);\n\tTomSelect.define('no_active_items', no_active_items);\n\tTomSelect.define('optgroup_columns', optgroup_columns);\n\tTomSelect.define('remove_button', remove_button);\n\tTomSelect.define('restore_on_backspace', restore_on_backspace);\n\tTomSelect.define('virtual_scroll', virtual_scroll);\n\n\treturn TomSelect;\n\n})));\nvar tomSelect=function(el,opts){return new TomSelect(el,opts);} \n//# sourceMappingURL=tom-select.complete.js.map\n\n\n//# sourceURL=webpack:///./node_modules/tom-select/dist/js/tom-select.complete.js?");
|
1426
958
|
|
1427
959
|
/***/ }),
|
1428
960
|
|
@@ -1457,7 +989,7 @@ eval("var map = {\n\t\"./blocks_controller.js\": \"./src/js/headmin/controllers/
|
|
1457
989
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1458
990
|
|
1459
991
|
"use strict";
|
1460
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stimulus */ \"./node_modules/stimulus/index.js\");\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @popperjs/core */ \"./node_modules/@popperjs/core/lib/index.js\");\nfunction _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\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr && (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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\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; } } }; }\n\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); }\n\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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\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); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\nvar _default = /*#__PURE__*/function (_Controller) {\n _inherits(_default, _Controller);\n\n var _super = _createSuper(_default);\n\n function _default() {\n _classCallCheck(this, _default);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(_default, [{\n key: \"connect\",\n value: function connect() {\n var _this = this;\n\n new sortablejs__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.blocksTarget, {\n onEnd: function onEnd() {\n _this.reorderPositions();\n }\n });\n this.toggleEmpty();\n }\n }, {\n key: \"toggleEmpty\",\n value: function toggleEmpty() {\n if (this.blockCount() > 0) {\n var empty = this.blocksTarget.querySelector('#blocks-empty');\n\n if (empty) {\n empty.remove();\n }\n } else {\n var _empty = this.templateEmptyTarget.innerHTML;\n this.blocksTarget.insertAdjacentHTML('beforeend', _empty);\n }\n }\n }, {\n key: \"add\",\n value: function add(event) {\n event.preventDefault();\n var blockType = event.target.dataset.type;\n var html = this.templateBlockTargets.filter(function (blockTarget) {\n return blockTarget.id === blockType;\n })[0].innerHTML;\n html = this.setPosition(html);\n var element = this.blocksTarget.querySelector(\"li[data-position='\".concat(event.target.dataset.position, \"']\"));\n\n if (element) {\n element.insertAdjacentHTML('afterend', html);\n } else {\n this.blocksTarget.insertAdjacentHTML('afterbegin', html);\n } // Dispatch an event\n\n\n this.blocksTarget.dispatchEvent(new CustomEvent('headmin:reinit', {\n bubbles: true\n }));\n this.reorderPositions();\n this.toggleEmpty();\n }\n }, {\n key: \"remove\",\n value: function remove(event) {\n event.preventDefault();\n var block = event.target.closest(\".list-group-item\");\n var destroyInput = block.querySelector(\"input[name*='_destroy']\");\n\n if (destroyInput) {\n destroyInput.value = 1;\n block.style.display = 'none';\n } else {\n block.remove();\n }\n\n this.reorderPositions();\n this.toggleEmpty();\n }\n }, {\n key: \"setPosition\",\n value: function setPosition(html) {\n var position = this.retrieveLastPosition() + 1;\n var regex = new RegExp('99999', \"g\");\n return html.replace(regex, position);\n }\n }, {\n key: \"retrieveLastPosition\",\n value: function retrieveLastPosition() {\n var blocks = Array.from(this.blockTargets);\n\n if (blocks.length < 1) {\n return 0;\n }\n\n var lastBlock = blocks.slice(-1)[0];\n return parseInt(lastBlock.querySelector(\"[name*='position']\").value);\n }\n }, {\n key: \"reorderPositions\",\n value: function reorderPositions() {\n var _iterator = _createForOfIteratorHelper(this.blockTargets.entries()),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n index = _step$value[0],\n block = _step$value[1];\n\n this.changePositionInfo(block, index);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }, {\n key: \"changePositionInfo\",\n value: function changePositionInfo(block, index) {\n block.setAttribute(\"data-position\", index);\n block.querySelector(\"input[name*='position']\").value = index;\n }\n }, {\n key: \"blockCount\",\n value: function blockCount() {\n return this.blockTargets.length;\n }\n }], [{\n key: \"targets\",\n get: function get() {\n return [\"templateBlock\", \"block\", \"blocks\", \"templateEmpty\", \"button\", \"buttons\"];\n }\n }]);\n\n return _default;\n}(stimulus__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]);\n\n\n\n//# sourceURL=webpack:///./src/js/headmin/controllers/blocks_controller.js?");
|
992
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @hotwired/stimulus */ \"./node_modules/@hotwired/stimulus/dist/stimulus.js\");\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @popperjs/core */ \"./node_modules/@popperjs/core/lib/index.js\");\nfunction _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\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\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.\"); }\n\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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\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; } } }; }\n\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); }\n\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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\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); }; }\n\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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\nvar _default = /*#__PURE__*/function (_Controller) {\n _inherits(_default, _Controller);\n\n var _super = _createSuper(_default);\n\n function _default() {\n _classCallCheck(this, _default);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(_default, [{\n key: \"connect\",\n value: function connect() {\n var _this = this;\n\n new sortablejs__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.blocksTarget, {\n onEnd: function onEnd() {\n _this.reorderPositions();\n }\n });\n this.toggleEmpty();\n }\n }, {\n key: \"toggleEmpty\",\n value: function toggleEmpty() {\n if (this.blockCount() > 0) {\n var empty = this.blocksTarget.querySelector('#blocks-empty');\n\n if (empty) {\n empty.remove();\n }\n } else {\n var _empty = this.templateEmptyTarget.innerHTML;\n this.blocksTarget.insertAdjacentHTML('beforeend', _empty);\n }\n }\n }, {\n key: \"add\",\n value: function add(event) {\n event.preventDefault();\n var blockType = event.target.dataset.type;\n var html = this.templateBlockTargets.filter(function (blockTarget) {\n return blockTarget.id === blockType;\n })[0].innerHTML;\n html = this.setPosition(html);\n var element = this.blocksTarget.querySelector(\"li[data-position='\".concat(event.target.dataset.position, \"']\"));\n\n if (element) {\n element.insertAdjacentHTML('afterend', html);\n } else {\n this.blocksTarget.insertAdjacentHTML('afterbegin', html);\n } // Dispatch an event\n\n\n this.blocksTarget.dispatchEvent(new CustomEvent('headmin:reinit', {\n bubbles: true\n }));\n this.reorderPositions();\n this.toggleEmpty();\n }\n }, {\n key: \"remove\",\n value: function remove(event) {\n event.preventDefault();\n var block = event.target.closest(\".list-group-item\");\n var destroyInput = block.querySelector(\"input[name*='_destroy']\");\n\n if (destroyInput) {\n destroyInput.value = 1;\n block.style.display = 'none';\n } else {\n block.remove();\n }\n\n this.reorderPositions();\n this.toggleEmpty();\n }\n }, {\n key: \"setPosition\",\n value: function setPosition(html) {\n var position = this.retrieveLastPosition() + 1;\n var regex = new RegExp('99999', \"g\");\n return html.replace(regex, position);\n }\n }, {\n key: \"retrieveLastPosition\",\n value: function retrieveLastPosition() {\n var blocks = Array.from(this.blockTargets);\n\n if (blocks.length < 1) {\n return 0;\n }\n\n var lastBlock = blocks.slice(-1)[0];\n return parseInt(lastBlock.querySelector(\"[name*='position']\").value);\n }\n }, {\n key: \"reorderPositions\",\n value: function reorderPositions() {\n var _iterator = _createForOfIteratorHelper(this.blockTargets.entries()),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n index = _step$value[0],\n block = _step$value[1];\n\n this.changePositionInfo(block, index);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }, {\n key: \"changePositionInfo\",\n value: function changePositionInfo(block, index) {\n block.setAttribute(\"data-position\", index);\n block.querySelector(\"input[name*='position']\").value = index;\n }\n }, {\n key: \"blockCount\",\n value: function blockCount() {\n return this.blockTargets.length;\n }\n }], [{\n key: \"targets\",\n get: function get() {\n return [\"templateBlock\", \"block\", \"blocks\", \"templateEmpty\", \"button\", \"buttons\"];\n }\n }]);\n\n return _default;\n}(_hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]);\n\n\n\n//# sourceURL=webpack:///./src/js/headmin/controllers/blocks_controller.js?");
|
1461
993
|
|
1462
994
|
/***/ }),
|
1463
995
|
|
@@ -1469,7 +1001,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1469
1001
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1470
1002
|
|
1471
1003
|
"use strict";
|
1472
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var
|
1004
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @hotwired/stimulus */ \"./node_modules/@hotwired/stimulus/dist/stimulus.js\");\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\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); }; }\n\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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\nvar _default = /*#__PURE__*/function (_Controller) {\n _inherits(_default, _Controller);\n\n var _super = _createSuper(_default);\n\n function _default() {\n _classCallCheck(this, _default);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(_default, [{\n key: \"connect\",\n value: // Attaches controller logic to the element itself\n // This allows calling controller methods from the element in other controllers\n function connect() {\n this.element['controller'] = this;\n }\n }, {\n key: \"toggle\",\n value: function toggle(event) {\n event.preventDefault();\n var expanded = this.buttonTarget.getAttribute('aria-expanded') === 'true';\n\n if (expanded) {\n this.close(null);\n } else {\n this.open();\n }\n }\n }, {\n key: \"open\",\n value: function open() {\n this.buttonTarget.setAttribute('aria-expanded', 'true');\n this.popupTarget.classList.remove('closed');\n }\n }, {\n key: \"close\",\n value: function close(event) {\n if (this.isClickedInside(event)) {\n event.preventDefault();\n return;\n }\n\n this.buttonTarget.setAttribute('aria-expanded', 'false');\n this.popupTarget.classList.add('closed');\n }\n }, {\n key: \"isClickedInside\",\n value: function isClickedInside(event) {\n if (!event) {\n return false;\n }\n\n var inPopup = this.popupTarget.contains(event.target);\n var inButton = this.buttonTarget.contains(event.target);\n var inAddButton = event.target.dataset.action === \"click->filters#add\";\n return inPopup || inButton || inAddButton;\n }\n }], [{\n key: \"targets\",\n get: function get() {\n return [\"button\", \"popup\"];\n }\n }]);\n\n return _default;\n}(_hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]);\n\n\n\n//# sourceURL=webpack:///./src/js/headmin/controllers/filter_controller.js?");
|
1473
1005
|
|
1474
1006
|
/***/ }),
|
1475
1007
|
|
@@ -1481,7 +1013,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1481
1013
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1482
1014
|
|
1483
1015
|
"use strict";
|
1484
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var
|
1016
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @hotwired/stimulus */ \"./node_modules/@hotwired/stimulus/dist/stimulus.js\");\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\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); }; }\n\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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\nvar _default = /*#__PURE__*/function (_Controller) {\n _inherits(_default, _Controller);\n\n var _super = _createSuper(_default);\n\n function _default() {\n _classCallCheck(this, _default);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(_default, [{\n key: \"add\",\n value: function add(event) {\n event.preventDefault();\n var name = event.target.dataset.filterName;\n var button = this.getButtonByName(name);\n\n if (button) {\n this.openFilter(button);\n } else {\n this.createFilter(name);\n }\n }\n }, {\n key: \"createFilter\",\n value: function createFilter(name) {\n var html = this.getTemplateHTML(name);\n html = this.replaceIdsWithTimestamps(html);\n this.listTarget.insertAdjacentHTML('beforeend', html); // Dispatch an event\n\n this.menuItemTarget.dispatchEvent(new CustomEvent('headmin:reinit', {\n bubbles: true\n }));\n }\n }, {\n key: \"remove\",\n value: function remove(event) {\n var filter = event.currentTarget.closest('.h-filter');\n filter.remove();\n this.formTarget.submit();\n }\n }, {\n key: \"removeAll\",\n value: function removeAll(event) {\n this.listTarget.innerHTML = \"\";\n this.formTarget.submit();\n }\n }, {\n key: \"update\",\n value: function update(event) {\n this.formTarget.submit();\n }\n }, {\n key: \"getButtonByName\",\n value: function getButtonByName(name) {\n return this.buttonTargets.find(function (element) {\n return element.dataset.filterName === name;\n });\n }\n }, {\n key: \"openFilter\",\n value: function openFilter(button) {\n button.controller.open();\n }\n }, {\n key: \"getTemplateHTML\",\n value: function getTemplateHTML(name) {\n var template = this.templateTargets.filter(function (element) {\n return element.dataset.filterName === name;\n })[0];\n return template.innerHTML;\n }\n }, {\n key: \"replaceIdsWithTimestamps\",\n value: function replaceIdsWithTimestamps(html) {\n var regex = new RegExp('template_id', \"g\");\n return html.replace(regex, new Date().getTime());\n }\n }], [{\n key: \"targets\",\n get: function get() {\n return [\"form\", \"list\", \"input\", \"template\", \"button\", \"menuItem\"];\n }\n }]);\n\n return _default;\n}(_hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]);\n\n\n\n//# sourceURL=webpack:///./src/js/headmin/controllers/filters_controller.js?");
|
1485
1017
|
|
1486
1018
|
/***/ }),
|
1487
1019
|
|
@@ -1493,7 +1025,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1493
1025
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1494
1026
|
|
1495
1027
|
"use strict";
|
1496
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var
|
1028
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @hotwired/stimulus */ \"./node_modules/@hotwired/stimulus/dist/stimulus.js\");\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @popperjs/core */ \"./node_modules/@popperjs/core/lib/index.js\");\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\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); }; }\n\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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\nvar _default = /*#__PURE__*/function (_Controller) {\n _inherits(_default, _Controller);\n\n var _super = _createSuper(_default);\n\n function _default() {\n _classCallCheck(this, _default);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(_default, [{\n key: \"connect\",\n value: function connect() {\n var _this = this;\n\n // Clicked outside popup\n document.addEventListener('click', function (event) {\n _this.handleOutsideClick(event);\n });\n }\n }, {\n key: \"handleOutsideClick\",\n value: function handleOutsideClick(event) {\n var inPopup = event.target.closest('[data-popup-target=\"popup\"]') !== null;\n var inButton = event.target.closest('[data-popup-target=\"button\"]') !== null;\n var openPopup = document.querySelector('[data-popup-target=\"popup\"]:not(.closed)');\n\n if (!inButton && !inPopup && openPopup) {\n this.closePopup(openPopup);\n }\n }\n }, {\n key: \"open\",\n value: function open(event) {\n var button = event.target.closest('[data-popup-target=\"button\"]');\n var popup = this.popupById(button.dataset['popupId']);\n var passThru = button.dataset['popupPassThru'];\n\n if (passThru) {\n // Pass click event to an element inside the popup\n var passThruElement = popup.querySelector(passThru);\n passThruElement.click();\n } else {\n // Open the popup\n Object(_popperjs_core__WEBPACK_IMPORTED_MODULE_2__[\"createPopper\"])(button, popup);\n this.openPopup(popup);\n }\n }\n }, {\n key: \"close\",\n value: function close(event) {\n var button = event.target.closest('[data-popup-target=\"button\"]');\n var popup = this.popupById(button.dataset['popupId']);\n this.closePopup(popup);\n }\n }, {\n key: \"popupById\",\n value: function popupById(id) {\n return this.popupTargets.find(function (popup) {\n return popup.dataset['popupId'] === id;\n });\n }\n }, {\n key: \"openPopup\",\n value: function openPopup(popup) {\n popup.classList.remove('closed');\n }\n }, {\n key: \"closePopup\",\n value: function closePopup(popup) {\n popup.classList.add('closed');\n }\n }], [{\n key: \"targets\",\n get: function get() {\n return [\"popup\", \"button\"];\n }\n }, {\n key: \"values\",\n get: function get() {\n return {\n id: String\n };\n }\n }]);\n\n return _default;\n}(_hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]);\n\n\n\n//# sourceURL=webpack:///./src/js/headmin/controllers/popup_controller.js?");
|
1497
1029
|
|
1498
1030
|
/***/ }),
|
1499
1031
|
|
@@ -1505,7 +1037,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1505
1037
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1506
1038
|
|
1507
1039
|
"use strict";
|
1508
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var
|
1040
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @hotwired/stimulus */ \"./node_modules/@hotwired/stimulus/dist/stimulus.js\");\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\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); }; }\n\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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\nvar _default = /*#__PURE__*/function (_Controller) {\n _inherits(_default, _Controller);\n\n var _super = _createSuper(_default);\n\n function _default() {\n _classCallCheck(this, _default);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(_default, [{\n key: \"connect\",\n value: function connect() {\n var _this = this;\n\n new sortablejs__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.listTarget, {\n animation: 150,\n ghostClass: 'list-group-item-dark',\n draggable: '.repeater-row',\n handle: '.repeater-row-handle',\n onEnd: function onEnd() {\n _this.resetIndices();\n\n _this.resetPositions();\n }\n });\n this.toggleEmpty();\n }\n }, {\n key: \"resetButtonIndices\",\n value: function resetButtonIndices(event) {\n var row = event.target.closest('.repeater-row');\n var index = this.containsRow(row) ? row.dataset.rowIndex : '';\n this.updatePopupButtonIndices(index);\n }\n }, {\n key: \"containsRow\",\n value: function containsRow(row) {\n return this.rowTargets.includes(row);\n }\n }, {\n key: \"updatePopupButtonIndices\",\n value: function updatePopupButtonIndices(index) {\n var popup = document.querySelector(\"[data-popup-target=\\\"popup\\\"][data-popup-id=\\\"repeater-buttons-\".concat(this.idValue, \"\\\"]\"));\n var buttons = popup.querySelectorAll('a');\n buttons.forEach(function (button) {\n button.dataset.rowIndex = index;\n });\n }\n }, {\n key: \"addRow\",\n value: function addRow(event) {\n event.preventDefault();\n var button = event.target;\n var templateName = button.dataset.templateName;\n var rowIndex = button.dataset.rowIndex; // Prepare html from template\n\n var template = this.getTemplate(templateName);\n var html = this.replaceIdsWithTimestamps(template); // Fallback to last row if no index is set\n\n if (rowIndex) {\n // Insert new row after defined row\n var row = this.rowTargets[rowIndex];\n row.insertAdjacentHTML('afterend', html);\n } else {\n // Insert before footer\n this.footerTarget.insertAdjacentHTML('beforebegin', html);\n } // Dispatch an event\n\n\n document.dispatchEvent(new CustomEvent('headmin:reinit', {\n bubbles: true\n }));\n this.resetIndices();\n this.resetPositions();\n this.toggleEmpty();\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(event) {\n event.preventDefault();\n var row = event.target.closest(\".repeater-row\");\n\n if (row.dataset.newRecord === \"true\") {\n // New records are simply removed from the page\n row.remove();\n } else {\n // Existing records are hidden and flagged for deletion\n row.querySelector(\"input[name*='_destroy']\").value = 1;\n row.style.display = 'none';\n }\n\n this.resetIndices();\n this.resetPositions();\n this.toggleEmpty();\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(name) {\n return this.templateTargets.filter(function (template) {\n return template.dataset.templateName === name;\n })[0];\n }\n }, {\n key: \"replaceIdsWithTimestamps\",\n value: function replaceIdsWithTimestamps(template) {\n console.log(template);\n var regex = new RegExp(template.dataset.templateIdRegex, \"g\");\n return template.innerHTML.replace(regex, new Date().getTime());\n }\n }, {\n key: \"visibleRowsCount\",\n value: function visibleRowsCount() {\n return this.visibleRows().length;\n }\n }, {\n key: \"visibleRows\",\n value: function visibleRows() {\n var rows = this.rowTargets;\n return rows.filter(function (row) {\n return row.querySelector(\"input[name*='_destroy']\").value !== '1';\n });\n }\n }, {\n key: \"toggleEmpty\",\n value: function toggleEmpty() {\n if (this.visibleRowsCount() > 0) {\n this.emptyTarget.classList.add('invisible');\n } else {\n this.emptyTarget.classList.remove('invisible');\n }\n }\n }, {\n key: \"resetPositions\",\n value: function resetPositions() {\n this.visibleRows().forEach(function (row, index) {\n var positionInput = row.querySelector(\"input[name*='position']\");\n\n if (positionInput) {\n positionInput.value = index;\n }\n });\n }\n }, {\n key: \"resetIndices\",\n value: function resetIndices() {\n this.visibleRows().forEach(function (row, index) {\n row.dataset.rowIndex = index;\n });\n }\n }], [{\n key: \"values\",\n get: function get() {\n return {\n id: String\n };\n }\n }, {\n key: \"targets\",\n get: function get() {\n return [\"repeater\", \"footer\", \"template\", \"row\", \"list\", \"empty\", \"addButton\"];\n }\n }]);\n\n return _default;\n}(_hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]);\n\n\n\n//# sourceURL=webpack:///./src/js/headmin/controllers/repeater_controller.js?");
|
1509
1041
|
|
1510
1042
|
/***/ }),
|
1511
1043
|
|
@@ -1517,7 +1049,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1517
1049
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1518
1050
|
|
1519
1051
|
"use strict";
|
1520
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var
|
1052
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @hotwired/stimulus */ \"./node_modules/@hotwired/stimulus/dist/stimulus.js\");\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\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); }; }\n\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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\nvar _default = /*#__PURE__*/function (_Controller) {\n _inherits(_default, _Controller);\n\n var _super = _createSuper(_default);\n\n function _default() {\n _classCallCheck(this, _default);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(_default, [{\n key: \"connect\",\n value: function connect() {\n var _this = this;\n\n this.wrapperTarget.addEventListener('idSelectionChanged', function (event) {\n var ids = event.detail.ids;\n\n _this.updateIdFields(ids);\n\n _this.updateCountValueWithIds(ids);\n });\n }\n }, {\n key: \"update\",\n value: function update(event) {\n event.preventDefault();\n this.updateFormAction();\n this.updateFormMethod();\n this.updateButton();\n }\n }, {\n key: \"updateIdFields\",\n value: function updateIdFields(ids) {\n var _this2 = this;\n\n this.removeIds();\n\n if (ids instanceof Array) {\n this.countValue = ids.length;\n ids.forEach(function (id) {\n _this2.addId(id);\n });\n } else {\n this.countValue = Infinity;\n this.addId('');\n }\n }\n }, {\n key: \"updateCounter\",\n value: function updateCounter() {\n var htmlString = '';\n\n switch (this.countValue) {\n case 0:\n htmlString = this.counterTarget.getAttribute('data-items-zero');\n break;\n\n case 1:\n htmlString = this.counterTarget.getAttribute('data-items-one');\n break;\n\n case Infinity:\n htmlString = this.counterTarget.getAttribute('data-items-other');\n htmlString = htmlString.replace(/<b>[\\s\\S]*?<\\/b>/, '<b>' + this.totalCount() + '<\\/b>');\n break;\n\n default:\n htmlString = this.counterTarget.getAttribute('data-items-other');\n var count = this.countValue === Infinity ? this.totalCount() : this.countValue;\n htmlString = htmlString.replace(/<b>[\\s\\S]*?<\\/b>/, \"<b>\".concat(count, \"</b>\"));\n }\n\n this.counterTarget.innerHTML = htmlString;\n }\n }, {\n key: \"totalCount\",\n value: function totalCount() {\n return this.counterTarget.getAttribute('data-total-count');\n }\n }, {\n key: \"updateCountValueWithIds\",\n value: function updateCountValueWithIds(ids) {\n if (ids instanceof Array) {\n this.countValue = ids.length;\n } else {\n this.countValue = Infinity;\n }\n }\n }, {\n key: \"countValueChanged\",\n value: function countValueChanged() {\n this.updateCounter();\n this.toggle();\n }\n }, {\n key: \"toggle\",\n value: function toggle() {\n if (this.countValue > 0) {\n this.wrapperTarget.classList.remove('d-none');\n } else {\n this.wrapperTarget.classList.add('d-none');\n }\n }\n }, {\n key: \"updateFormAction\",\n value: function updateFormAction() {\n this.formTarget.action = this.selectTarget.value;\n }\n }, {\n key: \"updateFormMethod\",\n value: function updateFormMethod() {\n var option = this.selectedOption();\n this.methodTarget.value = option.dataset.method;\n }\n }, {\n key: \"updateButton\",\n value: function updateButton() {\n var option = this.selectedOption();\n var confirm = option.dataset.confirm;\n\n if (confirm) {\n this.buttonTarget.dataset.confirm = confirm;\n } else {\n this.buttonTarget.removeAttribute('data-confirm');\n }\n\n this.enableButton();\n }\n }, {\n key: \"selectedOption\",\n value: function selectedOption() {\n return this.selectTarget.options[this.selectTarget.selectedIndex];\n }\n }, {\n key: \"enableButton\",\n value: function enableButton() {\n this.buttonTarget.removeAttribute('disabled');\n }\n }, {\n key: \"addId\",\n value: function addId(id) {\n var template = this.idInputTemplateTarget;\n var input = template.innerHTML.replace(/ID/g, id);\n this.formTarget.insertAdjacentHTML('afterbegin', input);\n }\n }, {\n key: \"removeIds\",\n value: function removeIds() {\n var _this3 = this;\n\n this.idTargets.forEach(function (input) {\n _this3.formTarget.removeChild(input);\n });\n }\n }], [{\n key: \"values\",\n get: function get() {\n return {\n count: {\n type: Number,\n default: 0\n }\n };\n }\n }, {\n key: \"targets\",\n get: function get() {\n return [\"wrapper\", \"form\", \"select\", \"method\", \"button\", \"idInputTemplate\", \"id\", \"counter\"];\n }\n }]);\n\n return _default;\n}(_hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]);\n\n\n\n//# sourceURL=webpack:///./src/js/headmin/controllers/table_actions_controller.js?");
|
1521
1053
|
|
1522
1054
|
/***/ }),
|
1523
1055
|
|
@@ -1529,7 +1061,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1529
1061
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1530
1062
|
|
1531
1063
|
"use strict";
|
1532
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var
|
1064
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _default; });\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @hotwired/stimulus */ \"./node_modules/@hotwired/stimulus/dist/stimulus.js\");\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n/* harmony import */ var _rails_ujs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @rails/ujs */ \"./node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js\");\n/* harmony import */ var _rails_ujs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_rails_ujs__WEBPACK_IMPORTED_MODULE_2__);\nfunction _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\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\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.\"); }\n\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); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\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); }; }\n\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); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\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; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\nvar _default = /*#__PURE__*/function (_Controller) {\n _inherits(_default, _Controller);\n\n var _super = _createSuper(_default);\n\n function _default() {\n _classCallCheck(this, _default);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(_default, [{\n key: \"connect\",\n value: function connect() {\n var _this = this;\n\n new sortablejs__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.bodyTarget, {\n handle: '.table-drag-sort-handle',\n onEnd: function onEnd(event) {\n _rails_ujs__WEBPACK_IMPORTED_MODULE_2___default.a.ajax({\n url: _this.urlValue,\n type: \"PATCH\",\n data: _this.getIdsDataString()\n });\n }\n });\n }\n }, {\n key: \"getIdsDataString\",\n value: function getIdsDataString() {\n var table = this.tableTarget;\n var data = \"\";\n\n var handles = _toConsumableArray(table.querySelectorAll(\".table-drag-sort-handle\"));\n\n handles.map(function (handle) {\n data += \"ids[]=\".concat(handle.dataset.id, \"&\");\n });\n return data;\n }\n }, {\n key: \"toggleIds\",\n value: function toggleIds(event) {\n var checkbox = event.target;\n this.toggleIdsCheckboxes(checkbox.checked);\n this.toggleIdCheckboxes(checkbox.checked);\n this.updateActions();\n }\n }, {\n key: \"toggleId\",\n value: function toggleId(event) {\n this.toggleIdsCheckboxes(false);\n this.updateActions();\n }\n }, {\n key: \"updateActions\",\n value: function updateActions() {\n this.actionsTarget.dispatchEvent(new CustomEvent('idSelectionChanged', {\n detail: {\n ids: this.ids()\n }\n }));\n }\n }, {\n key: \"ids\",\n value: function ids() {\n if (this.idsCheckboxTarget.checked) {\n return null;\n } else {\n return this.selectedIdCheckboxes().map(function (checkbox) {\n return checkbox.value;\n });\n }\n }\n }, {\n key: \"selectedIdCheckboxes\",\n value: function selectedIdCheckboxes() {\n return this.idCheckboxTargets.filter(function (checkbox) {\n return checkbox.checked;\n });\n }\n }, {\n key: \"toggleIdsCheckboxes\",\n value: function toggleIdsCheckboxes(checked) {\n this.idsCheckboxTargets.forEach(function (checkbox) {\n checkbox.checked = checked;\n });\n }\n }, {\n key: \"toggleIdCheckboxes\",\n value: function toggleIdCheckboxes(checked) {\n this.idCheckboxTargets.forEach(function (checkbox) {\n checkbox.checked = checked;\n });\n }\n }], [{\n key: \"values\",\n get: function get() {\n return {\n url: String\n };\n }\n }, {\n key: \"targets\",\n get: function get() {\n return [\"table\", \"body\", \"actions\", \"idCheckbox\", \"idsCheckbox\"];\n }\n }]);\n\n return _default;\n}(_hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]);\n\n\n\n//# sourceURL=webpack:///./src/js/headmin/controllers/table_controller.js?");
|
1533
1065
|
|
1534
1066
|
/***/ }),
|
1535
1067
|
|
@@ -1541,7 +1073,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1541
1073
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1542
1074
|
|
1543
1075
|
"use strict";
|
1544
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Headmin\", function() { return Headmin; });\n/* harmony import */ var ckeditor5_build_classic_simple_upload_adapter_image_resize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5-build-classic-simple-upload-adapter-image-resize */ \"./node_modules/ckeditor5-build-classic-simple-upload-adapter-image-resize/build/ckeditor.js\");\n/* harmony import */ var ckeditor5_build_classic_simple_upload_adapter_image_resize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(ckeditor5_build_classic_simple_upload_adapter_image_resize__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var tom_select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tom-select */ \"./node_modules/tom-select/dist/js/tom-select.complete.js\");\n/* harmony import */ var tom_select__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tom_select__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var flatpickr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flatpickr */ \"./node_modules/flatpickr/dist/esm/index.js\");\n/* harmony import */ var bootstrap_dist_js_bootstrap_bundle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bootstrap/dist/js/bootstrap.bundle */ \"./node_modules/bootstrap/dist/js/bootstrap.bundle.js\");\n/* harmony import */ var bootstrap_dist_js_bootstrap_bundle__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(bootstrap_dist_js_bootstrap_bundle__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _rails_ujs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @rails/ujs */ \"./node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js\");\n/* harmony import */ var _rails_ujs__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_rails_ujs__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var
|
1076
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Headmin\", function() { return Headmin; });\n/* harmony import */ var ckeditor5_build_classic_simple_upload_adapter_image_resize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5-build-classic-simple-upload-adapter-image-resize */ \"./node_modules/ckeditor5-build-classic-simple-upload-adapter-image-resize/build/ckeditor.js\");\n/* harmony import */ var ckeditor5_build_classic_simple_upload_adapter_image_resize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(ckeditor5_build_classic_simple_upload_adapter_image_resize__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var tom_select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tom-select */ \"./node_modules/tom-select/dist/js/tom-select.complete.js\");\n/* harmony import */ var tom_select__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tom_select__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var flatpickr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flatpickr */ \"./node_modules/flatpickr/dist/esm/index.js\");\n/* harmony import */ var bootstrap_dist_js_bootstrap_bundle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bootstrap/dist/js/bootstrap.bundle */ \"./node_modules/bootstrap/dist/js/bootstrap.bundle.js\");\n/* harmony import */ var bootstrap_dist_js_bootstrap_bundle__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(bootstrap_dist_js_bootstrap_bundle__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _rails_ujs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @rails/ujs */ \"./node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js\");\n/* harmony import */ var _rails_ujs__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_rails_ujs__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @hotwired/stimulus */ \"./node_modules/@hotwired/stimulus/dist/stimulus.js\");\n/* harmony import */ var _hotwired_stimulus_webpack_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @hotwired/stimulus-webpack-helpers */ \"./node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n\n\n\n\n\n\n\nvar Headmin = /*#__PURE__*/function () {\n function Headmin() {\n _classCallCheck(this, Headmin);\n }\n\n _createClass(Headmin, null, [{\n key: \"start\",\n value: function start() {\n var _this = this;\n\n // Init Rails UJS\n _rails_ujs__WEBPACK_IMPORTED_MODULE_4___default.a.start(); // Init Stimulus\n\n var application = _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_5__[\"Application\"].start();\n\n var context = __webpack_require__(\"./src/js/headmin/controllers sync recursive \\\\.js$\");\n\n application.load(Object(_hotwired_stimulus_webpack_helpers__WEBPACK_IMPORTED_MODULE_6__[\"definitionsFromContext\"])(context)); // Init Plugins\n\n this.initPlugins(); // Listen for a headmin:reinit event\n\n document.addEventListener('headmin:reinit', function (e) {\n _this.initPlugins();\n });\n }\n }, {\n key: \"initPlugins\",\n value: function initPlugins() {\n this.initTomSelects();\n this.initFlatpickrs();\n this.initToasts();\n this.initPopovers();\n this.initCKEditors();\n this.initRedactorX();\n }\n }, {\n key: \"initRedactorX\",\n value: function initRedactorX() {\n document.querySelectorAll('.redactorx').forEach(function (element) {\n if (typeof RedactorX == 'undefined') {\n console.error(\"RedactorX is a paid module and is not included in Headmin. Please purchase it and import it as a JS module\");\n return false;\n }\n\n var options = JSON.parse(element.getAttribute('data-redactor-options'));\n RedactorX(element, options);\n });\n }\n }, {\n key: \"initFlatpickrs\",\n value: function initFlatpickrs() {\n var _this2 = this;\n\n document.querySelectorAll('.flatpickr').forEach(function (element) {\n _this2.initFlatpickr(element);\n });\n }\n }, {\n key: \"initFlatpickr\",\n value: function initFlatpickr(element) {\n Object(flatpickr__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element, {\n allowInput: true,\n altInput: true,\n altFormat: 'd/m/Y'\n });\n }\n }, {\n key: \"initCKEditors\",\n value: function initCKEditors() {\n var _this3 = this;\n\n document.querySelectorAll('.ckeditor').forEach(function (element) {\n _this3.initCKEditor(element);\n });\n }\n }, {\n key: \"csrfToken\",\n value: function csrfToken() {\n return document.querySelector('meta[name=\"csrf-token\"]').content;\n }\n }, {\n key: \"initCKEditor\",\n value: function initCKEditor(element) {\n // Check if CKEditor is already initialized\n if (element.nextElementSibling && element.nextElementSibling.classList.contains('ck-editor')) return;\n var defaultToolbarItems = ['heading', '|', 'bold', 'italic', 'bulletedList', 'numberedList', '|', 'outdent', 'indent', '|', 'link', 'imageUpload', 'blockQuote', 'insertTable', 'mediaEmbed', '|', 'undo', 'redo'];\n var requestedToolbarItems = element.dataset.ckeditorToolbar ? JSON.parse(element.dataset.ckeditorToolbar) : undefined;\n var toolbarItems = requestedToolbarItems ? requestedToolbarItems : defaultToolbarItems;\n var uploadPath = element.dataset.ckeditorUploadPath;\n ClassicEditor.create(element, {\n toolbar: {\n items: toolbarItems\n },\n language: 'en',\n image: {\n toolbar: ['imageTextAlternative', 'imageStyle:full', 'imageStyle:side']\n },\n table: {\n contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells']\n },\n simpleUpload: {\n uploadUrl: uploadPath,\n withCredentials: true,\n headers: {\n 'X-CSRF-TOKEN': this.csrfToken()\n }\n }\n });\n }\n }, {\n key: \"initTomSelects\",\n value: function initTomSelects() {\n document.querySelectorAll('select[multiple]').forEach(function (select) {\n new tom_select__WEBPACK_IMPORTED_MODULE_1___default.a(select, {\n create: select.dataset['tags'] === \"true\"\n });\n });\n }\n }, {\n key: \"initToasts\",\n value: function initToasts() {\n document.querySelectorAll('.toast').forEach(function (toast) {\n new bootstrap_dist_js_bootstrap_bundle__WEBPACK_IMPORTED_MODULE_3___default.a.Toast(toast, {});\n });\n }\n }, {\n key: \"initPopovers\",\n value: function initPopovers() {\n var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle=\"popover\"]'));\n var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {\n return new bootstrap_dist_js_bootstrap_bundle__WEBPACK_IMPORTED_MODULE_3___default.a.Popover(popoverTriggerEl, {\n sanitize: false\n });\n });\n }\n }]);\n\n return Headmin;\n}();\n\n//# sourceURL=webpack:///./src/js/headmin/headmin.js?");
|
1545
1077
|
|
1546
1078
|
/***/ })
|
1547
1079
|
|