diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a68a12..2e1a978 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,14 +9,12 @@ jobs: fail-fast: false matrix: include: - - elixir: 1.12.3 - otp: 24 - elixir: 1.13.4 otp: 24 - check_warnings: true - check_format: true - elixir: 1.14.3 otp: 25.2.1 + - elixir: 1.16 + otp: 26 check_warnings: true check_format: true steps: diff --git a/assets/package-lock.json b/assets/package-lock.json index 1d17fbc..b1bfbc6 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -31,15 +31,18 @@ } }, "../deps/phoenix": { - "version": "1.7.7", + "version": "1.7.12", "license": "MIT" }, "../deps/phoenix_html": { - "version": "3.3.2" + "version": "4.1.0" }, "../deps/phoenix_live_view": { - "version": "0.18.18", - "license": "MIT" + "version": "0.20.14", + "license": "MIT", + "devDependencies": { + "@playwright/test": "^1.41.0" + } }, "node_modules/@babel/code-frame": { "version": "7.14.5", @@ -13325,7 +13328,10 @@ "version": "file:../deps/phoenix_html" }, "phoenix_live_view": { - "version": "file:../deps/phoenix_live_view" + "version": "file:../deps/phoenix_live_view", + "requires": { + "@playwright/test": "^1.41.0" + } }, "picocolors": { "version": "1.0.0", diff --git a/config/test.exs b/config/test.exs index 8cf5560..ace51d2 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,7 +1,7 @@ import Config # Print only warnings and errors during test -config :logger, level: :warn +config :logger, level: :warning config :exq_ui, DemoWeb.Endpoint, secret_key_base: "JUrii8hEdYZjAo/LHUziUO1xx0ViDK+I1yYDVvNrLpcYWH93l4kSBvWsbfGwJRu5", diff --git a/lib/exq_ui_web.ex b/lib/exq_ui_web.ex index f58bb84..cfb23be 100644 --- a/lib/exq_ui_web.ex +++ b/lib/exq_ui_web.ex @@ -55,7 +55,9 @@ defmodule ExqUIWeb do defp view_helpers do quote do # Use all HTML functionality (forms, tags, etc) - use Phoenix.HTML + import Phoenix.HTML + import Phoenix.HTML.Form + use PhoenixHTMLHelpers import Phoenix.Component # Import LiveView helpers (live_render, live_component, live_patch, etc) diff --git a/lib/exq_ui_web/live/busy_live/index.html.heex b/lib/exq_ui_web/live/busy_live/index.html.heex index bea5b9d..29b725f 100644 --- a/lib/exq_ui_web/live/busy_live/index.html.heex +++ b/lib/exq_ui_web/live/busy_live/index.html.heex @@ -54,10 +54,9 @@ <%= job.pid %> <%= job.payload.jid %> - <%= live_redirect(job.queue, - class: "nounderline", - to: Routes.queue_show_path(@socket, job.queue) - ) %> + <.link class="nounderline" navigate={Routes.queue_show_path(@socket, job.queue)}> + <%= job.queue %> + <%= job.payload.class %> <%= inspect(job.payload.args) %> diff --git a/lib/exq_ui_web/live/dead_live/index.ex b/lib/exq_ui_web/live/dead_live/index.ex index 3efff03..51e3a90 100644 --- a/lib/exq_ui_web/live/dead_live/index.ex +++ b/lib/exq_ui_web/live/dead_live/index.ex @@ -12,7 +12,7 @@ defmodule ExqUIWeb.DeadLive.Index do %{ header: "Last Failed", accessor: fn item -> - live_redirect(human_time(item.scheduled_at), + live_link(human_time(item.scheduled_at), to: Routes.dead_show_path(socket, item.score, item.id), class: "nounderline" ) diff --git a/lib/exq_ui_web/live/queue_live/index.html.heex b/lib/exq_ui_web/live/queue_live/index.html.heex index 773f334..04cade0 100644 --- a/lib/exq_ui_web/live/queue_live/index.html.heex +++ b/lib/exq_ui_web/live/queue_live/index.html.heex @@ -12,10 +12,9 @@ - <%= live_redirect(queue.name, - class: "nounderline", - to: Routes.queue_show_path(@socket, queue.name) - ) %> + <.link class="nounderline" navigate={Routes.queue_show_path(@socket, queue.name)}> + <%= queue.name %> + <%= queue.count %> diff --git a/lib/exq_ui_web/live/retry_live/index.ex b/lib/exq_ui_web/live/retry_live/index.ex index 7ed46fb..31769e8 100644 --- a/lib/exq_ui_web/live/retry_live/index.ex +++ b/lib/exq_ui_web/live/retry_live/index.ex @@ -12,7 +12,7 @@ defmodule ExqUIWeb.RetryLive.Index do %{ header: "Next Retry", accessor: fn item -> - live_redirect(human_time(item.scheduled_at), + live_link(human_time(item.scheduled_at), to: Routes.retry_show_path(socket, item.score, item.id), class: "nounderline" ) diff --git a/lib/exq_ui_web/live/scheduled_live/index.ex b/lib/exq_ui_web/live/scheduled_live/index.ex index 80d8743..55b6778 100644 --- a/lib/exq_ui_web/live/scheduled_live/index.ex +++ b/lib/exq_ui_web/live/scheduled_live/index.ex @@ -12,7 +12,7 @@ defmodule ExqUIWeb.ScheduledLive.Index do %{ header: "When", accessor: fn item -> - live_redirect(human_time(item.scheduled_at), + live_link(human_time(item.scheduled_at), to: Routes.scheduled_show_path(socket, item.score, item.id), class: "nounderline" ) diff --git a/lib/exq_ui_web/templates/layout/root.html.heex b/lib/exq_ui_web/templates/layout/root.html.heex index 21c6bb9..ed0b1ea 100644 --- a/lib/exq_ui_web/templates/layout/root.html.heex +++ b/lib/exq_ui_web/templates/layout/root.html.heex @@ -5,7 +5,9 @@ <%= csrf_meta_tag() %> - <%= live_title_tag(assigns[:page_title] || "ExqUI") %> + <.live_title> + <%= assigns[:page_title] || "ExqUI" %> + diff --git a/lib/exq_ui_web/views/helpers.ex b/lib/exq_ui_web/views/helpers.ex index bb9afa4..5144f35 100644 --- a/lib/exq_ui_web/views/helpers.ex +++ b/lib/exq_ui_web/views/helpers.ex @@ -1,7 +1,8 @@ defmodule ExqUIWeb.Helpers do @moduledoc false - use Phoenix.HTML - import Phoenix.LiveView.Helpers + + use PhoenixHTMLHelpers + import Phoenix.Component def nav_link(socket, name, link) do active = @@ -11,7 +12,19 @@ defmodule ExqUIWeb.Helpers do "" end - live_redirect(name, to: link, class: "nav-link" <> active) + assigns = %{to: link, class: "nav-link" <> active, name: name} + + ~H|<.link navigate={@to} class={@class}><%= @name %>| + end + + def live_link(text, options) do + assigns = %{ + to: Keyword.fetch!(options, :to), + class: Keyword.get(options, :class, ""), + text: text + } + + ~H|<.link navigate={@to} class={@class}><%= @text %>| end def human_time(nil) do diff --git a/mix.exs b/mix.exs index 0594279..13ccc93 100644 --- a/mix.exs +++ b/mix.exs @@ -36,9 +36,10 @@ defmodule ExqUI.MixProject do [ {:exq, ">= 0.16.2"}, {:exq_scheduler, "~> 1.0", optional: true}, - {:phoenix_live_view, "~> 0.18"}, + {:phoenix_live_view, "~> 0.20"}, {:phoenix_live_reload, "~> 1.2", only: :dev}, {:phoenix_view, "~> 2.0"}, + {:phoenix_html_helpers, "~> 1.0"}, {:jason, "~> 1.0"}, {:plug_cowboy, "~> 2.0"}, {:redix, ">= 0.9.0"}, diff --git a/mix.lock b/mix.lock index a6f2c94..c33780a 100644 --- a/mix.lock +++ b/mix.lock @@ -1,53 +1,56 @@ %{ "benchee": {:hex, :benchee, "1.0.1", "66b211f9bfd84bd97e6d1beaddf8fc2312aaabe192f776e8931cb0c16f53a521", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}], "hexpm", "3ad58ae787e9c7c94dd7ceda3b587ec2c64604563e049b2a0e8baafae832addb"}, - "castore": {:hex, :castore, "0.1.22", "4127549e411bedd012ca3a308dede574f43819fe9394254ca55ab4895abfa1a2", [:mix], [], "hexpm", "c17576df47eb5aa1ee40cc4134316a99f5cad3e215d5c77b8dd3cfef12a22cac"}, - "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, + "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, + "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"}, "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"}, - "cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"}, + "cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, - "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, - "crontab": {:hex, :crontab, "1.1.11", "4028ced51b813a5061f85b689d4391ef0c27550c8ab09aaf139e4295c3d93ea4", [:mix], [{:ecto, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "ecb045f9ac14a3e2990e54368f70cdb6e2f2abafc5bc329d6c31f0c74b653787"}, + "cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"}, + "crontab": {:hex, :crontab, "1.1.13", "3bad04f050b9f7f1c237809e42223999c150656a6b2afbbfef597d56df2144c5", [:mix], [{:ecto, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "d67441bec989640e3afb94e123f45a2bc42d76e02988c9613885dc3d01cf7085"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.18", "e1b2be73eb08a49fb032a0208bf647380682374a725dfb5b9e510def8397f6f2", [:mix], [], "hexpm", "114a0e85ec3cf9e04b811009e73c206394ffecfcc313e0b346de0d557774ee97"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"}, "elixir_uuid": {:hex, :elixir_uuid, "1.2.1", "dce506597acb7e6b0daeaff52ff6a9043f5919a4c3315abb4143f0b00378c097", [:mix], [], "hexpm", "f7eba2ea6c3555cea09706492716b0d87397b88946e6380898c2889d68585752"}, - "ex_doc": {:hex, :ex_doc, "0.26.0", "1922164bac0b18b02f84d6f69cab1b93bc3e870e2ad18d5dacb50a9e06b542a3", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2775d66e494a9a48355db7867478ffd997864c61c65a47d31c4949459281c78d"}, - "exq": {:hex, :exq, "0.16.2", "601c0486ce5eec5bcbda882b989a1d65a3611b729d8a92e402a77c87a0c367d8", [:mix], [{:elixir_uuid, ">= 1.2.0", [hex: :elixir_uuid, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, ">= 1.2.0 and < 5.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:redix, ">= 0.9.0", [hex: :redix, repo: "hexpm", optional: false]}], "hexpm", "7a0c5ff3d305c4dfb5a02d4c49f13a528e82039059716c70085ad10dfce7d018"}, + "ex_doc": {:hex, :ex_doc, "0.32.1", "21e40f939515373bcdc9cffe65f3b3543f05015ac6c3d01d991874129d173420", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "5142c9db521f106d61ff33250f779807ed2a88620e472ac95dc7d59c380113da"}, + "expo": {:hex, :expo, "0.5.2", "beba786aab8e3c5431813d7a44b828e7b922bfa431d6bfbada0904535342efe2", [:mix], [], "hexpm", "8c9bfa06ca017c9cb4020fabe980bc7fdb1aaec059fd004c2ab3bff03b1c599c"}, + "exq": {:hex, :exq, "0.19.0", "06eb92944dad39f0954dc8f63190d3e24d11734eef88cf5800883e57ebf74f3c", [:mix], [{:elixir_uuid, ">= 1.2.0", [hex: :elixir_uuid, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, ">= 1.2.0 and < 6.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:redix, ">= 0.9.0", [hex: :redix, repo: "hexpm", optional: false]}], "hexpm", "24fc0ebdd87cc7406e1034fb46c2419f9c8a362f0ec634d23b6b819514d36390"}, "exq_scheduler": {:hex, :exq_scheduler, "1.0.0", "fdac27c41be4930c88260b03c6f27167f1b92221587a69b26173b6af48d068b0", [:mix], [{:crontab, "~> 1.1", [hex: :crontab, repo: "hexpm", optional: false]}, {:elixir_uuid, "~> 1.2", [hex: :elixir_uuid, repo: "hexpm", optional: false]}, {:poison, "~> 3.1 or ~> 4.0 or ~> 5.0", [hex: :poison, repo: "hexpm", optional: true]}, {:redix, "~> 0.7 or ~> 1.0", [hex: :redix, repo: "hexpm", optional: false]}, {:timex, "~> 3.7", [hex: :timex, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "2b89d79fa9db91bbf78e3757f9b8b1b846e351aef82063c0baeb8081c3230264"}, - "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "floki": {:hex, :floki, "0.31.0", "f05ee8a8e6a3ced4e62beeb2c79a63bc8e12ab98fbaaf6e6a3d9b76b1278e23f", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "b05afa372f5c345a5bf240ac25ea1f0f3d5fcfd7490ac0beeb4a203f9444891e"}, - "gettext": {:hex, :gettext, "0.18.2", "7df3ea191bb56c0309c00a783334b288d08a879f53a7014341284635850a6e55", [:mix], [], "hexpm", "f9f537b13d4fdd30f3039d33cb80144c3aa1f8d9698e47d7bcbcc8df93b1f5c5"}, - "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, + "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, + "floki": {:hex, :floki, "0.36.1", "712b7f2ba19a4d5a47dfe3e74d81876c95bbcbee44fe551f0af3d2a388abb3da", [:mix], [], "hexpm", "21ba57abb8204bcc70c439b423fc0dd9f0286de67dc82773a14b0200ada0995f"}, + "gettext": {:hex, :gettext, "0.24.0", "6f4d90ac5f3111673cbefc4ebee96fe5f37a114861ab8c7b7d5b30a1108ce6d8", [:mix], [{:expo, "~> 0.5.1", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "bdf75cdfcbe9e4622dd18e034b227d77dd17f0f133853a1c73b97b3d6c770e8b"}, + "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"}, - "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, + "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, - "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"}, - "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, + "makeup": {:hex, :makeup, "1.1.1", "fa0bc768698053b2b3869fa8a62616501ff9d11a562f3ce39580d60860c3a55e", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5dc62fbdd0de44de194898b6710692490be74baa02d9d108bc29f007783b0b48"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"}, + "makeup_erlang": {:hex, :makeup_erlang, "0.1.5", "e0ff5a7c708dda34311f7522a8758e23bfcd7d8d8068dc312b5eb41c6fd76eba", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "94d2e986428585a21516d7d7149781480013c56e30c6a233534bedf38867a59a"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"}, + "nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "nimble_strftime": {:hex, :nimble_strftime, "0.1.1", "b988184d1bd945bc139b2c27dd00a6c0774ec94f6b0b580083abd62d5d07818b", [:mix], [], "hexpm", "89e599c9b8b4d1203b7bb5c79eb51ef7c6a28fbc6228230b312f8b796310d755"}, - "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, - "phoenix": {:hex, :phoenix, "1.7.7", "4cc501d4d823015007ba3cdd9c41ecaaf2ffb619d6fb283199fa8ddba89191e0", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "8966e15c395e5e37591b6ed0bd2ae7f48e961f0f60ac4c733f9566b519453085"}, - "phoenix_html": {:hex, :phoenix_html, "3.3.2", "d6ce982c6d8247d2fc0defe625255c721fb8d5f1942c5ac051f6177bffa5973f", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "44adaf8e667c1c20fb9d284b6b0fa8dc7946ce29e81ce621860aa7e96de9a11d"}, - "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"}, - "phoenix_live_view": {:hex, :phoenix_live_view, "0.18.18", "1f38fbd7c363723f19aad1a04b5490ff3a178e37daaf6999594d5f34796c47fc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a5810d0472f3189ede6d2a95bda7f31c6113156b91784a3426cb0ab6a6d85214"}, + "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, + "phoenix": {:hex, :phoenix, "1.7.12", "1cc589e0eab99f593a8aa38ec45f15d25297dd6187ee801c8de8947090b5a9d3", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "d646192fbade9f485b01bc9920c139bfdd19d0f8df3d73fd8eaf2dfbe0d2837c"}, + "phoenix_html": {:hex, :phoenix_html, "4.1.1", "4c064fd3873d12ebb1388425a8f2a19348cef56e7289e1998e2d2fa758aa982e", [:mix], [], "hexpm", "f2f2df5a72bc9a2f510b21497fd7d2b86d932ec0598f0210fed4114adc546c6f"}, + "phoenix_html_helpers": {:hex, :phoenix_html_helpers, "1.0.1", "7eed85c52eff80a179391036931791ee5d2f713d76a81d0d2c6ebafe1e11e5ec", [:mix], [{:phoenix_html, "~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "cffd2385d1fa4f78b04432df69ab8da63dc5cf63e07b713a4dcf36a3740e3090"}, + "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.5.3", "f2161c207fda0e4fb55165f650f7f8db23f02b29e3bff00ff7ef161d6ac1f09d", [:mix], [{:file_system, "~> 0.3 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "b4ec9cd73cb01ff1bd1cac92e045d13e7030330b74164297d1aee3907b54803c"}, + "phoenix_live_view": {:hex, :phoenix_live_view, "0.20.14", "70fa101aa0539e81bed4238777498f6215e9dda3461bdaa067cad6908110c364", [:mix], [{:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "82f6d006c5264f979ed5eb75593d808bbe39020f20df2e78426f4f2d570e2402"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, - "phoenix_template": {:hex, :phoenix_template, "1.0.3", "32de561eefcefa951aead30a1f94f1b5f0379bc9e340bb5c667f65f1edfa4326", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "16f4b6588a4152f3cc057b9d0c0ba7e82ee23afa65543da535313ad8d25d8e2c"}, - "phoenix_view": {:hex, :phoenix_view, "2.0.2", "6bd4d2fd595ef80d33b439ede6a19326b78f0f1d8d62b9a318e3d9c1af351098", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "a929e7230ea5c7ee0e149ffcf44ce7cf7f4b6d2bfe1752dd7c084cdff152d36f"}, - "plug": {:hex, :plug, "1.14.2", "cff7d4ec45b4ae176a227acd94a7ab536d9b37b942c8e8fa6dfc0fff98ff4d80", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "842fc50187e13cf4ac3b253d47d9474ed6c296a8732752835ce4a86acdf68d13"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"}, - "plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"}, + "phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"}, + "phoenix_view": {:hex, :phoenix_view, "2.0.3", "4d32c4817fce933693741deeb99ef1392619f942633dde834a5163124813aad3", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "cd34049af41be2c627df99cd4eaa71fc52a328c0c3d8e7d4aa28f880c30e7f64"}, + "plug": {:hex, :plug, "1.15.3", "712976f504418f6dff0a3e554c40d705a9bcf89a7ccef92fc6a5ef8f16a30a97", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cc4365a3c010a56af402e0809208873d113e9c38c401cabd88027ef4f5c01fd2"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.7.1", "87677ffe3b765bc96a89be7960f81703223fe2e21efa42c125fcd0127dd9d6b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "02dbd5f9ab571b864ae39418db7811618506256f6d13b4a45037e5fe78dc5de3"}, + "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, - "redix": {:hex, :redix, "1.1.5", "6fc460d66a5c2287e83e6d73dddc8d527ff59cb4d4f298b41e03a4db8c3b2bd5", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "679afdd4c14502fe9c11387ff1cdcb33065a1cf511097da1eee407f17c7a418b"}, - "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, + "redix": {:hex, :redix, "1.5.0", "fffadf4526722ba9f062c0bda64e881613fbf99c2c1708692751def8fe6d546d", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.5.0 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "01084c005339c1eb8f2ba9e3737277ec3648d1e9b5c8e96525dcdb38e474ca96"}, + "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"}, "telemetry_poller": {:hex, :telemetry_poller, "0.5.1", "21071cc2e536810bac5628b935521ff3e28f0303e770951158c73eaaa01e962a", [:rebar3], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4cab72069210bc6e7a080cec9afffad1b33370149ed5d379b81c7c5f0c663fd4"}, - "timex": {:hex, :timex, "3.7.9", "790cdfc4acfce434e442f98c02ea6d84d0239073bfd668968f82ac63e9a6788d", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.1", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "64691582e5bb87130f721fc709acfb70f24405833998fabf35be968984860ce1"}, + "timex": {:hex, :timex, "3.7.11", "bb95cb4eb1d06e27346325de506bcc6c30f9c6dea40d1ebe390b262fad1862d1", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.20", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.1", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "8b9024f7efbabaf9bd7aa04f65cf8dcd7c9818ca5737677c7b76acbc6a94d1aa"}, "tzdata": {:hex, :tzdata, "1.1.1", "20c8043476dfda8504952d00adac41c6eda23912278add38edc140ae0c5bcc46", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a69cec8352eafcd2e198dea28a34113b60fdc6cb57eb5ad65c10292a6ba89787"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, - "websock_adapter": {:hex, :websock_adapter, "0.5.4", "7af8408e7ed9d56578539594d1ee7d8461e2dd5c3f57b0f2a5352d610ddde757", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "d2c238c79c52cbe223fcdae22ca0bb5007a735b9e933870e241fce66afb4f4ab"}, + "websock_adapter": {:hex, :websock_adapter, "0.5.6", "0437fe56e093fd4ac422de33bf8fc89f7bc1416a3f2d732d8b2c8fd54792fe60", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "e04378d26b0af627817ae84c92083b7e97aca3121196679b73c73b99d0d133ea"}, } diff --git a/priv/static/js/app.js b/priv/static/js/app.js index e1632a7..6179e9e 100644 --- a/priv/static/js/app.js +++ b/priv/static/js/app.js @@ -1,2 +1,2 @@ /*! For license information please see app.js.LICENSE.txt */ -(()=>{var t={458:()=>{"use strict";!function(){var t=function(){if("function"==typeof window.CustomEvent)return window.CustomEvent;function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}return t.prototype=window.Event.prototype,t}();function e(t,e){var n=document.createElement("input");return n.type="hidden",n.name=t,n.value=e,n}function n(t,n){var i=t.getAttribute("data-to"),r=e("_method",t.getAttribute("data-method")),s=e("_csrf_token",t.getAttribute("data-csrf")),o=document.createElement("form"),a=document.createElement("input"),l=t.getAttribute("target");o.method="get"===t.getAttribute("data-method")?"get":"post",o.action=i,o.style.display="none",l?o.target=l:n&&(o.target="_blank"),o.appendChild(s),o.appendChild(r),document.body.appendChild(o),a.type="submit",o.appendChild(a),a.click()}window.addEventListener("click",(function(e){var i=e.target;if(!e.defaultPrevented)for(;i&&i.getAttribute;){var r=new t("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!i.dispatchEvent(r))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(i.getAttribute("data-method"))return n(i,e.metaKey||e.shiftKey),e.preventDefault(),!1;i=i.parentNode}}),!1),window.addEventListener("phoenix.link.click",(function(t){var e=t.target.getAttribute("data-confirm");e&&!window.confirm(e)&&t.preventDefault()}),!1)}()},747:function(t,e,n){var i;(function(r,s){"use strict";!function(){for(var t=0,e=["ms","moz","webkit","o"],n=0;n=0||t.indexOf("-")>=0?h:0)+parseFloat(t)),h=t>1?1:t,d()),h},hide:function(){u&&(u=!1,null!=a&&(r.cancelAnimationFrame(a),a=null),function t(){if(f.progress("+.1")>=1&&(o.style.opacity-=.05,o.style.opacity<=.05))return o.style.display="none",void(l=null);l=r.requestAnimationFrame(t)}())}};"object"==typeof t.exports?t.exports=f:void 0===(i=function(){return f}.call(e,n,e,t))||(t.exports=i)}).call(this,window,document)}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";n(458);var t=t=>{if("function"==typeof t)return t;return function(){return t}},e="undefined"!=typeof self?self:null,i="undefined"!=typeof window?window:null,r=e||i||r,s=0,o=1,a=2,l=3,h="closed",u="errored",c="joined",d="joining",f="leaving",p="phx_close",g="phx_error",m="phx_join",v="phx_reply",y="phx_leave",b="longpoll",w="websocket",k=4,_=class{constructor(t,e,n,i){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(e=>e.status===t).forEach(t=>t.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},x=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},E=class{static request(t,e,n,i,s,o,a){if(r.XDomainRequest){let n=new r.XDomainRequest;return this.xdomainRequest(n,t,e,i,s,o,a)}{let l=new r.XMLHttpRequest;return this.xhrRequest(l,t,e,n,i,s,o,a)}}static xdomainRequest(t,e,n,i,r,s,o){return t.timeout=r,t.open(e,n),t.onload=()=>{let e=this.parseJSON(t.responseText);o&&o(e)},s&&(t.ontimeout=s),t.onprogress=()=>{},t.send(i),t}static xhrRequest(t,e,n,i,r,s,o,a){return t.open(e,n,!0),t.timeout=s,t.setRequestHeader("Content-Type",i),t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===k&&a){let e=this.parseJSON(t.responseText);a(e)}},o&&(t.ontimeout=o),t.send(r),t}static parseJSON(t){if(!t||""===t)return null;try{return JSON.parse(t)}catch(e){return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let r=e?`${e}[${i}]`:i,s=t[i];"object"==typeof s?n.push(this.serialize(s,r)):n.push(encodeURIComponent(r)+"="+encodeURIComponent(s))}return n.join("&")}static appendParams(t,e){if(0===Object.keys(e).length)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},C=class{constructor(t){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=s,this.poll()}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+w),"$1/"+b)}endpointURL(){return E.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=s}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===o||this.readyState===s}poll(){this.ajax("GET","application/json",null,()=>this.ontimeout(),t=>{if(t){var{status:e,token:n,messages:i}=t;this.token=n}else e=0;switch(e){case 200:i.forEach(t=>{setTimeout(()=>this.onmessage({data:t}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=o,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error("unhandled poll status "+e)}})}send(t){"string"!=typeof t&&(t=(t=>{let e="",n=new Uint8Array(t),i=n.byteLength;for(let t=0;t{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",t.join("\n"),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,t&&200===t.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1))})}close(t,e,n){for(let t of this.reqs)t.abort();this.readyState=l;let i=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",i)):this.onclose(i)}ajax(t,e,n,i,r){let s;s=E.request(t,this.endpointURL(),e,n,this.timeout,()=>{this.reqs.delete(s),i()},t=>{this.reqs.delete(s),this.isActive()&&r(t)}),this.reqs.add(s)}},A={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,i,r,s,o]=JSON.parse(t);return e({join_ref:n,ref:i,topic:r,event:s,payload:o})}},binaryEncode(t){let{join_ref:e,ref:n,event:i,topic:r,payload:s}=t,o=this.META_LENGTH+e.length+n.length+r.length+i.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),h=0;l.setUint8(h++,this.KINDS.push),l.setUint8(h++,e.length),l.setUint8(h++,n.length),l.setUint8(h++,r.length),l.setUint8(h++,i.length),Array.from(e,t=>l.setUint8(h++,t.charCodeAt(0))),Array.from(n,t=>l.setUint8(h++,t.charCodeAt(0))),Array.from(r,t=>l.setUint8(h++,t.charCodeAt(0))),Array.from(i,t=>l.setUint8(h++,t.charCodeAt(0)));var u=new Uint8Array(a.byteLength+s.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(s),a.byteLength),u.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,i);case this.KINDS.reply:return this.decodeReply(t,e,i);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,i)}},decodePush(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),s=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(t.slice(o,o+i));o+=i;let l=n.decode(t.slice(o,o+r));o+=r;let h=n.decode(t.slice(o,o+s));return o+=s,{join_ref:a,ref:null,topic:l,event:h,payload:t.slice(o,t.byteLength)}},decodeReply(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),s=e.getUint8(3),o=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(t.slice(a,a+i));a+=i;let h=n.decode(t.slice(a,a+r));a+=r;let u=n.decode(t.slice(a,a+s));a+=s;let c=n.decode(t.slice(a,a+o));a+=o;let d=t.slice(a,t.byteLength);return{join_ref:l,ref:h,topic:u,event:v,payload:{status:c,response:d}}},decodeBroadcast(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),s=this.HEADER_LENGTH+2,o=n.decode(t.slice(s,s+i));s+=i;let a=n.decode(t.slice(s,s+r));return s+=r,{join_ref:null,ref:null,topic:o,event:a,payload:t.slice(s,t.byteLength)}}},S=n(747),T=n.n(S),M=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading"],L="data-phx-component",D="data-phx-ref",P="data-phx-ref-src",N="data-phx-upload-ref",R="data-phx-parent-id",I="data-phx-root-id",F=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],U=["checkbox","radio"],O="data-phx-session",$=`[${O}]`,H="data-phx-static",j="phx:live-socket:debug",B={debounce:300,throttle:300},q="d",J="s",V="e",W="r",z="t",Y="stream",X=(t,e)=>console.error&&console.error(t,e),G=t=>{let e=typeof t;return"number"===e||"string"===e&&/^(0|[1-9]\d*)$/.test(t)};var K,Z=t=>"function"==typeof t?t:function(){return t},Q=t=>JSON.parse(JSON.stringify(t)),tt=(t,e,n)=>{do{if(t.matches(`[${e}]`)&&!t.disabled)return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType&&!(n&&n.isSameNode(t)||t.matches($)));return null},et=t=>null!==t&&"object"==typeof t&&!(t instanceof Array),nt=t=>{for(let e in t)return!1;return!0},it=(t,e)=>t&&e(t),rt=function(t,e,n,i){t.forEach(t=>{new class{constructor(t,e,n){this.liveSocket=n,this.entry=t,this.offset=0,this.chunkSize=e,this.chunkTimer=null,this.uploadChannel=n.channel("lvu:"+t.ref,{token:t.metadata()})}error(t){clearTimeout(this.chunkTimer),this.uploadChannel.leave(),this.entry.error(t)}upload(){this.uploadChannel.onError(t=>this.error(t)),this.uploadChannel.join().receive("ok",t=>this.readNextChunk()).receive("error",t=>this.error(t))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let t=new window.FileReader,e=this.entry.file.slice(this.offset,this.chunkSize+this.offset);t.onload=t=>{if(null!==t.target.error)return X("Read error: "+t.target.error);this.offset+=t.target.result.byteLength,this.pushChunk(t.target.result)},t.readAsArrayBuffer(e)}pushChunk(t){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",t).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))})}}(t,n.config.chunk_size,i).upload()})},st={canPushState:()=>void 0!==history.pushState,dropLocal(t,e,n){return t.removeItem(this.localKey(e,n))},updateLocal(t,e,n,i,r){let s=this.getLocal(t,e,n),o=this.localKey(e,n),a=null===s?i:r(s);return t.setItem(o,JSON.stringify(a)),a},getLocal(t,e,n){return JSON.parse(t.getItem(this.localKey(e,n)))},updateCurrentState(t){this.canPushState()&&history.replaceState(t(history.state||{}),"",window.location.href)},pushState(t,e,n){if(this.canPushState()){if(n!==window.location.href){if("redirect"==e.type&&e.scroll){let t=history.state||{};t.scroll=e.scroll,history.replaceState(t,"",window.location.href)}delete e.scroll,history[t+"State"](e,"",n||null);let i=this.getHashTargetEl(window.location.hash);i?i.scrollIntoView():"redirect"===e.type&&window.scroll(0,0)}}else this.redirect(n)},setCookie(t,e){document.cookie=`${t}=${e}`},getCookie:t=>document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${t}s*=s*([^;]*).*$)|^.*$`),"$1"),redirect(t,e){e&&st.setCookie("__phoenix_flash__",e+"; max-age=60000; path=/"),window.location=t},localKey:(t,e)=>`${t}-${e}`,getHashTargetEl(t){let e=t.toString().substring(1);if(""!==e)return document.getElementById(e)||document.querySelector(`a[name="${e}"]`)}},ot=st,at={byId:t=>document.getElementById(t)||X("no id found for "+t),removeClass(t,e){t.classList.remove(e),0===t.classList.length&&t.removeAttribute("class")},all(t,e,n){if(!t)return[];let i=Array.from(t.querySelectorAll(e));return n?i.forEach(n):i},childNodeLength(t){let e=document.createElement("template");return e.innerHTML=t,e.content.childElementCount},isUploadInput:t=>"file"===t.type&&null!==t.getAttribute(N),findUploadInputs(t){return this.all(t,`input[type="file"][${N}]`)},findComponentNodeList(t,e){return this.filterWithinSameLiveView(this.all(t,`[${L}="${e}"]`),t)},isPhxDestroyed:t=>!(!t.id||!at.private(t,"destroyed")),wantsNewTab:t=>t.ctrlKey||t.shiftKey||t.metaKey||t.button&&1===t.button||"_blank"===t.target.getAttribute("target"),isUnloadableFormSubmit(t){return!t.defaultPrevented&&!this.wantsNewTab(t)},isNewPageHref(t,e){let n;try{n=new URL(t)}catch(i){try{n=new URL(t,e)}catch(t){return!0}}return n.host!==e.host||n.protocol!==e.protocol||n.pathname!==e.pathname||n.search!==e.search||""===n.hash&&!n.href.endsWith("#")},markPhxChildDestroyed(t){this.isPhxChild(t)&&t.setAttribute(O,""),this.putPrivate(t,"destroyed",!0)},findPhxChildrenInFragment(t,e){let n=document.createElement("template");return n.innerHTML=t,this.findPhxChildren(n.content,e)},isIgnored:(t,e)=>"ignore"===(t.getAttribute(e)||t.getAttribute("data-phx-update")),isPhxUpdate:(t,e,n)=>t.getAttribute&&n.indexOf(t.getAttribute(e))>=0,findPhxSticky(t){return this.all(t,"[data-phx-sticky]")},findPhxChildren(t,e){return this.all(t,`${$}[${R}="${e}"]`)},findParentCIDs(t,e){let n=new Set(e),i=e.reduce((e,n)=>{let i=`[${L}="${n}"] [${L}]`;return this.filterWithinSameLiveView(this.all(t,i),t).map(t=>parseInt(t.getAttribute(L))).forEach(t=>e.delete(t)),e},n);return 0===i.size?new Set(e):i},filterWithinSameLiveView(t,e){return e.querySelector($)?t.filter(t=>this.withinSameLiveView(t,e)):t},withinSameLiveView(t,e){for(;t=t.parentNode;){if(t.isSameNode(e))return!0;if(null!==t.getAttribute(O))return!1}},private:(t,e)=>t.phxPrivate&&t.phxPrivate[e],deletePrivate(t,e){t.phxPrivate&&delete t.phxPrivate[e]},putPrivate(t,e,n){t.phxPrivate||(t.phxPrivate={}),t.phxPrivate[e]=n},updatePrivate(t,e,n,i){let r=this.private(t,e);void 0===r?this.putPrivate(t,e,i(n)):this.putPrivate(t,e,i(r))},copyPrivates(t,e){e.phxPrivate&&(t.phxPrivate=e.phxPrivate)},putTitle(t){let e=document.querySelector("title");if(e){let{prefix:n,suffix:i}=e.dataset;document.title=`${n||""}${t}${i||""}`}else document.title=t},debounce(t,e,n,i,r,s,o,a){let l=t.getAttribute(n),h=t.getAttribute(r);""===l&&(l=i),""===h&&(h=s);let u=l||h;switch(u){case null:return a();case"blur":return void(this.once(t,"debounce-blur")&&t.addEventListener("blur",()=>a()));default:let n=parseInt(u),i=()=>h?this.deletePrivate(t,"throttled"):a(),r=this.incCycle(t,"debounce-trigger",i);if(isNaN(n))return X("invalid throttle/debounce value: "+u);if(h){let i=!1;if("keydown"===e.type){let n=this.private(t,"debounce-prev-key");this.putPrivate(t,"debounce-prev-key",e.key),i=n!==e.key}if(!i&&this.private(t,"throttled"))return!1;a(),this.putPrivate(t,"throttled",!0),setTimeout(()=>{o()&&this.triggerCycle(t,"debounce-trigger")},n)}else setTimeout(()=>{o()&&this.triggerCycle(t,"debounce-trigger",r)},n);let s=t.form;s&&this.once(s,"bind-debounce")&&s.addEventListener("submit",()=>{Array.from(new FormData(s).entries(),([t])=>{let e=s.querySelector(`[name="${t}"]`);this.incCycle(e,"debounce-trigger"),this.deletePrivate(e,"throttled")})}),this.once(t,"bind-debounce")&&t.addEventListener("blur",()=>this.triggerCycle(t,"debounce-trigger"))}},triggerCycle(t,e,n){let[i,r]=this.private(t,e);n||(n=i),n===i&&(this.incCycle(t,e),r())},once(t,e){return!0!==this.private(t,e)&&(this.putPrivate(t,e,!0),!0)},incCycle(t,e,n=function(){}){let[i]=this.private(t,e)||[0,n];return i++,this.putPrivate(t,e,[i,n]),i},discardError(t,e,n){let i=e.getAttribute&&e.getAttribute(n),r=i&&t.querySelector(`[id="${i}"], [name="${i}"], [name="${i}[]"]`);r&&(this.private(r,"phx-has-focused")||this.private(r,"phx-has-submitted")||e.classList.add("phx-no-feedback"))},resetForm(t,e){Array.from(t.elements).forEach(t=>{let n=`[${e}="${t.id}"],\n [${e}="${t.name}"],\n [${e}="${t.name.replace(/\[\]$/,"")}"]`;this.deletePrivate(t,"phx-has-focused"),this.deletePrivate(t,"phx-has-submitted"),this.all(document,n,t=>{t.classList.add("phx-no-feedback")})})},showError(t,e){(t.id||t.name)&&this.all(t.form,`[${e}="${t.id}"], [${e}="${t.name}"]`,t=>{this.removeClass(t,"phx-no-feedback")})},isPhxChild:t=>t.getAttribute&&t.getAttribute(R),isPhxSticky:t=>t.getAttribute&&null!==t.getAttribute("data-phx-sticky"),firstPhxChild(t){return this.isPhxChild(t)?t:this.all(t,`[${R}]`)[0]},dispatchEvent(t,e,n={}){let i={bubbles:void 0===n.bubbles||!!n.bubbles,cancelable:!0,detail:n.detail||{}},r="click"===e?new MouseEvent("click",i):new CustomEvent(e,i);t.dispatchEvent(r)},cloneNode(t,e){if(void 0===e)return t.cloneNode(!0);{let n=t.cloneNode(!1);return n.innerHTML=e,n}},mergeAttrs(t,e,n={}){let i=n.exclude||[],r=n.isIgnored,s=e.attributes;for(let n=s.length-1;n>=0;n--){let r=s[n].name;i.indexOf(r)<0&&t.setAttribute(r,e.getAttribute(r))}let o=t.attributes;for(let n=o.length-1;n>=0;n--){let i=o[n].name;r?i.startsWith("data-")&&!e.hasAttribute(i)&&t.removeAttribute(i):e.hasAttribute(i)||t.removeAttribute(i)}},mergeFocusedInput(t,e){t instanceof HTMLSelectElement||at.mergeAttrs(t,e,{exclude:["value"]}),e.readOnly?t.setAttribute("readonly",!0):t.removeAttribute("readonly")},hasSelectionRange:t=>t.setSelectionRange&&("text"===t.type||"textarea"===t.type),restoreFocus(t,e,n){if(!at.isTextualInput(t))return;let i=t.matches(":focus");t.readOnly&&t.blur(),i||t.focus(),this.hasSelectionRange(t)&&t.setSelectionRange(e,n)},isFormInput:t=>/^(?:input|select|textarea)$/i.test(t.tagName)&&"button"!==t.type,syncAttrsToProps(t){t instanceof HTMLInputElement&&U.indexOf(t.type.toLocaleLowerCase())>=0&&(t.checked=null!==t.getAttribute("checked"))},isTextualInput:t=>F.indexOf(t.type)>=0,isNowTriggerFormExternal:(t,e)=>t.getAttribute&&null!==t.getAttribute(e),syncPendingRef(t,e,n){let i=t.getAttribute(D);if(null===i)return!0;let r=t.getAttribute(P);return at.isFormInput(t)||null!==t.getAttribute(n)?(at.isUploadInput(t)&&at.mergeAttrs(t,e,{isIgnored:!0}),at.putPrivate(t,D,e),!1):(M.forEach(n=>{t.classList.contains(n)&&e.classList.add(n)}),e.setAttribute(D,i),e.setAttribute(P,r),!0)},cleanChildNodes(t,e){if(at.isPhxUpdate(t,e,["append","prepend"])){let e=[];t.childNodes.forEach(t=>{if(!t.id){t.nodeType===Node.TEXT_NODE&&""===t.nodeValue.trim()||X(`only HTML element tags with an id are allowed inside containers with phx-update.\n\nremoving illegal node: "${(t.outerHTML||t.nodeValue).trim()}"\n\n`),e.push(t)}}),e.forEach(t=>t.remove())}},replaceRootContainer(t,e,n){let i=new Set(["id",O,H,"data-phx-main",I]);if(t.tagName.toLowerCase()===e.toLowerCase())return Array.from(t.attributes).filter(t=>!i.has(t.name.toLowerCase())).forEach(e=>t.removeAttribute(e.name)),Object.keys(n).filter(t=>!i.has(t.toLowerCase())).forEach(e=>t.setAttribute(e,n[e])),t;{let r=document.createElement(e);return Object.keys(n).forEach(t=>r.setAttribute(t,n[t])),i.forEach(e=>r.setAttribute(e,t.getAttribute(e))),r.innerHTML=t.innerHTML,t.replaceWith(r),r}},getSticky(t,e,n){let i=(at.private(t,"sticky")||[]).find(([t])=>e===t);if(i){let[t,e,n]=i;return n}return"function"==typeof n?n():n},deleteSticky(t,e){this.updatePrivate(t,"sticky",[],t=>t.filter(([t,n])=>t!==e))},putSticky(t,e,n){let i=n(t);this.updatePrivate(t,"sticky",[],t=>{let r=t.findIndex(([t])=>e===t);return r>=0?t[r]=[e,n,i]:t.push([e,n,i]),t})},applyStickyOperations(t){let e=at.private(t,"sticky");e&&e.forEach(([e,n,i])=>this.putSticky(t,e,n))}},lt=at,ht=class{static isActive(t,e){let n=void 0===e._phxRef,i=t.getAttribute("data-phx-active-refs").split(",").indexOf(ct.genFileRef(e))>=0;return e.size>0&&(n||i)}static isPreflighted(t,e){return t.getAttribute("data-phx-preflighted-refs").split(",").indexOf(ct.genFileRef(e))>=0&&this.isActive(t,e)}constructor(t,e,n){this.ref=ct.genFileRef(e),this.fileEl=t,this.file=e,this.view=n,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener("phx:live-file:updated",this._onElUpdated)}metadata(){return this.meta}progress(t){this._progress=Math.floor(t),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{ct.untrackFile(this.fileEl,this.file),this._onDone()})):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}cancel(){this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(t="failed"){this.fileEl.removeEventListener("phx:live-file:updated",this._onElUpdated),this.view.pushFileProgress(this.fileEl,this.ref,{error:t}),ct.clearFiles(this.fileEl)}onDone(t){this._onDone=()=>{this.fileEl.removeEventListener("phx:live-file:updated",this._onElUpdated),t()}}onElUpdated(){-1===this.fileEl.getAttribute("data-phx-active-refs").split(",").indexOf(this.ref)&&this.cancel()}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,relative_path:this.file.webkitRelativePath,size:this.file.size,type:this.file.type,ref:this.ref}}uploader(t){if(this.meta.uploader){let e=t[this.meta.uploader]||X("no uploader configured for "+this.meta.uploader);return{name:this.meta.uploader,callback:e}}return{name:"channel",callback:rt}}zipPostFlight(t){this.meta=t.entries[this.ref],this.meta||X("no preflight upload response returned with ref "+this.ref,{input:this.fileEl,response:t})}},ut=0,ct=class{static genFileRef(t){let e=t._phxRef;return void 0!==e?e:(t._phxRef=(ut++).toString(),t._phxRef)}static getEntryDataURL(t,e,n){let i=this.activeFiles(t).find(t=>this.genFileRef(t)===e);n(URL.createObjectURL(i))}static hasUploadsInProgress(t){let e=0;return lt.findUploadInputs(t).forEach(t=>{t.getAttribute("data-phx-preflighted-refs")!==t.getAttribute("data-phx-done-refs")&&e++}),e>0}static serializeUploads(t){let e=this.activeFiles(t),n={};return e.forEach(e=>{let i={path:t.name},r=t.getAttribute(N);n[r]=n[r]||[],i.ref=this.genFileRef(e),i.last_modified=e.lastModified,i.name=e.name||i.ref,i.relative_path=e.webkitRelativePath,i.type=e.type,i.size=e.size,n[r].push(i)}),n}static clearFiles(t){t.value=null,t.removeAttribute(N),lt.putPrivate(t,"files",[])}static untrackFile(t,e){lt.putPrivate(t,"files",lt.private(t,"files").filter(t=>!Object.is(t,e)))}static trackFiles(t,e,n){if(null!==t.getAttribute("multiple")){let n=e.filter(e=>!this.activeFiles(t).find(t=>Object.is(t,e)));lt.putPrivate(t,"files",this.activeFiles(t).concat(n)),t.value=null}else n&&n.files.length>0&&(t.files=n.files),lt.putPrivate(t,"files",e)}static activeFileInputs(t){let e=lt.findUploadInputs(t);return Array.from(e).filter(t=>t.files&&this.activeFiles(t).length>0)}static activeFiles(t){return(lt.private(t,"files")||[]).filter(e=>ht.isActive(t,e))}static inputsAwaitingPreflight(t){let e=lt.findUploadInputs(t);return Array.from(e).filter(t=>this.filesAwaitingPreflight(t).length>0)}static filesAwaitingPreflight(t){return this.activeFiles(t).filter(e=>!ht.isPreflighted(t,e))}constructor(t,e,n){this.view=e,this.onComplete=n,this._entries=Array.from(ct.filesAwaitingPreflight(t)||[]).map(n=>new ht(t,n,e)),this.numEntriesInProgress=this._entries.length}entries(){return this._entries}initAdapterUpload(t,e,n){this._entries=this._entries.map(e=>(e.zipPostFlight(t),e.onDone(()=>{this.numEntriesInProgress--,0===this.numEntriesInProgress&&this.onComplete()}),e));let i=this._entries.reduce((t,e)=>{let{name:i,callback:r}=e.uploader(n.uploaders);return t[i]=t[i]||{callback:r,entries:[]},t[i].entries.push(e),t},{});for(let r in i){let{callback:s,entries:o}=i[r];s(o,e,t,n)}}},dt={focusMain(){let t=document.querySelector("main h1, main, h1");if(t){let e=t.tabIndex;t.tabIndex=-1,t.focus(),t.tabIndex=e}},anyOf:(t,e)=>e.find(e=>t instanceof e),isFocusable(t,e){return t instanceof HTMLAnchorElement&&"ignore"!==t.rel||t instanceof HTMLAreaElement&&void 0!==t.href||!t.disabled&&this.anyOf(t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement])||t instanceof HTMLIFrameElement||t.tabIndex>0||!e&&0===t.tabIndex&&null!==t.getAttribute("tabindex")&&"true"!==t.getAttribute("aria-hidden")},attemptFocus(t,e){if(this.isFocusable(t,e))try{t.focus()}catch(t){}return!!document.activeElement&&document.activeElement.isSameNode(t)},focusFirstInteractive(t){let e=t.firstElementChild;for(;e;){if(this.attemptFocus(e,!0)||this.focusFirstInteractive(e,!0))return!0;e=e.nextElementSibling}},focusFirst(t){let e=t.firstElementChild;for(;e;){if(this.attemptFocus(e)||this.focusFirst(e))return!0;e=e.nextElementSibling}},focusLast(t){let e=t.lastElementChild;for(;e;){if(this.attemptFocus(e)||this.focusLast(e))return!0;e=e.previousElementSibling}}},ft={LiveFileUpload:{activeRefs(){return this.el.getAttribute("data-phx-active-refs")},preflightedRefs(){return this.el.getAttribute("data-phx-preflighted-refs")},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let t=this.preflightedRefs();this.preflightedWas!==t&&(this.preflightedWas=t,""===t&&this.__view.cancelSubmit(this.el.form)),""===this.activeRefs()&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent("phx:live-file:updated"))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(N)),ct.getEntryDataURL(this.inputEl,this.ref,t=>{this.url=t,this.el.src=t})},destroyed(){URL.revokeObjectURL(this.url)}},FocusWrap:{mounted(){this.focusStart=this.el.firstElementChild,this.focusEnd=this.el.lastElementChild,this.focusStart.addEventListener("focus",()=>dt.focusLast(this.el)),this.focusEnd.addEventListener("focus",()=>dt.focusFirst(this.el)),this.el.addEventListener("phx:show-end",()=>this.el.focus()),"none"!==window.getComputedStyle(this.el).display&&dt.focusFirst(this.el)}}};var pt="undefined"==typeof document?void 0:document,gt=!!pt&&"content"in pt.createElement("template"),mt=!!pt&&pt.createRange&&"createContextualFragment"in pt.createRange();function vt(t){return t=t.trim(),gt?function(t){var e=pt.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}(t):mt?function(t){return K||(K=pt.createRange()).selectNode(pt.body),K.createContextualFragment(t).childNodes[0]}(t):function(t){var e=pt.createElement("body");return e.innerHTML=t,e.childNodes[0]}(t)}function yt(t,e){var n,i,r=t.nodeName,s=e.nodeName;return r===s||(n=r.charCodeAt(0),i=s.charCodeAt(0),n<=90&&i>=97?r===s.toUpperCase():i<=90&&n>=97&&s===r.toUpperCase())}function bt(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n))}var wt={OPTION:function(t,e){var n=t.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),n.selectedIndex=-1)}bt(t,e,"selected")},INPUT:function(t,e){bt(t,e,"checked"),bt(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;t.value!==n&&(t.value=n);var i=t.firstChild;if(i){var r=i.nodeValue;if(r==n||!n&&r==t.placeholder)return;i.nodeValue=n}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var n,i,r=-1,s=0,o=t.firstChild;o;)if("OPTGROUP"===(i=o.nodeName&&o.nodeName.toUpperCase()))o=(n=o).firstChild;else{if("OPTION"===i){if(o.hasAttribute("selected")){r=s;break}s++}!(o=o.nextSibling)&&n&&(o=n.nextSibling,n=null)}t.selectedIndex=r}}};function kt(){}function _t(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}var xt,Et=(xt=function(t,e){var n,i,r,s,o=e.attributes;if(11!==e.nodeType&&11!==t.nodeType){for(var a=o.length-1;a>=0;a--)i=(n=o[a]).name,r=n.namespaceURI,s=n.value,r?(i=n.localName||i,t.getAttributeNS(r,i)!==s&&("xmlns"===n.prefix&&(i=n.name),t.setAttributeNS(r,i,s))):t.getAttribute(i)!==s&&t.setAttribute(i,s);for(var l=t.attributes,h=l.length-1;h>=0;h--)i=(n=l[h]).name,(r=n.namespaceURI)?(i=n.localName||i,e.hasAttributeNS(r,i)||t.removeAttributeNS(r,i)):e.hasAttribute(i)||t.removeAttribute(i)}},function(t,e,n){if(n||(n={}),"string"==typeof e)if("#document"===t.nodeName||"HTML"===t.nodeName||"BODY"===t.nodeName){var i=e;(e=pt.createElement("html")).innerHTML=i}else e=vt(e);else 11===e.nodeType&&(e=e.firstElementChild);var r=n.getNodeKey||_t,s=n.onBeforeNodeAdded||kt,o=n.onNodeAdded||kt,a=n.onBeforeElUpdated||kt,l=n.onElUpdated||kt,h=n.onBeforeNodeDiscarded||kt,u=n.onNodeDiscarded||kt,c=n.onBeforeElChildrenUpdated||kt,d=n.skipFromChildren||kt,f=n.addChild||function(t,e){return t.appendChild(e)},p=!0===n.childrenOnly,g=Object.create(null),m=[];function v(t){m.push(t)}function y(t,e,n){!1!==h(t)&&(e&&e.removeChild(t),u(t),function t(e,n){if(1===e.nodeType)for(var i=e.firstChild;i;){var s=void 0;n&&(s=r(i))?v(s):(u(i),i.firstChild&&t(i,n)),i=i.nextSibling}}(t,n))}function b(t){o(t);for(var e=t.firstChild;e;){var n=e.nextSibling,i=r(e);if(i){var s=g[i];s&&yt(e,s)?(e.parentNode.replaceChild(s,e),w(s,e)):b(e)}else b(e);e=n}}function w(t,e,n){var i=r(e);if(i&&delete g[i],!n){if(!1===a(t,e))return;if(xt(t,e),l(t),!1===c(t,e))return}"TEXTAREA"!==t.nodeName?function(t,e){var n,i,o,a,l,h=d(t),u=e.firstChild,c=t.firstChild;t:for(;u;){for(a=u.nextSibling,n=r(u);!h&&c;){if(o=c.nextSibling,u.isSameNode&&u.isSameNode(c)){u=a,c=o;continue t}i=r(c);var p=c.nodeType,m=void 0;if(p===u.nodeType&&(1===p?(n?n!==i&&((l=g[n])?o===l?m=!1:(t.insertBefore(l,c),i?v(i):y(c,t,!0),c=l):m=!1):i&&(m=!1),(m=!1!==m&&yt(c,u))&&w(c,u)):3!==p&&8!=p||(m=!0,c.nodeValue!==u.nodeValue&&(c.nodeValue=u.nodeValue))),m){u=a,c=o;continue t}i?v(i):y(c,t,!0),c=o}if(n&&(l=g[n])&&yt(l,u))h||f(t,l),w(l,u);else{var k=s(u);!1!==k&&(k&&(u=k),u.actualize&&(u=u.actualize(t.ownerDocument||pt)),f(t,u),b(u))}u=a,c=o}!function(t,e,n){for(;e;){var i=e.nextSibling;(n=r(e))?v(n):y(e,t,!0),e=i}}(t,c,i);var _=wt[t.nodeName];_&&_(t,e)}(t,e):wt.TEXTAREA(t,e)}!function t(e){if(1===e.nodeType||11===e.nodeType)for(var n=e.firstChild;n;){var i=r(n);i&&(g[i]=n),t(n),n=n.nextSibling}}(t);var k,_,x=t,E=x.nodeType,C=e.nodeType;if(!p)if(1===E)1===C?yt(t,e)||(u(t),x=function(t,e){for(var n=t.firstChild;n;){var i=n.nextSibling;e.appendChild(n),n=i}return e}(t,(k=e.nodeName,(_=e.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==_?pt.createElementNS(_,k):pt.createElement(k)))):x=e;else if(3===E||8===E){if(C===E)return x.nodeValue!==e.nodeValue&&(x.nodeValue=e.nodeValue),x;x=e}if(x===e)u(t);else{if(e.isSameNode&&e.isSameNode(x))return;if(w(x,e,p),m)for(var A=0,S=m.length;A{if(n&&n.isSameNode(t)&<.isFormInput(t))return lt.mergeFocusedInput(t,e),!1}})}constructor(t,e,n,i,r,s){this.view=t,this.liveSocket=t.liveSocket,this.container=e,this.id=n,this.rootID=t.root.id,this.html=i,this.streams=r,this.streamInserts={},this.targetCID=s,this.cidPatch=G(this.targetCID),this.pendingRemoves=[],this.phxRemove=this.liveSocket.binding("remove"),this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[],aftertransitionsDiscarded:[]}}before(t,e){this.callbacks["before"+t].push(e)}after(t,e){this.callbacks["after"+t].push(e)}trackBefore(t,...e){this.callbacks["before"+t].forEach(t=>t(...e))}trackAfter(t,...e){this.callbacks["after"+t].forEach(t=>t(...e))}markPrunableContentForRemoval(){let t=this.liveSocket.binding("update");lt.all(this.container,`[${t}=stream]`,t=>t.innerHTML=""),lt.all(this.container,`[${t}=append] > *, [${t}=prepend] > *`,t=>{t.setAttribute("data-phx-prune","")})}perform(){let{view:t,liveSocket:e,container:n,html:i}=this,r=this.isCIDPatch()?this.targetCIDContainer(i):n;if(this.isCIDPatch()&&!r)return;let s=e.getActiveElement(),{selectionStart:o,selectionEnd:a}=s&<.hasSelectionRange(s)?s:{},l=e.binding("update"),h=e.binding("feedback-for"),u=e.binding("disable-with"),c=e.binding("trigger-action"),d=[],f=[],p=[],g=null,m=e.time("premorph container prep",()=>this.buildDiffHTML(n,i,l,r));return this.trackBefore("added",n),this.trackBefore("updated",n,n),e.time("morphdom",()=>{this.streams.forEach(([t,e])=>{this.streamInserts=Object.assign(this.streamInserts,t),e.forEach(t=>{let e=n.querySelector(`[id="${t}"]`);e&&(this.maybePendingRemove(e)||(e.remove(),this.onNodeDiscarded(e)))})}),Et(r,m,{childrenOnly:null===r.getAttribute(L),getNodeKey:t=>lt.isPhxDestroyed(t)?null:t.id,skipFromChildren:t=>"stream"===t.getAttribute(l),addChild:(t,e)=>{let n=e.id?this.streamInserts[e.id]:void 0;if(void 0===n)return t.appendChild(e);if(0===n)t.insertAdjacentElement("afterbegin",e);else if(-1===n)t.appendChild(e);else if(n>0){let i=Array.from(t.children)[n];t.insertBefore(e,i)}},onBeforeNodeAdded:t=>(this.trackBefore("added",t),t),onNodeAdded:e=>{e instanceof HTMLImageElement&&e.srcset?e.srcset=e.srcset:e instanceof HTMLVideoElement&&e.autoplay&&e.play(),lt.isNowTriggerFormExternal(e,c)&&(g=e),lt.discardError(r,e,h),(lt.isPhxChild(e)&&t.ownsElement(e)||lt.isPhxSticky(e)&&t.ownsElement(e.parentNode))&&this.trackAfter("phxChildAdded",e),d.push(e)},onNodeDiscarded:t=>this.onNodeDiscarded(t),onBeforeNodeDiscarded:t=>!(!t.getAttribute||null===t.getAttribute("data-phx-prune"))||(null===t.parentElement||!t.id||!lt.isPhxUpdate(t.parentElement,l,["stream","append","prepend"]))&&(!this.maybePendingRemove(t)&&!this.skipCIDSibling(t)),onElUpdated:t=>{lt.isNowTriggerFormExternal(t,c)&&(g=t),f.push(t),this.maybeReOrderStream(t)},onBeforeElUpdated:(t,e)=>{if(lt.cleanChildNodes(e,l),this.skipCIDSibling(e))return!1;if(lt.isPhxSticky(t))return!1;if(lt.isIgnored(t,l)||t.form&&t.form.isSameNode(g))return this.trackBefore("updated",t,e),lt.mergeAttrs(t,e,{isIgnored:!0}),f.push(t),lt.applyStickyOperations(t),!1;if("number"===t.type&&t.validity&&t.validity.badInput)return!1;if(!lt.syncPendingRef(t,e,u))return lt.isUploadInput(t)&&(this.trackBefore("updated",t,e),f.push(t)),lt.applyStickyOperations(t),!1;if(lt.isPhxChild(e)){let n=t.getAttribute(O);return lt.mergeAttrs(t,e,{exclude:[H]}),""!==n&&t.setAttribute(O,n),t.setAttribute(I,this.rootID),lt.applyStickyOperations(t),!1}return lt.copyPrivates(e,t),lt.discardError(r,e,h),s&&t.isSameNode(s)&<.isFormInput(t)&&"hidden"!==t.type?(this.trackBefore("updated",t,e),lt.mergeFocusedInput(t,e),lt.syncAttrsToProps(t),f.push(t),lt.applyStickyOperations(t),!1):(lt.isPhxUpdate(e,l,["append","prepend"])&&p.push(new class{constructor(t,e,n){let i=new Set,r=new Set([...e.children].map(t=>t.id)),s=[];Array.from(t.children).forEach(t=>{if(t.id&&(i.add(t.id),r.has(t.id))){let e=t.previousElementSibling&&t.previousElementSibling.id;s.push({elementId:t.id,previousElementId:e})}}),this.containerId=e.id,this.updateType=n,this.elementsToModify=s,this.elementIdsToAdd=[...r].filter(t=>!i.has(t))}perform(){let t=lt.byId(this.containerId);this.elementsToModify.forEach(e=>{e.previousElementId?it(document.getElementById(e.previousElementId),t=>{it(document.getElementById(e.elementId),e=>{e.previousElementSibling&&e.previousElementSibling.id==t.id||t.insertAdjacentElement("afterend",e)})}):it(document.getElementById(e.elementId),e=>{null==e.previousElementSibling||t.insertAdjacentElement("afterbegin",e)})}),"prepend"==this.updateType&&this.elementIdsToAdd.reverse().forEach(e=>{it(document.getElementById(e),e=>t.insertAdjacentElement("afterbegin",e))})}}(t,e,e.getAttribute(l))),lt.syncAttrsToProps(e),lt.applyStickyOperations(e),this.trackBefore("updated",t,e),!0)}})}),e.isDebugEnabled()&&function(){let t=new Set,e=document.querySelectorAll("*[id]");for(let n=0,i=e.length;n0&&e.time("post-morph append/prepend restoration",()=>{p.forEach(t=>t.perform())}),e.silenceEvents(()=>lt.restoreFocus(s,o,a)),lt.dispatchEvent(document,"phx:update"),d.forEach(t=>this.trackAfter("added",t)),f.forEach(t=>this.trackAfter("updated",t)),this.transitionPendingRemoves(),g&&(e.unload(),g.submit()),!0}onNodeDiscarded(t){(lt.isPhxChild(t)||lt.isPhxSticky(t))&&this.liveSocket.destroyViewByEl(t),this.trackAfter("discarded",t)}maybePendingRemove(t){return!(!t.getAttribute||null===t.getAttribute(this.phxRemove))&&(this.pendingRemoves.push(t),!0)}maybeReOrderStream(t){let e=t.id?this.streamInserts[t.id]:void 0;if(void 0!==e)if(0===e)t.parentElement.insertBefore(t,t.parentElement.firstElementChild);else if(e>0){let n=Array.from(t.parentElement.children),i=n.indexOf(t);if(e>=n.length-1)t.parentElement.appendChild(t);else{let r=n[e];i>e?t.parentElement.insertBefore(t,r):t.parentElement.insertBefore(t,r.nextElementSibling)}}}transitionPendingRemoves(){let{pendingRemoves:t,liveSocket:e}=this;t.length>0&&(e.transitionRemoves(t),e.requestDOMUpdate(()=>{t.forEach(t=>{let n=lt.firstPhxChild(t);n&&e.destroyViewByEl(n),t.remove()}),this.trackAfter("transitionsDiscarded",t)}))}isCIDPatch(){return this.cidPatch}skipCIDSibling(t){return t.nodeType===Node.ELEMENT_NODE&&null!==t.getAttribute("data-phx-skip")}targetCIDContainer(t){if(!this.isCIDPatch())return;let[e,...n]=lt.findComponentNodeList(this.container,this.targetCID);return 0===n.length&&1===lt.childNodeLength(t)?e:e&&e.parentNode}buildDiffHTML(t,e,n,i){let r=this.isCIDPatch(),s=r&&i.getAttribute(L)===this.targetCID.toString();if(!r||s)return e;{let t=null,n=document.createElement("template");t=lt.cloneNode(i);let[r,...s]=lt.findComponentNodeList(t,this.targetCID);return n.innerHTML=e,s.forEach(t=>t.remove()),Array.from(t.childNodes).forEach(t=>{t.id&&t.nodeType===Node.ELEMENT_NODE&&t.getAttribute(L)!==this.targetCID.toString()&&(t.setAttribute("data-phx-skip",""),t.innerHTML="")}),Array.from(n.content.childNodes).forEach(e=>t.insertBefore(e,r)),r.remove(),t.outerHTML}}indexOf(t,e){return Array.from(t.children).indexOf(e)}},At=class{static extract(t){let{[W]:e,[V]:n,[z]:i}=t;return delete t[W],delete t[V],delete t[z],{diff:t,title:i,reply:e||null,events:n||[]}}constructor(t,e){this.viewId=t,this.rendered={},this.mergeDiff(e)}parentViewId(){return this.viewId}toString(t){let[e,n]=this.recursiveToString(this.rendered,this.rendered.c,t);return[e,n]}recursiveToString(t,e=t.c,n){let i={buffer:"",components:e,onlyCids:n=n?new Set(n):null,streams:new Set};return this.toOutputBuffer(t,null,i),[i.buffer,i.streams]}componentCIDs(t){return Object.keys(t.c||{}).map(t=>parseInt(t))}isComponentOnlyDiff(t){return!!t.c&&1===Object.keys(t).length}getComponent(t,e){return t.c[e]}mergeDiff(t){let e=t.c,n={};if(delete t.c,this.rendered=this.mutableMerge(this.rendered,t),this.rendered.c=this.rendered.c||{},e){let i=this.rendered.c;for(let t in e)e[t]=this.cachedFindComponent(t,e[t],i,e,n);for(let t in e)i[t]=e[t];t.c=e}}cachedFindComponent(t,e,n,i,r){if(r[t])return r[t];{let s,o,a=e[J];if(G(a)){let t;t=a>0?this.cachedFindComponent(a,i[a],n,i,r):n[-a],o=t[J],s=this.cloneMerge(t,e),s[J]=o}else s=void 0!==e[J]?e:this.cloneMerge(n[t]||{},e);return r[t]=s,s}}mutableMerge(t,e){return void 0!==e[J]?e:(this.doMutableMerge(t,e),t)}doMutableMerge(t,e){for(let n in e){let i=e[n],r=t[n];et(i)&&void 0===i[J]&&et(r)?this.doMutableMerge(r,i):t[n]=i}}cloneMerge(t,e){let n={...t,...e};for(let i in n){let r=e[i],s=t[i];et(r)&&void 0===r[J]&&et(s)&&(n[i]=this.cloneMerge(s,r))}return n}componentToString(t){let[e,n]=this.recursiveCIDToString(this.rendered.c,t);return[e,n]}pruneCIDs(t){t.forEach(t=>delete this.rendered.c[t])}get(){return this.rendered}isNewFingerprint(t={}){return!!t[J]}templateStatic(t,e){return"number"==typeof t?e[t]:t}toOutputBuffer(t,e,n){if(t[q])return this.comprehensionToBuffer(t,e,n);let{[J]:i}=t;i=this.templateStatic(i,e),n.buffer+=i[0];for(let r=1;r0||a.length>0)&&(t[q]=[],n.streams.add(s))}dynamicToBuffer(t,e,n){if("number"==typeof t){let[e,i]=this.recursiveCIDToString(n.components,t,n.onlyCids);n.buffer+=e,n.streams=new Set([...n.streams,...i])}else et(t)?this.toOutputBuffer(t,e,n):n.buffer+=t}recursiveCIDToString(t,e,n){let i=t[e]||X("no component for CID "+e,t),r=document.createElement("template"),[s,o]=this.recursiveToString(i,t,n);r.innerHTML=s;let a=r.content,l=n&&!n.has(e),[h,u]=Array.from(a.childNodes).reduce(([t,n],i,s)=>i.nodeType===Node.ELEMENT_NODE?i.getAttribute(L)?[t,!0]:(i.setAttribute(L,e),i.id||(i.id=`${this.parentViewId()}-${e}-${s}`),l&&(i.setAttribute("data-phx-skip",""),i.innerHTML=""),[!0,n]):""!==i.nodeValue.trim()?(X(`only HTML element tags are allowed at the root of components.\n\ngot: "${i.nodeValue.trim()}"\n\nwithin:\n`,r.innerHTML.trim()),i.replaceWith(this.createSpan(i.nodeValue,e)),[!0,n]):(i.remove(),[t,n]),[!1,!1]);return h||u?!h&&u?(X("expected at least one HTML element tag directly inside a component, but only subcomponents were found. A component must render at least one HTML tag directly inside itself.",r.innerHTML.trim()),[r.innerHTML,o]):[r.innerHTML,o]:(X("expected at least one HTML element tag inside a component, but the component is empty:\n",r.innerHTML.trim()),[this.createSpan("",e).outerHTML,o])}createSpan(t,e){let n=document.createElement("span");return n.innerText=t,n.setAttribute(L,e),n}},St=1,Tt=class{static makeID(){return St++}static elementID(t){return t.phxHookId}constructor(t,e,n){this.__view=t,this.liveSocket=t.liveSocket,this.__callbacks=n,this.__listeners=new Set,this.__isDisconnected=!1,this.el=e,this.el.phxHookId=this.constructor.makeID();for(let t in this.__callbacks)this[t]=this.__callbacks[t]}__mounted(){this.mounted&&this.mounted()}__updated(){this.updated&&this.updated()}__beforeUpdate(){this.beforeUpdate&&this.beforeUpdate()}__destroyed(){this.destroyed&&this.destroyed()}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}pushEvent(t,e={},n=function(){}){return this.__view.pushHookEvent(null,t,e,n)}pushEventTo(t,e,n={},i=function(){}){return this.__view.withinTargets(t,(t,r)=>t.pushHookEvent(r,e,n,i))}handleEvent(t,e){let n=(n,i)=>i?t:e(n.detail);return window.addEventListener("phx:"+t,n),this.__listeners.add(n),n}removeHandleEvent(t){let e=t(null,!0);window.removeEventListener("phx:"+e,t),this.__listeners.delete(t)}upload(t,e){return this.__view.dispatchUploads(t,e)}uploadTo(t,e,n){return this.__view.withinTargets(t,t=>t.dispatchUploads(e,n))}__cleanup__(){this.__listeners.forEach(t=>this.removeHandleEvent(t))}},Mt=null,Lt={exec(t,e,n,i,r){let[s,o]=r||[null,{}];("["===e.charAt(0)?JSON.parse(e):[[s,o]]).forEach(([r,a])=>{r===s&&o.data&&(a.data=Object.assign(a.data||{},o.data)),this.filterToEls(i,a).forEach(s=>{this["exec_"+r](t,e,n,i,s,a)})})},isVisible:t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length>0),exec_exec(t,e,n,i,r,[s,o]){(o?lt.all(document,o):[i]).forEach(e=>{let i=e.getAttribute(s);if(!i)throw new Error(`expected ${s} to contain JS command on "${o}"`);n.liveSocket.execJS(e,i,t)})},exec_dispatch(t,e,n,i,r,{to:s,event:o,detail:a,bubbles:l}){(a=a||{}).dispatcher=i,lt.dispatchEvent(r,o,{detail:a,bubbles:l})},exec_push(t,e,n,i,r,s){if(!n.isConnected())return;let{event:o,data:a,target:l,page_loading:h,loading:u,value:c,dispatcher:d}=s,f={loading:u,value:c,target:l,page_loading:!!h},p="change"===t&&d?d:i,g=l||p.getAttribute(n.binding("target"))||p;n.withinTargets(g,(n,r)=>{if("change"===t){let{newCid:t,_target:a,callback:l}=s;a=a||(lt.isFormInput(i)?i.name:void 0),a&&(f._target=a),n.pushInput(i,r,t,o||e,f,l)}else if("submit"===t){let{submitter:t}=s;n.submitForm(i,r,o||e,t,f)}else n.pushEvent(t,i,r,o||e,a,f)})},exec_navigate(t,e,n,i,r,{href:s,replace:o}){n.liveSocket.historyRedirect(s,o?"replace":"push")},exec_patch(t,e,n,i,r,{href:s,replace:o}){n.liveSocket.pushHistoryPatch(s,o?"replace":"push",i)},exec_focus(t,e,n,i,r){window.requestAnimationFrame(()=>dt.attemptFocus(r))},exec_focus_first(t,e,n,i,r){window.requestAnimationFrame(()=>dt.focusFirstInteractive(r)||dt.focusFirst(r))},exec_push_focus(t,e,n,i,r){window.requestAnimationFrame(()=>Mt=r||i)},exec_pop_focus(t,e,n,i,r){window.requestAnimationFrame(()=>{Mt&&Mt.focus(),Mt=null})},exec_add_class(t,e,n,i,r,{names:s,transition:o,time:a}){this.addOrRemoveClasses(r,s,[],o,a,n)},exec_remove_class(t,e,n,i,r,{names:s,transition:o,time:a}){this.addOrRemoveClasses(r,[],s,o,a,n)},exec_transition(t,e,n,i,r,{time:s,transition:o}){this.addOrRemoveClasses(r,[],[],o,s,n)},exec_toggle(t,e,n,i,r,{display:s,ins:o,outs:a,time:l}){this.toggle(t,n,r,s,o,a,l)},exec_show(t,e,n,i,r,{display:s,transition:o,time:a}){this.show(t,n,r,s,o,a)},exec_hide(t,e,n,i,r,{display:s,transition:o,time:a}){this.hide(t,n,r,s,o,a)},exec_set_attr(t,e,n,i,r,{attr:[s,o]}){this.setOrRemoveAttrs(r,[[s,o]],[])},exec_remove_attr(t,e,n,i,r,{attr:s}){this.setOrRemoveAttrs(r,[],[s])},show(t,e,n,i,r,s){this.isVisible(n)||this.toggle(t,e,n,i,r,null,s)},hide(t,e,n,i,r,s){this.isVisible(n)&&this.toggle(t,e,n,i,null,r,s)},toggle(t,e,n,i,r,s,o){let[a,l,h]=r||[[],[],[]],[u,c,d]=s||[[],[],[]];if(a.length>0||u.length>0)if(this.isVisible(n)){let t=()=>{this.addOrRemoveClasses(n,c,a.concat(l).concat(h)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(n,u,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(n,d,c))})};n.dispatchEvent(new Event("phx:hide-start")),e.transition(o,t,()=>{this.addOrRemoveClasses(n,[],u.concat(d)),lt.putSticky(n,"toggle",t=>t.style.display="none"),n.dispatchEvent(new Event("phx:hide-end"))})}else{if("remove"===t)return;let r=()=>{this.addOrRemoveClasses(n,l,u.concat(c).concat(d));let t=i||this.defaultDisplay(n);lt.putSticky(n,"toggle",e=>e.style.display=t),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(n,a,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(n,h,l))})};n.dispatchEvent(new Event("phx:show-start")),e.transition(o,r,()=>{this.addOrRemoveClasses(n,[],a.concat(h)),n.dispatchEvent(new Event("phx:show-end"))})}else this.isVisible(n)?window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("phx:hide-start")),lt.putSticky(n,"toggle",t=>t.style.display="none"),n.dispatchEvent(new Event("phx:hide-end"))}):window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("phx:show-start"));let t=i||this.defaultDisplay(n);lt.putSticky(n,"toggle",e=>e.style.display=t),n.dispatchEvent(new Event("phx:show-end"))})},addOrRemoveClasses(t,e,n,i,r,s){let[o,a,l]=i||[[],[],[]];if(o.length>0){let i=()=>this.addOrRemoveClasses(t,a.concat(o),[]),h=()=>this.addOrRemoveClasses(t,e.concat(l),n.concat(o).concat(a));return s.transition(r,i,h)}window.requestAnimationFrame(()=>{let[i,r]=lt.getSticky(t,"classes",[[],[]]),s=e.filter(e=>i.indexOf(e)<0&&!t.classList.contains(e)),o=n.filter(e=>r.indexOf(e)<0&&t.classList.contains(e)),a=i.filter(t=>n.indexOf(t)<0).concat(s),l=r.filter(t=>e.indexOf(t)<0).concat(o);lt.putSticky(t,"classes",t=>(t.classList.remove(...l),t.classList.add(...a),[a,l]))})},setOrRemoveAttrs(t,e,n){let[i,r]=lt.getSticky(t,"attrs",[[],[]]),s=e.map(([t,e])=>t).concat(n),o=i.filter(([t,e])=>!s.includes(t)).concat(e),a=r.filter(t=>!s.includes(t)).concat(n);lt.putSticky(t,"attrs",t=>(a.forEach(e=>t.removeAttribute(e)),o.forEach(([e,n])=>t.setAttribute(e,n)),[o,a]))},hasAllClasses:(t,e)=>e.every(e=>t.classList.contains(e)),isToggledOut(t,e){return!this.isVisible(t)||this.hasAllClasses(t,e)},filterToEls:(t,{to:e})=>e?lt.all(document,e):[t],defaultDisplay:t=>({tr:"table-row",td:"table-cell"}[t.tagName.toLowerCase()]||"block")},Dt=(t,e,n=[])=>{let{submitter:i,...r}=e,s=new FormData(t);i&&i.hasAttribute("name")&&i.form&&i.form===t&&s.append(i.name,i.value);let o=[];s.forEach((t,e,n)=>{t instanceof File&&o.push(e)}),o.forEach(t=>s.delete(t));let a=new URLSearchParams;for(let[t,e]of s.entries())(0===n.length||n.indexOf(t)>=0)&&a.append(t,e);for(let t in r)a.append(t,r[t]);return a.toString()},Pt=class{constructor(t,e,n,i,r){this.isDead=!1,this.liveSocket=e,this.flash=i,this.parent=n,this.root=n?n.root:this,this.el=t,this.id=this.el.id,this.ref=0,this.childJoins=0,this.loaderTimer=null,this.pendingDiffs=[],this.pruningCIDs=[],this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(t){t&&t()},this.stopCallback=function(){},this.pendingJoinOps=this.parent?null:[],this.viewHooks={},this.uploaders={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.channel=this.liveSocket.channel("lv:"+this.id,()=>({redirect:this.redirect?this.href:void 0,url:this.redirect?void 0:this.href||void 0,params:this.connectParams(r),session:this.getSession(),static:this.getStatic(),flash:this.flash}))}setHref(t){this.href=t}setRedirect(t){this.redirect=!0,this.href=t}isMain(){return this.el.hasAttribute("data-phx-main")}connectParams(t){let e=this.liveSocket.params(this.el),n=lt.all(document,`[${this.binding("track-static")}]`).map(t=>t.src||t.href).filter(t=>"string"==typeof t);return n.length>0&&(e._track_static=n),e._mounts=this.joinCount,e._live_referer=t,e}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(O)}getStatic(){let t=this.el.getAttribute(H);return""===t?null:t}destroy(t=function(){}){this.destroyAllChildren(),this.destroyed=!0,delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],clearTimeout(this.loaderTimer);let e=()=>{t();for(let t in this.viewHooks)this.destroyHook(this.viewHooks[t])};lt.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"]),this.channel.leave().receive("ok",e).receive("error",e).receive("timeout",e)}setContainerClasses(...t){this.el.classList.remove("phx-connected","phx-loading","phx-error"),this.el.classList.add(...t)}showLoader(t){if(clearTimeout(this.loaderTimer),t)this.loaderTimer=setTimeout(()=>this.showLoader(),t);else{for(let t in this.viewHooks)this.viewHooks[t].__disconnected();this.setContainerClasses("phx-loading")}}execAll(t){lt.all(this.el,`[${t}]`,e=>this.liveSocket.execJS(e,e.getAttribute(t)))}hideLoader(){clearTimeout(this.loaderTimer),this.setContainerClasses("phx-connected"),this.execAll(this.binding("connected"))}triggerReconnected(){for(let t in this.viewHooks)this.viewHooks[t].__reconnected()}log(t,e){this.liveSocket.log(this,t,e)}transition(t,e,n=function(){}){this.liveSocket.transition(t,e,n)}withinTargets(t,e){if(t instanceof HTMLElement||t instanceof SVGElement)return this.liveSocket.owner(t,n=>e(n,t));if(G(t)){0===lt.findComponentNodeList(this.el,t).length?X("no component found matching phx-target of "+t):e(this,parseInt(t))}else{let n=Array.from(document.querySelectorAll(t));0===n.length&&X(`nothing found matching the phx-target selector "${t}"`),n.forEach(t=>this.liveSocket.owner(t,n=>e(n,t)))}}applyDiff(t,e,n){this.log(t,()=>["",Q(e)]);let{diff:i,reply:r,events:s,title:o}=At.extract(e);n({diff:i,reply:r,events:s}),o&&window.requestAnimationFrame(()=>lt.putTitle(o))}onJoin(t){let{rendered:e,container:n}=t;if(n){let[t,e]=n;this.el=lt.replaceRootContainer(this.el,t,e)}this.childJoins=0,this.joinPending=!0,this.flash=null,ot.dropLocal(this.liveSocket.localStorage,window.location.pathname,"consecutive-reloads"),this.applyDiff("mount",e,({diff:e,events:n})=>{this.rendered=new At(this.id,e);let[i,r]=this.renderContainer(null,"join");this.dropPendingRefs();let s=this.formsForRecovery(i);this.joinCount++,s.length>0?s.forEach(([t,e,o],a)=>{this.pushFormRecovery(t,o,t=>{a===s.length-1&&this.onJoinComplete(t,i,r,n)})}):this.onJoinComplete(t,i,r,n)})}dropPendingRefs(){lt.all(document,`[${P}="${this.id}"][${D}]`,t=>{t.removeAttribute(D),t.removeAttribute(P)})}onJoinComplete({live_patch:t},e,n,i){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(t,e,n,i);0===lt.findPhxChildrenInFragment(e,this.id).filter(t=>{let e=t.id&&this.el.querySelector(`[id="${t.id}"]`),n=e&&e.getAttribute(H);return n&&t.setAttribute(H,n),this.joinChild(t)}).length?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,e,n,i)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(t,e,n,i)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,e,n,i)])}attachTrueDocEl(){this.el=lt.byId(this.id),this.el.setAttribute(I,this.root.id)}execNewMounted(){lt.all(this.el,`[${this.binding("hook")}], [data-phx-hook]`,t=>{this.maybeAddNewHook(t)}),lt.all(this.el,`[${this.binding("mounted")}]`,t=>this.maybeMounted(t))}applyJoinPatch(t,e,n,i){this.attachTrueDocEl();let r=new Ct(this,this.el,this.id,e,n,null);if(r.markPrunableContentForRemoval(),this.performPatch(r,!1),this.joinNewChildren(),this.execNewMounted(),this.joinPending=!1,this.liveSocket.dispatchEvents(i),this.applyPendingUpdates(),t){let{kind:e,to:n}=t;this.liveSocket.historyPatch(n,e)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(t,e){this.liveSocket.triggerDOM("onBeforeElUpdated",[t,e]);let n=this.getHook(t),i=n&<.isIgnored(t,this.binding("update"));if(n&&!t.isEqualNode(e)&&(!i||(r=t.dataset,s=e.dataset,JSON.stringify(r)!==JSON.stringify(s))))return n.__beforeUpdate(),n;var r,s}maybeMounted(t){let e=t.getAttribute(this.binding("mounted")),n=e&<.private(t,"mounted");e&&!n&&(this.liveSocket.execJS(t,e),lt.putPrivate(t,"mounted",!0))}maybeAddNewHook(t,e){let n=this.addHook(t);n&&n.__mounted()}performPatch(t,e){let n=[],i=!1,r=new Set;return t.after("added",t=>{this.liveSocket.triggerDOM("onNodeAdded",[t]),this.maybeAddNewHook(t),t.getAttribute&&this.maybeMounted(t)}),t.after("phxChildAdded",t=>{lt.isPhxSticky(t)?this.liveSocket.joinRootViews():i=!0}),t.before("updated",(t,e)=>{this.triggerBeforeUpdateHook(t,e)&&r.add(t.id)}),t.after("updated",t=>{r.has(t.id)&&this.getHook(t).__updated()}),t.after("discarded",t=>{t.nodeType===Node.ELEMENT_NODE&&n.push(t)}),t.after("transitionsDiscarded",t=>this.afterElementsRemoved(t,e)),t.perform(),this.afterElementsRemoved(n,e),i}afterElementsRemoved(t,e){let n=[];t.forEach(t=>{let e=lt.all(t,`[${L}]`),i=lt.all(t,`[${this.binding("hook")}]`);e.concat(t).forEach(t=>{let e=this.componentID(t);G(e)&&-1===n.indexOf(e)&&n.push(e)}),i.concat(t).forEach(t=>{let e=this.getHook(t);e&&this.destroyHook(e)})}),e&&this.maybePushComponentsDestroyed(n)}joinNewChildren(){lt.findPhxChildren(this.el,this.id).forEach(t=>this.joinChild(t))}getChildById(t){return this.root.children[this.id][t]}getDescendentByEl(t){return t.id===this.id?this:this.children[t.getAttribute(R)][t.id]}destroyDescendent(t){for(let e in this.root.children)for(let n in this.root.children[e])if(n===t)return this.root.children[e][n].destroy()}joinChild(t){if(!this.getChildById(t.id)){let e=new Pt(t,this.liveSocket,this);return this.root.children[this.id][e.id]=e,e.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(t){this.childJoins--,0===this.childJoins&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.joinCallback(()=>{this.pendingJoinOps.forEach(([t,e])=>{t.isDestroyed()||e()}),this.pendingJoinOps=[]})}update(t,e){if(this.isJoinPending()||this.liveSocket.hasPendingLink()&&this.root.isMain())return this.pendingDiffs.push({diff:t,events:e});this.rendered.mergeDiff(t);let n=!1;this.rendered.isComponentOnlyDiff(t)?this.liveSocket.time("component patch complete",()=>{lt.findParentCIDs(this.el,this.rendered.componentCIDs(t)).forEach(e=>{this.componentPatch(this.rendered.getComponent(t,e),e)&&(n=!0)})}):nt(t)||this.liveSocket.time("full patch complete",()=>{let[e,i]=this.renderContainer(t,"update"),r=new Ct(this,this.el,this.id,e,i,null);n=this.performPatch(r,!0)}),this.liveSocket.dispatchEvents(e),n&&this.joinNewChildren()}renderContainer(t,e){return this.liveSocket.time(`toString diff (${e})`,()=>{let e=this.el.tagName,n=t?this.rendered.componentCIDs(t).concat(this.pruningCIDs):null,[i,r]=this.rendered.toString(n);return[`<${e}>${i}`,r]})}componentPatch(t,e){if(nt(t))return!1;let[n,i]=this.rendered.componentToString(e),r=new Ct(this,this.el,this.id,n,i,e);return this.performPatch(r,!0)}getHook(t){return this.viewHooks[Tt.elementID(t)]}addHook(t){if(Tt.elementID(t)||!t.getAttribute)return;let e=t.getAttribute("data-phx-hook")||t.getAttribute(this.binding("hook"));if(e&&!this.ownsElement(t))return;let n=this.liveSocket.getHookCallbacks(e);if(n){t.id||X(`no DOM ID for hook "${e}". Hooks require a unique ID on each element.`,t);let i=new Tt(this,t,n);return this.viewHooks[Tt.elementID(i.el)]=i,i}null!==e&&X(`unknown hook found for "${e}"`,t)}destroyHook(t){t.__destroyed(),t.__cleanup__(),delete this.viewHooks[Tt.elementID(t.el)]}applyPendingUpdates(){this.pendingDiffs.forEach(({diff:t,events:e})=>this.update(t,e)),this.pendingDiffs=[],this.eachChild(t=>t.applyPendingUpdates())}eachChild(t){let e=this.root.children[this.id]||{};for(let n in e)t(this.getChildById(n))}onChannel(t,e){this.liveSocket.onChannel(this.channel,t,t=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>e(t)]):this.liveSocket.requestDOMUpdate(()=>e(t))})}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",t=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",t,({diff:t,events:e})=>this.update(t,e))})}),this.onChannel("redirect",({to:t,flash:e})=>this.onRedirect({to:t,flash:e})),this.onChannel("live_patch",t=>this.onLivePatch(t)),this.onChannel("live_redirect",t=>this.onLiveRedirect(t)),this.channel.onError(t=>this.onError(t)),this.channel.onClose(t=>this.onClose(t))}destroyAllChildren(){this.eachChild(t=>t.destroy())}onLiveRedirect(t){let{to:e,kind:n,flash:i}=t,r=this.expandURL(e);this.liveSocket.historyRedirect(r,n,i)}onLivePatch(t){let{to:e,kind:n}=t;this.href=this.expandURL(e),this.liveSocket.historyPatch(e,n)}expandURL(t){return t.startsWith("/")?`${window.location.protocol}//${window.location.host}${t}`:t}onRedirect({to:t,flash:e}){this.liveSocket.redirect(t,e)}isDestroyed(){return this.destroyed}joinDead(){this.isDead=!0}join(t){this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel(),this.isMain()&&(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=e=>{e=e||function(){},t?t(this.joinCount,e):e()},this.liveSocket.wrapPush(this,{timeout:!1},()=>this.channel.join().receive("ok",t=>{this.isDestroyed()||this.liveSocket.requestDOMUpdate(()=>this.onJoin(t))}).receive("error",t=>!this.isDestroyed()&&this.onJoinError(t)).receive("timeout",()=>!this.isDestroyed()&&this.onJoinError({reason:"timeout"})))}onJoinError(t){return"reload"===t.reason?(this.log("error",()=>[`failed mount with ${t.status}. Falling back to page request`,t]),this.onRedirect({to:this.href})):"unauthorized"===t.reason||"stale"===t.reason?(this.log("error",()=>["unauthorized live_redirect. Falling back to page request",t]),this.onRedirect({to:this.href})):((t.redirect||t.live_redirect)&&(this.joinPending=!1,this.channel.leave()),t.redirect?this.onRedirect(t.redirect):t.live_redirect?this.onLiveRedirect(t.live_redirect):(this.log("error",()=>["unable to join",t]),void(this.liveSocket.isConnected()&&this.liveSocket.reloadWithJitter(this))))}onClose(t){if(!this.isDestroyed()){if(this.liveSocket.hasPendingLink()&&"leave"!==t)return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(200)}}onError(t){this.onClose(t),this.liveSocket.isConnected()&&this.log("error",()=>["view crashed",t]),this.liveSocket.isUnloaded()||this.displayError()}displayError(){this.isMain()&<.dispatchEvent(window,"phx:page-loading-start",{detail:{to:this.href,kind:"error"}}),this.showLoader(),this.setContainerClasses("phx-loading","phx-error"),this.execAll(this.binding("disconnected"))}pushWithReply(t,e,n,i=function(){}){if(!this.isConnected())return;let[r,[s],o]=t?t():[null,[],{}],a=function(){};return(o.page_loading||s&&null!==s.getAttribute(this.binding("page-loading")))&&(a=this.liveSocket.withPageLoading({kind:"element",target:s})),"number"!=typeof n.cid&&delete n.cid,this.liveSocket.wrapPush(this,{timeout:!0},()=>this.channel.push(e,n,3e4).receive("ok",t=>{let e=e=>{t.redirect&&this.onRedirect(t.redirect),t.live_patch&&this.onLivePatch(t.live_patch),t.live_redirect&&this.onLiveRedirect(t.live_redirect),null!==r&&this.undoRefs(r),a(),i(t,e)};t.diff?this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",t.diff,({diff:t,reply:n,events:i})=>{this.update(t,i),e(n)})}):e(null)}))}undoRefs(t){this.isConnected()&<.all(document,`[${P}="${this.id}"][${D}="${t}"]`,t=>{let e=t.getAttribute("data-phx-disabled");t.removeAttribute(D),t.removeAttribute(P),null!==t.getAttribute("data-phx-readonly")&&(t.readOnly=!1,t.removeAttribute("data-phx-readonly")),null!==e&&(t.disabled="true"===e,t.removeAttribute("data-phx-disabled")),M.forEach(e=>lt.removeClass(t,e));let n=t.getAttribute("data-phx-disable-with-restore");null!==n&&(t.innerText=n,t.removeAttribute("data-phx-disable-with-restore"));let i=lt.private(t,D);if(i){let e=this.triggerBeforeUpdateHook(t,i);Ct.patchEl(t,i,this.liveSocket.getActiveElement()),e&&e.__updated(),lt.deletePrivate(t,D)}})}putRef(t,e,n={}){let i=this.ref++,r=this.binding("disable-with");return n.loading&&(t=t.concat(lt.all(document,n.loading))),t.forEach(t=>{t.classList.add(`phx-${e}-loading`),t.setAttribute(D,i),t.setAttribute(P,this.el.id);let n=t.getAttribute(r);null!==n&&(t.getAttribute("data-phx-disable-with-restore")||t.setAttribute("data-phx-disable-with-restore",t.innerText),""!==n&&(t.innerText=n),t.setAttribute("disabled",""))}),[i,t,n]}componentID(t){let e=t.getAttribute&&t.getAttribute(L);return e?parseInt(e):null}targetComponentID(t,e,n={}){if(G(e))return e;let i=t.getAttribute(this.binding("target"));return G(i)?parseInt(i):e&&(null!==i||n.target)?this.closestComponentID(e):null}closestComponentID(t){return G(t)?t:t?it(t.closest(`[${L}]`),t=>this.ownsElement(t)&&this.componentID(t)):null}pushHookEvent(t,e,n,i){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",e,n]),!1;let[r,s,o]=this.putRef([],"hook");return this.pushWithReply(()=>[r,s,o],"event",{type:"hook",event:e,value:n,cid:this.closestComponentID(t)},(t,e)=>i(e,r)),r}extractMeta(t,e,n){let i=this.binding("value-");for(let n=0;n=0&&!t.checked&&delete e.value),n){e||(e={});for(let t in n)e[t]=n[t]}return e}pushEvent(t,e,n,i,r,s={}){this.pushWithReply(()=>this.putRef([e],t,s),"event",{type:t,event:i,value:this.extractMeta(e,r,s.value),cid:this.targetComponentID(e,n,s)})}pushFileProgress(t,e,n,i=function(){}){this.liveSocket.withinOwners(t.form,(r,s)=>{r.pushWithReply(null,"progress",{event:t.getAttribute(r.binding("progress")),ref:t.getAttribute(N),entry_ref:e,progress:n,cid:r.targetComponentID(t.form,s)},i)})}pushInput(t,e,n,i,r,s){let o,a,l=G(n)?n:this.targetComponentID(t.form,e),h=()=>this.putRef([t,t.form],"change",r);a=t.getAttribute(this.binding("change"))?Dt(t.form,{_target:r._target},[t.name]):Dt(t.form,{_target:r._target}),lt.isUploadInput(t)&&t.files&&t.files.length>0&&ct.trackFiles(t,Array.from(t.files)),o=ct.serializeUploads(t);let u={type:"form",event:i,value:a,uploads:o,cid:l};this.pushWithReply(h,"event",u,n=>{if(lt.showError(t,this.liveSocket.binding("feedback-for")),lt.isUploadInput(t)&&null!==t.getAttribute("data-phx-auto-upload")){if(ct.filesAwaitingPreflight(t).length>0){let[i,r]=h();this.uploadFiles(t.form,e,i,l,e=>{s&&s(n),this.triggerAwaitingSubmit(t.form)})}}else s&&s(n)})}triggerAwaitingSubmit(t){let e=this.getScheduledSubmit(t);if(e){let[n,i,r,s]=e;this.cancelSubmit(t),s()}}getScheduledSubmit(t){return this.formSubmits.find(([e,n,i,r])=>e.isSameNode(t))}scheduleSubmit(t,e,n,i){if(this.getScheduledSubmit(t))return!0;this.formSubmits.push([t,e,n,i])}cancelSubmit(t){this.formSubmits=this.formSubmits.filter(([e,n,i])=>!e.isSameNode(t)||(this.undoRefs(n),!1))}disableForm(t,e={}){let n=t=>!(tt(t,this.binding("update")+"=ignore",t.form)||tt(t,"data-phx-update=ignore",t.form)),i=Array.from(t.elements),r=i.filter(t=>t.hasAttribute(this.binding("disable-with"))),s=i.filter(t=>"BUTTON"==t.tagName).filter(n),o=i.filter(t=>["INPUT","TEXTAREA","SELECT"].includes(t.tagName)).filter(n);return s.forEach(t=>{t.setAttribute("data-phx-disabled",t.disabled),t.disabled=!0}),o.forEach(t=>{t.setAttribute("data-phx-readonly",t.readOnly),t.readOnly=!0,t.files&&(t.setAttribute("data-phx-disabled",t.disabled),t.disabled=!0)}),t.setAttribute(this.binding("page-loading"),""),this.putRef([t].concat(r).concat(s).concat(o),"submit",e)}pushFormSubmit(t,e,n,i,r,s){let o=()=>this.disableForm(t,r),a=this.targetComponentID(t,e);if(ct.hasUploadsInProgress(t)){let[a,l]=o(),h=()=>this.pushFormSubmit(t,i,e,n,r,s);return this.scheduleSubmit(t,a,r,h)}if(ct.inputsAwaitingPreflight(t).length>0){let[l,h]=o(),u=()=>[l,h,r];this.uploadFiles(t,e,l,a,e=>{let r=Dt(t,{submitter:i});this.pushWithReply(u,"event",{type:"form",event:n,value:r,cid:a},s)})}else{let e=Dt(t,{submitter:i});this.pushWithReply(o,"event",{type:"form",event:n,value:e,cid:a},s)}}uploadFiles(t,e,n,i,r){let s=this.joinCount,o=ct.activeFileInputs(t),a=o.length;o.forEach(t=>{let i=new ct(t,this,()=>{a--,0===a&&r()});this.uploaders[t]=i;let o=i.entries().map(t=>t.toPreflightPayload()),l={ref:t.getAttribute(N),entries:o,cid:this.targetComponentID(t.form,e)};this.log("upload",()=>["sending preflight request",l]),this.pushWithReply(null,"allow_upload",l,t=>{if(this.log("upload",()=>["got preflight response",t]),t.error){this.undoRefs(n);let[e,i]=t.error;this.log("upload",()=>["error for entry "+e,i])}else{let e=t=>{this.channel.onError(()=>{this.joinCount===s&&t()})};i.initAdapterUpload(t,e,this.liveSocket)}})})}dispatchUploads(t,e){let n=lt.findUploadInputs(this.el).filter(e=>e.name===t);0===n.length?X(`no live file inputs found matching the name "${t}"`):n.length>1?X(`duplicate live file inputs found matching the name "${t}"`):lt.dispatchEvent(n[0],"track-uploads",{detail:{files:e}})}pushFormRecovery(t,e,n){this.liveSocket.withinOwners(t,(i,r)=>{let s=Array.from(t.elements).find(t=>lt.isFormInput(t)&&"hidden"!==t.type&&!t.hasAttribute(this.binding("change"))),o=t.getAttribute(this.binding("auto-recover"))||t.getAttribute(this.binding("change"));Lt.exec("change",o,i,s,["push",{_target:s.name,newCid:e,callback:n}])})}pushLinkPatch(t,e,n){let i=this.liveSocket.setPendingLink(t),r=e?()=>this.putRef([e],"click"):null,s=()=>this.liveSocket.redirect(window.location.href),o=this.pushWithReply(r,"live_patch",{url:t},e=>{this.liveSocket.requestDOMUpdate(()=>{e.link_redirect?this.liveSocket.replaceMain(t,null,n,i):(this.liveSocket.commitPendingLink(i)&&(this.href=t),this.applyPendingUpdates(),n&&n(i))})});o?o.receive("timeout",s):s()}formsForRecovery(t){if(0===this.joinCount)return[];let e=this.binding("change"),n=document.createElement("template");return n.innerHTML=t,lt.all(this.el,`form[${e}]`).filter(t=>t.id&&this.ownsElement(t)).filter(t=>t.elements.length>0).filter(t=>"ignore"!==t.getAttribute(this.binding("auto-recover"))).map(t=>{let i=n.content.querySelector(`form[id="${t.id}"][${e}="${t.getAttribute(e)}"]`);return i?[t,i,this.targetComponentID(i)]:[t,null,null]}).filter(([t,e,n])=>e)}maybePushComponentsDestroyed(t){let e=t.filter(t=>0===lt.findComponentNodeList(this.el,t).length);e.length>0&&(this.pruningCIDs.push(...e),this.pushWithReply(null,"cids_will_destroy",{cids:e},()=>{this.pruningCIDs=this.pruningCIDs.filter(t=>-1!==e.indexOf(t));let t=e.filter(t=>0===lt.findComponentNodeList(this.el,t).length);t.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:t},t=>{this.rendered.pruneCIDs(t.cids)})}))}ownsElement(t){let e=t.closest($);return t.getAttribute(R)===this.id||e&&e.id===this.id||!e&&this.isDead}submitForm(t,e,n,i,r={}){lt.putPrivate(t,"phx-has-submitted",!0);let s=this.liveSocket.binding("feedback-for"),o=Array.from(t.elements);o.forEach(t=>lt.putPrivate(t,"phx-has-submitted",!0)),this.liveSocket.blurActiveElement(this),this.pushFormSubmit(t,e,n,i,r,()=>{o.forEach(t=>lt.showError(t,s)),this.liveSocket.restorePreviouslyActiveFocus()})}binding(t){return this.liveSocket.binding(t)}},Nt=class{constructor(){this.transitions=new Set,this.pendingOps=[]}reset(){this.transitions.forEach(t=>{clearTimeout(t),this.transitions.delete(t)}),this.flushPendingOps()}after(t){0===this.size()?t():this.pushPendingOp(t)}addTransition(t,e,n){e();let i=setTimeout(()=>{this.transitions.delete(i),n(),this.flushPendingOps()},t);this.transitions.add(i)}pushPendingOp(t){this.pendingOps.push(t)}size(){return this.transitions.size}flushPendingOps(){if(this.size()>0)return;let t=this.pendingOps.shift();t&&(t(),this.flushPendingOps())}};function Rt(t){return t}function It(t){return"translate("+t+",0)"}function Ft(t){return"translate(0,"+t+")"}function Ut(t){return e=>+t(e)}function Ot(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function $t(){return!this.__axis}function Ht(t,e){var n=[],i=null,r=null,s=6,o=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,h=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",c=1===t||3===t?It:Ft;function d(d){var f=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,p=null==r?e.tickFormat?e.tickFormat.apply(e,n):Rt:r,g=Math.max(s,0)+a,m=e.range(),v=+m[0]+l,y=+m[m.length-1]+l,b=(e.bandwidth?Ot:Ut)(e.copy(),l),w=d.selection?d.selection():d,k=w.selectAll(".domain").data([null]),_=w.selectAll(".tick").data(f,e).order(),x=_.exit(),E=_.enter().append("g").attr("class","tick"),C=_.select("line"),A=_.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),_=_.merge(E),C=C.merge(E.append("line").attr("stroke","currentColor").attr(u+"2",h*s)),A=A.merge(E.append("text").attr("fill","currentColor").attr(u,h*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),d!==w&&(k=k.transition(d),_=_.transition(d),C=C.transition(d),A=A.transition(d),x=x.transition(d).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=b(t))?c(t+l):this.getAttribute("transform")})),E.attr("opacity",1e-6).attr("transform",(function(t){var e=this.parentNode.__axis;return c((e&&isFinite(e=e(t))?e:b(t))+l)}))),x.remove(),k.attr("d",4===t||2===t?o?"M"+h*o+","+v+"H"+l+"V"+y+"H"+h*o:"M"+l+","+v+"V"+y:o?"M"+v+","+h*o+"V"+l+"H"+y+"V"+h*o:"M"+v+","+l+"H"+y),_.attr("opacity",1).attr("transform",(function(t){return c(b(t)+l)})),C.attr(u+"2",h*s),A.attr(u,h*g).text(p),w.filter($t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),w.each((function(){this.__axis=b}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(s=o=+t,d):s},d.tickSizeInner=function(t){return arguments.length?(s=+t,d):s},d.tickSizeOuter=function(t){return arguments.length?(o=+t,d):o},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function jt(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function Bt(t){let e=t,n=t,i=t;function r(t,e,r=0,s=t.length){if(r>>1;i(t[n],e)<0?r=n+1:s=n}while(rt(e)-n,n=jt,i=(e,n)=>jt(t(e),n)),{left:r,center:function(t,n,i=0,s=t.length){const o=r(t,n,i,s-1);return o>i&&e(t[o-1],n)>-e(t[o],n)?o-1:o},right:function(t,e,r=0,s=t.length){if(r>>1;i(t[n],e)<=0?r=n+1:s=n}while(r=0?(s>=qt?10:s>=Jt?5:s>=Vt?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=qt?10:s>=Jt?5:s>=Vt?2:1)}function zt(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=qt?r*=10:s>=Jt?r*=5:s>=Vt&&(r*=2),e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););}))},n&&(r.count=function(e,i){return Yt.setTime(+e),Xt.setTime(+i),t(Yt),t(Xt),Math.floor(n(Yt,Xt))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var Kt=Gt((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));Kt.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Gt((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Kt:null};const Zt=Kt;Kt.range;var Qt=Gt((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}));const te=Qt;Qt.range;var ee=Gt((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}));const ne=ee;ee.range;var ie=Gt((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}));const re=ie;ie.range;var se=Gt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5,t=>t.getDate()-1);const oe=se;se.range;function ae(t){return Gt((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var le=ae(0),he=ae(1),ue=ae(2),ce=ae(3),de=ae(4),fe=ae(5),pe=ae(6),ge=(le.range,he.range,ue.range,ce.range,de.range,fe.range,pe.range,Gt((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})));const me=ge;ge.range;var ve=Gt((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));ve.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Gt((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};const ye=ve;ve.range;var be=Gt((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()}));const we=be;be.range;var ke=Gt((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}));const _e=ke;ke.range;var xe=Gt((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}));const Ee=xe;xe.range;function Ce(t){return Gt((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var Ae=Ce(0),Se=Ce(1),Te=Ce(2),Me=Ce(3),Le=Ce(4),De=Ce(5),Pe=Ce(6),Ne=(Ae.range,Se.range,Te.range,Me.range,Le.range,De.range,Pe.range,Gt((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})));const Re=Ne;Ne.range;var Ie=Gt((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Ie.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Gt((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const Fe=Ie;Ie.range;function Ue(t,e,n,i,r,s){const o=[[te,1,1e3],[te,5,5e3],[te,15,15e3],[te,30,3e4],[s,1,6e4],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,36e5],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,864e5],[i,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function a(e,n,i){const r=Math.abs(n-e)/i,s=Bt(([,,t])=>t).right(o,r);if(s===o.length)return t.every(zt(e/31536e6,n/31536e6,i));if(0===s)return Zt.every(Math.max(zt(e,n,i),1));const[a,l]=o[r/o[s-1][2][t.toLowerCase(),e]))}function en(t,e,n){var i=Ye.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function nn(t,e,n){var i=Ye.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function rn(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function sn(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function on(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function an(t,e,n){var i=Ye.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function ln(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function hn(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function un(t,e,n){var i=Ye.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function cn(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function dn(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function fn(t,e,n){var i=Ye.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function pn(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function gn(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function mn(t,e,n){var i=Ye.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function vn(t,e,n){var i=Ye.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function yn(t,e,n){var i=Ye.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function bn(t,e,n){var i=Xe.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function wn(t,e,n){var i=Ye.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function kn(t,e,n){var i=Ye.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function _n(t,e){return Ke(t.getDate(),e,2)}function xn(t,e){return Ke(t.getHours(),e,2)}function En(t,e){return Ke(t.getHours()%12||12,e,2)}function Cn(t,e){return Ke(1+oe.count(ye(t),t),e,3)}function An(t,e){return Ke(t.getMilliseconds(),e,3)}function Sn(t,e){return An(t,e)+"000"}function Tn(t,e){return Ke(t.getMonth()+1,e,2)}function Mn(t,e){return Ke(t.getMinutes(),e,2)}function Ln(t,e){return Ke(t.getSeconds(),e,2)}function Dn(t){var e=t.getDay();return 0===e?7:e}function Pn(t,e){return Ke(le.count(ye(t)-1,t),e,2)}function Nn(t){var e=t.getDay();return e>=4||0===e?de(t):de.ceil(t)}function Rn(t,e){return t=Nn(t),Ke(de.count(ye(t),t)+(4===ye(t).getDay()),e,2)}function In(t){return t.getDay()}function Fn(t,e){return Ke(he.count(ye(t)-1,t),e,2)}function Un(t,e){return Ke(t.getFullYear()%100,e,2)}function On(t,e){return Ke((t=Nn(t)).getFullYear()%100,e,2)}function $n(t,e){return Ke(t.getFullYear()%1e4,e,4)}function Hn(t,e){var n=t.getDay();return Ke((t=n>=4||0===n?de(t):de.ceil(t)).getFullYear()%1e4,e,4)}function jn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ke(e/60|0,"0",2)+Ke(e%60,"0",2)}function Bn(t,e){return Ke(t.getUTCDate(),e,2)}function qn(t,e){return Ke(t.getUTCHours(),e,2)}function Jn(t,e){return Ke(t.getUTCHours()%12||12,e,2)}function Vn(t,e){return Ke(1+Ee.count(Fe(t),t),e,3)}function Wn(t,e){return Ke(t.getUTCMilliseconds(),e,3)}function zn(t,e){return Wn(t,e)+"000"}function Yn(t,e){return Ke(t.getUTCMonth()+1,e,2)}function Xn(t,e){return Ke(t.getUTCMinutes(),e,2)}function Gn(t,e){return Ke(t.getUTCSeconds(),e,2)}function Kn(t){var e=t.getUTCDay();return 0===e?7:e}function Zn(t,e){return Ke(Ae.count(Fe(t)-1,t),e,2)}function Qn(t){var e=t.getUTCDay();return e>=4||0===e?Le(t):Le.ceil(t)}function ti(t,e){return t=Qn(t),Ke(Le.count(Fe(t),t)+(4===Fe(t).getUTCDay()),e,2)}function ei(t){return t.getUTCDay()}function ni(t,e){return Ke(Se.count(Fe(t)-1,t),e,2)}function ii(t,e){return Ke(t.getUTCFullYear()%100,e,2)}function ri(t,e){return Ke((t=Qn(t)).getUTCFullYear()%100,e,2)}function si(t,e){return Ke(t.getUTCFullYear()%1e4,e,4)}function oi(t,e){var n=t.getUTCDay();return Ke((t=n>=4||0===n?Le(t):Le.ceil(t)).getUTCFullYear()%1e4,e,4)}function ai(){return"+0000"}function li(){return"%"}function hi(t){return+t}function ui(t){return Math.floor(+t/1e3)}Ve=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,o=t.shortDays,a=t.months,l=t.shortMonths,h=Qe(r),u=tn(r),c=Qe(s),d=tn(s),f=Qe(o),p=tn(o),g=Qe(a),m=tn(a),v=Qe(l),y=tn(l),b={a:function(t){return o[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:_n,e:_n,f:Sn,g:On,G:Hn,H:xn,I:En,j:Cn,L:An,m:Tn,M:Mn,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:hi,s:ui,S:Ln,u:Dn,U:Pn,V:Rn,w:In,W:Fn,x:null,X:null,y:Un,Y:$n,Z:jn,"%":li},w={a:function(t){return o[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Bn,e:Bn,f:zn,g:ri,G:oi,H:qn,I:Jn,j:Vn,L:Wn,m:Yn,M:Xn,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:hi,s:ui,S:Gn,u:Kn,U:Zn,V:ti,w:ei,W:ni,x:null,X:null,y:ii,Y:si,Z:ai,"%":li},k={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return E(t,e,n,i)},d:dn,e:dn,f:yn,g:ln,G:an,H:pn,I:pn,j:fn,L:vn,m:cn,M:gn,p:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:un,Q:wn,s:kn,S:mn,u:nn,U:rn,V:sn,w:en,W:on,x:function(t,e,i){return E(t,n,e,i)},X:function(t,e,n){return E(t,i,e,n)},y:ln,Y:an,Z:hn,"%":bn};function _(t,e){return function(n){var i,r,s,o=[],a=-1,l=0,h=t.length;for(n instanceof Date||(n=new Date(+n));++a53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=qe(Je(s.y,0,1))).getUTCDay(),i=r>4||0===r?Se.ceil(i):Se(i),i=Ee.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=Be(Je(s.y,0,1))).getDay(),i=r>4||0===r?he.ceil(i):he(i),i=oe.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?qe(Je(s.y,0,1)).getUTCDay():Be(Je(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,qe(s)):Be(s)}}function E(t,e,n,i){for(var r,s,o=0,a=e.length,l=n.length;o=l)return-1;if(37===(r=e.charCodeAt(o++))){if(r=e.charAt(o++),!(s=k[r in ze?e.charAt(o++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=_(n,b),b.X=_(i,b),b.c=_(e,b),w.x=_(n,w),w.X=_(i,w),w.c=_(e,w),{format:function(t){var e=_(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=x(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=_(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=x(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),We=Ve.format,Ve.parse,Ve.utcFormat,Ve.utcParse;const ci=Bt(jt),di=ci.right,fi=(ci.left,Bt((function(t){return null===t?NaN:+t})).center,di);function pi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function gi(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function mi(){}var vi="\\s*([+-]?\\d+)\\s*",yi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wi=/^#([0-9a-f]{3,8})$/,ki=new RegExp(`^rgb\\(${vi},${vi},${vi}\\)$`),_i=new RegExp(`^rgb\\(${bi},${bi},${bi}\\)$`),xi=new RegExp(`^rgba\\(${vi},${vi},${vi},${yi}\\)$`),Ei=new RegExp(`^rgba\\(${bi},${bi},${bi},${yi}\\)$`),Ci=new RegExp(`^hsl\\(${yi},${bi},${bi}\\)$`),Ai=new RegExp(`^hsla\\(${yi},${bi},${bi},${yi}\\)$`),Si={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ti(){return this.rgb().formatHex()}function Mi(){return this.rgb().formatRgb()}function Li(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=wi.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Di(e):3===n?new Ii(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Pi(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Pi(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ki.exec(t))?new Ii(e[1],e[2],e[3],1):(e=_i.exec(t))?new Ii(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=xi.exec(t))?Pi(e[1],e[2],e[3],e[4]):(e=Ei.exec(t))?Pi(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ci.exec(t))?ji(e[1],e[2]/100,e[3]/100,1):(e=Ai.exec(t))?ji(e[1],e[2]/100,e[3]/100,e[4]):Si.hasOwnProperty(t)?Di(Si[t]):"transparent"===t?new Ii(NaN,NaN,NaN,0):null}function Di(t){return new Ii(t>>16&255,t>>8&255,255&t,1)}function Pi(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ii(t,e,n,i)}function Ni(t){return t instanceof mi||(t=Li(t)),t?new Ii((t=t.rgb()).r,t.g,t.b,t.opacity):new Ii}function Ri(t,e,n,i){return 1===arguments.length?Ni(t):new Ii(t,e,n,null==i?1:i)}function Ii(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Fi(){return`#${Hi(this.r)}${Hi(this.g)}${Hi(this.b)}`}function Ui(){const t=Oi(this.opacity);return`${1===t?"rgb(":"rgba("}${$i(this.r)}, ${$i(this.g)}, ${$i(this.b)}${1===t?")":`, ${t})`}`}function Oi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $i(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Hi(t){return((t=$i(t))<16?"0":"")+t.toString(16)}function ji(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new qi(t,e,n,i)}function Bi(t){if(t instanceof qi)return new qi(t.h,t.s,t.l,t.opacity);if(t instanceof mi||(t=Li(t)),!t)return new qi;if(t instanceof qi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=e===s?(n-i)/a+6*(n0&&l<1?0:o,new qi(o,a,l,t.opacity)}function qi(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Ji(t){return(t=(t||0)%360)<0?t+360:t}function Vi(t){return Math.max(0,Math.min(1,t||0))}function Wi(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function zi(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}pi(mi,Li,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ti,formatHex:Ti,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Bi(this).formatHsl()},formatRgb:Mi,toString:Mi}),pi(Ii,Ri,gi(mi,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ii(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Ii(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ii($i(this.r),$i(this.g),$i(this.b),Oi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fi,formatHex:Fi,formatHex8:function(){return`#${Hi(this.r)}${Hi(this.g)}${Hi(this.b)}${Hi(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ui,toString:Ui})),pi(qi,(function(t,e,n,i){return 1===arguments.length?Bi(t):new qi(t,e,n,null==i?1:i)}),gi(mi,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new qi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new qi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ii(Wi(t>=240?t-240:t+120,r,i),Wi(t,r,i),Wi(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new qi(Ji(this.h),Vi(this.s),Vi(this.l),Oi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Oi(this.opacity);return`${1===t?"hsl(":"hsla("}${Ji(this.h)}, ${100*Vi(this.s)}%, ${100*Vi(this.l)}%${1===t?")":`, ${t})`}`}}));const Yi=t=>()=>t;function Xi(t,e){return function(n){return t+n*e}}function Gi(t){return 1==(t=+t)?Ki:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Yi(isNaN(e)?n:e)}}function Ki(t,e){var n=e-t;return n?Xi(t,n):Yi(isNaN(t)?e:t)}const Zi=function t(e){var n=Gi(e);function i(t,e){var i=n((t=Ri(t)).r,(e=Ri(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),o=Ki(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function Qi(t){return function(e){var n,i,r=e.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1],o=i>0?t[i-1]:2*r-s,a=is&&(r=e.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:nr(n,i)})),s=sr.lastIndex;return se&&(n=t,t=e,e=n),h=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?gr:pr,r=s=null,c}function c(e){return null==e||isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(h(e)))}return c.invert=function(n){return h(e((s||(s=i(a,o.map(t),nr)))(n)))},c.domain=function(t){return arguments.length?(o=Array.from(t,ur),u()):o.slice()},c.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},c.rangeRound=function(t){return a=Array.from(t),l=hr,u()},c.clamp=function(t){return arguments.length?(h=!!t||dr,u()):h!==dr},c.interpolate=function(t){return arguments.length?(l=t,u()):l},c.unknown=function(t){return arguments.length?(n=t,c):n},function(n,i){return t=n,e=i,u()}}function yr(){return vr()(dr,dr)}function br(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function wr(t){return new Date(t)}function kr(t){return t instanceof Date?+t:+new Date(+t)}function _r(t,e,n,i,r,s,o,a,l,h){var u=yr(),c=u.invert,d=u.domain,f=h(".%L"),p=h(":%S"),g=h("%I:%M"),m=h("%I %p"),v=h("%a %d"),y=h("%b %d"),b=h("%B"),w=h("%Y");function k(t){return(l(t)=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Cr(t){if(!(e=Er.exec(t)))throw new Error("invalid format: "+t);var e;return new Ar({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Ar(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Sr(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Tr(t){return(t=Sr(Math.abs(t)))?t[1]:NaN}function Mr(t,e){var n=Sr(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Cr.prototype=Ar.prototype,Ar.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Lr={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Mr(100*t,e),r:Mr,s:function(t,e){var n=Sr(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(xr=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Sr(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Dr(t){return t}var Pr,Nr,Rr,Ir=Array.prototype.map,Fr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ur(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Dr:(e=Ir.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Dr:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Ir.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",h=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=Cr(t)).fill,n=t.align,c=t.sign,d=t.symbol,f=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):Lr[y]||(void 0===m&&(m=12),v=!0,y="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?s:/[%p]/.test(y)?l:"",k=Lr[y],_=/[defgprs%]/.test(y);function x(t){var r,s,l,d=b,x=w;if("c"===y)x=k(t)+x,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:k(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==c&&(E=!1),d=(E?"("===c?c:h:"-"===c||"("===c?"":c)+d,x=("s"===y?Fr[8+xr/3]:"")+x+(E&&"("===c?")":""),_)for(r=-1,s=t.length;++r(l=t.charCodeAt(r))||l>57){x=(46===l?o+t.slice(r+1):t.slice(r))+x,t=t.slice(0,r);break}}g&&!f&&(t=i(t,1/0));var C=d.length+t.length+x.length,A=C>1)+d+t+x+A.slice(C);break;default:t=A+d+t+x}return a(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),x.toString=function(){return t+""},x}return{format:c,formatPrefix:function(t,e){var n=c(((t=Cr(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Tr(e)/3))),r=Math.pow(10,-i),s=Fr[8+i/3];return function(t){return n(r*t)+s}}}}function Or(t,e,n,i){var r,s=zt(t,e,n);switch((i=Cr(null==i?",f":i)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Tr(e)/3)))-Tr(Math.abs(t)))}(s,o))||(i.precision=r),Rr(i,o);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Tr(e)-Tr(t))+1}(s,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-Tr(Math.abs(t)))}(s))||(i.precision=r-2*("%"===i.type))}return Nr(i)}function $r(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,s,o,a=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((i=e0){let n=Math.round(t/o),i=Math.round(e/o);for(n*oe&&--i,s=new Array(r=i-n+1);++ae&&--i,s=new Array(r=i-n+1);++a0;){if((r=Wt(l,h,n))===i)return s[o]=l,s[a]=h,e(s);if(r>0)l=Math.floor(l/r)*r,h=Math.ceil(h/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,h=Math.floor(h*r)/r}i=r}return t},t}function Hr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n=r)&&(n=r)}return n}!function(t){Pr=Ur(t),Nr=Pr.format,Rr=Pr.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const jr=Math.PI,Br=2*jr,qr=Br-1e-6;function Jr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Vr(){return new Jr}Jr.prototype=Vr.prototype={constructor:Jr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,s){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var s=this._x1,o=this._y1,a=n-t,l=i-e,h=s-t,u=o-e,c=h*h+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(c>1e-6)if(Math.abs(u*a-l*h)>1e-6&&r){var d=n-s,f=i-o,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),v=Math.sqrt(c),y=r*Math.tan((jr-Math.acos((p+c-g)/(2*m*v)))/2),b=y/v,w=y/m;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*h)+","+(e+b*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>h*f)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+o,h=e+a,u=1^s,c=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+l+","+h),n&&(c<0&&(c=c%Br+Br),c>qr?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=h):c>1e-6&&(this._+="A"+n+","+n+",0,"+ +(c>=jr)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const Wr=Vr;Array.prototype.slice;function zr(t){return function(){return t}}function Yr(t){this._context=t}function Xr(t){return new Yr(t)}function Gr(t){return t[0]}function Kr(t){return t[1]}function Zr(t,e){var n=zr(!0),i=null,r=Xr,s=null;function o(o){var a,l,h,u=(o=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(o)).length,c=!1;for(null==i&&(s=r(h=Wr())),a=0;a<=u;++a)!(ae?1:t>=e?0:NaN}cs.prototype={constructor:cs,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var ys="http://www.w3.org/1999/xhtml";const bs={svg:"http://www.w3.org/2000/svg",xhtml:ys,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ws(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),bs.hasOwnProperty(e)?{space:bs[e],local:t}:t}function ks(t){return function(){this.removeAttribute(t)}}function _s(t){return function(){this.removeAttributeNS(t.space,t.local)}}function xs(t,e){return function(){this.setAttribute(t,e)}}function Es(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Cs(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function As(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Ss(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ts(t){return function(){this.style.removeProperty(t)}}function Ms(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ls(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Ds(t,e){return t.style.getPropertyValue(e)||Ss(t).getComputedStyle(t,null).getPropertyValue(e)}function Ps(t){return function(){delete this[t]}}function Ns(t,e){return function(){this[t]=e}}function Rs(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Is(t){return t.trim().split(/^|\s+/)}function Fs(t){return t.classList||new Us(t)}function Us(t){this._node=t,this._names=Is(t.getAttribute("class")||"")}function Os(t,e){for(var n=Fs(t),i=-1,r=e.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function so(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var uo=[null];function co(t,e){this._groups=t,this._parents=e}function fo(){return new co([[document.documentElement]],uo)}co.prototype=fo.prototype={constructor:co,select:function(t){"function"!=typeof t&&(t=ts(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=k&&(k=w+1);!(b=m[k])&&++k=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=vs);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s1?this.each((null==e?Ts:"function"==typeof e?Ls:Ms)(t,e,null==n?"":n)):Ds(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Ps:"function"==typeof e?Rs:Ns)(t,e)):this.node()[t]},classed:function(t,e){var n=Is(t+"");if(arguments.length<2){for(var i=Fs(this.node()),r=-1,s=n.length;++r{}};function mo(){for(var t,e=0,n=arguments.length,i={};e=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function bo(t,e){for(var n,i=0,r=t.length;i0)for(var n,i,r=new Array(n),s=0;s=0&&e._call.call(void 0,t),e=e._next;--Eo}()}finally{Eo=0,function(){var t,e,n=_o,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:_o=e);xo=t,Oo(i)}(),To=0}}function Uo(){var t=Lo.now(),e=t-So;e>1e3&&(Mo-=e,So=t)}function Oo(t){Eo||(Co&&(Co=clearTimeout(Co)),t-To>24?(t<1/0&&(Co=setTimeout(Fo,t-Lo.now()-Mo)),Ao&&(Ao=clearInterval(Ao))):(Ao||(So=Lo.now(),Ao=setInterval(Uo,1e3)),Eo=1,Do(Fo)))}function $o(t,e,n){var i=new Ro;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i}Ro.prototype=Io.prototype={constructor:Ro,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Po():+n)+(null==e?0:+e),this._next||xo===this||(xo?xo._next=this:_o=this,xo=this),this._call=t,this._time=n,Oo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Oo())}};var Ho=ko("start","end","cancel","interrupt"),jo=[];function Bo(t,e,n,i,r,s){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(l){var h,u,c,d;if(1!==n.state)return a();for(h in r)if((d=r[h]).name===n.name){if(3===d.state)return $o(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[h]):+h0)throw new Error("too late; already scheduled");return n}function Jo(t,e){var n=Vo(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Vo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var Wo,zo=180/Math.PI,Yo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xo(t,e,n,i,r,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:nr(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,o.rotate,a,l),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:nr(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,o.skewX,a,l),function(t,e,n,i,s,o){if(t!==n||e!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:nr(t,n)},{i:a-2,x:nr(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(t){for(var e,n=-1,i=l.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?qo:Jo;return function(){var o=s(this,t),a=o.on;a!==i&&(r=(i=a).copy()).on(e,n),o.on=r}}var ba=po.prototype.constructor;function wa(t){return function(){this.style.removeProperty(t)}}function ka(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function _a(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&ka(t,s,n)),i}return s._value=e,s}function xa(t){return function(e){this.textContent=t.call(this,e)}}function Ea(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&xa(i)),e}return i._value=t,i}var Ca=0;function Aa(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Sa(){return++Ca}var Ta=po.prototype;Aa.prototype=function(t){return po().transition(t)}.prototype={constructor:Aa,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=ts(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o=e&&(n=i=e):(n>e&&(n=e),i=s&&(n=i=s):(n>s&&(n=s),i2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):o=!1;o&&delete t.__transition}}(this,t)}))},po.prototype.transition=function(t){var e,n;t instanceof Aa?(e=t._id,t=t._name):(e=Sa(),(n=Ma).time=Po(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,s=0;s{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}isProfileEnabled(){return"true"===this.sessionStorage.getItem("phx:live-socket:profiling")}isDebugEnabled(){return"true"===this.sessionStorage.getItem(j)}isDebugDisabled(){return"false"===this.sessionStorage.getItem(j)}enableDebug(){this.sessionStorage.setItem(j,"true")}enableProfiling(){this.sessionStorage.setItem("phx:live-socket:profiling","true")}disableDebug(){this.sessionStorage.setItem(j,"false")}disableProfiling(){this.sessionStorage.removeItem("phx:live-socket:profiling")}enableLatencySim(t){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem("phx:live-socket:latency-sim",t)}disableLatencySim(){this.sessionStorage.removeItem("phx:live-socket:latency-sim")}getLatencySim(){let t=this.sessionStorage.getItem("phx:live-socket:latency-sim");return t?parseInt(t):null}getSocket(){return this.socket}connect(){"localhost"!==window.location.hostname||this.isDebugDisabled()||this.enableDebug();let t=()=>{this.joinRootViews()?(this.bindTopLevelEvents(),this.socket.connect()):this.main?this.socket.connect():this.bindTopLevelEvents({dead:!0}),this.joinDeadView()};["complete","loaded","interactive"].indexOf(document.readyState)>=0?t():document.addEventListener("DOMContentLoaded",()=>t())}disconnect(t){clearTimeout(this.reloadWithJitterTimer),this.socket.disconnect(t)}replaceTransport(t){clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(t),this.connect()}execJS(t,e,n=null){this.owner(t,i=>Lt.exec(n,e,i,t))}unload(){this.unloaded||(this.main&&this.isConnected()&&this.log(this.main,"socket",()=>["disconnect for page nav"]),this.unloaded=!0,this.destroyAllViews(),this.disconnect())}triggerDOM(t,e){this.domCallbacks[t](...e)}time(t,e){if(!this.isProfileEnabled()||!console.time)return e();console.time(t);let n=e();return console.timeEnd(t),n}log(t,e,n){if(this.viewLogger){let[i,r]=n();this.viewLogger(t,e,i,r)}else if(this.isDebugEnabled()){let[i,r]=n();((t,e,n,i)=>{t.liveSocket.isDebugEnabled()&&console.log(`${t.id} ${e}: ${n} - `,i)})(t,e,i,r)}}requestDOMUpdate(t){this.transitions.after(t)}transition(t,e,n=function(){}){this.transitions.addTransition(t,e,n)}onChannel(t,e,n){t.on(e,t=>{let e=this.getLatencySim();e?setTimeout(()=>n(t),e):n(t)})}wrapPush(t,e,n){let i=this.getLatencySim(),r=t.joinCount;if(!i)return this.isConnected()&&e.timeout?n().receive("timeout",()=>{t.joinCount!==r||t.isDestroyed()||this.reloadWithJitter(t,()=>{this.log(t,"timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})}):n();let s={receives:[],receive(t,e){this.receives.push([t,e])}};return setTimeout(()=>{t.isDestroyed()||s.receives.reduce((t,[e,n])=>t.receive(e,n),n())},i),s}reloadWithJitter(t,e){clearTimeout(this.reloadWithJitterTimer),this.disconnect();let n=this.reloadJitterMin,i=this.reloadJitterMax,r=Math.floor(Math.random()*(i-n+1))+n,s=ot.updateLocal(this.localStorage,window.location.pathname,"consecutive-reloads",0,t=>t+1);s>this.maxReloads&&(r=this.failsafeJitter),this.reloadWithJitterTimer=setTimeout(()=>{t.isDestroyed()||t.isConnected()||(t.destroy(),e?e():this.log(t,"join",()=>[`encountered ${s} consecutive reloads`]),s>this.maxReloads&&this.log(t,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]),this.hasPendingLink()?window.location=this.pendingLink:window.location.reload())},r)}getHookCallbacks(t){return t&&t.startsWith("Phoenix.")?ft[t.split(".")[1]]:this.hooks[t]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(t){return`${this.getBindingPrefix()}${t}`}channel(t,e){return this.socket.channel(t,e)}joinDeadView(){let t=document.body;if(t&&!this.isPhxView(t)&&!this.isPhxView(document.firstElementChild)){let e=this.newRootView(t);e.setHref(this.getHref()),e.joinDead(),this.main||(this.main=e),window.requestAnimationFrame(()=>e.execNewMounted())}}joinRootViews(){let t=!1;return lt.all(document,`${$}:not([${R}])`,e=>{if(!this.getRootById(e.id)){let t=this.newRootView(e);t.setHref(this.getHref()),t.join(),e.hasAttribute("data-phx-main")&&(this.main=t)}t=!0}),t}redirect(t,e){this.unload(),ot.redirect(t,e)}replaceMain(t,e,n=null,i=this.setPendingLink(t)){let r=this.currentLocation.href;this.outgoingMainEl=this.outgoingMainEl||this.main.el;let s=lt.cloneNode(this.outgoingMainEl,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(s,e,r),this.main.setRedirect(t),this.transitionRemoves(),this.main.join((t,e)=>{1===t&&this.commitPendingLink(i)&&this.requestDOMUpdate(()=>{lt.findPhxSticky(document).forEach(t=>s.appendChild(t)),this.outgoingMainEl.replaceWith(s),this.outgoingMainEl=null,n&&requestAnimationFrame(n),e()})})}transitionRemoves(t){let e=this.binding("remove");(t=t||lt.all(document,`[${e}]`)).forEach(t=>{document.body.contains(t)&&this.execJS(t,t.getAttribute(e),"remove")})}isPhxView(t){return t.getAttribute&&null!==t.getAttribute(O)}newRootView(t,e,n){let i=new Pt(t,this,null,e,n);return this.roots[i.id]=i,i}owner(t,e){let n=it(t.closest($),t=>this.getViewByEl(t))||this.main;n&&e(n)}withinOwners(t,e){this.owner(t,n=>e(n,t))}getViewByEl(t){let e=t.getAttribute(I);return it(this.getRootById(e),e=>e.getDescendentByEl(t))}getRootById(t){return this.roots[t]}destroyAllViews(){for(let t in this.roots)this.roots[t].destroy(),delete this.roots[t];this.main=null}destroyViewByEl(t){let e=this.getRootById(t.getAttribute(I));e&&e.id===t.id?(e.destroy(),delete this.roots[e.id]):e&&e.destroyDescendent(t.id)}setActiveElement(t){if(this.activeElement===t)return;this.activeElement=t;let e=()=>{t===this.activeElement&&(this.activeElement=null),t.removeEventListener("mouseup",this),t.removeEventListener("touchend",this)};t.addEventListener("mouseup",e),t.addEventListener("touchend",e)}getActiveElement(){return document.activeElement===document.body?this.activeElement||document.activeElement:document.activeElement||document.body}dropActiveElement(t){this.prevActive&&t.ownsElement(this.prevActive)&&(this.prevActive=null)}restorePreviouslyActiveFocus(){this.prevActive&&this.prevActive!==document.body&&this.prevActive.focus()}blurActiveElement(){this.prevActive=this.getActiveElement(),this.prevActive!==document.body&&this.prevActive.blur()}bindTopLevelEvents({dead:t}={}){this.boundTopLevelEvents||(this.boundTopLevelEvents=!0,this.socket.onClose(t=>t&&1001===t.code?this.unload():t&&1e3===t.code&&this.main?this.reloadWithJitter(this.main):void 0),document.body.addEventListener("click",(function(){})),window.addEventListener("pageshow",t=>{t.persisted&&(this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())},!0),t||this.bindNav(),this.bindClicks(),t||this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(t,e,n,i,r,s)=>{let o=i.getAttribute(this.binding("key")),a=t.key&&t.key.toLowerCase();if(o&&o.toLowerCase()!==a)return;let l={key:t.key,...this.eventMeta(e,t,i)};Lt.exec(e,r,n,i,["push",{data:l}])}),this.bind({blur:"focusout",focus:"focusin"},(t,e,n,i,r,s)=>{if(!s){let s={key:t.key,...this.eventMeta(e,t,i)};Lt.exec(e,r,n,i,["push",{data:s}])}}),this.bind({blur:"blur",focus:"focus"},(t,e,n,i,r,s,o)=>{if("window"===o){let r=this.eventMeta(e,t,i);Lt.exec(e,s,n,i,["push",{data:r}])}}),window.addEventListener("dragover",t=>t.preventDefault()),window.addEventListener("drop",t=>{t.preventDefault();let e=it(tt(t.target,this.binding("drop-target")),t=>t.getAttribute(this.binding("drop-target"))),n=e&&document.getElementById(e),i=Array.from(t.dataTransfer.files||[]);n&&!n.disabled&&0!==i.length&&n.files instanceof FileList&&(ct.trackFiles(n,i,t.dataTransfer),n.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on("track-uploads",t=>{let e=t.target;if(!lt.isUploadInput(e))return;let n=Array.from(t.detail.files||[]).filter(t=>t instanceof File||t instanceof Blob);ct.trackFiles(e,n),e.dispatchEvent(new Event("input",{bubbles:!0}))}))}eventMeta(t,e,n){let i=this.metadataCallbacks[t];return i?i(e,n):{}}setPendingLink(t){return this.linkRef++,this.pendingLink=t,this.linkRef}commitPendingLink(t){return this.linkRef===t&&(this.href=this.pendingLink,this.pendingLink=null,!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(t,e){for(let n in t){let i=t[n];this.on(i,t=>{let r=this.binding(n),s=this.binding("window-"+n),o=t.target.getAttribute&&t.target.getAttribute(r);o?this.debounce(t.target,t,i,()=>{this.withinOwners(t.target,i=>{e(t,n,i,t.target,o,null)})}):lt.all(document,`[${s}]`,r=>{let o=r.getAttribute(s);this.debounce(r,t,i,()=>{this.withinOwners(r,i=>{e(t,n,i,r,o,"window")})})})})}}bindClicks(){window.addEventListener("click",t=>this.clickStartedAtTarget=t.target),this.bindClick("click","click",!1),this.bindClick("mousedown","capture-click",!0)}bindClick(t,e,n){let i=this.binding(e);window.addEventListener(t,t=>{let e=null;if(n)e=t.target.matches(`[${i}]`)?t.target:t.target.querySelector(`[${i}]`);else{let n=this.clickStartedAtTarget||t.target;e=tt(n,i),this.dispatchClickAway(t,n),this.clickStartedAtTarget=null}let r=e&&e.getAttribute(i);if(r)"#"===e.getAttribute("href")&&t.preventDefault(),this.debounce(e,t,"click",()=>{this.withinOwners(e,n=>{Lt.exec("click",r,n,e,["push",{data:this.eventMeta("click",t,e)}])})});else{let e=t.target instanceof HTMLAnchorElement?t.target.getAttribute("href"):null;n||null===e||lt.wantsNewTab(t)||!lt.isNewPageHref(e,window.location)||this.unload()}},n)}dispatchClickAway(t,e){let n=this.binding("click-away");lt.all(document,`[${n}]`,i=>{i.isSameNode(e)||i.contains(e)||this.withinOwners(t.target,e=>{let r=i.getAttribute(n);Lt.isVisible(i)&&Lt.exec("click",r,e,i,["push",{data:this.eventMeta("click",t,t.target)}])})})}bindNav(){if(!ot.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let t=null;window.addEventListener("scroll",e=>{clearTimeout(t),t=setTimeout(()=>{ot.updateCurrentState(t=>Object.assign(t,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",t=>{if(!this.registerNewLocation(window.location))return;let{type:e,id:n,root:i,scroll:r}=t.state||{},s=window.location.href;this.requestDOMUpdate(()=>{this.main.isConnected()&&"patch"===e&&n===this.main.id?this.main.pushLinkPatch(s,null,()=>{this.maybeScroll(r)}):this.replaceMain(s,null,()=>{i&&this.replaceRootHistory(),this.maybeScroll(r)})})},!1),window.addEventListener("click",t=>{let e=tt(t.target,"data-phx-link"),n=e&&e.getAttribute("data-phx-link");if(!n||!this.isConnected()||!this.main||lt.wantsNewTab(t))return;let i=e.href,r=e.getAttribute("data-phx-link-state");t.preventDefault(),t.stopImmediatePropagation(),this.pendingLink!==i&&this.requestDOMUpdate(()=>{if("patch"===n)this.pushHistoryPatch(i,r,e);else{if("redirect"!==n)throw new Error('expected data-phx-link to be "patch" or "redirect", got: '+n);this.historyRedirect(i,r)}let t=e.getAttribute(this.binding("click"));t&&this.requestDOMUpdate(()=>this.execJS(e,t,"click"))})},!1)}maybeScroll(t){"number"==typeof t&&requestAnimationFrame(()=>{window.scrollTo(0,t)})}dispatchEvent(t,e={}){lt.dispatchEvent(window,"phx:"+t,{detail:e})}dispatchEvents(t){t.forEach(([t,e])=>this.dispatchEvent(t,e))}withPageLoading(t,e){lt.dispatchEvent(window,"phx:page-loading-start",{detail:t});let n=()=>lt.dispatchEvent(window,"phx:page-loading-stop",{detail:t});return e?e(n):n}pushHistoryPatch(t,e,n){if(!this.isConnected())return ot.redirect(t);this.withPageLoading({to:t,kind:"patch"},i=>{this.main.pushLinkPatch(t,n,n=>{this.historyPatch(t,e,n),i()})})}historyPatch(t,e,n=this.setPendingLink(t)){this.commitPendingLink(n)&&(ot.pushState(e,{type:"patch",id:this.main.id},t),this.registerNewLocation(window.location))}historyRedirect(t,e,n){if(!this.isConnected())return ot.redirect(t,n);if(/^\/$|^\/[^\/]+.*$/.test(t)){let{protocol:e,host:n}=window.location;t=`${e}//${n}${t}`}let i=window.scrollY;this.withPageLoading({to:t,kind:"redirect"},r=>{this.replaceMain(t,n,()=>{ot.pushState(e,{type:"redirect",id:this.main.id,scroll:i},t),this.registerNewLocation(window.location),r()})})}replaceRootHistory(){ot.pushState("replace",{root:!0,type:"patch",id:this.main.id})}registerNewLocation(t){let{pathname:e,search:n}=this.currentLocation;return e+n!==t.pathname+t.search&&(this.currentLocation=Q(t),!0)}bindForms(){let t=0,e=!1;this.on("submit",t=>{let n=t.target.getAttribute(this.binding("submit")),i=t.target.getAttribute(this.binding("change"));e||!i||n||(e=!0,t.preventDefault(),this.withinOwners(t.target,e=>{e.disableForm(t.target),window.requestAnimationFrame(()=>{lt.isUnloadableFormSubmit(t)&&this.unload(),t.target.submit()})}))},!0),this.on("submit",t=>{let e=t.target.getAttribute(this.binding("submit"));e?(t.preventDefault(),t.target.disabled=!0,this.withinOwners(t.target,n=>{Lt.exec("submit",e,n,t.target,["push",{submitter:t.submitter}])})):lt.isUnloadableFormSubmit(t)&&this.unload()},!1);for(let e of["change","input"])this.on(e,n=>{let i=this.binding("change"),r=n.target,s=r.getAttribute(i),o=r.form&&r.form.getAttribute(i),a=s||o;if(!a)return;if("number"===r.type&&r.validity&&r.validity.badInput)return;let l=s?r:r.form,h=t;t++;let{at:u,type:c}=lt.private(r,"prev-iteration")||{};u===h-1&&e!==c||(lt.putPrivate(r,"prev-iteration",{at:h,type:e}),this.debounce(r,n,e,()=>{this.withinOwners(l,t=>{lt.putPrivate(r,"phx-has-focused",!0),lt.isTextualInput(r)||this.setActiveElement(r),Lt.exec("change",a,t,r,["push",{_target:n.target.name,dispatcher:l}])})}))},!1);this.on("reset",t=>{let e=t.target;lt.resetForm(e,this.binding("feedback-for"));let n=Array.from(e.elements).find(t=>"reset"===t.type);window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))})})}debounce(t,e,n,i){if("blur"===n||"focusout"===n)return i();let r=this.binding("debounce"),s=this.binding("throttle"),o=this.defaults.debounce.toString(),a=this.defaults.throttle.toString();this.withinOwners(t,n=>{lt.debounce(t,e,r,o,s,a,()=>!n.isDestroyed()&&document.body.contains(t),()=>{i()})})}silenceEvents(t){this.silenced=!0,t(),this.silenced=!1}on(t,e){window.addEventListener(t,t=>{this.silenced||e(t)})}}(Oa,class{constructor(e,n={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=n.timeout||1e4,this.transport=n.transport||r.WebSocket||C,this.establishedConnections=0,this.defaultEncoder=A.encode.bind(A),this.defaultDecoder=A.decode.bind(A),this.closeWasClean=!1,this.binaryType=n.binaryType||"arraybuffer",this.connectClock=1,this.transport!==C?(this.encode=n.encode||this.defaultEncoder,this.decode=n.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let s=null;i&&i.addEventListener&&(i.addEventListener("pagehide",t=>{this.conn&&(this.disconnect(),s=this.connectClock)}),i.addEventListener("pageshow",t=>{s===this.connectClock&&(s=null,this.connect())})),this.heartbeatIntervalMs=n.heartbeatIntervalMs||3e4,this.rejoinAfterMs=t=>n.rejoinAfterMs?n.rejoinAfterMs(t):[1e3,2e3,5e3][t-1]||1e4,this.reconnectAfterMs=t=>n.reconnectAfterMs?n.reconnectAfterMs(t):[10,50,100,150,200,250,500,1e3,2e3][t-1]||5e3,this.logger=n.logger||null,this.longpollerTimeout=n.longpollerTimeout||2e4,this.params=t(n.params||{}),this.endPoint=`${e}/${w}`,this.vsn=n.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new x(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs)}getLongPollTransport(){return C}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.sendBuffer=[],this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=E.appendParams(E.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==t.charAt(0)?t:"/"===t.charAt(1)?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.teardown(t,e,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=t(e)),this.conn||(this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t))}log(t,e,n){this.logger(t,e,n)}hasLogger(){return null!==this.logger}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let i=this.onMessage(r=>{r.ref===e&&(this.off([i]),t(Date.now()-n))});return!0}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport","connected to "+this.endPointURL()),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,t])=>t())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();this.waitForBufferDone(()=>{this.conn&&(e?this.conn.close(e,n||""):this.conn.close()),this.waitForSocketClosed(()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e=1){5!==e&&this.conn&&this.conn.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(t,e+1)},150*e):t()}waitForSocketClosed(t,e=1){5!==e&&this.conn&&this.conn.readyState!==l?setTimeout(()=>{this.waitForSocketClosed(t,e+1)},150*e):t()}onConnClose(t){let e=t&&t.code;this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===e||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,e])=>e(t))}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,i])=>{i(t,e,n)}),(e===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(g)})}connectionState(){switch(this.conn&&this.conn.readyState){case s:return"connecting";case o:return"open";case a:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e.joinRef()!==t.joinRef())}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([e])=>-1===t.indexOf(e))}channel(e,n={}){let i=new class{constructor(e,n,i){this.state=h,this.topic=e,this.params=t(n||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new _(this,m,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new x(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=c,this.rejoinTimer.reset(),this.pushBuffer.forEach(t=>t.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=u,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=h,this.socket.remove(this)}),this.onError(t=>{this.socket.hasLogger()&&this.socket.log("channel","error "+this.topic,t),this.isJoining()&&this.joinPush.reset(),this.state=u,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new _(this,y,t({}),this.timeout).send(),this.state=u,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(v,(t,e)=>{this.trigger(this.replyEventName(e),t)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(t){this.on(p,t)}onError(t){return this.on(g,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(void 0===e||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let i=new _(this,t,(function(){return e}),n);return this.canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=f;let n=()=>{this.socket.hasLogger()&&this.socket.log("channel","leave "+this.topic),this.trigger(p,"leave")},i=new _(this,y,t({}),e);return i.receive("ok",()=>n()).receive("timeout",()=>n()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(t,e,n){return e}isMember(t,e,n,i){return this.topic===t&&(!i||i===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:i}),!1))}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=d,this.joinPush.resend(t))}trigger(t,e,n,i){let r=this.onMessage(t,e,n,i);if(e&&!r)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(e=>e.event===t);for(let t=0;tthis.conn.send(t)):this.sendBuffer.push(()=>this.encode(t,t=>this.conn.send(t)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,t=>{let{topic:e,event:n,payload:i,ref:r,join_ref:s}=t;r&&r===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${i.status||""} ${e} ${n} ${r&&"("+r+")"||""}`,i);for(let t=0;te.topic===t&&(e.isJoined()||e.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}},{params:{_csrf_token:Ua},hooks:{Table:{mounted:function(){var t=this.el,e=t.querySelector(".js-hidden-submit"),n=t.querySelector(".js-submit-button");t.querySelector(".js-select-all-rows").addEventListener("change",(function(){var e=this;t.querySelectorAll(".js-select-row").forEach((function(t){t.checked=e.checked}))})),t.querySelectorAll(".js-action").forEach((function(t){t.addEventListener("click",(function(){e.value=this.dataset.name,n.click()}))}))}},RealtimePlot:Pa,HistoricalPlot:Na,Refresh:Ra,Timestamp:Fa}});T().config({barColors:{0:"#B5179E"},shadowColor:"rgba(0, 0, 0, .3)"}),window.addEventListener("phx:page-loading-start",(function(t){return T().show()})),window.addEventListener("phx:page-loading-stop",(function(t){return T().hide()})),$a.connect(),window.liveSocket=$a})()})(); \ No newline at end of file +(()=>{var t={458:()=>{"use strict";!function(){var t=function(){if("function"==typeof window.CustomEvent)return window.CustomEvent;function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}return t.prototype=window.Event.prototype,t}();function e(t,e){var n=document.createElement("input");return n.type="hidden",n.name=t,n.value=e,n}function n(t,n){var i=t.getAttribute("data-to"),r=e("_method",t.getAttribute("data-method")),s=e("_csrf_token",t.getAttribute("data-csrf")),o=document.createElement("form"),a=document.createElement("input"),l=t.getAttribute("target");o.method="get"===t.getAttribute("data-method")?"get":"post",o.action=i,o.style.display="none",l?o.target=l:n&&(o.target="_blank"),o.appendChild(s),o.appendChild(r),document.body.appendChild(o),a.type="submit",o.appendChild(a),a.click()}window.addEventListener("click",(function(e){var i=e.target;if(!e.defaultPrevented)for(;i&&i.getAttribute;){var r=new t("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!i.dispatchEvent(r))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(i.getAttribute("data-method")&&i.getAttribute("data-to"))return n(i,e.metaKey||e.shiftKey),e.preventDefault(),!1;i=i.parentNode}}),!1),window.addEventListener("phoenix.link.click",(function(t){var e=t.target.getAttribute("data-confirm");e&&!window.confirm(e)&&t.preventDefault()}),!1)}()},747:function(t,e,n){var i;(function(r,s){"use strict";!function(){for(var t=0,e=["ms","moz","webkit","o"],n=0;n=0||t.indexOf("-")>=0?h:0)+parseFloat(t)),h=t>1?1:t,d()),h},hide:function(){u&&(u=!1,null!=a&&(r.cancelAnimationFrame(a),a=null),function t(){if(f.progress("+.1")>=1&&(o.style.opacity-=.05,o.style.opacity<=.05))return o.style.display="none",void(l=null);l=r.requestAnimationFrame(t)}())}};"object"==typeof t.exports?t.exports=f:void 0===(i=function(){return f}.call(e,n,e,t))||(t.exports=i)}).call(this,window,document)}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";n(458);var t=t=>{if("function"==typeof t)return t;return function(){return t}},e="undefined"!=typeof self?self:null,i="undefined"!=typeof window?window:null,r=e||i||r,s=0,o=1,a=2,l=3,h="closed",u="errored",c="joined",d="joining",f="leaving",p="phx_close",g="phx_error",m="phx_join",v="phx_reply",b="phx_leave",y="longpoll",w="websocket",k=4,x=class{constructor(t,e,n,i){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(e=>e.status===t).forEach(t=>t.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},_=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},C=class{static request(t,e,n,i,s,o,a){if(r.XDomainRequest){let n=new r.XDomainRequest;return this.xdomainRequest(n,t,e,i,s,o,a)}{let l=new r.XMLHttpRequest;return this.xhrRequest(l,t,e,n,i,s,o,a)}}static xdomainRequest(t,e,n,i,r,s,o){return t.timeout=r,t.open(e,n),t.onload=()=>{let e=this.parseJSON(t.responseText);o&&o(e)},s&&(t.ontimeout=s),t.onprogress=()=>{},t.send(i),t}static xhrRequest(t,e,n,i,r,s,o,a){return t.open(e,n,!0),t.timeout=s,t.setRequestHeader("Content-Type",i),t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===k&&a){let e=this.parseJSON(t.responseText);a(e)}},o&&(t.ontimeout=o),t.send(r),t}static parseJSON(t){if(!t||""===t)return null;try{return JSON.parse(t)}catch(e){return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let r=e?`${e}[${i}]`:i,s=t[i];"object"==typeof s?n.push(this.serialize(s,r)):n.push(encodeURIComponent(r)+"="+encodeURIComponent(s))}return n.join("&")}static appendParams(t,e){if(0===Object.keys(e).length)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},E=class{constructor(t){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=s,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+w),"$1/"+y)}endpointURL(){return C.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=s}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===o||this.readyState===s}poll(){this.ajax("GET","application/json",null,()=>this.ontimeout(),t=>{if(t){var{status:e,token:n,messages:i}=t;this.token=n}else e=0;switch(e){case 200:i.forEach(t=>{setTimeout(()=>this.onmessage({data:t}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=o,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error("unhandled poll status "+e)}})}send(t){"string"!=typeof t&&(t=(t=>{let e="",n=new Uint8Array(t),i=n.byteLength;for(let t=0;t{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",t.join("\n"),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,t&&200===t.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1))})}close(t,e,n){for(let t of this.reqs)t.abort();this.readyState=l;let i=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",i)):this.onclose(i)}ajax(t,e,n,i,r){let s;s=C.request(t,this.endpointURL(),e,n,this.timeout,()=>{this.reqs.delete(s),i()},t=>{this.reqs.delete(s),this.isActive()&&r(t)}),this.reqs.add(s)}},A={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,i,r,s,o]=JSON.parse(t);return e({join_ref:n,ref:i,topic:r,event:s,payload:o})}},binaryEncode(t){let{join_ref:e,ref:n,event:i,topic:r,payload:s}=t,o=this.META_LENGTH+e.length+n.length+r.length+i.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),h=0;l.setUint8(h++,this.KINDS.push),l.setUint8(h++,e.length),l.setUint8(h++,n.length),l.setUint8(h++,r.length),l.setUint8(h++,i.length),Array.from(e,t=>l.setUint8(h++,t.charCodeAt(0))),Array.from(n,t=>l.setUint8(h++,t.charCodeAt(0))),Array.from(r,t=>l.setUint8(h++,t.charCodeAt(0))),Array.from(i,t=>l.setUint8(h++,t.charCodeAt(0)));var u=new Uint8Array(a.byteLength+s.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(s),a.byteLength),u.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,i);case this.KINDS.reply:return this.decodeReply(t,e,i);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,i)}},decodePush(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),s=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(t.slice(o,o+i));o+=i;let l=n.decode(t.slice(o,o+r));o+=r;let h=n.decode(t.slice(o,o+s));return o+=s,{join_ref:a,ref:null,topic:l,event:h,payload:t.slice(o,t.byteLength)}},decodeReply(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),s=e.getUint8(3),o=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(t.slice(a,a+i));a+=i;let h=n.decode(t.slice(a,a+r));a+=r;let u=n.decode(t.slice(a,a+s));a+=s;let c=n.decode(t.slice(a,a+o));a+=o;let d=t.slice(a,t.byteLength);return{join_ref:l,ref:h,topic:u,event:v,payload:{status:c,response:d}}},decodeBroadcast(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),s=this.HEADER_LENGTH+2,o=n.decode(t.slice(s,s+i));s+=i;let a=n.decode(t.slice(s,s+r));return s+=r,{join_ref:null,ref:null,topic:o,event:a,payload:t.slice(s,t.byteLength)}}},S=n(747),T=n.n(S),M=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading","phx-hook-loading"],P="data-phx-component",R="data-phx-ref",L="data-phx-ref-src",D="data-phx-upload-ref",N="data-phx-parent-id",I="data-phx-root-id",F=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],U=["checkbox","radio"],O="data-phx-session",$=`[${O}]`,H="data-phx-static",j="data-phx-disabled",B="phx:live-socket:debug",q={debounce:300,throttle:300},J="d",V="s",W="e",z="r",Y="t",X="stream",G=(t,e)=>console.error&&console.error(t,e),K=t=>{let e=typeof t;return"number"===e||"string"===e&&/^(0|[1-9]\d*)$/.test(t)};var Z=t=>"function"==typeof t?t:function(){return t},Q=t=>JSON.parse(JSON.stringify(t)),tt=(t,e,n)=>{do{if(t.matches(`[${e}]`)&&!t.disabled)return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType&&!(n&&n.isSameNode(t)||t.matches($)));return null},et=t=>null!==t&&"object"==typeof t&&!(t instanceof Array),nt=t=>{for(let e in t)return!1;return!0},it=(t,e)=>t&&e(t),rt=function(t,e,n,i){t.forEach(t=>{new class{constructor(t,e,n){this.liveSocket=n,this.entry=t,this.offset=0,this.chunkSize=e,this.chunkTimer=null,this.errored=!1,this.uploadChannel=n.channel("lvu:"+t.ref,{token:t.metadata()})}error(t){this.errored||(this.uploadChannel.leave(),this.errored=!0,clearTimeout(this.chunkTimer),this.entry.error(t))}upload(){this.uploadChannel.onError(t=>this.error(t)),this.uploadChannel.join().receive("ok",t=>this.readNextChunk()).receive("error",t=>this.error(t))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let t=new window.FileReader,e=this.entry.file.slice(this.offset,this.chunkSize+this.offset);t.onload=t=>{if(null!==t.target.error)return G("Read error: "+t.target.error);this.offset+=t.target.result.byteLength,this.pushChunk(t.target.result)},t.readAsArrayBuffer(e)}pushChunk(t){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",t).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))}).receive("error",({reason:t})=>this.error(t))}}(t,n.config.chunk_size,i).upload()})},st={canPushState:()=>void 0!==history.pushState,dropLocal(t,e,n){return t.removeItem(this.localKey(e,n))},updateLocal(t,e,n,i,r){let s=this.getLocal(t,e,n),o=this.localKey(e,n),a=null===s?i:r(s);return t.setItem(o,JSON.stringify(a)),a},getLocal(t,e,n){return JSON.parse(t.getItem(this.localKey(e,n)))},updateCurrentState(t){this.canPushState()&&history.replaceState(t(history.state||{}),"",window.location.href)},pushState(t,e,n){if(this.canPushState()){if(n!==window.location.href){if("redirect"==e.type&&e.scroll){let t=history.state||{};t.scroll=e.scroll,history.replaceState(t,"",window.location.href)}delete e.scroll,history[t+"State"](e,"",n||null);let i=this.getHashTargetEl(window.location.hash);i?i.scrollIntoView():"redirect"===e.type&&window.scroll(0,0)}}else this.redirect(n)},setCookie(t,e){document.cookie=`${t}=${e}`},getCookie:t=>document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${t}s*=s*([^;]*).*$)|^.*$`),"$1"),redirect(t,e){e&&st.setCookie("__phoenix_flash__",e+"; max-age=60000; path=/"),window.location=t},localKey:(t,e)=>`${t}-${e}`,getHashTargetEl(t){let e=t.toString().substring(1);if(""!==e)return document.getElementById(e)||document.querySelector(`a[name="${e}"]`)}},ot=st,at={focusMain(){let t=document.querySelector("main h1, main, h1");if(t){let e=t.tabIndex;t.tabIndex=-1,t.focus(),t.tabIndex=e}},anyOf:(t,e)=>e.find(e=>t instanceof e),isFocusable(t,e){return t instanceof HTMLAnchorElement&&"ignore"!==t.rel||t instanceof HTMLAreaElement&&void 0!==t.href||!t.disabled&&this.anyOf(t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement])||t instanceof HTMLIFrameElement||t.tabIndex>0||!e&&null!==t.getAttribute("tabindex")&&"true"!==t.getAttribute("aria-hidden")},attemptFocus(t,e){if(this.isFocusable(t,e))try{t.focus()}catch(t){}return!!document.activeElement&&document.activeElement.isSameNode(t)},focusFirstInteractive(t){let e=t.firstElementChild;for(;e;){if(this.attemptFocus(e,!0)||this.focusFirstInteractive(e,!0))return!0;e=e.nextElementSibling}},focusFirst(t){let e=t.firstElementChild;for(;e;){if(this.attemptFocus(e)||this.focusFirst(e))return!0;e=e.nextElementSibling}},focusLast(t){let e=t.lastElementChild;for(;e;){if(this.attemptFocus(e)||this.focusLast(e))return!0;e=e.previousElementSibling}}},lt=null,ht={exec(t,e,n,i,r){let[s,o]=r||[null,{callback:r&&r.callback}];("["===e.charAt(0)?JSON.parse(e):[[s,o]]).forEach(([r,a])=>{r===s&&o.data&&(a.data=Object.assign(a.data||{},o.data),a.callback=a.callback||o.callback),this.filterToEls(i,a).forEach(s=>{this["exec_"+r](t,e,n,i,s,a)})})},isVisible:t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length>0),isInViewport(t){const e=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,i=window.innerWidth||document.documentElement.clientWidth;return e.right>0&&e.bottom>0&&e.left{let i=e.getAttribute(s);if(!i)throw new Error(`expected ${s} to contain JS command on "${o}"`);n.liveSocket.execJS(e,i,t)})},exec_dispatch(t,e,n,i,r,{to:s,event:o,detail:a,bubbles:l}){(a=a||{}).dispatcher=i,ct.dispatchEvent(r,o,{detail:a,bubbles:l})},exec_push(t,e,n,i,r,s){let{event:o,data:a,target:l,page_loading:h,loading:u,value:c,dispatcher:d,callback:f}=s,p={loading:u,value:c,target:l,page_loading:!!h},g="change"===t&&d?d:i,m=l||g.getAttribute(n.binding("target"))||g;n.withinTargets(m,(n,r)=>{if(n.isConnected())if("change"===t){let{newCid:t,_target:a}=s;a=a||(ct.isFormInput(i)?i.name:void 0),a&&(p._target=a),n.pushInput(i,r,t,o||e,p,f)}else if("submit"===t){let{submitter:t}=s;n.submitForm(i,r,o||e,t,p,f)}else n.pushEvent(t,i,r,o||e,a,p,f)})},exec_navigate(t,e,n,i,r,{href:s,replace:o}){n.liveSocket.historyRedirect(s,o?"replace":"push")},exec_patch(t,e,n,i,r,{href:s,replace:o}){n.liveSocket.pushHistoryPatch(s,o?"replace":"push",i)},exec_focus(t,e,n,i,r){window.requestAnimationFrame(()=>at.attemptFocus(r))},exec_focus_first(t,e,n,i,r){window.requestAnimationFrame(()=>at.focusFirstInteractive(r)||at.focusFirst(r))},exec_push_focus(t,e,n,i,r){window.requestAnimationFrame(()=>lt=r||i)},exec_pop_focus(t,e,n,i,r){window.requestAnimationFrame(()=>{lt&<.focus(),lt=null})},exec_add_class(t,e,n,i,r,{names:s,transition:o,time:a}){this.addOrRemoveClasses(r,s,[],o,a,n)},exec_remove_class(t,e,n,i,r,{names:s,transition:o,time:a}){this.addOrRemoveClasses(r,[],s,o,a,n)},exec_toggle_class(t,e,n,i,r,{to:s,names:o,transition:a,time:l}){this.toggleClasses(r,o,a,n)},exec_toggle_attr(t,e,n,i,r,{attr:[s,o,a]}){r.hasAttribute(s)?void 0!==a?r.getAttribute(s)===o?this.setOrRemoveAttrs(r,[[s,a]],[]):this.setOrRemoveAttrs(r,[[s,o]],[]):this.setOrRemoveAttrs(r,[],[s]):this.setOrRemoveAttrs(r,[[s,o]],[])},exec_transition(t,e,n,i,r,{time:s,transition:o}){this.addOrRemoveClasses(r,[],[],o,s,n)},exec_toggle(t,e,n,i,r,{display:s,ins:o,outs:a,time:l}){this.toggle(t,n,r,s,o,a,l)},exec_show(t,e,n,i,r,{display:s,transition:o,time:a}){this.show(t,n,r,s,o,a)},exec_hide(t,e,n,i,r,{display:s,transition:o,time:a}){this.hide(t,n,r,s,o,a)},exec_set_attr(t,e,n,i,r,{attr:[s,o]}){this.setOrRemoveAttrs(r,[[s,o]],[])},exec_remove_attr(t,e,n,i,r,{attr:s}){this.setOrRemoveAttrs(r,[],[s])},show(t,e,n,i,r,s){this.isVisible(n)||this.toggle(t,e,n,i,r,null,s)},hide(t,e,n,i,r,s){this.isVisible(n)&&this.toggle(t,e,n,i,null,r,s)},toggle(t,e,n,i,r,s,o){o=o||200;let[a,l,h]=r||[[],[],[]],[u,c,d]=s||[[],[],[]];if(a.length>0||u.length>0)if(this.isVisible(n)){let t=()=>{this.addOrRemoveClasses(n,c,a.concat(l).concat(h)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(n,u,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(n,d,c))})};n.dispatchEvent(new Event("phx:hide-start")),e.transition(o,t,()=>{this.addOrRemoveClasses(n,[],u.concat(d)),ct.putSticky(n,"toggle",t=>t.style.display="none"),n.dispatchEvent(new Event("phx:hide-end"))})}else{if("remove"===t)return;let r=()=>{this.addOrRemoveClasses(n,l,u.concat(c).concat(d));let t=i||this.defaultDisplay(n);ct.putSticky(n,"toggle",e=>e.style.display=t),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(n,a,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(n,h,l))})};n.dispatchEvent(new Event("phx:show-start")),e.transition(o,r,()=>{this.addOrRemoveClasses(n,[],a.concat(h)),n.dispatchEvent(new Event("phx:show-end"))})}else this.isVisible(n)?window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("phx:hide-start")),ct.putSticky(n,"toggle",t=>t.style.display="none"),n.dispatchEvent(new Event("phx:hide-end"))}):window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("phx:show-start"));let t=i||this.defaultDisplay(n);ct.putSticky(n,"toggle",e=>e.style.display=t),n.dispatchEvent(new Event("phx:show-end"))})},toggleClasses(t,e,n,i,r){window.requestAnimationFrame(()=>{let[s,o]=ct.getSticky(t,"classes",[[],[]]),a=e.filter(e=>s.indexOf(e)<0&&!t.classList.contains(e)),l=e.filter(e=>o.indexOf(e)<0&&t.classList.contains(e));this.addOrRemoveClasses(t,a,l,n,i,r)})},addOrRemoveClasses(t,e,n,i,r,s){r=r||200;let[o,a,l]=i||[[],[],[]];if(o.length>0){let i=()=>{this.addOrRemoveClasses(t,a,[].concat(o).concat(l)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(t,o,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(t,l,a))})},h=()=>this.addOrRemoveClasses(t,e.concat(l),n.concat(o).concat(a));return s.transition(r,i,h)}window.requestAnimationFrame(()=>{let[i,r]=ct.getSticky(t,"classes",[[],[]]),s=e.filter(e=>i.indexOf(e)<0&&!t.classList.contains(e)),o=n.filter(e=>r.indexOf(e)<0&&t.classList.contains(e)),a=i.filter(t=>n.indexOf(t)<0).concat(s),l=r.filter(t=>e.indexOf(t)<0).concat(o);ct.putSticky(t,"classes",t=>(t.classList.remove(...l),t.classList.add(...a),[a,l]))})},setOrRemoveAttrs(t,e,n){let[i,r]=ct.getSticky(t,"attrs",[[],[]]),s=e.map(([t,e])=>t).concat(n),o=i.filter(([t,e])=>!s.includes(t)).concat(e),a=r.filter(t=>!s.includes(t)).concat(n);ct.putSticky(t,"attrs",t=>(a.forEach(e=>t.removeAttribute(e)),o.forEach(([e,n])=>t.setAttribute(e,n)),[o,a]))},hasAllClasses:(t,e)=>e.every(e=>t.classList.contains(e)),isToggledOut(t,e){return!this.isVisible(t)||this.hasAllClasses(t,e)},filterToEls:(t,{to:e})=>e?ct.all(document,e):[t],defaultDisplay:t=>({tr:"table-row",td:"table-cell"}[t.tagName.toLowerCase()]||"block")},ut={byId:t=>document.getElementById(t)||G("no id found for "+t),removeClass(t,e){t.classList.remove(e),0===t.classList.length&&t.removeAttribute("class")},all(t,e,n){if(!t)return[];let i=Array.from(t.querySelectorAll(e));return n?i.forEach(n):i},childNodeLength(t){let e=document.createElement("template");return e.innerHTML=t,e.content.childElementCount},isUploadInput:t=>"file"===t.type&&null!==t.getAttribute(D),isAutoUpload:t=>t.hasAttribute("data-phx-auto-upload"),findUploadInputs(t){const e=t.id,n=this.all(document,`input[type="file"][${D}][form="${e}"]`);return this.all(t,`input[type="file"][${D}]`).concat(n)},findComponentNodeList(t,e){return this.filterWithinSameLiveView(this.all(t,`[${P}="${e}"]`),t)},isPhxDestroyed:t=>!(!t.id||!ut.private(t,"destroyed")),wantsNewTab(t){let e=t.ctrlKey||t.shiftKey||t.metaKey||t.button&&1===t.button,n=t.target instanceof HTMLAnchorElement&&t.target.hasAttribute("download"),i=t.target.hasAttribute("target")&&"_blank"===t.target.getAttribute("target").toLowerCase();return e||i||n},isUnloadableFormSubmit(t){return!(t.target&&"dialog"===t.target.getAttribute("method")||t.submitter&&"dialog"===t.submitter.getAttribute("formmethod"))&&(!t.defaultPrevented&&!this.wantsNewTab(t))},isNewPageClick(t,e){let n,i=t.target instanceof HTMLAnchorElement?t.target.getAttribute("href"):null;if(t.defaultPrevented||null===i||this.wantsNewTab(t))return!1;if(i.startsWith("mailto:")||i.startsWith("tel:"))return!1;if(t.target.isContentEditable)return!1;try{n=new URL(i)}catch(t){try{n=new URL(i,e)}catch(t){return!0}}return n.host===e.host&&n.protocol===e.protocol&&n.pathname===e.pathname&&n.search===e.search?""===n.hash&&!n.href.endsWith("#"):n.protocol.startsWith("http")},markPhxChildDestroyed(t){this.isPhxChild(t)&&t.setAttribute(O,""),this.putPrivate(t,"destroyed",!0)},findPhxChildrenInFragment(t,e){let n=document.createElement("template");return n.innerHTML=t,this.findPhxChildren(n.content,e)},isIgnored:(t,e)=>"ignore"===(t.getAttribute(e)||t.getAttribute("data-phx-update")),isPhxUpdate:(t,e,n)=>t.getAttribute&&n.indexOf(t.getAttribute(e))>=0,findPhxSticky(t){return this.all(t,"[data-phx-sticky]")},findPhxChildren(t,e){return this.all(t,`${$}[${N}="${e}"]`)},findExistingParentCIDs(t,e){let n=new Set,i=new Set;return e.forEach(e=>{this.filterWithinSameLiveView(this.all(t,`[${P}="${e}"]`),t).forEach(t=>{n.add(e),this.all(t,`[${P}]`).map(t=>parseInt(t.getAttribute(P))).forEach(t=>i.add(t))})}),i.forEach(t=>n.delete(t)),n},filterWithinSameLiveView(t,e){return e.querySelector($)?t.filter(t=>this.withinSameLiveView(t,e)):t},withinSameLiveView(t,e){for(;t=t.parentNode;){if(t.isSameNode(e))return!0;if(null!==t.getAttribute(O))return!1}},private:(t,e)=>t.phxPrivate&&t.phxPrivate[e],deletePrivate(t,e){t.phxPrivate&&delete t.phxPrivate[e]},putPrivate(t,e,n){t.phxPrivate||(t.phxPrivate={}),t.phxPrivate[e]=n},updatePrivate(t,e,n,i){let r=this.private(t,e);void 0===r?this.putPrivate(t,e,i(n)):this.putPrivate(t,e,i(r))},copyPrivates(t,e){e.phxPrivate&&(t.phxPrivate=e.phxPrivate)},putTitle(t){let e=document.querySelector("title");if(e){let{prefix:n,suffix:i}=e.dataset;document.title=`${n||""}${t}${i||""}`}else document.title=t},debounce(t,e,n,i,r,s,o,a){let l=t.getAttribute(n),h=t.getAttribute(r);""===l&&(l=i),""===h&&(h=s);let u=l||h;switch(u){case null:return a();case"blur":return void(this.once(t,"debounce-blur")&&t.addEventListener("blur",()=>a()));default:let n=parseInt(u),i=()=>h?this.deletePrivate(t,"throttled"):a(),r=this.incCycle(t,"debounce-trigger",i);if(isNaN(n))return G("invalid throttle/debounce value: "+u);if(h){let i=!1;if("keydown"===e.type){let n=this.private(t,"debounce-prev-key");this.putPrivate(t,"debounce-prev-key",e.key),i=n!==e.key}if(!i&&this.private(t,"throttled"))return!1;{a();const e=setTimeout(()=>{o()&&this.triggerCycle(t,"debounce-trigger")},n);this.putPrivate(t,"throttled",e)}}else setTimeout(()=>{o()&&this.triggerCycle(t,"debounce-trigger",r)},n);let s=t.form;s&&this.once(s,"bind-debounce")&&s.addEventListener("submit",()=>{Array.from(new FormData(s).entries(),([t])=>{let e=s.querySelector(`[name="${t}"]`);this.incCycle(e,"debounce-trigger"),this.deletePrivate(e,"throttled")})}),this.once(t,"bind-debounce")&&t.addEventListener("blur",()=>{clearTimeout(this.private(t,"throttled")),this.triggerCycle(t,"debounce-trigger")})}},triggerCycle(t,e,n){let[i,r]=this.private(t,e);n||(n=i),n===i&&(this.incCycle(t,e),r())},once(t,e){return!0!==this.private(t,e)&&(this.putPrivate(t,e,!0),!0)},incCycle(t,e,n=function(){}){let[i]=this.private(t,e)||[0,n];return i++,this.putPrivate(t,e,[i,n]),i},maybeAddPrivateHooks(t,e,n){t.hasAttribute&&(t.hasAttribute(e)||t.hasAttribute(n))&&t.setAttribute("data-phx-hook","Phoenix.InfiniteScroll")},isFeedbackContainer:(t,e)=>t.hasAttribute&&t.hasAttribute(e),maybeHideFeedback(t,e,n,i){const r={};e.forEach(e=>{if(!t.contains(e))return;const s=e.getAttribute(n);s?!0!==r[s]?(r[s]=this.shouldHideFeedback(t,s,i),!0===r[s]&&this.hideFeedback(e)):this.hideFeedback(e):ht.addOrRemoveClasses(e,[],["phx-no-feedback"])})},hideFeedback(t){ht.addOrRemoveClasses(t,["phx-no-feedback"],[])},shouldHideFeedback(t,e,n){const i=`[name="${e}"],\n [name="${e}[]"],\n [${n}="${e}"]`;let r=!1;return ut.all(t,i,t=>{(this.private(t,"phx-has-focused")||this.private(t,"phx-has-submitted"))&&(r=!0)}),!r},feedbackSelector(t,e,n){let i=`[${e}="${t.name}"],\n [${e}="${t.name.replace(/\[\]$/,"")}"]`;return t.getAttribute(n)&&(i+=`,[${e}="${t.getAttribute(n)}"]`),i},resetForm(t,e,n){Array.from(t.elements).forEach(t=>{let i=this.feedbackSelector(t,e,n);this.deletePrivate(t,"phx-has-focused"),this.deletePrivate(t,"phx-has-submitted"),this.all(document,i,t=>{ht.addOrRemoveClasses(t,["phx-no-feedback"],[])})})},showError(t,e,n){if(t.name){let i=this.feedbackSelector(t,e,n);this.all(document,i,t=>{ht.addOrRemoveClasses(t,[],["phx-no-feedback"])})}},isPhxChild:t=>t.getAttribute&&t.getAttribute(N),isPhxSticky:t=>t.getAttribute&&null!==t.getAttribute("data-phx-sticky"),isChildOfAny:(t,e)=>!!e.find(e=>e.contains(t)),firstPhxChild(t){return this.isPhxChild(t)?t:this.all(t,`[${N}]`)[0]},dispatchEvent(t,e,n={}){let i=!0;"INPUT"===t.nodeName&&"file"===t.type&&"click"===e&&(i=!1);let r={bubbles:void 0===n.bubbles?i:!!n.bubbles,cancelable:!0,detail:n.detail||{}},s="click"===e?new MouseEvent("click",r):new CustomEvent(e,r);t.dispatchEvent(s)},cloneNode(t,e){if(void 0===e)return t.cloneNode(!0);{let n=t.cloneNode(!1);return n.innerHTML=e,n}},mergeAttrs(t,e,n={}){let i=new Set(n.exclude||[]),r=n.isIgnored,s=e.attributes;for(let n=s.length-1;n>=0;n--){let o=s[n].name;if(i.has(o))"value"===o&&t.value===e.value&&t.setAttribute("value",e.getAttribute(o));else{const n=e.getAttribute(o);t.getAttribute(o)!==n&&(!r||r&&o.startsWith("data-"))&&t.setAttribute(o,n)}}let o=t.attributes;for(let n=o.length-1;n>=0;n--){let i=o[n].name;r?!i.startsWith("data-")||e.hasAttribute(i)||[R,L].includes(i)||t.removeAttribute(i):e.hasAttribute(i)||t.removeAttribute(i)}},mergeFocusedInput(t,e){t instanceof HTMLSelectElement||ut.mergeAttrs(t,e,{exclude:["value"]}),e.readOnly?t.setAttribute("readonly",!0):t.removeAttribute("readonly")},hasSelectionRange:t=>t.setSelectionRange&&("text"===t.type||"textarea"===t.type),restoreFocus(t,e,n){if(t instanceof HTMLSelectElement&&t.focus(),!ut.isTextualInput(t))return;let i=t.matches(":focus");t.readOnly&&t.blur(),i||t.focus(),this.hasSelectionRange(t)&&t.setSelectionRange(e,n)},isFormInput:t=>/^(?:input|select|textarea)$/i.test(t.tagName)&&"button"!==t.type,syncAttrsToProps(t){t instanceof HTMLInputElement&&U.indexOf(t.type.toLocaleLowerCase())>=0&&(t.checked=null!==t.getAttribute("checked"))},isTextualInput:t=>F.indexOf(t.type)>=0,isNowTriggerFormExternal:(t,e)=>t.getAttribute&&null!==t.getAttribute(e),syncPendingRef(t,e,n){let i=t.getAttribute(R);if(null===i)return!0;let r=t.getAttribute(L);return ut.isFormInput(t)||null!==t.getAttribute(n)?(ut.isUploadInput(t)&&ut.mergeAttrs(t,e,{isIgnored:!0}),ut.putPrivate(t,R,e),!1):(M.forEach(n=>{t.classList.contains(n)&&e.classList.add(n)}),e.setAttribute(R,i),e.setAttribute(L,r),!0)},cleanChildNodes(t,e){if(ut.isPhxUpdate(t,e,["append","prepend"])){let e=[];t.childNodes.forEach(t=>{if(!t.id){t.nodeType===Node.TEXT_NODE&&""===t.nodeValue.trim()||G(`only HTML element tags with an id are allowed inside containers with phx-update.\n\nremoving illegal node: "${(t.outerHTML||t.nodeValue).trim()}"\n\n`),e.push(t)}}),e.forEach(t=>t.remove())}},replaceRootContainer(t,e,n){let i=new Set(["id",O,H,"data-phx-main",I]);if(t.tagName.toLowerCase()===e.toLowerCase())return Array.from(t.attributes).filter(t=>!i.has(t.name.toLowerCase())).forEach(e=>t.removeAttribute(e.name)),Object.keys(n).filter(t=>!i.has(t.toLowerCase())).forEach(e=>t.setAttribute(e,n[e])),t;{let r=document.createElement(e);return Object.keys(n).forEach(t=>r.setAttribute(t,n[t])),i.forEach(e=>r.setAttribute(e,t.getAttribute(e))),r.innerHTML=t.innerHTML,t.replaceWith(r),r}},getSticky(t,e,n){let i=(ut.private(t,"sticky")||[]).find(([t])=>e===t);if(i){let[t,e,n]=i;return n}return"function"==typeof n?n():n},deleteSticky(t,e){this.updatePrivate(t,"sticky",[],t=>t.filter(([t,n])=>t!==e))},putSticky(t,e,n){let i=n(t);this.updatePrivate(t,"sticky",[],t=>{let r=t.findIndex(([t])=>e===t);return r>=0?t[r]=[e,n,i]:t.push([e,n,i]),t})},applyStickyOperations(t){let e=ut.private(t,"sticky");e&&e.forEach(([e,n,i])=>this.putSticky(t,e,n))}},ct=ut,dt=class{static isActive(t,e){let n=void 0===e._phxRef,i=t.getAttribute("data-phx-active-refs").split(",").indexOf(pt.genFileRef(e))>=0;return e.size>0&&(n||i)}static isPreflighted(t,e){return t.getAttribute("data-phx-preflighted-refs").split(",").indexOf(pt.genFileRef(e))>=0&&this.isActive(t,e)}static isPreflightInProgress(t){return!0===t._preflightInProgress}static markPreflightInProgress(t){t._preflightInProgress=!0}constructor(t,e,n,i){this.ref=pt.genFileRef(e),this.fileEl=t,this.file=e,this.view=n,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener("phx:live-file:updated",this._onElUpdated),this.autoUpload=i}metadata(){return this.meta}progress(t){this._progress=Math.floor(t),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{pt.untrackFile(this.fileEl,this.file),this._onDone()})):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}isCancelled(){return this._isCancelled}cancel(){this.file._preflightInProgress=!1,this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(t="failed"){this.fileEl.removeEventListener("phx:live-file:updated",this._onElUpdated),this.view.pushFileProgress(this.fileEl,this.ref,{error:t}),this.isAutoUpload()||pt.clearFiles(this.fileEl)}isAutoUpload(){return this.autoUpload}onDone(t){this._onDone=()=>{this.fileEl.removeEventListener("phx:live-file:updated",this._onElUpdated),t()}}onElUpdated(){-1===this.fileEl.getAttribute("data-phx-active-refs").split(",").indexOf(this.ref)&&(pt.untrackFile(this.fileEl,this.file),this.cancel())}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,relative_path:this.file.webkitRelativePath,size:this.file.size,type:this.file.type,ref:this.ref,meta:"function"==typeof this.file.meta?this.file.meta():void 0}}uploader(t){if(this.meta.uploader){let e=t[this.meta.uploader]||G("no uploader configured for "+this.meta.uploader);return{name:this.meta.uploader,callback:e}}return{name:"channel",callback:rt}}zipPostFlight(t){this.meta=t.entries[this.ref],this.meta||G("no preflight upload response returned with ref "+this.ref,{input:this.fileEl,response:t})}},ft=0,pt=class{static genFileRef(t){let e=t._phxRef;return void 0!==e?e:(t._phxRef=(ft++).toString(),t._phxRef)}static getEntryDataURL(t,e,n){let i=this.activeFiles(t).find(t=>this.genFileRef(t)===e);n(URL.createObjectURL(i))}static hasUploadsInProgress(t){let e=0;return ct.findUploadInputs(t).forEach(t=>{t.getAttribute("data-phx-preflighted-refs")!==t.getAttribute("data-phx-done-refs")&&e++}),e>0}static serializeUploads(t){let e=this.activeFiles(t),n={};return e.forEach(e=>{let i={path:t.name},r=t.getAttribute(D);n[r]=n[r]||[],i.ref=this.genFileRef(e),i.last_modified=e.lastModified,i.name=e.name||i.ref,i.relative_path=e.webkitRelativePath,i.type=e.type,i.size=e.size,"function"==typeof e.meta&&(i.meta=e.meta()),n[r].push(i)}),n}static clearFiles(t){t.value=null,t.removeAttribute(D),ct.putPrivate(t,"files",[])}static untrackFile(t,e){ct.putPrivate(t,"files",ct.private(t,"files").filter(t=>!Object.is(t,e)))}static trackFiles(t,e,n){if(null!==t.getAttribute("multiple")){let n=e.filter(e=>!this.activeFiles(t).find(t=>Object.is(t,e)));ct.updatePrivate(t,"files",[],t=>t.concat(n)),t.value=null}else n&&n.files.length>0&&(t.files=n.files),ct.putPrivate(t,"files",e)}static activeFileInputs(t){let e=ct.findUploadInputs(t);return Array.from(e).filter(t=>t.files&&this.activeFiles(t).length>0)}static activeFiles(t){return(ct.private(t,"files")||[]).filter(e=>dt.isActive(t,e))}static inputsAwaitingPreflight(t){let e=ct.findUploadInputs(t);return Array.from(e).filter(t=>this.filesAwaitingPreflight(t).length>0)}static filesAwaitingPreflight(t){return this.activeFiles(t).filter(e=>!dt.isPreflighted(t,e)&&!dt.isPreflightInProgress(e))}static markPreflightInProgress(t){t.forEach(t=>dt.markPreflightInProgress(t.file))}constructor(t,e,n){this.autoUpload=ct.isAutoUpload(t),this.view=e,this.onComplete=n,this._entries=Array.from(pt.filesAwaitingPreflight(t)||[]).map(n=>new dt(t,n,e,this.autoUpload)),pt.markPreflightInProgress(this._entries),this.numEntriesInProgress=this._entries.length}isAutoUpload(){return this.autoUpload}entries(){return this._entries}initAdapterUpload(t,e,n){this._entries=this._entries.map(e=>(e.isCancelled()?(this.numEntriesInProgress--,0===this.numEntriesInProgress&&this.onComplete()):(e.zipPostFlight(t),e.onDone(()=>{this.numEntriesInProgress--,0===this.numEntriesInProgress&&this.onComplete()})),e));let i=this._entries.reduce((t,e)=>{if(!e.meta)return t;let{name:i,callback:r}=e.uploader(n.uploaders);return t[i]=t[i]||{callback:r,entries:[]},t[i].entries.push(e),t},{});for(let r in i){let{callback:s,entries:o}=i[r];s(o,e,t,n)}}},gt={LiveFileUpload:{activeRefs(){return this.el.getAttribute("data-phx-active-refs")},preflightedRefs(){return this.el.getAttribute("data-phx-preflighted-refs")},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let t=this.preflightedRefs();this.preflightedWas!==t&&(this.preflightedWas=t,""===t&&this.__view.cancelSubmit(this.el.form)),""===this.activeRefs()&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent("phx:live-file:updated"))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(D)),pt.getEntryDataURL(this.inputEl,this.ref,t=>{this.url=t,this.el.src=t})},destroyed(){URL.revokeObjectURL(this.url)}},FocusWrap:{mounted(){this.focusStart=this.el.firstElementChild,this.focusEnd=this.el.lastElementChild,this.focusStart.addEventListener("focus",()=>at.focusLast(this.el)),this.focusEnd.addEventListener("focus",()=>at.focusFirst(this.el)),this.el.addEventListener("phx:show-end",()=>this.el.focus()),"none"!==window.getComputedStyle(this.el).display&&at.focusFirst(this.el)}}},mt=t=>["scroll","auto"].indexOf(getComputedStyle(t).overflowY)>=0?t:document.documentElement===t?null:mt(t.parentElement),vt=t=>t?t.scrollTop:document.documentElement.scrollTop||document.body.scrollTop,bt=t=>t?t.getBoundingClientRect().bottom:window.innerHeight||document.documentElement.clientHeight,yt=t=>t?t.getBoundingClientRect().top:0,wt=(t,e)=>{let n=t.getBoundingClientRect();return n.top>=yt(e)&&n.left>=0&&n.top<=bt(e)};gt.InfiniteScroll={mounted(){this.scrollContainer=mt(this.el);let t=vt(this.scrollContainer),e=!1,n=null,i=this.throttle(500,(t,e)=>{n=()=>!0,this.liveSocket.execJSHookPush(this.el,t,{id:e.id,_overran:!0},()=>{n=null})}),r=this.throttle(500,(t,e)=>{n=()=>e.scrollIntoView({block:"start"}),this.liveSocket.execJSHookPush(this.el,t,{id:e.id},()=>{n=null,window.requestAnimationFrame(()=>{wt(e,this.scrollContainer)||e.scrollIntoView({block:"start"})})})}),s=this.throttle(500,(t,e)=>{n=()=>e.scrollIntoView({block:"end"}),this.liveSocket.execJSHookPush(this.el,t,{id:e.id},()=>{n=null,window.requestAnimationFrame(()=>{wt(e,this.scrollContainer)||e.scrollIntoView({block:"end"})})})});this.onScroll=o=>{let a=vt(this.scrollContainer);if(n)return t=a,n();let l=this.el.getBoundingClientRect(),h=this.el.getAttribute(this.liveSocket.binding("viewport-top")),u=this.el.getAttribute(this.liveSocket.binding("viewport-bottom")),c=this.el.lastElementChild,d=this.el.firstElementChild,f=at;f&&h&&!e&&l.top>=0?(e=!0,i(h,d)):p&&e&&l.top<=0&&(e=!1),h&&f&&((t,e)=>{let n=t.getBoundingClientRect();return n.top>=yt(e)&&n.left>=0&&n.top<=bt(e)})(d,this.scrollContainer)?r(h,d):u&&p&&((t,e)=>{let n=t.getBoundingClientRect();return n.right>=yt(e)&&n.left>=0&&n.bottom<=bt(e)})(c,this.scrollContainer)&&s(u,c),t=a},this.scrollContainer?this.scrollContainer.addEventListener("scroll",this.onScroll):window.addEventListener("scroll",this.onScroll)},destroyed(){this.scrollContainer?this.scrollContainer.removeEventListener("scroll",this.onScroll):window.removeEventListener("scroll",this.onScroll)},throttle(t,e){let n,i=0;return(...r)=>{let s=Date.now(),o=t-(s-i);o<=0||o>t?(n&&(clearTimeout(n),n=null),i=s,e(...r)):n||(n=setTimeout(()=>{i=Date.now(),n=null,e(...r)},o))}}};var kt,xt=gt;var _t="undefined"==typeof document?void 0:document,Ct=!!_t&&"content"in _t.createElement("template"),Et=!!_t&&_t.createRange&&"createContextualFragment"in _t.createRange();function At(t){return t=t.trim(),Ct?function(t){var e=_t.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}(t):Et?function(t){return kt||(kt=_t.createRange()).selectNode(_t.body),kt.createContextualFragment(t).childNodes[0]}(t):function(t){var e=_t.createElement("body");return e.innerHTML=t,e.childNodes[0]}(t)}function St(t,e){var n,i,r=t.nodeName,s=e.nodeName;return r===s||(n=r.charCodeAt(0),i=s.charCodeAt(0),n<=90&&i>=97?r===s.toUpperCase():i<=90&&n>=97&&s===r.toUpperCase())}function Tt(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n))}var Mt={OPTION:function(t,e){var n=t.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),n.selectedIndex=-1)}Tt(t,e,"selected")},INPUT:function(t,e){Tt(t,e,"checked"),Tt(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;t.value!==n&&(t.value=n);var i=t.firstChild;if(i){var r=i.nodeValue;if(r==n||!n&&r==t.placeholder)return;i.nodeValue=n}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var n,i,r=-1,s=0,o=t.firstChild;o;)if("OPTGROUP"===(i=o.nodeName&&o.nodeName.toUpperCase()))o=(n=o).firstChild;else{if("OPTION"===i){if(o.hasAttribute("selected")){r=s;break}s++}!(o=o.nextSibling)&&n&&(o=n.nextSibling,n=null)}t.selectedIndex=r}}};function Pt(){}function Rt(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}var Lt,Dt=(Lt=function(t,e){var n,i,r,s,o=e.attributes;if(11!==e.nodeType&&11!==t.nodeType){for(var a=o.length-1;a>=0;a--)i=(n=o[a]).name,r=n.namespaceURI,s=n.value,r?(i=n.localName||i,t.getAttributeNS(r,i)!==s&&("xmlns"===n.prefix&&(i=n.name),t.setAttributeNS(r,i,s))):t.getAttribute(i)!==s&&t.setAttribute(i,s);for(var l=t.attributes,h=l.length-1;h>=0;h--)i=(n=l[h]).name,(r=n.namespaceURI)?(i=n.localName||i,e.hasAttributeNS(r,i)||t.removeAttributeNS(r,i)):e.hasAttribute(i)||t.removeAttribute(i)}},function(t,e,n){if(n||(n={}),"string"==typeof e)if("#document"===t.nodeName||"HTML"===t.nodeName||"BODY"===t.nodeName){var i=e;(e=_t.createElement("html")).innerHTML=i}else e=At(e);else 11===e.nodeType&&(e=e.firstElementChild);var r=n.getNodeKey||Rt,s=n.onBeforeNodeAdded||Pt,o=n.onNodeAdded||Pt,a=n.onBeforeElUpdated||Pt,l=n.onElUpdated||Pt,h=n.onBeforeNodeDiscarded||Pt,u=n.onNodeDiscarded||Pt,c=n.onBeforeElChildrenUpdated||Pt,d=n.skipFromChildren||Pt,f=n.addChild||function(t,e){return t.appendChild(e)},p=!0===n.childrenOnly,g=Object.create(null),m=[];function v(t){m.push(t)}function b(t,e,n){!1!==h(t)&&(e&&e.removeChild(t),u(t),function t(e,n){if(1===e.nodeType)for(var i=e.firstChild;i;){var s=void 0;n&&(s=r(i))?v(s):(u(i),i.firstChild&&t(i,n)),i=i.nextSibling}}(t,n))}function y(t){o(t);for(var e=t.firstChild;e;){var n=e.nextSibling,i=r(e);if(i){var s=g[i];s&&St(e,s)?(e.parentNode.replaceChild(s,e),w(s,e)):y(e)}else y(e);e=n}}function w(t,e,n){var i=r(e);if(i&&delete g[i],!n){if(!1===a(t,e))return;if(Lt(t,e),l(t),!1===c(t,e))return}"TEXTAREA"!==t.nodeName?function(t,e){var n,i,o,a,l,h=d(t,e),u=e.firstChild,c=t.firstChild;t:for(;u;){for(a=u.nextSibling,n=r(u);!h&&c;){if(o=c.nextSibling,u.isSameNode&&u.isSameNode(c)){u=a,c=o;continue t}i=r(c);var p=c.nodeType,m=void 0;if(p===u.nodeType&&(1===p?(n?n!==i&&((l=g[n])?o===l?m=!1:(t.insertBefore(l,c),i?v(i):b(c,t,!0),i=r(c=l)):m=!1):i&&(m=!1),(m=!1!==m&&St(c,u))&&w(c,u)):3!==p&&8!=p||(m=!0,c.nodeValue!==u.nodeValue&&(c.nodeValue=u.nodeValue))),m){u=a,c=o;continue t}i?v(i):b(c,t,!0),c=o}if(n&&(l=g[n])&&St(l,u))h||f(t,l),w(l,u);else{var k=s(u);!1!==k&&(k&&(u=k),u.actualize&&(u=u.actualize(t.ownerDocument||_t)),f(t,u),y(u))}u=a,c=o}!function(t,e,n){for(;e;){var i=e.nextSibling;(n=r(e))?v(n):b(e,t,!0),e=i}}(t,c,i);var x=Mt[t.nodeName];x&&x(t,e)}(t,e):Mt.TEXTAREA(t,e)}!function t(e){if(1===e.nodeType||11===e.nodeType)for(var n=e.firstChild;n;){var i=r(n);i&&(g[i]=n),t(n),n=n.nextSibling}}(t);var k,x,_=t,C=_.nodeType,E=e.nodeType;if(!p)if(1===C)1===E?St(t,e)||(u(t),_=function(t,e){for(var n=t.firstChild;n;){var i=n.nextSibling;e.appendChild(n),n=i}return e}(t,(k=e.nodeName,(x=e.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==x?_t.createElementNS(x,k):_t.createElement(k)))):_=e;else if(3===C||8===C){if(E===C)return _.nodeValue!==e.nodeValue&&(_.nodeValue=e.nodeValue),_;_=e}if(_===e)u(t);else{if(e.isSameNode&&e.isSameNode(_))return;if(w(_,e,p),m)for(var A=0,S=m.length;A{if(n&&n.isSameNode(t)&&ct.isFormInput(t))return ct.mergeFocusedInput(t,e),!1}})}constructor(t,e,n,i,r,s){this.view=t,this.liveSocket=t.liveSocket,this.container=e,this.id=n,this.rootID=t.root.id,this.html=i,this.streams=r,this.streamInserts={},this.streamComponentRestore={},this.targetCID=s,this.cidPatch=K(this.targetCID),this.pendingRemoves=[],this.phxRemove=this.liveSocket.binding("remove"),this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[],aftertransitionsDiscarded:[]}}before(t,e){this.callbacks["before"+t].push(e)}after(t,e){this.callbacks["after"+t].push(e)}trackBefore(t,...e){this.callbacks["before"+t].forEach(t=>t(...e))}trackAfter(t,...e){this.callbacks["after"+t].forEach(t=>t(...e))}markPrunableContentForRemoval(){let t=this.liveSocket.binding("update");ct.all(this.container,`[${t}=append] > *, [${t}=prepend] > *`,t=>{t.setAttribute("data-phx-prune","")})}perform(t){let{view:e,liveSocket:n,container:i,html:r}=this,s=this.isCIDPatch()?this.targetCIDContainer(r):i;if(this.isCIDPatch()&&!s)return;let o=n.getActiveElement(),{selectionStart:a,selectionEnd:l}=o&&ct.hasSelectionRange(o)?o:{},h=n.binding("update"),u=n.binding("feedback-for"),c=n.binding("feedback-group"),d=n.binding("disable-with"),f=n.binding("viewport-top"),p=n.binding("viewport-bottom"),g=n.binding("trigger-action"),m=[],v=[],b=[],y=[],w=null;function k(n,i){Dt(n,i,{childrenOnly:null===n.getAttribute(P),getNodeKey:e=>ct.isPhxDestroyed(e)?null:t?e.id:e.id||e.getAttribute&&e.getAttribute("data-phx-id"),skipFromChildren:t=>"stream"===t.getAttribute(h),addChild:(t,e)=>{let{ref:n,streamAt:i}=this.getStreamInsert(e);if(void 0===n)return t.appendChild(e);if(this.setStreamRef(e,n),0===i)t.insertAdjacentElement("afterbegin",e);else if(-1===i)t.appendChild(e);else if(i>0){let n=Array.from(t.children)[i];t.insertBefore(e,n)}},onBeforeNodeAdded:e=>{ct.maybeAddPrivateHooks(e,f,p),this.trackBefore("added",e);let n=e;return!t&&this.streamComponentRestore[e.id]&&(n=this.streamComponentRestore[e.id],delete this.streamComponentRestore[e.id],k.bind(this)(n,e)),n},onNodeAdded:t=>{t.getAttribute&&this.maybeReOrderStream(t,!0),ct.isFeedbackContainer(t,u)&&v.push(t),t instanceof HTMLImageElement&&t.srcset?t.srcset=t.srcset:t instanceof HTMLVideoElement&&t.autoplay&&t.play(),ct.isNowTriggerFormExternal(t,g)&&(w=t),(ct.isPhxChild(t)&&e.ownsElement(t)||ct.isPhxSticky(t)&&e.ownsElement(t.parentNode))&&this.trackAfter("phxChildAdded",t),m.push(t)},onNodeDiscarded:t=>this.onNodeDiscarded(t),onBeforeNodeDiscarded:t=>!(!t.getAttribute||null===t.getAttribute("data-phx-prune"))||(null===t.parentElement||!t.id||!ct.isPhxUpdate(t.parentElement,h,["stream","append","prepend"]))&&(!this.maybePendingRemove(t)&&!this.skipCIDSibling(t)),onElUpdated:t=>{ct.isNowTriggerFormExternal(t,g)&&(w=t),b.push(t),this.maybeReOrderStream(t,!1)},onBeforeElUpdated:(t,e)=>{if(ct.maybeAddPrivateHooks(e,f,p),(ct.isFeedbackContainer(t,u)||ct.isFeedbackContainer(e,u))&&(v.push(t),v.push(e)),ct.cleanChildNodes(e,h),this.skipCIDSibling(e))return this.maybeReOrderStream(t),!1;if(ct.isPhxSticky(t))return!1;if(ct.isIgnored(t,h)||t.form&&t.form.isSameNode(w))return this.trackBefore("updated",t,e),ct.mergeAttrs(t,e,{isIgnored:!0}),b.push(t),ct.applyStickyOperations(t),!1;if("number"===t.type&&t.validity&&t.validity.badInput)return!1;if(!ct.syncPendingRef(t,e,d))return ct.isUploadInput(t)&&(this.trackBefore("updated",t,e),b.push(t)),ct.applyStickyOperations(t),!1;if(ct.isPhxChild(e)){let n=t.getAttribute(O);return ct.mergeAttrs(t,e,{exclude:[H]}),""!==n&&t.setAttribute(O,n),t.setAttribute(I,this.rootID),ct.applyStickyOperations(t),!1}ct.copyPrivates(e,t);let n=o&&t.isSameNode(o)&&ct.isFormInput(t),i=n&&this.isChangedSelect(t,e);return n&&"hidden"!==t.type&&!i?(this.trackBefore("updated",t,e),ct.mergeFocusedInput(t,e),ct.syncAttrsToProps(t),b.push(t),ct.applyStickyOperations(t),!1):(i&&t.blur(),ct.isPhxUpdate(e,h,["append","prepend"])&&y.push(new class{constructor(t,e,n){let i=new Set,r=new Set([...e.children].map(t=>t.id)),s=[];Array.from(t.children).forEach(t=>{if(t.id&&(i.add(t.id),r.has(t.id))){let e=t.previousElementSibling&&t.previousElementSibling.id;s.push({elementId:t.id,previousElementId:e})}}),this.containerId=e.id,this.updateType=n,this.elementsToModify=s,this.elementIdsToAdd=[...r].filter(t=>!i.has(t))}perform(){let t=ct.byId(this.containerId);this.elementsToModify.forEach(e=>{e.previousElementId?it(document.getElementById(e.previousElementId),t=>{it(document.getElementById(e.elementId),e=>{e.previousElementSibling&&e.previousElementSibling.id==t.id||t.insertAdjacentElement("afterend",e)})}):it(document.getElementById(e.elementId),e=>{null==e.previousElementSibling||t.insertAdjacentElement("afterbegin",e)})}),"prepend"==this.updateType&&this.elementIdsToAdd.reverse().forEach(e=>{it(document.getElementById(e),e=>t.insertAdjacentElement("afterbegin",e))})}}(t,e,e.getAttribute(h))),ct.syncAttrsToProps(e),ct.applyStickyOperations(e),this.trackBefore("updated",t,e),!0)}})}return this.trackBefore("added",i),this.trackBefore("updated",i,i),n.time("morphdom",()=>{this.streams.forEach(([t,e,n,r])=>{e.forEach(([e,n,i])=>{this.streamInserts[e]={ref:t,streamAt:n,limit:i,reset:r}}),void 0!==r&&ct.all(i,`[data-phx-stream="${t}"]`,t=>{this.removeStreamChildElement(t)}),n.forEach(t=>{let e=i.querySelector(`[id="${t}"]`);e&&this.removeStreamChildElement(e)})}),t&&ct.all(this.container,`[${h}=stream]`,t=>{this.liveSocket.owner(t,e=>{e===this.view&&Array.from(t.children).forEach(t=>{this.removeStreamChildElement(t)})})}),k.bind(this)(s,r)}),n.isDebugEnabled()&&function(){let t=new Set,e=document.querySelectorAll("*[id]");for(let n=0,i=e.length;n0&&n.time("post-morph append/prepend restoration",()=>{y.forEach(t=>t.perform())}),ct.maybeHideFeedback(s,v,u,c),n.silenceEvents(()=>ct.restoreFocus(o,a,l)),ct.dispatchEvent(document,"phx:update"),m.forEach(t=>this.trackAfter("added",t)),b.forEach(t=>this.trackAfter("updated",t)),this.transitionPendingRemoves(),w&&(n.unload(),Object.getPrototypeOf(w).submit.call(w)),!0}onNodeDiscarded(t){(ct.isPhxChild(t)||ct.isPhxSticky(t))&&this.liveSocket.destroyViewByEl(t),this.trackAfter("discarded",t)}maybePendingRemove(t){return!(!t.getAttribute||null===t.getAttribute(this.phxRemove))&&(this.pendingRemoves.push(t),!0)}removeStreamChildElement(t){this.streamInserts[t.id]?(this.streamComponentRestore[t.id]=t,t.remove()):this.maybePendingRemove(t)||(t.remove(),this.onNodeDiscarded(t))}getStreamInsert(t){return(t.id?this.streamInserts[t.id]:{})||{}}setStreamRef(t,e){ct.putSticky(t,"data-phx-stream",t=>t.setAttribute("data-phx-stream",e))}maybeReOrderStream(t,e){let{ref:n,streamAt:i,reset:r}=this.getStreamInsert(t);if(void 0!==i&&(this.setStreamRef(t,n),(r||e)&&t.parentElement)){if(0===i)t.parentElement.insertBefore(t,t.parentElement.firstElementChild);else if(i>0){let e=Array.from(t.parentElement.children),n=e.indexOf(t);if(i>=e.length-1)t.parentElement.appendChild(t);else{let r=e[i];n>i?t.parentElement.insertBefore(t,r):t.parentElement.insertBefore(t,r.nextElementSibling)}}this.maybeLimitStream(t)}}maybeLimitStream(t){let{limit:e}=this.getStreamInsert(t),n=null!==e&&Array.from(t.parentElement.children);e&&e<0&&n.length>-1*e?n.slice(0,n.length+e).forEach(t=>this.removeStreamChildElement(t)):e&&e>=0&&n.length>e&&n.slice(e).forEach(t=>this.removeStreamChildElement(t))}transitionPendingRemoves(){let{pendingRemoves:t,liveSocket:e}=this;t.length>0&&(e.transitionRemoves(t),e.requestDOMUpdate(()=>{t.forEach(t=>{let n=ct.firstPhxChild(t);n&&e.destroyViewByEl(n),t.remove()}),this.trackAfter("transitionsDiscarded",t)}))}isChangedSelect(t,e){if(!(t instanceof HTMLSelectElement)||t.multiple)return!1;if(t.options.length!==e.options.length)return!0;let n=t.selectedOptions[0],i=e.selectedOptions[0];return n&&n.hasAttribute("selected")&&i.setAttribute("selected",n.getAttribute("selected")),!t.isEqualNode(e)}isCIDPatch(){return this.cidPatch}skipCIDSibling(t){return t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("data-phx-skip")}targetCIDContainer(t){if(!this.isCIDPatch())return;let[e,...n]=ct.findComponentNodeList(this.container,this.targetCID);return 0===n.length&&1===ct.childNodeLength(t)?e:e&&e.parentNode}indexOf(t,e){return Array.from(t.children).indexOf(e)}},It=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ft=new Set(["'",'"']),Ut=(t,e,n)=>{let i,r,s,o,a,l,h=0,u=!1,c=t.match(/^(\s*(?:\s*)*)<([^\s\/>]+)/);if(null===c)throw new Error("malformed html "+t);for(h=c[0].length,i=c[1],s=c[2],o=h;h"!==t.charAt(h);h++)if("="===t.charAt(h)){let e=" id"===t.slice(h-3,h);h++;let n=t.charAt(h);if(Ft.has(n)){let i=h;for(h++;h=i.length+s.length;){let e=t.charAt(d);if(u)"-"===e&&""===e&&"--"===t.slice(d-2,d))u=!0,d-=3;else{if(">"===e)break;d-=1}}r=t.slice(d+1,t.length);let f=Object.keys(e).map(t=>!0===e[t]?t:`${t}="${e[t]}"`).join(" ");if(n){let t=a?` id="${a}"`:"";l=It.has(s)?`<${s}${t}${""===f?"":" "}${f}/>`:`<${s}${t}${""===f?"":" "}${f}>`}else{l=`<${s}${""===f?"":" "}${f}${t.slice(o,d+1)}`}return[l,i,r]},Ot=class{static extract(t){let{[z]:e,[W]:n,[Y]:i}=t;return delete t[z],delete t[W],delete t[Y],{diff:t,title:i,reply:e||null,events:n||[]}}constructor(t,e){this.viewId=t,this.rendered={},this.magicId=0,this.mergeDiff(e)}parentViewId(){return this.viewId}toString(t){let[e,n]=this.recursiveToString(this.rendered,this.rendered.c,t,!0,{});return[e,n]}recursiveToString(t,e=t.c,n,i,r){let s={buffer:"",components:e,onlyCids:n=n?new Set(n):null,streams:new Set};return this.toOutputBuffer(t,null,s,i,r),[s.buffer,s.streams]}componentCIDs(t){return Object.keys(t.c||{}).map(t=>parseInt(t))}isComponentOnlyDiff(t){return!!t.c&&1===Object.keys(t).length}getComponent(t,e){return t.c[e]}resetRender(t){this.rendered.c[t]&&(this.rendered.c[t].reset=!0)}mergeDiff(t){let e=t.c,n={};if(delete t.c,this.rendered=this.mutableMerge(this.rendered,t),this.rendered.c=this.rendered.c||{},e){let i=this.rendered.c;for(let t in e)e[t]=this.cachedFindComponent(t,e[t],i,e,n);for(let t in e)i[t]=e[t];t.c=e}}cachedFindComponent(t,e,n,i,r){if(r[t])return r[t];{let s,o,a=e[V];if(K(a)){let t;t=a>0?this.cachedFindComponent(a,i[a],n,i,r):n[-a],o=t[V],s=this.cloneMerge(t,e,!0),s[V]=o}else s=void 0!==e[V]||void 0===n[t]?e:this.cloneMerge(n[t],e,!1);return r[t]=s,s}}mutableMerge(t,e){return void 0!==e[V]?e:(this.doMutableMerge(t,e),t)}doMutableMerge(t,e){for(let n in e){let i=e[n],r=t[n];et(i)&&void 0===i[V]&&et(r)?this.doMutableMerge(r,i):t[n]=i}t.r&&(t.newRender=!0)}cloneMerge(t,e,n){let i={...t,...e};for(let r in i){let s=e[r],o=t[r];et(s)&&void 0===s[V]&&et(o)?i[r]=this.cloneMerge(o,s,n):void 0===s&&et(o)&&(i[r]=this.cloneMerge(o,{},n))}return n?(delete i.magicId,delete i.newRender):t.r&&(i.newRender=!0),i}componentToString(t){let[e,n]=this.recursiveCIDToString(this.rendered.c,t,null),[i,r,s]=Ut(e,{});return[i,n]}pruneCIDs(t){t.forEach(t=>delete this.rendered.c[t])}get(){return this.rendered}isNewFingerprint(t={}){return!!t[V]}templateStatic(t,e){return"number"==typeof t?e[t]:t}nextMagicID(){return this.magicId++,`m${this.magicId}-${this.parentViewId()}`}toOutputBuffer(t,e,n,i,r={}){if(t[J])return this.comprehensionToBuffer(t,e,n);let{[V]:s}=t;s=this.templateStatic(s,e);let o=t.r,a=n.buffer;o&&(n.buffer=""),i&&o&&!t.magicId&&(t.newRender=!0,t.magicId=this.nextMagicID()),n.buffer+=s[0];for(let r=1;r0||l.length>0||h)&&(delete t[X],t[J]=[],n.streams.add(s))}dynamicToBuffer(t,e,n,i){if("number"==typeof t){let[e,i]=this.recursiveCIDToString(n.components,t,n.onlyCids);n.buffer+=e,n.streams=new Set([...n.streams,...i])}else et(t)?this.toOutputBuffer(t,e,n,i,{}):n.buffer+=t}recursiveCIDToString(t,e,n){let i=t[e]||G("no component for CID "+e,t),r={[P]:e},s=n&&!n.has(e);i.newRender=!s,i.magicId=`c${e}-${this.parentViewId()}`;let o=!i.reset,[a,l]=this.recursiveToString(i,t,n,o,r);return delete i.reset,[a,l]}},$t=1,Ht=class{static makeID(){return $t++}static elementID(t){return t.phxHookId}constructor(t,e,n){this.__view=t,this.liveSocket=t.liveSocket,this.__callbacks=n,this.__listeners=new Set,this.__isDisconnected=!1,this.el=e,this.el.phxHookId=this.constructor.makeID();for(let t in this.__callbacks)this[t]=this.__callbacks[t]}__mounted(){this.mounted&&this.mounted()}__updated(){this.updated&&this.updated()}__beforeUpdate(){this.beforeUpdate&&this.beforeUpdate()}__destroyed(){this.destroyed&&this.destroyed()}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}pushEvent(t,e={},n=function(){}){return this.__view.pushHookEvent(this.el,null,t,e,n)}pushEventTo(t,e,n={},i=function(){}){return this.__view.withinTargets(t,(t,r)=>t.pushHookEvent(this.el,r,e,n,i))}handleEvent(t,e){let n=(n,i)=>i?t:e(n.detail);return window.addEventListener("phx:"+t,n),this.__listeners.add(n),n}removeHandleEvent(t){let e=t(null,!0);window.removeEventListener("phx:"+e,t),this.__listeners.delete(t)}upload(t,e){return this.__view.dispatchUploads(null,t,e)}uploadTo(t,e,n){return this.__view.withinTargets(t,(t,i)=>{t.dispatchUploads(i,e,n)})}__cleanup__(){this.__listeners.forEach(t=>this.removeHandleEvent(t))}},jt=(t,e,n=[])=>{const{submitter:i,...r}=e;let s;if(i&&i.name){const t=document.createElement("input");t.type="hidden";const e=i.getAttribute("form");e&&t.setAttribute("form",e),t.name=i.name,t.value=i.value,i.parentElement.insertBefore(t,i),s=t}const o=new FormData(t),a=[];o.forEach((t,e,n)=>{t instanceof File&&a.push(e)}),a.forEach(t=>o.delete(t));const l=new URLSearchParams;for(let[t,e]of o.entries())(0===n.length||n.indexOf(t)>=0)&&l.append(t,e);i&&s&&i.parentElement.removeChild(s);for(let t in r)l.append(t,r[t]);return l.toString()},Bt=class{constructor(t,e,n,i,r){this.isDead=!1,this.liveSocket=e,this.flash=i,this.parent=n,this.root=n?n.root:this,this.el=t,this.id=this.el.id,this.ref=0,this.childJoins=0,this.loaderTimer=null,this.pendingDiffs=[],this.pendingForms=new Set,this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(t){t&&t()},this.stopCallback=function(){},this.pendingJoinOps=this.parent?null:[],this.viewHooks={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.channel=this.liveSocket.channel("lv:"+this.id,()=>{let t=this.href&&this.expandURL(this.href);return{redirect:this.redirect?t:void 0,url:this.redirect?void 0:t||void 0,params:this.connectParams(r),session:this.getSession(),static:this.getStatic(),flash:this.flash}})}setHref(t){this.href=t}setRedirect(t){this.redirect=!0,this.href=t}isMain(){return this.el.hasAttribute("data-phx-main")}connectParams(t){let e=this.liveSocket.params(this.el),n=ct.all(document,`[${this.binding("track-static")}]`).map(t=>t.src||t.href).filter(t=>"string"==typeof t);return n.length>0&&(e._track_static=n),e._mounts=this.joinCount,e._live_referer=t,e}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(O)}getStatic(){let t=this.el.getAttribute(H);return""===t?null:t}destroy(t=function(){}){this.destroyAllChildren(),this.destroyed=!0,delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],clearTimeout(this.loaderTimer);let e=()=>{t();for(let t in this.viewHooks)this.destroyHook(this.viewHooks[t])};ct.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"]),this.channel.leave().receive("ok",e).receive("error",e).receive("timeout",e)}setContainerClasses(...t){this.el.classList.remove("phx-connected","phx-loading","phx-error","phx-client-error","phx-server-error"),this.el.classList.add(...t)}showLoader(t){if(clearTimeout(this.loaderTimer),t)this.loaderTimer=setTimeout(()=>this.showLoader(),t);else{for(let t in this.viewHooks)this.viewHooks[t].__disconnected();this.setContainerClasses("phx-loading")}}execAll(t){ct.all(this.el,`[${t}]`,e=>this.liveSocket.execJS(e,e.getAttribute(t)))}hideLoader(){clearTimeout(this.loaderTimer),this.setContainerClasses("phx-connected"),this.execAll(this.binding("connected"))}triggerReconnected(){for(let t in this.viewHooks)this.viewHooks[t].__reconnected()}log(t,e){this.liveSocket.log(this,t,e)}transition(t,e,n=function(){}){this.liveSocket.transition(t,e,n)}withinTargets(t,e){if(t instanceof HTMLElement||t instanceof SVGElement)return this.liveSocket.owner(t,n=>e(n,t));if(K(t)){0===ct.findComponentNodeList(this.el,t).length?G("no component found matching phx-target of "+t):e(this,parseInt(t))}else{let n=Array.from(document.querySelectorAll(t));0===n.length&&G(`nothing found matching the phx-target selector "${t}"`),n.forEach(t=>this.liveSocket.owner(t,n=>e(n,t)))}}applyDiff(t,e,n){this.log(t,()=>["",Q(e)]);let{diff:i,reply:r,events:s,title:o}=Ot.extract(e);n({diff:i,reply:r,events:s}),o&&window.requestAnimationFrame(()=>ct.putTitle(o))}onJoin(t){let{rendered:e,container:n}=t;if(n){let[t,e]=n;this.el=ct.replaceRootContainer(this.el,t,e)}this.childJoins=0,this.joinPending=!0,this.flash=null,ot.dropLocal(this.liveSocket.localStorage,window.location.pathname,"consecutive-reloads"),this.applyDiff("mount",e,({diff:e,events:n})=>{this.rendered=new Ot(this.id,e);let[i,r]=this.renderContainer(null,"join");this.dropPendingRefs();let s=this.formsForRecovery(i).filter(([t,e,n])=>!this.pendingForms.has(t.id));this.joinCount++,s.length>0?s.forEach(([t,e,o],a)=>{this.pendingForms.add(t.id),this.pushFormRecovery(t,o,e=>{this.pendingForms.delete(t.id),a===s.length-1&&this.onJoinComplete(e,i,r,n)})}):this.onJoinComplete(t,i,r,n)})}dropPendingRefs(){ct.all(document,`[${L}="${this.id}"][${R}]`,t=>{t.removeAttribute(R),t.removeAttribute(L)})}onJoinComplete({live_patch:t},e,n,i){if(this.pendingForms.clear(),this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(t,e,n,i);0===ct.findPhxChildrenInFragment(e,this.id).filter(t=>{let e=t.id&&this.el.querySelector(`[id="${t.id}"]`),n=e&&e.getAttribute(H);return n&&t.setAttribute(H,n),e&&e.setAttribute(I,this.root.id),this.joinChild(t)}).length?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,e,n,i)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(t,e,n,i)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,e,n,i)])}attachTrueDocEl(){this.el=ct.byId(this.id),this.el.setAttribute(I,this.root.id)}execNewMounted(){let t=this.binding("viewport-top"),e=this.binding("viewport-bottom");ct.all(this.el,`[${t}], [${e}]`,n=>{ct.maybeAddPrivateHooks(n,t,e),this.maybeAddNewHook(n)}),ct.all(this.el,`[${this.binding("hook")}], [data-phx-hook]`,t=>{this.maybeAddNewHook(t)}),ct.all(this.el,`[${this.binding("mounted")}]`,t=>this.maybeMounted(t))}applyJoinPatch(t,e,n,i){this.attachTrueDocEl();let r=new Nt(this,this.el,this.id,e,n,null);if(r.markPrunableContentForRemoval(),this.performPatch(r,!1,!0),this.joinNewChildren(),this.execNewMounted(),this.joinPending=!1,this.liveSocket.dispatchEvents(i),this.applyPendingUpdates(),t){let{kind:e,to:n}=t;this.liveSocket.historyPatch(n,e)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(t,e){this.liveSocket.triggerDOM("onBeforeElUpdated",[t,e]);let n=this.getHook(t),i=n&&ct.isIgnored(t,this.binding("update"));if(n&&!t.isEqualNode(e)&&(!i||(r=t.dataset,s=e.dataset,JSON.stringify(r)!==JSON.stringify(s))))return n.__beforeUpdate(),n;var r,s}maybeMounted(t){let e=t.getAttribute(this.binding("mounted")),n=e&&ct.private(t,"mounted");e&&!n&&(this.liveSocket.execJS(t,e),ct.putPrivate(t,"mounted",!0))}maybeAddNewHook(t,e){let n=this.addHook(t);n&&n.__mounted()}performPatch(t,e,n=!1){let i=[],r=!1,s=new Set;return t.after("added",t=>{this.liveSocket.triggerDOM("onNodeAdded",[t]);let e=this.binding("viewport-top"),n=this.binding("viewport-bottom");ct.maybeAddPrivateHooks(t,e,n),this.maybeAddNewHook(t),t.getAttribute&&this.maybeMounted(t)}),t.after("phxChildAdded",t=>{ct.isPhxSticky(t)?this.liveSocket.joinRootViews():r=!0}),t.before("updated",(t,e)=>{this.triggerBeforeUpdateHook(t,e)&&s.add(t.id)}),t.after("updated",t=>{s.has(t.id)&&this.getHook(t).__updated()}),t.after("discarded",t=>{t.nodeType===Node.ELEMENT_NODE&&i.push(t)}),t.after("transitionsDiscarded",t=>this.afterElementsRemoved(t,e)),t.perform(n),this.afterElementsRemoved(i,e),r}afterElementsRemoved(t,e){let n=[];t.forEach(t=>{let e=ct.all(t,`[${P}]`),i=ct.all(t,`[${this.binding("hook")}]`);e.concat(t).forEach(t=>{let e=this.componentID(t);K(e)&&-1===n.indexOf(e)&&n.push(e)}),i.concat(t).forEach(t=>{let e=this.getHook(t);e&&this.destroyHook(e)})}),e&&this.maybePushComponentsDestroyed(n)}joinNewChildren(){ct.findPhxChildren(this.el,this.id).forEach(t=>this.joinChild(t))}getChildById(t){return this.root.children[this.id][t]}getDescendentByEl(t){return t.id===this.id?this:this.children[t.getAttribute(N)][t.id]}destroyDescendent(t){for(let e in this.root.children)for(let n in this.root.children[e])if(n===t)return this.root.children[e][n].destroy()}joinChild(t){if(!this.getChildById(t.id)){let e=new Bt(t,this.liveSocket,this);return this.root.children[this.id][e.id]=e,e.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(t){this.childJoins--,0===this.childJoins&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.joinCallback(()=>{this.pendingJoinOps.forEach(([t,e])=>{t.isDestroyed()||e()}),this.pendingJoinOps=[]})}update(t,e){if(this.isJoinPending()||this.liveSocket.hasPendingLink()&&this.root.isMain())return this.pendingDiffs.push({diff:t,events:e});this.rendered.mergeDiff(t);let n=!1;this.rendered.isComponentOnlyDiff(t)?this.liveSocket.time("component patch complete",()=>{ct.findExistingParentCIDs(this.el,this.rendered.componentCIDs(t)).forEach(e=>{this.componentPatch(this.rendered.getComponent(t,e),e)&&(n=!0)})}):nt(t)||this.liveSocket.time("full patch complete",()=>{let[e,i]=this.renderContainer(t,"update"),r=new Nt(this,this.el,this.id,e,i,null);n=this.performPatch(r,!0)}),this.liveSocket.dispatchEvents(e),n&&this.joinNewChildren()}renderContainer(t,e){return this.liveSocket.time(`toString diff (${e})`,()=>{let e=this.el.tagName,n=t?this.rendered.componentCIDs(t):null,[i,r]=this.rendered.toString(n);return[`<${e}>${i}`,r]})}componentPatch(t,e){if(nt(t))return!1;let[n,i]=this.rendered.componentToString(e),r=new Nt(this,this.el,this.id,n,i,e);return this.performPatch(r,!0)}getHook(t){return this.viewHooks[Ht.elementID(t)]}addHook(t){if(Ht.elementID(t)||!t.getAttribute)return;let e=t.getAttribute("data-phx-hook")||t.getAttribute(this.binding("hook"));if(e&&!this.ownsElement(t))return;let n=this.liveSocket.getHookCallbacks(e);if(n){t.id||G(`no DOM ID for hook "${e}". Hooks require a unique ID on each element.`,t);let i=new Ht(this,t,n);return this.viewHooks[Ht.elementID(i.el)]=i,i}null!==e&&G(`unknown hook found for "${e}"`,t)}destroyHook(t){t.__destroyed(),t.__cleanup__(),delete this.viewHooks[Ht.elementID(t.el)]}applyPendingUpdates(){this.pendingDiffs.forEach(({diff:t,events:e})=>this.update(t,e)),this.pendingDiffs=[],this.eachChild(t=>t.applyPendingUpdates())}eachChild(t){let e=this.root.children[this.id]||{};for(let n in e)t(this.getChildById(n))}onChannel(t,e){this.liveSocket.onChannel(this.channel,t,t=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>e(t)]):this.liveSocket.requestDOMUpdate(()=>e(t))})}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",t=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",t,({diff:t,events:e})=>this.update(t,e))})}),this.onChannel("redirect",({to:t,flash:e})=>this.onRedirect({to:t,flash:e})),this.onChannel("live_patch",t=>this.onLivePatch(t)),this.onChannel("live_redirect",t=>this.onLiveRedirect(t)),this.channel.onError(t=>this.onError(t)),this.channel.onClose(t=>this.onClose(t))}destroyAllChildren(){this.eachChild(t=>t.destroy())}onLiveRedirect(t){let{to:e,kind:n,flash:i}=t,r=this.expandURL(e);this.liveSocket.historyRedirect(r,n,i)}onLivePatch(t){let{to:e,kind:n}=t;this.href=this.expandURL(e),this.liveSocket.historyPatch(e,n)}expandURL(t){return t.startsWith("/")?`${window.location.protocol}//${window.location.host}${t}`:t}onRedirect({to:t,flash:e}){this.liveSocket.redirect(t,e)}isDestroyed(){return this.destroyed}joinDead(){this.isDead=!0}join(t){this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel(),this.isMain()&&(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=e=>{e=e||function(){},t?t(this.joinCount,e):e()},this.liveSocket.wrapPush(this,{timeout:!1},()=>this.channel.join().receive("ok",t=>{this.isDestroyed()||this.liveSocket.requestDOMUpdate(()=>this.onJoin(t))}).receive("error",t=>!this.isDestroyed()&&this.onJoinError(t)).receive("timeout",()=>!this.isDestroyed()&&this.onJoinError({reason:"timeout"})))}onJoinError(t){return"reload"===t.reason?(this.log("error",()=>[`failed mount with ${t.status}. Falling back to page request`,t]),void(this.isMain()&&this.onRedirect({to:this.href}))):"unauthorized"===t.reason||"stale"===t.reason?(this.log("error",()=>["unauthorized live_redirect. Falling back to page request",t]),void(this.isMain()&&this.onRedirect({to:this.href}))):((t.redirect||t.live_redirect)&&(this.joinPending=!1,this.channel.leave()),t.redirect?this.onRedirect(t.redirect):t.live_redirect?this.onLiveRedirect(t.live_redirect):(this.displayError(["phx-loading","phx-error","phx-server-error"]),this.log("error",()=>["unable to join",t]),void(this.liveSocket.isConnected()&&this.liveSocket.reloadWithJitter(this))))}onClose(t){if(!this.isDestroyed()){if(this.liveSocket.hasPendingLink()&&"leave"!==t)return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(200)}}onError(t){this.onClose(t),this.liveSocket.isConnected()&&this.log("error",()=>["view crashed",t]),this.liveSocket.isUnloaded()||(this.liveSocket.isConnected()?this.displayError(["phx-loading","phx-error","phx-server-error"]):this.displayError(["phx-loading","phx-error","phx-client-error"]))}displayError(t){this.isMain()&&ct.dispatchEvent(window,"phx:page-loading-start",{detail:{to:this.href,kind:"error"}}),this.showLoader(),this.setContainerClasses(...t),this.execAll(this.binding("disconnected"))}pushWithReply(t,e,n,i=function(){}){if(!this.isConnected())return;let[r,[s],o]=t?t():[null,[],{}],a=function(){};return(o.page_loading||s&&null!==s.getAttribute(this.binding("page-loading")))&&(a=this.liveSocket.withPageLoading({kind:"element",target:s})),"number"!=typeof n.cid&&delete n.cid,this.liveSocket.wrapPush(this,{timeout:!0},()=>this.channel.push(e,n,3e4).receive("ok",t=>{let e=e=>{t.redirect&&this.onRedirect(t.redirect),t.live_patch&&this.onLivePatch(t.live_patch),t.live_redirect&&this.onLiveRedirect(t.live_redirect),a(),i(t,e)};t.diff?this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",t.diff,({diff:t,reply:n,events:i})=>{null!==r&&this.undoRefs(r),this.update(t,i),e(n)})}):(null!==r&&this.undoRefs(r),e(null))}))}undoRefs(t){this.isConnected()&&ct.all(document,`[${L}="${this.id}"][${R}="${t}"]`,t=>{let e=t.getAttribute(j),n=t.getAttribute("data-phx-readonly");t.removeAttribute(R),t.removeAttribute(L),null!==n&&(t.readOnly="true"===n,t.removeAttribute("data-phx-readonly")),null!==e&&(t.disabled="true"===e,t.removeAttribute(j)),M.forEach(e=>ct.removeClass(t,e));let i=t.getAttribute("data-phx-disable-with-restore");null!==i&&(t.innerText=i,t.removeAttribute("data-phx-disable-with-restore"));let r=ct.private(t,R);if(r){let e=this.triggerBeforeUpdateHook(t,r);Nt.patchEl(t,r,this.liveSocket.getActiveElement()),e&&e.__updated(),ct.deletePrivate(t,R)}})}putRef(t,e,n={}){let i=this.ref++,r=this.binding("disable-with");return n.loading&&(t=t.concat(ct.all(document,n.loading))),t.forEach(t=>{t.classList.add(`phx-${e}-loading`),t.setAttribute(R,i),t.setAttribute(L,this.el.id);let n=t.getAttribute(r);null!==n&&(t.getAttribute("data-phx-disable-with-restore")||t.setAttribute("data-phx-disable-with-restore",t.innerText),""!==n&&(t.innerText=n),t.setAttribute(j,t.getAttribute(j)||t.disabled),t.setAttribute("disabled",""))}),[i,t,n]}componentID(t){let e=t.getAttribute&&t.getAttribute(P);return e?parseInt(e):null}targetComponentID(t,e,n={}){if(K(e))return e;let i=n.target||t.getAttribute(this.binding("target"));return K(i)?parseInt(i):e&&(null!==i||n.target)?this.closestComponentID(e):null}closestComponentID(t){return K(t)?t:t?it(t.closest(`[${P}]`),t=>this.ownsElement(t)&&this.componentID(t)):null}pushHookEvent(t,e,n,i,r){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",n,i]),!1;let[s,o,a]=this.putRef([t],"hook");return this.pushWithReply(()=>[s,o,a],"event",{type:"hook",event:n,value:i,cid:this.closestComponentID(e)},(t,e)=>r(e,s)),s}extractMeta(t,e,n){let i=this.binding("value-");for(let n=0;n=0&&!t.checked&&delete e.value),n){e||(e={});for(let t in n)e[t]=n[t]}return e}pushEvent(t,e,n,i,r,s={},o){this.pushWithReply(()=>this.putRef([e],t,s),"event",{type:t,event:i,value:this.extractMeta(e,r,s.value),cid:this.targetComponentID(e,n,s)},(t,e)=>o&&o(e))}pushFileProgress(t,e,n,i=function(){}){this.liveSocket.withinOwners(t.form,(r,s)=>{r.pushWithReply(null,"progress",{event:t.getAttribute(r.binding("progress")),ref:t.getAttribute(D),entry_ref:e,progress:n,cid:r.targetComponentID(t.form,s)},i)})}pushInput(t,e,n,i,r,s){let o,a,l=K(n)?n:this.targetComponentID(t.form,e,r),h=()=>this.putRef([t,t.form],"change",r),u=this.extractMeta(t.form);t instanceof HTMLButtonElement&&(u.submitter=t),a=t.getAttribute(this.binding("change"))?jt(t.form,{_target:r._target,...u},[t.name]):jt(t.form,{_target:r._target,...u}),ct.isUploadInput(t)&&t.files&&t.files.length>0&&pt.trackFiles(t,Array.from(t.files)),o=pt.serializeUploads(t);let c={type:"form",event:i,value:a,uploads:o,cid:l};this.pushWithReply(h,"event",c,n=>{if(ct.showError(t,this.liveSocket.binding("feedback-for"),this.liveSocket.binding("feedback-group")),ct.isUploadInput(t)&&ct.isAutoUpload(t)){if(pt.filesAwaitingPreflight(t).length>0){let[i,r]=h();this.uploadFiles(t.form,e,i,l,e=>{s&&s(n),this.triggerAwaitingSubmit(t.form),this.undoRefs(i)})}}else s&&s(n)})}triggerAwaitingSubmit(t){let e=this.getScheduledSubmit(t);if(e){let[n,i,r,s]=e;this.cancelSubmit(t),s()}}getScheduledSubmit(t){return this.formSubmits.find(([e,n,i,r])=>e.isSameNode(t))}scheduleSubmit(t,e,n,i){if(this.getScheduledSubmit(t))return!0;this.formSubmits.push([t,e,n,i])}cancelSubmit(t){this.formSubmits=this.formSubmits.filter(([e,n,i])=>!e.isSameNode(t)||(this.undoRefs(n),!1))}disableForm(t,e={}){let n=t=>!(tt(t,this.binding("update")+"=ignore",t.form)||tt(t,"data-phx-update=ignore",t.form)),i=Array.from(t.elements),r=i.filter(t=>t.hasAttribute(this.binding("disable-with"))),s=i.filter(t=>"BUTTON"==t.tagName).filter(n),o=i.filter(t=>["INPUT","TEXTAREA","SELECT"].includes(t.tagName)).filter(n);return s.forEach(t=>{t.setAttribute(j,t.disabled),t.disabled=!0}),o.forEach(t=>{t.setAttribute("data-phx-readonly",t.readOnly),t.readOnly=!0,t.files&&(t.setAttribute(j,t.disabled),t.disabled=!0)}),t.setAttribute(this.binding("page-loading"),""),this.putRef([t].concat(r).concat(s).concat(o),"submit",e)}pushFormSubmit(t,e,n,i,r,s){let o=()=>this.disableForm(t,r),a=this.targetComponentID(t,e);if(pt.hasUploadsInProgress(t)){let[a,l]=o(),h=()=>this.pushFormSubmit(t,e,n,i,r,s);return this.scheduleSubmit(t,a,r,h)}if(pt.inputsAwaitingPreflight(t).length>0){let[l,h]=o(),u=()=>[l,h,r];this.uploadFiles(t,e,l,a,e=>{if(pt.inputsAwaitingPreflight(t).length>0)return this.undoRefs(l);let r=this.extractMeta(t),o=jt(t,{submitter:i,...r});this.pushWithReply(u,"event",{type:"form",event:n,value:o,cid:a},s)})}else if(!t.hasAttribute(R)||!t.classList.contains("phx-submit-loading")){let e=this.extractMeta(t),r=jt(t,{submitter:i,...e});this.pushWithReply(o,"event",{type:"form",event:n,value:r,cid:a},s)}}uploadFiles(t,e,n,i,r){let s=this.joinCount,o=pt.activeFileInputs(t),a=o.length;o.forEach(t=>{let i=new pt(t,this,()=>{a--,0===a&&r()}),o=i.entries().map(t=>t.toPreflightPayload());if(0===o.length)return void a--;let l={ref:t.getAttribute(D),entries:o,cid:this.targetComponentID(t.form,e)};this.log("upload",()=>["sending preflight request",l]),this.pushWithReply(null,"allow_upload",l,t=>{if(this.log("upload",()=>["got preflight response",t]),i.entries().forEach(e=>{t.entries&&!t.entries[e.ref]&&this.handleFailedEntryPreflight(e.ref,"failed preflight",i)}),t.error||0===Object.keys(t.entries).length){this.undoRefs(n),(t.error||[]).map(([t,e])=>{this.handleFailedEntryPreflight(t,e,i)})}else{let e=t=>{this.channel.onError(()=>{this.joinCount===s&&t()})};i.initAdapterUpload(t,e,this.liveSocket)}})})}handleFailedEntryPreflight(t,e,n){if(n.isAutoUpload()){let e=n.entries().find(e=>e.ref===t.toString());e&&e.cancel()}else n.entries().map(t=>t.cancel());this.log("upload",()=>["error for entry "+t,e])}dispatchUploads(t,e,n){let i=this.targetCtxElement(t)||this.el,r=ct.findUploadInputs(i).filter(t=>t.name===e);0===r.length?G(`no live file inputs found matching the name "${e}"`):r.length>1?G(`duplicate live file inputs found matching the name "${e}"`):ct.dispatchEvent(r[0],"track-uploads",{detail:{files:n}})}targetCtxElement(t){if(K(t)){let[e]=ct.findComponentNodeList(this.el,t);return e}return t||null}pushFormRecovery(t,e,n){this.liveSocket.withinOwners(t,(i,r)=>{let s=this.binding("change"),o=Array.from(t.elements).filter(t=>ct.isFormInput(t)&&t.name&&!t.hasAttribute(s));if(0===o.length)return;o.forEach(t=>t.hasAttribute(D)&&pt.clearFiles(t));let a=o.find(t=>"hidden"!==t.type)||o[0],l=t.getAttribute(this.binding("auto-recover"))||t.getAttribute(this.binding("change"));ht.exec("change",l,i,a,["push",{_target:a.name,newCid:e,callback:n}])})}pushLinkPatch(t,e,n){let i=this.liveSocket.setPendingLink(t),r=e?()=>this.putRef([e],"click"):null,s=()=>this.liveSocket.redirect(window.location.href),o=t.startsWith("/")?`${location.protocol}//${location.host}${t}`:t,a=this.pushWithReply(r,"live_patch",{url:o},e=>{this.liveSocket.requestDOMUpdate(()=>{e.link_redirect?this.liveSocket.replaceMain(t,null,n,i):(this.liveSocket.commitPendingLink(i)&&(this.href=t),this.applyPendingUpdates(),n&&n(i))})});a?a.receive("timeout",s):s()}formsForRecovery(t){if(0===this.joinCount)return[];let e=this.binding("change"),n=document.createElement("template");return n.innerHTML=t,ct.all(this.el,`form[${e}]`).filter(t=>t.id&&this.ownsElement(t)).filter(t=>t.elements.length>0).filter(t=>"ignore"!==t.getAttribute(this.binding("auto-recover"))).map(t=>{const i=CSS.escape(t.getAttribute(e));let r=n.content.querySelector(`form[id="${t.id}"][${e}="${i}"]`);return r?[t,r,this.targetComponentID(r)]:[t,t,this.targetComponentID(t)]}).filter(([t,e,n])=>e)}maybePushComponentsDestroyed(t){let e=t.filter(t=>0===ct.findComponentNodeList(this.el,t).length);e.length>0&&(e.forEach(t=>this.rendered.resetRender(t)),this.pushWithReply(null,"cids_will_destroy",{cids:e},()=>{let t=e.filter(t=>0===ct.findComponentNodeList(this.el,t).length);t.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:t},t=>{this.rendered.pruneCIDs(t.cids)})}))}ownsElement(t){let e=t.closest($);return t.getAttribute(N)===this.id||e&&e.id===this.id||!e&&this.isDead}submitForm(t,e,n,i,r={}){ct.putPrivate(t,"phx-has-submitted",!0);const s=this.liveSocket.binding("feedback-for"),o=this.liveSocket.binding("feedback-group"),a=Array.from(t.elements);a.forEach(t=>ct.putPrivate(t,"phx-has-submitted",!0)),this.liveSocket.blurActiveElement(this),this.pushFormSubmit(t,e,n,i,r,()=>{a.forEach(t=>ct.showError(t,s,o)),this.liveSocket.restorePreviouslyActiveFocus()})}binding(t){return this.liveSocket.binding(t)}},qt=class{constructor(){this.transitions=new Set,this.pendingOps=[]}reset(){this.transitions.forEach(t=>{clearTimeout(t),this.transitions.delete(t)}),this.flushPendingOps()}after(t){0===this.size()?t():this.pushPendingOp(t)}addTransition(t,e,n){e();let i=setTimeout(()=>{this.transitions.delete(i),n(),this.flushPendingOps()},t);this.transitions.add(i)}pushPendingOp(t){this.pendingOps.push(t)}size(){return this.transitions.size}flushPendingOps(){if(this.size()>0)return;let t=this.pendingOps.shift();t&&(t(),this.flushPendingOps())}};function Jt(t){return t}function Vt(t){return"translate("+t+",0)"}function Wt(t){return"translate(0,"+t+")"}function zt(t){return e=>+t(e)}function Yt(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Xt(){return!this.__axis}function Gt(t,e){var n=[],i=null,r=null,s=6,o=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,h=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",c=1===t||3===t?Vt:Wt;function d(d){var f=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,p=null==r?e.tickFormat?e.tickFormat.apply(e,n):Jt:r,g=Math.max(s,0)+a,m=e.range(),v=+m[0]+l,b=+m[m.length-1]+l,y=(e.bandwidth?Yt:zt)(e.copy(),l),w=d.selection?d.selection():d,k=w.selectAll(".domain").data([null]),x=w.selectAll(".tick").data(f,e).order(),_=x.exit(),C=x.enter().append("g").attr("class","tick"),E=x.select("line"),A=x.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(C),E=E.merge(C.append("line").attr("stroke","currentColor").attr(u+"2",h*s)),A=A.merge(C.append("text").attr("fill","currentColor").attr(u,h*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),d!==w&&(k=k.transition(d),x=x.transition(d),E=E.transition(d),A=A.transition(d),_=_.transition(d).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=y(t))?c(t+l):this.getAttribute("transform")})),C.attr("opacity",1e-6).attr("transform",(function(t){var e=this.parentNode.__axis;return c((e&&isFinite(e=e(t))?e:y(t))+l)}))),_.remove(),k.attr("d",4===t||2===t?o?"M"+h*o+","+v+"H"+l+"V"+b+"H"+h*o:"M"+l+","+v+"V"+b:o?"M"+v+","+h*o+"V"+l+"H"+b+"V"+h*o:"M"+v+","+l+"H"+b),x.attr("opacity",1).attr("transform",(function(t){return c(y(t)+l)})),E.attr(u+"2",h*s),A.attr(u,h*g).text(p),w.filter(Xt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),w.each((function(){this.__axis=y}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(s=o=+t,d):s},d.tickSizeInner=function(t){return arguments.length?(s=+t,d):s},d.tickSizeOuter=function(t){return arguments.length?(o=+t,d):o},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function Kt(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function Zt(t){let e=t,n=t,i=t;function r(t,e,r=0,s=t.length){if(r>>1;i(t[n],e)<0?r=n+1:s=n}while(rt(e)-n,n=Kt,i=(e,n)=>Kt(t(e),n)),{left:r,center:function(t,n,i=0,s=t.length){const o=r(t,n,i,s-1);return o>i&&e(t[o-1],n)>-e(t[o],n)?o-1:o},right:function(t,e,r=0,s=t.length){if(r>>1;i(t[n],e)<=0?r=n+1:s=n}while(r=0?(s>=Qt?10:s>=te?5:s>=ee?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=Qt?10:s>=te?5:s>=ee?2:1)}function ie(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=Qt?r*=10:s>=te?r*=5:s>=ee&&(r*=2),e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););}))},n&&(r.count=function(e,i){return re.setTime(+e),se.setTime(+i),t(re),t(se),Math.floor(n(re,se))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var ae=oe((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));ae.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?oe((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):ae:null};const le=ae;ae.range;var he=oe((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}));const ue=he;he.range;var ce=oe((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}));const de=ce;ce.range;var fe=oe((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}));const pe=fe;fe.range;var ge=oe(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5,t=>t.getDate()-1);const me=ge;ge.range;function ve(t){return oe((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var be=ve(0),ye=ve(1),we=ve(2),ke=ve(3),xe=ve(4),_e=ve(5),Ce=ve(6),Ee=(be.range,ye.range,we.range,ke.range,xe.range,_e.range,Ce.range,oe((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})));const Ae=Ee;Ee.range;var Se=oe((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Se.every=function(t){return isFinite(t=Math.floor(t))&&t>0?oe((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};const Te=Se;Se.range;var Me=oe((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()}));const Pe=Me;Me.range;var Re=oe((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}));const Le=Re;Re.range;var De=oe((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}));const Ne=De;De.range;function Ie(t){return oe((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var Fe=Ie(0),Ue=Ie(1),Oe=Ie(2),$e=Ie(3),He=Ie(4),je=Ie(5),Be=Ie(6),qe=(Fe.range,Ue.range,Oe.range,$e.range,He.range,je.range,Be.range,oe((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})));const Je=qe;qe.range;var Ve=oe((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Ve.every=function(t){return isFinite(t=Math.floor(t))&&t>0?oe((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const We=Ve;Ve.range;function ze(t,e,n,i,r,s){const o=[[ue,1,1e3],[ue,5,5e3],[ue,15,15e3],[ue,30,3e4],[s,1,6e4],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,36e5],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,864e5],[i,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function a(e,n,i){const r=Math.abs(n-e)/i,s=Zt(([,,t])=>t).right(o,r);if(s===o.length)return t.every(ie(e/31536e6,n/31536e6,i));if(0===s)return le.every(Math.max(ie(e,n,i),1));const[a,l]=o[r/o[s-1][2][t.toLowerCase(),e]))}function dn(t,e,n){var i=sn.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function fn(t,e,n){var i=sn.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function pn(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function gn(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function mn(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function vn(t,e,n){var i=sn.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function bn(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function yn(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function wn(t,e,n){var i=sn.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function kn(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function xn(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function _n(t,e,n){var i=sn.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Cn(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function En(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function An(t,e,n){var i=sn.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Sn(t,e,n){var i=sn.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Tn(t,e,n){var i=sn.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Mn(t,e,n){var i=on.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function Pn(t,e,n){var i=sn.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Rn(t,e,n){var i=sn.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Ln(t,e){return ln(t.getDate(),e,2)}function Dn(t,e){return ln(t.getHours(),e,2)}function Nn(t,e){return ln(t.getHours()%12||12,e,2)}function In(t,e){return ln(1+me.count(Te(t),t),e,3)}function Fn(t,e){return ln(t.getMilliseconds(),e,3)}function Un(t,e){return Fn(t,e)+"000"}function On(t,e){return ln(t.getMonth()+1,e,2)}function $n(t,e){return ln(t.getMinutes(),e,2)}function Hn(t,e){return ln(t.getSeconds(),e,2)}function jn(t){var e=t.getDay();return 0===e?7:e}function Bn(t,e){return ln(be.count(Te(t)-1,t),e,2)}function qn(t){var e=t.getDay();return e>=4||0===e?xe(t):xe.ceil(t)}function Jn(t,e){return t=qn(t),ln(xe.count(Te(t),t)+(4===Te(t).getDay()),e,2)}function Vn(t){return t.getDay()}function Wn(t,e){return ln(ye.count(Te(t)-1,t),e,2)}function zn(t,e){return ln(t.getFullYear()%100,e,2)}function Yn(t,e){return ln((t=qn(t)).getFullYear()%100,e,2)}function Xn(t,e){return ln(t.getFullYear()%1e4,e,4)}function Gn(t,e){var n=t.getDay();return ln((t=n>=4||0===n?xe(t):xe.ceil(t)).getFullYear()%1e4,e,4)}function Kn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ln(e/60|0,"0",2)+ln(e%60,"0",2)}function Zn(t,e){return ln(t.getUTCDate(),e,2)}function Qn(t,e){return ln(t.getUTCHours(),e,2)}function ti(t,e){return ln(t.getUTCHours()%12||12,e,2)}function ei(t,e){return ln(1+Ne.count(We(t),t),e,3)}function ni(t,e){return ln(t.getUTCMilliseconds(),e,3)}function ii(t,e){return ni(t,e)+"000"}function ri(t,e){return ln(t.getUTCMonth()+1,e,2)}function si(t,e){return ln(t.getUTCMinutes(),e,2)}function oi(t,e){return ln(t.getUTCSeconds(),e,2)}function ai(t){var e=t.getUTCDay();return 0===e?7:e}function li(t,e){return ln(Fe.count(We(t)-1,t),e,2)}function hi(t){var e=t.getUTCDay();return e>=4||0===e?He(t):He.ceil(t)}function ui(t,e){return t=hi(t),ln(He.count(We(t),t)+(4===We(t).getUTCDay()),e,2)}function ci(t){return t.getUTCDay()}function di(t,e){return ln(Ue.count(We(t)-1,t),e,2)}function fi(t,e){return ln(t.getUTCFullYear()%100,e,2)}function pi(t,e){return ln((t=hi(t)).getUTCFullYear()%100,e,2)}function gi(t,e){return ln(t.getUTCFullYear()%1e4,e,4)}function mi(t,e){var n=t.getUTCDay();return ln((t=n>=4||0===n?He(t):He.ceil(t)).getUTCFullYear()%1e4,e,4)}function vi(){return"+0000"}function bi(){return"%"}function yi(t){return+t}function wi(t){return Math.floor(+t/1e3)}en=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,o=t.shortDays,a=t.months,l=t.shortMonths,h=un(r),u=cn(r),c=un(s),d=cn(s),f=un(o),p=cn(o),g=un(a),m=cn(a),v=un(l),b=cn(l),y={a:function(t){return o[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:Ln,e:Ln,f:Un,g:Yn,G:Gn,H:Dn,I:Nn,j:In,L:Fn,m:On,M:$n,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:yi,s:wi,S:Hn,u:jn,U:Bn,V:Jn,w:Vn,W:Wn,x:null,X:null,y:zn,Y:Xn,Z:Kn,"%":bi},w={a:function(t){return o[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Zn,e:Zn,f:ii,g:pi,G:mi,H:Qn,I:ti,j:ei,L:ni,m:ri,M:si,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:yi,s:wi,S:oi,u:ai,U:li,V:ui,w:ci,W:di,x:null,X:null,y:fi,Y:gi,Z:vi,"%":bi},k={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=b.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return C(t,e,n,i)},d:xn,e:xn,f:Tn,g:bn,G:vn,H:Cn,I:Cn,j:_n,L:Sn,m:kn,M:En,p:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:wn,Q:Pn,s:Rn,S:An,u:fn,U:pn,V:gn,w:dn,W:mn,x:function(t,e,i){return C(t,n,e,i)},X:function(t,e,n){return C(t,i,e,n)},y:bn,Y:vn,Z:yn,"%":Mn};function x(t,e){return function(n){var i,r,s,o=[],a=-1,l=0,h=t.length;for(n instanceof Date||(n=new Date(+n));++a53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=Qe(tn(s.y,0,1))).getUTCDay(),i=r>4||0===r?Ue.ceil(i):Ue(i),i=Ne.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=Ze(tn(s.y,0,1))).getDay(),i=r>4||0===r?ye.ceil(i):ye(i),i=me.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?Qe(tn(s.y,0,1)).getUTCDay():Ze(tn(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,Qe(s)):Ze(s)}}function C(t,e,n,i){for(var r,s,o=0,a=e.length,l=n.length;o=l)return-1;if(37===(r=e.charCodeAt(o++))){if(r=e.charAt(o++),!(s=k[r in rn?e.charAt(o++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return y.x=x(n,y),y.X=x(i,y),y.c=x(e,y),w.x=x(n,w),w.X=x(i,w),w.c=x(e,w),{format:function(t){var e=x(t+="",y);return e.toString=function(){return t},e},parse:function(t){var e=_(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=_(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),nn=en.format,en.parse,en.utcFormat,en.utcParse;const ki=Zt(Kt),xi=ki.right,_i=(ki.left,Zt((function(t){return null===t?NaN:+t})).center,xi);function Ci(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ei(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Ai(){}var Si="\\s*([+-]?\\d+)\\s*",Ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Pi=/^#([0-9a-f]{3,8})$/,Ri=new RegExp(`^rgb\\(${Si},${Si},${Si}\\)$`),Li=new RegExp(`^rgb\\(${Mi},${Mi},${Mi}\\)$`),Di=new RegExp(`^rgba\\(${Si},${Si},${Si},${Ti}\\)$`),Ni=new RegExp(`^rgba\\(${Mi},${Mi},${Mi},${Ti}\\)$`),Ii=new RegExp(`^hsl\\(${Ti},${Mi},${Mi}\\)$`),Fi=new RegExp(`^hsla\\(${Ti},${Mi},${Mi},${Ti}\\)$`),Ui={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Oi(){return this.rgb().formatHex()}function $i(){return this.rgb().formatRgb()}function Hi(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Pi.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ji(e):3===n?new Vi(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Bi(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Bi(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ri.exec(t))?new Vi(e[1],e[2],e[3],1):(e=Li.exec(t))?new Vi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Di.exec(t))?Bi(e[1],e[2],e[3],e[4]):(e=Ni.exec(t))?Bi(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ii.exec(t))?Ki(e[1],e[2]/100,e[3]/100,1):(e=Fi.exec(t))?Ki(e[1],e[2]/100,e[3]/100,e[4]):Ui.hasOwnProperty(t)?ji(Ui[t]):"transparent"===t?new Vi(NaN,NaN,NaN,0):null}function ji(t){return new Vi(t>>16&255,t>>8&255,255&t,1)}function Bi(t,e,n,i){return i<=0&&(t=e=n=NaN),new Vi(t,e,n,i)}function qi(t){return t instanceof Ai||(t=Hi(t)),t?new Vi((t=t.rgb()).r,t.g,t.b,t.opacity):new Vi}function Ji(t,e,n,i){return 1===arguments.length?qi(t):new Vi(t,e,n,null==i?1:i)}function Vi(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Wi(){return`#${Gi(this.r)}${Gi(this.g)}${Gi(this.b)}`}function zi(){const t=Yi(this.opacity);return`${1===t?"rgb(":"rgba("}${Xi(this.r)}, ${Xi(this.g)}, ${Xi(this.b)}${1===t?")":`, ${t})`}`}function Yi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Xi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Gi(t){return((t=Xi(t))<16?"0":"")+t.toString(16)}function Ki(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Qi(t,e,n,i)}function Zi(t){if(t instanceof Qi)return new Qi(t.h,t.s,t.l,t.opacity);if(t instanceof Ai||(t=Hi(t)),!t)return new Qi;if(t instanceof Qi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=e===s?(n-i)/a+6*(n0&&l<1?0:o,new Qi(o,a,l,t.opacity)}function Qi(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function tr(t){return(t=(t||0)%360)<0?t+360:t}function er(t){return Math.max(0,Math.min(1,t||0))}function nr(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function ir(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}Ci(Ai,Hi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Oi,formatHex:Oi,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Zi(this).formatHsl()},formatRgb:$i,toString:$i}),Ci(Vi,Ji,Ei(Ai,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Vi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Vi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Vi(Xi(this.r),Xi(this.g),Xi(this.b),Yi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Wi,formatHex:Wi,formatHex8:function(){return`#${Gi(this.r)}${Gi(this.g)}${Gi(this.b)}${Gi(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:zi,toString:zi})),Ci(Qi,(function(t,e,n,i){return 1===arguments.length?Zi(t):new Qi(t,e,n,null==i?1:i)}),Ei(Ai,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Qi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Qi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Vi(nr(t>=240?t-240:t+120,r,i),nr(t,r,i),nr(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Qi(tr(this.h),er(this.s),er(this.l),Yi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Yi(this.opacity);return`${1===t?"hsl(":"hsla("}${tr(this.h)}, ${100*er(this.s)}%, ${100*er(this.l)}%${1===t?")":`, ${t})`}`}}));const rr=t=>()=>t;function sr(t,e){return function(n){return t+n*e}}function or(t){return 1==(t=+t)?ar:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):rr(isNaN(e)?n:e)}}function ar(t,e){var n=e-t;return n?sr(t,n):rr(isNaN(t)?e:t)}const lr=function t(e){var n=or(e);function i(t,e){var i=n((t=Ji(t)).r,(e=Ji(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),o=ar(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function hr(t){return function(e){var n,i,r=e.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1],o=i>0?t[i-1]:2*r-s,a=is&&(r=e.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:dr(n,i)})),s=gr.lastIndex;return se&&(n=t,t=e,e=n),h=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?Er:Cr,r=s=null,c}function c(e){return null==e||isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(h(e)))}return c.invert=function(n){return h(e((s||(s=i(a,o.map(t),dr)))(n)))},c.domain=function(t){return arguments.length?(o=Array.from(t,wr),u()):o.slice()},c.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},c.rangeRound=function(t){return a=Array.from(t),l=yr,u()},c.clamp=function(t){return arguments.length?(h=!!t||xr,u()):h!==xr},c.interpolate=function(t){return arguments.length?(l=t,u()):l},c.unknown=function(t){return arguments.length?(n=t,c):n},function(n,i){return t=n,e=i,u()}}function Tr(){return Sr()(xr,xr)}function Mr(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Pr(t){return new Date(t)}function Rr(t){return t instanceof Date?+t:+new Date(+t)}function Lr(t,e,n,i,r,s,o,a,l,h){var u=Tr(),c=u.invert,d=u.domain,f=h(".%L"),p=h(":%S"),g=h("%I:%M"),m=h("%I %p"),v=h("%a %d"),b=h("%b %d"),y=h("%B"),w=h("%Y");function k(t){return(l(t)=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ir(t){if(!(e=Nr.exec(t)))throw new Error("invalid format: "+t);var e;return new Fr({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Fr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ur(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Or(t){return(t=Ur(Math.abs(t)))?t[1]:NaN}function $r(t,e){var n=Ur(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Ir.prototype=Fr.prototype,Fr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Hr={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>$r(100*t,e),r:$r,s:function(t,e){var n=Ur(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(Dr=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Ur(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function jr(t){return t}var Br,qr,Jr,Vr=Array.prototype.map,Wr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zr(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?jr:(e=Vr.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?jr:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Vr.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",h=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=Ir(t)).fill,n=t.align,c=t.sign,d=t.symbol,f=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,b=t.type;"n"===b?(g=!0,b="g"):Hr[b]||(void 0===m&&(m=12),v=!0,b="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var y="$"===d?r:"#"===d&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===d?s:/[%p]/.test(b)?l:"",k=Hr[b],x=/[defgprs%]/.test(b);function _(t){var r,s,l,d=y,_=w;if("c"===b)_=k(t)+_,t="";else{var C=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:k(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),C&&0==+t&&"+"!==c&&(C=!1),d=(C?"("===c?c:h:"-"===c||"("===c?"":c)+d,_=("s"===b?Wr[8+Dr/3]:"")+_+(C&&"("===c?")":""),x)for(r=-1,s=t.length;++r(l=t.charCodeAt(r))||l>57){_=(46===l?o+t.slice(r+1):t.slice(r))+_,t=t.slice(0,r);break}}g&&!f&&(t=i(t,1/0));var E=d.length+t.length+_.length,A=E>1)+d+t+_+A.slice(E);break;default:t=A+d+t+_}return a(t)}return m=void 0===m?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),_.toString=function(){return t+""},_}return{format:c,formatPrefix:function(t,e){var n=c(((t=Ir(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Or(e)/3))),r=Math.pow(10,-i),s=Wr[8+i/3];return function(t){return n(r*t)+s}}}}function Yr(t,e,n,i){var r,s=ie(t,e,n);switch((i=Ir(null==i?",f":i)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Or(e)/3)))-Or(Math.abs(t)))}(s,o))||(i.precision=r),Jr(i,o);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Or(e)-Or(t))+1}(s,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-Or(Math.abs(t)))}(s))||(i.precision=r-2*("%"===i.type))}return qr(i)}function Xr(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,s,o,a=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((i=e0){let n=Math.round(t/o),i=Math.round(e/o);for(n*oe&&--i,s=new Array(r=i-n+1);++ae&&--i,s=new Array(r=i-n+1);++a0;){if((r=ne(l,h,n))===i)return s[o]=l,s[a]=h,e(s);if(r>0)l=Math.floor(l/r)*r,h=Math.ceil(h/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,h=Math.floor(h*r)/r}i=r}return t},t}function Gr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n=r)&&(n=r)}return n}!function(t){Br=zr(t),qr=Br.format,Jr=Br.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Kr=Math.PI,Zr=2*Kr,Qr=Zr-1e-6;function ts(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function es(){return new ts}ts.prototype=es.prototype={constructor:ts,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,s){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var s=this._x1,o=this._y1,a=n-t,l=i-e,h=s-t,u=o-e,c=h*h+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(c>1e-6)if(Math.abs(u*a-l*h)>1e-6&&r){var d=n-s,f=i-o,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),v=Math.sqrt(c),b=r*Math.tan((Kr-Math.acos((p+c-g)/(2*m*v)))/2),y=b/v,w=b/m;Math.abs(y-1)>1e-6&&(this._+="L"+(t+y*h)+","+(e+y*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>h*f)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+o,h=e+a,u=1^s,c=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+l+","+h),n&&(c<0&&(c=c%Zr+Zr),c>Qr?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=h):c>1e-6&&(this._+="A"+n+","+n+",0,"+ +(c>=Kr)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const ns=es;Array.prototype.slice;function is(t){return function(){return t}}function rs(t){this._context=t}function ss(t){return new rs(t)}function os(t){return t[0]}function as(t){return t[1]}function ls(t,e){var n=is(!0),i=null,r=ss,s=null;function o(o){var a,l,h,u=(o=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(o)).length,c=!1;for(null==i&&(s=r(h=ns())),a=0;a<=u;++a)!(ae?1:t>=e?0:NaN}ks.prototype={constructor:ks,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Ts="http://www.w3.org/1999/xhtml";const Ms={svg:"http://www.w3.org/2000/svg",xhtml:Ts,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ps(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Ms.hasOwnProperty(e)?{space:Ms[e],local:t}:t}function Rs(t){return function(){this.removeAttribute(t)}}function Ls(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ds(t,e){return function(){this.setAttribute(t,e)}}function Ns(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Is(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Fs(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Us(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Os(t){return function(){this.style.removeProperty(t)}}function $s(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Hs(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function js(t,e){return t.style.getPropertyValue(e)||Us(t).getComputedStyle(t,null).getPropertyValue(e)}function Bs(t){return function(){delete this[t]}}function qs(t,e){return function(){this[t]=e}}function Js(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Vs(t){return t.trim().split(/^|\s+/)}function Ws(t){return t.classList||new zs(t)}function zs(t){this._node=t,this._names=Vs(t.getAttribute("class")||"")}function Ys(t,e){for(var n=Ws(t),i=-1,r=e.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function mo(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ko=[null];function xo(t,e){this._groups=t,this._parents=e}function _o(){return new xo([[document.documentElement]],ko)}xo.prototype=_o.prototype={constructor:xo,select:function(t){"function"!=typeof t&&(t=us(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=k&&(k=w+1);!(y=m[k])&&++k=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Ss);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s1?this.each((null==e?Os:"function"==typeof e?Hs:$s)(t,e,null==n?"":n)):js(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Bs:"function"==typeof e?Js:qs)(t,e)):this.node()[t]},classed:function(t,e){var n=Vs(t+"");if(arguments.length<2){for(var i=Ws(this.node()),r=-1,s=n.length;++r{}};function Ao(){for(var t,e=0,n=arguments.length,i={};e=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Mo(t,e){for(var n,i=0,r=t.length;i0)for(var n,i,r=new Array(n),s=0;s=0&&e._call.call(void 0,t),e=e._next;--No}()}finally{No=0,function(){var t,e,n=Lo,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Lo=e);Do=t,Yo(i)}(),Oo=0}}function zo(){var t=Ho.now(),e=t-Uo;e>1e3&&($o-=e,Uo=t)}function Yo(t){No||(Io&&(Io=clearTimeout(Io)),t-Oo>24?(t<1/0&&(Io=setTimeout(Wo,t-Ho.now()-$o)),Fo&&(Fo=clearInterval(Fo))):(Fo||(Uo=Ho.now(),Fo=setInterval(zo,1e3)),No=1,jo(Wo)))}function Xo(t,e,n){var i=new Jo;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i}Jo.prototype=Vo.prototype={constructor:Jo,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Bo():+n)+(null==e?0:+e),this._next||Do===this||(Do?Do._next=this:Lo=this,Do=this),this._call=t,this._time=n,Yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yo())}};var Go=Ro("start","end","cancel","interrupt"),Ko=[];function Zo(t,e,n,i,r,s){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(l){var h,u,c,d;if(1!==n.state)return a();for(h in r)if((d=r[h]).name===n.name){if(3===d.state)return Xo(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[h]):+h0)throw new Error("too late; already scheduled");return n}function ta(t,e){var n=ea(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ea(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var na,ia=180/Math.PI,ra={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function sa(t,e,n,i,r,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:dr(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,o.rotate,a,l),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:dr(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,o.skewX,a,l),function(t,e,n,i,s,o){if(t!==n||e!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:dr(t,n)},{i:a-2,x:dr(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(t){for(var e,n=-1,i=l.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qo:ta;return function(){var o=s(this,t),a=o.on;a!==i&&(r=(i=a).copy()).on(e,n),o.on=r}}var Ma=Co.prototype.constructor;function Pa(t){return function(){this.style.removeProperty(t)}}function Ra(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function La(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&Ra(t,s,n)),i}return s._value=e,s}function Da(t){return function(e){this.textContent=t.call(this,e)}}function Na(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Da(i)),e}return i._value=t,i}var Ia=0;function Fa(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ua(){return++Ia}var Oa=Co.prototype;Fa.prototype=function(t){return Co().transition(t)}.prototype={constructor:Fa,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=us(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o=e&&(n=i=e):(n>e&&(n=e),i=s&&(n=i=s):(n>s&&(n=s),i2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):o=!1;o&&delete t.__transition}}(this,t)}))},Co.prototype.transition=function(t){var e,n;t instanceof Fa?(e=t._id,t=t._name):(e=Ua(),(n=$a).time=Bo(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,s=0;s{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}isProfileEnabled(){return"true"===this.sessionStorage.getItem("phx:live-socket:profiling")}isDebugEnabled(){return"true"===this.sessionStorage.getItem(B)}isDebugDisabled(){return"false"===this.sessionStorage.getItem(B)}enableDebug(){this.sessionStorage.setItem(B,"true")}enableProfiling(){this.sessionStorage.setItem("phx:live-socket:profiling","true")}disableDebug(){this.sessionStorage.setItem(B,"false")}disableProfiling(){this.sessionStorage.removeItem("phx:live-socket:profiling")}enableLatencySim(t){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem("phx:live-socket:latency-sim",t)}disableLatencySim(){this.sessionStorage.removeItem("phx:live-socket:latency-sim")}getLatencySim(){let t=this.sessionStorage.getItem("phx:live-socket:latency-sim");return t?parseInt(t):null}getSocket(){return this.socket}connect(){"localhost"!==window.location.hostname||this.isDebugDisabled()||this.enableDebug();let t=()=>{this.joinRootViews()?(this.bindTopLevelEvents(),this.socket.connect()):this.main?this.socket.connect():this.bindTopLevelEvents({dead:!0}),this.joinDeadView()};["complete","loaded","interactive"].indexOf(document.readyState)>=0?t():document.addEventListener("DOMContentLoaded",()=>t())}disconnect(t){clearTimeout(this.reloadWithJitterTimer),this.socket.disconnect(t)}replaceTransport(t){clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(t),this.connect()}execJS(t,e,n=null){this.owner(t,i=>ht.exec(n,e,i,t))}execJSHookPush(t,e,n,i){this.withinOwners(t,r=>{ht.exec("hook",e,r,t,["push",{data:n,callback:i}])})}unload(){this.unloaded||(this.main&&this.isConnected()&&this.log(this.main,"socket",()=>["disconnect for page nav"]),this.unloaded=!0,this.destroyAllViews(),this.disconnect())}triggerDOM(t,e){this.domCallbacks[t](...e)}time(t,e){if(!this.isProfileEnabled()||!console.time)return e();console.time(t);let n=e();return console.timeEnd(t),n}log(t,e,n){if(this.viewLogger){let[i,r]=n();this.viewLogger(t,e,i,r)}else if(this.isDebugEnabled()){let[i,r]=n();((t,e,n,i)=>{t.liveSocket.isDebugEnabled()&&console.log(`${t.id} ${e}: ${n} - `,i)})(t,e,i,r)}}requestDOMUpdate(t){this.transitions.after(t)}transition(t,e,n=function(){}){this.transitions.addTransition(t,e,n)}onChannel(t,e,n){t.on(e,t=>{let e=this.getLatencySim();e?setTimeout(()=>n(t),e):n(t)})}wrapPush(t,e,n){let i=this.getLatencySim(),r=t.joinCount;if(!i)return this.isConnected()&&e.timeout?n().receive("timeout",()=>{t.joinCount!==r||t.isDestroyed()||this.reloadWithJitter(t,()=>{this.log(t,"timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})}):n();let s={receives:[],receive(t,e){this.receives.push([t,e])}};return setTimeout(()=>{t.isDestroyed()||s.receives.reduce((t,[e,n])=>t.receive(e,n),n())},i),s}reloadWithJitter(t,e){clearTimeout(this.reloadWithJitterTimer),this.disconnect();let n=this.reloadJitterMin,i=this.reloadJitterMax,r=Math.floor(Math.random()*(i-n+1))+n,s=ot.updateLocal(this.localStorage,window.location.pathname,"consecutive-reloads",0,t=>t+1);s>this.maxReloads&&(r=this.failsafeJitter),this.reloadWithJitterTimer=setTimeout(()=>{t.isDestroyed()||t.isConnected()||(t.destroy(),e?e():this.log(t,"join",()=>[`encountered ${s} consecutive reloads`]),s>this.maxReloads&&this.log(t,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]),this.hasPendingLink()?window.location=this.pendingLink:window.location.reload())},r)}getHookCallbacks(t){return t&&t.startsWith("Phoenix.")?xt[t.split(".")[1]]:this.hooks[t]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(t){return`${this.getBindingPrefix()}${t}`}channel(t,e){return this.socket.channel(t,e)}joinDeadView(){let t=document.body;if(t&&!this.isPhxView(t)&&!this.isPhxView(document.firstElementChild)){let e=this.newRootView(t);e.setHref(this.getHref()),e.joinDead(),this.main||(this.main=e),window.requestAnimationFrame(()=>e.execNewMounted())}}joinRootViews(){let t=!1;return ct.all(document,`${$}:not([${N}])`,e=>{if(!this.getRootById(e.id)){let t=this.newRootView(e);t.setHref(this.getHref()),t.join(),e.hasAttribute("data-phx-main")&&(this.main=t)}t=!0}),t}redirect(t,e){this.unload(),ot.redirect(t,e)}replaceMain(t,e,n=null,i=this.setPendingLink(t)){let r=this.currentLocation.href;this.outgoingMainEl=this.outgoingMainEl||this.main.el;let s=ct.cloneNode(this.outgoingMainEl,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(s,e,r),this.main.setRedirect(t),this.transitionRemoves(null,!0),this.main.join((t,e)=>{1===t&&this.commitPendingLink(i)&&this.requestDOMUpdate(()=>{ct.findPhxSticky(document).forEach(t=>s.appendChild(t)),this.outgoingMainEl.replaceWith(s),this.outgoingMainEl=null,n&&n(i),e()})})}transitionRemoves(t,e){let n=this.binding("remove");if(t=t||ct.all(document,`[${n}]`),e){const e=ct.findPhxSticky(document)||[];t=t.filter(t=>!ct.isChildOfAny(t,e))}t.forEach(t=>{this.execJS(t,t.getAttribute(n),"remove")})}isPhxView(t){return t.getAttribute&&null!==t.getAttribute(O)}newRootView(t,e,n){let i=new Bt(t,this,null,e,n);return this.roots[i.id]=i,i}owner(t,e){let n=it(t.closest($),t=>this.getViewByEl(t))||this.main;n&&e(n)}withinOwners(t,e){this.owner(t,n=>e(n,t))}getViewByEl(t){let e=t.getAttribute(I);return it(this.getRootById(e),e=>e.getDescendentByEl(t))}getRootById(t){return this.roots[t]}destroyAllViews(){for(let t in this.roots)this.roots[t].destroy(),delete this.roots[t];this.main=null}destroyViewByEl(t){let e=this.getRootById(t.getAttribute(I));e&&e.id===t.id?(e.destroy(),delete this.roots[e.id]):e&&e.destroyDescendent(t.id)}setActiveElement(t){if(this.activeElement===t)return;this.activeElement=t;let e=()=>{t===this.activeElement&&(this.activeElement=null),t.removeEventListener("mouseup",this),t.removeEventListener("touchend",this)};t.addEventListener("mouseup",e),t.addEventListener("touchend",e)}getActiveElement(){return document.activeElement===document.body?this.activeElement||document.activeElement:document.activeElement||document.body}dropActiveElement(t){this.prevActive&&t.ownsElement(this.prevActive)&&(this.prevActive=null)}restorePreviouslyActiveFocus(){this.prevActive&&this.prevActive!==document.body&&this.prevActive.focus()}blurActiveElement(){this.prevActive=this.getActiveElement(),this.prevActive!==document.body&&this.prevActive.blur()}bindTopLevelEvents({dead:t}={}){this.boundTopLevelEvents||(this.boundTopLevelEvents=!0,this.socket.onClose(t=>{if(t&&1e3===t.code&&this.main)return this.reloadWithJitter(this.main)}),document.body.addEventListener("click",(function(){})),window.addEventListener("pageshow",t=>{t.persisted&&(this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())},!0),t||this.bindNav(),this.bindClicks(),t||this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(t,e,n,i,r,s)=>{let o=i.getAttribute(this.binding("key")),a=t.key&&t.key.toLowerCase();if(o&&o.toLowerCase()!==a)return;let l={key:t.key,...this.eventMeta(e,t,i)};ht.exec(e,r,n,i,["push",{data:l}])}),this.bind({blur:"focusout",focus:"focusin"},(t,e,n,i,r,s)=>{if(!s){let s={key:t.key,...this.eventMeta(e,t,i)};ht.exec(e,r,n,i,["push",{data:s}])}}),this.bind({blur:"blur",focus:"focus"},(t,e,n,i,r,s)=>{if("window"===s){let s=this.eventMeta(e,t,i);ht.exec(e,r,n,i,["push",{data:s}])}}),window.addEventListener("dragover",t=>t.preventDefault()),window.addEventListener("drop",t=>{t.preventDefault();let e=it(tt(t.target,this.binding("drop-target")),t=>t.getAttribute(this.binding("drop-target"))),n=e&&document.getElementById(e),i=Array.from(t.dataTransfer.files||[]);n&&!n.disabled&&0!==i.length&&n.files instanceof FileList&&(pt.trackFiles(n,i,t.dataTransfer),n.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on("track-uploads",t=>{let e=t.target;if(!ct.isUploadInput(e))return;let n=Array.from(t.detail.files||[]).filter(t=>t instanceof File||t instanceof Blob);pt.trackFiles(e,n),e.dispatchEvent(new Event("input",{bubbles:!0}))}))}eventMeta(t,e,n){let i=this.metadataCallbacks[t];return i?i(e,n):{}}setPendingLink(t){return this.linkRef++,this.pendingLink=t,this.linkRef}commitPendingLink(t){return this.linkRef===t&&(this.href=this.pendingLink,this.pendingLink=null,!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(t,e){for(let n in t){let i=t[n];this.on(i,t=>{let r=this.binding(n),s=this.binding("window-"+n),o=t.target.getAttribute&&t.target.getAttribute(r);o?this.debounce(t.target,t,i,()=>{this.withinOwners(t.target,i=>{e(t,n,i,t.target,o,null)})}):ct.all(document,`[${s}]`,r=>{let o=r.getAttribute(s);this.debounce(r,t,i,()=>{this.withinOwners(r,i=>{e(t,n,i,r,o,"window")})})})})}}bindClicks(){window.addEventListener("mousedown",t=>this.clickStartedAtTarget=t.target),this.bindClick("click","click",!1),this.bindClick("mousedown","capture-click",!0)}bindClick(t,e,n){let i=this.binding(e);window.addEventListener(t,t=>{let e=null;if(n)e=t.target.matches(`[${i}]`)?t.target:t.target.querySelector(`[${i}]`);else{0===t.detail&&(this.clickStartedAtTarget=t.target);let n=this.clickStartedAtTarget||t.target;e=tt(n,i),this.dispatchClickAway(t,n),this.clickStartedAtTarget=null}let r=e&&e.getAttribute(i);r?("#"===e.getAttribute("href")&&t.preventDefault(),e.hasAttribute(R)||this.debounce(e,t,"click",()=>{this.withinOwners(e,n=>{ht.exec("click",r,n,e,["push",{data:this.eventMeta("click",t,e)}])})})):!n&&ct.isNewPageClick(t,window.location)&&this.unload()},n)}dispatchClickAway(t,e){let n=this.binding("click-away");ct.all(document,`[${n}]`,i=>{i.isSameNode(e)||i.contains(e)||this.withinOwners(i,e=>{let r=i.getAttribute(n);ht.isVisible(i)&&ht.isInViewport(i)&&ht.exec("click",r,e,i,["push",{data:this.eventMeta("click",t,t.target)}])})})}bindNav(){if(!ot.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let t=null;window.addEventListener("scroll",e=>{clearTimeout(t),t=setTimeout(()=>{ot.updateCurrentState(t=>Object.assign(t,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",t=>{if(!this.registerNewLocation(window.location))return;let{type:e,id:n,root:i,scroll:r}=t.state||{},s=window.location.href;ct.dispatchEvent(window,"phx:navigate",{detail:{href:s,patch:"patch"===e,pop:!0}}),this.requestDOMUpdate(()=>{this.main.isConnected()&&"patch"===e&&n===this.main.id?this.main.pushLinkPatch(s,null,()=>{this.maybeScroll(r)}):this.replaceMain(s,null,()=>{i&&this.replaceRootHistory(),this.maybeScroll(r)})})},!1),window.addEventListener("click",t=>{let e=tt(t.target,"data-phx-link"),n=e&&e.getAttribute("data-phx-link");if(!n||!this.isConnected()||!this.main||ct.wantsNewTab(t))return;let i=e.href instanceof SVGAnimatedString?e.href.baseVal:e.href,r=e.getAttribute("data-phx-link-state");t.preventDefault(),t.stopImmediatePropagation(),this.pendingLink!==i&&this.requestDOMUpdate(()=>{if("patch"===n)this.pushHistoryPatch(i,r,e);else{if("redirect"!==n)throw new Error('expected data-phx-link to be "patch" or "redirect", got: '+n);this.historyRedirect(i,r)}let t=e.getAttribute(this.binding("click"));t&&this.requestDOMUpdate(()=>this.execJS(e,t,"click"))})},!1)}maybeScroll(t){"number"==typeof t&&requestAnimationFrame(()=>{window.scrollTo(0,t)})}dispatchEvent(t,e={}){ct.dispatchEvent(window,"phx:"+t,{detail:e})}dispatchEvents(t){t.forEach(([t,e])=>this.dispatchEvent(t,e))}withPageLoading(t,e){ct.dispatchEvent(window,"phx:page-loading-start",{detail:t});let n=()=>ct.dispatchEvent(window,"phx:page-loading-stop",{detail:t});return e?e(n):n}pushHistoryPatch(t,e,n){if(!this.isConnected()||!this.main.isMain())return ot.redirect(t);this.withPageLoading({to:t,kind:"patch"},i=>{this.main.pushLinkPatch(t,n,n=>{this.historyPatch(t,e,n),i()})})}historyPatch(t,e,n=this.setPendingLink(t)){this.commitPendingLink(n)&&(ot.pushState(e,{type:"patch",id:this.main.id},t),ct.dispatchEvent(window,"phx:navigate",{detail:{patch:!0,href:t,pop:!1}}),this.registerNewLocation(window.location))}historyRedirect(t,e,n){if(!this.isConnected()||!this.main.isMain())return ot.redirect(t,n);if(/^\/$|^\/[^\/]+.*$/.test(t)){let{protocol:e,host:n}=window.location;t=`${e}//${n}${t}`}let i=window.scrollY;this.withPageLoading({to:t,kind:"redirect"},r=>{this.replaceMain(t,n,n=>{n===this.linkRef&&(ot.pushState(e,{type:"redirect",id:this.main.id,scroll:i},t),ct.dispatchEvent(window,"phx:navigate",{detail:{href:t,patch:!1,pop:!1}}),this.registerNewLocation(window.location)),r()})})}replaceRootHistory(){ot.pushState("replace",{root:!0,type:"patch",id:this.main.id})}registerNewLocation(t){let{pathname:e,search:n}=this.currentLocation;return e+n!==t.pathname+t.search&&(this.currentLocation=Q(t),!0)}bindForms(){let t=0,e=!1;this.on("submit",t=>{let n=t.target.getAttribute(this.binding("submit")),i=t.target.getAttribute(this.binding("change"));e||!i||n||(e=!0,t.preventDefault(),this.withinOwners(t.target,e=>{e.disableForm(t.target),window.requestAnimationFrame(()=>{ct.isUnloadableFormSubmit(t)&&this.unload(),t.target.submit()})}))},!0),this.on("submit",t=>{let e=t.target.getAttribute(this.binding("submit"));e?(t.preventDefault(),t.target.disabled=!0,this.withinOwners(t.target,n=>{ht.exec("submit",e,n,t.target,["push",{submitter:t.submitter}])})):ct.isUnloadableFormSubmit(t)&&this.unload()},!1);for(let e of["change","input"])this.on(e,n=>{let i=this.binding("change"),r=n.target,s=r.getAttribute(i),o=r.form&&r.form.getAttribute(i),a=s||o;if(!a)return;if("number"===r.type&&r.validity&&r.validity.badInput)return;let l=s?r:r.form,h=t;t++;let{at:u,type:c}=ct.private(r,"prev-iteration")||{};u===h-1&&"change"===e&&"input"===c||(ct.putPrivate(r,"prev-iteration",{at:h,type:e}),this.debounce(r,n,e,()=>{this.withinOwners(l,t=>{ct.putPrivate(r,"phx-has-focused",!0),ct.isTextualInput(r)||this.setActiveElement(r),ht.exec("change",a,t,r,["push",{_target:n.target.name,dispatcher:l}])})}))},!1);this.on("reset",t=>{let e=t.target;ct.resetForm(e,this.binding("feedback-for"),this.binding("feedback-group"));let n=Array.from(e.elements).find(t=>"reset"===t.type);n&&window.requestAnimationFrame(()=>{n.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))})})}debounce(t,e,n,i){if("blur"===n||"focusout"===n)return i();let r=this.binding("debounce"),s=this.binding("throttle"),o=this.defaults.debounce.toString(),a=this.defaults.throttle.toString();this.withinOwners(t,n=>{ct.debounce(t,e,r,o,s,a,()=>!n.isDestroyed()&&document.body.contains(t),()=>{i()})})}silenceEvents(t){this.silenced=!0,t(),this.silenced=!1}on(t,e){window.addEventListener(t,t=>{this.silenced||e(t)})}}(Ya,class{constructor(e,n={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=n.timeout||1e4,this.transport=n.transport||r.WebSocket||E,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=n.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=n.sessionStorage||r.sessionStorage,this.establishedConnections=0,this.defaultEncoder=A.encode.bind(A),this.defaultDecoder=A.decode.bind(A),this.closeWasClean=!1,this.binaryType=n.binaryType||"arraybuffer",this.connectClock=1,this.transport!==E?(this.encode=n.encode||this.defaultEncoder,this.decode=n.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let s=null;i&&i.addEventListener&&(i.addEventListener("pagehide",t=>{this.conn&&(this.disconnect(),s=this.connectClock)}),i.addEventListener("pageshow",t=>{s===this.connectClock&&(s=null,this.connect())})),this.heartbeatIntervalMs=n.heartbeatIntervalMs||3e4,this.rejoinAfterMs=t=>n.rejoinAfterMs?n.rejoinAfterMs(t):[1e3,2e3,5e3][t-1]||1e4,this.reconnectAfterMs=t=>n.reconnectAfterMs?n.reconnectAfterMs(t):[10,50,100,150,200,250,500,1e3,2e3][t-1]||5e3,this.logger=n.logger||null,!this.logger&&n.debug&&(this.logger=(t,e,n)=>{console.log(`${t}: ${e}`,n)}),this.longpollerTimeout=n.longpollerTimeout||2e4,this.params=t(n.params||{}),this.endPoint=`${e}/${w}`,this.vsn=n.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new _(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs)}getLongPollTransport(){return E}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=C.appendParams(C.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==t.charAt(0)?t:"/"===t.charAt(1)?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(t,e,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=t(e)),this.conn||(this.longPollFallbackMs&&this.transport!==E?this.connectWithFallback(E,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}hasLogger(){return null!==this.logger}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let i=this.onMessage(r=>{r.ref===e&&(this.off([i]),t(Date.now()-n))});return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let n,i=!1,r=!0,s=e=>{this.log("transport",`falling back to ${t.name}...`,e),this.off([void 0,n]),r=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession("phx:fallback:"+t.name))return s("memorized");this.fallbackTimer=setTimeout(s,e),n=this.onError(t=>{this.log("transport","error",t),r&&!i&&(clearTimeout(this.fallbackTimer),s(t))}),this.onOpen(()=>{if(i=!0,!r)return this.primaryPassedHealthCheck||this.storeSession("phx:fallback:"+t.name,"true"),this.log("transport",`established ${t.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(s,e),this.ping(t=>{this.log("transport","connected to primary after",t),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,t])=>t())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();this.waitForBufferDone(()=>{this.conn&&(e?this.conn.close(e,n||""):this.conn.close()),this.waitForSocketClosed(()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e=1){5!==e&&this.conn&&this.conn.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(t,e+1)},150*e):t()}waitForSocketClosed(t,e=1){5!==e&&this.conn&&this.conn.readyState!==l?setTimeout(()=>{this.waitForSocketClosed(t,e+1)},150*e):t()}onConnClose(t){let e=t&&t.code;this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===e||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,e])=>e(t))}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,i])=>{i(t,e,n)}),(e===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(g)})}connectionState(){switch(this.conn&&this.conn.readyState){case s:return"connecting";case o:return"open";case a:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([e])=>-1===t.indexOf(e))}channel(e,n={}){let i=new class{constructor(e,n,i){this.state=h,this.topic=e,this.params=t(n||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new x(this,m,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new _(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=c,this.rejoinTimer.reset(),this.pushBuffer.forEach(t=>t.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=u,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=h,this.socket.remove(this)}),this.onError(t=>{this.socket.hasLogger()&&this.socket.log("channel","error "+this.topic,t),this.isJoining()&&this.joinPush.reset(),this.state=u,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new x(this,b,t({}),this.timeout).send(),this.state=u,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(v,(t,e)=>{this.trigger(this.replyEventName(e),t)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(t){this.on(p,t)}onError(t){return this.on(g,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(void 0===e||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let i=new x(this,t,(function(){return e}),n);return this.canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=f;let n=()=>{this.socket.hasLogger()&&this.socket.log("channel","leave "+this.topic),this.trigger(p,"leave")},i=new x(this,b,t({}),e);return i.receive("ok",()=>n()).receive("timeout",()=>n()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(t,e,n){return e}isMember(t,e,n,i){return this.topic===t&&(!i||i===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:i}),!1))}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=d,this.joinPush.resend(t))}trigger(t,e,n,i){let r=this.onMessage(t,e,n,i);if(e&&!r)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(e=>e.event===t);for(let t=0;tthis.conn.send(t)):this.sendBuffer.push(()=>this.encode(t,t=>this.conn.send(t)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,t=>{let{topic:e,event:n,payload:i,ref:r,join_ref:s}=t;r&&r===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${i.status||""} ${e} ${n} ${r&&"("+r+")"||""}`,i);for(let t=0;te.topic===t&&(e.isJoined()||e.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}},{params:{_csrf_token:za},hooks:{Table:{mounted:function(){var t=this.el,e=t.querySelector(".js-hidden-submit"),n=t.querySelector(".js-submit-button");t.querySelector(".js-select-all-rows").addEventListener("change",(function(){var e=this;t.querySelectorAll(".js-select-row").forEach((function(t){t.checked=e.checked}))})),t.querySelectorAll(".js-action").forEach((function(t){t.addEventListener("click",(function(){e.value=this.dataset.name,n.click()}))}))}},RealtimePlot:Ba,HistoricalPlot:qa,Refresh:Ja,Timestamp:Wa}});T().config({barColors:{0:"#B5179E"},shadowColor:"rgba(0, 0, 0, .3)"}),window.addEventListener("phx:page-loading-start",(function(t){return T().show()})),window.addEventListener("phx:page-loading-stop",(function(t){return T().hide()})),Xa.connect(),window.liveSocket=Xa})()})(); \ No newline at end of file diff --git a/shell.nix b/shell.nix index 135d235..d9695aa 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,5 @@ { pkgs ? import { } }: pkgs.mkShell { nativeBuildInputs = - [ pkgs.nodejs-18_x pkgs.beam.packages.erlangR25.elixir_1_14 ]; + [ pkgs.nodejs-18_x pkgs.beam.packages.erlangR26.elixir_1_16 ]; } diff --git a/test/exq_ui_web/live/queue_live/index_test.exs b/test/exq_ui_web/live/queue_live/index_test.exs index c5c6d56..3abcbc6 100644 --- a/test/exq_ui_web/live/queue_live/index_test.exs +++ b/test/exq_ui_web/live/queue_live/index_test.exs @@ -5,7 +5,7 @@ defmodule ExqUIWeb.QueueLive.IndexTest do {:ok, view, _} = live(conn, "/queues") html = render(view) - assert html =~ ~r/hard.*1.*Delete/ + assert html =~ ~r/hard.*1.*Delete/s html = element( @@ -15,7 +15,7 @@ defmodule ExqUIWeb.QueueLive.IndexTest do ) |> render_click() - refute html =~ ~r/hard.*1.*Delete/ + refute html =~ ~r/hard.*1.*Delete/s end test "view single queue", %{conn: conn} do