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AS,UMvBrB,cAA6BrB,GACzB6B,eAAiB,CAAC,SAAU,WAE5B,aAAAqH,CAAc5hE,GACVi3B,MAAM58B,KAAKwnE,aAAa5vD,UAAUtT,KAC7BgvC,MAAKxgC,GAAYA,EAAS8L,SAC1B00B,MAAK5Z,IACF15B,KAAKynE,cAAcrjD,UAAYsV,KAGvC15B,KAAKwnE,YACT,INeJ/gB,GAAYiZ,SAAS,OAAQ,IAG7BjZ,GAAYiZ,SAAS,eO7BrB,cAA6BrB,GACzB6B,eAAiB,CAAC,UAAW,SAC7B,OAAAv2D,GACA,CAEA,MAAA+9D,GACkB1nE,KAAK2nE,cAAcC,QAE7B5nE,KAAKuiE,YAAYZ,UAAUj6D,OAAO,UAGlC1H,KAAKuiE,YAAYZ,UAAU/4D,IAAI,SAGvC,IPkBJ69C,GAAYiZ,SAAS,eAAgBwC,G","sources":["webpack:///./node_modules/@rails/actioncable/src/adapters.js","webpack:///./node_modules/@rails/actioncable/src/logger.js","webpack:///./node_modules/@rails/actioncable/src/connection_monitor.js","webpack:///./node_modules/@rails/actioncable/src/internal.js","webpack:///./node_modules/@rails/actioncable/src/connection.js","webpack:///./node_modules/@rails/actioncable/src/subscription.js","webpack:///./node_modules/@rails/actioncable/src/subscription_guarantor.js","webpack:///./node_modules/@rails/actioncable/src/subscriptions.js","webpack:///./node_modules/@rails/actioncable/src/consumer.js","webpack:///./node_modules/@rails/actioncable/src/index.js","webpack:///./node_modules/@rails/actiontext/app/assets/javascripts/actiontext.esm.js","webpack:///./node_modules/chartkick/dist/chartkick.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js","webpack:///./node_modules/@hotwired/stimulus/dist/stimulus.js","webpack:///./app/javascript/controllers/application.js","webpack:///./app/javascript/controllers/anchor_controller.js","webpack:///./app/javascript/controllers/tabs_controller.js","webpack:///./node_modules/stimulus-autocomplete/src/autocomplete.js","webpack:///./app/javascript/controllers/index.js","webpack:///./app/javascript/controllers/duration_input_controller.js","webpack:///./app/javascript/controllers/hello_controller.js","webpack:///./app/javascript/controllers/image_controller.js","webpack:///./app/javascript/controllers/modal_controller.js","webpack:///./app/javascript/controllers/multi_autocomplete_controller.js","webpack:///./app/javascript/controllers/preview_controller.js","webpack:///./app/javascript/controllers/toggle_field_controller.js"],"sourcesContent":["export default {\n logger: self.console,\n WebSocket: self.WebSocket\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 recordPing() {\n this.pingedAt = now()\n }\n\n recordConnect() {\n this.reconnectAttempts = 0\n this.recordPing()\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 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 this.monitor.recordPing()\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 Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport logger from \"./logger\"\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\n a.protocol = a.protocol.replace(\"http\", \"ws\")\n return a.href\n } else {\n return url\n }\n}\n","import Connection from \"./connection\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport Consumer, { createWebSocketURL } from \"./consumer\"\nimport INTERNAL from \"./internal\"\nimport Subscription from \"./subscription\"\nimport Subscriptions from \"./subscriptions\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport adapters from \"./adapters\"\nimport logger from \"./logger\"\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","var sparkMd5 = {\n exports: {}\n};\n\n(function(module, exports) {\n (function(factory) {\n {\n module.exports = factory();\n }\n })((function(undefined$1) {\n var hex_chr = [ \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\" ];\n function md5cycle(x, k) {\n var a = x[0], b = x[1], c = x[2], d = x[3];\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n function md5blk(s) {\n var md5blks = [], i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n function md5blk_array(a) {\n var md5blks = [], i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n function md51(s) {\n var n = s.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function md51_array(a) {\n var n = a.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);\n length = a.length;\n tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function rhex(n) {\n var s = \"\", j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];\n }\n return s;\n }\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join(\"\");\n }\n if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n (function() {\n function clamp(val, length) {\n val = val | 0 || 0;\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n return Math.min(val, length);\n }\n ArrayBuffer.prototype.slice = function(from, to) {\n var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray;\n if (to !== undefined$1) {\n end = clamp(to, length);\n }\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n return target;\n };\n })();\n }\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n return str;\n }\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i;\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n return returnUInt8Array ? arr : buff;\n }\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n return returnUInt8Array ? result : result.buffer;\n }\n function hexToBinaryString(hex) {\n var bytes = [], length = hex.length, x;\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n return String.fromCharCode.apply(String, bytes);\n }\n function SparkMD5() {\n this.reset();\n }\n SparkMD5.prototype.append = function(str) {\n this.appendBinary(toUtf8(str));\n return this;\n };\n SparkMD5.prototype.appendBinary = function(contents) {\n this._buff += contents;\n this._length += contents.length;\n var length = this._buff.length, i;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n this._buff = this._buff.substring(i - 64);\n return this;\n };\n SparkMD5.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, i, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.prototype.reset = function() {\n this._buff = \"\";\n this._length = 0;\n this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n return this;\n };\n SparkMD5.prototype.getState = function() {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash.slice()\n };\n };\n SparkMD5.prototype.setState = function(state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n return this;\n };\n SparkMD5.prototype.destroy = function() {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n SparkMD5.prototype._finish = function(tail, length) {\n var i = length, tmp, lo, hi;\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n SparkMD5.hash = function(str, raw) {\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n SparkMD5.hashBinary = function(content, raw) {\n var hash = md51(content), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n SparkMD5.ArrayBuffer = function() {\n this.reset();\n };\n SparkMD5.ArrayBuffer.prototype.append = function(arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i;\n this._length += arr.byteLength;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], i, ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.ArrayBuffer.prototype.reset = function() {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.getState = function() {\n var state = SparkMD5.prototype.getState.call(this);\n state.buff = arrayBuffer2Utf8Str(state.buff);\n return state;\n };\n SparkMD5.ArrayBuffer.prototype.setState = function(state) {\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n return SparkMD5.prototype.setState.call(this, state);\n };\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n SparkMD5.ArrayBuffer.hash = function(arr, raw) {\n var hash = md51_array(new Uint8Array(arr)), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n return SparkMD5;\n }));\n})(sparkMd5);\n\nvar SparkMD5 = sparkMd5.exports;\n\nconst fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\n\nclass FileChecksum {\n static create(file, callback) {\n const instance = new FileChecksum(file);\n instance.create(callback);\n }\n constructor(file) {\n this.file = file;\n this.chunkSize = 2097152;\n this.chunkCount = Math.ceil(this.file.size / this.chunkSize);\n this.chunkIndex = 0;\n }\n create(callback) {\n this.callback = callback;\n this.md5Buffer = new SparkMD5.ArrayBuffer;\n this.fileReader = new FileReader;\n this.fileReader.addEventListener(\"load\", (event => this.fileReaderDidLoad(event)));\n this.fileReader.addEventListener(\"error\", (event => this.fileReaderDidError(event)));\n this.readNextChunk();\n }\n fileReaderDidLoad(event) {\n this.md5Buffer.append(event.target.result);\n if (!this.readNextChunk()) {\n const binaryDigest = this.md5Buffer.end(true);\n const base64digest = btoa(binaryDigest);\n this.callback(null, base64digest);\n }\n }\n fileReaderDidError(event) {\n this.callback(`Error reading ${this.file.name}`);\n }\n readNextChunk() {\n if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {\n const start = this.chunkIndex * this.chunkSize;\n const end = Math.min(start + this.chunkSize, this.file.size);\n const bytes = fileSlice.call(this.file, start, end);\n this.fileReader.readAsArrayBuffer(bytes);\n this.chunkIndex++;\n return true;\n } else {\n return false;\n }\n }\n}\n\nfunction getMetaValue(name) {\n const element = findElement(document.head, `meta[name=\"${name}\"]`);\n if (element) {\n return element.getAttribute(\"content\");\n }\n}\n\nfunction findElements(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n const elements = root.querySelectorAll(selector);\n return toArray(elements);\n}\n\nfunction findElement(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n return root.querySelector(selector);\n}\n\nfunction dispatchEvent(element, type, eventInit = {}) {\n const {disabled: disabled} = element;\n const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;\n const event = document.createEvent(\"Event\");\n event.initEvent(type, bubbles || true, cancelable || true);\n event.detail = detail || {};\n try {\n element.disabled = false;\n element.dispatchEvent(event);\n } finally {\n element.disabled = disabled;\n }\n return event;\n}\n\nfunction toArray(value) {\n if (Array.isArray(value)) {\n return value;\n } else if (Array.from) {\n return Array.from(value);\n } else {\n return [].slice.call(value);\n }\n}\n\nclass BlobRecord {\n constructor(file, checksum, url, customHeaders = {}) {\n this.file = file;\n this.attributes = {\n filename: file.name,\n content_type: file.type || \"application/octet-stream\",\n byte_size: file.size,\n checksum: checksum\n };\n this.xhr = new XMLHttpRequest;\n this.xhr.open(\"POST\", url, true);\n this.xhr.responseType = \"json\";\n this.xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n this.xhr.setRequestHeader(\"Accept\", \"application/json\");\n this.xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n Object.keys(customHeaders).forEach((headerKey => {\n this.xhr.setRequestHeader(headerKey, customHeaders[headerKey]);\n }));\n const csrfToken = getMetaValue(\"csrf-token\");\n if (csrfToken != undefined) {\n this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\n }\n this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n }\n get status() {\n return this.xhr.status;\n }\n get response() {\n const {responseType: responseType, response: response} = this.xhr;\n if (responseType == \"json\") {\n return response;\n } else {\n return JSON.parse(response);\n }\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(JSON.stringify({\n blob: this.attributes\n }));\n }\n requestDidLoad(event) {\n if (this.status >= 200 && this.status < 300) {\n const {response: response} = this;\n const {direct_upload: direct_upload} = response;\n delete response.direct_upload;\n this.attributes = response;\n this.directUploadData = direct_upload;\n this.callback(null, this.toJSON());\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error creating Blob for \"${this.file.name}\". Status: ${this.status}`);\n }\n toJSON() {\n const result = {};\n for (const key in this.attributes) {\n result[key] = this.attributes[key];\n }\n return result;\n }\n}\n\nclass BlobUpload {\n constructor(blob) {\n this.blob = blob;\n this.file = blob.file;\n const {url: url, headers: headers} = blob.directUploadData;\n this.xhr = new XMLHttpRequest;\n this.xhr.open(\"PUT\", url, true);\n this.xhr.responseType = \"text\";\n for (const key in headers) {\n this.xhr.setRequestHeader(key, headers[key]);\n }\n this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(this.file.slice());\n }\n requestDidLoad(event) {\n const {status: status, response: response} = this.xhr;\n if (status >= 200 && status < 300) {\n this.callback(null, response);\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error storing \"${this.file.name}\". Status: ${this.xhr.status}`);\n }\n}\n\nlet id = 0;\n\nclass DirectUpload {\n constructor(file, url, delegate, customHeaders = {}) {\n this.id = ++id;\n this.file = file;\n this.url = url;\n this.delegate = delegate;\n this.customHeaders = customHeaders;\n }\n create(callback) {\n FileChecksum.create(this.file, ((error, checksum) => {\n if (error) {\n callback(error);\n return;\n }\n const blob = new BlobRecord(this.file, checksum, this.url, this.customHeaders);\n notify(this.delegate, \"directUploadWillCreateBlobWithXHR\", blob.xhr);\n blob.create((error => {\n if (error) {\n callback(error);\n } else {\n const upload = new BlobUpload(blob);\n notify(this.delegate, \"directUploadWillStoreFileWithXHR\", upload.xhr);\n upload.create((error => {\n if (error) {\n callback(error);\n } else {\n callback(null, blob.toJSON());\n }\n }));\n }\n }));\n }));\n }\n}\n\nfunction notify(object, methodName, ...messages) {\n if (object && typeof object[methodName] == \"function\") {\n return object[methodName](...messages);\n }\n}\n\nclass DirectUploadController {\n constructor(input, file) {\n this.input = input;\n this.file = file;\n this.directUpload = new DirectUpload(this.file, this.url, this);\n this.dispatch(\"initialize\");\n }\n start(callback) {\n const hiddenInput = document.createElement(\"input\");\n hiddenInput.type = \"hidden\";\n hiddenInput.name = this.input.name;\n this.input.insertAdjacentElement(\"beforebegin\", hiddenInput);\n this.dispatch(\"start\");\n this.directUpload.create(((error, attributes) => {\n if (error) {\n hiddenInput.parentNode.removeChild(hiddenInput);\n this.dispatchError(error);\n } else {\n hiddenInput.value = attributes.signed_id;\n }\n this.dispatch(\"end\");\n callback(error);\n }));\n }\n uploadRequestDidProgress(event) {\n const progress = event.loaded / event.total * 100;\n if (progress) {\n this.dispatch(\"progress\", {\n progress: progress\n });\n }\n }\n get url() {\n return this.input.getAttribute(\"data-direct-upload-url\");\n }\n dispatch(name, detail = {}) {\n detail.file = this.file;\n detail.id = this.directUpload.id;\n return dispatchEvent(this.input, `direct-upload:${name}`, {\n detail: detail\n });\n }\n dispatchError(error) {\n const event = this.dispatch(\"error\", {\n error: error\n });\n if (!event.defaultPrevented) {\n alert(error);\n }\n }\n directUploadWillCreateBlobWithXHR(xhr) {\n this.dispatch(\"before-blob-request\", {\n xhr: xhr\n });\n }\n directUploadWillStoreFileWithXHR(xhr) {\n this.dispatch(\"before-storage-request\", {\n xhr: xhr\n });\n xhr.upload.addEventListener(\"progress\", (event => this.uploadRequestDidProgress(event)));\n }\n}\n\nconst inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\n\nclass DirectUploadsController {\n constructor(form) {\n this.form = form;\n this.inputs = findElements(form, inputSelector).filter((input => input.files.length));\n }\n start(callback) {\n const controllers = this.createDirectUploadControllers();\n const startNextController = () => {\n const controller = controllers.shift();\n if (controller) {\n controller.start((error => {\n if (error) {\n callback(error);\n this.dispatch(\"end\");\n } else {\n startNextController();\n }\n }));\n } else {\n callback();\n this.dispatch(\"end\");\n }\n };\n this.dispatch(\"start\");\n startNextController();\n }\n createDirectUploadControllers() {\n const controllers = [];\n this.inputs.forEach((input => {\n toArray(input.files).forEach((file => {\n const controller = new DirectUploadController(input, file);\n controllers.push(controller);\n }));\n }));\n return controllers;\n }\n dispatch(name, detail = {}) {\n return dispatchEvent(this.form, `direct-uploads:${name}`, {\n detail: detail\n });\n }\n}\n\nconst processingAttribute = \"data-direct-uploads-processing\";\n\nconst submitButtonsByForm = new WeakMap;\n\nlet started = false;\n\nfunction start() {\n if (!started) {\n started = true;\n document.addEventListener(\"click\", didClick, true);\n document.addEventListener(\"submit\", didSubmitForm, true);\n document.addEventListener(\"ajax:before\", didSubmitRemoteElement);\n }\n}\n\nfunction didClick(event) {\n const {target: target} = event;\n if ((target.tagName == \"INPUT\" || target.tagName == \"BUTTON\") && target.type == \"submit\" && target.form) {\n submitButtonsByForm.set(target.form, target);\n }\n}\n\nfunction didSubmitForm(event) {\n handleFormSubmissionEvent(event);\n}\n\nfunction didSubmitRemoteElement(event) {\n if (event.target.tagName == \"FORM\") {\n handleFormSubmissionEvent(event);\n }\n}\n\nfunction handleFormSubmissionEvent(event) {\n const form = event.target;\n if (form.hasAttribute(processingAttribute)) {\n event.preventDefault();\n return;\n }\n const controller = new DirectUploadsController(form);\n const {inputs: inputs} = controller;\n if (inputs.length) {\n event.preventDefault();\n form.setAttribute(processingAttribute, \"\");\n inputs.forEach(disable);\n controller.start((error => {\n form.removeAttribute(processingAttribute);\n if (error) {\n inputs.forEach(enable);\n } else {\n submitForm(form);\n }\n }));\n }\n}\n\nfunction submitForm(form) {\n let button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n if (button) {\n const {disabled: disabled} = button;\n button.disabled = false;\n button.focus();\n button.click();\n button.disabled = disabled;\n } else {\n button = document.createElement(\"input\");\n button.type = \"submit\";\n button.style.display = \"none\";\n form.appendChild(button);\n button.click();\n form.removeChild(button);\n }\n submitButtonsByForm.delete(form);\n}\n\nfunction disable(input) {\n input.disabled = true;\n}\n\nfunction enable(input) {\n input.disabled = false;\n}\n\nfunction autostart() {\n if (window.ActiveStorage) {\n start();\n }\n}\n\nsetTimeout(autostart, 1);\n\nclass AttachmentUpload {\n constructor(attachment, element) {\n this.attachment = attachment;\n this.element = element;\n this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this);\n }\n start() {\n this.directUpload.create(this.directUploadDidComplete.bind(this));\n }\n directUploadWillStoreFileWithXHR(xhr) {\n xhr.upload.addEventListener(\"progress\", (event => {\n const progress = event.loaded / event.total * 100;\n this.attachment.setUploadProgress(progress);\n }));\n }\n directUploadDidComplete(error, attributes) {\n if (error) {\n throw new Error(`Direct upload failed: ${error}`);\n }\n this.attachment.setAttributes({\n sgid: attributes.attachable_sgid,\n url: this.createBlobUrl(attributes.signed_id, attributes.filename)\n });\n }\n createBlobUrl(signedId, filename) {\n return this.blobUrlTemplate.replace(\":signed_id\", signedId).replace(\":filename\", encodeURIComponent(filename));\n }\n get directUploadUrl() {\n return this.element.dataset.directUploadUrl;\n }\n get blobUrlTemplate() {\n return this.element.dataset.blobUrlTemplate;\n }\n}\n\naddEventListener(\"trix-attachment-add\", (event => {\n const {attachment: attachment, target: target} = event;\n if (attachment.file) {\n const upload = new AttachmentUpload(attachment, target);\n upload.start();\n }\n}));\n","/*\n * Chartkick.js\n * Create beautiful charts with one line of JavaScript\n * https://github.com/ankane/chartkick.js\n * v3.2.1\n * MIT License\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Chartkick = factory());\n}(this, (function () { 'use strict';\n\n function isArray(variable) {\n return Object.prototype.toString.call(variable) === \"[object Array]\";\n }\n\n function isFunction(variable) {\n return variable instanceof Function;\n }\n\n function isPlainObject(variable) {\n // protect against prototype pollution, defense 2\n return Object.prototype.toString.call(variable) === \"[object Object]\" && !isFunction(variable) && variable instanceof Object;\n }\n\n // https://github.com/madrobby/zepto/blob/master/src/zepto.js\n function extend(target, source) {\n var key;\n for (key in source) {\n // protect against prototype pollution, defense 1\n if (key === \"__proto__\") { continue; }\n\n if (isPlainObject(source[key]) || isArray(source[key])) {\n if (isPlainObject(source[key]) && !isPlainObject(target[key])) {\n target[key] = {};\n }\n if (isArray(source[key]) && !isArray(target[key])) {\n target[key] = [];\n }\n extend(target[key], source[key]);\n } else if (source[key] !== undefined) {\n target[key] = source[key];\n }\n }\n }\n\n function merge(obj1, obj2) {\n var target = {};\n extend(target, obj1);\n extend(target, obj2);\n return target;\n }\n\n var DATE_PATTERN = /^(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)$/i;\n\n // https://github.com/Do/iso8601.js\n var ISO8601_PATTERN = /(\\d\\d\\d\\d)(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)?(:)?(\\d\\d)?([.,]\\d+)?($|Z|([+-])(\\d\\d)(:)?(\\d\\d)?)/i;\n var DECIMAL_SEPARATOR = String(1.5).charAt(1);\n\n function parseISO8601(input) {\n var day, hour, matches, milliseconds, minutes, month, offset, result, seconds, type, year;\n type = Object.prototype.toString.call(input);\n if (type === \"[object Date]\") {\n return input;\n }\n if (type !== \"[object String]\") {\n return;\n }\n matches = input.match(ISO8601_PATTERN);\n if (matches) {\n year = parseInt(matches[1], 10);\n month = parseInt(matches[3], 10) - 1;\n day = parseInt(matches[5], 10);\n hour = parseInt(matches[7], 10);\n minutes = matches[9] ? parseInt(matches[9], 10) : 0;\n seconds = matches[11] ? parseInt(matches[11], 10) : 0;\n milliseconds = matches[12] ? parseFloat(DECIMAL_SEPARATOR + matches[12].slice(1)) * 1000 : 0;\n result = Date.UTC(year, month, day, hour, minutes, seconds, milliseconds);\n if (matches[13] && matches[14]) {\n offset = matches[15] * 60;\n if (matches[17]) {\n offset += parseInt(matches[17], 10);\n }\n offset *= matches[14] === \"-\" ? -1 : 1;\n result -= offset * 60 * 1000;\n }\n return new Date(result);\n }\n }\n // end iso8601.js\n\n function negativeValues(series) {\n var i, j, data;\n for (i = 0; i < series.length; i++) {\n data = series[i].data;\n for (j = 0; j < data.length; j++) {\n if (data[j][1] < 0) {\n return true;\n }\n }\n }\n return false;\n }\n\n function toStr(n) {\n return \"\" + n;\n }\n\n function toFloat(n) {\n return parseFloat(n);\n }\n\n function toDate(n) {\n var matches, year, month, day;\n if (typeof n !== \"object\") {\n if (typeof n === \"number\") {\n n = new Date(n * 1000); // ms\n } else {\n n = toStr(n);\n if ((matches = n.match(DATE_PATTERN))) {\n year = parseInt(matches[1], 10);\n month = parseInt(matches[3], 10) - 1;\n day = parseInt(matches[5], 10);\n return new Date(year, month, day);\n } else { // str\n // try our best to get the str into iso8601\n // TODO be smarter about this\n var str = n.replace(/ /, \"T\").replace(\" \", \"\").replace(\"UTC\", \"Z\");\n n = parseISO8601(str) || new Date(n);\n }\n }\n }\n return n;\n }\n\n function toArr(n) {\n if (!isArray(n)) {\n var arr = [], i;\n for (i in n) {\n if (n.hasOwnProperty(i)) {\n arr.push([i, n[i]]);\n }\n }\n n = arr;\n }\n return n;\n }\n\n function jsOptionsFunc(defaultOptions, hideLegend, setTitle, setMin, setMax, setStacked, setXtitle, setYtitle) {\n return function (chart, opts, chartOptions) {\n var series = chart.data;\n var options = merge({}, defaultOptions);\n options = merge(options, chartOptions || {});\n\n if (chart.hideLegend || \"legend\" in opts) {\n hideLegend(options, opts.legend, chart.hideLegend);\n }\n\n if (opts.title) {\n setTitle(options, opts.title);\n }\n\n // min\n if (\"min\" in opts) {\n setMin(options, opts.min);\n } else if (!negativeValues(series)) {\n setMin(options, 0);\n }\n\n // max\n if (opts.max) {\n setMax(options, opts.max);\n }\n\n if (\"stacked\" in opts) {\n setStacked(options, opts.stacked);\n }\n\n if (opts.colors) {\n options.colors = opts.colors;\n }\n\n if (opts.xtitle) {\n setXtitle(options, opts.xtitle);\n }\n\n if (opts.ytitle) {\n setYtitle(options, opts.ytitle);\n }\n\n // merge library last\n options = merge(options, opts.library || {});\n\n return options;\n };\n }\n\n function sortByTime(a, b) {\n return a[0].getTime() - b[0].getTime();\n }\n\n function sortByNumberSeries(a, b) {\n return a[0] - b[0];\n }\n\n function sortByNumber(a, b) {\n return a - b;\n }\n\n function isMinute(d) {\n return d.getMilliseconds() === 0 && d.getSeconds() === 0;\n }\n\n function isHour(d) {\n return isMinute(d) && d.getMinutes() === 0;\n }\n\n function isDay(d) {\n return isHour(d) && d.getHours() === 0;\n }\n\n function isWeek(d, dayOfWeek) {\n return isDay(d) && d.getDay() === dayOfWeek;\n }\n\n function isMonth(d) {\n return isDay(d) && d.getDate() === 1;\n }\n\n function isYear(d) {\n return isMonth(d) && d.getMonth() === 0;\n }\n\n function isDate(obj) {\n return !isNaN(toDate(obj)) && toStr(obj).length >= 6;\n }\n\n function isNumber(obj) {\n return typeof obj === \"number\";\n }\n\n var byteSuffixes = [\"bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\"];\n\n function formatValue(pre, value, options, axis) {\n pre = pre || \"\";\n if (options.prefix) {\n if (value < 0) {\n value = value * -1;\n pre += \"-\";\n }\n pre += options.prefix;\n }\n\n var suffix = options.suffix || \"\";\n var precision = options.precision;\n var round = options.round;\n\n if (options.byteScale) {\n var suffixIdx;\n var baseValue = axis ? options.byteScale : value;\n\n if (baseValue >= 1152921504606846976) {\n value /= 1152921504606846976;\n suffixIdx = 6;\n } else if (baseValue >= 1125899906842624) {\n value /= 1125899906842624;\n suffixIdx = 5;\n } else if (baseValue >= 1099511627776) {\n value /= 1099511627776;\n suffixIdx = 4;\n } else if (baseValue >= 1073741824) {\n value /= 1073741824;\n suffixIdx = 3;\n } else if (baseValue >= 1048576) {\n value /= 1048576;\n suffixIdx = 2;\n } else if (baseValue >= 1024) {\n value /= 1024;\n suffixIdx = 1;\n } else {\n suffixIdx = 0;\n }\n\n // TODO handle manual precision case\n if (precision === undefined && round === undefined) {\n if (value >= 1023.5) {\n if (suffixIdx < byteSuffixes.length - 1) {\n value = 1.0;\n suffixIdx += 1;\n }\n }\n precision = value >= 1000 ? 4 : 3;\n }\n suffix = \" \" + byteSuffixes[suffixIdx];\n }\n\n if (precision !== undefined && round !== undefined) {\n throw Error(\"Use either round or precision, not both\");\n }\n\n if (!axis) {\n if (precision !== undefined) {\n value = value.toPrecision(precision);\n if (!options.zeros) {\n value = parseFloat(value);\n }\n }\n\n if (round !== undefined) {\n if (round < 0) {\n var num = Math.pow(10, -1 * round);\n value = parseInt((1.0 * value / num).toFixed(0)) * num;\n } else {\n value = value.toFixed(round);\n if (!options.zeros) {\n value = parseFloat(value);\n }\n }\n }\n }\n\n if (options.thousands || options.decimal) {\n value = toStr(value);\n var parts = value.split(\".\");\n value = parts[0];\n if (options.thousands) {\n value = value.replace(/\\B(?=(\\d{3})+(?!\\d))/g, options.thousands);\n }\n if (parts.length > 1) {\n value += (options.decimal || \".\") + parts[1];\n }\n }\n\n return pre + value + suffix;\n }\n\n function seriesOption(chart, series, option) {\n if (option in series) {\n return series[option];\n } else if (option in chart.options) {\n return chart.options[option];\n }\n return null;\n }\n\n function allZeros(data) {\n var i, j, d;\n for (i = 0; i < data.length; i++) {\n d = data[i].data;\n for (j = 0; j < d.length; j++) {\n if (d[j][1] != 0) {\n return false;\n }\n }\n }\n return true;\n }\n\n var baseOptions = {\n maintainAspectRatio: false,\n animation: false,\n tooltips: {\n displayColors: false,\n callbacks: {}\n },\n legend: {},\n title: {fontSize: 20, fontColor: \"#333\"}\n };\n\n var defaultOptions = {\n scales: {\n yAxes: [\n {\n ticks: {\n maxTicksLimit: 4\n },\n scaleLabel: {\n fontSize: 16,\n // fontStyle: \"bold\",\n fontColor: \"#333\"\n }\n }\n ],\n xAxes: [\n {\n gridLines: {\n drawOnChartArea: false\n },\n scaleLabel: {\n fontSize: 16,\n // fontStyle: \"bold\",\n fontColor: \"#333\"\n },\n time: {},\n ticks: {}\n }\n ]\n }\n };\n\n // http://there4.io/2012/05/02/google-chart-color-list/\n var defaultColors = [\n \"#3366CC\", \"#DC3912\", \"#FF9900\", \"#109618\", \"#990099\", \"#3B3EAC\", \"#0099C6\",\n \"#DD4477\", \"#66AA00\", \"#B82E2E\", \"#316395\", \"#994499\", \"#22AA99\", \"#AAAA11\",\n \"#6633CC\", \"#E67300\", \"#8B0707\", \"#329262\", \"#5574A6\", \"#651067\"\n ];\n\n var hideLegend = function (options, legend, hideLegend) {\n if (legend !== undefined) {\n options.legend.display = !!legend;\n if (legend && legend !== true) {\n options.legend.position = legend;\n }\n } else if (hideLegend) {\n options.legend.display = false;\n }\n };\n\n var setTitle = function (options, title) {\n options.title.display = true;\n options.title.text = title;\n };\n\n var setMin = function (options, min) {\n if (min !== null) {\n options.scales.yAxes[0].ticks.min = toFloat(min);\n }\n };\n\n var setMax = function (options, max) {\n options.scales.yAxes[0].ticks.max = toFloat(max);\n };\n\n var setBarMin = function (options, min) {\n if (min !== null) {\n options.scales.xAxes[0].ticks.min = toFloat(min);\n }\n };\n\n var setBarMax = function (options, max) {\n options.scales.xAxes[0].ticks.max = toFloat(max);\n };\n\n var setStacked = function (options, stacked) {\n options.scales.xAxes[0].stacked = !!stacked;\n options.scales.yAxes[0].stacked = !!stacked;\n };\n\n var setXtitle = function (options, title) {\n options.scales.xAxes[0].scaleLabel.display = true;\n options.scales.xAxes[0].scaleLabel.labelString = title;\n };\n\n var setYtitle = function (options, title) {\n options.scales.yAxes[0].scaleLabel.display = true;\n options.scales.yAxes[0].scaleLabel.labelString = title;\n };\n\n // https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb\n var addOpacity = function(hex, opacity) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? \"rgba(\" + parseInt(result[1], 16) + \", \" + parseInt(result[2], 16) + \", \" + parseInt(result[3], 16) + \", \" + opacity + \")\" : hex;\n };\n\n // check if not null or undefined\n // https://stackoverflow.com/a/27757708/1177228\n var notnull = function(x) {\n return x != null;\n };\n\n var setLabelSize = function (chart, data, options) {\n var maxLabelSize = Math.ceil(chart.element.offsetWidth / 4.0 / data.labels.length);\n if (maxLabelSize > 25) {\n maxLabelSize = 25;\n } else if (maxLabelSize < 10) {\n maxLabelSize = 10;\n }\n if (!options.scales.xAxes[0].ticks.callback) {\n options.scales.xAxes[0].ticks.callback = function (value) {\n value = toStr(value);\n if (value.length > maxLabelSize) {\n return value.substring(0, maxLabelSize - 2) + \"...\";\n } else {\n return value;\n }\n };\n }\n };\n\n var setFormatOptions = function(chart, options, chartType) {\n var formatOptions = {\n prefix: chart.options.prefix,\n suffix: chart.options.suffix,\n thousands: chart.options.thousands,\n decimal: chart.options.decimal,\n precision: chart.options.precision,\n round: chart.options.round,\n zeros: chart.options.zeros\n };\n\n if (chart.options.bytes) {\n var series = chart.data;\n if (chartType === \"pie\") {\n series = [{data: series}];\n }\n\n // calculate max\n var max = 0;\n for (var i = 0; i < series.length; i++) {\n var s = series[i];\n for (var j = 0; j < s.data.length; j++) {\n if (s.data[j][1] > max) {\n max = s.data[j][1];\n }\n }\n }\n\n // calculate scale\n var scale = 1;\n while (max >= 1024) {\n scale *= 1024;\n max /= 1024;\n }\n\n // set step size\n formatOptions.byteScale = scale;\n }\n\n if (chartType !== \"pie\") {\n var myAxes = options.scales.yAxes;\n if (chartType === \"bar\") {\n myAxes = options.scales.xAxes;\n }\n\n if (formatOptions.byteScale) {\n if (!myAxes[0].ticks.stepSize) {\n myAxes[0].ticks.stepSize = formatOptions.byteScale / 2;\n }\n if (!myAxes[0].ticks.maxTicksLimit) {\n myAxes[0].ticks.maxTicksLimit = 4;\n }\n }\n\n if (!myAxes[0].ticks.callback) {\n myAxes[0].ticks.callback = function (value) {\n return formatValue(\"\", value, formatOptions, true);\n };\n }\n }\n\n if (!options.tooltips.callbacks.label) {\n if (chartType === \"scatter\") {\n options.tooltips.callbacks.label = function (item, data) {\n var label = data.datasets[item.datasetIndex].label || '';\n if (label) {\n label += ': ';\n }\n return label + '(' + item.xLabel + ', ' + item.yLabel + ')';\n };\n } else if (chartType === \"bubble\") {\n options.tooltips.callbacks.label = function (item, data) {\n var label = data.datasets[item.datasetIndex].label || '';\n if (label) {\n label += ': ';\n }\n var dataPoint = data.datasets[item.datasetIndex].data[item.index];\n return label + '(' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.v + ')';\n };\n } else if (chartType === \"pie\") {\n // need to use separate label for pie charts\n options.tooltips.callbacks.label = function (tooltipItem, data) {\n var dataLabel = data.labels[tooltipItem.index];\n var value = ': ';\n\n if (isArray(dataLabel)) {\n // show value on first line of multiline label\n // need to clone because we are changing the value\n dataLabel = dataLabel.slice();\n dataLabel[0] += value;\n } else {\n dataLabel += value;\n }\n\n return formatValue(dataLabel, data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index], formatOptions);\n };\n } else {\n var valueLabel = chartType === \"bar\" ? \"xLabel\" : \"yLabel\";\n options.tooltips.callbacks.label = function (tooltipItem, data) {\n var label = data.datasets[tooltipItem.datasetIndex].label || '';\n if (label) {\n label += ': ';\n }\n return formatValue(label, tooltipItem[valueLabel], formatOptions);\n };\n }\n }\n };\n\n var jsOptions = jsOptionsFunc(merge(baseOptions, defaultOptions), hideLegend, setTitle, setMin, setMax, setStacked, setXtitle, setYtitle);\n\n var createDataTable = function (chart, options, chartType, library) {\n var datasets = [];\n var labels = [];\n\n var colors = chart.options.colors || defaultColors;\n\n var day = true;\n var week = true;\n var dayOfWeek;\n var month = true;\n var year = true;\n var hour = true;\n var minute = true;\n\n var series = chart.data;\n\n var max = 0;\n if (chartType === \"bubble\") {\n for (var i$1 = 0; i$1 < series.length; i$1++) {\n var s$1 = series[i$1];\n for (var j$1 = 0; j$1 < s$1.data.length; j$1++) {\n if (s$1.data[j$1][2] > max) {\n max = s$1.data[j$1][2];\n }\n }\n }\n }\n\n var i, j, s, d, key, rows = [], rows2 = [];\n\n if (chartType === \"bar\" || chartType === \"column\" || (chart.xtype !== \"number\" && chart.xtype !== \"bubble\")) {\n var sortedLabels = [];\n\n for (i = 0; i < series.length; i++) {\n s = series[i];\n\n for (j = 0; j < s.data.length; j++) {\n d = s.data[j];\n key = chart.xtype == \"datetime\" ? d[0].getTime() : d[0];\n if (!rows[key]) {\n rows[key] = new Array(series.length);\n }\n rows[key][i] = toFloat(d[1]);\n if (sortedLabels.indexOf(key) === -1) {\n sortedLabels.push(key);\n }\n }\n }\n\n if (chart.xtype === \"datetime\" || chart.xtype === \"number\") {\n sortedLabels.sort(sortByNumber);\n }\n\n for (j = 0; j < series.length; j++) {\n rows2.push([]);\n }\n\n var value;\n var k;\n for (k = 0; k < sortedLabels.length; k++) {\n i = sortedLabels[k];\n if (chart.xtype === \"datetime\") {\n value = new Date(toFloat(i));\n // TODO make this efficient\n day = day && isDay(value);\n if (!dayOfWeek) {\n dayOfWeek = value.getDay();\n }\n week = week && isWeek(value, dayOfWeek);\n month = month && isMonth(value);\n year = year && isYear(value);\n hour = hour && isHour(value);\n minute = minute && isMinute(value);\n } else {\n value = i;\n }\n labels.push(value);\n for (j = 0; j < series.length; j++) {\n // Chart.js doesn't like undefined\n rows2[j].push(rows[i][j] === undefined ? null : rows[i][j]);\n }\n }\n } else {\n for (var i$2 = 0; i$2 < series.length; i$2++) {\n var s$2 = series[i$2];\n var d$1 = [];\n for (var j$2 = 0; j$2 < s$2.data.length; j$2++) {\n var point = {\n x: toFloat(s$2.data[j$2][0]),\n y: toFloat(s$2.data[j$2][1])\n };\n if (chartType === \"bubble\") {\n point.r = toFloat(s$2.data[j$2][2]) * 20 / max;\n // custom attribute, for tooltip\n point.v = s$2.data[j$2][2];\n }\n d$1.push(point);\n }\n rows2.push(d$1);\n }\n }\n\n for (i = 0; i < series.length; i++) {\n s = series[i];\n\n var color = s.color || colors[i];\n var backgroundColor = chartType !== \"line\" ? addOpacity(color, 0.5) : color;\n\n var dataset = {\n label: s.name || \"\",\n data: rows2[i],\n fill: chartType === \"area\",\n borderColor: color,\n backgroundColor: backgroundColor,\n pointBackgroundColor: color,\n borderWidth: 2,\n pointHoverBackgroundColor: color\n };\n\n if (s.stack) {\n dataset.stack = s.stack;\n }\n\n var curve = seriesOption(chart, s, \"curve\");\n if (curve === false) {\n dataset.lineTension = 0;\n }\n\n var points = seriesOption(chart, s, \"points\");\n if (points === false) {\n dataset.pointRadius = 0;\n dataset.pointHitRadius = 5;\n }\n\n dataset = merge(dataset, chart.options.dataset || {});\n dataset = merge(dataset, s.library || {});\n dataset = merge(dataset, s.dataset || {});\n\n datasets.push(dataset);\n }\n\n var xmin = chart.options.xmin;\n var xmax = chart.options.xmax;\n\n if (chart.xtype === \"datetime\") {\n // hacky check for Chart.js >= 2.9.0\n // https://github.com/chartjs/Chart.js/compare/v2.8.0...v2.9.0\n var gte29 = \"math\" in library.helpers;\n var ticksKey = gte29 ? \"ticks\" : \"time\";\n if (notnull(xmin)) {\n options.scales.xAxes[0][ticksKey].min = toDate(xmin).getTime();\n }\n if (notnull(xmax)) {\n options.scales.xAxes[0][ticksKey].max = toDate(xmax).getTime();\n }\n } else if (chart.xtype === \"number\") {\n if (notnull(xmin)) {\n options.scales.xAxes[0].ticks.min = xmin;\n }\n if (notnull(xmax)) {\n options.scales.xAxes[0].ticks.max = xmax;\n }\n }\n\n // for empty datetime chart\n if (chart.xtype === \"datetime\" && labels.length === 0) {\n if (notnull(xmin)) {\n labels.push(toDate(xmin));\n }\n if (notnull(xmax)) {\n labels.push(toDate(xmax));\n }\n day = false;\n week = false;\n month = false;\n year = false;\n hour = false;\n minute = false;\n }\n\n if (chart.xtype === \"datetime\" && labels.length > 0) {\n var minTime = (notnull(xmin) ? toDate(xmin) : labels[0]).getTime();\n var maxTime = (notnull(xmax) ? toDate(xmax) : labels[0]).getTime();\n\n for (i = 1; i < labels.length; i++) {\n var value$1 = labels[i].getTime();\n if (value$1 < minTime) {\n minTime = value$1;\n }\n if (value$1 > maxTime) {\n maxTime = value$1;\n }\n }\n\n var timeDiff = (maxTime - minTime) / (86400 * 1000.0);\n\n if (!options.scales.xAxes[0].time.unit) {\n var step;\n if (year || timeDiff > 365 * 10) {\n options.scales.xAxes[0].time.unit = \"year\";\n step = 365;\n } else if (month || timeDiff > 30 * 10) {\n options.scales.xAxes[0].time.unit = \"month\";\n step = 30;\n } else if (day || timeDiff > 10) {\n options.scales.xAxes[0].time.unit = \"day\";\n step = 1;\n } else if (hour || timeDiff > 0.5) {\n options.scales.xAxes[0].time.displayFormats = {hour: \"MMM D, h a\"};\n options.scales.xAxes[0].time.unit = \"hour\";\n step = 1 / 24.0;\n } else if (minute) {\n options.scales.xAxes[0].time.displayFormats = {minute: \"h:mm a\"};\n options.scales.xAxes[0].time.unit = \"minute\";\n step = 1 / 24.0 / 60.0;\n }\n\n if (step && timeDiff > 0) {\n var unitStepSize = Math.ceil(timeDiff / step / (chart.element.offsetWidth / 100.0));\n if (week && step === 1) {\n unitStepSize = Math.ceil(unitStepSize / 7.0) * 7;\n }\n options.scales.xAxes[0].time.unitStepSize = unitStepSize;\n }\n }\n\n if (!options.scales.xAxes[0].time.tooltipFormat) {\n if (day) {\n options.scales.xAxes[0].time.tooltipFormat = \"ll\";\n } else if (hour) {\n options.scales.xAxes[0].time.tooltipFormat = \"MMM D, h a\";\n } else if (minute) {\n options.scales.xAxes[0].time.tooltipFormat = \"h:mm a\";\n }\n }\n }\n\n var data = {\n labels: labels,\n datasets: datasets\n };\n\n return data;\n };\n\n var defaultExport = function defaultExport(library) {\n this.name = \"chartjs\";\n this.library = library;\n };\n\n defaultExport.prototype.renderLineChart = function renderLineChart (chart, chartType) {\n var chartOptions = {};\n // fix for https://github.com/chartjs/Chart.js/issues/2441\n if (!chart.options.max && allZeros(chart.data)) {\n chartOptions.max = 1;\n }\n\n var options = jsOptions(chart, merge(chartOptions, chart.options));\n setFormatOptions(chart, options, chartType);\n\n var data = createDataTable(chart, options, chartType || \"line\", this.library);\n\n if (chart.xtype === \"number\") {\n options.scales.xAxes[0].type = \"linear\";\n options.scales.xAxes[0].position = \"bottom\";\n } else {\n options.scales.xAxes[0].type = chart.xtype === \"string\" ? \"category\" : \"time\";\n }\n\n this.drawChart(chart, \"line\", data, options);\n };\n\n defaultExport.prototype.renderPieChart = function renderPieChart (chart) {\n var options = merge({}, baseOptions);\n if (chart.options.donut) {\n options.cutoutPercentage = 50;\n }\n\n if (\"legend\" in chart.options) {\n hideLegend(options, chart.options.legend);\n }\n\n if (chart.options.title) {\n setTitle(options, chart.options.title);\n }\n\n options = merge(options, chart.options.library || {});\n setFormatOptions(chart, options, \"pie\");\n\n var labels = [];\n var values = [];\n for (var i = 0; i < chart.data.length; i++) {\n var point = chart.data[i];\n labels.push(point[0]);\n values.push(point[1]);\n }\n\n var dataset = {\n data: values,\n backgroundColor: chart.options.colors || defaultColors\n };\n dataset = merge(dataset, chart.options.dataset || {});\n\n var data = {\n labels: labels,\n datasets: [dataset]\n };\n\n this.drawChart(chart, \"pie\", data, options);\n };\n\n defaultExport.prototype.renderColumnChart = function renderColumnChart (chart, chartType) {\n var options;\n if (chartType === \"bar\") {\n var barOptions = merge(baseOptions, defaultOptions);\n delete barOptions.scales.yAxes[0].ticks.maxTicksLimit;\n options = jsOptionsFunc(barOptions, hideLegend, setTitle, setBarMin, setBarMax, setStacked, setXtitle, setYtitle)(chart, chart.options);\n } else {\n options = jsOptions(chart, chart.options);\n }\n setFormatOptions(chart, options, chartType);\n var data = createDataTable(chart, options, \"column\", this.library);\n if (chartType !== \"bar\") {\n setLabelSize(chart, data, options);\n }\n this.drawChart(chart, (chartType === \"bar\" ? \"horizontalBar\" : \"bar\"), data, options);\n };\n\n defaultExport.prototype.renderAreaChart = function renderAreaChart (chart) {\n this.renderLineChart(chart, \"area\");\n };\n\n defaultExport.prototype.renderBarChart = function renderBarChart (chart) {\n this.renderColumnChart(chart, \"bar\");\n };\n\n defaultExport.prototype.renderScatterChart = function renderScatterChart (chart, chartType) {\n chartType = chartType || \"scatter\";\n\n var options = jsOptions(chart, chart.options);\n setFormatOptions(chart, options, chartType);\n\n if (!(\"showLines\" in options)) {\n options.showLines = false;\n }\n\n var data = createDataTable(chart, options, chartType, this.library);\n\n options.scales.xAxes[0].type = \"linear\";\n options.scales.xAxes[0].position = \"bottom\";\n\n this.drawChart(chart, chartType, data, options);\n };\n\n defaultExport.prototype.renderBubbleChart = function renderBubbleChart (chart) {\n this.renderScatterChart(chart, \"bubble\");\n };\n\n defaultExport.prototype.destroy = function destroy (chart) {\n if (chart.chart) {\n chart.chart.destroy();\n }\n };\n\n defaultExport.prototype.drawChart = function drawChart (chart, type, data, options) {\n this.destroy(chart);\n\n var chartOptions = {\n type: type,\n data: data,\n options: options\n };\n\n if (chart.options.code) {\n window.console.log(\"new Chart(ctx, \" + JSON.stringify(chartOptions) + \");\");\n }\n\n chart.element.innerHTML = \"\";\n var ctx = chart.element.getElementsByTagName(\"CANVAS\")[0];\n chart.chart = new this.library(ctx, chartOptions);\n };\n\n var defaultOptions$1 = {\n chart: {},\n xAxis: {\n title: {\n text: null\n },\n labels: {\n style: {\n fontSize: \"12px\"\n }\n }\n },\n yAxis: {\n title: {\n text: null\n },\n labels: {\n style: {\n fontSize: \"12px\"\n }\n }\n },\n title: {\n text: null\n },\n credits: {\n enabled: false\n },\n legend: {\n borderWidth: 0\n },\n tooltip: {\n style: {\n fontSize: \"12px\"\n }\n },\n plotOptions: {\n areaspline: {},\n area: {},\n series: {\n marker: {}\n }\n }\n };\n\n var hideLegend$1 = function (options, legend, hideLegend) {\n if (legend !== undefined) {\n options.legend.enabled = !!legend;\n if (legend && legend !== true) {\n if (legend === \"top\" || legend === \"bottom\") {\n options.legend.verticalAlign = legend;\n } else {\n options.legend.layout = \"vertical\";\n options.legend.verticalAlign = \"middle\";\n options.legend.align = legend;\n }\n }\n } else if (hideLegend) {\n options.legend.enabled = false;\n }\n };\n\n var setTitle$1 = function (options, title) {\n options.title.text = title;\n };\n\n var setMin$1 = function (options, min) {\n options.yAxis.min = min;\n };\n\n var setMax$1 = function (options, max) {\n options.yAxis.max = max;\n };\n\n var setStacked$1 = function (options, stacked) {\n var stackedValue = stacked ? (stacked === true ? \"normal\" : stacked) : null;\n options.plotOptions.series.stacking = stackedValue;\n options.plotOptions.area.stacking = stackedValue;\n options.plotOptions.areaspline.stacking = stackedValue;\n };\n\n var setXtitle$1 = function (options, title) {\n options.xAxis.title.text = title;\n };\n\n var setYtitle$1 = function (options, title) {\n options.yAxis.title.text = title;\n };\n\n var jsOptions$1 = jsOptionsFunc(defaultOptions$1, hideLegend$1, setTitle$1, setMin$1, setMax$1, setStacked$1, setXtitle$1, setYtitle$1);\n\n var setFormatOptions$1 = function(chart, options, chartType) {\n var formatOptions = {\n prefix: chart.options.prefix,\n suffix: chart.options.suffix,\n thousands: chart.options.thousands,\n decimal: chart.options.decimal,\n precision: chart.options.precision,\n round: chart.options.round,\n zeros: chart.options.zeros\n };\n\n if (chartType !== \"pie\" && !options.yAxis.labels.formatter) {\n options.yAxis.labels.formatter = function () {\n return formatValue(\"\", this.value, formatOptions);\n };\n }\n\n if (!options.tooltip.pointFormatter) {\n options.tooltip.pointFormatter = function () {\n return '\\u25CF ' + formatValue(this.series.name + ': ', this.y, formatOptions) + '
';\n };\n }\n };\n\n var defaultExport$1 = function defaultExport(library) {\n this.name = \"highcharts\";\n this.library = library;\n };\n\n defaultExport$1.prototype.renderLineChart = function renderLineChart (chart, chartType) {\n chartType = chartType || \"spline\";\n var chartOptions = {};\n if (chartType === \"areaspline\") {\n chartOptions = {\n plotOptions: {\n areaspline: {\n stacking: \"normal\"\n },\n area: {\n stacking: \"normal\"\n },\n series: {\n marker: {\n enabled: false\n }\n }\n }\n };\n }\n\n if (chart.options.curve === false) {\n if (chartType === \"areaspline\") {\n chartType = \"area\";\n } else if (chartType === \"spline\") {\n chartType = \"line\";\n }\n }\n\n var options = jsOptions$1(chart, chart.options, chartOptions), data, i, j;\n options.xAxis.type = chart.xtype === \"string\" ? \"category\" : (chart.xtype === \"number\" ? \"linear\" : \"datetime\");\n if (!options.chart.type) {\n options.chart.type = chartType;\n }\n setFormatOptions$1(chart, options, chartType);\n\n var series = chart.data;\n for (i = 0; i < series.length; i++) {\n series[i].name = series[i].name || \"Value\";\n data = series[i].data;\n if (chart.xtype === \"datetime\") {\n for (j = 0; j < data.length; j++) {\n data[j][0] = data[j][0].getTime();\n }\n }\n series[i].marker = {symbol: \"circle\"};\n if (chart.options.points === false) {\n series[i].marker.enabled = false;\n }\n }\n\n this.drawChart(chart, series, options);\n };\n\n defaultExport$1.prototype.renderScatterChart = function renderScatterChart (chart) {\n var options = jsOptions$1(chart, chart.options, {});\n options.chart.type = \"scatter\";\n this.drawChart(chart, chart.data, options);\n };\n\n defaultExport$1.prototype.renderPieChart = function renderPieChart (chart) {\n var chartOptions = merge(defaultOptions$1, {});\n\n if (chart.options.colors) {\n chartOptions.colors = chart.options.colors;\n }\n if (chart.options.donut) {\n chartOptions.plotOptions = {pie: {innerSize: \"50%\"}};\n }\n\n if (\"legend\" in chart.options) {\n hideLegend$1(chartOptions, chart.options.legend);\n }\n\n if (chart.options.title) {\n setTitle$1(chartOptions, chart.options.title);\n }\n\n var options = merge(chartOptions, chart.options.library || {});\n setFormatOptions$1(chart, options, \"pie\");\n var series = [{\n type: \"pie\",\n name: chart.options.label || \"Value\",\n data: chart.data\n }];\n\n this.drawChart(chart, series, options);\n };\n\n defaultExport$1.prototype.renderColumnChart = function renderColumnChart (chart, chartType) {\n chartType = chartType || \"column\";\n var series = chart.data;\n var options = jsOptions$1(chart, chart.options), i, j, s, d, rows = [], categories = [];\n options.chart.type = chartType;\n setFormatOptions$1(chart, options, chartType);\n\n for (i = 0; i < series.length; i++) {\n s = series[i];\n\n for (j = 0; j < s.data.length; j++) {\n d = s.data[j];\n if (!rows[d[0]]) {\n rows[d[0]] = new Array(series.length);\n categories.push(d[0]);\n }\n rows[d[0]][i] = d[1];\n }\n }\n\n if (chart.xtype === \"number\") {\n categories.sort(sortByNumber);\n }\n\n options.xAxis.categories = categories;\n\n var newSeries = [], d2;\n for (i = 0; i < series.length; i++) {\n d = [];\n for (j = 0; j < categories.length; j++) {\n d.push(rows[categories[j]][i] || 0);\n }\n\n d2 = {\n name: series[i].name || \"Value\",\n data: d\n };\n if (series[i].stack) {\n d2.stack = series[i].stack;\n }\n\n newSeries.push(d2);\n }\n\n this.drawChart(chart, newSeries, options);\n };\n\n defaultExport$1.prototype.renderBarChart = function renderBarChart (chart) {\n this.renderColumnChart(chart, \"bar\");\n };\n\n defaultExport$1.prototype.renderAreaChart = function renderAreaChart (chart) {\n this.renderLineChart(chart, \"areaspline\");\n };\n\n defaultExport$1.prototype.destroy = function destroy (chart) {\n if (chart.chart) {\n chart.chart.destroy();\n }\n };\n\n defaultExport$1.prototype.drawChart = function drawChart (chart, data, options) {\n this.destroy(chart);\n\n options.chart.renderTo = chart.element.id;\n options.series = data;\n\n if (chart.options.code) {\n window.console.log(\"new Highcharts.Chart(\" + JSON.stringify(options) + \");\");\n }\n\n chart.chart = new this.library.Chart(options);\n };\n\n var loaded = {};\n var callbacks = [];\n\n // Set chart options\n var defaultOptions$2 = {\n chartArea: {},\n fontName: \"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif\",\n pointSize: 6,\n legend: {\n textStyle: {\n fontSize: 12,\n color: \"#444\"\n },\n alignment: \"center\",\n position: \"right\"\n },\n curveType: \"function\",\n hAxis: {\n textStyle: {\n color: \"#666\",\n fontSize: 12\n },\n titleTextStyle: {},\n gridlines: {\n color: \"transparent\"\n },\n baselineColor: \"#ccc\",\n viewWindow: {}\n },\n vAxis: {\n textStyle: {\n color: \"#666\",\n fontSize: 12\n },\n titleTextStyle: {},\n baselineColor: \"#ccc\",\n viewWindow: {}\n },\n tooltip: {\n textStyle: {\n color: \"#666\",\n fontSize: 12\n }\n }\n };\n\n var hideLegend$2 = function (options, legend, hideLegend) {\n if (legend !== undefined) {\n var position;\n if (!legend) {\n position = \"none\";\n } else if (legend === true) {\n position = \"right\";\n } else {\n position = legend;\n }\n options.legend.position = position;\n } else if (hideLegend) {\n options.legend.position = \"none\";\n }\n };\n\n var setTitle$2 = function (options, title) {\n options.title = title;\n options.titleTextStyle = {color: \"#333\", fontSize: \"20px\"};\n };\n\n var setMin$2 = function (options, min) {\n options.vAxis.viewWindow.min = min;\n };\n\n var setMax$2 = function (options, max) {\n options.vAxis.viewWindow.max = max;\n };\n\n var setBarMin$1 = function (options, min) {\n options.hAxis.viewWindow.min = min;\n };\n\n var setBarMax$1 = function (options, max) {\n options.hAxis.viewWindow.max = max;\n };\n\n var setStacked$2 = function (options, stacked) {\n options.isStacked = stacked ? stacked : false;\n };\n\n var setXtitle$2 = function (options, title) {\n options.hAxis.title = title;\n options.hAxis.titleTextStyle.italic = false;\n };\n\n var setYtitle$2 = function (options, title) {\n options.vAxis.title = title;\n options.vAxis.titleTextStyle.italic = false;\n };\n\n var jsOptions$2 = jsOptionsFunc(defaultOptions$2, hideLegend$2, setTitle$2, setMin$2, setMax$2, setStacked$2, setXtitle$2, setYtitle$2);\n\n var resize = function (callback) {\n if (window.attachEvent) {\n window.attachEvent(\"onresize\", callback);\n } else if (window.addEventListener) {\n window.addEventListener(\"resize\", callback, true);\n }\n callback();\n };\n\n var defaultExport$2 = function defaultExport(library) {\n this.name = \"google\";\n this.library = library;\n };\n\n defaultExport$2.prototype.renderLineChart = function renderLineChart (chart) {\n var this$1 = this;\n\n this.waitForLoaded(chart, function () {\n var chartOptions = {};\n\n if (chart.options.curve === false) {\n chartOptions.curveType = \"none\";\n }\n\n if (chart.options.points === false) {\n chartOptions.pointSize = 0;\n }\n\n var options = jsOptions$2(chart, chart.options, chartOptions);\n var data = this$1.createDataTable(chart.data, chart.xtype);\n\n this$1.drawChart(chart, \"LineChart\", data, options);\n });\n };\n\n defaultExport$2.prototype.renderPieChart = function renderPieChart (chart) {\n var this$1 = this;\n\n this.waitForLoaded(chart, function () {\n var chartOptions = {\n chartArea: {\n top: \"10%\",\n height: \"80%\"\n },\n legend: {}\n };\n if (chart.options.colors) {\n chartOptions.colors = chart.options.colors;\n }\n if (chart.options.donut) {\n chartOptions.pieHole = 0.5;\n }\n if (\"legend\" in chart.options) {\n hideLegend$2(chartOptions, chart.options.legend);\n }\n if (chart.options.title) {\n setTitle$2(chartOptions, chart.options.title);\n }\n var options = merge(merge(defaultOptions$2, chartOptions), chart.options.library || {});\n\n var data = new this$1.library.visualization.DataTable();\n data.addColumn(\"string\", \"\");\n data.addColumn(\"number\", \"Value\");\n data.addRows(chart.data);\n\n this$1.drawChart(chart, \"PieChart\", data, options);\n });\n };\n\n defaultExport$2.prototype.renderColumnChart = function renderColumnChart (chart) {\n var this$1 = this;\n\n this.waitForLoaded(chart, function () {\n var options = jsOptions$2(chart, chart.options);\n var data = this$1.createDataTable(chart.data, chart.xtype);\n\n this$1.drawChart(chart, \"ColumnChart\", data, options);\n });\n };\n\n defaultExport$2.prototype.renderBarChart = function renderBarChart (chart) {\n var this$1 = this;\n\n this.waitForLoaded(chart, function () {\n var chartOptions = {\n hAxis: {\n gridlines: {\n color: \"#ccc\"\n }\n }\n };\n var options = jsOptionsFunc(defaultOptions$2, hideLegend$2, setTitle$2, setBarMin$1, setBarMax$1, setStacked$2, setXtitle$2, setYtitle$2)(chart, chart.options, chartOptions);\n var data = this$1.createDataTable(chart.data, chart.xtype);\n\n this$1.drawChart(chart, \"BarChart\", data, options);\n });\n };\n\n defaultExport$2.prototype.renderAreaChart = function renderAreaChart (chart) {\n var this$1 = this;\n\n this.waitForLoaded(chart, function () {\n var chartOptions = {\n isStacked: true,\n pointSize: 0,\n areaOpacity: 0.5\n };\n\n var options = jsOptions$2(chart, chart.options, chartOptions);\n var data = this$1.createDataTable(chart.data, chart.xtype);\n\n this$1.drawChart(chart, \"AreaChart\", data, options);\n });\n };\n\n defaultExport$2.prototype.renderGeoChart = function renderGeoChart (chart) {\n var this$1 = this;\n\n this.waitForLoaded(chart, \"geochart\", function () {\n var chartOptions = {\n legend: \"none\",\n colorAxis: {\n colors: chart.options.colors || [\"#f6c7b6\", \"#ce502d\"]\n }\n };\n var options = merge(merge(defaultOptions$2, chartOptions), chart.options.library || {});\n\n var data = new this$1.library.visualization.DataTable();\n data.addColumn(\"string\", \"\");\n data.addColumn(\"number\", chart.options.label || \"Value\");\n data.addRows(chart.data);\n\n this$1.drawChart(chart, \"GeoChart\", data, options);\n });\n };\n\n defaultExport$2.prototype.renderScatterChart = function renderScatterChart (chart) {\n var this$1 = this;\n\n this.waitForLoaded(chart, function () {\n var chartOptions = {};\n var options = jsOptions$2(chart, chart.options, chartOptions);\n\n var series = chart.data, rows2 = [], i, j, data, d;\n for (i = 0; i < series.length; i++) {\n series[i].name = series[i].name || \"Value\";\n d = series[i].data;\n for (j = 0; j < d.length; j++) {\n var row = new Array(series.length + 1);\n row[0] = d[j][0];\n row[i + 1] = d[j][1];\n rows2.push(row);\n }\n }\n\n data = new this$1.library.visualization.DataTable();\n data.addColumn(\"number\", \"\");\n for (i = 0; i < series.length; i++) {\n data.addColumn(\"number\", series[i].name);\n }\n data.addRows(rows2);\n\n this$1.drawChart(chart, \"ScatterChart\", data, options);\n });\n };\n\n defaultExport$2.prototype.renderTimeline = function renderTimeline (chart) {\n var this$1 = this;\n\n this.waitForLoaded(chart, \"timeline\", function () {\n var chartOptions = {\n legend: \"none\"\n };\n\n if (chart.options.colors) {\n chartOptions.colors = chart.options.colors;\n }\n var options = merge(merge(defaultOptions$2, chartOptions), chart.options.library || {});\n\n var data = new this$1.library.visualization.DataTable();\n data.addColumn({type: \"string\", id: \"Name\"});\n data.addColumn({type: \"date\", id: \"Start\"});\n data.addColumn({type: \"date\", id: \"End\"});\n data.addRows(chart.data);\n\n chart.element.style.lineHeight = \"normal\";\n\n this$1.drawChart(chart, \"Timeline\", data, options);\n });\n };\n\n defaultExport$2.prototype.destroy = function destroy (chart) {\n if (chart.chart) {\n chart.chart.clearChart();\n }\n };\n\n defaultExport$2.prototype.drawChart = function drawChart (chart, type, data, options) {\n this.destroy(chart);\n\n if (chart.options.code) {\n window.console.log(\"var data = new google.visualization.DataTable(\" + data.toJSON() + \");\\nvar chart = new google.visualization.\" + type + \"(element);\\nchart.draw(data, \" + JSON.stringify(options) + \");\");\n }\n\n chart.chart = new this.library.visualization[type](chart.element);\n resize(function () {\n chart.chart.draw(data, options);\n });\n };\n\n defaultExport$2.prototype.waitForLoaded = function waitForLoaded (chart, pack, callback) {\n var this$1 = this;\n\n if (!callback) {\n callback = pack;\n pack = \"corechart\";\n }\n\n callbacks.push({pack: pack, callback: callback});\n\n if (loaded[pack]) {\n this.runCallbacks();\n } else {\n loaded[pack] = true;\n\n // https://groups.google.com/forum/#!topic/google-visualization-api/fMKJcyA2yyI\n var loadOptions = {\n packages: [pack],\n callback: function () { this$1.runCallbacks(); }\n };\n var config = chart.__config();\n if (config.language) {\n loadOptions.language = config.language;\n }\n if (pack === \"geochart\" && config.mapsApiKey) {\n loadOptions.mapsApiKey = config.mapsApiKey;\n }\n\n this.library.charts.load(\"current\", loadOptions);\n }\n };\n\n defaultExport$2.prototype.runCallbacks = function runCallbacks () {\n var cb, call;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n call = this.library.visualization && ((cb.pack === \"corechart\" && this.library.visualization.LineChart) || (cb.pack === \"timeline\" && this.library.visualization.Timeline) || (cb.pack === \"geochart\" && this.library.visualization.GeoChart));\n if (call) {\n cb.callback();\n callbacks.splice(i, 1);\n i--;\n }\n }\n };\n\n // cant use object as key\n defaultExport$2.prototype.createDataTable = function createDataTable (series, columnType) {\n var i, j, s, d, key, rows = [], sortedLabels = [];\n for (i = 0; i < series.length; i++) {\n s = series[i];\n series[i].name = series[i].name || \"Value\";\n\n for (j = 0; j < s.data.length; j++) {\n d = s.data[j];\n key = (columnType === \"datetime\") ? d[0].getTime() : d[0];\n if (!rows[key]) {\n rows[key] = new Array(series.length);\n sortedLabels.push(key);\n }\n rows[key][i] = toFloat(d[1]);\n }\n }\n\n var rows2 = [];\n var day = true;\n var value;\n for (j = 0; j < sortedLabels.length; j++) {\n i = sortedLabels[j];\n if (columnType === \"datetime\") {\n value = new Date(toFloat(i));\n day = day && isDay(value);\n } else if (columnType === \"number\") {\n value = toFloat(i);\n } else {\n value = i;\n }\n rows2.push([value].concat(rows[i]));\n }\n if (columnType === \"datetime\") {\n rows2.sort(sortByTime);\n } else if (columnType === \"number\") {\n rows2.sort(sortByNumberSeries);\n\n for (i = 0; i < rows2.length; i++) {\n rows2[i][0] = toStr(rows2[i][0]);\n }\n\n columnType = \"string\";\n }\n\n // create datatable\n var data = new this.library.visualization.DataTable();\n columnType = columnType === \"datetime\" && day ? \"date\" : columnType;\n data.addColumn(columnType, \"\");\n for (i = 0; i < series.length; i++) {\n data.addColumn(\"number\", series[i].name);\n }\n data.addRows(rows2);\n\n return data;\n };\n\n var pendingRequests = [], runningRequests = 0, maxRequests = 4;\n\n function pushRequest(url, success, error) {\n pendingRequests.push([url, success, error]);\n runNext();\n }\n\n function runNext() {\n if (runningRequests < maxRequests) {\n var request = pendingRequests.shift();\n if (request) {\n runningRequests++;\n getJSON(request[0], request[1], request[2]);\n runNext();\n }\n }\n }\n\n function requestComplete() {\n runningRequests--;\n runNext();\n }\n\n function getJSON(url, success, error) {\n ajaxCall(url, success, function (jqXHR, textStatus, errorThrown) {\n var message = (typeof errorThrown === \"string\") ? errorThrown : errorThrown.message;\n error(message);\n });\n }\n\n function ajaxCall(url, success, error) {\n var $ = window.jQuery || window.Zepto || window.$;\n\n if ($ && $.ajax) {\n $.ajax({\n dataType: \"json\",\n url: url,\n success: success,\n error: error,\n complete: requestComplete\n });\n } else {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.onload = function () {\n requestComplete();\n if (xhr.status === 200) {\n success(JSON.parse(xhr.responseText), xhr.statusText, xhr);\n } else {\n error(xhr, \"error\", xhr.statusText);\n }\n };\n xhr.send();\n }\n }\n\n var config = {};\n var adapters = [];\n\n // helpers\n\n function setText(element, text) {\n if (document.body.innerText) {\n element.innerText = text;\n } else {\n element.textContent = text;\n }\n }\n\n // TODO remove prefix for all messages\n function chartError(element, message, noPrefix) {\n if (!noPrefix) {\n message = \"Error Loading Chart: \" + message;\n }\n setText(element, message);\n element.style.color = \"#ff0000\";\n }\n\n function errorCatcher(chart) {\n try {\n chart.__render();\n } catch (err) {\n chartError(chart.element, err.message);\n throw err;\n }\n }\n\n function fetchDataSource(chart, dataSource) {\n if (typeof dataSource === \"string\") {\n pushRequest(dataSource, function (data) {\n chart.rawData = data;\n errorCatcher(chart);\n }, function (message) {\n chartError(chart.element, message);\n });\n } else if (typeof dataSource === \"function\") {\n try {\n dataSource(function (data) {\n chart.rawData = data;\n errorCatcher(chart);\n }, function (message) {\n chartError(chart.element, message, true);\n });\n } catch (err) {\n chartError(chart.element, err, true);\n }\n } else {\n chart.rawData = dataSource;\n errorCatcher(chart);\n }\n }\n\n function addDownloadButton(chart) {\n var element = chart.element;\n var link = document.createElement(\"a\");\n\n var download = chart.options.download;\n if (download === true) {\n download = {};\n } else if (typeof download === \"string\") {\n download = {filename: download};\n }\n link.download = download.filename || \"chart.png\"; // https://caniuse.com/download\n\n link.style.position = \"absolute\";\n link.style.top = \"20px\";\n link.style.right = \"20px\";\n link.style.zIndex = 1000;\n link.style.lineHeight = \"20px\";\n link.target = \"_blank\"; // for safari\n var image = document.createElement(\"img\");\n image.alt = \"Download\";\n image.style.border = \"none\";\n // icon from font-awesome\n // http://fa2png.io/\n image.src = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==\";\n link.appendChild(image);\n element.style.position = \"relative\";\n\n chart.__downloadAttached = true;\n\n // mouseenter\n chart.__enterEvent = addEvent(element, \"mouseover\", function(e) {\n var related = e.relatedTarget;\n // check download option again to ensure it wasn't changed\n if ((!related || (related !== this && !childOf(this, related))) && chart.options.download) {\n link.href = chart.toImage(download);\n element.appendChild(link);\n }\n });\n\n // mouseleave\n chart.__leaveEvent = addEvent(element, \"mouseout\", function(e) {\n var related = e.relatedTarget;\n if (!related || (related !== this && !childOf(this, related))) {\n if (link.parentNode) {\n link.parentNode.removeChild(link);\n }\n }\n });\n }\n\n // https://stackoverflow.com/questions/10149963/adding-event-listener-cross-browser\n function addEvent(elem, event, fn) {\n if (elem.addEventListener) {\n elem.addEventListener(event, fn, false);\n return fn;\n } else {\n var fn2 = function() {\n // set the this pointer same as addEventListener when fn is called\n return(fn.call(elem, window.event));\n };\n elem.attachEvent(\"on\" + event, fn2);\n return fn2;\n }\n }\n\n function removeEvent(elem, event, fn) {\n if (elem.removeEventListener) {\n elem.removeEventListener(event, fn, false);\n } else {\n elem.detachEvent(\"on\" + event, fn);\n }\n }\n\n // https://gist.github.com/shawnbot/4166283\n function childOf(p, c) {\n if (p === c) { return false; }\n while (c && c !== p) { c = c.parentNode; }\n return c === p;\n }\n\n function getAdapterType(library) {\n if (library) {\n if (library.product === \"Highcharts\") {\n return defaultExport$1;\n } else if (library.charts) {\n return defaultExport$2;\n } else if (isFunction(library)) {\n return defaultExport;\n }\n }\n throw new Error(\"Unknown adapter\");\n }\n\n function addAdapter(library) {\n var adapterType = getAdapterType(library);\n var adapter = new adapterType(library);\n\n if (adapters.indexOf(adapter) === -1) {\n adapters.push(adapter);\n }\n }\n\n function loadAdapters() {\n if (\"Chart\" in window) {\n addAdapter(window.Chart);\n }\n\n if (\"Highcharts\" in window) {\n addAdapter(window.Highcharts);\n }\n\n if (window.google && window.google.charts) {\n addAdapter(window.google);\n }\n }\n\n function dataEmpty(data, chartType) {\n if (chartType === \"PieChart\" || chartType === \"GeoChart\" || chartType === \"Timeline\") {\n return data.length === 0;\n } else {\n for (var i = 0; i < data.length; i++) {\n if (data[i].data.length > 0) {\n return false;\n }\n }\n return true;\n }\n }\n\n function renderChart(chartType, chart) {\n if (chart.options.messages && chart.options.messages.empty && dataEmpty(chart.data, chartType)) {\n setText(chart.element, chart.options.messages.empty);\n } else {\n callAdapter(chartType, chart);\n if (chart.options.download && !chart.__downloadAttached && chart.adapter === \"chartjs\") {\n addDownloadButton(chart);\n }\n }\n }\n\n // TODO remove chartType if cross-browser way\n // to get the name of the chart class\n function callAdapter(chartType, chart) {\n var i, adapter, fnName, adapterName;\n fnName = \"render\" + chartType;\n adapterName = chart.options.adapter;\n\n loadAdapters();\n\n for (i = 0; i < adapters.length; i++) {\n adapter = adapters[i];\n if ((!adapterName || adapterName === adapter.name) && isFunction(adapter[fnName])) {\n chart.adapter = adapter.name;\n chart.__adapterObject = adapter;\n return adapter[fnName](chart);\n }\n }\n\n if (adapters.length > 0) {\n throw new Error(\"No charting library found for \" + chartType);\n } else {\n throw new Error(\"No charting libraries found - be sure to include one before your charts\");\n }\n }\n\n // process data\n\n var toFormattedKey = function (key, keyType) {\n if (keyType === \"number\") {\n key = toFloat(key);\n } else if (keyType === \"datetime\") {\n key = toDate(key);\n } else {\n key = toStr(key);\n }\n return key;\n };\n\n var formatSeriesData = function (data, keyType) {\n var r = [], key, j;\n for (j = 0; j < data.length; j++) {\n if (keyType === \"bubble\") {\n r.push([toFloat(data[j][0]), toFloat(data[j][1]), toFloat(data[j][2])]);\n } else {\n key = toFormattedKey(data[j][0], keyType);\n r.push([key, toFloat(data[j][1])]);\n }\n }\n if (keyType === \"datetime\") {\n r.sort(sortByTime);\n } else if (keyType === \"number\") {\n r.sort(sortByNumberSeries);\n }\n return r;\n };\n\n function detectXType(series, noDatetime, options) {\n if (dataEmpty(series)) {\n if ((options.xmin || options.xmax) && (!options.xmin || isDate(options.xmin)) && (!options.xmax || isDate(options.xmax))) {\n return \"datetime\";\n } else {\n return \"number\";\n }\n } else if (detectXTypeWithFunction(series, isNumber)) {\n return \"number\";\n } else if (!noDatetime && detectXTypeWithFunction(series, isDate)) {\n return \"datetime\";\n } else {\n return \"string\";\n }\n }\n\n function detectXTypeWithFunction(series, func) {\n var i, j, data;\n for (i = 0; i < series.length; i++) {\n data = toArr(series[i].data);\n for (j = 0; j < data.length; j++) {\n if (!func(data[j][0])) {\n return false;\n }\n }\n }\n return true;\n }\n\n // creates a shallow copy of each element of the array\n // elements are expected to be objects\n function copySeries(series) {\n var newSeries = [], i, j;\n for (i = 0; i < series.length; i++) {\n var copy = {};\n for (j in series[i]) {\n if (series[i].hasOwnProperty(j)) {\n copy[j] = series[i][j];\n }\n }\n newSeries.push(copy);\n }\n return newSeries;\n }\n\n function processSeries(chart, keyType, noDatetime) {\n var i;\n\n var opts = chart.options;\n var series = chart.rawData;\n\n // see if one series or multiple\n if (!isArray(series) || typeof series[0] !== \"object\" || isArray(series[0])) {\n series = [{name: opts.label, data: series}];\n chart.hideLegend = true;\n } else {\n chart.hideLegend = false;\n }\n\n // convert to array\n // must come before dataEmpty check\n series = copySeries(series);\n for (i = 0; i < series.length; i++) {\n series[i].data = toArr(series[i].data);\n }\n\n chart.xtype = keyType ? keyType : (opts.discrete ? \"string\" : detectXType(series, noDatetime, opts));\n\n // right format\n for (i = 0; i < series.length; i++) {\n series[i].data = formatSeriesData(series[i].data, chart.xtype);\n }\n\n return series;\n }\n\n function processSimple(chart) {\n var perfectData = toArr(chart.rawData), i;\n for (i = 0; i < perfectData.length; i++) {\n perfectData[i] = [toStr(perfectData[i][0]), toFloat(perfectData[i][1])];\n }\n return perfectData;\n }\n\n // define classes\n\n var Chart = function Chart(element, dataSource, options) {\n var elementId;\n if (typeof element === \"string\") {\n elementId = element;\n element = document.getElementById(element);\n if (!element) {\n throw new Error(\"No element with id \" + elementId);\n }\n }\n this.element = element;\n this.options = merge(Chartkick.options, options || {});\n this.dataSource = dataSource;\n\n Chartkick.charts[element.id] = this;\n\n fetchDataSource(this, dataSource);\n\n if (this.options.refresh) {\n this.startRefresh();\n }\n };\n\n Chart.prototype.getElement = function getElement () {\n return this.element;\n };\n\n Chart.prototype.getDataSource = function getDataSource () {\n return this.dataSource;\n };\n\n Chart.prototype.getData = function getData () {\n return this.data;\n };\n\n Chart.prototype.getOptions = function getOptions () {\n return this.options;\n };\n\n Chart.prototype.getChartObject = function getChartObject () {\n return this.chart;\n };\n\n Chart.prototype.getAdapter = function getAdapter () {\n return this.adapter;\n };\n\n Chart.prototype.updateData = function updateData (dataSource, options) {\n this.dataSource = dataSource;\n if (options) {\n this.__updateOptions(options);\n }\n fetchDataSource(this, dataSource);\n };\n\n Chart.prototype.setOptions = function setOptions (options) {\n this.__updateOptions(options);\n this.redraw();\n };\n\n Chart.prototype.redraw = function redraw () {\n fetchDataSource(this, this.rawData);\n };\n\n Chart.prototype.refreshData = function refreshData () {\n if (typeof this.dataSource === \"string\") {\n // prevent browser from caching\n var sep = this.dataSource.indexOf(\"?\") === -1 ? \"?\" : \"&\";\n var url = this.dataSource + sep + \"_=\" + (new Date()).getTime();\n fetchDataSource(this, url);\n } else if (typeof this.dataSource === \"function\") {\n fetchDataSource(this, this.dataSource);\n }\n };\n\n Chart.prototype.startRefresh = function startRefresh () {\n var this$1 = this;\n\n var refresh = this.options.refresh;\n\n if (refresh && typeof this.dataSource !== \"string\" && typeof this.dataSource !== \"function\") {\n throw new Error(\"Data source must be a URL or callback for refresh\");\n }\n\n if (!this.intervalId) {\n if (refresh) {\n this.intervalId = setInterval( function () {\n this$1.refreshData();\n }, refresh * 1000);\n } else {\n throw new Error(\"No refresh interval\");\n }\n }\n };\n\n Chart.prototype.stopRefresh = function stopRefresh () {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n };\n\n Chart.prototype.toImage = function toImage (download) {\n if (this.adapter === \"chartjs\") {\n if (download && download.background && download.background !== \"transparent\") {\n // https://stackoverflow.com/questions/30464750/chartjs-line-chart-set-background-color\n var canvas = this.chart.chart.canvas;\n var ctx = this.chart.chart.ctx;\n var tmpCanvas = document.createElement(\"canvas\");\n var tmpCtx = tmpCanvas.getContext(\"2d\");\n tmpCanvas.width = ctx.canvas.width;\n tmpCanvas.height = ctx.canvas.height;\n tmpCtx.fillStyle = download.background;\n tmpCtx.fillRect(0, 0, tmpCanvas.width, tmpCanvas.height);\n tmpCtx.drawImage(canvas, 0, 0);\n return tmpCanvas.toDataURL(\"image/png\");\n } else {\n return this.chart.toBase64Image();\n }\n } else {\n // TODO throw error in next major version\n // throw new Error(\"Feature only available for Chart.js\");\n return null;\n }\n };\n\n Chart.prototype.destroy = function destroy () {\n if (this.__adapterObject) {\n this.__adapterObject.destroy(this);\n }\n\n if (this.__enterEvent) {\n removeEvent(this.element, \"mouseover\", this.__enterEvent);\n }\n\n if (this.__leaveEvent) {\n removeEvent(this.element, \"mouseout\", this.__leaveEvent);\n }\n };\n\n Chart.prototype.__updateOptions = function __updateOptions (options) {\n var updateRefresh = options.refresh && options.refresh !== this.options.refresh;\n this.options = merge(Chartkick.options, options);\n if (updateRefresh) {\n this.stopRefresh();\n this.startRefresh();\n }\n };\n\n Chart.prototype.__render = function __render () {\n this.data = this.__processData();\n renderChart(this.__chartName(), this);\n };\n\n Chart.prototype.__config = function __config () {\n return config;\n };\n\n var LineChart = /*@__PURE__*/(function (Chart) {\n function LineChart () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) LineChart.__proto__ = Chart;\n LineChart.prototype = Object.create( Chart && Chart.prototype );\n LineChart.prototype.constructor = LineChart;\n\n LineChart.prototype.__processData = function __processData () {\n return processSeries(this);\n };\n\n LineChart.prototype.__chartName = function __chartName () {\n return \"LineChart\";\n };\n\n return LineChart;\n }(Chart));\n\n var PieChart = /*@__PURE__*/(function (Chart) {\n function PieChart () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) PieChart.__proto__ = Chart;\n PieChart.prototype = Object.create( Chart && Chart.prototype );\n PieChart.prototype.constructor = PieChart;\n\n PieChart.prototype.__processData = function __processData () {\n return processSimple(this);\n };\n\n PieChart.prototype.__chartName = function __chartName () {\n return \"PieChart\";\n };\n\n return PieChart;\n }(Chart));\n\n var ColumnChart = /*@__PURE__*/(function (Chart) {\n function ColumnChart () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) ColumnChart.__proto__ = Chart;\n ColumnChart.prototype = Object.create( Chart && Chart.prototype );\n ColumnChart.prototype.constructor = ColumnChart;\n\n ColumnChart.prototype.__processData = function __processData () {\n return processSeries(this, null, true);\n };\n\n ColumnChart.prototype.__chartName = function __chartName () {\n return \"ColumnChart\";\n };\n\n return ColumnChart;\n }(Chart));\n\n var BarChart = /*@__PURE__*/(function (Chart) {\n function BarChart () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) BarChart.__proto__ = Chart;\n BarChart.prototype = Object.create( Chart && Chart.prototype );\n BarChart.prototype.constructor = BarChart;\n\n BarChart.prototype.__processData = function __processData () {\n return processSeries(this, null, true);\n };\n\n BarChart.prototype.__chartName = function __chartName () {\n return \"BarChart\";\n };\n\n return BarChart;\n }(Chart));\n\n var AreaChart = /*@__PURE__*/(function (Chart) {\n function AreaChart () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) AreaChart.__proto__ = Chart;\n AreaChart.prototype = Object.create( Chart && Chart.prototype );\n AreaChart.prototype.constructor = AreaChart;\n\n AreaChart.prototype.__processData = function __processData () {\n return processSeries(this);\n };\n\n AreaChart.prototype.__chartName = function __chartName () {\n return \"AreaChart\";\n };\n\n return AreaChart;\n }(Chart));\n\n var GeoChart = /*@__PURE__*/(function (Chart) {\n function GeoChart () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) GeoChart.__proto__ = Chart;\n GeoChart.prototype = Object.create( Chart && Chart.prototype );\n GeoChart.prototype.constructor = GeoChart;\n\n GeoChart.prototype.__processData = function __processData () {\n return processSimple(this);\n };\n\n GeoChart.prototype.__chartName = function __chartName () {\n return \"GeoChart\";\n };\n\n return GeoChart;\n }(Chart));\n\n var ScatterChart = /*@__PURE__*/(function (Chart) {\n function ScatterChart () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) ScatterChart.__proto__ = Chart;\n ScatterChart.prototype = Object.create( Chart && Chart.prototype );\n ScatterChart.prototype.constructor = ScatterChart;\n\n ScatterChart.prototype.__processData = function __processData () {\n return processSeries(this, \"number\");\n };\n\n ScatterChart.prototype.__chartName = function __chartName () {\n return \"ScatterChart\";\n };\n\n return ScatterChart;\n }(Chart));\n\n var BubbleChart = /*@__PURE__*/(function (Chart) {\n function BubbleChart () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) BubbleChart.__proto__ = Chart;\n BubbleChart.prototype = Object.create( Chart && Chart.prototype );\n BubbleChart.prototype.constructor = BubbleChart;\n\n BubbleChart.prototype.__processData = function __processData () {\n return processSeries(this, \"bubble\");\n };\n\n BubbleChart.prototype.__chartName = function __chartName () {\n return \"BubbleChart\";\n };\n\n return BubbleChart;\n }(Chart));\n\n var Timeline = /*@__PURE__*/(function (Chart) {\n function Timeline () {\n Chart.apply(this, arguments);\n }\n\n if ( Chart ) Timeline.__proto__ = Chart;\n Timeline.prototype = Object.create( Chart && Chart.prototype );\n Timeline.prototype.constructor = Timeline;\n\n Timeline.prototype.__processData = function __processData () {\n var i, data = this.rawData;\n for (i = 0; i < data.length; i++) {\n data[i][1] = toDate(data[i][1]);\n data[i][2] = toDate(data[i][2]);\n }\n return data;\n };\n\n Timeline.prototype.__chartName = function __chartName () {\n return \"Timeline\";\n };\n\n return Timeline;\n }(Chart));\n\n var Chartkick = {\n LineChart: LineChart,\n PieChart: PieChart,\n ColumnChart: ColumnChart,\n BarChart: BarChart,\n AreaChart: AreaChart,\n GeoChart: GeoChart,\n ScatterChart: ScatterChart,\n BubbleChart: BubbleChart,\n Timeline: Timeline,\n charts: {},\n configure: function (options) {\n for (var key in options) {\n if (options.hasOwnProperty(key)) {\n config[key] = options[key];\n }\n }\n },\n setDefaultOptions: function (opts) {\n Chartkick.options = opts;\n },\n eachChart: function (callback) {\n for (var chartId in Chartkick.charts) {\n if (Chartkick.charts.hasOwnProperty(chartId)) {\n callback(Chartkick.charts[chartId]);\n }\n }\n },\n config: config,\n options: {},\n adapters: adapters,\n addAdapter: addAdapter,\n use: function(adapter) {\n addAdapter(adapter);\n return Chartkick;\n }\n };\n\n // not ideal, but allows for simpler integration\n if (typeof window !== \"undefined\" && !window.Chartkick) {\n window.Chartkick = Chartkick;\n }\n\n // backwards compatibility for esm require\n Chartkick.default = Chartkick;\n\n return Chartkick;\n\n})));\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","/*\nTurbo 7.3.0\nCopyright © 2023 37signals LLC\n */\n(function () {\n if (window.Reflect === undefined ||\n window.customElements === undefined ||\n window.customElements.polyfillWrapFlushCallback) {\n return;\n }\n const BuiltInHTMLElement = HTMLElement;\n const wrapperForTheName = {\n HTMLElement: function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor);\n },\n };\n window.HTMLElement = wrapperForTheName[\"HTMLElement\"];\n HTMLElement.prototype = BuiltInHTMLElement.prototype;\n HTMLElement.prototype.constructor = HTMLElement;\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);\n})();\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2019 Javan Makhmali\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n(function(prototype) {\n if (typeof prototype.requestSubmit == \"function\") return\n\n prototype.requestSubmit = function(submitter) {\n if (submitter) {\n validateSubmitter(submitter, this);\n submitter.click();\n } else {\n submitter = document.createElement(\"input\");\n submitter.type = \"submit\";\n submitter.hidden = true;\n this.appendChild(submitter);\n submitter.click();\n this.removeChild(submitter);\n }\n };\n\n function validateSubmitter(submitter, form) {\n submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\");\n submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\");\n submitter.form == form || raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\");\n }\n\n function raise(errorConstructor, message, name) {\n throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name)\n }\n})(HTMLFormElement.prototype);\n\nconst submittersByForm = new WeakMap();\nfunction findSubmitterFromClickTarget(target) {\n const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n const candidate = element ? element.closest(\"input, button\") : null;\n return (candidate === null || candidate === void 0 ? void 0 : candidate.type) == \"submit\" ? candidate : null;\n}\nfunction clickCaptured(event) {\n const submitter = findSubmitterFromClickTarget(event.target);\n if (submitter && submitter.form) {\n submittersByForm.set(submitter.form, submitter);\n }\n}\n(function () {\n if (\"submitter\" in Event.prototype)\n return;\n let prototype = window.Event.prototype;\n if (\"SubmitEvent\" in window && /Apple Computer/.test(navigator.vendor)) {\n prototype = window.SubmitEvent.prototype;\n }\n else if (\"SubmitEvent\" in window) {\n return;\n }\n addEventListener(\"click\", clickCaptured, true);\n Object.defineProperty(prototype, \"submitter\", {\n get() {\n if (this.type == \"submit\" && this.target instanceof HTMLFormElement) {\n return submittersByForm.get(this.target);\n }\n },\n });\n})();\n\nvar FrameLoadingStyle;\n(function (FrameLoadingStyle) {\n FrameLoadingStyle[\"eager\"] = \"eager\";\n FrameLoadingStyle[\"lazy\"] = \"lazy\";\n})(FrameLoadingStyle || (FrameLoadingStyle = {}));\nclass FrameElement extends HTMLElement {\n static get observedAttributes() {\n return [\"disabled\", \"complete\", \"loading\", \"src\"];\n }\n constructor() {\n super();\n this.loaded = Promise.resolve();\n this.delegate = new FrameElement.delegateConstructor(this);\n }\n connectedCallback() {\n this.delegate.connect();\n }\n disconnectedCallback() {\n this.delegate.disconnect();\n }\n reload() {\n return this.delegate.sourceURLReloaded();\n }\n attributeChangedCallback(name) {\n if (name == \"loading\") {\n this.delegate.loadingStyleChanged();\n }\n else if (name == \"complete\") {\n this.delegate.completeChanged();\n }\n else if (name == \"src\") {\n this.delegate.sourceURLChanged();\n }\n else {\n this.delegate.disabledChanged();\n }\n }\n get src() {\n return this.getAttribute(\"src\");\n }\n set src(value) {\n if (value) {\n this.setAttribute(\"src\", value);\n }\n else {\n this.removeAttribute(\"src\");\n }\n }\n get loading() {\n return frameLoadingStyleFromString(this.getAttribute(\"loading\") || \"\");\n }\n set loading(value) {\n if (value) {\n this.setAttribute(\"loading\", value);\n }\n else {\n this.removeAttribute(\"loading\");\n }\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n if (value) {\n this.setAttribute(\"disabled\", \"\");\n }\n else {\n this.removeAttribute(\"disabled\");\n }\n }\n get autoscroll() {\n return this.hasAttribute(\"autoscroll\");\n }\n set autoscroll(value) {\n if (value) {\n this.setAttribute(\"autoscroll\", \"\");\n }\n else {\n this.removeAttribute(\"autoscroll\");\n }\n }\n get complete() {\n return !this.delegate.isLoading;\n }\n get isActive() {\n return this.ownerDocument === document && !this.isPreview;\n }\n get isPreview() {\n var _a, _b;\n return (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.hasAttribute(\"data-turbo-preview\");\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\nfunction expandURL(locatable) {\n return new URL(locatable.toString(), document.baseURI);\n}\nfunction getAnchor(url) {\n let anchorMatch;\n if (url.hash) {\n return url.hash.slice(1);\n }\n else if ((anchorMatch = url.href.match(/#(.*)$/))) {\n return anchorMatch[1];\n }\n}\nfunction getAction(form, submitter) {\n const action = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formaction\")) || form.getAttribute(\"action\") || form.action;\n return expandURL(action);\n}\nfunction getExtension(url) {\n return (getLastPathComponent(url).match(/\\.[^.]*$/) || [])[0] || \"\";\n}\nfunction isHTML(url) {\n return !!getExtension(url).match(/^(?:|\\.(?:htm|html|xhtml|php))$/);\n}\nfunction isPrefixedBy(baseURL, url) {\n const prefix = getPrefix(url);\n return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix);\n}\nfunction locationIsVisitable(location, rootLocation) {\n return isPrefixedBy(location, rootLocation) && isHTML(location);\n}\nfunction getRequestURL(url) {\n const anchor = getAnchor(url);\n return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href;\n}\nfunction toCacheKey(url) {\n return getRequestURL(url);\n}\nfunction urlsAreEqual(left, right) {\n return expandURL(left).href == expandURL(right).href;\n}\nfunction getPathComponents(url) {\n return url.pathname.split(\"/\").slice(1);\n}\nfunction getLastPathComponent(url) {\n return getPathComponents(url).slice(-1)[0];\n}\nfunction getPrefix(url) {\n return addTrailingSlash(url.origin + url.pathname);\n}\nfunction addTrailingSlash(value) {\n return value.endsWith(\"/\") ? value : value + \"/\";\n}\n\nclass FetchResponse {\n constructor(response) {\n this.response = response;\n }\n get succeeded() {\n return this.response.ok;\n }\n get failed() {\n return !this.succeeded;\n }\n get clientError() {\n return this.statusCode >= 400 && this.statusCode <= 499;\n }\n get serverError() {\n return this.statusCode >= 500 && this.statusCode <= 599;\n }\n get redirected() {\n return this.response.redirected;\n }\n get location() {\n return expandURL(this.response.url);\n }\n get isHTML() {\n return this.contentType && this.contentType.match(/^(?:text\\/([^\\s;,]+\\b)?html|application\\/xhtml\\+xml)\\b/);\n }\n get statusCode() {\n return this.response.status;\n }\n get contentType() {\n return this.header(\"Content-Type\");\n }\n get responseText() {\n return this.response.clone().text();\n }\n get responseHTML() {\n if (this.isHTML) {\n return this.response.clone().text();\n }\n else {\n return Promise.resolve(undefined);\n }\n }\n header(name) {\n return this.response.headers.get(name);\n }\n}\n\nfunction activateScriptElement(element) {\n if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n return element;\n }\n else {\n const createdScriptElement = document.createElement(\"script\");\n const cspNonce = getMetaContent(\"csp-nonce\");\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}\nfunction copyElementAttributes(destinationElement, sourceElement) {\n for (const { name, value } of sourceElement.attributes) {\n destinationElement.setAttribute(name, value);\n }\n}\nfunction createDocumentFragment(html) {\n const template = document.createElement(\"template\");\n template.innerHTML = html;\n return template.content;\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 if (target && target.isConnected) {\n target.dispatchEvent(event);\n }\n else {\n document.documentElement.dispatchEvent(event);\n }\n return event;\n}\nfunction nextAnimationFrame() {\n return new Promise((resolve) => requestAnimationFrame(() => resolve()));\n}\nfunction nextEventLoopTick() {\n return new Promise((resolve) => setTimeout(() => resolve(), 0));\n}\nfunction nextMicrotask() {\n return Promise.resolve();\n}\nfunction parseHTMLDocument(html = \"\") {\n return new DOMParser().parseFromString(html, \"text/html\");\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}\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}\nfunction uuid() {\n return Array.from({ length: 36 })\n .map((_, i) => {\n if (i == 8 || i == 13 || i == 18 || i == 23) {\n return \"-\";\n }\n else if (i == 14) {\n return \"4\";\n }\n else if (i == 19) {\n return (Math.floor(Math.random() * 4) + 8).toString(16);\n }\n else {\n return Math.floor(Math.random() * 15).toString(16);\n }\n })\n .join(\"\");\n}\nfunction getAttribute(attributeName, ...elements) {\n for (const value of elements.map((element) => element === null || element === void 0 ? void 0 : element.getAttribute(attributeName))) {\n if (typeof value == \"string\")\n return value;\n }\n return null;\n}\nfunction hasAttribute(attributeName, ...elements) {\n return elements.some((element) => element && element.hasAttribute(attributeName));\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}\nfunction clearBusyState(...elements) {\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.removeAttribute(\"busy\");\n }\n element.removeAttribute(\"aria-busy\");\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 element.addEventListener(\"load\", onComplete, { once: true });\n element.addEventListener(\"error\", onComplete, { once: true });\n setTimeout(resolve, timeoutInMilliseconds);\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}\nfunction isAction(action) {\n return action == \"advance\" || action == \"replace\" || action == \"restore\";\n}\nfunction getVisitAction(...elements) {\n const action = getAttribute(\"data-turbo-action\", ...elements);\n return isAction(action) ? action : null;\n}\nfunction getMetaElement(name) {\n return document.querySelector(`meta[name=\"${name}\"]`);\n}\nfunction getMetaContent(name) {\n const element = getMetaElement(name);\n return element && element.content;\n}\nfunction setMetaContent(name, content) {\n let element = getMetaElement(name);\n if (!element) {\n element = document.createElement(\"meta\");\n element.setAttribute(\"name\", name);\n document.head.appendChild(element);\n }\n element.setAttribute(\"content\", content);\n return element;\n}\nfunction findClosestRecursively(element, selector) {\n var _a;\n if (element instanceof Element) {\n return (element.closest(selector) ||\n findClosestRecursively(element.assignedSlot || ((_a = element.getRootNode()) === null || _a === void 0 ? void 0 : _a.host), selector));\n }\n}\n\nvar FetchMethod;\n(function (FetchMethod) {\n FetchMethod[FetchMethod[\"get\"] = 0] = \"get\";\n FetchMethod[FetchMethod[\"post\"] = 1] = \"post\";\n FetchMethod[FetchMethod[\"put\"] = 2] = \"put\";\n FetchMethod[FetchMethod[\"patch\"] = 3] = \"patch\";\n FetchMethod[FetchMethod[\"delete\"] = 4] = \"delete\";\n})(FetchMethod || (FetchMethod = {}));\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}\nclass FetchRequest {\n constructor(delegate, method, location, body = new URLSearchParams(), target = null) {\n this.abortController = new AbortController();\n this.resolveRequestPromise = (_value) => { };\n this.delegate = delegate;\n this.method = method;\n this.headers = this.defaultHeaders;\n this.body = body;\n this.url = location;\n this.target = target;\n }\n get location() {\n return this.url;\n }\n get params() {\n return this.url.searchParams;\n }\n get entries() {\n return this.body ? Array.from(this.body.entries()) : [];\n }\n cancel() {\n this.abortController.abort();\n }\n async perform() {\n const { fetchOptions } = this;\n this.delegate.prepareRequest(this);\n await this.allowRequestToBeIntercepted(fetchOptions);\n try {\n this.delegate.requestStarted(this);\n const response = await fetch(this.url.href, fetchOptions);\n return await this.receive(response);\n }\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 }\n finally {\n this.delegate.requestFinished(this);\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 }\n else if (fetchResponse.succeeded) {\n this.delegate.requestSucceededWithResponse(this, fetchResponse);\n }\n else {\n this.delegate.requestFailedWithResponse(this, fetchResponse);\n }\n return fetchResponse;\n }\n get fetchOptions() {\n var _a;\n return {\n method: FetchMethod[this.method].toUpperCase(),\n credentials: \"same-origin\",\n headers: this.headers,\n redirect: \"follow\",\n body: this.isSafe ? null : this.body,\n signal: this.abortSignal,\n referrer: (_a = this.delegate.referrer) === null || _a === void 0 ? void 0 : _a.href,\n };\n }\n get defaultHeaders() {\n return {\n Accept: \"text/html, application/xhtml+xml\",\n };\n }\n get isSafe() {\n return this.method === FetchMethod.get;\n }\n get abortSignal() {\n return this.abortController.signal;\n }\n acceptResponseType(mimeType) {\n this.headers[\"Accept\"] = [mimeType, this.headers[\"Accept\"]].join(\", \");\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 if (event.defaultPrevented)\n await requestInterception;\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 return !event.defaultPrevented;\n }\n}\n\nclass AppearanceObserver {\n constructor(delegate, element) {\n this.started = false;\n this.intersect = (entries) => {\n const lastEntry = entries.slice(-1)[0];\n if (lastEntry === null || lastEntry === void 0 ? void 0 : lastEntry.isIntersecting) {\n this.delegate.elementAppearedInViewport(this.element);\n }\n };\n this.delegate = delegate;\n this.element = element;\n this.intersectionObserver = new IntersectionObserver(this.intersect);\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.intersectionObserver.observe(this.element);\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.intersectionObserver.unobserve(this.element);\n }\n }\n}\n\nclass StreamMessage {\n static wrap(message) {\n if (typeof message == \"string\") {\n return new this(createDocumentFragment(message));\n }\n else {\n return message;\n }\n }\n constructor(fragment) {\n this.fragment = importStreamElements(fragment);\n }\n}\nStreamMessage.contentType = \"text/vnd.turbo-stream.html\";\nfunction importStreamElements(fragment) {\n for (const element of fragment.querySelectorAll(\"turbo-stream\")) {\n const streamElement = document.importNode(element, true);\n for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll(\"script\")) {\n inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));\n }\n element.replaceWith(streamElement);\n }\n return fragment;\n}\n\nvar FormSubmissionState;\n(function (FormSubmissionState) {\n FormSubmissionState[FormSubmissionState[\"initialized\"] = 0] = \"initialized\";\n FormSubmissionState[FormSubmissionState[\"requesting\"] = 1] = \"requesting\";\n FormSubmissionState[FormSubmissionState[\"waiting\"] = 2] = \"waiting\";\n FormSubmissionState[FormSubmissionState[\"receiving\"] = 3] = \"receiving\";\n FormSubmissionState[FormSubmissionState[\"stopping\"] = 4] = \"stopping\";\n FormSubmissionState[FormSubmissionState[\"stopped\"] = 5] = \"stopped\";\n})(FormSubmissionState || (FormSubmissionState = {}));\nvar FormEnctype;\n(function (FormEnctype) {\n FormEnctype[\"urlEncoded\"] = \"application/x-www-form-urlencoded\";\n FormEnctype[\"multipart\"] = \"multipart/form-data\";\n FormEnctype[\"plain\"] = \"text/plain\";\n})(FormEnctype || (FormEnctype = {}));\nfunction formEnctypeFromString(encoding) {\n switch (encoding.toLowerCase()) {\n case FormEnctype.multipart:\n return FormEnctype.multipart;\n case FormEnctype.plain:\n return FormEnctype.plain;\n default:\n return FormEnctype.urlEncoded;\n }\n}\nclass FormSubmission {\n static confirmMethod(message, _element, _submitter) {\n return Promise.resolve(confirm(message));\n }\n constructor(delegate, formElement, submitter, mustRedirect = false) {\n this.state = FormSubmissionState.initialized;\n this.delegate = delegate;\n this.formElement = formElement;\n this.submitter = submitter;\n this.formData = buildFormData(formElement, submitter);\n this.location = expandURL(this.action);\n if (this.method == FetchMethod.get) {\n mergeFormDataEntries(this.location, [...this.body.entries()]);\n }\n this.fetchRequest = new FetchRequest(this, this.method, this.location, this.body, this.formElement);\n this.mustRedirect = mustRedirect;\n }\n get method() {\n var _a;\n const method = ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formmethod\")) || this.formElement.getAttribute(\"method\") || \"\";\n return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get;\n }\n get action() {\n var _a;\n const formElementAction = typeof this.formElement.action === \"string\" ? this.formElement.action : null;\n if ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.hasAttribute(\"formaction\")) {\n return this.submitter.getAttribute(\"formaction\") || \"\";\n }\n else {\n return this.formElement.getAttribute(\"action\") || formElementAction || \"\";\n }\n }\n get body() {\n if (this.enctype == FormEnctype.urlEncoded || this.method == FetchMethod.get) {\n return new URLSearchParams(this.stringFormData);\n }\n else {\n return this.formData;\n }\n }\n get enctype() {\n var _a;\n return formEnctypeFromString(((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formenctype\")) || this.formElement.enctype);\n }\n get isSafe() {\n return this.fetchRequest.isSafe;\n }\n get stringFormData() {\n return [...this.formData].reduce((entries, [name, value]) => {\n return entries.concat(typeof value == \"string\" ? [[name, value]] : []);\n }, []);\n }\n async start() {\n const { initialized, requesting } = FormSubmissionState;\n const confirmationMessage = getAttribute(\"data-turbo-confirm\", this.submitter, this.formElement);\n if (typeof confirmationMessage === \"string\") {\n const answer = await FormSubmission.confirmMethod(confirmationMessage, this.formElement, this.submitter);\n if (!answer) {\n return;\n }\n }\n if (this.state == initialized) {\n this.state = requesting;\n return this.fetchRequest.perform();\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 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 if (this.requestAcceptsTurboStreamResponse(request)) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n requestStarted(_request) {\n var _a;\n this.state = FormSubmissionState.waiting;\n (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.setAttribute(\"disabled\", \"\");\n this.setSubmitsWith();\n dispatch(\"turbo:submit-start\", {\n target: this.formElement,\n detail: { formSubmission: this },\n });\n this.delegate.formSubmissionStarted(this);\n }\n requestPreventedHandlingResponse(request, response) {\n this.result = { success: response.succeeded, fetchResponse: response };\n }\n requestSucceededWithResponse(request, response) {\n if (response.clientError || response.serverError) {\n this.delegate.formSubmissionFailedWithResponse(this, response);\n }\n else 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 }\n else {\n this.state = FormSubmissionState.receiving;\n this.result = { success: true, fetchResponse: response };\n this.delegate.formSubmissionSucceededWithResponse(this, response);\n }\n }\n requestFailedWithResponse(request, response) {\n this.result = { success: false, fetchResponse: response };\n this.delegate.formSubmissionFailedWithResponse(this, response);\n }\n requestErrored(request, error) {\n this.result = { success: false, error };\n this.delegate.formSubmissionErrored(this, error);\n }\n requestFinished(_request) {\n var _a;\n this.state = FormSubmissionState.stopped;\n (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.removeAttribute(\"disabled\");\n this.resetSubmitterText();\n dispatch(\"turbo:submit-end\", {\n target: this.formElement,\n detail: Object.assign({ formSubmission: this }, this.result),\n });\n this.delegate.formSubmissionFinished(this);\n }\n setSubmitsWith() {\n if (!this.submitter || !this.submitsWith)\n return;\n if (this.submitter.matches(\"button\")) {\n this.originalSubmitText = this.submitter.innerHTML;\n this.submitter.innerHTML = this.submitsWith;\n }\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 resetSubmitterText() {\n if (!this.submitter || !this.originalSubmitText)\n return;\n if (this.submitter.matches(\"button\")) {\n this.submitter.innerHTML = this.originalSubmitText;\n }\n else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n input.value = this.originalSubmitText;\n }\n }\n requestMustRedirect(request) {\n return !request.isSafe && this.mustRedirect;\n }\n requestAcceptsTurboStreamResponse(request) {\n return !request.isSafe || hasAttribute(\"data-turbo-stream\", this.submitter, this.formElement);\n }\n get submitsWith() {\n var _a;\n return (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"data-turbo-submits-with\");\n }\n}\nfunction buildFormData(formElement, submitter) {\n const formData = new FormData(formElement);\n const name = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"name\");\n const value = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"value\");\n if (name) {\n formData.append(name, value || \"\");\n }\n return formData;\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}\nfunction responseSucceededWithoutRedirect(response) {\n return response.statusCode == 200 && !response.redirected;\n}\nfunction mergeFormDataEntries(url, entries) {\n const searchParams = new URLSearchParams();\n for (const [name, value] of entries) {\n if (value instanceof File)\n continue;\n searchParams.append(name, value);\n }\n url.search = searchParams.toString();\n return url;\n}\n\nclass Snapshot {\n constructor(element) {\n this.element = element;\n }\n get activeElement() {\n return this.element.ownerDocument.activeElement;\n }\n get children() {\n return [...this.element.children];\n }\n hasAnchor(anchor) {\n return this.getElementForAnchor(anchor) != null;\n }\n getElementForAnchor(anchor) {\n return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null;\n }\n get isConnected() {\n return this.element.isConnected;\n }\n get firstAutofocusableElement() {\n const inertDisabledOrHidden = \"[inert], :disabled, [hidden], details:not([open]), dialog:not([open])\";\n for (const element of this.element.querySelectorAll(\"[autofocus]\")) {\n if (element.closest(inertDisabledOrHidden) == null)\n return element;\n else\n continue;\n }\n return null;\n }\n get permanentElements() {\n return queryPermanentElementsAll(this.element);\n }\n getPermanentElementById(id) {\n return getPermanentElementById(this.element, id);\n }\n getPermanentElementMapForSnapshot(snapshot) {\n const permanentElementMap = {};\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 return permanentElementMap;\n }\n}\nfunction getPermanentElementById(node, id) {\n return node.querySelector(`#${id}[data-turbo-permanent]`);\n}\nfunction queryPermanentElementsAll(node) {\n return node.querySelectorAll(\"[id][data-turbo-permanent]\");\n}\n\nclass FormSubmitObserver {\n constructor(delegate, eventTarget) {\n this.started = false;\n this.submitCaptured = () => {\n this.eventTarget.removeEventListener(\"submit\", this.submitBubbled, false);\n this.eventTarget.addEventListener(\"submit\", this.submitBubbled, false);\n };\n this.submitBubbled = ((event) => {\n if (!event.defaultPrevented) {\n const form = event.target instanceof HTMLFormElement ? event.target : undefined;\n const submitter = event.submitter || undefined;\n if (form &&\n submissionDoesNotDismissDialog(form, submitter) &&\n submissionDoesNotTargetIFrame(form, submitter) &&\n this.delegate.willSubmitForm(form, submitter)) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.delegate.formSubmitted(form, submitter);\n }\n }\n });\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"submit\", this.submitCaptured, true);\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"submit\", this.submitCaptured, true);\n this.started = false;\n }\n }\n}\nfunction submissionDoesNotDismissDialog(form, submitter) {\n const method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formmethod\")) || form.getAttribute(\"method\");\n return method != \"dialog\";\n}\nfunction submissionDoesNotTargetIFrame(form, submitter) {\n if ((submitter === null || submitter === void 0 ? void 0 : submitter.hasAttribute(\"formtarget\")) || form.hasAttribute(\"target\")) {\n const target = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formtarget\")) || form.target;\n for (const element of document.getElementsByName(target)) {\n if (element instanceof HTMLIFrameElement)\n return false;\n }\n return true;\n }\n else {\n return true;\n }\n}\n\nclass View {\n constructor(delegate, element) {\n this.resolveRenderPromise = (_value) => { };\n this.resolveInterceptionPromise = (_value) => { };\n this.delegate = delegate;\n this.element = element;\n }\n scrollToAnchor(anchor) {\n const element = this.snapshot.getElementForAnchor(anchor);\n if (element) {\n this.scrollToElement(element);\n this.focusElement(element);\n }\n else {\n this.scrollToPosition({ x: 0, y: 0 });\n }\n }\n scrollToAnchorFromLocation(location) {\n this.scrollToAnchor(getAnchor(location));\n }\n scrollToElement(element) {\n element.scrollIntoView();\n }\n focusElement(element) {\n if (element instanceof HTMLElement) {\n if (element.hasAttribute(\"tabindex\")) {\n element.focus();\n }\n else {\n element.setAttribute(\"tabindex\", \"-1\");\n element.focus();\n element.removeAttribute(\"tabindex\");\n }\n }\n }\n scrollToPosition({ x, y }) {\n this.scrollRoot.scrollTo(x, y);\n }\n scrollToTop() {\n this.scrollToPosition({ x: 0, y: 0 });\n }\n get scrollRoot() {\n return window;\n }\n async render(renderer) {\n const { isPreview, shouldRender, newSnapshot: snapshot } = renderer;\n if (shouldRender) {\n try {\n this.renderPromise = new Promise((resolve) => (this.resolveRenderPromise = resolve));\n this.renderer = renderer;\n await this.prepareToRenderSnapshot(renderer);\n const renderInterception = new Promise((resolve) => (this.resolveInterceptionPromise = resolve));\n const options = { resume: this.resolveInterceptionPromise, render: this.renderer.renderElement };\n const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);\n if (!immediateRender)\n await renderInterception;\n await this.renderSnapshot(renderer);\n this.delegate.viewRenderedSnapshot(snapshot, isPreview);\n this.delegate.preloadOnLoadLinksForView(this.element);\n this.finishRenderingSnapshot(renderer);\n }\n finally {\n delete this.renderer;\n this.resolveRenderPromise(undefined);\n delete this.renderPromise;\n }\n }\n else {\n this.invalidate(renderer.reloadReason);\n }\n }\n invalidate(reason) {\n this.delegate.viewInvalidated(reason);\n }\n async prepareToRenderSnapshot(renderer) {\n this.markAsPreview(renderer.isPreview);\n await renderer.prepareToRender();\n }\n markAsPreview(isPreview) {\n if (isPreview) {\n this.element.setAttribute(\"data-turbo-preview\", \"\");\n }\n else {\n this.element.removeAttribute(\"data-turbo-preview\");\n }\n }\n async renderSnapshot(renderer) {\n await renderer.render();\n }\n finishRenderingSnapshot(renderer) {\n renderer.finishRendering();\n }\n}\n\nclass FrameView extends View {\n missing() {\n this.element.innerHTML = `Content missing`;\n }\n get snapshot() {\n return new Snapshot(this.element);\n }\n}\n\nclass LinkInterceptor {\n constructor(delegate, element) {\n this.clickBubbled = (event) => {\n if (this.respondsToEventTarget(event.target)) {\n this.clickEvent = event;\n }\n else {\n delete this.clickEvent;\n }\n };\n this.linkClicked = ((event) => {\n if (this.clickEvent && this.respondsToEventTarget(event.target) && event.target instanceof Element) {\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 this.willVisit = ((_event) => {\n delete this.clickEvent;\n });\n this.delegate = delegate;\n this.element = element;\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 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 respondsToEventTarget(target) {\n const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n return element && element.closest(\"turbo-frame, html\") == this.element;\n }\n}\n\nclass LinkClickObserver {\n constructor(delegate, eventTarget) {\n this.started = false;\n this.clickCaptured = () => {\n this.eventTarget.removeEventListener(\"click\", this.clickBubbled, false);\n this.eventTarget.addEventListener(\"click\", this.clickBubbled, false);\n };\n this.clickBubbled = (event) => {\n if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {\n const target = (event.composedPath && event.composedPath()[0]) || event.target;\n const link = this.findLinkFromClickTarget(target);\n if (link && doesNotTargetIFrame(link)) {\n const location = this.getLocationForLink(link);\n if (this.delegate.willFollowLinkToLocation(link, location, event)) {\n event.preventDefault();\n this.delegate.followedLinkToLocation(link, location);\n }\n }\n }\n };\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"click\", this.clickCaptured, true);\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"click\", this.clickCaptured, true);\n this.started = false;\n }\n }\n clickEventIsSignificant(event) {\n return !((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 findLinkFromClickTarget(target) {\n return findClosestRecursively(target, \"a[href]:not([target^=_]):not([download])\");\n }\n getLocationForLink(link) {\n return expandURL(link.getAttribute(\"href\") || \"\");\n }\n}\nfunction doesNotTargetIFrame(anchor) {\n if (anchor.hasAttribute(\"target\")) {\n for (const element of document.getElementsByName(anchor.target)) {\n if (element instanceof HTMLIFrameElement)\n return false;\n }\n return true;\n }\n else {\n return true;\n }\n}\n\nclass FormLinkClickObserver {\n constructor(delegate, element) {\n this.delegate = delegate;\n this.linkInterceptor = new LinkClickObserver(this, element);\n }\n start() {\n this.linkInterceptor.start();\n }\n stop() {\n this.linkInterceptor.stop();\n }\n willFollowLinkToLocation(link, location, originalEvent) {\n return (this.delegate.willSubmitFormLinkToLocation(link, location, originalEvent) &&\n link.hasAttribute(\"data-turbo-method\"));\n }\n followedLinkToLocation(link, location) {\n const form = document.createElement(\"form\");\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 const action = Object.assign(location, { search: \"\" });\n form.setAttribute(\"data-turbo\", \"true\");\n form.setAttribute(\"action\", action.href);\n form.setAttribute(\"hidden\", \"\");\n const method = link.getAttribute(\"data-turbo-method\");\n if (method)\n form.setAttribute(\"method\", method);\n const turboFrame = link.getAttribute(\"data-turbo-frame\");\n if (turboFrame)\n form.setAttribute(\"data-turbo-frame\", turboFrame);\n const turboAction = getVisitAction(link);\n if (turboAction)\n form.setAttribute(\"data-turbo-action\", turboAction);\n const turboConfirm = link.getAttribute(\"data-turbo-confirm\");\n if (turboConfirm)\n form.setAttribute(\"data-turbo-confirm\", turboConfirm);\n const turboStream = link.hasAttribute(\"data-turbo-stream\");\n if (turboStream)\n form.setAttribute(\"data-turbo-stream\", \"\");\n this.delegate.submittedFormLinkToLocation(link, location, form);\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 constructor(delegate, permanentElementMap) {\n this.delegate = delegate;\n this.permanentElementMap = permanentElementMap;\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 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 replaceNewPermanentElementWithPlaceholder(permanentElement) {\n const placeholder = createPlaceholderForPermanentElement(permanentElement);\n permanentElement.replaceWith(placeholder);\n }\n replaceCurrentPermanentElementWithClone(permanentElement) {\n const clone = permanentElement.cloneNode(true);\n permanentElement.replaceWith(clone);\n }\n replacePlaceholderWithPermanentElement(permanentElement) {\n const placeholder = this.getPlaceholderById(permanentElement.id);\n placeholder === null || placeholder === void 0 ? void 0 : placeholder.replaceWith(permanentElement);\n }\n getPlaceholderById(id) {\n return this.placeholders.find((element) => element.content == id);\n }\n get placeholders() {\n return [...document.querySelectorAll(\"meta[name=turbo-permanent-placeholder][content]\")];\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 constructor(currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n this.activeElement = null;\n this.currentSnapshot = currentSnapshot;\n this.newSnapshot = newSnapshot;\n this.isPreview = isPreview;\n this.willRender = willRender;\n this.renderElement = renderElement;\n this.promise = new Promise((resolve, reject) => (this.resolvingFunctions = { resolve, reject }));\n }\n get shouldRender() {\n return true;\n }\n get reloadReason() {\n return;\n }\n prepareToRender() {\n return;\n }\n finishRendering() {\n if (this.resolvingFunctions) {\n this.resolvingFunctions.resolve();\n delete this.resolvingFunctions;\n }\n }\n async preservingPermanentElements(callback) {\n await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback);\n }\n focusFirstAutofocusableElement() {\n const element = this.connectedSnapshot.firstAutofocusableElement;\n if (elementIsFocusable(element)) {\n element.focus();\n }\n }\n enteringBardo(currentPermanentElement) {\n if (this.activeElement)\n return;\n if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {\n this.activeElement = this.currentSnapshot.activeElement;\n }\n }\n leavingBardo(currentPermanentElement) {\n if (currentPermanentElement.contains(this.activeElement) && this.activeElement instanceof HTMLElement) {\n this.activeElement.focus();\n this.activeElement = null;\n }\n }\n get connectedSnapshot() {\n return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot;\n }\n get currentElement() {\n return this.currentSnapshot.element;\n }\n get newElement() {\n return this.newSnapshot.element;\n }\n get permanentElementMap() {\n return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot);\n }\n}\nfunction elementIsFocusable(element) {\n return element && typeof element.focus == \"function\";\n}\n\nclass FrameRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n var _a;\n const destinationRange = document.createRange();\n destinationRange.selectNodeContents(currentElement);\n destinationRange.deleteContents();\n const frameElement = newElement;\n const sourceRange = (_a = frameElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.createRange();\n if (sourceRange) {\n sourceRange.selectNodeContents(frameElement);\n currentElement.appendChild(sourceRange.extractContents());\n }\n }\n constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);\n this.delegate = delegate;\n }\n get shouldRender() {\n return true;\n }\n async render() {\n await nextAnimationFrame();\n this.preservingPermanentElements(() => {\n this.loadFrameElement();\n });\n this.scrollFrameIntoView();\n await nextAnimationFrame();\n this.focusFirstAutofocusableElement();\n await nextAnimationFrame();\n this.activateScriptElements();\n }\n loadFrameElement() {\n this.delegate.willRenderFrame(this.currentElement, this.newElement);\n this.renderElement(this.currentElement, this.newElement);\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 if (element) {\n element.scrollIntoView({ block, behavior });\n return true;\n }\n }\n return false;\n }\n activateScriptElements() {\n for (const inertScriptElement of this.newScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n get newScriptElements() {\n return this.currentElement.querySelectorAll(\"script\");\n }\n}\nfunction readScrollLogicalPosition(value, defaultValue) {\n if (value == \"end\" || value == \"start\" || value == \"center\" || value == \"nearest\") {\n return value;\n }\n else {\n return defaultValue;\n }\n}\nfunction readScrollBehavior(value, defaultValue) {\n if (value == \"auto\" || value == \"smooth\") {\n return value;\n }\n else {\n return defaultValue;\n }\n}\n\nclass ProgressBar {\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 constructor() {\n this.hiding = false;\n this.value = 0;\n this.visible = false;\n this.trickle = () => {\n this.setValue(this.value + Math.random() / 100);\n };\n this.stylesheetElement = this.createStylesheetElement();\n this.progressElement = this.createProgressElement();\n this.installStylesheetElement();\n this.setValue(0);\n }\n show() {\n if (!this.visible) {\n this.visible = true;\n this.installProgressElement();\n this.startTrickling();\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 setValue(value) {\n this.value = value;\n this.refresh();\n }\n installStylesheetElement() {\n document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\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 fadeProgressElement(callback) {\n this.progressElement.style.opacity = \"0\";\n setTimeout(callback, ProgressBar.animationDuration * 1.5);\n }\n uninstallProgressElement() {\n if (this.progressElement.parentNode) {\n document.documentElement.removeChild(this.progressElement);\n }\n }\n startTrickling() {\n if (!this.trickleInterval) {\n this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);\n }\n }\n stopTrickling() {\n window.clearInterval(this.trickleInterval);\n delete this.trickleInterval;\n }\n refresh() {\n requestAnimationFrame(() => {\n this.progressElement.style.width = `${10 + this.value * 90}%`;\n });\n }\n createStylesheetElement() {\n const element = document.createElement(\"style\");\n element.type = \"text/css\";\n element.textContent = ProgressBar.defaultCSS;\n if (this.cspNonce) {\n element.nonce = this.cspNonce;\n }\n return element;\n }\n createProgressElement() {\n const element = document.createElement(\"div\");\n element.className = \"turbo-progress-bar\";\n return element;\n }\n get cspNonce() {\n return getMetaContent(\"csp-nonce\");\n }\n}\nProgressBar.animationDuration = 300;\n\nclass HeadSnapshot extends Snapshot {\n constructor() {\n super(...arguments);\n this.detailsByOuterHTML = this.children\n .filter((element) => !elementIsNoscript(element))\n .map((element) => elementWithoutNonce(element))\n .reduce((result, element) => {\n const { outerHTML } = element;\n const details = outerHTML in result\n ? result[outerHTML]\n : {\n type: elementType(element),\n tracked: elementIsTracked(element),\n elements: [],\n };\n return Object.assign(Object.assign({}, result), { [outerHTML]: Object.assign(Object.assign({}, details), { elements: [...details.elements, element] }) });\n }, {});\n }\n get trackedElementSignature() {\n return Object.keys(this.detailsByOuterHTML)\n .filter((outerHTML) => this.detailsByOuterHTML[outerHTML].tracked)\n .join(\"\");\n }\n getScriptElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"script\", snapshot);\n }\n getStylesheetElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"stylesheet\", snapshot);\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 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 }\n else if (elements.length > 1) {\n return [...result, ...elements.slice(1)];\n }\n else {\n return result;\n }\n }, []);\n }\n getMetaValue(name) {\n const element = this.findMetaElementByName(name);\n return element ? element.getAttribute(\"content\") : null;\n }\n findMetaElementByName(name) {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const { elements: [element], } = this.detailsByOuterHTML[outerHTML];\n return elementIsMetaElementWithName(element, name) ? element : result;\n }, undefined);\n }\n}\nfunction elementType(element) {\n if (elementIsScript(element)) {\n return \"script\";\n }\n else if (elementIsStylesheet(element)) {\n return \"stylesheet\";\n }\n}\nfunction elementIsTracked(element) {\n return element.getAttribute(\"data-turbo-track\") == \"reload\";\n}\nfunction elementIsScript(element) {\n const tagName = element.localName;\n return tagName == \"script\";\n}\nfunction elementIsNoscript(element) {\n const tagName = element.localName;\n return tagName == \"noscript\";\n}\nfunction elementIsStylesheet(element) {\n const tagName = element.localName;\n return tagName == \"style\" || (tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\");\n}\nfunction elementIsMetaElementWithName(element, name) {\n const tagName = element.localName;\n return tagName == \"meta\" && element.getAttribute(\"name\") == name;\n}\nfunction elementWithoutNonce(element) {\n if (element.hasAttribute(\"nonce\")) {\n element.setAttribute(\"nonce\", \"\");\n }\n return element;\n}\n\nclass PageSnapshot extends Snapshot {\n static fromHTMLString(html = \"\") {\n return this.fromDocument(parseHTMLDocument(html));\n }\n static fromElement(element) {\n return this.fromDocument(element.ownerDocument);\n }\n static fromDocument({ head, body }) {\n return new this(body, new HeadSnapshot(head));\n }\n constructor(element, headSnapshot) {\n super(element);\n this.headSnapshot = headSnapshot;\n }\n clone() {\n const clonedElement = this.element.cloneNode(true);\n const selectElements = this.element.querySelectorAll(\"select\");\n const clonedSelectElements = clonedElement.querySelectorAll(\"select\");\n for (const [index, source] of selectElements.entries()) {\n const clone = clonedSelectElements[index];\n for (const option of clone.selectedOptions)\n option.selected = false;\n for (const option of source.selectedOptions)\n clone.options[option.index].selected = true;\n }\n for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type=\"password\"]')) {\n clonedPasswordInput.value = \"\";\n }\n return new PageSnapshot(clonedElement, this.headSnapshot);\n }\n get headElement() {\n return this.headSnapshot.element;\n }\n get rootLocation() {\n var _a;\n const root = (_a = this.getSetting(\"root\")) !== null && _a !== void 0 ? _a : \"/\";\n return expandURL(root);\n }\n get cacheControlValue() {\n return this.getSetting(\"cache-control\");\n }\n get isPreviewable() {\n return this.cacheControlValue != \"no-preview\";\n }\n get isCacheable() {\n return this.cacheControlValue != \"no-cache\";\n }\n get isVisitable() {\n return this.getSetting(\"visit-control\") != \"reload\";\n }\n getSetting(name) {\n return this.headSnapshot.getMetaValue(`turbo-${name}`);\n }\n}\n\nvar TimingMetric;\n(function (TimingMetric) {\n TimingMetric[\"visitStart\"] = \"visitStart\";\n TimingMetric[\"requestStart\"] = \"requestStart\";\n TimingMetric[\"requestEnd\"] = \"requestEnd\";\n TimingMetric[\"visitEnd\"] = \"visitEnd\";\n})(TimingMetric || (TimingMetric = {}));\nvar VisitState;\n(function (VisitState) {\n VisitState[\"initialized\"] = \"initialized\";\n VisitState[\"started\"] = \"started\";\n VisitState[\"canceled\"] = \"canceled\";\n VisitState[\"failed\"] = \"failed\";\n VisitState[\"completed\"] = \"completed\";\n})(VisitState || (VisitState = {}));\nconst defaultOptions = {\n action: \"advance\",\n historyChanged: false,\n visitCachedSnapshot: () => { },\n willRender: true,\n updateHistory: true,\n shouldCacheSnapshot: true,\n acceptsStreamResponse: false,\n};\nvar SystemStatusCode;\n(function (SystemStatusCode) {\n SystemStatusCode[SystemStatusCode[\"networkFailure\"] = 0] = \"networkFailure\";\n SystemStatusCode[SystemStatusCode[\"timeoutFailure\"] = -1] = \"timeoutFailure\";\n SystemStatusCode[SystemStatusCode[\"contentTypeMismatch\"] = -2] = \"contentTypeMismatch\";\n})(SystemStatusCode || (SystemStatusCode = {}));\nclass Visit {\n constructor(delegate, location, restorationIdentifier, options = {}) {\n this.identifier = uuid();\n this.timingMetrics = {};\n this.followedRedirect = false;\n this.historyChanged = false;\n this.scrolled = false;\n this.shouldCacheSnapshot = true;\n this.acceptsStreamResponse = false;\n this.snapshotCached = false;\n this.state = VisitState.initialized;\n this.delegate = delegate;\n this.location = location;\n this.restorationIdentifier = restorationIdentifier || uuid();\n const { action, historyChanged, referrer, snapshot, snapshotHTML, response, visitCachedSnapshot, willRender, updateHistory, shouldCacheSnapshot, acceptsStreamResponse, } = Object.assign(Object.assign({}, defaultOptions), options);\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.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);\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 }\n get adapter() {\n return this.delegate.adapter;\n }\n get view() {\n return this.delegate.view;\n }\n get history() {\n return this.delegate.history;\n }\n get restorationData() {\n return this.history.getRestorationDataForIdentifier(this.restorationIdentifier);\n }\n get silent() {\n return this.isSamePage;\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 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 complete() {\n if (this.state == VisitState.started) {\n this.recordTimingMetric(TimingMetric.visitEnd);\n this.state = VisitState.completed;\n this.followRedirect();\n if (!this.followedRedirect) {\n this.adapter.visitCompleted(this);\n this.delegate.visitCompleted(this);\n }\n }\n }\n fail() {\n if (this.state == VisitState.started) {\n this.state = VisitState.failed;\n this.adapter.visitFailed(this);\n }\n }\n changeHistory() {\n var _a;\n if (!this.historyChanged && this.updateHistory) {\n const actionForHistory = this.location.href === ((_a = this.referrer) === null || _a === void 0 ? void 0 : _a.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 issueRequest() {\n if (this.hasPreloadedResponse()) {\n this.simulateRequest();\n }\n else if (this.shouldIssueRequest() && !this.request) {\n this.request = new FetchRequest(this, FetchMethod.get, this.location);\n this.request.perform();\n }\n }\n simulateRequest() {\n if (this.response) {\n this.startRequest();\n this.recordResponse();\n this.finishRequest();\n }\n }\n startRequest() {\n this.recordTimingMetric(TimingMetric.requestStart);\n this.adapter.visitRequestStarted(this);\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 }\n else {\n this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n }\n }\n }\n finishRequest() {\n this.recordTimingMetric(TimingMetric.requestEnd);\n this.adapter.visitRequestFinished(this);\n }\n loadResponse() {\n if (this.response) {\n const { statusCode, responseHTML } = this.response;\n this.render(async () => {\n if (this.shouldCacheSnapshot)\n this.cacheSnapshot();\n if (this.view.renderPromise)\n await this.view.renderPromise;\n if (isSuccessful(statusCode) && responseHTML != null) {\n await this.view.renderPage(PageSnapshot.fromHTMLString(responseHTML), false, this.willRender, this);\n this.performScroll();\n this.adapter.visitRendered(this);\n this.complete();\n }\n else {\n await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);\n this.adapter.visitRendered(this);\n this.fail();\n }\n });\n }\n }\n getCachedSnapshot() {\n const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();\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 getPreloadedSnapshot() {\n if (this.snapshotHTML) {\n return PageSnapshot.fromHTMLString(this.snapshotHTML);\n }\n }\n hasCachedSnapshot() {\n return this.getCachedSnapshot() != null;\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.isSamePage) {\n this.adapter.visitRendered(this);\n }\n else {\n if (this.view.renderPromise)\n await this.view.renderPromise;\n await this.view.renderPage(snapshot, isPreview, this.willRender, this);\n this.performScroll();\n this.adapter.visitRendered(this);\n if (!isPreview) {\n this.complete();\n }\n }\n });\n }\n }\n followRedirect() {\n var _a;\n if (this.redirectedToLocation && !this.followedRedirect && ((_a = this.response) === null || _a === void 0 ? void 0 : _a.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 goToSamePageAnchor() {\n if (this.isSamePage) {\n this.render(async () => {\n this.cacheSnapshot();\n this.performScroll();\n this.changeHistory();\n this.adapter.visitRendered(this);\n });\n }\n }\n prepareRequest(request) {\n if (this.acceptsStreamResponse) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n requestStarted() {\n this.startRequest();\n }\n requestPreventedHandlingResponse(_request, _response) { }\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 }\n else {\n this.redirectedToLocation = response.redirected ? response.location : undefined;\n this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\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 }\n else {\n this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n }\n }\n requestErrored(_request, _error) {\n this.recordResponse({\n statusCode: SystemStatusCode.networkFailure,\n redirected: false,\n });\n }\n requestFinished() {\n this.finishRequest();\n }\n performScroll() {\n if (!this.scrolled && !this.view.forceReloaded) {\n if (this.action == \"restore\") {\n this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();\n }\n else {\n this.scrollToAnchor() || this.view.scrollToTop();\n }\n if (this.isSamePage) {\n this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);\n }\n this.scrolled = true;\n }\n }\n scrollToRestoredPosition() {\n const { scrollPosition } = this.restorationData;\n if (scrollPosition) {\n this.view.scrollToPosition(scrollPosition);\n return true;\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 recordTimingMetric(metric) {\n this.timingMetrics[metric] = new Date().getTime();\n }\n getTimingMetrics() {\n return Object.assign({}, this.timingMetrics);\n }\n 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 hasPreloadedResponse() {\n return typeof this.response == \"object\";\n }\n shouldIssueRequest() {\n if (this.isSamePage) {\n return false;\n }\n else if (this.action == \"restore\") {\n return !this.hasCachedSnapshot();\n }\n else {\n return this.willRender;\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 async render(callback) {\n this.cancelRender();\n await new Promise((resolve) => {\n this.frame = requestAnimationFrame(() => resolve());\n });\n await callback();\n delete this.frame;\n }\n cancelRender() {\n if (this.frame) {\n cancelAnimationFrame(this.frame);\n delete this.frame;\n }\n }\n}\nfunction isSuccessful(statusCode) {\n return statusCode >= 200 && statusCode < 300;\n}\n\nclass BrowserAdapter {\n constructor(session) {\n this.progressBar = new ProgressBar();\n this.showProgressBar = () => {\n this.progressBar.show();\n };\n this.session = session;\n }\n visitProposedToLocation(location, options) {\n this.navigator.startVisit(location, (options === null || options === void 0 ? void 0 : options.restorationIdentifier) || uuid(), options);\n }\n visitStarted(visit) {\n this.location = visit.location;\n visit.loadCachedSnapshot();\n visit.issueRequest();\n visit.goToSamePageAnchor();\n }\n visitRequestStarted(visit) {\n this.progressBar.setValue(0);\n if (visit.hasCachedSnapshot() || visit.action != \"restore\") {\n this.showVisitProgressBarAfterDelay();\n }\n else {\n this.showProgressBar();\n }\n }\n visitRequestCompleted(visit) {\n visit.loadResponse();\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 visitRequestFinished(_visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n visitCompleted(_visit) { }\n pageInvalidated(reason) {\n this.reload(reason);\n }\n visitFailed(_visit) { }\n visitRendered(_visit) { }\n formSubmissionStarted(_formSubmission) {\n this.progressBar.setValue(0);\n this.showFormProgressBarAfterDelay();\n }\n formSubmissionFinished(_formSubmission) {\n this.progressBar.setValue(1);\n this.hideFormProgressBar();\n }\n showVisitProgressBarAfterDelay() {\n this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n hideVisitProgressBar() {\n this.progressBar.hide();\n if (this.visitProgressBarTimeout != null) {\n window.clearTimeout(this.visitProgressBarTimeout);\n delete this.visitProgressBarTimeout;\n }\n }\n showFormProgressBarAfterDelay() {\n if (this.formProgressBarTimeout == null) {\n this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\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 reload(reason) {\n var _a;\n dispatch(\"turbo:reload\", { detail: reason });\n window.location.href = ((_a = this.location) === null || _a === void 0 ? void 0 : _a.toString()) || window.location.href;\n }\n get navigator() {\n return this.session.navigator;\n }\n}\n\nclass CacheObserver {\n constructor() {\n this.selector = \"[data-turbo-temporary]\";\n this.deprecatedSelector = \"[data-turbo-cache=false]\";\n this.started = false;\n this.removeTemporaryElements = ((_event) => {\n for (const element of this.temporaryElements) {\n element.remove();\n }\n });\n }\n start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n get temporaryElements() {\n return [...document.querySelectorAll(this.selector), ...this.temporaryElementsWithDeprecation];\n }\n get temporaryElementsWithDeprecation() {\n const elements = document.querySelectorAll(this.deprecatedSelector);\n if (elements.length) {\n console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`);\n }\n return [...elements];\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 start() {\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n stop() {\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n }\n shouldInterceptLinkClick(element, _location, _event) {\n return this.shouldRedirect(element);\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 willSubmitForm(element, submitter) {\n return (element.closest(\"turbo-frame\") == null &&\n this.shouldSubmit(element, submitter) &&\n this.shouldRedirect(element, submitter));\n }\n formSubmitted(element, submitter) {\n const frame = this.findFrameElement(element, submitter);\n if (frame) {\n frame.delegate.formSubmitted(element, submitter);\n }\n }\n shouldSubmit(form, submitter) {\n var _a;\n const action = getAction(form, submitter);\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const rootLocation = expandURL((_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\");\n return this.shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation);\n }\n shouldRedirect(element, submitter) {\n const isNavigatable = element instanceof HTMLFormElement\n ? this.session.submissionIsNavigatable(element, submitter)\n : this.session.elementIsNavigatable(element);\n if (isNavigatable) {\n const frame = this.findFrameElement(element, submitter);\n return frame ? frame != element.closest(\"turbo-frame\") : false;\n }\n else {\n return false;\n }\n }\n findFrameElement(element, submitter) {\n const id = (submitter === null || submitter === void 0 ? void 0 : 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 constructor(delegate) {\n this.restorationIdentifier = uuid();\n this.restorationData = {};\n this.started = false;\n this.pageLoaded = false;\n this.onPopState = (event) => {\n if (this.shouldHandlePopState()) {\n const { turbo } = event.state || {};\n if (turbo) {\n this.location = new URL(window.location.href);\n const { restorationIdentifier } = turbo;\n this.restorationIdentifier = restorationIdentifier;\n this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location, restorationIdentifier);\n }\n }\n };\n this.onPageLoad = async (_event) => {\n await nextMicrotask();\n this.pageLoaded = true;\n };\n this.delegate = delegate;\n }\n start() {\n if (!this.started) {\n addEventListener(\"popstate\", this.onPopState, false);\n addEventListener(\"load\", this.onPageLoad, false);\n this.started = true;\n this.replace(new URL(window.location.href));\n }\n }\n stop() {\n if (this.started) {\n removeEventListener(\"popstate\", this.onPopState, false);\n removeEventListener(\"load\", this.onPageLoad, false);\n this.started = false;\n }\n }\n push(location, restorationIdentifier) {\n this.update(history.pushState, location, restorationIdentifier);\n }\n replace(location, restorationIdentifier) {\n this.update(history.replaceState, location, restorationIdentifier);\n }\n update(method, location, restorationIdentifier = uuid()) {\n const state = { turbo: { restorationIdentifier } };\n method.call(history, state, \"\", location.href);\n this.location = location;\n this.restorationIdentifier = restorationIdentifier;\n }\n getRestorationDataForIdentifier(restorationIdentifier) {\n return this.restorationData[restorationIdentifier] || {};\n }\n updateRestorationData(additionalData) {\n const { restorationIdentifier } = this;\n const restorationData = this.restorationData[restorationIdentifier];\n this.restorationData[restorationIdentifier] = Object.assign(Object.assign({}, restorationData), additionalData);\n }\n assumeControlOfScrollRestoration() {\n var _a;\n if (!this.previousScrollRestoration) {\n this.previousScrollRestoration = (_a = history.scrollRestoration) !== null && _a !== void 0 ? _a : \"auto\";\n history.scrollRestoration = \"manual\";\n }\n }\n relinquishControlOfScrollRestoration() {\n if (this.previousScrollRestoration) {\n history.scrollRestoration = this.previousScrollRestoration;\n delete this.previousScrollRestoration;\n }\n }\n shouldHandlePopState() {\n return this.pageIsLoaded();\n }\n pageIsLoaded() {\n return this.pageLoaded || document.readyState == \"complete\";\n }\n}\n\nclass Navigator {\n constructor(delegate) {\n this.delegate = delegate;\n }\n proposeVisit(location, options = {}) {\n if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {\n if (locationIsVisitable(location, this.view.snapshot.rootLocation)) {\n this.delegate.visitProposedToLocation(location, options);\n }\n else {\n window.location.href = location.toString();\n }\n }\n }\n startVisit(locatable, restorationIdentifier, options = {}) {\n this.stop();\n this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, Object.assign({ referrer: this.location }, options));\n this.currentVisit.start();\n }\n submitForm(form, submitter) {\n this.stop();\n this.formSubmission = new FormSubmission(this, form, submitter, true);\n this.formSubmission.start();\n }\n stop() {\n if (this.formSubmission) {\n this.formSubmission.stop();\n delete this.formSubmission;\n }\n if (this.currentVisit) {\n this.currentVisit.cancel();\n delete this.currentVisit;\n }\n }\n get adapter() {\n return this.delegate.adapter;\n }\n get view() {\n return this.delegate.view;\n }\n get history() {\n return this.delegate.history;\n }\n formSubmissionStarted(formSubmission) {\n if (typeof this.adapter.formSubmissionStarted === \"function\") {\n this.adapter.formSubmissionStarted(formSubmission);\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 const { statusCode, redirected } = fetchResponse;\n const action = this.getActionForFormSubmission(formSubmission);\n const visitOptions = {\n action,\n shouldCacheSnapshot,\n response: { statusCode, responseHTML, redirected },\n };\n this.proposeVisit(fetchResponse.location, visitOptions);\n }\n }\n }\n async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n const responseHTML = await fetchResponse.responseHTML;\n if (responseHTML) {\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n if (fetchResponse.serverError) {\n await this.view.renderError(snapshot, this.currentVisit);\n }\n else {\n await this.view.renderPage(snapshot, false, true, this.currentVisit);\n }\n this.view.scrollToTop();\n this.view.clearSnapshotCache();\n }\n }\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n formSubmissionFinished(formSubmission) {\n if (typeof this.adapter.formSubmissionFinished === \"function\") {\n this.adapter.formSubmissionFinished(formSubmission);\n }\n }\n visitStarted(visit) {\n this.delegate.visitStarted(visit);\n }\n visitCompleted(visit) {\n this.delegate.visitCompleted(visit);\n }\n locationWithActionIsSamePage(location, action) {\n const anchor = getAnchor(location);\n const currentAnchor = getAnchor(this.view.lastRenderedLocation);\n const isRestorationToTop = action === \"restore\" && typeof anchor === \"undefined\";\n return (action !== \"replace\" &&\n getRequestURL(location) === getRequestURL(this.view.lastRenderedLocation) &&\n (isRestorationToTop || (anchor != null && anchor !== currentAnchor)));\n }\n visitScrolledToSamePageLocation(oldURL, newURL) {\n this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);\n }\n get location() {\n return this.history.location;\n }\n get restorationIdentifier() {\n return this.history.restorationIdentifier;\n }\n getActionForFormSubmission({ submitter, formElement }) {\n return getVisitAction(submitter, formElement) || \"advance\";\n }\n}\n\nvar PageStage;\n(function (PageStage) {\n PageStage[PageStage[\"initial\"] = 0] = \"initial\";\n PageStage[PageStage[\"loading\"] = 1] = \"loading\";\n PageStage[PageStage[\"interactive\"] = 2] = \"interactive\";\n PageStage[PageStage[\"complete\"] = 3] = \"complete\";\n})(PageStage || (PageStage = {}));\nclass PageObserver {\n constructor(delegate) {\n this.stage = PageStage.initial;\n this.started = false;\n this.interpretReadyState = () => {\n const { readyState } = this;\n if (readyState == \"interactive\") {\n this.pageIsInteractive();\n }\n else if (readyState == \"complete\") {\n this.pageIsComplete();\n }\n };\n this.pageWillUnload = () => {\n this.delegate.pageWillUnload();\n };\n this.delegate = delegate;\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 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 pageIsInteractive() {\n if (this.stage == PageStage.loading) {\n this.stage = PageStage.interactive;\n this.delegate.pageBecameInteractive();\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 get readyState() {\n return document.readyState;\n }\n}\n\nclass ScrollObserver {\n constructor(delegate) {\n this.started = false;\n this.onScroll = () => {\n this.updatePosition({ x: window.pageXOffset, y: window.pageYOffset });\n };\n this.delegate = delegate;\n }\n start() {\n if (!this.started) {\n addEventListener(\"scroll\", this.onScroll, false);\n this.onScroll();\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n removeEventListener(\"scroll\", this.onScroll, false);\n this.started = false;\n }\n }\n updatePosition(position) {\n this.delegate.scrollPositionChanged(position);\n }\n}\n\nclass StreamMessageRenderer {\n render({ fragment }) {\n Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => document.documentElement.appendChild(fragment));\n }\n enteringBardo(currentPermanentElement, newPermanentElement) {\n newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));\n }\n leavingBardo() { }\n}\nfunction getPermanentElementMapForFragment(fragment) {\n const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);\n const permanentElementMap = {};\n for (const permanentElementInDocument of permanentElementsInDocument) {\n const { id } = permanentElementInDocument;\n for (const streamElement of fragment.querySelectorAll(\"turbo-stream\")) {\n const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);\n if (elementInStream) {\n permanentElementMap[id] = [permanentElementInDocument, elementInStream];\n }\n }\n }\n return permanentElementMap;\n}\n\nclass StreamObserver {\n constructor(delegate) {\n this.sources = new Set();\n this.started = false;\n this.inspectFetchResponse = ((event) => {\n const response = fetchResponseFromEvent(event);\n if (response && fetchResponseIsStream(response)) {\n event.preventDefault();\n this.receiveMessageResponse(response);\n }\n });\n this.receiveMessageEvent = (event) => {\n if (this.started && typeof event.data == \"string\") {\n this.receiveMessageHTML(event.data);\n }\n };\n this.delegate = delegate;\n }\n start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\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 disconnectStreamSource(source) {\n if (this.streamSourceIsConnected(source)) {\n this.sources.delete(source);\n source.removeEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n streamSourceIsConnected(source) {\n return this.sources.has(source);\n }\n async receiveMessageResponse(response) {\n const html = await response.responseHTML;\n if (html) {\n this.receiveMessageHTML(html);\n }\n }\n receiveMessageHTML(html) {\n this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));\n }\n}\nfunction fetchResponseFromEvent(event) {\n var _a;\n const fetchResponse = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.fetchResponse;\n if (fetchResponse instanceof FetchResponse) {\n return fetchResponse;\n }\n}\nfunction fetchResponseIsStream(response) {\n var _a;\n const contentType = (_a = response.contentType) !== null && _a !== void 0 ? _a : \"\";\n return contentType.startsWith(StreamMessage.contentType);\n}\n\nclass ErrorRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n const { documentElement, body } = document;\n documentElement.replaceChild(newElement, body);\n }\n async render() {\n this.replaceHeadAndBody();\n this.activateScriptElements();\n }\n replaceHeadAndBody() {\n const { documentElement, head } = document;\n documentElement.replaceChild(this.newHead, head);\n this.renderElement(this.currentElement, this.newElement);\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 get newHead() {\n return this.newSnapshot.headSnapshot.element;\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 }\n else {\n document.documentElement.appendChild(newElement);\n }\n }\n get shouldRender() {\n return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical;\n }\n get reloadReason() {\n if (!this.newSnapshot.isVisitable) {\n return {\n reason: \"turbo_visit_control_is_reload\",\n };\n }\n if (!this.trackedElementsAreIdentical) {\n return {\n reason: \"tracked_element_mismatch\",\n };\n }\n }\n async prepareToRender() {\n await this.mergeHead();\n }\n async render() {\n if (this.willRender) {\n await this.replaceBody();\n }\n }\n finishRendering() {\n super.finishRendering();\n if (!this.isPreview) {\n this.focusFirstAutofocusableElement();\n }\n }\n get currentHeadSnapshot() {\n return this.currentSnapshot.headSnapshot;\n }\n get newHeadSnapshot() {\n return this.newSnapshot.headSnapshot;\n }\n get newElement() {\n return this.newSnapshot.element;\n }\n async mergeHead() {\n const mergedHeadElements = this.mergeProvisionalElements();\n const newStylesheetElements = this.copyNewHeadStylesheetElements();\n this.copyNewHeadScriptElements();\n await mergedHeadElements;\n await newStylesheetElements;\n }\n async replaceBody() {\n await this.preservingPermanentElements(async () => {\n this.activateNewBody();\n await this.assignNewBody();\n });\n }\n get trackedElementsAreIdentical() {\n return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature;\n }\n async copyNewHeadStylesheetElements() {\n const loadingElements = [];\n for (const element of this.newHeadStylesheetElements) {\n loadingElements.push(waitForLoad(element));\n document.head.appendChild(element);\n }\n await Promise.all(loadingElements);\n }\n copyNewHeadScriptElements() {\n for (const element of this.newHeadScriptElements) {\n document.head.appendChild(activateScriptElement(element));\n }\n }\n async mergeProvisionalElements() {\n const newHeadElements = [...this.newHeadProvisionalElements];\n for (const element of this.currentHeadProvisionalElements) {\n if (!this.isCurrentElementInElementList(element, newHeadElements)) {\n document.head.removeChild(element);\n }\n }\n for (const element of newHeadElements) {\n document.head.appendChild(element);\n }\n }\n isCurrentElementInElementList(element, elementList) {\n for (const [index, newElement] of elementList.entries()) {\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 if (newElement.isEqualNode(element)) {\n elementList.splice(index, 1);\n return true;\n }\n }\n return false;\n }\n removeCurrentHeadProvisionalElements() {\n for (const element of this.currentHeadProvisionalElements) {\n document.head.removeChild(element);\n }\n }\n copyNewHeadProvisionalElements() {\n for (const element of this.newHeadProvisionalElements) {\n document.head.appendChild(element);\n }\n }\n activateNewBody() {\n document.adoptNode(this.newElement);\n this.activateNewBodyScriptElements();\n }\n activateNewBodyScriptElements() {\n for (const inertScriptElement of this.newBodyScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n async assignNewBody() {\n await this.renderElement(this.currentElement, this.newElement);\n }\n get newHeadStylesheetElements() {\n return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot);\n }\n get newHeadScriptElements() {\n return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot);\n }\n get currentHeadProvisionalElements() {\n return this.currentHeadSnapshot.provisionalElements;\n }\n get newHeadProvisionalElements() {\n return this.newHeadSnapshot.provisionalElements;\n }\n get newBodyScriptElements() {\n return this.newElement.querySelectorAll(\"script\");\n }\n}\n\nclass SnapshotCache {\n constructor(size) {\n this.keys = [];\n this.snapshots = {};\n this.size = size;\n }\n has(location) {\n return toCacheKey(location) in this.snapshots;\n }\n get(location) {\n if (this.has(location)) {\n const snapshot = this.read(location);\n this.touch(location);\n return snapshot;\n }\n }\n put(location, snapshot) {\n this.write(location, snapshot);\n this.touch(location);\n return snapshot;\n }\n clear() {\n this.snapshots = {};\n }\n read(location) {\n return this.snapshots[toCacheKey(location)];\n }\n write(location, snapshot) {\n this.snapshots[toCacheKey(location)] = snapshot;\n }\n touch(location) {\n const key = toCacheKey(location);\n const index = this.keys.indexOf(key);\n if (index > -1)\n this.keys.splice(index, 1);\n this.keys.unshift(key);\n this.trim();\n }\n trim() {\n for (const key of this.keys.splice(this.size)) {\n delete this.snapshots[key];\n }\n }\n}\n\nclass PageView extends View {\n constructor() {\n super(...arguments);\n this.snapshotCache = new SnapshotCache(10);\n this.lastRenderedLocation = new URL(location.href);\n this.forceReloaded = false;\n }\n renderPage(snapshot, isPreview = false, willRender = true, visit) {\n const renderer = new PageRenderer(this.snapshot, snapshot, PageRenderer.renderElement, isPreview, willRender);\n if (!renderer.shouldRender) {\n this.forceReloaded = true;\n }\n else {\n visit === null || visit === void 0 ? void 0 : visit.changeHistory();\n }\n return this.render(renderer);\n }\n renderError(snapshot, visit) {\n visit === null || visit === void 0 ? void 0 : visit.changeHistory();\n const renderer = new ErrorRenderer(this.snapshot, snapshot, ErrorRenderer.renderElement, false);\n return this.render(renderer);\n }\n clearSnapshotCache() {\n this.snapshotCache.clear();\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 getCachedSnapshotForLocation(location) {\n return this.snapshotCache.get(location);\n }\n get snapshot() {\n return PageSnapshot.fromElement(this.element);\n }\n}\n\nclass Preloader {\n constructor(delegate) {\n this.selector = \"a[data-turbo-preload]\";\n this.delegate = delegate;\n }\n get snapshotCache() {\n return this.delegate.navigator.view.snapshotCache;\n }\n start() {\n if (document.readyState === \"loading\") {\n return document.addEventListener(\"DOMContentLoaded\", () => {\n this.preloadOnLoadLinksForView(document.body);\n });\n }\n else {\n this.preloadOnLoadLinksForView(document.body);\n }\n }\n preloadOnLoadLinksForView(element) {\n for (const link of element.querySelectorAll(this.selector)) {\n this.preloadURL(link);\n }\n }\n async preloadURL(link) {\n const location = new URL(link.href);\n if (this.snapshotCache.has(location)) {\n return;\n }\n try {\n const response = await fetch(location.toString(), { headers: { \"VND.PREFETCH\": \"true\", Accept: \"text/html\" } });\n const responseText = await response.text();\n const snapshot = PageSnapshot.fromHTMLString(responseText);\n this.snapshotCache.put(location, snapshot);\n }\n catch (_) {\n }\n }\n}\n\nclass Session {\n constructor() {\n this.navigator = new Navigator(this);\n this.history = new History(this);\n this.preloader = new Preloader(this);\n this.view = new PageView(this, document.documentElement);\n this.adapter = new BrowserAdapter(this);\n this.pageObserver = new PageObserver(this);\n this.cacheObserver = new CacheObserver();\n this.linkClickObserver = new LinkClickObserver(this, window);\n this.formSubmitObserver = new FormSubmitObserver(this, document);\n this.scrollObserver = new ScrollObserver(this);\n this.streamObserver = new StreamObserver(this);\n this.formLinkClickObserver = new FormLinkClickObserver(this, document.documentElement);\n this.frameRedirector = new FrameRedirector(this, document.documentElement);\n this.streamMessageRenderer = new StreamMessageRenderer();\n this.drive = true;\n this.enabled = true;\n this.progressBarDelay = 500;\n this.started = false;\n this.formMode = \"on\";\n }\n start() {\n if (!this.started) {\n this.pageObserver.start();\n this.cacheObserver.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 disable() {\n this.enabled = false;\n }\n stop() {\n if (this.started) {\n this.pageObserver.stop();\n this.cacheObserver.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.started = false;\n }\n }\n registerAdapter(adapter) {\n this.adapter = adapter;\n }\n visit(location, options = {}) {\n const frameElement = options.frame ? document.getElementById(options.frame) : null;\n if (frameElement instanceof FrameElement) {\n frameElement.src = location.toString();\n frameElement.loaded;\n }\n else {\n this.navigator.proposeVisit(expandURL(location), options);\n }\n }\n connectStreamSource(source) {\n this.streamObserver.connectStreamSource(source);\n }\n disconnectStreamSource(source) {\n this.streamObserver.disconnectStreamSource(source);\n }\n renderStreamMessage(message) {\n this.streamMessageRenderer.render(StreamMessage.wrap(message));\n }\n clearCache() {\n this.view.clearSnapshotCache();\n }\n setProgressBarDelay(delay) {\n this.progressBarDelay = delay;\n }\n setFormMode(mode) {\n this.formMode = mode;\n }\n get location() {\n return this.history.location;\n }\n get restorationIdentifier() {\n return this.history.restorationIdentifier;\n }\n historyPoppedToLocationWithRestorationIdentifier(location, restorationIdentifier) {\n if (this.enabled) {\n this.navigator.startVisit(location, restorationIdentifier, {\n action: \"restore\",\n historyChanged: true,\n });\n }\n else {\n this.adapter.pageInvalidated({\n reason: \"turbo_disabled\",\n });\n }\n }\n scrollPositionChanged(position) {\n this.history.updateRestorationData({ scrollPosition: position });\n }\n willSubmitFormLinkToLocation(link, location) {\n return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation);\n }\n submittedFormLinkToLocation() { }\n willFollowLinkToLocation(link, location, event) {\n return (this.elementIsNavigatable(link) &&\n locationIsVisitable(location, this.snapshot.rootLocation) &&\n this.applicationAllowsFollowingLinkToLocation(link, location, event));\n }\n followedLinkToLocation(link, location) {\n const action = this.getActionForLink(link);\n const acceptsStreamResponse = link.hasAttribute(\"data-turbo-stream\");\n this.visit(location.href, { action, acceptsStreamResponse });\n }\n allowsVisitingLocationWithAction(location, action) {\n return this.locationWithActionIsSamePage(location, action) || this.applicationAllowsVisitingLocation(location);\n }\n visitProposedToLocation(location, options) {\n extendURLWithDeprecatedProperties(location);\n this.adapter.visitProposedToLocation(location, options);\n }\n visitStarted(visit) {\n if (!visit.acceptsStreamResponse) {\n markAsBusy(document.documentElement);\n }\n extendURLWithDeprecatedProperties(visit.location);\n if (!visit.silent) {\n this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n }\n }\n visitCompleted(visit) {\n clearBusyState(document.documentElement);\n this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n }\n locationWithActionIsSamePage(location, action) {\n return this.navigator.locationWithActionIsSamePage(location, action);\n }\n visitScrolledToSamePageLocation(oldURL, newURL) {\n this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);\n }\n willSubmitForm(form, submitter) {\n const action = getAction(form, submitter);\n return (this.submissionIsNavigatable(form, submitter) &&\n locationIsVisitable(expandURL(action), this.snapshot.rootLocation));\n }\n formSubmitted(form, submitter) {\n this.navigator.submitForm(form, submitter);\n }\n pageBecameInteractive() {\n this.view.lastRenderedLocation = this.location;\n this.notifyApplicationAfterPageLoad();\n }\n pageLoaded() {\n this.history.assumeControlOfScrollRestoration();\n }\n pageWillUnload() {\n this.history.relinquishControlOfScrollRestoration();\n }\n receivedMessageFromStream(message) {\n this.renderStreamMessage(message);\n }\n viewWillCacheSnapshot() {\n var _a;\n if (!((_a = this.navigator.currentVisit) === null || _a === void 0 ? void 0 : _a.silent)) {\n this.notifyApplicationBeforeCachingSnapshot();\n }\n }\n allowsImmediateRender({ element }, options) {\n const event = this.notifyApplicationBeforeRender(element, options);\n const { defaultPrevented, detail: { render }, } = event;\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n return !defaultPrevented;\n }\n viewRenderedSnapshot(_snapshot, _isPreview) {\n this.view.lastRenderedLocation = this.history.location;\n this.notifyApplicationAfterRender();\n }\n preloadOnLoadLinksForView(element) {\n this.preloader.preloadOnLoadLinksForView(element);\n }\n viewInvalidated(reason) {\n this.adapter.pageInvalidated(reason);\n }\n frameLoaded(frame) {\n this.notifyApplicationAfterFrameLoad(frame);\n }\n frameRendered(fetchResponse, frame) {\n this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n }\n applicationAllowsFollowingLinkToLocation(link, location, ev) {\n const event = this.notifyApplicationAfterClickingLinkToLocation(link, location, ev);\n return !event.defaultPrevented;\n }\n applicationAllowsVisitingLocation(location) {\n const event = this.notifyApplicationBeforeVisitingLocation(location);\n return !event.defaultPrevented;\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 notifyApplicationBeforeVisitingLocation(location) {\n return dispatch(\"turbo:before-visit\", {\n detail: { url: location.href },\n cancelable: true,\n });\n }\n notifyApplicationAfterVisitingLocation(location, action) {\n return dispatch(\"turbo:visit\", { detail: { url: location.href, action } });\n }\n notifyApplicationBeforeCachingSnapshot() {\n return dispatch(\"turbo:before-cache\");\n }\n notifyApplicationBeforeRender(newBody, options) {\n return dispatch(\"turbo:before-render\", {\n detail: Object.assign({ newBody }, options),\n cancelable: true,\n });\n }\n notifyApplicationAfterRender() {\n return dispatch(\"turbo:render\");\n }\n notifyApplicationAfterPageLoad(timing = {}) {\n return dispatch(\"turbo:load\", {\n detail: { url: this.location.href, timing },\n });\n }\n notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {\n dispatchEvent(new HashChangeEvent(\"hashchange\", {\n oldURL: oldURL.toString(),\n newURL: newURL.toString(),\n }));\n }\n notifyApplicationAfterFrameLoad(frame) {\n return dispatch(\"turbo:frame-load\", { target: frame });\n }\n notifyApplicationAfterFrameRender(fetchResponse, frame) {\n return dispatch(\"turbo:frame-render\", {\n detail: { fetchResponse },\n target: frame,\n cancelable: true,\n });\n }\n submissionIsNavigatable(form, submitter) {\n if (this.formMode == \"off\") {\n return false;\n }\n else {\n const submitterIsNavigatable = submitter ? this.elementIsNavigatable(submitter) : true;\n if (this.formMode == \"optin\") {\n return submitterIsNavigatable && form.closest('[data-turbo=\"true\"]') != null;\n }\n else {\n return submitterIsNavigatable && this.elementIsNavigatable(form);\n }\n }\n }\n elementIsNavigatable(element) {\n const container = findClosestRecursively(element, \"[data-turbo]\");\n const withinFrame = findClosestRecursively(element, \"turbo-frame\");\n if (this.drive || withinFrame) {\n if (container) {\n return container.getAttribute(\"data-turbo\") != \"false\";\n }\n else {\n return true;\n }\n }\n else {\n if (container) {\n return container.getAttribute(\"data-turbo\") == \"true\";\n }\n else {\n return false;\n }\n }\n }\n getActionForLink(link) {\n return getVisitAction(link) || \"advance\";\n }\n get snapshot() {\n return this.view.snapshot;\n }\n}\nfunction extendURLWithDeprecatedProperties(url) {\n Object.defineProperties(url, deprecatedLocationPropertyDescriptors);\n}\nconst deprecatedLocationPropertyDescriptors = {\n absoluteURL: {\n get() {\n return this.toString();\n },\n },\n};\n\nclass Cache {\n constructor(session) {\n this.session = session;\n }\n clear() {\n this.session.clearCache();\n }\n resetCacheControl() {\n this.setCacheControl(\"\");\n }\n exemptPageFromCache() {\n this.setCacheControl(\"no-cache\");\n }\n exemptPageFromPreview() {\n this.setCacheControl(\"no-preview\");\n }\n setCacheControl(value) {\n setMetaContent(\"turbo-cache-control\", value);\n }\n}\n\nconst StreamActions = {\n after() {\n this.targetElements.forEach((e) => { var _a; return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e.nextSibling); });\n },\n append() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach((e) => e.append(this.templateContent));\n },\n before() {\n this.targetElements.forEach((e) => { var _a; return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e); });\n },\n prepend() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach((e) => e.prepend(this.templateContent));\n },\n remove() {\n this.targetElements.forEach((e) => e.remove());\n },\n replace() {\n this.targetElements.forEach((e) => e.replaceWith(this.templateContent));\n },\n update() {\n this.targetElements.forEach((targetElement) => {\n targetElement.innerHTML = \"\";\n targetElement.append(this.templateContent);\n });\n },\n};\n\nconst session = new Session();\nconst cache = new Cache(session);\nconst { navigator: navigator$1 } = session;\nfunction start() {\n session.start();\n}\nfunction registerAdapter(adapter) {\n session.registerAdapter(adapter);\n}\nfunction visit(location, options) {\n session.visit(location, options);\n}\nfunction connectStreamSource(source) {\n session.connectStreamSource(source);\n}\nfunction disconnectStreamSource(source) {\n session.disconnectStreamSource(source);\n}\nfunction renderStreamMessage(message) {\n session.renderStreamMessage(message);\n}\nfunction clearCache() {\n console.warn(\"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`\");\n session.clearCache();\n}\nfunction setProgressBarDelay(delay) {\n session.setProgressBarDelay(delay);\n}\nfunction setConfirmMethod(confirmMethod) {\n FormSubmission.confirmMethod = confirmMethod;\n}\nfunction setFormMode(mode) {\n session.setFormMode(mode);\n}\n\nvar Turbo = /*#__PURE__*/Object.freeze({\n __proto__: null,\n navigator: navigator$1,\n session: session,\n cache: cache,\n PageRenderer: PageRenderer,\n PageSnapshot: PageSnapshot,\n FrameRenderer: FrameRenderer,\n start: start,\n registerAdapter: registerAdapter,\n visit: visit,\n connectStreamSource: connectStreamSource,\n disconnectStreamSource: disconnectStreamSource,\n renderStreamMessage: renderStreamMessage,\n clearCache: clearCache,\n setProgressBarDelay: setProgressBarDelay,\n setConfirmMethod: setConfirmMethod,\n setFormMode: setFormMode,\n StreamActions: StreamActions\n});\n\nclass TurboFrameMissingError extends Error {\n}\n\nclass FrameController {\n constructor(element) {\n this.fetchResponseLoaded = (_fetchResponse) => { };\n this.currentFetchRequest = null;\n this.resolveVisitPromise = () => { };\n this.connected = false;\n this.hasBeenLoaded = false;\n this.ignoredAttributes = new Set();\n this.action = null;\n this.visitCachedSnapshot = ({ element }) => {\n const frame = element.querySelector(\"#\" + this.element.id);\n if (frame && this.previousFrameElement) {\n frame.replaceChildren(...this.previousFrameElement.children);\n }\n delete this.previousFrameElement;\n };\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 connect() {\n if (!this.connected) {\n this.connected = true;\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n }\n else {\n this.loadSourceURL();\n }\n this.formLinkClickObserver.start();\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\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 }\n disabledChanged() {\n if (this.loadingStyle == FrameLoadingStyle.eager) {\n this.loadSourceURL();\n }\n }\n sourceURLChanged() {\n if (this.isIgnoringChangesTo(\"src\"))\n return;\n if (this.element.isConnected) {\n this.complete = false;\n }\n if (this.loadingStyle == FrameLoadingStyle.eager || this.hasBeenLoaded) {\n this.loadSourceURL();\n }\n }\n sourceURLReloaded() {\n const { src } = this.element;\n this.ignoringChangesToAttribute(\"complete\", () => {\n this.element.removeAttribute(\"complete\");\n });\n this.element.src = null;\n this.element.src = src;\n return this.element.loaded;\n }\n completeChanged() {\n if (this.isIgnoringChangesTo(\"complete\"))\n return;\n this.loadSourceURL();\n }\n loadingStyleChanged() {\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n }\n else {\n this.appearanceObserver.stop();\n this.loadSourceURL();\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 async loadResponse(fetchResponse) {\n if (fetchResponse.redirected || (fetchResponse.succeeded && fetchResponse.isHTML)) {\n this.sourceURL = fetchResponse.response.url;\n }\n try {\n const html = await fetchResponse.responseHTML;\n if (html) {\n const document = parseHTMLDocument(html);\n const pageSnapshot = PageSnapshot.fromDocument(document);\n if (pageSnapshot.isVisitable) {\n await this.loadFrameResponse(fetchResponse, document);\n }\n else {\n await this.handleUnvisitableFrameResponse(fetchResponse);\n }\n }\n }\n finally {\n this.fetchResponseLoaded = () => { };\n }\n }\n elementAppearedInViewport(element) {\n this.proposeVisitIfNavigatedWithAction(element, element);\n this.loadSourceURL();\n }\n willSubmitFormLinkToLocation(link) {\n return this.shouldInterceptNavigation(link);\n }\n submittedFormLinkToLocation(link, _location, form) {\n const frame = this.findFrameElement(link);\n if (frame)\n form.setAttribute(\"data-turbo-frame\", frame.id);\n }\n shouldInterceptLinkClick(element, _location, _event) {\n return this.shouldInterceptNavigation(element);\n }\n linkClickIntercepted(element, location) {\n this.navigateFrame(element, location);\n }\n willSubmitForm(element, submitter) {\n return element.closest(\"turbo-frame\") == this.element && this.shouldInterceptNavigation(element, submitter);\n }\n formSubmitted(element, submitter) {\n if (this.formSubmission) {\n this.formSubmission.stop();\n }\n this.formSubmission = new FormSubmission(this, element, submitter);\n const { fetchRequest } = this.formSubmission;\n this.prepareRequest(fetchRequest);\n this.formSubmission.start();\n }\n prepareRequest(request) {\n var _a;\n request.headers[\"Turbo-Frame\"] = this.id;\n if ((_a = this.currentNavigationElement) === null || _a === void 0 ? void 0 : _a.hasAttribute(\"data-turbo-stream\")) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n requestStarted(_request) {\n markAsBusy(this.element);\n }\n requestPreventedHandlingResponse(_request, _response) {\n this.resolveVisitPromise();\n }\n async requestSucceededWithResponse(request, response) {\n await this.loadResponse(response);\n this.resolveVisitPromise();\n }\n async requestFailedWithResponse(request, response) {\n await this.loadResponse(response);\n this.resolveVisitPromise();\n }\n requestErrored(request, error) {\n console.error(error);\n this.resolveVisitPromise();\n }\n requestFinished(_request) {\n clearBusyState(this.element);\n }\n formSubmissionStarted({ formElement }) {\n markAsBusy(formElement, this.findFrameElement(formElement));\n }\n formSubmissionSucceededWithResponse(formSubmission, response) {\n const frame = this.findFrameElement(formSubmission.formElement, formSubmission.submitter);\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, formSubmission.formElement, formSubmission.submitter);\n frame.delegate.loadResponse(response);\n if (!formSubmission.isSafe) {\n session.clearCache();\n }\n }\n formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n this.element.delegate.loadResponse(fetchResponse);\n session.clearCache();\n }\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n formSubmissionFinished({ formElement }) {\n clearBusyState(formElement, this.findFrameElement(formElement));\n }\n allowsImmediateRender({ element: newFrame }, options) {\n const event = dispatch(\"turbo:before-frame-render\", {\n target: this.element,\n detail: Object.assign({ newFrame }, options),\n cancelable: true,\n });\n const { defaultPrevented, detail: { render }, } = event;\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n return !defaultPrevented;\n }\n viewRenderedSnapshot(_snapshot, _isPreview) { }\n preloadOnLoadLinksForView(element) {\n session.preloadOnLoadLinksForView(element);\n }\n viewInvalidated() { }\n willRenderFrame(currentElement, _newElement) {\n this.previousFrameElement = currentElement.cloneNode(true);\n }\n async loadFrameResponse(fetchResponse, document) {\n const newFrameElement = await this.extractForeignFrameElement(document.body);\n if (newFrameElement) {\n const snapshot = new Snapshot(newFrameElement);\n const renderer = new FrameRenderer(this, this.view.snapshot, snapshot, FrameRenderer.renderElement, false, false);\n if (this.view.renderPromise)\n await this.view.renderPromise;\n this.changeHistory();\n await this.view.render(renderer);\n this.complete = true;\n session.frameRendered(fetchResponse, this.element);\n session.frameLoaded(this.element);\n this.fetchResponseLoaded(fetchResponse);\n }\n else if (this.willHandleFrameMissingFromResponse(fetchResponse)) {\n this.handleFrameMissingFromResponse(fetchResponse);\n }\n }\n async visit(url) {\n var _a;\n const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);\n (_a = this.currentFetchRequest) === null || _a === void 0 ? void 0 : _a.cancel();\n this.currentFetchRequest = request;\n return new Promise((resolve) => {\n this.resolveVisitPromise = () => {\n this.resolveVisitPromise = () => { };\n this.currentFetchRequest = null;\n resolve();\n };\n request.perform();\n });\n }\n navigateFrame(element, url, submitter) {\n const frame = this.findFrameElement(element, submitter);\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, element, submitter);\n this.withCurrentNavigationElement(element, () => {\n frame.src = url;\n });\n }\n proposeVisitIfNavigatedWithAction(frame, element, submitter) {\n this.action = getVisitAction(submitter, element, frame);\n if (this.action) {\n const pageSnapshot = PageSnapshot.fromElement(frame).clone();\n const { visitCachedSnapshot } = frame.delegate;\n frame.delegate.fetchResponseLoaded = (fetchResponse) => {\n if (frame.src) {\n const { statusCode, redirected } = fetchResponse;\n const responseHTML = frame.ownerDocument.documentElement.outerHTML;\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 if (this.action)\n options.action = this.action;\n session.visit(frame.src, options);\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 async handleUnvisitableFrameResponse(fetchResponse) {\n console.warn(`The response (${fetchResponse.statusCode}) from is performing a full page visit due to turbo-visit-control.`);\n await this.visitResponse(fetchResponse.response);\n }\n willHandleFrameMissingFromResponse(fetchResponse) {\n this.element.setAttribute(\"complete\", \"\");\n const response = fetchResponse.response;\n const visit = async (url, options = {}) => {\n if (url instanceof Response) {\n this.visitResponse(url);\n }\n else {\n session.visit(url, options);\n }\n };\n const event = dispatch(\"turbo:frame-missing\", {\n target: this.element,\n detail: { response, visit },\n cancelable: true,\n });\n return !event.defaultPrevented;\n }\n handleFrameMissingFromResponse(fetchResponse) {\n this.view.missing();\n this.throwFrameMissingError(fetchResponse);\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 async visitResponse(response) {\n const wrapped = new FetchResponse(response);\n const responseHTML = await wrapped.responseHTML;\n const { location, redirected, statusCode } = wrapped;\n return session.visit(location, { response: { redirected, statusCode, responseHTML } });\n }\n findFrameElement(element, submitter) {\n var _a;\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n return (_a = getFrameElementById(id)) !== null && _a !== void 0 ? _a : this.element;\n }\n async extractForeignFrameElement(container) {\n let element;\n const id = CSS.escape(this.id);\n try {\n element = activateElement(container.querySelector(`turbo-frame#${id}`), this.sourceURL);\n if (element) {\n return element;\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 }\n catch (error) {\n console.error(error);\n return new FrameElement();\n }\n return null;\n }\n formActionIsVisitable(form, submitter) {\n const action = getAction(form, submitter);\n return locationIsVisitable(expandURL(action), this.rootLocation);\n }\n shouldInterceptNavigation(element, submitter) {\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n if (element instanceof HTMLFormElement && !this.formActionIsVisitable(element, submitter)) {\n return false;\n }\n if (!this.enabled || id == \"_top\") {\n return false;\n }\n if (id) {\n const frameElement = getFrameElementById(id);\n if (frameElement) {\n return !frameElement.disabled;\n }\n }\n if (!session.elementIsNavigatable(element)) {\n return false;\n }\n if (submitter && !session.elementIsNavigatable(submitter)) {\n return false;\n }\n return true;\n }\n get id() {\n return this.element.id;\n }\n get enabled() {\n return !this.element.disabled;\n }\n get sourceURL() {\n if (this.element.src) {\n return this.element.src;\n }\n }\n set sourceURL(sourceURL) {\n this.ignoringChangesToAttribute(\"src\", () => {\n this.element.src = sourceURL !== null && sourceURL !== void 0 ? sourceURL : null;\n });\n }\n get loadingStyle() {\n return this.element.loading;\n }\n get isLoading() {\n return this.formSubmission !== undefined || this.resolveVisitPromise() !== undefined;\n }\n get complete() {\n return this.element.hasAttribute(\"complete\");\n }\n set complete(value) {\n this.ignoringChangesToAttribute(\"complete\", () => {\n if (value) {\n this.element.setAttribute(\"complete\", \"\");\n }\n else {\n this.element.removeAttribute(\"complete\");\n }\n });\n }\n get isActive() {\n return this.element.isActive && this.connected;\n }\n get rootLocation() {\n var _a;\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const root = (_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\";\n return expandURL(root);\n }\n isIgnoringChangesTo(attributeName) {\n return this.ignoredAttributes.has(attributeName);\n }\n ignoringChangesToAttribute(attributeName, callback) {\n this.ignoredAttributes.add(attributeName);\n callback();\n this.ignoredAttributes.delete(attributeName);\n }\n withCurrentNavigationElement(element, callback) {\n this.currentNavigationElement = element;\n callback();\n delete this.currentNavigationElement;\n }\n}\nfunction getFrameElementById(id) {\n if (id != null) {\n const element = document.getElementById(id);\n if (element instanceof FrameElement) {\n return element;\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 if (element instanceof FrameElement) {\n element.connectedCallback();\n element.disconnectedCallback();\n return element;\n }\n }\n}\n\nclass StreamElement extends HTMLElement {\n static async renderElement(newElement) {\n await newElement.performAction();\n }\n async connectedCallback() {\n try {\n await this.render();\n }\n catch (error) {\n console.error(error);\n }\n finally {\n this.disconnect();\n }\n }\n async render() {\n var _a;\n return ((_a = this.renderPromise) !== null && _a !== void 0 ? _a : (this.renderPromise = (async () => {\n const event = this.beforeRenderEvent;\n if (this.dispatchEvent(event)) {\n await nextAnimationFrame();\n await event.detail.render(this);\n }\n })()));\n }\n disconnect() {\n try {\n this.remove();\n }\n catch (_a) { }\n }\n removeDuplicateTargetChildren() {\n this.duplicateChildren.forEach((c) => c.remove());\n }\n get duplicateChildren() {\n var _a;\n const existingChildren = this.targetElements.flatMap((e) => [...e.children]).filter((c) => !!c.id);\n const newChildrenIds = [...(((_a = this.templateContent) === null || _a === void 0 ? void 0 : _a.children) || [])].filter((c) => !!c.id).map((c) => c.id);\n return existingChildren.filter((c) => newChildrenIds.includes(c.id));\n }\n get performAction() {\n if (this.action) {\n const actionFunction = StreamActions[this.action];\n if (actionFunction) {\n return actionFunction;\n }\n this.raise(\"unknown action\");\n }\n this.raise(\"action attribute is missing\");\n }\n get targetElements() {\n if (this.target) {\n return this.targetElementsById;\n }\n else if (this.targets) {\n return this.targetElementsByQuery;\n }\n else {\n this.raise(\"target or targets attribute is missing\");\n }\n }\n get templateContent() {\n return this.templateElement.content.cloneNode(true);\n }\n get templateElement() {\n if (this.firstElementChild === null) {\n const template = this.ownerDocument.createElement(\"template\");\n this.appendChild(template);\n return template;\n }\n else if (this.firstElementChild instanceof HTMLTemplateElement) {\n return this.firstElementChild;\n }\n this.raise(\"first child element must be a