{ "version": 3, "sources": ["../../../node_modules/@rails/actioncable/src/adapters.js", "../../../node_modules/@rails/actioncable/src/logger.js", "../../../node_modules/@rails/actioncable/src/connection_monitor.js", "../../../node_modules/@rails/actioncable/src/internal.js", "../../../node_modules/@rails/actioncable/src/connection.js", "../../../node_modules/@rails/actioncable/src/subscription.js", "../../../node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../node_modules/@rails/actioncable/src/subscriptions.js", "../../../node_modules/@rails/actioncable/src/consumer.js", "../../../node_modules/@rails/actioncable/src/index.js", "../../../node_modules/lodash/isObject.js", "../../../node_modules/lodash/_freeGlobal.js", "../../../node_modules/lodash/_root.js", "../../../node_modules/lodash/now.js", "../../../node_modules/lodash/_trimmedEndIndex.js", "../../../node_modules/lodash/_baseTrim.js", "../../../node_modules/lodash/_Symbol.js", "../../../node_modules/lodash/_getRawTag.js", "../../../node_modules/lodash/_objectToString.js", "../../../node_modules/lodash/_baseGetTag.js", "../../../node_modules/lodash/isObjectLike.js", "../../../node_modules/lodash/isSymbol.js", "../../../node_modules/lodash/toNumber.js", "../../../node_modules/lodash/debounce.js", "../../../node_modules/lodash/throttle.js", "../../../node_modules/highcharts/highcharts.js", "../../../node_modules/highcharts/modules/accessibility.js", "../../../node_modules/highcharts/modules/no-data-to-display.js", "../../../node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../javascript/controllers/application.js", "../../../node_modules/slim-select/src/slim-select/classes.ts", "../../../node_modules/slim-select/src/slim-select/animations.ts", "../../../node_modules/slim-select/src/slim-select/settings.ts", "../../../node_modules/slim-select/src/slim-select/helpers.ts", "../../../node_modules/slim-select/src/slim-select/events.ts", "../../../node_modules/slim-select/src/slim-select/lifecycle.ts", "../../../node_modules/slim-select/src/slim-select/store.ts", "../../../node_modules/slim-select/src/slim-select/render.ts", "../../../node_modules/slim-select/src/slim-select/mutations.ts", "../../../node_modules/slim-select/src/slim-select/select.ts", "../../../node_modules/slim-select/src/slim-select/sync.ts", "../../../node_modules/slim-select/src/slim-select/index.ts", "../../javascript/src/utilities/strings.ts", "../../javascript/controllers/inputs/slimselect_controller.ts", "../../javascript/controllers/companies/manual_attribute_controller.ts", "../../javascript/controllers/diligence/app_lookup_controller.ts", "../../../node_modules/@rails/request.js/src/fetch_response.js", "../../../node_modules/@rails/request.js/src/request_interceptor.js", "../../../node_modules/@rails/request.js/src/lib/utils.js", "../../../node_modules/@rails/request.js/src/fetch_request.js", "../../../node_modules/@rails/request.js/src/verbs.js", "../../javascript/controllers/diligence/benchmark/dropdown_controller.ts", "../../javascript/controllers/diligence/crrem/pathway_dropdown_controller.ts", "../../javascript/controllers/diligence/gross_floor_area_controller.ts", "../../javascript/controllers/diligence/year_built_controller.ts", "../../javascript/controllers/esgx_securities/snapshots/search_controller.ts", "../../javascript/controllers/esgx_securities/toggle_ftse_controller.ts", "../../javascript/controllers/esgx_securities/variance_report_upload_controller.ts", "../../javascript/controllers/inputs/submit_checkbox_controller.ts", "../../javascript/controllers/inputs/dropdown_controller.ts", "../../javascript/controllers/insights/asset_level_file_upload_controller.ts", "../../javascript/controllers/insights/progress_bar_controller.js", "../../../node_modules/@popperjs/core/lib/index.js", "../../../node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/@popperjs/core/lib/utils/userAgent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/@popperjs/core/lib/popper-lite.js", "../../../node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/bootstrap/js/src/dom/data.js", "../../../node_modules/bootstrap/js/src/util/index.js", "../../../node_modules/bootstrap/js/src/dom/event-handler.js", "../../../node_modules/bootstrap/js/src/dom/manipulator.js", "../../../node_modules/bootstrap/js/src/util/config.js", "../../../node_modules/bootstrap/js/src/base-component.js", "../../../node_modules/bootstrap/js/src/dom/selector-engine.js", "../../../node_modules/bootstrap/js/src/util/component-functions.js", "../../../node_modules/bootstrap/js/src/alert.js", "../../../node_modules/bootstrap/js/src/button.js", "../../../node_modules/bootstrap/js/src/util/swipe.js", "../../../node_modules/bootstrap/js/src/carousel.js", "../../../node_modules/bootstrap/js/src/collapse.js", "../../../node_modules/bootstrap/js/src/dropdown.js", "../../../node_modules/bootstrap/js/src/util/backdrop.js", "../../../node_modules/bootstrap/js/src/util/focustrap.js", "../../../node_modules/bootstrap/js/src/util/scrollbar.js", "../../../node_modules/bootstrap/js/src/modal.js", "../../../node_modules/bootstrap/js/src/offcanvas.js", "../../../node_modules/bootstrap/js/src/util/sanitizer.js", "../../../node_modules/bootstrap/js/src/util/template-factory.js", "../../../node_modules/bootstrap/js/src/tooltip.js", "../../../node_modules/bootstrap/js/src/popover.js", "../../../node_modules/bootstrap/js/src/scrollspy.js", "../../../node_modules/bootstrap/js/src/tab.js", "../../../node_modules/bootstrap/js/src/toast.js", "../../javascript/controllers/modal_controller.js", "../../javascript/controllers/snp_company_controller.ts", "../../javascript/controllers/inline_edit_controller.ts", "../../javascript/controllers/toggle_controller.ts", "../../javascript/controllers/tooltip_controller.ts", "../../javascript/controllers/period_selector_controller.ts", "../../javascript/controllers/sidebar_controller.ts", "../../javascript/controllers/accordion_persist_controller.ts", "../../javascript/controllers/export_queue_polling_controller.ts", "../../javascript/controllers/bulk_select_controller.ts", "../../javascript/controllers/lock_log_chart_controller.ts", "../../javascript/controllers/diligence/benchmark/chart_controller.ts", "../../javascript/src/utilities/arrays.ts", "../../javascript/src/utilities/objects.ts", "../../javascript/controllers/diligence/benchmark/legacy_chart_controller.ts", "../../javascript/controllers/diligence/legacy/pathway_controller.ts", "../../javascript/controllers/diligence/crrem/pathway_controller.ts", "../../javascript/controllers/diligence/public_disclosure_controller.ts", "../../javascript/controllers/esgx_securities/instance_chart_controller.ts", "../../javascript/controllers/index.js", "../../../node_modules/jquery/dist-module/jquery.module.js", "../../javascript/src/plugins/jquery.ts", "../../javascript/src/plugins/bootstrap_utils.ts", "../../javascript/src/bootstrap.ts", "../../javascript/src/plugins/highcharts.ts", "../../javascript/src/due_diligence/address_lookup.js", "../../javascript/duediligence.js"], "sourcesContent": ["export default {\n logger: typeof console !== \"undefined\" ? console : undefined,\n WebSocket: typeof WebSocket !== \"undefined\" ? WebSocket : undefined,\n}\n", "import adapters from \"./adapters\"\n\n// The logger is disabled by default. You can enable it with:\n//\n// ActionCable.logger.enabled = true\n//\n// Example:\n//\n// import * as ActionCable from '@rails/actioncable'\n//\n// ActionCable.logger.enabled = true\n// ActionCable.logger.log('Connection Established.')\n//\n\nexport default {\n log(...messages) {\n if (this.enabled) {\n messages.push(Date.now())\n adapters.logger.log(\"[ActionCable]\", ...messages)\n }\n },\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring the cable connection is in good health by validating the heartbeat pings sent from the server, and attempting\n// revival reconnections if things go astray. Internal class, not intended for direct user manipulation.\n\nconst now = () => new Date().getTime()\n\nconst secondsSince = time => (now() - time) / 1000\n\nclass ConnectionMonitor {\n constructor(connection) {\n this.visibilityDidChange = this.visibilityDidChange.bind(this)\n this.connection = connection\n this.reconnectAttempts = 0\n }\n\n start() {\n if (!this.isRunning()) {\n this.startedAt = now()\n delete this.stoppedAt\n this.startPolling()\n addEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`)\n }\n }\n\n stop() {\n if (this.isRunning()) {\n this.stoppedAt = now()\n this.stopPolling()\n removeEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(\"ConnectionMonitor stopped\")\n }\n }\n\n isRunning() {\n return this.startedAt && !this.stoppedAt\n }\n\n recordMessage() {\n this.pingedAt = now()\n }\n\n recordConnect() {\n this.reconnectAttempts = 0\n delete this.disconnectedAt\n logger.log(\"ConnectionMonitor recorded connect\")\n }\n\n recordDisconnect() {\n this.disconnectedAt = now()\n logger.log(\"ConnectionMonitor recorded disconnect\")\n }\n\n // Private\n\n startPolling() {\n this.stopPolling()\n this.poll()\n }\n\n stopPolling() {\n clearTimeout(this.pollTimeout)\n }\n\n poll() {\n this.pollTimeout = setTimeout(() => {\n this.reconnectIfStale()\n this.poll()\n }\n , this.getPollInterval())\n }\n\n getPollInterval() {\n const { staleThreshold, reconnectionBackoffRate } = this.constructor\n const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10))\n const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate\n const jitter = jitterMax * Math.random()\n return staleThreshold * 1000 * backoff * (1 + jitter)\n }\n\n reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`)\n this.reconnectAttempts++\n if (this.disconnectedRecently()) {\n logger.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`)\n } else {\n logger.log(\"ConnectionMonitor reopening\")\n this.connection.reopen()\n }\n }\n }\n\n get refreshedAt() {\n return this.pingedAt ? this.pingedAt : this.startedAt\n }\n\n connectionIsStale() {\n return secondsSince(this.refreshedAt) > this.constructor.staleThreshold\n }\n\n disconnectedRecently() {\n return this.disconnectedAt && (secondsSince(this.disconnectedAt) < this.constructor.staleThreshold)\n }\n\n visibilityDidChange() {\n if (document.visibilityState === \"visible\") {\n setTimeout(() => {\n if (this.connectionIsStale() || !this.connection.isOpen()) {\n logger.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`)\n this.connection.reopen()\n }\n }\n , 200)\n }\n }\n\n}\n\nConnectionMonitor.staleThreshold = 6 // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\nConnectionMonitor.reconnectionBackoffRate = 0.15\n\nexport default ConnectionMonitor\n", "export default {\n \"message_types\": {\n \"welcome\": \"welcome\",\n \"disconnect\": \"disconnect\",\n \"ping\": \"ping\",\n \"confirmation\": \"confirm_subscription\",\n \"rejection\": \"reject_subscription\"\n },\n \"disconnect_reasons\": {\n \"unauthorized\": \"unauthorized\",\n \"invalid_request\": \"invalid_request\",\n \"server_restart\": \"server_restart\",\n \"remote\": \"remote\"\n },\n \"default_mount_path\": \"/cable\",\n \"protocols\": [\n \"actioncable-v1-json\",\n \"actioncable-unsupported\"\n ]\n}\n", "import adapters from \"./adapters\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\n\n// Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nconst {message_types, protocols} = INTERNAL\nconst supportedProtocols = protocols.slice(0, protocols.length - 1)\n\nconst indexOf = [].indexOf\n\nclass Connection {\n constructor(consumer) {\n this.open = this.open.bind(this)\n this.consumer = consumer\n this.subscriptions = this.consumer.subscriptions\n this.monitor = new ConnectionMonitor(this)\n this.disconnected = true\n }\n\n send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data))\n return true\n } else {\n return false\n }\n }\n\n open() {\n if (this.isActive()) {\n logger.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`)\n return false\n } else {\n const socketProtocols = [...protocols, ...this.consumer.subprotocols || []]\n logger.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${socketProtocols}`)\n if (this.webSocket) { this.uninstallEventHandlers() }\n this.webSocket = new adapters.WebSocket(this.consumer.url, socketProtocols)\n this.installEventHandlers()\n this.monitor.start()\n return true\n }\n }\n\n close({allowReconnect} = {allowReconnect: true}) {\n if (!allowReconnect) { this.monitor.stop() }\n // Avoid closing websockets in a \"connecting\" state due to Safari 15.1+ bug. See: https://github.com/rails/rails/issues/43835#issuecomment-1002288478\n if (this.isOpen()) {\n return this.webSocket.close()\n }\n }\n\n reopen() {\n logger.log(`Reopening WebSocket, current state is ${this.getState()}`)\n if (this.isActive()) {\n try {\n return this.close()\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error)\n }\n finally {\n logger.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`)\n setTimeout(this.open, this.constructor.reopenDelay)\n }\n } else {\n return this.open()\n }\n }\n\n getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol\n }\n }\n\n isOpen() {\n return this.isState(\"open\")\n }\n\n isActive() {\n return this.isState(\"open\", \"connecting\")\n }\n\n triedToReconnect() {\n return this.monitor.reconnectAttempts > 0\n }\n\n // Private\n\n isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0\n }\n\n isState(...states) {\n return indexOf.call(states, this.getState()) >= 0\n }\n\n getState() {\n if (this.webSocket) {\n for (let state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase()\n }\n }\n }\n return null\n }\n\n installEventHandlers() {\n for (let eventName in this.events) {\n const handler = this.events[eventName].bind(this)\n this.webSocket[`on${eventName}`] = handler\n }\n }\n\n uninstallEventHandlers() {\n for (let eventName in this.events) {\n this.webSocket[`on${eventName}`] = function() {}\n }\n }\n\n}\n\nConnection.reopenDelay = 500\n\nConnection.prototype.events = {\n message(event) {\n if (!this.isProtocolSupported()) { return }\n const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)\n this.monitor.recordMessage()\n switch (type) {\n case message_types.welcome:\n if (this.triedToReconnect()) {\n this.reconnectAttempted = true\n }\n this.monitor.recordConnect()\n return this.subscriptions.reload()\n case message_types.disconnect:\n logger.log(`Disconnecting. Reason: ${reason}`)\n return this.close({allowReconnect: reconnect})\n case message_types.ping:\n return null\n case message_types.confirmation:\n this.subscriptions.confirmSubscription(identifier)\n if (this.reconnectAttempted) {\n this.reconnectAttempted = false\n return this.subscriptions.notify(identifier, \"connected\", {reconnected: true})\n } else {\n return this.subscriptions.notify(identifier, \"connected\", {reconnected: false})\n }\n case message_types.rejection:\n return this.subscriptions.reject(identifier)\n default:\n return this.subscriptions.notify(identifier, \"received\", message)\n }\n },\n\n open() {\n logger.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`)\n this.disconnected = false\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\")\n return this.close({allowReconnect: false})\n }\n },\n\n close(event) {\n logger.log(\"WebSocket onclose event\")\n if (this.disconnected) { return }\n this.disconnected = true\n this.monitor.recordDisconnect()\n return this.subscriptions.notifyAll(\"disconnected\", {willAttemptReconnect: this.monitor.isRunning()})\n },\n\n error() {\n logger.log(\"WebSocket onerror event\")\n }\n}\n\nexport default Connection\n", "// A new subscription is created through the ActionCable.Subscriptions instance available on the consumer.\n// It provides a number of callbacks and a method for calling remote procedure calls on the corresponding\n// Channel instance on the server side.\n//\n// An example demonstrates the basic functionality:\n//\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\", {\n// connected() {\n// // Called once the subscription has been successfully completed\n// },\n//\n// disconnected({ willAttemptReconnect: boolean }) {\n// // Called when the client has disconnected with the server.\n// // The object will have an `willAttemptReconnect` property which\n// // says whether the client has the intention of attempting\n// // to reconnect.\n// },\n//\n// appear() {\n// this.perform('appear', {appearing_on: this.appearingOn()})\n// },\n//\n// away() {\n// this.perform('away')\n// },\n//\n// appearingOn() {\n// $('main').data('appearing-on')\n// }\n// })\n//\n// The methods #appear and #away forward their intent to the remote AppearanceChannel instance on the server\n// by calling the `perform` method with the first parameter being the action (which maps to AppearanceChannel#appear/away).\n// The second parameter is a hash that'll get JSON encoded and made available on the server in the data parameter.\n//\n// This is how the server component would look:\n//\n// class AppearanceChannel < ApplicationActionCable::Channel\n// def subscribed\n// current_user.appear\n// end\n//\n// def unsubscribed\n// current_user.disappear\n// end\n//\n// def appear(data)\n// current_user.appear on: data['appearing_on']\n// end\n//\n// def away\n// current_user.away\n// end\n// end\n//\n// The \"AppearanceChannel\" name is automatically mapped between the client-side subscription creation and the server-side Ruby class name.\n// The AppearanceChannel#appear/away public methods are exposed automatically to client-side invocation through the perform method.\n\nconst extend = function(object, properties) {\n if (properties != null) {\n for (let key in properties) {\n const value = properties[key]\n object[key] = value\n }\n }\n return object\n}\n\nexport default class Subscription {\n constructor(consumer, params = {}, mixin) {\n this.consumer = consumer\n this.identifier = JSON.stringify(params)\n extend(this, mixin)\n }\n\n // Perform a channel action with the optional data passed as an attribute\n perform(action, data = {}) {\n data.action = action\n return this.send(data)\n }\n\n send(data) {\n return this.consumer.send({command: \"message\", identifier: this.identifier, data: JSON.stringify(data)})\n }\n\n unsubscribe() {\n return this.consumer.subscriptions.remove(this)\n }\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring channel subscribe command is confirmed, retrying until confirmation is received.\n// Internal class, not intended for direct user manipulation.\n\nclass SubscriptionGuarantor {\n constructor(subscriptions) {\n this.subscriptions = subscriptions\n this.pendingSubscriptions = []\n }\n\n guarantee(subscription) {\n if(this.pendingSubscriptions.indexOf(subscription) == -1){ \n logger.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`)\n this.pendingSubscriptions.push(subscription) \n }\n else {\n logger.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`)\n }\n this.startGuaranteeing()\n }\n\n forget(subscription) {\n logger.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`)\n this.pendingSubscriptions = (this.pendingSubscriptions.filter((s) => s !== subscription))\n }\n\n startGuaranteeing() {\n this.stopGuaranteeing()\n this.retrySubscribing()\n }\n \n stopGuaranteeing() {\n clearTimeout(this.retryTimeout)\n }\n\n retrySubscribing() {\n this.retryTimeout = setTimeout(() => {\n if (this.subscriptions && typeof(this.subscriptions.subscribe) === \"function\") {\n this.pendingSubscriptions.map((subscription) => {\n logger.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`)\n this.subscriptions.subscribe(subscription)\n })\n }\n }\n , 500)\n }\n}\n\nexport default SubscriptionGuarantor", "import logger from \"./logger\"\nimport Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\n\n// Collection class for creating (and internally managing) channel subscriptions.\n// The only method intended to be triggered by the user is ActionCable.Subscriptions#create,\n// and it should be called through the consumer like so:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n\nexport default class Subscriptions {\n constructor(consumer) {\n this.consumer = consumer\n this.guarantor = new SubscriptionGuarantor(this)\n this.subscriptions = []\n }\n\n create(channelName, mixin) {\n const channel = channelName\n const params = typeof channel === \"object\" ? channel : {channel}\n const subscription = new Subscription(this.consumer, params, mixin)\n return this.add(subscription)\n }\n\n // Private\n\n add(subscription) {\n this.subscriptions.push(subscription)\n this.consumer.ensureActiveConnection()\n this.notify(subscription, \"initialized\")\n this.subscribe(subscription)\n return subscription\n }\n\n remove(subscription) {\n this.forget(subscription)\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\")\n }\n return subscription\n }\n\n reject(identifier) {\n return this.findAll(identifier).map((subscription) => {\n this.forget(subscription)\n this.notify(subscription, \"rejected\")\n return subscription\n })\n }\n\n forget(subscription) {\n this.guarantor.forget(subscription)\n this.subscriptions = (this.subscriptions.filter((s) => s !== subscription))\n return subscription\n }\n\n findAll(identifier) {\n return this.subscriptions.filter((s) => s.identifier === identifier)\n }\n\n reload() {\n return this.subscriptions.map((subscription) =>\n this.subscribe(subscription))\n }\n\n notifyAll(callbackName, ...args) {\n return this.subscriptions.map((subscription) =>\n this.notify(subscription, callbackName, ...args))\n }\n\n notify(subscription, callbackName, ...args) {\n let subscriptions\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription)\n } else {\n subscriptions = [subscription]\n }\n\n return subscriptions.map((subscription) =>\n (typeof subscription[callbackName] === \"function\" ? subscription[callbackName](...args) : undefined))\n }\n\n subscribe(subscription) {\n if (this.sendCommand(subscription, \"subscribe\")) {\n this.guarantor.guarantee(subscription)\n }\n }\n\n confirmSubscription(identifier) {\n logger.log(`Subscription confirmed ${identifier}`)\n this.findAll(identifier).map((subscription) =>\n this.guarantor.forget(subscription))\n }\n\n sendCommand(subscription, command) {\n const {identifier} = subscription\n return this.consumer.send({command, identifier})\n }\n}\n", "import Connection from \"./connection\"\nimport Subscriptions from \"./subscriptions\"\n\n// The ActionCable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,\n// the ActionCable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.\n// The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription\n// method.\n//\n// The following example shows how this can be set up:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n//\n// When a consumer is created, it automatically connects with the server.\n//\n// To disconnect from the server, call\n//\n// App.cable.disconnect()\n//\n// and to restart the connection:\n//\n// App.cable.connect()\n//\n// Any channel subscriptions which existed prior to disconnecting will\n// automatically resubscribe.\n\nexport default class Consumer {\n constructor(url) {\n this._url = url\n this.subscriptions = new Subscriptions(this)\n this.connection = new Connection(this)\n this.subprotocols = []\n }\n\n get url() {\n return createWebSocketURL(this._url)\n }\n\n send(data) {\n return this.connection.send(data)\n }\n\n connect() {\n return this.connection.open()\n }\n\n disconnect() {\n return this.connection.close({allowReconnect: false})\n }\n\n ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open()\n }\n }\n\n addSubProtocol(subprotocol) {\n this.subprotocols = [...this.subprotocols, subprotocol]\n }\n}\n\nexport function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url()\n }\n\n if (url && !/^wss?:/i.test(url)) {\n const a = document.createElement(\"a\")\n a.href = url\n // Fix populating Location properties in IE. Otherwise, protocol will be blank.\n a.href = a.href // eslint-disable-line\n a.protocol = a.protocol.replace(\"http\", \"ws\")\n return a.href\n } else {\n return url\n }\n}\n", "import adapters from \"./adapters\"\nimport Connection from \"./connection\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport Consumer, { createWebSocketURL } from \"./consumer\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\nimport Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport Subscriptions from \"./subscriptions\"\n\nexport {\n Connection,\n ConnectionMonitor,\n Consumer,\n INTERNAL,\n Subscription,\n Subscriptions,\n SubscriptionGuarantor,\n adapters,\n createWebSocketURL,\n logger,\n}\n\nexport function createConsumer(url = getConfig(\"url\") || INTERNAL.default_mount_path) {\n return new Consumer(url)\n}\n\nexport function getConfig(name) {\n const element = document.head.querySelector(`meta[name='action-cable-${name}']`)\n if (element) {\n return element.getAttribute(\"content\")\n }\n}\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n", "var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n", "/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n", "var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n", "var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n", "var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n", "var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n", "var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n", "var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n", "var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n", "!/**\n * Highcharts JS v12.6.0 (2026-04-13)\n * @module highcharts/highcharts\n *\n * (c) 2009-2026 Highsoft AS\n *\n * A commercial license may be required depending on use.\n * See www.highcharts.com/license\n */function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?(t._Highcharts=e(),module.exports=t._Highcharts):\"function\"==typeof define&&define.amd?define(\"highcharts/highcharts\",[],e):\"object\"==typeof exports?(t._Highcharts=e(),exports.highcharts=t._Highcharts):(t.Highcharts&&t.Highcharts.error(16,!0),t.Highcharts=e())}(\"u\"(()=>{\"use strict\";let t,e,i,s,o,r;var a,n,h,l,d,c,p,g,u,f,m,x,y,b,v,k,w,M,S,T,C,A,P,L,O,E,I={};I.d=(t,e)=>{for(var i in e)I.o(e,i)&&!I.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},I.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var D={};I.d(D,{default:()=>on}),(a=f||(f={})).SVG_NS=\"http://www.w3.org/2000/svg\",a.product=\"Highcharts\",a.version=\"12.6.0\",a.win=\"u\">typeof window?window:{},a.doc=a.win.document,a.svg=!!a.doc?.createElementNS?.(a.SVG_NS,\"svg\")?.createSVGRect,a.pageLang=a.doc?.documentElement?.closest(\"[lang]\")?.lang,a.userAgent=a.win.navigator?.userAgent||\"\",a.isChrome=a.win.chrome,a.isFirefox=-1!==a.userAgent.indexOf(\"Firefox\"),a.isMS=/(edge|msie|trident)/i.test(a.userAgent)&&!a.win.opera,a.isSafari=!a.isChrome&&-1!==a.userAgent.indexOf(\"Safari\"),a.isTouchDevice=/(Mobile|Android|Windows Phone)/.test(a.userAgent),a.isWebKit=-1!==a.userAgent.indexOf(\"AppleWebKit\"),a.deg2rad=2*Math.PI/360,a.marginNames=[\"plotTop\",\"marginRight\",\"marginBottom\",\"plotLeft\"],a.noop=function(){},a.supportsPassiveEvents=function(){let t=!1;if(!a.isMS){let e=Object.defineProperty({},\"passive\",{get:function(){t=!0}});a.win.addEventListener&&a.win.removeEventListener&&(a.win.addEventListener(\"testPassive\",a.noop,e),a.win.removeEventListener(\"testPassive\",a.noop,e))}return t}(),a.charts=[],a.composed=[],a.dateFormats={},a.seriesTypes={},a.symbolSizes={},a.chartCount=0;let B=f,{doc:N,win:z}=B;function R(t,e,i,s={}){let o=\"function\"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(o,\"hcEvents\")||(o.hcEvents={});let r=o.hcEvents;B.Point&&t instanceof B.Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let a=t.addEventListener;a&&a.call(t,e,i,!!B.supportsPassiveEvents&&{passive:void 0===s.passive?-1!==e.indexOf(\"touch\"):s.passive,capture:!1}),r[e]||(r[e]=[]);let n={fn:i,order:\"number\"==typeof s.order?s.order:1/0};return r[e].push(n),r[e].sort((t,e)=>t.order-e.order),function(){tS(t,e,i)}}function W(t){let e=t.length,i=t[0];for(;e--;)t[e]i&&(i=t[e]);return i}function X(t,e,i){let s,o=td(e)&&!V(i),r=(e,i)=>{V(e)?t.setAttribute(i,e):o?(s=t.getAttribute(i))||\"class\"!==i||(s=t.getAttribute(i+\"Name\")):t.removeAttribute(i)};return td(e)?r(i,e):tm(e,r),s}function G(t,e,i){return t>e?t1e14?t:parseFloat(t.toPrecision(e||14))}function Y(t,e,i,s,o){let r=N.createElement(t);return e&&q(r,e),o&&$(r,{padding:\"0\",border:\"none\",margin:\"0\"}),i&&$(r,i),s&&s.appendChild(r),r}function j(t,e=0,i){let s=e%2/2,o=i?-1:1;return(Math.round(t*o-s)+s)*o}function $(t,e){q(t.style,e)}function V(t){return null!=t}function U(t,e,i){tm(t,function(s,o){s!==e&&s?.destroy&&s.destroy(),(s?.destroy||!i)&&delete t[o]})}function Z(t){t?.parentElement?.removeChild(t)}function _(t,e,i,s){let o={};return!function t(e,o,r,a){let n=i?o:e;tm(e,function(i,h){if(!a&&s&&s.indexOf(h)>-1&&o[h]){i=tT(i),r[h]=[];for(let e=0;et.order-e.order),s.forEach(e=>{!1===e.fn.call(t,i,t)&&i.preventDefault()})}s&&!i.defaultPrevented&&s.call(t,i)}let tt=(t=\"\")=>({center:.5,right:1,middle:.5,bottom:1})[t]||0;function te(t,e){let i,s,o,r,a=!e;return t.forEach(t=>{if(t.length>1)for(r=s=t.length-1;r>0;r--)(o=t[r]-t[r-1])<0&&!a?(e?.(),e=void 0):o&&(void 0===i||o=e-1&&(e=Math.floor(i)),Math.max(0,e-(to(t,\"padding-left\",!0)||0)-(to(t,\"padding-right\",!0)||0))}if(\"height\"===e)return Math.max(0,Math.min(t.offsetHeight,t.scrollHeight)-(to(t,\"padding-top\",!0)||0)-(to(t,\"padding-bottom\",!0)||0));let o=z.getComputedStyle(t,void 0);return o&&(s=o.getPropertyValue(e),tb(i,\"opacity\"!==e)&&(s=tv(s))),s}let tr=Array.prototype.find?function(t,e){return t.find(e)}:function(t,e){let i,s=t.length;for(i=0;i-1/0}function td(t){return\"string\"==typeof t}function tc(t){let e=Object.prototype.toString.call(t);return\"[object Array]\"===e||\"[object Array Iterator]\"===e}function tp(t){return\"function\"==typeof t}function tg(t,e){return!!t&&\"object\"==typeof t&&(!e||!tc(t))}function tu(t,...e){let i,s=[t,...e],o={},r=function(t,e){return\"object\"!=typeof t&&(t={}),tm(e,function(i,s){\"__proto__\"!==s&&\"constructor\"!==s&&(!tg(i,!0)||th(i)||tn(i)?t[s]=e[s]:t[s]=r(t[s]||{},i))}),t};!0===t&&(o=s[1],s=Array.prototype.slice.call(s,2));let a=s.length;for(i=0;i=t))&&(o||!(n<=(e[r]+(e[r+1]||e[r]))/2)));r++);return F(a*i,-Math.round(Math.log(.001)/Math.LN10))}function tm(t,e,i){for(let s in t)Object.hasOwnProperty.call(t,s)&&e.call(i||t[s],t[s],s,t)}function tx(t){let e=N.documentElement,i=t.parentElement||t.parentNode?t.getBoundingClientRect():{top:0,left:0,width:0,height:0};return{top:i.top+(z.pageYOffset||e.scrollTop)-(e.clientTop||0),left:i.left+(z.pageXOffset||e.scrollLeft)-(e.clientLeft||0),width:i.width,height:i.height}}function ty(t,e,i){return Array((e||2)+1-String(t).replace(\"-\",\"\").length).join(i||\"0\")+t}function tb(){let t=arguments,e=t.length;for(let i=0;it.indexOf(e)&&!!t.push(e)}function tw(t,e,i){return/%$/.test(t)?e*parseFloat(t)/100+(i||0):parseFloat(t)}function tM(t,...e){let i,s;do for(s of(i=t,e))t=t.replace(s[0],s[1]);while(t!==i);return t}function tS(t,e,i){function s(e,i){let s=t.removeEventListener;s&&s.call(t,e,i,!1)}function o(i){let o,r;t.nodeName&&(e?(o={})[e]=!0:o=i,tm(o,function(t,e){if(i[e])for(r=i[e].length;r--;)s(e,i[e][r].fn)}))}let r=\"function\"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(r,\"hcEvents\")){let t=r.hcEvents;if(e){let r=t[e]||[];i?(t[e]=r.filter(function(t){return i!==t.fn}),s(e,i)):(o(t),t[e]=[])}else o(t),delete r.hcEvents}}function tT(t){return tc(t)?t:[t]}function tC(t,e){let i,s,o=t.length;for(s=0;s0?setTimeout(t,e,i):(t.call(0,i),-1)}function tP(t){return td(t)?t.substring(0,1).toUpperCase()+t.substring(1):String(t)}let{charts:tL,win:tO}=B;function tE(t,e,i,s){let o=e?\"Highcharts error\":\"Highcharts warning\";32===t&&(t=`${o}: Deprecated member`);let r=tl(t),a=r?`${o} #${t}: www.highcharts.com/errors/${t}/`:t.toString();if(void 0!==s){let t=\"\";r&&(a+=\"?\"),tm(s,function(e,i){t+=`\n - ${i}: ${e}`,r&&(a+=encodeURI(i)+\"=\"+encodeURI(e))}),a+=t}Q(B,\"displayError\",{chart:i,code:t,message:a,params:s},function(){if(e)throw Error(a);tO.console&&-1===tE.messages.indexOf(a)&&console.warn(a)}),tE.messages.push(a)}function tI(t,e){let i,s=t.options.index,o=e.length;for(i=t.options.isInternal?o:0;i0?\"+\":\"\")+e/60),this.variableTimezone=\"UTC\"!==o&&o?.indexOf(\"Etc/GMT\")!==0,this.timezone=o,this.lang&&s&&(this.lang.locale=s),[\"months\",\"shortMonths\",\"weekdays\",\"shortWeekdays\"].forEach(t=>{let e=/months/i.test(t),i=/short/.test(t),s={timeZone:\"UTC\"};s[e?\"month\":\"weekday\"]=i?\"short\":\"long\",this[t]=(e?[0,1,2,3,4,5,6,7,8,9,10,11]:[3,4,5,6,7,8,9]).map(t=>this.dateFormat(s,(e?31:1)*24*36e5*t))})}toParts(t){let[e,i,s,o,r,a,n]=this.dateTimeFormat({weekday:\"narrow\",day:\"numeric\",month:\"numeric\",year:\"numeric\",hour:\"numeric\",minute:\"numeric\",second:\"numeric\"},t,\"es\").split(/(?:, | |\\/|:)/g);return[o,s-1,i,r,a,n,Math.floor(Number(t)||0)%1e3,\"DLMXJVS\".indexOf(e)].map(Number)}dateTimeFormat(t,e,i=this.options.locale||tN){let s=JSON.stringify(t)+i;td(t)&&(t=this.str2dtf(t));let o=this.dTLCache[s];if(!o){t.timeZone??(t.timeZone=this.timezone);try{o=new Intl.DateTimeFormat(i,t)}catch(e){/Invalid time zone/i.test(e.message)?(tE(34),t.timeZone=\"UTC\",o=new Intl.DateTimeFormat(i,t)):tE(e.message,!1)}}return this.dTLCache[s]=o,o?.format(e)||\"\"}str2dtf(t,e={}){let i={L:{fractionalSecondDigits:3},S:{second:\"2-digit\"},M:{minute:\"numeric\"},H:{hour:\"2-digit\"},k:{hour:\"numeric\"},E:{weekday:\"narrow\"},a:{weekday:\"short\"},A:{weekday:\"long\"},d:{day:\"2-digit\"},e:{day:\"numeric\"},b:{month:\"short\"},B:{month:\"long\"},m:{month:\"2-digit\"},o:{month:\"numeric\"},y:{year:\"2-digit\"},Y:{year:\"numeric\"}};return Object.keys(i).forEach(s=>{-1!==t.indexOf(s)&&q(e,i[s])}),e}makeTime(t,e,i=1,s=0,o,r,a){let n=this.Date.UTC(t,e,i,s,o||0,r||0,a||0);if(\"UTC\"!==this.timezone){let t=this.getTimezoneOffset(n);if(n+=t,-1!==[2,3,8,9,10,11].indexOf(e)&&(s<5||s>20)){let e=this.getTimezoneOffset(n);t!==e?n+=e-t:t-36e5!==this.getTimezoneOffset(n-36e5)||tR||(n-=36e5)}}return n}parse(t){if(!td(t))return t??void 0;let e=(t=t.replace(/\\//g,\"-\").replace(/(GMT|UTC)/,\"\")).indexOf(\"Z\")>-1||/([+-][0-9]{2}):?[0-9]{2}$/.test(t),i=/^[0-9]{4}-[0-9]{2}(-[0-9]{2}|)$/.test(t);e||i||(t+=\"Z\");let s=Date.parse(t);if(tl(s))return s+(!e||i?this.getTimezoneOffset(s):0)}getTimezoneOffset(t){if(\"UTC\"!==this.timezone){let[e,i,s,o,r=0]=this.dateTimeFormat({timeZoneName:\"shortOffset\"},t,\"en\").split(/(GMT|:)/).map(Number),a=-(60*(s+r/60)*6e4);if(tl(a))return a}return 0}dateFormat(t,e,i){let s=this.lang;if(!V(e)||isNaN(e))return s?.invalidDate||\"\";if(td(t=t??\"%Y-%m-%d %H:%M:%S\")){let i,o=/%\\[([a-zA-Z]+)\\]/g;for(;i=o.exec(t);)t=t.replace(i[0],this.dateTimeFormat(i[1],e,s?.locale))}if(td(t)&&-1!==t.indexOf(\"%\")){let i=this,[o,r,a,n,h,l,d,c]=this.toParts(e),p=s?.weekdays||this.weekdays,g=s?.shortWeekdays||this.shortWeekdays,u=s?.months||this.months,f=s?.shortMonths||this.shortMonths;tm(q({a:g?g[c]:p[c].substr(0,3),A:p[c],d:ty(a),e:ty(a,2,\" \"),w:c,v:s?.weekFrom??\"\",b:f[r],B:u[r],m:ty(r+1),o:r+1,y:o.toString().substr(2,2),Y:o,H:ty(n),k:n,I:ty(n%12||12),l:n%12||12,M:ty(h),p:n<12?\"AM\":\"PM\",P:n<12?\"am\":\"pm\",S:ty(l),L:ty(d,3)},B.dateFormats),function(s,o){if(td(t))for(;-1!==t.indexOf(\"%\"+o);)t=t.replace(\"%\"+o,\"function\"==typeof s?s.call(i,e,i):s)})}else if(tg(t)){let i=(this.getTimezoneOffset(e)||0)/36e5,s=this.timezone||\"Etc/GMT\"+(i>=0?\"+\":\"\")+i,{prefix:o=\"\",suffix:r=\"\"}=t;t=o+this.dateTimeFormat(q({timeZone:s},t),e)+r}return i?tP(t):t}resolveDTLFormat(t){return tg(t,!0)?tg(t,!0)&&void 0===t.main?{main:t}:t:{main:(t=tT(t))[0],from:t[1],to:t[2]}}getDateFormat(t,e,i,s){let o=this.dateFormat(\"%m-%d %H:%M:%S.%L\",e),r=\"01-01 00:00:00.000\",a={millisecond:15,second:12,minute:9,hour:6,day:3},n=\"millisecond\",h=n;for(n in tD){if(t&&t===tD.week&&+this.dateFormat(\"%w\",e)===i&&o.substr(6)===r.substr(6)){n=\"week\";break}if(t&&tD[n]>t){n=h;break}if(a[n]&&o.substr(a[n])!==r.substr(a[n]))break;\"week\"!==n&&(h=n)}return this.resolveDTLFormat(s[n]).main}},tH=class extends tW{getTimeTicks(t,e,i,s){let o=this,r=[],a={},{count:n=1,unitRange:h}=t,[l,d,c,p,g,u]=o.toParts(e),f=(e||0)%1e3,m;if(s??(s=1),V(e)){if(f=h>=tD.second?0:n*Math.floor(f/n),h>=tD.second&&(u=h>=tD.minute?0:n*Math.floor(u/n)),h>=tD.minute&&(g=h>=tD.hour?0:n*Math.floor(g/n)),h>=tD.hour&&(p=h>=tD.day?0:n*Math.floor(p/n)),h>=tD.day&&(c=h>=tD.month?1:Math.max(1,n*Math.floor(c/n))),h>=tD.month&&(d=h>=tD.year?0:n*Math.floor(d/n)),h>=tD.year&&(l-=l%n),h===tD.week){n&&(e=o.makeTime(l,d,c,p,g,u,f));let t=this.dateTimeFormat({timeZone:this.timezone,weekday:\"narrow\"},e,\"es\"),i=\"DLMXJVS\".indexOf(t);c+=-i+s+(i4*tD.month||o.getTimezoneOffset(e)!==o.getTimezoneOffset(i));let t=e,x=1;for(;t1?t=o.makeTime(l,d,c,p+x*n):t+=h*n,x++;r.push(t),h<=tD.hour&&r.length<1e4&&r.forEach(t=>{t%18e5==0&&\"000000000\"===o.dateFormat(\"%H%M%S%L\",t)&&(a[t]=\"day\")})}return r.info=q(t,{higherRanks:a,totalRange:h*n}),r}},{isTouchDevice:tX}=B,tG={colors:[\"#2caffe\",\"#544fc5\",\"#00e272\",\"#fe6a35\",\"#6b8abc\",\"#d568fb\",\"#2ee0ca\",\"#fa4b42\",\"#feb56a\",\"#91e8e1\"],symbols:[\"circle\",\"diamond\",\"square\",\"triangle\",\"triangle-down\"],lang:{weekFrom:\"week from\",chartTitle:\"Chart title\",locale:void 0,loading:\"Loading...\",months:void 0,seriesName:\"Series {add index 1}\",shortMonths:void 0,weekdays:void 0,numericSymbols:[\"k\",\"M\",\"G\",\"T\",\"P\",\"E\"],pieSliceName:\"Slice\",resetZoom:\"Reset zoom\",yAxisTitle:\"Values\",resetZoomTitle:\"Reset zoom level 1:1\"},global:{buttonTheme:{fill:\"#f7f7f7\",padding:8,r:2,stroke:\"#cccccc\",\"stroke-width\":1,style:{color:\"#333333\",cursor:\"pointer\",fontSize:\"0.8em\",fontWeight:\"normal\"},states:{hover:{fill:\"#e6e6e6\"},select:{fill:\"#e6e9ff\",style:{color:\"#000000\",fontWeight:\"bold\"}},disabled:{style:{color:\"#cccccc\"}}}}},time:{Date:void 0,timezone:\"UTC\",timezoneOffset:0,useUTC:void 0},chart:{alignThresholds:!1,panning:{enabled:!1,type:\"x\"},styledMode:!1,borderRadius:0,colorCount:10,allowMutatingData:!0,ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{},position:{}},reflow:!0,type:\"line\",zooming:{singleTouch:!1,resetButton:{theme:{zIndex:6},position:{align:\"right\",x:-10,y:10}}},width:null,height:null,borderColor:\"#334eff\",backgroundColor:\"#ffffff\",plotBorderColor:\"#cccccc\"},title:{style:{color:\"#333333\",fontWeight:\"bold\"},text:\"Chart title\",margin:15,minScale:.67},subtitle:{style:{color:\"#666666\",fontSize:\"0.8em\"},text:\"\"},caption:{margin:15,style:{color:\"#666666\",fontSize:\"0.8em\"},text:\"\",align:\"left\",verticalAlign:\"bottom\"},plotOptions:{},legend:{enabled:!0,align:\"center\",alignColumns:!0,className:\"highcharts-no-tooltip\",events:{},layout:\"horizontal\",itemMarginBottom:2,itemMarginTop:2,labelFormatter:function(){return this.name},borderColor:\"#999999\",borderRadius:0,navigation:{style:{fontSize:\"0.8em\"},activeColor:\"#0022ff\",inactiveColor:\"#cccccc\"},itemStyle:{color:\"#333333\",cursor:\"pointer\",fontSize:\"0.8em\",textDecoration:\"none\",textOverflow:\"ellipsis\"},itemHoverStyle:{color:\"#000000\"},itemHiddenStyle:{color:\"#666666\",textDecoration:\"line-through\"},shadow:!1,itemCheckboxStyle:{position:\"absolute\",width:\"13px\",height:\"13px\"},squareSymbol:!0,symbolPadding:5,verticalAlign:\"bottom\",x:0,y:0,title:{style:{color:\"#333333\",fontSize:\"0.8em\",fontWeight:\"bold\"}}},loading:{labelStyle:{fontWeight:\"bold\",position:\"relative\",top:\"45%\"},style:{position:\"absolute\",backgroundColor:\"#ffffff\",opacity:.5,textAlign:\"center\"}},tooltip:{enabled:!0,animation:{duration:300,easing:t=>Math.sqrt(1-Math.pow(t-1,2))},borderRadius:3,dateTimeLabelFormats:{millisecond:\"%[AebHMSL]\",second:\"%[AebHMS]\",minute:\"%[AebHM]\",hour:\"%[AebHM]\",day:\"%[AebY]\",week:\"%v %[AebY]\",month:\"%[BY]\",year:\"%Y\"},footerFormat:\"\",headerShape:\"callout\",hideDelay:500,showDelay:0,padding:8,position:{x:0,y:3},shared:!1,snap:tX?25:10,headerFormat:'{ucfirst point.key}
',pointFormat:'\u25CF {series.name}: {point.y}
',backgroundColor:\"#ffffff\",borderWidth:void 0,stickOnContact:!1,style:{color:\"#333333\",cursor:\"default\",fontSize:\"0.8em\"},useHTML:!1},credits:{enabled:!0,href:\"https://www.highcharts.com?credits\",position:{align:\"right\",x:-10,verticalAlign:\"bottom\",y:-5},style:{cursor:\"pointer\",color:\"#999999\",fontSize:\"0.6em\"},text:\"Highcharts.com\"}},tF=new tH(tG.time,tG.lang),tY={defaultOptions:tG,defaultTime:tF,getOptions:function(){return tG},setOptions:function(t){return Q(B,\"setOptions\",{options:t}),tu(!0,tG,t),t.time&&tF.update(tG.time),t.lang&&\"locale\"in t.lang&&tF.update({locale:t.lang.locale}),t.lang?.chartTitle&&(tG.title={...tG.title,text:t.lang.chartTitle}),tG}},{win:tj}=B,t$=(t,e,i)=>`color-mix(in srgb,${t},${e} ${100*i}%)`,tV=t=>td(t)&&!!t&&\"none\"!==t;class tU{static parse(t){return t?new tU(t):tU.None}constructor(t){let e,i,s,o;this.rgba=[NaN,NaN,NaN,NaN],this.input=t;const r=B.Color;if(r&&r!==tU)return new r(t);if(\"object\"==typeof t&&void 0!==t.stops)this.stops=t.stops.map(t=>new tU(t[1]));else if(\"string\"==typeof t)for(this.input=t=tU.names[t.toLowerCase()]||t,s=tU.parsers.length;s--&&!i;)(e=(o=tU.parsers[s]).regex.exec(t))&&(i=o.parse(e));i&&(this.rgba=i)}get(t){let e=this.input,i=this.rgba;if(this.output)return this.output;if(\"object\"==typeof e&&void 0!==this.stops){let i=tu(e);return i.stops=[].slice.call(i.stops),this.stops.forEach((e,s)=>{i.stops[s]=[i.stops[s][0],e.get(t)]}),i}return i&&tl(i[0])?\"rgb\"!==t&&(t||1!==i[3])?\"a\"===t?`${i[3]}`:\"rgba(\"+i.join(\",\")+\")\":\"rgb(\"+i[0]+\",\"+i[1]+\",\"+i[2]+\")\":e}brighten(t){let e=this.rgba;if(this.stops)this.stops.forEach(function(e){e.brighten(t)});else if(tl(t)&&0!==t)if(tl(e[0]))for(let i=0;i<3;i++)e[i]+=tv(255*t),e[i]<0&&(e[i]=0),e[i]>255&&(e[i]=255);else tU.useColorMix&&tV(this.input)&&(this.output=t$(this.input,t>0?\"white\":\"black\",Math.abs(t)));return this}setOpacity(t){return this.rgba[3]=t,this}tweenTo(t,e){let i=this.rgba,s=t.rgba;if(!tl(i[0])||!tl(s[0]))return tU.useColorMix&&tV(this.input)&&tV(t.input)&&e<.99?t$(this.input,t.input,e):t.input||\"none\";let o=1!==s[3]||1!==i[3],r=(t,s)=>t+(i[s]-t)*(1-e),a=s.slice(0,3).map(r).map(Math.round);return o&&a.push(r(s[3],3)),(o?\"rgba(\":\"rgb(\")+a.join(\",\")+\")\"}}tU.names={white:\"#ffffff\",black:\"#000000\"},tU.parsers=[{regex:/rgba\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d?(?:\\.\\d+)?)\\s*\\)/,parse:function(t){return[tv(t[1]),tv(t[2]),tv(t[3]),parseFloat(t[4],10)]}},{regex:/rgb\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*\\)/,parse:function(t){return[tv(t[1]),tv(t[2]),tv(t[3]),1]}},{regex:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?$/i,parse:function(t){return[tv(t[1]+t[1],16),tv(t[2]+t[2],16),tv(t[3]+t[3],16),V(t[4])?tv(t[4]+t[4],16)/255:1]}},{regex:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?$/i,parse:function(t){return[tv(t[1],16),tv(t[2],16),tv(t[3],16),V(t[4])?tv(t[4],16)/255:1]}}],tU.useColorMix=tj.CSS?.supports(\"color\",\"color-mix(in srgb,red,blue 9%)\"),tU.None=new tU(\"\");let{parse:tZ}=tU,{win:t_}=B;class tK{constructor(t,e,i){this.pos=NaN,this.options=e,this.elem=t,this.prop=i}dSetter(){let t=this.paths,e=t?.[0],i=t?.[1],s=this.now||0,o=[];if(1!==s&&e&&i)if(e.length===i.length&&s<1)for(let t=0;t=n+this.startTime?(this.now=this.end,this.pos=1,this.update(),h[this.prop]=!0,i=!0,tm(h,function(t){!0!==t&&(i=!1)}),i&&a&&a.call(r),e=!1):(this.pos=o.easing((s-this.startTime)/n),this.now=this.start+(this.end-this.start)*this.pos,this.update(),e=!0),e}initPath(t,e,i){let s=t.startX,o=t.endX,r=i.slice(),a=t.isArea,n=a?2:1,h=e&&i.length>e.length&&i.hasStackedCliffs,l,d,c,p,g=e?.slice();if(!g||h)return[r,r];function u(t,e){for(;t.length{let i=tq(t.options.animation);r=tg(e)&&V(e.defer)?s.defer:Math.max(r,i.duration+i.defer),a=Math.min(s.duration,i.duration)}),t.renderer.forExport&&(r=0),{defer:Math.max(0,r-a),duration:Math.min(r,a)}},setAnimation:function(t,e){e.renderer.globalAnimation=tb(t,e.options.chart.animation,!0)},stop:tJ},{SVG_NS:t0,win:t1}=B,{trustedTypes:t2}=t1,t3=t2&&tp(t2.createPolicy)&&t2.createPolicy(\"highcharts\",{createHTML:t=>t}),t5=t3?t3.createHTML(\"\"):\"\";class t6{static filterUserAttributes(t){return tm(t,(e,i)=>{let s=!0;-1===t6.allowedAttributes.indexOf(i)&&(s=!1),-1!==[\"background\",\"dynsrc\",\"href\",\"lowsrc\",\"src\"].indexOf(i)&&(s=td(e)&&t6.allowedReferences.some(t=>0===e.indexOf(t))),s||(tE(33,!1,void 0,{\"Invalid attribute in config\":`${i}`}),delete t[i]),td(e)&&t[i]&&(t[i]=e.replace(/{let i=e.split(\":\").map(t=>t.trim()),s=i.shift();return s&&i.length&&(t[s.replace(/-([a-z])/g,t=>t[1].toUpperCase())]=i.join(\":\")),t},{})}static setElementHTML(t,e){t.innerHTML=t6.emptyHTML,e&&new t6(e).addToDOM(t)}constructor(t){this.nodes=\"string\"==typeof t?this.parseMarkup(t):t}addToDOM(t){return function t(e,i){let s;return tT(e).forEach(function(e){let o,r=e.tagName,a=e.textContent?B.doc.createTextNode(e.textContent):void 0,n=t6.bypassHTMLFiltering;if(r)if(\"#text\"===r)o=a;else if(-1!==t6.allowedTags.indexOf(r)||n){let s=\"svg\"===r?t0:i.namespaceURI||t0,h=B.doc.createElementNS(s,r),l=e.attributes||{};tm(e,function(t,e){\"tagName\"!==e&&\"attributes\"!==e&&\"children\"!==e&&\"style\"!==e&&\"textContent\"!==e&&(l[e]=t)}),X(h,n?l:t6.filterUserAttributes(l)),e.style&&$(h,e.style),a&&h.appendChild(a),t(e.children||[],h),o=h}else tE(33,!1,void 0,{\"Invalid tagName in config\":r});o&&i.appendChild(o),s=o}),s}(this.nodes,t)}parseMarkup(t){let e,i=[];t=t.trim().replace(/ style=([\"'])/g,\" data-style=$1\");try{e=new DOMParser().parseFromString(t3?t3.createHTML(t):t,\"text/html\")}catch{}if(!e){let i=Y(\"div\");i.innerHTML=t,e={body:i}}let s=(t,e)=>{let i=t.nodeName.toLowerCase(),o={tagName:i};\"#text\"===i&&(o.textContent=t.textContent||\"\");let r=t.attributes;if(r){let t={};[].forEach.call(r,e=>{\"data-style\"===e.name?o.style=t6.parseStyle(e.value):t[e.name]=e.value}),o.attributes=t}if(t.childNodes.length){let e=[];[].forEach.call(t.childNodes,t=>{s(t,e)}),e.length&&(o.children=e)}e.push(o)};return[].forEach.call(e.body.childNodes,t=>s(t,i)),i}}t6.allowedAttributes=[\"alt\",\"aria-controls\",\"aria-describedby\",\"aria-expanded\",\"aria-haspopup\",\"aria-hidden\",\"aria-label\",\"aria-labelledby\",\"aria-live\",\"aria-pressed\",\"aria-readonly\",\"aria-roledescription\",\"aria-selected\",\"class\",\"clip-path\",\"color\",\"colspan\",\"cx\",\"cy\",\"d\",\"disabled\",\"dx\",\"dy\",\"fill\",\"filterUnits\",\"flood-color\",\"flood-opacity\",\"height\",\"href\",\"id\",\"in\",\"in2\",\"markerHeight\",\"markerWidth\",\"offset\",\"opacity\",\"operator\",\"orient\",\"padding\",\"paddingLeft\",\"paddingRight\",\"patternUnits\",\"r\",\"radius\",\"refX\",\"refY\",\"result\",\"role\",\"rowspan\",\"scope\",\"slope\",\"src\",\"startOffset\",\"stdDeviation\",\"stroke-linecap\",\"stroke-width\",\"stroke\",\"style\",\"summary\",\"tabindex\",\"tableValues\",\"target\",\"text-align\",\"text-anchor\",\"textAnchor\",\"textLength\",\"title\",\"type\",\"valign\",\"width\",\"x\",\"x1\",\"x2\",\"xlink:href\",\"y\",\"y1\",\"y2\",\"zIndex\"],t6.allowedReferences=[\"https://\",\"http://\",\"mailto:\",\"/\",\"../\",\"./\",\"#\"],t6.allowedTags=[\"#text\",\"a\",\"abbr\",\"b\",\"br\",\"button\",\"caption\",\"circle\",\"clipPath\",\"code\",\"dd\",\"defs\",\"div\",\"dl\",\"dt\",\"em\",\"feComponentTransfer\",\"feComposite\",\"feDropShadow\",\"feFlood\",\"feFuncA\",\"feFuncB\",\"feFuncG\",\"feFuncR\",\"feGaussianBlur\",\"feMerge\",\"feMergeNode\",\"feMorphology\",\"feOffset\",\"filter\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"hr\",\"i\",\"img\",\"li\",\"linearGradient\",\"marker\",\"ol\",\"p\",\"path\",\"pattern\",\"pre\",\"rect\",\"small\",\"span\",\"stop\",\"strong\",\"style\",\"sub\",\"sup\",\"svg\",\"table\",\"tbody\",\"td\",\"text\",\"textPath\",\"th\",\"thead\",\"title\",\"tr\",\"tspan\",\"u\",\"ul\"],t6.emptyHTML=t5,t6.bypassHTMLFiltering=!1;let{defaultOptions:t9,defaultTime:t4}=tY,{pageLang:t8}=B,t7={add:(t,e)=>t+e,divide:(t,e)=>0!==e?t/e:\"\",eq:(t,e)=>t==e,each:function(t){let e=arguments[arguments.length-1];return!!tc(t)&&t.map((i,s)=>ee(e.body,q(tg(i)?i:{\"@this\":i},{\"@index\":s,\"@first\":0===s,\"@last\":s===t.length-1}))).join(\"\")},ge:(t,e)=>t>=e,gt:(t,e)=>t>e,if:t=>!!t,le:(t,e)=>t<=e,lt:(t,e)=>tt*e,ne:(t,e)=>t!=e,subtract:(t,e)=>t-e,ucfirst:tP,unless:t=>!t},et={};function ee(t=\"\",e,i){let s=RegExp(\"\\\\{([\\\\p{L}\\\\p{M}\\\\d:\\\\.,;\\\\-\\\\/<>\\\\[\\\\]%_@+\\\"'\u2019= #\\\\(\\\\)]+)\\\\}\",\"gu\"),o=RegExp(\"\\\\(([\\\\p{L}\\\\p{M}\\\\d:\\\\.,;\\\\-\\\\/<>\\\\[\\\\]%_@+\\\"'= ]+)\\\\)\",\"gu\"),r=[],a=/f$/,n=/\\.(\\d)/,h=i?.options?.lang||t9.lang,l=i?.time||t4,d=i?.numberFormatter||ei.bind(i),c=(t=\"\")=>{let i;return\"true\"===t||\"false\"!==t&&((i=Number(t)).toString()===t?i:/^[\"'].+[\"']$/.test(t)?t.slice(1,-1):ts(t,e))},p,g,u=0,f;for(;null!==(p=s.exec(t));){let i=p,s=o.exec(p[1]);s&&(p=s,f=!0),g?.isBlock||(g={ctx:e,expression:p[1],find:p[0],isBlock:\"#\"===p[1].charAt(0),start:p.index,startInner:p.index+p[0].length,length:p[0].length});let a=(g.isBlock?i:p)[1].split(\" \")[0].replace(\"#\",\"\");t7[a]&&(g.isBlock&&a===g.fn&&u++,g.fn||(g.fn=a));let n=\"else\"===p[1];if(g.isBlock&&g.fn&&(p[1]===`/${g.fn}`||n))if(u)!n&&u--;else{let e=g.startInner,i=t.substr(e,p.index-e);void 0===g.body?(g.body=i,g.startInner=p.index+p[0].length):g.elseBody=i,g.find+=i+p[0],n||(r.push(g),g=void 0)}else g.isBlock||r.push(g);if(s&&!g?.isBlock)break}return r.forEach(s=>{let r,p,{body:g,elseBody:u,expression:f,fn:m}=s;if(m){let t=[s],o=[],a=f.length,n=0,h;for(p=0;p<=a;p++){let t=f.charAt(p);h||'\"'!==t&&\"'\"!==t?h===t&&(h=\"\"):h=t,h||\" \"!==t&&p!==a||(o.push(f.substr(n,p-n)),n=p+1)}for(p=t7[m].length;p--;)t.unshift(c(o[p+1]));r=t7[m].apply(e,t),s.isBlock&&\"boolean\"==typeof r&&(r=ee(r?g:u,e,i))}else{let t=/^[\"'].+[\"']$/.test(f)?[f]:f.split(\":\");if(r=c(t.shift()||\"\"),t.length&&\"number\"==typeof r){let e=t.join(\":\");if(a.test(e)){let t=parseInt((e.match(n)||[\"\",\"-1\"])[1],10);null!==r&&(r=d(r,t,h.decimalPoint,e.indexOf(\",\")>-1?h.thousandsSep:\"\"))}else r=l.dateFormat(e,r)}o.lastIndex=0,o.test(s.find)&&td(r)&&(r=`\"${r}\"`)}t=t.replace(s.find,tb(r,\"\"))}),f?ee(t,e,i):t}function ei(t,e,i,s){e*=1;let o,r,[a,n]=(t=+t||0).toString().split(\"e\").map(Number),h=this?.options?.lang||t9.lang,l=(t.toString().split(\".\")[1]||\"\").split(\"e\")[0].length,d=e,c={};i??(i=h.decimalPoint),s??(s=h.thousandsSep),-1===e?e=Math.min(l,20):tl(e)?e&&n<0&&((r=e+n)>=0?(a=+a.toExponential(r).split(\"e\")[0],e=r):(a=Math.floor(a),t=e<20?+(a*Math.pow(10,n)).toFixed(e):0,n=0)):e=2,n&&(e??(e=2),t=a),tl(e)&&e>=0&&(c.minimumFractionDigits=e,c.maximumFractionDigits=e),\"\"===s&&(c.useGrouping=!1);let p=s||i,g=p?\"en\":this?.locale||h.locale||t8,u=JSON.stringify(c)+g;return o=(et[u]??(et[u]=new Intl.NumberFormat(g,c))).format(t),p&&(o=o.replace(/([,\\.])/g,\"_$1\").replace(/_\\,/g,s??\",\").replace(\"_.\",i??\".\")),(e||0!=+o)&&(!(n<0)||d)||(o=\"0\"),n&&0!=+o&&(o+=\"e\"+(n<0?\"\":\"+\")+n),o}let es={dateFormat:function(t,e,i){return t4.dateFormat(t,e,i)},format:ee,helpers:t7,numberFormat:ei};(n=m||(m={})).rendererTypes={},n.getRendererType=function(t=o){return n.rendererTypes[t]||n.rendererTypes[o]},n.registerRendererType=function(t,e,i){n.rendererTypes[t]=e,(!o||i)&&(o=t,B.Renderer=e)};let eo=m;(x||(x={})).distribute=function t(e,i,s){let o=e,r=o.reducedLen||i,a=(t,e)=>t.target-e.target,n=[],h=e.length,l=[],d=n.push,c,p=!0,g,u,f=0;for(c=h;c--;)f+=e[c].size;if(f>r){if(tC(e,(t,e)=>(e.rank||0)-(t.rank||0)),e[0].rank===e[e.length-1].rank){let t=[[0,h-1]];for(;t.length&&f>r;){let i=t.shift();if(!i)break;g=e[c=Math.floor((i[0]+i[1])/2)],tk(l,c)&&(f-=g.size),i[0]r&&c>=0;)g=e[c],tk(l,c)&&(f-=g.size),c--;l.sort((t,e)=>e-t).forEach(t=>d.apply(n,e.splice(t,1)))}for(tC(e,a),e=e.map(t=>({size:t.size,targets:[t.target],align:tb(t.align,.5)}));p;){for(c=e.length;c--;)g=e[c],u=(Math.min.apply(0,g.targets)+Math.max.apply(0,g.targets))/2,g.pos=G(u-g.size*g.align,0,i-g.size);for(c=e.length,p=!1;c--;)c>0&&e[c-1].pos+e[c-1].size>e[c].pos&&(e[c-1].size+=e[c].size,e[c-1].targets=e[c-1].targets.concat(e[c].targets),e[c-1].align=.5,e[c-1].pos+e[c-1].size>i&&(e[c-1].pos=i-e[c-1].size),e.splice(c,1),p=!0)}return d.apply(o,n),c=0,e.some(e=>{let r=0;return(e.targets||[]).some(()=>(o[c].pos=e.pos+r,void 0!==s&&Math.abs(o[c].pos-o[c].target)>s)?(o.slice(0,c+1).forEach(t=>delete t.pos),o.reducedLen=(o.reducedLen||i)-.1*i,o.reducedLen>.1*i&&t(o,i,s),!0):(r+=o[c].size,c++,!1))}),tC(o,a),o};let er=x,{animate:ea,animObject:en,stop:eh}=tQ,{deg2rad:el,doc:ed,svg:ec,SVG_NS:ep,win:eg,isFirefox:eu}=B;class ef{_defaultGetter(t){let e=tb(this[t+\"Value\"],this[t],this.element?this.element.getAttribute(t):null,0);return/^-?[\\d\\.]+$/.test(e)&&(e=parseFloat(e)),e}_defaultSetter(t,e,i){i.setAttribute(e,t)}add(t){let e,i=this.renderer,s=this.element;return t&&(this.parentGroup=t),void 0!==this.textStr&&\"text\"===this.element.nodeName&&i.buildText(this),this.added=!0,(!t||t.handleZ||this.zIndex)&&(e=this.zIndexSetter()),e||(t?t.element:i.box).appendChild(s),this.onAdd&&this.onAdd(),this}addClass(t,e){let i=e?\"\":this.attr(\"class\")||\"\";return(t=(t||\"\").split(/ /g).reduce(function(t,e){return -1===i.indexOf(e)&&t.push(e),t},i?[i]:[]).join(\" \"))!==i&&this.attr(\"class\",t),this}afterSetters(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)}align(t,e,i,s=!0){let o=this.renderer,r=o.alignedObjects,a=!!t;t?(this.alignOptions=t,this.alignByTranslate=e,this.alignTo=i):(t=this.alignOptions||{},e=this.alignByTranslate,i=this.alignTo);let n=!i||td(i)?i||\"renderer\":void 0;n&&(a&&tk(r,this),i=void 0);let h=tb(i,o[n],o),l=(h.x||0)+(t.x||0)+((h.width||0)-(t.width||0))*tt(t.align),d=(h.y||0)+(t.y||0)+((h.height||0)-(t.height||0))*tt(t.verticalAlign),c={};return t.align&&(c[\"text-align\"]=t.align),c[e?\"translateX\":\"x\"]=Math.round(l),c[e?\"translateY\":\"y\"]=Math.round(d),s&&(this[this.placed?\"animate\":\"attr\"](c),this.placed=!0),this.alignAttr=c,this}alignSetter(t){let e={left:\"start\",center:\"middle\",right:\"end\"};e[t]&&(this.alignValue=t,this.element.setAttribute(\"text-anchor\",e[t]))}animate(t,e,i){let s=en(tb(e,this.renderer.globalAnimation,!0)),o=s.defer;return ed.hidden&&(s.duration=0),0!==s.duration?(i&&(s.complete=i),tA(()=>{this.element&&ea(this,t,s)},o)):(this.attr(t,void 0,i||s.complete),tm(t,function(t,e){s.step&&s.step.call(this,t,{prop:e,pos:1,elem:this})},this)),this}applyTextOutline(t){let e=this.element;-1!==t.indexOf(\"contrast\")&&(t=t.replace(/contrast/g,this.renderer.getContrast(e.style.fill)));let i=t.indexOf(\" \"),s=t.substring(i+1),o=t.substring(0,i);if(o&&\"none\"!==o&&B.svg){this.fakeTS=!0,o=o.replace(/(^[\\d\\.]+)(.*?)$/g,function(t,e,i){return 2*Number(e)+i}),this.removeTextOutline();let t=ed.createElementNS(ep,\"tspan\");X(t,{class:\"highcharts-text-outline\",fill:s,stroke:s,\"stroke-width\":o,\"stroke-linejoin\":\"round\"});let i=e.querySelector(\"textPath\")||e;[].forEach.call(i.childNodes,e=>{let i=e.cloneNode(!0);i.removeAttribute&&[\"fill\",\"stroke\",\"stroke-width\",\"stroke\"].forEach(t=>i.removeAttribute(t)),t.appendChild(i)});let r=0;[].forEach.call(i.querySelectorAll(\"text tspan\"),t=>{r+=Number(t.getAttribute(\"dy\"))});let a=ed.createElementNS(ep,\"tspan\");a.textContent=\"\u200B\",X(a,{x:Number(e.getAttribute(\"x\")),dy:-r}),t.appendChild(a),i.insertBefore(t,i.firstChild)}}attr(t,e,i,s){let{element:o}=this,r=ef.symbolCustomAttribs,a,n,h=this,l;return\"string\"==typeof t&&void 0!==e&&(a=t,(t={})[a]=e),\"string\"==typeof t?h=(this[t+\"Getter\"]||this._defaultGetter).call(this,t,o):(tm(t,function(e,i){l=!1,s||eh(this,i),this.symbolName&&-1!==r.indexOf(i)&&(n||(this.symbolAttr(t),n=!0),l=!0),this.rotation&&(\"x\"===i||\"y\"===i)&&(this.doTransform=!0),l||(this[i+\"Setter\"]||this._defaultSetter).call(this,e,i,o)},this),this.afterSetters()),i&&i.call(this),h}clip(t){if(t&&!t.clipPath){let e=tB()+\"-\",i=this.renderer.createElement(\"clipPath\").attr({id:e}).add(this.renderer.defs);q(t,{clipPath:i,id:e,count:0}),t.add(i)}return this.attr(\"clip-path\",t?`url(${this.renderer.url}#${t.id})`:\"none\")}crisp(t,e){e=Math.round(e||t.strokeWidth||0);let i=t.x||this.x||0,s=t.y||this.y||0,o=(t.width||this.width||0)+i,r=(t.height||this.height||0)+s,a=j(i,e),n=j(s,e);return q(t,{x:a,y:n,width:j(o,e)-a,height:j(r,e)-n}),V(t.strokeWidth)&&(t.strokeWidth=e),t}complexColor(t,e,i){let s=this.renderer,o,r,a,n,h,l,d,c,p,g,u=[],f;Q(this.renderer,\"complexColor\",{args:arguments},function(){if(t.radialGradient?r=\"radialGradient\":t.linearGradient&&(r=\"linearGradient\"),r){if(a=t[r],h=s.gradients,l=t.stops,p=i.radialReference,tc(a)&&(t[r]=a={x1:a[0],y1:a[1],x2:a[2],y2:a[3],gradientUnits:\"userSpaceOnUse\"}),\"radialGradient\"===r&&p&&!V(a.gradientUnits)&&(n=a,a=tu(a,s.getRadialAttr(p,n),{gradientUnits:\"userSpaceOnUse\"})),tm(a,function(t,e){\"id\"!==e&&u.push(e,t)}),tm(l,function(t){u.push(t)}),h[u=u.join(\",\")])g=h[u].attr(\"id\");else{a.id=g=tB();let t=h[u]=s.createElement(r).attr(a).add(s.defs);t.radAttr=n,t.stops=[],l.forEach(function(e){0===e[1].indexOf(\"rgba\")?(d=(o=tU.parse(e[1])).get(\"rgb\"),c=o.get(\"a\")):(d=e[1],c=1);let i=s.createElement(\"stop\").attr({offset:e[0],\"stop-color\":d,\"stop-opacity\":c}).add(t);t.stops.push(i)})}f=\"url(\"+s.url+\"#\"+g+\")\",i.setAttribute(e,f),i.gradient=u,t.toString=function(){return f}}})}css(t){let e=this.styles,i={},s=this.element,o,r=!e;if(e&&tm(t,function(t,s){e&&e[s]!==t&&(i[s]=t,r=!0)}),r){e&&(t=q(e,i)),null===t.width||\"auto\"===t.width?delete this.textWidth:\"text\"===s.nodeName.toLowerCase()&&t.width&&(o=this.textWidth=tv(t.width)),q(this.styles,t),o&&!ec&&this.renderer.forExport&&delete t.width;let r=eu&&t.fontSize||null;r&&(tl(r)||/^\\d+$/.test(r))&&(t.fontSize+=\"px\");let a=tu(t);s.namespaceURI===this.SVG_NS&&([\"textOutline\",\"textOverflow\",\"whiteSpace\",\"width\"].forEach(t=>a&&delete a[t]),a.color&&(a.fill=a.color,delete a.color)),$(s,a)}return this.added&&(\"text\"===this.element.nodeName&&this.renderer.buildText(this),t.textOutline&&this.applyTextOutline(t.textOutline)),this}dashstyleSetter(t){let e,i=this[\"stroke-width\"];if(\"inherit\"===i&&(i=1),t){let s=(t=t.toLowerCase()).replace(\"shortdashdotdot\",\"3,1,1,1,1,1,\").replace(\"shortdashdot\",\"3,1,1,1\").replace(\"shortdot\",\"1,1,\").replace(\"shortdash\",\"3,1,\").replace(\"longdash\",\"8,3,\").replace(/dot/g,\"1,3,\").replace(\"dash\",\"4,3,\").replace(/,$/,\"\").split(\",\");for(e=s.length;e--;)s[e]=\"\"+tv(s[e])*tb(i,NaN);t=s.join(\",\").replace(/NaN/g,\"none\"),this.element.setAttribute(\"stroke-dasharray\",t)}}destroy(){let t=this,{element:e={},renderer:i,stops:s}=t,o=e.ownerSVGElement,r=\"SPAN\"===e.nodeName&&t.parentGroup||void 0,a;if(e.onclick=e.onmouseout=e.onmouseover=e.onmousemove=e.point=null,eh(t),t.clipPath&&o){let e=t.clipPath;[].forEach.call(o.querySelectorAll(\"[clip-path],[CLIP-PATH]\"),function(t){t.getAttribute(\"clip-path\").indexOf(e.element.id)>-1&&t.removeAttribute(\"clip-path\")}),t.clipPath=e.destroy()}if(s){for(let t of s)t.destroy();s.length=0}for(t.safeRemoveChild(e);r?.div&&0===r.div.childNodes.length;)a=r.parentGroup,t.safeRemoveChild(r.div),delete r.div,r=a;t.alignOptions&&K(i.alignedObjects,t),tm(t,(e,i)=>{(t[i]?.parentGroup===t||-1!==[\"connector\",\"foreignObject\"].indexOf(i))&&t[i]?.destroy?.(),delete t[i]})}dSetter(t,e,i){tc(t)&&(\"string\"==typeof t[0]&&(t=this.renderer.pathToSegments(t)),this.pathArray=t,t=t.reduce((t,e,i)=>e?.join?(i?t+\" \":\"\")+e.join(\" \"):(e||\"\").toString(),\"\")),/(NaN| {2}|^$)/.test(t)&&(t=\"M 0 0\"),this[e]!==t&&(i.setAttribute(e,t),this[e]=t)}fillSetter(t,e,i){\"string\"==typeof t?i.setAttribute(e,t):t&&this.complexColor(t,e,i)}hrefSetter(t,e,i){i.setAttributeNS(\"http://www.w3.org/1999/xlink\",e,t)}getBBox(t,e){let i,s,o,{element:r,renderer:a,styles:n,textStr:h}=this,{cache:l,cacheKeys:d}=a,c=r.namespaceURI===this.SVG_NS,p=tb(e,this.rotation,0),g=a.styledMode?r&&ef.prototype.getStyle.call(r,\"font-size\"):n.fontSize,u=this.getBBoxCacheKey([a.rootFontSize,this.textWidth,this.alignValue,n.fontWeight,n.lineClamp,n.textOverflow,g,p]);if(u&&!t&&(i=l[u]),!i||i.polygon){if(c||a.forExport){try{o=this.fakeTS&&function(t){let e=r.querySelector(\".highcharts-text-outline\");e&&$(e,{display:t})},tp(o)&&o(\"none\"),i=r.getBBox?q({},r.getBBox()):{width:r.offsetWidth,height:r.offsetHeight,x:0,y:0},tp(o)&&o(\"\")}catch{}(!i||i.width<0)&&(i={x:0,y:0,width:0,height:0})}else i=this.htmlGetBBox();s=i.height,c&&(i.height=s=({\"11px,17\":14,\"13px,20\":16})[`${g||\"\"},${Math.round(s)}`]||s),p&&(i=this.getRotatedBox(i,p));let t={bBox:i};Q(this,\"afterGetBBox\",t),i=t.bBox}if(u&&(\"\"===h||i.height>0)){for(;d.length>250;)delete l[d.shift()];l[u]||d.push(u),l[u]=i}return i}getBBoxCacheKey(t){if(V(this.textStr)){let e=\"\"+this.textStr;return -1===e.indexOf(\"<\")&&(e=e.replace(/\\d/g,\"0\")),[e,...t].join(\",\")}}getRotatedBox(t,e){let{x:i,y:s,width:o,height:r}=t,{alignValue:a,translateY:n,rotationOriginX:h=0,rotationOriginY:l=0}=this,d=tt(a),c=Number(this.element.getAttribute(\"y\")||0)-(n?0:s),p=e*el,g=(e-90)*el,u=Math.cos(p),f=Math.sin(p),m=o*u,x=o*f,y=Math.cos(g),b=Math.sin(g),[[v,k],[w,M]]=[h,l].map(t=>[t-t*u,t*f]),S=i+d*(o-m)+v+M+c*y,T=S+m,C=T-r*y,A=C-m,P=s+c-d*x-k+w+c*b,L=P+x,O=L-r*b,E=O-x,I=Math.min(S,T,C,A),D=Math.min(P,L,O,E),B=Math.max(S,T,C,A)-I,N=Math.max(P,L,O,E)-D;return{x:I,y:D,width:B,height:N,polygon:[[S,P],[T,L],[C,O],[A,E]]}}getStyle(t){return eg.getComputedStyle(this.element||this,\"\").getPropertyValue(t)}hasClass(t){return -1!==(\"\"+this.attr(\"class\")).split(\" \").indexOf(t)}hide(){return this.attr({visibility:\"hidden\"})}htmlGetBBox(){return{height:0,width:0,x:0,y:0}}constructor(t,e){this.onEvents={},this.opacity=1,this.SVG_NS=ep,this.element=\"span\"===e||\"body\"===e?Y(e):ed.createElementNS(this.SVG_NS,e),this.renderer=t,this.styles={},Q(this,\"afterInit\")}on(t,e){let{onEvents:i}=this;return i[t]&&i[t](),i[t]=R(this.element,t,e),this}opacitySetter(t,e,i){let s=Number(Number(t).toFixed(3));this.opacity=s,i.setAttribute(e,s)}reAlign(){this.alignOptions?.width&&\"left\"!==this.alignOptions.align&&(this.alignOptions.width=this.getBBox().width,this.placed=!1,this.align())}removeClass(t){return this.attr(\"class\",(\"\"+this.attr(\"class\")).replace(td(t)?RegExp(`(^| )${t}( |$)`):t,\" \").replace(/ +/g,\" \").trim())}removeTextOutline(){let t=this.element.querySelector(\"tspan.highcharts-text-outline\");t&&this.safeRemoveChild(t)}safeRemoveChild(t){let e=t.parentNode;e&&e.removeChild(t)}setRadialReference(t){let e=this.element.gradient&&this.renderer.gradients[this.element.gradient]||void 0;return this.element.radialReference=t,e?.radAttr&&e.animate(this.renderer.getRadialAttr(t,e.radAttr)),this}shadow(t){let{renderer:e}=this,i=tu(this.parentGroup?.rotation===90?{offsetX:-1,offsetY:-1}:{},tg(t)?t:{}),s=e.shadowDefinition(i);return this.attr({filter:t?`url(${e.url}#${s})`:\"none\"})}show(t=!0){return this.attr({visibility:t?\"inherit\":\"visible\"})}\"stroke-widthSetter\"(t,e,i){this[e]=t,i.setAttribute(e,t)}strokeWidth(){if(!this.renderer.styledMode)return this[\"stroke-width\"]||0;let t=this.getStyle(\"stroke-width\"),e=0,i;return/px$/.test(t)?e=tv(t):\"\"!==t&&(X(i=ed.createElementNS(ep,\"rect\"),{width:t,\"stroke-width\":0}),this.element.parentNode.appendChild(i),e=i.getBBox().width,i.parentNode.removeChild(i)),e}symbolAttr(t){let e=this;ef.symbolCustomAttribs.forEach(function(i){e[i]=tb(t[i],e[i])}),e.attr({d:e.renderer.symbols[e.symbolName](e.x,e.y,e.width,e.height,e)})}textSetter(t){t!==this.textStr&&(delete this.textPxLength,this.textStr=t,this.added&&this.renderer.buildText(this),this.reAlign())}titleSetter(t){let e=this.element,i=e.getElementsByTagName(\"title\")[0]||ed.createElementNS(this.SVG_NS,\"title\");e.insertBefore?e.insertBefore(i,e.firstChild):e.appendChild(i),i.textContent=tM(tb(t,\"\"),[/<[^>]*>/g,\"\"]).replace(/</g,\"<\").replace(/>/g,\">\")}toFront(){let t=this.element;return t.parentNode.appendChild(t),this}translate(t,e){return this.attr({translateX:t,translateY:e})}updateTransform(t=\"transform\"){let{element:e,foreignObject:i,matrix:s,padding:o,rotation:r=0,rotationOriginX:a,rotationOriginY:n,scaleX:h,scaleY:l,text:d,translateX:c=0,translateY:p=0}=this,g=[`translate(${c},${p})`];V(s)&&g.push(\"matrix(\"+s.join(\",\")+\")\"),r&&(g.push(\"rotate(\"+r+\" \"+(a??e.getAttribute(\"x\")??this.x??0)+\" \"+(n??e.getAttribute(\"y\")??this.y??0)+\")\"),d?.element.tagName!==\"SPAN\"||d?.foreignObject||d.attr({rotation:r,rotationOriginX:(a||0)-o,rotationOriginY:(n||0)-o})),(V(h)||V(l))&&g.push(`scale(${h??1} ${l??1})`),g.length&&!(d||this).textPath&&(i?.element||e).setAttribute(t,g.join(\" \"))}visibilitySetter(t,e,i){\"inherit\"===t?i.removeAttribute(e):this[e]!==t&&i.setAttribute(e,t),this[e]=t}xGetter(t){return\"circle\"===this.element.nodeName&&(\"x\"===t?t=\"cx\":\"y\"===t&&(t=\"cy\")),this._defaultGetter(t)}zIndexSetter(t,e){let i=this.renderer,s=this.parentGroup,o=(s||i).element||i.box,r=this.element,a=o===i.box,n,h,l,d=!1,c,p=this.added,g;if(V(t)?(r.setAttribute(\"data-z-index\",t),t*=1,this[e]===t&&(p=!1)):V(this[e])&&r.removeAttribute(\"data-z-index\"),this[e]=t,p){for((t=this.zIndex)&&s&&(s.handleZ=!0),g=(n=o.childNodes).length-1;g>=0&&!d;g--)c=!V(l=(h=n[g]).getAttribute(\"data-z-index\")),h!==r&&(t<0&&c&&!a&&!g?(o.insertBefore(r,n[g]),d=!0):(tv(l)<=t||c&&(!V(t)||t>=0))&&(o.insertBefore(r,n[g+1]),d=!0));d||(o.insertBefore(r,n[3*!!a]),d=!0)}return d}}ef.symbolCustomAttribs=[\"anchorX\",\"anchorY\",\"clockwise\",\"end\",\"height\",\"innerR\",\"r\",\"start\",\"width\",\"x\",\"y\"],ef.prototype.strokeSetter=ef.prototype.fillSetter,ef.prototype.yGetter=ef.prototype.xGetter,ef.prototype.matrixSetter=ef.prototype.rotationOriginXSetter=ef.prototype.rotationOriginYSetter=ef.prototype.rotationSetter=ef.prototype.scaleXSetter=ef.prototype.scaleYSetter=ef.prototype.translateXSetter=ef.prototype.translateYSetter=ef.prototype.verticalAlignSetter=function(t,e){this[e]=t,this.doTransform=!0};let em=ef;class ex extends em{constructor(t,e,i,s,o,r,a,n,h,l){let d;super(t,\"g\"),this.paddingLeftSetter=this.paddingSetter,this.paddingRightSetter=this.paddingSetter,this.doUpdate=!1,this.textStr=e,this.x=i,this.y=s,this.anchorX=r,this.anchorY=a,this.baseline=h,this.className=l,this.addClass(\"button\"===l?\"highcharts-no-tooltip\":\"highcharts-label\"),l&&this.addClass(\"highcharts-\"+l),this.text=t.text(void 0,0,0,n).attr({zIndex:1}),\"string\"==typeof o&&((d=/^url\\((.*?)\\)$/.test(o))||this.renderer.symbols[o])&&(this.symbolKey=o),this.bBox=ex.emptyBBox,this.padding=3,this.baselineOffset=0,this.needsBox=t.styledMode||d,this.deferredAttr={},this.alignFactor=0}alignSetter(t){let e=tt(t);this.textAlign=t,e!==this.alignFactor&&(this.alignFactor=e,this.bBox&&tl(this.xSetting)&&this.attr({x:this.xSetting}),this.updateTextPadding())}anchorXSetter(t,e){this.anchorX=t,this.boxAttr(e,Math.round(t)-this.getCrispAdjust()-this.xSetting)}anchorYSetter(t,e){this.anchorY=t,this.boxAttr(e,t-this.ySetting)}boxAttr(t,e){this.box?this.box.attr(t,e):this.deferredAttr[t]=e}css(t){if(t){let e={};t=tu(t),ex.textProps.forEach(i=>{void 0!==t[i]&&(e[i]=t[i],delete t[i])}),this.text.css(e),\"fontSize\"in e||\"fontWeight\"in e||\"width\"in e?this.updateTextPadding():\"textOverflow\"in e&&this.updateBoxSize()}return em.prototype.css.call(this,t)}destroy(){tS(this.element,\"mouseenter\"),tS(this.element,\"mouseleave\"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),em.prototype.destroy.call(this)}fillSetter(t,e){t&&(this.needsBox=!0),this.fill=t,this.boxAttr(e,t)}getBBox(t,e){(this.textStr&&0===this.bBox.width&&0===this.bBox.height||this.rotation)&&this.updateBoxSize();let{padding:i,height:s=0,translateX:o=0,translateY:r=0,width:a=0}=this,n=tb(this.paddingLeft,i),h=e??(this.rotation||0),l={width:a,height:s,x:o+this.bBox.x-n,y:r+this.bBox.y-i+this.baselineOffset};return h&&(l=this.getRotatedBox(l,h)),l}getCrispAdjust(){return(this.renderer.styledMode&&this.box?this.box.strokeWidth():this[\"stroke-width\"]?parseInt(this[\"stroke-width\"],10):0)%2/2}heightSetter(t){this.heightSetting=t,this.doUpdate=!0}afterSetters(){super.afterSetters(),this.doUpdate&&(this.updateBoxSize(),this.doUpdate=!1)}onAdd(){this.text.add(this),this.attr({text:tb(this.textStr,\"\"),x:this.x||0,y:this.y||0}),this.box&&V(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})}paddingSetter(t,e){tl(t)?t!==this[e]&&(this[e]=t,this.updateTextPadding()):this[e]=void 0}rSetter(t,e){this.boxAttr(e,t)}strokeSetter(t,e){this.stroke=t,this.boxAttr(e,t)}\"stroke-widthSetter\"(t,e){t&&(this.needsBox=!0),this[\"stroke-width\"]=t,this.boxAttr(e,t)}\"text-alignSetter\"(t){this.textAlign=this[\"text-align\"]=t,this.updateTextPadding()}textSetter(t){void 0!==t&&this.text.attr({text:t}),this.updateTextPadding(),this.reAlign()}updateBoxSize(){let t,e=this.text,i={},s=this.padding,o=this.bBox=(!tl(this.widthSetting)||!tl(this.heightSetting)||this.textAlign)&&V(e.textStr)?e.getBBox(void 0,0):ex.emptyBBox;this.width=this.getPaddedWidth(),this.height=(this.heightSetting||o.height||0)+2*s;let r=this.renderer.fontMetrics(e);if(this.baselineOffset=s+Math.min((this.text.firstLineMetrics||r).b,o.height||1/0),this.heightSetting&&(this.baselineOffset+=(this.heightSetting-r.h)/2),this.needsBox&&!e.textPath){if(!this.box){let t=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect();t.addClass((\"button\"===this.className?\"\":\"highcharts-label-box\")+(this.className?\" highcharts-\"+this.className+\"-box\":\"\")),t.add(this)}i.x=t=this.getCrispAdjust(),i.y=(this.baseline?-this.baselineOffset:0)+t,i.width=Math.round(this.width),i.height=Math.round(this.height),this.box.attr(q(i,this.deferredAttr)),this.deferredAttr={}}}updateTextPadding(){let t=this.text,e=t.styles.textAlign||this.textAlign;if(!t.textPath){this.updateBoxSize();let i=this.baseline?0:this.baselineOffset,s=(this.paddingLeft??this.padding)+tt(e)*(this.widthSetting??this.bBox.width);(s!==t.x||i!==t.y)&&(t.attr({align:e,x:s}),void 0!==i&&t.attr(\"y\",i)),t.x=s,t.y=i}}widthSetter(t){this.widthSetting=tl(t)?t:void 0,this.doUpdate=!0}getPaddedWidth(){let t=this.padding,e=tb(this.paddingLeft,t),i=tb(this.paddingRight,t);return(this.widthSetting||this.bBox.width||0)+e+i}xSetter(t){this.x=t,this.alignFactor&&(t-=this.alignFactor*this.getPaddedWidth(),this[\"forceAnimate:x\"]=!0),this.anchorX&&(this[\"forceAnimate:anchorX\"]=!0),this.xSetting=Math.round(t),this.attr(\"translateX\",this.xSetting)}ySetter(t){this.anchorY&&(this[\"forceAnimate:anchorY\"]=!0),this.ySetting=this.y=Math.round(t),this.attr(\"translateY\",this.ySetting)}}function ey(t,e,i,s,o){let r=[];if(o){let a=o.start||0,n=o.end||0,h=tb(o.r,i),l=tb(o.r,s||i),d=1e-4>Math.abs(n-a-2*Math.PI);d&&(a=Math.PI/2,n=2.5*Math.PI-1e-4);let c=o.innerR,p=tb(o.open,d),g=d?0:Math.cos(a),u=d?1:Math.sin(a),f=d?0:Math.cos(n),m=d?1:Math.sin(n),x=tb(o.longArc,n-a-Math.PI<1e-4?0:1),y=[\"A\",h,l,0,x,tb(o.clockwise,1),t+(d?.001:h*f),e+l*m];y.params={start:a,end:n,cx:t,cy:e},r.push([\"M\",t+h*g,e+l*u],y),V(c)&&((y=[\"A\",c,c,0,x,V(o.clockwise)?1-o.clockwise:0,t+(d?-.001:c*g),e+c*u]).params={start:n,end:a,cx:t,cy:e},r.push(p?[\"M\",t+c*f,e+c*m]:[\"L\",t+c*f,e+c*m],y)),p||r.push([\"Z\"])}return r}function eb(t,e,i,s,o){return o?.r?ev(t,e,i,s,o):[[\"M\",t,e],[\"L\",t+i,e],[\"L\",t+i,e+s],[\"L\",t,e+s],[\"Z\"]]}function ev(t,e,i,s,o){let r=o?.r||0;return[[\"M\",t+r,e],[\"L\",t+i-r,e],[\"A\",r,r,0,0,1,t+i,e+r],[\"L\",t+i,e+s-r],[\"A\",r,r,0,0,1,t+i-r,e+s],[\"L\",t+r,e+s],[\"A\",r,r,0,0,1,t,e+s-r],[\"L\",t,e+r],[\"A\",r,r,0,0,1,t+r,e],[\"Z\"]]}ex.emptyBBox={width:0,height:0,x:0,y:0},ex.textProps=[\"color\",\"direction\",\"fontFamily\",\"fontSize\",\"fontStyle\",\"fontWeight\",\"lineClamp\",\"lineHeight\",\"textAlign\",\"textDecoration\",\"textOutline\",\"textOverflow\",\"whiteSpace\",\"width\"];let ek={arc:ey,callout:function(t,e,i,s,o){let r=Math.min(o?.r||0,i,s),a=r+6,n=o?.anchorX,h=o?.anchorY||0,l=ev(t,e,i,s,{r});if(!tl(n)||n0&&h0)return l;if(t+n>i-a)if(h>e+a&&he+a&&h0){let i=hs&&na&&l.splice(1,1,[\"L\",n-6,e],[\"L\",n,e-6],[\"L\",n+6,e],[\"L\",i-r,e]);return l},circle:function(t,e,i,s){return ey(t+i/2,e+s/2,i/2,s/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},diamond:function(t,e,i,s){return[[\"M\",t+i/2,e],[\"L\",t+i,e+s/2],[\"L\",t+i/2,e+s],[\"L\",t,e+s/2],[\"Z\"]]},rect:eb,roundedRect:ev,square:eb,triangle:function(t,e,i,s){return[[\"M\",t+i/2,e],[\"L\",t+i,e+s],[\"L\",t,e+s],[\"Z\"]]},\"triangle-down\":function(t,e,i,s){return[[\"M\",t,e],[\"L\",t+i,e],[\"L\",t+i/2,e+s],[\"Z\"]]}},{doc:ew,SVG_NS:eM,win:eS}=B,eT=(t,e)=>t.substring(0,e)+\"\u2026\",eC=class{constructor(t){const e=t.styles;this.renderer=t.renderer,this.svgElement=t,this.width=t.textWidth,this.textLineHeight=e?.lineHeight,this.textOutline=e?.textOutline,this.ellipsis=e?.textOverflow===\"ellipsis\",this.lineClamp=e?.lineClamp,this.noWrap=e?.whiteSpace===\"nowrap\"}buildSVG(){let t=this.svgElement,e=t.element,i=t.renderer,s=tb(t.textStr,\"\").toString(),o=-1!==s.indexOf(\"<\"),r=e.childNodes,a=!t.added&&i.box,n=[s,this.ellipsis,this.noWrap,this.textLineHeight,this.textOutline,t.getStyle(\"font-size\"),t.styles.lineClamp,this.width].join(\",\");if(n!==t.textCache){t.textCache=n,delete t.actualWidth;for(let t=r.length;t--;)e.removeChild(r[t]);if(o||this.ellipsis||this.width||t.textPath||-1!==s.indexOf(\" \")&&(!this.noWrap||//g.test(s))){if(\"\"!==s){a&&a.appendChild(e);let i=new t6(s);this.modifyTree(i.nodes),i.addToDOM(e),this.modifyDOM(),this.ellipsis&&-1!==(e.textContent||\"\").indexOf(\"\u2026\")&&t.attr(\"title\",this.unescapeEntities(t.textStr||\"\",[\"<\",\">\"])),a&&a.removeChild(e)}}else e.appendChild(ew.createTextNode(this.unescapeEntities(s)));td(this.textOutline)&&t.applyTextOutline&&t.applyTextOutline(this.textOutline)}}modifyDOM(){let t,e=this.svgElement,i=X(e.element,\"x\");for(e.firstLineMetrics=void 0;t=e.element.firstChild;)if(/^[\\s\\u200B]*$/.test(t.textContent||\" \"))e.element.removeChild(t);else break;[].forEach.call(e.element.querySelectorAll(\"tspan.highcharts-br\"),(t,s)=>{t.nextSibling&&t.previousSibling&&(0===s&&1===t.previousSibling.nodeType&&(e.firstLineMetrics=e.renderer.fontMetrics(t.previousSibling)),X(t,{dy:this.getLineHeight(t.nextSibling),x:i}))});let s=this.width||0;if(!s)return;let o=(t,o)=>{let r=t.textContent||\"\",a=r.replace(/([^\\^])-/g,\"$1- \").split(\" \"),n=!this.noWrap&&(a.length>1||e.element.childNodes.length>1),h=this.getLineHeight(o),l=Math.max(0,s-.8*h),d=0,c=e.actualWidth;if(n){let r=[],n=[];for(;o.firstChild&&o.firstChild!==t;)n.push(o.firstChild),o.removeChild(o.firstChild);for(;a.length;)if(a.length&&!this.noWrap&&d>0&&(r.push(t.textContent||\"\"),t.textContent=a.join(\" \").replace(/- /g,\"-\")),this.truncate(t,void 0,a,0===d&&c||0,s,l,(t,e)=>a.slice(0,e).join(\" \").replace(/- /g,\"-\")),c=e.actualWidth,d++,this.lineClamp&&d>=this.lineClamp){a.length&&(this.truncate(t,t.textContent||\"\",void 0,0,s,l,eT),t.textContent=t.textContent?.replace(\"\u2026\",\"\")+\"\u2026\");break}n.forEach(e=>{o.insertBefore(e,t)}),r.forEach(e=>{o.insertBefore(ew.createTextNode(e),t);let s=ew.createElementNS(eM,\"tspan\");s.textContent=\"\u200B\",X(s,{dy:h,x:i}),o.insertBefore(s,t)})}else this.ellipsis&&r&&this.truncate(t,r,void 0,0,s,l,eT)},r=t=>{[].slice.call(t.childNodes).forEach(i=>{i.nodeType===eS.Node.TEXT_NODE?o(i,t):(-1!==i.className.baseVal.indexOf(\"highcharts-br\")&&(e.actualWidth=0),r(i))})};r(e.element)}getLineHeight(t){let e=t.nodeType===eS.Node.TEXT_NODE?t.parentElement:t;return this.textLineHeight?parseInt(this.textLineHeight.toString(),10):this.renderer.fontMetrics(e||this.svgElement.element).h}modifyTree(t){let e=(i,s)=>{let{attributes:o={},children:r,style:a={},tagName:n}=i,h=this.renderer.styledMode;if(\"b\"===n||\"strong\"===n?h?o.class=\"highcharts-strong\":a.fontWeight=\"bold\":(\"i\"===n||\"em\"===n)&&(h?o.class=\"highcharts-emphasized\":a.fontStyle=\"italic\"),a?.color&&(a.fill=a.color),\"br\"===n){o.class=\"highcharts-br\",i.textContent=\"\u200B\";let e=t[s+1];e?.textContent&&(e.textContent=e.textContent.replace(/^ +/gm,\"\"))}else\"a\"===n&&r&&r.some(t=>\"#text\"===t.tagName)&&(i.children=[{children:r,tagName:\"tspan\"}]);\"#text\"!==n&&\"a\"!==n&&(i.tagName=\"tspan\"),q(i,{attributes:o,style:a}),r&&r.filter(t=>\"#text\"!==t.tagName).forEach(e)};t.forEach(e),Q(this.svgElement,\"afterModifyTree\",{nodes:t})}truncate(t,e,i,s,o,r,a){let n,h,l=this.svgElement,{rotation:d}=l,c=[],p=i&&!s?1:0,g=(e||i||\"\").length,u=g;i||(o=r);let f=function(e,o){let r=o||e,a=t.parentNode;if(a&&void 0===c[r]&&a.getSubStringLength)try{c[r]=s+a.getSubStringLength(0,i?r+1:r)}catch{}return c[r]};if(l.rotation=0,s+(h=f(t.textContent.length))>o){for(;p<=g;)u=Math.ceil((p+g)/2),i&&(n=a(i,u)),h=f(u,n&&n.length-1),p===g?p=g+1:h>o?g=u-1:p=u;0===g?t.textContent=\"\":e&&g===e.length-1||(t.textContent=n||a(e||i,u)),this.ellipsis&&h>o&&this.truncate(t,t.textContent||\"\",void 0,0,o,r,eT)}i&&i.splice(0,u),l.actualWidth=h,l.rotation=d}unescapeEntities(t,e){return tm(this.renderer.escapes,function(i,s){e&&-1!==e.indexOf(i)||(t=t.toString().replace(RegExp(i,\"g\"),s))}),t}},{defaultOptions:eA}=tY,{charts:eP,deg2rad:eL,doc:eO,isFirefox:eE,isMS:eI,isWebKit:eD,noop:eB,SVG_NS:eN,symbolSizes:ez,win:eR}=B;class eW{constructor(t,e,i,s,o,r,a){let n,h;this.x=0,this.y=0;const l=this.createElement(\"svg\").attr({version:\"1.1\",class:\"highcharts-root\"}),d=l.element;a||l.css(this.getStyle(s||{})),t.appendChild(d),X(t,\"dir\",\"ltr\"),-1===t.innerHTML.indexOf(\"xmlns\")&&X(d,\"xmlns\",this.SVG_NS),this.box=d,this.boxWrapper=l,this.alignedObjects=[],this.url=this.getReferenceURL(),this.createElement(\"desc\").add().element.appendChild(eO.createTextNode(\"Created with Highcharts 12.6.0\")),this.defs=this.createElement(\"defs\").add(),this.allowHTML=r,this.forExport=o,this.styledMode=a,this.gradients={},this.cache={},this.cacheKeys=[],this.asyncCounter=0,this.rootFontSize=l.getStyle(\"font-size\"),this.setSize(e,i,!1),eE&&t.getBoundingClientRect&&((n=function(){$(t,{left:0,top:0}),h=t.getBoundingClientRect(),$(t,{left:Math.ceil(h.left)-h.left+\"px\",top:Math.ceil(h.top)-h.top+\"px\"})})(),this.unSubPixelFix=R(eR,\"resize\",n))}definition(t){return new t6([t]).addToDOM(this.defs.element)}getReferenceURL(){if((eE||eD)&&eO.getElementsByTagName(\"base\").length){if(!V(e)){let t=tB(),i=new t6([{tagName:\"svg\",attributes:{width:8,height:8},children:[{tagName:\"defs\",children:[{tagName:\"clipPath\",attributes:{id:t},children:[{tagName:\"rect\",attributes:{width:4,height:4}}]}]},{tagName:\"rect\",attributes:{id:\"hitme\",width:8,height:8,\"clip-path\":`url(#${t})`,fill:\"rgba(0,0,0,0.001)\"}}]}]).addToDOM(eO.body);$(i,{position:\"fixed\",top:0,left:0,zIndex:9e5});let s=eO.elementFromPoint(6,6);e=s?.id===\"hitme\",eO.body.removeChild(i)}if(e)return tM(eR.location.href.split(\"#\")[0],[/<[^>]*>/g,\"\"],[/([\\('\\)])/g,\"\\\\$1\"],[/ /g,\"%20\"])}return\"\"}getStyle(t){return this.style=q({fontFamily:'-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", sans-serif',fontSize:\"1rem\"},t),this.style}setStyle(t){this.boxWrapper.css(this.getStyle(t))}isHidden(){return!this.boxWrapper.getBBox().width}destroy(){let t=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),U(this.gradients||{}),this.gradients=null,this.defs=t.destroy(),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null,null}createElement(t){return new this.Element(this,t)}getRadialAttr(t,e){return{cx:t[0]-t[2]/2+(e.cx||0)*t[2],cy:t[1]-t[2]/2+(e.cy||0)*t[2],r:(e.r||0)*t[2]}}shadowDefinition(t){let e=[`highcharts-drop-shadow-${this.chartIndex}`,...Object.keys(t).map(e=>`${e}-${t[e]}`)].join(\"-\").toLowerCase().replace(/[^a-z\\d\\-]/g,\"\"),i=tu({color:\"#000000\",offsetX:1,offsetY:1,opacity:.15,width:5},t);return this.defs.element.querySelector(`#${e}`)||this.definition({tagName:\"filter\",attributes:{id:e,filterUnits:i.filterUnits},children:this.getShadowFilterContent(i)}),e}getShadowFilterContent(t){return[{tagName:\"feDropShadow\",attributes:{dx:t.offsetX,dy:t.offsetY,\"flood-color\":t.color,\"flood-opacity\":Math.min(5*t.opacity,1),stdDeviation:t.width/2}}]}buildText(t){new eC(t).buildSVG()}getContrast(t){if(\"transparent\"===t)return\"#000000\";let e=tU.parse(t).rgba,i=\" clamp(0,calc(9e9*(0.5 - (0.2126*r + 0.7152*g + 0.0722*b))),1)\";if(tl(e[0])||!tU.useColorMix){let t=e.map(t=>{let e=t/255;return e<=.04?e/12.92:Math.pow((e+.055)/1.055,2.4)}),i=.2126*t[0]+.7152*t[1]+.0722*t[2];return 1.05/(i+.05)>(i+.05)/.05?\"#FFFFFF\":\"#000000\"}return\"color(from \"+t+\" srgb\"+i+i+i+\")\"}button(t,e,i,s,o={},r,a,n,h,l){let d=this.label(t,e,i,h,void 0,void 0,l,void 0,\"button\"),c=this.styledMode,p=arguments,g=0;o=tu(eA.global.buttonTheme,o),c&&(delete o.fill,delete o.stroke,delete o[\"stroke-width\"]);let u=o.states||{},f=o.style||{};delete o.states,delete o.style;let m=[t6.filterUserAttributes(o)],x=[f];return c||[\"hover\",\"select\",\"disabled\"].forEach((t,e)=>{m.push(tu(m[0],t6.filterUserAttributes(p[e+5]||u[t]||{}))),x.push(m[e+1].style),delete m[e+1].style}),R(d.element,eI?\"mouseover\":\"mouseenter\",function(){3!==g&&d.setState(1)}),R(d.element,eI?\"mouseout\":\"mouseleave\",function(){3!==g&&d.setState(g)}),d.setState=(t=0)=>{if(1!==t&&(d.state=g=t),d.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass(\"highcharts-button-\"+[\"normal\",\"hover\",\"pressed\",\"disabled\"][t]),!c){d.attr(m[t]);let e=x[t];tg(e)&&d.css(e)}},d.attr(m[0]),!c&&(d.css(q({cursor:\"default\"},f)),l&&d.text.css({pointerEvents:\"none\"})),d.on(\"touchstart\",t=>t.stopPropagation()).on(\"click\",function(t){3!==g&&s?.call(d,t)})}crispLine(t,e){let[i,s]=t;return V(i[1])&&i[1]===s[1]&&(i[1]=s[1]=j(i[1],e)),V(i[2])&&i[2]===s[2]&&(i[2]=s[2]=j(i[2],e)),t}path(t){let e=this.styledMode?{}:{fill:\"none\"};return tc(t)?e.d=t:tg(t)&&q(e,t),this.createElement(\"path\").attr(e)}circle(t,e,i){let s=tg(t)?t:void 0===t?{}:{x:t,y:e,r:i},o=this.createElement(\"circle\");return o.xSetter=o.ySetter=function(t,e,i){i.setAttribute(\"c\"+e,t)},o.attr(s)}arc(t,e,i,s,o,r){let a;tg(t)?(e=(a=t).y,i=a.r,s=a.innerR,o=a.start,r=a.end,t=a.x):a={innerR:s,start:o,end:r};let n=this.symbol(\"arc\",t,e,i,i,a);return n.r=i,n}rect(t,e,i,s,o,r){let a=tg(t)?t:void 0===t?{}:{x:t,y:e,r:o,width:Math.max(i||0,0),height:Math.max(s||0,0)},n=this.createElement(\"rect\");return this.styledMode||(void 0!==r&&(a[\"stroke-width\"]=r,q(a,n.crisp(a))),a.fill=\"none\"),n.rSetter=function(t,e,i){n.r=t,X(i,{rx:t,ry:t})},n.rGetter=function(){return n.r||0},n.attr(a)}roundedRect(t){return this.symbol(\"roundedRect\").attr(t)}setSize(t,e,i){this.width=t,this.height=e,this.boxWrapper.animate({width:t,height:e},{step:function(){this.attr({viewBox:\"0 0 \"+this.attr(\"width\")+\" \"+this.attr(\"height\")})},duration:tb(i,!0)?void 0:0}),this.alignElements()}g(t){let e=this.createElement(\"g\");return t?e.attr({class:\"highcharts-\"+t}):e}image(t,e,i,s,o,r){let a={preserveAspectRatio:\"none\"};tl(e)&&(a.x=e),tl(i)&&(a.y=i),tl(s)&&(a.width=s),tl(o)&&(a.height=o);let n=this.createElement(\"image\").attr(a),h=function(e){n.attr({href:t}),r.call(n,e)};if(r){n.attr({href:\"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"});let e=new eR.Image;R(e,\"load\",h),e.src=t,e.complete&&h({})}else n.attr({href:t});return n}symbol(t,e,i,s,o,r){let a,n,h,l,d=this,c=/^url\\((.*?)\\)$/,p=c.test(t),g=!p&&(this.symbols[t]?t:\"circle\"),u=g&&this.symbols[g];if(u)\"number\"==typeof e&&(n=u.call(this.symbols,e||0,i||0,s||0,o||0,r)),a=this.path(n),d.styledMode||a.attr(\"fill\",\"none\"),q(a,{symbolName:g||void 0,x:e,y:i,width:s,height:o}),r&&q(a,r);else if(p){h=t.match(c)[1];let s=a=this.image(h);s.imgwidth=tb(r?.width,ez[h]?.width),s.imgheight=tb(r?.height,ez[h]?.height),l=t=>t.attr({width:t.width,height:t.height}),[\"width\",\"height\"].forEach(t=>{s[`${t}Setter`]=function(t,e){this[e]=t;let{alignByTranslate:i,element:s,width:o,height:a,imgwidth:n,imgheight:h}=this,l=\"width\"===e?n:h,d=1;r&&\"within\"===r.backgroundSize&&o&&a&&n&&h?(d=Math.min(o/n,a/h),X(s,{width:Math.round(n*d),height:Math.round(h*d)})):s&&l&&s.setAttribute(e,l),!i&&n&&h&&this.translate(((o||0)-n*d)/2,((a||0)-h*d)/2)}}),V(e)&&s.attr({x:e,y:i}),s.isImg=!0,V(s.imgwidth)&&V(s.imgheight)?l(s):(s.attr({width:0,height:0}),Y(\"img\",{onload:function(){let t=eP[d.chartIndex];0===this.width&&($(this,{position:\"absolute\",top:\"-999em\"}),eO.body.appendChild(this)),ez[h]={width:this.width,height:this.height},s.imgwidth=this.width,s.imgheight=this.height,s.element&&l(s),this.parentNode&&this.parentNode.removeChild(this),d.asyncCounter--,d.asyncCounter||!t||t.hasLoaded||t.onload()},src:h}),this.asyncCounter++)}return a}clipRect(t,e,i,s){return this.rect(t,e,i,s,0)}text(t,e,i,s){let o={};if(s&&(this.allowHTML||!this.forExport))return this.html(t,e,i);o.x=Math.round(e||0),i&&(o.y=Math.round(i)),V(t)&&(o.text=t);let r=this.createElement(\"text\").attr(o);return s&&(!this.forExport||this.allowHTML)||(r.xSetter=function(t,e,i){let s=i.getElementsByTagName(\"tspan\"),o=i.getAttribute(e);for(let i=0,r;it.align())}}q(eW.prototype,{Element:em,SVG_NS:eN,escapes:{\"&\":\"&\",\"<\":\"<\",\">\":\">\",\"'\":\"'\",'\"':\""\"},symbols:ek,draw:eB}),eo.registerRendererType(\"svg\",eW,!0);let{composed:eH,isFirefox:eX}=B;function eG(t,e,i){let s=this.div?.style;em.prototype[`${e}Setter`].call(this,t,e,i),s&&(i.style[e]=s[e]=t)}let eF=(t,e)=>{if(!t.div){let i=X(t.element,\"class\"),s=t.css,o=Y(\"div\",i?{className:i}:void 0,{position:\"absolute\",left:`${t.translateX||0}px`,top:`${t.translateY||0}px`,...t.styles,display:t.display,opacity:t.opacity,visibility:t.visibility},t.parentGroup?.div||e);t.classSetter=(t,e,i)=>{i.setAttribute(\"class\",t),o.className=t},t.translateXSetter=t.translateYSetter=(e,i)=>{t[i]=e,o.style[\"translateX\"===i?\"left\":\"top\"]=`${e}px`,t.doTransform=!0},t.scaleXSetter=t.scaleYSetter=(e,i)=>{t[i]=e,t.doTransform=!0},t.opacitySetter=t.visibilitySetter=eG,t.css=e=>(s.call(t,e),e.cursor&&(o.style.cursor=e.cursor),e.pointerEvents&&(o.style.pointerEvents=e.pointerEvents),t),t.on=function(){return em.prototype.on.apply({element:o,onEvents:t.onEvents},arguments),t},t.div=o}return t.div};class eY extends em{static compose(t){tk(eH,this.compose)&&(t.prototype.html=function(t,e,i){return new eY(this,\"span\").attr({text:t,x:Math.round(e),y:Math.round(i)})})}constructor(t,e){super(t,e),eY.useForeignObject?this.foreignObject=t.createElement(\"foreignObject\").attr({zIndex:2}):this.css({position:\"absolute\",...t.styledMode?{}:{fontFamily:t.style.fontFamily,fontSize:t.style.fontSize}}),this.element.style.whiteSpace=\"nowrap\"}getSpanCorrection(t,e,i){this.xCorr=-t*i,this.yCorr=-e}css(t){let e,{element:i}=this,s=\"SPAN\"===i.tagName&&t&&\"width\"in t,o=s&&t.width;return s&&(delete t.width,this.textWidth=tv(o)||void 0,e=!0),t?.textOverflow===\"ellipsis\"&&(t.overflow=\"hidden\",t.whiteSpace=\"nowrap\"),t?.lineClamp&&(t.display=\"-webkit-box\",t.WebkitLineClamp=t.lineClamp,t.WebkitBoxOrient=\"vertical\",t.overflow=\"hidden\"),tl(Number(t?.fontSize))&&(t.fontSize+=\"px\"),q(this.styles,t),$(i,t),e&&this.updateTransform(),this}htmlGetBBox(){let{element:t}=this;return{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}updateTransform(){if(!this.added){this.alignOnAdd=!0;return}let{element:t,foreignObject:e,oldTextWidth:i,renderer:s,rotation:o,rotationOriginX:r,rotationOriginY:a,scaleX:n,scaleY:h,styles:{display:l=\"inline-block\",whiteSpace:d},textAlign:c=\"left\",textWidth:p,translateX:g=0,translateY:u=0,x:f=0,y:m=0}=this,x=()=>this.textPxLength?this.textPxLength:($(t,{width:\"\",whiteSpace:d||\"nowrap\"}),t.offsetWidth);if(e||$(t,{marginLeft:`${g}px`,marginTop:`${u}px`}),\"SPAN\"===t.tagName){let g,u=[o,c,t.innerHTML,p,this.textAlign].join(\",\"),y=-(this.parentGroup?.padding*1)||0;if(p!==i){let e=x(),r=p||0,a=!s.styledMode&&\"\"===t.style.textOverflow&&t.style.webkitLineClamp;(r>i||e>r||a)&&(/[\\-\\s\\u00AD]/.test(t.textContent||t.innerText)||\"ellipsis\"===t.style.textOverflow)&&($(t,{width:(o||n||e>r)&&tl(p)?p+\"px\":a?Math.min(e+1,r)+\"px\":\"auto\",display:l,whiteSpace:d||\"normal\"}),this.oldTextWidth=p)}e&&($(t,{display:\"inline-block\",verticalAlign:\"top\"}),e.attr({width:s.width,height:s.height})),u!==this.cTT&&(g=s.fontMetrics(t).b,V(o)&&!e&&(o!==(this.oldRotation||0)||c!==this.oldAlign)&&$(t,{transform:`rotate(${o}deg)`,transformOrigin:`${y}% ${y}px`}),this.getSpanCorrection(!V(o)&&!this.textWidth&&this.textPxLength||t.offsetWidth,g,tt(c)));let{xCorr:b=0,yCorr:v=0}=this,k={left:`${f+b}px`,top:`${m+v}px`,textAlign:c,transformOrigin:`${(r??f)-b-f-y}px ${(a??m)-v-m-y}px`};(n||h)&&(k.transform=`scale(${n??1},${h??1})`),e?(super.updateTransform(),tl(f)&&tl(m)?(e.attr({x:f+b,y:m+v,width:t.offsetWidth+3,height:t.offsetHeight,\"transform-origin\":t.getAttribute(\"transform-origin\")||\"0 0\"}),$(t,{display:l,textAlign:c})):eX&&e.attr({width:0,height:0})):$(t,k),this.cTT=u,this.oldRotation=o,this.oldAlign=c}}add(t){let{foreignObject:e,renderer:i}=this,s=i.box.parentNode,o=[];if(e)e.add(t),super.add(i.createElement(\"body\").attr({xmlns:\"http://www.w3.org/1999/xhtml\"}).css({background:\"transparent\",margin:\"0 3px 0 0\"}).add(e));else{let e;if(this.parentGroup=t,t&&!(e=t.div)){let i=t;for(;i;)o.push(i),i=i.parentGroup;for(let t of o.reverse())e=eF(t,s)}(e||s).appendChild(this.element)}return this.added=!0,this.alignOnAdd&&this.updateTransform(),this}textSetter(t){t!==this.textStr&&(delete this.bBox,delete this.oldTextWidth,t6.setElementHTML(this.element,t??\"\"),this.textStr=t,this.doTransform=!0)}alignSetter(t){this.alignValue=this.textAlign=t,this.doTransform=!0}xSetter(t,e){this[e]=t,this.doTransform=!0}}let ej=eY.prototype;ej.visibilitySetter=ej.opacitySetter=eG,ej.ySetter=ej.rotationSetter=ej.rotationOriginXSetter=ej.rotationOriginYSetter=ej.xSetter,(h=y||(y={})).xAxis={alignTicks:!0,allowDecimals:void 0,panningEnabled:!0,zIndex:2,zoomEnabled:!0,dateTimeLabelFormats:{millisecond:{main:\"%[HMSL]\",range:!1},second:{main:\"%[HMS]\",range:!1},minute:{main:\"%[HM]\",range:!1},hour:{main:\"%[HM]\",range:!1},day:{main:\"%[eb]\"},week:{main:\"%[eb]\"},month:{main:\"%[bY]\"},year:{main:\"%Y\"}},endOnTick:!1,gridLineDashStyle:\"Solid\",gridZIndex:1,labels:{autoRotationLimit:80,distance:15,enabled:!0,indentation:10,overflow:\"justify\",reserveSpace:void 0,rotation:void 0,staggerLines:0,step:0,useHTML:!1,zIndex:7,style:{color:\"#333333\",cursor:\"default\",fontSize:\"0.8em\",textOverflow:\"ellipsis\"}},maxPadding:.01,minorGridLineDashStyle:\"Solid\",minorTickLength:2,minorTickPosition:\"outside\",minorTicksPerMajor:5,minPadding:.01,offset:void 0,reversed:void 0,reversedStacks:!1,showEmpty:!0,showFirstLabel:!0,showLastLabel:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickmarkPlacement:\"between\",tickPixelInterval:100,tickPosition:\"outside\",title:{align:\"middle\",useHTML:!1,x:0,y:0,style:{color:\"#666666\",fontSize:\"0.8em\"}},visible:!0,minorGridLineColor:\"#f2f2f2\",minorGridLineWidth:1,minorTickColor:\"#999999\",lineColor:\"#333333\",lineWidth:1,gridLineColor:\"#e6e6e6\",gridLineWidth:void 0,tickColor:\"#333333\"},h.yAxis={reversedStacks:!0,endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:void 0},startOnTick:!0,title:{},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:\"justify\",formatter:function(){return this.axis.chart.numberFormatter(this.total||0,-1)},style:{color:\"#000000\",fontSize:\"0.7em\",fontWeight:\"bold\",textOutline:\"1px contrast\"}},gridLineWidth:1,lineWidth:0};let e$=y;(b||(b={})).registerEventOptions=function(t,e){t.eventOptions=t.eventOptions||{},tm(e.events,function(e,i){t.eventOptions[i]!==e&&(t.eventOptions[i]&&(tS(t,i,t.eventOptions[i]),delete t.eventOptions[i]),tp(e)&&(t.eventOptions[i]=e,R(t,i,e,{order:0})))})};let eV=b,{deg2rad:eU}=B,eZ=class{constructor(t,e,i,s,o){this.isNew=!0,this.isNewLabel=!0,this.axis=t,this.pos=e,this.type=i||\"\",this.parameters=o||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,Q(this,\"init\"),i||s||this.addLabel()}addLabel(){let t=this,e=t.axis,i=e.options,s=e.chart,o=e.categories,r=e.logarithmic,a=e.names,n=t.pos,h=tb(t.options?.labels,i.labels),l=e.tickPositions,d=n===l[0],c=n===l[l.length-1],p=(!h.step||1===h.step)&&1===e.tickInterval,g=l.info,u=t.label,f,m,x,y=this.parameters.category||(o?tb(o[n],a[n],n):n);r&&tl(y)&&(y=F(r.lin2log(y))),e.dateTime&&(g?f=(m=s.time.resolveDTLFormat(i.dateTimeLabelFormats[!i.grid?.enabled&&g.higherRanks[n]||g.unitName])).main:tl(y)&&(f=e.dateTime.getXDateFormat(y,i.dateTimeLabelFormats||{}))),t.isFirst=d,t.isLast=c;let b={axis:e,chart:s,dateTimeLabelFormat:f,isFirst:d,isLast:c,pos:n,tick:t,tickPositionInfo:g,value:y};Q(this,\"labelFormat\",b);let v=t=>h.formatter?h.formatter.call(t,t):h.format?(t.text=e.defaultLabelFormatter.call(t),es.format(h.format,t,s)):e.defaultLabelFormatter.call(t),k=v.call(b,b),w=m?.list;w?t.shortenLabel=function(){for(x=0;x0&&s+d*c>n&&(f=Math.round((o-s)/Math.cos(l*eU))):(s-d*cn&&(g=n-t.x+g*d,u=-1),(g=Math.min(p,g))g||e.autoRotation&&h?.styles?.width)&&(f=g)),f&&h&&(this.shortenLabel?this.shortenLabel():h.css(q({},{width:Math.floor(f)+\"px\",lineClamp:+!e.isRadial})))}moveLabel(t,e){let i=this,s=i.label,o=i.axis,r=!1,a;s&&s.textStr===t?(i.movedLabel=s,r=!0,delete i.label):tm(o.ticks,function(e){r||e.isNew||e===i||!e.label||e.label.textStr!==t||(i.movedLabel=e.label,r=!0,e.labelPos=i.movedLabel.xy,delete e.label)}),!r&&(i.labelPos||s)&&(a=i.labelPos||s.xy,i.movedLabel=i.createLabel(t,e,a),i.movedLabel&&i.movedLabel.attr({opacity:0}))}render(t,e,i){let s=this.axis,o=s.horiz,r=this.pos,a=tb(this.tickmarkOffset,s.tickmarkOffset),n=this.getPosition(o,r,a,e),h=n.x,l=n.y,d=s.pos,c=d+s.len,p=o?h:l,g=tb(i,this.label?.newOpacity,1);!s.chart.polar&&(F(p)c)&&(i=0),i??(i=1),this.isActive=!0,this.renderGridLine(e,i),this.renderMark(n,i),this.renderLabel(n,e,g,t),this.isNew=!1,Q(this,\"afterRender\")}renderGridLine(t,e){let i=this.axis,s=i.options,o={},r=this.pos,a=this.type,n=tb(this.tickmarkOffset,i.tickmarkOffset),h=i.chart.renderer,l=this.gridLine,d,c=s.gridLineWidth,p=s.gridLineColor,g=s.gridLineDashStyle;\"minor\"===this.type&&(c=s.minorGridLineWidth,p=s.minorGridLineColor,g=s.minorGridLineDashStyle),l||(i.chart.styledMode||(o.stroke=p,o[\"stroke-width\"]=c||0,o.dashstyle=g),a||(o.zIndex=1),t&&(e=0),this.gridLine=l=h.path().attr(o).addClass(\"highcharts-\"+(a?a+\"-\":\"\")+\"grid-line\").add(i.gridGroup)),l&&(d=i.getPlotLinePath({value:r+n,lineWidth:l.strokeWidth(),force:\"pass\",old:t,acrossPanes:!1}))&&l[t||this.isNew?\"attr\":\"animate\"]({d:d,opacity:e})}renderMark(t,e){let i=this.axis,s=i.options,o=i.chart.renderer,r=this.type,a=i.tickSize(r?r+\"Tick\":\"tick\"),n=t.x,h=t.y,l=tb(s[\"minor\"!==r?\"tickWidth\":\"minorTickWidth\"],!r&&i.isXAxis?1:0),d=s[\"minor\"!==r?\"tickColor\":\"minorTickColor\"],c=this.mark,p=!c;a&&(i.opposite&&(a[0]=-a[0]),!c&&(this.mark=c=o.path().addClass(\"highcharts-\"+(r?r+\"-\":\"\")+\"tick\").add(i.axisGroup),i.chart.styledMode||c.attr({stroke:d,\"stroke-width\":l})),c[p?\"attr\":\"animate\"]({d:this.getMarkPath(n,h,a[0],c.strokeWidth(),i.horiz,o),opacity:e}))}renderLabel(t,e,i,s){let o=this.axis,r=o.horiz,a=o.options,n=this.label,h=a.labels,l=h.step,d=tb(this.tickmarkOffset,o.tickmarkOffset),c=t.x,p=t.y,g=!0;n&&tl(c)&&(n.xy=t=this.getLabelPosition(c,p,n,r,h,d,s,l),(!this.isFirst||this.isLast||a.showFirstLabel)&&(!this.isLast||this.isFirst||a.showLastLabel)?r&&!e&&0!==i&&this.handleOverflow(t):g=!1,l&&s%l&&(g=!1),g&&tl(t.y)?(t.opacity=i,n[this.isNewLabel?\"attr\":\"animate\"](t).show(!0),this.isNewLabel=!1):(n.hide(),this.isNewLabel=!0))}replaceMovedLabel(){let t=this.label,e=this.axis;t&&!this.isNew&&(t.animate({opacity:0},void 0,t.destroy),delete this.label),e.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel}},{animObject:e_}=tQ,{xAxis:eK,yAxis:eq}=e$,{defaultOptions:eJ}=tY,{registerEventOptions:eQ}=eV,{deg2rad:e0}=B,e1=(t,e)=>tf(e,void 0,void 0,tb(t.options.allowDecimals,e<.5||void 0!==t.tickAmount),!!t.tickAmount);q(eJ,{xAxis:eK,yAxis:tu(eK,eq)});class e2{constructor(t,e,i){this.init(t,e,i)}init(t,e,i=this.coll){let s=\"xAxis\"===i,o=this.isZAxis||(t.inverted?!s:s);this.chart=t,this.horiz=o,this.isXAxis=s,this.coll=i,Q(this,\"init\",{userOptions:e}),this.opposite=tb(e.opposite,this.opposite),this.side=tb(e.side,this.side,o?2*!this.opposite:this.opposite?1:3),this.setOptions(e);let r=this.options,a=r.labels;this.type??(this.type=r.type||\"linear\"),this.uniqueNames??(this.uniqueNames=r.uniqueNames??!0),Q(this,\"afterSetType\"),this.userOptions=e,this.minPixelPadding=0,this.reversed=tb(r.reversed,this.reversed),this.visible=r.visible,this.zoomEnabled=r.zoomEnabled,this.hasNames=\"category\"===this.type||!0===r.categories,this.categories=tc(r.categories)&&r.categories||(this.hasNames?[]:void 0),this.names||(this.names=[],this.names.keys={}),this.plotLinesAndBandsGroups={},this.positiveValuesOnly=!!this.logarithmic,this.isLinked=V(r.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len??(this.len=0),this.minRange=this.userMinRange=r.minRange||r.maxZoom,this.range=r.range,this.offset=r.offset||0,this.max=void 0,this.min=void 0;let n=tb(r.crosshair,tT(t.options.tooltip.crosshairs)[+!s]);this.crosshair=!0===n?{}:n,-1===t.axes.indexOf(this)&&(s?t.axes.splice(t.xAxis.length,0,this):t.axes.push(this),tI(this,t[this.coll])),t.orderItems(this.coll),this.series=this.series||[],t.inverted&&!this.isZAxis&&s&&!V(this.reversed)&&(this.reversed=!0),this.labelRotation=tl(a.rotation)?a.rotation:void 0,eQ(this,r),Q(this,\"afterInit\")}setOptions(t){let e=this.horiz?{labels:{autoRotation:[-45],padding:3},margin:15}:{labels:{padding:1},title:{rotation:90*this.side}};this.options=tu(e,\"yAxis\"===this.coll?{title:{text:this.chart.options.lang.yAxisTitle}}:{},eJ[this.coll],t),Q(this,\"afterSetOptions\",{userOptions:t})}defaultLabelFormatter(){let t=this.axis,e=this.chart,{numberFormatter:i}=e,s=tl(this.value)?this.value:NaN,o=t.chart.time,r=t.categories,a=this.dateTimeLabelFormat,n=eJ.lang,h=n.numericSymbols,l=n.numericSymbolMagnitude||1e3,d=t.logarithmic?Math.abs(s):t.tickInterval,c=h?.length,p,g;if(r)g=`${this.value}`;else if(a)g=o.dateFormat(a,s,!0);else if(c&&h&&d>=1e3)for(;c--&&void 0===g;)d>=(p=Math.pow(l,c+1))&&10*s%p==0&&null!==h[c]&&0!==s&&(g=i(s/p,-1,void 0,void 0,e)+h[c]);return g??(g=i(s,-1,void 0,1e4>Math.abs(s)?\"\":void 0,e)),g}getSeriesExtremes(){let t,e=this;Q(this,\"getSeriesExtremes\",null,function(){e.hasVisibleSeries=!1,e.dataMin=e.dataMax=e.threshold=void 0,e.softThreshold=!e.isXAxis,e.series.forEach(i=>{if(i.reserveSpace()){let s=i.options,o,r=s.threshold,a,n;if(e.hasVisibleSeries=!0,e.positiveValuesOnly&&0>=(r||0)&&(r=void 0),e.isXAxis)(o=i.getColumn(\"x\")).length&&(o=e.logarithmic?o.filter(t=>t>0):o,a=(t=i.getXExtremes(o)).min,n=t.max,tl(a)||a instanceof Date||(o=o.filter(tl),a=(t=i.getXExtremes(o)).min,n=t.max),o.length&&(e.dataMin=Math.min(tb(e.dataMin,a),a),e.dataMax=Math.max(tb(e.dataMax,n),n)));else{let t=i.applyExtremes();tl(t.dataMin)&&(a=t.dataMin,e.dataMin=Math.min(tb(e.dataMin,a),a)),tl(t.dataMax)&&(n=t.dataMax,e.dataMax=Math.max(tb(e.dataMax,n),n)),V(r)&&(e.threshold=r),(!s.softThreshold||e.positiveValuesOnly)&&(e.softThreshold=!1)}}})}),Q(this,\"afterGetSeriesExtremes\")}translate(t,e,i,s,o,r){let a=this.linkedParent||this,n=s&&a.old?a.old.min:a.min;if(!tl(n))return NaN;let h=a.minPixelPadding,l=(a.isOrdinal||a.brokenAxis?.hasBreaks||a.logarithmic&&o)&&!!a.lin2val,d=1,c=0,p=s&&a.old?a.old.transA:a.transA,g=0;return p||(p=a.transA),i&&(d*=-1,c=a.len),a.reversed&&(d*=-1,c-=d*(a.sector||a.len)),e?(g=(t=t*d+c-h)/p+n,l&&(g=a.lin2val(g))):(l&&(t=a.val2lin(t)),g=d*(t-n)*p+c+d*h+(tl(r)?p*r:0),a.isRadial||(g=F(g))),g}toPixels(t,e){return this.translate(this.chart?.time.parse(t)??NaN,!1,!this.horiz,void 0,!0)+(e?0:this.pos)}toValue(t,e){return this.translate(t-(e?0:this.pos),!0,!this.horiz,void 0,!0)}getPlotLinePath(t){let e=this,i=e.chart,s=e.left,o=e.top,r=t.old,a=t.value,n=t.lineWidth,h=r&&i.oldChartHeight||i.chartHeight,l=r&&i.oldChartWidth||i.chartWidth,d=e.transB,c=t.translatedValue,p=t.force,g,u,f,m,x;function y(t,e,i){return\"pass\"!==p&&(ti)&&(p?t=G(t,e,i):x=!0),t}let b={value:a,lineWidth:n,old:r,force:p,acrossPanes:t.acrossPanes,translatedValue:c};return Q(this,\"getPlotLinePath\",b,function(t){g=f=(c=G(c=tb(c,e.translate(a,void 0,void 0,r)),-1e9,1e9))+d,u=m=h-c-d,tl(c)?e.horiz?(u=o,m=h-e.bottom+(e.options.isInternal?0:i.scrollablePixelsY||0),g=f=y(g,s,s+e.width)):(g=s,f=l-e.right+(i.scrollablePixelsX||0),u=m=y(u,o,o+e.height)):(x=!0,p=!1),t.path=x&&!p?void 0:i.renderer.crispLine([[\"M\",g,u],[\"L\",f,m]],n||1)}),b.path}getLinearTickPositions(t,e,i){let s,o,r,a=F(Math.floor(e/t)*t),n=F(Math.ceil(i/t)*t),h=[];if(F(a+t)===a&&(r=20),this.single)return[e];for(s=a;s<=n&&(h.push(s),(s=F(s+t,r))!==o);)o=s;return h}getMinorTickInterval(){let{minorTicks:t,minorTickInterval:e}=this.options;return!0===t?tb(e,\"auto\"):!1!==t?e:void 0}getMinorTickPositions(){let t=this.options,e=this.tickPositions,i=this.minorTickInterval,s=this.pointRangePadding||0,o=(this.min||0)-s,r=(this.max||0)+s,a=this.brokenAxis?.hasBreaks?this.brokenAxis.unitLength:r-o,n=[],h;if(a&&a/i{let e=t.getColumn(\"x\");return t.xIncrement?e.slice(0,2):e}))||0),this.dataMax-this.dataMin)),tl(s)&&tl(o)&&tl(r)&&s-o=r,a=(r-s+o)/2,h=[o-a,i.parse(t.min)??o-a],n&&(h[2]=e?e.log2lin(this.dataMin):this.dataMin),l=[(o=H(h))+r,i.parse(t.max)??o+r],n&&(l[2]=e?e.log2lin(this.dataMax):this.dataMax),(s=W(l))-ot-e),t=te([i]))}return t&&e?Math.min(t,e):t||e}nameToX(t){let e=tc(this.options.categories),i=e?this.categories:this.names,s=t.options.x,o;return t.series.requireSorting=!1,V(s)||(s=this.uniqueNames&&i?e?i.indexOf(t.name):tb(i.keys[t.name],-1):t.series.autoIncrement()),-1===s?!e&&i&&(o=i.length):tl(s)&&(o=s),void 0!==o?(this.names[o]=t.name,this.names.keys[t.name]=o):t.x&&(o=t.x),o}updateNames(){let t=this,e=this.names;e.length>0&&(Object.keys(e.keys).forEach(function(t){delete e.keys[t]}),e.length=0,this.minRange=this.userMinRange,(this.series||[]).forEach(e=>{e.xIncrement=null,(!e.points||e.isDirtyData)&&(t.max=Math.max(t.max||0,e.dataTable.rowCount-1),e.processData(),e.generatePoints());let i=e.getColumn(\"x\").slice();e.data.forEach((e,s)=>{let o=i[s];e?.options&&void 0!==e.name&&void 0!==(o=t.nameToX(e))&&o!==e.x&&(i[s]=e.x=o)}),e.dataTable.setColumn(\"x\",i)}))}setAxisTranslation(){let t=this,e=t.max-t.min,i=t.linkedParent,s=!!t.categories,o=t.isXAxis,r=t.axisPointRange||0,a,n=0,h=0,l,d=t.transA;(o||s||r)&&(a=t.getClosest(),i?(n=i.minPointOffset,h=i.pointRangePadding):t.series.forEach(function(e){let i=s?1:o?tb(e.options.pointRange,a,0):t.axisPointRange||0,l=e.options.pointPlacement;if(r=Math.max(r,i),!t.single||s){let t=e.is(\"xrange\")?!o:o;n=Math.max(n,t&&td(l)?0:i/2),h=Math.max(h,t&&\"on\"===l?0:i)}}),l=t.ordinal?.slope&&a?t.ordinal.slope/a:1,t.minPointOffset=n*=l,t.pointRangePadding=h*=l,t.pointRange=Math.min(r,t.single&&s?1:e),o&&(t.closestPointRange=a)),t.translationSlope=t.transA=d=t.staticScale||t.len/(e+h||1),t.transB=t.horiz?t.left:t.bottom,t.minPixelPadding=d*n,Q(this,\"afterSetAxisTranslation\")}minFromRange(){let{max:t,min:e}=this;return tl(t)&&tl(e)&&t-e||void 0}setTickInterval(t){let{categories:e,chart:i,dataMax:s,dataMin:o,dateTime:r,isXAxis:a,logarithmic:n,options:h,softThreshold:l}=this,d=i.time,c=tl(this.threshold)?this.threshold:void 0,p=this.minRange||0,{ceiling:g,floor:u,linkedTo:f,softMax:m,softMin:x}=h,y=tl(f)&&i[this.coll]?.[f],b=h.tickPixelInterval,v=h.maxPadding,k=h.minPadding,w=0,M,S=tl(h.tickInterval)&&h.tickInterval>=0?h.tickInterval:void 0,T,C,A,P;if(r||e||y||this.getTickAmount(),A=tb(this.userMin,d.parse(h.min)),P=tb(this.userMax,d.parse(h.max)),y?(this.linkedParent=y,M=y.getExtremes(),this.min=tb(M.min,M.dataMin),this.max=tb(M.max,M.dataMax),this.type!==y.type&&tE(11,!0,i)):(l&&V(c)&&tl(s)&&tl(o)&&(o>=c?(T=c,k=0):s<=c&&(C=c,v=0)),this.min=tb(A,T,o),this.max=tb(P,C,s)),tl(this.max)&&tl(this.min)&&(n&&(this.positiveValuesOnly&&!t&&0>=Math.min(this.min,tb(o,this.min))&&tE(10,!0,i),this.min=F(n.log2lin(this.min),16),this.max=F(n.log2lin(this.max),16)),this.range&&tl(o)&&(this.userMin=this.min=A=Math.max(o,this.minFromRange()||0),this.userMax=P=this.max,this.range=void 0)),Q(this,\"foundExtremes\"),this.adjustForMinRange(),tl(this.min)&&tl(this.max)){if(!tl(this.userMin)&&tl(x)&&xthis.max&&(this.max=P=m),e||this.axisPointRange||this.stacking?.usePercentage||y||(w=this.max-this.min)&&(!V(A)&&k&&(this.min-=w*k),!V(P)&&v&&(this.max+=w*v)),!tl(this.userMin)&&tl(u)&&(this.min=Math.max(this.min,u)),!tl(this.userMax)&&tl(g)&&(this.max=Math.min(this.max,g)),l&&tl(o)&&tl(s)){let t=c||0;!V(A)&&this.min=t?this.min=h.minRange?Math.min(t,this.max-p):t:!V(P)&&this.max>t&&s<=t&&(this.max=h.minRange?Math.max(t,this.min+p):t)}!i.polar&&this.min>this.max&&(V(h.min)?this.max=this.min:V(h.max)&&(this.min=this.max)),w=this.max-this.min}if(this.min!==this.max&&tl(this.min)&&tl(this.max)?y&&!S&&b===y.options.tickPixelInterval?this.tickInterval=S=y.tickInterval:this.tickInterval=tb(S,this.tickAmount?w/Math.max(this.tickAmount-1,1):void 0,e?1:w*b/Math.max(this.len,b)):this.tickInterval=1,a&&!t){let t=this.min!==this.old?.min||this.max!==this.old?.max;this.series.forEach(function(e){e.forceCrop=e.forceCropping?.(),e.processData(t)}),Q(this,\"postProcessData\",{hasExtremesChanged:t})}this.setAxisTranslation(),Q(this,\"initialAxisTranslation\"),this.pointRange&&!S&&(this.tickInterval=Math.max(this.pointRange,this.tickInterval));let L=tb(h.minTickInterval,r&&!this.series.some(t=>!t.sorted)?this.closestPointRange:0);!S&&L&&this.tickIntervalMath.max(2*this.len,200))n=[this.min,this.max],tE(19,!1,this.chart);else if(this.dateTime)n=this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,t.units),this.min,this.max,t.startOfWeek,this.ordinal?.positions,this.closestPointRange,!0);else if(this.logarithmic)n=this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max);else{let t=this.tickInterval,e=t;for(;e<=2*t;)if(n=this.getLinearTickPositions(this.tickInterval,this.min,this.max),this.tickAmount&&n.length>this.tickAmount)this.tickInterval=e1(this,e*=1.1);else break}n.length>this.len&&(n=[n[0],n[n.length-1]])[0]===n[1]&&(n.length=1),i&&(this.tickPositions=n,(h=i.apply(this,[this.min,this.max,this]))&&(n=h))}this.isDirty||n.length===this.tickPositions?.length||(this.isDirty=!0),this.tickPositions=n,this.minorTickInterval=\"auto\"===s&&this.tickInterval?this.tickInterval/t.minorTicksPerMajor:s,this.paddedTicks=n.slice(0),this.trimTicks(n,r,a),!this.isLinked&&tl(this.min)&&tl(this.max)&&(this.single&&n.length<2&&!this.categories&&!this.series.some(t=>t.is(\"heatmap\")&&\"between\"===t.options.pointPlacement)&&(this.min-=.5,this.max+=.5),e||h||this.adjustTickAmount()),Q(this,\"afterSetTickPositions\")}trimTicks(t,e,i){let s=t[0],o=t[t.length-1],r=!this.isOrdinal&&this.minPointOffset||0;if(Q(this,\"trimTicks\"),!this.isLinked||!this.grid){if(e&&s!==-1/0)this.min=s;else for(;this.min-r>t[0];)t.shift();if(i)this.max=o;else for(;this.max+r{let{horiz:e,options:i}=t;return[e?i.left:i.top,i.width,i.height,i.pane].join(\",\")},r=o(this);i[this.coll].forEach(function(i){let{series:a}=i;a.length&&a.some(t=>t.visible)&&i!==e&&o(i)===r&&(t=!0,s.push(i))})}if(t&&a){s.forEach(t=>{let i=t.getThresholdAlignment(e);tl(i)&&n.push(i)});let t=n.length>1?n.reduce((t,e)=>t+=e,0)/n.length:void 0;s.forEach(e=>{e.thresholdAlignment=t})}return t}getThresholdAlignment(t){if((!tl(this.dataMin)||this!==t&&this.series.some(t=>t.isDirty||t.isDirtyData||t.xAxis?.isDirty))&&this.getSeriesExtremes(),tl(this.threshold)){let t=G((this.threshold-(this.dataMin||0))/((this.dataMax||0)-(this.dataMin||0)),0,1);return this.options.reversed&&(t=1-t),t}}getTickAmount(){let t=this.options,e=t.tickPixelInterval,i=t.tickAmount;V(t.tickInterval)||i||!(this.lenr.push(F(r[r.length-1]+p)),f=()=>r.unshift(F(r[0]-p));if(tl(n)&&(g=0===n?0:1===n?a-1:Math.round(G(n*(a-1),1,a-2)),o.reversed&&(g=a-1-g)),t.hasData()&&tl(s)&&tl(i)){let n=()=>{t.transA*=(h-1)/(a-1),t.min=o.startOnTick?r[0]:Math.min(s,r[0]),t.max=o.endOnTick?r[r.length-1]:Math.max(i,r[r.length-1])};if(tl(g)&&tl(t.threshold)){for(;r[g]!==l||r.length!==a||r[0]>s||r[r.length-1]t.threshold?f():u();if(p>8*t.tickInterval)break;p*=2}n()}else if(h0&&c{i=i||t.isDirtyData||t.isDirty,s=s||t.xAxis?.isDirty||!1}),this.setAxisSize();let o=this.len!==this.old?.len;o||i||s||this.isLinked||this.forceRedraw||this.userMin!==this.old?.userMin||this.userMax!==this.old?.userMax||this.alignToOthers()?(e&&\"yAxis\"===t&&e.buildStacks(),this.forceRedraw=!1,this.userMinRange||(this.minRange=void 0),this.getSeriesExtremes(),this.setTickInterval(),e&&\"xAxis\"===t&&e.buildStacks(),this.isDirty||(this.isDirty=o||this.min!==this.old?.min||this.max!==this.old?.max)):e&&e.cleanStacks(),i&&delete this.allExtremes,Q(this,\"afterSetScale\")}setExtremes(t,e,i=!0,s,o){let r=this.chart;this.series.forEach(t=>{delete t.kdTree}),t=r.time.parse(t),e=r.time.parse(e),Q(this,\"setExtremes\",o=q(o,{min:t,max:e}),t=>{this.userMin=t.min,this.userMax=t.max,this.eventArgs=t,i&&r.redraw(s)})}setAxisSize(){let t=this.chart,e=this.options,i=e.offsets||[0,0,0,0],s=this.horiz,o=this.width=Math.round(tw(tb(e.width,t.plotWidth-i[3]+i[1]),t.plotWidth)),r=this.height=Math.round(tw(tb(e.height,t.plotHeight-i[0]+i[2]),t.plotHeight)),a=this.top=Math.round(tw(tb(e.top,t.plotTop+i[0]),t.plotHeight,t.plotTop)),n=this.left=Math.round(tw(tb(e.left,t.plotLeft+i[3]),t.plotWidth,t.plotLeft));this.bottom=t.chartHeight-r-a,this.right=t.chartWidth-o-n,this.len=Math.max(s?o:r,0),this.pos=s?n:a}getExtremes(){let t=this.logarithmic;return{min:t?F(t.lin2log(this.min)):this.min,max:t?F(t.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}}getThreshold(t){let e=this.logarithmic,i=e?e.lin2log(this.min):this.min,s=e?e.lin2log(this.max):this.max;return null===t||t===-1/0?t=i:t===1/0?t=s:i>t?t=i:s15&&e<165?t.align=\"right\":e>195&&e<345&&(t.align=\"left\")}),i.align}tickSize(t){let e=this.options,i=tb(e[\"tick\"===t?\"tickWidth\":\"minorTickWidth\"],\"tick\"===t&&this.isXAxis&&!this.categories?1:0),s=e[\"tick\"===t?\"tickLength\":\"minorTickLength\"],o;i&&s&&(\"inside\"===e[t+\"Position\"]&&(s=-s),o=[s,i]);let r={tickSize:o};return Q(this,\"afterTickSize\",r),r.tickSize}labelMetrics(){let t=this.chart.renderer,e=this.ticks,i=e[Object.keys(e)[0]]||{};return this.chart.renderer.fontMetrics(i.label||i.movedLabel||t.box)}unsquish(){let t=this.options.labels,e=t.padding||0,i=this.horiz,s=this.tickInterval,o=this.len/((+!!this.categories+this.max-this.min)/s),r=t.rotation,a=F(.8*this.labelMetrics().h),n=Math.max(this.max-this.min,0),h=function(t){let i=(t+2*e)/(o||1);return(i=i>1?Math.ceil(i):1)*s>n&&t!==1/0&&o!==1/0&&n&&(i=Math.ceil(n/s)),F(i*s)},l=s,d,c=Number.MAX_VALUE,p;if(i){if(!t.staggerLines&&(tl(r)?p=[r]:o=-90&&i<=90)&&(e=(t=h(Math.abs(a/Math.sin(e0*i))))+Math.abs(i/360))u&&(u=i)}),this.maxLabelLength=u,this.autoRotation?u>h&&u>d.h?l.rotation=this.labelRotation:this.labelRotation=0:n&&(p=h),l.rotation&&(p=u>.5*t.chartHeight?.33*t.chartHeight:u,c||(g=1)),this.labelAlign=o.align||this.autoLabelAlign(this.labelRotation||0),this.labelAlign&&(l.align=this.labelAlign),i.forEach(function(t){let e=s[t],i=e?.label,o=r.width,a={};i&&(i.attr(l),e.shortenLabel?e.shortenLabel():p&&!o&&\"nowrap\"!==r.whiteSpace&&(p<(i.textPxLength||0)||\"SPAN\"===i.element.tagName)?i.css(q(a,{width:`${p}px`,lineClamp:g})):!i.styles.width||a.width||o||i.css({width:\"auto\"}),e.rotation=l.rotation)},this),this.tickRotCorr=e.rotCorr(d.b,this.labelRotation||0,0!==this.side)}hasData(){return this.series.some(function(t){return t.hasData()})||this.options.showEmpty&&V(this.min)&&V(this.max)}addTitle(t){let e,i=this.chart.renderer,s=this.horiz,o=this.opposite,r=this.options.title,a=this.chart.styledMode;this.axisTitle||((e=r.textAlign)||(e=(s?{low:\"left\",middle:\"center\",high:\"right\"}:{low:o?\"right\":\"left\",middle:\"center\",high:o?\"left\":\"right\"})[r.align]),this.axisTitle=i.text(r.text||\"\",0,0,r.useHTML).attr({zIndex:7,rotation:r.rotation||0,align:e}).addClass(\"highcharts-axis-title\"),a||this.axisTitle.css(tu(r.style)),this.axisTitle.add(this.axisGroup),this.axisTitle.isNew=!0),a||r.style.width||this.isRadial||this.axisTitle.css({width:this.len+\"px\"}),this.axisTitle[t?\"show\":\"hide\"](t)}generateTick(t){let e=this.ticks;e[t]?e[t].addLabel():e[t]=new eZ(this,t)}createGroups(){let{axisParent:t,chart:e,coll:i,options:s}=this,o=e.renderer,r=(e,r,a)=>o.g(e).attr({zIndex:a}).addClass(`highcharts-${i.toLowerCase()}${r} `+(this.isRadial?`highcharts-radial-axis${r} `:\"\")+(s.className||\"\")).add(t);this.axisGroup||(this.gridGroup=r(\"grid\",\"-grid\",s.gridZIndex),this.axisGroup=r(\"axis\",\"\",s.zIndex),this.labelGroup=r(\"axis-labels\",\"-labels\",s.labels.zIndex))}getOffset(){let t=this,{chart:e,horiz:i,options:s,side:o,ticks:r,tickPositions:a,coll:n}=t,h=e.inverted&&!t.isZAxis?[1,0,3,2][o]:o,l=t.hasData(),d=s.title,c=s.labels,p=tl(s.crossing),g=e.axisOffset,u=e.clipOffset,f=[-1,1,1,-1][o],m,x=0,y,b=0,v=0,k,w;if(t.showAxis=m=l||s.showEmpty,t.staggerLines=t.horiz&&c.staggerLines||void 0,t.createGroups(),l||t.isLinked?(a.forEach(function(e){t.generateTick(e)}),t.renderUnsquish(),t.reserveSpaceDefault=0===o||2===o||({1:\"left\",3:\"right\"})[o]===t.labelAlign,tb(c.reserveSpace,!p&&null,\"center\"===t.labelAlign||null,t.reserveSpaceDefault)&&a.forEach(function(t){v=Math.max(r[t].getLabelSize(),v)}),t.staggerLines&&(v*=t.staggerLines),t.labelOffset=v*(t.opposite?-1:1)):tm(r,function(t,e){t.destroy(),delete r[e]}),d?.text&&!1!==d.enabled&&(t.addTitle(m),m&&!p&&!1!==d.reserveSpace&&(t.titleOffset=x=t.axisTitle.getBBox()[i?\"height\":\"width\"],b=V(y=d.offset)?0:tb(d.margin,i?5:10))),t.renderLine(),t.offset=f*tb(s.offset,g[o]?g[o]+(s.margin||0):0),t.tickRotCorr=t.tickRotCorr||{x:0,y:0},w=0===o?-t.labelMetrics().h:2===o?t.tickRotCorr.y:0,k=Math.abs(v)+b,v&&(k-=w,k+=f*(i?tb(c.y,t.tickRotCorr.y+f*c.distance):tb(c.x,f*c.distance))),t.axisTitleMargin=tb(y,k),t.getMaxLabelDimensions&&(t.maxLabelDimensions=t.getMaxLabelDimensions(r,a)),\"colorAxis\"!==n&&u){let e=this.tickSize(\"tick\");g[o]=Math.max(g[o],(t.axisTitleMargin||0)+x+f*t.offset,k,a?.length&&e?e[0]+f*t.offset:0);let i=!t.axisLine||s.offset?0:t.axisLine.strokeWidth()/2;u[h]=Math.max(u[h],i)}Q(this,\"afterGetOffset\")}getLinePath(t){let e=this.chart,i=this.opposite,s=this.offset,o=this.horiz,r=this.left+(i?this.width:0)+s,a=e.chartHeight-this.bottom-(i?this.height:0)+s;return i&&(t*=-1),e.renderer.crispLine([[\"M\",o?this.left:r,o?a:this.top],[\"L\",o?e.chartWidth-this.right:r,o?a:e.chartHeight-this.bottom]],t)}renderLine(){!this.axisLine&&(this.axisLine=this.chart.renderer.path().addClass(\"highcharts-axis-line\").add(this.axisGroup),this.chart.styledMode||this.axisLine.attr({stroke:this.options.lineColor,\"stroke-width\":this.options.lineWidth,zIndex:7}))}getTitlePosition(t){let e=this.horiz,i=this.left,s=this.top,o=this.len,r=this.options.title,a=e?i:s,n=this.opposite,h=this.offset,l=r.x,d=r.y,c=this.chart.renderer.fontMetrics(t),p=t?Math.max(t.getBBox(!1,0).height-c.h-1,0):0,g={low:a+(e?0:o),middle:a+o/2,high:a+(e?o:0)}[r.align],u=(e?s+this.height:i)+(e?1:-1)*(n?-1:1)*(this.axisTitleMargin||0)+[-p,p,c.f,-p][this.side],f={x:e?g+l:u+(n?this.width:0)+h+l,y:e?u+d-(n?this.height:0)+h:g+d};return Q(this,\"afterGetTitlePosition\",{titlePosition:f}),f}renderMinorTick(t,e){let i=this.minorTicks;i[t]||(i[t]=new eZ(this,t,\"minor\")),e&&i[t].isNew&&i[t].render(null,!0),i[t].render(null,!1,1)}renderTick(t,e,i){let s=this.isLinked,o=this.ticks;(!s||t>=this.min&&t<=this.max||this.grid?.isColumn)&&(o[t]||(o[t]=new eZ(this,t)),i&&o[t].isNew&&o[t].render(e,!0,-1),o[t].render(e))}render(){let t,e,i=this,s=i.chart,o=i.logarithmic,r=s.renderer,a=i.options,n=i.isLinked,h=i.tickPositions,l=i.axisTitle,d=i.ticks,c=i.minorTicks,p=i.alternateBands,g=a.stackLabels,u=a.alternateGridColor,f=a.crossing,m=i.tickmarkOffset,x=i.axisLine,y=i.showAxis,b=e_(r.globalAnimation);if(i.labelEdge.length=0,i.overlap=!1,[d,c,p].forEach(function(t){tm(t,function(t){t.isActive=!1})}),tl(f)){let t=this.isXAxis?s.yAxis[0]:s.xAxis[0],e=[1,-1,-1,1][this.side];if(t){let s=t.toPixels(f,!0);i.horiz&&(s=t.len-s),i.offset=e*s}}if(i.hasData()||n){let r=i.chart.hasRendered&&i.old&&tl(i.old.min);i.minorTickInterval&&!i.categories&&i.getMinorTickPositions().forEach(function(t){i.renderMinorTick(t,r)}),h.length&&(h.forEach(function(t,e){i.renderTick(t,e,r)}),m&&(0===i.min||i.single)&&(d[-1]||(d[-1]=new eZ(i,-1,null,!0)),d[-1].render(-1))),u&&h.forEach(function(r,a){e=void 0!==h[a+1]?h[a+1]+m:i.max-m,a%2==0&&r{let e=this.cross;e||(this.cross=e=h.renderer.path().addClass(\"highcharts-crosshair highcharts-crosshair-\"+(o?\"category \":\"thin \")+(a.className||\"\")).attr({zIndex:tb(a.zIndex,2)}).add(),!h.styledMode&&(e.attr({stroke:a.color||(o?tU.parse(\"#ccd3ff\").setOpacity(.25).get():\"#cccccc\"),\"stroke-width\":tb(a.width,1)}).css({\"pointer-events\":\"none\"}),a.dashStyle&&e.attr({dashstyle:a.dashStyle}))),e.show().animate({d:i},e_(a?.animation)),o&&!a.width&&e.attr({\"stroke-width\":this.transA}),this.cross&&(this.cross.e=t)},(!l||\"hidden\"===l.attr(\"visibility\"))&&a.showDelay||0)}else this.hideCrosshair();Q(this,\"afterDrawCrosshair\",{e:t,point:e})}hideCrosshair(){clearTimeout(this.crossShowTimer),this.cross&&this.cross.hide(),Q(this,\"afterHideCrosshair\")}update(t,e){let i=this.chart;t=tu(this.userOptions,t),this.destroy(!0),this.init(i,t),i.isDirtyBox=!0,tb(e,!0)&&i.redraw()}remove(t){let e=this.chart,i=this.coll,s=this.series,o=s.length;for(;o--;)s[o]&&s[o].remove(!1);K(e.axes,this),K(e[i]||[],this),e.orderItems(i),this.destroy(),e.isDirtyBox=!0,tb(t,!0)&&e.redraw()}setTitle(t,e){this.update({title:t},e)}setCategories(t,e){this.update({categories:t},e)}}e2.keepProps=[\"coll\",\"extKey\",\"hcEvents\",\"len\",\"names\",\"series\",\"userMax\",\"userMin\"],!function(t){function e(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)}function i(){if(\"datetime\"!==this.type){this.dateTime=void 0;return}this.dateTime||(this.dateTime=new s(this))}t.compose=function(t){return t.keepProps.includes(\"dateTime\")||(t.keepProps.push(\"dateTime\"),t.prototype.getTimeTicks=e,R(t,\"afterSetType\",i)),t};class s{constructor(t){this.axis=t}normalizeTimeTickInterval(t,e){let i=e||[[\"millisecond\",[1,2,5,10,20,25,50,100,200,500]],[\"second\",[1,2,5,10,15,30]],[\"minute\",[1,2,5,10,15,30]],[\"hour\",[1,2,3,4,6,8,12]],[\"day\",[1,2]],[\"week\",[1,2]],[\"month\",[1,2,3,4,6]],[\"year\",null]],s=i[i.length-1],o=tD[s[0]],r=s[1],a,n;for(a=0;a=.5)t=Math.round(t),n=o.getLinearTickPositions(t,e,i);else if(t>=.08){let o,r,a,h,l,d,c,p=Math.floor(e);for(o=t>.3?[1,2,4]:t>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9],r=p;re&&(!s||d<=i)&&void 0!==d&&n.push(d),d>i&&(c=!0),d=l}else{let h=this.lin2log(e),l=this.lin2log(i),d=s?o.getMinorTickInterval():a.tickInterval,c=a.tickPixelInterval/(s?5:1),p=s?r/o.tickPositions.length:r;t=tf(t=tb(\"auto\"===d?null:d,this.minorAutoInterval,(l-h)*c/(p||1))),n=o.getLinearTickPositions(t,h,l).map(this.log2lin),s||(this.minorAutoInterval=t/5)}return s||(o.tickInterval=t),n}lin2log(t){return Math.pow(10,t)}log2lin(t){return Math.log(t)/Math.LN10}}t.Additions=s}(k||(k={}));let e5=k;!function(t){let e;function i(t){return this.addPlotBandOrLine(t,\"plotBands\")}function s(t,i){let s=this.userOptions,o=new e(this,t);if(this.visible&&(o=o.render()),o){if(this._addedPlotLB||(this._addedPlotLB=!0,(s.plotLines||[]).concat(s.plotBands||[]).forEach(t=>{this.addPlotBandOrLine(t)})),i){let e=s[i]||[];e.push(t),s[i]=e}this.plotLinesAndBands.push(o)}return o}function o(t){return this.addPlotBandOrLine(t,\"plotLines\")}function r(t,e,i){i=i||this.options;let s=this.getPlotLinePath({value:e,force:!0,acrossPanes:i.acrossPanes}),o=[],r=this.horiz,a=!tl(this.min)||!tl(this.max)||tthis.max&&e>this.max,n=this.getPlotLinePath({value:t,force:!0,acrossPanes:i.acrossPanes}),h,l=1,d;if(n&&s)for(a&&(d=n.toString()===s.toString(),l=0),h=0;h{let t=[];for(let e of this.axes)for(let{label:i,options:s}of e.plotLinesAndBands)i&&!s?.label?.allowOverlap&&t.push(i);return t})}),e6.compose(e9,e)}constructor(t,e){this.axis=t,this.options=e,this.id=e.id}render(){Q(this,\"render\");let{axis:t,options:e}=this,{horiz:i,logarithmic:s}=t,{color:o,events:r,zIndex:a=0}=e,{renderer:n,time:h}=t.chart,l={},d=h.parse(e.to),c=h.parse(e.from),p=h.parse(e.value),g=e.borderWidth,u=e.label,{label:f,svgElem:m}=this,x=[],y,b=V(c)&&V(d),v=V(p),k=!m,w={class:\"highcharts-plot-\"+(b?\"band \":\"line \")+(e.className||\"\")},M=b?\"bands\":\"lines\";if(!t.chart.styledMode&&(v?(w.stroke=o||\"#999999\",w[\"stroke-width\"]=tb(e.width,1),e.dashStyle&&(w.dashstyle=e.dashStyle)):b&&(w.fill=o||\"#e6e9ff\",g&&(w.stroke=e.borderColor,w[\"stroke-width\"]=g))),l.zIndex=a,M+=\"-\"+a,(y=t.plotLinesAndBandsGroups[M])||(t.plotLinesAndBandsGroups[M]=y=n.g(\"plot-\"+M).attr(l).add()),m||(this.svgElem=m=n.path().attr(w).add(y)),V(p))x=t.getPlotLinePath({value:s?.log2lin(p)??p,lineWidth:m.strokeWidth(),acrossPanes:e.acrossPanes});else{if(!(V(c)&&V(d)))return;x=t.getPlotBandPath(s?.log2lin(c)??c,s?.log2lin(d)??d,e)}return!this.eventsAdded&&r&&(tm(r,(t,e)=>{m?.on(e,t=>{r[e].apply(this,[t,this])})}),this.eventsAdded=!0),(k||!m.d)&&x?.length?m.attr({d:x}):m&&(x?(m.show(),m.animate({d:x})):m.d&&(m.hide(),f&&(this.label=f=f.destroy()))),u&&(V(u.text)||V(u.formatter))&&x?.length&&t.width>0&&t.height>0&&!x.isFlat?(u=tu({align:i&&b?\"center\":void 0,x:i?!b&&4:10,verticalAlign:!i&&b?\"middle\":void 0,y:i?b?16:10:b?6:-4,rotation:i&&!b?90:0,...b?{inside:!0}:{}},u),this.renderLabel(u,x,b,a)):f&&f.hide(),this}renderLabel(t,e,i,s){let o=this.axis,r=o.chart.renderer,a=t.inside,n=this.label;n||(this.label=n=r.text(this.getLabelText(t),0,0,t.useHTML).attr({align:t.textAlign||t.align,rotation:t.rotation,class:\"highcharts-plot-\"+(i?\"band\":\"line\")+\"-label \"+(t.className||\"\"),zIndex:s}),o.chart.styledMode||n.css(tu({color:o.chart.options.title?.style?.color,fontSize:\"0.8em\",textOverflow:i&&!a?\"\":\"ellipsis\"},t.style)),n.add());let h=e.xBounds||[e[0][1],e[1][1],i?e[2][1]:e[0][1]],l=e.yBounds||[e[0][2],e[1][2],i?e[2][2]:e[0][2]],d=W(h),c=W(l),p=H(h)-d;n.align(t,!1,{x:d,y:c,width:p,height:H(l)-c}),n.alignAttr.y-=r.fontMetrics(n).b,(!n.alignValue||\"left\"===n.alignValue||V(a))&&n.css({width:(t.style?.width||(i&&a?p:90===n.rotation?o.height-(n.alignAttr.y-o.top):(t.clip?o.width+o.left:o.chart.chartWidth)-n.alignAttr.x))+\"px\"}),n.show(!0)}getLabelText(t){return V(t.formatter)?t.formatter.call(this,this):t.text}destroy(){K(this.axis.plotLinesAndBands,this),delete this.axis,U(this)}}let{animObject:e4}=tQ,{format:e8}=es,{composed:e7,dateFormats:it,doc:ie,isSafari:ii}=B,{distribute:is}=er,io=t=>{clearTimeout(t.hideTimer),clearTimeout(t.showTimer)};class ir{constructor(t,e,i){this.allowShared=!0,this.crosshairs=[],this.distance=0,this.isHidden=!0,this.isSticky=!1,this.options={},this.outside=!1,this.chart=t,this.init(t,e),this.pointer=i}bodyFormatter(t){return t.map(t=>{let e=t.series.tooltipOptions,i=t.formatPrefix||\"point\";return(e[i+\"Formatter\"]||t.tooltipFormatter).call(t,e[i+\"Format\"]||\"\",t)})}cleanSplit(t){this.chart.series.forEach(function(e){let i=e?.tt;i&&(!i.isActive||t?e.tt=i.destroy():i.isActive=!1)})}defaultFormatter(t){let e,i=this.points||tT(this);return(e=(e=[t.headerFooterFormatter(i[0])]).concat(t.bodyFormatter(i))).push(t.headerFooterFormatter(i[0],!0)),e}destroy(){this.label&&(this.label=this.label.destroy()),this.split&&(this.cleanSplit(!0),this.tt&&(this.tt=this.tt.destroy())),this.renderer&&(this.renderer=this.renderer.destroy(),Z(this.container)),ta(this.hideTimer),io(this)}getAnchor(t,e){let i,{chart:s,pointer:o}=this,r=s.inverted,a=s.plotTop,n=s.plotLeft;if(t=tT(t),t[0].series?.yAxis&&!t[0].series.yAxis.options.reversedStacks&&(t=t.slice().reverse()),this.followPointer&&e)void 0===e.chartX&&(e=o.normalize(e)),i=[e.chartX-n,e.chartY-a];else if(t[0].tooltipPos)i=t[0].tooltipPos;else{let s=0,o=0;t.forEach(function(t){let e=t.pos(!0);e&&(s+=e[0],o+=e[1])}),s/=t.length,o/=t.length,this.shared&&t.length>1&&e&&(r?s=e.chartX:o=e.chartY),i=[s-n,o-a]}let h={point:t[0],ret:i};return Q(this,\"getAnchor\",h),h.ret.map(Math.round)}getClassName(t,e,i){let s=this.options,o=t.series,r=o.options;return[s.className,\"highcharts-label\",i&&\"highcharts-tooltip-header\",e?\"highcharts-tooltip-box\":\"highcharts-tooltip\",!i&&\"highcharts-color-\"+tb(t.colorIndex,o.colorIndex),r?.className].filter(td).join(\" \")}getLabel({anchorX:t,anchorY:e}={anchorX:0,anchorY:0}){let i=this,s=this.chart.styledMode,o=this.options,r=this.split&&this.allowShared,a=this.container,n=this.chart.renderer;if(this.label){let t=!this.label.hasClass(\"highcharts-label\");(!r&&t||r&&!t)&&this.destroy()}if(!this.label){if(this.outside){let t=this.chart,e=t.options.chart.style,i=eo.getRendererType();this.container=a=B.doc.createElement(\"div\"),a.className=\"highcharts-tooltip-container \"+(t.renderTo.className.match(/(highcharts[a-zA-Z0-9-]+)\\s?/gm)||\"\"),$(a,{position:\"absolute\",top:\"1px\",pointerEvents:\"none\",zIndex:Math.max(this.options.style.zIndex||0,(e?.zIndex||0)+3)}),this.renderer=n=new i(a,0,0,e,void 0,void 0,n.styledMode)}if(r?this.label=n.g(\"tooltip\"):(this.label=n.label(\"\",t,e,o.shape||\"callout\",void 0,void 0,o.useHTML,void 0,\"tooltip\").attr({padding:o.padding,r:o.borderRadius}),s||this.label.attr({fill:o.backgroundColor,\"stroke-width\":o.borderWidth||0}).css(o.style).css({pointerEvents:o.style.pointerEvents||(this.shouldStickOnContact()?\"auto\":\"none\")})),i.outside){let t=this.label;[t.xSetter,t.ySetter].forEach((e,s)=>{t[s?\"ySetter\":\"xSetter\"]=o=>{e.call(t,i.distance),t[s?\"y\":\"x\"]=o,a&&(a.style[s?\"top\":\"left\"]=`${o}px`)}})}this.label.attr({zIndex:8}).shadow(o.shadow??!o.fixed).add()}return a&&!a.parentElement&&B.doc.body.appendChild(a),this.label}getPlayingField(){let{body:t,documentElement:e}=ie,{chart:i,distance:s,outside:o}=this;return{width:o?Math.max(t.scrollWidth,e.scrollWidth,t.offsetWidth,e.offsetWidth,e.clientWidth)-2*s-2:i.chartWidth,height:o?Math.max(t.scrollHeight,e.scrollHeight,t.offsetHeight,e.offsetHeight,e.clientHeight):i.chartHeight}}getPosition(t,e,i){let{distance:s,chart:o,outside:r,pointer:a}=this,{inverted:n,plotLeft:h,plotTop:l,polar:d}=o,{plotX:c=0,plotY:p=0}=i,g={},u=n&&i.h||0,{height:f,width:m}=this.getPlayingField(),x=a.getChartPosition(),y=i=>{let a=\"x\"===i;return[i,a?m:f,a?t:e].concat(r?[a?t*x.scaleX:e*x.scaleY,a?x.left-s+(c+h)*x.scaleX:x.top-s+(p+l)*x.scaleY,0,a?m:f]:[a?t:e,a?c+h:p+l,a?h:l,a?h+o.plotWidth:l+o.plotHeight])},b=y(\"y\"),v=y(\"x\"),k,w=!!i.negative;!d&&o.hoverSeries?.yAxis?.reversed&&(w=!w);let M=!this.followPointer&&tb(i.ttBelow,!d&&!n===w),S=function(t,e,i,o,a,n,h){let l=r?\"y\"===t?s*x.scaleY:s*x.scaleX:s,d=(i-o)/2,c=oe?m:m+u)}},T=function(t,e,i,o,r){if(re-s)return!1;re-o/2?g[t]=e-o-2:g[t]=r-i/2},C=function(t){[b,v]=[v,b],k=t},A=()=>{!1!==S.apply(0,b)?!1!==T.apply(0,v)||k||(C(!0),A()):k?g.x=g.y=0:(C(!0),A())};return(n&&!d||this.len>1)&&C(),A(),r&&(g.x-=x.left,g.y-=x.top),g}getFixedPosition(t,e,i){let s=i.series,{chart:o,options:r,split:a}=this,n=r.position,h=n.relativeTo,l=r.shared||s?.yAxis?.isRadial&&(\"pane\"===h||!h)?\"plotBox\":h,d=\"chart\"===l?o.renderer:o[l]||o.getClipBox(s,!0);return{x:d.x+(d.width-t)*tt(n.align)+n.x,y:d.y+(d.height-e)*tt(n.verticalAlign)+(!a&&n.y||0)}}hide(t){let e=this;io(this),t=tb(t,this.options.hideDelay),this.isHidden||(this.hideTimer=tA(function(){let i=e.getLabel();e.getLabel().animate({opacity:0},{duration:t?150:t,complete:()=>{i.hide(),e.container&&e.container.remove()}}),e.isHidden=!0},t))}init(t,e){this.chart=t,this.options=e,this.crosshairs=[],this.isHidden=!0,this.split=e.split&&!t.inverted&&!t.polar,this.shared=e.shared||this.split,this.outside=tb(e.outside,!!(t.scrollablePixelsX||t.scrollablePixelsY))}shouldStickOnContact(t){return!!(!this.followPointer&&this.options.stickOnContact&&(!t||this.pointer.inClass(t.target,\"highcharts-tooltip\")))}move(t,e,i,s){let{followPointer:o,options:r}=this,a=e4(!o&&!this.isHidden&&!r.fixed&&r.animation),n=o||(this.len||0)>1,h={x:t,y:e};n?h.anchorX=h.anchorY=NaN:(h.anchorX=i,h.anchorY=s),a.step=()=>this.drawTracker(),this.getLabel().animate(h,a)}refresh(t,e){let i=this,{chart:s,options:o,pointer:r,shared:a}=this,n=tT(t),h=n[0],l=o.format,d=o.formatter||i.defaultFormatter,c=s.styledMode,p=i.allowShared;if(!o.enabled||!h.series)return;io(this),i.allowShared=!(!tc(t)&&t.series&&t.series.noSharedTooltip),p=p&&!i.allowShared,i.followPointer=!i.split&&h.series.tooltipOptions.followPointer;let g=i.getAnchor(t,e),u=g[0],f=g[1];a&&i.allowShared&&(r.applyInactiveState(n),n.forEach(t=>t.setState(\"hover\")),h.points=n),this.len=n.length;let m=td(l)?e8(l,h,s):d.call(h,i,h);h.points=void 0;let x=h.series;this.distance=tb(x.tooltipOptions.distance,16),!1===m?this.hide():this.showTimer=tA(()=>{if(i.split&&i.allowShared)i.renderSplit(m,n);else{let t=u,a=f;if(e&&r.isDirectTouch&&(t=e.chartX-s.plotLeft,a=e.chartY-s.plotTop),!(s.polar||!1===x.options.clip||n.some(e=>r.isDirectTouch||e.series.shouldShowTooltip(t,a))))return void i.hide();{let t=i.getLabel(p&&i.tt||{});(!o.style.width||c)&&t.css({width:(this.outside?this.getPlayingField():s.spacingBox).width-2*o.padding+\"px\"}),t.attr({class:i.getClassName(h),text:tc(m)?m.join(\"\"):m}),this.outside&&t.attr({x:G(t.x||0,0,this.getPlayingField().width-(t.width||0)-1)}),c||t.attr({stroke:o.borderColor||h.color||x.color||\"#666666\"}),i.updatePosition({plotX:u,plotY:f,negative:h.negative,ttBelow:h.ttBelow,series:x,h:g[2]||0})}}i.isHidden&&i.label&&i.label.attr({opacity:1}).show(),i.isHidden=!1},i.isHidden&&o.showDelay||0),Q(this,\"refresh\")}renderSplit(t,e){let i=this,{chart:s,chart:{chartWidth:o,chartHeight:r,plotHeight:a,plotLeft:n,plotTop:h,scrollablePixelsY:l=0,scrollablePixelsX:d,styledMode:c},distance:p,options:g,options:{fixed:u,position:f,positioner:m},pointer:x}=i,{scrollLeft:y=0,scrollTop:b=0}=s.scrollablePlotArea?.scrollingContainer||{},v=i.outside&&\"number\"!=typeof d?ie.documentElement.getBoundingClientRect():{left:y,right:y+o,top:b,bottom:b+r},k=i.getLabel(),w=this.renderer||s.renderer,M=!!s.xAxis[0]?.opposite,{left:S,top:T}=x.getChartPosition(),C=m||u,A=h+b,P=0,L=a-l,O=function(t,e,s,o,r=[0,0],a=!0){let n,h;if(s.isHeader)h=M?0:L,n=G(r[0]-t/2,v.left,v.right-t-(i.outside?S:0));else if(u&&s){let o=i.getFixedPosition(t,e,s);n=o.x,h=o.y-A}else h=r[1]-A,n=G(n=a?r[0]-t-p:r[0]+p,a?n:v.left,v.right);return{x:n,y:h}};td(t)&&(t=[!1,t]);let E=t.slice(0,e.length+1).reduce(function(t,s,o){if(!1!==s&&\"\"!==s){let r=e[o-1]||{isHeader:!0,plotX:e[0].plotX,plotY:a,series:{}},l=r.isHeader,d=l?i:r.series,f=d.tt=function(t,e,s){let o=t,{isHeader:r,series:a}=e,n=a.tooltipOptions||g;if(!o){let t={padding:n.padding,r:n.borderRadius};c||(t.fill=n.backgroundColor,t[\"stroke-width\"]=n.borderWidth??(u&&!r?0:1)),o=w.label(\"\",0,0,n[r?\"headerShape\":\"shape\"]||(u&&!r?\"rect\":\"callout\"),void 0,void 0,n.useHTML).addClass(i.getClassName(e,!0,r)).attr(t).add(k)}return o.isActive=!0,o.attr({text:s}),c||o.css(n.style).attr({stroke:n.borderColor||e.color||a.color||\"#333333\"}),o}(d.tt,r,s.toString()),x=f.getBBox(),y=x.width+f.strokeWidth();l&&(P=x.height,L+=P,M&&(A-=P));let{anchorX:b,anchorY:S}=function(t){let e,i,{isHeader:s,plotX:o=0,plotY:r=0,series:l}=t;if(s)e=Math.max(n+o,n),i=h+a/2;else{let{xAxis:t,yAxis:s}=l;e=t.pos+G(o,-p,t.len+p),l.shouldShowTooltip(0,s.pos-h+r,{ignoreX:!0})&&(i=s.pos+r)}return{anchorX:e=G(e,v.left-p,v.right+p),anchorY:i}}(r);if(\"number\"==typeof S){let e=x.height+1,s=(m||O).call(i,y,e,r,i,[b,S]);t.push({align:C?0:void 0,anchorX:b,anchorY:S,boxWidth:y,point:r,rank:tb(s.rank,+!!l),size:e,target:s.y,tt:f,x:s.x})}else f.isActive=!1}return t},[]);!C&&E.some(t=>{let{outside:e}=i,s=(e?S:0)+t.anchorX;return ss})&&(E=E.map(t=>{let{x:e,y:i}=O.call(this,t.boxWidth,t.size,t.point,void 0,[t.anchorX,t.anchorY],!1);return q(t,{target:i,x:e})})),i.cleanSplit(),is(E,L);let I={left:S,right:S};E.forEach(function(t){let{x:e,boxWidth:s,isHeader:o}=t;!o&&(i.outside&&S+eI.right&&(I.right=S+e))}),E.forEach(function(t){let{x:e,anchorX:s,anchorY:o,pos:r,point:{isHeader:a}}=t,n={visibility:void 0===r?\"hidden\":\"inherit\",x:e,y:(r||0)+A+(u&&f.y||0),anchorX:s,anchorY:o};if(i.outside&&e0&&(a||(n.x=e+t,n.anchorX=s+t),a&&(n.x=(I.right-I.left)/2,n.anchorX=s+t))}t.tt.attr(n)});let{container:D,outside:B,renderer:N}=i;if(B&&D&&N){let{width:t,height:e,x:i,y:s}=k.getBBox();N.setSize(t+i,e+s,!1),D.style.left=I.left+\"px\",D.style.top=T+\"px\"}ii&&k.attr({opacity:1===k.opacity?.999:1})}drawTracker(){let t=this;if(!this.shouldStickOnContact()){t.tracker&&(t.tracker=t.tracker.destroy());return}let e=t.chart,i=t.label,s=t.shared?e.hoverPoints:e.hoverPoint;if(!i||!s)return;let o={x:0,y:0,width:0,height:0},r=this.getAnchor(s),a=i.getBBox();r[0]+=e.plotLeft-(i.translateX||0),r[1]+=e.plotTop-(i.translateY||0),o.x=Math.min(0,r[0]),o.y=Math.min(0,r[1]),o.width=r[0]<0?Math.max(Math.abs(r[0]),a.width-r[0]):Math.max(Math.abs(r[0]),a.width),o.height=r[1]<0?Math.max(Math.abs(r[1]),a.height-Math.abs(r[1])):Math.max(Math.abs(r[1]),a.height),t.tracker?t.tracker.attr(o):(t.tracker=i.renderer.rect(o).addClass(\"highcharts-tracker\").add(i),R(t.tracker.element,\"mouseenter\",()=>io(t)),e.styledMode||t.tracker.attr({fill:\"rgba(0,0,0,0)\"}))}styledModeFormat(t){return t.replace('style=\"font-size: 0.8em\"','class=\"highcharts-header\"').replace(/style=\"color:{(point|series)\\.color}\"/g,'class=\"highcharts-color-{$1.colorIndex} {series.options.className} {point.options.className}\"')}headerFooterFormatter(t,e){let i=t.series,s=i.tooltipOptions,o=i.xAxis,r=o?.dateTime,a={isFooter:e,point:t},n=s.xDateFormat||\"\",h=s[e?\"footerFormat\":\"headerFormat\"];return Q(this,\"headerFormatter\",a,function(e){if(r&&!n&&tl(t.key)&&(n=r.getXDateFormat(t.key,s.dateTimeLabelFormats)),r&&n){if(tg(n)){let t=n;it[0]=e=>i.chart.time.dateFormat(t,e),n=\"%0\"}(t.tooltipDateKeys||[\"key\"]).forEach(t=>{h=h.replace(RegExp(\"point\\\\.\"+t+\"([ \\\\)}])\"),`(point.${t}:${n})$1`)})}i.chart.styledMode&&(h=this.styledModeFormat(h)),e.text=e8(h,t,this.chart)}),a.text||\"\"}update(t){this.destroy(),this.init(this.chart,tu(!0,this.options,t))}updatePosition(t){let{chart:e,container:i,distance:s,options:o,pointer:r,renderer:a}=this,{height:n=0,width:h=0}=this.getLabel(),{fixed:l,positioner:d}=o,{left:c,top:p,scaleX:g,scaleY:u}=r.getChartPosition(),f=(d||l&&this.getFixedPosition||this.getPosition).call(this,h,n,t,this),m=B.doc,x=(t.plotX||0)+e.plotLeft,y=(t.plotY||0)+e.plotTop,b;if(a&&i){let{scrollLeft:t=0,scrollTop:r=0}=e.scrollablePlotArea?.scrollingContainer||{};f.x+=t+c,f.y+=r+p,b=(o.borderWidth||0)+2*s+2,a.setSize(G(h+b,0,m.documentElement.clientWidth)-1,n+b,!1),(1!==g||1!==u)&&($(i,{transform:`scale(${g}, ${u})`}),x*=g,y*=u),x+=c-f.x,y+=p-f.y}this.move(Math.round(f.x),Math.round(f.y||0),x,y)}}(l=ir||(ir={})).compose=function(t){tk(e7,\"Core.Tooltip\")&&R(t,\"afterInit\",function(){let t=this.chart;t.options.tooltip&&(t.tooltip=new l(t,t.options.tooltip,this))})};let ia=ir,{animObject:ih}=tQ,{defaultOptions:il}=tY,{format:id}=es;class ic{constructor(t,e,i){this.formatPrefix=\"point\",this.visible=!0,this.point=this,this.series=t,this.applyOptions(e,i),this.id??(this.id=tB()),this.resolveColor(),this.dataLabelOnNull??(this.dataLabelOnNull=t.options.nullInteraction),t.chart.pointCount++,this.category=t.xAxis?.categories?.[this.x]??this.x,this.key=this.name??this.category,Q(this,\"afterInit\")}animateBeforeDestroy(){let t=this,e={x:t.startXPos,opacity:0},i=t.getGraphicalProps();i.singular.forEach(function(i){t[i]=t[i].animate(\"dataLabel\"===i?{x:t[i].startXPos,y:t[i].startYPos,opacity:0}:e)}),i.plural.forEach(function(e){t[e].forEach(function(e){e.element&&e.animate(q({x:t.startXPos},e.startYPos?{x:e.startXPos,y:e.startYPos}:{}))})})}applyOptions(t,e){let i=this.series,s=i.options.pointValKey||i.pointValKey;return q(this,t=ic.prototype.optionsToObject.call(this,t)),this.options?this.options=i.chart.options.chart.allowMutatingData?q(this.options,t):tu(this.options,t):this.options=t,t.group&&delete this.group,t.dataLabels&&delete this.dataLabels,s&&(this.y=ic.prototype.getNestedProperty.call(this,s)),this.selected&&(this.state=\"select\"),\"name\"in this&&void 0===e&&i.xAxis&&i.xAxis.hasNames&&(this.x=i.xAxis.nameToX(this)),void 0===this.x&&i?this.x=e??i.autoIncrement():tl(t.x)&&i.options.relativeXValue?this.x=i.autoIncrement(t.x):\"string\"==typeof this.x&&(e??(e=i.chart.time.parse(this.x)),tl(e)&&(this.x=e)),this.isNull=this.isValid&&!this.isValid(),this.formatPrefix=this.isNull?\"null\":\"point\",this}destroy(){if(!this.destroyed){let t=this,e=t.series,i=e.chart,s=e.options.dataSorting,o=i.hoverPoints,r=ih(t.series.chart.renderer.globalAnimation),a=()=>{for(let e in(t.graphic||t.graphics||t.dataLabel||t.dataLabels)&&(tS(t),t.destroyElements()),t)delete t[e]};t.legendItem&&i.legend.destroyItem(t),o&&(t.setState(),K(o,t),o.length||(i.hoverPoints=null)),t===i.hoverPoint&&t.onMouseOut(),s?.enabled?(this.animateBeforeDestroy(),tA(a,r.duration)):a(),i.pointCount--}this.destroyed=!0}destroyElements(t){let e=this,i=e.getGraphicalProps(t);i.singular.forEach(function(t){e[t]=e[t].destroy()}),i.plural.forEach(function(t){e[t].forEach(function(t){t?.element&&t.destroy()}),delete e[t]})}firePointEvent(t,e,i){let s=this,o=this.series.options;s.manageEvent(t),\"click\"===t&&o.allowPointSelect&&(i=function(t){!s.destroyed&&s.select&&s.select(null,t.ctrlKey||t.metaKey||t.shiftKey)}),Q(s,t,e,i)}getClassName(){return\"highcharts-point\"+(this.selected?\" highcharts-point-select\":\"\")+(this.negative&&!1!==this.series.options.negativeColor?\" highcharts-negative\":\"\")+(this.isNull?\" highcharts-null-point\":\"\")+(void 0!==this.colorIndex?\" highcharts-color-\"+this.colorIndex:\"\")+(this.options.className?\" \"+this.options.className:\"\")+(this.zone?.className?\" \"+this.zone.className.replace(\"highcharts-negative\",\"\"):\"\")}getGraphicalProps(t){let e,i,s=this,o=[],r={singular:[],plural:[]};for((t=t||{graphic:1,dataLabel:1}).graphic&&o.push(\"graphic\",\"connector\"),t.dataLabel&&o.push(\"dataLabel\",\"dataLabelPath\",\"dataLabelUpper\"),i=o.length;i--;)s[e=o[i]]&&r.singular.push(e);return[\"graphic\",\"dataLabel\"].forEach(function(e){let i=e+\"s\";t[e]&&s[i]&&r.plural.push(i)}),r}getNestedProperty(t){if(t)return 0===t.indexOf(\"custom.\")?ts(t,this.options):this[t]}getZone(){let t=this.series,e=t.zones,i=t.zoneAxis||\"y\",s,o=0;for(s=e[0];this[i]>=s.value;)s=e[++o];return this.nonZonedColor||(this.nonZonedColor=this.color),s?.color&&!this.options.color?this.color=s.color:this.color=this.nonZonedColor,s}hasNewShapeType(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType}isValid(){return(tl(this.x)||this.x instanceof Date)&&tl(this.y)}optionsToObject(t){let e=this.series,i=e.options.keys,s=i||e.pointArrayMap||[\"y\"],o=s.length,r={},a,n=0,h=0;if(tl(t)||null===t)r[s[0]]=t;else if(tc(t))for(!i&&t.length>o&&(\"string\"==(a=typeof t[0])?e.xAxis?.dateTime?r.x=e.chart.time.parse(t[0]):r.name=t[0]:\"number\"===a&&(r.x=t[0]),n++);h0?ic.prototype.setNestedProperty(r,t[n],s[h]):r[s[h]]=t[n]),n++,h++;else\"object\"==typeof t&&(r=t,t.dataLabels&&(e.hasDataLabels=()=>!0),t.marker&&(e._hasPointMarkers=!0));return r}pos(t,e=this.plotY){if(!this.destroyed){let{plotX:i,series:s}=this,{chart:o,xAxis:r,yAxis:a}=s,n=0,h=0;if(tl(i)&&tl(e))return t&&(n=r?r.pos:o.plotLeft,h=a?a.pos:o.plotTop),o.inverted&&r&&a?[a.len-e+h,r.len-i+n]:[i+n,e+h]}}resolveColor(){let t=this.series,e=t.chart.options.chart,i=t.chart.styledMode,s,o,r=e.colorCount,a;delete this.nonZonedColor,t.options.colorByPoint?(i||(s=(o=t.options.colors||t.chart.options.colors)[t.colorCounter],r=o.length),a=t.colorCounter,t.colorCounter++,t.colorCounter===r&&(t.colorCounter=0)):(i||(s=t.color),a=t.colorIndex),this.colorIndex=tb(this.options.colorIndex,a),this.color=tb(this.options.color,s)}setNestedProperty(t,e,i){return i.split(\".\").reduce(function(t,i,s,o){let r=o.length-1===s;return t[i]=r?e:tg(t[i],!0)?t[i]:{},t[i]},t),t}shouldDraw(){return!this.isNull}tooltipFormatter(t){let{chart:e,pointArrayMap:i=[\"y\"],tooltipOptions:s}=this.series,{valueDecimals:o=\"\",valuePrefix:r=\"\",valueSuffix:a=\"\"}=s;return e.styledMode&&(t=e.tooltip?.styledModeFormat(t)||t),i.forEach(e=>{e=\"{point.\"+e,(r||a)&&(t=t.replace(RegExp(e+\"}\",\"g\"),r+e+\"}\"+a)),t=t.replace(RegExp(e+\"}\",\"g\"),e+\":,.\"+o+\"f}\")}),id(t,this,e)}update(t,e,i,s){let o,r=this,a=r.series,n=r.graphic,h=a.chart,l=a.options,d=l.data;function c(){r.applyOptions(t);let s=n&&r.hasMockGraphic,c=null===r.y?!s:s;n&&c&&(r.graphic=n.destroy(),delete r.hasMockGraphic),tg(t,!0)&&(n?.element&&t&&t.marker&&void 0!==t.marker.symbol&&(r.graphic=n.destroy()),t?.dataLabels&&r.dataLabel&&(r.dataLabel=r.dataLabel.destroy())),o=r.index;let p={};for(let t of a.dataColumnKeys())p[t]=r[t];a.dataTable.setRow(p,o),d&&!a.processedData&&(d[o]=tg(d[o],!0)||tg(t,!0)?r.options:t??d[o]),a.isDirty=a.isDirtyData=!0,!a.fixedBox&&a.hasCartesianSeries&&(h.isDirtyBox=!0),\"point\"===l.legendType&&(h.isDirtyLegend=!0),e&&h.redraw(i)}e=tb(e,!0),!1===s?c():r.firePointEvent(\"update\",{options:t},c)}remove(t,e){this.series.removePoint(this.series.data.indexOf(this),t,e)}select(t,e){let i=this,s=i.series,o=s.chart;t=tb(t,!i.selected),this.selectedStaging=t,i.firePointEvent(t?\"select\":\"unselect\",{accumulate:e},function(){i.selected=i.options.selected=t,s.options.data[s.data.indexOf(i)]=i.options,i.setState(t&&\"select\"),e||o.getSelectedPoints().forEach(function(t){let e=t.series;t.selected&&t!==i&&(t.selected=t.options.selected=!1,e.options.data[e.data.indexOf(t)]=t.options,t.setState(o.hoverPoints&&e.options.inactiveOtherPoints?\"inactive\":\"\"),t.firePointEvent(\"unselect\"))})}),delete this.selectedStaging}onMouseOver(t){let{inverted:e,pointer:i}=this.series.chart;i&&(t=t?i.normalize(t):i.getChartCoordinatesFromPoint(this,e),i.runPointActions(t,this))}onMouseOut(){let t=this.series.chart;this.firePointEvent(\"mouseOut\"),this.series.options.inactiveOtherPoints||(t.hoverPoints||[]).forEach(function(t){t.setState()}),t.hoverPoints=t.hoverPoint=null}manageEvent(t){let e=tu(this.series.options.point,this.options),i=e.events?.[t];tp(i)&&(!this.hcEvents?.[t]||this.hcEvents?.[t]?.map(t=>t.fn).indexOf(i)===-1)?(this.importedUserEvent?.(),this.importedUserEvent=R(this,t,i),this.hcEvents&&(this.hcEvents[t].userEvent=!0)):this.importedUserEvent&&!i&&this.hcEvents?.[t]&&this.hcEvents?.[t].userEvent&&(tS(this,t),delete this.hcEvents[t],Object.keys(this.hcEvents)||delete this.importedUserEvent)}setState(t,e){let i=this.series,s=this.state,o=i.options.states[t||\"normal\"]||{},r=il.plotOptions[i.type].marker&&i.options.marker,a=r&&!1===r.enabled,n=r?.states?.[t||\"normal\"]||{},h=!1===n.enabled,l=this.marker||{},d=i.chart,c=r&&i.markerAttribs,p=i.halo,g,u,f,m=i.stateMarkerGraphic,x;if((t=t||\"\")===this.state&&!e||this.selected&&\"select\"!==t||!1===o.enabled||t&&(h||a&&!1===n.enabled)||t&&l.states&&l.states[t]&&!1===l.states[t].enabled)return;if(this.state=t,c&&(g=i.markerAttribs(this,t)),this.graphic&&!this.hasMockGraphic){if(s&&this.graphic.removeClass(\"highcharts-point-\"+s),t&&this.graphic.addClass(\"highcharts-point-\"+t),!d.styledMode){u=i.pointAttribs(this,t),f=tb(d.options.chart.animation,o.animation);let e=u.opacity;i.options.inactiveOtherPoints&&tl(e)&&(this.dataLabels||[]).forEach(function(t){t&&!t.hasClass(\"highcharts-data-label-hidden\")&&(t.animate({opacity:e},f),t.connector&&t.connector.animate({opacity:e},f))}),this.graphic.animate(u,f)}g&&this.graphic.animate(g,tb(d.options.chart.animation,n.animation,r.animation)),m&&m.hide()}else t&&n&&(x=l.symbol||i.symbol,m&&m.currentSymbol!==x&&(m=m.destroy()),g&&(m?m[e?\"animate\":\"attr\"]({x:g.x,y:g.y}):x&&(i.stateMarkerGraphic=m=d.renderer.symbol(x,g.x,g.y,g.width,g.height,tu(r,n)).add(i.markerGroup),m.currentSymbol=x)),!d.styledMode&&m&&\"inactive\"!==this.state&&m.attr(i.pointAttribs(this,t))),m&&(m[t&&this.isInside?\"show\":\"hide\"](),m.element.point=this,m.addClass(this.getClassName(),!0));let y=o.halo,b=this.graphic||m,v=b?.visibility||\"inherit\";y?.size&&b&&\"hidden\"!==v&&!this.isCluster?(p||(i.halo=p=d.renderer.path().add(b.parentGroup)),p.show()[e?\"animate\":\"attr\"]({d:this.haloPath(y.size)}),p.attr({class:\"highcharts-halo highcharts-color-\"+tb(this.colorIndex,i.colorIndex)+(this.className?\" \"+this.className:\"\"),visibility:v,zIndex:-1}),p.point=this,d.styledMode||p.attr(q({fill:this.color||i.color,\"fill-opacity\":y.opacity},t6.filterUserAttributes(y.attributes||{})))):p?.point?.haloPath&&!p.point.destroyed&&p.animate({d:p.point.haloPath(0)},null,p.hide),Q(this,\"afterSetState\",{state:t})}haloPath(t){let e=this.pos();return e?this.series.chart.renderer.symbols.circle(j(e[0],1)-t,e[1]-t,2*t,2*t):[]}}let ip=ic,{parse:ig}=tU,{charts:iu,composed:im,isTouchDevice:ix}=B,iy=(t,e)=>!V(e)||t[`${e}Key`];class ib{applyInactiveState(t=[]){let e=[];for(let i of(t.forEach(t=>{let i=t.series;e.push(i),i.linkedParent&&e.push(i.linkedParent),i.linkedSeries&&e.push.apply(e,i.linkedSeries),i.navigatorSeries&&e.push(i.navigatorSeries),i.boosted&&i.markerGroup&&e.push.apply(e,this.chart.series.filter(t=>t.markerGroup===i.markerGroup))}),this.chart.series)){let t=i.options;t.states?.inactive?.enabled!==!1&&(-1===e.indexOf(i)?i.setState(\"inactive\",!0):t.inactiveOtherPoints&&i.setAllPointsToState(\"inactive\"))}}destroy(){let t=this;this.eventsToUnbind.forEach(t=>t()),this.eventsToUnbind=[],!B.chartCount&&(ib.unbindDocumentMouseUp.forEach(t=>t.unbind()),ib.unbindDocumentMouseUp.length=0,ib.unbindDocumentTouchEnd&&(ib.unbindDocumentTouchEnd=ib.unbindDocumentTouchEnd())),tm(t,function(e,i){t[i]=void 0})}getSelectionMarkerAttrs(t,e){let i={args:{chartX:t,chartY:e},attrs:{},shapeType:\"rect\"};return Q(this,\"getSelectionMarkerAttrs\",i,i=>{let s,{chart:o,zoomHor:r,zoomVert:a}=this,{mouseDownX:n=0,mouseDownY:h=0}=o,l=i.attrs;l.x=o.plotLeft,l.y=o.plotTop,l.width=r?1:o.plotWidth,l.height=a?1:o.plotHeight,r&&(l.width=Math.max(1,Math.abs(s=t-n)),l.x=(s>0?0:s)+n),a&&(l.height=Math.max(1,Math.abs(s=e-h)),l.y=(s>0?0:s)+h)}),i}drag(t){let{chart:e}=this,{mouseDownX:i=0,mouseDownY:s=0}=e,{panning:o,panKey:r,selectionMarkerFill:a}=e.options.chart,n=e.plotLeft,h=e.plotTop,l=e.plotWidth,d=e.plotHeight,c=tg(o)?o.enabled:o,p=r&&t[`${r}Key`],g=t.chartX,u=t.chartY,f,m=this.selectionMarker;if((!m||!m.touch)&&(gn+l&&(g=n+l),uh+d&&(u=h+d),this.hasDragged=Math.sqrt(Math.pow(i-g,2)+Math.pow(s-u,2)),this.hasDragged>10)){f=e.isInsidePlot(i-n,s-h,{visiblePlotOnly:!0});let{shapeType:l,attrs:d}=this.getSelectionMarkerAttrs(g,u);this.hasZoom&&f&&!p&&!m&&(this.selectionMarker=m=e.renderer[l](),m.attr({class:\"highcharts-selection-marker\",zIndex:7}).add(),e.styledMode||m.attr({fill:a||ig(\"#334eff\").setOpacity(.25).get()})),m&&m.attr(d),f&&!m&&c&&iy(t,r)&&e.pan(t,o)}}dragStart(t){let e=this.chart;e.mouseIsDown=t.type,e.cancelClick=!1,e.mouseDownX=t.chartX,e.mouseDownY=t.chartY}getSelectionBox(t){let e={args:{marker:t},result:t.getBBox()};return Q(this,\"getSelectionBox\",e),e.result}drop(t){let e,{chart:i,selectionMarker:s}=this;for(let t of i.axes)t.isPanning&&(t.isPanning=!1,(t.options.startOnTick||t.options.endOnTick||t.series.some(t=>t.boosted))&&(t.forceRedraw=!0,t.setExtremes(t.userMin,t.userMax,!1),e=!0));if(e&&i.redraw(),s&&t){if(this.hasDragged){let e=this.getSelectionBox(s);i.transform({axes:i.axes.filter(t=>t.zoomEnabled&&(\"xAxis\"===t.coll&&this.zoomX||\"yAxis\"===t.coll&&this.zoomY)),selection:{originalEvent:t,xAxis:[],yAxis:[],...e},from:e})}tl(i.index)&&(this.selectionMarker=s.destroy())}i&&tl(i.index)&&($(i.container,{cursor:i._cursor}),i.cancelClick=this.hasDragged>10,i.mouseIsDown=!1,this.hasDragged=0,this.pinchDown=[],this.hasPinchMoved=!1)}findNearestKDPoint(t,e,i){let s;return t.forEach(function(t){var o;let r,a,n,h=!(t.noSharedTooltip&&e)&&0>t.options.findNearestPointBy.indexOf(\"y\"),l=t.searchPoint(i,h);tg(l,!0)&&l.series&&(!tg(s,!0)||(r=(o=s).distX-l.distX,a=o.dist-l.dist,n=l.series.group?.zIndex-o.series.group?.zIndex,(0!==r&&e?r:0!==a?a:0!==n?n:o.series.index>l.series.index?-1:1)>0))&&(s=l)}),s}getChartCoordinatesFromPoint(t,e){let{xAxis:i,yAxis:s}=t.series,o=t.shapeArgs;if(i&&s){let r=t.clientX??t.plotX??0,a=t.plotY||0;return t.isNode&&o&&tl(o.x)&&tl(o.y)&&(r=o.x,a=o.y),e?{chartX:s.len+s.pos-a,chartY:i.len+i.pos-r}:{chartX:r+i.pos,chartY:a+s.pos}}if(o?.x&&o.y)return{chartX:o.x,chartY:o.y}}getChartPosition(){if(this.chartPosition)return this.chartPosition;let{container:t}=this.chart,e=tx(t);this.chartPosition={left:e.left,top:e.top,scaleX:1,scaleY:1};let{offsetHeight:i,offsetWidth:s}=t;return s>2&&i>2&&(this.chartPosition.scaleX=e.width/s,this.chartPosition.scaleY=e.height/i),this.chartPosition}getCoordinates(t){let e={xAxis:[],yAxis:[]};for(let i of this.chart.axes)e[i.isXAxis?\"xAxis\":\"yAxis\"].push({axis:i,value:i.toValue(t[i.horiz?\"chartX\":\"chartY\"])});return e}getHoverData(t,e,i,s,o,r){let a=[],n=function(t){return t.visible&&!(!o&&t.directTouch)&&tb(t.options.enableMouseTracking,!0)},h=e,l,d={chartX:r?r.chartX:void 0,chartY:r?r.chartY:void 0,shared:o};Q(this,\"beforeGetHoverData\",d),l=h&&!h.stickyTracking?[h]:i.filter(t=>t.stickyTracking&&(d.filter||n)(t));let c=s&&t||!r?t:this.findNearestKDPoint(l,o,r);return h=c?.series,c&&(o&&!h.noSharedTooltip?(l=i.filter(function(t){return d.filter?d.filter(t):n(t)&&!t.noSharedTooltip})).forEach(function(t){let e=t.options?.nullInteraction,i=tr(t.points,function(t){return t.x===c.x&&(!t.isNull||!!e)});tg(i)&&(t.boosted&&t.boost&&(i=t.boost.getPoint(i)),a.push(i))}):a.push(c)),Q(this,\"afterGetHoverData\",d={hoverPoint:c}),{hoverPoint:d.hoverPoint,hoverSeries:h,hoverPoints:a}}getPointFromEvent(t){let e=t.target,i;for(;e&&!i;)i=e.point,e=e.parentNode;return i}onTrackerMouseOut(t){let e=this.chart,i=t.relatedTarget,s=e.hoverSeries;this.isDirectTouch=!1,!s||!i||s.stickyTracking||this.inClass(i,\"highcharts-tooltip\")||this.inClass(i,\"highcharts-series-\"+s.index)&&this.inClass(i,\"highcharts-tracker\")||s.onMouseOut()}inClass(t,e){let i=t,s;for(;i;){if(s=X(i,\"class\")){if(-1!==s.indexOf(e))return!0;if(-1!==s.indexOf(\"highcharts-container\"))return!1}i=i.parentElement}}constructor(t,e){this.hasDragged=0,this.pointerCaptureEventsToUnbind=[],this.eventsToUnbind=[],this.options=e,this.chart=t,this.runChartClick=!!e.chart.events?.click,this.pinchDown=[],this.setDOMEvents(),Q(this,\"afterInit\")}normalize(t,e){let i=t.touches,s=i?i.length?i.item(0):tb(i.changedTouches,t.changedTouches)[0]:t;e||(e=this.getChartPosition());let o=s.pageX-e.left,r=s.pageY-e.top;return q(t,{chartX:Math.round(o/=e.scaleX),chartY:Math.round(r/=e.scaleY)})}onContainerClick(t){let e=this.chart,i=e.hoverPoint,s=this.normalize(t),o=e.plotLeft,r=e.plotTop;!e.cancelClick&&(i&&this.inClass(s.target,\"highcharts-tracker\")?(Q(i.series,\"click\",q(s,{point:i})),e.hoverPoint&&i.firePointEvent(\"click\",s)):(q(s,this.getCoordinates(s)),e.isInsidePlot(s.chartX-o,s.chartY-r,{visiblePlotOnly:!0})&&Q(e,\"click\",s)))}onContainerMouseDown(t){let e=(1&(t.buttons||t.button))==1;t=this.normalize(t),B.isFirefox&&0!==t.button&&this.onContainerMouseMove(t),(void 0===t.button||e)&&(this.zoomOption(t),e&&t.preventDefault?.(),this.dragStart(t))}onContainerMouseLeave(t){let{pointer:e}=iu[tb(ib.hoverChartIndex,-1)]||{};t=this.normalize(t),this.onContainerMouseMove(t),e&&!this.inClass(t.relatedTarget,\"highcharts-tooltip\")&&(e.reset(),e.chartPosition=void 0)}onContainerMouseEnter(){delete this.chartPosition}onContainerMouseMove(t){let e=this.chart,i=e.tooltip,s=this.normalize(t);this.setHoverChartIndex(t),(\"mousedown\"===e.mouseIsDown||this.touchSelect(s))&&this.drag(s),!e.exporting?.openMenu&&(this.inClass(s.target,\"highcharts-tracker\")||e.isInsidePlot(s.chartX-e.plotLeft,s.chartY-e.plotTop,{visiblePlotOnly:!0}))&&!i?.shouldStickOnContact(s)&&(this.inClass(s.target,\"highcharts-no-tooltip\")?this.reset(!1,0):this.runPointActions(s))}onDocumentTouchEnd(t){this.onDocumentMouseUp(t)}onContainerTouchMove(t){this.touchSelect(t)?this.onContainerMouseMove(t):this.touch(t)}onContainerTouchStart(t){this.touchSelect(t)?this.onContainerMouseDown(t):(this.zoomOption(t),this.touch(t,!0))}onDocumentMouseMove(t){let e=this.chart,i=e.tooltip,s=this.chartPosition,o=this.normalize(t,s);!s||e.isInsidePlot(o.chartX-e.plotLeft,o.chartY-e.plotTop,{visiblePlotOnly:!0})||i?.shouldStickOnContact(o)||o.target!==e.container.ownerDocument&&this.inClass(o.target,\"highcharts-tracker\")||this.reset()}onDocumentMouseUp(t){t?.touches&&this.hasPinchMoved&&t?.preventDefault?.(),iu[tb(ib.hoverChartIndex,-1)]?.pointer?.drop(t)}pinch(t){let e=this,{chart:i,hasZoom:s,lastTouches:o}=e,r=[].map.call(t.touches||[],t=>e.normalize(t)),a=r.length,n=1===a&&(e.inClass(t.target,\"highcharts-tracker\")&&i.runTrackerClick||e.runChartClick),h=i.tooltip,l=1===a&&tb(h?.options.followTouchMove,!0);a>1?e.initiated=!0:l&&(e.initiated=!1),s&&e.initiated&&!n&&!1!==t.cancelable&&t.preventDefault(),\"touchstart\"===t.type?(e.pinchDown=r,e.res=!0,i.mouseDownX=t.chartX):l?this.runPointActions(e.normalize(t)):o&&(Q(i,\"touchpan\",{originalEvent:t,touches:r},()=>{let e=t=>{let e=t[0],i=t[1]||e;return{x:e.chartX,y:e.chartY,width:i.chartX-e.chartX,height:i.chartY-e.chartY}};i.transform({axes:i.axes.filter(t=>t.zoomEnabled&&(this.zoomHor&&t.horiz||this.zoomVert&&!t.horiz)),to:e(r),from:e(o),trigger:t.type})}),e.res&&(e.res=!1,this.reset(!1,0))),e.lastTouches=r}reset(t,e){let i=this.chart,s=i.hoverSeries,o=i.hoverPoint,r=i.hoverPoints,a=i.tooltip,n=a?.shared?r:o;t&&n&&tT(n).forEach(function(e){e.series.isCartesian&&void 0===e.plotX&&(t=!1)}),t?a&&n&&tT(n).length&&(a.refresh(n),a.shared&&r?r.forEach(function(t){t.setState(t.state,!0),t.series.isCartesian&&(t.series.xAxis.crosshair&&t.series.xAxis.drawCrosshair(null,t),t.series.yAxis.crosshair&&t.series.yAxis.drawCrosshair(null,t))}):o&&(o.setState(o.state,!0),i.axes.forEach(function(t){t.crosshair&&o.series[t.coll]===t&&t.drawCrosshair(null,o)}))):(o&&o.onMouseOut(),r&&r.forEach(function(t){t.setState()}),s&&s.onMouseOut(),a&&a.hide(e),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),i.axes.forEach(function(t){t.hideCrosshair()}),i.hoverPoints=i.hoverPoint=void 0)}runPointActions(t,e,i){let s=this.chart,o=s.series,r=s.tooltip?.options.enabled?s.tooltip:void 0,a=!!r&&r.shared,n=e||s.hoverPoint,h=n?.series||s.hoverSeries,l=(!t||\"touchmove\"!==t.type)&&(!!e||h?.directTouch&&this.isDirectTouch),d=this.getHoverData(n,h,o,l,a,t);n=d.hoverPoint,h=d.hoverSeries;let c=d.hoverPoints,p=h?.tooltipOptions.followPointer&&!h.tooltipOptions.split,g=a&&h&&!h.noSharedTooltip;if(n&&(i||n!==s.hoverPoint||r?.isHidden)){if((s.hoverPoints||[]).forEach(function(t){-1===c.indexOf(t)&&t.setState()}),s.hoverSeries!==h&&h.onMouseOver(),this.applyInactiveState(c),(c||[]).forEach(function(t){t.setState(\"hover\")}),s.hoverPoint&&s.hoverPoint.firePointEvent(\"mouseOut\"),!n.series)return;s.hoverPoints=c,s.hoverPoint=n,n.firePointEvent(\"mouseOver\",void 0,()=>{r&&n&&r.refresh(g?c:n,t)})}else if(p&&r&&!r.isHidden){let e=r.getAnchor([{}],t);s.isInsidePlot(e[0],e[1],{visiblePlotOnly:!0})&&r.updatePosition({plotX:e[0],plotY:e[1]})}this.unDocMouseMove||(this.unDocMouseMove=R(s.container.ownerDocument,\"mousemove\",t=>iu[ib.hoverChartIndex??-1]?.pointer?.onDocumentMouseMove(t)),this.eventsToUnbind.push(this.unDocMouseMove)),s.axes.forEach(function(e){let i,o=e.crosshair?.snap??!0;o&&((i=s.hoverPoint)&&i.series[e.coll]===e||(i=tr(c,t=>t.series?.[e.coll]===e))),i||!o?e.drawCrosshair(t,i):e.hideCrosshair()})}setDOMEvents(){let t=this.chart.container,e=t.ownerDocument,i=t=>t.parentElement||t.getRootNode()?.host?.parentElement;t.onmousedown=this.onContainerMouseDown.bind(this),t.onmousemove=this.onContainerMouseMove.bind(this),t.onclick=this.onContainerClick.bind(this),this.eventsToUnbind.push(R(t,\"mouseenter\",this.onContainerMouseEnter.bind(this)),R(t,\"mouseleave\",this.onContainerMouseLeave.bind(this))),ib.unbindDocumentMouseUp.some(t=>t.doc===e)||ib.unbindDocumentMouseUp.push({doc:e,unbind:R(e,\"mouseup\",this.onDocumentMouseUp.bind(this))});let s=i(this.chart.renderTo);for(;s&&\"BODY\"!==s.tagName;)this.eventsToUnbind.push(R(s,\"scroll\",()=>{delete this.chartPosition})),s=i(s);this.eventsToUnbind.push(R(t,\"touchstart\",this.onContainerTouchStart.bind(this),{passive:!1}),R(t,\"touchmove\",this.onContainerTouchMove.bind(this),{passive:!1})),ib.unbindDocumentTouchEnd||(ib.unbindDocumentTouchEnd=R(e,\"touchend\",this.onDocumentTouchEnd.bind(this),{passive:!1})),this.setPointerCapture(),R(this.chart,\"redraw\",this.setPointerCapture.bind(this))}setPointerCapture(){if(!ix)return;let t=this.pointerCaptureEventsToUnbind,e=this.chart,i=e.container,s=tb(e.options.tooltip?.followTouchMove,!0)&&e.series.some(t=>t.options.findNearestPointBy.indexOf(\"y\")>-1);!this.hasPointerCapture&&s?(t.push(R(i,\"pointerdown\",t=>{t.target?.hasPointerCapture(t.pointerId)&&t.target?.releasePointerCapture(t.pointerId)}),R(i,\"pointermove\",t=>{e.pointer?.getPointFromEvent(t)?.onMouseOver(t)})),e.styledMode||$(i,{\"touch-action\":\"none\"}),i.className+=\" highcharts-no-touch-action\",this.hasPointerCapture=!0):this.hasPointerCapture&&!s&&(t.forEach(t=>t()),t.length=0,e.styledMode||$(i,{\"touch-action\":tb(e.options.chart.style?.[\"touch-action\"],\"manipulation\")}),i.className=i.className.replace(\" highcharts-no-touch-action\",\"\"),this.hasPointerCapture=!1)}setHoverChartIndex(t){let e=this.chart,i=B.charts[tb(ib.hoverChartIndex,-1)];if(i&&i!==e){let s={relatedTarget:e.container};t&&!t?.relatedTarget&&Object.assign({},t,s),i.pointer?.onContainerMouseLeave(t||s)}i?.mouseIsDown||(ib.hoverChartIndex=e.index)}touch(t,e){let i,{chart:s,pinchDown:o=[]}=this;this.setHoverChartIndex(),1===(t=this.normalize(t)).touches.length?s.isInsidePlot(t.chartX-s.plotLeft,t.chartY-s.plotTop,{visiblePlotOnly:!0})&&!s.exporting?.openMenu?(e&&this.runPointActions(t),\"touchmove\"===t.type&&(this.hasPinchMoved=i=!!o[0]&&Math.pow(o[0].chartX-t.chartX,2)+Math.pow(o[0].chartY-t.chartY,2)>=16),tb(i,!0)&&this.pinch(t)):e&&this.reset():2===t.touches.length&&this.pinch(t)}touchSelect(t){return!!(this.chart.zooming.singleTouch&&t.touches&&1===t.touches.length)}zoomOption(t){let e=this.chart,i=e.inverted,s=e.zooming.type||\"\",o,r;/touch/.test(t.type)&&(s=tb(e.zooming.pinchType,s)),this.zoomX=o=/x/.test(s),this.zoomY=r=/y/.test(s),this.zoomHor=o&&!i||r&&i,this.zoomVert=r&&!i||o&&i,this.hasZoom=(o||r)&&iy(t,e.zooming.key)}}ib.unbindDocumentMouseUp=[],(d=ib||(ib={})).compose=function(t){tk(im,\"Core.Pointer\")&&R(t,\"beforeRender\",function(){this.pointer=new d(this,this.options)})};let iv=ib,{setLength:ik,splice:iw}={convertToNumber:function(t,e){switch(typeof t){case\"boolean\":return+!!t;case\"number\":return isNaN(t)&&!e?null:t;default:return isNaN(t=parseFloat(`${t??\"\"}`))&&!e?null:t}},setLength:function(t,e,i){return Array.isArray(t)?(t.length=e,t):t[i?\"subarray\":\"slice\"](0,e)},splice:function(t,e,i,s,o=[]){if(Array.isArray(t))return Array.isArray(o)||(o=Array.from(o)),{removed:t.splice(e,i,...o),array:t};let r=Object.getPrototypeOf(t).constructor,a=t[s?\"subarray\":\"slice\"](e,e+i),n=new r(t.length-i+o.length);return n.set(t.subarray(0,e),0),n.set(o,e),n.set(t.subarray(e+i),e+o.length),{removed:a,array:n}}},iM=class{constructor(t={}){this.autoId=!t.id,this.columns={},this.id=t.id||tB(),this.rowCount=0,this.versionTag=tB();let e=0;tm(t.columns||{},(t,i)=>{this.columns[i]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,tm(this.columns,(e,i)=>{e.length!==t&&(this.columns[i]=ik(e,t))})}deleteRows(t,e=1){if(e>0&&t{this.columns[o]=iw(s,t,e).array,i=s.length}),this.rowCount=i}Q(this,\"afterDeleteRows\",{rowIndex:t,rowCount:e}),this.versionTag=tB()}getColumn(t,e){return this.columns[t]}getColumns(t,e){return(t||Object.keys(this.columns)).reduce((t,e)=>(t[e]=this.columns[e],t),{})}getRow(t,e){return(e||Object.keys(this.columns)).map(e=>this.columns[e]?.[t])}setColumn(t,e=[],i=0,s){this.setColumns({[t]:e},i,s)}setColumns(t,e,i){let s=this.rowCount;tm(t,(t,e)=>{this.columns[e]=t.slice(),s=t.length}),this.applyRowCount(s),i?.silent||(Q(this,\"afterSetColumns\"),this.versionTag=tB())}setRow(t,e=this.rowCount,i,s){let{columns:o}=this,r=i?this.rowCount+1:e+1,a=Object.keys(t);if(s?.addColumns!==!1)for(let t=0,e=a.length;t{a||s?.addColumns===!1||(a=Array(r)),a&&(i?a=iw(a,e,0,!0,[t[n]??null]).array:a[e]=t[n]??null,o[n]=a)}),r>this.rowCount&&this.applyRowCount(r),s?.silent||(Q(this,\"afterSetRows\"),this.versionTag=tB())}getModified(){return this.modified||this}};var iS=M||(M={});function iT(t,e,i){let s=this.legendItem=this.legendItem||{},{chart:o,options:r}=this,{baseline:a=0,symbolWidth:n,symbolHeight:h}=t,l=this.symbol||\"circle\",d=h/2,c=o.renderer,p=s.group,g=a-Math.round((t.fontMetrics?.b||h)*(i?.4:.3)),u={},f,m=r.marker,x=0;if(o.styledMode||(u[\"stroke-width\"]=Math.min(r.lineWidth||0,24),r.dashStyle?u.dashstyle=r.dashStyle:\"square\"!==r.linecap&&(u[\"stroke-linecap\"]=\"round\")),s.line=c.path().addClass(\"highcharts-graph\").attr(u).add(p),i&&(s.area=c.path().addClass(\"highcharts-area\").add(p)),u[\"stroke-linecap\"]&&(x=Math.min(s.line.strokeWidth(),n)/2),n){let t=[[\"M\",x,g],[\"L\",n-x,g]];s.line.attr({d:t}),s.area?.attr({d:[...t,[\"L\",n-x,a],[\"L\",x,a]]})}if(m&&!1!==m.enabled&&n){let t=Math.min(tb(m.radius,d),d);0===l.indexOf(\"url\")&&(m=tu(m,{width:h,height:h}),t=0),s.symbol=f=c.symbol(l,n/2-t,g-t,2*t,2*t,q({context:\"legend\"},m)).addClass(\"highcharts-point\").add(p),f.isMarker=!0}}iS.areaMarker=function(t,e){iT.call(this,t,e,!0)},iS.lineMarker=iT;let iC=M,{defaultOptions:iA}=tY;var iP=S||(S={});function iL(t,e){let i=iA.plotOptions||{},s=e.defaultOptions,o=e.prototype;return o.type=t,o.pointClass||(o.pointClass=ip),!iP.seriesTypes[t]&&(s&&(i[t]=s),iP.seriesTypes[t]=e,!0)}iP.seriesTypes=B.seriesTypes,iP.registerSeriesType=iL,iP.seriesType=function(t,e,i,s,o){let r=iA.plotOptions||{};if(e=e||\"\",r[t]=tu(r[e],i),delete iP.seriesTypes[t],iL(t,J(iP.seriesTypes[e]||B.Series,s)),iP.seriesTypes[t].prototype.type=t,o){class e extends ip{}q(e.prototype,o),iP.seriesTypes[t].prototype.pointClass=e}return iP.seriesTypes[t]};let iO=S,{animObject:iE,setAnimation:iI}=tQ,{defaultOptions:iD}=tY,{registerEventOptions:iB}=eV,{svg:iN,win:iz}=B,{seriesTypes:iR}=iO,{format:iW}=es;class iH{constructor(){this.zoneAxis=\"y\"}init(t,e){let i;Q(this,\"init\",{options:e}),this.dataTable??(this.dataTable=new iM);let s=t.series;this.eventsToUnbind=[],this.chart=t,this.options=this.setOptions(e);let o=this.options,r=!1!==o.visible;this.linkedSeries=[],this.bindAxes(),q(this,{name:o.name,state:\"\",visible:r,selected:!0===o.selected}),iB(this,o);let a=o.events;(a?.click||o.point?.events?.click||o.allowPointSelect)&&(t.runTrackerClick=!0),this.getColor(),this.getSymbol(),this.isCartesian&&(t.hasCartesianSeries=!0),s.length&&(i=s[s.length-1]),this._i=tb(i?._i,-1)+1,this.opacity=this.options.opacity,t.orderItems(\"series\",tI(this,s)),o.dataSorting?.enabled?this.setDataSortingOptions():this.points||this.data||this.setData(o.data,!1),Q(this,\"afterInit\")}is(t){return iR[t]&&this instanceof iR[t]}bindAxes(){let t,e=this,i=e.options,s=e.chart;Q(this,\"bindAxes\",null,function(){(e.axisTypes||[]).forEach(function(o){(s[o]||[]).forEach(function(s){t=s.options,(tb(i[o],0)===s.index||void 0!==i[o]&&i[o]===t.id)&&(tI(e,s.series),e[o]=s,s.isDirty=!0)}),e[o]||e.optionalAxis===o||tE(18,!0,s)})}),Q(this,\"afterBindAxes\")}hasData(){return this.visible&&void 0!==this.dataMax&&void 0!==this.dataMin||this.visible&&this.dataTable.rowCount>0}hasMarkerChanged(t,e){let i=t.marker,s=e.marker||{};return i&&(s.enabled&&!i.enabled||s.symbol!==i.symbol||s.height!==i.height||s.width!==i.width)}autoIncrement(t){let e,i=this.options,{pointIntervalUnit:s,relativeXValue:o}=this.options,r=this.chart.time,a=this.xIncrement??r.parse(i.pointStart)??0;if(this.pointInterval=e=tb(this.pointInterval,i.pointInterval,1),o&&tl(t)&&(e*=t),s){let t=r.toParts(a);\"day\"===s?t[2]+=e:\"month\"===s?t[1]+=e:\"year\"===s&&(t[0]+=e),e=r.makeTime.apply(r,t)-a}return o&&tl(t)?a+e:(this.xIncrement=a+e,a)}setDataSortingOptions(){let t=this.options;q(this,{requireSorting:!1,sorted:!1,enabledDataSorting:!0,allowDG:!1}),V(t.pointRange)||(t.pointRange=1)}setOptions(t){let e,i=this.chart,s=i.options.plotOptions,o=i.userOptions||{},r=tu(t),a=i.styledMode,n={plotOptions:s,userOptions:r};Q(this,\"setOptions\",n);let h=n.plotOptions[this.type],l=o.plotOptions||{},d=l.series||{},c=iD.plotOptions[this.type]||{},p=l[this.type]||{};h.dataLabels=this.mergeArrays(c.dataLabels,h.dataLabels),this.userOptions=n.userOptions;let g=tu(h,s.series,p,r);this.tooltipOptions=tu(iD.tooltip,iD.plotOptions.series?.tooltip,c?.tooltip,i.userOptions.tooltip,l.series?.tooltip,p.tooltip,r.tooltip),this.stickyTracking=tb(r.stickyTracking,p.stickyTracking,d.stickyTracking,!!this.tooltipOptions.shared&&!this.noSharedTooltip||g.stickyTracking),null===h.marker&&delete g.marker;let{negativeColor:u,negativeFillColor:f,zoneAxis:m=\"y\",zones:x}=g,y=this.zones=(x||[]).map(t=>({...t}));return this.zoneAxis=m,(u||f)&&!x&&(e={value:g[m+\"Threshold\"]||g.threshold||0,className:\"highcharts-negative\"},a||(\"boolean\"!=typeof u&&(e.color=u),e.fillColor=f),y.push(e)),y.length&&V(y[y.length-1].value)&&y.push(a?{}:{color:this.color,fillColor:this.fillColor}),Q(this,\"afterSetOptions\",{options:g}),g}getName(){return this.options.name??iW(this.chart.options.lang.seriesName,this,this.chart)}getCyclic(t,e,i){let s,o,r=this.chart,a=`${t}Index`,n=`${t}Counter`,h=i?.length||r.options.chart.colorCount;!e&&(V(o=tb(\"color\"===t?this.options.colorIndex:void 0,this[a]))?s=o:(r.series.length||(r[n]=0),s=r[n]%h,r[n]+=1),i&&(e=i[s])),void 0!==s&&(this[a]=s),this[t]=e}getColor(){this.chart.styledMode?this.getCyclic(\"color\"):this.options.colorByPoint?this.color=\"#cccccc\":this.getCyclic(\"color\",this.options.color||iD.plotOptions[this.type].color,this.chart.options.colors)}getPointsCollection(){return(this.hasGroupedData?this.points:this.data)||[]}getSymbol(){let t=this.options.marker;this.getCyclic(\"symbol\",t.symbol,this.chart.options.symbols)}getColumn(t,e){return(e?this.dataTable.getModified():this.dataTable).getColumn(t,!0)||[]}findPointIndex(t,e){let i,s,o,{id:r,x:a}=t,n=this.points,h=this.options.dataSorting,l=this.cropStart||0;if(r){let t=this.chart.get(r);t instanceof ip&&(i=t)}else if(this.linkedParent||this.enabledDataSorting||this.options.relativeXValue){let e=e=>!e.touched&&e.index===t.index;if(h?.matchByName?e=e=>!e.touched&&e.name===t.name:this.options.relativeXValue&&(e=e=>!e.touched&&e.options.x===t.x),!(i=tr(n,e)))return}return i&&void 0!==(o=i?.index)&&(s=!0),void 0===o&&tl(a)&&(o=this.getColumn(\"x\").indexOf(a,e)),-1!==o&&void 0!==o&&this.cropped&&(o=o>=l?o-l:o),!s&&tl(o)&&n[o]?.touched&&(o=void 0),o}updateData(t,e){let{options:i,requireSorting:s}=this,o=i.dataSorting,r=this.points,a=[],n=t.length===r.length,h=this.xIncrement,l,d,c,p,g=!0;if(this.xIncrement=null,t.forEach((t,e)=>{let h,d=V(t)&&this.pointClass.prototype.optionsToObject.call({series:this},t)||{},{id:c,x:g}=d;c||tl(g)?(-1===(h=this.findPointIndex(d,p))||void 0===h?a.push(t):r[h]&&t!==i.data?.[h]?(r[h].update(t,!1,void 0,!1),r[h].touched=!0,s&&(p=h+1)):r[h]&&(r[h].touched=!0),(!n||e!==h||o?.enabled||this.hasDerivedData)&&(l=!0)):a.push(t)},this),l)for(d=r.length;d--;)(c=r[d])&&!c.touched&&c.remove?.(!1,e);else n&&!o?.enabled?(t.forEach((t,e)=>{t===r[e].y||r[e].destroyed||r[e].update(t,!1,void 0,!1)}),a.length=0):g=!1;if(r.forEach(t=>{t&&(t.touched=!1)}),!g)return!1;a.forEach(t=>{this.addPoint(t,!1,void 0,void 0,!1)},this);let u=this.getColumn(\"x\");return null!==h&&null===this.xIncrement&&u.length&&(this.xIncrement=H(u),this.autoIncrement()),!0}dataColumnKeys(){return[\"x\",...this.pointArrayMap||[\"y\"]]}setData(t,e=!0,i,s){let o=this.points,r=o?.length||0,a=this.options,n=this.chart,h=a.dataSorting,l=this.xAxis,d=a.turboThreshold,c=this.dataTable,p=this.dataColumnKeys(),g=this.pointValKey||\"y\",u=(this.pointArrayMap||[]).length,f=a.keys,m,x,y=0,b=1,v;n.options.chart.allowMutatingData||(a.data&&delete this.options.data,this.userOptions.data&&delete this.userOptions.data,v=tu(!0,t));let k=(t=v||t||[]).length;if(h?.enabled&&(t=this.sortData(t)),!1!==s&&k&&r&&!this.cropped&&!this.hasGroupedData&&this.visible&&!this.boosted&&(x=this.updateData(t,i)),!x){this.xIncrement=null,this.colorCounter=0;let e=d&&!a.relativeXValue&&k>d;if(e){let i=this.getFirstValidPoint(t),s=this.getFirstValidPoint(t,k-1,-1),o=t=>!!(tc(t)&&(f||tl(t[0])));if(tl(i)&&tl(s)){let e=[],i=[];for(let s of t)e.push(this.autoIncrement()),i.push(s);c.setColumns({x:e,[g]:i})}else if(o(i)&&o(s))if(u){let e=+(i.length===u),s=Array(p.length).fill(0).map(()=>[]);for(let i of t){e&&s[0].push(this.autoIncrement());for(let t=e;t<=u;t++)s[t]?.push(i[t-e])}c.setColumns(p.reduce((t,e,i)=>(t[e]=s[i],t),{}))}else{f&&(y=f.indexOf(\"x\"),b=f.indexOf(\"y\"),y=y>=0?y:0,b=b>=0?b:1),1===i.length&&(b=0);let e=[],s=[];for(let i of t)y===b?e.push(this.autoIncrement()):e.push(i[y]??i.x??null),s.push(i[b]??i.y??null);c.setColumns({x:e,[g]:s})}else e=!1}if(!e){let e=p.reduce((t,e)=>(t[e]=[],t),{});for(m=0;m{let s=ts(i,t),o=ts(i,e);return os)}).forEach(function(t,e){t.x=e},this),e.linkedSeries&&e.linkedSeries.forEach(function(e){let i=e.options,o=i.data;!i.dataSorting?.enabled&&o&&(o.forEach(function(i,r){o[r]=s(e,i),t[r]&&(o[r].x=t[r].x,o[r].index=r)}),e.setData(o,!1))}),t}getProcessedData(t){let e=this,{dataTable:i,isCartesian:s,options:o,xAxis:r}=e,a=o.cropThreshold,n=t||e.getExtremesFromAll,h=r?.logarithmic,l=i.rowCount,d,c,p=0,g,u,f,m=e.getColumn(\"x\"),x=i,y=!1;return r&&(u=(g=r.getExtremes()).min,f=g.max,y=!!(r.categories&&!r.names.length),s&&e.sorted&&!n&&(!a||l>a||e.forceCrop)&&(m[l-1]f?x=new iM:e.getColumn(e.pointValKey||\"y\").length&&(m[0]f)&&(x=(d=this.cropData(i,u,f)).modified,p=d.start,c=!0))),m=x.getColumn(\"x\")||[],{modified:x,cropped:c,cropStart:p,closestPointRange:te([h?m.map(h.log2lin):m],()=>e.requireSorting&&!y&&tE(15,!1,e.chart))}}processData(t){let e=this.xAxis,i=this.dataTable;if(this.isCartesian&&!this.isDirty&&!e.isDirty&&!this.yAxis.isDirty&&!t)return!1;let s=this.getProcessedData();i.modified=s.modified,this.cropped=s.cropped,this.cropStart=s.cropStart,this.closestPointRange=this.basePointRange=s.closestPointRange,Q(this,\"afterProcessData\")}cropData(t,e,i){let s=t.getColumn(\"x\",!0)||[],o=s.length,r={},a,n,h=0,l=o;for(a=0;a=e){h=Math.max(0,a-1);break}for(n=a;ni){l=n+1;break}for(let e of this.dataColumnKeys()){let i=t.getColumn(e,!0);i&&(r[e]=i.slice(h,l))}return{modified:new iM({columns:r}),start:h,end:l}}generatePoints(){let t=this.options,e=this.processedData||t.data,i=this.dataTable.getModified(),s=this.getColumn(\"x\",!0),o=this.pointClass,r=i.rowCount,a=this.cropStart||0,n=this.hasGroupedData,h=t.keys,l=[],d=t.dataGrouping?.groupAll?a:0,c=this.pointArrayMap||[\"y\"],p=this.dataColumnKeys(),g,u,f,m,x=this.data,y;if(!x&&!n){let t=[];t.length=e?.length||0,x=this.data=t}for(h&&n&&(this.options.keys=!1),m=0;mr.getColumn(t,!0)||[])||[],l=this.getColumn(\"x\",!0),d=[],c=this.requireSorting&&!this.is(\"column\")?1:0,p=!!s&&s.positiveValuesOnly,g=o||this.cropped||!i,u,f,m,x=0,y=0;for(i&&(x=(u=i.getExtremes()).min,y=u.max),m=0;m=x&&(l[m-c]||f)<=y)for(let t of h){let e=t[m];tl(e)&&(e>0||!p)&&d.push(e)}let b={activeYData:d,dataMin:W(d),dataMax:H(d)};return Q(this,\"afterGetExtremes\",{dataExtremes:b}),b}applyExtremes(){let t=this.getExtremes();return this.dataMin=t.dataMin,this.dataMax=t.dataMax,t}getFirstValidPoint(t,e=0,i=1){let s=t.length,o=e;for(;o>=0&&o1)&&(r.step=function(t,e){i&&i.apply(e,arguments),\"width\"===e.prop&&h?.element&&h.attr(o?\"height\":\"width\",t+99)}),n.addClass(\"highcharts-animating\").animate(t,r)}}afterAnimate(){this.setClip(),tm(this.chart.sharedClips,(t,e,i)=>{t&&!this.chart.container.querySelector(`[clip-path=\"url(#${t.id})\"]`)&&(t.destroy(),delete i[e])}),this.finishedAnimating=!0,Q(this,\"afterAnimate\")}drawPoints(t=this.points){let e,i,s,o,r,a,n,h=this.chart,l=h.styledMode,{colorAxis:d,options:c}=this,p=c.marker,g=c.nullInteraction,u=this[this.specialGroup||\"markerGroup\"],f=this.xAxis,m=tb(p.enabled,!f||!!f.isRadial||null,this.closestPointRangePx>=p.enabledThreshold*p.radius);if(!1!==p.enabled||this._hasPointMarkers)for(e=0;e0||i.hasImage)&&(i.graphic=s=h.renderer.symbol(t,n.x,n.y,n.width,n.height,a?r:p).add(u),this.enabledDataSorting&&h.hasRendered&&(s.attr({x:i.startXPos}),o=\"animate\")),s&&\"animate\"===o&&s[e?\"show\":\"hide\"](e).animate(n),s){let t=this.pointAttribs(i,l||!i.selected?void 0:\"select\");l?d&&s.css({fill:t.fill}):s[o](t)}s&&s.addClass(i.getClassName(),!0)}else s&&(i.graphic=s.destroy())}}markerAttribs(t,e){let i=this.options,s=i.marker,o=t.marker||{},r=o.symbol||s.symbol,a={},n,h,l=tb(o.radius,s?.radius);e&&(n=s?.states?.[e],h=o.states?.[e],l=tb(h?.radius,n?.radius,l&&l+(n?.radiusPlus||0))),t.hasImage=r&&0===r.indexOf(\"url\"),t.hasImage&&(l=0);let d=t.pos();return tl(l)&&d&&(i.crisp&&(d[0]=j(d[0],t.hasImage?0:\"rect\"===r?s?.lineWidth||0:1)),a.x=d[0]-l,a.y=d[1]-l),l&&(a.width=a.height=2*l),a}pointAttribs(t,e){let i=this.options,s=i.marker,o=t?.options,r=o?.marker||{},a=o?.color,n=t?.color,h=t?.zone?.color,l,d,c=this.color,p,g,u=tb(r.lineWidth,s.lineWidth),f=t?.isNull&&i.nullInteraction?0:1;return c=a||h||n||c,p=r.fillColor||s.fillColor||c,g=r.lineColor||s.lineColor||c,e=e||\"normal\",l=s.states[e]||{},u=tb((d=r.states&&r.states[e]||{}).lineWidth,l.lineWidth,u+tb(d.lineWidthPlus,l.lineWidthPlus,0)),p=d.fillColor||l.fillColor||p,g=d.lineColor||l.lineColor||g,{stroke:g,\"stroke-width\":u,fill:p,opacity:f=tb(d.opacity,l.opacity,f)}}destroy(t){let e,i,s=this,o=s.chart,r=/AppleWebKit\\/533/.test(iz.navigator.userAgent),a=s.data||[];for(Q(s,\"destroy\",{keepEventsForUpdate:t}),this.removeEvents(t),(s.axisTypes||[]).forEach(function(t){i=s[t],i?.series&&(K(i.series,s),i.isDirty=i.forceRedraw=!0)}),s.legendItem&&s.chart.legend.destroyItem(s),e=a.length;e--;)a[e]?.destroy?.();for(let t of s.zones)U(t,void 0,!0);ta(s.animationTimeout),tm(s,function(t,e){t instanceof em&&!t.survive&&t[r&&\"group\"===e?\"hide\":\"destroy\"]()}),o.hoverSeries===s&&(o.hoverSeries=void 0),K(o.series,s),o.orderItems(\"series\"),tm(s,function(e,i){t&&\"hcEvents\"===i||delete s[i]})}applyZones(){let{area:t,chart:e,graph:i,zones:s,points:o,xAxis:r,yAxis:a,zoneAxis:n}=this,{inverted:h,renderer:l}=e,d=this[`${n}Axis`],{isXAxis:c,len:p=0,minPointOffset:g=0}=d||{},u=(i?.strokeWidth()||0)/2+1,f=(t,e=0,i=0)=>{h&&(i=p-i);let{translated:s=0,lineClip:o}=t,r=i-s;o?.push([\"L\",e,Math.abs(r){t.forEach((e,i)=>{(\"M\"===e[0]||\"L\"===e[0])&&(t[i]=[e[0],c?p-e[1]:e[1],c?e[2]:p-e[2]])})};if(s.forEach(t=>{t.lineClip=[],t.translated=G(d.toPixels(tb(t.value,e),!0)||0,0,p)}),i&&!this.showLine&&i.hide(),t&&t.hide(),\"y\"===n&&o.length{let s=e.lineClip||[],o=Math.round(e.translated||0);r.reversed&&s.reverse();let{clip:n,simpleClip:d}=e,p=0,g=0,f=r.len,y=a.len;c?(p=o,f=x):(g=o,y=x);let b=[[\"M\",p,g],[\"L\",f,g],[\"L\",f,y],[\"L\",p,y],[\"Z\"]],v=[b[0],...s,b[1],b[2],...m,b[3],b[4]];m=s.reverse(),x=o,h&&(u(v),t&&u(b)),n?(n.animate({d:v}),d?.animate({d:b})):(n=e.clip=l.path(v),t&&(d=e.simpleClip=l.path(b))),i&&e.graph?.clip(n),t&&e.area?.clip(d)})}else this.visible&&(i&&i.show(),t&&t.show())}plotGroup(t,e,i,s,o){let r=this[t],a=!r,n={visibility:i,zIndex:s||.1};return V(this.opacity)&&!this.chart.styledMode&&\"inactive\"!==this.state&&(n.opacity=this.opacity),r||(this[t]=r=this.chart.renderer.g().add(o)),r.addClass(\"highcharts-\"+e+\" highcharts-series-\"+this.index+\" highcharts-\"+this.type+\"-series \"+(V(this.colorIndex)?\"highcharts-color-\"+this.colorIndex+\" \":\"\")+(this.options.className||\"\")+(r.hasClass(\"highcharts-tracker\")?\" highcharts-tracker\":\"\"),!0),r.attr(n)[a?\"attr\":\"animate\"](this.getPlotBox(e)),r}getPlotBox(t){let e=this.xAxis,i=this.yAxis,s=this.chart,o=s.inverted&&!s.polar&&e&&this.invertible&&\"series\"===t;s.inverted&&(e=i,i=this.xAxis);let r={scale:1,translateX:e?e.left:s.plotLeft,translateY:i?i.top:s.plotTop,name:t};Q(this,\"getPlotBox\",r);let{scale:a,translateX:n,translateY:h}=r;return{translateX:n,translateY:h,rotation:90*!!o,rotationOriginX:o?a*(e.len-i.len)/2:0,rotationOriginY:o?a*(e.len+i.len)/2:0,scaleX:o?-a:a,scaleY:a}}removeEvents(t){let{eventsToUnbind:e}=this;t||tS(this),e.length&&(e.forEach(t=>{t()}),e.length=0)}render(){let t=this,{chart:e,options:i,hasRendered:s}=t,o=iE(i.animation),r=t.visible?\"inherit\":\"hidden\",a=i.zIndex,n=e.seriesGroup,h=t.finishedAnimating?0:o.duration;Q(this,\"render\"),t.plotGroup(\"group\",\"series\",r,a,n),t.markerGroup=t.plotGroup(\"markerGroup\",\"markers\",r,a,n),!1!==i.clip&&t.setClip(),h&&t.animate?.(!0),t.drawGraph&&(t.drawGraph(),t.applyZones()),t.visible&&t.drawPoints(),t.drawDataLabels?.(),t.redrawPoints?.(),i.enableMouseTracking&&t.drawTracker?.(),h&&t.animate?.(),s||(h&&o.defer&&(h+=o.defer),t.animationTimeout=tA(()=>{t.afterAnimate()},h||0)),t.isDirty=!1,t.hasRendered=!0,Q(t,\"afterRender\")}redraw(){let t=this.isDirty||this.isDirtyData;this.translate(),this.render(),t&&delete this.kdTree}reserveSpace(){return this.visible||!this.chart.options.chart.ignoreHiddenSeries}searchPoint(t,e){let{xAxis:i,yAxis:s}=this,o=this.chart.inverted;return this.searchKDTree({clientX:o?i.len-t.chartY+i.pos:t.chartX-i.pos,plotY:o?s.len-t.chartX+s.pos:t.chartY-s.pos},e,t)}buildKDTree(t){this.buildingKdTree=!0;let e=this,i=e.options,s=i.findNearestPointBy.indexOf(\"y\")>-1?2:1;delete e.kdTree,tA(function(){e.kdTree=function t(i,s,o){let r,a,n=i?.length;if(n)return r=e.kdAxisArray[s%o],i.sort((t,e)=>(t[r]||0)-(e[r]||0)),{point:i[a=Math.floor(n/2)],left:t(i.slice(0,a),s+1,o),right:t(i.slice(a+1),s+1,o)}}(e.getValidPoints(void 0,!e.directTouch,i?.nullInteraction),s,s),e.buildingKdTree=!1},i.kdNow||t?.type===\"touchstart\"?0:1)}searchKDTree(t,e,i,s,o){let r=this,[a,n]=this.kdAxisArray,h=e?\"distX\":\"dist\",l=(r.options.findNearestPointBy||\"\").indexOf(\"y\")>-1?2:1,d=!!r.isBubble,c=s||((t,e,i)=>{let s=t[i]||0,o=e[i]||0;return[s===o&&t.index>e.index||st=0&&r<=(s?s.len:e.plotHeight)&&o>=0&&o<=(i?i.len:e.plotWidth)}drawTracker(){let t=this,e=t.options,i=e.trackByArea,s=[].concat((i?t.areaPath:t.graphPath)||[]),o=t.chart,r=o.pointer,a=o.renderer,n=o.options.tooltip?.snap||0,h=()=>{e.enableMouseTracking&&o.hoverSeries!==t&&t.onMouseOver()},l=\"rgba(192,192,192,\"+(iN?1e-4:.002)+\")\",d=t.tracker;d?d.attr({d:s}):t.graph&&(t.tracker=d=a.path(s).attr({visibility:t.visible?\"inherit\":\"hidden\",zIndex:2}).addClass(i?\"highcharts-tracker-area\":\"highcharts-tracker-line\").add(t.group),o.styledMode||d.attr({\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",stroke:l,fill:i?l:\"none\",\"stroke-width\":t.graph.strokeWidth()+(i?0:2*n)}),[t.tracker,t.markerGroup,...t.dataLabelsGroups||[]].forEach(t=>{t&&(t.addClass(\"highcharts-tracker\").on(\"mouseover\",h).on(\"mouseout\",t=>{r?.onTrackerMouseOut(t)}),e.cursor&&!o.styledMode&&t.css({cursor:e.cursor}),t.on(\"touchstart\",h))})),Q(this,\"afterDrawTracker\")}addPoint(t,e,i,s,o){let r,a,n=this.options,{chart:h,data:l,dataTable:d,xAxis:c}=this,p=c?.hasNames&&c.names,g=n.data,u=this.getColumn(\"x\");e=tb(e,!0);let f={series:this};this.pointClass.prototype.applyOptions.apply(f,[t]);let m=f.x;if(a=u.length,this.requireSorting&&mm;)a--;d.setRow(f,a,!0,{addColumns:!1}),p&&f.name&&(p[m]=f.name),g?.splice(a,0,t),(r||this.processedData)&&(this.data.splice(a,0,null),this.processData()),\"point\"===n.legendType&&this.generatePoints(),i&&(l[0]&&l[0].remove?l[0].remove(!1):([l,g].filter(V).forEach(t=>{t.shift()}),d.deleteRows(0))),!1!==o&&Q(this,\"addPoint\",{point:f}),this.isDirty=!0,this.isDirtyData=!0,e&&h.redraw(s)}removePoint(t,e,i){let s=this,{chart:o,data:r,points:a,dataTable:n}=s,h=r[t],l=function(){[a?.length===r.length?a:void 0,r,s.options.data].filter(V).forEach(e=>{e.splice(t,1)}),n.deleteRows(t),h?.destroy(),s.isDirty=!0,s.isDirtyData=!0,e&&o.redraw()};iI(i,o),e=tb(e,!0),h?h.firePointEvent(\"remove\",null,l):l()}remove(t,e,i,s){let o=this,r=o.chart;function a(){o.destroy(s),r.isDirtyLegend=r.isDirtyBox=!0,r.linkSeries(s),tb(t,!0)&&r.redraw(e)}!1!==i?Q(o,\"remove\",null,a):a()}update(t,e){Q(this,\"update\",{options:t=_(t,this.userOptions)});let i=this,s=i.chart,o=i.userOptions,r=i.initialType||i.type,a=s.options.plotOptions,n=iR[r].prototype,h=i.finishedAnimating&&{animation:!1},l={},d,c,p=iH.keepProps.slice(),g=t.type||o.type||s.options.chart.type,u=!(this.hasDerivedData||g&&g!==this.type||void 0!==t.keys||void 0!==t.pointStart||void 0!==t.pointInterval||void 0!==t.relativeXValue||t.joinBy||t.mapData||[\"dataGrouping\",\"pointStart\",\"pointInterval\",\"pointIntervalUnit\",\"keys\"].some(t=>i.hasOptionChanged(t)));g=g||r,u?(p.push.apply(p,iH.keepPropsForPoints),!1!==t.visible&&p.push(\"area\",\"graph\"),i.parallelArrays.forEach(function(t){p.push(t+\"Data\")}),t.data&&(t.dataSorting&&q(i.options.dataSorting,t.dataSorting),this.setData(t.data,!1))):this.dataTable.modified=this.dataTable,t.dataLabels&&o.dataLabels&&(t.dataLabels=this.mergeArrays(o.dataLabels,t.dataLabels)),t=tu(o,{index:void 0===o.index?i.index:o.index,pointStart:a?.series?.pointStart??o.pointStart??i.getColumn(\"x\")[0]},!u&&{data:i.options.data},t,h),u&&t.data&&(t.data=i.options.data),(p=[\"dataLabelsGroup\",\"dataLabelsGroups\",\"dataLabelsParentGroups\",\"group\",\"markerGroup\",\"transformGroup\"].concat(p)).forEach(function(t){p[t]=i[t],delete i[t]});let f=!1;if(iR[g]){if(f=g!==i.type,i.remove(!1,!1,!1,!0),f)if(s.propFromSeries(),Object.setPrototypeOf)Object.setPrototypeOf(i,iR[g].prototype);else{let t=Object.hasOwnProperty.call(i,\"hcEvents\")&&i.hcEvents;for(c in n)i[c]=void 0;q(i,iR[g].prototype),t?i.hcEvents=t:delete i.hcEvents}}else tE(17,!0,s,{missingModuleFor:g});if(p.forEach(function(t){i[t]=p[t]}),i.init(s,t),u&&this.points)for(let t of(!1===(d=i.options).visible?(l.graphic=1,l.dataLabel=1):(this.hasMarkerChanged(d,o)&&(l.graphic=1),i.hasDataLabels?.()||(l.dataLabel=1)),this.points))t?.series&&(t.resolveColor(),Object.keys(l).length&&t.destroyElements(l),!1===d.showInLegend&&t.legendItem&&s.legend.destroyItem(t));i.initialType=r,s.linkSeries(),s.setSortedData(),f&&i.linkedSeries.length&&(i.isDirtyData=!0),Q(this,\"afterUpdate\"),tb(e,!0)&&s.redraw(!!u&&void 0)}setName(t){this.name=this.options.name=this.userOptions.name=t,this.chart.isDirtyLegend=!0}hasOptionChanged(t){let e=this.chart,i=this.options[t],s=e.options.plotOptions,o=this.userOptions[t],r=tb(s?.[this.type]?.[t],s?.series?.[t]);return o&&!V(r)?i!==o:i!==tb(r,i)}onMouseOver(){let t=this.chart,e=t.hoverSeries,i=t.pointer;i?.setHoverChartIndex(),e&&e!==this&&e.onMouseOut(),this.options.events.mouseOver&&Q(this,\"mouseOver\"),this.setState(\"hover\"),t.hoverSeries=this}onMouseOut(){let t=this.options,e=this.chart,i=e.tooltip,s=e.hoverPoint;e.hoverSeries=null,s&&s.onMouseOut(),this&&t.events.mouseOut&&Q(this,\"mouseOut\"),i&&!this.stickyTracking&&(!i.shared||this.noSharedTooltip)&&i.hide(),e.series.forEach(function(t){t.setState(\"\",!0)})}setState(t,e){let i=this,{graph:s,options:o}=i,{inactiveOtherPoints:r,states:a}=o,n=tb(a?.[t||\"normal\"]?.animation,i.chart.options.chart.animation),{lineWidth:h,opacity:l}=o;if(t=t||\"\",i.state!==t&&([i.group,i.markerGroup,...i.dataLabelsGroups||[]].forEach(function(e){e&&(i.state&&e.removeClass(\"highcharts-series-\"+i.state),t&&e.addClass(\"highcharts-series-\"+t))}),i.state=t,!i.chart.styledMode)){if(a[t]?.enabled===!1)return;if(t&&(h=a[t].lineWidth||h+(a[t].lineWidthPlus||0),l=tb(a[t].opacity,l)),s&&!s.dashstyle&&tl(h))for(let t of[s,...this.zones.map(t=>t.graph)])t?.animate({\"stroke-width\":h},n);r||[i.group,i.markerGroup,...i.dataLabelsGroups||[],i.labelBySeries].forEach(function(t){t?.animate({opacity:l},n)})}e&&r&&i.points&&i.setAllPointsToState(t||void 0)}setAllPointsToState(t){this.points.forEach(function(e){e.setState&&e.setState(t)})}setVisible(t,e){let i=this,s=i.chart,o=s.options.chart.ignoreHiddenSeries,r=i.visible;i.visible=t=i.options.visible=i.userOptions.visible=void 0===t?!r:t;let a=t?\"show\":\"hide\";[\"group\",\"markerGroup\",\"tracker\",\"tt\"].forEach(t=>{i[t]?.[a]()}),i.dataLabelsGroups?.forEach(t=>{t?.[a]()}),(s.hoverSeries===i||s.hoverPoint?.series===i)&&i.onMouseOut(),i.legendItem&&s.legend.colorizeItem(i,t),i.isDirty=!0,i.options.stacking&&s.series.forEach(t=>{t.options.stacking&&t.visible&&(t.isDirty=!0)}),i.linkedSeries.forEach(e=>{e.setVisible(t,!1)}),o&&(s.isDirtyBox=!0),Q(i,a),!1!==e&&s.redraw()}show(){this.setVisible(!0)}hide(){this.setVisible(!1)}select(t){this.selected=t=this.options.selected=void 0===t?!this.selected:t,this.checkbox&&(this.checkbox.checked=t),Q(this,t?\"select\":\"unselect\")}shouldShowTooltip(t,e,i={}){return i.series=this,i.visiblePlotOnly=!0,this.chart.isInsidePlot(t,e,i)}drawLegendSymbol(t,e){let i=this.chart.renderer,s=this.options.legendSymbol||\"rectangle\",o=e.legendItem||{},{options:r,symbolHeight:a,symbolWidth:n}=t,h=r.squareSymbol,l=h?a:n,d=h?(n-a)/2:0,c=(t.baseline||0)-a+1,p=r.symbolRadius??a,g=\"rectangle\"===s?i.rect(d,c,l,a,p):i.symbols[s]&&i.symbol(s,d,c,l,a,{r:p});g?o.symbol=g.addClass(\"highcharts-point\").attr({zIndex:3}).add(o.group):iC[s]?.call(this,t,e)}}iH.defaultOptions={lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},enableMouseTracking:!0,events:{},marker:{enabledThreshold:2,lineColor:\"#ffffff\",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:150},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:\"#cccccc\",lineColor:\"#000000\",lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:\"center\",borderWidth:0,defer:!0,formatter:function(){let{numberFormatter:t}=this.series.chart;return\"number\"!=typeof this.y?\"\":t(this.y,-1)},padding:5,style:{fontSize:\"0.7em\",fontWeight:\"bold\",color:\"contrast\",textOutline:\"1px contrast\"},verticalAlign:\"bottom\",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:150},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:150},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:\"x\"},iH.types=iO.seriesTypes,iH.registerType=iO.registerSeriesType,iH.keepProps=[\"colorIndex\",\"eventOptions\",\"navigatorSeries\",\"symbolIndex\",\"baseSeries\"],iH.keepPropsForPoints=[\"data\",\"isDirtyData\",\"isDirtyCanvas\",\"points\",\"dataTable\",\"processedData\",\"xIncrement\",\"cropped\",\"_hasPointMarkers\",\"hasDataLabels\",\"nodes\",\"layout\",\"level\",\"mapMap\",\"mapData\",\"minY\",\"maxY\",\"minX\",\"maxX\",\"transformGroups\"],q(iH.prototype,{axisTypes:[\"xAxis\",\"yAxis\"],coll:\"series\",colorCounter:0,directTouch:!1,invertible:!0,isCartesian:!0,kdAxisArray:[\"clientX\",\"plotY\"],parallelArrays:[\"x\",\"y\"],pointClass:ip,requireSorting:!0,sorted:!0}),iO.series=iH;let iX=iH,{animObject:iG,setAnimation:iF}=tQ,{registerEventOptions:iY}=eV,{composed:ij,marginNames:i$}=B,{distribute:iV}=er,{format:iU}=es;class iZ{constructor(t,e){this.allItems=[],this.initialItemY=0,this.itemHeight=0,this.itemMarginBottom=0,this.itemMarginTop=0,this.itemX=0,this.itemY=0,this.lastItemY=0,this.lastLineHeight=0,this.legendHeight=0,this.legendWidth=0,this.maxItemWidth=0,this.maxLegendWidth=0,this.offsetWidth=0,this.padding=0,this.pages=[],this.symbolHeight=0,this.symbolWidth=0,this.titleHeight=0,this.totalItemWidth=0,this.widthOption=0,this.chart=t,this.setOptions(e),e.enabled&&(this.render(),iY(this,e),R(this.chart,\"endResize\",function(){this.legend.positionCheckboxes()})),R(this.chart,\"render\",()=>{this.options.enabled&&this.proximate&&(this.proximatePositions(),this.positionItems())})}setOptions(t){let e=tb(t.padding,8);this.options=t,this.chart.styledMode||(this.itemStyle=t.itemStyle,this.itemHiddenStyle=tu(this.itemStyle,t.itemHiddenStyle)),this.itemMarginTop=t.itemMarginTop,this.itemMarginBottom=t.itemMarginBottom,this.padding=e,this.initialItemY=e-5,this.symbolWidth=tb(t.symbolWidth,16),this.pages=[],this.proximate=\"proximate\"===t.layout&&!this.chart.inverted,this.baseline=void 0}update(t,e){let i=this.chart;this.setOptions(tu(!0,this.options,t)),\"events\"in this.options&&iY(this,this.options),this.destroy(),i.isDirtyLegend=i.isDirtyBox=!0,tb(e,!0)&&i.redraw(),Q(this,\"afterUpdate\",{redraw:e})}colorizeItem(t,e){let i=t.color,{area:s,group:o,label:r,line:a,symbol:n}=t.legendItem||{};if((t instanceof iX||t instanceof ip)&&(t.color=t.options?.legendSymbolColor||i),o?.[e?\"removeClass\":\"addClass\"](\"highcharts-legend-item-hidden\"),!this.chart.styledMode){let{itemHiddenStyle:i={}}=this,o=i.color,{fillColor:h,fillOpacity:l,lineColor:d,marker:c}=t.options,p=t=>(!e&&(t.fill&&(t.fill=o),t.stroke&&(t.stroke=o)),t);r?.css(tu(e?this.itemStyle:i)),a?.attr(p({stroke:d||t.color})),n&&n.attr(p(c&&n.isMarker?t.pointAttribs():{fill:t.color})),s?.attr(p({fill:h||t.color,\"fill-opacity\":h?1:l??.75}))}t.color=i,Q(this,\"afterColorizeItem\",{item:t,visible:e})}positionItems(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()}positionItem(t){let{group:e,x:i=0,y:s=0}=t.legendItem||{},o=this.options,r=o.symbolPadding,a=!o.rtl,n=t.checkbox;if(e?.element){let o={translateX:a?i:this.legendWidth-i-2*r-4,translateY:s},n=()=>{Q(this,\"afterPositionItem\",{item:t})};e[V(e.translateY)?\"animate\":\"attr\"](o,void 0,n)}n&&(n.x=i,n.y=s)}destroyItem(t){let e=t.legendItem||{};for(let t of[\"group\",\"label\",\"line\",\"symbol\"])e[t]&&(e[t]=e[t].destroy());t.checkbox=Z(t.checkbox),t.legendItem=void 0}destroy(){for(let t of this.getAllItems())this.destroyItem(t);for(let t of[\"clipRect\",\"up\",\"down\",\"pager\",\"nav\",\"box\",\"title\",\"group\"])this[t]&&(this[t]=this[t].destroy());this.display=null}positionCheckboxes(){let t,e=this.group?.alignAttr,i=this.clipHeight||this.legendHeight,s=this.titleHeight;e&&(t=e.translateY,this.allItems.forEach(function(o){let r,a=o.checkbox;a&&(r=t+s+a.y+(this.scrollOffset||0)+3,$(a,{left:e.translateX+o.checkboxOffset+a.x-20+\"px\",top:r+\"px\",display:this.proximate||r>t-6&&r1.5*k?v.height:k))}layoutItem(t){let e=this.options,i=this.padding,s=\"horizontal\"===e.layout,o=t.itemHeight,r=this.itemMarginBottom,a=this.itemMarginTop,n=s?tb(e.itemDistance,20):0,h=this.maxLegendWidth,l=e.alignColumns&&this.totalItemWidth>h?this.maxItemWidth:t.itemWidth,d=t.legendItem||{};s&&this.itemX-i+l>h&&(this.itemX=i,this.lastLineHeight&&(this.itemY+=a+this.lastLineHeight+r),this.lastLineHeight=0),this.lastItemY=a+this.itemY+r,this.lastLineHeight=Math.max(o,this.lastLineHeight),d.x=this.itemX,d.y=this.itemY,s?this.itemX+=l:(this.itemY+=a+o+r,this.lastLineHeight=o),this.offsetWidth=this.widthOption||Math.max((s?this.itemX-i-(t.checkbox?0:n):l)+i,this.offsetWidth)}getAllItems(){let t=[];return this.chart.series.forEach(function(e){let i=e?.options;e&&tb(i.showInLegend,!V(i.linkedTo)&&void 0,!0)&&(t=t.concat(e.legendItem?.labels||(\"point\"===i.legendType?e.data:e)))}),Q(this,\"afterGetAllItems\",{allItems:t}),t}getAlignment(){let t=this.options;return this.proximate?t.align.charAt(0)+\"tv\":t.floating?\"\":t.align.charAt(0)+t.verticalAlign.charAt(0)+t.layout.charAt(0)}adjustMargins(t,e){let i=this.chart,s=this.options,o=this.getAlignment();o&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach((r,a)=>{r.test(o)&&!V(t[a])&&(i[i$[a]]=Math.max(i[i$[a]],i.legend[(a+1)%2?\"legendHeight\":\"legendWidth\"]+[1,-1,-1,1][a]*s[a%2?\"x\":\"y\"]+(s.margin??12)+e[a]+(i.titleOffset[a]||0)))})}proximatePositions(){let t,e=this.chart,i=[],s=\"left\"===this.options.align;for(let o of(this.allItems.forEach(function(t){let o,r,a=s,n,h;t.yAxis&&(t.xAxis.options.reversed&&(a=!a),t.points&&(o=tr(a?t.points:t.points.slice(0).reverse(),function(t){return tl(t.plotY)})),r=this.itemMarginTop+t.legendItem.label.getBBox().height+this.itemMarginBottom,h=t.yAxis.top-e.plotTop,n=t.visible?(o?o.plotY:t.yAxis.height)+(h-.3*r):h+t.yAxis.height,i.push({target:n,size:r,item:t}))},this),iV(i,e.plotHeight)))t=o.item.legendItem||{},tl(o.pos)&&(t.y=e.plotTop-e.spacing[0]+o.pos)}render(){let t=this.chart,e=t.spacingBox.width,i=t.renderer,s=this.options,o=this.padding,r=this.getAllItems(),a,n,h,l=this.group,d,c=this.box;this.itemX=o,this.itemY=this.initialItemY,this.offsetWidth=0,this.lastItemY=0,this.widthOption=tw(s.width,e-o),d=e-2*o-s.x,[\"rm\",\"lm\"].indexOf(this.getAlignment().substring(0,2))>-1&&(d/=2),this.maxLegendWidth=this.widthOption||d,l||(this.group=l=i.g(\"legend\").addClass(s.className||\"\").attr({zIndex:7}).add(),this.contentGroup=i.g().attr({zIndex:1}).add(l),this.scrollGroup=i.g().add(this.contentGroup)),this.renderTitle(),tC(r,(t,e)=>(t.options?.legendIndex||0)-(e.options?.legendIndex||0)),s.reversed&&r.reverse(),this.allItems=r,this.display=a=!!r.length,this.lastLineHeight=0,this.maxItemWidth=0,this.totalItemWidth=0,this.itemHeight=0,r.forEach(this.renderItem,this),r.forEach(this.layoutItem,this),n=(s.maxWidth?Math.min(this.widthOption||this.offsetWidth,d,tw(s.maxWidth,t.chartWidth)||1/0):this.widthOption||this.offsetWidth)+o,h=this.lastItemY+this.lastLineHeight+this.titleHeight,h=this.handleOverflow(h)+o,c||(this.box=c=i.rect().addClass(\"highcharts-legend-box\").attr({r:s.borderRadius}).add(l)),t.styledMode||c.attr({stroke:s.borderColor,\"stroke-width\":s.borderWidth||0,fill:s.backgroundColor||\"none\"}).shadow(s.shadow),n>0&&h>0&&c[c.placed?\"animate\":\"attr\"](c.crisp.call({},{x:0,y:0,width:n,height:h},c.strokeWidth())),l[a?\"show\":\"hide\"](),t.styledMode&&\"none\"===l.getStyle(\"display\")&&(n=h=0),this.legendWidth=n,this.legendHeight=h,a&&this.align(),this.proximate||this.positionItems(),Q(this,\"afterRender\")}align(t=this.chart.spacingBox){let e=this.chart,i=this.options,s=t.y;/(lth|ct|rth)/.test(this.getAlignment())&&e.titleOffset[0]>0?s+=e.titleOffset[0]:/(lbh|cb|rbh)/.test(this.getAlignment())&&e.titleOffset[2]>0&&(s-=e.titleOffset[2]),s!==t.y&&(t=tu(t,{y:s})),e.hasRendered||(this.group.placed=!1),this.group.align(tu(i,{width:this.legendWidth,height:this.legendHeight,verticalAlign:this.proximate?\"top\":i.verticalAlign}),!0,t)}handleOverflow(t){let e=this,i=this.chart,s=i.renderer,o=this.options,r=o.y,a=\"top\"===o.verticalAlign,n=this.padding,h=o.maxHeight,l=o.navigation,d=tb(l.animation,!0),c=l.arrowSize||12,p=this.pages,g=this.allItems,u=function(t){\"number\"==typeof t?w.attr({height:t}):w&&(e.clipRect=w.destroy(),e.contentGroup.clip()),e.contentGroup.div&&(e.contentGroup.div.style.clip=t?\"rect(\"+n+\"px,9999px,\"+(n+t)+\"px,0)\":\"auto\")},f=function(t){return e[t]=s.circle(0,0,1.3*c).translate(c/2,c/2).add(k),i.styledMode||e[t].attr(\"fill\",\"rgba(0,0,0,0.0001)\"),e[t]},m,x,y,b,v=i.spacingBox.height+(a?-r:r)-n,k=this.nav,w=this.clipRect;return\"horizontal\"!==o.layout||\"middle\"===o.verticalAlign||o.floating||(v/=2),h&&(v=Math.min(v,h)),p.length=0,t&&v>0&&t>v&&!1!==l.enabled?(this.clipHeight=m=Math.max(v-20-this.titleHeight-n,0),this.currentPage=tb(this.currentPage,1),this.fullHeight=t,g.forEach((t,e)=>{let i=(y=t.legendItem||{}).y||0,s=Math.round(y.label.getBBox().height),o=p.length;(!o||i-p[o-1]>m&&(x||i)!==p[o-1])&&(p.push(x||i),o++),y.pageIx=o-1,x&&b&&(b.pageIx=o-1),e===g.length-1&&i+s-p[o-1]>m&&i>p[o-1]&&(p.push(i),y.pageIx=o),i!==x&&(x=i),b=y}),w||(w=e.clipRect=s.clipRect(0,n-2,9999,0),e.contentGroup.clip(w)),u(m),k||(this.nav=k=s.g().attr({zIndex:1}).add(this.group),this.up=s.symbol(\"triangle\",0,0,c,c).add(k),f(\"upTracker\").on(\"click\",function(){e.scroll(-1,d)}),this.pager=s.text(\"\",15,10).addClass(\"highcharts-legend-navigation\"),!i.styledMode&&l.style&&this.pager.css(l.style),this.pager.add(k),this.down=s.symbol(\"triangle-down\",0,0,c,c).add(k),f(\"downTracker\").on(\"click\",function(){e.scroll(1,d)})),e.scroll(0),t=v):k&&(u(),this.nav=k.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),t}scroll(t,e){let i=this.chart,s=this.pages,o=s.length,r=this.clipHeight,a=this.options.navigation,n=this.pager,h=this.padding,l=this.currentPage+t;l>o&&(l=o),l>0&&(void 0!==e&&iF(e,i),this.nav.attr({translateX:h,translateY:r+this.padding+7+this.titleHeight,visibility:\"inherit\"}),[this.up,this.upTracker].forEach(function(t){t.attr({class:1===l?\"highcharts-legend-nav-inactive\":\"highcharts-legend-nav-active\"})}),n.attr({text:l+\"/\"+o}),[this.down,this.downTracker].forEach(function(t){t.attr({x:18+this.pager.getBBox().width,class:l===o?\"highcharts-legend-nav-inactive\":\"highcharts-legend-nav-active\"})},this),i.styledMode||(this.up.attr({fill:1===l?a.inactiveColor:a.activeColor}),this.upTracker.css({cursor:1===l?\"default\":\"pointer\"}),this.down.attr({fill:l===o?a.inactiveColor:a.activeColor}),this.downTracker.css({cursor:l===o?\"default\":\"pointer\"})),this.scrollOffset=-s[l-1]+this.initialItemY,this.scrollGroup.animate({translateY:this.scrollOffset}),this.currentPage=l,this.positionCheckboxes(),tA(()=>{Q(this,\"afterScroll\",{currentPage:l})},iG(tb(e,i.renderer.globalAnimation,!0)).duration))}setItemEvents(t,e,i){let s=this,o=t.legendItem||{},r=s.chart.renderer.boxWrapper,a=t instanceof ip,n=t instanceof iX,h=\"highcharts-legend-\"+(a?\"point\":\"series\")+\"-active\",l=s.chart.styledMode,d=i?[e,o.symbol]:[o.group],c=e=>{s.allItems.forEach(i=>{t!==i&&[i].concat(i.linkedSeries||[]).forEach(t=>{t.setState(e,!a)})})};for(let i of d)i&&i.on(\"mouseover\",function(){t.visible&&c(\"inactive\"),t.setState(\"hover\"),t.visible&&r.addClass(h),l||e.css(s.options.itemHoverStyle)}).on(\"mouseout\",function(){s.chart.styledMode||e.css(tu(t.visible?s.itemStyle:s.itemHiddenStyle)),c(\"\"),r.removeClass(h),t.setState()}).on(\"click\",function(e){let i=function(){t.setVisible&&t.setVisible(),c(t.visible?\"inactive\":\"\")};r.removeClass(h),Q(s,\"itemClick\",{browserEvent:e,legendItem:t,context:s},i),a?t.firePointEvent(\"legendItemClick\",{browserEvent:e}):n&&Q(t,\"legendItemClick\",{browserEvent:e})})}createCheckboxForItem(t){t.checkbox=Y(\"input\",{type:\"checkbox\",className:\"highcharts-legend-checkbox\",checked:t.selected,defaultChecked:t.selected},this.options.itemCheckboxStyle,this.chart.container),R(t.checkbox,\"click\",function(e){let i=e.target;Q(t.series||t,\"checkboxClick\",{checked:i.checked,item:t},function(){t.select()})})}}(c=iZ||(iZ={})).compose=function(t){tk(ij,\"Core.Legend\")&&R(t,\"beforeMargins\",function(){this.legend=new c(this,this.options.legend)})};let i_=iZ,{animate:iK,animObject:iq,setAnimation:iJ}=tQ,{defaultOptions:iQ}=tY,{numberFormat:i0}=es,{registerEventOptions:i1}=eV,{charts:i2,doc:i3,marginNames:i5,svg:i6,win:i9}=B,{seriesTypes:i4}=iO;class i8{static chart(t,e,i){return new i8(t,e,i)}constructor(t,e,i){if(this.sharedClips={},!i3)return void tE(36,!1,this);const s=[...arguments];(td(t)||t.nodeName)&&(this.renderTo=s.shift()),this.init(s[0],s[1])}setZoomOptions(){let t=this.options.chart,e=t.zooming;this.zooming={...e,type:tb(t.zoomType,e.type),key:tb(t.zoomKey,e.key),pinchType:tb(t.pinchType,e.pinchType),singleTouch:tb(t.zoomBySingleTouch,e.singleTouch,!1),resetButton:tu(e.resetButton,t.resetZoomButton)}}init(t,e){Q(this,\"init\",{args:arguments},function(){let i=tu(iQ,t),s=i.chart,o=this.renderTo||s.renderTo;this.userOptions=q({},t),(this.renderTo=td(o)?i3.getElementById(o):o)||tE(13,!0,this),this.margin=[],this.spacing=[],this.labelCollectors=[],this.callback=e,this.isResizing=0,this.options=i,this.axes=[],this.series=[],this.locale=i.lang.locale??this.renderTo.closest(\"[lang]\")?.lang,this.time=new tH(q(i.time||{},{locale:this.locale}),i.lang),i.time=this.time.options,this.numberFormatter=(s.numberFormatter||i0).bind(this),this.styledMode=s.styledMode,this.hasCartesianSeries=s.showAxes,this.index=i2.length,i2.push(this),B.chartCount++,i1(this,s),this.xAxis=[],this.yAxis=[],this.pointCount=this.colorCounter=this.symbolCounter=0,this.setZoomOptions(),Q(this,\"afterInit\"),this.firstRender()})}initSeries(t){let e=this.options.chart,i=t.type||e.type,s=i4[i];s||tE(17,!0,this,{missingModuleFor:i});let o=new s;return\"function\"==typeof o.init&&o.init(this,t),o}setSortedData(){this.getSeriesOrderByLinks().forEach(function(t){t.points||t.data||!t.enabledDataSorting||t.setData(t.options.data,!1)})}getSeriesOrderByLinks(){return this.series.concat().sort(function(t,e){return t.linkedSeries.length||e.linkedSeries.length?e.linkedSeries.length-t.linkedSeries.length:0})}orderItems(t,e=0){let i=this[t],s=this.options[t]=tT(this.options[t]).slice(),o=this.userOptions[t]=this.userOptions[t]?tT(this.userOptions[t]).slice():[];if(this.hasRendered&&(s.splice(e),o.splice(e)),i)for(let t=e,r=i.length;t=Math.max(h+r,t.pos)&&e<=Math.min(h+r+c.width,t.pos+t.len)||(u.isInsidePlot=!1)}if(!i.ignoreY&&u.isInsidePlot){let t=!s&&i.axis&&!i.axis.isXAxis&&i.axis||d&&(s?d.xAxis:d.yAxis)||{pos:a,len:1/0},e=i.paneCoordinates?t.pos+g:a+g;e>=Math.max(l+a,t.pos)&&e<=Math.min(l+a+c.height,t.pos+t.len)||(u.isInsidePlot=!1)}return Q(this,\"afterIsInsidePlot\",u),u.isInsidePlot}redraw(t){Q(this,\"beforeRedraw\");let e=this.hasCartesianSeries?this.axes:this.colorAxis||[],i=this.series,s=this.pointer,o=this.legend,r=this.userOptions.legend,a=this.renderer,n=a.isHidden(),h=[],l,d,c,p=this.isDirtyBox,g=this.isDirtyLegend,u;for(a.rootFontSize=a.boxWrapper.getStyle(\"font-size\"),this.setResponsive&&this.setResponsive(!1),iJ(!!this.hasRendered&&t,this),n&&this.temporaryDisplay(),this.layOutTitles(!1),c=i.length;c--;)if(((u=i[c]).options.stacking||u.options.centerInCategory)&&(d=!0,u.isDirty)){l=!0;break}if(l)for(c=i.length;c--;)(u=i[c]).options.stacking&&(u.isDirty=!0);i.forEach(function(t){t.isDirty&&(\"point\"===t.options.legendType?(\"function\"==typeof t.updateTotals&&t.updateTotals(),g=!0):r&&(r.labelFormatter||r.labelFormat)&&(g=!0)),t.isDirtyData&&Q(t,\"updatedData\")}),g&&o&&o.options.enabled&&(o.render(),this.isDirtyLegend=!1),d&&this.getStacks(),e.forEach(function(t){t.updateNames(),t.setScale()}),this.getMargins(),e.forEach(function(t){t.isDirty&&(p=!0)}),e.forEach(function(t){let e=t.min+\",\"+t.max;t.extKey!==e&&(t.extKey=e,h.push(function(){Q(t,\"afterSetExtremes\",q(t.eventArgs,t.getExtremes())),delete t.eventArgs})),(p||d)&&t.redraw()}),p&&this.drawChartBox(),Q(this,\"predraw\"),i.forEach(function(t){(p||t.isDirty)&&t.visible&&t.redraw(),t.isDirtyData=!1}),s&&s.reset(!0),a.draw(),Q(this,\"redraw\"),Q(this,\"render\"),n&&this.temporaryDisplay(!0),h.forEach(function(t){t.call()})}get(t){let e=this.series;function i(e){return e.id===t||e.options&&e.options.id===t}let s=tr(this.axes,i)||tr(this.series,i);for(let t=0;!s&&t(e.getPointsCollection().forEach(e=>{tb(e.selectedStaging,e.selected)&&t.push(e)}),t),[])}getSelectedSeries(){return this.series.filter(t=>t.selected)}setTitle(t,e,i){this.applyDescription(\"title\",t),this.applyDescription(\"subtitle\",e),this.applyDescription(\"caption\",void 0),this.layOutTitles(i)}applyDescription(t,e){let i=this,s=this.options[t]=tu(this.options[t],e),o=this[t];o&&e&&(this[t]=o=o.destroy()),s&&!o&&((o=this.renderer.text(s.text,0,0,s.useHTML).attr({align:s.align,class:\"highcharts-\"+t,zIndex:s.zIndex||4}).css({textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"}).add()).update=function(e,s){i.applyDescription(t,e),i.layOutTitles(s)},this.styledMode||o.css(q(\"title\"===t?{fontSize:this.options.isStock?\"1em\":\"1.2em\"}:{},s.style)),o.textPxLength=o.getBBox().width,o.css({whiteSpace:s.style?.whiteSpace}),this[t]=o)}layOutTitles(t=!0){let e=[0,0,0],{options:i,renderer:s,spacingBox:o}=this;[\"title\",\"subtitle\",\"caption\"].forEach(t=>{let i=this[t],r=this.options[t],a=tu(o),n=i?.textPxLength||0;if(i&&r){Q(this,\"layOutTitle\",{alignTo:a,key:t,textPxLength:n});let o=s.fontMetrics(i),h=o.b,l=o.h,d=r.verticalAlign||\"top\",c=\"top\"===d,p=c&&r.minScale||1,g=\"title\"===t?c?-3:0:c?e[0]+2:0,u=Math.min(a.width/n,1),f=Math.max(p,u),m=tu({y:\"bottom\"===d?h:g+h},r),x=(r.width||(u>p?this.chartWidth:a.width)/f)+\"px\";m.align??(m.align=\"title\"===t?u{if(t!==this.container){let e=t.style.display;return t.style.display=\"none\",[t,e]}}),e={width:to(this.renderTo,\"width\",!0)||0,height:to(this.renderTo,\"height\",!0)||0};return t.filter(Boolean).forEach(([t,e])=>{t.style.display=e}),e}getChartSize(){let t=this.options.chart,e=t.width,i=t.height,s=this.getContainerBox(),o=s.height<=1||!this.renderTo.parentElement?.style.height&&\"100%\"===this.renderTo.style.height;this.chartWidth=Math.max(0,e||s.width||600),this.chartHeight=Math.max(0,tw(i,this.chartWidth)||(o?400:s.height)),this.containerBox=s}temporaryDisplay(t){let e=this.renderTo,i;if(t)for(;e?.style;)e.hcOrigStyle&&($(e,e.hcOrigStyle),delete e.hcOrigStyle),e.hcOrigDetached&&(i3.body.removeChild(e),e.hcOrigDetached=!1),e=e.parentNode;else for(;e?.style&&(i3.body.contains(e)||e.parentNode||(e.hcOrigDetached=!0,i3.body.appendChild(e)),(\"none\"===to(e,\"display\",!1)||e.hcOrigDetached)&&(e.hcOrigStyle={display:e.style.display,height:e.style.height,overflow:e.style.overflow},i={display:\"block\",overflow:\"hidden\"},e!==this.renderTo&&(i.height=0),$(e,i),e.offsetWidth||e.style.setProperty(\"display\",\"block\",\"important\")),(e=e.parentNode)!==i3.body););}setClassName(t){this.container.className=\"highcharts-container \"+(t||\"\")}getContainer(){let t,e=this.options,i=e.chart,s=\"data-highcharts-chart\",o=tB(),r=this.renderTo,a=tv(X(r,s));tl(a)&&i2[a]&&i2[a].hasRendered&&i2[a].destroy(),X(r,s,this.index),r.innerHTML=t6.emptyHTML,i.skipClone||r.offsetWidth||this.temporaryDisplay(),this.getChartSize();let n=this.chartHeight,h=this.chartWidth;$(r,{overflow:\"hidden\"}),this.styledMode||(t=q({position:\"relative\",overflow:\"hidden\",width:h+\"px\",height:n+\"px\",textAlign:\"left\",lineHeight:\"normal\",zIndex:0,\"-webkit-tap-highlight-color\":\"rgba(0,0,0,0)\",userSelect:\"none\",\"touch-action\":\"manipulation\",outline:\"none\",padding:\"0px\"},i.style||{}));let l=Y(\"div\",{id:o},t,r);this.container=l,this.getChartSize(),h!==this.chartWidth&&(h=this.chartWidth,this.styledMode||$(l,{width:tb(i.style?.width,h+\"px\")})),this.containerBox=this.getContainerBox(),this._cursor=l.style.cursor;let d=i.renderer||!i6?eo.getRendererType(i.renderer):eW;if(this.renderer=new d(l,h,n,void 0,i.forExport,e.exporting?.allowHTML,this.styledMode),iJ(void 0,this),this.setClassName(i.className),this.styledMode)for(let t in e.defs)this.renderer.definition(e.defs[t]);else this.renderer.setStyle(i.style);this.renderer.chartIndex=this.index,Q(this,\"afterGetContainer\")}getMargins(t){let{spacing:e,margin:i,titleOffset:s}=this;this.resetMargins(),s[0]&&!V(i[0])&&(this.plotTop=Math.max(this.plotTop,s[0]+e[0])),s[2]&&!V(i[2])&&(this.marginBottom=Math.max(this.marginBottom,s[2]+e[2])),this.legend?.display&&this.legend.adjustMargins(i,e),Q(this,\"getMargins\"),t||this.getAxisMargins()}getAxisMargins(){let t=this,e=t.axisOffset=[0,0,0,0],i=t.colorAxis,s=t.margin,o=t=>{t.forEach(t=>{t.visible&&t.getOffset()})};t.hasCartesianSeries?o(t.axes):i?.length&&o(i),i5.forEach((i,o)=>{V(s[o])||(t[i]+=e[o])}),t.setChartSize()}getOptions(){return _(this.userOptions,iQ)}reflow(t){let e=this,i=e.containerBox,s=e.getContainerBox();delete e.pointer?.chartPosition,!e.exporting?.isPrinting&&!e.isResizing&&i&&s.width&&((s.width!==i.width||s.height!==i.height)&&(ta(e.reflowTimeout),e.reflowTimeout=tA(function(){if(e.container){e.setSize(void 0,void 0,!1);let t=e.containerBox;t&&(t.height=e.chartHeight)}},100*!!t)),e.containerBox=s)}setReflow(){let t=this,e=e=>{t.options?.chart.reflow&&t.hasLoaded&&t.reflow(e)};if(\"function\"==typeof ResizeObserver)new ResizeObserver(e).observe(t.renderTo);else{let t=R(i9,\"resize\",e);R(this,\"destroy\",t)}}setSize(t,e,i){let s=this,o=s.renderer;s.isResizing+=1,iJ(i,s);let r=o.globalAnimation;s.oldChartHeight=s.chartHeight,s.oldChartWidth=s.chartWidth,void 0!==t&&(s.options.chart.width=t),void 0!==e&&(s.options.chart.height=e),s.getChartSize();let{chartWidth:a,chartHeight:n,scrollablePixelsX:h=0,scrollablePixelsY:l=0}=s;(s.isDirtyBox||a!==s.oldChartWidth||n!==s.oldChartHeight)&&(s.styledMode||(r?iK:$)(s.container,{width:`${a+h}px`,height:`${n+l}px`},r),s.setChartSize(!0),o.setSize(a,n,r),s.axes.forEach(function(t){t.isDirty=!0,t.setScale()}),s.isDirtyLegend=!0,s.isDirtyBox=!0,s.layOutTitles(),s.getMargins(),s.redraw(r),s.oldChartHeight=void 0,Q(s,\"resize\"),setTimeout(()=>{s&&Q(s,\"endResize\")},iq(r).duration)),s.isResizing-=1}setChartSize(t){let e,i,s,o,{chartHeight:r,chartWidth:a,inverted:n,spacing:h,renderer:l}=this,d=this.clipOffset,c=Math[n?\"floor\":\"round\"];this.plotLeft=e=Math.round(this.plotLeft),this.plotTop=i=Math.round(this.plotTop),this.plotWidth=s=Math.max(0,Math.round(a-e-(this.marginRight??0))),this.plotHeight=o=Math.max(0,Math.round(r-i-(this.marginBottom??0))),this.plotSizeX=n?o:s,this.plotSizeY=n?s:o,this.spacingBox=l.spacingBox={x:h[3],y:h[0],width:a-h[3]-h[1],height:r-h[0]-h[2]},this.plotBox=l.plotBox={x:e,y:i,width:s,height:o},d&&(this.clipBox={x:c(d[3]),y:c(d[0]),width:c(this.plotSizeX-d[1]-d[3]),height:c(this.plotSizeY-d[0]-d[2])}),t||(this.axes.forEach(function(t){t.setAxisSize(),t.setAxisTranslation()}),l.alignElements()),Q(this,\"afterSetChartSize\",{skipAxes:t})}resetMargins(){Q(this,\"resetMargins\");let t=this,e=t.options.chart,i=e.plotBorderWidth||0,s=Math.round(i)/2;[\"margin\",\"spacing\"].forEach(i=>{let s=e[i],o=tg(s)?s:[s,s,s,s];[\"Top\",\"Right\",\"Bottom\",\"Left\"].forEach((s,r)=>{t[i][r]=e[`${i}${s}`]??o[r]})}),i5.forEach((e,i)=>{t[e]=t.margin[i]??t.spacing[i]}),t.axisOffset=[0,0,0,0],t.clipOffset=[s,s,s,s],t.plotBorderWidth=i}drawChartBox(){let t=this.options.chart,e=this.renderer,i=this.chartWidth,s=this.chartHeight,o=this.styledMode,r=this.plotBGImage,a=t.backgroundColor,n=t.plotBackgroundColor,h=t.plotBackgroundImage,l=this.plotLeft,d=this.plotTop,c=this.plotWidth,p=this.plotHeight,g=this.plotBox,u=this.clipRect,f=this.clipBox,m=this.chartBackground,x=this.plotBackground,y=this.plotBorder,b,v,k,w=\"animate\";m||(this.chartBackground=m=e.rect().addClass(\"highcharts-background\").add(),w=\"attr\"),o?b=v=m.strokeWidth():(v=(b=t.borderWidth||0)+8*!!t.shadow,k={fill:a||\"none\"},(b||m[\"stroke-width\"])&&(k.stroke=t.borderColor,k[\"stroke-width\"]=b),m.attr(k).shadow(t.shadow)),m[w]({x:v/2,y:v/2,width:i-v-b%2,height:s-v-b%2,r:t.borderRadius}),w=\"animate\",x||(w=\"attr\",this.plotBackground=x=e.rect().addClass(\"highcharts-plot-background\").add()),x[w](g),!o&&(x.attr({fill:n||\"none\"}).shadow(t.plotShadow),h&&(r?(h!==r.attr(\"href\")&&r.attr(\"href\",h),r.animate(g)):this.plotBGImage=e.image(h,l,d,c,p).add())),u?u.animate({width:f.width,height:f.height}):this.clipRect=e.clipRect(f),w=\"animate\",y||(w=\"attr\",this.plotBorder=y=e.rect().addClass(\"highcharts-plot-border\").attr({zIndex:1}).add()),o||y.attr({stroke:t.plotBorderColor,\"stroke-width\":t.plotBorderWidth||0,fill:\"none\"}),y[w](y.crisp(g,-y.strokeWidth())),this.isDirtyBox=!1,Q(this,\"afterDrawChartBox\")}propFromSeries(){let t,e,i,s=this,o=s.options.chart,r=s.options.series;[\"inverted\",\"angular\",\"polar\"].forEach(function(a){for(e=i4[o.type],i=o[a]||e&&e.prototype[a],t=r?.length;!i&&t--;)(e=i4[r[t].type])&&e.prototype[a]&&(i=!0);s[a]=i})}linkSeries(t){let e=this,i=e.series;i.forEach(function(t){t.linkedSeries.length=0}),i.forEach(function(t){let{linkedTo:s}=t.options,o=td(s)&&(\":previous\"===s?i[t.index-1]:e.get(s));o&&o.linkedParent!==t&&(o.linkedSeries.push(t),t.linkedParent=o,o.enabledDataSorting&&t.setDataSortingOptions(),t.visible=t.options.visible??o.options.visible??t.visible)}),Q(this,\"afterLinkSeries\",{isUpdating:t})}renderSeries(){this.series.forEach(function(t){t.translate(),t.render()})}render(){let t=this.axes,e=this.colorAxis,i=this.renderer,s=this.options.chart.axisLayoutRuns||2,o=t=>{t.forEach(t=>{t.visible&&t.render()})},r=0,a=!0,n,h=0;for(let e of(this.setTitle(),Q(this,\"beforeMargins\"),this.getStacks?.(),this.getMargins(!0),this.setChartSize(),t)){let{options:t}=e,{labels:i}=t;if(this.hasCartesianSeries&&e.horiz&&e.visible&&i.enabled&&e.series.length&&\"colorAxis\"!==e.coll&&!this.polar){r=t.tickLength,e.createGroups();let s=new eZ(e,0,\"\",!0),o=s.createLabel(\"x\",i);if(s.destroy(),o&&tb(i.reserveSpace,!tl(t.crossing))&&(r=o.getBBox().height+i.distance+Math.max(t.offset||0,0)),r){o?.destroy();break}}}for(this.plotHeight=Math.max(this.plotHeight-r,0);(a||n||s>1)&&h(h?1:s[1]),n=i/this.plotHeight>(h?1:s[0]),h++}this.drawChartBox(),this.hasCartesianSeries?o(t):e?.length&&o(e),this.seriesGroup||(this.seriesGroup=i.g(\"series-group\").attr({zIndex:3}).shadow(this.options.chart.seriesGroupShadow).add()),this.renderSeries(),this.addCredits(),this.setResponsive&&this.setResponsive(),this.hasRendered=!0}addCredits(t){let e=this,i=tu(!0,this.options.credits,t);i.enabled&&!this.credits&&(this.credits=this.renderer.text(i.text+(this.mapCredits||\"\"),0,0).addClass(\"highcharts-credits\").on(\"click\",function(t){Q(e,\"creditsClick\",t,()=>{i.href&&(i9.location.href=i.href)})}).attr({align:i.position.align,zIndex:8}),i.events?.click&&R(e,\"creditsClick\",i.events.click),e.styledMode||this.credits.css(i.style),this.credits.add().align(i.position),this.credits.update=function(t){e.credits=e.credits.destroy(),e.addCredits(t)})}destroy(){let t,e=this,i=e.axes,s=e.series,o=e.container,r=o?.parentNode;for(Q(e,\"destroy\"),e.renderer.forExport?K(i2,e):i2[e.index]=void 0,B.chartCount--,e.renderTo.removeAttribute(\"data-highcharts-chart\"),tS(e),t=i.length;t--;)i[t]=i[t].destroy();for(this.scroller?.destroy?.(),t=s.length;t--;)s[t]=s[t].destroy();[\"title\",\"subtitle\",\"chartBackground\",\"plotBackground\",\"plotBGImage\",\"plotBorder\",\"seriesGroup\",\"clipRect\",\"credits\",\"pointer\",\"rangeSelector\",\"legend\",\"resetZoomButton\",\"tooltip\",\"renderer\"].forEach(t=>{e[t]=e[t]?.destroy?.()}),o&&(o.innerHTML=t6.emptyHTML,tS(o),r&&Z(o)),tm(e,function(t,i){delete e[i]})}firstRender(){let t=this,e=t.options;t.getContainer(),t.resetMargins(),t.setChartSize(),t.propFromSeries(),t.createAxes();let i=tc(e.series)?e.series:[];e.series=[],i.forEach(function(e){t.initSeries(e)}),t.linkSeries(),t.setSortedData(),Q(t,\"beforeRender\"),t.render(),t.pointer?.getChartPosition(),t.renderer.asyncCounter||t.hasLoaded||t.onload(),t.temporaryDisplay(!0)}onload(){this.callbacks.concat([this.callback]).forEach(function(t){t&&void 0!==this.index&&t.apply(this,[this])},this),Q(this,\"load\"),Q(this,\"render\"),V(this.index)&&this.setReflow(),this.warnIfA11yModuleNotLoaded(),this.warnIfCSSNotLoaded(),this.hasLoaded=!0}warnIfA11yModuleNotLoaded(){let{options:t,title:e}=this;t&&!this.accessibility&&(this.renderer.boxWrapper.attr({role:\"img\",\"aria-label\":(e?.element.textContent||\"\").replace(/{t[e]&&(tT(t[e]).forEach((t,s)=>{let o;if(!t)return;let r=V(t.id);r&&(o=n.get(t.id)),!o&&n[e]&&(o=n[e][tb(t.index,s)])&&(r&&V(o.options.id)||o.options.isInternal)&&(o=void 0),o&&o.coll===e&&(o.update(t,!1),i&&(o.touched=!0)),!o&&i&&n.collectionsWithInit[e]&&(n.collectionsWithInit[e][0].apply(n,[t].concat(n.collectionsWithInit[e][1]||[]).concat([!1])).touched=!0)}),i&&n[e].forEach(t=>{t.touched||t.options.isInternal?delete t.touched:d.push(t)}))}),d.forEach(t=>{t.chart&&t.remove&&t.remove(!1)}),o&&n.axes.forEach(function(t){t.update({},!1)}),r&&n.getSeriesOrderByLinks().forEach(function(t){t.chart&&t.update({},!1)},this);let p=c?.width,g=c&&(td(c.height)?tw(c.height,p||n.chartWidth):c.height);a||tl(p)&&p!==n.chartWidth||tl(g)&&g!==n.chartHeight?n.setSize(p,g,s):tb(e,!0)&&n.redraw(s),Q(n,\"afterUpdate\",{options:t,redraw:e,animation:s})}setSubtitle(t,e){this.applyDescription(\"subtitle\",t),this.layOutTitles(e)}setCaption(t,e){this.applyDescription(\"caption\",t),this.layOutTitles(e)}showResetZoom(){let t=this,e=iQ.lang,i=t.zooming.resetButton,s=i.theme,o=\"chart\"===i.relativeTo||\"spacingBox\"===i.relativeTo?null:\"plotBox\";function r(){t.zoomOut()}Q(this,\"beforeShowResetZoom\",null,function(){t.resetZoomButton=t.renderer.button(e.resetZoom,null,null,r,s).attr({align:i.position.align,title:e.resetZoomTitle}).addClass(\"highcharts-reset-zoom\").add().align(i.position,!1,o)}),Q(this,\"afterShowResetZoom\")}zoomOut(){Q(this,\"selection\",{resetSelection:!0},()=>this.transform({reset:!0,trigger:\"zoom\"}))}pan(t,e){let i=this,s=\"object\"==typeof e?e:{enabled:e,type:\"x\"},o=s.type,r=o&&i[({x:\"xAxis\",xy:\"axes\",y:\"yAxis\"})[o]].filter(t=>t.options.panningEnabled&&!t.options.isInternal),a=i.options.chart;a?.panning&&(a.panning=s),Q(this,\"pan\",{originalEvent:t},()=>{i.transform({axes:r,event:t,to:{x:t.chartX-(i.mouseDownX||0),y:t.chartY-(i.mouseDownY||0)},trigger:\"pan\"}),$(i.container,{cursor:\"move\"})})}transform(t){let{axes:e=this.axes,event:i,from:s={},reset:o,selection:r,to:a={},trigger:n,allowResetButton:h=!0}=t,{inverted:l,time:d}=this;this.hoverPoints?.forEach(t=>t.setState()),Q(this,\"transform\",t);let c=t.hasZoomed||!1,p,g;for(let t of e){let{horiz:e,len:u,minPointOffset:f=0,options:m,reversed:x}=t,y=e?\"width\":\"height\",b=e?\"x\":\"y\",v=tb(a[y],t.len),k=tb(s[y],t.len),w=10>Math.abs(v)?1:v/k,M=(s[b]||0)+k/2-t.pos,S=M-((a[b]??t.pos)+v/2-t.pos)/w,T=x&&!l||!x&&l?-1:1;if(!o&&(M<0||M>t.len))continue;let C=t.chart.polar||t.isOrdinal?0:f*T||0,A=t.toValue(S,!0),P=t.toValue(S+u/w,!0),L=A+C,O=P-C,E=t.allExtremes;if(r&&r[t.coll].push({axis:t,min:Math.min(A,P),max:Math.max(A,P)}),L>O&&([L,O]=[O,L]),1===w&&!o&&\"yAxis\"===t.coll&&!E){for(let e of t.series){let t=e.getExtremes(e.getProcessedData(!0).modified.getColumn(e.pointValKey||\"y\")||[],!0);E??(E={dataMin:Number.MAX_VALUE,dataMax:-Number.MAX_VALUE}),tl(t.dataMin)&&tl(t.dataMax)&&(E.dataMin=Math.min(t.dataMin,E.dataMin),E.dataMax=Math.max(t.dataMax,E.dataMax))}t.allExtremes=E}let{dataMin:I,dataMax:D,min:B,max:N}=q(t.getExtremes(),E||{}),z=d.parse(m.min),R=d.parse(m.max),W=I??z,H=D??R,X=O-L,G=t.categories?0:Math.min(X,H-W),F=W-G*(V(z)?0:m.minPadding),Y=H+G*(V(R)?0:m.maxPadding),j=t.allowZoomOutside||1===w||\"zoom\"!==n&&w>1,$=Math.min(z??F,F,j?B:F),U=Math.max(R??Y,Y,j?N:Y);(!t.isOrdinal||1!==w||o)&&(L<$&&(L=$,w>=1&&(O=L+X)),O>U&&(O=U,w>=1&&(L=O-X)),(o||t.series.length&&(L!==B||O!==N)&&L>=$&&O<=U)&&(r?r[t.coll].push({axis:t,min:L,max:O}):(t.isPanning=\"zoom\"!==n,t.isPanning&&\"mousewheel\"!==n&&(g=!0),t.setExtremes(o?void 0:L,o?void 0:O,!1,!1,{move:S,trigger:n,scale:w}),!o&&(L>$||O{delete t.selection,t.trigger=\"zoom\",this.transform(t)}):(!p||g||this.resetZoomButton?!p&&this.resetZoomButton&&(this.resetZoomButton=this.resetZoomButton.destroy()):this.showResetZoom(),this.redraw(\"zoom\"===n&&(this.options.chart.animation??this.pointCount<100)))),c}}q(i8.prototype,{callbacks:[],collectionsWithInit:{xAxis:[i8.prototype.addAxis,[!0]],yAxis:[i8.prototype.addAxis,[!1]],series:[i8.prototype.addSeries]},collectionsWithUpdate:[\"xAxis\",\"yAxis\",\"series\"],propsRequireDirtyBox:[\"backgroundColor\",\"borderColor\",\"borderWidth\",\"borderRadius\",\"plotBackgroundColor\",\"plotBackgroundImage\",\"plotBorderColor\",\"plotBorderWidth\",\"plotShadow\",\"shadow\"],propsRequireReflow:[\"margin\",\"marginTop\",\"marginRight\",\"marginBottom\",\"marginLeft\",\"spacing\",\"spacingTop\",\"spacingRight\",\"spacingBottom\",\"spacingLeft\"],propsRequireUpdateSeries:[\"chart.inverted\",\"chart.polar\",\"chart.ignoreHiddenSeries\",\"chart.type\",\"colors\",\"plotOptions\",\"time\",\"tooltip\"]});let{stop:i7}=tQ,{composed:st}=B;function se(){let t=this.scrollablePlotArea;(this.scrollablePixelsX||this.scrollablePixelsY)&&!t&&(this.scrollablePlotArea=t=new ss(this)),t?.applyFixed()}function si(){this.chart.scrollablePlotArea&&(this.chart.scrollablePlotArea.isDirty=!0)}class ss{static compose(t,e,i){tk(st,this.compose)&&(R(t,\"afterInit\",si),R(e,\"afterSetChartSize\",t=>this.afterSetSize(t.target,t)),R(e,\"render\",se),R(i,\"show\",si))}static afterSetSize(t,e){let i,s,o,{minWidth:r,minHeight:a}=t.options.chart.scrollablePlotArea||{},{clipBox:n,plotBox:h,inverted:l,renderer:d}=t;if(!d.forExport)if(r?(t.scrollablePixelsX=i=Math.max(0,r-t.chartWidth),i&&(t.scrollablePlotBox=tu(t.plotBox),h.width=t.plotWidth+=i,n[l?\"height\":\"width\"]+=i,o=!0)):a&&(t.scrollablePixelsY=s=Math.max(0,a-t.chartHeight),V(s)&&(t.scrollablePlotBox=tu(t.plotBox),h.height=t.plotHeight+=s,n[l?\"width\":\"height\"]+=s,o=!1)),V(o)){if(!e.skipAxes)for(let e of t.axes)(e.horiz===o||t.hasParallelCoordinates&&\"yAxis\"===e.coll)&&(e.setAxisSize(),e.setAxisTranslation())}else delete t.scrollablePlotBox}constructor(t){let e;const i=t.options.chart,s=eo.getRendererType(),o=i.scrollablePlotArea||{},r=this.moveFixedElements.bind(this),a={WebkitOverflowScrolling:\"touch\",overflowX:\"hidden\",overflowY:\"hidden\"};t.scrollablePixelsX&&(a.overflowX=\"auto\"),t.scrollablePixelsY&&(a.overflowY=\"auto\"),this.chart=t;const n=this.parentDiv=Y(\"div\",{className:\"highcharts-scrolling-parent\"},{position:\"relative\"},t.renderTo),h=this.scrollingContainer=Y(\"div\",{className:\"highcharts-scrolling\"},a,n),l=this.innerContainer=Y(\"div\",{className:\"highcharts-inner-container\"},void 0,h),d=this.fixedDiv=Y(\"div\",{className:\"highcharts-fixed\"},{position:\"absolute\",overflow:\"hidden\",pointerEvents:\"none\",zIndex:(i.style?.zIndex||0)+2,top:0},void 0,!0),c=this.fixedRenderer=new s(d,t.chartWidth,t.chartHeight,i.style);this.mask=c.path().attr({fill:i.backgroundColor||\"#fff\",\"fill-opacity\":o.opacity??.85,zIndex:-1}).addClass(\"highcharts-scrollable-mask\").add(),h.parentNode.insertBefore(d,h),$(t.renderTo,{overflow:\"visible\"}),R(t,\"afterShowResetZoom\",r),R(t,\"afterApplyDrilldown\",r),R(t,\"afterLayOutTitles\",r),R(h,\"scroll\",()=>{let{pointer:i,hoverPoint:s}=t;i&&(delete i.chartPosition,s&&(e=s),i.runPointActions(void 0,e,!0))}),l.appendChild(t.container)}applyFixed(){let{chart:t,fixedRenderer:e,isDirty:i,scrollingContainer:s}=this,{axisOffset:o,chartWidth:r,chartHeight:a,container:n,plotHeight:h,plotLeft:l,plotTop:d,plotWidth:c,scrollablePixelsX:p=0,scrollablePixelsY:g=0}=t,{scrollPositionX:u=0,scrollPositionY:f=0}=t.options.chart.scrollablePlotArea||{},m=r+p,x=a+g;e.setSize(r,a),(i??!0)&&(this.isDirty=!1,this.moveFixedElements()),i7(t.container),$(n,{width:`${m}px`,height:`${x}px`}),t.renderer.boxWrapper.attr({width:m,height:x,viewBox:[\"0 0\",m,x].join(\" \")}),t.chartBackground?.attr({width:m,height:x}),$(s,{width:`${r}px`,height:`${a}px`}),V(i)||(s.scrollLeft=p*u,s.scrollTop=g*f);let y=d-o[0]-1,b=l-o[3]-1,v=d+h+o[2]+1,k=l+c+o[1]+1,w=l+c-p,M=d+h-g,S=[[\"M\",0,0]];p?S=[[\"M\",0,y],[\"L\",l-1,y],[\"L\",l-1,v],[\"L\",0,v],[\"Z\"],[\"M\",w,y],[\"L\",r,y],[\"L\",r,v],[\"L\",w,v],[\"Z\"]]:g&&(S=[[\"M\",b,0],[\"L\",b,d-1],[\"L\",k,d-1],[\"L\",k,0],[\"Z\"],[\"M\",b,M],[\"L\",b,a],[\"L\",k,a],[\"L\",k,M],[\"Z\"]]),\"adjustHeight\"!==t.redrawTrigger&&this.mask.attr({d:S})}moveFixedElements(){let t,{container:e,inverted:i,scrollablePixelsX:s,scrollablePixelsY:o}=this.chart,r=this.fixedRenderer,a=ss.fixedSelectors.slice();if(s&&!i?t=\".highcharts-yaxis\":s&&i||o&&!i?t=\".highcharts-xaxis\":o&&i&&(t=\".highcharts-yaxis\"),t&&!(this.chart.hasParallelCoordinates&&\".highcharts-yaxis\"===t))for(let e of[`${t}:not(.highcharts-radial-axis)`,`${t}-labels:not(.highcharts-radial-axis-labels)`])tk(a,e);else for(let t of[\".highcharts-xaxis\",\".highcharts-yaxis\"])for(let e of[`${t}:not(.highcharts-radial-axis)`,`${t}-labels:not(.highcharts-radial-axis-labels)`])K(a,e);for(let t of a)[].forEach.call(e.querySelectorAll(t),t=>{(t.namespaceURI===r.SVG_NS?r.box:r.box.parentNode).appendChild(t),t.style.pointerEvents=\"auto\"})}}ss.fixedSelectors=[\".highcharts-breadcrumbs-group\",\".highcharts-contextbutton\",\".highcharts-caption\",\".highcharts-credits\",\".highcharts-drillup-button\",\".highcharts-legend\",\".highcharts-legend-checkbox\",\".highcharts-navigator-series\",\".highcharts-navigator-xaxis\",\".highcharts-navigator-yaxis\",\".highcharts-navigator\",\".highcharts-range-selector-group\",\".highcharts-reset-zoom\",\".highcharts-scrollbar\",\".highcharts-subtitle\",\".highcharts-title\"];let{format:so}=es,{series:sr}=iO,sa=class{constructor(t,e,i,s,o){const r=t.chart.inverted,a=t.reversed;this.axis=t;const n=this.isNegative=!!i!=!!a;this.options=e=e||{},this.x=s,this.total=null,this.cumulative=null,this.points={},this.hasValidPoints=!1,this.stack=o,this.leftCliff=0,this.rightCliff=0,this.alignOptions={align:e.align||(r?n?\"left\":\"right\":\"center\"),verticalAlign:e.verticalAlign||(r?\"middle\":n?\"bottom\":\"top\"),y:e.y,x:e.x},this.textAlign=e.textAlign||(r?n?\"right\":\"left\":\"center\")}destroy(){U(this,this.axis)}render(t){let e=this.axis.chart,i=this.options,s=i.format,o=(s?so(s,this,e):i.formatter?.call(this,this))||\"\";if(this.label)this.label.attr({text:o,visibility:\"hidden\"});else{this.label=e.renderer.label(o,null,void 0,i.shape,void 0,void 0,i.useHTML,!1,\"stack-labels\");let s={r:i.borderRadius||0,text:o,padding:tb(i.padding,5),visibility:\"hidden\"};e.styledMode||(s.fill=i.backgroundColor,s.stroke=i.borderColor,s[\"stroke-width\"]=i.borderWidth,this.label.css(i.style||{})),this.label.attr(s),this.label.added||this.label.add(t)}this.label.labelrank=e.plotSizeY,Q(this,\"afterRender\")}setOffset(t,e,i,s,o,r){let{alignOptions:a,axis:n,label:h,options:l,textAlign:d}=this,c=n.chart,p=this.getStackBox({xOffset:t,width:e,boxBottom:i,boxTop:s,defaultX:o,xAxis:r}),{verticalAlign:g}=a;if(h&&p){let t=h.getBBox(void 0,0),e=h.padding,i=\"justify\"===tb(l.overflow,\"justify\"),s;a.x=l.x||0,a.y=l.y||0;let{x:o,y:r}=this.adjustStackPosition({labelBox:t,verticalAlign:g,textAlign:d});p.x-=o,p.y-=r,h.align(a,!1,p),(s=c.isInsidePlot(h.alignAttr.x+a.x+o,h.alignAttr.y+a.y+r))||(i=!1),i&&sr.prototype.justifyDataLabel.call(n,h,a,h.alignAttr,t,p),h.attr({x:h.alignAttr.x,y:h.alignAttr.y,rotation:l.rotation,rotationOriginX:t.width*tt(l.textAlign||\"center\"),rotationOriginY:t.height/2}),tb(!i&&l.crop,!0)&&(s=tl(h.x)&&tl(h.y)&&c.isInsidePlot(h.x-e+(h.width||0),h.y)&&c.isInsidePlot(h.x+e,h.y)),h[s?\"show\":\"hide\"]()}Q(this,\"afterSetOffset\",{xOffset:t,width:e})}adjustStackPosition({labelBox:t,verticalAlign:e,textAlign:i}){return{x:t.width/2+t.width/2*(2*tt(i)-1),y:t.height/2*2*(1-tt(e))}}getStackBox(t){let e=this.axis,i=e.chart,{boxTop:s,defaultX:o,xOffset:r,width:a,boxBottom:n}=t,h=e.stacking.usePercentage?100:tb(s,this.total,0),l=e.toPixels(h),d=t.xAxis||i.xAxis[0],c=tb(o,d.translate(this.x))+r,p=Math.abs(l-e.toPixels(n||tl(e.min)&&e.logarithmic&&e.logarithmic.lin2log(e.min)||0)),g=i.inverted,u=this.isNegative;return g?{x:(u?l:l-p)-i.plotLeft,y:d.height-c-a+d.top-i.plotTop,width:p,height:a}:{x:c+d.transB-i.plotLeft,y:(u?l-p:l)-i.plotTop,width:a,height:p}}},{getDeferredAnimation:sn}=tQ,{series:{prototype:sh}}=iO;function sl(){let t=this.inverted;this.axes.forEach(t=>{t.stacking?.stacks&&t.hasVisibleSeries&&(t.stacking.oldStacks=t.stacking.stacks)}),this.series.forEach(e=>{let i=e.xAxis?.options||{};e.options.stacking&&e.reserveSpace()&&(e.stackKey=[e.type,tb(e.options.stack,\"\"),t?i.top:i.left,t?i.height:i.width].join(\",\"))})}function sd(){let t=this.stacking;if(t){let e=t.stacks;tm(e,(t,i)=>{U(t),delete e[i]}),t.stackTotalGroup?.destroy()}}function sc(){this.stacking||(this.stacking=new sx(this))}function sp(t,e,i,s){return!V(t)||t.x!==e||s&&t.stackKey!==s?t={x:e,index:0,key:s,stackKey:s}:t.index++,t.key=[i,e,t.index].join(\",\"),t}function sg(){let t,e=this,i=e.yAxis,s=e.stackKey||\"\",o=i.stacking.stacks,r=e.getColumn(\"x\",!0),a=e.options.stacking,n=e[a+\"Stacker\"];n&&[s,\"-\"+s].forEach(i=>{let s=r.length,a,h,l;for(;s--;)a=r[s],t=e.getStackIndicator(t,a,e.index,i),h=o[i]?.[a],(l=h?.points[t.key||\"\"])&&n.call(e,l,h,s)})}function su(t,e,i){let s=e.total?100/e.total:0;t[0]=F(t[0]*s),t[1]=F(t[1]*s),this.stackedYData[i]=t[1]}function sf(t){(this.is(\"column\")||this.is(\"columnrange\"))&&(this.options.centerInCategory&&this.chart.series.length>1?sh.setStackedPoints.call(this,t,\"group\"):t.stacking.resetStacks())}function sm(t,e){let i,s,o,r,a,n,h,l=e||this.options.stacking;if(!l||!this.reserveSpace()||(({group:\"xAxis\"})[l]||\"yAxis\")!==t.coll)return;let d=this.getColumn(\"x\",!0),c=this.getColumn(this.pointValKey||\"y\",!0),p=[],g=c.length,u=this.options,f=u.threshold||0,m=u.startFromThreshold?f:0,x=u.stack,y=e?`${this.type},${l}`:this.stackKey||\"\",b=\"-\"+y,v=this.negStacks,k=t.stacking,w=k.stacks,M=k.oldStacks;for(k.stacksTouched+=1,h=0;h0&&!1===this.singleStacks&&(o.points[n][0]=o.points[this.index+\",\"+e+\",0\"][0])):(delete o.points[n],delete o.points[this.index]);let S=o.total||0;\"percent\"===l?(r=s?y:b,S=v&&w[r]?.[e]?(r=w[r][e]).total=Math.max(r.total||0,S)+Math.abs(u):F(S+Math.abs(u))):\"group\"===l?tl(g)&&S++:S=F(S+u),\"group\"===l?o.cumulative=(S||1)-1:o.cumulative=F(tb(o.cumulative,m)+u),o.total=S,null!==g&&(o.points[n].push(o.cumulative),p[h]=o.cumulative,o.hasValidPoints=!0)}\"percent\"===l&&(k.usePercentage=!0),\"group\"!==l&&(this.stackedYData=p),k.oldStacks={}}class sx{constructor(t){this.oldStacks={},this.stacks={},this.stacksTouched=0,this.axis=t}buildStacks(){let t,e,i=this.axis,s=i.series,o=\"xAxis\"===i.coll,r=i.options.reversedStacks,a=s.length;for(this.resetStacks(),this.usePercentage=!1,e=a;e--;)t=s[r?e:a-e-1],o&&t.setGroupedPoints(i),t.setStackedPoints(i);if(!o)for(e=0;e{tm(t,t=>{t.cumulative=t.total})}))}resetStacks(){tm(this.stacks,t=>{tm(t,(e,i)=>{tl(e.touched)&&e.touched{tm(t,t=>{t.render(r)})}),r.animate({opacity:1},o)}}(T||(T={})).compose=function(t,e,i){let s=e.prototype,o=i.prototype;s.getStacks||(R(t,\"init\",sc),R(t,\"destroy\",sd),s.getStacks=sl,o.getStackIndicator=sp,o.modifyStacks=sg,o.percentStacker=su,o.setGroupedPoints=sf,o.setStackedPoints=sm)};let sy=T;class sb extends iX{drawGraph(){let t=this.options,e=(this.gappedPath||this.getGraphPath).call(this),i=this.chart.styledMode;[this,...this.zones].forEach((s,o)=>{let r,a=s.graph,n=a?\"animate\":\"attr\",h=s.dashStyle||t.dashStyle;if(a?(a.endX=this.preventGraphAnimation?null:e.xMap,a.animate({d:e})):e.length&&(s.graph=a=this.chart.renderer.path(e).addClass(\"highcharts-graph\"+(o?` highcharts-zone-graph-${o-1} `:\" \")+(o&&s.className||\"\")).attr({zIndex:1}).add(this.group)),a&&!i&&(r={stroke:!o&&t.lineColor||s.color||this.color||\"#cccccc\",\"stroke-width\":t.lineWidth||0,fill:this.fillGraph&&this.color||\"none\"},h?r.dashstyle=h:\"square\"!==t.linecap&&(r[\"stroke-linecap\"]=r[\"stroke-linejoin\"]=\"round\"),a[n](r),t.shadow)){let e=this.chart.inverted,i={filterUnits:\"userSpaceOnUse\"},s=tg(t.shadow)?tu(e?{}:i,t.shadow):!!e||i;a.shadow(s)}a&&(a.startX=e.xMap,a.isArea=e.isArea)})}getGraphPath(t,e,i){let s=this,o=s.options,r=[],a=[],n,h=o.step,l=(t=t||s.points).reversed;return l&&t.reverse(),(h=({right:1,center:2})[h]||h&&3)&&l&&(h=4-h),(t=this.getValidPoints(t,!1,o.nullInteraction||!(o.connectNulls&&!e&&!i))).forEach(function(l,d){let c,p=l.plotX,g=l.plotY,u=t[d-1],f=l.isNull||\"number\"!=typeof g;(l.leftCliff||u?.rightCliff)&&!i&&(n=!0),f&&!V(e)&&d>0?n=!o.connectNulls:f&&!e?n=!0:(0===d||n?c=[[\"M\",l.plotX,l.plotY]]:s.getPointSpline?c=[s.getPointSpline(t,l,d)]:h?(c=1===h?[[\"L\",u.plotX,g]]:2===h?[[\"L\",(u.plotX+p)/2,u.plotY],[\"L\",(u.plotX+p)/2,g]]:[[\"L\",p,u.plotY]]).push([\"L\",p,g]):c=[[\"L\",p,g]],a.push(l.x),h&&(a.push(l.x),2===h&&a.push(l.x)),r.push.apply(r,c),n=!1)}),r.xMap=a,s.graphPath=r,r}}sb.defaultOptions=tu(iX.defaultOptions,{legendSymbol:\"lineMarker\"}),iO.registerSeriesType(\"line\",sb);let{seriesTypes:{line:sv}}=iO;class sk extends sv{drawGraph(){this.areaPath=[],super.drawGraph.apply(this);let{areaPath:t,options:e}=this;[this,...this.zones].forEach((i,s)=>{let o={},r=i.fillColor||e.fillColor,a=i.area,n=a?\"animate\":\"attr\";a?(a.endX=this.preventGraphAnimation?null:t.xMap,a.animate({d:t})):(o.zIndex=0,(a=i.area=this.chart.renderer.path(t).addClass(\"highcharts-area\"+(s?` highcharts-zone-area-${s-1} `:\" \")+(s&&i.className||\"\")).add(this.group)).isArea=!0),this.chart.styledMode||(o.fill=r||i.color||this.color,o[\"fill-opacity\"]=r?1:e.fillOpacity??.75,a.css({pointerEvents:this.stickyTracking?\"none\":\"auto\"})),a[n](o),a.startX=t.xMap,a.shiftUnit=e.step?2:1})}getGraphPath(t){let e,i,s,o=sv.prototype.getGraphPath,r=this.options,a=r.stacking,n=this.yAxis,h=[],l=[],d=this.index,c=n.stacking.stacks[this.stackKey],p=r.threshold,g=Math.round(n.getThreshold(r.threshold)),u=tb(r.connectNulls,\"percent\"===a),f=function(i,s,o){let r=t[i],u=t[s],f=a&&c[r.x].points[d],m=r[o+\"Null\"]||0,x=r[o+\"Cliff\"]||0,y,b,v=!0;f&&(x||m)?(y=(m?f[0]:f[1])+x,b=f[0]+x,v=!!m):!a&&u&&(u.isNull||!V(u.plotY))&&(y=b=p),void 0!==y&&(l.push({plotX:e,plotY:null===y?g:n.getThreshold(y),isNull:v,isCliff:!0}),h.push({plotX:e,plotY:null===b?g:n.getThreshold(b),doCurve:!1}))};t=t||this.points,a&&(t=this.getStackPoints(t));for(let o=0,r=t.length;o1&&a&&l.some(t=>t.isCliff)&&(b.hasStackedCliffs=v.hasStackedCliffs=!0),b.xMap=m.xMap,this.areaPath=b,v}getStackPoints(t){let e=this,i=[],s=[],o=this.xAxis,r=this.yAxis,a=r.stacking.stacks[this.stackKey],n={},h=r.series,l=h.length,d=r.options.reversedStacks?1:-1,c=h.indexOf(e),p=r.getThreshold(e.options.threshold||0);if(t=t||this.points,this.options.stacking){for(let e=0;et.visible);s.forEach(function(t,u){let f=0,m,x;if(n[t]&&!n[t].isNull)i.push(n[t]),[-1,1].forEach(function(i){let o=1===i?\"rightNull\":\"leftNull\",r=a[s[u+i]],p=0;if(r){let i=c;for(;i>=0&&i=0&&ei&&o>h?(o=Math.max(i,h),a=2*h-o):op&&a>h?(a=Math.max(p,h),o=2*h-a):a1){let o=this.xAxis.series.filter(t=>t.visible).map(t=>t.index),r=0,a=0;tm(this.xAxis.stacking?.stacks,t=>{let e=\"number\"==typeof i.x?t[i.x.toString()]?.points:void 0,s=e?.[this.index],n={};if(e&&tc(s)){let t=this.index,i=Object.keys(e).filter(t=>!t.match(\",\")&&e[t]&&e[t].length>1).map(parseFloat).filter(t=>-1!==o.indexOf(t)).filter(e=>{let i=this.chart.series[e].options,s=i.stacking&&i.stack;if(V(s)){if(tl(n[s]))return t===e&&(t=n[s]),!1;n[s]=e}return!0}).sort((t,e)=>e-t);r=i.indexOf(t),a=i.length}}),r=this.xAxis.reversed?a-1-r:r;let n=(a-1)*s.paddedWidth+e;t=(i.plotX||0)+n/2-e-r*s.paddedWidth}return t}translate(){let t=this,e=t.chart,i=t.options,s=t.dense=t.closestPointRange*t.xAxis.transA<2,o=t.borderWidth=i.borderWidth??+!s,r=t.xAxis,a=t.yAxis,n=i.threshold,h=i.minPointLength??5,l=t.getColumnMetrics(),d=l.width,c=t.pointXOffset=l.offset,p=t.dataMin,g=t.dataMax,u=t.translatedThreshold=a.getThreshold(n),f=t.barW=Math.max(d,1+2*o);i.pointPadding&&i.crisp&&(f=Math.ceil(f)),iX.prototype.translate.apply(t),t.points.forEach(function(s){let o=s.yBottom??u,m=999+Math.abs(o),x=s.plotX||0,y=G(s.plotY,-m,a.len+m),b,v=Math.min(y,o),k=Math.max(y,o)-v,w=d,M=x+c,S=f;h&&Math.abs(k)h?o-(b?h:0):u-(b?h:0)),V(s.options.pointWidth)&&(M-=Math.round(((w=S=Math.ceil(s.options.pointWidth))-d)/2)),i.centerInCategory&&(M=t.adjustForMissingColumns(M,w,s,l)),s.barX=M,s.pointWidth=w,s.tooltipPos=e.inverted?[G(a.len+a.pos-e.plotLeft-y,a.pos-e.plotLeft,a.len+a.pos-e.plotLeft),r.len+r.pos-e.plotTop-M-S/2,k]:[r.left-e.plotLeft+M+S/2,G(y+a.pos-e.plotTop,a.pos-e.plotTop,a.len+a.pos-e.plotTop),k],s.shapeType=t.pointClass.prototype.shapeType||\"roundedRect\",s.shapeArgs=t.crispCol(M,v,S,s.isNull?0:k)}),Q(this,\"afterColumnTranslate\")}drawGraph(){this.group[this.dense?\"addClass\":\"removeClass\"](\"highcharts-dense-data\")}pointAttribs(t,e){let i=this.options,s=this.pointAttrToOptions||{},o=s.stroke||\"borderColor\",r=s[\"stroke-width\"]||\"borderWidth\",a,n,h,l=t&&t.color||this.color,d=t&&t[o]||i[o]||l,c=t&&t.options.dashStyle||i.dashStyle,p=t&&t[r]||i[r]||this[r]||0,g=t?.isNull&&i.nullInteraction?0:t?.opacity??i.opacity??1;t&&this.zones.length&&(n=t.getZone(),l=t.options.color||n&&(n.color||t.nonZonedColor)||this.color,n&&(d=n.borderColor||d,c=n.dashStyle||c,p=n.borderWidth||p)),e&&t&&(h=(a=tu(i.states[e],t.options.states?.[e]||{})).brightness,l=a.color||void 0!==h&&sL(l).brighten(a.brightness).get()||l,d=a[o]||d,p=a[r]||p,c=a.dashStyle||c,g=tb(a.opacity,g));let u={fill:l,stroke:d,\"stroke-width\":p,opacity:g};return c&&(u.dashstyle=c),u}drawPoints(t=this.points){let e,i=this,s=this.chart,o=i.options,r=o.nullInteraction,a=s.renderer,n=o.animationLimit||250;t.forEach(function(t){let h=t.plotY,l=t.graphic,d=!!l,c=l&&s.pointCount(\"dataLabelsGroup\"===e?t.push(...i.dataLabelsGroups||[]):t.push(i[e]),t),[]).forEach(t=>{t&&(t.addClass(\"highcharts-tracker\").on(\"mouseover\",r).on(\"mouseout\",function(t){o?.onTrackerMouseOut(t)}).on(\"touchstart\",r),!s.styledMode&&i.options.cursor&&t.css({cursor:i.options.cursor}))}),i._hasTracking=!0),Q(this,\"afterDrawTracker\")}remove(){let t=this,e=t.chart;e.hasRendered&&e.series.forEach(function(e){e.type===t.type&&(e.isDirty=!0)}),iX.prototype.remove.apply(t,arguments)}}sE.defaultOptions=tu(iX.defaultOptions,{borderRadius:3,centerInCategory:!1,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1},select:{color:\"#cccccc\",borderColor:\"#000000\"}},dataLabels:{align:void 0,verticalAlign:void 0,y:void 0},startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:\"#ffffff\"}),q(sE.prototype,{directTouch:!0,getSymbol:sO,negStacks:!0,trackerGroups:[\"group\",\"dataLabelsGroup\"]}),iO.registerSeriesType(\"column\",sE);let sI=sE,{getDeferredAnimation:sD}=tQ,{format:sB}=es;!function(t){function e(){return h(this).some(t=>t?.enabled)}function i(t,e,i,s,o){let{chart:r,enabledDataSorting:a}=this,n=this.isCartesian&&r.inverted,h=t.plotX,l=t.plotY,d=i.rotation||0,c=V(h)&&V(l)&&r.isInsidePlot(h,Math.round(l),{inverted:n,paneCoordinates:!0,series:this}),p=0===d&&\"justify\"===tb(i.overflow,a?\"none\":\"justify\"),g=this.visible&&!1!==t.visible&&V(h)&&(t.series.forceDL||a&&!p||c||tb(i.inside,!!this.options.stacking)&&s&&r.isInsidePlot(h,n?s.x+1:s.y+s.height-1,{inverted:n,paneCoordinates:!0,series:this})),u=t.pos();if(g&&u){var f;let h=e.getBBox(),l=e.getBBox(void 0,0);if(s=q({x:u[0],y:Math.round(u[1]),width:0,height:0},s||{}),\"plotEdges\"===i.alignTo&&this.isCartesian&&(s[n?\"x\":\"y\"]=0,s[n?\"width\":\"height\"]=this.yAxis?.len||0),q(i,{width:h.width,height:h.height}),f=s,a&&this.xAxis&&!p&&this.setDataLabelStartPos(t,e,o,c,f),e.align(tu(i,{width:l.width,height:l.height}),!1,s,!1),e.alignAttr.x+=tt(i.align)*(l.width-h.width),e.alignAttr.y+=tt(i.verticalAlign)*(l.height-h.height),e[e.placed?\"animate\":\"attr\"]({\"text-align\":e.alignAttr[\"text-align\"]||\"center\",x:e.alignAttr.x+(h.width-l.width)/2,y:e.alignAttr.y+(h.height-l.height)/2,rotationOriginX:(e.width||0)/2,rotationOriginY:(e.height||0)/2}),p&&s.height>=0)this.justifyDataLabel(e,i,e.alignAttr,h,s,o);else if(tb(i.crop,!0)){let{x:t,y:i}=e.alignAttr;g=r.isInsidePlot(t,i,{paneCoordinates:!0,series:this})&&r.isInsidePlot(t+h.width-1,i+h.height-1,{paneCoordinates:!0,series:this})}i.shape&&!d&&e[o?\"attr\":\"animate\"]({anchorX:u[0],anchorY:u[1]})}o&&a&&(e.placed=!1),g||a&&!p?(e.show(),e.placed=!0):(e.hide(),e.placed=!1)}function s(t,e){Q(this,\"initDataLabelsGroup\",{index:t,zIndex:e?.zIndex??6}),this.dataLabelsGroup=this.dataLabelsGroups?.[t];let i=this.plotGroup(\"dataLabelsGroup\",\"data-labels\",this.hasRendered?\"inherit\":\"hidden\",e?.zIndex??6,this.dataLabelsParentGroups?.[t]);return this.dataLabelsGroups||(this.dataLabelsGroups=[]),this.dataLabelsGroups[t]=i,this.dataLabelsGroup=this.dataLabelsGroups[0],i}function o(t,e,i){let s=!!this.hasRendered,o=this.initDataLabelsGroup(t,i).attr({opacity:+s});return!s&&o&&(this.visible&&o.show(),this.options.animation?o.animate({opacity:1},e):o.attr({opacity:1})),o}function r(t){let e;t=t||this.points;let i=this,s=i.chart,o=i.options,r=s.renderer,{backgroundColor:a,plotBackgroundColor:l}=s.options.chart,d=r.getContrast(td(l)&&l||td(a)&&a||\"#000000\"),c=h(i),{animation:p,defer:g}=c[0],u=g?sD(s,p,i):{defer:0,duration:0};Q(this,\"drawDataLabels\"),i.hasDataLabels?.()&&t.forEach(t=>{let a=t.dataLabels||[],h=t.color||i.color;tT(n(c,t.dlOptions||t.options?.dataLabels)).forEach((n,l)=>{e=this.initDataLabels(l,u,n);let c=n.enabled&&(t.visible||t.dataLabelOnHidden)&&(!t.isNull||t.dataLabelOnNull)&&function(t,e){let i=e.filter;if(i){let e=i.operator,s=t[i.property],o=i.value;return\">\"===e&&s>o||\"<\"===e&&s=\"===e&&s>=o||\"<=\"===e&&s<=o||\"==\"===e&&s==o||\"===\"===e&&s===o||\"!=\"===e&&s!=o||\"!==\"===e&&s!==o||!1}return!0}(t,n),{backgroundColor:p,borderColor:g,distance:f,style:m={}}=n,x,y,b,v={},k=a[l],w=!k,M;c&&(y=V(x=tb(n[t.formatPrefix+\"Format\"],n.format))?sB(x,t,s):(n[t.formatPrefix+\"Formatter\"]||n.formatter).call(t,n,t),b=n.rotation,!s.styledMode&&(m.color=tb(n.color,m.color,td(i.color)?i.color:void 0,\"#000000\"),\"contrast\"===m.color?(\"none\"!==p&&(M=p),t.contrastColor=r.getContrast(\"auto\"!==M&&td(M)&&M||(td(h)?h:\"\")),m.color=M||!V(f)&&n.inside||0>tv(f||0)||o.stacking?t.contrastColor:d):delete t.contrastColor,o.cursor&&(m.cursor=o.cursor)),v={r:n.borderRadius||0,rotation:b,padding:n.padding,zIndex:1},s.styledMode||(v.fill=\"auto\"===p?t.color:p,v.stroke=\"auto\"===g?t.color:g,v[\"stroke-width\"]=n.borderWidth),tm(v,(t,e)=>{void 0===t&&delete v[e]})),!k||c&&V(y)&&!!(k.div||k.text?.foreignObject)==!!n.useHTML&&(k.rotation&&n.rotation||k.rotation===n.rotation)||(k=void 0,w=!0),c&&V(y)&&\"\"!==y&&(k?v.text=y:(k=r.label(y,0,0,n.shape,void 0,void 0,n.useHTML,void 0,\"data-label\")).addClass(\" highcharts-data-label-color-\"+t.colorIndex+\" \"+(n.className||\"\")+(n.useHTML?\" highcharts-tracker\":\"\")),k&&(k.options=n,k.attr(v),s.styledMode?m.width&&k.css({width:m.width,textOverflow:m.textOverflow,whiteSpace:m.whiteSpace}):k.css(m).shadow(n.shadow),Q(k,\"beforeAddingDataLabel\",{labelOptions:n,point:t}),k.added||k.add(e),i.alignDataLabel(t,k,n,void 0,w),k.isActive=!0,a[l]&&a[l]!==k&&a[l].destroy(),a[l]=k))});let l=a.length;for(;l--;)a[l]?.isActive?a[l].isActive=!1:(a[l]?.destroy(),a.splice(l,1));t.dataLabel=a[0],t.dataLabels=a}),Q(this,\"afterDrawDataLabels\")}function a(t,e,i,s,o,r){let a=this.chart,n=e.align,h=e.verticalAlign,l=t.box?0:t.padding||0,d=a.inverted?this.yAxis:this.xAxis,c=d?d.left-a.plotLeft:0,p=a.inverted?this.xAxis:this.yAxis,g=p?p.top-a.plotTop:0,{x:u=0,y:f=0}=e,m,x;return(m=(i.x||0)+l+c)<0&&(\"right\"===n&&u>=0?(e.align=\"left\",e.inside=!0):u-=m,x=!0),(m=(i.x||0)+s.width-l+c)>a.plotWidth&&(\"left\"===n&&u<=0?(e.align=\"right\",e.inside=!0):u+=a.plotWidth-m,x=!0),(m=i.y+l+g)<0&&(\"bottom\"===h&&f>=0?(e.verticalAlign=\"top\",e.inside=!0):f-=m,x=!0),(m=(i.y||0)+s.height-l+g)>a.plotHeight&&(\"top\"===h&&f<=0?(e.verticalAlign=\"bottom\",e.inside=!0):f+=a.plotHeight-m,x=!0),x&&(e.x=u,e.y=f,t.placed=!r,t.align(e,void 0,o)),x}function n(t,e){let i=[],s;if(tc(t)&&!tc(e))i=t.map(function(t){return tu(t,e)});else if(tc(e)&&!tc(t))i=e.map(function(e){return tu(t,e)});else if(tc(t)||tc(e)){if(tc(t)&&tc(e))for(s=Math.max(t.length,e.length);s--;)i[s]=tu(t[s],e[s])}else i=tu(t,e);return i}function h(t){let e=t.chart.options.plotOptions;return tT(n(n(e?.series?.dataLabels,e?.[t.type]?.dataLabels),t.options.dataLabels))}function l(t,e,i,s,o){let r=this.chart,a=r.inverted,n=this.xAxis,h=n.reversed,l=((a?e.height:e.width)||0)/2,d=t.pointWidth,c=d?d/2:0;e.startXPos=a?o.x:h?-l-c:n.width-l+c,e.startYPos=a?h?this.yAxis.height-l+c:-l-c:o.y,s?\"hidden\"===e.visibility&&(e.show(),e.attr({opacity:0}).animate({opacity:1})):e.attr({opacity:1}).animate({opacity:0},void 0,e.hide),r.hasRendered&&(i&&e.attr({x:e.startXPos,y:e.startYPos}),e.placed=!0)}t.compose=function(t){let h=t.prototype;h.initDataLabels||(h.initDataLabels=o,h.initDataLabelsGroup=s,h.alignDataLabel=i,h.drawDataLabels=r,h.justifyDataLabel=a,h.mergeArrays=n,h.setDataLabelStartPos=l,h.hasDataLabels=e)}}(C||(C={}));let sN=C,{composed:sz}=B,{series:sR}=iO;function sW(t,e,i,s,o){let{chart:r,options:a}=this,n=r.inverted,h=this.xAxis?.len||r.plotSizeX||0,l=this.yAxis?.len||r.plotSizeY||0,d=t.dlBox||t.shapeArgs,c=t.below??(t.plotY||0)>(this.translatedThreshold??l),p=i.inside??!!a.stacking;if(d){if(s=tu(d),\"allow\"!==i.overflow||!1!==i.crop||!1!==a.clip){s.y<0&&(s.height+=s.y,s.y=0);let t=s.y+s.height-l;t>0&&t\u25CF {series.name}
',pointFormat:\"x: {point.x}
y: {point.y}
\"}}),q(sY.prototype,{allowOutsidePlotInteraction:!0,drawTracker:sG.prototype.drawTracker,sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:[\"group\",\"markerGroup\",\"dataLabelsGroup\"]}),R(sY,\"afterTranslate\",function(){this.applyJitter()}),iO.registerSeriesType(\"scatter\",sY);let{deg2rad:sj}=B;(p=P||(P={})).getCenter=function(){let t=this.options,e=this.chart,i=2*(t.slicedOffset||0),s=e.plotWidth-2*i,o=e.plotHeight-2*i,r=t.center,a=Math.min(s,o),n=t.thickness,h,l=t.size,d=t.innerSize||0,c,p;\"string\"==typeof l&&(l=parseFloat(l)),\"string\"==typeof d&&(d=parseFloat(d));let g=[tb(r?.[0],\"50%\"),tb(r?.[1],\"50%\"),tb(l&&l<0?void 0:t.size,\"100%\"),tb(d&&d<0?void 0:t.innerSize||0,\"0%\")];for(!e.angular||this instanceof iX||(g[3]=0),c=0;c<4;++c)p=g[c],h=c<2||2===c&&/%$/.test(p),g[c]=tw(p,[s,o,a,g[2]][c])+(h?i:0);return g[3]>g[2]&&(g[3]=g[2]),tl(n)&&2*n0&&(g[3]=g[2]-2*n),Q(this,\"afterGetCenter\",{positions:g}),g},p.getStartAndEndRadians=function(t,e){let i=tl(t)?t:0,s=tl(e)&&e>i&&e-i<360?e:i+360;return{start:sj*(i+-90),end:sj*(s+-90)}};let s$=P,{setAnimation:sV}=tQ;class sU extends ip{getConnectorPath(t){let e=t.dataLabelPosition,i=t.options||{},s=i.connectorShape,o=this.connectorShapes[s]||s;return e&&o.call(this,{...e.computed,alignment:e.alignment},e.connectorPosition,i)||[]}getTranslate(){return this.sliced&&this.slicedTranslation||{translateX:0,translateY:0}}haloPath(t){let e=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(e.x,e.y,e.r+t,e.r+t,{innerR:e.r-1,start:e.start,end:e.end,borderRadius:e.borderRadius})}constructor(t,e,i){super(t,e,i),this.half=0,this.name??(this.name=t.chart.options.lang.pieSliceName);const s=t=>{this.slice(\"select\"===t.type)};R(this,\"select\",s),R(this,\"unselect\",s)}isValid(){return tl(this.y)&&this.y>=0}setVisible(t,e=!0){t!==this.visible&&this.update({visible:t??!this.visible},e,void 0,!1)}slice(t,e,i){let s=this.series;sV(i,s.chart),e=tb(e,!0),this.sliced=this.options.sliced=t=V(t)?t:!this.sliced,s.options.data[s.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate())}}q(sU.prototype,{connectorShapes:{fixedOffset:function(t,e,i){let s=e.breakAt,o=e.touchingSliceAt,r=i.softConnector?[\"C\",t.x+(\"left\"===t.alignment?-5:5),t.y,2*s.x-o.x,2*s.y-o.y,s.x,s.y]:[\"L\",s.x,s.y];return[[\"M\",t.x,t.y],r,[\"L\",o.x,o.y]]},straight:function(t,e){let i=e.touchingSliceAt;return[[\"M\",t.x,t.y],[\"L\",i.x,i.y]]},crookedLine:function(t,e,i){let{angle:s=this.angle||0,breakAt:o,touchingSliceAt:r}=e,{series:a}=this,[n,h,l]=a.center,d=l/2,{plotLeft:c,plotWidth:p}=a.chart,g=\"left\"===t.alignment,{x:u,y:f}=t,m=o.x;if(i.crookDistance){let t=tw(i.crookDistance,1);m=g?n+d+(p+c-n-d)*(1-t):c+(n-d)*t}else m=n+(h-f)*Math.tan(s-Math.PI/2);let x=[[\"M\",u,f]];return(g?m<=u&&m>=o.x:m>=u&&m<=o.x)&&x.push([\"L\",m,f]),x.push([\"L\",o.x,o.y],[\"L\",r.x,r.y]),x}}});let{getStartAndEndRadians:sZ}=s$,{noop:s_}=B;class sK extends iX{animate(t){let e=this,i=e.points,s=e.startAngleRad;t||i.forEach(function(t){let i=t.graphic,o=t.shapeArgs;i&&o&&(i.attr({r:tb(t.startR,e.center&&e.center[3]/2),start:s,end:s}),i.animate({r:o.r,start:o.start,end:o.end},e.options.animation))})}drawEmpty(){let t,e,i=this.startAngleRad,s=this.endAngleRad,o=this.options;0===this.total&&this.center?(t=this.center[0],e=this.center[1],this.graph||(this.graph=this.chart.renderer.arc(t,e,this.center[1]/2,0,i,s).addClass(\"highcharts-empty-series\").add(this.group)),this.graph.attr({d:ek.arc(t,e,this.center[2]/2,0,{start:i,end:s,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({\"stroke-width\":o.borderWidth,fill:o.fillColor||\"none\",stroke:o.color||\"#cccccc\"})):this.graph&&(this.graph=this.graph.destroy())}drawPoints(){let t=this.chart.renderer;this.points.forEach(function(e){e.graphic&&e.hasNewShapeType()&&(e.graphic=e.graphic.destroy()),e.graphic||(e.graphic=t[e.shapeType](e.shapeArgs).add(e.series.group),e.delayedRendering=!0)})}generatePoints(){super.generatePoints(),this.updateTotals()}getX(t,e,i,s){let o=this.center,r=this.radii?this.radii[i.index]||0:o[2]/2,a=s.dataLabelPosition,n=a?.distance||0,h=Math.asin(G((t-o[1])/(r+n),-1,1));return o[0]+Math.cos(h)*(r+n)*(e?-1:1)+(n>0?(e?-1:1)*(s.padding||0):0)}hasData(){return this.points.some(t=>t.visible)}redrawPoints(){let t,e,i,s,o=this,r=o.chart;this.drawEmpty(),o.group&&!r.styledMode&&o.group.shadow(o.options.shadow),o.points.forEach(function(a){let n={};e=a.graphic,!a.isNull&&e?(s=a.shapeArgs,t=a.getTranslate(),r.styledMode||(i=o.pointAttribs(a,a.selected&&\"select\")),a.delayedRendering?(e.setRadialReference(o.center).attr(s).attr(t),r.styledMode||e.attr(i).attr({\"stroke-linejoin\":\"round\"}),a.delayedRendering=!1):(e.setRadialReference(o.center),r.styledMode||tu(!0,n,i),tu(!0,n,s,t),e.animate(n)),e.attr({visibility:a.visible?\"inherit\":\"hidden\"}),e.addClass(a.getClassName(),!0)):e&&(a.graphic=e.destroy())})}sortByAngle(t,e){t.sort(function(t,i){return void 0!==t.angle&&(i.angle-t.angle)*e})}translate(t){Q(this,\"translate\"),this.generatePoints();let e=this.options,i=e.slicedOffset,s=sZ(e.startAngle,e.endAngle),o=this.startAngleRad=s.start,r=(this.endAngleRad=s.end)-o,a=this.points,n=e.ignoreHiddenPoint,h=a.length,l,d,c,p,g,u,f,m=0;for(t||(this.center=t=this.getCenter()),u=0;u1.5*Math.PI?c-=2*Math.PI:c<-Math.PI/2&&(c+=2*Math.PI),f.slicedTranslation={translateX:Math.round(Math.cos(c)*i),translateY:Math.round(Math.sin(c)*i)},p=Math.cos(c)*t[2]/2,g=Math.sin(c)*t[2]/2,f.tooltipPos=[t[0]+.7*p,t[1]+.7*g],f.half=+(c<-Math.PI/2||c>Math.PI/2),f.angle=c}Q(this,\"afterTranslate\")}updateTotals(){let t=this.points,e=t.length,i=this.options.ignoreHiddenPoint,s,o,r=0;for(s=0;s0&&(o.visible||!i)?o.y/r*100:0,o.total=r}}sK.defaultOptions=tu(iX.defaultOptions,{borderRadius:3,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{connectorPadding:5,connectorShape:\"crookedLine\",crookDistance:void 0,distance:30,enabled:!0,formatter:function(){return this.isNull?void 0:this.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,inactiveOtherPoints:!0,legendType:\"point\",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:\"#ffffff\",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}}),q(sK.prototype,{axisTypes:[],directTouch:!0,drawGraph:void 0,drawTracker:sI.prototype.drawTracker,getCenter:s$.getCenter,getSymbol:s_,invertible:!1,isCartesian:!1,noSharedTooltip:!0,pointAttribs:sI.prototype.pointAttribs,pointClass:sU,requireSorting:!1,searchPoint:s_,trackerGroups:[\"group\",\"dataLabelsGroup\"]}),iO.registerSeriesType(\"pie\",sK);let{composed:sq,noop:sJ}=B,{distribute:sQ}=er,{series:s0}=iO;!function(t){let e={radialDistributionY:function(t,e){return(e.dataLabelPosition?.top||0)+t.distributeBox.pos},radialDistributionX:function(t,e,i,s,o){let r=o.dataLabelPosition;return t.getX(i<(r?.top||0)+2||i>(r?.bottom||0)-2?s:i,e.half,e,o)},justify:function(t,e,i,s){return s[0]+(t.half?-1:1)*(i+(e.dataLabelPosition?.distance||0))},alignToPlotEdges:function(t,e,i,s){let o=t.getBBox().width;return e?o+s:i-o-s},alignToConnectors:function(t,e,i,s){let o=0,r;return t.forEach(function(t){(r=t.dataLabel.getBBox().width)>o&&(o=r)}),e?o+s:i-o-s}};function i(t,e){let i=Math.PI/2,{start:s=0,end:o=0}=t.shapeArgs||{},r=t.angle||0;e>0&&si&&r>i/2&&r<1.5*i&&(r=r<=i?Math.max(i/2,(s+i)/2):Math.min(1.5*i,(i+o)/2));let{center:a,options:n}=this,h=a[2]/2,l=Math.cos(r),d=Math.sin(r),c=a[0]+l*h,p=a[1]+d*h,g=Math.min((n.slicedOffset||0)+(n.borderWidth||0),e/5);return{natural:{x:c+l*e,y:p+d*e},computed:{},alignment:e<0?\"center\":t.half?\"right\":\"left\",connectorPosition:{angle:r,breakAt:{x:c+l*g,y:p+d*g},touchingSliceAt:{x:c,y:p}},distance:e}}function s(){let t=this,e=t.points,i=t.chart,s=i.plotWidth,o=i.plotHeight,r=i.plotLeft,a=Math.round(i.chartWidth/3),n=t.center,h=n[2]/2,l=n[1],d=[[],[]],c=[0,0,0,0],p=t.dataLabelPositioners,g,u,f,m=0;t.visible&&t.hasDataLabels?.()&&(e.forEach(t=>{(t.dataLabels||[]).forEach(t=>{t.shortened&&(t.attr({width:\"auto\"}).css({width:\"auto\",textOverflow:\"clip\"}),t.shortened=!1)})}),s0.prototype.drawDataLabels.apply(t),e.forEach(t=>{(t.dataLabels||[]).forEach((e,i)=>{let s=n[2]/2,o=e.options,r=tw(o?.distance||0,s);0===i&&d[t.half].push(t),!V(o?.style?.width)&&e.getBBox().width>a&&(e.css({width:Math.round(.7*a)+\"px\"}),e.shortened=!0),e.dataLabelPosition=this.getDataLabelPosition(t,r),m=Math.max(m,r)})}),d.forEach((e,a)=>{let d=e.length,g=[],x,y,b=0,v;d&&(t.sortByAngle(e,a-.5),m>0&&(x=Math.max(0,l-h-m),y=Math.min(l+h+m,i.plotHeight),e.forEach(t=>{(t.dataLabels||[]).forEach(e=>{let s=e.dataLabelPosition;s&&s.distance>0&&(s.top=Math.max(0,l-h-s.distance),s.bottom=Math.min(l+h+s.distance,i.plotHeight),b=e.getBBox().height||21,e.lineHeight=i.renderer.fontMetrics(e.text||e).h+2*e.padding,t.distributeBox={target:(e.dataLabelPosition?.natural.y||0)-s.top+e.lineHeight/2,size:b,rank:t.y},g.push(t.distributeBox))})}),sQ(g,v=y+b-x,v/5)),e.forEach(i=>{(i.dataLabels||[]).forEach(l=>{let d=l.options||{},m=i.distributeBox,x=l.dataLabelPosition,y=x?.natural.y||0,b=d.connectorPadding||0,v=l.lineHeight||21,k=(v-l.getBBox().height)/2,w=0,M=y,S=\"inherit\";if(x){if(g&&V(m)&&x.distance>0&&(void 0===m.pos?S=\"hidden\":(f=m.size,M=p.radialDistributionY(i,l))),d.justify)w=p.justify(i,l,h,n);else switch(d.alignTo){case\"connectors\":w=p.alignToConnectors(e,a,s,r);break;case\"plotEdges\":w=p.alignToPlotEdges(l,a,s,r);break;default:w=p.radialDistributionX(t,i,M-k,y,l)}if(x.attribs={visibility:S,align:x.alignment},x.posAttribs={x:w+(d.x||0)+(({left:b,right:-b})[x.alignment]||0),y:M+(d.y||0)-v/2},x.computed.x=w,x.computed.y=M-k,tb(d.crop,!0)){let t;w-(u=l.getBBox().width)s-b&&0===a&&(t=Math.round(w+u-s+b),c[1]=Math.max(t,c[1])),M-f/2<0?c[0]=Math.max(Math.round(-M+f/2),c[0]):M+f/2>o&&(c[2]=Math.max(Math.round(M+f/2-o),c[2])),x.sideOverflow=t}}})}))}),(0===H(c)||this.verifyDataLabelOverflow(c))&&(this.placeDataLabels(),this.points.forEach(e=>{e.dataLabels?.forEach((s,o)=>{let{connectorColor:r,connectorWidth:a=1}=s.options||{},n=s.dataLabelPosition;if(tl(a)){let h;g=s.connector,n&&n.distance>0?(h=!g,g||(s.connector=g=i.renderer.path().addClass(\"highcharts-data-label-connector highcharts-color-\"+e.colorIndex+(e.className?\" \"+e.className:\"\")).add(t.dataLabelsGroups?.[o])),i.styledMode||g.attr({\"stroke-width\":a,stroke:r||e.color||\"#666666\"}),g[h?\"attr\":\"animate\"]({d:e.getConnectorPath(s)}),g.attr({visibility:n.attribs?.visibility})):g&&(s.connector=g.destroy())}})})))}function o(){this.points.forEach(t=>{(t.dataLabels||[]).forEach(t=>{let e=t.dataLabelPosition;e?(e.sideOverflow&&(t.css({width:Math.max(t.getBBox().width-e.sideOverflow,0)+\"px\",textOverflow:t.options?.style?.textOverflow||\"ellipsis\"}),t.shortened=!0),t.attr(e.attribs),t[t.moved?\"animate\":\"attr\"](e.posAttribs),t.moved=!0):t&&t.attr({y:-9999})}),delete t.distributeBox},this)}function r(t){let e=this.center,i=this.options,s=i.center,o=i.minSize||80,r=o,a=null!==i.size;return!a&&(null!==s[0]?r=Math.max(e[2]-Math.max(t[1],t[3]),o):(r=Math.max(e[2]-t[1]-t[3],o),e[0]+=(t[3]-t[1])/2),null!==s[1]?r=G(r,o,e[2]-Math.max(t[0],t[2])):(r=G(r,o,e[2]-t[0]-t[2]),e[1]+=(t[0]-t[2])/2),r(t.x+=e.x,t.y+=e.y,t),{x:0,y:0});return{x:e.x/t.length,y:e.y/t.length}},g.getDistanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},g.getAngleBetweenPoints=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)},g.pointInPolygon=function({x:t,y:e},i){let s=i.length,o,r,a=!1;for(o=0,r=s-1;oe!=l>e&&t<(h-s)*(e-n)/(l-n)+s&&(a=!a)}return a};let{pointInPolygon:s2}=O;function s3(t,e){let i,s=!1;return t&&(i=t.newOpacity,t.oldOpacity!==i&&(t.hasClass(\"highcharts-data-label\")?(t[i?\"removeClass\":\"addClass\"](\"highcharts-data-label-hidden\"),s=!0,t[t.isOld?\"animate\":\"attr\"]({opacity:i},void 0,function(){e.styledMode||t.css({pointerEvents:i?\"auto\":\"none\"})}),Q(e,\"afterHideOverlappingLabel\")):t.attr({opacity:i})),t.isOld=!0),s}let{defaultOptions:s5}=tY,{noop:s6}=B,s9={radius:0,scope:\"stack\",where:void 0},s4=s6,s8=s6;function s7(t,e,i,s,o={}){let r=s4(t,e,i,s,o),{brStart:a=!0,brEnd:n=!0,innerR:h=0,r:l=i,start:d=0,end:c=0}=o;if(o.open||!o.borderRadius)return r;let p=c-d,g=Math.sin(p/2),u=Math.max(Math.min(tw(o.borderRadius||0,l-h),(l-h)/2,l*g/(1+g)),0),f=Math.min(u,p/Math.PI*2*h),m=r.length-1;for(;m--;)(a||0!==m&&3!==m)&&(n||1!==m&&2!==m)&&!function(t,e,i){let s,o,r,a=t[e],n=t[e+1];if(\"Z\"===n[0]&&(n=t[0]),(\"M\"===a[0]||\"L\"===a[0])&&\"A\"===n[0]?(s=a,o=n,r=!0):\"A\"===a[0]&&(\"M\"===n[0]||\"L\"===n[0])&&(s=n,o=a),s&&o&&o.params){let a=o[1],n=o[5],h=o.params,{start:l,end:d,cx:c,cy:p}=h,g=n?a-i:a+i,u=g?Math.asin(i/g):0,f=n?u:-u,m=Math.cos(u)*g;r?(h.start=l+f,s[1]=c+m*Math.cos(l),s[2]=p+m*Math.sin(l),t.splice(e+1,0,[\"A\",i,i,0,0,1,c+a*Math.cos(h.start),p+a*Math.sin(h.start)])):(h.end=d-f,o[6]=c+a*Math.cos(h.end),o[7]=p+a*Math.sin(h.end),t.splice(e+1,0,[\"A\",i,i,0,0,1,c+m*Math.cos(d),p+m*Math.sin(d)])),o[4]=Math.abs(h.end-h.start)1?f:u);return r}function ot(){if(this.options.borderRadius&&!(this.chart.is3d&&this.chart.is3d())){let{options:t,yAxis:e}=this,i=\"percent\"===t.stacking,s=s5.plotOptions?.[this.type]?.borderRadius,o=oe(t.borderRadius,tg(s)?s:{}),r=e.options.reversed;for(let s of this.points){let{shapeArgs:a}=s;if(\"roundedRect\"===s.shapeType&&a){let{width:n=0,height:h=0,y:l=0}=a,d=l,c=h;if(\"stack\"===o.scope&&s.stackTotal){let o=e.translate(i?100:s.stackTotal,!1,!0,!1,!0),r=e.translate(t.threshold||0,!1,!0,!1,!0),a=this.crispCol(0,Math.min(o,r),0,Math.abs(o-r));d=a.y,c=a.height}let p=(s.negative?-1:1)*(r?-1:1)==-1,g=o.where;!g&&this.is(\"waterfall\")&&Math.abs((s.yBottom||0)-(this.translatedThreshold||0))>this.borderWidth&&(g=\"all\"),g||(g=\"end\");let u=Math.min(tw(o.radius,n),n/2,\"all\"===g?c/2:1/0)||0;\"end\"===g&&(p&&(d-=u),c+=u),q(a,{brBoxHeight:c,brBoxY:d,r:u})}}}}function oe(t,e){return tg(t)||(t={radius:t||0}),tu(s9,e,t)}function oi(){let t=oe(this.options.borderRadius);for(let e of this.points){let i=e.shapeArgs;i&&(i.borderRadius=tw(t.radius,(i.r||0)-(i.innerR||0)))}}function os(t,e,i,s,o={}){let r=s8(t,e,i,s,o),{r:a=0,brBoxHeight:n=s,brBoxY:h=e}=o,l=e-h,d=h+n-(e+s),c=l-a>-.1?0:a,p=d-a>-.1?0:a,g=Math.max(c&&l,0),u=Math.max(p&&d,0),f=[t+c,e],m=[t+i-c,e],x=[t+i,e+c],y=[t+i,e+s-p],b=[t+i-p,e+s],v=[t+p,e+s],k=[t,e+s-p],w=[t,e+c],M=(t,e)=>Math.sqrt(Math.pow(t,2)-Math.pow(e,2));if(g){let t=M(c,c-g);f[0]-=t,m[0]+=t,x[1]=w[1]=e+c-g}if(s=tb(i.minWidth,0)&&this.chartHeight>=tb(i.minHeight,0)}).call(this,this)&&e.push(t._id)}function or(t,e){let i=this.options.responsive,s=this.currentResponsive,o=[],r;!e&&i&&i.rules&&i.rules.forEach(t=>{void 0===t._id&&(t._id=tB()),this.matchResponsiveRule(t,o)},this);let a=tu(...o.map(t=>tr(i?.rules||[],e=>e._id===t)).map(t=>t?.chartOptions));a.isResponsiveOptions=!0,o=o.toString()||void 0;let n=s?.ruleIds;o!==n&&(s&&(this.currentResponsive=void 0,this.updatingResponsive=!0,this.update(s.undoOptions,t,!0),this.updatingResponsive=!1),o?((r=_(a,this.options,!0,this.collectionsWithUpdate)).isResponsiveOptions=!0,this.currentResponsive={ruleIds:o,mergedOptions:a,undoOptions:r},this.updatingResponsive||this.update(a,t,!0)):this.currentResponsive=void 0)}(E||(E={})).compose=function(t){let e=t.prototype;return e.matchResponsiveRule||q(e,{matchResponsiveRule:oo,setResponsive:or}),t};let oa=E;B.AST=t6,B.Axis=e2,B.Chart=i8,B.Color=tU,B.DataLabel=sN,B.DataTableCore=iM,B.Fx=tK,B.HTMLElement=eY,B.Legend=i_,B.LegendSymbol=iC,B.PlotLineOrBand=e9,B.Point=ip,B.Pointer=iv,B.RendererRegistry=eo,B.Series=iX,B.SeriesRegistry=iO,B.StackItem=sa,B.SVGElement=em,B.SVGRenderer=eW,B.Templating=es,B.Tick=eZ,B.Time=tH,B.Tooltip=ia,B.addEvent=R,B.animObject=tQ.animObject,B.animate=tQ.animate,B.arrayMax=H,B.arrayMin=W,B.attr=X,B.chart=i8.chart,B.clamp=G,B.color=tU.parse,B.correctFloat=F,B.createElement=Y,B.css=$,B.dateFormat=es.dateFormat,B.defaultOptions=tY.defaultOptions,B.defined=V,B.destroyObjectProperties=U,B.diffObjects=_,B.discardElement=Z,B.distribute=er.distribute,B.erase=K,B.error=tE,B.extend=q,B.extendClass=J,B.find=tr,B.fireEvent=Q,B.format=es.format,B.getDeferredAnimation=tQ.getDeferredAnimation,B.getMagnitude=ti,B.getOptions=tY.getOptions,B.getStyle=to,B.insertItem=tI,B.isArray=tc,B.isClass=th,B.isDOMElement=tn,B.isFunction=tp,B.isNumber=tl,B.isObject=tg,B.isString=td,B.merge=tu,B.normalizeTickInterval=tf,B.numberFormat=es.numberFormat,B.objectEach=tm,B.offset=tx,B.pad=ty,B.pick=tb,B.pInt=tv,B.relativeLength=tw,B.removeEvent=tS,B.seriesType=iO.seriesType,B.setAnimation=tQ.setAnimation,B.setOptions=tY.setOptions,B.splat=tT,B.stableSort=tC,B.stop=tQ.stop,B.syncTimeout=tA,B.time=tY.defaultTime,B.timers=tK.timers,B.timeUnits=tD,B.uniqueKey=tB,B.useSerialIds=function(e){return t=tb(e,t)},B.wrap=function(t,e,i){let s=t[e];t[e]=function(){let t=arguments,e=this;return i.apply(this,[function(){return s.apply(e,arguments.length?arguments:t)}].concat([].slice.call(arguments)))}},({compose:function(t,e,i){let s=t.types.pie;if(!e.symbolCustomAttribs.includes(\"borderRadius\")){let o=i.prototype.symbols;R(t,\"afterColumnTranslate\",ot,{order:9}),R(s,\"afterTranslate\",oi),e.symbolCustomAttribs.push(\"borderRadius\",\"brBoxHeight\",\"brBoxY\",\"brEnd\",\"brStart\"),s4=o.arc,s8=o.roundedRect,o.arc=s7,o.roundedRect=os}},optionsToObject:oe}).compose(B.Series,B.SVGElement,B.SVGRenderer),sH.compose(B.Series.types.column),sN.compose(B.Series),e3.compose(B.Axis),eY.compose(B.SVGRenderer),i_.compose(B.Chart),e5.compose(B.Axis),(r=(u=B.Chart).prototype).hideOverlappingLabels||(r.hideOverlappingLabels=function(t){let e=t.length,i=(t,e)=>!(e.x>=t.x+t.width||e.x+e.width<=t.x||e.y>=t.y+t.height||e.y+e.height<=t.y),s=(t,e)=>{for(let i of t)if(s2({x:i[0],y:i[1]},e))return!0;return!1},o,r,a,n,h,l=!1;for(let i=0;i(e?.labelrank||0)-(t?.labelrank||0));for(let o=0;o{tm(t,t=>{t.label&&e.push(t.label)})});for(let i of t.series||[])if(i.visible&&i.hasDataLabels?.()){let s=i=>{for(let s of i)s.visible&&(s.dataLabels||[]).forEach(i=>{let o=i.options||{};i.labelrank=tb(o.labelrank,s.labelrank,s.shapeArgs?.height),o.allowOverlap??Number(o.distance)>0?(i.oldOpacity=i.opacity,i.newOpacity=1,s3(i,t)):e.push(i)})};s(i.nodes||[]),s(i.points)}this.hideOverlappingLabels(e)})),s1.compose(B.Series.types.pie),e9.compose(B.Chart,B.Axis),iv.compose(B.Chart),oa.compose(B.Chart),ss.compose(B.Axis,B.Chart,B.Series),sy.compose(B.Axis,B.Chart,B.Series),ia.compose(B.Pointer);let on=B;return D.default})());", "!/**\n * Highcharts JS v12.6.0 (2026-04-13)\n * @module highcharts/modules/accessibility\n * @requires highcharts\n *\n * Accessibility module\n *\n * (c) 2010-2026 Highsoft AS\n * Author: \u00D8ystein Moseng\n *\n * A commercial license may be required depending on use.\n * See www.highcharts.com/license\n */function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(e._Highcharts,e._Highcharts.Templating,e._Highcharts.AST,e._Highcharts.Legend,e._Highcharts.Axis,e._Highcharts.Color,e._Highcharts.SeriesRegistry,e._Highcharts.RendererRegistry,e._Highcharts.Point,e._Highcharts.Series):\"function\"==typeof define&&define.amd?define(\"highcharts/modules/accessibility\",[\"highcharts/highcharts\"],function(e){return t(e,e.Templating,e.AST,e.Legend,e.Axis,e.Color,e.SeriesRegistry,e.RendererRegistry,e.Point,e.Series)}):\"object\"==typeof exports?exports[\"highcharts/modules/accessibility\"]=t(e._Highcharts,e._Highcharts.Templating,e._Highcharts.AST,e._Highcharts.Legend,e._Highcharts.Axis,e._Highcharts.Color,e._Highcharts.SeriesRegistry,e._Highcharts.RendererRegistry,e._Highcharts.Point,e._Highcharts.Series):e.Highcharts=t(e.Highcharts,e.Highcharts.Templating,e.Highcharts.AST,e.Highcharts.Legend,e.Highcharts.Axis,e.Highcharts.Color,e.Highcharts.SeriesRegistry,e.Highcharts.RendererRegistry,e.Highcharts.Point,e.Highcharts.Series)}(\"u\"(()=>{\"use strict\";let c;var d,u,p,g,m={260:e=>{e.exports=l},512:e=>{e.exports=o},532:e=>{e.exports=r},608:e=>{e.exports=a},620:e=>{e.exports=n},632:e=>{e.exports=s},660:e=>{e.exports=i},820:e=>{e.exports=h},944:t=>{t.exports=e},984:e=>{e.exports=t}},b={};function f(e){var t=b[e];if(void 0!==t)return t.exports;var i=b[e]={exports:{}};return m[e](i,i.exports,f),i.exports}f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},f.d=(e,t)=>{for(var i in t)f.o(t,i)&&!f.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var x={};f.d(x,{default:()=>sw});var y=f(944),v=f.n(y);let{doc:w,win:E}=v();function A(e,t,i,s={}){let r=\"function\"==typeof e&&e.prototype||e;Object.hasOwnProperty.call(r,\"hcEvents\")||(r.hcEvents={});let n=r.hcEvents;v().Point&&e instanceof v().Point&&e.series&&e.series.chart&&(e.series.chart.runTrackerClick=!0);let o=e.addEventListener;o&&o.call(e,t,i,!!v().supportsPassiveEvents&&{passive:void 0===s.passive?-1!==t.indexOf(\"touch\"):s.passive,capture:!1}),n[t]||(n[t]=[]);let a={fn:i,order:\"number\"==typeof s.order?s.order:1/0};return n[t].push(a),n[t].sort((e,t)=>e.order-t.order),function(){X(e,t,i)}}function T(e,t,i){let s,r=z(t)&&!S(i),n=(t,i)=>{S(t)?e.setAttribute(i,t):r?(s=e.getAttribute(i))||\"class\"!==i||(s=e.getAttribute(i+\"Name\")):e.removeAttribute(i)};return z(t)?n(i,t):U(t,n),s}function M(e,t,i){return e>t?e1e14?e:parseFloat(e.toPrecision(t||14))}function k(e,t=0,i){let s=t%2/2,r=i?-1:1;return(Math.round(e*r-s)+s)*r}function P(e,t){B(e.style,t)}function S(e){return null!=e}function D(e,t,i){U(e,function(s,r){s!==t&&s?.destroy&&s.destroy(),(s?.destroy||!i)&&delete e[r]})}function N(e,t){let i=e.length;for(;i--;)if(e[i]===t){e.splice(i,1);break}}function B(e,t){let i;for(i in e||(e={}),t)e[i]=t[i];return e}function I(e,t,i,s){if(i=i||{},w?.createEvent&&(e.dispatchEvent||e.fireEvent&&e!==v())){let s=w.createEvent(\"Events\");s.initEvent(t,!0,!0),i=B(s,i),e.dispatchEvent?e.dispatchEvent(i):e.fireEvent(t,i)}else if(e.hcEvents){i.target||B(i,{preventDefault:function(){i.defaultPrevented=!0},target:e,type:t});let s=[],r=e,n=!1;for(;r.hcEvents;)Object.hasOwnProperty.call(r,\"hcEvents\")&&r.hcEvents[t]&&(s.length&&(n=!0),s.unshift.apply(s,r.hcEvents[t])),r=Object.getPrototypeOf(r);n&&s.sort((e,t)=>e.order-t.order),s.forEach(t=>{!1===t.fn.call(e,i,e)&&i.preventDefault()})}s&&!i.defaultPrevented&&s.call(e,i)}function F(e,t){let i=e.split(\".\");for(;i.length&&S(t);){let e=i.shift();if(void 0===e||\"__proto__\"===e)return;if(\"this\"===e){let e;return K(t)&&(e=t[\"@this\"]),e??t}let s=t[e.replace(/[\\\\'\"]/g,\"\")];if(!S(s)||\"function\"==typeof s||\"number\"==typeof s.nodeType||s===E)return;t=s}return t}let O=Array.prototype.find?function(e,t){return e.find(t)}:function(e,t){let i,s=e.length;for(i=0;i-1/0}function z(e){return\"string\"==typeof e}function q(e){let t=Object.prototype.toString.call(e);return\"[object Array]\"===t||\"[object Array Iterator]\"===t}function K(e,t){return!!e&&\"object\"==typeof e&&(!t||!q(e))}function G(e,...t){let i,s=[e,...t],r={},n=function(e,t){return\"object\"!=typeof e&&(e={}),U(t,function(i,s){if(\"__proto__\"!==s&&\"constructor\"!==s){let r;!K(i,!0)||(r=i?.constructor,K(i,!0)&&!L(i)&&r?.name&&\"Object\"!==r.name)||L(i)?e[s]=t[s]:e[s]=n(e[s]||{},i)}}),e};!0===e&&(r=s[1],s=Array.prototype.slice.call(s,2));let o=s.length;for(i=0;ie.indexOf(t)&&!!e.push(t)}function X(e,t,i){function s(t,i){let s=e.removeEventListener;s&&s.call(e,t,i,!1)}function r(i){let r,n;e.nodeName&&(t?(r={})[t]=!0:r=i,U(r,function(e,t){if(i[t])for(n=i[t].length;n--;)s(t,i[t][n].fn)}))}let n=\"function\"==typeof e&&e.prototype||e;if(Object.hasOwnProperty.call(n,\"hcEvents\")){let e=n.hcEvents;if(t){let n=e[t]||[];i?(e[t]=n.filter(function(e){return i!==e.fn}),s(t,i)):(r(e),e[t]=[])}else r(e),delete n.hcEvents}}function j(e,t,i){return t>0?setTimeout(e,t,i):(e.call(0,i),-1)}let{doc:Y,win:_}=v(),Z=_.EventTarget&&new _.EventTarget||\"none\";function $(e){if(\"function\"==typeof _.MouseEvent)return new _.MouseEvent(e.type,e);if(Y?.createEvent){let t=Y.createEvent(\"MouseEvent\");if(t.initMouseEvent)return t.initMouseEvent(e.type,e.bubbles,e.cancelable,e.view||_,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),t}return Q(e.type)}function Q(e,t,i){let s=t||{x:0,y:0};if(\"function\"==typeof _.MouseEvent)return new _.MouseEvent(e,{bubbles:!0,cancelable:!0,composed:!0,button:0,buttons:1,relatedTarget:i||Z,view:_,detail:+(\"click\"===e),screenX:s.x,screenY:s.y,clientX:s.x,clientY:s.y});if(Y?.createEvent){let t=Y.createEvent(\"MouseEvent\");if(t.initMouseEvent)return t.initMouseEvent(e,!0,!0,_,+(\"click\"===e),s.x,s.y,s.x,s.y,!1,!1,!1,!1,0,null),t}return{type:e}}let J={addClass:function(e,t){e.classList?e.classList.add(t):0>e.className.indexOf(t)&&(e.className+=\" \"+t)},cloneMouseEvent:$,cloneTouchEvent:function(e){let t=e=>{let t=[];for(let i=0;i/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\").replace(/\\//g,\"/\")},getElement:function(e){return Y.getElementById(e)},getFakeMouseEvent:Q,getHeadingTagNameForElement:function(e){let t=e=>\"h\"+Math.min(6,parseInt(e.slice(1),10)+1),i=e=>/^H[1-6]$/i.test(e),s=e=>{let r=(e=>{let t=e;for(;t=t.previousSibling;){let e=t.tagName||\"\";if(i(e))return e}return\"\"})(e);if(r)return t(r);let n=e.parentElement;if(!n)return\"h6\";let o=n.tagName;return i(o)?t(o):s(n)};return s(e)},removeChildNodes:function(e){for(;e.lastChild;)e.removeChild(e.lastChild)},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(t,\"g\"),\"\")},removeElement:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},reverseChildNodes:function(e){let t=e.childNodes.length;for(;t--;)e.appendChild(e.childNodes[t])},simulatedEventTarget:Z,stripHTMLTagsFromString:function(e,t=!1){return\"string\"==typeof e?t?e.replace(/<\\/?[^>]+(>|$)/g,\"\"):e.replace(/<\\/?(?!\\s)[^>]+(>|$)/g,\"\"):e},visuallyHideElement:function(e){P(e,{position:\"absolute\",width:\"1px\",height:\"1px\",overflow:\"hidden\",whiteSpace:\"nowrap\",clip:\"rect(1px, 1px, 1px, 1px)\",marginTop:\"-3px\",\"-ms-filter\":\"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)\",filter:\"alpha(opacity=1)\",opacity:.01})}};var ee=f(984),et=f.n(ee);let{format:ei}=et();var es=d||(d={});function er(e,t,i){let s=(e,t)=>{let i=e.slice(t||0),s=i.indexOf(\"{\"),r=i.indexOf(\"}\");if(s>-1&&r>s)return{statement:i.substring(s+1,r),begin:t+s+1,end:t+r}},r=[],n,o,a=0;do n=s(e,a),(o=e.substring(a,n&&n.begin-1)).length&&r.push({value:o,type:\"constant\"}),n&&r.push({value:n.statement,type:\"statement\"}),a=n?n.end+1:a+1;while(n);return r.forEach(e=>{\"statement\"===e.type&&(e.value=function(e,t){let i,s,r=e.indexOf(\"#each(\"),n=e.indexOf(\"#plural(\"),o=e.indexOf(\"[\"),a=e.indexOf(\"]\");if(r>-1){let n=e.slice(r).indexOf(\")\")+r,o=e.substring(0,r),a=e.substring(n+1),l=e.substring(r+6,n).split(\",\"),h=Number(l[1]),c;if(s=\"\",i=F(l[0],t)){c=(h=isNaN(h)?i.length:h)<0?i.length+h:Math.min(h,i.length);for(let e=0;e-1){var l;let i=e.slice(n).indexOf(\")\")+n,r=e.substring(n+8,i).split(\",\");switch(Number(F(r[0],t))){case 0:s=W(r[4],r[1]);break;case 1:s=W(r[2],r[1]);break;case 2:s=W(r[3],r[1]);break;default:s=r[1]}return s?(l=s).trim&&l.trim()||l.replace(/^\\s+|\\s+$/g,\"\"):\"\"}if(o>-1){let s,r=e.substring(0,o),n=Number(e.substring(o+1,a));return i=F(r,t),!isNaN(n)&&i&&(n<0?void 0===(s=i[i.length+n])&&(s=i[0]):void 0===(s=i[n])&&(s=i[i.length-1])),void 0!==s?s:\"\"}return\"{\"+e+\"}\"}(e.value,t))}),ei(r.reduce((e,t)=>e+t.value,\"\"),t,i)}function en(e,t){let i=e.split(\".\"),s=this.options.lang,r=0;for(;r!!e.graphic);return t&&t.graphic&&t.graphic.element}}function ec(e){let t=eh(e);return t&&t.parentNode||e.graph&&e.graph.element||e.group&&e.group.element}let ed={fireEventOnWrappedOrUnwrappedElement:function e(t,i){let s=i.type,r=t.hcEvents;ea?.createEvent&&(t.dispatchEvent||t.fireEvent)?t.dispatchEvent?t.dispatchEvent(i):t.fireEvent(s,i):r&&r[s]?I(t,s,i):t.element&&e(t.element,i)},getChartTitle:function(e){return el(e.options.title.text||e.langFormat(\"accessibility.defaultChartTitle\",{chart:e}),e.renderer.forExport)},getAxisDescription:function(e){return e&&(e.options.accessibility?.description||e.axisTitle?.textStr||e.options.id||e.categories&&e.chart.langFormat(\"accessibility.axis.defaultAxisNames.categories\",{})||e.dateTime&&e.chart.langFormat(\"accessibility.axis.defaultAxisNames.time\",{})||e.chart.langFormat(\"accessibility.axis.defaultAxisNames.values\",{}))},getAxisRangeDescription:function(e){var t,i,s;let r,n,o,a,l,h,c,d,u,p,g,m,b=e.options||{};return b.accessibility&&void 0!==b.accessibility.rangeDescription?b.accessibility.rangeDescription:e.categories?(r=(t=e).chart,t.dataMax&&t.dataMin?r.langFormat(\"accessibility.axis.rangeCategories\",{chart:r,axis:t,numCategories:t.dataMax-t.dataMin+1}):\"\"):e.dateTime&&(0===e.min||0===e.dataMin)?(n=(i=e).chart,o={},a=i.dataMin||i.min||0,l=i.dataMax||i.max||0,h=\"Seconds\",o.Seconds=(l-a)/1e3,o.Minutes=o.Seconds/60,o.Hours=o.Minutes/60,o.Days=o.Hours/24,[\"Minutes\",\"Hours\",\"Days\"].forEach(function(e){o[e]>2&&(h=e)}),c=o[h].toFixed(+(\"Seconds\"!==h&&\"Minutes\"!==h)),n.langFormat(\"accessibility.axis.timeRange\"+h,{chart:n,axis:i,range:c.replace(\".0\",\"\")})):(p=(u=(d=(s=e).chart).options)&&u.accessibility&&u.accessibility.screenReaderSection.axisRangeDateFormat||\"\",g={min:s.dataMin||s.min||0,max:s.dataMax||s.max||0},m=function(e){return s.dateTime?d.time.dateFormat(p,g[e]):g[e].toString()},d.langFormat(\"accessibility.axis.rangeFromTo\",{chart:d,axis:s,rangeFrom:m(\"min\"),rangeTo:m(\"max\")}))},getPointFromXY:function(e,t,i){let s=e.length,r;for(;s--;)if(r=O(e[s].points||[],function(e){return e.x===t&&e.y===i}))return r},getSeriesFirstPointElement:eh,getSeriesFromName:function(e,t){return t?(e.series||[]).filter(function(e){return e.name===t}):e.series},getSeriesA11yElement:ec,unhideChartElementFromAT:function e(t,i){i.setAttribute(\"aria-hidden\",!1),i!==t.renderTo&&i.parentNode&&i.parentNode!==ea.body&&(Array.prototype.forEach.call(i.parentNode.childNodes,function(e){e.hasAttribute(\"aria-hidden\")||e.setAttribute(\"aria-hidden\",!0)}),e(t,i.parentNode))},hideSeriesFromAT:function(e){let t=ec(e);t&&t.setAttribute(\"aria-hidden\",!0)},scrollAxisToPoint:function(e){let t=e.series.xAxis,i=e.series.yAxis,s=t&&t.scrollbar?t:i,r=s&&s.scrollbar;if(r&&S(r.to)&&S(r.from)){let t=r.to-r.from,i=function(e,t){if(!S(e.dataMin)||!S(e.dataMax))return 0;let i=e.toPixels(e.dataMin),s=e.toPixels(e.dataMax),r=\"xAxis\"===e.coll?\"x\":\"y\";return(e.toPixels(t[r]||0)-i)/(s-i)}(s,e);r.updatePosition(i-t/2,i+t/2),I(r,\"changed\",{from:r.from,to:r.to,trigger:\"scrollbar\",DOMEvent:null})}}},{doc:eu}=v(),{removeElement:ep}=J,eg=class{constructor(){this.elements=[]}createElement(){let e=eu.createElement.apply(eu,arguments);return this.elements.push(e),e}removeElement(e){ep(e),this.elements.splice(this.elements.indexOf(e),1)}destroyCreatedElements(){this.elements.forEach(function(e){ep(e)}),this.elements=[]}},em=class{constructor(){this.eventRemovers=[]}addEvent(){let e=A.apply(v(),arguments);return this.eventRemovers.push({element:arguments[0],remover:e}),e}removeEvent(e){let t=this.eventRemovers.map(e=>e.remover).indexOf(e);this.eventRemovers[t].remover(),this.eventRemovers.splice(t,1)}removeAddedEvents(){this.eventRemovers.map(e=>e.remover).forEach(e=>e()),this.eventRemovers=[]}},{fireEventOnWrappedOrUnwrappedElement:eb}=ed,{getFakeMouseEvent:ef}=J,ex=class{destroy(){}getKeyboardNavigation(){return[]}init(){}onChartRender(){}onChartUpdate(){}initBase(e,t){this.chart=e,this.eventProvider=new em,this.domElementProvider=new eg,this.proxyProvider=t,this.keyCodes={left:37,right:39,up:38,down:40,enter:13,space:32,esc:27,tab:9,pageUp:33,pageDown:34,end:35,home:36}}addEvent(e,t,i,s){return this.eventProvider.addEvent(e,t,i,s)}createElement(e,t){return this.domElementProvider.createElement(e,t)}fakeClickEvent(e){eb(e,ef(\"click\"))}destroyBase(){this.domElementProvider.destroyCreatedElements(),this.eventProvider.removeAddedEvents()}},ey=class{constructor(e,t){this.chart=e,this.keyCodeMap=t.keyCodeMap||[],this.validate=t.validate,this.init=t.init,this.terminate=t.terminate,this.response={success:1,prev:2,next:3,noHandler:4,fail:5}}run(e){let t=e.which||e.keyCode,i=this.response.noHandler,s=O(this.keyCodeMap,function(e){return e[0].indexOf(t)>-1});return s?i=s[1].call(this,t,e):9===t&&(i=this.response[e.shiftKey?\"prev\":\"next\"]),i}},{unhideChartElementFromAT:ev,getChartTitle:ew}=ed,{doc:eE}=v(),{stripHTMLTagsFromString:eA}=J,eT=class extends ex{onChartUpdate(){this.handleSVGTitleElement(),this.setSVGContainerLabel(),this.setGraphicContainerAttrs(),this.setRenderToAttrs(),this.makeCreditsAccessible()}handleSVGTitleElement(){let e=this.chart,t=\"highcharts-title-\"+e.index,i=eA(e.langFormat(\"accessibility.svgContainerTitle\",{chartTitle:ew(e)}));if(i.length){let s=this.svgTitleElement=this.svgTitleElement||eE.createElementNS(\"http://www.w3.org/2000/svg\",\"title\");s.textContent=i,s.id=t,e.renderTo.insertBefore(s,e.renderTo.firstChild)}}setSVGContainerLabel(){let e=this.chart,t=e.langFormat(\"accessibility.svgContainerLabel\",{chartTitle:ew(e)});e.renderer.box&&t.length&&e.renderer.box.setAttribute(\"aria-label\",t)}setGraphicContainerAttrs(){let e=this.chart,t=e.langFormat(\"accessibility.graphicContainerLabel\",{chartTitle:ew(e)});t.length&&e.container.setAttribute(\"aria-label\",t)}setRenderToAttrs(){let e=this.chart,t=\"disabled\"!==e.options.accessibility.landmarkVerbosity,i=e.langFormat(\"accessibility.chartContainerLabel\",{title:ew(e),chart:e});i&&(e.renderTo.setAttribute(\"role\",t?\"region\":\"group\"),e.renderTo.setAttribute(\"aria-label\",i))}makeCreditsAccessible(){let e=this.chart,t=e.credits;t&&(t.textStr&&t.element.setAttribute(\"aria-label\",e.langFormat(\"accessibility.credits\",{creditsStr:eA(t.textStr,e.renderer.forExport)})),ev(e,t.element))}getKeyboardNavigation(){let e=this.chart;return new ey(e,{keyCodeMap:[],validate:function(){return!0},init:function(){let t=e.accessibility;t&&t.keyboardNavigation.tabindexContainer.focus()}})}destroy(){this.chart.renderTo.setAttribute(\"aria-hidden\",!0)}};!function(e){let t=[\"x\",\"y\",\"transform\",\"width\",\"height\",\"r\",\"d\",\"stroke-width\"];function i(){let e=this.focusElement,t=this.options.accessibility.keyboardNavigation.focusBorder;e&&(e.removeFocusBorder(),t.enabled&&e.addFocusBorder(t.margin,{stroke:t.style.color,strokeWidth:t.style.lineWidth,r:t.style.borderRadius}))}function s(e,t){let i=this.options.accessibility.keyboardNavigation.focusBorder,s=t||e.element;s&&s.focus&&(s.hcEvents&&s.hcEvents.focusin||A(s,\"focusin\",function(){}),s.focus(),i.hideBrowserFocusOutline&&(s.style.outline=\"none\")),this.focusElement&&this.focusElement.removeFocusBorder(),this.focusElement=e,A(this,\"endResize\",function(){this.renderFocusBorder()}),this.renderFocusBorder()}function r(e,i){this.focusBorder&&this.removeFocusBorder();let s=this.getBBox(),r=W(e,3),n=this.parentGroup,o=this.scaleX||n&&n.scaleX,a=this.scaleY||n&&n.scaleY,l=(o?!a:a)?Math.abs(o||a||1):(Math.abs(o||1)+Math.abs(a||1))/2,h=this.renderer.fontMetrics(this).h;s.x+=this.translateX?this.translateX:0,s.y+=this.translateY?this.translateY:0;let c=s.x-r,d=s.y-r,u=s.width+2*r,p=s.height+2*r,g=!!this.text;if(\"text\"===this.element.nodeName||g){let e,t,i=!!this.rotation,n=g?{x:+!!i,y:0}:(e=0,t=0,\"middle\"===this.attr(\"text-anchor\")?e=t=.5:this.rotation?e=.25:t=.75,{x:e,y:t}),o=+this.attr(\"x\"),a=+this.attr(\"y\");if(isNaN(o)||(c=o-s.width*n.x-r),isNaN(a)||(d=a-(\"start\"===this.attr(\"text-anchor\")?h:s.height)*n.y-r),g&&i){let e=u;u=p,p=e,isNaN(o)||(c=o-s.height*n.x-r),isNaN(a)||(d=a-s.width*n.y-r)}}this.focusBorder=this.renderer.rect(c,d,u,p,parseInt((i&&i.r||0).toString(),10)/l).addClass(\"highcharts-focus-border\").attr({zIndex:99}).add(n),this.renderer.styledMode||this.focusBorder.attr({stroke:i&&i.stroke,\"stroke-width\":(i&&i.strokeWidth||0)/l}),function(e,...i){e.focusBorderUpdateHooks||(e.focusBorderUpdateHooks={},t.forEach(t=>{let s=t+\"Setter\",r=e[s]||e._defaultSetter;e.focusBorderUpdateHooks[s]=r,e[s]=function(){let t=r.apply(e,arguments);return e.addFocusBorder.apply(e,i),t}}))}(this,e,i),function(e){if(e.focusBorderDestroyHook)return;let t=e.destroy;e.destroy=function(){return e.focusBorder&&e.focusBorder.destroy&&e.focusBorder.destroy(),t.apply(e,arguments)},e.focusBorderDestroyHook=t}(this)}function n(){var e;e=this,e.focusBorderUpdateHooks&&(Object.keys(e.focusBorderUpdateHooks).forEach(t=>{let i=e.focusBorderUpdateHooks[t];i===e._defaultSetter?delete e[t]:e[t]=i}),delete e.focusBorderUpdateHooks),this.focusBorderDestroyHook&&(this.destroy=this.focusBorderDestroyHook,delete this.focusBorderDestroyHook),this.focusBorder&&(this.focusBorder.destroy(),delete this.focusBorder)}e.compose=function(e,t){let o=e.prototype,a=t.prototype;o.renderFocusBorder||(o.renderFocusBorder=i,o.setFocusToElement=s),a.addFocusBorder||(a.addFocusBorder=r,a.removeFocusBorder=n)}}(u||(u={}));let eM=u;var eC=f(660),ek=f.n(eC);let{doc:eP}=v(),{addClass:eS,visuallyHideElement:eD}=J,eN=class{constructor(e,t){this.chart=e,this.domElementProvider=new eg,this.announceRegion=this.addAnnounceRegion(t)}destroy(){this.domElementProvider.destroyCreatedElements()}announce(e){ek().setElementHTML(this.announceRegion,e),this.clearAnnouncementRegionTimer&&R(this.clearAnnouncementRegionTimer),this.clearAnnouncementRegionTimer=setTimeout(()=>{this.announceRegion.innerHTML=ek().emptyHTML,delete this.clearAnnouncementRegionTimer},3e3)}addAnnounceRegion(e){let t=this.chart.announcerContainer||this.createAnnouncerContainer(),i=this.domElementProvider.createElement(\"div\");return T(i,{\"aria-hidden\":!1,\"aria-live\":e,\"aria-atomic\":!0}),this.chart.styledMode?eS(i,\"highcharts-visually-hidden\"):eD(i),t.appendChild(i),i}createAnnouncerContainer(){let e=this.chart,t=eP.createElement(\"div\");return T(t,{\"aria-hidden\":!1,class:\"highcharts-announcer-container\"}),t.style.position=\"relative\",e.renderTo.insertBefore(t,e.renderTo.firstChild),e.announcerContainer=t,t}},{escapeStringForHTML:eB,stripHTMLTagsFromString:eI}=J;function eF(e){return(e.annotations||[]).reduce((e,t)=>(t.options&&!1!==t.options.visible&&(e=e.concat(t.labels)),e),[])}function eO(e){return e.options&&e.options.accessibility&&e.options.accessibility.description||e.graphic&&e.graphic.text&&e.graphic.text.textStr||\"\"}function eR(e){let t=e.options&&e.options.accessibility&&e.options.accessibility.description;if(t)return t;let i=e.chart,s=eO(e),r=e.points.filter(e=>!!e.graphic).map(e=>{let t=e.accessibility&&e.accessibility.valueDescription||e.graphic&&e.graphic.element&&e.graphic.element.getAttribute(\"aria-label\")||\"\",i=e&&e.series.name||\"\";return(i?i+\", \":\"\")+\"data point \"+t}).filter(e=>!!e),n=r.length,o=n>1?\"MultiplePoints\":n?\"SinglePoint\":\"NoPoints\",a={annotationText:s,annotation:e,numPoints:n,annotationPoint:r[0],additionalAnnotationPoints:r.slice(1)};return i.langFormat(\"accessibility.screenReaderSection.annotations.description\"+o,a)}function eL(e){return eF(e).map(t=>{let i=eB(eI(eR(t),e.renderer.forExport));return i?`
  • ${i}
  • `:\"\"})}let eH={getAnnotationsInfoHTML:function(e){let t=e.annotations;if(!(t&&t.length))return\"\";let i=eL(e);return`
      ${i.join(\" \")}
    `},getAnnotationLabelDescription:eR,getAnnotationListItems:eL,getPointAnnotationTexts:function(e){let t=eF(e.series.chart).filter(t=>t.points.indexOf(e)>-1);return t.length?t.map(e=>`${eO(e)}`):[]}},{getAnnotationsInfoHTML:ez}=eH,{getAxisDescription:eq,getAxisRangeDescription:eK,getChartTitle:eG,unhideChartElementFromAT:eU}=ed,{format:eW}=et(),{doc:eV}=v(),{addClass:eX,getElement:ej,getHeadingTagNameForElement:eY,stripHTMLTagsFromString:e_,visuallyHideElement:eZ}=J;function e$(e){return function(e,...t){let i,s;do for(s of(i=e,t))e=e.replace(s[0],s[1]);while(e!==i);return e}(e,[/<([\\w\\-.:!]+)\\b[^<>]*>\\s*<\\/\\1>/g,\"\"])}let eQ=class extends ex{constructor(){super(...arguments),this.screenReaderSections={}}init(){let e=this.chart,t=this;this.initRegionsDefinitions(),this.addEvent(e,\"afterGetTableAST\",function(e){t.onDataTableCreated(e)}),this.addEvent(e,\"afterViewData\",function(e){e.wasHidden&&(t.dataTableDiv=e.element,setTimeout(function(){t.focusDataTable()},300))}),this.addEvent(e,\"afterHideData\",function(){t.viewDataTableButton&&t.viewDataTableButton.setAttribute(\"aria-expanded\",\"false\")}),e.exporting&&this.addEvent(e,\"afterPrint\",function(){t.updateAllScreenReaderSections()}),this.announcer=new eN(e,\"assertive\")}initRegionsDefinitions(){let e=this,t=this.chart.options.accessibility;this.screenReaderSections={before:{element:null,buildContent:function(i){let s=t.screenReaderSection.beforeChartFormatter;return s?s(i,e):e.defaultBeforeChartFormatter()},insertIntoDOM:function(e,t){t.renderTo.insertBefore(e,t.renderTo.firstChild)},afterInserted:function(){void 0!==e.sonifyButtonId&&e.initSonifyButton(e.sonifyButtonId),void 0!==e.dataTableButtonId&&e.initDataTableButton(e.dataTableButtonId)}},after:{element:null,buildContent:function(i){let s=t.screenReaderSection.afterChartFormatter;return s?s(i,e):e.defaultAfterChartFormatter()},insertIntoDOM:function(e,t){t.renderTo.insertBefore(e,t.container.nextSibling)},afterInserted:function(){e.chart.accessibility&&t.keyboardNavigation.enabled&&e.chart.accessibility.keyboardNavigation.updateExitAnchor()}}}}onChartRender(){this.linkedDescriptionElement=this.getLinkedDescriptionElement(),this.setLinkedDescriptionAttrs(),this.updateAllScreenReaderSections()}updateAllScreenReaderSections(){let e=this;Object.keys(this.screenReaderSections).forEach(function(t){e.updateScreenReaderSection(t)})}getLinkedDescriptionElement(){let e=this.chart.options.accessibility.linkedDescription;if(!e)return;if(\"string\"!=typeof e)return e;let t=eW(e,this.chart),i=eV.querySelectorAll(t);if(1===i.length)return i[0]}setLinkedDescriptionAttrs(){let e=this.linkedDescriptionElement;e&&(e.setAttribute(\"aria-hidden\",\"true\"),eX(e,\"highcharts-linked-description\"))}updateScreenReaderSection(e){let t=this.chart,i=this.screenReaderSections[e],s=i.buildContent(t),r=i.element=i.element||this.createElement(\"div\"),n=r.firstChild||this.createElement(\"div\");s?(this.setScreenReaderSectionAttribs(r,e),ek().setElementHTML(n,s),r.appendChild(n),i.insertIntoDOM(r,t),t.styledMode?eX(n,\"highcharts-visually-hidden\"):eZ(n),eU(t,n),i.afterInserted&&i.afterInserted()):(r.parentNode&&r.parentNode.removeChild(r),i.element=null)}setScreenReaderSectionAttribs(e,t){let i=this.chart,s=i.langFormat(\"accessibility.screenReaderSection.\"+t+\"RegionLabel\",{chart:i,chartTitle:eG(i)});T(e,{id:`highcharts-screen-reader-region-${t}-${i.index}`,\"aria-label\":s||void 0}),e.style.position=\"relative\",s&&e.setAttribute(\"role\",\"all\"===i.options.accessibility.landmarkVerbosity?\"region\":\"group\")}defaultBeforeChartFormatter(){let e=this.chart,t=e.options.accessibility.screenReaderSection.beforeChartFormat;if(!t)return\"\";let i=this.getAxesDescription(),s=e.sonify&&e.options.sonification&&e.options.sonification.enabled,r=\"highcharts-a11y-sonify-data-btn-\"+e.index,n=\"hc-linkto-highcharts-data-table-\"+e.index,o=ez(e),a=e.langFormat(\"accessibility.screenReaderSection.annotations.heading\",{chart:e}),l={headingTagName:eY(e.renderTo),chartTitle:eG(e),typeDescription:this.getTypeDescriptionText(),chartSubtitle:this.getSubtitleText(),chartLongdesc:this.getLongdescText(),xAxisDescription:i.xAxis,yAxisDescription:i.yAxis,playAsSoundButton:s?this.getSonifyButtonText(r):\"\",viewTableButton:e.exporting?.getCSV?this.getDataTableButtonText(n):\"\",annotationsTitle:o?a:\"\",annotationsList:o},h=eo.i18nFormat(t,l,e);return this.dataTableButtonId=n,this.sonifyButtonId=r,e$(h)}defaultAfterChartFormatter(){let e=this.chart,t=e.options.accessibility.screenReaderSection.afterChartFormat;if(!t)return\"\";let i={endOfChartMarker:this.getEndOfChartMarkerText()};return e$(eo.i18nFormat(t,i,e))}getLinkedDescription(){let e=this.linkedDescriptionElement;return e_(e&&e.innerHTML||\"\",this.chart.renderer.forExport)}getLongdescText(){let e=this.chart.options,t=e.caption,i=t&&t.text,s=this.getLinkedDescription();return e.accessibility.description||s||i||\"\"}getTypeDescriptionText(){let e=this.chart;return e.types?e.options.accessibility.typeDescription||function(e,t){let i,s,r,n=t[0],o=e.series&&e.series[0]||{},a=e.mapView&&e.mapView.geoMap&&e.mapView.geoMap.title,l={numSeries:e.series.length,numPoints:o.points&&o.points.length,chart:e,mapTitle:a};return n?\"map\"===n||\"tiledwebmap\"===n?l.mapTitle?e.langFormat(\"accessibility.chartTypes.mapTypeDescription\",l):e.langFormat(\"accessibility.chartTypes.unknownMap\",l):e.types.length>1?e.langFormat(\"accessibility.chartTypes.combinationChart\",l):(i=t[0],s=e.langFormat(\"accessibility.seriesTypeDescriptions.\"+i,l),r=e.series&&e.series.length<2?\"Single\":\"Multiple\",(e.langFormat(\"accessibility.chartTypes.\"+i+r,l)||e.langFormat(\"accessibility.chartTypes.default\"+r,l))+(s?\" \"+s:\"\")):e.langFormat(\"accessibility.chartTypes.emptyChart\",l)}(e,e.types):\"\"}getDataTableButtonText(e){let t=this.chart;return'\"}getSonifyButtonText(e){let t=this.chart;return t.options.sonification&&!1===t.options.sonification.enabled?\"\":'\"}getSubtitleText(){let e=this.chart.options.subtitle;return e_(e&&e.text||\"\",this.chart.renderer.forExport)}getEndOfChartMarkerText(){let e=ej(`highcharts-end-of-chart-marker-${this.chart.index}`);if(e)return e.outerHTML;let t=this.chart,i=t.langFormat(\"accessibility.screenReaderSection.endOfChartMarker\",{chart:t});return'
    '+i+\"
    \"}onDataTableCreated(e){let t=this.chart;if(t.options.accessibility.enabled){this.viewDataTableButton&&this.viewDataTableButton.setAttribute(\"aria-expanded\",\"true\");let i=e.tree.attributes||{};i.tabindex=-1,i.summary=t.langFormat(\"accessibility.table.tableSummary\",{chart:t}),e.tree.attributes=i}}focusDataTable(){let e=this.dataTableDiv,t=e&&e.getElementsByTagName(\"table\")[0];t&&t.focus&&t.focus()}initSonifyButton(e){let t=this.sonifyButton=ej(e),i=this.chart,s=e=>{t&&(t.setAttribute(\"aria-hidden\",\"true\"),t.setAttribute(\"aria-label\",\"\")),e.preventDefault(),e.stopPropagation();let s=i.langFormat(\"accessibility.sonification.playAsSoundClickAnnouncement\",{chart:i});this.announcer.announce(s),setTimeout(()=>{t&&(t.removeAttribute(\"aria-hidden\"),t.removeAttribute(\"aria-label\")),i.sonify&&i.sonify()},1e3)};t&&i&&(t.setAttribute(\"tabindex\",-1),t.onclick=function(e){(i.options.accessibility&&i.options.accessibility.screenReaderSection.onPlayAsSoundClick||s).call(this,e,i,this)})}initDataTableButton(e){let t=this.viewDataTableButton=ej(e),i=this.chart,s=e.replace(\"hc-linkto-\",\"\");t&&(T(t,{tabindex:-1,\"aria-expanded\":!!ej(s)}),t.onclick=i.options.accessibility.screenReaderSection.onViewDataTableClick||function(){i.exporting?.viewData()})}getAxesDescription(){let e=this.chart,t=function(t,i){let s=e[t];return s.length>1||s[0]&&W(s[0].options.accessibility&&s[0].options.accessibility.enabled,i)},i=!!e.types&&0>e.types.indexOf(\"map\")&&0>e.types.indexOf(\"treemap\")&&0>e.types.indexOf(\"tilemap\"),s=!!e.hasCartesianSeries,r=t(\"xAxis\",!e.angular&&s&&i),n=t(\"yAxis\",s&&i),o={};return r&&(o.xAxis=this.getAxisDescriptionText(\"xAxis\")),n&&(o.yAxis=this.getAxisDescriptionText(\"yAxis\")),o}getAxisDescriptionText(e){let t=this.chart,i=t[e];return t.langFormat(\"accessibility.axis.\"+e+\"Description\"+(i.length>1?\"Plural\":\"Singular\"),{chart:t,names:i.map(function(e){return eq(e)}),ranges:i.map(function(e){return eK(e)}),numAxes:i.length})}destroy(){this.announcer&&this.announcer.destroy()}},{getChartTitle:eJ,unhideChartElementFromAT:e0}=ed,{getFakeMouseEvent:e1}=J;function e2(e){return e.exporting?.svgElements?.[0]}class e3 extends ex{init(){let e=this.chart,t=this;this.addEvent(e,\"exportMenuShown\",function(){t.onMenuShown()}),this.addEvent(e,\"exportMenuHidden\",function(){t.onMenuHidden()}),this.createProxyGroup()}onMenuHidden(){let e=this.chart.exporting?.contextMenuEl;e&&e.setAttribute(\"aria-hidden\",\"true\"),this.setExportButtonExpandedState(\"false\")}onMenuShown(){let e=this.chart,t=e.exporting?.contextMenuEl;t&&(this.addAccessibleContextMenuAttribs(),e0(e,t)),this.setExportButtonExpandedState(\"true\")}setExportButtonExpandedState(e){this.exportButtonProxy&&this.exportButtonProxy.innerElement.setAttribute(\"aria-expanded\",e)}onChartRender(){let e=this.chart,t=e.focusElement,i=e.accessibility;this.proxyProvider.clearGroup(\"chartMenu\"),this.proxyMenuButton(),this.exportButtonProxy&&t&&t===e.exporting?.group&&(t.focusBorder?e.setFocusToElement(t,this.exportButtonProxy.innerElement):i&&i.keyboardNavigation.tabindexContainer.focus())}proxyMenuButton(){let e,t,i=this.chart,s=this.proxyProvider,r=e2(i);e=i.options.exporting,t=e2(i),e&&!1!==e.enabled&&e.accessibility&&e.accessibility.enabled&&t&&t.element&&r&&(this.exportButtonProxy=s.addProxyElement(\"chartMenu\",{click:r},\"button\",{\"aria-label\":i.langFormat(\"accessibility.exporting.menuButtonLabel\",{chart:i,chartTitle:eJ(i)}),\"aria-expanded\":!1,title:i.options.lang.contextButtonTitle||null}))}createProxyGroup(){this.chart&&this.proxyProvider&&this.proxyProvider.addGroup(\"chartMenu\")}addAccessibleContextMenuAttribs(){let e=this.chart,t=e.exporting?.divElements;if(t&&t.length){t.forEach(e=>{e&&(\"LI\"!==e.tagName||e.children&&e.children.length?e.setAttribute(\"aria-hidden\",\"true\"):e.setAttribute(\"tabindex\",-1))});let i=t[0]&&t[0].parentNode;i&&T(i,{\"aria-hidden\":void 0,\"aria-label\":e.langFormat(\"accessibility.exporting.chartMenuLabel\",{chart:e}),role:\"list\"})}}getKeyboardNavigation(){let e=this.keyCodes,t=this.chart,i=this;return new ey(t,{keyCodeMap:[[[e.left,e.up],function(){return i.onKbdPrevious(this)}],[[e.right,e.down],function(){return i.onKbdNext(this)}],[[e.enter,e.space],function(){return i.onKbdClick(this)}]],validate:function(){return!!t.exporting&&t.options.exporting?.buttons?.contextButton.enabled!==!1&&!1!==t.options.exporting.enabled&&!1!==(t.options.exporting.accessibility?.enabled||!1)},init:function(){let e=i.exportButtonProxy,s=i.chart.exporting?.group;e&&s&&t.setFocusToElement(s,e.innerElement)},terminate:function(){t.hideExportMenu()}})}onKbdPrevious(e){let t=this.chart,i=t.options.accessibility,s=e.response,r=t.highlightedExportItemIx||0;for(;r--;)if(t.highlightExportItem(r))return s.success;return i.keyboardNavigation.wrapAround?(t.highlightLastExportItem(),s.success):s.prev}onKbdNext(e){let t=this.chart,i=t.options.accessibility,s=e.response;for(let e=(t.highlightedExportItemIx||0)+1;e<(t.exporting?.divElements?.length||0);++e)if(t.highlightExportItem(e))return s.success;return i.keyboardNavigation.wrapAround?(t.highlightExportItem(0),s.success):s.next}onKbdClick(e){let t=this.chart,i=void 0!==t.highlightedExportItemIx&&t.exporting?.divElements?.[t.highlightedExportItemIx],s=e2(t)?.element;return t.exporting?.openMenu?i&&this.fakeClickEvent(i):(s&&this.fakeClickEvent(s),t.highlightExportItem(0)),e.response.success}}!function(e){function t(){let e=e2(this);if(e){let t=e.element;t.onclick&&(t.onclick=function(){e1(\"click\")})}}function i(){let e=this.exporting?.divElements;e&&this.exporting?.contextMenuEl&&this.exporting?.openMenu&&(e.forEach(e=>{e&&\"highcharts-menu-item\"===e.className&&e.onmouseout&&e.onmouseout(e1(\"mouseout\"))}),this.highlightedExportItemIx=0,this.exporting.contextMenuEl.hideMenu(),this.container.focus())}function s(e){let t=this.exporting?.divElements?.[e],i=void 0!==this.highlightedExportItemIx&&this.exporting?.divElements?.[this.highlightedExportItemIx];if(t&&\"LI\"===t.tagName&&!(t.children&&t.children.length)){let s=!!(this.renderTo.getElementsByTagName(\"g\")[0]||{}).focus;return t.focus&&s&&t.focus(),i&&i.onmouseout&&i.onmouseout(e1(\"mouseout\")),t.onmouseover&&t.onmouseover(e1(\"mouseover\")),this.highlightedExportItemIx=e,!0}return!1}function r(){if(this.exporting?.divElements){let e=this.exporting?.divElements.length;for(;e--;)if(this.highlightExportItem(e))return!0}return!1}e.compose=function(e){let n=e.prototype;n.hideExportMenu||(n.hideExportMenu=i,n.highlightExportItem=s,n.highlightLastExportItem=r,n.showExportMenu=t)}}(e3||(e3={}));let e5=e3,{doc:e4,win:e6}=v(),{getElement:e9,simulatedEventTarget:e8}=J;class e7{constructor(e,t){this.currentModuleIx=NaN,this.modules=[],this.init(e,t)}init(e,t){let i=this.eventProvider=new em;this.chart=e,this.components=t,this.modules=[],this.currentModuleIx=0,this.update(),i.addEvent(this.tabindexContainer,\"keydown\",e=>this.onKeydown(e)),i.addEvent(this.tabindexContainer,\"focus\",e=>this.onFocus(e)),[\"mouseup\",\"touchend\"].forEach(e=>i.addEvent(e4,e,e=>this.onMouseUp(e))),[\"mousedown\",\"touchstart\"].forEach(t=>i.addEvent(e.renderTo,t,()=>{this.isClickingChart=!0}))}update(e){let t=this.chart.options.accessibility,i=t&&t.keyboardNavigation,s=this.components;this.updateContainerTabindex(),i&&i.enabled&&e&&e.length?(this.modules=e.reduce(function(e,t){let i=s[t].getKeyboardNavigation();return e.concat(i)},[]),this.updateExitAnchor()):(this.modules=[],this.currentModuleIx=0,this.removeExitAnchor())}updateExitAnchor(){let e=e9(`highcharts-end-of-chart-marker-${this.chart.index}`);this.removeExitAnchor(),e?(this.makeElementAnExitAnchor(e),this.exitAnchor=e):this.createExitAnchor()}move(e){let t=this.modules&&this.modules[this.currentModuleIx];t&&t.terminate&&t.terminate(e),this.chart.focusElement&&this.chart.focusElement.removeFocusBorder(),this.currentModuleIx+=e;let i=this.modules&&this.modules[this.currentModuleIx];if(i){if(i.validate&&!i.validate())return this.move(e);if(i.init)return i.init(e),!0}return this.currentModuleIx=0,this.exiting=!0,e>0?this.exitAnchor&&this.exitAnchor.focus():this.tabindexContainer.focus(),!1}onFocus(e){let t=this.chart,i=e.relatedTarget&&t.container.contains(e.relatedTarget),s=t.options.accessibility,r=s&&s.keyboardNavigation;if(r&&r.enabled&&!this.exiting&&!this.tabbingInBackwards&&!this.isClickingChart&&!i){let e=this.getFirstValidModuleIx();null!==e&&(this.currentModuleIx=e,this.modules[e].init(1))}this.keyboardReset=!1,this.exiting=!1}onMouseUp(e){if(delete this.isClickingChart,!this.keyboardReset&&e.relatedTarget!==e8){let t=this.chart;if(!e.target||!t.container.contains(e.target)){let e=this.modules&&this.modules[this.currentModuleIx||0];e&&e.terminate&&e.terminate(),this.currentModuleIx=0}t.focusElement&&(t.focusElement.removeFocusBorder(),delete t.focusElement),this.keyboardReset=!0}}onKeydown(e){let t,i=e||e6.event,s=this.modules&&this.modules.length&&this.modules[this.currentModuleIx],r=i.target;if((!r||\"INPUT\"!==r.nodeName||r.classList.contains(\"highcharts-a11y-proxy-element\"))&&(this.keyboardReset=!1,this.exiting=!1,s)){let e=s.run(i);e===s.response.success?t=!0:e===s.response.prev?t=this.move(-1):e===s.response.next&&(t=this.move(1)),t&&(i.preventDefault(),i.stopPropagation())}}updateContainerTabindex(){let e,t=this.chart.options.accessibility,i=t&&t.keyboardNavigation,s=!(i&&!1===i.enabled),r=this.chart,n=r.container;r.renderTo.hasAttribute(\"tabindex\")?(n.removeAttribute(\"tabindex\"),e=r.renderTo):e=n,this.tabindexContainer=e;let o=e.getAttribute(\"tabindex\");s&&!o?e.setAttribute(\"tabindex\",\"0\"):s||r.container.removeAttribute(\"tabindex\")}createExitAnchor(){let e=this.chart,t=this.exitAnchor=e4.createElement(\"div\");e.renderTo.appendChild(t),this.makeElementAnExitAnchor(t)}makeElementAnExitAnchor(e){let t=this.tabindexContainer.getAttribute(\"tabindex\")||0;e.setAttribute(\"class\",\"highcharts-exit-anchor\"),e.setAttribute(\"tabindex\",t),e.setAttribute(\"aria-hidden\",!1),this.addExitAnchorEventsToEl(e)}removeExitAnchor(){if(this.exitAnchor){let e=this.eventProvider.eventRemovers.find(e=>e.element===this.exitAnchor);e&&S(e.remover)&&this.eventProvider.removeEvent(e.remover),this.exitAnchor.parentNode&&this.exitAnchor.parentNode.removeChild(this.exitAnchor),delete this.exitAnchor}}addExitAnchorEventsToEl(e){let t=this.chart,i=this;this.eventProvider.addEvent(e,\"focus\",function(e){let s=e||e6.event,r=!(s.relatedTarget&&t.container.contains(s.relatedTarget)||i.exiting);if(t.focusElement&&delete t.focusElement,r){if(i.tabbingInBackwards=!0,i.tabindexContainer.focus(),delete i.tabbingInBackwards,s.preventDefault(),i.modules&&i.modules.length){i.currentModuleIx=i.modules.length-1;let e=i.modules[i.currentModuleIx];e&&e.validate&&!e.validate()?i.move(-1):e&&e.init(-1)}}else i.exiting=!1})}getFirstValidModuleIx(){let e=this.modules.length;for(let t=0;t{e&&e.dismissPopupContent&&e.dismissPopupContent()})}(e7||(e7={})).compose=function(e){e5.compose(e);let t=e.prototype;return!t.dismissPopupContent&&(t.dismissPopupContent=te,e4&&A(e4,\"keydown\",tt)),e};let ti=e7;var ts=f(632),tr=f.n(ts);let{animObject:tn}=v(),{doc:to}=v(),{getChartTitle:ta}=ed,{stripHTMLTagsFromString:tl,addClass:th,removeClass:tc}=J;function td(e){let t=e.legend&&e.legend.allItems,i=e.options.legend.accessibility||{},s=e.colorAxis&&e.colorAxis.some(e=>!e.dataClasses||!e.dataClasses.length);return!!(t&&t.length&&!s&&!1!==i.enabled)}function tu(e,t){let i=t.legendItem||{};for(let s of(t.setState(e?\"hover\":\"\",!0),[\"group\",\"label\",\"symbol\"])){let t=i[s],r=t&&t.element||t;r&&I(r,e?\"mouseover\":\"mouseout\")}}class tp extends ex{constructor(){super(...arguments),this.highlightedLegendItemIx=NaN,this.proxyGroup=null}init(){let e=this;this.recreateProxies(),this.addEvent(tr(),\"afterScroll\",function(){this.chart===e.chart&&(e.proxyProvider.updateGroupProxyElementPositions(\"legend\"),e.updateLegendItemProxyVisibility(),e.highlightedLegendItemIx>-1&&this.chart.highlightLegendItem(e.highlightedLegendItemIx))}),this.addEvent(tr(),\"afterPositionItem\",function(t){this.chart===e.chart&&this.chart.renderer&&e.updateProxyPositionForItem(t.item)}),this.addEvent(tr(),\"afterRender\",function(){this.chart===e.chart&&this.chart.renderer&&e.recreateProxies()&&j(()=>e.proxyProvider.updateGroupProxyElementPositions(\"legend\"),tn(W(this.chart.renderer.globalAnimation,!0)).duration)})}updateLegendItemProxyVisibility(){let e,t=this.chart,i=t.legend,s=i.allItems||[],r=i.currentPage||1,n=i.clipHeight||0;s.forEach(s=>{if(s.a11yProxyElement){let o=i.pages&&i.pages.length,a=s.a11yProxyElement.element,l=!1;if(e=s.legendItem||{},o){let t=e.pageIx||0;l=(e.y||0)+(e.label?Math.round(e.label.getBBox().height):0)-i.pages[t]>n||t!==r-1}l?t.styledMode?th(a,\"highcharts-a11y-invisible\"):a.style.visibility=\"hidden\":(tc(a,\"highcharts-a11y-invisible\"),a.style.visibility=\"\")}})}onChartRender(){td(this.chart)||this.removeProxies()}highlightAdjacentLegendPage(e){let t=this.chart,i=t.legend,s=(i.currentPage||1)+e,r=i.pages||[];if(s>0&&s<=r.length){let e=0;for(let r of i.allItems)((r.legendItem||{}).pageIx||0)+1===s&&t.highlightLegendItem(e)&&(this.highlightedLegendItemIx=e),++e}}updateProxyPositionForItem(e){e.a11yProxyElement&&e.a11yProxyElement.refreshPosition()}recreateProxies(){let e=to.activeElement,t=this.proxyGroup,i=e&&t&&t.contains(e);return this.removeProxies(),!!td(this.chart)&&(this.addLegendProxyGroup(),this.proxyLegendItems(),this.updateLegendItemProxyVisibility(),this.updateLegendTitle(),i&&this.chart.highlightLegendItem(this.highlightedLegendItemIx),!0)}removeProxies(){this.proxyProvider.removeGroup(\"legend\")}updateLegendTitle(){let e=this.chart,t=tl((e.legend&&e.legend.options.title&&e.legend.options.title.text||\"\").replace(/
    /g,\" \"),e.renderer.forExport),i=e.langFormat(\"accessibility.legend.legendLabel\"+(t?\"\":\"NoTitle\"),{chart:e,legendTitle:t,chartTitle:ta(e)});this.proxyProvider.updateGroupAttrs(\"legend\",{\"aria-label\":i})}addLegendProxyGroup(){let e=\"all\"===this.chart.options.accessibility.landmarkVerbosity?\"region\":null;this.proxyGroup=this.proxyProvider.addGroup(\"legend\",\"ul\",{\"aria-label\":\"_placeholder_\",role:e})}proxyLegendItems(){let e,t=this;((this.chart.legend||{}).allItems||[]).forEach(i=>{(e=i.legendItem||{}).label&&e.label.element&&t.proxyLegendItem(i)})}proxyLegendItem(e){let t=e.legendItem||{},i=e.legendItem?.label,s=i?.element,r=t.label?.styles?.textOverflow===\"ellipsis\";if(!t.label||!t.group)return;let n=this.chart.langFormat(\"accessibility.legend.legendItem\",{chart:this.chart,itemName:tl(e.name,this.chart.renderer.forExport),item:e}),o={tabindex:-1,\"aria-pressed\":e.visible,\"aria-label\":n,title:\"\"};r&&-1!==(s.textContent||\"\").indexOf(\"\u2026\")&&(o.title=i?.textStr);let a=t.group.div?t.label:t.group;e.a11yProxyElement=this.proxyProvider.addProxyElement(\"legend\",{click:t.label,visual:a.element},\"button\",o)}getKeyboardNavigation(){let e=this.keyCodes,t=this,i=this.chart;return new ey(i,{keyCodeMap:[[[e.left,e.right,e.up,e.down],function(e){return t.onKbdArrowKey(this,e)}],[[e.enter,e.space],function(){return t.onKbdClick(this)}],[[e.pageDown,e.pageUp],function(i){let s=i===e.pageDown?1:-1;return t.highlightAdjacentLegendPage(s),this.response.success}]],validate:function(){return t.shouldHaveLegendNavigation()},init:function(){i.highlightLegendItem(0),t.highlightedLegendItemIx=0},terminate:function(){t.highlightedLegendItemIx=-1,i.legend.allItems.forEach(e=>tu(!1,e))}})}onKbdArrowKey(e,t){let{keyCodes:{left:i,up:s},highlightedLegendItemIx:r,chart:n}=this,o=n.legend.allItems.length,a=n.options.accessibility.keyboardNavigation.wrapAround,l=t===i||t===s?-1:1;return n.highlightLegendItem(r+l)?this.highlightedLegendItemIx+=l:a&&o>1&&(this.highlightedLegendItemIx=l>0?0:o-1,n.highlightLegendItem(this.highlightedLegendItemIx)),e.response.success}onKbdClick(e){let t=this.chart.legend.allItems[this.highlightedLegendItemIx];return t&&t.a11yProxyElement&&t.a11yProxyElement.click(),e.response.success}shouldHaveLegendNavigation(){if(!td(this.chart))return!1;let e=this.chart,t=(e.options.legend||{}).accessibility||{};return!!(e.legend.display&&t.keyboardNavigation&&t.keyboardNavigation.enabled)}destroy(){this.removeProxies()}}function tg(e){let t=this.legend.allItems,i=this.accessibility&&this.accessibility.components.legend.highlightedLegendItemIx,s=t[e],r=s?.legendItem||{};if(s){var n;let o,a;H(i)&&t[i]&&tu(!1,t[i]),n=this.legend,o=(n.allItems[e].legendItem||{}).pageIx,a=n.currentPage,void 0!==o&&o+1!==a&&n.scroll(1+o-a);let l=r.label,h=s.a11yProxyElement&&s.a11yProxyElement.innerElement;return l&&l.element&&h&&this.setFocusToElement(l,h),tu(!0,s),!0}return!1}function tm(e){let t=this.chart.options.accessibility,i=e.item;t.enabled&&i&&i.a11yProxyElement&&i.a11yProxyElement.innerElement.setAttribute(\"aria-pressed\",e.visible?\"true\":\"false\")}(tp||(tp={})).compose=function(e,t){let i=e.prototype;i.highlightLegendItem||(i.highlightLegendItem=tg,A(t,\"afterColorizeItem\",tm))};let tb=tp;var tf=f(532),tx=f.n(tf);let{isTouchDevice:ty}=v(),tv=[];function tw(){this.navigator&&this.navigator.setBaseSeries(null,!1)}function tE(){let e,t,i,s=this.legend,r=this.navigator;if(r){e=s&&s.options,t=r.xAxis,i=r.yAxis;let{scrollbarHeight:n,scrollButtonSize:o}=r;this.inverted?(r.left=r.opposite?this.chartWidth-n-r.height:this.spacing[3]+n,r.top=this.plotTop+o):(r.left=W(t.left,this.plotLeft+o),r.top=r.navigatorOptions.top||this.chartHeight-r.height-n-(this.scrollbar?.options.margin||0)-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?this.rangeSelector.getHeight():0)-(e&&\"bottom\"===e.verticalAlign&&\"proximate\"!==e.layout&&e.enabled&&!e.floating?s.legendHeight+W(e.margin,10):0)-(this.titleOffset?this.titleOffset[2]:0)),t&&i&&(this.inverted?t.options.left=i.options.left=r.left:t.options.top=i.options.top=r.top,t.setAxisSize(),i.setAxisSize())}}function tA(e){!this.navigator&&!this.scroller&&(this.options.navigator.enabled||this.options.scrollbar.enabled)&&(this.scroller=this.navigator=new c(this),W(e.redraw,!0)&&this.redraw(e.animation))}function tT(){let e=this.options;(e.navigator.enabled||e.scrollbar.enabled)&&(this.scroller=this.navigator=new c(this))}function tM(){let e=this.options,t=e.navigator,i=e.rangeSelector;if((t&&t.enabled||i&&i.enabled)&&(!ty&&\"x\"===this.zooming.type||ty&&\"x\"===this.zooming.pinchType))return!1}function tC(e){let t=e.navigator;if(t&&e.xAxis[0]){let i=e.xAxis[0].getExtremes();t.render(i.min,i.max)}}function tk(e){let t=e.options.navigator||{},i=e.options.scrollbar||{};!this.navigator&&!this.scroller&&(t.enabled||i.enabled)&&(G(!0,this.options.navigator,t),G(!0,this.options.scrollbar,i),delete e.options.navigator,delete e.options.scrollbar)}let tP=function(e,t){if(V(tv,e)){let i=e.prototype;c=t,i.callbacks.push(tC),A(e,\"afterAddSeries\",tw),A(e,\"afterSetChartSize\",tE),A(e,\"afterUpdate\",tA),A(e,\"beforeRender\",tT),A(e,\"beforeShowResetZoom\",tM),A(e,\"update\",tk)}},{isTouchDevice:tS}=v();function tD(){this.navigatorAxis||(this.navigatorAxis=new tB(this))}function tN(e){let t,i=this.chart,s=i.options,r=s.navigator,n=this.navigatorAxis,o=i.zooming.pinchType,a=s.rangeSelector,l=i.zooming.type;if(this.isXAxis&&(r?.enabled||a?.enabled)){if(\"y\"===l&&\"zoom\"===e.trigger)t=!1;else if((\"zoom\"===e.trigger&&\"xy\"===l||tS&&\"xy\"===o)&&this.options.range){let t=n.previousZoom;S(e.min)?n.previousZoom=[this.min,this.max]:t&&(e.min=t[0],e.max=t[1],n.previousZoom=void 0)}}void 0!==t&&e.preventDefault()}class tB{static compose(e){e.keepProps.includes(\"navigatorAxis\")||(e.keepProps.push(\"navigatorAxis\"),A(e,\"init\",tD),A(e,\"setExtremes\",tN))}constructor(e){this.axis=e}destroy(){this.axis=void 0}toFixedRange(e,t,i,s){let r=this.axis,n=(r.pointRange||0)/2,o=W(i,r.translate(e,!0,!r.horiz)),a=W(s,r.translate(t,!0,!r.horiz));return S(i)||(o=C(o+n)),S(s)||(a=C(a-n)),H(o)&&H(a)||(o=a=void 0),{min:o,max:a}}}var tI=f(620),tF=f.n(tI),tO=f(512),tR=f.n(tO);let{parse:tL}=tF(),{seriesTypes:tH}=tR(),tz={height:40,margin:22,maskInside:!0,handles:{width:7,borderRadius:0,height:15,symbols:[\"navigator-handle\",\"navigator-handle\"],enabled:!0,lineWidth:1,backgroundColor:\"#f2f2f2\",borderColor:\"#999999\"},maskFill:tL(\"#667aff\").setOpacity(.3).get(),outlineColor:\"#999999\",outlineWidth:1,series:{type:void 0===tH.areaspline?\"line\":\"areaspline\",fillOpacity:.05,lineWidth:1,compare:null,sonification:{enabled:!1},dataGrouping:{approximation:\"average\",enabled:!0,groupPixelWidth:2,firstAnchor:\"firstPoint\",anchor:\"middle\",lastAnchor:\"lastPoint\",units:[[\"millisecond\",[1,2,5,10,20,25,50,100,200,500]],[\"second\",[1,2,5,10,15,30]],[\"minute\",[1,2,5,10,15,30]],[\"hour\",[1,2,3,4,6,8,12]],[\"day\",[1,2,3,4]],[\"week\",[1,2,3]],[\"month\",[1,3,6]],[\"year\",null]]},dataLabels:{enabled:!1,zIndex:2},id:\"highcharts-navigator-series\",className:\"highcharts-navigator-series\",lineColor:null,marker:{enabled:!1},threshold:null},xAxis:{className:\"highcharts-navigator-xaxis\",tickLength:0,lineWidth:0,gridLineColor:\"#e6e6e6\",id:\"navigator-x-axis\",gridLineWidth:1,tickPixelInterval:200,labels:{align:\"left\",style:{color:\"#000000\",fontSize:\"0.7em\",opacity:.6,textOutline:\"2px contrast\"},x:3,y:-4},crosshair:!1},yAxis:{className:\"highcharts-navigator-yaxis\",gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,id:\"navigator-y-axis\",maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:void 0},tickLength:0,tickWidth:0}},tq={\"navigator-handle\":function(e,t,i,s,r={}){var n,o,a,l,h,c,d;let u=r.width?r.width/2:i,p=(n=r.borderRadius||0,o=Math.min(2*u,s),/%$/.test(n)?o*parseFloat(n)/100+0:parseFloat(n));return[[\"M\",-1.5,(s=r.height||s)/2-3.5],[\"L\",-1.5,s/2+4.5],[\"M\",.5,s/2-3.5],[\"L\",.5,s/2+4.5],...(a=-u-1,l=.5,h=2*u+1,c=s,d={r:p},d?.r?function(e,t,i,s,r){let n=r?.r||0;return[[\"M\",e+n,t],[\"L\",e+i-n,t],[\"A\",n,n,0,0,1,e+i,t+n],[\"L\",e+i,t+s-n],[\"A\",n,n,0,0,1,e+i-n,t+s],[\"L\",e+n,t+s],[\"A\",n,n,0,0,1,e,t+s-n],[\"L\",e,t+n],[\"A\",n,n,0,0,1,e+n,t],[\"Z\"]]}(a,.5,h,c,d):[[\"M\",a,.5],[\"L\",a+h,.5],[\"L\",a+h,.5+c],[\"L\",a,.5+c],[\"Z\"]])]}};var tK=f(608),tG=f.n(tK);let{defaultOptions:tU}=v(),{composed:tW}=v(),{getRendererType:tV}=tG(),{setFixedRange:tX}={setFixedRange:function(e){let t=this.xAxis[0];S(t.dataMax)&&S(t.dataMin)&&e?this.fixedRange=Math.min(e,t.dataMax-t.dataMin):this.fixedRange=e}};function tj(){this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1)}let tY=function(e,t,i){tB.compose(t),V(tW,\"Navigator\")&&(e.prototype.setFixedRange=tX,B(tV().prototype.symbols,tq),B(tU,{navigator:tz}),A(i,\"afterUpdate\",tj))},{composed:t_}=v();!function(e){let t;function i(e){let t=W(e.options?.min,e.min),i=W(e.options?.max,e.max);return{axisMin:t,axisMax:i,scrollMin:S(e.dataMin)?Math.min(t,e.min??1/0,e.dataMin,e.threshold??1/0):t,scrollMax:e.treeGrid?.adjustedMax??(S(e.dataMax)?Math.max(i,e.max??-1/0,e.dataMax,e.threshold??-1/0):i)}}function s(){let e=this.scrollbar,t=e&&!e.options.opposite,i=this.horiz?2:t?3:1;e&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[i]+=e.size+(e.options.margin||0))}function r(){let e=this;e.options?.scrollbar?.enabled&&(e.options.scrollbar.vertical=!e.horiz,e.options.startOnTick=e.options.endOnTick=!1,e.scrollbar=new t(e.chart.renderer,e.options.scrollbar,e.chart),A(e.scrollbar,\"changed\",function(t){let s,r,{axisMin:n,axisMax:o,scrollMin:a,scrollMax:l}=i(e),h=e.toPixels(a),c=e.toPixels(l)-h;if(S(n)&&S(o))if(e.horiz&&!e.reversed||!e.horiz&&e.reversed?(s=Math.min(l,e.toValue(h+c*this.to)),r=Math.max(a,e.toValue(h+c*this.from))):(s=Math.min(l,e.toValue(h+c*(1-this.from))),r=Math.max(a,e.toValue(h+c*(1-this.to)))),this.shouldUpdateExtremes(t.DOMType)){let i=\"mousemove\"!==t.DOMType&&\"touchmove\"!==t.DOMType&&void 0;e.setExtremes(C(r),C(s),!0,i,t)}else this.setRange(this.from,this.to)}))}function n(){let e,t,s,{scrollMin:r,scrollMax:n}=i(this),o=this.scrollbar,a=(this.axisTitleMargin||0)+(this.titleOffset||0),l=this.chart.scrollbarsOffsets,h=this.options.margin||0;if(o&&l){if(this.horiz)this.opposite||(l[1]+=a),o.position(this.left,this.top+this.height+2+l[1]-(this.opposite?h:0),this.width,this.height),this.opposite||(l[1]+=h),e=1;else{let t;this.opposite&&(l[0]+=a),t=o.options.opposite?this.left+this.width+2+l[0]-(this.opposite?0:h):this.opposite?0:h,o.position(t,this.top,this.width,this.height),this.opposite&&(l[0]+=h),e=0}if(l[e]+=o.size+(o.options.margin||0),isNaN(r)||isNaN(n)||!S(this.min)||!S(this.max)||S(this.dataMin)&&this.dataMin===this.dataMax)o.setRange(0,1);else if(this.min===this.max){let e=this.pointRange/(this.dataMax+1);t=e*this.min,s=e*(this.max+1),o.setRange(t,s)}else t=(this.toPixels(this.min)-this.toPixels(r))/(this.toPixels(n)-this.toPixels(r)),s=(this.toPixels(this.max)-this.toPixels(r))/(this.toPixels(n)-this.toPixels(r)),this.horiz&&!this.reversed||!this.horiz&&this.reversed?o.setRange(t,s):o.setRange(1-s,1-t)}}e.compose=function(e,i){V(t_,\"Axis.Scrollbar\")&&(t=i,A(e,\"afterGetOffset\",s),A(e,\"afterInit\",r),A(e,\"afterRender\",n))}}(p||(p={}));let tZ=p,t$={height:10,barBorderRadius:5,buttonBorderRadius:0,buttonsEnabled:!1,liveRedraw:void 0,margin:void 0,minWidth:6,opposite:!0,step:.2,zIndex:3,barBackgroundColor:\"#cccccc\",barBorderWidth:0,barBorderColor:\"#cccccc\",buttonArrowColor:\"#333333\",buttonBackgroundColor:\"#e6e6e6\",buttonBorderColor:\"#cccccc\",buttonBorderWidth:1,rifleColor:\"none\",trackBackgroundColor:\"rgba(255, 255, 255, 0.001)\",trackBorderColor:\"#cccccc\",trackBorderRadius:5,trackBorderWidth:1},{defaultOptions:tQ}=v(),{composed:tJ}=v();class t0{static compose(e){tZ.compose(e,t0),V(tJ,\"Scrollbar\")&&B(tQ,{scrollbar:t$})}static swapXY(e,t){return t&&e.forEach(e=>{let t,i=e.length;for(let s=0;sthis.calculatedWidth?t.minWidth:0;return{chartX:(e.chartX-this.x-this.xOffset)/(this.barWidth-i),chartY:(e.chartY-this.y-this.yOffset)/(this.barWidth-i)}}destroy(){let e=this,t=e.chart.scroller;e.removeEvents(),[\"track\",\"scrollbarRifles\",\"scrollbar\",\"scrollbarGroup\",\"group\"].forEach(function(t){e[t]&&e[t].destroy&&(e[t]=e[t].destroy())}),t&&e===t.scrollbar&&(t.scrollbar=null,D(t.scrollbarButtons))}drawScrollbarButton(e){let t=this.renderer,i=this.scrollbarButtons,s=this.options,r=this.size,n=t.g().add(this.group);if(i.push(n),s.buttonsEnabled){let o=t.rect().addClass(\"highcharts-scrollbar-button\").add(n);this.chart.styledMode||o.attr({stroke:s.buttonBorderColor,\"stroke-width\":s.buttonBorderWidth,fill:s.buttonBackgroundColor}),o.attr(o.crisp({x:-.5,y:-.5,width:r,height:r,r:s.buttonBorderRadius},o.strokeWidth()));let a=t.path(t0.swapXY([[\"M\",r/2+(e?-1:1),r/2-3],[\"L\",r/2+(e?-1:1),r/2+3],[\"L\",r/2+(e?2:-2),r/2]],s.vertical)).addClass(\"highcharts-scrollbar-arrow\").add(i[e]);this.chart.styledMode||a.attr({fill:s.buttonArrowColor})}}init(e,t,i){this.scrollbarButtons=[],this.renderer=e,this.userOptions=t,this.options=G(t$,tQ.scrollbar,t),this.options.margin=W(this.options.margin,10),this.chart=i,this.size=W(this.options.size,this.options.height),t.enabled&&(this.render(),this.addEvents())}mouseDownHandler(e){let t=this.chart.pointer?.normalize(e)||e,i=this.cursorToScrollbarPosition(t);this.chartX=i.chartX,this.chartY=i.chartY,this.initPositions=[this.from,this.to],this.grabbedCenter=!0}mouseMoveHandler(e){let t,i=this.chart.pointer?.normalize(e)||e,s=this.options.vertical?\"chartY\":\"chartX\",r=this.initPositions||[];this.grabbedCenter&&(!e.touches||0!==e.touches[0][s])&&(t=this.cursorToScrollbarPosition(i)[s]-this[s],this.hasDragged=!0,this.updatePosition(r[0]+t,r[1]+t),this.hasDragged&&I(this,\"changed\",{from:this.from,to:this.to,trigger:\"scrollbar\",DOMType:e.type,DOMEvent:e}))}mouseUpHandler(e){this.hasDragged&&I(this,\"changed\",{from:this.from,to:this.to,trigger:\"scrollbar\",DOMType:e.type,DOMEvent:e}),this.grabbedCenter=this.hasDragged=this.chartX=this.chartY=null}position(e,t,i,s){let{buttonsEnabled:r,margin:n=0,vertical:o}=this.options,a=this.rendered?\"animate\":\"attr\",l=s,h=0;this.group.show(),this.x=e,this.y=t+this.trackBorderWidth,this.width=i,this.height=s,this.xOffset=l,this.yOffset=h,o?(this.width=this.yOffset=i=h=this.size,this.xOffset=l=0,this.yOffset=h=r?this.size:0,this.barWidth=s-(r?2*i:0),this.x=e+=n):(this.height=s=this.size,this.xOffset=l=r?this.size:0,this.barWidth=i-(r?2*s:0),this.y=this.y+n),this.group[a]({translateX:e,translateY:this.y}),this.track[a]({width:i,height:s}),this.scrollbarButtons[1][a]({translateX:o?0:i-l,translateY:o?s-h:0})}removeEvents(){this._events.forEach(function(e){X.apply(null,e)}),this._events.length=0}render(){let e=this.renderer,t=this.options,i=this.size,s=this.chart.styledMode,r=e.g(\"scrollbar\").attr({zIndex:t.zIndex}).hide().add();this.group=r,this.track=e.rect().addClass(\"highcharts-scrollbar-track\").attr({r:t.trackBorderRadius||0,height:i,width:i}).add(r),s||this.track.attr({fill:t.trackBackgroundColor,stroke:t.trackBorderColor,\"stroke-width\":t.trackBorderWidth});let n=this.trackBorderWidth=this.track.strokeWidth();this.track.attr({x:-k(0,n),y:-k(0,n)}),this.scrollbarGroup=e.g().add(r),this.scrollbar=e.rect().addClass(\"highcharts-scrollbar-thumb\").attr({height:i-n,width:i-n,r:t.barBorderRadius||0}).add(this.scrollbarGroup),this.scrollbarRifles=e.path(t0.swapXY([[\"M\",-3,i/4],[\"L\",-3,2*i/3],[\"M\",0,i/4],[\"L\",0,2*i/3],[\"M\",3,i/4],[\"L\",3,2*i/3]],t.vertical)).addClass(\"highcharts-scrollbar-rifles\").add(this.scrollbarGroup),s||(this.scrollbar.attr({fill:t.barBackgroundColor,stroke:t.barBorderColor,\"stroke-width\":t.barBorderWidth}),this.scrollbarRifles.attr({stroke:t.rifleColor,\"stroke-width\":1})),this.scrollbarStrokeWidth=this.scrollbar.strokeWidth(),this.scrollbarGroup.translate(-k(0,this.scrollbarStrokeWidth),-k(0,this.scrollbarStrokeWidth)),this.drawScrollbarButton(0),this.drawScrollbarButton(1)}setRange(e,t){let i,s,r=this.options,n=r.vertical,o=r.minWidth,a=this.barWidth,l=!this.rendered||this.hasDragged||this.chart.navigator&&this.chart.navigator.hasDragged?\"attr\":\"animate\";if(!S(a))return;let h=a*Math.min(t,1);i=Math.ceil(a*(e=Math.max(e,0))),this.calculatedWidth=s=C(h-i),s=1?this.group.hide():this.group.show()),this.rendered=!0}shouldUpdateExtremes(e){return W(this.options.liveRedraw,v().svg&&!v().isTouchDevice&&!this.chart.boosted)||\"mouseup\"===e||\"touchend\"===e||!S(e)}trackClick(e){let t=this.chart.pointer?.normalize(e)||e,i=this.to-this.from,s=this.y+this.scrollbarTop,r=this.x+this.scrollbarLeft;this.options.vertical&&t.chartY>s||!this.options.vertical&&t.chartX>r?this.updatePosition(this.from+i,this.to+i):this.updatePosition(this.from-i,this.to-i),I(this,\"changed\",{from:this.from,to:this.to,trigger:\"scrollbar\",DOMEvent:e})}update(e){this.destroy(),this.init(this.chart.renderer,G(!0,this.options,e),this.chart)}updatePosition(e,t){t>1&&(e=C(1-C(t-e)),t=1),e<0&&(t=C(t-e),e=0),this.from=e,this.to=t}}t0.defaultOptions=t$;let{defaultOptions:t1}=v(),{isTouchDevice:t2}=v();function t3(e,...t){let i=[].filter.call(t,H);if(i.length)return Math[e].apply(0,i)}class t5{static compose(e,t,i){tP(e,t5),tY(e,t,i)}constructor(e){this.isDirty=!1,this.scrollbarHeight=0,this.init(e)}drawHandle(e,t,i,s){let r=this.navigatorOptions.handles.height;this.handles[t][s](i?{translateX:Math.round(this.left+this.height/2),translateY:Math.round(this.top+parseInt(e,10)+.5-r)}:{translateX:Math.round(this.left+parseInt(e,10)),translateY:Math.round(this.top+this.height/2-r/2-1)})}drawOutline(e,t,i,s){let r=this.navigatorOptions.maskInside,n=this.outline.strokeWidth(),o=n/2,a=n%2/2,l=this.scrollButtonSize,h=this.size,c=this.top,d=this.height,u=c-o,p=c+d,g=this.left,m,b;i?(m=c+t+a,t=c+e+a,b=[[\"M\",g+d,c-l-a],[\"L\",g+d,m],[\"L\",g,m],[\"M\",g,t],[\"L\",g+d,t],[\"L\",g+d,c+h+l]],r&&b.push([\"M\",g+d,m-o],[\"L\",g+d,t+o])):(g-=l,e+=g+l-a,t+=g+l-a,b=[[\"M\",g,u],[\"L\",e,u],[\"L\",e,p],[\"M\",t,p],[\"L\",t,u],[\"L\",g+h+2*l,u]],r&&b.push([\"M\",e-o,u],[\"L\",t+o,u])),this.outline[s]({d:b})}drawMasks(e,t,i,s){let r,n,o,a,l=this.left,h=this.top,c=this.height;i?(o=[l,l,l],a=[h,h+e,h+t],n=[c,c,c],r=[e,t-e,this.size-t]):(o=[l,l+e,l+t],a=[h,h,h],n=[e,t-e,this.size-t],r=[c,c,c]),this.shades.forEach((e,t)=>{e[s]({x:o[t],y:a[t],width:n[t],height:r[t]})})}renderElements(){let e=this,t=e.navigatorOptions,i=t.maskInside,s=e.chart,r=s.inverted,n=s.renderer,o={cursor:r?\"ns-resize\":\"ew-resize\"},a=e.navigatorGroup??(e.navigatorGroup=n.g(\"navigator\").attr({zIndex:8,visibility:\"hidden\"}).add());if([!i,i,!i].forEach((i,r)=>{let l=e.shades[r]??(e.shades[r]=n.rect().addClass(\"highcharts-navigator-mask\"+(1===r?\"-inside\":\"-outside\")).add(a));s.styledMode||(l.attr({fill:i?t.maskFill:\"rgba(0,0,0,0)\"}),1===r&&l.css(o))}),e.outline||(e.outline=n.path().addClass(\"highcharts-navigator-outline\").add(a)),s.styledMode||e.outline.attr({\"stroke-width\":t.outlineWidth,stroke:t.outlineColor}),t.handles?.enabled){let i=!1,r=t.handles,{height:l,width:h}=r;[0,1].forEach(t=>{let c=r.symbols[t];(i=i||e.handles[t]?.symbolName!==c)&&(e.handles[t]?.destroy(),e.handles[t]=n.symbol(c,-h/2-1,0,h,l,r),e.handles[t].attr({zIndex:7-t}).addClass(\"highcharts-navigator-handle highcharts-navigator-handle-\"+[\"left\",\"right\"][t]).add(a)),s.inverted&&e.handles[t].attr({rotation:90,rotationOriginX:Math.floor(-h/2),rotationOriginY:(l+h)/2}),s.styledMode||e.handles[t].attr({fill:r.backgroundColor,stroke:r.borderColor,\"stroke-width\":r.lineWidth,width:r.width,height:r.height,x:-h/2-1,y:0}).css(o)}),i&&(e.partsEventsToUnbind?.forEach(e=>{e()}),e.partsEventsToUnbind=[...e.getPartsEvents(\"mousedown\"),...e.getPartsEvents(\"touchstart\")])}}update(e,t=!1){let i=this.chart,s=i.options.chart.inverted!==i.scrollbar?.options.vertical;if(G(!0,i.options.navigator,e),this.navigatorOptions=i.options.navigator||{},this.setOpposite(),S(e.enabled)||s)return this.destroy(),this.navigatorEnabled=e.enabled||this.navigatorEnabled,this.init(i);if(this.navigatorEnabled&&(this.isDirty=!0,!1===e.adaptToUpdatedData&&this.baseSeries.forEach(e=>{X(e,\"updatedData\",this.updatedDataHandler)},this),e.adaptToUpdatedData&&this.baseSeries.forEach(e=>{e.eventsToUnbind.push(A(e,\"updatedData\",this.updatedDataHandler))},this),(e.series||e.baseSeries)&&this.setBaseSeries(void 0,!1),e.height||e.xAxis||e.yAxis)){this.height=e.height??this.height;let t=this.getXAxisOffsets();this.xAxis.update({...e.xAxis,offsets:t,[i.inverted?\"width\":\"height\"]:this.height,[i.inverted?\"height\":\"width\"]:void 0},!1),this.yAxis.update({...e.yAxis,[i.inverted?\"width\":\"height\"]:this.height},!1)}t&&i.redraw()}render(e,t,i,s){let r=this.chart,n=this.xAxis,o=n.pointRange||0,a=n.navigatorAxis.fake?r.xAxis[0]:n,l=this.navigatorEnabled,h=this.rendered,c=r.inverted,d=r.xAxis[0].minRange,u=r.xAxis[0].options.maxRange,p=this.scrollButtonSize,g,m,b,f=this.scrollbarHeight,x,y;if(this.hasDragged&&!S(i))return;if(this.isDirty&&this.renderElements(),e=C(e-o/2),t=C(t+o/2),!H(e)||!H(t))if(!h)return;else i=0,s=W(n.width,a.width);this.left=W(n.left,r.plotLeft+p+(c?r.plotWidth:0));let v=this.size=x=W(n.len,(c?r.plotHeight:r.plotWidth)-2*p);g=c?f:x+2*p,i=W(i,n.toPixels(e,!0)),s=W(s,n.toPixels(t,!0)),H(i)&&Math.abs(i)!==1/0||(i=0,s=g);let w=n.toValue(i,!0),E=n.toValue(s,!0),A=Math.abs(C(E-w));S(d)&&Au&&(this.grabbedLeft?i=n.toPixels(E-u-o,!0):this.grabbedRight&&(s=n.toPixels(w+u+o,!0))),this.zoomedMax=M(Math.max(i,s),0,v),this.zoomedMin=M(this.fixedWidth?this.zoomedMax-this.fixedWidth:Math.min(i,s),0,v),this.range=this.zoomedMax-this.zoomedMin,v=Math.round(this.zoomedMax);let T=Math.round(this.zoomedMin);l&&(this.navigatorGroup.attr({visibility:\"inherit\"}),y=h&&!this.hasDragged?\"animate\":\"attr\",this.drawMasks(T,v,c,y),this.drawOutline(T,v,c,y),this.navigatorOptions.handles?.enabled&&(this.drawHandle(T,0,c,y),this.drawHandle(v,1,c,y))),this.scrollbar&&(c?(b=this.top-p,m=this.left-f+(l||!a.opposite?0:(a.titleOffset||0)+a.axisTitleMargin),f=x+2*p):(b=this.top+(l?this.height:-f),m=this.left-p),this.scrollbar.position(m,b,g,f),this.scrollbar.setRange(this.zoomedMin/(x||1),this.zoomedMax/(x||1))),this.rendered=!0,this.isDirty=!1,I(this,\"afterRender\")}addMouseEvents(){let e,t,i=this,s=i.chart,r=s.container,n=[];i.mouseMoveHandler=e=function(e){i.onMouseMove(e)},i.mouseUpHandler=t=function(e){i.onMouseUp(e)},n.push(A(s.renderTo,\"mousemove\",e),A(r.ownerDocument,\"mouseup\",t),A(s.renderTo,\"touchmove\",e),A(r.ownerDocument,\"touchend\",t)),i.eventsToUnbind=n,i.series&&i.series[0]&&n.push(A(i.series[0].xAxis,\"foundExtremes\",function(){s.navigator?.modifyNavigatorAxisExtremes()}))}getPartsEvents(e){let t=this,i=[];return[\"shades\",\"handles\"].forEach(s=>{t[s].forEach(function(r,n){i.push(A(r.element,e,function(e){t[`${s}Mousedown`](e,n)}))})}),i}shadesMousedown(e,t){e=this.chart.pointer?.normalize(e)||e;let i=this.chart,s=this.xAxis,r=this.zoomedMin,n=this.size,o=this.range,a=this.left,l=e.chartX,h,c,d,u;i.inverted&&(l=e.chartY,a=this.top),1===t?(this.grabbedCenter=l,this.fixedWidth=o,this.dragOffset=l-r):(u=l-a-o/2,0===t?u=Math.max(0,u):2===t&&u+o>=n&&(u=n-o,this.reversedExtremes?(u-=o,c=this.getUnionExtremes()?.dataMin):h=this.getUnionExtremes()?.dataMax),u!==r&&(this.fixedWidth=o,S((d=s.navigatorAxis.toFixedRange(u,u+o,c,h)).min)&&I(this,\"setRange\",{min:Math.min(d.min,d.max),max:Math.max(d.min,d.max),redraw:!0,eventArguments:{trigger:\"navigator\"}})))}handlesMousedown(e,t){e=this.chart.pointer?.normalize(e)||e;let i=this.chart,s=i.xAxis[0],r=this.reversedExtremes;0===t?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=r?s.min:s.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=r?s.max:s.min),i.setFixedRange(void 0)}onMouseMove(e){let t=this,i=t.chart,s=t.navigatorSize,r=t.range,n=t.dragOffset,o=i.inverted,a=t.left,l;(!e.touches||0!==e.touches[0].pageX)&&(l=(e=i.pointer?.normalize(e)||e).chartX,o&&(a=t.top,l=e.chartY),t.grabbedLeft?(t.hasDragged=!0,t.render(0,0,l-a,t.otherHandlePos)):t.grabbedRight?(t.hasDragged=!0,t.render(0,0,t.otherHandlePos,l-a)):t.grabbedCenter&&n&&(t.hasDragged=!0,ls+n-r&&(l=s+n-r),t.render(0,0,l-n,l-n+r)),t.hasDragged&&W(t.scrollbarOptions?.liveRedraw,!t2&&!this.chart.boosted)&&(e.DOMType=e.type,setTimeout(function(){t.onMouseUp(e)},0)))}onMouseUp(e){let t,i,s,r,n,o,a=this.chart,l=this.xAxis,h=this.scrollbar,c=e.DOMEvent||e,d=a.inverted,u=this.rendered&&!this.hasDragged?\"animate\":\"attr\";(this.hasDragged&&(!h||!h.hasDragged)||\"scrollbar\"===e.trigger)&&(s=this.getUnionExtremes(),this.zoomedMin===this.otherHandlePos?r=this.fixedExtreme:this.zoomedMax===this.otherHandlePos&&(n=this.fixedExtreme),this.zoomedMax===this.size&&(n=this.reversedExtremes?s.dataMin:s.dataMax),0===this.zoomedMin&&(r=this.reversedExtremes?s.dataMax:s.dataMin),S((o=l.navigatorAxis.toFixedRange(this.zoomedMin,this.zoomedMax,r,n)).min)&&I(this,\"setRange\",{min:Math.min(o.min,o.max),max:Math.max(o.min,o.max),redraw:!0,animation:!this.hasDragged&&null,eventArguments:{trigger:\"navigator\",triggerOp:\"navigator-drag\",DOMEvent:c}})),\"mousemove\"!==e.DOMType&&\"touchmove\"!==e.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null),this.navigatorEnabled&&H(this.zoomedMin)&&H(this.zoomedMax)&&(i=Math.round(this.zoomedMin),t=Math.round(this.zoomedMax),this.shades&&this.drawMasks(i,t,d,u),this.outline&&this.drawOutline(i,t,d,u),this.navigatorOptions.handles?.enabled&&Object.keys(this.handles).length===this.handles.length&&(this.drawHandle(i,0,d,u),this.drawHandle(t,1,d,u)))}removeEvents(){this.eventsToUnbind?.forEach(e=>{e()}),this.eventsToUnbind=void 0,this.removeBaseSeriesEvents()}removeBaseSeriesEvents(){let e=this.baseSeries||[];this.navigatorEnabled&&e[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&&e.forEach(function(e){X(e,\"updatedData\",this.updatedDataHandler)},this),e[0].xAxis&&X(e[0].xAxis,\"foundExtremes\",this.modifyBaseAxisExtremes))}getXAxisOffsets(){return this.chart.inverted?[this.scrollButtonSize,0,-this.scrollButtonSize,0]:[0,-this.scrollButtonSize,0,this.scrollButtonSize]}init(e){let t=e.options,i=t.navigator||{},s=i.enabled,r=t.scrollbar||{},n=r.enabled,o=s&&i.height||0,a=n&&r.height||0,l=r.buttonsEnabled&&a||0;this.handles=[],this.shades=[],this.chart=e,this.setBaseSeries(),this.height=o,this.scrollbarHeight=a,this.scrollButtonSize=l,this.scrollbarEnabled=n,this.navigatorEnabled=!!s,this.navigatorOptions=i,this.scrollbarOptions=r,this.setOpposite();let h=this,c=h.baseSeries,d=e.xAxis.length,u=e.yAxis.length,p=c&&c[0]&&c[0].xAxis||e.xAxis[0]||{options:{}};if(e.isDirtyBox=!0,h.navigatorEnabled){let t=this.getXAxisOffsets();h.xAxis=new(tx())(e,G({breaks:p.options.breaks,ordinal:p.options.ordinal,overscroll:p.options.overscroll},i.xAxis,{type:\"datetime\",yAxis:i.yAxis?.id,index:d,isInternal:!0,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:p.options.ordinal?0:p.options.minPadding,maxPadding:p.options.ordinal?0:p.options.maxPadding,zoomEnabled:!1},e.inverted?{offsets:t,width:o}:{offsets:t,height:o}),\"xAxis\"),h.yAxis=new(tx())(e,G(i.yAxis,{alignTicks:!1,offset:0,index:u,isInternal:!0,reversed:W(i.yAxis&&i.yAxis.reversed,e.yAxis[0]&&e.yAxis[0].reversed,!1),zoomEnabled:!1},e.inverted?{width:o}:{height:o}),\"yAxis\"),c||i.series?.data?h.updateNavigatorSeries(!1):0===e.series.length&&(h.unbindRedraw=A(e,\"beforeRedraw\",function(){e.series.length>0&&!h.series&&(h.setBaseSeries(),h.unbindRedraw?.())})),h.reversedExtremes=e.inverted&&!h.xAxis.reversed||!e.inverted&&h.xAxis.reversed,h.renderElements(),h.addMouseEvents()}else h.xAxis={chart:e,navigatorAxis:{fake:!0},translate:function(t,i){let s=e.xAxis[0],r=s.getExtremes(),n=s.len-2*l,o=t3(\"min\",s.options.min,r.dataMin),a=t3(\"max\",s.options.max,r.dataMax)-o;return i?t*a/n+o:n*(t-o)/a},toPixels:function(e){return this.translate(e)},toValue:function(e){return this.translate(e,!0)}},h.xAxis.navigatorAxis.axis=h.xAxis,h.xAxis.navigatorAxis.toFixedRange=tB.prototype.toFixedRange.bind(h.xAxis.navigatorAxis);if(e.options.scrollbar?.enabled){let t=G(e.options.scrollbar,{vertical:e.inverted});H(t.margin)||(t.margin=e.inverted?-3:3),e.scrollbar=h.scrollbar=new t0(e.renderer,t,e),A(h.scrollbar,\"changed\",function(e){let t=h.size,i=t*this.to,s=t*this.from;h.hasDragged=h.scrollbar?.hasDragged,h.render(0,0,s,i),this.shouldUpdateExtremes(e.DOMType)&&setTimeout(function(){h.onMouseUp(e)})})}h.addBaseSeriesEvents(),h.addChartEvents()}setOpposite(){let e=this.navigatorOptions,t=this.navigatorEnabled,i=this.chart;this.opposite=W(e.opposite,!!(!t&&i.inverted))}getUnionExtremes(e){let t,i=this.chart.xAxis[0],s=this.chart.time,r=this.xAxis,n=r.options,o=i.options;return e&&null===i.dataMin||(t={dataMin:W(s.parse(n?.min),t3(\"min\",s.parse(o.min),i.dataMin,r.dataMin,r.min)),dataMax:W(s.parse(n?.max),t3(\"max\",s.parse(o.max),i.dataMax,r.dataMax,r.max))}),t}setBaseSeries(e,t){let i=this.chart,s=this.baseSeries=[];e=e||i.options.navigator?.baseSeries||(i.series.length?O(i.series,e=>!e.options.isInternal).index:0),(i.series||[]).forEach((t,i)=>{!t.options.isInternal&&(t.options.showInNavigator||(i===e||t.options.id===e)&&!1!==t.options.showInNavigator)&&s.push(t)}),this.xAxis&&!this.xAxis.navigatorAxis.fake&&this.updateNavigatorSeries(!0,t)}updateNavigatorSeries(e,t){let i=this,s=i.chart,r=i.baseSeries,n={enableMouseTracking:!1,index:null,linkedTo:null,group:\"nav\",padXAxis:!1,xAxis:this.navigatorOptions.xAxis?.id,yAxis:this.navigatorOptions.yAxis?.id,showInLegend:!1,stacking:void 0,isInternal:!0,states:{inactive:{opacity:1}}},o=i.series=(i.series||[]).filter(e=>{let t=e.baseSeries;return!(t&&0>r.indexOf(t))||(t&&(X(t,\"updatedData\",i.updatedDataHandler),delete t.navigatorSeries),e.chart&&e.destroy(),!1)}),a,l,h=i.navigatorOptions.series,c;if(r&&r.length&&r.forEach(e=>{var d;let u=e.navigatorSeries,p=B({color:e.color,visible:e.visible},q(h)?t1.navigator.series:h);if(u&&!1===i.navigatorOptions.adaptToUpdatedData)return;n.name=\"Navigator \"+r.length,c=(a=e.options||{}).navigatorOptions||{},p.dataLabels=q(d=p.dataLabels)?d:[d],(l=G(a,n,p,c)).pointRange=W(p.pointRange,c.pointRange,t1.plotOptions[l.type||\"line\"]?.pointRange);let g=c.data||p.data;i.hasNavigatorData=i.hasNavigatorData||!!g,l.data=g||a.data?.slice(0),u&&u.options?u.update(l,t):(e.navigatorSeries=s.initSeries(l),s.setSortedData(),e.navigatorSeries.baseSeries=e,o.push(e.navigatorSeries))}),h?.data&&!(r&&r.length)||q(h)){var d;i.hasNavigatorData=!1,(h=q(d=h)?d:[d]).forEach((e,t)=>{n.name=\"Navigator \"+(o.length+1),(l=G(t1.navigator?.series,{color:s.series[t]&&!s.series[t].options.isInternal&&s.series[t].color||s.options.colors?.[t]||s.options.colors?.[0]},n,e)).data=e.data,l.data&&(i.hasNavigatorData=!0,o.push(s.initSeries(l)))})}e&&this.addBaseSeriesEvents()}addBaseSeriesEvents(){let e=this,t=e.baseSeries||[];t[0]&&t[0].xAxis&&t[0].eventsToUnbind.push(A(t[0].xAxis,\"foundExtremes\",this.modifyBaseAxisExtremes)),t.forEach(i=>{i.eventsToUnbind.push(A(i,\"show\",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!0,!1)})),i.eventsToUnbind.push(A(i,\"hide\",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!1,!1)})),!1!==this.navigatorOptions.adaptToUpdatedData&&i.xAxis&&i.eventsToUnbind.push(A(i,\"updatedData\",this.updatedDataHandler)),i.eventsToUnbind.push(A(i,\"remove\",function(){t&&N(t,i),this.navigatorSeries&&e.series&&(N(e.series,this.navigatorSeries),S(this.navigatorSeries.options)&&this.navigatorSeries.remove(!1),delete this.navigatorSeries)}))})}getBaseSeriesMin(e){return this.baseSeries.reduce(function(e,t){return Math.min(e,t.getColumn(\"x\")[0]??e)},e)}modifyNavigatorAxisExtremes(){let e=this.xAxis;if(void 0!==e.getExtremes){let t=this.getUnionExtremes(!0);t&&(t.dataMin!==e.min||t.dataMax!==e.max)&&(e.min=t.dataMin,e.max=t.dataMax)}}modifyBaseAxisExtremes(){let e,t,i=this.chart.navigator,s=this.getExtremes(),r=s.min,n=s.max,o=s.dataMin,a=s.dataMax,l=n-r,h=i?.stickToMin,c=i?.stickToMax,d=W(this.ordinal?.convertOverscroll(this.options.overscroll),0),u=i.series&&i.series[0],p=!!this.setExtremes;!(this.eventArgs&&\"rangeSelectorButton\"===this.eventArgs.trigger)&&(h&&(e=(t=o)+l),c&&(e=a+d,h||(t=Math.max(o,e-l,i.getBaseSeriesMin(u&&u.xData?u.xData[0]:-Number.MAX_VALUE)))),p&&(h||c)&&H(t)&&(this.min=this.userMin=t,this.max=this.userMax=e)),i.stickToMin=i.stickToMax=null}updatedDataHandler(){let e=this.chart.navigator,t=this.navigatorSeries,i=e.reversedExtremes?0===Math.round(e.zoomedMin):Math.round(e.zoomedMax)>=Math.round(e.size);e.stickToMax=W(this.chart.options.navigator&&this.chart.options.navigator.stickToMax,i),e.stickToMin=e.shouldStickToMin(this,e),t&&!e.hasNavigatorData&&(t.options.pointStart=this.getColumn(\"x\")[0],t.setData(this.options.data,!1,void 0,!1))}shouldStickToMin(e,t){let i=t.getBaseSeriesMin(e.getColumn(\"x\")[0]),s=e.xAxis,r=s.max,n=s.min,o=s.options.range;return!!(H(r)&&H(n))&&(o&&r-i>0?r-i{e.destroy&&e.destroy()}),[\"series\",\"xAxis\",\"yAxis\",\"shades\",\"outline\",\"scrollbarTrack\",\"scrollbarRifles\",\"scrollbarGroup\",\"scrollbar\",\"navigatorGroup\",\"rendered\"].forEach(e=>{this[e]&&this[e].destroy&&this[e].destroy(),this[e]=null}),[this.handles].forEach(e=>{D(e)}),this.baseSeries.forEach(e=>{e.navigatorSeries=void 0}),this.navigatorEnabled=!1}}let{animObject:t4}=v(),{format:t6}=et(),{getFakeMouseEvent:t9}=J,{getAxisRangeDescription:t8,fireEventOnWrappedOrUnwrappedElement:t7}=ed,ie=class extends ex{init(){let e=this.chart,t=this;this.announcer=new eN(e,\"polite\"),this.addEvent(t5,\"afterRender\",function(){this.chart===t.chart&&this.chart.renderer&&j(()=>{t.proxyProvider.updateGroupProxyElementPositions(\"navigator\"),t.updateHandleValues()},t4(W(this.chart.renderer.globalAnimation,!0)).duration)})}onChartUpdate(){let e=this.chart,t=e.options,i=t.navigator;if(i.enabled&&i.accessibility?.enabled){let i=t.accessibility.landmarkVerbosity,s=t.lang.accessibility?.navigator.groupLabel;this.proxyProvider.removeGroup(\"navigator\"),this.proxyProvider.addGroup(\"navigator\",\"div\",{role:\"all\"===i?\"region\":\"group\",\"aria-label\":t6(s,{chart:e},e)});let r=t.lang.accessibility?.navigator.handleLabel;[0,1].forEach(t=>{let i=this.getHandleByIx(t);if(i){let s=this.proxyProvider.addProxyElement(\"navigator\",{click:i},\"input\",{type:\"range\",\"aria-label\":t6(r,{handleIx:t,chart:e},e)});this[t?\"maxHandleProxy\":\"minHandleProxy\"]=s.innerElement,s.innerElement.style.pointerEvents=\"none\",s.innerElement.oninput=()=>this.updateNavigator()}}),this.updateHandleValues()}else this.proxyProvider.removeGroup(\"navigator\")}getNavigatorHandleNavigation(e){let t=this,i=this.chart,s=e?this.maxHandleProxy:this.minHandleProxy,r=this.keyCodes;return new ey(i,{keyCodeMap:[[[r.left,r.right,r.up,r.down],function(n){if(s){let o=n===r.left||n===r.up?-1:1;s.value=\"\"+M(parseFloat(s.value)+o,0,100),t.updateNavigator(()=>{let r=t.getHandleByIx(e);r&&i.setFocusToElement(r,s)})}return this.response.success}]],init:()=>{i.setFocusToElement(this.getHandleByIx(e),s)},validate:()=>!!(this.getHandleByIx(e)&&s&&i.options.navigator.accessibility?.enabled)})}getKeyboardNavigation(){return[this.getNavigatorHandleNavigation(0),this.getNavigatorHandleNavigation(1)]}destroy(){this.updateNavigatorThrottleTimer&&R(this.updateNavigatorThrottleTimer),this.proxyProvider.removeGroup(\"navigator\"),this.announcer&&this.announcer.destroy()}updateHandleValues(){let e=this.chart.navigator;if(e&&this.minHandleProxy&&this.maxHandleProxy){let t=e.size;this.minHandleProxy.value=\"\"+Math.round(e.zoomedMin/t*100),this.maxHandleProxy.value=\"\"+Math.round(e.zoomedMax/t*100)}}getHandleByIx(e){let t=this.chart.navigator;return t&&t.handles&&t.handles[e]}updateNavigator(e){let t=e=>{let t=this.chart,{navigator:i,pointer:s}=t,r=this.chart.accessibility?.keyboardNavigation;if(i&&s&&this.minHandleProxy&&this.maxHandleProxy){let n=s.getChartPosition(),o=parseFloat(this.minHandleProxy.value)/100*i.size,a=parseFloat(this.maxHandleProxy.value)/100*i.size;[[0,\"mousedown\",i.zoomedMin],[0,\"mousemove\",o],[0,\"mouseup\",o],[1,\"mousedown\",i.zoomedMax],[1,\"mousemove\",a],[1,\"mouseup\",a]].forEach(([e,t,s])=>{let r=this.getHandleByIx(e)?.element;r&&t7(r,t9(t,{x:n.left+i.left+s,y:n.top+i.top},r))}),r&&(r.keyboardReset=!1),e&&e();let l=t.options.lang.accessibility?.navigator.changeAnnouncement,h=t8(t.xAxis[0]);this.announcer.announce(t6(l,{axisRangeDescription:h,chart:t},t))}};this.updateNavigatorThrottleTimer&&R(this.updateNavigatorThrottleTimer),this.updateNavigatorThrottleTimer=setTimeout(t.bind(this,e),20)}},{getPointAnnotationTexts:it}=eH,{getAxisDescription:ii,getSeriesFirstPointElement:is,getSeriesA11yElement:ir,unhideChartElementFromAT:io}=ed,{format:ia,numberFormat:il}=et(),{reverseChildNodes:ih,stripHTMLTagsFromString:ic}=J;function id(e){let t=e.chart.options.accessibility.series.pointDescriptionEnabledThreshold;return!!(!1!==t&&e.points&&e.points.length>=+t)}function iu(e,t){let i=e.series,s=i.chart,r=s.options.accessibility.point||{},n=i.options.accessibility&&i.options.accessibility.point||{},o=i.tooltipOptions||{},a=s.options.lang;return H(t)?il(t,n.valueDecimals||r.valueDecimals||o.valueDecimals||-1,a.decimalPoint,a.accessibility.thousandsSep||a.thousandsSep):t}function ip(e,t){let i=e[t];return e.chart.langFormat(\"accessibility.series.\"+t+\"Description\",{name:ii(i),series:e})}function ig(e){let t,i,s,r,n,o,a,l,h,c,d,u,p=e.series,g=p.chart.series.length>1||p.options.name,m=(o=(n=e.series).chart,l=(a=n.options.accessibility)&&a.point&&a.point.valueDescriptionFormat||o.options.accessibility.point.valueDescriptionFormat,c=(h=W(n.xAxis&&n.xAxis.options.accessibility&&n.xAxis.options.accessibility.enabled,!o.angular&&\"flowmap\"!==n.type))?(t=function(e){let t=e.series,i=t.chart,s=t.options.accessibility&&t.options.accessibility.point||{},r=i.options.accessibility.point||{},n=t.xAxis&&t.xAxis.dateTime;if(n){let t=n.getXDateFormat(e.x||0,i.options.tooltip.dateTimeLabelFormats),o=s.dateFormatter&&s.dateFormatter(e)||r.dateFormatter?.(e)||s.dateFormat||r.dateFormat||t;return i.time.dateFormat(o,e.x||0,void 0)}}(e),i=(e.series.xAxis||{}).categories&&S(e.category)&&(\"\"+e.category).replace(\"
    \",\" \"),s=S(e.id)&&0>(\"\"+e.id).indexOf(\"highcharts-\"),r=\"x, \"+e.x,e.name||t||i||(s?e.id:r)):\"\",ia(l,{point:e,index:S(e.index)?e.index+1:\"\",xDescription:c,value:function(e){let t=e.series,i=t.chart.options.accessibility.point||{},s=t.chart.options.accessibility&&t.chart.options.accessibility.point||{},r=t.tooltipOptions||{},n=s.valuePrefix||i.valuePrefix||r.valuePrefix||\"\",o=s.valueSuffix||i.valueSuffix||r.valueSuffix||\"\",a=void 0!==e.value?\"value\":\"y\",l=iu(e,e[a]);if(e.isNull)return t.chart.langFormat(\"accessibility.series.nullPointValue\",{point:e});if(t.pointArrayMap){let t,i,s;return t=n||\"\",i=o||\"\",s=function(s){let r=iu(e,W(e[s],e.options[s]));return void 0!==r?s+\": \"+t+r+i:r},e.series.pointArrayMap.reduce(function(e,t){let i=s(t);return i?e+(e.length?\", \":\"\")+i:e},\"\")}return n+l+o}(e),separator:h?\", \":\"\"},o)),b=e.options&&e.options.accessibility&&e.options.accessibility.description,f=g?\" \"+p.name+\".\":\"\",x=(d=e.series.chart,(u=it(e)).length?d.langFormat(\"accessibility.series.pointAnnotationsDescription\",{point:e,annotations:u}):\"\");return e.accessibility=e.accessibility||{},e.accessibility.valueDescription=m,m+(b?\" \"+b:\"\")+f+(x?\" \"+x:\"\")}function im(e){let t,i=e.chart,s=i.types||[],r=(t=(e.options.accessibility||{}).description)&&e.chart.langFormat(\"accessibility.series.description\",{description:t,series:e})||\"\",n=function(t){return i[t]&&i[t].length>1&&e[t]},o=e.index+1,a=ip(e,\"xAxis\"),l=ip(e,\"yAxis\"),h={seriesNumber:o,series:e,chart:i},c=s.length>1?\"Combination\":\"\",d=i.langFormat(\"accessibility.series.summary.\"+e.type+c,h)||i.langFormat(\"accessibility.series.summary.default\"+c,h),u=(n(\"yAxis\")?\" \"+l+\".\":\"\")+(n(\"xAxis\")?\" \"+a+\".\":\"\");return ia(W(e.options.accessibility&&e.options.accessibility.descriptionFormat,i.options.accessibility.series.descriptionFormat,\"\"),{seriesDescription:d,authorDescription:r?\" \"+r:\"\",axisDescription:u,series:e,chart:i,seriesNumber:o},void 0)}let ib={defaultPointDescriptionFormatter:ig,defaultSeriesDescriptionFormatter:im,describeSeries:function(e){let t=e.chart,i=is(e),s=ir(e),r=t.is3d&&t.is3d();if(s){let n,o,a,l,h,c,d,u,p,g,m;if(s.lastChild!==i||r||ih(s),n=e.options.accessibility||{},a=!id(e)&&!n.exposeAsGroupOnly,o=e.chart.options.accessibility.keyboardNavigation.seriesNavigation,l=!!(e.points&&(e.points.length<+o.pointNavigationEnabledThreshold||!1===o.pointNavigationEnabledThreshold)),h=e.chart.options.accessibility.point.describeNull,(a||l)&&e.points.forEach(t=>{let i,s,r,n,o,l=t.graphic&&t.graphic.element||(s=(i=t.series)&&i.chart,r=i&&i.is(\"sunburst\"),n=t.isNull,o=s&&s.options.accessibility.point.describeNull,n&&!r&&o&&function(e){let t,i=e.series,s=function(e){let t=e.index;if(!e.series||!e.series.data||!S(t))return null;let i=e.series.options?.nullInteraction;return O(e.series.data,function(e){return!!(e&&void 0!==e.index&&(i||e.index>t)&&e.graphic&&e.graphic.element)})||null}(e),r=s&&s.graphic,n=r?r.parentGroup:i.graph||i.group,o=s?{x:W(e.plotX,s.plotX,0),y:W(e.plotY,s.plotY,0)}:{x:W(e.plotX,0),y:W(e.plotY,0)},a=((t=e.series.chart.renderer.rect(o.x,o.y,1,1)).attr({class:\"highcharts-a11y-mock-point\",fill:\"none\",opacity:0,\"fill-opacity\":0,\"stroke-opacity\":0}),t);if(n&&n.element)return e.graphic=a,e.hasMockGraphic=!0,a.add(n),n.element.insertBefore(a.element,r?r.element:null),a.element}(t)),c=t.options&&t.options.accessibility&&!1===t.options.accessibility.enabled;if(l){if(t.isNull&&!h)return void l.setAttribute(\"aria-hidden\",!0);if(l.setAttribute(\"tabindex\",\"-1\"),e.chart.styledMode||(l.style.outline=\"none\"),a&&!c){let e,i,s,r;e=t.series,i=e.options.accessibility?.point||{},s=e.chart.options.accessibility.point||{},r=ic(z(i.descriptionFormat)&&ia(i.descriptionFormat,t,e.chart)||i.descriptionFormatter?.(t)||z(s.descriptionFormat)&&ia(s.descriptionFormat,t,e.chart)||s.descriptionFormatter?.(t)||ig(t),e.chart.renderer.forExport),l.setAttribute(\"role\",\"img\"),l.setAttribute(\"aria-label\",r)}else l.setAttribute(\"aria-hidden\",!0)}}),io(t,s),u=(d=(c=e.chart).options.chart).options3d&&d.options3d.enabled,p=c.series.length>1,g=c.options.accessibility.series.describeSingleSeries,m=(e.options.accessibility||{}).exposeAsGroupOnly,!(u&&p)&&(p||g||m||id(e))){let t,i,r;t=e.options.accessibility||{},r=(i=e.chart.options.accessibility).landmarkVerbosity,t.exposeAsGroupOnly?s.setAttribute(\"role\",\"img\"):\"all\"===r?s.setAttribute(\"role\",\"region\"):s.setAttribute(\"role\",\"group\"),s.setAttribute(\"tabindex\",\"-1\"),e.chart.styledMode||(s.style.outline=\"none\"),s.setAttribute(\"aria-label\",ic(i.series.descriptionFormatter&&i.series.descriptionFormatter(e)||im(e),e.chart.renderer.forExport))}else s.removeAttribute(\"aria-label\")}}},{composed:ix}=v(),{getChartTitle:iy}=ed,{defaultPointDescriptionFormatter:iv,defaultSeriesDescriptionFormatter:iw}=ib;function iE(e){return!!e.options.accessibility.announceNewData.enabled}class iA{constructor(e){this.dirty={allSeries:{}},this.lastAnnouncementTime=0,this.chart=e}init(){let e=this.chart,t=e.options.accessibility.announceNewData.interruptUser?\"assertive\":\"polite\";this.lastAnnouncementTime=0,this.dirty={allSeries:{}},this.eventProvider=new em,this.announcer=new eN(e,t),this.addEventListeners()}destroy(){this.eventProvider.removeAddedEvents(),this.announcer.destroy()}addEventListeners(){let e=this,t=this.chart,i=this.eventProvider;i.addEvent(t,\"afterApplyDrilldown\",function(){e.lastAnnouncementTime=0}),i.addEvent(t,\"afterAddSeries\",function(t){e.onSeriesAdded(t.series)}),i.addEvent(t,\"redraw\",function(){e.announceDirtyData()})}onSeriesAdded(e){iE(this.chart)&&(this.dirty.hasDirty=!0,this.dirty.allSeries[e.name+e.index]=e,this.dirty.newSeries=S(this.dirty.newSeries)?void 0:e)}announceDirtyData(){let e=this.chart,t=this;if(e.options.accessibility.announceNewData&&this.dirty.hasDirty){var i;let e,s=this.dirty.newPoint;s&&(s=1===(e=(i=s).series.data.filter(e=>i.x===e.x&&i.y===e.y)).length?e[0]:i),this.queueAnnouncement(Object.keys(this.dirty.allSeries).map(e=>t.dirty.allSeries[e]),this.dirty.newSeries,s),this.dirty={allSeries:{}}}}queueAnnouncement(e,t,i){let s=this.chart.options.accessibility.announceNewData;if(s.enabled){var r;let n,o=+new Date,a=o-this.lastAnnouncementTime,l=Math.max(0,s.minAnnounceInterval-a),h=(r=this.queuedAnnouncement&&this.queuedAnnouncement.series,Object.keys(n=(r||[]).concat(e||[]).reduce((e,t)=>(e[t.name+t.index]=t,e),{})).map(e=>n[e])),c=this.buildAnnouncementMessage(h,t,i);c&&(this.queuedAnnouncement&&R(this.queuedAnnouncementTimer),this.queuedAnnouncement={time:o,message:c,series:h},this.queuedAnnouncementTimer=setTimeout(()=>{this&&this.announcer&&(this.lastAnnouncementTime=+new Date,this.announcer.announce(this.queuedAnnouncement.message),delete this.queuedAnnouncement,delete this.queuedAnnouncementTimer)},l))}}buildAnnouncementMessage(e,t,i){let s=this.chart,r=s.options.accessibility.announceNewData;if(r.announcementFormatter){let s=r.announcementFormatter(e,t,i,this);if(!1!==s)return s.length?s:null}let n=v().charts&&v().charts.length>1?\"Multiple\":\"Single\",o=t?\"newSeriesAnnounce\"+n:i?\"newPointAnnounce\"+n:\"newDataAnnounce\",a=iy(s);return s.langFormat(\"accessibility.announceNewData.\"+o,{chartTitle:a,seriesDesc:t?iw(t):null,pointDesc:i?iv(i):null,point:i,series:t})}}function iT(e){let t=this.chart,i=t.accessibility?.components.series.newDataAnnouncer;i&&i.chart===t&&iE(t)&&(i.dirty.newPoint=S(i.dirty.newPoint)?void 0:e.point)}function iM(){let e=this.chart,t=e.accessibility?.components.series.newDataAnnouncer;t&&t.chart===e&&iE(e)&&(t.dirty.hasDirty=!0,t.dirty.allSeries[this.name+this.index]=this)}(iA||(iA={})).compose=function(e){V(ix,\"A11y.NDA\")&&(A(e,\"addPoint\",iT),A(e,\"updatedData\",iM))};let iC=iA,{doc:ik,win:iP}=v(),{fireEventOnWrappedOrUnwrappedElement:iS}=ed,{cloneMouseEvent:iD,cloneTouchEvent:iN,getFakeMouseEvent:iB,removeElement:iI}=J,iF=class{constructor(e,t,i=\"button\",s,r){this.chart=e,this.target=t,this.eventProvider=new em;const n=this.innerElement=ik.createElement(i),o=this.element=s?ik.createElement(s):n;e.styledMode||this.hideElementVisually(n),s&&(\"li\"!==s||e.styledMode||(o.style.listStyle=\"none\"),o.appendChild(n),this.element=o),this.updateTarget(t,r)}click(){let e=this.getTargetPosition();e.x+=e.width/2,e.y+=e.height/2;let t=iB(\"click\",e);iS(this.target.click,t)}updateTarget(e,t){this.target=e,this.updateCSSClassName();let i=t||{};Object.keys(i).forEach(e=>{null===i[e]&&delete i[e]});let s=this.getTargetAttr(e.click,\"aria-label\");T(this.innerElement,G(s?{\"aria-label\":s}:{},i)),this.eventProvider.removeAddedEvents(),this.addProxyEventsToElement(this.innerElement,e.click),this.refreshPosition()}refreshPosition(){let e=this.getTargetPosition();P(this.innerElement,{width:(e.width||1)+\"px\",height:(e.height||1)+\"px\",left:(Math.round(e.x)||0)+\"px\",top:(Math.round(e.y)||0)+\"px\"})}remove(){this.eventProvider.removeAddedEvents(),iI(this.element)}updateCSSClassName(){let e=e=>e.indexOf(\"highcharts-no-tooltip\")>-1,t=e(this.chart.legend?.group?.div?.className||\"\"),i=e(this.getTargetAttr(this.target.click,\"class\")||\"\");this.innerElement.className=t||i?\"highcharts-a11y-proxy-element highcharts-no-tooltip\":\"highcharts-a11y-proxy-element\"}addProxyEventsToElement(e,t){[\"click\",\"touchstart\",\"touchend\",\"touchcancel\",\"touchmove\",\"mouseover\",\"mouseenter\",\"mouseleave\",\"mouseout\"].forEach(i=>{let s=0===i.indexOf(\"touch\");this.eventProvider.addEvent(e,i,e=>{let i=s?iN(e):iD(e);t&&iS(t,i),e.stopPropagation(),s||e.preventDefault()},{passive:!1})})}hideElementVisually(e){P(e,{borderWidth:0,backgroundColor:\"transparent\",cursor:\"pointer\",outline:\"none\",opacity:.001,filter:\"alpha(opacity=1)\",zIndex:999,overflow:\"hidden\",padding:0,margin:0,display:\"block\",position:\"absolute\",\"-ms-filter\":\"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)\"})}getTargetPosition(){let e=this.target.click,t=e.element?e.element:e,i=this.target.visual||t,s=this.chart.renderTo,r=this.chart.pointer;if(s&&i?.getBoundingClientRect&&r){let e=iP.scrollY||ik.documentElement.scrollTop,t=i.getBoundingClientRect(),s=r.getChartPosition();return{x:(t.left-s.left)/s.scaleX,y:(t.top+e-s.top)/s.scaleY,width:t.right/s.scaleX-t.left/s.scaleX,height:t.bottom/s.scaleY-t.top/s.scaleY}}return{x:0,y:0,width:1,height:1}}getTargetAttr(e,t){return e.element?e.element.getAttribute(t):e.getAttribute(t)}},{doc:iO}=v(),{unhideChartElementFromAT:iR}=ed,{removeChildNodes:iL}=J,iH=class{constructor(e){this.chart=e,this.domElementProvider=new eg,this.groups={},this.groupOrder=[],this.beforeChartProxyPosContainer=this.createProxyPosContainer(\"before\"),this.afterChartProxyPosContainer=this.createProxyPosContainer(\"after\"),this.update()}addProxyElement(e,t,i=\"button\",s){let r=this.groups[e];if(!r)throw Error(\"ProxyProvider.addProxyElement: Invalid group key \"+e);let n=\"ul\"===r.type||\"ol\"===r.type?\"li\":void 0,o=new iF(this.chart,t,i,n,s);return r.proxyContainerElement.appendChild(o.element),r.proxyElements.push(o),o}addGroup(e,t=\"div\",i){let s,r=this.groups[e];if(r)return r.groupElement;let n=this.domElementProvider.createElement(t);return i&&i.role&&\"div\"!==t?(s=this.domElementProvider.createElement(\"div\")).appendChild(n):s=n,s.className=\"highcharts-a11y-proxy-group highcharts-a11y-proxy-group-\"+e.replace(/\\W/g,\"-\"),this.groups[e]={proxyContainerElement:n,groupElement:s,type:t,proxyElements:[]},T(s,i||{}),\"ul\"===t&&n.setAttribute(\"role\",\"list\"),this.afterChartProxyPosContainer.appendChild(s),this.updateGroupOrder(this.groupOrder),s}updateGroupAttrs(e,t){let i=this.groups[e];if(!i)throw Error(\"ProxyProvider.updateGroupAttrs: Invalid group key \"+e);T(i.groupElement,t)}updateGroupOrder(e){if(this.groupOrder=e.slice(),this.isDOMOrderGroupOrder())return;let t=e.indexOf(\"series\"),i=t>-1?e.slice(0,t):e,s=t>-1?e.slice(t+1):[],r=iO.activeElement;[\"before\",\"after\"].forEach(e=>{let t=this[\"before\"===e?\"beforeChartProxyPosContainer\":\"afterChartProxyPosContainer\"];iL(t),(\"before\"===e?i:s).forEach(e=>{let i=this.groups[e];i&&t.appendChild(i.groupElement)})}),(this.beforeChartProxyPosContainer.contains(r)||this.afterChartProxyPosContainer.contains(r))&&r&&r.focus&&r.focus()}clearGroup(e){let t=this.groups[e];if(!t)throw Error(\"ProxyProvider.clearGroup: Invalid group key \"+e);iL(t.proxyContainerElement)}removeGroup(e){let t=this.groups[e];t&&(this.domElementProvider.removeElement(t.groupElement),t.groupElement!==t.proxyContainerElement&&this.domElementProvider.removeElement(t.proxyContainerElement),delete this.groups[e])}update(){this.updatePosContainerPositions(),this.updateGroupOrder(this.groupOrder),this.updateProxyElementPositions()}updateProxyElementPositions(){Object.keys(this.groups).forEach(this.updateGroupProxyElementPositions.bind(this))}updateGroupProxyElementPositions(e){let t=this.groups[e];t&&t.proxyElements.forEach(e=>e.refreshPosition())}destroy(){this.domElementProvider.destroyCreatedElements()}createProxyPosContainer(e){let t=this.domElementProvider.createElement(\"div\");return t.setAttribute(\"aria-hidden\",\"false\"),t.className=\"highcharts-a11y-proxy-container\"+(e?\"-\"+e:\"\"),P(t,{top:\"0\",left:\"0\"}),this.chart.styledMode||(t.style.whiteSpace=\"nowrap\",t.style.position=\"absolute\"),t}getCurrentGroupOrderInDOM(){let e=e=>{let t=Object.keys(this.groups),i=t.length;for(;i--;){let s=t[i],r=this.groups[s];if(r&&e===r.groupElement)return s}},t=t=>{let i=[],s=t.children;for(let t=0;t\"series\"===e||!!this.groups[e]),i=e.length;if(i!==t.length)return!1;for(;i--;)if(e[i]!==t[i])return!1;return!0}updatePosContainerPositions(){let e=this.chart;if(e.renderer.forExport)return;let t=e.renderer.box;e.container.insertBefore(this.afterChartProxyPosContainer,t.nextSibling),e.container.insertBefore(this.beforeChartProxyPosContainer,t),iR(this.chart,this.afterChartProxyPosContainer),iR(this.chart,this.beforeChartProxyPosContainer)}},{unhideChartElementFromAT:iz,getAxisRangeDescription:iq}=ed;class iK extends ex{init(){let e=this.chart;this.announcer=new eN(e,\"polite\")}onChartUpdate(){let e=this.chart,t=this,i=e.rangeSelector;i&&(this.updateSelectorVisibility(),this.setDropdownAttrs(),i.buttons&&i.buttons.length&&i.buttons.forEach(e=>{t.setRangeButtonAttrs(e)}),i.maxInput&&i.minInput&&[\"minInput\",\"maxInput\"].forEach(function(s,r){let n=i[s];n&&(iz(e,n),t.setRangeInputAttrs(n,\"accessibility.rangeSelector.\"+(r?\"max\":\"min\")+\"InputLabel\"))}))}updateSelectorVisibility(){let e=this.chart,t=e.rangeSelector,i=t&&t.dropdown,s=t&&t.buttons||[];t&&t.hasVisibleDropdown&&i?(iz(e,i),s.forEach(e=>e.element.setAttribute(\"aria-hidden\",!0))):(i&&i.setAttribute(\"aria-hidden\",!0),s.forEach(t=>iz(e,t.element)))}setDropdownAttrs(){let e=this.chart,t=e.rangeSelector&&e.rangeSelector.dropdown;if(t){let i=e.langFormat(\"accessibility.rangeSelector.dropdownLabel\",{rangeTitle:e.options.lang.rangeSelectorZoom});t.setAttribute(\"aria-label\",i),t.setAttribute(\"tabindex\",-1)}}setRangeButtonAttrs(e){T(e.element,{tabindex:-1,role:\"button\"})}setRangeInputAttrs(e,t){let i=this.chart;T(e,{tabindex:-1,\"aria-label\":i.langFormat(t,{chart:i})})}onButtonNavKbdArrowKey(e,t){let i=e.response,s=this.keyCodes,r=this.chart,n=r.options.accessibility.keyboardNavigation.wrapAround,o=t===s.left||t===s.up?-1:1;return r.highlightRangeSelectorButton(r.highlightedRangeSelectorItemIx+o)?i.success:n?(e.init(o),i.success):i[o>0?\"next\":\"prev\"]}onButtonNavKbdClick(e){let t=e.response,i=this.chart;return 3!==i.oldRangeSelectorItemState&&this.fakeClickEvent(i.rangeSelector.buttons[i.highlightedRangeSelectorItemIx].element),t.success}onAfterBtnClick(){let e=this.chart,t=iq(e.xAxis[0]),i=e.langFormat(\"accessibility.rangeSelector.clickButtonAnnouncement\",{chart:e,axisRangeDescription:t});i&&this.announcer.announce(i)}onInputKbdMove(e){let t=this.chart,i=t.rangeSelector,s=t.highlightedInputRangeIx=(t.highlightedInputRangeIx||0)+e;if(s>1||s<0){if(t.accessibility)return t.accessibility.keyboardNavigation.exiting=!0,t.accessibility.keyboardNavigation.tabindexContainer.focus(),t.accessibility.keyboardNavigation.move(e)}else if(i){let e=i[s?\"maxDateBox\":\"minDateBox\"],r=i[s?\"maxInput\":\"minInput\"];e&&r&&t.setFocusToElement(e,r)}return!0}onInputNavInit(e){let t=this,i=this.chart,s=e>0?0:1,r=i.rangeSelector,n=r&&r[s?\"maxDateBox\":\"minDateBox\"],o=r&&r.minInput,a=r&&r.maxInput;if(i.highlightedInputRangeIx=s,n&&o&&a){i.setFocusToElement(n,s?a:o),this.removeInputKeydownHandler&&this.removeInputKeydownHandler();let e=e=>{(e.which||e.keyCode)===this.keyCodes.tab&&t.onInputKbdMove(e.shiftKey?-1:1)&&(e.preventDefault(),e.stopPropagation())},r=A(o,\"keydown\",e),l=A(a,\"keydown\",e);this.removeInputKeydownHandler=()=>{r(),l()}}}onInputNavTerminate(){let e=this.chart.rangeSelector||{};e.maxInput&&e.hideInput(\"max\"),e.minInput&&e.hideInput(\"min\"),this.removeInputKeydownHandler&&(this.removeInputKeydownHandler(),delete this.removeInputKeydownHandler)}initDropdownNav(){let e=this.chart,t=e.rangeSelector,i=t&&t.dropdown;t&&i&&(e.setFocusToElement(t.buttonGroup,i),this.removeDropdownKeydownHandler&&this.removeDropdownKeydownHandler(),this.removeDropdownKeydownHandler=A(i,\"keydown\",t=>{let i=(t.which||t.keyCode)===this.keyCodes.tab,s=e.accessibility;i&&(t.preventDefault(),t.stopPropagation(),s&&s.keyboardNavigation.move(t.shiftKey?-1:1))}))}getRangeSelectorButtonNavigation(){let e=this.chart,t=this.keyCodes,i=this;return new ey(e,{keyCodeMap:[[[t.left,t.right,t.up,t.down],function(e){return i.onButtonNavKbdArrowKey(this,e)}],[[t.enter,t.space],function(){return i.onButtonNavKbdClick(this)}]],validate:function(){return!!(e.rangeSelector&&e.rangeSelector.buttons&&e.rangeSelector.buttons.length)},init:function(t){let s=e.rangeSelector;if(s&&s.hasVisibleDropdown)i.initDropdownNav();else if(s){let i=s.buttons.length-1;e.highlightRangeSelectorButton(t>0?0:i)}},terminate:function(){i.removeDropdownKeydownHandler&&(i.removeDropdownKeydownHandler(),delete i.removeDropdownKeydownHandler)}})}getRangeSelectorInputNavigation(){let e=this.chart,t=this;return new ey(e,{keyCodeMap:[],validate:function(){return!!(e.rangeSelector&&e.rangeSelector.inputGroup&&\"hidden\"!==e.rangeSelector.inputGroup.element.style.visibility&&!1!==e.options.rangeSelector.inputEnabled&&e.rangeSelector.minInput&&e.rangeSelector.maxInput)},init:function(e){t.onInputNavInit(e)},terminate:function(){t.onInputNavTerminate()}})}getKeyboardNavigation(){return[this.getRangeSelectorButtonNavigation(),this.getRangeSelectorInputNavigation()]}destroy(){this.removeDropdownKeydownHandler&&this.removeDropdownKeydownHandler(),this.removeInputKeydownHandler&&this.removeInputKeydownHandler(),this.announcer&&this.announcer.destroy()}}function iG(e){let t=this.rangeSelector&&this.rangeSelector.buttons||[],i=this.highlightedRangeSelectorItemIx,s=this.rangeSelector&&this.rangeSelector.selected;return void 0!==i&&t[i]&&i!==s&&t[i].setState(this.oldRangeSelectorItemState||0),this.highlightedRangeSelectorItemIx=e,!!t[e]&&(this.setFocusToElement(t[e].box,t[e].element),e!==s&&(this.oldRangeSelectorItemState=t[e].state,t[e].setState(1)),!0)}function iU(){let e=this.chart.accessibility;if(e&&e.components.rangeSelector)return e.components.rangeSelector.onAfterBtnClick()}(iK||(iK={})).compose=function(e,t){let i=e.prototype;i.highlightRangeSelectorButton||(i.highlightRangeSelectorButton=iG,A(t,\"afterBtnClick\",iU))};let iW=iK,{composed:iV}=v();!function(e){function t(e){G(!0,e,{marker:{enabled:!0,states:{normal:{opacity:0}}}})}function i(e){return e.marker.states&&e.marker.states.normal&&e.marker.states.normal.opacity}function s(e){return!!(e._hasPointMarkers&&e.points&&e.points.length)}function r(){this.chart.styledMode&&(this.markerGroup&&this.markerGroup[this.a11yMarkersForced?\"addClass\":\"removeClass\"](\"highcharts-a11y-markers-hidden\"),s(this)&&this.points.forEach(e=>{e.graphic&&(e.graphic[e.hasForcedA11yMarker?\"addClass\":\"removeClass\"](\"highcharts-a11y-marker-hidden\"),e.graphic[!1===e.hasForcedA11yMarker?\"addClass\":\"removeClass\"](\"highcharts-a11y-marker-visible\"))}))}function n(e){this.resetA11yMarkerOptions=G(e.options.marker||{},this.userOptions.marker||{})}function o(){let e=this.options;!function(e){let t,i=e.chart.options.accessibility.enabled,s=!1!==(e.options.accessibility&&e.options.accessibility.enabled);return i&&s&&(t=e.chart.options.accessibility,e.points.length{e.graphic&&(e.graphic=e.graphic.destroy())})}function l(){this.boosted&&this.a11yMarkersForced&&(G(!0,this.options,{marker:{enabled:!1}}),delete this.a11yMarkersForced)}e.compose=function(e){V(iV,\"A11y.FM\")&&(A(e,\"afterSetOptions\",n),A(e,\"render\",o),A(e,\"afterRender\",r),A(e,\"renderCanvas\",l))}}(g||(g={}));let iX=g;var ij=f(260),iY=f.n(ij),i_=f(820),iZ=f.n(i_);let{seriesTypes:i$}=tR(),{doc:iQ}=v(),{getPointFromXY:iJ,getSeriesFromName:i0,scrollAxisToPoint:i1}=ed;function i2(e){let t=e.index,i=e.series.points,s=i.length;if(i[t]===e)return t;for(;s--;)if(i[s]===e)return s}function i3(e){let t=e.chart.options.accessibility.keyboardNavigation.seriesNavigation,i=e.options.accessibility||{},s=i.keyboardNavigation;return s&&!1===s.enabled||!1===i.enabled||!1===e.options.enableMouseTracking||!e.visible||t.pointNavigationEnabledThreshold&&+t.pointNavigationEnabledThreshold<=e.points.length}function i5(e){let t=e.series,i=t.options.nullInteraction,s=e.options.accessibility,r=t.chart.options.accessibility,n=s?.enabled===!1;return r.keyboardNavigation.seriesNavigation.skipNullPoints??(!(!e.isNull||i)&&!1===e.visible||!1===e.isInside||n||i3(t))}function i4(e){let t=e.series||[],i=t.length;for(let e=0;e-1;t.highlightedPoint===this&&i!==e&&!r&&e&&e.focus&&e.focus()})}onDrillupAll(){let e,t=this.lastDrilledDownPoint,i=this.chart,s=t&&i0(i,t.seriesName);t&&s&&S(t.x)&&S(t.y)&&(e=iJ(s,t.x,t.y)),e=e||i4(i),i.container&&i.container.focus(),e&&e.highlight&&e.highlight(!1)}getKeyboardNavigationHandler(){let e=this,t=this.keyCodes,i=this.chart,s=i.inverted;return new ey(i,{keyCodeMap:[[s?[t.up,t.down]:[t.left,t.right],function(t){return e.onKbdSideways(this,t)}],[s?[t.left,t.right]:[t.up,t.down],function(t){return e.onKbdVertical(this,t)}],[[t.enter,t.space],function(e,t){let s=i.highlightedPoint;if(s){let{plotLeft:e,plotTop:i}=this.chart,{plotX:r=0,plotY:n=0}=s;t={...t,chartX:e+r,chartY:i+n,point:s,target:s.graphic?.element||t.target},I(s.series,\"click\",t),s.firePointEvent(\"click\",t)}return this.response.success}],[[t.home],function(){return i9(i),this.response.success}],[[t.end],function(){return i6(i),this.response.success}],[[t.pageDown,t.pageUp],function(e){return i.highlightAdjacentSeries(e===t.pageDown),this.response.success}]],init:function(){return e.onHandlerInit(this)},validate:function(){return!!i4(i)},terminate:function(){return e.onHandlerTerminate()}})}onKbdSideways(e,t){let i=this.keyCodes,s=t===i.right||t===i.down;return this.attemptHighlightAdjacentPoint(e,s)}onHandlerInit(e){let t=this.chart;return t.options.accessibility.keyboardNavigation.seriesNavigation.rememberPointFocus&&t.highlightedPoint?t.highlightedPoint.highlight():i9(t),e.response.success}onKbdVertical(e,t){let i=this.chart,s=this.keyCodes,r=t===s.down||t===s.right,n=i.options.accessibility.keyboardNavigation.seriesNavigation;if(n.mode&&\"serialize\"===n.mode)return this.attemptHighlightAdjacentPoint(e,r);let o=i.highlightedPoint&&i.highlightedPoint.series.keyboardMoveVertical?\"highlightAdjacentPointVertical\":\"highlightAdjacentSeries\";return i[o](r),e.response.success}onHandlerTerminate(){let e=this.chart,t=e.options.accessibility.keyboardNavigation;e.tooltip&&e.tooltip.hide(0);let i=e.highlightedPoint&&e.highlightedPoint.series;i&&i.onMouseOut&&i.onMouseOut(),e.highlightedPoint&&e.highlightedPoint.onMouseOut&&e.highlightedPoint.onMouseOut(),t.seriesNavigation.rememberPointFocus||delete e.highlightedPoint}attemptHighlightAdjacentPoint(e,t){let i=this.chart,s=i.options.accessibility.keyboardNavigation.wrapAround;return i.highlightAdjacentPoint(t)?e.response.success:s&&(t?i9(i):i6(i))?e.response.success:e.response[t?\"next\":\"prev\"]}onSeriesDestroy(e){let t=this.chart;t.highlightedPoint&&t.highlightedPoint.series===e&&(delete t.highlightedPoint,t.focusElement&&t.focusElement.removeFocusBorder())}destroy(){this.eventProvider.removeAddedEvents()}}!function(e){function t(e){let t,i,s=this.series,r=this.highlightedPoint,n=r&&i2(r)||0,o=r&&r.series.points||[],a=this.series&&this.series[this.series.length-1],l=a&&a.points&&a.points[a.points.length-1];if(!s[0]||!s[0].points)return!1;if(r){if(t=s[r.series.index+(e?1:-1)],(i=o[n+(e?1:-1)])||!t||(i=t.points[e?0:t.points.length-1]),!i)return!1}else i=e?s[0].points[0]:l;return i5(i)?(i3(t=i.series)?this.highlightedPoint=e?t.points[t.points.length-1]:t.points[0]:this.highlightedPoint=i,this.highlightAdjacentPoint(e)):i.highlight()}function i(e){let t=this.highlightedPoint,i=1/0,s;return!!S(t.plotX)&&!!S(t.plotY)&&(this.series.forEach(r=>{i3(r)||r.points.forEach(n=>{if(!S(n.plotY)||!S(n.plotX)||n===t)return;let o=n.plotY-t.plotY,a=Math.abs(n.plotX-t.plotX),l=Math.abs(o)*Math.abs(o)+a*a*4;r.yAxis&&r.yAxis.reversed&&(o*=-1),!(o<=0&&e||o>=0&&!e||l<5||i5(n))&&l!(S(e.plotX)&&S(e.plotY));if(!h(e)){for(;l--;)!h(n=t.points[l])&&(a=(e.plotX-n.plotX)*(e.plotX-n.plotX)*4+(e.plotY-n.plotY)*(e.plotY-n.plotY)*1)=0;--e)if(!i5(i[e]))return i[e].highlight()}return!1}e.compose=function(e,o,a){let l=e.prototype,h=o.prototype,c=a.prototype;l.highlightAdjacentPoint||(l.highlightAdjacentPoint=t,l.highlightAdjacentPointVertical=i,l.highlightAdjacentSeries=s,h.highlight=r,c.keyboardMoveVertical=!0,[\"column\",\"gantt\",\"pie\"].forEach(e=>{i$[e]&&(i$[e].prototype.keyboardMoveVertical=!1)}),c.highlightNextValidPoint=n)}}(i8||(i8={}));let i7=i8,{hideSeriesFromAT:se}=ed,{describeSeries:st}=ib,si=class extends ex{static compose(e,t,i){iC.compose(i),iX.compose(i),i7.compose(e,t,i)}init(){this.newDataAnnouncer=new iC(this.chart),this.newDataAnnouncer.init(),this.keyboardNavigation=new i7(this.chart,this.keyCodes),this.keyboardNavigation.init(),this.hideTooltipFromATWhenShown(),this.hideSeriesLabelsFromATWhenShown()}hideTooltipFromATWhenShown(){let e=this;this.chart.tooltip&&this.addEvent(this.chart.tooltip.constructor,\"refresh\",function(){this.chart===e.chart&&this.label&&this.label.element&&this.label.element.setAttribute(\"aria-hidden\",!0)})}hideSeriesLabelsFromATWhenShown(){this.addEvent(this.chart,\"afterDrawSeriesLabels\",function(){this.series.forEach(function(e){e.labelBySeries&&e.labelBySeries.attr(\"aria-hidden\",!0)})})}onChartRender(){this.chart.series.forEach(function(e){!1!==(e.options.accessibility&&e.options.accessibility.enabled)&&e.visible&&0!==e.getPointsCollection().length?st(e):se(e)})}getKeyboardNavigation(){return this.keyboardNavigation.getKeyboardNavigationHandler()}destroy(){this.newDataAnnouncer.destroy(),this.keyboardNavigation.destroy()}},{unhideChartElementFromAT:ss}=ed,{getFakeMouseEvent:sr}=J,sn=class extends ex{constructor(){super(...arguments),this.focusedMapNavButtonIx=-1}init(){let e=this,t=this.chart;this.proxyProvider.addGroup(\"zoom\",\"div\"),[\"afterShowResetZoom\",\"afterApplyDrilldown\",\"drillupall\"].forEach(i=>{e.addEvent(t,i,function(){e.updateProxyOverlays()})})}onChartUpdate(){let e=this.chart,t=this;e.mapNavigation&&e.mapNavigation.navButtons.forEach((i,s)=>{ss(e,i.element),t.setMapNavButtonAttrs(i.element,\"accessibility.zoom.mapZoom\"+(s?\"Out\":\"In\"))})}setMapNavButtonAttrs(e,t){let i=this.chart;T(e,{tabindex:-1,role:\"button\",\"aria-label\":i.langFormat(t,{chart:i})})}onChartRender(){this.updateProxyOverlays()}updateProxyOverlays(){let e=this.chart;if(this.proxyProvider.clearGroup(\"zoom\"),e.resetZoomButton&&this.createZoomProxyButton(e.resetZoomButton,\"resetZoomProxyButton\",e.langFormat(\"accessibility.zoom.resetZoomButton\",{chart:e})),e.drillUpButton&&e.breadcrumbs&&e.breadcrumbs.list){let t=e.breadcrumbs.list[e.breadcrumbs.list.length-1];this.createZoomProxyButton(e.drillUpButton,\"drillUpProxyButton\",e.langFormat(\"accessibility.drillUpButton\",{chart:e,buttonText:e.breadcrumbs.getButtonText(t)}))}}createZoomProxyButton(e,t,i){this[t]=this.proxyProvider.addProxyElement(\"zoom\",{click:e},\"button\",{\"aria-label\":i,tabindex:-1})}getMapZoomNavigation(){let e=this.keyCodes,t=this.chart,i=this;return new ey(t,{keyCodeMap:[[[e.up,e.down,e.left,e.right],function(e){return i.onMapKbdArrow(this,e)}],[[e.tab],function(e,t){return i.onMapKbdTab(this,t)}],[[e.space,e.enter],function(){return i.onMapKbdClick(this)}]],validate:function(){return!!(t.mapView&&t.mapNavigation&&t.mapNavigation.navButtons.length)},init:function(e){return i.onMapNavInit(e)}})}onMapKbdArrow(e,t){let i=this.chart,s=this.keyCodes,r=i.container,n=t===s.up||t===s.down,o=t===s.left||t===s.up?1:-1,a=(n?i.plotHeight:i.plotWidth)/10*o,l=10*Math.random(),h={x:r.offsetLeft+i.plotLeft+i.plotWidth/2+l,y:r.offsetTop+i.plotTop+i.plotHeight/2+l},c=n?{x:h.x,y:h.y+a}:{x:h.x+a,y:h.y};return[sr(\"mousedown\",h),sr(\"mousemove\",c),sr(\"mouseup\",c)].forEach(e=>r.dispatchEvent(e)),e.response.success}onMapKbdTab(e,t){let i=this.chart,s=e.response,r=t.shiftKey,n=r&&!this.focusedMapNavButtonIx||!r&&this.focusedMapNavButtonIx;if(i.mapNavigation.navButtons[this.focusedMapNavButtonIx].setState(0),n)return i.mapView&&i.mapView.zoomBy(),s[r?\"prev\":\"next\"];this.focusedMapNavButtonIx+=r?-1:1;let o=i.mapNavigation.navButtons[this.focusedMapNavButtonIx];return i.setFocusToElement(o.box,o.element),o.setState(2),s.success}onMapKbdClick(e){let t=this.chart.mapNavigation.navButtons[this.focusedMapNavButtonIx].element;return this.fakeClickEvent(t),e.response.success}onMapNavInit(e){let t=this.chart,i=t.mapNavigation.navButtons[0],s=t.mapNavigation.navButtons[1],r=e>0?i:s;t.setFocusToElement(r.box,r.element),r.setState(2),this.focusedMapNavButtonIx=e>0?0:1}simpleButtonNavigation(e,t,i){let s=this.keyCodes,r=this,n=this.chart;return new ey(n,{keyCodeMap:[[[s.tab,s.up,s.down,s.left,s.right],function(e,t){let i=e===s.tab&&t.shiftKey||e===s.left||e===s.up;return this.response[i?\"prev\":\"next\"]}],[[s.space,s.enter],function(){return W(i(this,n),this.response.success)}]],validate:function(){return n[e]&&n[e].box&&r[t].innerElement},init:function(){n.setFocusToElement(n[e].box,r[t].innerElement)}})}getKeyboardNavigation(){return[this.simpleButtonNavigation(\"resetZoomButton\",\"resetZoomProxyButton\",function(e,t){t.zoomOut()}),this.simpleButtonNavigation(\"drillUpButton\",\"drillUpProxyButton\",function(e,t){return t.drillUp(),e.response.prev}),this.getMapZoomNavigation()]}},{doc:so,isMS:sa,win:sl}=v(),sh=function(){if(sa&&sl.getComputedStyle){let e=so.createElement(\"div\");e.style.backgroundImage=\"url(data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\",so.body.appendChild(e);let t=(e.currentStyle||sl.getComputedStyle(e)).backgroundImage;return so.body.removeChild(e),\"none\"===t}return sl.matchMedia&&sl.matchMedia(\"(forced-colors: active)\").matches},sc=function(e){e.highContrastModeActive=!0;let t=e.options.accessibility.highContrastTheme;e.update(t,!1);let i=t.colors?.length>1;e.series.forEach(function(e){let s=t.plotOptions[e.type]||{},r=i&&void 0!==e.colorIndex?t.colors[e.colorIndex]:s.color||\"window\",n={color:s.color||\"windowText\",colors:i?t.colors:[s.color||\"windowText\"],borderColor:s.borderColor||\"window\",fillColor:r};e.update(n,!1),e.points&&e.points.forEach(function(e){e.options&&e.options.color&&e.update({color:s.color||\"windowText\",borderColor:s.borderColor||\"window\"},!1)})}),e.redraw()},sd={chart:{backgroundColor:\"window\"},title:{style:{color:\"windowText\"}},subtitle:{style:{color:\"windowText\"}},colorAxis:{minColor:\"windowText\",maxColor:\"windowText\",stops:[],dataClasses:[]},colors:[\"windowText\"],xAxis:{gridLineColor:\"windowText\",labels:{style:{color:\"windowText\"}},lineColor:\"windowText\",minorGridLineColor:\"windowText\",tickColor:\"windowText\",title:{style:{color:\"windowText\"}}},yAxis:{gridLineColor:\"windowText\",labels:{style:{color:\"windowText\"}},lineColor:\"windowText\",minorGridLineColor:\"windowText\",tickColor:\"windowText\",title:{style:{color:\"windowText\"}}},tooltip:{backgroundColor:\"window\",borderColor:\"windowText\",style:{color:\"windowText\"}},plotOptions:{series:{lineColor:\"windowText\",fillColor:\"window\",borderColor:\"windowText\",edgeColor:\"windowText\",borderWidth:1,dataLabels:{connectorColor:\"windowText\",color:\"windowText\",style:{color:\"windowText\",textOutline:\"none\"}},marker:{lineColor:\"windowText\",fillColor:\"windowText\"}},pie:{color:\"window\",colors:[\"window\"],borderColor:\"windowText\",borderWidth:1},boxplot:{fillColor:\"window\"},candlestick:{lineColor:\"windowText\",fillColor:\"window\"},errorbar:{fillColor:\"window\"}},legend:{backgroundColor:\"window\",itemStyle:{color:\"windowText\"},itemHoverStyle:{color:\"windowText\"},itemHiddenStyle:{color:\"#555\"},title:{style:{color:\"windowText\"}}},credits:{style:{color:\"windowText\"}},drilldown:{activeAxisLabelStyle:{color:\"windowText\"},activeDataLabelStyle:{color:\"windowText\"}},navigation:{buttonOptions:{symbolStroke:\"windowText\",theme:{fill:\"window\"}}},rangeSelector:{buttonTheme:{fill:\"window\",stroke:\"windowText\",style:{color:\"windowText\"},states:{hover:{fill:\"window\",stroke:\"windowText\",style:{color:\"windowText\"}},select:{fill:\"#444\",stroke:\"windowText\",style:{color:\"windowText\"}}}},inputBoxBorderColor:\"windowText\",inputStyle:{backgroundColor:\"window\",color:\"windowText\"},labelStyle:{color:\"windowText\"}},navigator:{handles:{backgroundColor:\"window\",borderColor:\"windowText\"},outlineColor:\"windowText\",maskFill:\"transparent\",series:{color:\"windowText\",lineColor:\"windowText\"},xAxis:{gridLineColor:\"windowText\"}},scrollbar:{barBackgroundColor:\"#444\",barBorderColor:\"windowText\",buttonArrowColor:\"windowText\",buttonBackgroundColor:\"window\",buttonBorderColor:\"windowText\",rifleColor:\"windowText\",trackBackgroundColor:\"window\",trackBorderColor:\"windowText\"}};function su(e,t,i){let s=e,r,n=0;for(;n\"series\"!==e)):Object.keys(this.components):[]}update(){let e=this.components,t=this.chart,i=t.options.accessibility;I(t,\"beforeA11yUpdate\"),t.types=this.getChartTypes();let s=i.keyboardNavigation.order;this.proxyProvider.updateGroupOrder(s),this.getComponentOrder().forEach(function(i){e[i].onChartUpdate(),I(t,\"afterA11yComponentUpdate\",{name:i,component:e[i]})}),this.keyboardNavigation.update(s),!t.highContrastModeActive&&!1!==i.highContrastMode&&(sh()||!0===i.highContrastMode)&&sc(t),I(t,\"afterA11yUpdate\",{accessibility:this})}destroy(){let e=this.chart||{},t=this.components;Object.keys(t).forEach(function(e){t[e].destroy(),t[e].destroyBase()}),this.proxyProvider&&this.proxyProvider.destroy(),e.announcerContainer&&sf(e.announcerContainer),this.keyboardNavigation&&this.keyboardNavigation.destroy(),e.renderTo&&e.renderTo.setAttribute(\"aria-hidden\",!0),e.focusElement&&e.focusElement.removeFocusBorder()}getChartTypes(){let e={};return this.chart.series.forEach(function(t){e[t.type]=1}),Object.keys(e)}}!function(e){function t(){this.accessibility&&this.accessibility.destroy()}function i(){this.a11yDirty&&this.renderTo&&(delete this.a11yDirty,this.updateA11yEnabled());let e=this.accessibility;e&&!e.zombie&&(e.proxyProvider.updateProxyElementPositions(),e.getComponentOrder().forEach(function(t){e.components[t].onChartRender()}))}function s(e){let t=e.options.accessibility;t&&(t.customComponents&&(this.options.accessibility.customComponents=t.customComponents,delete t.customComponents),G(!0,this.options.accessibility,t),this.accessibility&&this.accessibility.destroy&&(this.accessibility.destroy(),delete this.accessibility)),this.a11yDirty=!0}function r(){let t=this.accessibility,i=this.options.accessibility,s=this.renderer.boxWrapper.element,r=this.title;if(i&&i.enabled)t&&!t.zombie?t.update():(this.accessibility=t=new e(this),t&&!t.zombie&&t.update(),\"img\"===s.getAttribute(\"role\")&&s.removeAttribute(\"role\"));else if(t)t.destroy&&t.destroy(),delete this.accessibility;else{this.renderTo.setAttribute(\"role\",\"img\"),this.renderTo.setAttribute(\"aria-hidden\",!1),this.renderTo.setAttribute(\"aria-label\",(r&&r.element.textContent||\"\").replace(/{A(e,t,function(){this.a11yDirty=!0})}),[\"afterApplyDrilldown\",\"drillupall\"].forEach(t=>{A(e,t,function(){let e=this.accessibility;e&&!e.zombie&&e.update()})}),A(a,\"update\",n),[\"update\",\"updatedData\",\"remove\"].forEach(e=>{A(l,e,function(){this.chart.accessibility&&(this.chart.a11yDirty=!0)})}))}}(sx||(sx={})),G(!0,sm,{accessibility:{enabled:!0,screenReaderSection:{beforeChartFormat:\"<{headingTagName}>{chartTitle}
    {typeDescription}
    {chartSubtitle}
    {chartLongdesc}
    {playAsSoundButton}
    {viewTableButton}
    {xAxisDescription}
    {yAxisDescription}
    {annotationsTitle}{annotationsList}
    \",afterChartFormat:\"{endOfChartMarker}\",axisRangeDateFormat:\"%Y-%m-%d %H:%M:%S\"},series:{descriptionFormat:\"{seriesDescription}{authorDescription}{axisDescription}\",describeSingleSeries:!1,pointDescriptionEnabledThreshold:200},point:{valueDescriptionFormat:\"{xDescription}{separator}{value}.\",describeNull:!0},landmarkVerbosity:\"all\",linkedDescription:'*[data-highcharts-chart=\"{index}\"] + .highcharts-description',highContrastMode:\"auto\",keyboardNavigation:{enabled:!0,focusBorder:{enabled:!0,hideBrowserFocusOutline:!0,style:{color:\"#334eff\",lineWidth:2,borderRadius:3},margin:2},order:[\"series\",\"zoom\",\"rangeSelector\",\"navigator\",\"legend\",\"chartMenu\"],wrapAround:!0,seriesNavigation:{skipNullPoints:void 0,pointNavigationEnabledThreshold:!1,rememberPointFocus:!1}},announceNewData:{enabled:!1,minAnnounceInterval:5e3,interruptUser:!1}},legend:{accessibility:{enabled:!0,keyboardNavigation:{enabled:!0}}},exporting:{accessibility:{enabled:!0}},navigator:{accessibility:{enabled:!0}}},{accessibility:{highContrastTheme:sd},lang:{accessibility:{defaultChartTitle:\"Chart\",chartContainerLabel:\"{title}. Highcharts interactive chart.\",svgContainerLabel:\"Interactive chart\",drillUpButton:\"{buttonText}\",credits:\"Chart credits: {creditsStr}\",thousandsSep:\",\",svgContainerTitle:\"\",graphicContainerLabel:\"\",screenReaderSection:{beforeRegionLabel:\"\",afterRegionLabel:\"\",annotations:{heading:\"Chart annotations summary\",descriptionSinglePoint:\"{annotationText}. Related to {annotationPoint}\",descriptionMultiplePoints:\"{annotationText}. Related to {annotationPoint}{#each additionalAnnotationPoints}, also related to {this}{/each}\",descriptionNoPoints:\"{annotationText}\"},endOfChartMarker:\"End of interactive chart.\"},sonification:{playAsSoundButtonText:\"Play as sound, {chartTitle}\",playAsSoundClickAnnouncement:\"Play\"},legend:{legendLabelNoTitle:\"Toggle series visibility, {chartTitle}\",legendLabel:\"Chart legend: {legendTitle}\",legendItem:\"Show {itemName}\"},zoom:{mapZoomIn:\"Zoom chart\",mapZoomOut:\"Zoom out chart\",resetZoomButton:\"Reset zoom\"},rangeSelector:{dropdownLabel:\"{rangeTitle}\",minInputLabel:\"Select start date.\",maxInputLabel:\"Select end date.\",clickButtonAnnouncement:\"Viewing {axisRangeDescription}\"},navigator:{handleLabel:\"{#eq handleIx 0}Start, percent{else}End, percent{/eq}\",groupLabel:\"Axis zoom\",changeAnnouncement:\"{axisRangeDescription}\"},stockTools:{groupLabel:\"Stock chart tools\",arrowLabel:\"Toggle submenu\"},table:{viewAsDataTableButtonText:\"View as data table, {chartTitle}\",tableSummary:\"Table representation of chart.\"},announceNewData:{newDataAnnounce:\"Updated data for chart {chartTitle}\",newSeriesAnnounceSingle:\"New data series: {seriesDesc}\",newPointAnnounceSingle:\"New data point: {pointDesc}\",newSeriesAnnounceMultiple:\"New data series in chart {chartTitle}: {seriesDesc}\",newPointAnnounceMultiple:\"New data point in chart {chartTitle}: {pointDesc}\"},seriesTypeDescriptions:{boxplot:\"Box plot charts are typically used to display groups of statistical data. Each data point in the chart can have up to 5 values: minimum, lower quartile, median, upper quartile, and maximum.\",arearange:\"Arearange charts are line charts displaying a range between a lower and higher value for each point.\",areasplinerange:\"These charts are line charts displaying a range between a lower and higher value for each point.\",bubble:\"Bubble charts are scatter charts where each data point also has a size value.\",columnrange:\"Columnrange charts are column charts displaying a range between a lower and higher value for each point.\",errorbar:\"Errorbar series are used to display the variability of the data.\",funnel:\"Funnel charts are used to display reduction of data in stages.\",pyramid:\"Pyramid charts consist of a single pyramid with item heights corresponding to each point value.\",waterfall:\"A waterfall chart is a column chart where each column contributes towards a total end value.\"},chartTypes:{emptyChart:\"Empty chart\",mapTypeDescription:\"Map of {mapTitle} with {numSeries} data series.\",unknownMap:\"Map of unspecified region with {numSeries} data series.\",combinationChart:\"Combination chart with {numSeries} data series.\",defaultSingle:\"Chart with {numPoints} data {#eq numPoints 1}point{else}points{/eq}.\",defaultMultiple:\"Chart with {numSeries} data series.\",splineSingle:\"Line chart with {numPoints} data {#eq numPoints 1}point{else}points{/eq}.\",splineMultiple:\"Line chart with {numSeries} lines.\",lineSingle:\"Line chart with {numPoints} data {#eq numPoints 1}point{else}points{/eq}.\",lineMultiple:\"Line chart with {numSeries} lines.\",columnSingle:\"Bar chart with {numPoints} {#eq numPoints 1}bar{else}bars{/eq}.\",columnMultiple:\"Bar chart with {numSeries} data series.\",barSingle:\"Bar chart with {numPoints} {#eq numPoints 1}bar{else}bars{/eq}.\",barMultiple:\"Bar chart with {numSeries} data series.\",pieSingle:\"Pie chart with {numPoints} {#eq numPoints 1}slice{else}slices{/eq}.\",pieMultiple:\"Pie chart with {numSeries} pies.\",scatterSingle:\"Scatter chart with {numPoints} {#eq numPoints 1}point{else}points{/eq}.\",scatterMultiple:\"Scatter chart with {numSeries} data series.\",boxplotSingle:\"Boxplot with {numPoints} {#eq numPoints 1}box{else}boxes{/eq}.\",boxplotMultiple:\"Boxplot with {numSeries} data series.\",bubbleSingle:\"Bubble chart with {numPoints} {#eq numPoints 1}bubbles{else}bubble{/eq}.\",bubbleMultiple:\"Bubble chart with {numSeries} data series.\"},axis:{xAxisDescriptionSingular:\"The chart has 1 X axis displaying {names[0]}. {ranges[0]}\",xAxisDescriptionPlural:\"The chart has {numAxes} X axes displaying {#each names}{#unless @first},{/unless}{#if @last} and{/if} {this}{/each}.\",yAxisDescriptionSingular:\"The chart has 1 Y axis displaying {names[0]}. {ranges[0]}\",yAxisDescriptionPlural:\"The chart has {numAxes} Y axes displaying {#each names}{#unless @first},{/unless}{#if @last} and{/if} {this}{/each}.\",timeRangeDays:\"Data range: {range} days.\",timeRangeHours:\"Data range: {range} hours.\",timeRangeMinutes:\"Data range: {range} minutes.\",timeRangeSeconds:\"Data range: {range} seconds.\",rangeFromTo:\"Data ranges from {rangeFrom} to {rangeTo}.\",rangeCategories:\"Data range: {numCategories} categories.\",defaultAxisNames:{categories:\"categories\",time:\"Time\",values:\"values\"}},exporting:{chartMenuLabel:\"Chart menu\",menuButtonLabel:\"View chart menu, {chartTitle}\"},series:{summary:{default:\"{series.name}, series {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.\",defaultCombination:\"{series.name}, series {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.\",line:\"{series.name}, line {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.\",lineCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Line with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.\",spline:\"{series.name}, line {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.\",splineCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Line with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.\",column:\"{series.name}, bar series {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}bar{else}bars{/eq}.\",columnCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Bar series with {series.points.length} {#eq series.points.length 1}bar{else}bars{/eq}.\",bar:\"{series.name}, bar series {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}bar{else}bars{/eq}.\",barCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Bar series with {series.points.length} {#eq series.points.length 1}bar{else}bars{/eq}.\",pie:\"{series.name}, pie {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}slice{else}slices{/eq}.\",pieCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Pie with {series.points.length} {#eq series.points.length 1}slice{else}slices{/eq}.\",scatter:\"{series.name}, scatter plot {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}point{else}points{/eq}.\",scatterCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}, scatter plot with {series.points.length} {#eq series.points.length 1}point{else}points{/eq}.\",boxplot:\"{series.name}, boxplot {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}box{else}boxes{/eq}.\",boxplotCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Boxplot with {series.points.length} {#eq series.points.length 1}box{else}boxes{/eq}.\",bubble:\"{series.name}, bubble series {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}bubble{else}bubbles{/eq}.\",bubbleCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Bubble series with {series.points.length} {#eq series.points.length 1}bubble{else}bubbles{/eq}.\",map:\"{series.name}, map {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}area{else}areas{/eq}.\",mapCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Map with {series.points.length} {#eq series.points.length 1}area{else}areas{/eq}.\",mapline:\"{series.name}, line {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.\",maplineCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Line with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.\",mapbubble:\"{series.name}, bubble series {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}bubble{else}bubbles{/eq}.\",mapbubbleCombination:\"{series.name}, series {seriesNumber} of {chart.series.length}. Bubble series with {series.points.length} {#eq series.points.length 1}bubble{else}bubbles{/eq}.\"},description:\"{description}\",xAxisDescription:\"X axis, {name}\",yAxisDescription:\"Y axis, {name}\",nullPointValue:\"No value\",pointAnnotationsDescription:\"{#each annotations}Annotation: {this}{/each}\"}}}});let sy=sx,sv=v();sv.i18nFormat=sy.i18nFormat,sv.A11yChartUtilities=ed,sv.A11yHTMLUtilities=J,sv.AccessibilityComponent=ex,sv.KeyboardNavigationHandler=ey,sv.SeriesAccessibilityDescriber=ib,sy.compose(sv.Chart,sv.Legend,sv.Point,sv.Series,sv.SVGElement,sv.RangeSelector);let sw=v();return x.default})());", "!/**\n * Highcharts JS v12.6.0 (2026-04-13)\n * @module highcharts/modules/no-data-to-display\n * @requires highcharts\n *\n * Plugin for displaying a message when there is no data visible in chart.\n *\n * (c) 2010-2026 Highsoft AS\n * Author: \u00D8ystein Moseng\n *\n * A commercial license may be required depending on use.\n * See www.highcharts.com/license\n */function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.AST):\"function\"==typeof define&&define.amd?define(\"highcharts/modules/no-data-to-display\",[\"highcharts/highcharts\"],function(t){return e(t,t.AST)}):\"object\"==typeof exports?exports[\"highcharts/modules/no-data-to-display\"]=e(t._Highcharts,t._Highcharts.AST):t.Highcharts=e(t.Highcharts,t.Highcharts.AST)}(\"u\"(()=>{\"use strict\";var o={660:t=>{t.exports=e},944:e=>{e.exports=t}},r={};function a(t){var e=r[t];if(void 0!==e)return e.exports;var n=r[t]={exports:{}};return o[t](n,n.exports,a),n.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};a.d(n,{default:()=>x});var i=a(944),s=a.n(i),l=a(660),c=a.n(l);let h={lang:{noData:\"No data to display\"},noData:{attr:{zIndex:1},position:{x:0,y:0,align:\"center\",verticalAlign:\"middle\"},style:{fontWeight:\"bold\",fontSize:\"0.8em\",color:\"#666666\"}}},{doc:d,win:p}=s();function u(t){return f(t)&&\"number\"==typeof t.nodeType}function f(t,e){let o;return!!t&&\"object\"==typeof t&&(!e||\"[object Array]\"!==(o=Object.prototype.toString.call(t))&&\"[object Array Iterator]\"!==o)}Array.prototype.find;function y(){let t=this.series||[],e=t.length;for(;e--;)if(t[e].hasData()&&!t[e].options.isInternal)return!0;return this.loadingShown}function b(){this.noDataLabel&&(this.noDataLabel=this.noDataLabel.destroy())}function g(t){let e=this.options,o=t||e&&e.lang.noData||\"\",r=e&&(e.noData||{});this.renderer&&(this.noDataLabel||(this.noDataLabel=this.renderer.label(o,0,0,void 0,void 0,void 0,r.useHTML,void 0,\"no-data\").add()),this.styledMode||this.noDataLabel.attr(c().filterUserAttributes(r.attr||{})).css(r.style||{}),this.noDataLabel.align(function(t,e){let o;for(o in t||(t={}),e)t[o]=e[o];return t}(this.noDataLabel.getBBox(),r.position||{}),!1,\"plotBox\"))}function v(){this.hasData()?this.hideNoData():this.showNoData()}let D=s();({compose:function(t,e){let o=t.prototype;o.showNoData||(o.hasData=y,o.hideNoData=b,o.showNoData=g,function(t,e,o,r={}){let a=\"function\"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(a,\"hcEvents\")||(a.hcEvents={});let n=a.hcEvents;s().Point&&t instanceof s().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let i=t.addEventListener;i&&i.call(t,e,o,!!s().supportsPassiveEvents&&{passive:void 0===r.passive?-1!==e.indexOf(\"touch\"):r.passive,capture:!1}),n[e]||(n[e]=[]);let l={fn:o,order:\"number\"==typeof r.order?r.order:1/0};n[e].push(l),n[e].sort((t,e)=>t.order-e.order)}(t,\"render\",v),function(t,...e){let o,r=[t,...e],a={},n=function(t,e){return\"object\"!=typeof t&&(t={}),function(t,e,o){for(let o in t)Object.hasOwnProperty.call(t,o)&&e.call((0,t[o]),t[o],o,t)}(e,function(o,r){if(\"__proto__\"!==r&&\"constructor\"!==r){let a;!f(o,!0)||(a=o?.constructor,f(o,!0)&&!u(o)&&a?.name&&\"Object\"!==a.name)||u(o)?t[r]=e[r]:t[r]=n(t[r]||{},o)}}),t};!0===t&&(a=r[1],r=Array.prototype.slice.call(r,2));let i=r.length;for(o=0;o\n * \n * Show all expanded messages in this frame.\n * \n *\n *
    \n * Show response from this form within this frame.\n *
    \n * \n */\nclass FrameElement extends HTMLElement {\n static delegateConstructor = undefined\n\n loaded = Promise.resolve()\n\n static get observedAttributes() {\n return [\"disabled\", \"loading\", \"src\"]\n }\n\n constructor() {\n super();\n this.delegate = new FrameElement.delegateConstructor(this);\n }\n\n connectedCallback() {\n this.delegate.connect();\n }\n\n disconnectedCallback() {\n this.delegate.disconnect();\n }\n\n reload() {\n return this.delegate.sourceURLReloaded()\n }\n\n attributeChangedCallback(name) {\n if (name == \"loading\") {\n this.delegate.loadingStyleChanged();\n } else if (name == \"src\") {\n this.delegate.sourceURLChanged();\n } else if (name == \"disabled\") {\n this.delegate.disabledChanged();\n }\n }\n\n /**\n * Gets the URL to lazily load source HTML from\n */\n get src() {\n return this.getAttribute(\"src\")\n }\n\n /**\n * Sets the URL to lazily load source HTML from\n */\n set src(value) {\n if (value) {\n this.setAttribute(\"src\", value);\n } else {\n this.removeAttribute(\"src\");\n }\n }\n\n /**\n * Gets the refresh mode for the frame.\n */\n get refresh() {\n return this.getAttribute(\"refresh\")\n }\n\n /**\n * Sets the refresh mode for the frame.\n */\n set refresh(value) {\n if (value) {\n this.setAttribute(\"refresh\", value);\n } else {\n this.removeAttribute(\"refresh\");\n }\n }\n\n get shouldReloadWithMorph() {\n return this.src && this.refresh === \"morph\"\n }\n\n /**\n * Determines if the element is loading\n */\n get loading() {\n return frameLoadingStyleFromString(this.getAttribute(\"loading\") || \"\")\n }\n\n /**\n * Sets the value of if the element is loading\n */\n set loading(value) {\n if (value) {\n this.setAttribute(\"loading\", value);\n } else {\n this.removeAttribute(\"loading\");\n }\n }\n\n /**\n * Gets the disabled state of the frame.\n *\n * If disabled, no requests will be intercepted by the frame.\n */\n get disabled() {\n return this.hasAttribute(\"disabled\")\n }\n\n /**\n * Sets the disabled state of the frame.\n *\n * If disabled, no requests will be intercepted by the frame.\n */\n set disabled(value) {\n if (value) {\n this.setAttribute(\"disabled\", \"\");\n } else {\n this.removeAttribute(\"disabled\");\n }\n }\n\n /**\n * Gets the autoscroll state of the frame.\n *\n * If true, the frame will be scrolled into view automatically on update.\n */\n get autoscroll() {\n return this.hasAttribute(\"autoscroll\")\n }\n\n /**\n * Sets the autoscroll state of the frame.\n *\n * If true, the frame will be scrolled into view automatically on update.\n */\n set autoscroll(value) {\n if (value) {\n this.setAttribute(\"autoscroll\", \"\");\n } else {\n this.removeAttribute(\"autoscroll\");\n }\n }\n\n /**\n * Determines if the element has finished loading\n */\n get complete() {\n return !this.delegate.isLoading\n }\n\n /**\n * Gets the active state of the frame.\n *\n * If inactive, source changes will not be observed.\n */\n get isActive() {\n return this.ownerDocument === document && !this.isPreview\n }\n\n /**\n * Sets the active state of the frame.\n *\n * If inactive, source changes will not be observed.\n */\n get isPreview() {\n return this.ownerDocument?.documentElement?.hasAttribute(\"data-turbo-preview\")\n }\n}\n\nfunction frameLoadingStyleFromString(style) {\n switch (style.toLowerCase()) {\n case \"lazy\":\n return FrameLoadingStyle.lazy\n default:\n return FrameLoadingStyle.eager\n }\n}\n\nconst drive = {\n enabled: true,\n progressBarDelay: 500,\n unvisitableExtensions: new Set(\n [\n \".7z\", \".aac\", \".apk\", \".avi\", \".bmp\", \".bz2\", \".css\", \".csv\", \".deb\", \".dmg\", \".doc\",\n \".docx\", \".exe\", \".gif\", \".gz\", \".heic\", \".heif\", \".ico\", \".iso\", \".jpeg\", \".jpg\",\n \".js\", \".json\", \".m4a\", \".mkv\", \".mov\", \".mp3\", \".mp4\", \".mpeg\", \".mpg\", \".msi\",\n \".ogg\", \".ogv\", \".pdf\", \".pkg\", \".png\", \".ppt\", \".pptx\", \".rar\", \".rtf\",\n \".svg\", \".tar\", \".tif\", \".tiff\", \".txt\", \".wav\", \".webm\", \".webp\", \".wma\", \".wmv\",\n \".xls\", \".xlsx\", \".xml\", \".zip\"\n ]\n )\n};\n\nfunction activateScriptElement(element) {\n if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n return element\n } else {\n const createdScriptElement = document.createElement(\"script\");\n const cspNonce = getCspNonce();\n if (cspNonce) {\n createdScriptElement.nonce = cspNonce;\n }\n createdScriptElement.textContent = element.textContent;\n createdScriptElement.async = false;\n copyElementAttributes(createdScriptElement, element);\n return createdScriptElement\n }\n}\n\nfunction copyElementAttributes(destinationElement, sourceElement) {\n for (const { name, value } of sourceElement.attributes) {\n destinationElement.setAttribute(name, value);\n }\n}\n\nfunction createDocumentFragment(html) {\n const template = document.createElement(\"template\");\n template.innerHTML = html;\n return template.content\n}\n\nfunction dispatch(eventName, { target, cancelable, detail } = {}) {\n const event = new CustomEvent(eventName, {\n cancelable,\n bubbles: true,\n composed: true,\n detail\n });\n\n if (target && target.isConnected) {\n target.dispatchEvent(event);\n } else {\n document.documentElement.dispatchEvent(event);\n }\n\n return event\n}\n\nfunction cancelEvent(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n\nfunction nextRepaint() {\n if (document.visibilityState === \"hidden\") {\n return nextEventLoopTick()\n } else {\n return nextAnimationFrame()\n }\n}\n\nfunction nextAnimationFrame() {\n return new Promise((resolve) => requestAnimationFrame(() => resolve()))\n}\n\nfunction nextEventLoopTick() {\n return new Promise((resolve) => setTimeout(() => resolve(), 0))\n}\n\nfunction parseHTMLDocument(html = \"\") {\n return new DOMParser().parseFromString(html, \"text/html\")\n}\n\nfunction unindent(strings, ...values) {\n const lines = interpolate(strings, values).replace(/^\\n/, \"\").split(\"\\n\");\n const match = lines[0].match(/^\\s+/);\n const indent = match ? match[0].length : 0;\n return lines.map((line) => line.slice(indent)).join(\"\\n\")\n}\n\nfunction interpolate(strings, values) {\n return strings.reduce((result, string, i) => {\n const value = values[i] == undefined ? \"\" : values[i];\n return result + string + value\n }, \"\")\n}\n\nfunction uuid() {\n return Array.from({ length: 36 })\n .map((_, i) => {\n if (i == 8 || i == 13 || i == 18 || i == 23) {\n return \"-\"\n } else if (i == 14) {\n return \"4\"\n } else if (i == 19) {\n return (Math.floor(Math.random() * 4) + 8).toString(16)\n } else {\n return Math.floor(Math.random() * 16).toString(16)\n }\n })\n .join(\"\")\n}\n\nfunction getAttribute(attributeName, ...elements) {\n for (const value of elements.map((element) => element?.getAttribute(attributeName))) {\n if (typeof value == \"string\") return value\n }\n\n return null\n}\n\nfunction hasAttribute(attributeName, ...elements) {\n return elements.some((element) => element && element.hasAttribute(attributeName))\n}\n\nfunction markAsBusy(...elements) {\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.setAttribute(\"busy\", \"\");\n }\n element.setAttribute(\"aria-busy\", \"true\");\n }\n}\n\nfunction clearBusyState(...elements) {\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.removeAttribute(\"busy\");\n }\n\n element.removeAttribute(\"aria-busy\");\n }\n}\n\nfunction waitForLoad(element, timeoutInMilliseconds = 2000) {\n return new Promise((resolve) => {\n const onComplete = () => {\n element.removeEventListener(\"error\", onComplete);\n element.removeEventListener(\"load\", onComplete);\n resolve();\n };\n\n element.addEventListener(\"load\", onComplete, { once: true });\n element.addEventListener(\"error\", onComplete, { once: true });\n setTimeout(resolve, timeoutInMilliseconds);\n })\n}\n\nfunction getHistoryMethodForAction(action) {\n switch (action) {\n case \"replace\":\n return history.replaceState\n case \"advance\":\n case \"restore\":\n return history.pushState\n }\n}\n\nfunction isAction(action) {\n return action == \"advance\" || action == \"replace\" || action == \"restore\"\n}\n\nfunction getVisitAction(...elements) {\n const action = getAttribute(\"data-turbo-action\", ...elements);\n\n return isAction(action) ? action : null\n}\n\nfunction getMetaElement(name) {\n return document.querySelector(`meta[name=\"${name}\"]`)\n}\n\nfunction getMetaContent(name) {\n const element = getMetaElement(name);\n return element && element.content\n}\n\nfunction getCspNonce() {\n const element = getMetaElement(\"csp-nonce\");\n\n if (element) {\n const { nonce, content } = element;\n return nonce == \"\" ? content : nonce\n }\n}\n\nfunction setMetaContent(name, content) {\n let element = getMetaElement(name);\n\n if (!element) {\n element = document.createElement(\"meta\");\n element.setAttribute(\"name\", name);\n\n document.head.appendChild(element);\n }\n\n element.setAttribute(\"content\", content);\n\n return element\n}\n\nfunction findClosestRecursively(element, selector) {\n if (element instanceof Element) {\n return (\n element.closest(selector) || findClosestRecursively(element.assignedSlot || element.getRootNode()?.host, selector)\n )\n }\n}\n\nfunction elementIsFocusable(element) {\n const inertDisabledOrHidden = \"[inert], :disabled, [hidden], details:not([open]), dialog:not([open])\";\n\n return !!element && element.closest(inertDisabledOrHidden) == null && typeof element.focus == \"function\"\n}\n\nfunction queryAutofocusableElement(elementOrDocumentFragment) {\n return Array.from(elementOrDocumentFragment.querySelectorAll(\"[autofocus]\")).find(elementIsFocusable)\n}\n\nasync function around(callback, reader) {\n const before = reader();\n\n callback();\n\n await nextAnimationFrame();\n\n const after = reader();\n\n return [before, after]\n}\n\nfunction doesNotTargetIFrame(name) {\n if (name === \"_blank\") {\n return false\n } else if (name) {\n for (const element of document.getElementsByName(name)) {\n if (element instanceof HTMLIFrameElement) return false\n }\n\n return true\n } else {\n return true\n }\n}\n\nfunction findLinkFromClickTarget(target) {\n const link = findClosestRecursively(target, \"a[href], a[xlink\\\\:href]\");\n\n if (!link) return null\n if (link.href.startsWith(\"#\")) return null\n if (link.hasAttribute(\"download\")) return null\n\n const linkTarget = link.getAttribute(\"target\");\n if (linkTarget && linkTarget !== \"_self\") return null\n\n return link\n}\n\nfunction debounce(fn, delay) {\n let timeoutId = null;\n\n return (...args) => {\n const callback = () => fn.apply(this, args);\n clearTimeout(timeoutId);\n timeoutId = setTimeout(callback, delay);\n }\n}\n\nconst submitter = {\n \"aria-disabled\": {\n beforeSubmit: submitter => {\n submitter.setAttribute(\"aria-disabled\", \"true\");\n submitter.addEventListener(\"click\", cancelEvent);\n },\n\n afterSubmit: submitter => {\n submitter.removeAttribute(\"aria-disabled\");\n submitter.removeEventListener(\"click\", cancelEvent);\n }\n },\n\n \"disabled\": {\n beforeSubmit: submitter => submitter.disabled = true,\n afterSubmit: submitter => submitter.disabled = false\n }\n};\n\nclass Config {\n #submitter = null\n\n constructor(config) {\n Object.assign(this, config);\n }\n\n get submitter() {\n return this.#submitter\n }\n\n set submitter(value) {\n this.#submitter = submitter[value] || value;\n }\n}\n\nconst forms = new Config({\n mode: \"on\",\n submitter: \"disabled\"\n});\n\nconst config = {\n drive,\n forms\n};\n\nfunction expandURL(locatable) {\n return new URL(locatable.toString(), document.baseURI)\n}\n\nfunction getAnchor(url) {\n let anchorMatch;\n if (url.hash) {\n return url.hash.slice(1)\n // eslint-disable-next-line no-cond-assign\n } else if ((anchorMatch = url.href.match(/#(.*)$/))) {\n return anchorMatch[1]\n }\n}\n\nfunction getAction$1(form, submitter) {\n const action = submitter?.getAttribute(\"formaction\") || form.getAttribute(\"action\") || form.action;\n\n return expandURL(action)\n}\n\nfunction getExtension(url) {\n return (getLastPathComponent(url).match(/\\.[^.]*$/) || [])[0] || \"\"\n}\n\nfunction isPrefixedBy(baseURL, url) {\n const prefix = addTrailingSlash(url.origin + url.pathname);\n return addTrailingSlash(baseURL.href) === prefix || baseURL.href.startsWith(prefix)\n}\n\nfunction locationIsVisitable(location, rootLocation) {\n return isPrefixedBy(location, rootLocation) && !config.drive.unvisitableExtensions.has(getExtension(location))\n}\n\nfunction getLocationForLink(link) {\n return expandURL(link.getAttribute(\"href\") || \"\")\n}\n\nfunction getRequestURL(url) {\n const anchor = getAnchor(url);\n return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href\n}\n\nfunction toCacheKey(url) {\n return getRequestURL(url)\n}\n\nfunction urlsAreEqual(left, right) {\n return expandURL(left).href == expandURL(right).href\n}\n\nfunction getPathComponents(url) {\n return url.pathname.split(\"/\").slice(1)\n}\n\nfunction getLastPathComponent(url) {\n return getPathComponents(url).slice(-1)[0]\n}\n\nfunction addTrailingSlash(value) {\n return value.endsWith(\"/\") ? value : value + \"/\"\n}\n\nclass FetchResponse {\n constructor(response) {\n this.response = response;\n }\n\n get succeeded() {\n return this.response.ok\n }\n\n get failed() {\n return !this.succeeded\n }\n\n get clientError() {\n return this.statusCode >= 400 && this.statusCode <= 499\n }\n\n get serverError() {\n return this.statusCode >= 500 && this.statusCode <= 599\n }\n\n get redirected() {\n return this.response.redirected\n }\n\n get location() {\n return expandURL(this.response.url)\n }\n\n get isHTML() {\n return this.contentType && this.contentType.match(/^(?:text\\/([^\\s;,]+\\b)?html|application\\/xhtml\\+xml)\\b/)\n }\n\n get statusCode() {\n return this.response.status\n }\n\n get contentType() {\n return this.header(\"Content-Type\")\n }\n\n get responseText() {\n return this.response.clone().text()\n }\n\n get responseHTML() {\n if (this.isHTML) {\n return this.response.clone().text()\n } else {\n return Promise.resolve(undefined)\n }\n }\n\n header(name) {\n return this.response.headers.get(name)\n }\n}\n\nclass LimitedSet extends Set {\n constructor(maxSize) {\n super();\n this.maxSize = maxSize;\n }\n\n add(value) {\n if (this.size >= this.maxSize) {\n const iterator = this.values();\n const oldestValue = iterator.next().value;\n this.delete(oldestValue);\n }\n super.add(value);\n }\n}\n\nconst recentRequests = new LimitedSet(20);\n\nfunction fetchWithTurboHeaders(url, options = {}) {\n const modifiedHeaders = new Headers(options.headers || {});\n const requestUID = uuid();\n recentRequests.add(requestUID);\n modifiedHeaders.append(\"X-Turbo-Request-Id\", requestUID);\n\n return window.fetch(url, {\n ...options,\n headers: modifiedHeaders\n })\n}\n\nfunction fetchMethodFromString(method) {\n switch (method.toLowerCase()) {\n case \"get\":\n return FetchMethod.get\n case \"post\":\n return FetchMethod.post\n case \"put\":\n return FetchMethod.put\n case \"patch\":\n return FetchMethod.patch\n case \"delete\":\n return FetchMethod.delete\n }\n}\n\nconst FetchMethod = {\n get: \"get\",\n post: \"post\",\n put: \"put\",\n patch: \"patch\",\n delete: \"delete\"\n};\n\nfunction fetchEnctypeFromString(encoding) {\n switch (encoding.toLowerCase()) {\n case FetchEnctype.multipart:\n return FetchEnctype.multipart\n case FetchEnctype.plain:\n return FetchEnctype.plain\n default:\n return FetchEnctype.urlEncoded\n }\n}\n\nconst FetchEnctype = {\n urlEncoded: \"application/x-www-form-urlencoded\",\n multipart: \"multipart/form-data\",\n plain: \"text/plain\"\n};\n\nclass FetchRequest {\n abortController = new AbortController()\n #resolveRequestPromise = (_value) => {}\n\n constructor(delegate, method, location, requestBody = new URLSearchParams(), target = null, enctype = FetchEnctype.urlEncoded) {\n const [url, body] = buildResourceAndBody(expandURL(location), method, requestBody, enctype);\n\n this.delegate = delegate;\n this.url = url;\n this.target = target;\n this.fetchOptions = {\n credentials: \"same-origin\",\n redirect: \"follow\",\n method: method.toUpperCase(),\n headers: { ...this.defaultHeaders },\n body: body,\n signal: this.abortSignal,\n referrer: this.delegate.referrer?.href\n };\n this.enctype = enctype;\n }\n\n get method() {\n return this.fetchOptions.method\n }\n\n set method(value) {\n const fetchBody = this.isSafe ? this.url.searchParams : this.fetchOptions.body || new FormData();\n const fetchMethod = fetchMethodFromString(value) || FetchMethod.get;\n\n this.url.search = \"\";\n\n const [url, body] = buildResourceAndBody(this.url, fetchMethod, fetchBody, this.enctype);\n\n this.url = url;\n this.fetchOptions.body = body;\n this.fetchOptions.method = fetchMethod.toUpperCase();\n }\n\n get headers() {\n return this.fetchOptions.headers\n }\n\n set headers(value) {\n this.fetchOptions.headers = value;\n }\n\n get body() {\n if (this.isSafe) {\n return this.url.searchParams\n } else {\n return this.fetchOptions.body\n }\n }\n\n set body(value) {\n this.fetchOptions.body = value;\n }\n\n get location() {\n return this.url\n }\n\n get params() {\n return this.url.searchParams\n }\n\n get entries() {\n return this.body ? Array.from(this.body.entries()) : []\n }\n\n cancel() {\n this.abortController.abort();\n }\n\n async perform() {\n const { fetchOptions } = this;\n this.delegate.prepareRequest(this);\n const event = await this.#allowRequestToBeIntercepted(fetchOptions);\n try {\n this.delegate.requestStarted(this);\n\n if (event.detail.fetchRequest) {\n this.response = event.detail.fetchRequest.response;\n } else {\n this.response = fetchWithTurboHeaders(this.url.href, fetchOptions);\n }\n\n const response = await this.response;\n return await this.receive(response)\n } catch (error) {\n if (error.name !== \"AbortError\") {\n if (this.#willDelegateErrorHandling(error)) {\n this.delegate.requestErrored(this, error);\n }\n throw error\n }\n } finally {\n this.delegate.requestFinished(this);\n }\n }\n\n async receive(response) {\n const fetchResponse = new FetchResponse(response);\n const event = dispatch(\"turbo:before-fetch-response\", {\n cancelable: true,\n detail: { fetchResponse },\n target: this.target\n });\n if (event.defaultPrevented) {\n this.delegate.requestPreventedHandlingResponse(this, fetchResponse);\n } else if (fetchResponse.succeeded) {\n this.delegate.requestSucceededWithResponse(this, fetchResponse);\n } else {\n this.delegate.requestFailedWithResponse(this, fetchResponse);\n }\n return fetchResponse\n }\n\n get defaultHeaders() {\n return {\n Accept: \"text/html, application/xhtml+xml\"\n }\n }\n\n get isSafe() {\n return isSafe(this.method)\n }\n\n get abortSignal() {\n return this.abortController.signal\n }\n\n acceptResponseType(mimeType) {\n this.headers[\"Accept\"] = [mimeType, this.headers[\"Accept\"]].join(\", \");\n }\n\n async #allowRequestToBeIntercepted(fetchOptions) {\n const requestInterception = new Promise((resolve) => (this.#resolveRequestPromise = resolve));\n const event = dispatch(\"turbo:before-fetch-request\", {\n cancelable: true,\n detail: {\n fetchOptions,\n url: this.url,\n resume: this.#resolveRequestPromise\n },\n target: this.target\n });\n this.url = event.detail.url;\n if (event.defaultPrevented) await requestInterception;\n\n return event\n }\n\n #willDelegateErrorHandling(error) {\n const event = dispatch(\"turbo:fetch-request-error\", {\n target: this.target,\n cancelable: true,\n detail: { request: this, error: error }\n });\n\n return !event.defaultPrevented\n }\n}\n\nfunction isSafe(fetchMethod) {\n return fetchMethodFromString(fetchMethod) == FetchMethod.get\n}\n\nfunction buildResourceAndBody(resource, method, requestBody, enctype) {\n const searchParams =\n Array.from(requestBody).length > 0 ? new URLSearchParams(entriesExcludingFiles(requestBody)) : resource.searchParams;\n\n if (isSafe(method)) {\n return [mergeIntoURLSearchParams(resource, searchParams), null]\n } else if (enctype == FetchEnctype.urlEncoded) {\n return [resource, searchParams]\n } else {\n return [resource, requestBody]\n }\n}\n\nfunction entriesExcludingFiles(requestBody) {\n const entries = [];\n\n for (const [name, value] of requestBody) {\n if (value instanceof File) continue\n else entries.push([name, value]);\n }\n\n return entries\n}\n\nfunction mergeIntoURLSearchParams(url, requestBody) {\n const searchParams = new URLSearchParams(entriesExcludingFiles(requestBody));\n\n url.search = searchParams.toString();\n\n return url\n}\n\nclass AppearanceObserver {\n started = false\n\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n this.intersectionObserver = new IntersectionObserver(this.intersect);\n }\n\n start() {\n if (!this.started) {\n this.started = true;\n this.intersectionObserver.observe(this.element);\n }\n }\n\n stop() {\n if (this.started) {\n this.started = false;\n this.intersectionObserver.unobserve(this.element);\n }\n }\n\n intersect = (entries) => {\n const lastEntry = entries.slice(-1)[0];\n if (lastEntry?.isIntersecting) {\n this.delegate.elementAppearedInViewport(this.element);\n }\n }\n}\n\nclass StreamMessage {\n static contentType = \"text/vnd.turbo-stream.html\"\n\n static wrap(message) {\n if (typeof message == \"string\") {\n return new this(createDocumentFragment(message))\n } else {\n return message\n }\n }\n\n constructor(fragment) {\n this.fragment = importStreamElements(fragment);\n }\n}\n\nfunction importStreamElements(fragment) {\n for (const element of fragment.querySelectorAll(\"turbo-stream\")) {\n const streamElement = document.importNode(element, true);\n\n for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll(\"script\")) {\n inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));\n }\n\n element.replaceWith(streamElement);\n }\n\n return fragment\n}\n\nconst identity = key => key;\n\nclass LRUCache {\n keys = []\n entries = {}\n #toCacheKey\n\n constructor(size, toCacheKey = identity) {\n this.size = size;\n this.#toCacheKey = toCacheKey;\n }\n\n has(key) {\n return this.#toCacheKey(key) in this.entries\n }\n\n get(key) {\n if (this.has(key)) {\n const entry = this.read(key);\n this.touch(key);\n return entry\n }\n }\n\n put(key, entry) {\n this.write(key, entry);\n this.touch(key);\n return entry\n }\n\n clear() {\n for (const key of Object.keys(this.entries)) {\n this.evict(key);\n }\n }\n\n // Private\n\n read(key) {\n return this.entries[this.#toCacheKey(key)]\n }\n\n write(key, entry) {\n this.entries[this.#toCacheKey(key)] = entry;\n }\n\n touch(key) {\n key = this.#toCacheKey(key);\n const index = this.keys.indexOf(key);\n if (index > -1) this.keys.splice(index, 1);\n this.keys.unshift(key);\n this.trim();\n }\n\n trim() {\n for (const key of this.keys.splice(this.size)) {\n this.evict(key);\n }\n }\n\n evict(key) {\n delete this.entries[key];\n }\n}\n\nconst PREFETCH_DELAY = 100;\n\nclass PrefetchCache extends LRUCache {\n #prefetchTimeout = null\n #maxAges = {}\n\n constructor(size = 1, prefetchDelay = PREFETCH_DELAY) {\n super(size, toCacheKey);\n this.prefetchDelay = prefetchDelay;\n }\n\n putLater(url, request, ttl) {\n this.#prefetchTimeout = setTimeout(() => {\n request.perform();\n this.put(url, request, ttl);\n this.#prefetchTimeout = null;\n }, this.prefetchDelay);\n }\n\n put(url, request, ttl = cacheTtl) {\n super.put(url, request);\n this.#maxAges[toCacheKey(url)] = new Date(new Date().getTime() + ttl);\n }\n\n clear() {\n super.clear();\n if (this.#prefetchTimeout) clearTimeout(this.#prefetchTimeout);\n }\n\n evict(key) {\n super.evict(key);\n delete this.#maxAges[key];\n }\n\n has(key) {\n if (super.has(key)) {\n const maxAge = this.#maxAges[toCacheKey(key)];\n\n return maxAge && maxAge > Date.now()\n } else {\n return false\n }\n }\n}\n\nconst cacheTtl = 10 * 1000;\nconst prefetchCache = new PrefetchCache();\n\nconst FormSubmissionState = {\n initialized: \"initialized\",\n requesting: \"requesting\",\n waiting: \"waiting\",\n receiving: \"receiving\",\n stopping: \"stopping\",\n stopped: \"stopped\"\n};\n\nclass FormSubmission {\n state = FormSubmissionState.initialized\n\n static confirmMethod(message) {\n return Promise.resolve(confirm(message))\n }\n\n constructor(delegate, formElement, submitter, mustRedirect = false) {\n const method = getMethod(formElement, submitter);\n const action = getAction(getFormAction(formElement, submitter), method);\n const body = buildFormData(formElement, submitter);\n const enctype = getEnctype(formElement, submitter);\n\n this.delegate = delegate;\n this.formElement = formElement;\n this.submitter = submitter;\n this.fetchRequest = new FetchRequest(this, method, action, body, formElement, enctype);\n this.mustRedirect = mustRedirect;\n }\n\n get method() {\n return this.fetchRequest.method\n }\n\n set method(value) {\n this.fetchRequest.method = value;\n }\n\n get action() {\n return this.fetchRequest.url.toString()\n }\n\n set action(value) {\n this.fetchRequest.url = expandURL(value);\n }\n\n get body() {\n return this.fetchRequest.body\n }\n\n get enctype() {\n return this.fetchRequest.enctype\n }\n\n get isSafe() {\n return this.fetchRequest.isSafe\n }\n\n get location() {\n return this.fetchRequest.url\n }\n\n // The submission process\n\n async start() {\n const { initialized, requesting } = FormSubmissionState;\n const confirmationMessage = getAttribute(\"data-turbo-confirm\", this.submitter, this.formElement);\n\n if (typeof confirmationMessage === \"string\") {\n const confirmMethod = typeof config.forms.confirm === \"function\" ?\n config.forms.confirm :\n FormSubmission.confirmMethod;\n\n const answer = await confirmMethod(confirmationMessage, this.formElement, this.submitter);\n if (!answer) {\n return\n }\n }\n\n if (this.state == initialized) {\n this.state = requesting;\n return this.fetchRequest.perform()\n }\n }\n\n stop() {\n const { stopping, stopped } = FormSubmissionState;\n if (this.state != stopping && this.state != stopped) {\n this.state = stopping;\n this.fetchRequest.cancel();\n return true\n }\n }\n\n // Fetch request delegate\n\n prepareRequest(request) {\n if (!request.isSafe) {\n const token = getCookieValue(getMetaContent(\"csrf-param\")) || getMetaContent(\"csrf-token\");\n if (token) {\n request.headers[\"X-CSRF-Token\"] = token;\n }\n }\n\n if (this.requestAcceptsTurboStreamResponse(request)) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted(_request) {\n this.state = FormSubmissionState.waiting;\n if (this.submitter) config.forms.submitter.beforeSubmit(this.submitter);\n this.setSubmitsWith();\n markAsBusy(this.formElement);\n dispatch(\"turbo:submit-start\", {\n target: this.formElement,\n detail: { formSubmission: this }\n });\n this.delegate.formSubmissionStarted(this);\n }\n\n requestPreventedHandlingResponse(request, response) {\n prefetchCache.clear();\n\n this.result = { success: response.succeeded, fetchResponse: response };\n }\n\n requestSucceededWithResponse(request, response) {\n if (response.clientError || response.serverError) {\n this.delegate.formSubmissionFailedWithResponse(this, response);\n return\n }\n\n prefetchCache.clear();\n\n if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {\n const error = new Error(\"Form responses must redirect to another location\");\n this.delegate.formSubmissionErrored(this, error);\n } else {\n this.state = FormSubmissionState.receiving;\n this.result = { success: true, fetchResponse: response };\n this.delegate.formSubmissionSucceededWithResponse(this, response);\n }\n }\n\n requestFailedWithResponse(request, response) {\n this.result = { success: false, fetchResponse: response };\n this.delegate.formSubmissionFailedWithResponse(this, response);\n }\n\n requestErrored(request, error) {\n this.result = { success: false, error };\n this.delegate.formSubmissionErrored(this, error);\n }\n\n requestFinished(_request) {\n this.state = FormSubmissionState.stopped;\n if (this.submitter) config.forms.submitter.afterSubmit(this.submitter);\n this.resetSubmitterText();\n clearBusyState(this.formElement);\n dispatch(\"turbo:submit-end\", {\n target: this.formElement,\n detail: { formSubmission: this, ...this.result }\n });\n this.delegate.formSubmissionFinished(this);\n }\n\n // Private\n\n setSubmitsWith() {\n if (!this.submitter || !this.submitsWith) return\n\n if (this.submitter.matches(\"button\")) {\n this.originalSubmitText = this.submitter.innerHTML;\n this.submitter.innerHTML = this.submitsWith;\n } else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n this.originalSubmitText = input.value;\n input.value = this.submitsWith;\n }\n }\n\n resetSubmitterText() {\n if (!this.submitter || !this.originalSubmitText) return\n\n if (this.submitter.matches(\"button\")) {\n this.submitter.innerHTML = this.originalSubmitText;\n } else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n input.value = this.originalSubmitText;\n }\n }\n\n requestMustRedirect(request) {\n return !request.isSafe && this.mustRedirect\n }\n\n requestAcceptsTurboStreamResponse(request) {\n return !request.isSafe || hasAttribute(\"data-turbo-stream\", this.submitter, this.formElement)\n }\n\n get submitsWith() {\n return this.submitter?.getAttribute(\"data-turbo-submits-with\")\n }\n}\n\nfunction buildFormData(formElement, submitter) {\n const formData = new FormData(formElement);\n const name = submitter?.getAttribute(\"name\");\n const value = submitter?.getAttribute(\"value\");\n\n if (name) {\n formData.append(name, value || \"\");\n }\n\n return formData\n}\n\nfunction getCookieValue(cookieName) {\n if (cookieName != null) {\n const cookies = document.cookie ? document.cookie.split(\"; \") : [];\n const cookie = cookies.find((cookie) => cookie.startsWith(cookieName));\n if (cookie) {\n const value = cookie.split(\"=\").slice(1).join(\"=\");\n return value ? decodeURIComponent(value) : undefined\n }\n }\n}\n\nfunction responseSucceededWithoutRedirect(response) {\n return response.statusCode == 200 && !response.redirected\n}\n\nfunction getFormAction(formElement, submitter) {\n const formElementAction = typeof formElement.action === \"string\" ? formElement.action : null;\n\n if (submitter?.hasAttribute(\"formaction\")) {\n return submitter.getAttribute(\"formaction\") || \"\"\n } else {\n return formElement.getAttribute(\"action\") || formElementAction || \"\"\n }\n}\n\nfunction getAction(formAction, fetchMethod) {\n const action = expandURL(formAction);\n\n if (isSafe(fetchMethod)) {\n action.search = \"\";\n }\n\n return action\n}\n\nfunction getMethod(formElement, submitter) {\n const method = submitter?.getAttribute(\"formmethod\") || formElement.getAttribute(\"method\") || \"\";\n return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get\n}\n\nfunction getEnctype(formElement, submitter) {\n return fetchEnctypeFromString(submitter?.getAttribute(\"formenctype\") || formElement.enctype)\n}\n\nclass Snapshot {\n constructor(element) {\n this.element = element;\n }\n\n get activeElement() {\n return this.element.ownerDocument.activeElement\n }\n\n get children() {\n return [...this.element.children]\n }\n\n hasAnchor(anchor) {\n return this.getElementForAnchor(anchor) != null\n }\n\n getElementForAnchor(anchor) {\n return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null\n }\n\n get isConnected() {\n return this.element.isConnected\n }\n\n get firstAutofocusableElement() {\n return queryAutofocusableElement(this.element)\n }\n\n get permanentElements() {\n return queryPermanentElementsAll(this.element)\n }\n\n getPermanentElementById(id) {\n return getPermanentElementById(this.element, id)\n }\n\n getPermanentElementMapForSnapshot(snapshot) {\n const permanentElementMap = {};\n\n for (const currentPermanentElement of this.permanentElements) {\n const { id } = currentPermanentElement;\n const newPermanentElement = snapshot.getPermanentElementById(id);\n if (newPermanentElement) {\n permanentElementMap[id] = [currentPermanentElement, newPermanentElement];\n }\n }\n\n return permanentElementMap\n }\n}\n\nfunction getPermanentElementById(node, id) {\n return node.querySelector(`#${id}[data-turbo-permanent]`)\n}\n\nfunction queryPermanentElementsAll(node) {\n return node.querySelectorAll(\"[id][data-turbo-permanent]\")\n}\n\nclass FormSubmitObserver {\n started = false\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"submit\", this.submitCaptured, true);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"submit\", this.submitCaptured, true);\n this.started = false;\n }\n }\n\n submitCaptured = () => {\n this.eventTarget.removeEventListener(\"submit\", this.submitBubbled, false);\n this.eventTarget.addEventListener(\"submit\", this.submitBubbled, false);\n }\n\n submitBubbled = (event) => {\n if (!event.defaultPrevented) {\n const form = event.target instanceof HTMLFormElement ? event.target : undefined;\n const submitter = event.submitter || undefined;\n\n if (\n form &&\n submissionDoesNotDismissDialog(form, submitter) &&\n submissionDoesNotTargetIFrame(form, submitter) &&\n this.delegate.willSubmitForm(form, submitter)\n ) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.delegate.formSubmitted(form, submitter);\n }\n }\n }\n}\n\nfunction submissionDoesNotDismissDialog(form, submitter) {\n const method = submitter?.getAttribute(\"formmethod\") || form.getAttribute(\"method\");\n\n return method != \"dialog\"\n}\n\nfunction submissionDoesNotTargetIFrame(form, submitter) {\n const target = submitter?.getAttribute(\"formtarget\") || form.getAttribute(\"target\");\n\n return doesNotTargetIFrame(target)\n}\n\nclass View {\n #resolveRenderPromise = (_value) => {}\n #resolveInterceptionPromise = (_value) => {}\n\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n }\n\n // Scrolling\n\n scrollToAnchor(anchor) {\n const element = this.snapshot.getElementForAnchor(anchor);\n if (element) {\n this.focusElement(element);\n this.scrollToElement(element);\n } else {\n this.scrollToPosition({ x: 0, y: 0 });\n }\n }\n\n scrollToAnchorFromLocation(location) {\n this.scrollToAnchor(getAnchor(location));\n }\n\n scrollToElement(element) {\n element.scrollIntoView();\n }\n\n focusElement(element) {\n if (element instanceof HTMLElement) {\n if (element.hasAttribute(\"tabindex\")) {\n element.focus();\n } else {\n element.setAttribute(\"tabindex\", \"-1\");\n element.focus();\n element.removeAttribute(\"tabindex\");\n }\n }\n }\n\n scrollToPosition({ x, y }) {\n this.scrollRoot.scrollTo(x, y);\n }\n\n scrollToTop() {\n this.scrollToPosition({ x: 0, y: 0 });\n }\n\n get scrollRoot() {\n return window\n }\n\n // Rendering\n\n async render(renderer) {\n const { isPreview, shouldRender, willRender, newSnapshot: snapshot } = renderer;\n\n // A workaround to ignore tracked element mismatch reloads when performing\n // a promoted Visit from a frame navigation\n const shouldInvalidate = willRender;\n\n if (shouldRender) {\n try {\n this.renderPromise = new Promise((resolve) => (this.#resolveRenderPromise = resolve));\n this.renderer = renderer;\n await this.prepareToRenderSnapshot(renderer);\n\n const renderInterception = new Promise((resolve) => (this.#resolveInterceptionPromise = resolve));\n const options = { resume: this.#resolveInterceptionPromise, render: this.renderer.renderElement, renderMethod: this.renderer.renderMethod };\n const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);\n if (!immediateRender) await renderInterception;\n\n await this.renderSnapshot(renderer);\n this.delegate.viewRenderedSnapshot(snapshot, isPreview, this.renderer.renderMethod);\n this.delegate.preloadOnLoadLinksForView(this.element);\n this.finishRenderingSnapshot(renderer);\n } finally {\n delete this.renderer;\n this.#resolveRenderPromise(undefined);\n delete this.renderPromise;\n }\n } else if (shouldInvalidate) {\n this.invalidate(renderer.reloadReason);\n }\n }\n\n invalidate(reason) {\n this.delegate.viewInvalidated(reason);\n }\n\n async prepareToRenderSnapshot(renderer) {\n this.markAsPreview(renderer.isPreview);\n await renderer.prepareToRender();\n }\n\n markAsPreview(isPreview) {\n if (isPreview) {\n this.element.setAttribute(\"data-turbo-preview\", \"\");\n } else {\n this.element.removeAttribute(\"data-turbo-preview\");\n }\n }\n\n markVisitDirection(direction) {\n this.element.setAttribute(\"data-turbo-visit-direction\", direction);\n }\n\n unmarkVisitDirection() {\n this.element.removeAttribute(\"data-turbo-visit-direction\");\n }\n\n async renderSnapshot(renderer) {\n await renderer.render();\n }\n\n finishRenderingSnapshot(renderer) {\n renderer.finishRendering();\n }\n}\n\nclass FrameView extends View {\n missing() {\n this.element.innerHTML = `Content missing`;\n }\n\n get snapshot() {\n return new Snapshot(this.element)\n }\n}\n\nclass LinkInterceptor {\n constructor(delegate, element) {\n this.delegate = delegate;\n this.element = element;\n }\n\n start() {\n this.element.addEventListener(\"click\", this.clickBubbled);\n document.addEventListener(\"turbo:click\", this.linkClicked);\n document.addEventListener(\"turbo:before-visit\", this.willVisit);\n }\n\n stop() {\n this.element.removeEventListener(\"click\", this.clickBubbled);\n document.removeEventListener(\"turbo:click\", this.linkClicked);\n document.removeEventListener(\"turbo:before-visit\", this.willVisit);\n }\n\n clickBubbled = (event) => {\n if (this.clickEventIsSignificant(event)) {\n this.clickEvent = event;\n } else {\n delete this.clickEvent;\n }\n }\n\n linkClicked = (event) => {\n if (this.clickEvent && this.clickEventIsSignificant(event)) {\n if (this.delegate.shouldInterceptLinkClick(event.target, event.detail.url, event.detail.originalEvent)) {\n this.clickEvent.preventDefault();\n event.preventDefault();\n this.delegate.linkClickIntercepted(event.target, event.detail.url, event.detail.originalEvent);\n }\n }\n delete this.clickEvent;\n }\n\n willVisit = (_event) => {\n delete this.clickEvent;\n }\n\n clickEventIsSignificant(event) {\n const target = event.composed ? event.target?.parentElement : event.target;\n const element = findLinkFromClickTarget(target) || target;\n\n return element instanceof Element && element.closest(\"turbo-frame, html\") == this.element\n }\n}\n\nclass LinkClickObserver {\n started = false\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"click\", this.clickCaptured, true);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"click\", this.clickCaptured, true);\n this.started = false;\n }\n }\n\n clickCaptured = () => {\n this.eventTarget.removeEventListener(\"click\", this.clickBubbled, false);\n this.eventTarget.addEventListener(\"click\", this.clickBubbled, false);\n }\n\n clickBubbled = (event) => {\n if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {\n const target = (event.composedPath && event.composedPath()[0]) || event.target;\n const link = findLinkFromClickTarget(target);\n if (link && doesNotTargetIFrame(link.target)) {\n const location = getLocationForLink(link);\n if (this.delegate.willFollowLinkToLocation(link, location, event)) {\n event.preventDefault();\n this.delegate.followedLinkToLocation(link, location);\n }\n }\n }\n }\n\n clickEventIsSignificant(event) {\n return !(\n (event.target && event.target.isContentEditable) ||\n event.defaultPrevented ||\n event.which > 1 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n )\n }\n}\n\nclass FormLinkClickObserver {\n constructor(delegate, element) {\n this.delegate = delegate;\n this.linkInterceptor = new LinkClickObserver(this, element);\n }\n\n start() {\n this.linkInterceptor.start();\n }\n\n stop() {\n this.linkInterceptor.stop();\n }\n\n // Link hover observer delegate\n\n canPrefetchRequestToLocation(link, location) {\n return false\n }\n\n prefetchAndCacheRequestToLocation(link, location) {\n return\n }\n\n // Link click observer delegate\n\n willFollowLinkToLocation(link, location, originalEvent) {\n return (\n this.delegate.willSubmitFormLinkToLocation(link, location, originalEvent) &&\n (link.hasAttribute(\"data-turbo-method\") || link.hasAttribute(\"data-turbo-stream\"))\n )\n }\n\n followedLinkToLocation(link, location) {\n const form = document.createElement(\"form\");\n\n const type = \"hidden\";\n for (const [name, value] of location.searchParams) {\n form.append(Object.assign(document.createElement(\"input\"), { type, name, value }));\n }\n\n const action = Object.assign(location, { search: \"\" });\n form.setAttribute(\"data-turbo\", \"true\");\n form.setAttribute(\"action\", action.href);\n form.setAttribute(\"hidden\", \"\");\n\n const method = link.getAttribute(\"data-turbo-method\");\n if (method) form.setAttribute(\"method\", method);\n\n const turboFrame = link.getAttribute(\"data-turbo-frame\");\n if (turboFrame) form.setAttribute(\"data-turbo-frame\", turboFrame);\n\n const turboAction = getVisitAction(link);\n if (turboAction) form.setAttribute(\"data-turbo-action\", turboAction);\n\n const turboConfirm = link.getAttribute(\"data-turbo-confirm\");\n if (turboConfirm) form.setAttribute(\"data-turbo-confirm\", turboConfirm);\n\n const turboStream = link.hasAttribute(\"data-turbo-stream\");\n if (turboStream) form.setAttribute(\"data-turbo-stream\", \"\");\n\n this.delegate.submittedFormLinkToLocation(link, location, form);\n\n document.body.appendChild(form);\n form.addEventListener(\"turbo:submit-end\", () => form.remove(), { once: true });\n requestAnimationFrame(() => form.requestSubmit());\n }\n}\n\nclass Bardo {\n static async preservingPermanentElements(delegate, permanentElementMap, callback) {\n const bardo = new this(delegate, permanentElementMap);\n bardo.enter();\n await callback();\n bardo.leave();\n }\n\n constructor(delegate, permanentElementMap) {\n this.delegate = delegate;\n this.permanentElementMap = permanentElementMap;\n }\n\n enter() {\n for (const id in this.permanentElementMap) {\n const [currentPermanentElement, newPermanentElement] = this.permanentElementMap[id];\n this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);\n this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);\n }\n }\n\n leave() {\n for (const id in this.permanentElementMap) {\n const [currentPermanentElement] = this.permanentElementMap[id];\n this.replaceCurrentPermanentElementWithClone(currentPermanentElement);\n this.replacePlaceholderWithPermanentElement(currentPermanentElement);\n this.delegate.leavingBardo(currentPermanentElement);\n }\n }\n\n replaceNewPermanentElementWithPlaceholder(permanentElement) {\n const placeholder = createPlaceholderForPermanentElement(permanentElement);\n permanentElement.replaceWith(placeholder);\n }\n\n replaceCurrentPermanentElementWithClone(permanentElement) {\n const clone = permanentElement.cloneNode(true);\n permanentElement.replaceWith(clone);\n }\n\n replacePlaceholderWithPermanentElement(permanentElement) {\n const placeholder = this.getPlaceholderById(permanentElement.id);\n placeholder?.replaceWith(permanentElement);\n }\n\n getPlaceholderById(id) {\n return this.placeholders.find((element) => element.content == id)\n }\n\n get placeholders() {\n return [...document.querySelectorAll(\"meta[name=turbo-permanent-placeholder][content]\")]\n }\n}\n\nfunction createPlaceholderForPermanentElement(permanentElement) {\n const element = document.createElement(\"meta\");\n element.setAttribute(\"name\", \"turbo-permanent-placeholder\");\n element.setAttribute(\"content\", permanentElement.id);\n return element\n}\n\nclass Renderer {\n #activeElement = null\n\n static renderElement(currentElement, newElement) {\n // Abstract method\n }\n\n constructor(currentSnapshot, newSnapshot, isPreview, willRender = true) {\n this.currentSnapshot = currentSnapshot;\n this.newSnapshot = newSnapshot;\n this.isPreview = isPreview;\n this.willRender = willRender;\n this.renderElement = this.constructor.renderElement;\n this.promise = new Promise((resolve, reject) => (this.resolvingFunctions = { resolve, reject }));\n }\n\n get shouldRender() {\n return true\n }\n\n get shouldAutofocus() {\n return true\n }\n\n get reloadReason() {\n return\n }\n\n prepareToRender() {\n return\n }\n\n render() {\n // Abstract method\n }\n\n finishRendering() {\n if (this.resolvingFunctions) {\n this.resolvingFunctions.resolve();\n delete this.resolvingFunctions;\n }\n }\n\n async preservingPermanentElements(callback) {\n await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback);\n }\n\n focusFirstAutofocusableElement() {\n if (this.shouldAutofocus) {\n const element = this.connectedSnapshot.firstAutofocusableElement;\n if (element) {\n element.focus();\n }\n }\n }\n\n // Bardo delegate\n\n enteringBardo(currentPermanentElement) {\n if (this.#activeElement) return\n\n if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {\n this.#activeElement = this.currentSnapshot.activeElement;\n }\n }\n\n leavingBardo(currentPermanentElement) {\n if (currentPermanentElement.contains(this.#activeElement) && this.#activeElement instanceof HTMLElement) {\n this.#activeElement.focus();\n\n this.#activeElement = null;\n }\n }\n\n get connectedSnapshot() {\n return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot\n }\n\n get currentElement() {\n return this.currentSnapshot.element\n }\n\n get newElement() {\n return this.newSnapshot.element\n }\n\n get permanentElementMap() {\n return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)\n }\n\n get renderMethod() {\n return \"replace\"\n }\n}\n\nclass FrameRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n const destinationRange = document.createRange();\n destinationRange.selectNodeContents(currentElement);\n destinationRange.deleteContents();\n\n const frameElement = newElement;\n const sourceRange = frameElement.ownerDocument?.createRange();\n if (sourceRange) {\n sourceRange.selectNodeContents(frameElement);\n currentElement.appendChild(sourceRange.extractContents());\n }\n }\n\n constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);\n this.delegate = delegate;\n }\n\n get shouldRender() {\n return true\n }\n\n async render() {\n await nextRepaint();\n this.preservingPermanentElements(() => {\n this.loadFrameElement();\n });\n this.scrollFrameIntoView();\n await nextRepaint();\n this.focusFirstAutofocusableElement();\n await nextRepaint();\n this.activateScriptElements();\n }\n\n loadFrameElement() {\n this.delegate.willRenderFrame(this.currentElement, this.newElement);\n this.renderElement(this.currentElement, this.newElement);\n }\n\n scrollFrameIntoView() {\n if (this.currentElement.autoscroll || this.newElement.autoscroll) {\n const element = this.currentElement.firstElementChild;\n const block = readScrollLogicalPosition(this.currentElement.getAttribute(\"data-autoscroll-block\"), \"end\");\n const behavior = readScrollBehavior(this.currentElement.getAttribute(\"data-autoscroll-behavior\"), \"auto\");\n\n if (element) {\n element.scrollIntoView({ block, behavior });\n return true\n }\n }\n return false\n }\n\n activateScriptElements() {\n for (const inertScriptElement of this.newScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n\n get newScriptElements() {\n return this.currentElement.querySelectorAll(\"script\")\n }\n}\n\nfunction readScrollLogicalPosition(value, defaultValue) {\n if (value == \"end\" || value == \"start\" || value == \"center\" || value == \"nearest\") {\n return value\n } else {\n return defaultValue\n }\n}\n\nfunction readScrollBehavior(value, defaultValue) {\n if (value == \"auto\" || value == \"smooth\") {\n return value\n } else {\n return defaultValue\n }\n}\n\n/**\n * @typedef {object} ConfigHead\n *\n * @property {'merge' | 'append' | 'morph' | 'none'} [style]\n * @property {boolean} [block]\n * @property {boolean} [ignore]\n * @property {function(Element): boolean} [shouldPreserve]\n * @property {function(Element): boolean} [shouldReAppend]\n * @property {function(Element): boolean} [shouldRemove]\n * @property {function(Element, {added: Node[], kept: Element[], removed: Element[]}): void} [afterHeadMorphed]\n */\n\n/**\n * @typedef {object} ConfigCallbacks\n *\n * @property {function(Node): boolean} [beforeNodeAdded]\n * @property {function(Node): void} [afterNodeAdded]\n * @property {function(Element, Node): boolean} [beforeNodeMorphed]\n * @property {function(Element, Node): void} [afterNodeMorphed]\n * @property {function(Element): boolean} [beforeNodeRemoved]\n * @property {function(Element): void} [afterNodeRemoved]\n * @property {function(string, Element, \"update\" | \"remove\"): boolean} [beforeAttributeUpdated]\n */\n\n/**\n * @typedef {object} Config\n *\n * @property {'outerHTML' | 'innerHTML'} [morphStyle]\n * @property {boolean} [ignoreActive]\n * @property {boolean} [ignoreActiveValue]\n * @property {boolean} [restoreFocus]\n * @property {ConfigCallbacks} [callbacks]\n * @property {ConfigHead} [head]\n */\n\n/**\n * @typedef {function} NoOp\n *\n * @returns {void}\n */\n\n/**\n * @typedef {object} ConfigHeadInternal\n *\n * @property {'merge' | 'append' | 'morph' | 'none'} style\n * @property {boolean} [block]\n * @property {boolean} [ignore]\n * @property {(function(Element): boolean) | NoOp} shouldPreserve\n * @property {(function(Element): boolean) | NoOp} shouldReAppend\n * @property {(function(Element): boolean) | NoOp} shouldRemove\n * @property {(function(Element, {added: Node[], kept: Element[], removed: Element[]}): void) | NoOp} afterHeadMorphed\n */\n\n/**\n * @typedef {object} ConfigCallbacksInternal\n *\n * @property {(function(Node): boolean) | NoOp} beforeNodeAdded\n * @property {(function(Node): void) | NoOp} afterNodeAdded\n * @property {(function(Node, Node): boolean) | NoOp} beforeNodeMorphed\n * @property {(function(Node, Node): void) | NoOp} afterNodeMorphed\n * @property {(function(Node): boolean) | NoOp} beforeNodeRemoved\n * @property {(function(Node): void) | NoOp} afterNodeRemoved\n * @property {(function(string, Element, \"update\" | \"remove\"): boolean) | NoOp} beforeAttributeUpdated\n */\n\n/**\n * @typedef {object} ConfigInternal\n *\n * @property {'outerHTML' | 'innerHTML'} morphStyle\n * @property {boolean} [ignoreActive]\n * @property {boolean} [ignoreActiveValue]\n * @property {boolean} [restoreFocus]\n * @property {ConfigCallbacksInternal} callbacks\n * @property {ConfigHeadInternal} head\n */\n\n/**\n * @typedef {Object} IdSets\n * @property {Set} persistentIds\n * @property {Map>} idMap\n */\n\n/**\n * @typedef {Function} Morph\n *\n * @param {Element | Document} oldNode\n * @param {Element | Node | HTMLCollection | Node[] | string | null} newContent\n * @param {Config} [config]\n * @returns {undefined | Node[]}\n */\n\n// base IIFE to define idiomorph\n/**\n *\n * @type {{defaults: ConfigInternal, morph: Morph}}\n */\nvar Idiomorph = (function () {\n\n /**\n * @typedef {object} MorphContext\n *\n * @property {Element} target\n * @property {Element} newContent\n * @property {ConfigInternal} config\n * @property {ConfigInternal['morphStyle']} morphStyle\n * @property {ConfigInternal['ignoreActive']} ignoreActive\n * @property {ConfigInternal['ignoreActiveValue']} ignoreActiveValue\n * @property {ConfigInternal['restoreFocus']} restoreFocus\n * @property {Map>} idMap\n * @property {Set} persistentIds\n * @property {ConfigInternal['callbacks']} callbacks\n * @property {ConfigInternal['head']} head\n * @property {HTMLDivElement} pantry\n * @property {Element[]} activeElementAndParents\n */\n\n //=============================================================================\n // AND NOW IT BEGINS...\n //=============================================================================\n\n const noOp = () => {};\n /**\n * Default configuration values, updatable by users now\n * @type {ConfigInternal}\n */\n const defaults = {\n morphStyle: \"outerHTML\",\n callbacks: {\n beforeNodeAdded: noOp,\n afterNodeAdded: noOp,\n beforeNodeMorphed: noOp,\n afterNodeMorphed: noOp,\n beforeNodeRemoved: noOp,\n afterNodeRemoved: noOp,\n beforeAttributeUpdated: noOp,\n },\n head: {\n style: \"merge\",\n shouldPreserve: (elt) => elt.getAttribute(\"im-preserve\") === \"true\",\n shouldReAppend: (elt) => elt.getAttribute(\"im-re-append\") === \"true\",\n shouldRemove: noOp,\n afterHeadMorphed: noOp,\n },\n restoreFocus: true,\n };\n\n /**\n * Core idiomorph function for morphing one DOM tree to another\n *\n * @param {Element | Document} oldNode\n * @param {Element | Node | HTMLCollection | Node[] | string | null} newContent\n * @param {Config} [config]\n * @returns {Promise | Node[]}\n */\n function morph(oldNode, newContent, config = {}) {\n oldNode = normalizeElement(oldNode);\n const newNode = normalizeParent(newContent);\n const ctx = createMorphContext(oldNode, newNode, config);\n\n const morphedNodes = saveAndRestoreFocus(ctx, () => {\n return withHeadBlocking(\n ctx,\n oldNode,\n newNode,\n /** @param {MorphContext} ctx */ (ctx) => {\n if (ctx.morphStyle === \"innerHTML\") {\n morphChildren(ctx, oldNode, newNode);\n return Array.from(oldNode.childNodes);\n } else {\n return morphOuterHTML(ctx, oldNode, newNode);\n }\n },\n );\n });\n\n ctx.pantry.remove();\n return morphedNodes;\n }\n\n /**\n * Morph just the outerHTML of the oldNode to the newContent\n * We have to be careful because the oldNode could have siblings which need to be untouched\n * @param {MorphContext} ctx\n * @param {Element} oldNode\n * @param {Element} newNode\n * @returns {Node[]}\n */\n function morphOuterHTML(ctx, oldNode, newNode) {\n const oldParent = normalizeParent(oldNode);\n morphChildren(\n ctx,\n oldParent,\n newNode,\n // these two optional params are the secret sauce\n oldNode, // start point for iteration\n oldNode.nextSibling, // end point for iteration\n );\n // this is safe even with siblings, because normalizeParent returns a SlicedParentNode if needed.\n return Array.from(oldParent.childNodes);\n }\n\n /**\n * @param {MorphContext} ctx\n * @param {Function} fn\n * @returns {Promise | Node[]}\n */\n function saveAndRestoreFocus(ctx, fn) {\n if (!ctx.config.restoreFocus) return fn();\n let activeElement =\n /** @type {HTMLInputElement|HTMLTextAreaElement|null} */ (\n document.activeElement\n );\n\n // don't bother if the active element is not an input or textarea\n if (\n !(\n activeElement instanceof HTMLInputElement ||\n activeElement instanceof HTMLTextAreaElement\n )\n ) {\n return fn();\n }\n\n const { id: activeElementId, selectionStart, selectionEnd } = activeElement;\n\n const results = fn();\n\n if (\n activeElementId &&\n activeElementId !== document.activeElement?.getAttribute(\"id\")\n ) {\n activeElement = ctx.target.querySelector(`[id=\"${activeElementId}\"]`);\n activeElement?.focus();\n }\n if (activeElement && !activeElement.selectionEnd && selectionEnd) {\n activeElement.setSelectionRange(selectionStart, selectionEnd);\n }\n\n return results;\n }\n\n const morphChildren = (function () {\n /**\n * This is the core algorithm for matching up children. The idea is to use id sets to try to match up\n * nodes as faithfully as possible. We greedily match, which allows us to keep the algorithm fast, but\n * by using id sets, we are able to better match up with content deeper in the DOM.\n *\n * Basic algorithm:\n * - for each node in the new content:\n * - search self and siblings for an id set match, falling back to a soft match\n * - if match found\n * - remove any nodes up to the match:\n * - pantry persistent nodes\n * - delete the rest\n * - morph the match\n * - elsif no match found, and node is persistent\n * - find its match by querying the old root (future) and pantry (past)\n * - move it and its children here\n * - morph it\n * - else\n * - create a new node from scratch as a last result\n *\n * @param {MorphContext} ctx the merge context\n * @param {Element} oldParent the old content that we are merging the new content into\n * @param {Element} newParent the parent element of the new content\n * @param {Node|null} [insertionPoint] the point in the DOM we start morphing at (defaults to first child)\n * @param {Node|null} [endPoint] the point in the DOM we stop morphing at (defaults to after last child)\n */\n function morphChildren(\n ctx,\n oldParent,\n newParent,\n insertionPoint = null,\n endPoint = null,\n ) {\n // normalize\n if (\n oldParent instanceof HTMLTemplateElement &&\n newParent instanceof HTMLTemplateElement\n ) {\n // @ts-ignore we can pretend the DocumentFragment is an Element\n oldParent = oldParent.content;\n // @ts-ignore ditto\n newParent = newParent.content;\n }\n insertionPoint ||= oldParent.firstChild;\n\n // run through all the new content\n for (const newChild of newParent.childNodes) {\n // once we reach the end of the old parent content skip to the end and insert the rest\n if (insertionPoint && insertionPoint != endPoint) {\n const bestMatch = findBestMatch(\n ctx,\n newChild,\n insertionPoint,\n endPoint,\n );\n if (bestMatch) {\n // if the node to morph is not at the insertion point then remove/move up to it\n if (bestMatch !== insertionPoint) {\n removeNodesBetween(ctx, insertionPoint, bestMatch);\n }\n morphNode(bestMatch, newChild, ctx);\n insertionPoint = bestMatch.nextSibling;\n continue;\n }\n }\n\n // if the matching node is elsewhere in the original content\n if (newChild instanceof Element) {\n // we can pretend the id is non-null because the next `.has` line will reject it if not\n const newChildId = /** @type {String} */ (\n newChild.getAttribute(\"id\")\n );\n if (ctx.persistentIds.has(newChildId)) {\n // move it and all its children here and morph\n const movedChild = moveBeforeById(\n oldParent,\n newChildId,\n insertionPoint,\n ctx,\n );\n morphNode(movedChild, newChild, ctx);\n insertionPoint = movedChild.nextSibling;\n continue;\n }\n }\n\n // last resort: insert the new node from scratch\n const insertedNode = createNode(\n oldParent,\n newChild,\n insertionPoint,\n ctx,\n );\n // could be null if beforeNodeAdded prevented insertion\n if (insertedNode) {\n insertionPoint = insertedNode.nextSibling;\n }\n }\n\n // remove any remaining old nodes that didn't match up with new content\n while (insertionPoint && insertionPoint != endPoint) {\n const tempNode = insertionPoint;\n insertionPoint = insertionPoint.nextSibling;\n removeNode(ctx, tempNode);\n }\n }\n\n /**\n * This performs the action of inserting a new node while handling situations where the node contains\n * elements with persistent ids and possible state info we can still preserve by moving in and then morphing\n *\n * @param {Element} oldParent\n * @param {Node} newChild\n * @param {Node|null} insertionPoint\n * @param {MorphContext} ctx\n * @returns {Node|null}\n */\n function createNode(oldParent, newChild, insertionPoint, ctx) {\n if (ctx.callbacks.beforeNodeAdded(newChild) === false) return null;\n if (ctx.idMap.has(newChild)) {\n // node has children with ids with possible state so create a dummy elt of same type and apply full morph algorithm\n const newEmptyChild = document.createElement(\n /** @type {Element} */ (newChild).tagName,\n );\n oldParent.insertBefore(newEmptyChild, insertionPoint);\n morphNode(newEmptyChild, newChild, ctx);\n ctx.callbacks.afterNodeAdded(newEmptyChild);\n return newEmptyChild;\n } else {\n // optimisation: no id state to preserve so we can just insert a clone of the newChild and its descendants\n const newClonedChild = document.importNode(newChild, true); // importNode to not mutate newParent\n oldParent.insertBefore(newClonedChild, insertionPoint);\n ctx.callbacks.afterNodeAdded(newClonedChild);\n return newClonedChild;\n }\n }\n\n //=============================================================================\n // Matching Functions\n //=============================================================================\n const findBestMatch = (function () {\n /**\n * Scans forward from the startPoint to the endPoint looking for a match\n * for the node. It looks for an id set match first, then a soft match.\n * We abort softmatching if we find two future soft matches, to reduce churn.\n * @param {Node} node\n * @param {MorphContext} ctx\n * @param {Node | null} startPoint\n * @param {Node | null} endPoint\n * @returns {Node | null}\n */\n function findBestMatch(ctx, node, startPoint, endPoint) {\n let softMatch = null;\n let nextSibling = node.nextSibling;\n let siblingSoftMatchCount = 0;\n\n let cursor = startPoint;\n while (cursor && cursor != endPoint) {\n // soft matching is a prerequisite for id set matching\n if (isSoftMatch(cursor, node)) {\n if (isIdSetMatch(ctx, cursor, node)) {\n return cursor; // found an id set match, we're done!\n }\n\n // we haven't yet saved a soft match fallback\n if (softMatch === null) {\n // the current soft match will hard match something else in the future, leave it\n if (!ctx.idMap.has(cursor)) {\n // save this as the fallback if we get through the loop without finding a hard match\n softMatch = cursor;\n }\n }\n }\n if (\n softMatch === null &&\n nextSibling &&\n isSoftMatch(cursor, nextSibling)\n ) {\n // The next new node has a soft match with this node, so\n // increment the count of future soft matches\n siblingSoftMatchCount++;\n nextSibling = nextSibling.nextSibling;\n\n // If there are two future soft matches, block soft matching for this node to allow\n // future siblings to soft match. This is to reduce churn in the DOM when an element\n // is prepended.\n if (siblingSoftMatchCount >= 2) {\n softMatch = undefined;\n }\n }\n\n // if the current node contains active element, stop looking for better future matches,\n // because if one is found, this node will be moved to the pantry, reparenting it and thus losing focus\n // @ts-ignore pretend cursor is Element rather than Node, we're just testing for array inclusion\n if (ctx.activeElementAndParents.includes(cursor)) break;\n\n cursor = cursor.nextSibling;\n }\n\n return softMatch || null;\n }\n\n /**\n *\n * @param {MorphContext} ctx\n * @param {Node} oldNode\n * @param {Node} newNode\n * @returns {boolean}\n */\n function isIdSetMatch(ctx, oldNode, newNode) {\n let oldSet = ctx.idMap.get(oldNode);\n let newSet = ctx.idMap.get(newNode);\n\n if (!newSet || !oldSet) return false;\n\n for (const id of oldSet) {\n // a potential match is an id in the new and old nodes that\n // has not already been merged into the DOM\n // But the newNode content we call this on has not been\n // merged yet and we don't allow duplicate IDs so it is simple\n if (newSet.has(id)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n *\n * @param {Node} oldNode\n * @param {Node} newNode\n * @returns {boolean}\n */\n function isSoftMatch(oldNode, newNode) {\n // ok to cast: if one is not element, `id` and `tagName` will be undefined and we'll just compare that.\n const oldElt = /** @type {Element} */ (oldNode);\n const newElt = /** @type {Element} */ (newNode);\n\n return (\n oldElt.nodeType === newElt.nodeType &&\n oldElt.tagName === newElt.tagName &&\n // If oldElt has an `id` with possible state and it doesn't match newElt.id then avoid morphing.\n // We'll still match an anonymous node with an IDed newElt, though, because if it got this far,\n // its not persistent, and new nodes can't have any hidden state.\n // We can't use .id because of form input shadowing, and we can't count on .getAttribute's presence because it could be a document-fragment\n (!oldElt.getAttribute?.(\"id\") ||\n oldElt.getAttribute?.(\"id\") === newElt.getAttribute?.(\"id\"))\n );\n }\n\n return findBestMatch;\n })();\n\n //=============================================================================\n // DOM Manipulation Functions\n //=============================================================================\n\n /**\n * Gets rid of an unwanted DOM node; strategy depends on nature of its reuse:\n * - Persistent nodes will be moved to the pantry for later reuse\n * - Other nodes will have their hooks called, and then are removed\n * @param {MorphContext} ctx\n * @param {Node} node\n */\n function removeNode(ctx, node) {\n // are we going to id set match this later?\n if (ctx.idMap.has(node)) {\n // skip callbacks and move to pantry\n moveBefore(ctx.pantry, node, null);\n } else {\n // remove for realsies\n if (ctx.callbacks.beforeNodeRemoved(node) === false) return;\n node.parentNode?.removeChild(node);\n ctx.callbacks.afterNodeRemoved(node);\n }\n }\n\n /**\n * Remove nodes between the start and end nodes\n * @param {MorphContext} ctx\n * @param {Node} startInclusive\n * @param {Node} endExclusive\n * @returns {Node|null}\n */\n function removeNodesBetween(ctx, startInclusive, endExclusive) {\n /** @type {Node | null} */\n let cursor = startInclusive;\n // remove nodes until the endExclusive node\n while (cursor && cursor !== endExclusive) {\n let tempNode = /** @type {Node} */ (cursor);\n cursor = cursor.nextSibling;\n removeNode(ctx, tempNode);\n }\n return cursor;\n }\n\n /**\n * Search for an element by id within the document and pantry, and move it using moveBefore.\n *\n * @param {Element} parentNode - The parent node to which the element will be moved.\n * @param {string} id - The ID of the element to be moved.\n * @param {Node | null} after - The reference node to insert the element before.\n * If `null`, the element is appended as the last child.\n * @param {MorphContext} ctx\n * @returns {Element} The found element\n */\n function moveBeforeById(parentNode, id, after, ctx) {\n const target =\n /** @type {Element} - will always be found */\n (\n // ctx.target.id unsafe because of form input shadowing\n // ctx.target could be a document fragment which doesn't have `getAttribute`\n (ctx.target.getAttribute?.(\"id\") === id && ctx.target) ||\n ctx.target.querySelector(`[id=\"${id}\"]`) ||\n ctx.pantry.querySelector(`[id=\"${id}\"]`)\n );\n removeElementFromAncestorsIdMaps(target, ctx);\n moveBefore(parentNode, target, after);\n return target;\n }\n\n /**\n * Removes an element from its ancestors' id maps. This is needed when an element is moved from the\n * \"future\" via `moveBeforeId`. Otherwise, its erstwhile ancestors could be mistakenly moved to the\n * pantry rather than being deleted, preventing their removal hooks from being called.\n *\n * @param {Element} element - element to remove from its ancestors' id maps\n * @param {MorphContext} ctx\n */\n function removeElementFromAncestorsIdMaps(element, ctx) {\n // we know id is non-null String, because this function is only called on elements with ids\n const id = /** @type {String} */ (element.getAttribute(\"id\"));\n /** @ts-ignore - safe to loop in this way **/\n while ((element = element.parentNode)) {\n let idSet = ctx.idMap.get(element);\n if (idSet) {\n idSet.delete(id);\n if (!idSet.size) {\n ctx.idMap.delete(element);\n }\n }\n }\n }\n\n /**\n * Moves an element before another element within the same parent.\n * Uses the proposed `moveBefore` API if available (and working), otherwise falls back to `insertBefore`.\n * This is essentialy a forward-compat wrapper.\n *\n * @param {Element} parentNode - The parent node containing the after element.\n * @param {Node} element - The element to be moved.\n * @param {Node | null} after - The reference node to insert `element` before.\n * If `null`, `element` is appended as the last child.\n */\n function moveBefore(parentNode, element, after) {\n // @ts-ignore - use proposed moveBefore feature\n if (parentNode.moveBefore) {\n try {\n // @ts-ignore - use proposed moveBefore feature\n parentNode.moveBefore(element, after);\n } catch (e) {\n // fall back to insertBefore as some browsers may fail on moveBefore when trying to move Dom disconnected nodes to pantry\n parentNode.insertBefore(element, after);\n }\n } else {\n parentNode.insertBefore(element, after);\n }\n }\n\n return morphChildren;\n })();\n\n //=============================================================================\n // Single Node Morphing Code\n //=============================================================================\n const morphNode = (function () {\n /**\n * @param {Node} oldNode root node to merge content into\n * @param {Node} newContent new content to merge\n * @param {MorphContext} ctx the merge context\n * @returns {Node | null} the element that ended up in the DOM\n */\n function morphNode(oldNode, newContent, ctx) {\n if (ctx.ignoreActive && oldNode === document.activeElement) {\n // don't morph focused element\n return null;\n }\n\n if (ctx.callbacks.beforeNodeMorphed(oldNode, newContent) === false) {\n return oldNode;\n }\n\n if (oldNode instanceof HTMLHeadElement && ctx.head.ignore) ; else if (\n oldNode instanceof HTMLHeadElement &&\n ctx.head.style !== \"morph\"\n ) {\n // ok to cast: if newContent wasn't also a , it would've got caught in the `!isSoftMatch` branch above\n handleHeadElement(\n oldNode,\n /** @type {HTMLHeadElement} */ (newContent),\n ctx,\n );\n } else {\n morphAttributes(oldNode, newContent, ctx);\n if (!ignoreValueOfActiveElement(oldNode, ctx)) {\n // @ts-ignore newContent can be a node here because .firstChild will be null\n morphChildren(ctx, oldNode, newContent);\n }\n }\n ctx.callbacks.afterNodeMorphed(oldNode, newContent);\n return oldNode;\n }\n\n /**\n * syncs the oldNode to the newNode, copying over all attributes and\n * inner element state from the newNode to the oldNode\n *\n * @param {Node} oldNode the node to copy attributes & state to\n * @param {Node} newNode the node to copy attributes & state from\n * @param {MorphContext} ctx the merge context\n */\n function morphAttributes(oldNode, newNode, ctx) {\n let type = newNode.nodeType;\n\n // if is an element type, sync the attributes from the\n // new node into the new node\n if (type === 1 /* element type */) {\n const oldElt = /** @type {Element} */ (oldNode);\n const newElt = /** @type {Element} */ (newNode);\n\n const oldAttributes = oldElt.attributes;\n const newAttributes = newElt.attributes;\n for (const newAttribute of newAttributes) {\n if (ignoreAttribute(newAttribute.name, oldElt, \"update\", ctx)) {\n continue;\n }\n if (oldElt.getAttribute(newAttribute.name) !== newAttribute.value) {\n oldElt.setAttribute(newAttribute.name, newAttribute.value);\n }\n }\n // iterate backwards to avoid skipping over items when a delete occurs\n for (let i = oldAttributes.length - 1; 0 <= i; i--) {\n const oldAttribute = oldAttributes[i];\n\n // toAttributes is a live NamedNodeMap, so iteration+mutation is unsafe\n // e.g. custom element attribute callbacks can remove other attributes\n if (!oldAttribute) continue;\n\n if (!newElt.hasAttribute(oldAttribute.name)) {\n if (ignoreAttribute(oldAttribute.name, oldElt, \"remove\", ctx)) {\n continue;\n }\n oldElt.removeAttribute(oldAttribute.name);\n }\n }\n\n if (!ignoreValueOfActiveElement(oldElt, ctx)) {\n syncInputValue(oldElt, newElt, ctx);\n }\n }\n\n // sync text nodes\n if (type === 8 /* comment */ || type === 3 /* text */) {\n if (oldNode.nodeValue !== newNode.nodeValue) {\n oldNode.nodeValue = newNode.nodeValue;\n }\n }\n }\n\n /**\n * NB: many bothans died to bring us information:\n *\n * https://github.com/patrick-steele-idem/morphdom/blob/master/src/specialElHandlers.js\n * https://github.com/choojs/nanomorph/blob/master/lib/morph.jsL113\n *\n * @param {Element} oldElement the element to sync the input value to\n * @param {Element} newElement the element to sync the input value from\n * @param {MorphContext} ctx the merge context\n */\n function syncInputValue(oldElement, newElement, ctx) {\n if (\n oldElement instanceof HTMLInputElement &&\n newElement instanceof HTMLInputElement &&\n newElement.type !== \"file\"\n ) {\n let newValue = newElement.value;\n let oldValue = oldElement.value;\n\n // sync boolean attributes\n syncBooleanAttribute(oldElement, newElement, \"checked\", ctx);\n syncBooleanAttribute(oldElement, newElement, \"disabled\", ctx);\n\n if (!newElement.hasAttribute(\"value\")) {\n if (!ignoreAttribute(\"value\", oldElement, \"remove\", ctx)) {\n oldElement.value = \"\";\n oldElement.removeAttribute(\"value\");\n }\n } else if (oldValue !== newValue) {\n if (!ignoreAttribute(\"value\", oldElement, \"update\", ctx)) {\n oldElement.setAttribute(\"value\", newValue);\n oldElement.value = newValue;\n }\n }\n // TODO: QUESTION(1cg): this used to only check `newElement` unlike the other branches -- why?\n // did I break something?\n } else if (\n oldElement instanceof HTMLOptionElement &&\n newElement instanceof HTMLOptionElement\n ) {\n syncBooleanAttribute(oldElement, newElement, \"selected\", ctx);\n } else if (\n oldElement instanceof HTMLTextAreaElement &&\n newElement instanceof HTMLTextAreaElement\n ) {\n let newValue = newElement.value;\n let oldValue = oldElement.value;\n if (ignoreAttribute(\"value\", oldElement, \"update\", ctx)) {\n return;\n }\n if (newValue !== oldValue) {\n oldElement.value = newValue;\n }\n if (\n oldElement.firstChild &&\n oldElement.firstChild.nodeValue !== newValue\n ) {\n oldElement.firstChild.nodeValue = newValue;\n }\n }\n }\n\n /**\n * @param {Element} oldElement element to write the value to\n * @param {Element} newElement element to read the value from\n * @param {string} attributeName the attribute name\n * @param {MorphContext} ctx the merge context\n */\n function syncBooleanAttribute(oldElement, newElement, attributeName, ctx) {\n // @ts-ignore this function is only used on boolean attrs that are reflected as dom properties\n const newLiveValue = newElement[attributeName],\n // @ts-ignore ditto\n oldLiveValue = oldElement[attributeName];\n if (newLiveValue !== oldLiveValue) {\n const ignoreUpdate = ignoreAttribute(\n attributeName,\n oldElement,\n \"update\",\n ctx,\n );\n if (!ignoreUpdate) {\n // update attribute's associated DOM property\n // @ts-ignore this function is only used on boolean attrs that are reflected as dom properties\n oldElement[attributeName] = newElement[attributeName];\n }\n if (newLiveValue) {\n if (!ignoreUpdate) {\n // https://developer.mozilla.org/en-US/docs/Glossary/Boolean/HTML\n // this is the correct way to set a boolean attribute to \"true\"\n oldElement.setAttribute(attributeName, \"\");\n }\n } else {\n if (!ignoreAttribute(attributeName, oldElement, \"remove\", ctx)) {\n oldElement.removeAttribute(attributeName);\n }\n }\n }\n }\n\n /**\n * @param {string} attr the attribute to be mutated\n * @param {Element} element the element that is going to be updated\n * @param {\"update\" | \"remove\"} updateType\n * @param {MorphContext} ctx the merge context\n * @returns {boolean} true if the attribute should be ignored, false otherwise\n */\n function ignoreAttribute(attr, element, updateType, ctx) {\n if (\n attr === \"value\" &&\n ctx.ignoreActiveValue &&\n element === document.activeElement\n ) {\n return true;\n }\n return (\n ctx.callbacks.beforeAttributeUpdated(attr, element, updateType) ===\n false\n );\n }\n\n /**\n * @param {Node} possibleActiveElement\n * @param {MorphContext} ctx\n * @returns {boolean}\n */\n function ignoreValueOfActiveElement(possibleActiveElement, ctx) {\n return (\n !!ctx.ignoreActiveValue &&\n possibleActiveElement === document.activeElement &&\n possibleActiveElement !== document.body\n );\n }\n\n return morphNode;\n })();\n\n //=============================================================================\n // Head Management Functions\n //=============================================================================\n /**\n * @param {MorphContext} ctx\n * @param {Element} oldNode\n * @param {Element} newNode\n * @param {function} callback\n * @returns {Node[] | Promise}\n */\n function withHeadBlocking(ctx, oldNode, newNode, callback) {\n if (ctx.head.block) {\n const oldHead = oldNode.querySelector(\"head\");\n const newHead = newNode.querySelector(\"head\");\n if (oldHead && newHead) {\n const promises = handleHeadElement(oldHead, newHead, ctx);\n // when head promises resolve, proceed ignoring the head tag\n return Promise.all(promises).then(() => {\n const newCtx = Object.assign(ctx, {\n head: {\n block: false,\n ignore: true,\n },\n });\n return callback(newCtx);\n });\n }\n }\n // just proceed if we not head blocking\n return callback(ctx);\n }\n\n /**\n * The HEAD tag can be handled specially, either w/ a 'merge' or 'append' style\n *\n * @param {Element} oldHead\n * @param {Element} newHead\n * @param {MorphContext} ctx\n * @returns {Promise[]}\n */\n function handleHeadElement(oldHead, newHead, ctx) {\n let added = [];\n let removed = [];\n let preserved = [];\n let nodesToAppend = [];\n\n // put all new head elements into a Map, by their outerHTML\n let srcToNewHeadNodes = new Map();\n for (const newHeadChild of newHead.children) {\n srcToNewHeadNodes.set(newHeadChild.outerHTML, newHeadChild);\n }\n\n // for each elt in the current head\n for (const currentHeadElt of oldHead.children) {\n // If the current head element is in the map\n let inNewContent = srcToNewHeadNodes.has(currentHeadElt.outerHTML);\n let isReAppended = ctx.head.shouldReAppend(currentHeadElt);\n let isPreserved = ctx.head.shouldPreserve(currentHeadElt);\n if (inNewContent || isPreserved) {\n if (isReAppended) {\n // remove the current version and let the new version replace it and re-execute\n removed.push(currentHeadElt);\n } else {\n // this element already exists and should not be re-appended, so remove it from\n // the new content map, preserving it in the DOM\n srcToNewHeadNodes.delete(currentHeadElt.outerHTML);\n preserved.push(currentHeadElt);\n }\n } else {\n if (ctx.head.style === \"append\") {\n // we are appending and this existing element is not new content\n // so if and only if it is marked for re-append do we do anything\n if (isReAppended) {\n removed.push(currentHeadElt);\n nodesToAppend.push(currentHeadElt);\n }\n } else {\n // if this is a merge, we remove this content since it is not in the new head\n if (ctx.head.shouldRemove(currentHeadElt) !== false) {\n removed.push(currentHeadElt);\n }\n }\n }\n }\n\n // Push the remaining new head elements in the Map into the\n // nodes to append to the head tag\n nodesToAppend.push(...srcToNewHeadNodes.values());\n\n let promises = [];\n for (const newNode of nodesToAppend) {\n // TODO: This could theoretically be null, based on type\n let newElt = /** @type {ChildNode} */ (\n document.createRange().createContextualFragment(newNode.outerHTML)\n .firstChild\n );\n if (ctx.callbacks.beforeNodeAdded(newElt) !== false) {\n if (\n (\"href\" in newElt && newElt.href) ||\n (\"src\" in newElt && newElt.src)\n ) {\n /** @type {(result?: any) => void} */ let resolve;\n let promise = new Promise(function (_resolve) {\n resolve = _resolve;\n });\n newElt.addEventListener(\"load\", function () {\n resolve();\n });\n promises.push(promise);\n }\n oldHead.appendChild(newElt);\n ctx.callbacks.afterNodeAdded(newElt);\n added.push(newElt);\n }\n }\n\n // remove all removed elements, after we have appended the new elements to avoid\n // additional network requests for things like style sheets\n for (const removedElement of removed) {\n if (ctx.callbacks.beforeNodeRemoved(removedElement) !== false) {\n oldHead.removeChild(removedElement);\n ctx.callbacks.afterNodeRemoved(removedElement);\n }\n }\n\n ctx.head.afterHeadMorphed(oldHead, {\n added: added,\n kept: preserved,\n removed: removed,\n });\n return promises;\n }\n\n //=============================================================================\n // Create Morph Context Functions\n //=============================================================================\n const createMorphContext = (function () {\n /**\n *\n * @param {Element} oldNode\n * @param {Element} newContent\n * @param {Config} config\n * @returns {MorphContext}\n */\n function createMorphContext(oldNode, newContent, config) {\n const { persistentIds, idMap } = createIdMaps(oldNode, newContent);\n\n const mergedConfig = mergeDefaults(config);\n const morphStyle = mergedConfig.morphStyle || \"outerHTML\";\n if (![\"innerHTML\", \"outerHTML\"].includes(morphStyle)) {\n throw `Do not understand how to morph style ${morphStyle}`;\n }\n\n return {\n target: oldNode,\n newContent: newContent,\n config: mergedConfig,\n morphStyle: morphStyle,\n ignoreActive: mergedConfig.ignoreActive,\n ignoreActiveValue: mergedConfig.ignoreActiveValue,\n restoreFocus: mergedConfig.restoreFocus,\n idMap: idMap,\n persistentIds: persistentIds,\n pantry: createPantry(),\n activeElementAndParents: createActiveElementAndParents(oldNode),\n callbacks: mergedConfig.callbacks,\n head: mergedConfig.head,\n };\n }\n\n /**\n * Deep merges the config object and the Idiomorph.defaults object to\n * produce a final configuration object\n * @param {Config} config\n * @returns {ConfigInternal}\n */\n function mergeDefaults(config) {\n let finalConfig = Object.assign({}, defaults);\n\n // copy top level stuff into final config\n Object.assign(finalConfig, config);\n\n // copy callbacks into final config (do this to deep merge the callbacks)\n finalConfig.callbacks = Object.assign(\n {},\n defaults.callbacks,\n config.callbacks,\n );\n\n // copy head config into final config (do this to deep merge the head)\n finalConfig.head = Object.assign({}, defaults.head, config.head);\n\n return finalConfig;\n }\n\n /**\n * @returns {HTMLDivElement}\n */\n function createPantry() {\n const pantry = document.createElement(\"div\");\n pantry.hidden = true;\n document.body.insertAdjacentElement(\"afterend\", pantry);\n return pantry;\n }\n\n /**\n * @param {Element} oldNode\n * @returns {Element[]}\n */\n function createActiveElementAndParents(oldNode) {\n /** @type {Element[]} */\n let activeElementAndParents = [];\n let elt = document.activeElement;\n if (elt?.tagName !== \"BODY\" && oldNode.contains(elt)) {\n while (elt) {\n activeElementAndParents.push(elt);\n if (elt === oldNode) break;\n elt = elt.parentElement;\n }\n }\n return activeElementAndParents;\n }\n\n /**\n * Returns all elements with an ID contained within the root element and its descendants\n *\n * @param {Element} root\n * @returns {Element[]}\n */\n function findIdElements(root) {\n let elements = Array.from(root.querySelectorAll(\"[id]\"));\n // root could be a document fragment which doesn't have `getAttribute`\n if (root.getAttribute?.(\"id\")) {\n elements.push(root);\n }\n return elements;\n }\n\n /**\n * A bottom-up algorithm that populates a map of Element -> IdSet.\n * The idSet for a given element is the set of all IDs contained within its subtree.\n * As an optimzation, we filter these IDs through the given list of persistent IDs,\n * because we don't need to bother considering IDed elements that won't be in the new content.\n *\n * @param {Map>} idMap\n * @param {Set} persistentIds\n * @param {Element} root\n * @param {Element[]} elements\n */\n function populateIdMapWithTree(idMap, persistentIds, root, elements) {\n for (const elt of elements) {\n // we can pretend id is non-null String, because the .has line will reject it immediately if not\n const id = /** @type {String} */ (elt.getAttribute(\"id\"));\n if (persistentIds.has(id)) {\n /** @type {Element|null} */\n let current = elt;\n // walk up the parent hierarchy of that element, adding the id\n // of element to the parent's id set\n while (current) {\n let idSet = idMap.get(current);\n // if the id set doesn't exist, create it and insert it in the map\n if (idSet == null) {\n idSet = new Set();\n idMap.set(current, idSet);\n }\n idSet.add(id);\n\n if (current === root) break;\n current = current.parentElement;\n }\n }\n }\n }\n\n /**\n * This function computes a map of nodes to all ids contained within that node (inclusive of the\n * node). This map can be used to ask if two nodes have intersecting sets of ids, which allows\n * for a looser definition of \"matching\" than tradition id matching, and allows child nodes\n * to contribute to a parent nodes matching.\n *\n * @param {Element} oldContent the old content that will be morphed\n * @param {Element} newContent the new content to morph to\n * @returns {IdSets}\n */\n function createIdMaps(oldContent, newContent) {\n const oldIdElements = findIdElements(oldContent);\n const newIdElements = findIdElements(newContent);\n\n const persistentIds = createPersistentIds(oldIdElements, newIdElements);\n\n /** @type {Map>} */\n let idMap = new Map();\n populateIdMapWithTree(idMap, persistentIds, oldContent, oldIdElements);\n\n /** @ts-ignore - if newContent is a duck-typed parent, pass its single child node as the root to halt upwards iteration */\n const newRoot = newContent.__idiomorphRoot || newContent;\n populateIdMapWithTree(idMap, persistentIds, newRoot, newIdElements);\n\n return { persistentIds, idMap };\n }\n\n /**\n * This function computes the set of ids that persist between the two contents excluding duplicates\n *\n * @param {Element[]} oldIdElements\n * @param {Element[]} newIdElements\n * @returns {Set}\n */\n function createPersistentIds(oldIdElements, newIdElements) {\n let duplicateIds = new Set();\n\n /** @type {Map} */\n let oldIdTagNameMap = new Map();\n for (const { id, tagName } of oldIdElements) {\n if (oldIdTagNameMap.has(id)) {\n duplicateIds.add(id);\n } else {\n oldIdTagNameMap.set(id, tagName);\n }\n }\n\n let persistentIds = new Set();\n for (const { id, tagName } of newIdElements) {\n if (persistentIds.has(id)) {\n duplicateIds.add(id);\n } else if (oldIdTagNameMap.get(id) === tagName) {\n persistentIds.add(id);\n }\n // skip if tag types mismatch because its not possible to morph one tag into another\n }\n\n for (const id of duplicateIds) {\n persistentIds.delete(id);\n }\n return persistentIds;\n }\n\n return createMorphContext;\n })();\n\n //=============================================================================\n // HTML Normalization Functions\n //=============================================================================\n const { normalizeElement, normalizeParent } = (function () {\n /** @type {WeakSet} */\n const generatedByIdiomorph = new WeakSet();\n\n /**\n *\n * @param {Element | Document} content\n * @returns {Element}\n */\n function normalizeElement(content) {\n if (content instanceof Document) {\n return content.documentElement;\n } else {\n return content;\n }\n }\n\n /**\n *\n * @param {null | string | Node | HTMLCollection | Node[] | Document & {generatedByIdiomorph:boolean}} newContent\n * @returns {Element}\n */\n function normalizeParent(newContent) {\n if (newContent == null) {\n return document.createElement(\"div\"); // dummy parent element\n } else if (typeof newContent === \"string\") {\n return normalizeParent(parseContent(newContent));\n } else if (\n generatedByIdiomorph.has(/** @type {Element} */ (newContent))\n ) {\n // the template tag created by idiomorph parsing can serve as a dummy parent\n return /** @type {Element} */ (newContent);\n } else if (newContent instanceof Node) {\n if (newContent.parentNode) {\n // we can't use the parent directly because newContent may have siblings\n // that we don't want in the morph, and reparenting might be expensive (TODO is it?),\n // so instead we create a fake parent node that only sees a slice of its children.\n /** @type {Element} */\n return /** @type {any} */ (new SlicedParentNode(newContent));\n } else {\n // a single node is added as a child to a dummy parent\n const dummyParent = document.createElement(\"div\");\n dummyParent.append(newContent);\n return dummyParent;\n }\n } else {\n // all nodes in the array or HTMLElement collection are consolidated under\n // a single dummy parent element\n const dummyParent = document.createElement(\"div\");\n for (const elt of [...newContent]) {\n dummyParent.append(elt);\n }\n return dummyParent;\n }\n }\n\n /**\n * A fake duck-typed parent element to wrap a single node, without actually reparenting it.\n * This is useful because the node may have siblings that we don't want in the morph, and it may also be moved\n * or replaced with one or more elements during the morph. This class effectively allows us a window into\n * a slice of a node's children.\n * \"If it walks like a duck, and quacks like a duck, then it must be a duck!\" -- James Whitcomb Riley (1849\u20131916)\n */\n class SlicedParentNode {\n /** @param {Node} node */\n constructor(node) {\n this.originalNode = node;\n this.realParentNode = /** @type {Element} */ (node.parentNode);\n this.previousSibling = node.previousSibling;\n this.nextSibling = node.nextSibling;\n }\n\n /** @returns {Node[]} */\n get childNodes() {\n // return slice of realParent's current childNodes, based on previousSibling and nextSibling\n const nodes = [];\n let cursor = this.previousSibling\n ? this.previousSibling.nextSibling\n : this.realParentNode.firstChild;\n while (cursor && cursor != this.nextSibling) {\n nodes.push(cursor);\n cursor = cursor.nextSibling;\n }\n return nodes;\n }\n\n /**\n * @param {string} selector\n * @returns {Element[]}\n */\n querySelectorAll(selector) {\n return this.childNodes.reduce((results, node) => {\n if (node instanceof Element) {\n if (node.matches(selector)) results.push(node);\n const nodeList = node.querySelectorAll(selector);\n for (let i = 0; i < nodeList.length; i++) {\n results.push(nodeList[i]);\n }\n }\n return results;\n }, /** @type {Element[]} */ ([]));\n }\n\n /**\n * @param {Node} node\n * @param {Node} referenceNode\n * @returns {Node}\n */\n insertBefore(node, referenceNode) {\n return this.realParentNode.insertBefore(node, referenceNode);\n }\n\n /**\n * @param {Node} node\n * @param {Node} referenceNode\n * @returns {Node}\n */\n moveBefore(node, referenceNode) {\n // @ts-ignore - use new moveBefore feature\n return this.realParentNode.moveBefore(node, referenceNode);\n }\n\n /**\n * for later use with populateIdMapWithTree to halt upwards iteration\n * @returns {Node}\n */\n get __idiomorphRoot() {\n return this.originalNode;\n }\n }\n\n /**\n *\n * @param {string} newContent\n * @returns {Node | null | DocumentFragment}\n */\n function parseContent(newContent) {\n let parser = new DOMParser();\n\n // remove svgs to avoid false-positive matches on head, etc.\n let contentWithSvgsRemoved = newContent.replace(\n /]*>|>)([\\s\\S]*?)<\\/svg>/gim,\n \"\",\n );\n\n // if the newContent contains a html, head or body tag, we can simply parse it w/o wrapping\n if (\n contentWithSvgsRemoved.match(/<\\/html>/) ||\n contentWithSvgsRemoved.match(/<\\/head>/) ||\n contentWithSvgsRemoved.match(/<\\/body>/)\n ) {\n let content = parser.parseFromString(newContent, \"text/html\");\n // if it is a full HTML document, return the document itself as the parent container\n if (contentWithSvgsRemoved.match(/<\\/html>/)) {\n generatedByIdiomorph.add(content);\n return content;\n } else {\n // otherwise return the html element as the parent container\n let htmlElement = content.firstChild;\n if (htmlElement) {\n generatedByIdiomorph.add(htmlElement);\n }\n return htmlElement;\n }\n } else {\n // if it is partial HTML, wrap it in a template tag to provide a parent element and also to help\n // deal with touchy tags like tr, tbody, etc.\n let responseDoc = parser.parseFromString(\n \"\",\n \"text/html\",\n );\n let content = /** @type {HTMLTemplateElement} */ (\n responseDoc.body.querySelector(\"template\")\n ).content;\n generatedByIdiomorph.add(content);\n return content;\n }\n }\n\n return { normalizeElement, normalizeParent };\n })();\n\n //=============================================================================\n // This is what ends up becoming the Idiomorph global object\n //=============================================================================\n return {\n morph,\n defaults,\n };\n})();\n\n/**\n * Morph the state of the currentElement based on the attributes and contents of\n * the newElement. Morphing may dispatch turbo:before-morph-element,\n * turbo:before-morph-attribute, and turbo:morph-element events.\n *\n * @param currentElement Element destination of morphing changes\n * @param newElement Element source of morphing changes\n */\nfunction morphElements(currentElement, newElement, { callbacks, ...options } = {}) {\n Idiomorph.morph(currentElement, newElement, {\n ...options,\n callbacks: new DefaultIdiomorphCallbacks(callbacks)\n });\n}\n\n/**\n * Morph the child elements of the currentElement based on the child elements of\n * the newElement. Morphing children may dispatch turbo:before-morph-element,\n * turbo:before-morph-attribute, and turbo:morph-element events.\n *\n * @param currentElement Element destination of morphing children changes\n * @param newElement Element source of morphing children changes\n */\nfunction morphChildren(currentElement, newElement, options = {}) {\n morphElements(currentElement, newElement.childNodes, {\n ...options,\n morphStyle: \"innerHTML\"\n });\n}\n\nfunction shouldRefreshFrameWithMorphing(currentFrame, newFrame) {\n return currentFrame instanceof FrameElement &&\n currentFrame.shouldReloadWithMorph && (!newFrame || areFramesCompatibleForRefreshing(currentFrame, newFrame)) &&\n !currentFrame.closest(\"[data-turbo-permanent]\")\n}\n\nfunction areFramesCompatibleForRefreshing(currentFrame, newFrame) {\n // newFrame cannot yet be an instance of FrameElement because custom\n // elements don't get initialized until they're attached to the DOM, so\n // test its Element#nodeName instead\n return newFrame instanceof Element && newFrame.nodeName === \"TURBO-FRAME\" && currentFrame.id === newFrame.id &&\n (!newFrame.getAttribute(\"src\") || urlsAreEqual(currentFrame.src, newFrame.getAttribute(\"src\")))\n}\n\nfunction closestFrameReloadableWithMorphing(node) {\n return node.parentElement.closest(\"turbo-frame[src][refresh=morph]\")\n}\n\nclass DefaultIdiomorphCallbacks {\n #beforeNodeMorphed\n\n constructor({ beforeNodeMorphed } = {}) {\n this.#beforeNodeMorphed = beforeNodeMorphed || (() => true);\n }\n\n beforeNodeAdded = (node) => {\n return !(node.id && node.hasAttribute(\"data-turbo-permanent\") && document.getElementById(node.id))\n }\n\n beforeNodeMorphed = (currentElement, newElement) => {\n if (currentElement instanceof Element) {\n if (!currentElement.hasAttribute(\"data-turbo-permanent\") && this.#beforeNodeMorphed(currentElement, newElement)) {\n const event = dispatch(\"turbo:before-morph-element\", {\n cancelable: true,\n target: currentElement,\n detail: { currentElement, newElement }\n });\n\n return !event.defaultPrevented\n } else {\n return false\n }\n }\n }\n\n beforeAttributeUpdated = (attributeName, target, mutationType) => {\n const event = dispatch(\"turbo:before-morph-attribute\", {\n cancelable: true,\n target,\n detail: { attributeName, mutationType }\n });\n\n return !event.defaultPrevented\n }\n\n beforeNodeRemoved = (node) => {\n return this.beforeNodeMorphed(node)\n }\n\n afterNodeMorphed = (currentElement, newElement) => {\n if (currentElement instanceof Element) {\n dispatch(\"turbo:morph-element\", {\n target: currentElement,\n detail: { currentElement, newElement }\n });\n }\n }\n}\n\nclass MorphingFrameRenderer extends FrameRenderer {\n static renderElement(currentElement, newElement) {\n dispatch(\"turbo:before-frame-morph\", {\n target: currentElement,\n detail: { currentElement, newElement }\n });\n\n morphChildren(currentElement, newElement, {\n callbacks: {\n beforeNodeMorphed: (node, newNode) => {\n if (\n shouldRefreshFrameWithMorphing(node, newNode) &&\n closestFrameReloadableWithMorphing(node) === currentElement\n ) {\n node.reload();\n return false\n }\n return true\n }\n }\n });\n }\n\n async preservingPermanentElements(callback) {\n return await callback()\n }\n}\n\nclass ProgressBar {\n static animationDuration = 300 /*ms*/\n\n static get defaultCSS() {\n return unindent`\n .turbo-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 2147483647;\n transition:\n width ${ProgressBar.animationDuration}ms ease-out,\n opacity ${ProgressBar.animationDuration / 2}ms ${ProgressBar.animationDuration / 2}ms ease-in;\n transform: translate3d(0, 0, 0);\n }\n `\n }\n\n hiding = false\n value = 0\n visible = false\n\n constructor() {\n this.stylesheetElement = this.createStylesheetElement();\n this.progressElement = this.createProgressElement();\n this.installStylesheetElement();\n this.setValue(0);\n }\n\n show() {\n if (!this.visible) {\n this.visible = true;\n this.installProgressElement();\n this.startTrickling();\n }\n }\n\n hide() {\n if (this.visible && !this.hiding) {\n this.hiding = true;\n this.fadeProgressElement(() => {\n this.uninstallProgressElement();\n this.stopTrickling();\n this.visible = false;\n this.hiding = false;\n });\n }\n }\n\n setValue(value) {\n this.value = value;\n this.refresh();\n }\n\n // Private\n\n installStylesheetElement() {\n document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n }\n\n installProgressElement() {\n this.progressElement.style.width = \"0\";\n this.progressElement.style.opacity = \"1\";\n document.documentElement.insertBefore(this.progressElement, document.body);\n this.refresh();\n }\n\n fadeProgressElement(callback) {\n this.progressElement.style.opacity = \"0\";\n setTimeout(callback, ProgressBar.animationDuration * 1.5);\n }\n\n uninstallProgressElement() {\n if (this.progressElement.parentNode) {\n document.documentElement.removeChild(this.progressElement);\n }\n }\n\n startTrickling() {\n if (!this.trickleInterval) {\n this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);\n }\n }\n\n stopTrickling() {\n window.clearInterval(this.trickleInterval);\n delete this.trickleInterval;\n }\n\n trickle = () => {\n this.setValue(this.value + Math.random() / 100);\n }\n\n refresh() {\n requestAnimationFrame(() => {\n this.progressElement.style.width = `${10 + this.value * 90}%`;\n });\n }\n\n createStylesheetElement() {\n const element = document.createElement(\"style\");\n element.type = \"text/css\";\n element.textContent = ProgressBar.defaultCSS;\n const cspNonce = getCspNonce();\n if (cspNonce) {\n element.nonce = cspNonce;\n }\n return element\n }\n\n createProgressElement() {\n const element = document.createElement(\"div\");\n element.className = \"turbo-progress-bar\";\n return element\n }\n}\n\nclass HeadSnapshot extends Snapshot {\n detailsByOuterHTML = this.children\n .filter((element) => !elementIsNoscript(element))\n .map((element) => elementWithoutNonce(element))\n .reduce((result, element) => {\n const { outerHTML } = element;\n const details =\n outerHTML in result\n ? result[outerHTML]\n : {\n type: elementType(element),\n tracked: elementIsTracked(element),\n elements: []\n };\n return {\n ...result,\n [outerHTML]: {\n ...details,\n elements: [...details.elements, element]\n }\n }\n }, {})\n\n get trackedElementSignature() {\n return Object.keys(this.detailsByOuterHTML)\n .filter((outerHTML) => this.detailsByOuterHTML[outerHTML].tracked)\n .join(\"\")\n }\n\n getScriptElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"script\", snapshot)\n }\n\n getStylesheetElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"stylesheet\", snapshot)\n }\n\n getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {\n return Object.keys(this.detailsByOuterHTML)\n .filter((outerHTML) => !(outerHTML in snapshot.detailsByOuterHTML))\n .map((outerHTML) => this.detailsByOuterHTML[outerHTML])\n .filter(({ type }) => type == matchedType)\n .map(({ elements: [element] }) => element)\n }\n\n get provisionalElements() {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const { type, tracked, elements } = this.detailsByOuterHTML[outerHTML];\n if (type == null && !tracked) {\n return [...result, ...elements]\n } else if (elements.length > 1) {\n return [...result, ...elements.slice(1)]\n } else {\n return result\n }\n }, [])\n }\n\n getMetaValue(name) {\n const element = this.findMetaElementByName(name);\n return element ? element.getAttribute(\"content\") : null\n }\n\n findMetaElementByName(name) {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const {\n elements: [element]\n } = this.detailsByOuterHTML[outerHTML];\n return elementIsMetaElementWithName(element, name) ? element : result\n }, undefined | undefined)\n }\n}\n\nfunction elementType(element) {\n if (elementIsScript(element)) {\n return \"script\"\n } else if (elementIsStylesheet(element)) {\n return \"stylesheet\"\n }\n}\n\nfunction elementIsTracked(element) {\n return element.getAttribute(\"data-turbo-track\") == \"reload\"\n}\n\nfunction elementIsScript(element) {\n const tagName = element.localName;\n return tagName == \"script\"\n}\n\nfunction elementIsNoscript(element) {\n const tagName = element.localName;\n return tagName == \"noscript\"\n}\n\nfunction elementIsStylesheet(element) {\n const tagName = element.localName;\n return tagName == \"style\" || (tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\")\n}\n\nfunction elementIsMetaElementWithName(element, name) {\n const tagName = element.localName;\n return tagName == \"meta\" && element.getAttribute(\"name\") == name\n}\n\nfunction elementWithoutNonce(element) {\n if (element.hasAttribute(\"nonce\")) {\n element.setAttribute(\"nonce\", \"\");\n }\n\n return element\n}\n\nclass PageSnapshot extends Snapshot {\n static fromHTMLString(html = \"\") {\n return this.fromDocument(parseHTMLDocument(html))\n }\n\n static fromElement(element) {\n return this.fromDocument(element.ownerDocument)\n }\n\n static fromDocument({ documentElement, body, head }) {\n return new this(documentElement, body, new HeadSnapshot(head))\n }\n\n constructor(documentElement, body, headSnapshot) {\n super(body);\n this.documentElement = documentElement;\n this.headSnapshot = headSnapshot;\n }\n\n clone() {\n const clonedElement = this.element.cloneNode(true);\n\n const selectElements = this.element.querySelectorAll(\"select\");\n const clonedSelectElements = clonedElement.querySelectorAll(\"select\");\n\n for (const [index, source] of selectElements.entries()) {\n const clone = clonedSelectElements[index];\n for (const option of clone.selectedOptions) option.selected = false;\n for (const option of source.selectedOptions) clone.options[option.index].selected = true;\n }\n\n for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type=\"password\"]')) {\n clonedPasswordInput.value = \"\";\n }\n\n for (const clonedNoscriptElement of clonedElement.querySelectorAll(\"noscript\")) {\n clonedNoscriptElement.remove();\n }\n\n return new PageSnapshot(this.documentElement, clonedElement, this.headSnapshot)\n }\n\n get lang() {\n return this.documentElement.getAttribute(\"lang\")\n }\n\n get dir() {\n return this.documentElement.getAttribute(\"dir\")\n }\n\n get headElement() {\n return this.headSnapshot.element\n }\n\n get rootLocation() {\n const root = this.getSetting(\"root\") ?? \"/\";\n return expandURL(root)\n }\n\n get cacheControlValue() {\n return this.getSetting(\"cache-control\")\n }\n\n get isPreviewable() {\n return this.cacheControlValue != \"no-preview\"\n }\n\n get isCacheable() {\n return this.cacheControlValue != \"no-cache\"\n }\n\n get isVisitable() {\n return this.getSetting(\"visit-control\") != \"reload\"\n }\n\n get prefersViewTransitions() {\n const viewTransitionEnabled = this.getSetting(\"view-transition\") === \"true\" || this.headSnapshot.getMetaValue(\"view-transition\") === \"same-origin\";\n return viewTransitionEnabled && !window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n }\n\n get refreshMethod() {\n return this.getSetting(\"refresh-method\")\n }\n\n get refreshScroll() {\n return this.getSetting(\"refresh-scroll\")\n }\n\n // Private\n\n getSetting(name) {\n return this.headSnapshot.getMetaValue(`turbo-${name}`)\n }\n}\n\nclass ViewTransitioner {\n #viewTransitionStarted = false\n #lastOperation = Promise.resolve()\n\n renderChange(useViewTransition, render) {\n if (useViewTransition && this.viewTransitionsAvailable && !this.#viewTransitionStarted) {\n this.#viewTransitionStarted = true;\n this.#lastOperation = this.#lastOperation.then(async () => {\n await document.startViewTransition(render).finished;\n });\n } else {\n this.#lastOperation = this.#lastOperation.then(render);\n }\n\n return this.#lastOperation\n }\n\n get viewTransitionsAvailable() {\n return document.startViewTransition\n }\n}\n\nconst defaultOptions = {\n action: \"advance\",\n historyChanged: false,\n visitCachedSnapshot: () => {},\n willRender: true,\n updateHistory: true,\n shouldCacheSnapshot: true,\n acceptsStreamResponse: false,\n refresh: {}\n};\n\nconst TimingMetric = {\n visitStart: \"visitStart\",\n requestStart: \"requestStart\",\n requestEnd: \"requestEnd\",\n visitEnd: \"visitEnd\"\n};\n\nconst VisitState = {\n initialized: \"initialized\",\n started: \"started\",\n canceled: \"canceled\",\n failed: \"failed\",\n completed: \"completed\"\n};\n\nconst SystemStatusCode = {\n networkFailure: 0,\n timeoutFailure: -1,\n contentTypeMismatch: -2\n};\n\nconst Direction = {\n advance: \"forward\",\n restore: \"back\",\n replace: \"none\"\n};\n\nclass Visit {\n identifier = uuid() // Required by turbo-ios\n timingMetrics = {}\n\n followedRedirect = false\n historyChanged = false\n scrolled = false\n shouldCacheSnapshot = true\n acceptsStreamResponse = false\n snapshotCached = false\n state = VisitState.initialized\n viewTransitioner = new ViewTransitioner()\n\n constructor(delegate, location, restorationIdentifier, options = {}) {\n this.delegate = delegate;\n this.location = location;\n this.restorationIdentifier = restorationIdentifier || uuid();\n\n const {\n action,\n historyChanged,\n referrer,\n snapshot,\n snapshotHTML,\n response,\n visitCachedSnapshot,\n willRender,\n updateHistory,\n shouldCacheSnapshot,\n acceptsStreamResponse,\n direction,\n refresh\n } = {\n ...defaultOptions,\n ...options\n };\n this.action = action;\n this.historyChanged = historyChanged;\n this.referrer = referrer;\n this.snapshot = snapshot;\n this.snapshotHTML = snapshotHTML;\n this.response = response;\n this.isPageRefresh = this.view.isPageRefresh(this);\n this.visitCachedSnapshot = visitCachedSnapshot;\n this.willRender = willRender;\n this.updateHistory = updateHistory;\n this.scrolled = !willRender;\n this.shouldCacheSnapshot = shouldCacheSnapshot;\n this.acceptsStreamResponse = acceptsStreamResponse;\n this.direction = direction || Direction[action];\n this.refresh = refresh;\n }\n\n get adapter() {\n return this.delegate.adapter\n }\n\n get view() {\n return this.delegate.view\n }\n\n get history() {\n return this.delegate.history\n }\n\n get restorationData() {\n return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)\n }\n\n start() {\n if (this.state == VisitState.initialized) {\n this.recordTimingMetric(TimingMetric.visitStart);\n this.state = VisitState.started;\n this.adapter.visitStarted(this);\n this.delegate.visitStarted(this);\n }\n }\n\n cancel() {\n if (this.state == VisitState.started) {\n if (this.request) {\n this.request.cancel();\n }\n this.cancelRender();\n this.state = VisitState.canceled;\n }\n }\n\n complete() {\n if (this.state == VisitState.started) {\n this.recordTimingMetric(TimingMetric.visitEnd);\n this.adapter.visitCompleted(this);\n this.state = VisitState.completed;\n this.followRedirect();\n\n if (!this.followedRedirect) {\n this.delegate.visitCompleted(this);\n }\n }\n }\n\n fail() {\n if (this.state == VisitState.started) {\n this.state = VisitState.failed;\n this.adapter.visitFailed(this);\n this.delegate.visitCompleted(this);\n }\n }\n\n changeHistory() {\n if (!this.historyChanged && this.updateHistory) {\n const actionForHistory = this.location.href === this.referrer?.href ? \"replace\" : this.action;\n const method = getHistoryMethodForAction(actionForHistory);\n this.history.update(method, this.location, this.restorationIdentifier);\n this.historyChanged = true;\n }\n }\n\n issueRequest() {\n if (this.hasPreloadedResponse()) {\n this.simulateRequest();\n } else if (this.shouldIssueRequest() && !this.request) {\n this.request = new FetchRequest(this, FetchMethod.get, this.location);\n this.request.perform();\n }\n }\n\n simulateRequest() {\n if (this.response) {\n this.startRequest();\n this.recordResponse();\n this.finishRequest();\n }\n }\n\n startRequest() {\n this.recordTimingMetric(TimingMetric.requestStart);\n this.adapter.visitRequestStarted(this);\n }\n\n recordResponse(response = this.response) {\n this.response = response;\n if (response) {\n const { statusCode } = response;\n if (isSuccessful(statusCode)) {\n this.adapter.visitRequestCompleted(this);\n } else {\n this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n }\n }\n }\n\n finishRequest() {\n this.recordTimingMetric(TimingMetric.requestEnd);\n this.adapter.visitRequestFinished(this);\n }\n\n loadResponse() {\n if (this.response) {\n const { statusCode, responseHTML } = this.response;\n this.render(async () => {\n if (this.shouldCacheSnapshot) this.cacheSnapshot();\n if (this.view.renderPromise) await this.view.renderPromise;\n\n if (isSuccessful(statusCode) && responseHTML != null) {\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n await this.renderPageSnapshot(snapshot, false);\n\n this.adapter.visitRendered(this);\n this.complete();\n } else {\n await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);\n this.adapter.visitRendered(this);\n this.fail();\n }\n });\n }\n }\n\n getCachedSnapshot() {\n const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();\n\n if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {\n if (this.action == \"restore\" || snapshot.isPreviewable) {\n return snapshot\n }\n }\n }\n\n getPreloadedSnapshot() {\n if (this.snapshotHTML) {\n return PageSnapshot.fromHTMLString(this.snapshotHTML)\n }\n }\n\n hasCachedSnapshot() {\n return this.getCachedSnapshot() != null\n }\n\n loadCachedSnapshot() {\n const snapshot = this.getCachedSnapshot();\n if (snapshot) {\n const isPreview = this.shouldIssueRequest();\n this.render(async () => {\n this.cacheSnapshot();\n if (this.isPageRefresh) {\n this.adapter.visitRendered(this);\n } else {\n if (this.view.renderPromise) await this.view.renderPromise;\n\n await this.renderPageSnapshot(snapshot, isPreview);\n\n this.adapter.visitRendered(this);\n if (!isPreview) {\n this.complete();\n }\n }\n });\n }\n }\n\n followRedirect() {\n if (this.redirectedToLocation && !this.followedRedirect && this.response?.redirected) {\n this.adapter.visitProposedToLocation(this.redirectedToLocation, {\n action: \"replace\",\n response: this.response,\n shouldCacheSnapshot: false,\n willRender: false\n });\n this.followedRedirect = true;\n }\n }\n\n // Fetch request delegate\n\n prepareRequest(request) {\n if (this.acceptsStreamResponse) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted() {\n this.startRequest();\n }\n\n requestPreventedHandlingResponse(_request, _response) {}\n\n async requestSucceededWithResponse(request, response) {\n const responseHTML = await response.responseHTML;\n const { redirected, statusCode } = response;\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected\n });\n } else {\n this.redirectedToLocation = response.redirected ? response.location : undefined;\n this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n }\n }\n\n async requestFailedWithResponse(request, response) {\n const responseHTML = await response.responseHTML;\n const { redirected, statusCode } = response;\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected\n });\n } else {\n this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n }\n }\n\n requestErrored(_request, _error) {\n this.recordResponse({\n statusCode: SystemStatusCode.networkFailure,\n redirected: false\n });\n }\n\n requestFinished() {\n this.finishRequest();\n }\n\n // Scrolling\n\n performScroll() {\n if (!this.scrolled && !this.view.forceReloaded && !this.view.shouldPreserveScrollPosition(this)) {\n if (this.action == \"restore\") {\n this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();\n } else {\n this.scrollToAnchor() || this.view.scrollToTop();\n }\n\n this.scrolled = true;\n }\n }\n\n scrollToRestoredPosition() {\n const { scrollPosition } = this.restorationData;\n if (scrollPosition) {\n this.view.scrollToPosition(scrollPosition);\n return true\n }\n }\n\n scrollToAnchor() {\n const anchor = getAnchor(this.location);\n if (anchor != null) {\n this.view.scrollToAnchor(anchor);\n return true\n }\n }\n\n // Instrumentation\n\n recordTimingMetric(metric) {\n this.timingMetrics[metric] = new Date().getTime();\n }\n\n getTimingMetrics() {\n return { ...this.timingMetrics }\n }\n\n // Private\n\n hasPreloadedResponse() {\n return typeof this.response == \"object\"\n }\n\n shouldIssueRequest() {\n if (this.action == \"restore\") {\n return !this.hasCachedSnapshot()\n } else {\n return this.willRender\n }\n }\n\n cacheSnapshot() {\n if (!this.snapshotCached) {\n this.view.cacheSnapshot(this.snapshot).then((snapshot) => snapshot && this.visitCachedSnapshot(snapshot));\n this.snapshotCached = true;\n }\n }\n\n async render(callback) {\n this.cancelRender();\n await new Promise((resolve) => {\n this.frame =\n document.visibilityState === \"hidden\" ? setTimeout(() => resolve(), 0) : requestAnimationFrame(() => resolve());\n });\n await callback();\n delete this.frame;\n }\n\n async renderPageSnapshot(snapshot, isPreview) {\n await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(snapshot), async () => {\n await this.view.renderPage(snapshot, isPreview, this.willRender, this);\n this.performScroll();\n });\n }\n\n cancelRender() {\n if (this.frame) {\n cancelAnimationFrame(this.frame);\n delete this.frame;\n }\n }\n}\n\nfunction isSuccessful(statusCode) {\n return statusCode >= 200 && statusCode < 300\n}\n\nclass BrowserAdapter {\n progressBar = new ProgressBar()\n\n constructor(session) {\n this.session = session;\n }\n\n visitProposedToLocation(location, options) {\n if (locationIsVisitable(location, this.navigator.rootLocation)) {\n this.navigator.startVisit(location, options?.restorationIdentifier || uuid(), options);\n } else {\n window.location.href = location.toString();\n }\n }\n\n visitStarted(visit) {\n this.location = visit.location;\n this.redirectedToLocation = null;\n\n visit.loadCachedSnapshot();\n visit.issueRequest();\n }\n\n visitRequestStarted(visit) {\n this.progressBar.setValue(0);\n if (visit.hasCachedSnapshot() || visit.action != \"restore\") {\n this.showVisitProgressBarAfterDelay();\n } else {\n this.showProgressBar();\n }\n }\n\n visitRequestCompleted(visit) {\n visit.loadResponse();\n\n if (visit.response.redirected) {\n this.redirectedToLocation = visit.redirectedToLocation;\n }\n }\n\n visitRequestFailedWithStatusCode(visit, statusCode) {\n switch (statusCode) {\n case SystemStatusCode.networkFailure:\n case SystemStatusCode.timeoutFailure:\n case SystemStatusCode.contentTypeMismatch:\n return this.reload({\n reason: \"request_failed\",\n context: {\n statusCode\n }\n })\n default:\n return visit.loadResponse()\n }\n }\n\n visitRequestFinished(_visit) {}\n\n visitCompleted(_visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n\n pageInvalidated(reason) {\n this.reload(reason);\n }\n\n visitFailed(_visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n\n visitRendered(_visit) {}\n\n // Link prefetching\n\n linkPrefetchingIsEnabledForLocation(location) {\n return true\n }\n\n // Form Submission Delegate\n\n formSubmissionStarted(_formSubmission) {\n this.progressBar.setValue(0);\n this.showFormProgressBarAfterDelay();\n }\n\n formSubmissionFinished(_formSubmission) {\n this.progressBar.setValue(1);\n this.hideFormProgressBar();\n }\n\n // Private\n\n showVisitProgressBarAfterDelay() {\n this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n\n hideVisitProgressBar() {\n this.progressBar.hide();\n if (this.visitProgressBarTimeout != null) {\n window.clearTimeout(this.visitProgressBarTimeout);\n delete this.visitProgressBarTimeout;\n }\n }\n\n showFormProgressBarAfterDelay() {\n if (this.formProgressBarTimeout == null) {\n this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n }\n\n hideFormProgressBar() {\n this.progressBar.hide();\n if (this.formProgressBarTimeout != null) {\n window.clearTimeout(this.formProgressBarTimeout);\n delete this.formProgressBarTimeout;\n }\n }\n\n showProgressBar = () => {\n this.progressBar.show();\n }\n\n reload(reason) {\n dispatch(\"turbo:reload\", { detail: reason });\n\n window.location.href = (this.redirectedToLocation || this.location)?.toString() || window.location.href;\n }\n\n get navigator() {\n return this.session.navigator\n }\n}\n\nclass CacheObserver {\n selector = \"[data-turbo-temporary]\"\n\n started = false\n\n start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n\n stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n\n removeTemporaryElements = (_event) => {\n for (const element of this.temporaryElements) {\n element.remove();\n }\n }\n\n get temporaryElements() {\n return [...document.querySelectorAll(this.selector)]\n }\n}\n\nclass FrameRedirector {\n constructor(session, element) {\n this.session = session;\n this.element = element;\n this.linkInterceptor = new LinkInterceptor(this, element);\n this.formSubmitObserver = new FormSubmitObserver(this, element);\n }\n\n start() {\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n\n stop() {\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n }\n\n // Link interceptor delegate\n\n shouldInterceptLinkClick(element, _location, _event) {\n return this.#shouldRedirect(element)\n }\n\n linkClickIntercepted(element, url, event) {\n const frame = this.#findFrameElement(element);\n if (frame) {\n frame.delegate.linkClickIntercepted(element, url, event);\n }\n }\n\n // Form submit observer delegate\n\n willSubmitForm(element, submitter) {\n return (\n element.closest(\"turbo-frame\") == null &&\n this.#shouldSubmit(element, submitter) &&\n this.#shouldRedirect(element, submitter)\n )\n }\n\n formSubmitted(element, submitter) {\n const frame = this.#findFrameElement(element, submitter);\n if (frame) {\n frame.delegate.formSubmitted(element, submitter);\n }\n }\n\n #shouldSubmit(form, submitter) {\n const action = getAction$1(form, submitter);\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const rootLocation = expandURL(meta?.content ?? \"/\");\n\n return this.#shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation)\n }\n\n #shouldRedirect(element, submitter) {\n const isNavigatable =\n element instanceof HTMLFormElement\n ? this.session.submissionIsNavigatable(element, submitter)\n : this.session.elementIsNavigatable(element);\n\n if (isNavigatable) {\n const frame = this.#findFrameElement(element, submitter);\n return frame ? frame != element.closest(\"turbo-frame\") : false\n } else {\n return false\n }\n }\n\n #findFrameElement(element, submitter) {\n const id = submitter?.getAttribute(\"data-turbo-frame\") || element.getAttribute(\"data-turbo-frame\");\n if (id && id != \"_top\") {\n const frame = this.element.querySelector(`#${id}:not([disabled])`);\n if (frame instanceof FrameElement) {\n return frame\n }\n }\n }\n}\n\nclass History {\n location\n restorationIdentifier = uuid()\n restorationData = {}\n started = false\n currentIndex = 0\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n addEventListener(\"popstate\", this.onPopState, false);\n this.currentIndex = history.state?.turbo?.restorationIndex || 0;\n this.started = true;\n this.replace(new URL(window.location.href));\n }\n }\n\n stop() {\n if (this.started) {\n removeEventListener(\"popstate\", this.onPopState, false);\n this.started = false;\n }\n }\n\n push(location, restorationIdentifier) {\n this.update(history.pushState, location, restorationIdentifier);\n }\n\n replace(location, restorationIdentifier) {\n this.update(history.replaceState, location, restorationIdentifier);\n }\n\n update(method, location, restorationIdentifier = uuid()) {\n if (method === history.pushState) ++this.currentIndex;\n\n const state = { turbo: { restorationIdentifier, restorationIndex: this.currentIndex } };\n method.call(history, state, \"\", location.href);\n this.location = location;\n this.restorationIdentifier = restorationIdentifier;\n }\n\n // Restoration data\n\n getRestorationDataForIdentifier(restorationIdentifier) {\n return this.restorationData[restorationIdentifier] || {}\n }\n\n updateRestorationData(additionalData) {\n const { restorationIdentifier } = this;\n const restorationData = this.restorationData[restorationIdentifier];\n this.restorationData[restorationIdentifier] = {\n ...restorationData,\n ...additionalData\n };\n }\n\n // Scroll restoration\n\n assumeControlOfScrollRestoration() {\n if (!this.previousScrollRestoration) {\n this.previousScrollRestoration = history.scrollRestoration ?? \"auto\";\n history.scrollRestoration = \"manual\";\n }\n }\n\n relinquishControlOfScrollRestoration() {\n if (this.previousScrollRestoration) {\n history.scrollRestoration = this.previousScrollRestoration;\n delete this.previousScrollRestoration;\n }\n }\n\n // Event handlers\n\n onPopState = (event) => {\n const { turbo } = event.state || {};\n this.location = new URL(window.location.href);\n\n if (turbo) {\n const { restorationIdentifier, restorationIndex } = turbo;\n this.restorationIdentifier = restorationIdentifier;\n const direction = restorationIndex > this.currentIndex ? \"forward\" : \"back\";\n this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location, restorationIdentifier, direction);\n this.currentIndex = restorationIndex;\n } else {\n this.currentIndex++;\n this.delegate.historyPoppedWithEmptyState(this.location);\n }\n }\n}\n\nclass LinkPrefetchObserver {\n started = false\n #prefetchedLink = null\n\n constructor(delegate, eventTarget) {\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n\n start() {\n if (this.started) return\n\n if (this.eventTarget.readyState === \"loading\") {\n this.eventTarget.addEventListener(\"DOMContentLoaded\", this.#enable, { once: true });\n } else {\n this.#enable();\n }\n }\n\n stop() {\n if (!this.started) return\n\n this.eventTarget.removeEventListener(\"mouseenter\", this.#tryToPrefetchRequest, {\n capture: true,\n passive: true\n });\n this.eventTarget.removeEventListener(\"mouseleave\", this.#cancelRequestIfObsolete, {\n capture: true,\n passive: true\n });\n\n this.eventTarget.removeEventListener(\"turbo:before-fetch-request\", this.#tryToUsePrefetchedRequest, true);\n this.started = false;\n }\n\n #enable = () => {\n this.eventTarget.addEventListener(\"mouseenter\", this.#tryToPrefetchRequest, {\n capture: true,\n passive: true\n });\n this.eventTarget.addEventListener(\"mouseleave\", this.#cancelRequestIfObsolete, {\n capture: true,\n passive: true\n });\n\n this.eventTarget.addEventListener(\"turbo:before-fetch-request\", this.#tryToUsePrefetchedRequest, true);\n this.started = true;\n }\n\n #tryToPrefetchRequest = (event) => {\n if (getMetaContent(\"turbo-prefetch\") === \"false\") return\n\n const target = event.target;\n const isLink = target.matches && target.matches(\"a[href]:not([target^=_]):not([download])\");\n\n if (isLink && this.#isPrefetchable(target)) {\n const link = target;\n const location = getLocationForLink(link);\n\n if (this.delegate.canPrefetchRequestToLocation(link, location)) {\n this.#prefetchedLink = link;\n\n const fetchRequest = new FetchRequest(\n this,\n FetchMethod.get,\n location,\n new URLSearchParams(),\n target\n );\n\n fetchRequest.fetchOptions.priority = \"low\";\n\n prefetchCache.putLater(location, fetchRequest, this.#cacheTtl);\n }\n }\n }\n\n #cancelRequestIfObsolete = (event) => {\n if (event.target === this.#prefetchedLink) this.#cancelPrefetchRequest();\n }\n\n #cancelPrefetchRequest = () => {\n prefetchCache.clear();\n this.#prefetchedLink = null;\n }\n\n #tryToUsePrefetchedRequest = (event) => {\n if (event.target.tagName !== \"FORM\" && event.detail.fetchOptions.method === \"GET\") {\n const cached = prefetchCache.get(event.detail.url);\n\n if (cached) {\n // User clicked link, use cache response\n event.detail.fetchRequest = cached;\n }\n\n prefetchCache.clear();\n }\n }\n\n prepareRequest(request) {\n const link = request.target;\n\n request.headers[\"X-Sec-Purpose\"] = \"prefetch\";\n\n const turboFrame = link.closest(\"turbo-frame\");\n const turboFrameTarget = link.getAttribute(\"data-turbo-frame\") || turboFrame?.getAttribute(\"target\") || turboFrame?.id;\n\n if (turboFrameTarget && turboFrameTarget !== \"_top\") {\n request.headers[\"Turbo-Frame\"] = turboFrameTarget;\n }\n }\n\n // Fetch request interface\n\n requestSucceededWithResponse() {}\n\n requestStarted(fetchRequest) {}\n\n requestErrored(fetchRequest) {}\n\n requestFinished(fetchRequest) {}\n\n requestPreventedHandlingResponse(fetchRequest, fetchResponse) {}\n\n requestFailedWithResponse(fetchRequest, fetchResponse) {}\n\n get #cacheTtl() {\n return Number(getMetaContent(\"turbo-prefetch-cache-time\")) || cacheTtl\n }\n\n #isPrefetchable(link) {\n const href = link.getAttribute(\"href\");\n\n if (!href) return false\n\n if (unfetchableLink(link)) return false\n if (linkToTheSamePage(link)) return false\n if (linkOptsOut(link)) return false\n if (nonSafeLink(link)) return false\n if (eventPrevented(link)) return false\n\n return true\n }\n}\n\nconst unfetchableLink = (link) => {\n return link.origin !== document.location.origin || ![\"http:\", \"https:\"].includes(link.protocol) || link.hasAttribute(\"target\")\n};\n\nconst linkToTheSamePage = (link) => {\n return (link.pathname + link.search === document.location.pathname + document.location.search) || link.href.startsWith(\"#\")\n};\n\nconst linkOptsOut = (link) => {\n if (link.getAttribute(\"data-turbo-prefetch\") === \"false\") return true\n if (link.getAttribute(\"data-turbo\") === \"false\") return true\n\n const turboPrefetchParent = findClosestRecursively(link, \"[data-turbo-prefetch]\");\n if (turboPrefetchParent && turboPrefetchParent.getAttribute(\"data-turbo-prefetch\") === \"false\") return true\n\n return false\n};\n\nconst nonSafeLink = (link) => {\n const turboMethod = link.getAttribute(\"data-turbo-method\");\n if (turboMethod && turboMethod.toLowerCase() !== \"get\") return true\n\n if (isUJS(link)) return true\n if (link.hasAttribute(\"data-turbo-confirm\")) return true\n if (link.hasAttribute(\"data-turbo-stream\")) return true\n\n return false\n};\n\nconst isUJS = (link) => {\n return link.hasAttribute(\"data-remote\") || link.hasAttribute(\"data-behavior\") || link.hasAttribute(\"data-confirm\") || link.hasAttribute(\"data-method\")\n};\n\nconst eventPrevented = (link) => {\n const event = dispatch(\"turbo:before-prefetch\", { target: link, cancelable: true });\n return event.defaultPrevented\n};\n\nclass Navigator {\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n proposeVisit(location, options = {}) {\n if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {\n this.delegate.visitProposedToLocation(location, options);\n }\n }\n\n startVisit(locatable, restorationIdentifier, options = {}) {\n this.stop();\n this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, {\n referrer: this.location,\n ...options\n });\n this.currentVisit.start();\n }\n\n submitForm(form, submitter) {\n this.stop();\n this.formSubmission = new FormSubmission(this, form, submitter, true);\n\n this.formSubmission.start();\n }\n\n stop() {\n if (this.formSubmission) {\n this.formSubmission.stop();\n delete this.formSubmission;\n }\n\n if (this.currentVisit) {\n this.currentVisit.cancel();\n delete this.currentVisit;\n }\n }\n\n get adapter() {\n return this.delegate.adapter\n }\n\n get view() {\n return this.delegate.view\n }\n\n get rootLocation() {\n return this.view.snapshot.rootLocation\n }\n\n get history() {\n return this.delegate.history\n }\n\n // Form submission delegate\n\n formSubmissionStarted(formSubmission) {\n // Not all adapters implement formSubmissionStarted\n if (typeof this.adapter.formSubmissionStarted === \"function\") {\n this.adapter.formSubmissionStarted(formSubmission);\n }\n }\n\n async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {\n if (formSubmission == this.formSubmission) {\n const responseHTML = await fetchResponse.responseHTML;\n if (responseHTML) {\n const shouldCacheSnapshot = formSubmission.isSafe;\n if (!shouldCacheSnapshot) {\n this.view.clearSnapshotCache();\n }\n\n const { statusCode, redirected } = fetchResponse;\n const action = this.#getActionForFormSubmission(formSubmission, fetchResponse);\n const visitOptions = {\n action,\n shouldCacheSnapshot,\n response: { statusCode, responseHTML, redirected }\n };\n this.proposeVisit(fetchResponse.location, visitOptions);\n }\n }\n }\n\n async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n const responseHTML = await fetchResponse.responseHTML;\n\n if (responseHTML) {\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n if (fetchResponse.serverError) {\n await this.view.renderError(snapshot, this.currentVisit);\n } else {\n await this.view.renderPage(snapshot, false, true, this.currentVisit);\n }\n if (snapshot.refreshScroll !== \"preserve\") {\n this.view.scrollToTop();\n }\n this.view.clearSnapshotCache();\n }\n }\n\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n\n formSubmissionFinished(formSubmission) {\n // Not all adapters implement formSubmissionFinished\n if (typeof this.adapter.formSubmissionFinished === \"function\") {\n this.adapter.formSubmissionFinished(formSubmission);\n }\n }\n\n // Link prefetching\n\n linkPrefetchingIsEnabledForLocation(location) {\n // Not all adapters implement linkPrefetchingIsEnabledForLocation\n if (typeof this.adapter.linkPrefetchingIsEnabledForLocation === \"function\") {\n return this.adapter.linkPrefetchingIsEnabledForLocation(location)\n }\n\n return true\n }\n\n // Visit delegate\n\n visitStarted(visit) {\n this.delegate.visitStarted(visit);\n }\n\n visitCompleted(visit) {\n this.delegate.visitCompleted(visit);\n delete this.currentVisit;\n }\n\n // Same-page links are no longer handled with a Visit.\n // This method is still needed for Turbo Native adapters.\n locationWithActionIsSamePage(location, action) {\n return false\n }\n\n // Visits\n\n get location() {\n return this.history.location\n }\n\n get restorationIdentifier() {\n return this.history.restorationIdentifier\n }\n\n #getActionForFormSubmission(formSubmission, fetchResponse) {\n const { submitter, formElement } = formSubmission;\n return getVisitAction(submitter, formElement) || this.#getDefaultAction(fetchResponse)\n }\n\n #getDefaultAction(fetchResponse) {\n const sameLocationRedirect = fetchResponse.redirected && fetchResponse.location.href === this.location?.href;\n return sameLocationRedirect ? \"replace\" : \"advance\"\n }\n}\n\nconst PageStage = {\n initial: 0,\n loading: 1,\n interactive: 2,\n complete: 3\n};\n\nclass PageObserver {\n stage = PageStage.initial\n started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n if (this.stage == PageStage.initial) {\n this.stage = PageStage.loading;\n }\n document.addEventListener(\"readystatechange\", this.interpretReadyState, false);\n addEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n document.removeEventListener(\"readystatechange\", this.interpretReadyState, false);\n removeEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = false;\n }\n }\n\n interpretReadyState = () => {\n const { readyState } = this;\n if (readyState == \"interactive\") {\n this.pageIsInteractive();\n } else if (readyState == \"complete\") {\n this.pageIsComplete();\n }\n }\n\n pageIsInteractive() {\n if (this.stage == PageStage.loading) {\n this.stage = PageStage.interactive;\n this.delegate.pageBecameInteractive();\n }\n }\n\n pageIsComplete() {\n this.pageIsInteractive();\n if (this.stage == PageStage.interactive) {\n this.stage = PageStage.complete;\n this.delegate.pageLoaded();\n }\n }\n\n pageWillUnload = () => {\n this.delegate.pageWillUnload();\n }\n\n get readyState() {\n return document.readyState\n }\n}\n\nclass ScrollObserver {\n started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.started) {\n addEventListener(\"scroll\", this.onScroll, false);\n this.onScroll();\n this.started = true;\n }\n }\n\n stop() {\n if (this.started) {\n removeEventListener(\"scroll\", this.onScroll, false);\n this.started = false;\n }\n }\n\n onScroll = () => {\n this.updatePosition({ x: window.pageXOffset, y: window.pageYOffset });\n }\n\n // Private\n\n updatePosition(position) {\n this.delegate.scrollPositionChanged(position);\n }\n}\n\nclass StreamMessageRenderer {\n render({ fragment }) {\n Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => {\n withAutofocusFromFragment(fragment, () => {\n withPreservedFocus(() => {\n document.documentElement.appendChild(fragment);\n });\n });\n });\n }\n\n // Bardo delegate\n\n enteringBardo(currentPermanentElement, newPermanentElement) {\n newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));\n }\n\n leavingBardo() {}\n}\n\nfunction getPermanentElementMapForFragment(fragment) {\n const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);\n const permanentElementMap = {};\n for (const permanentElementInDocument of permanentElementsInDocument) {\n const { id } = permanentElementInDocument;\n\n for (const streamElement of fragment.querySelectorAll(\"turbo-stream\")) {\n const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);\n\n if (elementInStream) {\n permanentElementMap[id] = [permanentElementInDocument, elementInStream];\n }\n }\n }\n\n return permanentElementMap\n}\n\nasync function withAutofocusFromFragment(fragment, callback) {\n const generatedID = `turbo-stream-autofocus-${uuid()}`;\n const turboStreams = fragment.querySelectorAll(\"turbo-stream\");\n const elementWithAutofocus = firstAutofocusableElementInStreams(turboStreams);\n let willAutofocusId = null;\n\n if (elementWithAutofocus) {\n if (elementWithAutofocus.id) {\n willAutofocusId = elementWithAutofocus.id;\n } else {\n willAutofocusId = generatedID;\n }\n\n elementWithAutofocus.id = willAutofocusId;\n }\n\n callback();\n await nextRepaint();\n\n const hasNoActiveElement = document.activeElement == null || document.activeElement == document.body;\n\n if (hasNoActiveElement && willAutofocusId) {\n const elementToAutofocus = document.getElementById(willAutofocusId);\n\n if (elementIsFocusable(elementToAutofocus)) {\n elementToAutofocus.focus();\n }\n if (elementToAutofocus && elementToAutofocus.id == generatedID) {\n elementToAutofocus.removeAttribute(\"id\");\n }\n }\n}\n\nasync function withPreservedFocus(callback) {\n const [activeElementBeforeRender, activeElementAfterRender] = await around(callback, () => document.activeElement);\n\n const restoreFocusTo = activeElementBeforeRender && activeElementBeforeRender.id;\n\n if (restoreFocusTo) {\n const elementToFocus = document.getElementById(restoreFocusTo);\n\n if (elementIsFocusable(elementToFocus) && elementToFocus != activeElementAfterRender) {\n elementToFocus.focus();\n }\n }\n}\n\nfunction firstAutofocusableElementInStreams(nodeListOfStreamElements) {\n for (const streamElement of nodeListOfStreamElements) {\n const elementWithAutofocus = queryAutofocusableElement(streamElement.templateElement.content);\n\n if (elementWithAutofocus) return elementWithAutofocus\n }\n\n return null\n}\n\nclass StreamObserver {\n sources = new Set()\n #started = false\n\n constructor(delegate) {\n this.delegate = delegate;\n }\n\n start() {\n if (!this.#started) {\n this.#started = true;\n addEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n\n stop() {\n if (this.#started) {\n this.#started = false;\n removeEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n\n connectStreamSource(source) {\n if (!this.streamSourceIsConnected(source)) {\n this.sources.add(source);\n source.addEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n\n disconnectStreamSource(source) {\n if (this.streamSourceIsConnected(source)) {\n this.sources.delete(source);\n source.removeEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n\n streamSourceIsConnected(source) {\n return this.sources.has(source)\n }\n\n inspectFetchResponse = (event) => {\n const response = fetchResponseFromEvent(event);\n if (response && fetchResponseIsStream(response)) {\n event.preventDefault();\n this.receiveMessageResponse(response);\n }\n }\n\n receiveMessageEvent = (event) => {\n if (this.#started && typeof event.data == \"string\") {\n this.receiveMessageHTML(event.data);\n }\n }\n\n async receiveMessageResponse(response) {\n const html = await response.responseHTML;\n if (html) {\n this.receiveMessageHTML(html);\n }\n }\n\n receiveMessageHTML(html) {\n this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));\n }\n}\n\nfunction fetchResponseFromEvent(event) {\n const fetchResponse = event.detail?.fetchResponse;\n if (fetchResponse instanceof FetchResponse) {\n return fetchResponse\n }\n}\n\nfunction fetchResponseIsStream(response) {\n const contentType = response.contentType ?? \"\";\n return contentType.startsWith(StreamMessage.contentType)\n}\n\nclass ErrorRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n const { documentElement, body } = document;\n\n documentElement.replaceChild(newElement, body);\n }\n\n async render() {\n this.replaceHeadAndBody();\n this.activateScriptElements();\n }\n\n replaceHeadAndBody() {\n const { documentElement, head } = document;\n documentElement.replaceChild(this.newHead, head);\n this.renderElement(this.currentElement, this.newElement);\n }\n\n activateScriptElements() {\n for (const replaceableElement of this.scriptElements) {\n const parentNode = replaceableElement.parentNode;\n if (parentNode) {\n const element = activateScriptElement(replaceableElement);\n parentNode.replaceChild(element, replaceableElement);\n }\n }\n }\n\n get newHead() {\n return this.newSnapshot.headSnapshot.element\n }\n\n get scriptElements() {\n return document.documentElement.querySelectorAll(\"script\")\n }\n}\n\nclass PageRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n if (document.body && newElement instanceof HTMLBodyElement) {\n document.body.replaceWith(newElement);\n } else {\n document.documentElement.appendChild(newElement);\n }\n }\n\n get shouldRender() {\n return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical\n }\n\n get reloadReason() {\n if (!this.newSnapshot.isVisitable) {\n return {\n reason: \"turbo_visit_control_is_reload\"\n }\n }\n\n if (!this.trackedElementsAreIdentical) {\n return {\n reason: \"tracked_element_mismatch\"\n }\n }\n }\n\n async prepareToRender() {\n this.#setLanguage();\n await this.mergeHead();\n }\n\n async render() {\n if (this.willRender) {\n await this.replaceBody();\n }\n }\n\n finishRendering() {\n super.finishRendering();\n if (!this.isPreview) {\n this.focusFirstAutofocusableElement();\n }\n }\n\n get currentHeadSnapshot() {\n return this.currentSnapshot.headSnapshot\n }\n\n get newHeadSnapshot() {\n return this.newSnapshot.headSnapshot\n }\n\n get newElement() {\n return this.newSnapshot.element\n }\n\n #setLanguage() {\n const { documentElement } = this.currentSnapshot;\n const { dir, lang } = this.newSnapshot;\n\n if (lang) {\n documentElement.setAttribute(\"lang\", lang);\n } else {\n documentElement.removeAttribute(\"lang\");\n }\n if (dir) {\n documentElement.setAttribute(\"dir\", dir);\n } else {\n documentElement.removeAttribute(\"dir\");\n }\n }\n\n async mergeHead() {\n const mergedHeadElements = this.mergeProvisionalElements();\n const newStylesheetElements = this.copyNewHeadStylesheetElements();\n this.copyNewHeadScriptElements();\n\n await mergedHeadElements;\n await newStylesheetElements;\n\n if (this.willRender) {\n this.removeUnusedDynamicStylesheetElements();\n }\n }\n\n async replaceBody() {\n await this.preservingPermanentElements(async () => {\n this.activateNewBody();\n await this.assignNewBody();\n });\n }\n\n get trackedElementsAreIdentical() {\n return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature\n }\n\n async copyNewHeadStylesheetElements() {\n const loadingElements = [];\n\n for (const element of this.newHeadStylesheetElements) {\n loadingElements.push(waitForLoad(element));\n\n document.head.appendChild(element);\n }\n\n await Promise.all(loadingElements);\n }\n\n copyNewHeadScriptElements() {\n for (const element of this.newHeadScriptElements) {\n document.head.appendChild(activateScriptElement(element));\n }\n }\n\n removeUnusedDynamicStylesheetElements() {\n for (const element of this.unusedDynamicStylesheetElements) {\n document.head.removeChild(element);\n }\n }\n\n async mergeProvisionalElements() {\n const newHeadElements = [...this.newHeadProvisionalElements];\n\n for (const element of this.currentHeadProvisionalElements) {\n if (!this.isCurrentElementInElementList(element, newHeadElements)) {\n document.head.removeChild(element);\n }\n }\n\n for (const element of newHeadElements) {\n document.head.appendChild(element);\n }\n }\n\n isCurrentElementInElementList(element, elementList) {\n for (const [index, newElement] of elementList.entries()) {\n // if title element...\n if (element.tagName == \"TITLE\") {\n if (newElement.tagName != \"TITLE\") {\n continue\n }\n if (element.innerHTML == newElement.innerHTML) {\n elementList.splice(index, 1);\n return true\n }\n }\n\n // if any other element...\n if (newElement.isEqualNode(element)) {\n elementList.splice(index, 1);\n return true\n }\n }\n\n return false\n }\n\n removeCurrentHeadProvisionalElements() {\n for (const element of this.currentHeadProvisionalElements) {\n document.head.removeChild(element);\n }\n }\n\n copyNewHeadProvisionalElements() {\n for (const element of this.newHeadProvisionalElements) {\n document.head.appendChild(element);\n }\n }\n\n activateNewBody() {\n document.adoptNode(this.newElement);\n this.removeNoscriptElements();\n this.activateNewBodyScriptElements();\n }\n\n removeNoscriptElements() {\n for (const noscriptElement of this.newElement.querySelectorAll(\"noscript\")) {\n noscriptElement.remove();\n }\n }\n\n activateNewBodyScriptElements() {\n for (const inertScriptElement of this.newBodyScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n\n async assignNewBody() {\n await this.renderElement(this.currentElement, this.newElement);\n }\n\n get unusedDynamicStylesheetElements() {\n return this.oldHeadStylesheetElements.filter((element) => {\n return element.getAttribute(\"data-turbo-track\") === \"dynamic\"\n })\n }\n\n get oldHeadStylesheetElements() {\n return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)\n }\n\n get newHeadStylesheetElements() {\n return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)\n }\n\n get newHeadScriptElements() {\n return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)\n }\n\n get currentHeadProvisionalElements() {\n return this.currentHeadSnapshot.provisionalElements\n }\n\n get newHeadProvisionalElements() {\n return this.newHeadSnapshot.provisionalElements\n }\n\n get newBodyScriptElements() {\n return this.newElement.querySelectorAll(\"script\")\n }\n}\n\nclass MorphingPageRenderer extends PageRenderer {\n static renderElement(currentElement, newElement) {\n morphElements(currentElement, newElement, {\n callbacks: {\n beforeNodeMorphed: (node, newNode) => {\n if (\n shouldRefreshFrameWithMorphing(node, newNode) &&\n !closestFrameReloadableWithMorphing(node)\n ) {\n node.reload();\n return false\n }\n return true\n }\n }\n });\n\n dispatch(\"turbo:morph\", { detail: { currentElement, newElement } });\n }\n\n async preservingPermanentElements(callback) {\n return await callback()\n }\n\n get renderMethod() {\n return \"morph\"\n }\n\n get shouldAutofocus() {\n return false\n }\n}\n\nclass SnapshotCache extends LRUCache {\n constructor(size) {\n super(size, toCacheKey);\n }\n\n get snapshots() {\n return this.entries\n }\n}\n\nclass PageView extends View {\n snapshotCache = new SnapshotCache(10)\n lastRenderedLocation = new URL(location.href)\n forceReloaded = false\n\n shouldTransitionTo(newSnapshot) {\n return this.snapshot.prefersViewTransitions && newSnapshot.prefersViewTransitions\n }\n\n renderPage(snapshot, isPreview = false, willRender = true, visit) {\n const shouldMorphPage = this.isPageRefresh(visit) && (visit?.refresh?.method || this.snapshot.refreshMethod) === \"morph\";\n const rendererClass = shouldMorphPage ? MorphingPageRenderer : PageRenderer;\n\n const renderer = new rendererClass(this.snapshot, snapshot, isPreview, willRender);\n\n if (!renderer.shouldRender) {\n this.forceReloaded = true;\n } else {\n visit?.changeHistory();\n }\n\n return this.render(renderer)\n }\n\n renderError(snapshot, visit) {\n visit?.changeHistory();\n const renderer = new ErrorRenderer(this.snapshot, snapshot, false);\n return this.render(renderer)\n }\n\n clearSnapshotCache() {\n this.snapshotCache.clear();\n }\n\n async cacheSnapshot(snapshot = this.snapshot) {\n if (snapshot.isCacheable) {\n this.delegate.viewWillCacheSnapshot();\n const { lastRenderedLocation: location } = this;\n await nextEventLoopTick();\n const cachedSnapshot = snapshot.clone();\n this.snapshotCache.put(location, cachedSnapshot);\n return cachedSnapshot\n }\n }\n\n getCachedSnapshotForLocation(location) {\n return this.snapshotCache.get(location)\n }\n\n isPageRefresh(visit) {\n return !visit || (this.lastRenderedLocation.pathname === visit.location.pathname && visit.action === \"replace\")\n }\n\n shouldPreserveScrollPosition(visit) {\n return this.isPageRefresh(visit) && (visit?.refresh?.scroll || this.snapshot.refreshScroll) === \"preserve\"\n }\n\n get snapshot() {\n return PageSnapshot.fromElement(this.element)\n }\n}\n\nclass Preloader {\n selector = \"a[data-turbo-preload]\"\n\n constructor(delegate, snapshotCache) {\n this.delegate = delegate;\n this.snapshotCache = snapshotCache;\n }\n\n start() {\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", this.#preloadAll);\n } else {\n this.preloadOnLoadLinksForView(document.body);\n }\n }\n\n stop() {\n document.removeEventListener(\"DOMContentLoaded\", this.#preloadAll);\n }\n\n preloadOnLoadLinksForView(element) {\n for (const link of element.querySelectorAll(this.selector)) {\n if (this.delegate.shouldPreloadLink(link)) {\n this.preloadURL(link);\n }\n }\n }\n\n async preloadURL(link) {\n const location = new URL(link.href);\n\n if (this.snapshotCache.has(location)) {\n return\n }\n\n const fetchRequest = new FetchRequest(this, FetchMethod.get, location, new URLSearchParams(), link);\n await fetchRequest.perform();\n }\n\n // Fetch request delegate\n\n prepareRequest(fetchRequest) {\n fetchRequest.headers[\"X-Sec-Purpose\"] = \"prefetch\";\n }\n\n async requestSucceededWithResponse(fetchRequest, fetchResponse) {\n try {\n const responseHTML = await fetchResponse.responseHTML;\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n\n this.snapshotCache.put(fetchRequest.url, snapshot);\n } catch (_) {\n // If we cannot preload that is ok!\n }\n }\n\n requestStarted(fetchRequest) {}\n\n requestErrored(fetchRequest) {}\n\n requestFinished(fetchRequest) {}\n\n requestPreventedHandlingResponse(fetchRequest, fetchResponse) {}\n\n requestFailedWithResponse(fetchRequest, fetchResponse) {}\n\n #preloadAll = () => {\n this.preloadOnLoadLinksForView(document.body);\n }\n}\n\nclass Cache {\n constructor(session) {\n this.session = session;\n }\n\n clear() {\n this.session.clearCache();\n }\n\n resetCacheControl() {\n this.#setCacheControl(\"\");\n }\n\n exemptPageFromCache() {\n this.#setCacheControl(\"no-cache\");\n }\n\n exemptPageFromPreview() {\n this.#setCacheControl(\"no-preview\");\n }\n\n #setCacheControl(value) {\n setMetaContent(\"turbo-cache-control\", value);\n }\n}\n\nclass Session {\n navigator = new Navigator(this)\n history = new History(this)\n view = new PageView(this, document.documentElement)\n adapter = new BrowserAdapter(this)\n\n pageObserver = new PageObserver(this)\n cacheObserver = new CacheObserver()\n linkPrefetchObserver = new LinkPrefetchObserver(this, document)\n linkClickObserver = new LinkClickObserver(this, window)\n formSubmitObserver = new FormSubmitObserver(this, document)\n scrollObserver = new ScrollObserver(this)\n streamObserver = new StreamObserver(this)\n formLinkClickObserver = new FormLinkClickObserver(this, document.documentElement)\n frameRedirector = new FrameRedirector(this, document.documentElement)\n streamMessageRenderer = new StreamMessageRenderer()\n cache = new Cache(this)\n\n enabled = true\n started = false\n #pageRefreshDebouncePeriod = 150\n\n constructor(recentRequests) {\n this.recentRequests = recentRequests;\n this.preloader = new Preloader(this, this.view.snapshotCache);\n this.debouncedRefresh = this.refresh;\n this.pageRefreshDebouncePeriod = this.pageRefreshDebouncePeriod;\n }\n\n start() {\n if (!this.started) {\n this.pageObserver.start();\n this.cacheObserver.start();\n this.linkPrefetchObserver.start();\n this.formLinkClickObserver.start();\n this.linkClickObserver.start();\n this.formSubmitObserver.start();\n this.scrollObserver.start();\n this.streamObserver.start();\n this.frameRedirector.start();\n this.history.start();\n this.preloader.start();\n this.started = true;\n this.enabled = true;\n }\n }\n\n disable() {\n this.enabled = false;\n }\n\n stop() {\n if (this.started) {\n this.pageObserver.stop();\n this.cacheObserver.stop();\n this.linkPrefetchObserver.stop();\n this.formLinkClickObserver.stop();\n this.linkClickObserver.stop();\n this.formSubmitObserver.stop();\n this.scrollObserver.stop();\n this.streamObserver.stop();\n this.frameRedirector.stop();\n this.history.stop();\n this.preloader.stop();\n this.started = false;\n }\n }\n\n registerAdapter(adapter) {\n this.adapter = adapter;\n }\n\n visit(location, options = {}) {\n const frameElement = options.frame ? document.getElementById(options.frame) : null;\n\n if (frameElement instanceof FrameElement) {\n const action = options.action || getVisitAction(frameElement);\n\n frameElement.delegate.proposeVisitIfNavigatedWithAction(frameElement, action);\n frameElement.src = location.toString();\n } else {\n this.navigator.proposeVisit(expandURL(location), options);\n }\n }\n\n refresh(url, options = {}) {\n options = typeof options === \"string\" ? { requestId: options } : options;\n\n const { method, requestId, scroll } = options;\n const isRecentRequest = requestId && this.recentRequests.has(requestId);\n const isCurrentUrl = url === document.baseURI;\n if (!isRecentRequest && !this.navigator.currentVisit && isCurrentUrl) {\n this.visit(url, { action: \"replace\", shouldCacheSnapshot: false, refresh: { method, scroll } });\n }\n }\n\n connectStreamSource(source) {\n this.streamObserver.connectStreamSource(source);\n }\n\n disconnectStreamSource(source) {\n this.streamObserver.disconnectStreamSource(source);\n }\n\n renderStreamMessage(message) {\n this.streamMessageRenderer.render(StreamMessage.wrap(message));\n }\n\n clearCache() {\n this.view.clearSnapshotCache();\n }\n\n setProgressBarDelay(delay) {\n console.warn(\n \"Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`\"\n );\n\n this.progressBarDelay = delay;\n }\n\n set progressBarDelay(delay) {\n config.drive.progressBarDelay = delay;\n }\n\n get progressBarDelay() {\n return config.drive.progressBarDelay\n }\n\n set drive(value) {\n config.drive.enabled = value;\n }\n\n get drive() {\n return config.drive.enabled\n }\n\n set formMode(value) {\n config.forms.mode = value;\n }\n\n get formMode() {\n return config.forms.mode\n }\n\n get location() {\n return this.history.location\n }\n\n get restorationIdentifier() {\n return this.history.restorationIdentifier\n }\n\n get pageRefreshDebouncePeriod() {\n return this.#pageRefreshDebouncePeriod\n }\n\n set pageRefreshDebouncePeriod(value) {\n this.refresh = debounce(this.debouncedRefresh.bind(this), value);\n this.#pageRefreshDebouncePeriod = value;\n }\n\n // Preloader delegate\n\n shouldPreloadLink(element) {\n const isUnsafe = element.hasAttribute(\"data-turbo-method\");\n const isStream = element.hasAttribute(\"data-turbo-stream\");\n const frameTarget = element.getAttribute(\"data-turbo-frame\");\n const frame = frameTarget == \"_top\" ?\n null :\n document.getElementById(frameTarget) || findClosestRecursively(element, \"turbo-frame:not([disabled])\");\n\n if (isUnsafe || isStream || frame instanceof FrameElement) {\n return false\n } else {\n const location = new URL(element.href);\n\n return this.elementIsNavigatable(element) && locationIsVisitable(location, this.snapshot.rootLocation)\n }\n }\n\n // History delegate\n\n historyPoppedToLocationWithRestorationIdentifierAndDirection(location, restorationIdentifier, direction) {\n if (this.enabled) {\n this.navigator.startVisit(location, restorationIdentifier, {\n action: \"restore\",\n historyChanged: true,\n direction\n });\n } else {\n this.adapter.pageInvalidated({\n reason: \"turbo_disabled\"\n });\n }\n }\n\n historyPoppedWithEmptyState(location) {\n this.history.replace(location);\n this.view.lastRenderedLocation = location;\n this.view.cacheSnapshot();\n }\n\n // Scroll observer delegate\n\n scrollPositionChanged(position) {\n this.history.updateRestorationData({ scrollPosition: position });\n }\n\n // Form click observer delegate\n\n willSubmitFormLinkToLocation(link, location) {\n return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation)\n }\n\n submittedFormLinkToLocation() {}\n\n // Link hover observer delegate\n\n canPrefetchRequestToLocation(link, location) {\n return (\n this.elementIsNavigatable(link) &&\n locationIsVisitable(location, this.snapshot.rootLocation) &&\n this.navigator.linkPrefetchingIsEnabledForLocation(location)\n )\n }\n\n // Link click observer delegate\n\n willFollowLinkToLocation(link, location, event) {\n return (\n this.elementIsNavigatable(link) &&\n locationIsVisitable(location, this.snapshot.rootLocation) &&\n this.applicationAllowsFollowingLinkToLocation(link, location, event)\n )\n }\n\n followedLinkToLocation(link, location) {\n const action = this.getActionForLink(link);\n const acceptsStreamResponse = link.hasAttribute(\"data-turbo-stream\");\n\n this.visit(location.href, { action, acceptsStreamResponse });\n }\n\n // Navigator delegate\n\n allowsVisitingLocationWithAction(location, action) {\n return this.applicationAllowsVisitingLocation(location)\n }\n\n visitProposedToLocation(location, options) {\n extendURLWithDeprecatedProperties(location);\n this.adapter.visitProposedToLocation(location, options);\n }\n\n // Visit delegate\n\n visitStarted(visit) {\n if (!visit.acceptsStreamResponse) {\n markAsBusy(document.documentElement);\n this.view.markVisitDirection(visit.direction);\n }\n extendURLWithDeprecatedProperties(visit.location);\n this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n }\n\n visitCompleted(visit) {\n this.view.unmarkVisitDirection();\n clearBusyState(document.documentElement);\n this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n }\n\n // Form submit observer delegate\n\n willSubmitForm(form, submitter) {\n const action = getAction$1(form, submitter);\n\n return (\n this.submissionIsNavigatable(form, submitter) &&\n locationIsVisitable(expandURL(action), this.snapshot.rootLocation)\n )\n }\n\n formSubmitted(form, submitter) {\n this.navigator.submitForm(form, submitter);\n }\n\n // Page observer delegate\n\n pageBecameInteractive() {\n this.view.lastRenderedLocation = this.location;\n this.notifyApplicationAfterPageLoad();\n }\n\n pageLoaded() {\n this.history.assumeControlOfScrollRestoration();\n }\n\n pageWillUnload() {\n this.history.relinquishControlOfScrollRestoration();\n }\n\n // Stream observer delegate\n\n receivedMessageFromStream(message) {\n this.renderStreamMessage(message);\n }\n\n // Page view delegate\n\n viewWillCacheSnapshot() {\n this.notifyApplicationBeforeCachingSnapshot();\n }\n\n allowsImmediateRender({ element }, options) {\n const event = this.notifyApplicationBeforeRender(element, options);\n const {\n defaultPrevented,\n detail: { render }\n } = event;\n\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n\n return !defaultPrevented\n }\n\n viewRenderedSnapshot(_snapshot, _isPreview, renderMethod) {\n this.view.lastRenderedLocation = this.history.location;\n this.notifyApplicationAfterRender(renderMethod);\n }\n\n preloadOnLoadLinksForView(element) {\n this.preloader.preloadOnLoadLinksForView(element);\n }\n\n viewInvalidated(reason) {\n this.adapter.pageInvalidated(reason);\n }\n\n // Frame element\n\n frameLoaded(frame) {\n this.notifyApplicationAfterFrameLoad(frame);\n }\n\n frameRendered(fetchResponse, frame) {\n this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n }\n\n // Application events\n\n applicationAllowsFollowingLinkToLocation(link, location, ev) {\n const event = this.notifyApplicationAfterClickingLinkToLocation(link, location, ev);\n return !event.defaultPrevented\n }\n\n applicationAllowsVisitingLocation(location) {\n const event = this.notifyApplicationBeforeVisitingLocation(location);\n return !event.defaultPrevented\n }\n\n notifyApplicationAfterClickingLinkToLocation(link, location, event) {\n return dispatch(\"turbo:click\", {\n target: link,\n detail: { url: location.href, originalEvent: event },\n cancelable: true\n })\n }\n\n notifyApplicationBeforeVisitingLocation(location) {\n return dispatch(\"turbo:before-visit\", {\n detail: { url: location.href },\n cancelable: true\n })\n }\n\n notifyApplicationAfterVisitingLocation(location, action) {\n return dispatch(\"turbo:visit\", { detail: { url: location.href, action } })\n }\n\n notifyApplicationBeforeCachingSnapshot() {\n return dispatch(\"turbo:before-cache\")\n }\n\n notifyApplicationBeforeRender(newBody, options) {\n return dispatch(\"turbo:before-render\", {\n detail: { newBody, ...options },\n cancelable: true\n })\n }\n\n notifyApplicationAfterRender(renderMethod) {\n return dispatch(\"turbo:render\", { detail: { renderMethod } })\n }\n\n notifyApplicationAfterPageLoad(timing = {}) {\n return dispatch(\"turbo:load\", {\n detail: { url: this.location.href, timing }\n })\n }\n\n notifyApplicationAfterFrameLoad(frame) {\n return dispatch(\"turbo:frame-load\", { target: frame })\n }\n\n notifyApplicationAfterFrameRender(fetchResponse, frame) {\n return dispatch(\"turbo:frame-render\", {\n detail: { fetchResponse },\n target: frame,\n cancelable: true\n })\n }\n\n // Helpers\n\n submissionIsNavigatable(form, submitter) {\n if (config.forms.mode == \"off\") {\n return false\n } else {\n const submitterIsNavigatable = submitter ? this.elementIsNavigatable(submitter) : true;\n\n if (config.forms.mode == \"optin\") {\n return submitterIsNavigatable && form.closest('[data-turbo=\"true\"]') != null\n } else {\n return submitterIsNavigatable && this.elementIsNavigatable(form)\n }\n }\n }\n\n elementIsNavigatable(element) {\n const container = findClosestRecursively(element, \"[data-turbo]\");\n const withinFrame = findClosestRecursively(element, \"turbo-frame\");\n\n // Check if Drive is enabled on the session or we're within a Frame.\n if (config.drive.enabled || withinFrame) {\n // Element is navigatable by default, unless `data-turbo=\"false\"`.\n if (container) {\n return container.getAttribute(\"data-turbo\") != \"false\"\n } else {\n return true\n }\n } else {\n // Element isn't navigatable by default, unless `data-turbo=\"true\"`.\n if (container) {\n return container.getAttribute(\"data-turbo\") == \"true\"\n } else {\n return false\n }\n }\n }\n\n // Private\n\n getActionForLink(link) {\n return getVisitAction(link) || \"advance\"\n }\n\n get snapshot() {\n return this.view.snapshot\n }\n}\n\n// Older versions of the Turbo Native adapters referenced the\n// `Location#absoluteURL` property in their implementations of\n// the `Adapter#visitProposedToLocation()` and `#visitStarted()`\n// methods. The Location class has since been removed in favor\n// of the DOM URL API, and accordingly all Adapter methods now\n// receive URL objects.\n//\n// We alias #absoluteURL to #toString() here to avoid crashing\n// older adapters which do not expect URL objects. We should\n// consider removing this support at some point in the future.\n\nfunction extendURLWithDeprecatedProperties(url) {\n Object.defineProperties(url, deprecatedLocationPropertyDescriptors);\n}\n\nconst deprecatedLocationPropertyDescriptors = {\n absoluteURL: {\n get() {\n return this.toString()\n }\n }\n};\n\nconst session = new Session(recentRequests);\n\n// Rename `navigator` to avoid shadowing `window.navigator`\nconst { cache, navigator: sessionNavigator } = session;\n\n/**\n * Starts the main session.\n * This initialises any necessary observers such as those to monitor\n * link interactions.\n */\nfunction start() {\n session.start();\n}\n\n/**\n * Registers an adapter for the main session.\n *\n * @param adapter Adapter to register\n */\nfunction registerAdapter(adapter) {\n session.registerAdapter(adapter);\n}\n\n/**\n * Performs an application visit to the given location.\n *\n * @param location Location to visit (a URL or path)\n * @param options Options to apply\n * @param options.action Type of history navigation to apply (\"restore\",\n * \"replace\" or \"advance\")\n * @param options.historyChanged Specifies whether the browser history has\n * already been changed for this visit or not\n * @param options.referrer Specifies the referrer of this visit such that\n * navigations to the same page will not result in a new history entry.\n * @param options.snapshotHTML Cached snapshot to render\n * @param options.response Response of the specified location\n */\nfunction visit(location, options) {\n session.visit(location, options);\n}\n\n/**\n * Connects a stream source to the main session.\n *\n * @param source Stream source to connect\n */\nfunction connectStreamSource(source) {\n session.connectStreamSource(source);\n}\n\n/**\n * Disconnects a stream source from the main session.\n *\n * @param source Stream source to disconnect\n */\nfunction disconnectStreamSource(source) {\n session.disconnectStreamSource(source);\n}\n\n/**\n * Renders a stream message to the main session by appending it to the\n * current document.\n *\n * @param message Message to render\n */\nfunction renderStreamMessage(message) {\n session.renderStreamMessage(message);\n}\n\n/**\n * Sets the delay after which the progress bar will appear during navigation.\n *\n * The progress bar appears after 500ms by default.\n *\n * Note that this method has no effect when used with the iOS or Android\n * adapters.\n *\n * @param delay Time to delay in milliseconds\n */\nfunction setProgressBarDelay(delay) {\n console.warn(\n \"Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.drive.progressBarDelay = delay;\n}\n\nfunction setConfirmMethod(confirmMethod) {\n console.warn(\n \"Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.forms.confirm = confirmMethod;\n}\n\nfunction setFormMode(mode) {\n console.warn(\n \"Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`\"\n );\n config.forms.mode = mode;\n}\n\n/**\n * Morph the state of the currentBody based on the attributes and contents of\n * the newBody. Morphing body elements may dispatch turbo:morph,\n * turbo:before-morph-element, turbo:before-morph-attribute, and\n * turbo:morph-element events.\n *\n * @param currentBody HTMLBodyElement destination of morphing changes\n * @param newBody HTMLBodyElement source of morphing changes\n */\nfunction morphBodyElements(currentBody, newBody) {\n MorphingPageRenderer.renderElement(currentBody, newBody);\n}\n\n/**\n * Morph the child elements of the currentFrame based on the child elements of\n * the newFrame. Morphing turbo-frame elements may dispatch turbo:before-frame-morph,\n * turbo:before-morph-element, turbo:before-morph-attribute, and\n * turbo:morph-element events.\n *\n * @param currentFrame FrameElement destination of morphing children changes\n * @param newFrame FrameElement source of morphing children changes\n */\nfunction morphTurboFrameElements(currentFrame, newFrame) {\n MorphingFrameRenderer.renderElement(currentFrame, newFrame);\n}\n\nvar Turbo = /*#__PURE__*/Object.freeze({\n __proto__: null,\n PageRenderer: PageRenderer,\n PageSnapshot: PageSnapshot,\n FrameRenderer: FrameRenderer,\n fetch: fetchWithTurboHeaders,\n config: config,\n session: session,\n cache: cache,\n navigator: sessionNavigator,\n start: start,\n registerAdapter: registerAdapter,\n visit: visit,\n connectStreamSource: connectStreamSource,\n disconnectStreamSource: disconnectStreamSource,\n renderStreamMessage: renderStreamMessage,\n setProgressBarDelay: setProgressBarDelay,\n setConfirmMethod: setConfirmMethod,\n setFormMode: setFormMode,\n morphBodyElements: morphBodyElements,\n morphTurboFrameElements: morphTurboFrameElements,\n morphChildren: morphChildren,\n morphElements: morphElements\n});\n\nclass TurboFrameMissingError extends Error {}\n\nclass FrameController {\n fetchResponseLoaded = (_fetchResponse) => Promise.resolve()\n #currentFetchRequest = null\n #resolveVisitPromise = () => {}\n #connected = false\n #hasBeenLoaded = false\n #ignoredAttributes = new Set()\n #shouldMorphFrame = false\n action = null\n\n constructor(element) {\n this.element = element;\n this.view = new FrameView(this, this.element);\n this.appearanceObserver = new AppearanceObserver(this, this.element);\n this.formLinkClickObserver = new FormLinkClickObserver(this, this.element);\n this.linkInterceptor = new LinkInterceptor(this, this.element);\n this.restorationIdentifier = uuid();\n this.formSubmitObserver = new FormSubmitObserver(this, this.element);\n }\n\n // Frame delegate\n\n connect() {\n if (!this.#connected) {\n this.#connected = true;\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.#loadSourceURL();\n }\n this.formLinkClickObserver.start();\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n }\n\n disconnect() {\n if (this.#connected) {\n this.#connected = false;\n this.appearanceObserver.stop();\n this.formLinkClickObserver.stop();\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n\n if (!this.element.hasAttribute(\"recurse\")) {\n this.#currentFetchRequest?.cancel();\n }\n }\n }\n\n disabledChanged() {\n if (this.disabled) {\n this.#currentFetchRequest?.cancel();\n } else if (this.loadingStyle == FrameLoadingStyle.eager) {\n this.#loadSourceURL();\n }\n }\n\n sourceURLChanged() {\n if (this.#isIgnoringChangesTo(\"src\")) return\n\n if (!this.sourceURL) {\n this.#currentFetchRequest?.cancel();\n }\n\n if (this.element.isConnected) {\n this.complete = false;\n }\n\n if (this.loadingStyle == FrameLoadingStyle.eager || this.#hasBeenLoaded) {\n this.#loadSourceURL();\n }\n }\n\n sourceURLReloaded() {\n const { refresh, src } = this.element;\n\n this.#shouldMorphFrame = src && refresh === \"morph\";\n\n this.element.removeAttribute(\"complete\");\n this.element.src = null;\n this.element.src = src;\n return this.element.loaded\n }\n\n loadingStyleChanged() {\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.appearanceObserver.stop();\n this.#loadSourceURL();\n }\n }\n\n async #loadSourceURL() {\n if (this.enabled && this.isActive && !this.complete && this.sourceURL) {\n this.element.loaded = this.#visit(expandURL(this.sourceURL));\n this.appearanceObserver.stop();\n await this.element.loaded;\n this.#hasBeenLoaded = true;\n }\n }\n\n async loadResponse(fetchResponse) {\n if (fetchResponse.redirected || (fetchResponse.succeeded && fetchResponse.isHTML)) {\n this.sourceURL = fetchResponse.response.url;\n }\n\n try {\n const html = await fetchResponse.responseHTML;\n if (html) {\n const document = parseHTMLDocument(html);\n const pageSnapshot = PageSnapshot.fromDocument(document);\n\n if (pageSnapshot.isVisitable) {\n await this.#loadFrameResponse(fetchResponse, document);\n } else {\n await this.#handleUnvisitableFrameResponse(fetchResponse);\n }\n }\n } finally {\n this.#shouldMorphFrame = false;\n this.fetchResponseLoaded = () => Promise.resolve();\n }\n }\n\n // Appearance observer delegate\n\n elementAppearedInViewport(element) {\n this.proposeVisitIfNavigatedWithAction(element, getVisitAction(element));\n this.#loadSourceURL();\n }\n\n // Form link click observer delegate\n\n willSubmitFormLinkToLocation(link) {\n return this.#shouldInterceptNavigation(link)\n }\n\n submittedFormLinkToLocation(link, _location, form) {\n const frame = this.#findFrameElement(link);\n if (frame) form.setAttribute(\"data-turbo-frame\", frame.id);\n }\n\n // Link interceptor delegate\n\n shouldInterceptLinkClick(element, _location, _event) {\n return this.#shouldInterceptNavigation(element)\n }\n\n linkClickIntercepted(element, location) {\n this.#navigateFrame(element, location);\n }\n\n // Form submit observer delegate\n\n willSubmitForm(element, submitter) {\n return element.closest(\"turbo-frame\") == this.element && this.#shouldInterceptNavigation(element, submitter)\n }\n\n formSubmitted(element, submitter) {\n if (this.formSubmission) {\n this.formSubmission.stop();\n }\n\n this.formSubmission = new FormSubmission(this, element, submitter);\n\n const { fetchRequest } = this.formSubmission;\n const frame = this.#findFrameElement(element, submitter);\n\n this.prepareRequest(fetchRequest, frame);\n this.formSubmission.start();\n }\n\n // Fetch request delegate\n\n prepareRequest(request, frame = this) {\n request.headers[\"Turbo-Frame\"] = frame.id;\n\n if (this.currentNavigationElement?.hasAttribute(\"data-turbo-stream\")) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n\n requestStarted(_request) {\n markAsBusy(this.element);\n }\n\n requestPreventedHandlingResponse(_request, _response) {\n this.#resolveVisitPromise();\n }\n\n async requestSucceededWithResponse(request, response) {\n await this.loadResponse(response);\n this.#resolveVisitPromise();\n }\n\n async requestFailedWithResponse(request, response) {\n await this.loadResponse(response);\n this.#resolveVisitPromise();\n }\n\n requestErrored(request, error) {\n console.error(error);\n this.#resolveVisitPromise();\n }\n\n requestFinished(_request) {\n clearBusyState(this.element);\n }\n\n // Form submission delegate\n\n formSubmissionStarted({ formElement }) {\n markAsBusy(formElement, this.#findFrameElement(formElement));\n }\n\n formSubmissionSucceededWithResponse(formSubmission, response) {\n const frame = this.#findFrameElement(formSubmission.formElement, formSubmission.submitter);\n\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, getVisitAction(formSubmission.submitter, formSubmission.formElement, frame));\n frame.delegate.loadResponse(response);\n\n if (!formSubmission.isSafe) {\n session.clearCache();\n }\n }\n\n formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n this.element.delegate.loadResponse(fetchResponse);\n session.clearCache();\n }\n\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n\n formSubmissionFinished({ formElement }) {\n clearBusyState(formElement, this.#findFrameElement(formElement));\n }\n\n // View delegate\n\n allowsImmediateRender({ element: newFrame }, options) {\n const event = dispatch(\"turbo:before-frame-render\", {\n target: this.element,\n detail: { newFrame, ...options },\n cancelable: true\n });\n\n const {\n defaultPrevented,\n detail: { render }\n } = event;\n\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n\n return !defaultPrevented\n }\n\n viewRenderedSnapshot(_snapshot, _isPreview, _renderMethod) {}\n\n preloadOnLoadLinksForView(element) {\n session.preloadOnLoadLinksForView(element);\n }\n\n viewInvalidated() {}\n\n // Frame renderer delegate\n\n willRenderFrame(currentElement, _newElement) {\n this.previousFrameElement = currentElement.cloneNode(true);\n }\n\n visitCachedSnapshot = ({ element }) => {\n const frame = element.querySelector(\"#\" + this.element.id);\n\n if (frame && this.previousFrameElement) {\n frame.replaceChildren(...this.previousFrameElement.children);\n }\n\n delete this.previousFrameElement;\n }\n\n // Private\n\n async #loadFrameResponse(fetchResponse, document) {\n const newFrameElement = await this.extractForeignFrameElement(document.body);\n const rendererClass = this.#shouldMorphFrame ? MorphingFrameRenderer : FrameRenderer;\n\n if (newFrameElement) {\n const snapshot = new Snapshot(newFrameElement);\n const renderer = new rendererClass(this, this.view.snapshot, snapshot, false, false);\n if (this.view.renderPromise) await this.view.renderPromise;\n this.changeHistory();\n\n await this.view.render(renderer);\n this.complete = true;\n session.frameRendered(fetchResponse, this.element);\n session.frameLoaded(this.element);\n await this.fetchResponseLoaded(fetchResponse);\n } else if (this.#willHandleFrameMissingFromResponse(fetchResponse)) {\n this.#handleFrameMissingFromResponse(fetchResponse);\n }\n }\n\n async #visit(url) {\n const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);\n\n this.#currentFetchRequest?.cancel();\n this.#currentFetchRequest = request;\n\n return new Promise((resolve) => {\n this.#resolveVisitPromise = () => {\n this.#resolveVisitPromise = () => {};\n this.#currentFetchRequest = null;\n resolve();\n };\n request.perform();\n })\n }\n\n #navigateFrame(element, url, submitter) {\n const frame = this.#findFrameElement(element, submitter);\n\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, getVisitAction(submitter, element, frame));\n\n this.#withCurrentNavigationElement(element, () => {\n frame.src = url;\n });\n }\n\n proposeVisitIfNavigatedWithAction(frame, action = null) {\n this.action = action;\n\n if (this.action) {\n const pageSnapshot = PageSnapshot.fromElement(frame).clone();\n const { visitCachedSnapshot } = frame.delegate;\n\n frame.delegate.fetchResponseLoaded = async (fetchResponse) => {\n if (frame.src) {\n const { statusCode, redirected } = fetchResponse;\n const responseHTML = await fetchResponse.responseHTML;\n const response = { statusCode, redirected, responseHTML };\n const options = {\n response,\n visitCachedSnapshot,\n willRender: false,\n updateHistory: false,\n restorationIdentifier: this.restorationIdentifier,\n snapshot: pageSnapshot\n };\n\n if (this.action) options.action = this.action;\n\n session.visit(frame.src, options);\n }\n };\n }\n }\n\n changeHistory() {\n if (this.action) {\n const method = getHistoryMethodForAction(this.action);\n session.history.update(method, expandURL(this.element.src || \"\"), this.restorationIdentifier);\n }\n }\n\n async #handleUnvisitableFrameResponse(fetchResponse) {\n console.warn(\n `The response (${fetchResponse.statusCode}) from is performing a full page visit due to turbo-visit-control.`\n );\n\n await this.#visitResponse(fetchResponse.response);\n }\n\n #willHandleFrameMissingFromResponse(fetchResponse) {\n this.element.setAttribute(\"complete\", \"\");\n\n const response = fetchResponse.response;\n const visit = async (url, options) => {\n if (url instanceof Response) {\n this.#visitResponse(url);\n } else {\n session.visit(url, options);\n }\n };\n\n const event = dispatch(\"turbo:frame-missing\", {\n target: this.element,\n detail: { response, visit },\n cancelable: true\n });\n\n return !event.defaultPrevented\n }\n\n #handleFrameMissingFromResponse(fetchResponse) {\n this.view.missing();\n this.#throwFrameMissingError(fetchResponse);\n }\n\n #throwFrameMissingError(fetchResponse) {\n const message = `The response (${fetchResponse.statusCode}) did not contain the expected and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;\n throw new TurboFrameMissingError(message)\n }\n\n async #visitResponse(response) {\n const wrapped = new FetchResponse(response);\n const responseHTML = await wrapped.responseHTML;\n const { location, redirected, statusCode } = wrapped;\n\n return session.visit(location, { response: { redirected, statusCode, responseHTML } })\n }\n\n #findFrameElement(element, submitter) {\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n const target = this.#getFrameElementById(id);\n\n return target instanceof FrameElement ? target : this.element\n }\n\n async extractForeignFrameElement(container) {\n let element;\n const id = CSS.escape(this.id);\n\n try {\n element = activateElement(container.querySelector(`turbo-frame#${id}`), this.sourceURL);\n if (element) {\n return element\n }\n\n element = activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`), this.sourceURL);\n if (element) {\n await element.loaded;\n return await this.extractForeignFrameElement(element)\n }\n } catch (error) {\n console.error(error);\n return new FrameElement()\n }\n\n return null\n }\n\n #formActionIsVisitable(form, submitter) {\n const action = getAction$1(form, submitter);\n\n return locationIsVisitable(expandURL(action), this.rootLocation)\n }\n\n #shouldInterceptNavigation(element, submitter) {\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n\n if (element instanceof HTMLFormElement && !this.#formActionIsVisitable(element, submitter)) {\n return false\n }\n\n if (!this.enabled || id == \"_top\") {\n return false\n }\n\n if (id) {\n const frameElement = this.#getFrameElementById(id);\n if (frameElement) {\n return !frameElement.disabled\n } else if (id == \"_parent\") {\n return false\n }\n }\n\n if (!session.elementIsNavigatable(element)) {\n return false\n }\n\n if (submitter && !session.elementIsNavigatable(submitter)) {\n return false\n }\n\n return true\n }\n\n // Computed properties\n\n get id() {\n return this.element.id\n }\n\n get disabled() {\n return this.element.disabled\n }\n\n get enabled() {\n return !this.disabled\n }\n\n get sourceURL() {\n if (this.element.src) {\n return this.element.src\n }\n }\n\n set sourceURL(sourceURL) {\n this.#ignoringChangesToAttribute(\"src\", () => {\n this.element.src = sourceURL ?? null;\n });\n }\n\n get loadingStyle() {\n return this.element.loading\n }\n\n get isLoading() {\n return this.formSubmission !== undefined || this.#resolveVisitPromise() !== undefined\n }\n\n get complete() {\n return this.element.hasAttribute(\"complete\")\n }\n\n set complete(value) {\n if (value) {\n this.element.setAttribute(\"complete\", \"\");\n } else {\n this.element.removeAttribute(\"complete\");\n }\n }\n\n get isActive() {\n return this.element.isActive && this.#connected\n }\n\n get rootLocation() {\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const root = meta?.content ?? \"/\";\n return expandURL(root)\n }\n\n #isIgnoringChangesTo(attributeName) {\n return this.#ignoredAttributes.has(attributeName)\n }\n\n #ignoringChangesToAttribute(attributeName, callback) {\n this.#ignoredAttributes.add(attributeName);\n callback();\n this.#ignoredAttributes.delete(attributeName);\n }\n\n #withCurrentNavigationElement(element, callback) {\n this.currentNavigationElement = element;\n callback();\n delete this.currentNavigationElement;\n }\n\n #getFrameElementById(id) {\n if (id != null) {\n const element = id === \"_parent\" ?\n this.element.parentElement.closest(\"turbo-frame\") :\n document.getElementById(id);\n if (element instanceof FrameElement) {\n return element\n }\n }\n }\n}\n\nfunction activateElement(element, currentURL) {\n if (element) {\n const src = element.getAttribute(\"src\");\n if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {\n throw new Error(`Matching element has a source URL which references itself`)\n }\n if (element.ownerDocument !== document) {\n element = document.importNode(element, true);\n }\n\n if (element instanceof FrameElement) {\n element.connectedCallback();\n element.disconnectedCallback();\n return element\n }\n }\n}\n\nconst StreamActions = {\n after() {\n this.removeDuplicateTargetSiblings();\n this.targetElements.forEach((e) => e.parentElement?.insertBefore(this.templateContent, e.nextSibling));\n },\n\n append() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach((e) => e.append(this.templateContent));\n },\n\n before() {\n this.removeDuplicateTargetSiblings();\n this.targetElements.forEach((e) => e.parentElement?.insertBefore(this.templateContent, e));\n },\n\n prepend() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach((e) => e.prepend(this.templateContent));\n },\n\n remove() {\n this.targetElements.forEach((e) => e.remove());\n },\n\n replace() {\n const method = this.getAttribute(\"method\");\n\n this.targetElements.forEach((targetElement) => {\n if (method === \"morph\") {\n morphElements(targetElement, this.templateContent);\n } else {\n targetElement.replaceWith(this.templateContent);\n }\n });\n },\n\n update() {\n const method = this.getAttribute(\"method\");\n\n this.targetElements.forEach((targetElement) => {\n if (method === \"morph\") {\n morphChildren(targetElement, this.templateContent);\n } else {\n targetElement.innerHTML = \"\";\n targetElement.append(this.templateContent);\n }\n });\n },\n\n refresh() {\n const method = this.getAttribute(\"method\");\n const requestId = this.requestId;\n const scroll = this.getAttribute(\"scroll\");\n\n session.refresh(this.baseURI, { method, requestId, scroll });\n }\n};\n\n//