diff --git a/Plotly.Blazor.Examples/App.razor b/Plotly.Blazor.Examples/App.razor index 2f2bf7a6..4a1ff0f5 100644 --- a/Plotly.Blazor.Examples/App.razor +++ b/Plotly.Blazor.Examples/App.razor @@ -1,16 +1,150 @@ - - - - - - - Not found - -

Sorry, there's nothing at this address.

-
-
-
+ + + + + + + + Not found + +

Sorry, there's nothing at this address.

+
+
+
+ + + + +
- - - \ No newline at end of file +@code +{ + public MudTheme Theme { get; set; } = new() + { + Palette = new PaletteLight + { + Black = "#272c34ff", + Primary = "#0078d7", + Secondary = "#FEB16B", + Success = "#A4D266", + Warning = "#FEB16B", + Dark = "#303030", + Info = "#4889CD", + Error = "#EA4F52", + Surface = "#f0f0f0", + Background = "#f0f0f0", + BackgroundGrey = "#f5f5f5ff", + DrawerBackground = "#f0f0f0", + DrawerText = "#424242ff", + DrawerIcon = "#616161ff", + AppbarBackground = "#0078d7", + AppbarText = "#ffffffff", + TextPrimary = "#424242ff", + TextSecondary = "#00000089", + ActionDefault = "#00000089", + ActionDisabled = "#00000042", + ActionDisabledBackground = "#0000001e", + Divider = "#e0e0e0ff", + DividerLight = "#000000cc", + TableLines = "#e0e0e0ff", + LinesDefault = "#0000001e", + LinesInputs = "#bdbdbdff", + TextDisabled = "#00000060" + }, + PaletteDark = new PaletteDark + { + Black = "#000000", + Primary = "#54A68F", + Secondary = "#FEB16B", + Success = "#A4D266", + Warning = "#FEB16B", + Dark = "#303030", + Info = "#4889CD", + Error = "#EA4F52", + Surface = "#303030", + Background = "#212121", + BackgroundGrey = "#303030", + DrawerBackground = "#303030", + DrawerText = "#FFFFFF", + DrawerIcon = "#FFFFFF", + AppbarBackground = "#303030", + AppbarText = "#FFFFFF", + TextPrimary = "#FFFFFF", + TextSecondary = "#FFFFFF", + ActionDefault = "#adadb1", + ActionDisabled = "rgba(255,255,255, 0.26)", + ActionDisabledBackground = "rgba(255,255,255, 0.12)", + Divider = "rgba(255,255,255, 0.12)", + DividerLight = "rgba(255,255,255, 0.06)", + TableLines = "rgba(255,255,255, 0.12)", + LinesDefault = "rgba(255,255,255, 0.12)", + LinesInputs = "rgba(255,255,255, 0.3)", + TextDisabled = "rgba(255,255,255, 0.2)" + }, + Typography = new Typography + { + Default = new Default + { + FontSize = "1em" + }, + Body1 = new Body1 + { + FontSize = "1em" + }, + Body2 = new Body2 + { + FontSize = ".83em" + }, + Caption = new Caption + { + FontSize = "1.12em", + FontWeight = 550 + }, + Overline = new Overline + { + FontSize = "1.12em", + FontWeight = 550 + }, + H1 = new H1 + { + FontSize = "2em", + FontWeight = 700 + }, + H2 = new H2 + { + FontSize = "1.5em", + FontWeight = 650 + }, + H3 = new H3 + { + FontSize = "1.17em", + FontWeight = 600 + }, + H4 = new H4 + { + FontSize = "1.12em", + FontWeight = 550 + }, + H5 = new H5 + { + FontSize = ".83em", + FontWeight = 500 + }, + H6 = new H6 + { + FontSize = ".75em", + FontWeight = 450 + }, + Subtitle1 = new Subtitle1 + { + FontSize = "3em", + FontWeight = 650 + }, + Subtitle2 = new Subtitle2 + { + FontSize = "1.17em", + FontWeight = 600 + } + } + }; +} diff --git a/Plotly.Blazor.Examples/Components/BarChart.razor b/Plotly.Blazor.Examples/Components/BarChart.razor index 0d3b81fe..1eb241bd 100644 --- a/Plotly.Blazor.Examples/Components/BarChart.razor +++ b/Plotly.Blazor.Examples/Components/BarChart.razor @@ -1,38 +1,55 @@ @using Plotly.Blazor.LayoutLib - + @code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } - Config config = new Config - { - Responsive = true - }; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Layout layout = new Layout + /// + protected override void OnInitialized() { - Title = new Title + config = new Config { - Text = "Bar" - }, - BarMode = BarModeEnum.Stack, - Height = 500 - }; + Responsive = true + }; - List data = new List - { - new Bar + layout = new Layout { - X = new List {"giraffes", "orangutans", "monkeys"}, - Y = new List {20, 14, 23}, - Name = "SF Zoo" - }, - new Bar + Title = new Title + { + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, + BarMode = BarModeEnum.Stack + }; + + data = new List { - X = new List {"giraffes", "orangutans", "monkeys"}, - Y = new List {12, 18, 29}, - Name = "LA Zoo" - } - }; + new Bar + { + X = new List { "giraffes", "orangutans", "monkeys" }, + Y = new List { 20, 14, 23 }, + Name = "SF Zoo" + }, + new Bar + { + X = new List { "giraffes", "orangutans", "monkeys" }, + Y = new List { 12, 18, 29 }, + Name = "LA Zoo" + } + }; + + base.OnInitialized(); + } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/BoxChart.razor b/Plotly.Blazor.Examples/Components/BoxChart.razor index ebec6a3b..02193883 100644 --- a/Plotly.Blazor.Examples/Components/BoxChart.razor +++ b/Plotly.Blazor.Examples/Components/BoxChart.razor @@ -1,43 +1,61 @@ @using Plotly.Blazor.LayoutLib - +@using Plotly.Blazor.Traces.BoxLib + +@code +{ + [CascadingParameter] + private MudTheme Theme { get; set; } -@code { - PlotlyChart chart; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Config config = new Config + /// + protected override void OnInitialized() { - Responsive = true - }; - - Layout layout = new Layout - { - Title = new Title + config = new Config { - Text = "Box" - }, - Height = 500 - }; + Responsive = true + }; - List data = new List - { - new Box + layout = new Layout { - Y = new List {86, 92, 77, 81, 70, 71, 72, 39, 48, 38, 6, 23, 69, 84, 60, 96, 75, 84, 84, 92, 75, 80, 47, 32, 16}, - Name = "trace 0" - }, - new Box - { - Y = new List {79, 65, 58, 49, 95, 29, 81, 38, 27, 21, 96, 68, 58, 40, 62, 30, 45, 53, 80, 83, 41, 39, 54, 50, 34}, - Name = "trace 1", - BoxMean = Traces.BoxLib.BoxMeanEnum.SD - }, - new Box + Title = new Title + { + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + } + }; + + data = new List { - Name = "trace 2", - Y = new List {31, 50, 4, 6, 54, 58, 69, 32, 40, 24, 20, 17, 33, 8, 12, 97, 0, 4, 75, 10, 43, 70, 88, 0, 17}, - BoxMean = Traces.BoxLib.BoxMeanEnum.True, - BoxPoints = Traces.BoxLib.BoxPointsEnum.All - } - }; -} + new Box + { + Y = new List { 86, 92, 77, 81, 70, 71, 72, 39, 48, 38, 6, 23, 69, 84, 60, 96, 75, 84, 84, 92, 75, 80, 47, 32, 16 }, + Name = "trace 0" + }, + new Box + { + Y = new List { 79, 65, 58, 49, 95, 29, 81, 38, 27, 21, 96, 68, 58, 40, 62, 30, 45, 53, 80, 83, 41, 39, 54, 50, 34 }, + Name = "trace 1", + BoxMean = BoxMeanEnum.SD + }, + new Box + { + Name = "trace 2", + Y = new List { 31, 50, 4, 6, 54, 58, 69, 32, 40, 24, 20, 17, 33, 8, 12, 97, 0, 4, 75, 10, 43, 70, 88, 0, 17 }, + BoxMean = BoxMeanEnum.True, + BoxPoints = BoxPointsEnum.All + } + }; + + base.OnInitialized(); + } +} \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/CandleStickChart.razor b/Plotly.Blazor.Examples/Components/CandleStickChart.razor index cdc395f5..a4e96947 100644 --- a/Plotly.Blazor.Examples/Components/CandleStickChart.razor +++ b/Plotly.Blazor.Examples/Components/CandleStickChart.razor @@ -2,88 +2,106 @@ @using Plotly.Blazor.LayoutLib.XAxisLib @using Plotly.Blazor.Traces.CandlestickLib @using Line = Plotly.Blazor.Traces.CandlestickLib.DecreasingLib.Line - + + @code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } - Config config = new Config - { - Responsive = true - }; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Layout layout = new Layout + /// + protected override void OnInitialized() { - DragMode = DragModeEnum.Zoom, - Margin = new Margin + config = new Config { - R = 10, - T = 25, - B = 40, - L = 60 - }, - ShowLegend = true, - Title = new Title - { - Text = "Candlestick" - }, - XAxis = new List + Responsive = true + }; + + layout = new Layout { - new XAxis + Title = new Title { - AutoRange = AutoRangeEnum.True, - Domain = new List {0, 1}, - Range = new List {"2017-01-03 12:00", "2017-02-15 12:00"}, - RangeSlider = new RangeSlider - { - Range = new object[] {"2017-01-03 12:00", "2017-02-15 12:00"} - }, - Title = new LayoutLib.XAxisLib.Title - { - Text = "Date" - }, - Type = TypeEnum.Date - } - }, - YAxis = new List - { - new YAxis + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font { - AutoRange = LayoutLib.YAxisLib.AutoRangeEnum.True, - Domain = new List {0, 1}, - Range = new List {114.609999778, 137.410004222}, - Type = LayoutLib.YAxisLib.TypeEnum.Linear - } - }, - Height = 500 - }; - - List data = new List - { - new Candlestick - { - X = new List {new DateTime(2017, 1, 4), new DateTime(2017, 1, 5), new DateTime(2017, 1, 6), new DateTime(2017, 1, 9), new DateTime(2017, 1, 10), new DateTime(2017, 1, 11), new DateTime(2017, 1, 12), new DateTime(2017, 1, 13), new DateTime(2017, 1, 17), new DateTime(2017, 1, 18), new DateTime(2017, 1, 19), new DateTime(2017, 1, 20), new DateTime(2017, 1, 23), new DateTime(2017, 1, 24), new DateTime(2017, 1, 25), new DateTime(2017, 1, 26), new DateTime(2017, 1, 27), new DateTime(2017, 1, 30), new DateTime(2017, 1, 31), new DateTime(2017, 2, 1), new DateTime(2017, 2, 2), new DateTime(2017, 2, 3), new DateTime(2017, 2, 6), new DateTime(2017, 2, 7), new DateTime(2017, 2, 8), new DateTime(2017, 2, 9), new DateTime(2017, 2, 10), new DateTime(2017, 2, 13), new DateTime(2017, 2, 14), new DateTime(2017, 2, 15)}, - Close = new List {116.019997, 116.610001, 117.910004, 118.989998, 119.110001, 119.75, 119.25, 119.040001, 120, 119.989998, 119.779999, 120, 120.080002, 119.970001, 121.879997, 121.940002, 121.949997, 121.629997, 121.349998, 128.75, 128.529999, 129.080002, 130.289993, 131.529999, 132.039993, 132.419998, 132.119995, 133.289993, 135.020004, 135.509995}, - Decreasing = new Decreasing + Color = Theme.PaletteDark.TextPrimary.ToString() + }, + DragMode = DragModeEnum.Zoom, + Margin = new Margin + { + R = 10, + T = 25, + B = 40, + L = 60 + }, + ShowLegend = true, + XAxis = new List { - Line = new Line + new() { - Color = "#7F7F7F" + AutoRange = AutoRangeEnum.True, + Domain = new List { 0, 1 }, + Range = new List { "2017-01-03 12:00", "2017-02-15 12:00" }, + RangeSlider = new RangeSlider + { + Range = new object[] { "2017-01-03 12:00", "2017-02-15 12:00" } + }, + Title = new LayoutLib.XAxisLib.Title + { + Text = "Date" + }, + Type = TypeEnum.Date } }, - High = new List {116.510002, 116.860001, 118.160004, 119.43, 119.379997, 119.93, 119.300003, 119.620003, 120.239998, 120.5, 120.089996, 120.449997, 120.809998, 120.099998, 122.099998, 122.440002, 122.349998, 121.629997, 121.389999, 130.490005, 129.389999, 129.190002, 130.5, 132.089996, 132.220001, 132.449997, 132.940002, 133.820007, 135.089996, 136.270004}, - Increasing = new Increasing + YAxis = new List { - Line = new Traces.CandlestickLib.IncreasingLib.Line + new() { - Color = "rgba(31,119,180,1)" + AutoRange = LayoutLib.YAxisLib.AutoRangeEnum.True, + Domain = new List { 0, 1 }, + Range = new List { 114.609999778, 137.410004222 }, + Type = LayoutLib.YAxisLib.TypeEnum.Linear } - }, - Low = new List {115.75, 115.809998, 116.470001, 117.940002, 118.300003, 118.599998, 118.209999, 118.809998, 118.220001, 119.709999, 119.370003, 119.730003, 119.769997, 119.5, 120.279999, 121.599998, 121.599998, 120.660004, 120.620003, 127.010002, 127.779999, 128.160004, 128.899994, 130.449997, 131.220001, 131.119995, 132.050003, 132.75, 133.25, 134.619995}, - Open = new List {115.849998, 115.919998, 116.779999, 117.949997, 118.769997, 118.739998, 118.900002, 119.110001, 118.339996, 120, 119.400002, 120.449997, 120, 119.550003, 120.419998, 121.669998, 122.139999, 120.93, 121.150002, 127.029999, 127.980003, 128.309998, 129.130005, 130.539993, 131.350006, 131.649994, 132.460007, 133.080002, 133.470001, 135.520004}, - XAxis = "x", - YAxis = "y" - } - }; + } + }; + + data = new List + { + new Candlestick + { + X = new List { new DateTime(2017, 1, 4), new DateTime(2017, 1, 5), new DateTime(2017, 1, 6), new DateTime(2017, 1, 9), new DateTime(2017, 1, 10), new DateTime(2017, 1, 11), new DateTime(2017, 1, 12), new DateTime(2017, 1, 13), new DateTime(2017, 1, 17), new DateTime(2017, 1, 18), new DateTime(2017, 1, 19), new DateTime(2017, 1, 20), new DateTime(2017, 1, 23), new DateTime(2017, 1, 24), new DateTime(2017, 1, 25), new DateTime(2017, 1, 26), new DateTime(2017, 1, 27), new DateTime(2017, 1, 30), new DateTime(2017, 1, 31), new DateTime(2017, 2, 1), new DateTime(2017, 2, 2), new DateTime(2017, 2, 3), new DateTime(2017, 2, 6), new DateTime(2017, 2, 7), new DateTime(2017, 2, 8), new DateTime(2017, 2, 9), new DateTime(2017, 2, 10), new DateTime(2017, 2, 13), new DateTime(2017, 2, 14), new DateTime(2017, 2, 15) }, + Close = new List { 116.019997, 116.610001, 117.910004, 118.989998, 119.110001, 119.75, 119.25, 119.040001, 120, 119.989998, 119.779999, 120, 120.080002, 119.970001, 121.879997, 121.940002, 121.949997, 121.629997, 121.349998, 128.75, 128.529999, 129.080002, 130.289993, 131.529999, 132.039993, 132.419998, 132.119995, 133.289993, 135.020004, 135.509995 }, + Decreasing = new Decreasing + { + Line = new Line + { + Color = "#7F7F7F" + } + }, + High = new List { 116.510002, 116.860001, 118.160004, 119.43, 119.379997, 119.93, 119.300003, 119.620003, 120.239998, 120.5, 120.089996, 120.449997, 120.809998, 120.099998, 122.099998, 122.440002, 122.349998, 121.629997, 121.389999, 130.490005, 129.389999, 129.190002, 130.5, 132.089996, 132.220001, 132.449997, 132.940002, 133.820007, 135.089996, 136.270004 }, + Increasing = new Increasing + { + Line = new Traces.CandlestickLib.IncreasingLib.Line + { + Color = "rgba(31,119,180,1)" + } + }, + Low = new List { 115.75, 115.809998, 116.470001, 117.940002, 118.300003, 118.599998, 118.209999, 118.809998, 118.220001, 119.709999, 119.370003, 119.730003, 119.769997, 119.5, 120.279999, 121.599998, 121.599998, 120.660004, 120.620003, 127.010002, 127.779999, 128.160004, 128.899994, 130.449997, 131.220001, 131.119995, 132.050003, 132.75, 133.25, 134.619995 }, + Open = new List { 115.849998, 115.919998, 116.779999, 117.949997, 118.769997, 118.739998, 118.900002, 119.110001, 118.339996, 120, 119.400002, 120.449997, 120, 119.550003, 120.419998, 121.669998, 122.139999, 120.93, 121.150002, 127.029999, 127.980003, 128.309998, 129.130005, 130.539993, 131.350006, 131.649994, 132.460007, 133.080002, 133.470001, 135.520004 }, + XAxis = "x", + YAxis = "y" + } + }; + + base.OnInitialized(); + } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/HeatMapChart.razor b/Plotly.Blazor.Examples/Components/HeatMapChart.razor index 0156354f..6dc026fe 100644 --- a/Plotly.Blazor.Examples/Components/HeatMapChart.razor +++ b/Plotly.Blazor.Examples/Components/HeatMapChart.razor @@ -1,32 +1,44 @@ -@using System.Globalization -@using Plotly.Blazor.LayoutLib +@using Plotly.Blazor.LayoutLib @using Plotly.Blazor.LayoutLib.XAxisLib -@using Font = Plotly.Blazor.LayoutLib.AnnotationLib.Font +@using System.Globalization + - - -@code { - - PlotlyChart plotlyChart; - Layout layout; - Config config; - IList data; +@code +{ + [CascadingParameter] + private MudTheme Theme { get; set; } + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; /// - public override async Task SetParametersAsync(ParameterView parameters) + protected override void OnInitialized() { - await base.SetParametersAsync(parameters); + config = new Config + { + ShowLink = false, + Responsive = true, + DisplayLogo = false + }; + layout = new Layout { Title = new Title { - Text = "Annotated Heatmap" + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() }, Annotations = new List(), XAxis = new List { - new () + new() { Ticks = TicksEnum.Empty, Side = SideEnum.Top @@ -34,26 +46,22 @@ }, YAxis = new List { - new () + new() { Ticks = LayoutLib.YAxisLib.TicksEnum.Empty, - TickSuffix = " ", + TickSuffix = " " } } }; - config = new Config - { - ShowLink = false, - Responsive = true, - DisplayLogo = false - }; - data = GetMapData(); + data = GetMapData().ToList(); AddAnnotations(layout, data.First()); + + base.OnInitialized(); } - IList GetMapData() + private IList GetMapData() { IList mapData = new List(); @@ -63,21 +71,21 @@ var zValues = new[] { - new double? []{0.00, 0.00, 0.75, 0.75, 0.00}, - new double? []{0.00, 0.00, 0.75, 0.75, 0.00}, - new double? []{0.75, 0.75, 0.75, 0.75, 0.75}, - new double? []{null, 0.00, 0.00, 0.75, 0.00} + new double?[] { 0.00, 0.00, 0.75, 0.75, 0.00 }, + new double?[] { 0.00, 0.00, 0.75, 0.75, 0.00 }, + new double?[] { 0.75, 0.75, 0.75, 0.75, 0.75 }, + new double?[] { null, 0.00, 0.00, 0.75, 0.00 } }; - mapData.Add(new HeatMap() + mapData.Add(new HeatMap { X = xValues.Cast().ToList(), Y = yValues.Cast().ToList(), Z = zValues.Cast().ToList(), ColorScale = new[] { - new [] {"0", "#3D9970"}, - new [] {"1", "#001f3f"}, + new[] { "0", "#3D9970" }, + new[] { "1", "#001f3f" } }, ShowScale = false }); @@ -85,7 +93,7 @@ return mapData; } - static void AddAnnotations(Layout layout, ITrace trace) + private static void AddAnnotations(Layout layout, ITrace trace) { if (trace is not HeatMap { Z: List zValues } heatMap) return; @@ -103,13 +111,13 @@ X = heatMap.X[j], Y = heatMap.Y[i], Text = currentValue.HasValue ? currentValue.Value.ToString(CultureInfo.InvariantCulture) : string.Empty, - Font = new Font + Font = new LayoutLib.AnnotationLib.Font { Family = "Arial", Size = 12, Color = textColor }, - ShowArrow = false, + ShowArrow = false }; layout.Annotations.Add(result); } diff --git a/Plotly.Blazor.Examples/Components/Hover.razor b/Plotly.Blazor.Examples/Components/Hover.razor index a8443a9b..52f3c19d 100644 --- a/Plotly.Blazor.Examples/Components/Hover.razor +++ b/Plotly.Blazor.Examples/Components/Hover.razor @@ -1,12 +1,12 @@ -@using Plotly.Blazor.LayoutLib +@using Plotly.Blazor.Interop +@using Plotly.Blazor.LayoutLib @using Plotly.Blazor.Traces.ScatterLib -@using Plotly.Blazor.Interop -@using System.Text.Json + + HoverAction="HoverAction" AfterRender="SubscribeEvents"/> -@if (HoverInfos != null && HoverInfos.Count() > 0) +@if (HoverInfos != null && HoverInfos.Any()) { Current X: @HoverInfos.First().X Current Y: @HoverInfos.FirstOrDefault(d => d.TraceIndex == 0)?.Y @@ -15,51 +15,58 @@ @code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } - IEnumerable HoverInfos { get; set; } + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; + private IEnumerable HoverInfos { get; set; } - Config config = new() + /// + protected override void OnInitialized() { - Responsive = true - }; + config = new Config + { + Responsive = true + }; - Layout layout = new() - { - Title = new Title + layout = new Layout { - Text = "Scatter with Hover Events" - }, - YAxis = new List + Title = new Title + { + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, + HoverMode = HoverModeEnum.XUnified + }; + + data = new List { - new() + new Scatter { - Title = new LayoutLib.YAxisLib.Title - { - Text = "Scatter Unit" - } + Name = "ScatterTrace", + Mode = ModeFlag.Markers, + X = Enumerable.Range(0, 30).Cast().ToList(), + Y = Helper.GenerateData(0, 30).Y + }, + new Scatter + { + Name = "ScatterTrace 2", + Mode = ModeFlag.Markers, + X = Enumerable.Range(0, 30).Cast().ToList(), + Y = Helper.GenerateData(0, 30).Y } - }, - HoverMode = HoverModeEnum.XUnified - }; + }; - IList data = new List - { - new Scatter - { - Name = "ScatterTrace", - Mode = ModeFlag.Markers, - X = Enumerable.Range(0, 30).Cast().ToList(), - Y = Helper.GenerateData(0, 30).Y - }, - new Scatter - { - Name = "ScatterTrace 2", - Mode = ModeFlag.Markers, - X = Enumerable.Range(0, 30).Cast().ToList(), - Y = Helper.GenerateData(0, 30).Y - } - }; + base.OnInitialized(); + } public void HoverAction(IEnumerable eventData) { @@ -67,7 +74,7 @@ StateHasChanged(); } - public async Task SubscribeEvents() + public async void SubscribeEvents() { await chart.SubscribeHoverEvent(); } diff --git a/Plotly.Blazor.Examples/Components/IndicatorChart.razor b/Plotly.Blazor.Examples/Components/IndicatorChart.razor index 64fa0d17..39aaf08a 100644 --- a/Plotly.Blazor.Examples/Components/IndicatorChart.razor +++ b/Plotly.Blazor.Examples/Components/IndicatorChart.razor @@ -2,111 +2,133 @@ @using Plotly.Blazor.LayoutLib.GridLib @using Plotly.Blazor.Traces.IndicatorLib @using Domain = Plotly.Blazor.Traces.IndicatorLib.Domain - + @code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } - Config config = new() - { - Responsive = true - }; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Layout layout = new() + /// + protected override void OnInitialized() { - Margin = new Margin - { - L = 25, - B = 25, - R = 25, - T = 25 - }, - Grid = new Grid + config = new Config { - Columns = 2, - Rows = 2, - Pattern = PatternEnum.Independent - } - }; + Responsive = true + }; - IList data = new List - { - new Indicator + layout = new Layout { - Mode = ModeFlag.Number, - Title = new Traces.IndicatorLib.Title - { - Text = "Number Indicator" - }, - Value = 500, - Domain = new Domain + Title = new Title { - Row = 0, - Column = 0 + Text = GetType().Name }, - Delta = new Delta - { - Reference = 400, - Relative = true - } - }, - new Indicator - { - Mode = ModeFlag.Number | ModeFlag.Delta, - Title = new Traces.IndicatorLib.Title + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font { - Text = "Number+Delta Indicator" + Color = Theme.PaletteDark.TextPrimary.ToString() }, - Value = 500, - Domain = new Domain + Margin = new Margin { - Row = 0, - Column = 1 + L = 25, + B = 25, + R = 25, + T = 25 }, - Delta = new Delta + Grid = new Grid { - Reference = 400, - Relative = true + Columns = 2, + Rows = 2, + Pattern = PatternEnum.Independent } - }, - new Indicator + }; + + data = new List { - Mode = ModeFlag.Number | ModeFlag.Gauge, - Title = new Traces.IndicatorLib.Title + new Indicator { - Text = "Number+Gauge Indicator" + Mode = ModeFlag.Number, + Title = new Traces.IndicatorLib.Title + { + Text = "Number Indicator" + }, + Value = 500, + Domain = new Domain + { + Row = 0, + Column = 0 + }, + Delta = new Delta + { + Reference = 400, + Relative = true + } }, - Value = 500, - Domain = new Domain + new Indicator { - Row = 1, - Column = 0 + Mode = ModeFlag.Number | ModeFlag.Delta, + Title = new Traces.IndicatorLib.Title + { + Text = "Number+Delta Indicator" + }, + Value = 500, + Domain = new Domain + { + Row = 0, + Column = 1 + }, + Delta = new Delta + { + Reference = 400, + Relative = true + } }, - Delta = new Delta - { - Reference = 400, - Relative = true - } - }, - new Indicator - { - Mode = ModeFlag.Number | ModeFlag.Delta | ModeFlag.Gauge, - Title = new Traces.IndicatorLib.Title + new Indicator { - Text = "Number+Delta+Gauge Indicator" + Mode = ModeFlag.Number | ModeFlag.Gauge, + Title = new Traces.IndicatorLib.Title + { + Text = "Number+Gauge Indicator" + }, + Value = 500, + Domain = new Domain + { + Row = 1, + Column = 0 + }, + Delta = new Delta + { + Reference = 400, + Relative = true + } }, - Value = 500, - Domain = new Domain + new Indicator { - Row = 1, - Column = 1 - }, - Delta = new Delta - { - Reference = 400, - Relative = true + Mode = ModeFlag.Number | ModeFlag.Delta | ModeFlag.Gauge, + Title = new Traces.IndicatorLib.Title + { + Text = "Number+Delta+Gauge Indicator" + }, + Value = 500, + Domain = new Domain + { + Row = 1, + Column = 1 + }, + Delta = new Delta + { + Reference = 400, + Relative = true + } } - } - }; + }; + + base.OnInitialized(); + } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/LiveDataChart.razor b/Plotly.Blazor.Examples/Components/LiveDataChart.razor index 5f23260a..aad5e46d 100644 --- a/Plotly.Blazor.Examples/Components/LiveDataChart.razor +++ b/Plotly.Blazor.Examples/Components/LiveDataChart.razor @@ -1,38 +1,93 @@ -@using Plotly.Blazor.LayoutLib -@using Plotly.Blazor.Traces.ScatterLib - -@using System.Reactive.Concurrency -@using System.Reactive.Linq -@using System.Reactive.Subjects -@using System.Threading +@using System.Collections.Concurrent @using System.Diagnostics -@using System.Collections.Concurrent - +@using Plotly.Blazor.LayoutLib +@using Plotly.Blazor.Traces.ScatterLib @implements IDisposable - + -@code { +@code +{ + [CascadingParameter] + private MudTheme Theme { get; set; } private PlotlyChart chart; private Config config; private Layout layout; - private IList traces; + private IList data; private CancellationTokenSource cancellationToken; private BlockingCollection queue; - private event EventHandler dataEvent; - + private event EventHandler DataEvent; /// - protected override void OnParametersSet() + protected override void OnInitialized() { - config = CreateConfig(); - layout = CreateLayout(); - traces = CreateTraces(); + config = new Config + { + Responsive = true + }; + + layout = new Layout + { + Title = new Title + { + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, + XAxis = new[] + { + new XAxis + { + Title = new LayoutLib.XAxisLib.Title + { + Text = "Index" + } + } + }, + YAxis = new[] + { + new YAxis + { + Title = new LayoutLib.YAxisLib.Title + { + Text = "Value" + } + } + } + }; + + data = new List + { + new Scatter + { + Name = "Trace 1", + Mode = ModeFlag.Lines, + X = new List(), + Y = new List(), + XAxis = "x", + YAxis = "y" + }, + new Scatter + { + Name = "Trace 2", + Mode = ModeFlag.Lines, + X = new List(), + Y = new List(), + XAxis = "x", + YAxis = "y" + } + }; + cancellationToken = new CancellationTokenSource(); queue = new BlockingCollection(); - base.OnParametersSet(); + + base.OnInitialized(); } /// @@ -40,7 +95,7 @@ { if (firstRender) { - dataEvent += UpdateData; + DataEvent += UpdateData; _ = WriteData(50, 30); } @@ -50,7 +105,7 @@ /// public void Dispose() { - dataEvent -= UpdateData; + DataEvent -= UpdateData; cancellationToken?.Cancel(); } @@ -58,19 +113,20 @@ /// Writes data to the queue. /// /// - /// /// + /// /// + /// private Task WriteData(int milliseconds, int count) { return Task.Run(async () => { - // Repeat until cancellation is requested + // Repeat until cancellation is requested while (!cancellationToken.IsCancellationRequested) { - (var x, var y) = Helper.GenerateData(0, count, GenerateMethod.Sin); - (var x2, var y2) = Helper.GenerateData(0, count, GenerateMethod.Cos); + var (x, y) = Helper.GenerateData(0, count); + var (x2, y2) = Helper.GenerateData(0, count, GenerateMethod.Cos); - dataEvent?.Invoke(this, new DataJob(new DataEventArgs(x, y, 0), chart, traces)); - dataEvent?.Invoke(this, new DataJob(new DataEventArgs(x2, y2, 1), chart, traces)); + DataEvent?.Invoke(this, new DataJob(new DataEventArgs(x, y, 0), chart, data)); + DataEvent?.Invoke(this, new DataJob(new DataEventArgs(x2, y2, 1), chart, data)); await Task.Delay(TimeSpan.FromMilliseconds(milliseconds)); } @@ -110,97 +166,22 @@ Console.WriteLine($"Render of {count} points took {stopwatch.ElapsedMilliseconds}ms"); } - /// - /// Creates an initial config. - /// - /// Config - private Config CreateConfig() - { - return new Config - { - Responsive = true - }; - } - - /// - /// Creates an initial layout. - /// - /// Layout - private Layout CreateLayout() - { - return new Layout - { - Title = new Title - { - Text = "Live Data Simulation" - }, - XAxis = new[] - { - new XAxis - { - Title = new Plotly.Blazor.LayoutLib.XAxisLib.Title - { - Text = "Index" - }, - } - }, - YAxis = new[] - { - new YAxis - { - Title = new Plotly.Blazor.LayoutLib.YAxisLib.Title - { - Text = "Value" - } - } - } - }; - } - - /// - /// Creates an initial list of traces. - /// - /// IList<ITrace> - private IList CreateTraces() - { - return new List - { - new Scatter - { - Name = "Trace 1", - Mode = ModeFlag.Lines, - X = new List(), - Y = new List(), - XAxis = "x", - YAxis = "y" - }, - new Scatter - { - Name = "Trace 2", - Mode = ModeFlag.Lines, - X = new List(), - Y = new List(), - XAxis = "x", - YAxis = "y" - } - }; - } /// /// Event Arguments for the Live Data Simulation. /// internal class DataEventArgs : EventArgs { - public IEnumerable X { get; set; } - public IEnumerable Y { get; set; } - public int TraceIndex { get; set; } - public DataEventArgs(IEnumerable x, IEnumerable y, int traceIndex) { X = x; Y = y; TraceIndex = traceIndex; } + + public IEnumerable X { get; set; } + public IEnumerable Y { get; set; } + public int TraceIndex { get; set; } } /// @@ -208,18 +189,18 @@ /// internal class DataJob { - public DataEventArgs DataEventArgs { get; set; } - - public PlotlyChart Chart { get; set; } - - public IList Traces { get; set; } - public DataJob(DataEventArgs dataEventArgs, PlotlyChart chart, IList traces) { DataEventArgs = dataEventArgs; Chart = chart; Traces = traces; } + + public DataEventArgs DataEventArgs { get; set; } + + public PlotlyChart Chart { get; set; } + + public IList Traces { get; set; } } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/MapChart.razor b/Plotly.Blazor.Examples/Components/MapChart.razor index fb62ff43..799587da 100644 --- a/Plotly.Blazor.Examples/Components/MapChart.razor +++ b/Plotly.Blazor.Examples/Components/MapChart.razor @@ -1,33 +1,56 @@ @using Plotly.Blazor.LayoutLib @using Plotly.Blazor.LayoutLib.GeoLib @using Plotly.Blazor.LayoutLib.GeoLib.ProjectionLib -@using System.Globalization @using Plotly.Blazor.Traces.ScatterGeoLib +@using System.Globalization @inject NavigationManager MyNavigationManager - +@if (!IsInitialized) +{ + + + +} + + -@code { +@code +{ + [CascadingParameter] + private MudTheme Theme { get; set; } - PlotlyChart plotlyChart; - Layout layout; - Config config; - IList data; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; + private bool IsInitialized { get; set; } /// - public override async Task SetParametersAsync(ParameterView parameters) + protected override async Task OnInitializedAsync() { + config = new Config + { + Responsive = true, + ShowLink = false + }; + layout = new Layout { Title = new Title { Text = "Feb. 2011 American Airline flight paths" }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, ShowLegend = false, Geo = new List { - new Geo + new() { Scope = ScopeEnum.NorthAmerica, Projection = new Projection @@ -35,32 +58,24 @@ Type = TypeEnum.AzimuthalEqualArea }, ShowLand = true, - LandColor = "rgb(243,243,243)", - CountryColor = "rgb(204,204,204)" + BgColor = "rgb(48, 48, 48)" } - }, - Height = 500 + } }; - config = new Config - { - ShowLink = false, - Responsive = true - }; - data = await GetMapData(); - await base.SetParametersAsync(ParameterView.Empty); + data = new List(); + + await base.OnInitializedAsync(); } - async Task> GetMapData() + private async Task> GetMapData() { - IList mapData = new List(); - var client = new HttpClient { BaseAddress = new Uri(MyNavigationManager.BaseUri) }; - var csv = (await client.GetStringAsync("/2011_february_aa_flight_paths.csv")) + var csv = (await client.GetStringAsync($"{MyNavigationManager.BaseUri}2011_february_aa_flight_paths.csv")) .Split("\n") .Skip(1) .Where(s => !string.IsNullOrWhiteSpace(s)) @@ -81,24 +96,30 @@ count.Add(int.Parse(row[7], NumberStyles.Any, CultureInfo.InvariantCulture)); } - var max = (float) count.Max(); + var max = (float)count.Max(); - for (var i = 0; i < count.Count; i++) + return count.Select((t, i) => new ScatterGeo { - mapData.Add(new ScatterGeo + LocationMode = LocationModeEnum.USAStates, Lon = new List { startLon[i], endLon[i] }, Lat = new List { startLat[i], endLat[i] }, Mode = ModeFlag.Lines, Line = new Line { - LocationMode = LocationModeEnum.USAStates, - Lon = new List {startLon[i], endLon[i]}, - Lat = new List {startLat[i], endLat[i]}, - Mode = ModeFlag.Lines, - Line = new Line - { - Width = 1, - Color = "red" - }, - Opacity = new decimal(count[i] / max) - }); - } - return mapData; + Width = 1, Color = "red" + }, + Opacity = new decimal(t / max) + }).Cast().ToList(); + } + + private void LoadData() + { + Task.Run(async () => + { + foreach (var trace in await GetMapData()) + { + await InvokeAsync(async () => await chart.AddTrace(trace)); + // Add the delay to keep the UI responsive + await Task.Delay(10); + } + IsInitialized = true; + await InvokeAsync(StateHasChanged); + }); } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/MultipleAxesChart.razor b/Plotly.Blazor.Examples/Components/MultipleAxesChart.razor index 3c4d973f..9cfe189b 100644 --- a/Plotly.Blazor.Examples/Components/MultipleAxesChart.razor +++ b/Plotly.Blazor.Examples/Components/MultipleAxesChart.razor @@ -2,94 +2,111 @@ @using Plotly.Blazor.LayoutLib.YAxisLib @using Plotly.Blazor.Traces.ScatterLib @using System.Diagnostics - -
- Clear - Add data + +
+
+ Clear + Add data
@code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } - Config config = new Config - { - Responsive = true - }; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Layout layout = new Layout + /// + protected override void OnInitialized() { - Title = new Title + config = new Config { - Text = "Multiple Axes" - }, - YAxis = new List + Responsive = true + }; + + layout = new Layout { - new YAxis + Title = new Title { - Title = new LayoutLib.YAxisLib.Title - { - Text = "Scatter Unit" - } + Text = GetType().Name }, - new YAxis + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font { - Title = new LayoutLib.YAxisLib.Title + Color = Theme.PaletteDark.TextPrimary.ToString() + }, + YAxis = new List + { + new() { - Text = "Bar Unit" + Title = new LayoutLib.YAxisLib.Title + { + Text = "Scatter Unit" + } }, - Overlaying = "y", - Side = SideEnum.Right + new() + { + Title = new LayoutLib.YAxisLib.Title + { + Text = "Bar Unit" + }, + Overlaying = "y", + Side = SideEnum.Right + } } - }, - Height = 500 - }; + }; - List data = new List - { - new Scatter + data = new List { - Name = "ScatterTrace", - Mode = ModeFlag.Lines | ModeFlag.Markers, - X = new List(), - Y = new List() - }, - new Bar - { - Name = "BarTrace", - YAxis = "y2", - X = new List(), - Y = new List(), - Opacity = new decimal(0.7) - } - }; - - private async Task AddData(int count = 100) + new Scatter + { + Name = "ScatterTrace", + Mode = ModeFlag.Lines | ModeFlag.Markers, + X = new List(), + Y = new List() + }, + new Bar + { + Name = "BarTrace", + YAxis = "y2", + X = new List(), + Y = new List(), + Opacity = new decimal(0.7) + } + }; + + base.OnInitialized(); + } + + private async void AddData() { - if (!(chart.Data.ElementAt(0) is Scatter scatter)) return; - if (!(chart.Data.ElementAt(1) is Bar bar)) return; + const int count = 100; + + if (chart.Data.ElementAt(0) is not Scatter scatter) return; + if (chart.Data.ElementAt(1) is not Bar bar) return; var (x, y) = Helper.GenerateData(scatter.X.Count + 1, scatter.X.Count + 1 + count); var (x2, y2) = Helper.GenerateData(bar.X.Count + 1, bar.X.Count + 1 + count, GenerateMethod.Cos); - scatter.X.AddRange(x); - scatter.Y.AddRange(y); - - bar.X.AddRange(x2); - bar.Y.AddRange(y2); - var stopwatch = new Stopwatch(); stopwatch.Start(); - await chart.React(); + + // Pattern: x[], y[], indices[] + await chart.ExtendTraces(new[] { x, x2 }, new[] { y, y2 }, new[] { 0, 1 }); + stopwatch.Stop(); Console.WriteLine($"[PERF.] Update took {stopwatch.ElapsedMilliseconds}"); } private async Task Clear() { - if (!(chart.Data.ElementAt(0) is Scatter plot)) return; - if (!(chart.Data.ElementAt(1) is Bar plot2)) return; + if (chart.Data.ElementAt(0) is not Scatter plot) return; + if (chart.Data.ElementAt(1) is not Bar plot2) return; plot.X.Clear(); plot.Y.Clear(); @@ -99,13 +116,4 @@ await chart.React(); } - - - protected override async Task OnAfterRenderAsync(bool firstRender) - { - if (firstRender) - { - await AddData(); - } - } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/PieChart.razor b/Plotly.Blazor.Examples/Components/PieChart.razor index c2cdf7ca..7e2ebcaa 100644 --- a/Plotly.Blazor.Examples/Components/PieChart.razor +++ b/Plotly.Blazor.Examples/Components/PieChart.razor @@ -1,45 +1,65 @@ -@using System.Text.Json; -@using Plotly.Blazor.Interop; - +@using Plotly.Blazor.Interop +@using Plotly.Blazor.LayoutLib + + @code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } + + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Config config = new Config + /// + protected override void OnInitialized() + { + config = new Config { Responsive = true }; - Layout layout = new Layout + layout = new Layout { Title = new Title { - Text = "Pie" + Text = GetType().Name }, - Height = 500 + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + } }; - List data = new List - { - new Pie + data = new List { - Values = new List {19, 26, 55}, - Labels = new List {"Residential", "Non-Residential", "Utility"} - } - }; + new Pie + { + Values = new List { 19, 26, 55 }, + Labels = new List { "Residential", "Non-Residential", "Utility" } + } + }; + + base.OnInitialized(); + } public void PieClick(object value, object label) { - var l = label.ToString(); - var v = value.ToString(); + // Use the values if needed + //var l = label.ToString(); + //var v = value.ToString(); } public void HoverAction(IEnumerable eventData) { - var HoverInfos = eventData; - var value = eventData.First().X.ToString(); - var label = eventData.First().Y.ToString(); + // Use the values if needed + //var first = eventData.First(); + //var value = first.X.ToString(); + //var label = first.Y.ToString(); } public async Task SubscribeEvents() @@ -47,6 +67,4 @@ await chart.SubscribeClickEvent(); await chart.SubscribeHoverEvent(); } - - } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/Relayout.razor b/Plotly.Blazor.Examples/Components/Relayout.razor index dab26c86..4b1a19f0 100644 --- a/Plotly.Blazor.Examples/Components/Relayout.razor +++ b/Plotly.Blazor.Examples/Components/Relayout.razor @@ -1,14 +1,11 @@ -@using Plotly.Blazor.LayoutLib +@using Plotly.Blazor.Interop +@using Plotly.Blazor.LayoutLib @using Plotly.Blazor.Traces.ScatterLib -@using Plotly.Blazor.Interop -@using System.Text.Json - - - + RelayoutAction="RelayoutAction" AfterRender="Init"/> -@if(relayoutData?.XRange?.Count() == 2) +@if (relayoutData?.XRange?.Count() == 2) { X: @relayoutData.XRange[0], @relayoutData.XRange[1] } @@ -18,36 +15,59 @@ Y: @relayoutData.YRange[0], @relayoutData.YRange[1] } -@code { - RelayoutEventData relayoutData; - - PlotlyChart chart; - private Config config = new() +@code +{ + [CascadingParameter] + private MudTheme Theme { get; set; } + + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; + private RelayoutEventData relayoutData; + + /// + protected override void OnInitialized() + { + config = new Config { Responsive = true }; - private IList data = new List - { - new Scatter + layout = new Layout { - Name = "ScatterTrace", - Mode = ModeFlag.Lines | ModeFlag.Markers, - X = new List(), - Y = new List() - } - }; - private Layout layout = new() - { - Title = new Title { Text = "Scatter with Relayout Event" }, + Title = new Title + { + Text = "Scatter with Relayout Event" + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, YAxis = new List + { + new() + { + Title = new LayoutLib.YAxisLib.Title { Text = "Scatter Unit" } + } + } + }; + + data = new List { - new() + new Scatter { - Title = new LayoutLib.YAxisLib.Title { Text = "Scatter Unit" } + Name = "ScatterTrace", + Mode = ModeFlag.Lines | ModeFlag.Markers, + X = new List(), + Y = new List() } - } - }; + }; + + base.OnInitialized(); + } protected override async Task OnAfterRenderAsync(bool firstRender) { @@ -57,12 +77,15 @@ } } + private async void Init() + { + await ExtendData(); + await chart.SubscribeRelayoutEvent(); + } + private async Task ExtendData(int count = 100) { - if (!(chart.Data.FirstOrDefault() is Scatter scatter)) - { - return; - } + if (chart.Data.FirstOrDefault() is not Scatter scatter) return; var max = (int?)scatter.X?.Max(); var (x, y) = Helper.GenerateData(max + 1 ?? 0, max + 1 + count ?? count); @@ -83,9 +106,4 @@ relayoutData = data; StateHasChanged(); } - - public async Task SubscribeEvents() - { - await chart.SubscribeRelayoutEvent(); - } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/RibbonChart.razor b/Plotly.Blazor.Examples/Components/RibbonChart.razor index 12dfd7d3..5da71273 100644 --- a/Plotly.Blazor.Examples/Components/RibbonChart.razor +++ b/Plotly.Blazor.Examples/Components/RibbonChart.razor @@ -1,73 +1,104 @@ @using Plotly.Blazor.LayoutLib +@using Plotly.Blazor.LayoutLib.SceneLib +@using XAxis = Plotly.Blazor.LayoutLib.SceneLib.XAxis +@using YAxis = Plotly.Blazor.LayoutLib.SceneLib.YAxis +@using Newtonsoft.Json.Linq @inject NavigationManager MyNavigationManager - +@if (!IsInitialized) +{ + + + +} -@code { + + +@code +{ + [CascadingParameter] + private MudTheme Theme { get; set; } + + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; + + private bool IsInitialized { get; set; } const string Url = "https://raw.githubusercontent.com/plotly/datasets/master/3d-ribbon.json"; - - PlotlyChart plotlyChart; - Layout layout; - Config config; - IList data; - - public override async Task SetParametersAsync(ParameterView parameters) + + + /// + protected override void OnInitialized() { + config = new Config + { + ShowLink = false, + Responsive = true, + DisplayLogo = false + }; + layout = new Layout { Title = new Title { - Text = "Ribbon chart" + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() }, - Height = 600, - Width = 600, ShowLegend = false, Scene = new[] { - new Scene() + new Scene { - XAxis = new LayoutLib.SceneLib.XAxis(){Title = new LayoutLib.SceneLib.XAxisLib.Title(){Text = "Sample #"}}, - YAxis = new LayoutLib.SceneLib.YAxis(){Title = new LayoutLib.SceneLib.YAxisLib.Title(){Text = "Wave length"}}, - ZAxis = new LayoutLib.SceneLib.ZAxis(){Title = new LayoutLib.SceneLib.ZAxisLib.Title(){Text = "OD"}} + XAxis = new XAxis { Title = new LayoutLib.SceneLib.XAxisLib.Title { Text = "Sample #" } }, + YAxis = new YAxis { Title = new LayoutLib.SceneLib.YAxisLib.Title { Text = "Wave length" } }, + ZAxis = new ZAxis { Title = new LayoutLib.SceneLib.ZAxisLib.Title { Text = "OD" } } } } }; - config = new Config - { - ShowLink = false, - Responsive = true, - DisplayLogo = false - }; - - data = (await GetRibbonsData()).ToList(); - await base.SetParametersAsync(ParameterView.Empty); + data = new List(); + base.OnInitialized(); } - async Task > GetRibbonsData() + private void LoadData() { - var client = new HttpClient + Task.Run(async () => { - BaseAddress = new Uri(MyNavigationManager.BaseUri) - }; - - var jsonResponse = await client.GetStringAsync(Url); - var jasonObject = Newtonsoft.Json.Linq.JObject.Parse(jsonResponse); - var results = jasonObject["data"].Children().ToList(); - - return results.Select(result => - { - var ribbon = result.ToObject(); - return new Surface() + using var client = new HttpClient { - X = ribbon.X, - Y = ribbon.Y, - Z = ribbon.Z, - ShowLegend = false, - ShowScale = false + BaseAddress = new Uri(MyNavigationManager.BaseUri) }; + + var jsonResponse = await client.GetStringAsync(Url); + var jsonObject = JObject.Parse(jsonResponse); + var results = jsonObject["data"]?.Children().ToList(); + + if (!results?.Any() ?? true) return; + + foreach (var ribbon in results.Select(obj => obj.ToObject())) + { + await InvokeAsync(async () => await chart.AddTrace(new Surface + { + X = ribbon.X, + Y = ribbon.Y, + Z = ribbon.Z, + ShowLegend = false, + ShowScale = false + })); + + // Add the delay to keep the UI responsive + await Task.Delay(10); + } + IsInitialized = true; + await InvokeAsync(StateHasChanged); }); } - + record Ribbon(object[][] X, object[][] Y, object[][] Z, string[][] ColorScale); } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/ScatterChart.razor b/Plotly.Blazor.Examples/Components/ScatterChart.razor index 63e587f3..bb70ff39 100644 --- a/Plotly.Blazor.Examples/Components/ScatterChart.razor +++ b/Plotly.Blazor.Examples/Components/ScatterChart.razor @@ -1,86 +1,96 @@ -@using Plotly.Blazor.LayoutLib +@using Blazor_Layout = Layout +@using Examples_Helper = Helper +@using Plotly.Blazor.LayoutLib @using Plotly.Blazor.Traces.ScatterLib -@using System.Diagnostics -@using Blazor_Layout = Plotly.Blazor.Layout -@using Examples_Helper = Plotly.Blazor.Examples.Helper -@using Title = Plotly.Blazor.LayoutLib.Title -@using YAxis = Plotly.Blazor.LayoutLib.YAxis - - -
+ +
+
Clear - Pop - Push - Rename - Prepend - Extend - Prepend (Max. 100) - Extend (Max. 100) - Show Image - Download + Pop + Push + Rename + Prepend + Extend + Prepend (Max. 100) + Extend (Max. 100) + Show Image + Download
@if (imgSource != null) {
-
+

Export as an image

- + image
} @code { + [CascadingParameter] + private MudTheme Theme { get; set; } + private PlotlyChart chart; - private Config config = new() - { - Responsive = true - }; + private Config config; + private Layout layout; + private IList data; + private string imgSource; - private IList data = new List + /// + protected override void OnInitialized() { - new Scatter + config = new Config { - Name = "ScatterTrace", - Mode = ModeFlag.Lines | ModeFlag.Markers, - X = new List(), - Y = new List() - } - }; - - private string imgSource; + Responsive = true + }; - private Layout layout = new() + layout = new Layout { - Title = new Title { Text = "Scatter" }, + Title = new Title + { + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, YAxis = new List - { - new() { - Title = new LayoutLib.YAxisLib.Title { Text = "Scatter Unit" } + new() + { + Title = new LayoutLib.YAxisLib.Title { Text = "Scatter Unit" } + } } - } }; - protected override async Task OnAfterRenderAsync(bool firstRender) - { - if (firstRender) + data = new List { - await ExtendData(); - } + new Scatter + { + Name = "ScatterTrace", + Mode = ModeFlag.Lines | ModeFlag.Markers, + X = new List(), + Y = new List() + } + }; + + base.OnInitialized(); } private async Task AddScatter() { var (x, y) = Helper.GenerateData(0, 100); await chart.AddTrace(new Scatter - { - Name = $"ScatterTrace{data.Count + 1}", - Mode = ModeFlag.Lines | ModeFlag.Markers, - X = x, - Y = y - }); + { + Name = $"ScatterTrace{data.Count + 1}", + Mode = ModeFlag.Lines | ModeFlag.Markers, + X = x, + Y = y + }); } private async Task DeleteScatter() @@ -98,9 +108,11 @@ await chart.DownloadImage(ImageFormat.Png, 400, 800, "ScatterExample"); } - private async Task ExtendData(int count = 100) + private async void ExtendData() { - if (!(chart.Data.FirstOrDefault() is Scatter scatter)) + const int count = 100; + + if (chart.Data.FirstOrDefault() is not Scatter scatter) { return; } @@ -119,8 +131,11 @@ } } - private async Task ExtendWithLimit(int count = 100, int limit = 100) + private async Task ExtendWithLimit() { + const int count = 100; + const int limit = 100; + if (chart.Data.FirstOrDefault() is not Scatter scatter) { return; @@ -140,9 +155,11 @@ } } - private async Task PrependData(int count = 100) + private async Task PrependData() { - if (!(chart.Data.FirstOrDefault() is Scatter scatter)) + const int count = 100; + + if (chart.Data.FirstOrDefault() is not Scatter scatter) { return; } @@ -161,8 +178,11 @@ } } - private async Task PrependWithLimit(int count = 100, int limit = 100) + private async void PrependWithLimit() { + const int count = 100; + const int limit = 100; + if (chart.Data.FirstOrDefault() is not Scatter scatter) { return; @@ -187,5 +207,4 @@ var updateScatterChart = new Scatter { Name = "Restyled Name" }; await chart.Restyle(updateScatterChart, 0); } - } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/ScatterGlChart.razor b/Plotly.Blazor.Examples/Components/ScatterGlChart.razor index 8d189c62..d31e3318 100644 --- a/Plotly.Blazor.Examples/Components/ScatterGlChart.razor +++ b/Plotly.Blazor.Examples/Components/ScatterGlChart.razor @@ -1,42 +1,69 @@ @using Plotly.Blazor.LayoutLib +@using Plotly.Blazor.Traces.ScatterGlLib - + @code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } - Config config = new() - { - Responsive = true - }; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Layout layout = new() + /// + protected override void OnInitialized() { - Title = new Title + config = new Config { - Text = "ScatterGl with >100k Points" - }, - YAxis = new List + Responsive = true + }; + + layout = new Layout { - new() + Title = new Title + { + Text = "ScatterGl with >100k Points" + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font { - Title = new LayoutLib.YAxisLib.Title + Color = Theme.PaletteDark.TextPrimary.ToString() + }, + YAxis = new List + { + new() { - Text = "Scatter Unit" + Title = new LayoutLib.YAxisLib.Title + { + Text = "Scatter Unit" + } } } - } - }; + }; + + data = new List + { + new ScatterGl + { + Name = "ScatterGlTrace", + Mode = ModeFlag.Lines | ModeFlag.Markers, + X = new List(), + Y = new List() + } + }; + + base.OnInitialized(); + } - IList data = new List + private void LoadData() { - new ScatterGl + Task.Run(async () => { - Name = "ScatterGlTrace", - Mode = Traces.ScatterGlLib.ModeFlag.Lines | Traces.ScatterGlLib.ModeFlag.Markers, - X = Enumerable.Range(0, 100000).Cast().ToList(), - Y = Helper.GenerateData(0, 100000).Y - } - }; + await chart.ExtendTrace(Enumerable.Range(0, 100000).Cast().ToList(), Helper.GenerateData(0, 100000).Y, 0); + }); + } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/ShapesChart.razor b/Plotly.Blazor.Examples/Components/ShapesChart.razor index 1a1b9c80..daf0a72f 100644 --- a/Plotly.Blazor.Examples/Components/ShapesChart.razor +++ b/Plotly.Blazor.Examples/Components/ShapesChart.razor @@ -2,7 +2,9 @@ @using Plotly.Blazor.LayoutLib.ShapeLib @using Plotly.Blazor.Traces.ScatterLib @using Line = Plotly.Blazor.LayoutLib.ShapeLib.Line - + + +
Remove Line Add Line @@ -10,86 +12,92 @@ @code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } - Config config = new() - { - Responsive = true - }; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Layout layout = new() + /// + protected override void OnInitialized() { - Title = new Title + config = new Config { - Text = "Scatter" - }, - YAxis = new List + Responsive = true + }; + + layout = new Layout { - new() + Title = new Title + { + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, + Shapes = new List { - Title = new LayoutLib.YAxisLib.Title + new() + { + Type = TypeEnum.Rect, + XRef = "x", + YRef = "y", + X0 = 20, + Y0 = 0, + X1 = 40, + Y1 = 100, + FillColor = "#d3d3d3", + Opacity = new decimal(0.3), + Line = new Line + { + Width = 0 + } + }, + new() { - Text = "Scatter Unit" + Type = TypeEnum.Rect, + XRef = "x", + YRef = "y", + X0 = 70, + Y0 = 0, + X1 = 90, + Y1 = 100, + FillColor = "#d3d3d3", + Opacity = new decimal(0.3), + Line = new Line + { + Width = 0 + } } } - }, + }; - Shapes = new List + data = new List { - new() + new Scatter { - Type = TypeEnum.Rect, - XRef = "x", - YRef = "y", - X0 = 20, - Y0 = 0, - X1 = 40, - Y1 = 100, - FillColor = "#d3d3d3", - Opacity = new decimal(0.3), - Line = new Line - { - Width = 0 - } + Name = "ScatterTrace", + Mode = ModeFlag.Lines | ModeFlag.Markers, + X = Enumerable.Range(0, 100).Cast().ToList(), + Y = Enumerable.Range(0, 100).Cast().ToList() }, - new() + new Scatter { - Type = TypeEnum.Rect, - XRef = "x", - YRef = "y", - X0 = 70, - Y0 = 0, - X1 = 90, - Y1 = 100, - FillColor = "#d3d3d3", - Opacity = new decimal(0.3), - Line = new Line - { - Width = 0 - } + Name = "TextTrace", + X = new List { 30, 80 }, + Y = new List { 50, 50 }, + TextArray = new List { "Test1", "Test2" }, + Mode = ModeFlag.Text } - }, - Height = 500 - }; + }; - List data = new() - { - new Scatter - { - Name = "ScatterTrace", - Mode = ModeFlag.Lines | ModeFlag.Markers, - X = Enumerable.Range(0, 100).Cast().ToList(), - Y = Enumerable.Range(0, 100).Cast().ToList() - }, - new Scatter - { - Name = "TextTrace", - X = new List { 30, 80 }, - Y = new List { 50, 50 }, - TextArray = new List { "Test1", "Test2" }, - Mode = ModeFlag.Text - } - }; + base.OnInitialized(); + } private void RemoveLine() { @@ -113,7 +121,8 @@ Y1 = 1, Line = new Line { - Width = 3 + Width = 3, + Color = "#d3d3d3" } }); _ = chart.Relayout(CancellationToken.None); diff --git a/Plotly.Blazor.Examples/Components/SmithChart.razor b/Plotly.Blazor.Examples/Components/SmithChart.razor index a60c97d3..41c36519 100644 --- a/Plotly.Blazor.Examples/Components/SmithChart.razor +++ b/Plotly.Blazor.Examples/Components/SmithChart.razor @@ -1,55 +1,69 @@ @using Plotly.Blazor.LayoutLib -@using Plotly.Blazor.LayoutLib.SmithLib @using Plotly.Blazor.Traces.ScatterSmithLib @using Plotly.Blazor.Traces.ScatterSmithLib.MarkerLib - + + @code { - PlotlyChart chart; + [CascadingParameter] + private MudTheme Theme { get; set; } - Config config = new Config - { - Responsive = true - }; + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; - Layout layout = new Layout + /// + protected override void OnInitialized() { - Title = new Title + config = new Config { - Text = "Smith" - }, - Height = 500, - Smith = new List { - new Smith { - RealAxis = new RealAxis { - GridColor = "red" - }, - ImaginaryAxis = new ImaginaryAxis { - GridColor = "blue" + Responsive = true + }; + + layout = new Layout + { + Title = new Title + { + Text = GetType().Name + }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, + Smith = new List + { + new() + { + BgColor = "rgb(48, 48, 48)" } } - } - }; + }; - List data = new List - { - new ScatterSmith + data = new List { - Real = new List {1}, - Imag = new List {1}, - Marker = new Marker + new ScatterSmith { - Symbol = SymbolEnum.X, - Size = 30 + Real = new List { 1 }, + Imag = new List { 1 }, + Marker = new Marker + { + Symbol = SymbolEnum.X, + Size = 30 + }, + Name = "Marker" }, - Name = "Marker" - }, - new ScatterSmith - { - Real = new List {0.5, 1, 2, 3}, - Imag = new List {0.5, 1, 2, 3}, - Name = "Series" - } - }; + new ScatterSmith + { + Real = new List { 0.5, 1, 2, 3 }, + Imag = new List { 0.5, 1, 2, 3 }, + Name = "Series" + } + }; + + base.OnInitialized(); + } } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Components/SurfaceChart.razor b/Plotly.Blazor.Examples/Components/SurfaceChart.razor index f52ca5d1..ef814fd8 100644 --- a/Plotly.Blazor.Examples/Components/SurfaceChart.razor +++ b/Plotly.Blazor.Examples/Components/SurfaceChart.razor @@ -1,25 +1,50 @@ -@using System.Globalization +@using Plotly.Blazor.LayoutLib +@using System.Globalization @inject NavigationManager MyNavigationManager - +@if (!IsInitialized) +{ + + + +} -@code { + - PlotlyChart plotlyChart; - Layout layout; - Config config; - IList data; +@code +{ + [CascadingParameter] + private MudTheme Theme { get; set; } + private PlotlyChart chart; + private Config config; + private Layout layout; + private IList data; + + private bool IsInitialized { get; set; } /// - public override async Task SetParametersAsync(ParameterView parameters) + protected override void OnInitialized() { + config = new Config + { + ShowLink = false, + Responsive = true, + DisplayLogo = false + }; + layout = new Layout { Title = new Title { Text = "Mt Bruno Elevation" }, + PaperBgColor = Theme.PaletteDark.Surface.ToString(), + PlotBgColor = Theme.PaletteDark.Surface.ToString(), + Font = new Font + { + Color = Theme.PaletteDark.TextPrimary.ToString() + }, Margin = new Margin { L = 65, @@ -29,26 +54,36 @@ } }; - config = new Config + data = new List(); + + base.OnInitialized(); + } + + private void LoadData() + { + Task.Run(async () => { - ShowLink = false, - Responsive = true, - DisplayLogo = false - }; - data = await GetMapData(); - await base.SetParametersAsync(ParameterView.Empty); + foreach (var trace in await GetMapData()) + { + await InvokeAsync(async () => await chart.AddTrace(trace)); + // Add the delay to keep the UI responsive + await Task.Delay(10); + } + IsInitialized = true; + await InvokeAsync(StateHasChanged); + }); } async Task> GetMapData() { IList mapData = new List(); - var client = new HttpClient + using var client = new HttpClient { BaseAddress = new Uri(MyNavigationManager.BaseUri) }; - var csv = (await client.GetStringAsync("/mt_bruno_elevation.csv")) + var csv = (await client.GetStringAsync($"{MyNavigationManager.BaseUri}mt_bruno_elevation.csv")) .Split("\n") .Skip(1) .Where(s => !string.IsNullOrWhiteSpace(s)) @@ -60,7 +95,7 @@ { var currentValues = new List(); - for(var i=1;i<25;i++) + for (var i = 1; i < 25; i++) { currentValues.Add(decimal.Parse(row[i], NumberStyles.Any, CultureInfo.InvariantCulture)); } @@ -68,12 +103,11 @@ z.Add(currentValues.ToArray()); } - mapData.Add(new Surface() + mapData.Add(new Surface { Z = z.Cast().ToList() }); return mapData; } - } \ No newline at end of file diff --git a/Plotly.Blazor.Examples/Plotly.Blazor.Examples.csproj b/Plotly.Blazor.Examples/Plotly.Blazor.Examples.csproj index 72e003f1..869cc321 100644 --- a/Plotly.Blazor.Examples/Plotly.Blazor.Examples.csproj +++ b/Plotly.Blazor.Examples/Plotly.Blazor.Examples.csproj @@ -38,4 +38,8 @@ Always + + + + diff --git a/Plotly.Blazor.Examples/Shared/CodeSnippet.razor b/Plotly.Blazor.Examples/Shared/CodeSnippet.razor index bf219f07..1421605e 100644 --- a/Plotly.Blazor.Examples/Shared/CodeSnippet.razor +++ b/Plotly.Blazor.Examples/Shared/CodeSnippet.razor @@ -1,4 +1,4 @@ -
@Code
+
@Code
@code { @@ -18,6 +18,7 @@ StateHasChanged(); } await JsRunTime.InvokeVoidAsync("onBlazorReady"); + await JsRunTime.InvokeVoidAsync("hljs.highlightAll"); } catch (Exception e) { diff --git a/Plotly.Blazor.Examples/Shared/Example.razor b/Plotly.Blazor.Examples/Shared/Example.razor index 8ea42c9c..fe601009 100644 --- a/Plotly.Blazor.Examples/Shared/Example.razor +++ b/Plotly.Blazor.Examples/Shared/Example.razor @@ -1,7 +1,7 @@ @Title - + @ChildContent diff --git a/Plotly.Blazor.Examples/Shared/NavMenu.razor b/Plotly.Blazor.Examples/Shared/NavMenu.razor index e313138a..02d5027c 100644 --- a/Plotly.Blazor.Examples/Shared/NavMenu.razor +++ b/Plotly.Blazor.Examples/Shared/NavMenu.razor @@ -5,9 +5,6 @@ - - Examples - Scatter Live Data diff --git a/Plotly.Blazor.Examples/wwwroot/css/highlight/github-dark.min.css b/Plotly.Blazor.Examples/wwwroot/css/highlight/github-dark.min.css new file mode 100644 index 00000000..03b6da8b --- /dev/null +++ b/Plotly.Blazor.Examples/wwwroot/css/highlight/github-dark.min.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: GitHub Dark + Description: Dark theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-dark + Current colors taken from GitHub's CSS +*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c} \ No newline at end of file diff --git a/Plotly.Blazor.Examples/wwwroot/index.html b/Plotly.Blazor.Examples/wwwroot/index.html index f95fd383..e0ff2ef3 100644 --- a/Plotly.Blazor.Examples/wwwroot/index.html +++ b/Plotly.Blazor.Examples/wwwroot/index.html @@ -10,6 +10,9 @@ + + + @@ -35,7 +38,6 @@ - diff --git a/Plotly.Blazor.Examples/wwwroot/js/highlight.min.js b/Plotly.Blazor.Examples/wwwroot/js/highlight.min.js index 385db622..085e87e3 100644 --- a/Plotly.Blazor.Examples/wwwroot/js/highlight.min.js +++ b/Plotly.Blazor.Examples/wwwroot/js/highlight.min.js @@ -1,44 +1,354 @@ -/* - Highlight.js 10.0.3 (a4b1bd2d) +/*! + Highlight.js v11.8.0 (git: 65687a907b) + (c) 2006-2023 undefined and other contributors License: BSD-3-Clause - Copyright (c) 2006-2020, Ivan Sagalaev -*/ -var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!n.hasOwnProperty(r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}function n(e){return e.replace(/&/g,"&").replace(//g,">")}function t(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach((function(e){for(n in e)t[n]=e[n]})),t}function r(e){return e.nodeName.toLowerCase()}var a=Object.freeze({__proto__:null,escapeHTML:n,inherit:t,nodeStream:function(e){var n=[];return function e(t,a){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=e(i,a),r(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n},mergeStreams:function(e,t,a){var i=0,s="",o=[];function l(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function u(e){s+=""}function d(e){("start"===e.event?c:u)(e.node)}for(;e.length||t.length;){var g=l();if(s+=n(a.substring(i,g[0].offset)),i=g[0].offset,g===e){o.reverse().forEach(u);do{d(g.splice(0,1)[0]),g=l()}while(g===e&&g.length&&g[0].offset===i);o.reverse().forEach(c)}else"start"===g[0].event?o.push(g[0].node):o.pop(),d(g.splice(0,1)[0])}return s+n(a.substr(i))}});const i="",s=e=>!!e.kind;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=n(e)}openNode(e){if(!s(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){s(e)&&(this.buffer+=i)}span(e){this.buffer+=``}value(){return this.buffer}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){e.children&&(e.children.every(e=>"string"==typeof e)?(e.text=e.children.join(""),delete e.children):e.children.forEach(e=>{"string"!=typeof e&&l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){let t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){}}function u(e){return e&&e.source||e}const d="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",g={begin:"\\\\[\\s\\S]",relevance:0},h={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[g]},f={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[g]},p={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},m=function(e,n,r){var a=t({className:"comment",begin:e,end:n,contains:[]},r||{});return a.contains.push(p),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),a},b=m("//","$"),v=m("/\\*","\\*/"),x=m("#","$");var _=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:d,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",BACKSLASH_ESCAPE:g,APOS_STRING_MODE:h,QUOTE_STRING_MODE:f,PHRASAL_WORDS_MODE:p,COMMENT:m,C_LINE_COMMENT_MODE:b,C_BLOCK_COMMENT_MODE:v,HASH_COMMENT_MODE:x,NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{className:"number",begin:d,relevance:0},BINARY_NUMBER_MODE:{className:"number",begin:"\\b(0b[01]+)",relevance:0},CSS_NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},REGEXP_MODE:{begin:/(?=\/[^\/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[g,{begin:/\[/,end:/\]/,relevance:0,contains:[g]}]}]},TITLE_MODE:{className:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0}}),E="of and for in not or if then".split(" ");function R(e,n){return n?+n:(t=e,E.includes(t.toLowerCase())?0:1);var t}const N=n,w=t,{nodeStream:y,mergeStreams:O}=a;return function(n){var r=[],a={},i={},s=[],o=!0,l=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,d="Could not find the language '{}', did you forget to load/include a language module?",g={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0,__emitter:c};function h(e){return g.noHighlightRe.test(e)}function f(e,n,t,r){var a={code:n,language:e};T("before:highlight",a);var i=a.result?a.result:p(a.language,a.code,t,r);return i.code=a.code,T("after:highlight",i),i}function p(e,n,r,i){var s=n;function l(e,n){var t=v.case_insensitive?n[0].toLowerCase():n[0];return e.keywords.hasOwnProperty(t)&&e.keywords[t]}function c(){null!=_.subLanguage?function(){if(""!==k){var e="string"==typeof _.subLanguage;if(!e||a[_.subLanguage]){var n=e?p(_.subLanguage,k,!0,E[_.subLanguage]):m(k,_.subLanguage.length?_.subLanguage:void 0);_.relevance>0&&(T+=n.relevance),e&&(E[_.subLanguage]=n.top),w.addSublanguage(n.emitter,n.language)}else w.addText(k)}}():function(){var e,n,t,r;if(_.keywords){for(n=0,_.lexemesRe.lastIndex=0,t=_.lexemesRe.exec(k),r="";t;){r+=k.substring(n,t.index);var a=null;(e=l(_,t))?(w.addText(r),r="",T+=e[1],a=e[0],w.addKeyword(t[0],a)):r+=t[0],n=_.lexemesRe.lastIndex,t=_.lexemesRe.exec(k)}r+=k.substr(n),w.addText(r)}else w.addText(k)}(),k=""}function h(e){e.className&&w.openNode(e.className),_=Object.create(e,{parent:{value:_}})}var f={};function b(n,t){var a,i=t&&t[0];if(k+=n,null==i)return c(),0;if("begin"==f.type&&"end"==t.type&&f.index==t.index&&""===i){if(k+=s.slice(t.index,t.index+1),!o)throw(a=Error("0 width match regex")).languageName=e,a.badRule=f.rule,a;return 1}if(f=t,"begin"===t.type)return function(e){var n=e[0],t=e.rule;return t.__onBegin&&(t.__onBegin(e)||{}).ignoreMatch?function(e){return 0===_.matcher.regexIndex?(k+=e[0],1):(B=!0,0)}(n):(t&&t.endSameAsBegin&&(t.endRe=RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),t.skip?k+=n:(t.excludeBegin&&(k+=n),c(),t.returnBegin||t.excludeBegin||(k=n)),h(t),t.returnBegin?0:n.length)}(t);if("illegal"===t.type&&!r)throw(a=Error('Illegal lexeme "'+i+'" for mode "'+(_.className||"")+'"')).mode=_,a;if("end"===t.type){var l=function(e){var n=e[0],t=s.substr(e.index),r=function e(n,t){if(function(e,n){var t=e&&e.exec(n);return t&&0===t.index}(n.endRe,t)){for(;n.endsParent&&n.parent;)n=n.parent;return n}if(n.endsWithParent)return e(n.parent,t)}(_,t);if(r){var a=_;a.skip?k+=n:(a.returnEnd||a.excludeEnd||(k+=n),c(),a.excludeEnd&&(k=n));do{_.className&&w.closeNode(),_.skip||_.subLanguage||(T+=_.relevance),_=_.parent}while(_!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),h(r.starts)),a.returnEnd?0:n.length}}(t);if(null!=l)return l}if("illegal"===t.type&&""===i)return 1;if(A>1e5&&A>3*t.index)throw Error("potential infinite loop, way more iterations than matches");return k+=i,i.length}var v=M(e);if(!v)throw console.error(d.replace("{}",e)),Error('Unknown language: "'+e+'"');!function(e){function n(n,t){return RegExp(u(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i0&&(a+="|"),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"==l[0][0]&&l[1]?a+="\\"+(+l[1]+s):(a+=l[0],"("==l[0]&&r++)}a+=")"}return a}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let n=this.matcherRe.exec(e);if(!n)return null;let t=n.findIndex((e,n)=>n>0&&null!=e),r=this.matchIndexes[t];return Object.assign(n,r)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let n=new r;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){let n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),t}}function i(e){let n=e.input[e.index-1],t=e.input[e.index+e[0].length];if("."===n||"."===t)return{ignoreMatch:!0}}if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");!function r(s,o){s.compiled||(s.compiled=!0,s.__onBegin=null,s.keywords=s.keywords||s.beginKeywords,s.keywords&&(s.keywords=function(e,n){var t={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(n){r(n,e[n])})),t;function r(e,r){n&&(r=r.toLowerCase()),r.split(" ").forEach((function(n){var r=n.split("|");t[r[0]]=[e,R(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemesRe=n(s.lexemes||/\w+/,!0),o&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__onBegin=i),s.begin||(s.begin=/\B|\b/),s.beginRe=n(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(s.endRe=n(s.end)),s.terminator_end=u(s.end)||"",s.endsWithParent&&o.terminator_end&&(s.terminator_end+=(s.end?"|":"")+o.terminator_end)),s.illegal&&(s.illegalRe=n(s.illegal)),null==s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(n){return t(e,{variants:null},n)}))),e.cached_variants?e.cached_variants:function e(n){return!!n&&(n.endsWithParent||e(n.starts))}(e)?t(e,{starts:e.starts?t(e.starts):null}):Object.isFrozen(e)?t(e):e}("self"===e?s:e)}))),s.contains.forEach((function(e){r(e,s)})),s.starts&&r(s.starts,o),s.matcher=function(e){let n=new a;return e.contains.forEach(e=>n.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&n.addRule(e.terminator_end,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(s))}(e)}(v);var x,_=i||v,E={},w=new g.__emitter(g);!function(){for(var e=[],n=_;n!==v;n=n.parent)n.className&&e.unshift(n.className);e.forEach(e=>w.openNode(e))}();var y,O,k="",T=0,L=0,A=0,B=!1;try{for(_.matcher.considerAll();A++,B?B=!1:(_.matcher.lastIndex=L,_.matcher.considerAll()),y=_.matcher.exec(s);)O=b(s.substring(L,y.index),y),L=y.index+O;return b(s.substr(L)),w.closeAllNodes(),w.finalize(),x=w.toHTML(),{relevance:T,value:x,language:e,illegal:!1,emitter:w,top:_}}catch(n){if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:n.message,context:s.slice(L-100,L+100),mode:n.mode},sofar:x,relevance:0,value:N(s),emitter:w};if(o)return{relevance:0,value:N(s),emitter:w,language:e,top:_,errorRaised:n};throw n}}function m(e,n){n=n||g.languages||Object.keys(a);var t=function(e){const n={relevance:0,emitter:new g.__emitter(g),value:N(e),illegal:!1,top:E};return n.emitter.addText(e),n}(e),r=t;return n.filter(M).filter(k).forEach((function(n){var a=p(n,e,!1);a.language=n,a.relevance>r.relevance&&(r=a),a.relevance>t.relevance&&(r=t,t=a)})),r.language&&(t.second_best=r),t}function b(e){return g.tabReplace||g.useBR?e.replace(l,(function(e,n){return g.useBR&&"\n"===e?"
":g.tabReplace?n.replace(/\t/g,g.tabReplace):""})):e}function v(e){var n,t,r,a,s,o=function(e){var n,t=e.className+" ";if(t+=e.parentNode?e.parentNode.className:"",n=g.languageDetectRe.exec(t)){var r=M(n[1]);return r||(console.warn(d.replace("{}",n[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>h(e)||M(e))}(e);h(o)||(T("before:highlightBlock",{block:e,language:o}),g.useBR?(n=document.createElement("div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"):n=e,s=n.textContent,r=o?f(o,s,!0):m(s),(t=y(n)).length&&((a=document.createElement("div")).innerHTML=r.value,r.value=O(t,y(a),s)),r.value=b(r.value),T("after:highlightBlock",{block:e,result:r}),e.innerHTML=r.value,e.className=function(e,n,t){var r=n?i[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),e.includes(r)||a.push(r),a.join(" ").trim()}(e.className,o,r.language),e.result={language:r.language,re:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance}))}function x(){if(!x.called){x.called=!0;var e=document.querySelectorAll("pre code");r.forEach.call(e,v)}}const E={disableAutodetect:!0,name:"Plain text"};function M(e){return e=(e||"").toLowerCase(),a[e]||a[i[e]]}function k(e){var n=M(e);return n&&!n.disableAutodetect}function T(e,n){var t=e;s.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(n,{highlight:f,highlightAuto:m,fixMarkup:b,highlightBlock:v,configure:function(e){g=w(g,e)},initHighlighting:x,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",x,!1)},registerLanguage:function(e,t){var r;try{r=t(n)}catch(n){if(console.error("Language definition for '{}' could not be registered.".replace("{}",e)),!o)throw n;console.error(n),r=E}r.name||(r.name=e),a[e]=r,r.rawDefinition=t.bind(null,n),r.aliases&&r.aliases.forEach((function(n){i[n]=e}))},listLanguages:function(){return Object.keys(a)},getLanguage:M,requireLanguage:function(e){var n=M(e);if(n)return n;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:k,inherit:w,addPlugin:function(e,n){s.push(e)}}),n.debugMode=function(){o=!1},n.safeMode=function(){o=!0},n.versionString="10.0.3";for(const n in _)"object"==typeof _[n]&&e(_[n]);return Object.assign(n,_),n}({})}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); -hljs.registerLanguage("apache",function(){"use strict";return function(e){var n={className:"number",begin:"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?"};return{name:"Apache config",aliases:["apacheconf"],case_insensitive:!0,contains:[e.HASH_COMMENT_MODE,{className:"section",begin:"",contains:[n,{className:"number",begin:":\\d{1,5}"},e.inherit(e.QUOTE_STRING_MODE,{relevance:0})]},{className:"attribute",begin:/\w+/,relevance:0,keywords:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{end:/$/,relevance:0,keywords:{literal:"on off all deny allow"},contains:[{className:"meta",begin:"\\s\\[",end:"\\]$"},{className:"variable",begin:"[\\$%]\\{",end:"\\}",contains:["self",{className:"number",begin:"[\\$%]\\d+"}]},n,{className:"number",begin:"\\d+"},e.QUOTE_STRING_MODE]}}],illegal:/\S/}}}()); -hljs.registerLanguage("bash",function(){"use strict";return function(e){const s={};Object.assign(s,{className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{/,end:/\}/,contains:[{begin:/:-/,contains:[s]}]}]});const n={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},t={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,n]};n.contains.push(t);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,s]};return{name:"Bash",aliases:["sh","zsh"],lexemes:/\b-?[a-z\._]+\b/,keywords:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[{className:"meta",begin:/^#![^\n]+sh\s*$/,relevance:10},{className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},a,e.HASH_COMMENT_MODE,t,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},s]}}}()); -hljs.registerLanguage("c-like",function(){"use strict";return function(e){function t(e){return"(?:"+e+")?"}var n="(decltype\\(auto\\)|"+t("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+t("<.*?>")+")",r={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},{begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\((?:.|\n)*?\)\1"/}]},s={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t("[a-zA-Z_]\\w*::")+e.IDENT_RE,relevance:0},o=t("[a-zA-Z_]\\w*::")+e.IDENT_RE+"\\s*\\(",l={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary",literal:"true false nullptr NULL"},d=[r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,a],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:l,contains:d.concat([{begin:/\(/,end:/\)/,keywords:l,contains:d.concat(["self"]),relevance:0}]),relevance:0},u={className:"function",begin:"("+n+"[\\*&\\s]+)+"+o,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:l,illegal:/[^\w\s\*&:<>]/,contains:[{begin:"decltype\\(auto\\)",keywords:l,relevance:0},{begin:o,returnBegin:!0,contains:[c],relevance:0},{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,r,{begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:["self",e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,r]}]},r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i]};return{aliases:["c","cc","h","c++","h++","hpp","hh","hxx","cxx"],keywords:l,disableAutodetect:!0,illegal:"",keywords:l,contains:["self",r]},{begin:e.IDENT_RE+"::",keywords:l},{className:"class",beginKeywords:"class struct",end:/[{;:]/,contains:[{begin://,contains:["self"]},e.TITLE_MODE]}]),exports:{preprocessor:i,strings:a,keywords:l}}}}()); -hljs.registerLanguage("c",function(){"use strict";return function(e){var n=e.getLanguage("c-like").rawDefinition();return n.name="C",n.aliases=["c","h"],n}}()); -hljs.registerLanguage("coffeescript",function(){"use strict";return function(e){var n={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",built_in:"npm require console print module global window document"},i="[A-Za-z$_][0-9A-Za-z$_]*",s={className:"subst",begin:/#\{/,end:/}/,keywords:n},a=[e.BINARY_NUMBER_MODE,e.inherit(e.C_NUMBER_MODE,{starts:{end:"(\\s*/)?",relevance:0}}),{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[e.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s]},{begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s]}]},{className:"regexp",variants:[{begin:"///",end:"///",contains:[s,e.HASH_COMMENT_MODE]},{begin:"//[gim]{0,3}(?=\\W)",relevance:0},{begin:/\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/}]},{begin:"@"+i},{subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,variants:[{begin:"```",end:"```"},{begin:"`",end:"`"}]}];s.contains=a;var t=e.inherit(e.TITLE_MODE,{begin:i}),r={className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:n,contains:["self"].concat(a)}]};return{name:"CoffeeScript",aliases:["coffee","cson","iced"],keywords:n,illegal:/\/\*/,contains:a.concat([e.COMMENT("###","###"),e.HASH_COMMENT_MODE,{className:"function",begin:"^\\s*"+i+"\\s*=\\s*(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:!0,contains:[t,r]},{begin:/[:\(,=]\s*/,relevance:0,contains:[{className:"function",begin:"(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:!0,contains:[r]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[t]},t]},{begin:i+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}}()); -hljs.registerLanguage("cpp",function(){"use strict";return function(e){var t=e.getLanguage("c-like").rawDefinition();return t.disableAutodetect=!1,t.name="C++",t.aliases=["cc","c++","h++","hpp","hh","hxx","cxx"],t}}()); -hljs.registerLanguage("csharp",function(){"use strict";return function(e){var n={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let nameof on orderby partial remove select set value var when where yield",literal:"null false true"},i=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},t=e.inherit(s,{illegal:/\n/}),l={className:"subst",begin:"{",end:"}",keywords:n},r=e.inherit(l,{illegal:/\n/}),c={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:"{{"},{begin:"}}"},e.BACKSLASH_ESCAPE,r]},o={className:"string",begin:/\$@"/,end:'"',contains:[{begin:"{{"},{begin:"}}"},{begin:'""'},l]},g=e.inherit(o,{illegal:/\n/,contains:[{begin:"{{"},{begin:"}}"},{begin:'""'},r]});l.contains=[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],r.contains=[g,c,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];var d={variants:[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},d,a,{beginKeywords:"class interface",end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},i,{begin:"<",end:">",keywords:"in out"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"meta-string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+e.IDENT_RE+"\\s*\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{begin:e.IDENT_RE+"\\s*\\(",returnBegin:!0,contains:[e.TITLE_MODE],relevance:0},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0,contains:[d,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}}()); -hljs.registerLanguage("css",function(){"use strict";return function(e){var n={begin:/(?:[A-Z\_\.\-]+|--[a-zA-Z0-9_-]+)\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[{className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[{begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}}]};return{name:"CSS",case_insensitive:!0,illegal:/[=\/|'\$]/,contains:[e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/},{className:"selector-class",begin:/\.[A-Za-z0-9_-]+/},{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"@(page|font-face)",lexemes:"@[a-z-]+",keywords:"@page @font-face"},{begin:"@",end:"[{;]",illegal:/:/,returnBegin:!0,contains:[{className:"keyword",begin:/@\-?\w[\w]*(\-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:"and or not only",contains:[{begin:/[a-z-]+:/,className:"attribute"},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[e.C_BLOCK_COMMENT_MODE,n]}]}}}()); -hljs.registerLanguage("diff",function(){"use strict";return function(e){return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{begin:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{begin:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{className:"comment",variants:[{begin:/Index: /,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^\-{3}/,end:/$/},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/}]},{className:"addition",begin:"^\\+",end:"$"},{className:"deletion",begin:"^\\-",end:"$"},{className:"addition",begin:"^\\!",end:"$"}]}}}()); -hljs.registerLanguage("go",function(){"use strict";return function(e){var n={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{name:"Go",aliases:["golang"],keywords:n,illegal:")?\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:a,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"number",begin:"\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",relevance:0},n]}}}()); -hljs.registerLanguage("javascript",function(){"use strict";return function(e){var n={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/},a="[A-Za-z$_][0-9A-Za-z$_]*",s={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},r={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:e.C_NUMBER_RE+"n?"}],relevance:0},i={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},t={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,i],subLanguage:"xml"}},c={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,i],subLanguage:"css"}},o={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,i]};i.contains=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,t,c,o,r,e.REGEXP_MODE];var l=i.contains.concat([e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]),d={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:l};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,contains:[{className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},{className:"meta",begin:/^#!/,end:/$/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,t,c,o,e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,r,{begin:/[{,\n]\s*/,relevance:0,contains:[{begin:a+"\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:a,relevance:0}]}]},{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+a+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:a},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:l}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:"<>",end:""},{begin:n.begin,end:n.end}],subLanguage:"xml",contains:[{begin:n.begin,end:n.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:a}),d],illegal:/\[|%/},{begin:/\$[(.]/},e.METHOD_GUARD,{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0},{begin:"(get|set)\\s+(?="+a+"\\()",end:/{/,keywords:"get set",contains:[e.inherit(e.TITLE_MODE,{begin:a}),{begin:/\(\)/},d]}],illegal:/#(?!!)/}}}()); -hljs.registerLanguage("json",function(){"use strict";return function(n){var e={literal:"true false null"},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],t=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:t,keywords:e},l={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(a,{begin:/:/})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(a)],illegal:"\\S"};return t.push(l,s),i.forEach((function(n){t.push(n)})),{name:"JSON",contains:t,keywords:e,illegal:"\\S"}}}()); -hljs.registerLanguage("kotlin",function(){"use strict";return function(e){var n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual trait volatile transient native default",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:"\\${",end:"}",contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},t={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(t);var r={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(t,{className:"meta-string"})]}]},c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),o={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=o;return d.variants[1].contains=[o],o.variants[1].contains=[d],{name:"Kotlin",aliases:["kt"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},a,r,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,illegal:/fun\s+(<.*>)?[^\s\(]+(\s+[^\s\(]+)\s*=/,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[o,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,r,l,t,e.C_NUMBER_MODE]},c]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},r,l]},t,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},{className:"number",begin:"\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",relevance:0}]}}}()); -hljs.registerLanguage("less",function(){"use strict";return function(e){var n="([\\w-]+|@{[\\w-]+})",a=[],s=[],t=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},r=function(e,n,a){return{className:e,begin:n,relevance:a}},i={begin:"\\(",end:"\\)",contains:s,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t("'"),t('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},r("number","#[0-9A-Fa-f]+\\b"),i,r("variable","@@?[\\w-]+",10),r("variable","@{[\\w-]+}"),r("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},{className:"meta",begin:"!important"});var c=s.concat({begin:"{",end:"}",contains:a}),l={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},o={begin:n+"\\s*:",returnBegin:!0,end:"[;}]",relevance:0,contains:[{className:"attribute",begin:n,end:":",excludeEnd:!0,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",returnEnd:!0,contains:s,relevance:0}},d={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:c}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:n,end:"{"}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l,r("keyword","all\\b"),r("variable","@{[\\w-]+}"),r("selector-tag",n+"%?",0),r("selector-id","#"+n),r("selector-class","\\."+n,0),r("selector-tag","&",0),{className:"selector-attr",begin:"\\[",end:"\\]"},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"\\(",end:"\\)",contains:c},{begin:"!important"}]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,d,o,b),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:a}}}()); -hljs.registerLanguage("lua",function(){"use strict";return function(e){var t={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},a=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[t],relevance:10})];return{name:"Lua",lexemes:e.UNDERSCORE_IDENT_RE,keywords:{literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[t],relevance:5}])}}}()); -hljs.registerLanguage("makefile",function(){"use strict";return function(e){var i={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:"",relevance:10,contains:[a,i,t,s,{begin:"\\[",end:"\\]",contains:[{className:"meta",begin:"",contains:[a,s,i,t]}]}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:")",end:">",keywords:{name:"style"},contains:[c],starts:{end:"",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:")",end:">",keywords:{name:"script"},contains:[c],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:"",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},c]}]}}}()); -hljs.registerLanguage("markdown",function(){"use strict";return function(n){const e={begin:"<",end:">",subLanguage:"xml",relevance:0},a={begin:"\\[.+?\\][\\(\\[].*?[\\)\\]]",returnBegin:!0,contains:[{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0,relevance:0},{className:"link",begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}],relevance:10},i={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},s={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};i.contains.push(s),s.contains.push(i);var c=[e,a];return i.contains=i.contains.concat(c),s.contains=s.contains.concat(c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:c=c.concat(i,s)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:c}]}]},e,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:c,end:"$"},{className:"code",variants:[{begin:"(`{3,})(.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})(.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}}()); -hljs.registerLanguage("nginx",function(){"use strict";return function(e){var n={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{/,end:/}/},{begin:"[\\$\\@]"+e.UNDERSCORE_IDENT_RE}]},a={endsWithParent:!0,lexemes:"[a-z/_]+",keywords:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[n]},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:"\\s\\^",end:"\\s|{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|{|;",returnEnd:!0},{begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0},n]};return{name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{begin:e.UNDERSCORE_IDENT_RE+"\\s+{",returnBegin:!0,end:"{",contains:[{className:"section",begin:e.UNDERSCORE_IDENT_RE}],relevance:0},{begin:e.UNDERSCORE_IDENT_RE+"\\s",end:";|{",returnBegin:!0,contains:[{className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:a}],relevance:0}],illegal:"[^\\s\\}]"}}}()); -hljs.registerLanguage("objectivec",function(){"use strict";return function(e){var n=/[a-zA-Z@][a-zA-Z0-9_]*/,_="@interface @class @protocol @implementation";return{name:"Objective-C",aliases:["mm","objc","obj-c"],keywords:{keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},lexemes:n,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+_.split(" ").join("|")+")\\b",end:"({|$)",excludeEnd:!0,keywords:_,lexemes:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}}()); -hljs.registerLanguage("perl",function(){"use strict";return function(e){var n="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmget sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",t={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},s={begin:"->{",end:"}"},r={variants:[{begin:/\$\d/},{begin:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{begin:/[\$%@][^\s\w{]/,relevance:0}]},i=[e.BACKSLASH_ESCAPE,t,r],a=[r,e.HASH_COMMENT_MODE,e.COMMENT("^\\=\\w","\\=cut",{endsWithParent:!0}),s,{className:"string",contains:i,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*\\<",end:"\\>",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:"{\\w+}",contains:[],relevance:0},{begin:"-?\\w+\\s*\\=\\>",contains:[],relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",begin:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",relevance:10},{className:"regexp",begin:"(m|qr)?/",end:"/[a-z]*",contains:[e.BACKSLASH_ESCAPE],relevance:0}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return t.contains=a,s.contains=a,{name:"Perl",aliases:["pl","pm"],lexemes:/[\w\.]+/,keywords:n,contains:a}}}()); -hljs.registerLanguage("php",function(){"use strict";return function(e){var r={begin:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},t={className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},a={className:"string",contains:[e.BACKSLASH_ESCAPE,t],variants:[{begin:'b"',end:'"'},{begin:"b'",end:"'"},e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},n={variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]},i={keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list new object or private protected public real return string switch throw trait try unset use var void while xor yield",literal:"false null true",built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Throwable Traversable WeakReference Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass"};return{aliases:["php","php3","php4","php5","php6","php7"],case_insensitive:!0,keywords:i,contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[t]}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler",lexemes:e.UNDERSCORE_IDENT_RE}),{className:"string",begin:/<<<['"]?\w+['"]?$/,end:/^\w+;?$/,contains:[e.BACKSLASH_ESCAPE,{className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]}]},t,{className:"keyword",begin:/\$this\b/},r,{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[e.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",r,e.C_BLOCK_COMMENT_MODE,a,n]}]},{className:"class",beginKeywords:"class interface",end:"{",excludeEnd:!0,illegal:/[:\(\$"]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",end:";",illegal:/[\.']/,contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",end:";",contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"=>"},a,n]}}}()); -hljs.registerLanguage("php-template",function(){"use strict";return function(n){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}}()); -hljs.registerLanguage("plaintext",function(){"use strict";return function(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}}()); -hljs.registerLanguage("properties",function(){"use strict";return function(e){var n="[ \\t\\f]*",t="("+n+"[:=]"+n+"|[ \\t\\f]+)",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",s={end:t,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\n"}]}};return{name:".properties",case_insensitive:!0,illegal:/\S/,contains:[e.COMMENT("^\\s*[!#]","$"),{begin:"([^\\\\\\W:= \\t\\f\\n]|\\\\.)+"+t,returnBegin:!0,contains:[{className:"attr",begin:"([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",endsParent:!0,relevance:0}],starts:s},{begin:a+t,returnBegin:!0,relevance:0,contains:[{className:"meta",begin:a,endsParent:!0,relevance:0}],starts:s},{className:"attr",relevance:0,begin:a+n+"$"}]}}}()); -hljs.registerLanguage("python",function(){"use strict";return function(e){var n={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10",built_in:"Ellipsis NotImplemented",literal:"False None True"},a={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:n,illegal:/#/},s={begin:/\{\{/,relevance:0},r={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/(u|b)?r?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(u|b)?r?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(fr|rf|f)'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(fr|rf|f)"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(u|r|ur)'/,end:/'/,relevance:10},{begin:/(u|r|ur)"/,end:/"/,relevance:10},{begin:/(b|br)'/,end:/'/},{begin:/(b|br)"/,end:/"/},{begin:/(fr|rf|f)'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/(fr|rf|f)"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l={className:"number",relevance:0,variants:[{begin:e.BINARY_NUMBER_RE+"[lLjJ]?"},{begin:"\\b(0o[0-7]+)[lLjJ]?"},{begin:e.C_NUMBER_RE+"[lLjJ]?"}]},t={className:"params",variants:[{begin:/\(\s*\)/,skip:!0,className:null},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:["self",a,l,r,e.HASH_COMMENT_MODE]}]};return i.contains=[r,l,a],{name:"Python",aliases:["py","gyp","ipython"],keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[a,l,{beginKeywords:"if",relevance:0},r,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,t,{begin:/->/,endsWithParent:!0,keywords:"None"}]},{className:"meta",begin:/^[\t ]*@/,end:/$/},{begin:/\b(print|exec)\(/}]}}}()); -hljs.registerLanguage("python-repl",function(){"use strict";return function(n){return{aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}}()); -hljs.registerLanguage("ruby",function(){"use strict";return function(e){var n="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",a={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},s={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},r=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^\\=begin","^\\=end",{contains:[s],relevance:10}),e.COMMENT("^__END__","\\n$")],c={className:"subst",begin:"#\\{",end:"}",keywords:a},t={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[qQwWx]?\\(",end:"\\)"},{begin:"%[qQwWx]?\\[",end:"\\]"},{begin:"%[qQwWx]?{",end:"}"},{begin:"%[qQwWx]?<",end:">"},{begin:"%[qQwWx]?/",end:"/"},{begin:"%[qQwWx]?%",end:"%"},{begin:"%[qQwWx]?-",end:"-"},{begin:"%[qQwWx]?\\|",end:"\\|"},{begin:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{begin:/<<[-~]?'?(\w+)(?:.|\n)*?\n\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},{begin:/\w+/,endSameAsBegin:!0,contains:[e.BACKSLASH_ESCAPE,c]}]}]},b={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:a},d=[t,i,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE}]}].concat(r)},{className:"function",beginKeywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),b].concat(r)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(\\!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[t,{begin:n}],relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{className:"params",begin:/\|/,end:/\|/,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[i,{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r{",end:"}[a-z]*"},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(r),relevance:0}].concat(r);c.contains=d,b.contains=d;var g=[{begin:/^\s*=>/,starts:{end:"$",contains:d}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{end:"$",contains:d}}];return{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:r.concat(g).concat(d)}}}()); -hljs.registerLanguage("rust",function(){"use strict";return function(e){var n="([ui](8|16|32|64|128|size)|f(32|64))?",t="drop i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 str char bool Box Option Result String Vec Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator SliceConcatExt ToString assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!";return{name:"Rust",aliases:["rs"],keywords:{keyword:"abstract as async await become box break const continue crate do dyn else enum extern false final fn for if impl in let loop macro match mod move mut override priv pub ref return self Self static struct super trait true try type typeof unsafe unsized use virtual where while yield",literal:"true false Some None Ok Err",built_in:t},lexemes:e.IDENT_RE+"!?",illegal:""}]}}}()); -hljs.registerLanguage("scss",function(){"use strict";return function(e){var t={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"},i={className:"number",begin:"#[0-9A-Fa-f]+"};return e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:"\\#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},{className:"selector-attr",begin:"\\[",end:"\\]",illegal:"$"},{className:"selector-tag",begin:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",relevance:0},{className:"selector-pseudo",begin:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{className:"selector-pseudo",begin:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},t,{className:"attribute",begin:"\\b(src|z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",illegal:"[^\\s]"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:":",end:";",contains:[t,i,e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"meta",begin:"!important"}]},{begin:"@(page|font-face)",lexemes:"@[a-z-]+",keywords:"@page @font-face"},{begin:"@",end:"[{;]",returnBegin:!0,keywords:"and or not only",contains:[{begin:"@[a-z-]+",className:"keyword"},t,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i,e.CSS_NUMBER_MODE]}]}}}()); -hljs.registerLanguage("shell",function(){"use strict";return function(s){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:"^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]",starts:{end:"$",subLanguage:"bash"}}]}}}()); -hljs.registerLanguage("sql",function(){"use strict";return function(e){var t=e.COMMENT("--","$");return{name:"SQL",case_insensitive:!0,illegal:/[<>{}*]/,contains:[{beginKeywords:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment values with",end:/;/,endsWithParent:!0,lexemes:/[\w\.]+/,keywords:{keyword:"as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias all allocate allow alter always analyze ancillary and anti any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound bucket buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain explode export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour hours http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lateral lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minutes minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second seconds section securefile security seed segment select self semi sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tablesample tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace window with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null unknown",built_in:"array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp tinyint varchar varchar2 varying void"},contains:[{className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},{className:"string",begin:'"',end:'"',contains:[{begin:'""'}]},{className:"string",begin:"`",end:"`"},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,e.HASH_COMMENT_MODE]},e.C_BLOCK_COMMENT_MODE,t,e.HASH_COMMENT_MODE]}}}()); -hljs.registerLanguage("swift",function(){"use strict";return function(e){var i={keyword:"#available #colorLiteral #column #else #elseif #endif #file #fileLiteral #function #if #imageLiteral #line #selector #sourceLocation _ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype associativity break case catch class continue convenience default defer deinit didSet do dynamic dynamicType else enum extension fallthrough false fileprivate final for func get guard if import in indirect infix init inout internal is lazy left let mutating nil none nonmutating open operator optional override postfix precedence prefix private protocol Protocol public repeat required rethrows return right self Self set static struct subscript super switch throw throws true try try! try? Type typealias unowned var weak where while willSet",literal:"true false nil",built_in:"abs advance alignof alignofValue anyGenerator assert assertionFailure bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords enumerate equal fatalError filter find getBridgedObjectiveCType getVaList indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare map max maxElement min minElement numericCast overlaps partition posix precondition preconditionFailure print println quickSort readLine reduce reflect reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split startsWith stride strideof strideofValue swap toString transcode underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers withUnsafePointer withUnsafePointers withVaList zip"},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),t={className:"subst",begin:/\\\(/,end:"\\)",keywords:i,contains:[]},a={className:"string",contains:[e.BACKSLASH_ESCAPE,t],variants:[{begin:/"""/,end:/"""/},{begin:/"/,end:/"/}]},r={className:"number",begin:"\\b([\\d_]+(\\.[\\deE_]+)?|0x[a-fA-F0-9_]+(\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b",relevance:0};return t.contains=[r],{name:"Swift",keywords:i,contains:[a,e.C_LINE_COMMENT_MODE,n,{className:"type",begin:"\\b[A-Z][\\wÀ-ʸ']*[!?]"},{className:"type",begin:"\\b[A-Z][\\wÀ-ʸ']*",relevance:0},r,{className:"function",beginKeywords:"func",end:"{",excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/}),{begin://},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,contains:["self",r,a,e.C_BLOCK_COMMENT_MODE,{begin:":"}],illegal:/["']/}],illegal:/\[|%/},{className:"class",beginKeywords:"struct protocol class extension enum",keywords:i,end:"\\{",excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/})]},{className:"meta",begin:"(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|@infix|@prefix|@postfix|@autoclosure|@testable|@available|@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|@propertyWrapper)"},{beginKeywords:"import",end:/$/,contains:[e.C_LINE_COMMENT_MODE,n]}]}}}()); -hljs.registerLanguage("typescript",function(){"use strict";return function(e){var n={keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private protected get set super static implements enum export import declare type namespace abstract as from extends async await",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void Promise"},r={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},a={begin:"\\(",end:/\)/,keywords:n,contains:["self",e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.NUMBER_MODE]},t={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,r,a]},s={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:e.C_NUMBER_RE+"n?"}],relevance:0},i={className:"subst",begin:"\\$\\{",end:"\\}",keywords:n,contains:[]},o={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,i],subLanguage:"xml"}},c={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,i],subLanguage:"css"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,i]};return i.contains=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,o,c,E,s,e.REGEXP_MODE],{name:"TypeScript",aliases:["ts"],keywords:n,contains:[{className:"meta",begin:/^\s*['"]use strict['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,o,c,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+e.IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.IDENT_RE},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:["self",e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[\{;]/,excludeEnd:!0,keywords:n,contains:["self",e.inherit(e.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*"}),t],illegal:/%/,relevance:0},{beginKeywords:"constructor",end:/[\{;]/,excludeEnd:!0,contains:["self",t]},{begin:/module\./,keywords:{built_in:"module"},relevance:0},{beginKeywords:"module",end:/\{/,excludeEnd:!0},{beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:"interface extends"},{begin:/\$[(.]/},{begin:"\\."+e.IDENT_RE,relevance:0},r,a]}}}()); -hljs.registerLanguage("yaml",function(){"use strict";return function(e){var n={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:"{{",end:"}}"},{begin:"%{",end:"}"}]}]};return{name:"YAML",case_insensitive:!0,aliases:["yml","YAML"],contains:[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---s*$",relevance:10},{className:"string",begin:"[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!"+e.UNDERSCORE_IDENT_RE},{className:"type",begin:"!!"+e.UNDERSCORE_IDENT_RE},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"\\-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b"},n]}}}()); \ No newline at end of file + */ +var hljs=function(){"use strict";function e(t){ +return t instanceof Map?t.clear=t.delete=t.set=()=>{ +throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{ +throw Error("set is read-only") +}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>{ +const i=t[n],s=typeof i;"object"!==s&&"function"!==s||Object.isFrozen(i)||e(i) +})),t}class t{constructor(e){ +void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} +ignoreMatch(){this.isMatchIgnored=!0}}function n(e){ +return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") +}function i(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] +;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const s=e=>!!e.scope +;class o{constructor(e,t){ +this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ +this.buffer+=n(e)}openNode(e){if(!s(e))return;const t=((e,{prefix:t})=>{ +if(e.startsWith("language:"))return e.replace("language:","language-") +;if(e.includes(".")){const n=e.split(".") +;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") +}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)} +closeNode(e){s(e)&&(this.buffer+="
")}value(){return this.buffer}span(e){ +this.buffer+=``}}const r=(e={})=>{const t={children:[]} +;return Object.assign(t,e),t};class a{constructor(){ +this.rootNode=r(),this.stack=[this.rootNode]}get top(){ +return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ +this.top.children.push(e)}openNode(e){const t=r({scope:e}) +;this.add(t),this.stack.push(t)}closeNode(){ +if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ +for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} +walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ +return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), +t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ +"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ +a._collapse(e)})))}}class c extends a{constructor(e){super(),this.options=e} +addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){ +this.closeNode()}__addSublanguage(e,t){const n=e.root +;t&&(n.scope="language:"+t),this.add(n)}toHTML(){ +return new o(this,this.options).value()}finalize(){ +return this.closeAllNodes(),!0}}function l(e){ +return e?"string"==typeof e?e:e.source:null}function g(e){return h("(?=",e,")")} +function u(e){return h("(?:",e,")*")}function d(e){return h("(?:",e,")?")} +function h(...e){return e.map((e=>l(e))).join("")}function f(...e){const t=(e=>{ +const t=e[e.length-1] +;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} +})(e);return"("+(t.capture?"":"?:")+e.map((e=>l(e))).join("|")+")"} +function p(e){return RegExp(e.toString()+"|").exec("").length-1} +const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ +;function m(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n +;let i=l(e),s="";for(;i.length>0;){const e=b.exec(i);if(!e){s+=i;break} +s+=i.substring(0,e.index), +i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+t):(s+=e[0], +"("===e[0]&&n++)}return s})).map((e=>`(${e})`)).join(t)} +const E="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",O={ +begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'", +illegal:"\\n",contains:[O]},N={scope:"string",begin:'"',end:'"',illegal:"\\n", +contains:[O]},S=(e,t,n={})=>{const s=i({scope:"comment",begin:e,end:t, +contains:[]},n);s.contains.push({scope:"doctag", +begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", +end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) +;const o=f("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) +;return s.contains.push({begin:h(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s +},v=S("//","$"),M=S("/\\*","\\*/"),R=S("#","$");var j=Object.freeze({ +__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:E,UNDERSCORE_IDENT_RE:x, +NUMBER_RE:w,C_NUMBER_RE:y,BINARY_NUMBER_RE:_, +RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", +SHEBANG:(e={})=>{const t=/^#![ ]*\// +;return e.binary&&(e.begin=h(t,/.*\b/,e.binary,/\b.*/)),i({scope:"meta",begin:t, +end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, +BACKSLASH_ESCAPE:O,APOS_STRING_MODE:k,QUOTE_STRING_MODE:N,PHRASAL_WORDS_MODE:{ +begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ +},COMMENT:S,C_LINE_COMMENT_MODE:v,C_BLOCK_COMMENT_MODE:M,HASH_COMMENT_MODE:R, +NUMBER_MODE:{scope:"number",begin:w,relevance:0},C_NUMBER_MODE:{scope:"number", +begin:y,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:_,relevance:0}, +REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, +end:/\/[gimuy]*/,illegal:/\n/,contains:[O,{begin:/\[/,end:/\]/,relevance:0, +contains:[O]}]}]},TITLE_MODE:{scope:"title",begin:E,relevance:0}, +UNDERSCORE_TITLE_MODE:{scope:"title",begin:x,relevance:0},METHOD_GUARD:{ +begin:"\\.\\s*"+x,relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ +"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ +t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function A(e,t){ +"."===e.input[e.index-1]&&t.ignoreMatch()}function I(e,t){ +void 0!==e.className&&(e.scope=e.className,delete e.className)}function T(e,t){ +t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", +e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, +void 0===e.relevance&&(e.relevance=0))}function L(e,t){ +Array.isArray(e.illegal)&&(e.illegal=f(...e.illegal))}function B(e,t){ +if(e.match){ +if(e.begin||e.end)throw Error("begin & end are not supported with match") +;e.begin=e.match,delete e.match}}function P(e,t){ +void 0===e.relevance&&(e.relevance=1)}const D=(e,t)=>{if(!e.beforeMatch)return +;if(e.starts)throw Error("beforeMatch cannot be used with starts") +;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] +})),e.keywords=n.keywords,e.begin=h(n.beforeMatch,g(n.begin)),e.starts={ +relevance:0,contains:[Object.assign(n,{endsParent:!0})] +},e.relevance=0,delete n.beforeMatch +},H=["of","and","for","in","not","or","if","then","parent","list","value"],C="keyword" +;function $(e,t,n=C){const i=Object.create(null) +;return"string"==typeof e?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach((n=>{ +Object.assign(i,$(e[n],t,n))})),i;function s(e,n){ +t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") +;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ +return t?Number(t):(e=>H.includes(e.toLowerCase()))(e)?0:1}const z={},W=e=>{ +console.error(e)},X=(e,...t)=>{console.log("WARN: "+e,...t)},G=(e,t)=>{ +z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0) +},K=Error();function F(e,t,{key:n}){let i=0;const s=e[n],o={},r={} +;for(let e=1;e<=t.length;e++)r[e+i]=s[e],o[e+i]=!0,i+=p(t[e-1]) +;e[n]=r,e[n]._emit=o,e[n]._multi=!0}function Z(e){(e=>{ +e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, +delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ +_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope +}),(e=>{if(Array.isArray(e.begin)){ +if(e.skip||e.excludeBegin||e.returnBegin)throw W("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), +K +;if("object"!=typeof e.beginScope||null===e.beginScope)throw W("beginScope must be object"), +K;F(e,e.begin,{key:"beginScope"}),e.begin=m(e.begin,{joinWith:""})}})(e),(e=>{ +if(Array.isArray(e.end)){ +if(e.skip||e.excludeEnd||e.returnEnd)throw W("skip, excludeEnd, returnEnd not compatible with endScope: {}"), +K +;if("object"!=typeof e.endScope||null===e.endScope)throw W("endScope must be object"), +K;F(e,e.end,{key:"endScope"}),e.end=m(e.end,{joinWith:""})}})(e)}function V(e){ +function t(t,n){ +return RegExp(l(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":"")) +}class n{constructor(){ +this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} +addRule(e,t){ +t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), +this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) +;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(m(e,{joinWith:"|" +}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex +;const t=this.matcherRe.exec(e);if(!t)return null +;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] +;return t.splice(0,n),Object.assign(t,i)}}class s{constructor(){ +this.rules=[],this.multiRegexes=[], +this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ +if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n +;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), +t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ +return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ +this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ +const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex +;let n=t.exec(e) +;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ +const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} +return n&&(this.regexIndex+=n.position+1, +this.regexIndex===this.count&&this.considerAll()),n}} +if(e.compilerExtensions||(e.compilerExtensions=[]), +e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") +;return e.classNameAliases=i(e.classNameAliases||{}),function n(o,r){const a=o +;if(o.isCompiled)return a +;[I,B,Z,D].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))), +o.__beforeBegin=null,[T,L,P].forEach((e=>e(o,r))),o.isCompiled=!0;let c=null +;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords), +c=o.keywords.$pattern, +delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=$(o.keywords,e.case_insensitive)), +a.keywordPatternRe=t(c,!0), +r&&(o.begin||(o.begin=/\B|\b/),a.beginRe=t(a.begin),o.end||o.endsWithParent||(o.end=/\B|\b/), +o.end&&(a.endRe=t(a.end)), +a.terminatorEnd=l(a.end)||"",o.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)), +o.illegal&&(a.illegalRe=t(o.illegal)), +o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>i(e,{ +variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?i(e,{ +starts:e.starts?i(e.starts):null +}):Object.isFrozen(e)?i(e):e))("self"===e?o:e)))),o.contains.forEach((e=>{n(e,a) +})),o.starts&&n(o.starts,r),a.matcher=(e=>{const t=new s +;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" +}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" +}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){ +return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{ +constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}} +const Y=n,Q=i,ee=Symbol("nomatch"),te=n=>{ +const i=Object.create(null),s=Object.create(null),o=[];let r=!0 +;const a="Could not find the language '{}', did you forget to load/include a language module?",l={ +disableAutodetect:!0,name:"Plain text",contains:[]};let p={ +ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, +languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", +cssSelector:"pre code",languages:null,__emitter:c};function b(e){ +return p.noHighlightRe.test(e)}function m(e,t,n){let i="",s="" +;"object"==typeof t?(i=e, +n=t.ignoreIllegals,s=t.language):(G("10.7.0","highlight(lang, code, ...args) has been deprecated."), +G("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), +s=e,i=t),void 0===n&&(n=!0);const o={code:i,language:s};S("before:highlight",o) +;const r=o.result?o.result:E(o.language,o.code,n) +;return r.code=o.code,S("after:highlight",r),r}function E(e,n,s,o){ +const c=Object.create(null);function l(){if(!S.keywords)return void M.addText(R) +;let e=0;S.keywordPatternRe.lastIndex=0;let t=S.keywordPatternRe.exec(R),n="" +;for(;t;){n+=R.substring(e,t.index) +;const s=_.case_insensitive?t[0].toLowerCase():t[0],o=(i=s,S.keywords[i]);if(o){ +const[e,i]=o +;if(M.addText(n),n="",c[s]=(c[s]||0)+1,c[s]<=7&&(j+=i),e.startsWith("_"))n+=t[0];else{ +const n=_.classNameAliases[e]||e;u(t[0],n)}}else n+=t[0] +;e=S.keywordPatternRe.lastIndex,t=S.keywordPatternRe.exec(R)}var i +;n+=R.substring(e),M.addText(n)}function g(){null!=S.subLanguage?(()=>{ +if(""===R)return;let e=null;if("string"==typeof S.subLanguage){ +if(!i[S.subLanguage])return void M.addText(R) +;e=E(S.subLanguage,R,!0,v[S.subLanguage]),v[S.subLanguage]=e._top +}else e=x(R,S.subLanguage.length?S.subLanguage:null) +;S.relevance>0&&(j+=e.relevance),M.__addSublanguage(e._emitter,e.language) +})():l(),R=""}function u(e,t){ +""!==e&&(M.startScope(t),M.addText(e),M.endScope())}function d(e,t){let n=1 +;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue} +const i=_.classNameAliases[e[n]]||e[n],s=t[n];i?u(s,i):(R=s,l(),R=""),n++}} +function h(e,t){ +return e.scope&&"string"==typeof e.scope&&M.openNode(_.classNameAliases[e.scope]||e.scope), +e.beginScope&&(e.beginScope._wrap?(u(R,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), +R=""):e.beginScope._multi&&(d(e.beginScope,t),R="")),S=Object.create(e,{parent:{ +value:S}}),S}function f(e,n,i){let s=((e,t)=>{const n=e&&e.exec(t) +;return n&&0===n.index})(e.endRe,i);if(s){if(e["on:end"]){const i=new t(e) +;e["on:end"](n,i),i.isMatchIgnored&&(s=!1)}if(s){ +for(;e.endsParent&&e.parent;)e=e.parent;return e}} +if(e.endsWithParent)return f(e.parent,n,i)}function b(e){ +return 0===S.matcher.regexIndex?(R+=e[0],1):(T=!0,0)}function m(e){ +const t=e[0],i=n.substring(e.index),s=f(S,e,i);if(!s)return ee;const o=S +;S.endScope&&S.endScope._wrap?(g(), +u(t,S.endScope._wrap)):S.endScope&&S.endScope._multi?(g(), +d(S.endScope,e)):o.skip?R+=t:(o.returnEnd||o.excludeEnd||(R+=t), +g(),o.excludeEnd&&(R=t));do{ +S.scope&&M.closeNode(),S.skip||S.subLanguage||(j+=S.relevance),S=S.parent +}while(S!==s.parent);return s.starts&&h(s.starts,e),o.returnEnd?0:t.length} +let w={};function y(i,o){const a=o&&o[0];if(R+=i,null==a)return g(),0 +;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===a){ +if(R+=n.slice(o.index,o.index+1),!r){const t=Error(`0 width match regex (${e})`) +;throw t.languageName=e,t.badRule=w.rule,t}return 1} +if(w=o,"begin"===o.type)return(e=>{ +const n=e[0],i=e.rule,s=new t(i),o=[i.__beforeBegin,i["on:begin"]] +;for(const t of o)if(t&&(t(e,s),s.isMatchIgnored))return b(n) +;return i.skip?R+=n:(i.excludeBegin&&(R+=n), +g(),i.returnBegin||i.excludeBegin||(R=n)),h(i,e),i.returnBegin?0:n.length})(o) +;if("illegal"===o.type&&!s){ +const e=Error('Illegal lexeme "'+a+'" for mode "'+(S.scope||"")+'"') +;throw e.mode=S,e}if("end"===o.type){const e=m(o);if(e!==ee)return e} +if("illegal"===o.type&&""===a)return 1 +;if(I>1e5&&I>3*o.index)throw Error("potential infinite loop, way more iterations than matches") +;return R+=a,a.length}const _=O(e) +;if(!_)throw W(a.replace("{}",e)),Error('Unknown language: "'+e+'"') +;const k=V(_);let N="",S=o||k;const v={},M=new p.__emitter(p);(()=>{const e=[] +;for(let t=S;t!==_;t=t.parent)t.scope&&e.unshift(t.scope) +;e.forEach((e=>M.openNode(e)))})();let R="",j=0,A=0,I=0,T=!1;try{ +if(_.__emitTokens)_.__emitTokens(n,M);else{for(S.matcher.considerAll();;){ +I++,T?T=!1:S.matcher.considerAll(),S.matcher.lastIndex=A +;const e=S.matcher.exec(n);if(!e)break;const t=y(n.substring(A,e.index),e) +;A=e.index+t}y(n.substring(A))}return M.finalize(),N=M.toHTML(),{language:e, +value:N,relevance:j,illegal:!1,_emitter:M,_top:S}}catch(t){ +if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n), +illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A, +context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:N},_emitter:M};if(r)return{ +language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:S} +;throw t}}function x(e,t){t=t||p.languages||Object.keys(i);const n=(e=>{ +const t={value:Y(e),illegal:!1,relevance:0,_top:l,_emitter:new p.__emitter(p)} +;return t._emitter.addText(e),t})(e),s=t.filter(O).filter(N).map((t=>E(t,e,!1))) +;s.unshift(n);const o=s.sort(((e,t)=>{ +if(e.relevance!==t.relevance)return t.relevance-e.relevance +;if(e.language&&t.language){if(O(e.language).supersetOf===t.language)return 1 +;if(O(t.language).supersetOf===e.language)return-1}return 0})),[r,a]=o,c=r +;return c.secondBest=a,c}function w(e){let t=null;const n=(e=>{ +let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" +;const n=p.languageDetectRe.exec(t);if(n){const t=O(n[1]) +;return t||(X(a.replace("{}",n[1])), +X("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} +return t.split(/\s+/).find((e=>b(e)||O(e)))})(e);if(b(n))return +;if(S("before:highlightElement",{el:e,language:n +}),e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), +console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), +console.warn("The element with unescaped HTML:"), +console.warn(e)),p.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML) +;t=e;const i=t.textContent,o=n?m(i,{language:n,ignoreIllegals:!0}):x(i) +;e.innerHTML=o.value,((e,t,n)=>{const i=t&&s[t]||n +;e.classList.add("hljs"),e.classList.add("language-"+i) +})(e,n,o.language),e.result={language:o.language,re:o.relevance, +relevance:o.relevance},o.secondBest&&(e.secondBest={ +language:o.secondBest.language,relevance:o.secondBest.relevance +}),S("after:highlightElement",{el:e,result:o,text:i})}let y=!1;function _(){ +"loading"!==document.readyState?document.querySelectorAll(p.cssSelector).forEach(w):y=!0 +}function O(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]} +function k(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ +s[e.toLowerCase()]=t}))}function N(e){const t=O(e) +;return t&&!t.disableAutodetect}function S(e,t){const n=e;o.forEach((e=>{ +e[n]&&e[n](t)}))} +"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ +y&&_()}),!1),Object.assign(n,{highlight:m,highlightAuto:x,highlightAll:_, +highlightElement:w, +highlightBlock:e=>(G("10.7.0","highlightBlock will be removed entirely in v12.0"), +G("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{p=Q(p,e)}, +initHighlighting:()=>{ +_(),G("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, +initHighlightingOnLoad:()=>{ +_(),G("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") +},registerLanguage:(e,t)=>{let s=null;try{s=t(n)}catch(t){ +if(W("Language definition for '{}' could not be registered.".replace("{}",e)), +!r)throw t;W(t),s=l} +s.name||(s.name=e),i[e]=s,s.rawDefinition=t.bind(null,n),s.aliases&&k(s.aliases,{ +languageName:e})},unregisterLanguage:e=>{delete i[e] +;for(const t of Object.keys(s))s[t]===e&&delete s[t]}, +listLanguages:()=>Object.keys(i),getLanguage:O,registerAliases:k, +autoDetection:N,inherit:Q,addPlugin:e=>{(e=>{ +e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ +e["before:highlightBlock"](Object.assign({block:t.el},t)) +}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ +e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),o.push(e)}, +removePlugin:e=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),n.debugMode=()=>{ +r=!1},n.safeMode=()=>{r=!0},n.versionString="11.8.0",n.regex={concat:h, +lookahead:g,either:f,optional:d,anyNumberOfTimes:u} +;for(const t in j)"object"==typeof j[t]&&e(j[t]);return Object.assign(n,j),n +},ne=te({});return ne.newInstance=()=>te({}),ne}() +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `csharp` grammar compiled for Highlight.js 11.8.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const n={ +keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), +built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], +literal:["default","false","null","true"]},a=e.inherit(e.TITLE_MODE,{ +begin:"[a-zA-Z](\\.?\\w)*"}),i={className:"number",variants:[{ +begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] +},t=e.inherit(s,{illegal:/\n/}),r={className:"subst",begin:/\{/,end:/\}/, +keywords:n},l=e.inherit(r,{illegal:/\n/}),c={className:"string",begin:/\$"/, +end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ +},e.BACKSLASH_ESCAPE,l]},o={className:"string",begin:/\$@"/,end:'"',contains:[{ +begin:/\{\{/},{begin:/\}\}/},{begin:'""'},r]},d=e.inherit(o,{illegal:/\n/, +contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]}) +;r.contains=[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.C_BLOCK_COMMENT_MODE], +l.contains=[d,c,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.inherit(e.C_BLOCK_COMMENT_MODE,{ +illegal:/\n/})];const g={variants:[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},a] +},_=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",b={ +begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], +keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, +contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ +begin:"\x3c!--|--\x3e"},{begin:""}]}] +}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", +end:"$",keywords:{ +keyword:"if else elif endif define undef warning error line region endregion pragma checksum" +}},g,i,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, +illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" +},a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", +relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", +begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ +className:"string",begin:/"/,end:/"/}]},{ +beginKeywords:"new return throw await else",relevance:0},{className:"function", +begin:"("+_+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ +beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", +relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params", +begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, +contains:[g,i,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},b]}}})() +;hljs.registerLanguage("csharp",e)})(); \ No newline at end of file