{"version":3,"sources":["webpack:///./node_modules/plotly.js/src/lib/index.js","webpack:///./node_modules/d3/d3.js","webpack:///./node_modules/plotly.js/src/components/color/index.js","webpack:///./node_modules/fast-isnumeric/index.js","webpack:///./node_modules/plotly.js/src/registry.js","webpack:///./node_modules/plotly.js/src/components/drawing/index.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/axes.js","webpack:///./node_modules/plotly.js/src/plotly.js","webpack:///./node_modules/plotly.js/src/plots/plots.js","webpack:///./node_modules/plotly.js/src/lib/extend.js","webpack:///./node_modules/plotly.js/src/plots/font_attributes.js","webpack:///./node_modules/plotly.js/src/constants/numerical.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/constants.js","webpack:///./node_modules/plotly.js/src/lib/svg_text_utils.js","webpack:///./node_modules/plotly.js/src/constants/alignment.js","webpack:///./node_modules/plotly.js/src/traces/scatter/subtypes.js","webpack:///./node_modules/tinycolor2/tinycolor.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/axis_ids.js","webpack:///./node_modules/plotly.js/src/components/color/attributes.js","webpack:///./node_modules/plotly.js/src/components/dragelement/index.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/layout_attributes.js","webpack:///./node_modules/plotly.js/src/components/errorbars/index.js","webpack:///./external_modules/helpers/helper.less","webpack:///./node_modules/plotly.js/src/components/colorscale/scales.js","webpack:///./node_modules/plotly.js/src/plot_api/edit_types.js","webpack:///./node_modules/plotly.js/src/components/fx/index.js","webpack:///./node_modules/plotly.js/src/components/colorscale/has_colorscale.js","webpack:///./node_modules/plotly.js/src/lib/setcursor.js","webpack:///./node_modules/plotly.js/src/plots/array_container_defaults.js","webpack:///./external_modules/helpers/multimodal.js","webpack:///./external_modules/helpers/error.js","webpack:///./external_modules/helpers/params.js","webpack:///./node_modules/plotly.js/src/lib/loggers.js","webpack:///./node_modules/plotly.js/src/lib/is_plain_object.js","webpack:///./node_modules/plotly.js/src/plots/attributes.js","webpack:///./node_modules/plotly.js/src/plots/layout_attributes.js","webpack:///./node_modules/plotly.js/src/traces/scatter/attributes.js","webpack:///./node_modules/plotly.js/src/constants/xmlns_namespaces.js","webpack:///./node_modules/plotly.js/src/constants/interactions.js","webpack:///./node_modules/plotly.js/src/components/fx/constants.js","webpack:///./node_modules/plotly.js/src/plot_api/plot_schema.js","webpack:///./node_modules/plotly.js/src/lib/nested_property.js","webpack:///./node_modules/plotly.js/src/components/errorbars/attributes.js","webpack:///./node_modules/plotly.js/src/components/colorbar/attributes.js","webpack:///./node_modules/plotly.js/src/components/colorscale/defaults.js","webpack:///./node_modules/plotly.js/src/components/legend/anchor_utils.js","webpack:///./node_modules/plotly.js/src/components/annotations/attributes.js","webpack:///./node_modules/plotly.js/src/components/sliders/constants.js","webpack:///./external_modules/helpers/ajax.js","webpack:///./external_modules/helpers/wait.js","webpack:///./node_modules/plotly.js/src/plot_api/plot_config.js","webpack:///./node_modules/plotly.js/src/lib/noop.js","webpack:///./node_modules/plotly.js/src/components/fx/attributes.js","webpack:///./node_modules/plotly.js/src/lib/is_array.js","webpack:///./node_modules/plotly.js/src/lib/mod.js","webpack:///./node_modules/plotly.js/src/lib/to_log_range.js","webpack:///./node_modules/plotly.js/src/lib/throttle.js","webpack:///./node_modules/plotly.js/src/plots/animation_attributes.js","webpack:///./node_modules/plotly.js/src/components/drawing/attributes.js","webpack:///./node_modules/plotly.js/src/components/colorscale/is_valid_scale.js","webpack:///./node_modules/plotly.js/src/components/colorscale/flip_scale.js","webpack:///./node_modules/plotly.js/src/components/colorscale/calc.js","webpack:///./node_modules/plotly.js/src/traces/scatter/constants.js","webpack:///./node_modules/plotly.js/src/components/errorbars/defaults.js","webpack:///./node_modules/plotly.js/src/components/titles/index.js","webpack:///./node_modules/plotly.js/build/ploticon.js","webpack:///./node_modules/plotly.js/src/snapshot/download.js","webpack:///./node_modules/plotly.js/src/snapshot/helpers.js","webpack:///./node_modules/plotly.js/src/snapshot/tosvg.js","webpack:///./node_modules/plotly.js/src/snapshot/svgtoimg.js","webpack:///./node_modules/plotly.js/src/lib/events.js","webpack:///./node_modules/plotly.js/src/components/fx/helpers.js","webpack:///./node_modules/plotly.js/src/components/fx/layout_attributes.js","webpack:///./node_modules/plotly.js/src/components/fx/hover.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/index.js","webpack:///./node_modules/plotly.js/src/components/legend/helpers.js","webpack:///./node_modules/plotly.js/src/traces/pie/style_one.js","webpack:///./node_modules/plotly.js/src/components/annotations/draw.js","webpack:///./node_modules/plotly.js/src/components/annotations3d/attributes.js","webpack:///./node_modules/plotly.js/src/components/shapes/helpers.js","webpack:///./node_modules/plotly.js/src/components/updatemenus/constants.js","webpack:///./node_modules/plotly.js/src/components/rangeslider/attributes.js","webpack:///./node_modules/plotly.js/src/components/rangeselector/attributes.js","webpack:///./node_modules/plotly.js/src/traces/bar/attributes.js","webpack:///./node_modules/plotly.js/src/lib/push_unique.js","webpack:///./node_modules/plotly.js/src/plot_api/container_array_match.js","webpack:///./node_modules/plotly.js/src/components/colorscale/get_scale.js","webpack:///./node_modules/plotly.js/src/components/colorscale/default_scale.js","webpack:///./node_modules/plotly.js/src/components/colorscale/is_valid_scale_array.js","webpack:///./node_modules/plotly.js/src/lib/regex.js","webpack:///./node_modules/plotly.js/src/lib/search.js","webpack:///./node_modules/plotly.js/src/lib/matrix.js","webpack:///./node_modules/plotly.js/src/lib/get_graph_div.js","webpack:///./node_modules/plotly.js/src/plots/frame_attributes.js","webpack:///./node_modules/plotly.js/src/components/colorscale/color_attributes.js","webpack:///./node_modules/plotly.js/src/components/colorscale/attributes.js","webpack:///./node_modules/plotly.js/src/components/colorscale/index.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/tick_value_defaults.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/tick_mark_defaults.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/tick_label_defaults.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/axis_autotype.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/axis_defaults.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/set_convert.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/position_defaults.js","webpack:///./node_modules/plotly.js/src/components/modebar/index.js","webpack:///./node_modules/plotly.js/src/plot_api/to_image.js","webpack:///./node_modules/has-hover/index.js","webpack:///./node_modules/plotly.js/src/lib/queue.js","webpack:///./node_modules/plotly.js/src/plots/polar/micropolar.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/graph_interact.js","webpack:///./node_modules/plotly.js/src/components/fx/hoverlabel_defaults.js","webpack:///./node_modules/plotly.js/src/lib/polygon.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/scale_zoom.js","webpack:///./node_modules/plotly.js/src/traces/scatter/xy_defaults.js","webpack:///./node_modules/plotly.js/src/traces/scatter/arrays_to_calcdata.js","webpack:///./node_modules/plotly.js/src/traces/scatter/colorbar.js","webpack:///./node_modules/plotly.js/src/traces/scatter/fill_hover_text.js","webpack:///./node_modules/plotly.js/src/components/legend/attributes.js","webpack:///./node_modules/plotly.js/src/components/legend/style.js","webpack:///./node_modules/plotly.js/src/components/annotations/arrow_paths.js","webpack:///./node_modules/plotly.js/src/components/annotations/common_defaults.js","webpack:///./node_modules/plotly.js/src/components/shapes/constants.js","webpack:///./node_modules/plotly.js/src/components/shapes/attributes.js","webpack:///./node_modules/plotly.js/src/components/images/attributes.js","webpack:///./node_modules/plotly.js/src/components/updatemenus/attributes.js","webpack:///./node_modules/plotly.js/src/plots/pad_attributes.js","webpack:///./node_modules/plotly.js/src/components/sliders/attributes.js","webpack:///./node_modules/plotly.js/src/components/rangeslider/constants.js","webpack:///./node_modules/plotly.js/src/components/rangeselector/button_attributes.js","webpack:///./node_modules/plotly.js/src/components/rangeselector/constants.js","webpack:///./node_modules/plotly.js/src/snapshot/cloneplot.js","webpack:///./node_modules/plotly.js/src/traces/bar/layout_attributes.js","webpack:///./node_modules/plotly.js/src/traces/bar/arrays_to_calcdata.js","webpack:///./node_modules/plotly.js/src/traces/pie/attributes.js","webpack:///./node_modules/plotly.js/src/traces/pie/layout_attributes.js","webpack:///./node_modules/plotly.js/src/traces/pie/helpers.js","webpack:///./app/los_plot.js","webpack:///./node_modules/plotly.js/lib/index-basic.js","webpack:///./node_modules/plotly.js/lib/core.js","webpack:///./node_modules/plotly.js/src/core.js","webpack:///./node_modules/plotly.js/src/lib/keyed_container.js","webpack:///./node_modules/plotly.js/src/lib/relative_attr.js","webpack:///./node_modules/plotly.js/src/lib/relink_private.js","webpack:///./node_modules/plotly.js/src/lib/ensure_array.js","webpack:///./node_modules/plotly.js/src/lib/coerce.js","webpack:///./node_modules/plotly.js/src/lib/dates.js","webpack:///./node_modules/plotly.js/src/lib/stats.js","webpack:///./node_modules/plotly.js/src/lib/geometry2d.js","webpack:///./node_modules/plotly.js/src/lib/notifier.js","webpack:///./node_modules/plotly.js/src/lib/filter_unique.js","webpack:///./node_modules/plotly.js/src/lib/filter_visible.js","webpack:///./node_modules/plotly.js/src/lib/clean_number.js","webpack:///./node_modules/plotly.js/src/lib/identity.js","webpack:///./node_modules/plotly.js/src/plots/polar/area_attributes.js","webpack:///./node_modules/plotly.js/src/components/colorbar/has_colorbar.js","webpack:///./node_modules/plotly.js/src/components/colorbar/defaults.js","webpack:///./node_modules/plotly.js/src/components/colorscale/extract_scale.js","webpack:///./node_modules/plotly.js/src/components/colorscale/make_color_scale_func.js","webpack:///./node_modules/plotly.js/src/constants/string_mappings.js","webpack:///./node_modules/plotly.js/src/traces/scatter/make_bubble_size_func.js","webpack:///./node_modules/plotly.js/src/components/drawing/symbol_defs.js","webpack:///./node_modules/plotly.js/src/plots/polar/axis_attributes.js","webpack:///./node_modules/plotly.js/src/components/errorbars/calc.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/layout_defaults.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/type_defaults.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/category_order_defaults.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/ordered_categories.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/constraint_defaults.js","webpack:///./node_modules/plotly.js/src/components/errorbars/compute_error.js","webpack:///./node_modules/plotly.js/src/components/errorbars/plot.js","webpack:///./node_modules/plotly.js/src/components/errorbars/style.js","webpack:///./node_modules/plotly.js/src/plots/command.js","webpack:///./node_modules/plotly.js/src/components/modebar/manage.js","webpack:///./node_modules/plotly.js/src/components/modebar/modebar.js","webpack:///./node_modules/plotly.js/src/components/modebar/buttons.js","webpack:///./node_modules/plotly.js/src/snapshot/filesaver.js","webpack:///./node_modules/plotly.js/src/plot_api/plot_api.js","webpack:///./node_modules/is-browser/client.js","webpack:///./node_modules/plotly.js/src/plots/polar/index.js","webpack:///./node_modules/plotly.js/src/plots/polar/micropolar_manager.js","webpack:///./node_modules/plotly.js/src/plots/polar/undo_manager.js","webpack:///./node_modules/mouse-event-offset/index.js","webpack:///./node_modules/plotly.js/src/components/dragelement/align.js","webpack:///./node_modules/plotly.js/src/components/dragelement/cursor.js","webpack:///./node_modules/plotly.js/src/components/dragelement/unhover.js","webpack:///./node_modules/plotly.js/src/components/fx/layout_global_defaults.js","webpack:///./node_modules/plotly.js/src/components/fx/defaults.js","webpack:///./node_modules/plotly.js/src/components/fx/layout_defaults.js","webpack:///./node_modules/plotly.js/src/components/fx/calc.js","webpack:///./node_modules/plotly.js/src/lib/override_cursor.js","webpack:///./node_modules/plotly.js/src/components/fx/click.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/dragbox.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/select.js","webpack:///./node_modules/plotly.js/src/plot_api/manage_arrays.js","webpack:///./node_modules/plotly.js/src/plot_api/helpers.js","webpack:///./node_modules/gl-mat4/fromQuat.js","webpack:///./node_modules/plotly.js/src/plot_api/subroutines.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/constraints.js","webpack:///./node_modules/es6-promise/dist/es6-promise.js","webpack:///vertx (ignored)","webpack:///./node_modules/plotly.js/build/plotcss.js","webpack:///./node_modules/plotly.js/src/fonts/mathjax_config.js","webpack:///./node_modules/plotly.js/src/plot_api/set_plot_config.js","webpack:///./node_modules/plotly.js/src/plot_api/register.js","webpack:///./node_modules/plotly.js/src/plot_api/validate.js","webpack:///./node_modules/plotly.js/src/traces/scatter/index.js","webpack:///./node_modules/plotly.js/src/traces/scatter/defaults.js","webpack:///./node_modules/plotly.js/src/traces/scatter/marker_defaults.js","webpack:///./node_modules/plotly.js/src/traces/scatter/line_defaults.js","webpack:///./node_modules/plotly.js/src/traces/scatter/line_shape_defaults.js","webpack:///./node_modules/plotly.js/src/traces/scatter/text_defaults.js","webpack:///./node_modules/plotly.js/src/traces/scatter/fillcolor_defaults.js","webpack:///./node_modules/plotly.js/src/traces/scatter/clean_data.js","webpack:///./node_modules/plotly.js/src/traces/scatter/calc.js","webpack:///./node_modules/plotly.js/src/traces/scatter/colorscale_calc.js","webpack:///./node_modules/plotly.js/src/traces/scatter/plot.js","webpack:///./node_modules/plotly.js/src/traces/scatter/line_points.js","webpack:///./node_modules/plotly.js/src/traces/scatter/link_traces.js","webpack:///./node_modules/plotly.js/src/components/colorbar/draw.js","webpack:///./node_modules/plotly.js/src/traces/scatter/style.js","webpack:///./node_modules/plotly.js/src/traces/scatter/hover.js","webpack:///./node_modules/plotly.js/src/traces/scatter/get_trace_color.js","webpack:///./node_modules/plotly.js/src/traces/scatter/select.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/attributes.js","webpack:///./node_modules/plotly.js/src/plots/cartesian/transition_axes.js","webpack:///./node_modules/plotly.js/src/components/legend/index.js","webpack:///./node_modules/plotly.js/src/components/legend/defaults.js","webpack:///./node_modules/plotly.js/src/components/legend/draw.js","webpack:///./node_modules/plotly.js/src/components/legend/handle_click.js","webpack:///./node_modules/plotly.js/src/components/legend/constants.js","webpack:///./node_modules/plotly.js/src/components/legend/get_legend_data.js","webpack:///./node_modules/plotly.js/src/components/annotations/index.js","webpack:///./node_modules/plotly.js/src/components/annotations/draw_arrow_head.js","webpack:///./node_modules/plotly.js/src/components/annotations/click.js","webpack:///./node_modules/plotly.js/src/components/annotations/defaults.js","webpack:///./node_modules/plotly.js/src/components/annotations/annotation_defaults.js","webpack:///./node_modules/plotly.js/src/components/annotations/calc_autorange.js","webpack:///./node_modules/plotly.js/src/components/annotations/convert_coords.js","webpack:///./node_modules/plotly.js/src/components/annotations3d/index.js","webpack:///./node_modules/plotly.js/src/components/annotations3d/defaults.js","webpack:///./node_modules/plotly.js/src/components/annotations3d/convert.js","webpack:///./node_modules/plotly.js/src/components/annotations3d/draw.js","webpack:///./node_modules/plotly.js/src/plots/gl3d/project.js","webpack:///./node_modules/plotly.js/src/components/shapes/index.js","webpack:///./node_modules/plotly.js/src/components/shapes/draw.js","webpack:///./node_modules/plotly.js/src/components/shapes/defaults.js","webpack:///./node_modules/plotly.js/src/components/shapes/shape_defaults.js","webpack:///./node_modules/plotly.js/src/components/shapes/calc_autorange.js","webpack:///./node_modules/plotly.js/src/components/images/index.js","webpack:///./node_modules/plotly.js/src/components/images/defaults.js","webpack:///./node_modules/plotly.js/src/components/images/draw.js","webpack:///./node_modules/plotly.js/src/components/images/convert_coords.js","webpack:///./node_modules/plotly.js/src/components/updatemenus/index.js","webpack:///./node_modules/plotly.js/src/components/updatemenus/defaults.js","webpack:///./node_modules/plotly.js/src/components/updatemenus/draw.js","webpack:///./node_modules/plotly.js/src/components/updatemenus/scrollbox.js","webpack:///./node_modules/plotly.js/src/components/sliders/index.js","webpack:///./node_modules/plotly.js/src/components/sliders/defaults.js","webpack:///./node_modules/plotly.js/src/components/sliders/draw.js","webpack:///./node_modules/plotly.js/src/components/rangeslider/index.js","webpack:///./node_modules/plotly.js/src/components/rangeslider/defaults.js","webpack:///./node_modules/plotly.js/src/components/rangeslider/calc_autorange.js","webpack:///./node_modules/plotly.js/src/components/rangeslider/draw.js","webpack:///./node_modules/plotly.js/src/components/rangeselector/index.js","webpack:///./node_modules/plotly.js/src/components/rangeselector/defaults.js","webpack:///./node_modules/plotly.js/src/components/rangeselector/draw.js","webpack:///./node_modules/plotly.js/src/components/rangeselector/get_update_object.js","webpack:///./node_modules/plotly.js/src/snapshot/index.js","webpack:///./node_modules/plotly.js/src/snapshot/toimage.js","webpack:///./node_modules/plotly.js/lib/bar.js","webpack:///./node_modules/plotly.js/src/traces/bar/index.js","webpack:///./node_modules/plotly.js/src/traces/bar/defaults.js","webpack:///./node_modules/plotly.js/src/traces/bar/style_defaults.js","webpack:///./node_modules/plotly.js/src/traces/bar/layout_defaults.js","webpack:///./node_modules/plotly.js/src/traces/bar/calc.js","webpack:///./node_modules/plotly.js/src/traces/bar/set_positions.js","webpack:///./node_modules/plotly.js/src/traces/bar/sieve.js","webpack:///./node_modules/plotly.js/src/traces/bar/plot.js","webpack:///./node_modules/plotly.js/src/traces/bar/style.js","webpack:///./node_modules/plotly.js/src/traces/bar/hover.js","webpack:///./node_modules/plotly.js/src/traces/bar/select.js","webpack:///./node_modules/plotly.js/lib/pie.js","webpack:///./node_modules/plotly.js/src/traces/pie/index.js","webpack:///./node_modules/plotly.js/src/traces/pie/defaults.js","webpack:///./node_modules/plotly.js/src/traces/pie/layout_defaults.js","webpack:///./node_modules/plotly.js/src/traces/pie/calc.js","webpack:///./node_modules/plotly.js/src/traces/pie/plot.js","webpack:///./node_modules/plotly.js/src/traces/pie/style.js","webpack:///./node_modules/plotly.js/src/traces/pie/base_plot.js"],"names":["ensure","end","dlg","do_show","immediate","hide_func","on","event","body","removeClass","data","hasClass","addClass","css","not","delay","setTimeout","modal","clearTimeout","show","hide","multi","code","join","errorDialog","msg","console","log","text","$","self","queryString","paramsArray","params","i","length","param","split","decodeURIComponent","replace","window","location","search","substr","addNewState","history","pushState","request","wait","error","uri","method","options","url","type","contentType","accepts","cache","dataType","JSON","stringify","d","cb","error_cb","fd","fe","success","undefined","failure","done","push","req","ajax","fail","process_msg","pleaseWaitDiv","pleaseWaitDivInit","recurse","force","showInit","hideInit","Plotly","losView","lon","ko","observable","lat","czmax","numSteps","plotAvailable","needState","key","graphDiv","document","getElementById","ready","resize","Plots","currentPlot","newPlot","title","xaxis","linewidth","yaxis","update_sky","num","cz","_needState","promise","Promise","resolve","_","deleteTraces","addTraces","y","x","mode","line","shape","reset_selection","check_coordinates","then","los","applyBindings"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO,mCAAmC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAc,qBAAqB;AACnC;AACA;;AAEA;;AAEA,cAAc,wBAAwB;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,UAAU;AACxB;AACA;;AAEA;AACA,cAAc,UAAU;AACxB;AACA,kBAAkB,UAAU;AAC5B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,qBAAqB;AACnC;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,sBAAsB,UAAU;AAChC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;AACA;AACA;;AAEA;AACA,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;AACA,YAAY;AACZ;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,qBAAqB;AACrB;AACA;AACA;AACA,YAAY,eAAe;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C,oBAAoB;AAC/D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU,qBAAqB,gBAAgB;AAC9D;AACA,aAAa,OAAO;AACpB,aAAa,EAAE;AACf;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4BAA4B,4BAA4B;AACxD,WAAW,UAAU,QAAQ;AAC7B;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD,WAAW,cAAc,WAAW;AACpC;AACA;AACA;AACA,4BAA4B,mCAAmC;AAC/D,WAAW,QAAQ,QAAQ,GAAG,QAAQ;AACtC;AACA;AACA;AACA,4BAA4B,iDAAiD;AAC7E,WAAW,iBAAiB,SAAS;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wEAAwE;AACxE,iBAAiB;AACjB;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,cAAc;AAC3B,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB;AACA,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gCAAgC,EAAE;AAClC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+BAA+B,QAAQ,IAAI;AAC3C;;AAEA;AACA;AACA;AACA;AACA,gCAAgC,MAAM,IAAI,cAAc;AACxD,gCAAgC,cAAc,IAAI,SAAS,aAAa,EAAE;AAC1E;AACA,WAAW,OAAO,4BAA4B,IAAI;AAClD,WAAW,IAAI;AACf;AACA,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;ACpyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE,KAAK;AACL,wFAAwF;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F,4DAA4D,SAAS;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,wEAAwE;AACxE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,EAAE;AACpD,sBAAsB;AACtB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA,OAAO;AACP,oBAAoB,UAAU;AAC9B;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C,4EAA4E,UAAU;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,sCAAsC,OAAO;AAC7C,gEAAgE,OAAO;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,wCAAwC;AAC9F;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iFAAiF;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,SAAS,gBAAgB;AACzB;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,sEAAsE,6BAA6B;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,OAAO;AAChE;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,gEAAgE,QAAQ;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,6DAA6D,OAAO;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,2CAA2C,QAAQ;AACnD,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B,oEAAoE,OAAO;AAC3E;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,+BAA+B,iCAAiC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,gCAAgC,QAAQ;AACxC,yBAAyB,8BAA8B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,OAAO;AACP,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,8BAA8B,8BAA8B;AAC5D;AACA,+CAA+C;AAC/C,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,wBAAwB,OAAO;AAC/B;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,eAAe,QAAQ;AACvB,UAAU,OAAO;AACjB,UAAU,OAAO;AACjB;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,8BAA8B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,8BAA8B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,OAAO,2DAA2D,iBAAiB,OAAO;AACnJ;AACA,yDAAyD,OAAO,2DAA2D,iBAAiB,OAAO;AACnJ;AACA,mDAAmD,OAAO,mDAAmD,iBAAiB,OAAO;AACrI;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA,iBAAiB,OAAO;AACxB,0BAA0B,OAAO;AACjC;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,iBAAiB,OAAO;AACxB,2BAA2B,OAAO;AAClC,uDAAuD,OAAO;AAC9D,0EAA0E,OAAO;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA,KAAK;AACL;AACA;AACA,iBAAiB,OAAO;AACxB,0BAA0B,OAAO;AACjC,0BAA0B,OAAO,yBAAyB,iBAAiB,OAAO;AAClF;AACA,iBAAiB,OAAO;AACxB;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,MAAM;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,8EAA8E,OAAO;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,8BAA8B,OAAO;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gCAAgC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM,qBAAqB,OAAO;AAClD;AACA,SAAS;AACT;AACA,gBAAgB,QAAQ,sBAAsB,OAAO;AACrD;AACA,mBAAmB,cAAc;AACjC,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qBAAqB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,0BAA0B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AAAA;AAAA;AAAA;AAAA,qGAA2E,4EAA4E;AACvJ,CAAC,G;;;;;;;ACj1SD;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,uCAAuC;;AAEnE,gCAAgC,8CAA8C;;AAE9E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa,6DAA6D;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAc,iBAAiB;AAC/B;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,gBAAgB;AAC1C;AACA;AACA;AACA;AACA;AACA,sBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gBAAgB;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,WAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,iBAAiB;AAC5B;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,gBAAgB,2BAA2B;AAC3C;AACA,gBAAgB,2BAA2B;AAC3C;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,6BAA6B;AACvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;AACA,WAAW,OAAO;AAClB;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,YAAY;AACZ;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACxTA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,6BAA6B;AACtE,qCAAqC,sCAAsC;AAC3E;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,aAAa,YAAY;AAC5D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,uCAAuC,aAAa,YAAY;AAChE;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C,aAAa;AAC3D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,YAAY;AAChC;AACA,4CAA4C,UAAU;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB;AACpB,oBAAoB;;AAEpB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,cAAc,oBAAoB;AAClC;AACA;AACA;AACA,cAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,kCAAkC;AAC1D;AACA;AACA;AACA;AACA;AACA,cAAc,WAAW;AACzB;AACA;AACA;AACA;AACA;;AAEA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,8BAA8B;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;;;;;;;ACj5BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,wBAAwB;AAClD;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA,oCAAoC;;AAEpC;AACA;;AAEA,YAAY;AACZ;;AAEA,mBAAmB,WAAW;AAC9B,sBAAsB,kBAAkB;;AAExC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc,oBAAoB;AAClC;AACA;AACA;AACA,cAAc,oBAAoB;AAClC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,oBAAoB;AAClC;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,+BAA+B;AAC/B;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAAgC,wCAAwC;AACxE;AACA;AACA;AACA,+BAA+B,UAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kBAAkB;;AAErE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mCAAmC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA,sBAAsB,mCAAmC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,oBAAoB,OAAO;;AAE3B;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;;AAEnC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,qCAAqC;AACxD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc,iBAAiB;AAC/B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc,qBAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc,qBAAqB;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB,sBAAsB;AACtB;AACA;AACA;AACA;;AAEA,cAAc,mBAAmB;AACjC,uBAAuB,4BAA4B;AACnD,kBAAkB,mBAAmB;AACrC,uCAAuC,2BAA2B;AAClE,2BAA2B,2BAA2B;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA,qCAAqC,0BAA0B,EAAE;;AAEjE;AACA;AACA,iCAAiC,qDAAqD,EAAE;AACxF;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,8BAA8B,2CAA2C,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,WAAW,EAAE;AAC1D;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kCAAkC,mCAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,6BAA6B,sBAAsB;AACnD;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,0BAA0B,yBAAyB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;;AAEA;AACA;AACA;AACA,kEAAkE,kBAAkB;;AAEpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,6DAA6D,kBAAkB;;AAE/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B,qBAAqB;AAC/C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,iBAAiB,4DAA4D;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,sDAAsD;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,SAAS;AACT;;AAEA;AACA;AACA,oEAAoE,eAAe;AACnF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,yBAAyB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,KAAK;AACjD;AACA,iCAAiC,KAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,SAAS,4BAA4B,gCAAgC,EAAE;;AAEvE;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA,gCAAgC;;AAEhC,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;;AAEA;AACA,yBAAyB,iBAAiB;AAC1C;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,iBAAiB;AAC/B,cAAc,iBAAiB;;AAE/B;AACA;AACA;AACA;AACA;;AAEA,cAAc,sBAAsB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kCAAkC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kCAAkC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,uCAAuC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,sBAAsB;AACpC;AACA;AACA,cAAc,sBAAsB;AACpC;AACA;AACA;;;;;;;;;;ACl3EA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;;AAEA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;;AAEb;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,iCAAiC,iBAAiB;AAClD;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB,EAAE;AACnD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C,2CAA2C;AAC3C;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,wDAAwD;AACxD;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,qBAAqB;AACnC;AACA;AACA;;AAEA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAc,uBAAuB;AACrC;AACA;AACA;;AAEA;;AAEA,cAAc,uBAAuB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,4BAA4B;AAC9C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc,4BAA4B;AAC1C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc,wBAAwB;AACtC;AACA;;AAEA,kBAAkB,wBAAwB;AAC1C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD;AAChD;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,wBAAwB;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,uBAAuB;AACrC;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,cAAc,mBAAmB;AACjC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,0BAA0B,2BAA2B;AACrD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,6BAA6B;AAC3C;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,uBAAuB;AACzC,qFAAqF;AACrF;AACA,KAAK;AACL,2EAA2E;AAC3E;;AAEA;AACA;AACA,kBAAkB,4BAA4B;AAC9C,oGAAoG;AACpG;AACA,KAAK;AACL,0FAA0F;AAC1F;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,yBAAyB;AAC3C;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAkB,0BAA0B;AAC5C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;AAC5C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,mCAAmC;AACnC;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+BAA+B;AAC/B;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,cAAc;AACd;AACA;AACA,2BAA2B,qCAAqC;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAc,4BAA4B;AAC1C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,oBAAoB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,6BAA6B;AAC3C;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAc,uBAAuB;AACrC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,YAAY;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,0BAA0B;AAC9C,oBAAoB,0BAA0B;AAC9C,oBAAoB,0BAA0B;AAC9C,oBAAoB;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,gBAAgB,iBAAiB;AACjC,gBAAgB,iBAAiB;AACjC,gBAAgB,iBAAiB;AACjC,gBAAgB;AAChB;;AAEA;AACA;;AAEA;;AAEA,sBAAsB,mBAAmB;AACzC;;AAEA,yCAAyC;AACzC,2CAA2C;AAC3C;AACA;AACA;AACA;;AAEA,0BAA0B,mBAAmB;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,+BAA+B;AAC1C;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA,SAAS;AACT;AACA,mBAAmB,+BAA+B;;AAElD;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,uBAAuB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sDAAsD;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,0BAA0B;AACpD;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,WAAW;AACnD;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;;AAE5C;AACA,kBAAkB,2BAA2B;AAC7C;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB,yBAAyB;AAC/C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,YAAY;AACvB;AACA,WAAW,SAAS;AACpB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,SAAS;AACpB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,0EAA0E;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,4BAA4B;AACtD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA,aAAa;AACb;AACA;;AAEA,sBAAsB,4BAA4B;AAClD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc,yBAAyB;AACvC;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAc,qBAAqB;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,qBAAqB;AACnC;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,cAAc,qBAAqB;AACnC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB,6BAA6B;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,qBAAqB;AACnC;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qBAAqB;AACxC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,mBAAmB;AACrC;;AAEA;AACA;AACA,sBAAsB,kCAAkC;AACxD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;;AAEA,sBAAsB,uBAAuB;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc,4BAA4B;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc,2BAA2B;AACzC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc,wBAAwB;AACtC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACryEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT,4CAA4C;AAC5C;AACA;;AAEA,kBAAkB,YAAY;AAC9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC/GA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA,aAAa,cAAc;AAC3B;AACA,aAAa,OAAO;AACpB;AACA,aAAa,gBAAgB;AAC7B;AACA;AACA,YAAY,OAAO,+BAA+B,oBAAoB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B;;AAE1B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,wBAAwB,8CAA8C;;AAEtE;AACA,yCAAyC,yBAAyB;;AAElE;AACA;AACA;AACA,yBAAyB,8BAA8B;AACvD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iCAAiC,+CAA+C;AAChF;AACA;AACA,iCAAiC,6CAA6C;AAC9E;AACA;AACA,iCAAiC,YAAY;AAC7C;AACA;AACA,iCAAiC,qDAAqD;AACtF;;AAEA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;;AAEA;AACA;;;AAGA;;AAEA,uBAAuB,MAAM;AAC7B,uBAAuB,MAAM;;AAE7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,gBAAgB,2CAA2C;AAC3D,gBAAgB,qCAAqC;AACrD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,uCAAuC;AACvC;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,YAAY;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,OAAO;AAClB;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA,sBAAsB,eAAe;;AAErC;AACA,0BAA0B,yBAAyB;AACnD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,aAAa;AACjD;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,sBAAsB,oBAAoB;AAC1C;;AAEA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,+CAA+C,mBAAmB;AAClE;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,uCAAuC;AACpE,KAAK;AACL,6BAA6B,yDAAyD;AACtF,KAAK,OAAO;AACZ,6BAA6B,kBAAkB;AAC/C;;AAEA;AACA,8BAA8B,qCAAqC;AACnE,KAAK;AACL,8BAA8B,wDAAwD;AACtF,KAAK,OAAO;AACZ,8BAA8B,mBAAmB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,WAAW,aAAa;AACxB;AACA,WAAW,OAAO;AAClB,aAAa,IAAI;AACjB,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,6CAA6C;;AAEhE;;AAEA;AACA;AACA,uBAAuB,WAAW;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,WAAW;AACxF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA;AACA;AACA;AACA,qFAAqF,WAAW;AAChG;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA,mCAAmC,WAAW;AAC9C;AACA,gCAAgC,WAAW;AAC3C,gDAAgD,cAAc,EAAE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;AC/pBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;;;;;;;;;ACjCA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,oBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,8BAA8B;AACpD,sBAAsB,8BAA8B;AACpD,sBAAsB,8BAA8B;;AAEpD;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B,mBAAmB,OAAO;AACzD,+BAA+B,mBAAmB,OAAO;AACzD,+BAA+B,mBAAmB,OAAO;AACzD;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,UAAU;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD,wCAAwC;AACxC,wCAAwC;AACxC;;AAEA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,eAAe,UAAU;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AACA,sDAAsD;AACtD,wCAAwC;AACxC,wCAAwC;AACxC;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,eAAe,UAAU;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yCAAyC;AAC5D,mBAAmB,yCAAyC;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wCAAwC;AAC3D,mBAAmB,yCAAyC;AAC5D,mBAAmB,yCAAyC;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uCAAuC;AAC1D,mBAAmB,wCAAwC;AAC3D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+DAA+D,WAAW;AAC1E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2DAA2D,wBAAwB;;AAEnF;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,8EAA8E,4BAA4B,gBAAgB;AAC1H,8EAA8E,2BAA2B,gBAAgB;AACzH,qDAAqD,oDAAoD,gBAAgB;AACzH,qDAAqD,oDAAoD,gBAAgB;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD,0BAA0B;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;AAEA,KAAK,kBAAkB,YAAY,kBAAkB;AACrD;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA4B,YAAY;;AAExC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,EAAE,cAAc,EAAE,cAAc,EAAE;AACjE,+BAA+B,EAAE,cAAc,EAAE,cAAc,EAAE;AACjE,+BAA+B,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE;AACjF,+BAA+B,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE;AACjF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,UAAU,OAAO,UAAU,OAAO,SAAS;AACnF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAwB,kBAAkB;AAAA;AAC1C;AACA;AACA;AACA;AACA;;AAEA,CAAC;;;;;;;;;;;AC1qCD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,0CAA0C;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtOA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,6CAA6C;;AAEpE,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA,aAAa,iDAAiD,qBAAqB;AACnF,aAAa,iDAAiD;AAC9D;AACA;AACA,uBAAuB,mBAAmB;;AAE1C,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,mCAAmC;;AAE1D,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA,uBAAuB,mBAAmB;;AAE1C,KAAK;AACL;AACA;;AAEA;AACA,uBAAuB,mBAAmB;;AAE1C,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL,4BAA4B,SAAS,+BAA+B;AACpE;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA,aAAa,oDAAoD;AACjE,aAAa;AACb;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;AC1dA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;;;;;;;;;;;;;;;ACxDA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qCAAqC,EAAE;;AAEnE;AACA;AACA;AACA;AACA,6BAA6B,sCAAsC,EAAE;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,0BAA0B;AACpD;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B;;AAEA;AACA;AACA,0BAA0B,uBAAuB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC,eAAe,GAAG,uBAAuB;AAC7E;;AAEA;AACA;;;;;;;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;;AAGA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;;AAEA;AACA,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,aAAa;AACb;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B,uBAAuB,OAAO;AAC9B,yBAAyB,OAAO;AAChC,oBAAoB,OAAO;AAC3B,wBAAwB;AACxB,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,cAAc,mBAAmB;AACjC;AACA,wBAAwB;AACxB;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;QCzEgBA,M,GAAAA,M;QAuCAC,G,GAAAA,G;;AA5ChB;;;;AACA;;;;AAEA,oBAAgB,EAAhB;;AAEO,SAASD,MAAT,CAAgBE,GAAhB,EAAqBC,OAArB,EAA8BC,SAA9B,EAAyCC,SAAzC,EAAoD;AACzD,wBAAEH,GAAF,EAAOI,EAAP,CAAU,iBAAV,EAA6B,UAASC,KAAT,EAAgB;AAC3C,QAAIC,OAAO,sBAAE,MAAF,CAAX;;AAEA,0BAAE,IAAF,EAAQC,WAAR,CAAoB,gBAApB;AACAD,SAAKE,IAAL,CAAU,gBAAV,EAA4BF,KAAKE,IAAL,CAAU,gBAAV,IAA8B,CAA1D;AACD,GALD;;AAOA,wBAAER,GAAF,EAAOI,EAAP,CAAU,gBAAV,EAA4B,UAASC,KAAT,EAAgB;AAC1C,QAAIC,OAAO,sBAAE,MAAF,CAAX;;AAEA,QAAI,OAAOA,KAAKE,IAAL,CAAU,gBAAV,CAAP,IAAsC,WAA1C,EACEF,KAAKE,IAAL,CAAU,gBAAV,EAA4B,CAA5B;;AAEF,QAAI,sBAAE,IAAF,EAAQC,QAAR,CAAiB,gBAAjB,CAAJ,EAAwC;;AAExC,0BAAE,IAAF,EAAQC,QAAR,CAAiB,gBAAjB;AACAJ,SAAKE,IAAL,CAAU,gBAAV,EAA4BF,KAAKE,IAAL,CAAU,gBAAV,IAA8B,CAA1D;AACA,0BAAE,IAAF,EAAQG,GAAR,CAAY,SAAZ,EAAuB,OAAO,KAAKL,KAAKE,IAAL,CAAU,gBAAV,CAAnC;;AAEA,0BAAE,iBAAF,EACGI,GADH,CACO,iBADP,EAEGD,GAFH,CAEO,SAFP,EAEkB,OAAO,KAAKL,KAAKE,IAAL,CAAU,gBAAV,CAF9B,EAGGE,QAHH,CAGY,gBAHZ;AAID,GAhBD;;AAkBA,MAAIG,QAAQX,YAAY,CAAZ,GAAgB,GAA5B;AACAF,MAAIQ,IAAJ,CACE,cADF,EAEEM,WAAW,YAAW;AACpBb;AACD,GAFD,EAEGY,KAFH,CAFF;AAMAb,MAAIQ,IAAJ,CAAS,qBAAT,EAAgC,YAAW;AACzC,QAAIL,SAAJ,EAAeA,YAAf,KACKH,IAAIe,KAAJ,CAAU,MAAV;AACN,GAHD;AAID;;AAEM,SAAShB,GAAT,CAAaC,GAAb,EAAkB;AACvBgB,eAAahB,IAAIQ,IAAJ,CAAS,cAAT,CAAb;AACAR,MAAIQ,IAAJ,CAAS,qBAAT;AACD,C;;;;;;;;;;;;QCtBeS,I,GAAAA,I;QAQAC,I,GAAAA,I;;AAjChB;;;;AACA;;AACA;;IAAYC,K;;;;;;AAEZ,oBAAgB,EAAhB;;AAEA,IAAIC,OAAO,CACT,oDADS,EAET,4CAFS,EAGT,6BAHS,EAIT,4BAJS,EAKT,8HALS,EAMT,gBANS,EAOT,QAPS,EAQT,8DARS,EAST,QATS,EAUT,4BAVS,EAWT,qEAXS,EAYT,QAZS,EAaT,QAbS,EAcT,QAdS,EAeT,QAfS,EAgBTC,IAhBS,CAgBJ,EAhBI,CAAX;AAiBA,IAAIC,cAAc,sBAAEF,IAAF,CAAlB;;AAEO,SAASH,IAAT,CAAcM,GAAd,EAAmB;AACxBC,UAAQC,GAAR,CAAY,4BAA4BF,GAAxC;AACA,wBAAE,aAAF,EAAiBD,WAAjB,EAA8BI,IAA9B,CAAmCH,GAAnC;AACAJ,QAAMrB,MAAN,CAAawB,WAAb,EAA0B,YAAW;AACnCA,gBAAYP,KAAZ;AACD,GAFD;AAGD;;AAEM,SAASG,IAAT,GAAgB;AACrBC,QAAMpB,GAAN,CAAUuB,WAAV;AACAA,cAAYP,KAAZ,CAAkB,MAAlB;AACD,C;;;;;;;;;ACpCD,iCAAO,CAAC,sBAAD,CAAP,mCAAmB,UAASY,CAAT,EAAY;AAC7B,MAAIC,OAAO,IAAX;;AAEAA,OAAKC,WAAL,GAAoB,UAASC,WAAT,EAAsB;AACxC,QAAIC,SAAS,EAAb;;AAEA,SAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAIF,YAAYG,MAAhC,EAAwC,EAAED,CAA1C,EAA6C;AAC3C,UAAIE,QAAQJ,YAAYE,CAAZ,EAAeG,KAAf,CAAqB,GAArB,EAA0B,CAA1B,CAAZ;;AAEA,UAAID,MAAMD,MAAN,KAAiB,CAArB,EAAwB;;AAExBF,aAAOG,MAAM,CAAN,CAAP,IAAmBE,mBAAmBF,MAAM,CAAN,EAASG,OAAT,CAAiB,KAAjB,EAAwB,GAAxB,CAAnB,CAAnB;AACD;;AAED,WAAON,MAAP;AACD,GAZkB,CAYhBO,OAAOC,QAAP,CAAgBC,MAAhB,CAAuBC,MAAvB,CAA8B,CAA9B,EAAiCN,KAAjC,CAAuC,GAAvC,CAZgB,CAAnB;;AAcAP,OAAKc,WAAL,GAAmB,YAAW;AAC5BlB,YAAQC,GAAR,CAAYG,KAAKC,WAAjB;AACAc,YAAQC,SAAR,CAAkB,EAAlB,EAAsB,EAAtB,EAA0B,MAAMjB,EAAEO,KAAF,CAAQN,KAAKC,WAAb,CAAhC;AACD,GAHD;;AAKA,SAAOD,IAAP;AACD,CAvBD;AAAA,qG;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,sBAAsB;AAC5C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,sBAAsB;AAC5C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,sBAAsB;AAC5C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;;;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT,2BAA2B,SAAS,kBAAkB;AACtD;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,aAAa;AACb;AACA;AACA;;AAEA;;AAEA,aAAa;AACb;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;;;;;;;AC5SA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,SAAS;;AAET;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,SAAS;AACpB;AACA;AACA,oBAAoB,OAAO;AAC3B,oBAAoB,OAAO;AAC3B,oBAAoB,SAAS;AAC7B,oBAAoB,OAAO;AAC3B,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,uBAAuB;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qFAAqF;AACrF;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F;AAC9F;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,4BAA4B;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,kBAAkB;AAC3B;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iDAAiD;AACjD;;AAEA;AACA,gCAAgC;AAChC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;AACpC;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,2BAA2B,UAAU;AACrC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;AACA,gCAAgC;;AAEhC;AACA;AACA;;AAEA;AACA;;AAEA,uCAAuC;AACvC;;;;;;;;ACvmBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO,KAAK,GAAG,KAAK;AACpC;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA,0BAA0B,oBAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,qFAAqF;AACrF,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,2BAA2B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,QAAQ;AAC/C;AACA;;AAEA;AACA;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA6C;AAC7C,wCAAwC;AACxC,oCAAoC;AACpC;;AAEA;AACA;AACA,yBAAyB,uBAAuB,EAAE;AAClD,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;;;;;;;;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB,SAAS;AACrD;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA,CAAC;;;;;;;;AC5JD;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;;AAEA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;AC/TA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QCxFgBiB,O,GAAAA,O;;AAHhB;;IAAYC,I;;AACZ;;IAAYC,K;;;;AAEL,SAASF,OAAT,CAAiBG,GAAjB,EAAsBC,MAAtB,EAA8BzC,IAA9B,EAAoC0C,OAApC,EAA6C;AAClD,MAAIL,UAAU;AACZM,SAAKH,GADO;AAEZI,UAAMH,MAFM;AAGZI,iBAAa,kBAHD;AAIZC,aAAS,kBAJG;AAKZC,WAAO,KALK;AAMZC,cAAU,MANE;AAOZhD,UAAMiD,KAAKC,SAAL,CAAelD,IAAf;AAPM,GAAd;;AAUA,MAAImD,IAAI,EAAEC,IAAI,EAAN,EAAUC,UAAU,EAApB,EAAwBC,IAAI,KAA5B,EAAmCC,IAAI,KAAvC,EAA8CJ,GAAG,IAAjD,EAAR;AACAnC,UAAQC,GAAR,CAAYoB,OAAZ;;AAEA,MAAIK,OAAJ,EAAa;AACX,QAAIA,QAAQK,KAAZ,EAAmBV,QAAQU,KAAR,GAAgBL,QAAQK,KAAxB;AACpB;;AAED,WAASS,OAAT,CAAiBxD,IAAjB,EAAuB;AACrBsC,SAAK5B,IAAL;AACA,QAAIV,KAAKuC,KAAL,KAAekB,SAAf,IAA4BzD,KAAKuC,KAAL,IAAc,MAA9C,EAAsD;AACpDA,YAAM9B,IAAN,CAAWT,KAAKuC,KAAhB;AACA;AACD;AACD,SAAK,IAAIf,CAAT,IAAc2B,EAAEC,EAAhB,EAAoB;AAClBD,QAAEC,EAAF,CAAK5B,CAAL,EAAQxB,IAAR;AACD;AACDmD,MAAEA,CAAF,GAAMnD,IAAN;AACD;;AAED,WAAS0D,OAAT,GAAmB;AACjBP,MAAEI,EAAF,GAAO,IAAP;AACAvC,YAAQC,GAAR,CAAY,eAAZ;AACAqB,SAAK5B,IAAL;AACAM,YAAQC,GAAR,CAAYkC,EAAEE,QAAd;AACA,SAAK,IAAI7B,CAAT,IAAc2B,EAAEE,QAAhB,EAA0B;AACxBF,QAAEE,QAAF,CAAW7B,CAAX;AACD;AACF;;AAEDa,UAAQE,KAAR,GAAgBmB,OAAhB;;AAEAP,IAAEQ,IAAF,GAAS,UAASP,EAAT,EAAa;AACpB,QAAID,EAAEG,EAAN,EAAU;AACRF,SAAGD,EAAEA,CAAL;AACA;AACD;AACDA,MAAEC,EAAF,CAAKQ,IAAL,CAAUR,EAAV;AACD,GAND;;AAQAD,IAAEZ,KAAF,GAAU,UAASa,EAAT,EAAa;AACrB,QAAID,EAAEI,EAAN,EAAU;AACRH;AACD;AACDD,MAAEE,QAAF,CAAWO,IAAX,CAAgBR,EAAhB;AACD,GALD;;AAOAd,OAAK7B,IAAL;AACA,MAAIoD,MAAM1C,EAAE2C,IAAF,CAAOzB,OAAP,CAAV;;AAEAwB,MAAIF,IAAJ,CAASH,OAAT;AACAK,MAAIE,IAAJ,CAASL,OAAT;;AAEA,SAAOP,CAAP;AACD,C;;;;;;;;;;;;;;;ACnED;;;;AACA;;AAEA;;IAAYxC,K;;;;;;AAEZ,oBAAgB,EAAhB;;AAEA,IAAIC,OAAO,CACT,sGADS,EAET,uEAFS,EAGT,4BAHS,EAIT,0BAJS,EAKT,QALS,EAMT,0BANS,EAOT,wBAPS,EAQT,oFARS,EAST,QATS,EAUT,QAVS,EAWT,kCAXS,EAYT,QAZS,EAaT,cAbS,EAcTC,IAdS,CAcJ,EAdI,CAAX;;AAgBAD,OAAO,uBAAQA,IAAR,EAAc,EAAEoD,aAAa,eAAf,EAAd,CAAP;AACA,IAAIC,gBAAgB9C,EAAEP,IAAF,CAApB;AACA,IAAIsD,oBAAoB/C,EAAEP,IAAF,CAAxB;AACA,IAAIuD,UAAU,CAAd;;AAEA,SAAS1D,IAAT,CAAcf,SAAd,EAAyB;AACvB,MAAIyE,UAAU,CAAd,EAAiB;AACfA;AACA;AACD;AACDA,YAAU,CAAV;AACAxD,QAAMrB,MAAN,CACE2E,aADF,EAEE,YAAW;AACTA,kBAAc1D,KAAd;AACD,GAJH,EAKEb,SALF,EAME,YAAW;AACTuE,kBAAc1D,KAAd,CAAoB,MAApB;AACA4D;AACD,GATH;AAWD;;AAED,SAASzD,IAAT,CAAc0D,KAAd,EAAqB;AACnBzD,QAAMpB,GAAN,CAAU0E,aAAV;AACD;;AAED,SAASI,QAAT,CAAkB3E,SAAlB,EAA6B;AAC3BiB,QAAMrB,MAAN,CACE4E,iBADF,EAEE,YAAW;AACTA,sBAAkB3D,KAAlB;AACD,GAJH,EAKEb,SALF;AAOD;;AAED,SAAS4E,QAAT,CAAkBF,KAAlB,EAAyB;AACvBzD,QAAMpB,GAAN,CAAU2E,iBAAV;AACD;;QAEQzD,I,GAAAA,I;QAAMC,I,GAAAA,I;QAAM2D,Q,GAAAA,Q;QAAUC,Q,GAAAA,Q;;;;;;;;;ACjE/B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK,oBAAoB,cAAc,GAAG;AAC1C;;AAEA;AACA;AACA;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;;AAEA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,SAAS;AACT;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA,6BAA6B,QAAQ;AACrC;AACA;AACA;;AAEA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;;AAGA;AACA;AACA,6CAA6C;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;;AAEA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;AC7OA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA,iCAA4B;AAC5B;;AAEA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,eAAe;AACrG;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,2DAA2D,gBAAgB;AAC3E,mCAAmC,GAAG;AACtC,sBAAsB,IAAI,cAAc,EAAE,EAAE;AAC5C,sBAAsB,IAAI,cAAc,EAAE;AAC1C,4DAA4D,WAAW;AACvE,wCAAwC;AACxC,KAAK;AACL;AACA;AACA;;AAEA;AACA,gCAAgC,UAAU,eAAe,WAAW;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,4BAA4B;AAC1C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,gEAAgE;AAChE;AACA;;AAEA;AACA,eAAe,4CAA4C;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gCAAgC;AAC3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC9KA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,gGAAgG,eAAe;AAC/G;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,qBAAqB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;;;;;;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,CAAC;AACD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B;AACA,SAAS,sBAAsB;AAC/B,UAAU,2CAA2C;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,wCAAwC;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,aAAa,WAAW;AACxB,aAAa,WAAW;AACxB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,SAAS;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B;AACxD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,8BAA8B;AACnD;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wCAAwC,gCAAgC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,qCAAqC,kCAAkC,EAAE;;AAEzE;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,4BAA4B;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,sBAAsB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,sBAAsB;;AAE1C;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,kCAAkC,kCAAkC,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;;AAEA;;AAEA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;;AAEA;AACA,+BAA+B,QAAQ;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC,QAAQ;;AAE9C;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,QAAQ;AAC9C;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mCAAmC,QAAQ;AAC3C;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6BAA6B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oCAAoC;AACpC,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnwCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA,cAAc,qBAAqB;AACnC;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,qBAAqB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,oBAAoB;AACtC;;AAEA;AACA;;AAEA;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,cAAc,uBAAuB;AACrC;AACA;AACA;AACA;AACA;;AAEA,cAAc,uBAAuB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C,kBAAkB,gBAAgB;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qCAAqC,6BAA6B;;AAElE;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,uCAAuC,0BAA0B,EAAE;;AAEnE;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,wCAAwC;AAC1D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA,sBAAsB,qBAAqB;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AClZA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,aAAa,0BAA0B;AACvC;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,mCAAmC;AACrD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA,WAAW,mBAAmB;AAC9B,WAAW,mBAAmB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,KAAK,QAAQ;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,oBAAoB,kBAAkB;;AAEtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;;AAEA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;AACA,sBAAsB,aAAa;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,0EAA0E;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA,wBAAwB,mCAAmC;AAC3D;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;;AAErB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA,iDAAiD,oCAAoC;AACrF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;ACnsBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;AClFD;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD,UAAU;AACjE;;AAEA;AACA,uDAAuD,UAAU;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,2CAA2C;AACnE;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,8BAA8B;AACjE;AACA;AACA,mCAAmC,wBAAwB;AAC3D;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,wCAAwC;AAC3E;AACA;AACA,mCAAmC,8BAA8B;AACjE;AACA;AACA,mCAAmC,0BAA0B;AAC7D;;AAEA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB,cAAc;;AAEpC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA,aAAa,iCAAiC;AAC9C,aAAa;AACb;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;;;;;;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;;AAEA,mCAAmC;AACnC,mCAAmC,UAAU;;AAE7C;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL,2BAA2B;;AAE3B,KAAK;;AAEL,iCAAiC;;AAEjC,KAAK;;AAEL,kCAAkC;;AAElC,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA,WAAW,IAAI;AACf;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,aAAa,eAAe;AAC5B;AACA,QAAQ,QAAQ,OAAO,UAAU,OAAO,aAAa;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,sBAAsB;;AAEtB;AACA;;AAEA,YAAY;AACZ;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,kBAAkB,gBAAgB;AAClC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,6BAA6B,eAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB,cAAc;AACvC,4BAA4B,eAAe;AAC3C,4BAA4B,cAAc;AAC1C,+BAA+B,eAAe;;AAE9C,oCAAoC,cAAc;AAClD,oCAAoC,cAAc;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;;AAExB;AACA,cAAc,YAAY;AAC1B;AACA,kBAAkB,UAAU;AAC5B;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA,aAAa,eAAe;AAC5B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,gBAAgB;AAC3B;AACA;AACA,WAAW,cAAc;AACzB;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT,iCAAiC;;AAEjC,SAAS;AACT,4BAA4B;AAC5B,2BAA2B,iCAAiC;;AAE5D,SAAS;AACT,2BAA2B;AAC3B;AACA,2BAA2B,aAAa;;AAExC,SAAS;AACT,2BAA2B;AAC3B;AACA,2BAA2B,aAAa;;AAExC,SAAS;AACT,qCAAqC;;AAErC;AACA,SAAS;AACT,mCAAmC;;AAEnC,SAAS;AACT;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,iCAAiC;;AAExD,KAAK;AACL;AACA;;AAEA;AACA;AACA,uBAAuB,aAAa;;AAEpC,KAAK;AACL;AACA;;AAEA;AACA;AACA,uBAAuB,aAAa;;AAEpC,KAAK;AACL;AACA;;AAEA;AACA,uBAAuB,sBAAsB;;AAE7C,KAAK;AACL;AACA;;AAEA;AACA;AACA,uBAAuB,sBAAsB;;AAE7C,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,6BAA6B;;AAEnD;AACA;AACA;;AAEA;AACA;;AAEA,sDAAsD,4BAA4B,EAAE;AACpF,iDAAiD,yBAAyB,EAAE;;AAE5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC,+BAA+B;AACtE;;AAEA;AACA;AACA;AACA;AACA,6CAA6C,oCAAoC;AACjF,uCAAuC,gCAAgC;;AAEvE;AACA;;AAEA;AACA;;AAEA,oCAAoC,gCAAgC;AACpE,+BAA+B,yBAAyB;;AAExD,8BAA8B,+BAA+B;AAC7D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oDAAoD,sCAAsC;AAC1F,qDAAqD,oCAAoC;;AAEzF,mCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8BAA8B,0BAA0B;AACxD,+BAA+B,iCAAiC;AAChE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC,0BAA0B;AACnE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,eAAe;AAC5C;;AAEA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;AC9cA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA,yCAAyC;;AAEzC;AACA;AACA,WAAW,2BAA2B;AACtC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iCAAiC,8BAA8B,EAAE;AACjE,kCAAkC,aAAa,EAAE;AACjD,KAAK;AACL;;AAEA;;;;;;;;8CC3LA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,OAAO,oBAAoB,SAAS;AACxD;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,gCAAgC;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,gCAAgC;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AChNA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0BAA0B;;AAE1B;AACA;AACA;AACA;AACA,KAAK,kBAAkB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,+DAA+D;AAC/D;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA,qBAAqB;AACrB,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,oGAAoG;AAClM;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB,GAAG;AACxB,iBAAiB;AACjB;AACA;AACA,kFAAkF;AAClF;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,EAAE;AACnB;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB;AACpB;AACA,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF;AACvF,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,yGAAyG;AACtH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA,wEAAwE,uDAAuD;AAC/H;AACA;AACA;AACA,qBAAqB,sDAAsD;AAC3E;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA,qBAAqB,sDAAsD;AAC3E;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACz4CA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AC5JA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,kDAAkD,4BAA4B;AAC9E;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA,kDAAkD,4BAA4B;AAC9E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8BAA8B,gBAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;;AAEA;AACA,kBAAkB,eAAe;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA,qBAAqB,kDAAkD;AACvE;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,gBAAgB;AAC5B;AACA;AACA;AACA,qBAAqB,iBAAiB,EAAE;AACxC,qBAAqB,kBAAkB;;AAEvC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC,iBAAiB;;AAEpD;AACA;AACA,0BAA0B;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACtOA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B,YAAY,kBAAkB;AAC9B,YAAY,kBAAkB;AAC9B,aAAa;AACb,YAAY,2BAA2B;AACvC,YAAY,oCAAoC;AAChD,YAAY,kBAAkB;AAC9B,YAAY,2BAA2B;AACvC,eAAe,iBAAiB;AAChC;AACA,KAAK;;AAEL;AACA,YAAY,kBAAkB;AAC9B,YAAY,kBAAkB;AAC9B,aAAa;AACb,YAAY,kBAAkB;AAC9B,YAAY,2BAA2B;AACvC,YAAY,oCAAoC;AAChD,YAAY,kBAAkB;AAC9B,YAAY,2BAA2B;AACvC,eAAe,iBAAiB;AAChC;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL,uBAAuB;;AAEvB,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;;AAEL,uBAAuB;;AAEvB,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA,4BAA4B,2BAA2B,sBAAsB;AAC7E,4BAA4B,2BAA2B,4BAA4B;AACnF,2BAA2B,SAAS,sBAAsB;;AAE1D;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;;;;;;;ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;;AAEA;AACA;AACA,aAAa,eAAe;AAC5B,aAAa,eAAe;AAC5B,aAAa;AACb;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA,KAAK;;AAEL;AACA;AACA;AACA;;;AAGA,KAAK;;AAEL;AACA;AACA;AACA;;;AAGA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;;AAEL,sBAAsB;;AAEtB,KAAK;;AAEL;;AAEA,KAAK;;AAEL;AACA;;;AAGA,KAAK;AACL;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA,CAAC;;;;;;;;ACxJD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,iBAAiB;AAC9B,aAAa;AACb;;AAEA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;;AAGA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;;AAEA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA,KAAK;AACL,yBAAyB;;AAEzB,KAAK,GAAG,IAAI,UAAU;AACtB;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,SAAS;;AAET;AACA;AACA;AACA;;;AAGA,SAAS;;AAET;AACA;AACA;;;AAGA,SAAS;;AAET;AACA;;;AAGA,SAAS;;AAET;AACA;;;AAGA,SAAS;;AAET;;AAEA,SAAS;AACT,KAAK;;AAEL;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;;AAGA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA,CAAC;;;;;;;;AC7OD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B;AACxD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B;AACxD;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,gCAAgC;AAClD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;AACb;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL,4BAA4B;AAC5B;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA,2BAA2B;;AAE3B,KAAK;AACL,iCAAiC;;AAEjC,KAAK;AACL,kCAAkC;;AAElC,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,oDAAoD;AACrE,iBAAiB;AACjB;AACA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA,iBAAiB,oDAAoD;AACrE,iBAAiB;AACjB;AACA;AACA;;AAEA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1BA;;AACA;;AACA;;IAAY/B,K;;AACZ;;IAAYgC,M;;;;AAEZ,SAASC,OAAT,GAAmB;AACjB,MAAIpD,OAAO,IAAX;;AAEAA,OAAKqD,GAAL,GAAWC,GAAGC,UAAH,CAAc,GAAd,CAAX;AACAvD,OAAKwD,GAAL,GAAWF,GAAGC,UAAH,CAAc,EAAd,CAAX;AACAvD,OAAKyD,KAAL,GAAaH,GAAGC,UAAH,CAAc,KAAd,CAAb;AACAvD,OAAK0D,QAAL,GAAgBJ,GAAGC,UAAH,CAAc,GAAd,CAAhB;AACAvD,OAAK2D,aAAL,GAAqBL,GAAGC,UAAH,CAAc,KAAd,CAArB;;AAEA,MAAIK,YAAY,KAAhB;;AAEA,OAAK,IAAIC,GAAT,IAAgB7D,IAAhB,EAAsB;AACpB,QAAI6D,0BAAJ,EAAwB;AACtB7D,WAAK6D,GAAL,EAAU,oBAAYA,GAAZ,CAAV;AACD,KAFD,MAEO;AACL,0BAAYA,GAAZ,IAAmB7D,KAAK6D,GAAL,GAAnB;AACAD,kBAAY,IAAZ;AACD;AACF;;AAED5D,OAAK8D,QAAL,GAAgBC,SAASC,cAAT,CAAwB,aAAxB,CAAhB;;AAEAjE,IAAEgE,QAAF,EAAYE,KAAZ,CAAkB,YAAM;AACtBlE,MAAEW,MAAF,EAAUwD,MAAV,CAAiB,YAAM;AACrBf,aAAOgB,KAAP,CAAaD,MAAb,CAAoBlE,KAAK8D,QAAzB;AACD,KAFD;AAGD,GAJD;;AAMA9D,OAAKoE,WAAL,GAAmBjB,OAAOkB,OAAP,CAAerE,KAAK8D,QAApB,EAA8B,EAA9B,EAAkC;AACnDQ,WAAO,sBAD4C;AAEnDC,WAAO,EAAED,OAAO,OAAT,EAAkBE,WAAW,CAA7B,EAF4C;AAGnDC,WAAO,EAAEH,OAAO,WAAT,EAAsBE,WAAW,CAAjC;AAH4C,GAAlC,CAAnB;;AAMAzE,IAAEC,KAAKoE,WAAP,EAAoBH,KAApB,CAA0B,YAAM;AAC9Bd,WAAOgB,KAAP,CAAaD,MAAb,CAAoBlE,KAAK8D,QAAzB;AACD,GAFD;;AAIA9D,OAAK0E,UAAL,GAAkB,YAAW;AAC3B,QAAIC,MAAM3E,KAAK0D,QAAL,EAAV;AACA,QAAIL,MAAM,EAAV;AAAA,QACEG,MAAM,EADR;AAAA,QAEEoB,KAAK,EAFP;;AAIA,wBAAY,KAAZ,IAAqB5E,KAAKqD,GAAL,EAArB;AACA,wBAAY,KAAZ,IAAqBrD,KAAKwD,GAAL,EAArB;AACA,wBAAY,OAAZ,IAAuBxD,KAAKyD,KAAL,EAAvB;AACA,wBAAY,UAAZ,IAA0BzD,KAAK0D,QAAL,EAA1B;AACA,wBAAY,eAAZ,IAA+B1D,KAAK2D,aAAL,EAA/B;;AAEA,QAAI3D,KAAK6E,UAAT,EAAqB;;AAErB,SAAK,IAAIzE,IAAI,CAAb,EAAgBA,IAAIuE,GAApB,EAAyBvE,GAAzB,EAA8B;AAC5BiD,UAAIb,IAAJ,CAASxC,KAAKqD,GAAL,EAAT;AACAG,UAAIhB,IAAJ,CAASxC,KAAKwD,GAAL,EAAT;AACAoB,SAAGpC,IAAH,CAAQxC,KAAKyD,KAAL,KAAerD,CAAf,GAAmBuE,GAAnB,GAAyB,IAAjC;AACD;;AAED,QAAIlC,MAAM,mBAAK,+BAAL,EAAsC,MAAtC,EAA8C;AACtDY,WAAKA,GADiD;AAEtDG,WAAKA,GAFiD;AAGtDoB,UAAIA;AAHkD,KAA9C,CAAV;;AAMA,QAAIE,UAAU,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,CAAV,EAAgB;AACxCrF,cAAQC,GAAR,CAAY,eAAZ;AACA4C,UAAItB,KAAJ,CAAU,YAAW;AACnBA,cAAM9B,IAAN,CAAW,kCAAX;AACD,OAFD;;AAIAoD,UAAIF,IAAJ,CAAS,UAAS3D,IAAT,EAAe;AACtBgB,gBAAQC,GAAR,CAAYjB,IAAZ;;AAEA,YAAIoB,KAAK8D,QAAL,CAAclF,IAAd,KAAuByD,SAAvB,IAAoCrC,KAAK8D,QAAL,CAAclF,IAAd,CAAmByB,MAAnB,GAA4B,CAApE,EACE8C,OAAO+B,YAAP,CAAoBlF,KAAK8D,QAAzB,EAAmC,CAAC,CAAD,CAAnC;AACFX,eAAOgC,SAAP,CAAiBnF,KAAK8D,QAAtB,EAAgC,CAC9B;AACEtC,gBAAM,SADR;AAEE4D,aAAGxG,KAAKgG,EAFV;AAGES,aAAGzG,KAAKmD,CAHV;AAIEuD,gBAAM,OAJR;AAKEC,gBAAM,EAAEC,OAAO,QAAT;AALR,SAD8B,CAAhC;;AAUAxF,aAAK2D,aAAL,CAAmB,IAAnB;;AAEAqB,gBAAQhF,IAAR;AACD,OAlBD;AAmBD,KAzBa,CAAd;AA0BA,WAAO8E,OAAP;AACD,GArDD;;AAuDA9E,OAAKyF,eAAL,GAAuB,YAAW,CAAE,CAApC;;AAEA,WAASC,iBAAT,GAA6B;AAC3B,QAAI1F,KAAK6E,UAAT,EAAqB;AACtB;;AAED7E,OAAK6E,UAAL,GAAkB,KAAlB;AACA,MAAI7E,KAAK2D,aAAL,EAAJ,EAA0B;AACxB3D,SAAK0E,UAAL,GAAkBiB,IAAlB,CAAuBD,iBAAvB;AACD;AACD1F,OAAK6E,UAAL,GAAkB,IAAlB;;AAEA,MAAIjB,SAAJ,EAAe;;AAEf,SAAO5D,IAAP;AACD;;AAED,IAAI4F,MAAM,IAAIxC,OAAJ,EAAV;;AAEAE,GAAGuC,aAAH,CAAiBD,GAAjB,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,gBAAgB;AAC9B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,0BAA0B,oBAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;;AAE9C,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0BAA0B,oBAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,0BAA0B,mBAAmB;AAC7C;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0BAA0B,kBAAkB;AAC5C;AACA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,0BAA0B,cAAc;AACxC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,IAAI;AAChB;AACA;AACA;AACA;AACA,SAAS,iCAAiC;AAC1C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA,oBAAoB,mBAAmB,SAAS,EAAE;;AAElD;;AAEA;AACA;AACA;;;;;;;;AC1VA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe,EAAE;;AAEnC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mCAAmC;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK,EAAE;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC,iCAAiC;AAClE,kCAAkC,mCAAmC;AACrE,gCAAgC,gCAAgC;AAChE,yCAAyC,sCAAsC;;AAE/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjnBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA,WAAW,MAAM;AACjB;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;;AAEA,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wCAAwC,cAAc,EAAE;AACxD;;AAEA;AACA;AACA,2CAA2C,cAAc,EAAE;AAC3D;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB,yBAAyB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,UAAU;AACtB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA,0BAA0B,kBAAkB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,wBAAwB,OAAO,GAAG,OAAO;AACzC;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,YAAY,MAAM;AAClB;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;;AAEA;AACA;;AAEA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,uCAAuC,UAAU;;;;;;;;ACbjD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA,gDAAgD;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS,oDAAoD;;AAE7D;AACA,SAAS,oDAAoD;;AAE7D;AACA;AACA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,OAAO;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,cAAc;AACd,aAAa;AACb;AACA,WAAW,OAAO;AAClB,sBAAsB,QAAQ;AAC9B,mBAAmB,QAAQ;AAC3B;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,OAAO;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,gCAAgC,cAAc;;AAE9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA,wEAAwE;AACxE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yBAAyB,+BAA+B,EAAE;AAC1D,yBAAyB,oBAAoB;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;ACzdA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA,8BAA8B;;AAE9B,CAAC;;AAED;AACA;AACA;AACA;;;AAGA,SAAS;AACT;AACA;;;AAGA,SAAS;AACT;AACA;AACA;;;AAGA,SAAS;AACT;AACA;AACA;;;AAGA,SAAS;AACT;AACA;;;AAGA,SAAS;AACT;AACA;;;AAGA,SAAS;AACT;AACA;;AAEA,SAAS;AACT;AACA;;;AAGA;AACA;;AAEA,wBAAwB;AACxB;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,oBAAoB;AACrC,iBAAiB;AACjB;;AAEA,SAAS;AACT;AACA;AACA;;;AAGA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA,iBAAiB,6BAA6B;AAC9C,iBAAiB;AACjB;;AAEA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;;AAGA,SAAS;AACT;AACA;;;AAGA;AACA;AACA,CAAC;;;;;;;;ACjHD;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;;;AAGA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;AACA;;AAEA;;AAEA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B,aAAa;AAC1C;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,oBAAoB;AACpB;;AAEA;AACA,cAAc,qBAAqB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,uBAAuB;AACzC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,qBAAqB;AACzC;AACA;;AAEA,uBAAuB;;AAEvB;AACA,oBAAoB,qBAAqB;AACzC;;AAEA,sBAAsB,iBAAiB;AACvC;;AAEA,8DAA8D;AAC9D;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc,qBAAqB;AACnC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc,mBAAmB;AACjC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc,mBAAmB;AACjC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,qBAAqB;AACnC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,iBAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,eAAe;AAC3B;;AAEA;AACA;AACA;AACA,+DAA+D;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,wGAAwG;AACxG;;AAEA;;AAEA,2CAA2C,sBAAsB;;AAEjE;;AAEA;;AAEA,cAAc,uBAAuB;;AAErC;;AAEA,kBAAkB,wBAAwB;;AAE1C;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,cAAc,uBAAuB;AACrC;AACA;;AAEA;AACA;AACA;;AAEA,cAAc,6BAA6B;AAC3C;AACA;;AAEA;AACA,sBAAsB,yBAAyB;AAC/C;AACA;AACA;AACA,oBAAoB;AACpB;AACA;;AAEA,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,IAAI,4BAA4B;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,cAAc,6BAA6B;AAC3C;AACA;AACA;AACA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,0BAA0B;AAC5C;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,SAAS;AACrB,gBAAgB,QAAQ;AACxB,gBAAgB,OAAO;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,SAAS;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA;;AAEA;AACA,mCAAmC;AACnC;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kDAAkD;;;AAGlD,sEAAsE;;AAEtE;;AAEA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kDAAkD;;AAElD,sEAAsE;;AAEtE;;AAEA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC3KA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,wBAAwB;AAC9C;AACA;;AAEA;AACA,0BAA0B,wBAAwB;AAClD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8BAA8B;AAChE;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,oEAAoE;AACrF,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA,uBAAuB,wCAAwC;AAC/D,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,8BAA8B,uBAAuB;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;;;;;;;ACxaA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,sBAAsB,qBAAqB;AAC3C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA,4BAA4B,wBAAwB;AACpD;;AAEA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,oBAAoB;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAkB,0BAA0B;AAC5C;;AAEA,sBAAsB,wBAAwB;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACnOA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA,KAAK;AACL;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;;AAEA;;AAEA;;AAEA,kBAAkB,oBAAoB;AACtC;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;ACnSA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA,WAAW,EAAE;AACb;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,2BAA2B,iBAAiB;AAC5C;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,mBAAmB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,sBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0BAA0B;AAC1B,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,qBAAqB;AAC3C;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0BAA0B,OAAO;AACjC;AACA;;AAEA,8BAA8B,uBAAuB;AACrD;AACA;AACA;AACA;AACA;;AAEA,+CAA+C;AAC/C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;AACA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;;AAEA,sBAAsB,qBAAqB;AAC3C;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC9lBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gGAAgG;AAChG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;;AAEA;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA,WAAW,iBAAiB;AAC5B;AACA,WAAW,OAAO;AAClB;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB,4BAA4B;AAClD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kBAAkB,oBAAoB;AACtC;AACA;;AAEA;AACA,sBAAsB,qBAAqB;AAC3C;;AAEA,0BAA0B,8BAA8B;AACxD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,4BAA4B;AAC9C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oDAAoD;AACpD;;AAEA;;AAEA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA,kBAAkB,iCAAiC;;AAEnD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oCAAoC;AAC5D;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA,kDAAkD,OAAO;AACzD;AACA,kCAAkC,SAAS,aAAa;AACxD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA,0BAA0B,oBAAoB,sBAAsB;;AAEpE;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,oBAAoB;AAClC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,oBAAoB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,eAAe;AAC1B,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,sBAAsB,oBAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,eAAe;AAC1B,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;;AAEA;AACA;AACA,uBAAuB;AACvB;AACA;;AAEA,kBAAkB,wBAAwB;;AAE1C;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,gBAAgB;AAC3B,WAAW,cAAc;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,SAAS;AACpB,WAAW,gBAAgB;AAC3B,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAAgC;AAChC,KAAK;;AAEL;;AAEA;AACA,cAAc,mBAAmB;AACjC;AACA;;AAEA;AACA,cAAc,mBAAmB;AACjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,SAAS;AACpB,WAAW,gBAAgB;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,oBAAoB;AAClC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,SAAS;AACpB,WAAW,gBAAgB;AAC3B,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,cAAc,oBAAoB;;AAElC;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,2BAA2B;AACzC,6BAA6B,2DAA2D;AACxF;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA,cAAc,2BAA2B;AACzC;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC;AACA,WAAW,OAAO;AAClB;AACA,WAAW,EAAE;AACb;AACA,WAAW,kBAAkB;AAC7B;AACA;AACA;AACA,WAAW,wBAAwB;AACnC;AACA,WAAW,OAAO;AAClB,uBAAuB,6BAA6B;AACpD;AACA,WAAW,kBAAkB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,kEAAkE;;AAElE;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB,mBAAmB;AACnB;AACA;;AAEA;AACA,mBAAmB,+BAA+B,kBAAkB,EAAE,EAAE;;AAExE;AACA;AACA;AACA;AACA;;AAEA,oCAAoC,yCAAyC;;AAE7E,gCAAgC,qCAAqC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,oBAAoB,EAAE;AAC5D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,eAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,mBAAmB;AACzC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,4BAA4B;AAC1C;AACA;AACA;;AAEA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC;AACA,WAAW,OAAO;AAClB;AACA,WAAW,EAAE;AACb;AACA;AACA;AACA,WAAW,wBAAwB;AACnC;AACA,WAAW,OAAO;AAClB,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,gCAAgC;AAChC,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA,cAAc,iBAAiB;AAC/B;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iBAAiB,EAAE;AACzD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;;AAEA,+DAA+D,SAAS;AACxE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD;AAChD;;AAEA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA,qDAAqD,IAAI;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;;AAEA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC;AACA,WAAW,OAAO;AAClB,uBAAuB,6BAA6B;AACpD;AACA,WAAW,OAAO;AAClB,uBAAuB,6BAA6B;AACpD;AACA,WAAW,kBAAkB;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,qDAAqD;AACrD;;AAEA,uDAAuD;AACvD;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,6BAA6B,sCAAsC,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA,WAAW,yDAAyD;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,UAAU;AAC7B;AACA;AACA;AACA;AACA,mCAAmC,UAAU,GAAG,UAAU;AAC1D;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,0BAA0B,sBAAsB;AAChD;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,aAAa;AACb,SAAS;AACT;AACA;AACA,sBAAsB,0BAA0B;AAChD;;AAEA;;AAEA;AACA;AACA;AACA;AACA,mDAAmD,iBAAiB;AACpE,qBAAqB;AACrB;AACA;AACA,SAAS;AACT,sBAAsB,wCAAwC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,mEAAmE;AACnE,qBAAqB;AACrB;AACA;AACA;;AAEA,0DAA0D;AAC1D,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,sBAAsB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA,iBAAiB,OAAO;AACxB,iBAAiB,iBAAiB;AAClC,kBAAkB,OAAO;AACzB,kBAAkB,MAAM;AACxB,qBAAqB,OAAO;AAC5B;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC,QAAQ;AACzC;;AAEA,kDAAkD;AAClD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA,kCAAkC,QAAQ;AAC1C;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB,oBAAoB;AAC1C,oCAAoC;AACpC;AACA,sBAAsB,wCAAwC;AAC9D,4BAA4B,6CAA6C;AACzE,SAAS;AACT;AACA;;AAEA,sBAAsB,yCAAyC;AAC/D,4BAA4B,2BAA2B;AACvD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA,iCAAiC,QAAQ;AACzC;AACA,kBAAkB,2BAA2B;AAC7C,wBAAwB,gDAAgD;AACxE;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;;AAEA,yCAAyC;AACzC;;AAEA;AACA,0BAA0B;;AAE1B;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;ACvyFA,sB;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD,oCAAoC,eAAe;AACnD;AACA;AACA;AACA,wCAAwC,SAAS,+CAA+C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,+BAA+B,oBAAoB;AACnD,+BAA+B,oBAAoB;AACnD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,6CAA6C,yBAAyB,EAAE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,6BAA6B,qBAAqB,EAAE;AACpD,6BAA6B,0CAA0C,EAAE;AACzE,iCAAiC,qBAAqB,EAAE;AACxD,wCAAwC,gCAAgC,EAAE;AAC1E,8BAA8B,cAAc;AAC5C;AACA;;;;;;;AC/DA,oBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;AAEA;;AAEA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,eAAe,GAAG,uBAAuB;AACjF;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,oBAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B,0BAA0B,kCAAkC,EAAE;;AAExF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,qBAAqB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qCAAqC,uCAAuC;AAC5E;AACA,qCAAqC,uCAAuC;AAC5E;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gCAAgC,qCAAqC;AACrE;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB,eAAe;;AAErC;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,eAAe;;AAErC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,oBAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,qBAAqB;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,sBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB,mBAAmB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;;AAEvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,uCAAuC;AACvD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAc,mBAAmB;AACjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,6BAA6B;AAC3C;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,iBAAiB;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACr/BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,eAAe;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,oCAAoC,6CAA6C,EAAE;AACnF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,wBAAwB;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA,4BAA4B,yBAAyB;AACrD;;AAEA,8BAA8B,cAAc;;AAE5C;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,0BAA0B,oBAAoB;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,0BAA0B,oBAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B,yBAAyB;AACnD;AACA;AACA;AACA;AACA;AACA,sCAAsC,0BAA0B;AAChE;AACA;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,yBAAyB;AACnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,sBAAsB;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB,KAAK,IAAI;AACzD,0BAA0B,mBAAmB,OAAO,KAAK,IAAI,KAAK;AAClE,qBAAqB,2BAA2B,KAAK,IAAI;AACzD,qBAAqB,uBAAuB,KAAK,IAAI;AACrD,8BAA8B,wBAAwB,KAAK,KAAK;AAChE,8BAA8B,oBAAoB,KAAK,KAAK;AAC5D,sBAAsB,6BAA6B,KAAK,IAAI;AAC5D;AACA;AACA;AACA;AACA;AACA,MAAM,4CAA4C;AAClD;AACA,OAAO,8CAA8C;AACrD;AACA,OAAO,iDAAiD;AACxD;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB,wBAAwB;AACxB,KAAK,eAAe;AACpB;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF;AACpF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;AACA;;AAEA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA,qCAAqC,cAAc;AACnD;AACA;AACA;AACA,kBAAkB,0BAA0B;AAC5C;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,oBAAoB;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,cAAc,eAAe;AAC7B;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,qBAAqB;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,OAAO;AAC7B;AACA;;AAEA;AACA,sBAAsB,gCAAgC;AACtD,yBAAyB,yCAAyC;AAClE,qBAAqB;AACrB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB,EAAE;AACjE,qCAAqC,kBAAkB,EAAE;;AAEzD,uBAAuB,sBAAsB;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,iBAAiB;AACvC;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,uBAAuB;AAC7C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0CAA0C,sBAAsB;AAChE;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,UAAU,EAAE;AACvD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,EAAE;AACb;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,UAAU;AACrB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,kBAAkB,mBAAmB;AACrC;AACA,sBAAsB,OAAO;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpiBA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,E;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB,oBAAoB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,mBAAmB;;AAEjC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA,aAAa;;AAEb;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA,kBAAkB,iDAAiD;AACnE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,wBAAwB;AAC1C;AACA,oCAAoC,aAAa,eAAe;AAChE;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,wBAAwB;AAC1C;;AAEA,wBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,kBAAkB,wCAAwC;AAC1D;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;AACA;;;;;;;;AClgBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;;AAEA;;;AAGA;AACA;AACA;;AAEA;;AAEA,cAAc,6BAA6B;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,oBAAoB;AACtC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;;AAEA,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;uDC1MA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC,qBAAqB;;AAEtB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iFAAiF;;AAEjF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,sBAAsB;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,IAAI;AACd;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,uCAAuC;AACxD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,MAAM;AAChB,UAAU,OAAO;AACjB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU,MAAM;AAChB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,IAAI;AACd;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,UAAU,SAAS;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,YAAY,SAAS;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;AACD,oC;;;;;;;ACjoCA,e;;;;;;;ACAA;;AAEA;AACA;AACA,oEAAoE,SAAS,UAAU;AACvF,6EAA6E;AAC7E,kDAAkD;AAClD,iCAAiC;AACjC,uCAAuC;AACvC,4CAA4C;AAC5C,qDAAqD,sBAAsB,qBAAqB,oBAAoB,iBAAiB;AACrI,8BAA8B;AAC9B,6BAA6B;AAC7B,mCAAmC;AACnC,sCAAsC,MAAM,OAAO,oBAAoB;AACvE,kDAAkD;AAClD,yCAAyC;AACzC,yCAAyC;AACzC,6CAA6C;AAC7C,mCAAmC;AACnC,+CAA+C;AAC/C,+CAA+C;AAC/C,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C,2CAA2C;AAC3C,6CAA6C;AAC7C,2CAA2C;AAC3C,2CAA2C;AAC3C,6CAA6C;AAC7C,2CAA2C;AAC3C,6CAA6C;AAC7C,qCAAqC,QAAQ,UAAU,aAAa,iCAAiC;AACrG,oCAAoC,wCAAwC,qCAAqC,oCAAoC,mCAAmC,gCAAgC;AACxN,0CAA0C;AAC1C,oCAAoC,qBAAqB,sBAAsB,gBAAgB,kBAAkB,sBAAsB,mBAAmB;AAC1J,qDAAqD;AACrD,yCAAyC,eAAe,gBAAgB,eAAe,mBAAmB,sBAAsB;AAChI,6CAA6C,QAAQ;AACrD,mDAAmD;AACnD,oFAAoF;AACpF,yDAAyD;AACzD,sEAAsE;AACtE,qEAAqE,uCAAuC,oCAAoC,mCAAmC,kCAAkC,+BAA+B,aAAa,UAAU,aAAa,oBAAoB,SAAS,UAAU;AAC/T,6EAA6E,UAAU;AACvF,yCAAyC,kBAAkB,uBAAuB,6BAA6B,aAAa,iBAAiB,4BAA4B,kBAAkB;AAC3L,sDAAsD,mBAAmB,YAAY,iBAAiB,eAAe,iBAAiB,mBAAmB,mBAAmB,kBAAkB;AAC9L,oCAAoC,eAAe,2BAA2B;AAC9E,yCAAyC;AACzC,yCAAyC,yBAAyB;AAClE,gCAAgC,eAAe,SAAS,WAAW,cAAc,eAAe,gBAAgB;AAChH,qBAAqB;AACrB,yCAAyC,gBAAgB,sBAAsB,aAAa,SAAS,yBAAyB,uCAAuC,WAAW,aAAa;AAC7L,qCAAqC,YAAY,YAAY,cAAc,gBAAgB,YAAY,eAAe,iBAAiB,iBAAiB;AACxJ,2CAA2C,qBAAqB,eAAe;AAC/E;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,CAAC;AACD;AACA;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB,OAAO,OAAO;AACd;AACA,OAAO,OAAO;AACd;AACA,OAAO,OAAO;AACd;AACA,OAAO,MAAM;AACb;AACA,OAAO,OAAO;AACd;AACA;AACA,OAAO,OAAO;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,kBAAkB,SAAS;AAC3B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,0BAA0B,yBAAyB;AACnD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,6CAA6C;AAC7C,8CAA8C;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,sBAAsB,mBAAmB;AACzC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,kBAAkB;AACxC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AC9XA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+EAA+E,eAAe;AAC9F;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,8DAA8D,UAAU;AACxE,8DAA8D,wBAAwB;;AAEtF;AACA;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D,gCAAgC;AAC/F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mEAAmE,qCAAqC;AACxG;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA,2CAA2C;;AAE3C;;AAEA;AACA,+DAA+D,8BAA8B;AAC7F;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB;AACnB;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,yDAAyD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,8BAA8B,QAAQ;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,oBAAoB,aAAa;AACjC,oBAAoB;;AAEpB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,eAAe;AAC7B;AACA,aAAa,iBAAiB,IAAI;;AAElC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,kDAAkD,uBAAuB,EAAE;;AAE3E;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,yBAAyB,sBAAsB;AAC/C;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,qCAAqC,cAAc,EAAE;AACrD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;;AAEA;AACA,sDAAsD,WAAW;AACjE,iBAAiB;AACjB,aAAa;;AAEb;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,cAAc,EAAE;AACnD;AACA;AACA,KAAK;AACL;;;;;;;;AC1jBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,cAAc,cAAc;AAC5B;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C,IAAI;AAClD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;ACxZA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,wBAAwB;AAClE;AACA,yCAAyC,uBAAuB;AAChE;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,SAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;;AAExC;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yCAAyC,oCAAoC;AAC7E,wCAAwC;AACxC,yBAAyB;AACzB;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yDAAyD;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,oBAAoB,iCAAiC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC,sBAAsB;AACxD,kCAAkC,qBAAqB;AACvD,mCAAmC,uBAAuB;AAC1D,mCAAmC,oBAAoB;AACvD,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA,6BAA6B,mCAAmC;AAChE;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;;;;;;;;AC7nBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA,0BAA0B,gBAAgB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C,iDAAiD,YAAY;;AAE7D;AACA;AACA,+CAA+C,YAAY;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,2BAA2B;AAC3B,kBAAkB,eAAe;AACjC;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;;AAET;AACA;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,qBAAqB;AAC/C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kBAAkB,wBAAwB;AAC1C;AACA;;AAEA;AACA,sBAAsB,qBAAqB;AAC3C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB,2BAA2B;AACjD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,0BAA0B,6BAA6B;AACvD;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA,sBAAsB,2BAA2B;AACjD;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0BAA0B,6BAA6B;AACvD;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,sBAAsB,6BAA6B;AACnD;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AC5UA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA,2CAA2C;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,8CAA8C,yBAAyB;AACvE;AACA;;AAEA;AACA,+CAA+C,yBAAyB;AACxE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;;AAEA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA,yCAAyC,+BAA+B;AACxE,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,0EAA0E,0CAA0C,EAAE;AACtH,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA,aAAa;AACb,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0DAA0D,+BAA+B,EAAE;AAC3F,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C,OAAO;AACnD;AACA;AACA,aAAa;;AAEb;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,aAAa;;AAEb;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,sBAAsB;AAChD,0BAA0B,qBAAqB;AAC/C,2BAA2B,oBAAoB;AAC/C,2BAA2B,uBAAuB;AAClD,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,sBAAsB;AAChD,0BAA0B,qBAAqB;AAC/C;AACA;AACA,KAAK;AACL;;;;;;;;AC5sBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,sBAAsB,qBAAqB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,sBAAsB,qBAAqB;AAC3C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,qBAAqB;AAC3C,mCAAmC;AACnC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;AACA;;AAEA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;AC9NA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA,2BAA2B;AAC3B;AACA;AACA,wBAAwB;AACxB;;AAEA;;AAEA;AACA;AACA;AACA,8CAA8C;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,+BAA+B;AAChD,cAAc,qBAAqB;AACnC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,sBAAsB,eAAe;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,iBAAiB;AACjB,eAAe;;AAEf;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,yBAAyB;AACnD;AACA;AACA;AACA;AACA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,4CAA4C;;AAErE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;;;;;;;;ACxIA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;;AAEA,cAAc,kBAAkB;AAChC;AACA;;AAEA,cAAc,mBAAmB;AACjC;AACA;;AAEA,+BAA+B;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,cAAc,wBAAwB;AACtC;AACA;;AAEA;AACA,sBAAsB,cAAc;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;;;;;;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,kBAAkB;AAClB,kBAAkB,OAAO;AACzB;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,KAAK;AACL;;;;;;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,kBAAkB,wBAAwB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB,gBAAgB;AACtC;;AAEA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA,cAAc,OAAO;AACrB,kBAAkB,OAAO;AACzB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,8BAA8B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,sBAAsB;AAC1C,oBAAoB,sBAAsB;AAC1C;AACA;AACA,oBAAoB,sBAAsB;AAC1C,oBAAoB,sBAAsB;AAC1C;AACA;AACA,oBAAoB,sBAAsB;AAC1C,oBAAoB,sBAAsB;AAC1C;AACA;AACA,oBAAoB,sBAAsB;AAC1C,oBAAoB,sBAAsB;AAC1C;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C,yBAAyB;AACpE;;AAEA,2CAA2C,yBAAyB;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C,yBAAyB;AACpE;;AAEA,2CAA2C,yBAAyB;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,0CAA0C;AACrE;AACA;AACA,2BAA2B,wBAAwB;AACnD;;AAEA;AACA;AACA,2BAA2B,0CAA0C;AACrE;AACA;AACA,2BAA2B,8BAA8B;AACzD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,SAAS;;AAET;AACA,KAAK;AACL;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA,sBAAsB;;AAEtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA,gDAAgD,WAAW;AAC3D;;AAEA;AACA;AACA;AACA,gDAAgD,WAAW;AAC3D;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,cAAc,qBAAqB;AACnC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,0BAA0B;AAC5C;;AAEA,kBAAkB,OAAO;AACzB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;;AAEA;AACA,cAAc,8BAA8B;AAC5C;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;;;AAGA;AACA;AACA,mBAAmB,4BAA4B;AAC/C,qBAAqB,iCAAiC;AACtD,oBAAoB;AACpB,SAAS;AACT;AACA,kBAAkB,4BAA4B;AAC9C,qBAAqB,iCAAiC;AACtD,qBAAqB;AACrB;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;;AAEL;AACA,cAAc,wBAAwB;AACtC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,mEAAmE;AACtF;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,6CAA6C,4DAA4D;AACzG,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD,2BAA2B,qBAAqB;AAChD,4BAA4B,oBAAoB;AAChD,4BAA4B,uBAAuB;AACnD,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACtqBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB,2BAA2B;AAC3B,2BAA2B;AAC3B,qBAAqB;AACrB,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACpdA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;;AAET;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,0CAA0C,eAAe;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,4FAA4F;AAC5F;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC,sBAAsB;AAC5D,sCAAsC,qBAAqB;AAC3D,iCAAiC,oBAAoB;AACrD,iCAAiC,uBAAuB;AACxD,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,uCAAuC;AACvC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uCAAuC,mBAAmB;;AAE1D;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA,mBAAmB,+DAA+D;AAClF;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,sDAAsD;AACtD;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AC1mBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,qDAAqD;;AAErD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,KAAK;AACL;;AAEA;AACA,0BAA0B,0BAA0B;AACpD;AACA;;AAEA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,eAAe,aAAa;;AAE5B;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,qCAAqC,gDAAgD,EAAE;AACvF;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,aAAa;AAC5B;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sDAAsD;AACtD;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACpiBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA,oDAAoD;AACpD;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;;AAEA;AACA;;;;;;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,sBAAsB;AAChD,0BAA0B,qBAAqB;AAC/C,2BAA2B,oBAAoB;AAC/C,2BAA2B,uBAAuB;AAClD,KAAK;AACL;;;;;;;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;;AAEA,+BAA+B,cAAc;AAC7C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;;AAEA,SAAS;AACT;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;;AAEA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,mEAAmE,UAAU;AAC7E,mEAAmE,wBAAwB;AAC3F;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;AACA;;AAEA;;AAEA;AACA;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,uBAAuB;AAC5D;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,cAAc,eAAe;AAC7B,iBAAiB;AACjB;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB,sCAAsC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc,uBAAuB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,uBAAuB;AACzC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,uBAAuB;AACzC;;AAEA,sBAAsB,sBAAsB;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc,uBAAuB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,aAAa;AAC3B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA,cAAc,uBAAuB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,sBAAsB;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;;AAEA;AACA;AACA,uCAAuC,sBAAsB;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,sBAAsB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,sBAAsB;AAC5C;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mCAAmC,cAAc;AACjD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;;AAEA,sBAAsB,kBAAkB;AACxC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,6BAA6B,2BAA2B;AACxD;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,cAAc,mBAAmB;AACjC;;AAEA,kBAAkB,kBAAkB;AACpC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,2BAA2B;AACrE;;;AAGA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;;AAEA,sBAAsB,kBAAkB;AACxC;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;;AAEA,sBAAsB,kBAAkB;AACxC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,6BAA6B;AAC1D;;;AAGA;AACA;AACA;;;;;;;;ACnlBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA,WAAW,QAAQ;AACnB;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,mBAAmB;AACrC;AACA,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,aAAa,OAAO;AACpB;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB,SAAS;;AAET;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACxgBA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,2BAA2B,EAAE;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,wBAAwB;AAC9D,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA,KAAK;AACL,kBAAkB,eAAe;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;;;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA,2CAA2C,kBAAkB,EAAE;;AAE/D;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,yBAAyB;AAC3C;AACA;;AAEA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;;AAEA;AACA;;;;;;;;ACrJA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;;AAErB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B,wBAAwB;;AAEpD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wDAAwD;;AAExD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B,gCAAgC;AAC7D,gCAAgC,gCAAgC;;AAEhE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C;;AAE9C,kBAAkB,sBAAsB;AACxC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,WAAW;AAC7B;AACA;AACA;;AAEA,sBAAsB,WAAW;AACjC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB,qBAAqB;AAC3C;AACA;;AAEA;AACA,sBAAsB,kCAAkC;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,4BAA4B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAc,wBAAwB;AACtC;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,eAAe;AACjC,oCAAoC;AACpC;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,cAAc,eAAe;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrsBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8BAA8B,uBAAuB;;AAErD;AACA;AACA,SAAS;AACT,KAAK;AACL;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA","file":"los.bundle.js","sourcesContent":["/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar numConstants = require('../constants/numerical');\nvar FP_SAFE = numConstants.FP_SAFE;\nvar BADNUM = numConstants.BADNUM;\n\nvar lib = module.exports = {};\n\nlib.nestedProperty = require('./nested_property');\nlib.keyedContainer = require('./keyed_container');\nlib.relativeAttr = require('./relative_attr');\nlib.isPlainObject = require('./is_plain_object');\nlib.isArray = require('./is_array');\nlib.mod = require('./mod');\nlib.toLogRange = require('./to_log_range');\nlib.relinkPrivateKeys = require('./relink_private');\nlib.ensureArray = require('./ensure_array');\n\nvar coerceModule = require('./coerce');\nlib.valObjectMeta = coerceModule.valObjectMeta;\nlib.coerce = coerceModule.coerce;\nlib.coerce2 = coerceModule.coerce2;\nlib.coerceFont = coerceModule.coerceFont;\nlib.coerceHoverinfo = coerceModule.coerceHoverinfo;\nlib.validate = coerceModule.validate;\n\nvar datesModule = require('./dates');\nlib.dateTime2ms = datesModule.dateTime2ms;\nlib.isDateTime = datesModule.isDateTime;\nlib.ms2DateTime = datesModule.ms2DateTime;\nlib.ms2DateTimeLocal = datesModule.ms2DateTimeLocal;\nlib.cleanDate = datesModule.cleanDate;\nlib.isJSDate = datesModule.isJSDate;\nlib.formatDate = datesModule.formatDate;\nlib.incrementMonth = datesModule.incrementMonth;\nlib.dateTick0 = datesModule.dateTick0;\nlib.dfltRange = datesModule.dfltRange;\nlib.findExactDates = datesModule.findExactDates;\nlib.MIN_MS = datesModule.MIN_MS;\nlib.MAX_MS = datesModule.MAX_MS;\n\nvar searchModule = require('./search');\nlib.findBin = searchModule.findBin;\nlib.sorterAsc = searchModule.sorterAsc;\nlib.sorterDes = searchModule.sorterDes;\nlib.distinctVals = searchModule.distinctVals;\nlib.roundUp = searchModule.roundUp;\n\nvar statsModule = require('./stats');\nlib.aggNums = statsModule.aggNums;\nlib.len = statsModule.len;\nlib.mean = statsModule.mean;\nlib.variance = statsModule.variance;\nlib.stdev = statsModule.stdev;\nlib.interp = statsModule.interp;\n\nvar matrixModule = require('./matrix');\nlib.init2dArray = matrixModule.init2dArray;\nlib.transposeRagged = matrixModule.transposeRagged;\nlib.dot = matrixModule.dot;\nlib.translationMatrix = matrixModule.translationMatrix;\nlib.rotationMatrix = matrixModule.rotationMatrix;\nlib.rotationXYMatrix = matrixModule.rotationXYMatrix;\nlib.apply2DTransform = matrixModule.apply2DTransform;\nlib.apply2DTransform2 = matrixModule.apply2DTransform2;\n\nvar geom2dModule = require('./geometry2d');\nlib.segmentsIntersect = geom2dModule.segmentsIntersect;\nlib.segmentDistance = geom2dModule.segmentDistance;\nlib.getTextLocation = geom2dModule.getTextLocation;\nlib.clearLocationCache = geom2dModule.clearLocationCache;\nlib.getVisibleSegment = geom2dModule.getVisibleSegment;\n\nvar extendModule = require('./extend');\nlib.extendFlat = extendModule.extendFlat;\nlib.extendDeep = extendModule.extendDeep;\nlib.extendDeepAll = extendModule.extendDeepAll;\nlib.extendDeepNoArrays = extendModule.extendDeepNoArrays;\n\nvar loggersModule = require('./loggers');\nlib.log = loggersModule.log;\nlib.warn = loggersModule.warn;\nlib.error = loggersModule.error;\n\nvar regexModule = require('./regex');\nlib.counterRegex = regexModule.counter;\n\nvar throttleModule = require('./throttle');\nlib.throttle = throttleModule.throttle;\nlib.throttleDone = throttleModule.done;\nlib.clearThrottle = throttleModule.clear;\n\nlib.getGraphDiv = require('./get_graph_div');\n\nlib.notifier = require('./notifier');\n\nlib.filterUnique = require('./filter_unique');\nlib.filterVisible = require('./filter_visible');\nlib.pushUnique = require('./push_unique');\n\nlib.cleanNumber = require('./clean_number');\n\nlib.ensureNumber = function num(v) {\n if(!isNumeric(v)) return BADNUM;\n v = Number(v);\n if(v < -FP_SAFE || v > FP_SAFE) return BADNUM;\n return isNumeric(v) ? Number(v) : BADNUM;\n};\n\nlib.noop = require('./noop');\nlib.identity = require('./identity');\n\n/**\n * swap x and y of the same attribute in container cont\n * specify attr with a ? in place of x/y\n * you can also swap other things than x/y by providing part1 and part2\n */\nlib.swapAttrs = function(cont, attrList, part1, part2) {\n if(!part1) part1 = 'x';\n if(!part2) part2 = 'y';\n for(var i = 0; i < attrList.length; i++) {\n var attr = attrList[i],\n xp = lib.nestedProperty(cont, attr.replace('?', part1)),\n yp = lib.nestedProperty(cont, attr.replace('?', part2)),\n temp = xp.get();\n xp.set(yp.get());\n yp.set(temp);\n }\n};\n\n/**\n * to prevent event bubbling, in particular text selection during drag.\n * see http://stackoverflow.com/questions/5429827/\n * how-can-i-prevent-text-element-selection-with-cursor-drag\n * for maximum effect use:\n * return pauseEvent(e);\n */\nlib.pauseEvent = function(e) {\n if(e.stopPropagation) e.stopPropagation();\n if(e.preventDefault) e.preventDefault();\n e.cancelBubble = true;\n return false;\n};\n\n/**\n * SVG painter's algo worked around with reinsertion\n */\nlib.raiseToTop = function raiseToTop(elem) {\n elem.parentNode.appendChild(elem);\n};\n\n/**\n * cancel a possibly pending transition; returned selection may be used by caller\n */\nlib.cancelTransition = function(selection) {\n return selection.transition().duration(0);\n};\n\n// constrain - restrict a number v to be between v0 and v1\nlib.constrain = function(v, v0, v1) {\n if(v0 > v1) return Math.max(v1, Math.min(v0, v));\n return Math.max(v0, Math.min(v1, v));\n};\n\n/**\n * do two bounding boxes from getBoundingClientRect,\n * ie {left,right,top,bottom,width,height}, overlap?\n * takes optional padding pixels\n */\nlib.bBoxIntersect = function(a, b, pad) {\n pad = pad || 0;\n return (a.left <= b.right + pad &&\n b.left <= a.right + pad &&\n a.top <= b.bottom + pad &&\n b.top <= a.bottom + pad);\n};\n\n/*\n * simpleMap: alternative to Array.map that only\n * passes on the element and up to 2 extra args you\n * provide (but not the array index or the whole array)\n *\n * array: the array to map it to\n * func: the function to apply\n * x1, x2: optional extra args\n */\nlib.simpleMap = function(array, func, x1, x2) {\n var len = array.length,\n out = new Array(len);\n for(var i = 0; i < len; i++) out[i] = func(array[i], x1, x2);\n return out;\n};\n\n// random string generator\nlib.randstr = function randstr(existing, bits, base) {\n /*\n * Include number of bits, the base of the string you want\n * and an optional array of existing strings to avoid.\n */\n if(!base) base = 16;\n if(bits === undefined) bits = 24;\n if(bits <= 0) return '0';\n\n var digits = Math.log(Math.pow(2, bits)) / Math.log(base),\n res = '',\n i,\n b,\n x;\n\n for(i = 2; digits === Infinity; i *= 2) {\n digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;\n }\n\n var rem = digits - Math.floor(digits);\n\n for(i = 0; i < Math.floor(digits); i++) {\n x = Math.floor(Math.random() * base).toString(base);\n res = x + res;\n }\n\n if(rem) {\n b = Math.pow(base, rem);\n x = Math.floor(Math.random() * b).toString(base);\n res = x + res;\n }\n\n var parsed = parseInt(res, base);\n if((existing && (existing.indexOf(res) > -1)) ||\n (parsed !== Infinity && parsed >= Math.pow(2, bits))) {\n return randstr(existing, bits, base);\n }\n else return res;\n};\n\nlib.OptionControl = function(opt, optname) {\n /*\n * An environment to contain all option setters and\n * getters that collectively modify opts.\n *\n * You can call up opts from any function in new object\n * as this.optname || this.opt\n *\n * See FitOpts for example of usage\n */\n if(!opt) opt = {};\n if(!optname) optname = 'opt';\n\n var self = {};\n self.optionList = [];\n\n self._newoption = function(optObj) {\n optObj[optname] = opt;\n self[optObj.name] = optObj;\n self.optionList.push(optObj);\n };\n\n self['_' + optname] = opt;\n return self;\n};\n\n/**\n * lib.smooth: smooth arrayIn by convolving with\n * a hann window with given full width at half max\n * bounce the ends in, so the output has the same length as the input\n */\nlib.smooth = function(arrayIn, FWHM) {\n FWHM = Math.round(FWHM) || 0; // only makes sense for integers\n if(FWHM < 2) return arrayIn;\n\n var alen = arrayIn.length,\n alen2 = 2 * alen,\n wlen = 2 * FWHM - 1,\n w = new Array(wlen),\n arrayOut = new Array(alen),\n i,\n j,\n k,\n v;\n\n // first make the window array\n for(i = 0; i < wlen; i++) {\n w[i] = (1 - Math.cos(Math.PI * (i + 1) / FWHM)) / (2 * FWHM);\n }\n\n // now do the convolution\n for(i = 0; i < alen; i++) {\n v = 0;\n for(j = 0; j < wlen; j++) {\n k = i + j + 1 - FWHM;\n\n // multibounce\n if(k < -alen) k -= alen2 * Math.round(k / alen2);\n else if(k >= alen2) k -= alen2 * Math.floor(k / alen2);\n\n // single bounce\n if(k < 0) k = - 1 - k;\n else if(k >= alen) k = alen2 - 1 - k;\n\n v += arrayIn[k] * w[j];\n }\n arrayOut[i] = v;\n }\n\n return arrayOut;\n};\n\n/**\n * syncOrAsync: run a sequence of functions synchronously\n * as long as its returns are not promises (ie have no .then)\n * includes one argument arg to send to all functions...\n * this is mainly just to prevent us having to make wrapper functions\n * when the only purpose of the wrapper is to reference gd\n * and a final step to be executed at the end\n * TODO: if there's an error and everything is sync,\n * this doesn't happen yet because we want to make sure\n * that it gets reported\n */\nlib.syncOrAsync = function(sequence, arg, finalStep) {\n var ret, fni;\n\n function continueAsync() {\n return lib.syncOrAsync(sequence, arg, finalStep);\n }\n\n while(sequence.length) {\n fni = sequence.splice(0, 1)[0];\n ret = fni(arg);\n\n if(ret && ret.then) {\n return ret.then(continueAsync)\n .then(undefined, lib.promiseError);\n }\n }\n\n return finalStep && finalStep(arg);\n};\n\n\n/**\n * Helper to strip trailing slash, from\n * http://stackoverflow.com/questions/6680825/return-string-without-trailing-slash\n */\nlib.stripTrailingSlash = function(str) {\n if(str.substr(-1) === '/') return str.substr(0, str.length - 1);\n return str;\n};\n\nlib.noneOrAll = function(containerIn, containerOut, attrList) {\n /**\n * some attributes come together, so if you have one of them\n * in the input, you should copy the default values of the others\n * to the input as well.\n */\n if(!containerIn) return;\n\n var hasAny = false,\n hasAll = true,\n i,\n val;\n\n for(i = 0; i < attrList.length; i++) {\n val = containerIn[attrList[i]];\n if(val !== undefined && val !== null) hasAny = true;\n else hasAll = false;\n }\n\n if(hasAny && !hasAll) {\n for(i = 0; i < attrList.length; i++) {\n containerIn[attrList[i]] = containerOut[attrList[i]];\n }\n }\n};\n\n/** merges calcdata field (given by cdAttr) with traceAttr values\n *\n * N.B. Loop over minimum of cd.length and traceAttr.length\n * i.e. it does not try to fill in beyond traceAttr.length-1\n *\n * @param {array} traceAttr : trace attribute\n * @param {object} cd : calcdata trace\n * @param {string} cdAttr : calcdata key\n */\nlib.mergeArray = function(traceAttr, cd, cdAttr) {\n if(Array.isArray(traceAttr)) {\n var imax = Math.min(traceAttr.length, cd.length);\n for(var i = 0; i < imax; i++) cd[i][cdAttr] = traceAttr[i];\n }\n};\n\n/** fills calcdata field (given by cdAttr) with traceAttr values\n * or function of traceAttr values (e.g. some fallback)\n *\n * N.B. Loops over all cd items.\n *\n * @param {array} traceAttr : trace attribute\n * @param {object} cd : calcdata trace\n * @param {string} cdAttr : calcdata key\n * @param {function} [fn] : optional function to apply to each array item\n */\nlib.fillArray = function(traceAttr, cd, cdAttr, fn) {\n fn = fn || lib.identity;\n\n if(Array.isArray(traceAttr)) {\n for(var i = 0; i < cd.length; i++) {\n cd[i][cdAttr] = fn(traceAttr[i]);\n }\n }\n};\n\n/** Handler for trace-wide vs per-point options\n *\n * @param {object} trace : (full) trace object\n * @param {number} ptNumber : index of the point in question\n * @param {string} astr : attribute string\n * @param {function} [fn] : optional function to apply to each array item\n *\n * @return {any}\n */\nlib.castOption = function(trace, ptNumber, astr, fn) {\n fn = fn || lib.identity;\n\n var val = lib.nestedProperty(trace, astr).get();\n\n if(Array.isArray(val)) {\n if(Array.isArray(ptNumber) && Array.isArray(val[ptNumber[0]])) {\n return fn(val[ptNumber[0]][ptNumber[1]]);\n } else {\n return fn(val[ptNumber]);\n }\n } else {\n return val;\n }\n};\n\n/** Extract option from calcdata item, correctly falling back to\n * trace value if not found.\n *\n * @param {object} calcPt : calcdata[i][j] item\n * @param {object} trace : (full) trace object\n * @param {string} calcKey : calcdata key\n * @param {string} traceKey : aka trace attribute string\n * @return {any}\n */\nlib.extractOption = function(calcPt, trace, calcKey, traceKey) {\n if(calcKey in calcPt) return calcPt[calcKey];\n\n // fallback to trace value,\n // must check if value isn't itself an array\n // which means the trace attribute has a corresponding\n // calcdata key, but its value is falsy\n var traceVal = lib.nestedProperty(trace, traceKey).get();\n if(!Array.isArray(traceVal)) return traceVal;\n};\n\n/** Returns target as set by 'target' transform attribute\n *\n * @param {object} trace : full trace object\n * @param {object} transformOpts : transform option object\n * - target (string} :\n * either an attribute string referencing an array in the trace object, or\n * a set array.\n *\n * @return {array or false} : the target array (NOT a copy!!) or false if invalid\n */\nlib.getTargetArray = function(trace, transformOpts) {\n var target = transformOpts.target;\n\n if(typeof target === 'string' && target) {\n var array = lib.nestedProperty(trace, target).get();\n return Array.isArray(array) ? array : false;\n } else if(Array.isArray(target)) {\n return target;\n }\n\n return false;\n};\n\n/**\n * modified version of jQuery's extend to strip out private objs and functions,\n * and cut arrays down to first or 1 elements\n * because extend-like algorithms are hella slow\n * obj2 is assumed to already be clean of these things (including no arrays)\n */\nlib.minExtend = function(obj1, obj2) {\n var objOut = {};\n if(typeof obj2 !== 'object') obj2 = {};\n var arrayLen = 3,\n keys = Object.keys(obj1),\n i,\n k,\n v;\n for(i = 0; i < keys.length; i++) {\n k = keys[i];\n v = obj1[k];\n if(k.charAt(0) === '_' || typeof v === 'function') continue;\n else if(k === 'module') objOut[k] = v;\n else if(Array.isArray(v)) objOut[k] = v.slice(0, arrayLen);\n else if(v && (typeof v === 'object')) objOut[k] = lib.minExtend(obj1[k], obj2[k]);\n else objOut[k] = v;\n }\n\n keys = Object.keys(obj2);\n for(i = 0; i < keys.length; i++) {\n k = keys[i];\n v = obj2[k];\n if(typeof v !== 'object' || !(k in objOut) || typeof objOut[k] !== 'object') {\n objOut[k] = v;\n }\n }\n\n return objOut;\n};\n\nlib.titleCase = function(s) {\n return s.charAt(0).toUpperCase() + s.substr(1);\n};\n\nlib.containsAny = function(s, fragments) {\n for(var i = 0; i < fragments.length; i++) {\n if(s.indexOf(fragments[i]) !== -1) return true;\n }\n return false;\n};\n\nlib.isPlotDiv = function(el) {\n var el3 = d3.select(el);\n return el3.node() instanceof HTMLElement &&\n el3.size() &&\n el3.classed('js-plotly-plot');\n};\n\nlib.removeElement = function(el) {\n var elParent = el && el.parentNode;\n if(elParent) elParent.removeChild(el);\n};\n\n/**\n * for dynamically adding style rules\n * makes one stylesheet that contains all rules added\n * by all calls to this function\n */\nlib.addStyleRule = function(selector, styleString) {\n if(!lib.styleSheet) {\n var style = document.createElement('style');\n // WebKit hack :(\n style.appendChild(document.createTextNode(''));\n document.head.appendChild(style);\n lib.styleSheet = style.sheet;\n }\n var styleSheet = lib.styleSheet;\n\n if(styleSheet.insertRule) {\n styleSheet.insertRule(selector + '{' + styleString + '}', 0);\n }\n else if(styleSheet.addRule) {\n styleSheet.addRule(selector, styleString, 0);\n }\n else lib.warn('addStyleRule failed');\n};\n\nlib.isIE = function() {\n return typeof window.navigator.msSaveBlob !== 'undefined';\n};\n\n/**\n * Duck typing to recognize a d3 selection, mostly for IE9's benefit\n * because it doesn't handle instanceof like modern browsers\n */\nlib.isD3Selection = function(obj) {\n return obj && (typeof obj.classed === 'function');\n};\n\n\n/**\n * Converts a string path to an object.\n *\n * When given a string containing an array element, it will create a `null`\n * filled array of the given size.\n *\n * @example\n * lib.objectFromPath('nested.test[2].path', 'value');\n * // returns { nested: { test: [null, null, { path: 'value' }]}\n *\n * @param {string} path to nested value\n * @param {*} any value to be set\n *\n * @return {Object} the constructed object with a full nested path\n */\nlib.objectFromPath = function(path, value) {\n var keys = path.split('.'),\n tmpObj,\n obj = tmpObj = {};\n\n for(var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var el = null;\n\n var parts = keys[i].match(/(.*)\\[([0-9]+)\\]/);\n\n if(parts) {\n key = parts[1];\n el = parts[2];\n\n tmpObj = tmpObj[key] = [];\n\n if(i === keys.length - 1) {\n tmpObj[el] = value;\n } else {\n tmpObj[el] = {};\n }\n\n tmpObj = tmpObj[el];\n } else {\n\n if(i === keys.length - 1) {\n tmpObj[key] = value;\n } else {\n tmpObj[key] = {};\n }\n\n tmpObj = tmpObj[key];\n }\n }\n\n return obj;\n};\n\n/**\n * Iterate through an object in-place, converting dotted properties to objects.\n *\n * Examples:\n *\n * lib.expandObjectPaths({'nested.test.path': 'value'});\n * => { nested: { test: {path: 'value'}}}\n *\n * It also handles array notation, e.g.:\n *\n * lib.expandObjectPaths({'foo[1].bar': 'value'});\n * => { foo: [null, {bar: value}] }\n *\n * It handles merges the results when two properties are specified in parallel:\n *\n * lib.expandObjectPaths({'foo[1].bar': 10, 'foo[0].bar': 20});\n * => { foo: [{bar: 10}, {bar: 20}] }\n *\n * It does NOT, however, merge mulitple mutliply-nested arrays::\n *\n * lib.expandObjectPaths({'marker[1].range[1]': 5, 'marker[1].range[0]': 4})\n * => { marker: [null, {range: 4}] }\n */\n\n// Store this to avoid recompiling regex on *every* prop since this may happen many\n// many times for animations. Could maybe be inside the function. Not sure about\n// scoping vs. recompilation tradeoff, but at least it's not just inlining it into\n// the inner loop.\nvar dottedPropertyRegex = /^([^\\[\\.]+)\\.(.+)?/;\nvar indexedPropertyRegex = /^([^\\.]+)\\[([0-9]+)\\](\\.)?(.+)?/;\n\nlib.expandObjectPaths = function(data) {\n var match, key, prop, datum, idx, dest, trailingPath;\n if(typeof data === 'object' && !Array.isArray(data)) {\n for(key in data) {\n if(data.hasOwnProperty(key)) {\n if((match = key.match(dottedPropertyRegex))) {\n datum = data[key];\n prop = match[1];\n\n delete data[key];\n\n data[prop] = lib.extendDeepNoArrays(data[prop] || {}, lib.objectFromPath(key, lib.expandObjectPaths(datum))[prop]);\n } else if((match = key.match(indexedPropertyRegex))) {\n datum = data[key];\n\n prop = match[1];\n idx = parseInt(match[2]);\n\n delete data[key];\n\n data[prop] = data[prop] || [];\n\n if(match[3] === '.') {\n // This is the case where theere are subsequent properties into which\n // we must recurse, e.g. transforms[0].value\n trailingPath = match[4];\n dest = data[prop][idx] = data[prop][idx] || {};\n\n // NB: Extend deep no arrays prevents this from working on multiple\n // nested properties in the same object, e.g.\n //\n // {\n // foo[0].bar[1].range\n // foo[0].bar[0].range\n // }\n //\n // In this case, the extendDeepNoArrays will overwrite one array with\n // the other, so that both properties *will not* be present in the\n // result. Fixing this would require a more intelligent tracking\n // of changes and merging than extendDeepNoArrays currently accomplishes.\n lib.extendDeepNoArrays(dest, lib.objectFromPath(trailingPath, lib.expandObjectPaths(datum)));\n } else {\n // This is the case where this property is the end of the line,\n // e.g. xaxis.range[0]\n data[prop][idx] = lib.expandObjectPaths(datum);\n }\n } else {\n data[key] = lib.expandObjectPaths(data[key]);\n }\n }\n }\n }\n\n return data;\n};\n\n/**\n * Converts value to string separated by the provided separators.\n *\n * @example\n * lib.numSeparate(2016, '.,');\n * // returns '2016'\n *\n * @example\n * lib.numSeparate(3000, '.,', true);\n * // returns '3,000'\n *\n * @example\n * lib.numSeparate(1234.56, '|,')\n * // returns '1,234|56'\n *\n * @param {string|number} value the value to be converted\n * @param {string} separators string of decimal, then thousands separators\n * @param {boolean} separatethousands boolean, 4-digit integers are separated if true\n *\n * @return {string} the value that has been separated\n */\nlib.numSeparate = function(value, separators, separatethousands) {\n if(!separatethousands) separatethousands = false;\n\n if(typeof separators !== 'string' || separators.length === 0) {\n throw new Error('Separator string required for formatting!');\n }\n\n if(typeof value === 'number') {\n value = String(value);\n }\n\n var thousandsRe = /(\\d+)(\\d{3})/,\n decimalSep = separators.charAt(0),\n thouSep = separators.charAt(1);\n\n var x = value.split('.'),\n x1 = x[0],\n x2 = x.length > 1 ? decimalSep + x[1] : '';\n\n // Years are ignored for thousands separators\n if(thouSep && (x.length > 1 || x1.length > 4 || separatethousands)) {\n while(thousandsRe.test(x1)) {\n x1 = x1.replace(thousandsRe, '$1' + thouSep + '$2');\n }\n }\n\n return x1 + x2;\n};\n\nvar TEMPLATE_STRING_REGEX = /%{([^\\s%{}]*)}/g;\nvar SIMPLE_PROPERTY_REGEX = /^\\w*$/;\n\n/*\n * Substitute values from an object into a string\n *\n * Examples:\n * Lib.templateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'\n * Lib.templateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'\n *\n * @param {string} input string containing %{...} template strings\n * @param {obj} data object containing substitution values\n *\n * @return {string} templated string\n */\n\nlib.templateString = function(string, obj) {\n // Not all that useful, but cache nestedProperty instantiation\n // just in case it speeds things up *slightly*:\n var getterCache = {};\n\n return string.replace(TEMPLATE_STRING_REGEX, function(dummy, key) {\n if(SIMPLE_PROPERTY_REGEX.test(key)) {\n return obj[key] || '';\n }\n getterCache[key] = getterCache[key] || lib.nestedProperty(obj, key).get;\n return getterCache[key]() || '';\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/index.js\n// module id = 0\n// module chunks = 0","!function() {\n var d3 = {\n version: \"3.5.17\"\n };\n var d3_arraySlice = [].slice, d3_array = function(list) {\n return d3_arraySlice.call(list);\n };\n var d3_document = this.document;\n function d3_documentElement(node) {\n return node && (node.ownerDocument || node.document || node).documentElement;\n }\n function d3_window(node) {\n return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView);\n }\n if (d3_document) {\n try {\n d3_array(d3_document.documentElement.childNodes)[0].nodeType;\n } catch (e) {\n d3_array = function(list) {\n var i = list.length, array = new Array(i);\n while (i--) array[i] = list[i];\n return array;\n };\n }\n }\n if (!Date.now) Date.now = function() {\n return +new Date();\n };\n if (d3_document) {\n try {\n d3_document.createElement(\"DIV\").style.setProperty(\"opacity\", 0, \"\");\n } catch (error) {\n var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;\n d3_element_prototype.setAttribute = function(name, value) {\n d3_element_setAttribute.call(this, name, value + \"\");\n };\n d3_element_prototype.setAttributeNS = function(space, local, value) {\n d3_element_setAttributeNS.call(this, space, local, value + \"\");\n };\n d3_style_prototype.setProperty = function(name, value, priority) {\n d3_style_setProperty.call(this, name, value + \"\", priority);\n };\n }\n }\n d3.ascending = d3_ascending;\n function d3_ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n }\n d3.descending = function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n };\n d3.min = function(array, f) {\n var i = -1, n = array.length, a, b;\n if (arguments.length === 1) {\n while (++i < n) if ((b = array[i]) != null && b >= b) {\n a = b;\n break;\n }\n while (++i < n) if ((b = array[i]) != null && a > b) a = b;\n } else {\n while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {\n a = b;\n break;\n }\n while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;\n }\n return a;\n };\n d3.max = function(array, f) {\n var i = -1, n = array.length, a, b;\n if (arguments.length === 1) {\n while (++i < n) if ((b = array[i]) != null && b >= b) {\n a = b;\n break;\n }\n while (++i < n) if ((b = array[i]) != null && b > a) a = b;\n } else {\n while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {\n a = b;\n break;\n }\n while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;\n }\n return a;\n };\n d3.extent = function(array, f) {\n var i = -1, n = array.length, a, b, c;\n if (arguments.length === 1) {\n while (++i < n) if ((b = array[i]) != null && b >= b) {\n a = c = b;\n break;\n }\n while (++i < n) if ((b = array[i]) != null) {\n if (a > b) a = b;\n if (c < b) c = b;\n }\n } else {\n while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {\n a = c = b;\n break;\n }\n while (++i < n) if ((b = f.call(array, array[i], i)) != null) {\n if (a > b) a = b;\n if (c < b) c = b;\n }\n }\n return [ a, c ];\n };\n function d3_number(x) {\n return x === null ? NaN : +x;\n }\n function d3_numeric(x) {\n return !isNaN(x);\n }\n d3.sum = function(array, f) {\n var s = 0, n = array.length, a, i = -1;\n if (arguments.length === 1) {\n while (++i < n) if (d3_numeric(a = +array[i])) s += a;\n } else {\n while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;\n }\n return s;\n };\n d3.mean = function(array, f) {\n var s = 0, n = array.length, a, i = -1, j = n;\n if (arguments.length === 1) {\n while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;\n } else {\n while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;\n }\n if (j) return s / j;\n };\n d3.quantile = function(values, p) {\n var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;\n return e ? v + e * (values[h] - v) : v;\n };\n d3.median = function(array, f) {\n var numbers = [], n = array.length, a, i = -1;\n if (arguments.length === 1) {\n while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a);\n } else {\n while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a);\n }\n if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5);\n };\n d3.variance = function(array, f) {\n var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0;\n if (arguments.length === 1) {\n while (++i < n) {\n if (d3_numeric(a = d3_number(array[i]))) {\n d = a - m;\n m += d / ++j;\n s += d * (a - m);\n }\n }\n } else {\n while (++i < n) {\n if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) {\n d = a - m;\n m += d / ++j;\n s += d * (a - m);\n }\n }\n }\n if (j > 1) return s / (j - 1);\n };\n d3.deviation = function() {\n var v = d3.variance.apply(this, arguments);\n return v ? Math.sqrt(v) : v;\n };\n function d3_bisector(compare) {\n return {\n left: function(a, x, lo, hi) {\n if (arguments.length < 3) lo = 0;\n if (arguments.length < 4) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (arguments.length < 3) lo = 0;\n if (arguments.length < 4) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;\n }\n return lo;\n }\n };\n }\n var d3_bisect = d3_bisector(d3_ascending);\n d3.bisectLeft = d3_bisect.left;\n d3.bisect = d3.bisectRight = d3_bisect.right;\n d3.bisector = function(f) {\n return d3_bisector(f.length === 1 ? function(d, x) {\n return d3_ascending(f(d), x);\n } : f);\n };\n d3.shuffle = function(array, i0, i1) {\n if ((m = arguments.length) < 3) {\n i1 = array.length;\n if (m < 2) i0 = 0;\n }\n var m = i1 - i0, t, i;\n while (m) {\n i = Math.random() * m-- | 0;\n t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t;\n }\n return array;\n };\n d3.permute = function(array, indexes) {\n var i = indexes.length, permutes = new Array(i);\n while (i--) permutes[i] = array[indexes[i]];\n return permutes;\n };\n d3.pairs = function(array) {\n var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);\n while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];\n return pairs;\n };\n d3.transpose = function(matrix) {\n if (!(n = matrix.length)) return [];\n for (var i = -1, m = d3.min(matrix, d3_transposeLength), transpose = new Array(m); ++i < m; ) {\n for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n; ) {\n row[j] = matrix[j][i];\n }\n }\n return transpose;\n };\n function d3_transposeLength(d) {\n return d.length;\n }\n d3.zip = function() {\n return d3.transpose(arguments);\n };\n d3.keys = function(map) {\n var keys = [];\n for (var key in map) keys.push(key);\n return keys;\n };\n d3.values = function(map) {\n var values = [];\n for (var key in map) values.push(map[key]);\n return values;\n };\n d3.entries = function(map) {\n var entries = [];\n for (var key in map) entries.push({\n key: key,\n value: map[key]\n });\n return entries;\n };\n d3.merge = function(arrays) {\n var n = arrays.length, m, i = -1, j = 0, merged, array;\n while (++i < n) j += arrays[i].length;\n merged = new Array(j);\n while (--n >= 0) {\n array = arrays[n];\n m = array.length;\n while (--m >= 0) {\n merged[--j] = array[m];\n }\n }\n return merged;\n };\n var abs = Math.abs;\n d3.range = function(start, stop, step) {\n if (arguments.length < 3) {\n step = 1;\n if (arguments.length < 2) {\n stop = start;\n start = 0;\n }\n }\n if ((stop - start) / step === Infinity) throw new Error(\"infinite range\");\n var range = [], k = d3_range_integerScale(abs(step)), i = -1, j;\n start *= k, stop *= k, step *= k;\n if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k);\n return range;\n };\n function d3_range_integerScale(x) {\n var k = 1;\n while (x * k % 1) k *= 10;\n return k;\n }\n function d3_class(ctor, properties) {\n for (var key in properties) {\n Object.defineProperty(ctor.prototype, key, {\n value: properties[key],\n enumerable: false\n });\n }\n }\n d3.map = function(object, f) {\n var map = new d3_Map();\n if (object instanceof d3_Map) {\n object.forEach(function(key, value) {\n map.set(key, value);\n });\n } else if (Array.isArray(object)) {\n var i = -1, n = object.length, o;\n if (arguments.length === 1) while (++i < n) map.set(i, object[i]); else while (++i < n) map.set(f.call(object, o = object[i], i), o);\n } else {\n for (var key in object) map.set(key, object[key]);\n }\n return map;\n };\n function d3_Map() {\n this._ = Object.create(null);\n }\n var d3_map_proto = \"__proto__\", d3_map_zero = \"\\x00\";\n d3_class(d3_Map, {\n has: d3_map_has,\n get: function(key) {\n return this._[d3_map_escape(key)];\n },\n set: function(key, value) {\n return this._[d3_map_escape(key)] = value;\n },\n remove: d3_map_remove,\n keys: d3_map_keys,\n values: function() {\n var values = [];\n for (var key in this._) values.push(this._[key]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var key in this._) entries.push({\n key: d3_map_unescape(key),\n value: this._[key]\n });\n return entries;\n },\n size: d3_map_size,\n empty: d3_map_empty,\n forEach: function(f) {\n for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]);\n }\n });\n function d3_map_escape(key) {\n return (key += \"\") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key;\n }\n function d3_map_unescape(key) {\n return (key += \"\")[0] === d3_map_zero ? key.slice(1) : key;\n }\n function d3_map_has(key) {\n return d3_map_escape(key) in this._;\n }\n function d3_map_remove(key) {\n return (key = d3_map_escape(key)) in this._ && delete this._[key];\n }\n function d3_map_keys() {\n var keys = [];\n for (var key in this._) keys.push(d3_map_unescape(key));\n return keys;\n }\n function d3_map_size() {\n var size = 0;\n for (var key in this._) ++size;\n return size;\n }\n function d3_map_empty() {\n for (var key in this._) return false;\n return true;\n }\n d3.nest = function() {\n var nest = {}, keys = [], sortKeys = [], sortValues, rollup;\n function map(mapType, array, depth) {\n if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;\n var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;\n while (++i < n) {\n if (values = valuesByKey.get(keyValue = key(object = array[i]))) {\n values.push(object);\n } else {\n valuesByKey.set(keyValue, [ object ]);\n }\n }\n if (mapType) {\n object = mapType();\n setter = function(keyValue, values) {\n object.set(keyValue, map(mapType, values, depth));\n };\n } else {\n object = {};\n setter = function(keyValue, values) {\n object[keyValue] = map(mapType, values, depth);\n };\n }\n valuesByKey.forEach(setter);\n return object;\n }\n function entries(map, depth) {\n if (depth >= keys.length) return map;\n var array = [], sortKey = sortKeys[depth++];\n map.forEach(function(key, keyMap) {\n array.push({\n key: key,\n values: entries(keyMap, depth)\n });\n });\n return sortKey ? array.sort(function(a, b) {\n return sortKey(a.key, b.key);\n }) : array;\n }\n nest.map = function(array, mapType) {\n return map(mapType, array, 0);\n };\n nest.entries = function(array) {\n return entries(map(d3.map, array, 0), 0);\n };\n nest.key = function(d) {\n keys.push(d);\n return nest;\n };\n nest.sortKeys = function(order) {\n sortKeys[keys.length - 1] = order;\n return nest;\n };\n nest.sortValues = function(order) {\n sortValues = order;\n return nest;\n };\n nest.rollup = function(f) {\n rollup = f;\n return nest;\n };\n return nest;\n };\n d3.set = function(array) {\n var set = new d3_Set();\n if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);\n return set;\n };\n function d3_Set() {\n this._ = Object.create(null);\n }\n d3_class(d3_Set, {\n has: d3_map_has,\n add: function(key) {\n this._[d3_map_escape(key += \"\")] = true;\n return key;\n },\n remove: d3_map_remove,\n values: d3_map_keys,\n size: d3_map_size,\n empty: d3_map_empty,\n forEach: function(f) {\n for (var key in this._) f.call(this, d3_map_unescape(key));\n }\n });\n d3.behavior = {};\n function d3_identity(d) {\n return d;\n }\n d3.rebind = function(target, source) {\n var i = 1, n = arguments.length, method;\n while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);\n return target;\n };\n function d3_rebind(target, source, method) {\n return function() {\n var value = method.apply(source, arguments);\n return value === source ? target : value;\n };\n }\n function d3_vendorSymbol(object, name) {\n if (name in object) return name;\n name = name.charAt(0).toUpperCase() + name.slice(1);\n for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {\n var prefixName = d3_vendorPrefixes[i] + name;\n if (prefixName in object) return prefixName;\n }\n }\n var d3_vendorPrefixes = [ \"webkit\", \"ms\", \"moz\", \"Moz\", \"o\", \"O\" ];\n function d3_noop() {}\n d3.dispatch = function() {\n var dispatch = new d3_dispatch(), i = -1, n = arguments.length;\n while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);\n return dispatch;\n };\n function d3_dispatch() {}\n d3_dispatch.prototype.on = function(type, listener) {\n var i = type.indexOf(\".\"), name = \"\";\n if (i >= 0) {\n name = type.slice(i + 1);\n type = type.slice(0, i);\n }\n if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener);\n if (arguments.length === 2) {\n if (listener == null) for (type in this) {\n if (this.hasOwnProperty(type)) this[type].on(name, null);\n }\n return this;\n }\n };\n function d3_dispatch_event(dispatch) {\n var listeners = [], listenerByName = new d3_Map();\n function event() {\n var z = listeners, i = -1, n = z.length, l;\n while (++i < n) if (l = z[i].on) l.apply(this, arguments);\n return dispatch;\n }\n event.on = function(name, listener) {\n var l = listenerByName.get(name), i;\n if (arguments.length < 2) return l && l.on;\n if (l) {\n l.on = null;\n listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));\n listenerByName.remove(name);\n }\n if (listener) listeners.push(listenerByName.set(name, {\n on: listener\n }));\n return dispatch;\n };\n return event;\n }\n d3.event = null;\n function d3_eventPreventDefault() {\n d3.event.preventDefault();\n }\n function d3_eventSource() {\n var e = d3.event, s;\n while (s = e.sourceEvent) e = s;\n return e;\n }\n function d3_eventDispatch(target) {\n var dispatch = new d3_dispatch(), i = 0, n = arguments.length;\n while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);\n dispatch.of = function(thiz, argumentz) {\n return function(e1) {\n try {\n var e0 = e1.sourceEvent = d3.event;\n e1.target = target;\n d3.event = e1;\n dispatch[e1.type].apply(thiz, argumentz);\n } finally {\n d3.event = e0;\n }\n };\n };\n return dispatch;\n }\n d3.requote = function(s) {\n return s.replace(d3_requote_re, \"\\\\$&\");\n };\n var d3_requote_re = /[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g;\n var d3_subclass = {}.__proto__ ? function(object, prototype) {\n object.__proto__ = prototype;\n } : function(object, prototype) {\n for (var property in prototype) object[property] = prototype[property];\n };\n function d3_selection(groups) {\n d3_subclass(groups, d3_selectionPrototype);\n return groups;\n }\n var d3_select = function(s, n) {\n return n.querySelector(s);\n }, d3_selectAll = function(s, n) {\n return n.querySelectorAll(s);\n }, d3_selectMatches = function(n, s) {\n var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, \"matchesSelector\")];\n d3_selectMatches = function(n, s) {\n return d3_selectMatcher.call(n, s);\n };\n return d3_selectMatches(n, s);\n };\n if (typeof Sizzle === \"function\") {\n d3_select = function(s, n) {\n return Sizzle(s, n)[0] || null;\n };\n d3_selectAll = Sizzle;\n d3_selectMatches = Sizzle.matchesSelector;\n }\n d3.selection = function() {\n return d3.select(d3_document.documentElement);\n };\n var d3_selectionPrototype = d3.selection.prototype = [];\n d3_selectionPrototype.select = function(selector) {\n var subgroups = [], subgroup, subnode, group, node;\n selector = d3_selection_selector(selector);\n for (var j = -1, m = this.length; ++j < m; ) {\n subgroups.push(subgroup = []);\n subgroup.parentNode = (group = this[j]).parentNode;\n for (var i = -1, n = group.length; ++i < n; ) {\n if (node = group[i]) {\n subgroup.push(subnode = selector.call(node, node.__data__, i, j));\n if (subnode && \"__data__\" in node) subnode.__data__ = node.__data__;\n } else {\n subgroup.push(null);\n }\n }\n }\n return d3_selection(subgroups);\n };\n function d3_selection_selector(selector) {\n return typeof selector === \"function\" ? selector : function() {\n return d3_select(selector, this);\n };\n }\n d3_selectionPrototype.selectAll = function(selector) {\n var subgroups = [], subgroup, node;\n selector = d3_selection_selectorAll(selector);\n for (var j = -1, m = this.length; ++j < m; ) {\n for (var group = this[j], i = -1, n = group.length; ++i < n; ) {\n if (node = group[i]) {\n subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));\n subgroup.parentNode = node;\n }\n }\n }\n return d3_selection(subgroups);\n };\n function d3_selection_selectorAll(selector) {\n return typeof selector === \"function\" ? selector : function() {\n return d3_selectAll(selector, this);\n };\n }\n var d3_nsXhtml = \"http://www.w3.org/1999/xhtml\";\n var d3_nsPrefix = {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: d3_nsXhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n };\n d3.ns = {\n prefix: d3_nsPrefix,\n qualify: function(name) {\n var i = name.indexOf(\":\"), prefix = name;\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return d3_nsPrefix.hasOwnProperty(prefix) ? {\n space: d3_nsPrefix[prefix],\n local: name\n } : name;\n }\n };\n d3_selectionPrototype.attr = function(name, value) {\n if (arguments.length < 2) {\n if (typeof name === \"string\") {\n var node = this.node();\n name = d3.ns.qualify(name);\n return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name);\n }\n for (value in name) this.each(d3_selection_attr(value, name[value]));\n return this;\n }\n return this.each(d3_selection_attr(name, value));\n };\n function d3_selection_attr(name, value) {\n name = d3.ns.qualify(name);\n function attrNull() {\n this.removeAttribute(name);\n }\n function attrNullNS() {\n this.removeAttributeNS(name.space, name.local);\n }\n function attrConstant() {\n this.setAttribute(name, value);\n }\n function attrConstantNS() {\n this.setAttributeNS(name.space, name.local, value);\n }\n function attrFunction() {\n var x = value.apply(this, arguments);\n if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);\n }\n function attrFunctionNS() {\n var x = value.apply(this, arguments);\n if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);\n }\n return value == null ? name.local ? attrNullNS : attrNull : typeof value === \"function\" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;\n }\n function d3_collapse(s) {\n return s.trim().replace(/\\s+/g, \" \");\n }\n d3_selectionPrototype.classed = function(name, value) {\n if (arguments.length < 2) {\n if (typeof name === \"string\") {\n var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1;\n if (value = node.classList) {\n while (++i < n) if (!value.contains(name[i])) return false;\n } else {\n value = node.getAttribute(\"class\");\n while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;\n }\n return true;\n }\n for (value in name) this.each(d3_selection_classed(value, name[value]));\n return this;\n }\n return this.each(d3_selection_classed(name, value));\n };\n function d3_selection_classedRe(name) {\n return new RegExp(\"(?:^|\\\\s+)\" + d3.requote(name) + \"(?:\\\\s+|$)\", \"g\");\n }\n function d3_selection_classes(name) {\n return (name + \"\").trim().split(/^|\\s+/);\n }\n function d3_selection_classed(name, value) {\n name = d3_selection_classes(name).map(d3_selection_classedName);\n var n = name.length;\n function classedConstant() {\n var i = -1;\n while (++i < n) name[i](this, value);\n }\n function classedFunction() {\n var i = -1, x = value.apply(this, arguments);\n while (++i < n) name[i](this, x);\n }\n return typeof value === \"function\" ? classedFunction : classedConstant;\n }\n function d3_selection_classedName(name) {\n var re = d3_selection_classedRe(name);\n return function(node, value) {\n if (c = node.classList) return value ? c.add(name) : c.remove(name);\n var c = node.getAttribute(\"class\") || \"\";\n if (value) {\n re.lastIndex = 0;\n if (!re.test(c)) node.setAttribute(\"class\", d3_collapse(c + \" \" + name));\n } else {\n node.setAttribute(\"class\", d3_collapse(c.replace(re, \" \")));\n }\n };\n }\n d3_selectionPrototype.style = function(name, value, priority) {\n var n = arguments.length;\n if (n < 3) {\n if (typeof name !== \"string\") {\n if (n < 2) value = \"\";\n for (priority in name) this.each(d3_selection_style(priority, name[priority], value));\n return this;\n }\n if (n < 2) {\n var node = this.node();\n return d3_window(node).getComputedStyle(node, null).getPropertyValue(name);\n }\n priority = \"\";\n }\n return this.each(d3_selection_style(name, value, priority));\n };\n function d3_selection_style(name, value, priority) {\n function styleNull() {\n this.style.removeProperty(name);\n }\n function styleConstant() {\n this.style.setProperty(name, value, priority);\n }\n function styleFunction() {\n var x = value.apply(this, arguments);\n if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority);\n }\n return value == null ? styleNull : typeof value === \"function\" ? styleFunction : styleConstant;\n }\n d3_selectionPrototype.property = function(name, value) {\n if (arguments.length < 2) {\n if (typeof name === \"string\") return this.node()[name];\n for (value in name) this.each(d3_selection_property(value, name[value]));\n return this;\n }\n return this.each(d3_selection_property(name, value));\n };\n function d3_selection_property(name, value) {\n function propertyNull() {\n delete this[name];\n }\n function propertyConstant() {\n this[name] = value;\n }\n function propertyFunction() {\n var x = value.apply(this, arguments);\n if (x == null) delete this[name]; else this[name] = x;\n }\n return value == null ? propertyNull : typeof value === \"function\" ? propertyFunction : propertyConstant;\n }\n d3_selectionPrototype.text = function(value) {\n return arguments.length ? this.each(typeof value === \"function\" ? function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n } : value == null ? function() {\n this.textContent = \"\";\n } : function() {\n this.textContent = value;\n }) : this.node().textContent;\n };\n d3_selectionPrototype.html = function(value) {\n return arguments.length ? this.each(typeof value === \"function\" ? function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n } : value == null ? function() {\n this.innerHTML = \"\";\n } : function() {\n this.innerHTML = value;\n }) : this.node().innerHTML;\n };\n d3_selectionPrototype.append = function(name) {\n name = d3_selection_creator(name);\n return this.select(function() {\n return this.appendChild(name.apply(this, arguments));\n });\n };\n function d3_selection_creator(name) {\n function create() {\n var document = this.ownerDocument, namespace = this.namespaceURI;\n return namespace === d3_nsXhtml && document.documentElement.namespaceURI === d3_nsXhtml ? document.createElement(name) : document.createElementNS(namespace, name);\n }\n function createNS() {\n return this.ownerDocument.createElementNS(name.space, name.local);\n }\n return typeof name === \"function\" ? name : (name = d3.ns.qualify(name)).local ? createNS : create;\n }\n d3_selectionPrototype.insert = function(name, before) {\n name = d3_selection_creator(name);\n before = d3_selection_selector(before);\n return this.select(function() {\n return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);\n });\n };\n d3_selectionPrototype.remove = function() {\n return this.each(d3_selectionRemove);\n };\n function d3_selectionRemove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n }\n d3_selectionPrototype.data = function(value, key) {\n var i = -1, n = this.length, group, node;\n if (!arguments.length) {\n value = new Array(n = (group = this[0]).length);\n while (++i < n) {\n if (node = group[i]) {\n value[i] = node.__data__;\n }\n }\n return value;\n }\n function bind(group, groupData) {\n var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;\n if (key) {\n var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;\n for (i = -1; ++i < n; ) {\n if (node = group[i]) {\n if (nodeByKeyValue.has(keyValue = key.call(node, node.__data__, i))) {\n exitNodes[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n keyValues[i] = keyValue;\n }\n }\n for (i = -1; ++i < m; ) {\n if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) {\n enterNodes[i] = d3_selection_dataNode(nodeData);\n } else if (node !== true) {\n updateNodes[i] = node;\n node.__data__ = nodeData;\n }\n nodeByKeyValue.set(keyValue, true);\n }\n for (i = -1; ++i < n; ) {\n if (i in keyValues && nodeByKeyValue.get(keyValues[i]) !== true) {\n exitNodes[i] = group[i];\n }\n }\n } else {\n for (i = -1; ++i < n0; ) {\n node = group[i];\n nodeData = groupData[i];\n if (node) {\n node.__data__ = nodeData;\n updateNodes[i] = node;\n } else {\n enterNodes[i] = d3_selection_dataNode(nodeData);\n }\n }\n for (;i < m; ++i) {\n enterNodes[i] = d3_selection_dataNode(groupData[i]);\n }\n for (;i < n; ++i) {\n exitNodes[i] = group[i];\n }\n }\n enterNodes.update = updateNodes;\n enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode;\n enter.push(enterNodes);\n update.push(updateNodes);\n exit.push(exitNodes);\n }\n var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]);\n if (typeof value === \"function\") {\n while (++i < n) {\n bind(group = this[i], value.call(group, group.parentNode.__data__, i));\n }\n } else {\n while (++i < n) {\n bind(group = this[i], value);\n }\n }\n update.enter = function() {\n return enter;\n };\n update.exit = function() {\n return exit;\n };\n return update;\n };\n function d3_selection_dataNode(data) {\n return {\n __data__: data\n };\n }\n d3_selectionPrototype.datum = function(value) {\n return arguments.length ? this.property(\"__data__\", value) : this.property(\"__data__\");\n };\n d3_selectionPrototype.filter = function(filter) {\n var subgroups = [], subgroup, group, node;\n if (typeof filter !== \"function\") filter = d3_selection_filter(filter);\n for (var j = 0, m = this.length; j < m; j++) {\n subgroups.push(subgroup = []);\n subgroup.parentNode = (group = this[j]).parentNode;\n for (var i = 0, n = group.length; i < n; i++) {\n if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {\n subgroup.push(node);\n }\n }\n }\n return d3_selection(subgroups);\n };\n function d3_selection_filter(selector) {\n return function() {\n return d3_selectMatches(this, selector);\n };\n }\n d3_selectionPrototype.order = function() {\n for (var j = -1, m = this.length; ++j < m; ) {\n for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {\n if (node = group[i]) {\n if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n return this;\n };\n d3_selectionPrototype.sort = function(comparator) {\n comparator = d3_selection_sortComparator.apply(this, arguments);\n for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator);\n return this.order();\n };\n function d3_selection_sortComparator(comparator) {\n if (!arguments.length) comparator = d3_ascending;\n return function(a, b) {\n return a && b ? comparator(a.__data__, b.__data__) : !a - !b;\n };\n }\n d3_selectionPrototype.each = function(callback) {\n return d3_selection_each(this, function(node, i, j) {\n callback.call(node, node.__data__, i, j);\n });\n };\n function d3_selection_each(groups, callback) {\n for (var j = 0, m = groups.length; j < m; j++) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {\n if (node = group[i]) callback(node, i, j);\n }\n }\n return groups;\n }\n d3_selectionPrototype.call = function(callback) {\n var args = d3_array(arguments);\n callback.apply(args[0] = this, args);\n return this;\n };\n d3_selectionPrototype.empty = function() {\n return !this.node();\n };\n d3_selectionPrototype.node = function() {\n for (var j = 0, m = this.length; j < m; j++) {\n for (var group = this[j], i = 0, n = group.length; i < n; i++) {\n var node = group[i];\n if (node) return node;\n }\n }\n return null;\n };\n d3_selectionPrototype.size = function() {\n var n = 0;\n d3_selection_each(this, function() {\n ++n;\n });\n return n;\n };\n function d3_selection_enter(selection) {\n d3_subclass(selection, d3_selection_enterPrototype);\n return selection;\n }\n var d3_selection_enterPrototype = [];\n d3.selection.enter = d3_selection_enter;\n d3.selection.enter.prototype = d3_selection_enterPrototype;\n d3_selection_enterPrototype.append = d3_selectionPrototype.append;\n d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;\n d3_selection_enterPrototype.node = d3_selectionPrototype.node;\n d3_selection_enterPrototype.call = d3_selectionPrototype.call;\n d3_selection_enterPrototype.size = d3_selectionPrototype.size;\n d3_selection_enterPrototype.select = function(selector) {\n var subgroups = [], subgroup, subnode, upgroup, group, node;\n for (var j = -1, m = this.length; ++j < m; ) {\n upgroup = (group = this[j]).update;\n subgroups.push(subgroup = []);\n subgroup.parentNode = group.parentNode;\n for (var i = -1, n = group.length; ++i < n; ) {\n if (node = group[i]) {\n subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j));\n subnode.__data__ = node.__data__;\n } else {\n subgroup.push(null);\n }\n }\n }\n return d3_selection(subgroups);\n };\n d3_selection_enterPrototype.insert = function(name, before) {\n if (arguments.length < 2) before = d3_selection_enterInsertBefore(this);\n return d3_selectionPrototype.insert.call(this, name, before);\n };\n function d3_selection_enterInsertBefore(enter) {\n var i0, j0;\n return function(d, i, j) {\n var group = enter[j].update, n = group.length, node;\n if (j != j0) j0 = j, i0 = 0;\n if (i >= i0) i0 = i + 1;\n while (!(node = group[i0]) && ++i0 < n) ;\n return node;\n };\n }\n d3.select = function(node) {\n var group;\n if (typeof node === \"string\") {\n group = [ d3_select(node, d3_document) ];\n group.parentNode = d3_document.documentElement;\n } else {\n group = [ node ];\n group.parentNode = d3_documentElement(node);\n }\n return d3_selection([ group ]);\n };\n d3.selectAll = function(nodes) {\n var group;\n if (typeof nodes === \"string\") {\n group = d3_array(d3_selectAll(nodes, d3_document));\n group.parentNode = d3_document.documentElement;\n } else {\n group = d3_array(nodes);\n group.parentNode = null;\n }\n return d3_selection([ group ]);\n };\n d3_selectionPrototype.on = function(type, listener, capture) {\n var n = arguments.length;\n if (n < 3) {\n if (typeof type !== \"string\") {\n if (n < 2) listener = false;\n for (capture in type) this.each(d3_selection_on(capture, type[capture], listener));\n return this;\n }\n if (n < 2) return (n = this.node()[\"__on\" + type]) && n._;\n capture = false;\n }\n return this.each(d3_selection_on(type, listener, capture));\n };\n function d3_selection_on(type, listener, capture) {\n var name = \"__on\" + type, i = type.indexOf(\".\"), wrap = d3_selection_onListener;\n if (i > 0) type = type.slice(0, i);\n var filter = d3_selection_onFilters.get(type);\n if (filter) type = filter, wrap = d3_selection_onFilter;\n function onRemove() {\n var l = this[name];\n if (l) {\n this.removeEventListener(type, l, l.$);\n delete this[name];\n }\n }\n function onAdd() {\n var l = wrap(listener, d3_array(arguments));\n onRemove.call(this);\n this.addEventListener(type, this[name] = l, l.$ = capture);\n l._ = listener;\n }\n function removeAll() {\n var re = new RegExp(\"^__on([^.]+)\" + d3.requote(type) + \"$\"), match;\n for (var name in this) {\n if (match = name.match(re)) {\n var l = this[name];\n this.removeEventListener(match[1], l, l.$);\n delete this[name];\n }\n }\n }\n return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll;\n }\n var d3_selection_onFilters = d3.map({\n mouseenter: \"mouseover\",\n mouseleave: \"mouseout\"\n });\n if (d3_document) {\n d3_selection_onFilters.forEach(function(k) {\n if (\"on\" + k in d3_document) d3_selection_onFilters.remove(k);\n });\n }\n function d3_selection_onListener(listener, argumentz) {\n return function(e) {\n var o = d3.event;\n d3.event = e;\n argumentz[0] = this.__data__;\n try {\n listener.apply(this, argumentz);\n } finally {\n d3.event = o;\n }\n };\n }\n function d3_selection_onFilter(listener, argumentz) {\n var l = d3_selection_onListener(listener, argumentz);\n return function(e) {\n var target = this, related = e.relatedTarget;\n if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) {\n l.call(target, e);\n }\n };\n }\n var d3_event_dragSelect, d3_event_dragId = 0;\n function d3_event_dragSuppress(node) {\n var name = \".dragsuppress-\" + ++d3_event_dragId, click = \"click\" + name, w = d3.select(d3_window(node)).on(\"touchmove\" + name, d3_eventPreventDefault).on(\"dragstart\" + name, d3_eventPreventDefault).on(\"selectstart\" + name, d3_eventPreventDefault);\n if (d3_event_dragSelect == null) {\n d3_event_dragSelect = \"onselectstart\" in node ? false : d3_vendorSymbol(node.style, \"userSelect\");\n }\n if (d3_event_dragSelect) {\n var style = d3_documentElement(node).style, select = style[d3_event_dragSelect];\n style[d3_event_dragSelect] = \"none\";\n }\n return function(suppressClick) {\n w.on(name, null);\n if (d3_event_dragSelect) style[d3_event_dragSelect] = select;\n if (suppressClick) {\n var off = function() {\n w.on(click, null);\n };\n w.on(click, function() {\n d3_eventPreventDefault();\n off();\n }, true);\n setTimeout(off, 0);\n }\n };\n }\n d3.mouse = function(container) {\n return d3_mousePoint(container, d3_eventSource());\n };\n var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;\n function d3_mousePoint(container, e) {\n if (e.changedTouches) e = e.changedTouches[0];\n var svg = container.ownerSVGElement || container;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n if (d3_mouse_bug44083 < 0) {\n var window = d3_window(container);\n if (window.scrollX || window.scrollY) {\n svg = d3.select(\"body\").append(\"svg\").style({\n position: \"absolute\",\n top: 0,\n left: 0,\n margin: 0,\n padding: 0,\n border: \"none\"\n }, \"important\");\n var ctm = svg[0][0].getScreenCTM();\n d3_mouse_bug44083 = !(ctm.f || ctm.e);\n svg.remove();\n }\n }\n if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, \n point.y = e.clientY;\n point = point.matrixTransform(container.getScreenCTM().inverse());\n return [ point.x, point.y ];\n }\n var rect = container.getBoundingClientRect();\n return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];\n }\n d3.touch = function(container, touches, identifier) {\n if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;\n if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {\n if ((touch = touches[i]).identifier === identifier) {\n return d3_mousePoint(container, touch);\n }\n }\n };\n d3.behavior.drag = function() {\n var event = d3_eventDispatch(drag, \"drag\", \"dragstart\", \"dragend\"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, \"mousemove\", \"mouseup\"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, \"touchmove\", \"touchend\");\n function drag() {\n this.on(\"mousedown.drag\", mousedown).on(\"touchstart.drag\", touchstart);\n }\n function dragstart(id, position, subject, move, end) {\n return function() {\n var that = this, target = d3.event.target.correspondingElement || d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = \".drag\" + (dragId == null ? \"\" : \"-\" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);\n if (origin) {\n dragOffset = origin.apply(that, arguments);\n dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];\n } else {\n dragOffset = [ 0, 0 ];\n }\n dispatch({\n type: \"dragstart\"\n });\n function moved() {\n var position1 = position(parent, dragId), dx, dy;\n if (!position1) return;\n dx = position1[0] - position0[0];\n dy = position1[1] - position0[1];\n dragged |= dx | dy;\n position0 = position1;\n dispatch({\n type: \"drag\",\n x: position1[0] + dragOffset[0],\n y: position1[1] + dragOffset[1],\n dx: dx,\n dy: dy\n });\n }\n function ended() {\n if (!position(parent, dragId)) return;\n dragSubject.on(move + dragName, null).on(end + dragName, null);\n dragRestore(dragged);\n dispatch({\n type: \"dragend\"\n });\n }\n };\n }\n drag.origin = function(x) {\n if (!arguments.length) return origin;\n origin = x;\n return drag;\n };\n return d3.rebind(drag, event, \"on\");\n };\n function d3_behavior_dragTouchId() {\n return d3.event.changedTouches[0].identifier;\n }\n d3.touches = function(container, touches) {\n if (arguments.length < 2) touches = d3_eventSource().touches;\n return touches ? d3_array(touches).map(function(touch) {\n var point = d3_mousePoint(container, touch);\n point.identifier = touch.identifier;\n return point;\n }) : [];\n };\n var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;\n function d3_sgn(x) {\n return x > 0 ? 1 : x < 0 ? -1 : 0;\n }\n function d3_cross2d(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);\n }\n function d3_acos(x) {\n return x > 1 ? 0 : x < -1 ? π : Math.acos(x);\n }\n function d3_asin(x) {\n return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);\n }\n function d3_sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n }\n function d3_cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n }\n function d3_tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n }\n function d3_haversin(x) {\n return (x = Math.sin(x / 2)) * x;\n }\n var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4;\n d3.interpolateZoom = function(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;\n if (d2 < ε2) {\n S = Math.log(w1 / w0) / ρ;\n i = function(t) {\n return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * t * S) ];\n };\n } else {\n var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / ρ;\n i = function(t) {\n var s = t * S, coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));\n return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ];\n };\n }\n i.duration = S * 1e3;\n return i;\n };\n d3.behavior.zoom = function() {\n var view = {\n x: 0,\n y: 0,\n k: 1\n }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = \"mousedown.zoom\", mousemove = \"mousemove.zoom\", mouseup = \"mouseup.zoom\", mousewheelTimer, touchstart = \"touchstart.zoom\", touchtime, event = d3_eventDispatch(zoom, \"zoomstart\", \"zoom\", \"zoomend\"), x0, x1, y0, y1;\n if (!d3_behavior_zoomWheel) {\n d3_behavior_zoomWheel = \"onwheel\" in d3_document ? (d3_behavior_zoomDelta = function() {\n return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);\n }, \"wheel\") : \"onmousewheel\" in d3_document ? (d3_behavior_zoomDelta = function() {\n return d3.event.wheelDelta;\n }, \"mousewheel\") : (d3_behavior_zoomDelta = function() {\n return -d3.event.detail;\n }, \"MozMousePixelScroll\");\n }\n function zoom(g) {\n g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + \".zoom\", mousewheeled).on(\"dblclick.zoom\", dblclicked).on(touchstart, touchstarted);\n }\n zoom.event = function(g) {\n g.each(function() {\n var dispatch = event.of(this, arguments), view1 = view;\n if (d3_transitionInheritId) {\n d3.select(this).transition().each(\"start.zoom\", function() {\n view = this.__chart__ || {\n x: 0,\n y: 0,\n k: 1\n };\n zoomstarted(dispatch);\n }).tween(\"zoom:zoom\", function() {\n var dx = size[0], dy = size[1], cx = center0 ? center0[0] : dx / 2, cy = center0 ? center0[1] : dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);\n return function(t) {\n var l = i(t), k = dx / l[2];\n this.__chart__ = view = {\n x: cx - l[0] * k,\n y: cy - l[1] * k,\n k: k\n };\n zoomed(dispatch);\n };\n }).each(\"interrupt.zoom\", function() {\n zoomended(dispatch);\n }).each(\"end.zoom\", function() {\n zoomended(dispatch);\n });\n } else {\n this.__chart__ = view;\n zoomstarted(dispatch);\n zoomed(dispatch);\n zoomended(dispatch);\n }\n });\n };\n zoom.translate = function(_) {\n if (!arguments.length) return [ view.x, view.y ];\n view = {\n x: +_[0],\n y: +_[1],\n k: view.k\n };\n rescale();\n return zoom;\n };\n zoom.scale = function(_) {\n if (!arguments.length) return view.k;\n view = {\n x: view.x,\n y: view.y,\n k: null\n };\n scaleTo(+_);\n rescale();\n return zoom;\n };\n zoom.scaleExtent = function(_) {\n if (!arguments.length) return scaleExtent;\n scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ];\n return zoom;\n };\n zoom.center = function(_) {\n if (!arguments.length) return center;\n center = _ && [ +_[0], +_[1] ];\n return zoom;\n };\n zoom.size = function(_) {\n if (!arguments.length) return size;\n size = _ && [ +_[0], +_[1] ];\n return zoom;\n };\n zoom.duration = function(_) {\n if (!arguments.length) return duration;\n duration = +_;\n return zoom;\n };\n zoom.x = function(z) {\n if (!arguments.length) return x1;\n x1 = z;\n x0 = z.copy();\n view = {\n x: 0,\n y: 0,\n k: 1\n };\n return zoom;\n };\n zoom.y = function(z) {\n if (!arguments.length) return y1;\n y1 = z;\n y0 = z.copy();\n view = {\n x: 0,\n y: 0,\n k: 1\n };\n return zoom;\n };\n function location(p) {\n return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ];\n }\n function point(l) {\n return [ l[0] * view.k + view.x, l[1] * view.k + view.y ];\n }\n function scaleTo(s) {\n view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s));\n }\n function translateTo(p, l) {\n l = point(l);\n view.x += p[0] - l[0];\n view.y += p[1] - l[1];\n }\n function zoomTo(that, p, l, k) {\n that.__chart__ = {\n x: view.x,\n y: view.y,\n k: view.k\n };\n scaleTo(Math.pow(2, k));\n translateTo(center0 = p, l);\n that = d3.select(that);\n if (duration > 0) that = that.transition().duration(duration);\n that.call(zoom.event);\n }\n function rescale() {\n if (x1) x1.domain(x0.range().map(function(x) {\n return (x - view.x) / view.k;\n }).map(x0.invert));\n if (y1) y1.domain(y0.range().map(function(y) {\n return (y - view.y) / view.k;\n }).map(y0.invert));\n }\n function zoomstarted(dispatch) {\n if (!zooming++) dispatch({\n type: \"zoomstart\"\n });\n }\n function zoomed(dispatch) {\n rescale();\n dispatch({\n type: \"zoom\",\n scale: view.k,\n translate: [ view.x, view.y ]\n });\n }\n function zoomended(dispatch) {\n if (!--zooming) dispatch({\n type: \"zoomend\"\n }), center0 = null;\n }\n function mousedowned() {\n var that = this, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);\n d3_selection_interrupt.call(that);\n zoomstarted(dispatch);\n function moved() {\n dragged = 1;\n translateTo(d3.mouse(that), location0);\n zoomed(dispatch);\n }\n function ended() {\n subject.on(mousemove, null).on(mouseup, null);\n dragRestore(dragged);\n zoomended(dispatch);\n }\n }\n function touchstarted() {\n var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = \".zoom-\" + d3.event.changedTouches[0].identifier, touchmove = \"touchmove\" + zoomName, touchend = \"touchend\" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that);\n started();\n zoomstarted(dispatch);\n subject.on(mousedown, null).on(touchstart, started);\n function relocate() {\n var touches = d3.touches(that);\n scale0 = view.k;\n touches.forEach(function(t) {\n if (t.identifier in locations0) locations0[t.identifier] = location(t);\n });\n return touches;\n }\n function started() {\n var target = d3.event.target;\n d3.select(target).on(touchmove, moved).on(touchend, ended);\n targets.push(target);\n var changed = d3.event.changedTouches;\n for (var i = 0, n = changed.length; i < n; ++i) {\n locations0[changed[i].identifier] = null;\n }\n var touches = relocate(), now = Date.now();\n if (touches.length === 1) {\n if (now - touchtime < 500) {\n var p = touches[0];\n zoomTo(that, p, locations0[p.identifier], Math.floor(Math.log(view.k) / Math.LN2) + 1);\n d3_eventPreventDefault();\n }\n touchtime = now;\n } else if (touches.length > 1) {\n var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1];\n distance0 = dx * dx + dy * dy;\n }\n }\n function moved() {\n var touches = d3.touches(that), p0, l0, p1, l1;\n d3_selection_interrupt.call(that);\n for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {\n p1 = touches[i];\n if (l1 = locations0[p1.identifier]) {\n if (l0) break;\n p0 = p1, l0 = l1;\n }\n }\n if (l1) {\n var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0);\n p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ];\n l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ];\n scaleTo(scale1 * scale0);\n }\n touchtime = null;\n translateTo(p0, l0);\n zoomed(dispatch);\n }\n function ended() {\n if (d3.event.touches.length) {\n var changed = d3.event.changedTouches;\n for (var i = 0, n = changed.length; i < n; ++i) {\n delete locations0[changed[i].identifier];\n }\n for (var identifier in locations0) {\n return void relocate();\n }\n }\n d3.selectAll(targets).on(zoomName, null);\n subject.on(mousedown, mousedowned).on(touchstart, touchstarted);\n dragRestore();\n zoomended(dispatch);\n }\n }\n function mousewheeled() {\n var dispatch = event.of(this, arguments);\n if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), \n translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch);\n mousewheelTimer = setTimeout(function() {\n mousewheelTimer = null;\n zoomended(dispatch);\n }, 50);\n d3_eventPreventDefault();\n scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);\n translateTo(center0, translate0);\n zoomed(dispatch);\n }\n function dblclicked() {\n var p = d3.mouse(this), k = Math.log(view.k) / Math.LN2;\n zoomTo(this, p, location(p), d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1);\n }\n return d3.rebind(zoom, event, \"on\");\n };\n var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel;\n d3.color = d3_color;\n function d3_color() {}\n d3_color.prototype.toString = function() {\n return this.rgb() + \"\";\n };\n d3.hsl = d3_hsl;\n function d3_hsl(h, s, l) {\n return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse(\"\" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);\n }\n var d3_hslPrototype = d3_hsl.prototype = new d3_color();\n d3_hslPrototype.brighter = function(k) {\n k = Math.pow(.7, arguments.length ? k : 1);\n return new d3_hsl(this.h, this.s, this.l / k);\n };\n d3_hslPrototype.darker = function(k) {\n k = Math.pow(.7, arguments.length ? k : 1);\n return new d3_hsl(this.h, this.s, k * this.l);\n };\n d3_hslPrototype.rgb = function() {\n return d3_hsl_rgb(this.h, this.s, this.l);\n };\n function d3_hsl_rgb(h, s, l) {\n var m1, m2;\n h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h;\n s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s;\n l = l < 0 ? 0 : l > 1 ? 1 : l;\n m2 = l <= .5 ? l * (1 + s) : l + s - l * s;\n m1 = 2 * l - m2;\n function v(h) {\n if (h > 360) h -= 360; else if (h < 0) h += 360;\n if (h < 60) return m1 + (m2 - m1) * h / 60;\n if (h < 180) return m2;\n if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;\n return m1;\n }\n function vv(h) {\n return Math.round(v(h) * 255);\n }\n return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));\n }\n d3.hcl = d3_hcl;\n function d3_hcl(h, c, l) {\n return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);\n }\n var d3_hclPrototype = d3_hcl.prototype = new d3_color();\n d3_hclPrototype.brighter = function(k) {\n return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));\n };\n d3_hclPrototype.darker = function(k) {\n return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));\n };\n d3_hclPrototype.rgb = function() {\n return d3_hcl_lab(this.h, this.c, this.l).rgb();\n };\n function d3_hcl_lab(h, c, l) {\n if (isNaN(h)) h = 0;\n if (isNaN(c)) c = 0;\n return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);\n }\n d3.lab = d3_lab;\n function d3_lab(l, a, b) {\n return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);\n }\n var d3_lab_K = 18;\n var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;\n var d3_labPrototype = d3_lab.prototype = new d3_color();\n d3_labPrototype.brighter = function(k) {\n return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);\n };\n d3_labPrototype.darker = function(k) {\n return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);\n };\n d3_labPrototype.rgb = function() {\n return d3_lab_rgb(this.l, this.a, this.b);\n };\n function d3_lab_rgb(l, a, b) {\n var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;\n x = d3_lab_xyz(x) * d3_lab_X;\n y = d3_lab_xyz(y) * d3_lab_Y;\n z = d3_lab_xyz(z) * d3_lab_Z;\n return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));\n }\n function d3_lab_hcl(l, a, b) {\n return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);\n }\n function d3_lab_xyz(x) {\n return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;\n }\n function d3_xyz_lab(x) {\n return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;\n }\n function d3_xyz_rgb(r) {\n return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));\n }\n d3.rgb = d3_rgb;\n function d3_rgb(r, g, b) {\n return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse(\"\" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);\n }\n function d3_rgbNumber(value) {\n return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);\n }\n function d3_rgbString(value) {\n return d3_rgbNumber(value) + \"\";\n }\n var d3_rgbPrototype = d3_rgb.prototype = new d3_color();\n d3_rgbPrototype.brighter = function(k) {\n k = Math.pow(.7, arguments.length ? k : 1);\n var r = this.r, g = this.g, b = this.b, i = 30;\n if (!r && !g && !b) return new d3_rgb(i, i, i);\n if (r && r < i) r = i;\n if (g && g < i) g = i;\n if (b && b < i) b = i;\n return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));\n };\n d3_rgbPrototype.darker = function(k) {\n k = Math.pow(.7, arguments.length ? k : 1);\n return new d3_rgb(k * this.r, k * this.g, k * this.b);\n };\n d3_rgbPrototype.hsl = function() {\n return d3_rgb_hsl(this.r, this.g, this.b);\n };\n d3_rgbPrototype.toString = function() {\n return \"#\" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);\n };\n function d3_rgb_hex(v) {\n return v < 16 ? \"0\" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);\n }\n function d3_rgb_parse(format, rgb, hsl) {\n var r = 0, g = 0, b = 0, m1, m2, color;\n m1 = /([a-z]+)\\((.*)\\)/.exec(format = format.toLowerCase());\n if (m1) {\n m2 = m1[2].split(\",\");\n switch (m1[1]) {\n case \"hsl\":\n {\n return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100);\n }\n\n case \"rgb\":\n {\n return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2]));\n }\n }\n }\n if (color = d3_rgb_names.get(format)) {\n return rgb(color.r, color.g, color.b);\n }\n if (format != null && format.charAt(0) === \"#\" && !isNaN(color = parseInt(format.slice(1), 16))) {\n if (format.length === 4) {\n r = (color & 3840) >> 4;\n r = r >> 4 | r;\n g = color & 240;\n g = g >> 4 | g;\n b = color & 15;\n b = b << 4 | b;\n } else if (format.length === 7) {\n r = (color & 16711680) >> 16;\n g = (color & 65280) >> 8;\n b = color & 255;\n }\n }\n return rgb(r, g, b);\n }\n function d3_rgb_hsl(r, g, b) {\n var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2;\n if (d) {\n s = l < .5 ? d / (max + min) : d / (2 - max - min);\n if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4;\n h *= 60;\n } else {\n h = NaN;\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new d3_hsl(h, s, l);\n }\n function d3_rgb_lab(r, g, b) {\n r = d3_rgb_xyz(r);\n g = d3_rgb_xyz(g);\n b = d3_rgb_xyz(b);\n var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z);\n return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z));\n }\n function d3_rgb_xyz(r) {\n return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4);\n }\n function d3_rgb_parseNumber(c) {\n var f = parseFloat(c);\n return c.charAt(c.length - 1) === \"%\" ? Math.round(f * 2.55) : f;\n }\n var d3_rgb_names = d3.map({\n aliceblue: 15792383,\n antiquewhite: 16444375,\n aqua: 65535,\n aquamarine: 8388564,\n azure: 15794175,\n beige: 16119260,\n bisque: 16770244,\n black: 0,\n blanchedalmond: 16772045,\n blue: 255,\n blueviolet: 9055202,\n brown: 10824234,\n burlywood: 14596231,\n cadetblue: 6266528,\n chartreuse: 8388352,\n chocolate: 13789470,\n coral: 16744272,\n cornflowerblue: 6591981,\n cornsilk: 16775388,\n crimson: 14423100,\n cyan: 65535,\n darkblue: 139,\n darkcyan: 35723,\n darkgoldenrod: 12092939,\n darkgray: 11119017,\n darkgreen: 25600,\n darkgrey: 11119017,\n darkkhaki: 12433259,\n darkmagenta: 9109643,\n darkolivegreen: 5597999,\n darkorange: 16747520,\n darkorchid: 10040012,\n darkred: 9109504,\n darksalmon: 15308410,\n darkseagreen: 9419919,\n darkslateblue: 4734347,\n darkslategray: 3100495,\n darkslategrey: 3100495,\n darkturquoise: 52945,\n darkviolet: 9699539,\n deeppink: 16716947,\n deepskyblue: 49151,\n dimgray: 6908265,\n dimgrey: 6908265,\n dodgerblue: 2003199,\n firebrick: 11674146,\n floralwhite: 16775920,\n forestgreen: 2263842,\n fuchsia: 16711935,\n gainsboro: 14474460,\n ghostwhite: 16316671,\n gold: 16766720,\n goldenrod: 14329120,\n gray: 8421504,\n green: 32768,\n greenyellow: 11403055,\n grey: 8421504,\n honeydew: 15794160,\n hotpink: 16738740,\n indianred: 13458524,\n indigo: 4915330,\n ivory: 16777200,\n khaki: 15787660,\n lavender: 15132410,\n lavenderblush: 16773365,\n lawngreen: 8190976,\n lemonchiffon: 16775885,\n lightblue: 11393254,\n lightcoral: 15761536,\n lightcyan: 14745599,\n lightgoldenrodyellow: 16448210,\n lightgray: 13882323,\n lightgreen: 9498256,\n lightgrey: 13882323,\n lightpink: 16758465,\n lightsalmon: 16752762,\n lightseagreen: 2142890,\n lightskyblue: 8900346,\n lightslategray: 7833753,\n lightslategrey: 7833753,\n lightsteelblue: 11584734,\n lightyellow: 16777184,\n lime: 65280,\n limegreen: 3329330,\n linen: 16445670,\n magenta: 16711935,\n maroon: 8388608,\n mediumaquamarine: 6737322,\n mediumblue: 205,\n mediumorchid: 12211667,\n mediumpurple: 9662683,\n mediumseagreen: 3978097,\n mediumslateblue: 8087790,\n mediumspringgreen: 64154,\n mediumturquoise: 4772300,\n mediumvioletred: 13047173,\n midnightblue: 1644912,\n mintcream: 16121850,\n mistyrose: 16770273,\n moccasin: 16770229,\n navajowhite: 16768685,\n navy: 128,\n oldlace: 16643558,\n olive: 8421376,\n olivedrab: 7048739,\n orange: 16753920,\n orangered: 16729344,\n orchid: 14315734,\n palegoldenrod: 15657130,\n palegreen: 10025880,\n paleturquoise: 11529966,\n palevioletred: 14381203,\n papayawhip: 16773077,\n peachpuff: 16767673,\n peru: 13468991,\n pink: 16761035,\n plum: 14524637,\n powderblue: 11591910,\n purple: 8388736,\n rebeccapurple: 6697881,\n red: 16711680,\n rosybrown: 12357519,\n royalblue: 4286945,\n saddlebrown: 9127187,\n salmon: 16416882,\n sandybrown: 16032864,\n seagreen: 3050327,\n seashell: 16774638,\n sienna: 10506797,\n silver: 12632256,\n skyblue: 8900331,\n slateblue: 6970061,\n slategray: 7372944,\n slategrey: 7372944,\n snow: 16775930,\n springgreen: 65407,\n steelblue: 4620980,\n tan: 13808780,\n teal: 32896,\n thistle: 14204888,\n tomato: 16737095,\n turquoise: 4251856,\n violet: 15631086,\n wheat: 16113331,\n white: 16777215,\n whitesmoke: 16119285,\n yellow: 16776960,\n yellowgreen: 10145074\n });\n d3_rgb_names.forEach(function(key, value) {\n d3_rgb_names.set(key, d3_rgbNumber(value));\n });\n function d3_functor(v) {\n return typeof v === \"function\" ? v : function() {\n return v;\n };\n }\n d3.functor = d3_functor;\n d3.xhr = d3_xhrType(d3_identity);\n function d3_xhrType(response) {\n return function(url, mimeType, callback) {\n if (arguments.length === 2 && typeof mimeType === \"function\") callback = mimeType, \n mimeType = null;\n return d3_xhr(url, mimeType, response, callback);\n };\n }\n function d3_xhr(url, mimeType, response, callback) {\n var xhr = {}, dispatch = d3.dispatch(\"beforesend\", \"progress\", \"load\", \"error\"), headers = {}, request = new XMLHttpRequest(), responseType = null;\n if (this.XDomainRequest && !(\"withCredentials\" in request) && /^(http(s)?:)?\\/\\//.test(url)) request = new XDomainRequest();\n \"onload\" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {\n request.readyState > 3 && respond();\n };\n function respond() {\n var status = request.status, result;\n if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {\n try {\n result = response.call(xhr, request);\n } catch (e) {\n dispatch.error.call(xhr, e);\n return;\n }\n dispatch.load.call(xhr, result);\n } else {\n dispatch.error.call(xhr, request);\n }\n }\n request.onprogress = function(event) {\n var o = d3.event;\n d3.event = event;\n try {\n dispatch.progress.call(xhr, request);\n } finally {\n d3.event = o;\n }\n };\n xhr.header = function(name, value) {\n name = (name + \"\").toLowerCase();\n if (arguments.length < 2) return headers[name];\n if (value == null) delete headers[name]; else headers[name] = value + \"\";\n return xhr;\n };\n xhr.mimeType = function(value) {\n if (!arguments.length) return mimeType;\n mimeType = value == null ? null : value + \"\";\n return xhr;\n };\n xhr.responseType = function(value) {\n if (!arguments.length) return responseType;\n responseType = value;\n return xhr;\n };\n xhr.response = function(value) {\n response = value;\n return xhr;\n };\n [ \"get\", \"post\" ].forEach(function(method) {\n xhr[method] = function() {\n return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));\n };\n });\n xhr.send = function(method, data, callback) {\n if (arguments.length === 2 && typeof data === \"function\") callback = data, data = null;\n request.open(method, url, true);\n if (mimeType != null && !(\"accept\" in headers)) headers[\"accept\"] = mimeType + \",*/*\";\n if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]);\n if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType);\n if (responseType != null) request.responseType = responseType;\n if (callback != null) xhr.on(\"error\", callback).on(\"load\", function(request) {\n callback(null, request);\n });\n dispatch.beforesend.call(xhr, request);\n request.send(data == null ? null : data);\n return xhr;\n };\n xhr.abort = function() {\n request.abort();\n return xhr;\n };\n d3.rebind(xhr, dispatch, \"on\");\n return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback));\n }\n function d3_xhr_fixCallback(callback) {\n return callback.length === 1 ? function(error, request) {\n callback(error == null ? request : null);\n } : callback;\n }\n function d3_xhrHasResponse(request) {\n var type = request.responseType;\n return type && type !== \"text\" ? request.response : request.responseText;\n }\n d3.dsv = function(delimiter, mimeType) {\n var reFormat = new RegExp('[\"' + delimiter + \"\\n]\"), delimiterCode = delimiter.charCodeAt(0);\n function dsv(url, row, callback) {\n if (arguments.length < 3) callback = row, row = null;\n var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);\n xhr.row = function(_) {\n return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;\n };\n return xhr;\n }\n function response(request) {\n return dsv.parse(request.responseText);\n }\n function typedResponse(f) {\n return function(request) {\n return dsv.parse(request.responseText, f);\n };\n }\n dsv.parse = function(text, f) {\n var o;\n return dsv.parseRows(text, function(row, i) {\n if (o) return o(row, i - 1);\n var a = new Function(\"d\", \"return {\" + row.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"]\";\n }).join(\",\") + \"}\");\n o = f ? function(row, i) {\n return f(a(row), i);\n } : a;\n });\n };\n dsv.parseRows = function(text, f) {\n var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol;\n function token() {\n if (I >= N) return EOF;\n if (eol) return eol = false, EOL;\n var j = I;\n if (text.charCodeAt(j) === 34) {\n var i = j;\n while (i++ < N) {\n if (text.charCodeAt(i) === 34) {\n if (text.charCodeAt(i + 1) !== 34) break;\n ++i;\n }\n }\n I = i + 2;\n var c = text.charCodeAt(i + 1);\n if (c === 13) {\n eol = true;\n if (text.charCodeAt(i + 2) === 10) ++I;\n } else if (c === 10) {\n eol = true;\n }\n return text.slice(j + 1, i).replace(/\"\"/g, '\"');\n }\n while (I < N) {\n var c = text.charCodeAt(I++), k = 1;\n if (c === 10) eol = true; else if (c === 13) {\n eol = true;\n if (text.charCodeAt(I) === 10) ++I, ++k;\n } else if (c !== delimiterCode) continue;\n return text.slice(j, I - k);\n }\n return text.slice(j);\n }\n while ((t = token()) !== EOF) {\n var a = [];\n while (t !== EOL && t !== EOF) {\n a.push(t);\n t = token();\n }\n if (f && (a = f(a, n++)) == null) continue;\n rows.push(a);\n }\n return rows;\n };\n dsv.format = function(rows) {\n if (Array.isArray(rows[0])) return dsv.formatRows(rows);\n var fieldSet = new d3_Set(), fields = [];\n rows.forEach(function(row) {\n for (var field in row) {\n if (!fieldSet.has(field)) {\n fields.push(fieldSet.add(field));\n }\n }\n });\n return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) {\n return fields.map(function(field) {\n return formatValue(row[field]);\n }).join(delimiter);\n })).join(\"\\n\");\n };\n dsv.formatRows = function(rows) {\n return rows.map(formatRow).join(\"\\n\");\n };\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n function formatValue(text) {\n return reFormat.test(text) ? '\"' + text.replace(/\\\"/g, '\"\"') + '\"' : text;\n }\n return dsv;\n };\n d3.csv = d3.dsv(\",\", \"text/csv\");\n d3.tsv = d3.dsv(\"\t\", \"text/tab-separated-values\");\n var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_frame = this[d3_vendorSymbol(this, \"requestAnimationFrame\")] || function(callback) {\n setTimeout(callback, 17);\n };\n d3.timer = function() {\n d3_timer.apply(this, arguments);\n };\n function d3_timer(callback, delay, then) {\n var n = arguments.length;\n if (n < 2) delay = 0;\n if (n < 3) then = Date.now();\n var time = then + delay, timer = {\n c: callback,\n t: time,\n n: null\n };\n if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer;\n d3_timer_queueTail = timer;\n if (!d3_timer_interval) {\n d3_timer_timeout = clearTimeout(d3_timer_timeout);\n d3_timer_interval = 1;\n d3_timer_frame(d3_timer_step);\n }\n return timer;\n }\n function d3_timer_step() {\n var now = d3_timer_mark(), delay = d3_timer_sweep() - now;\n if (delay > 24) {\n if (isFinite(delay)) {\n clearTimeout(d3_timer_timeout);\n d3_timer_timeout = setTimeout(d3_timer_step, delay);\n }\n d3_timer_interval = 0;\n } else {\n d3_timer_interval = 1;\n d3_timer_frame(d3_timer_step);\n }\n }\n d3.timer.flush = function() {\n d3_timer_mark();\n d3_timer_sweep();\n };\n function d3_timer_mark() {\n var now = Date.now(), timer = d3_timer_queueHead;\n while (timer) {\n if (now >= timer.t && timer.c(now - timer.t)) timer.c = null;\n timer = timer.n;\n }\n return now;\n }\n function d3_timer_sweep() {\n var t0, t1 = d3_timer_queueHead, time = Infinity;\n while (t1) {\n if (t1.c) {\n if (t1.t < time) time = t1.t;\n t1 = (t0 = t1).n;\n } else {\n t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;\n }\n }\n d3_timer_queueTail = t0;\n return time;\n }\n function d3_format_precision(x, p) {\n return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1);\n }\n d3.round = function(x, n) {\n return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);\n };\n var d3_formatPrefixes = [ \"y\", \"z\", \"a\", \"f\", \"p\", \"n\", \"µ\", \"m\", \"\", \"k\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\", \"Y\" ].map(d3_formatPrefix);\n d3.formatPrefix = function(value, precision) {\n var i = 0;\n if (value = +value) {\n if (value < 0) value *= -1;\n if (precision) value = d3.round(value, d3_format_precision(value, precision));\n i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);\n i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));\n }\n return d3_formatPrefixes[8 + i / 3];\n };\n function d3_formatPrefix(d, i) {\n var k = Math.pow(10, abs(8 - i) * 3);\n return {\n scale: i > 8 ? function(d) {\n return d / k;\n } : function(d) {\n return d * k;\n },\n symbol: d\n };\n }\n function d3_locale_numberFormat(locale) {\n var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) {\n var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0;\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = locale_grouping[j = (j + 1) % locale_grouping.length];\n }\n return t.reverse().join(locale_thousands);\n } : d3_identity;\n return function(specifier) {\n var match = d3_format_re.exec(specifier), fill = match[1] || \" \", align = match[2] || \">\", sign = match[3] || \"-\", symbol = match[4] || \"\", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = \"\", suffix = \"\", integer = false, exponent = true;\n if (precision) precision = +precision.substring(1);\n if (zfill || fill === \"0\" && align === \"=\") {\n zfill = fill = \"0\";\n align = \"=\";\n }\n switch (type) {\n case \"n\":\n comma = true;\n type = \"g\";\n break;\n\n case \"%\":\n scale = 100;\n suffix = \"%\";\n type = \"f\";\n break;\n\n case \"p\":\n scale = 100;\n suffix = \"%\";\n type = \"r\";\n break;\n\n case \"b\":\n case \"o\":\n case \"x\":\n case \"X\":\n if (symbol === \"#\") prefix = \"0\" + type.toLowerCase();\n\n case \"c\":\n exponent = false;\n\n case \"d\":\n integer = true;\n precision = 0;\n break;\n\n case \"s\":\n scale = -1;\n type = \"r\";\n break;\n }\n if (symbol === \"$\") prefix = locale_currency[0], suffix = locale_currency[1];\n if (type == \"r\" && !precision) type = \"g\";\n if (precision != null) {\n if (type == \"g\") precision = Math.max(1, Math.min(21, precision)); else if (type == \"e\" || type == \"f\") precision = Math.max(0, Math.min(20, precision));\n }\n type = d3_format_types.get(type) || d3_format_typeDefault;\n var zcomma = zfill && comma;\n return function(value) {\n var fullSuffix = suffix;\n if (integer && value % 1) return \"\";\n var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, \"-\") : sign === \"-\" ? \"\" : sign;\n if (scale < 0) {\n var unit = d3.formatPrefix(value, precision);\n value = unit.scale(value);\n fullSuffix = unit.symbol + suffix;\n } else {\n value *= scale;\n }\n value = type(value, precision);\n var i = value.lastIndexOf(\".\"), before, after;\n if (i < 0) {\n var j = exponent ? value.lastIndexOf(\"e\") : -1;\n if (j < 0) before = value, after = \"\"; else before = value.substring(0, j), after = value.substring(j);\n } else {\n before = value.substring(0, i);\n after = locale_decimal + value.substring(i + 1);\n }\n if (!zfill && comma) before = formatGroup(before, Infinity);\n var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : \"\";\n if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity);\n negative += prefix;\n value = before + after;\n return (align === \"<\" ? negative + value + padding : align === \">\" ? padding + negative + value : align === \"^\" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix;\n };\n };\n }\n var d3_format_re = /(?:([^{])?([<>=^]))?([+\\- ])?([$#])?(0)?(\\d+)?(,)?(\\.-?\\d+)?([a-z%])?/i;\n var d3_format_types = d3.map({\n b: function(x) {\n return x.toString(2);\n },\n c: function(x) {\n return String.fromCharCode(x);\n },\n o: function(x) {\n return x.toString(8);\n },\n x: function(x) {\n return x.toString(16);\n },\n X: function(x) {\n return x.toString(16).toUpperCase();\n },\n g: function(x, p) {\n return x.toPrecision(p);\n },\n e: function(x, p) {\n return x.toExponential(p);\n },\n f: function(x, p) {\n return x.toFixed(p);\n },\n r: function(x, p) {\n return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p))));\n }\n });\n function d3_format_typeDefault(x) {\n return x + \"\";\n }\n var d3_time = d3.time = {}, d3_date = Date;\n function d3_date_utc() {\n this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);\n }\n d3_date_utc.prototype = {\n getDate: function() {\n return this._.getUTCDate();\n },\n getDay: function() {\n return this._.getUTCDay();\n },\n getFullYear: function() {\n return this._.getUTCFullYear();\n },\n getHours: function() {\n return this._.getUTCHours();\n },\n getMilliseconds: function() {\n return this._.getUTCMilliseconds();\n },\n getMinutes: function() {\n return this._.getUTCMinutes();\n },\n getMonth: function() {\n return this._.getUTCMonth();\n },\n getSeconds: function() {\n return this._.getUTCSeconds();\n },\n getTime: function() {\n return this._.getTime();\n },\n getTimezoneOffset: function() {\n return 0;\n },\n valueOf: function() {\n return this._.valueOf();\n },\n setDate: function() {\n d3_time_prototype.setUTCDate.apply(this._, arguments);\n },\n setDay: function() {\n d3_time_prototype.setUTCDay.apply(this._, arguments);\n },\n setFullYear: function() {\n d3_time_prototype.setUTCFullYear.apply(this._, arguments);\n },\n setHours: function() {\n d3_time_prototype.setUTCHours.apply(this._, arguments);\n },\n setMilliseconds: function() {\n d3_time_prototype.setUTCMilliseconds.apply(this._, arguments);\n },\n setMinutes: function() {\n d3_time_prototype.setUTCMinutes.apply(this._, arguments);\n },\n setMonth: function() {\n d3_time_prototype.setUTCMonth.apply(this._, arguments);\n },\n setSeconds: function() {\n d3_time_prototype.setUTCSeconds.apply(this._, arguments);\n },\n setTime: function() {\n d3_time_prototype.setTime.apply(this._, arguments);\n }\n };\n var d3_time_prototype = Date.prototype;\n function d3_time_interval(local, step, number) {\n function round(date) {\n var d0 = local(date), d1 = offset(d0, 1);\n return date - d0 < d1 - date ? d0 : d1;\n }\n function ceil(date) {\n step(date = local(new d3_date(date - 1)), 1);\n return date;\n }\n function offset(date, k) {\n step(date = new d3_date(+date), k);\n return date;\n }\n function range(t0, t1, dt) {\n var time = ceil(t0), times = [];\n if (dt > 1) {\n while (time < t1) {\n if (!(number(time) % dt)) times.push(new Date(+time));\n step(time, 1);\n }\n } else {\n while (time < t1) times.push(new Date(+time)), step(time, 1);\n }\n return times;\n }\n function range_utc(t0, t1, dt) {\n try {\n d3_date = d3_date_utc;\n var utc = new d3_date_utc();\n utc._ = t0;\n return range(utc, t1, dt);\n } finally {\n d3_date = Date;\n }\n }\n local.floor = local;\n local.round = round;\n local.ceil = ceil;\n local.offset = offset;\n local.range = range;\n var utc = local.utc = d3_time_interval_utc(local);\n utc.floor = utc;\n utc.round = d3_time_interval_utc(round);\n utc.ceil = d3_time_interval_utc(ceil);\n utc.offset = d3_time_interval_utc(offset);\n utc.range = range_utc;\n return local;\n }\n function d3_time_interval_utc(method) {\n return function(date, k) {\n try {\n d3_date = d3_date_utc;\n var utc = new d3_date_utc();\n utc._ = date;\n return method(utc, k)._;\n } finally {\n d3_date = Date;\n }\n };\n }\n d3_time.year = d3_time_interval(function(date) {\n date = d3_time.day(date);\n date.setMonth(0, 1);\n return date;\n }, function(date, offset) {\n date.setFullYear(date.getFullYear() + offset);\n }, function(date) {\n return date.getFullYear();\n });\n d3_time.years = d3_time.year.range;\n d3_time.years.utc = d3_time.year.utc.range;\n d3_time.day = d3_time_interval(function(date) {\n var day = new d3_date(2e3, 0);\n day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n return day;\n }, function(date, offset) {\n date.setDate(date.getDate() + offset);\n }, function(date) {\n return date.getDate() - 1;\n });\n d3_time.days = d3_time.day.range;\n d3_time.days.utc = d3_time.day.utc.range;\n d3_time.dayOfYear = function(date) {\n var year = d3_time.year(date);\n return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);\n };\n [ \"sunday\", \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\" ].forEach(function(day, i) {\n i = 7 - i;\n var interval = d3_time[day] = d3_time_interval(function(date) {\n (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);\n return date;\n }, function(date, offset) {\n date.setDate(date.getDate() + Math.floor(offset) * 7);\n }, function(date) {\n var day = d3_time.year(date).getDay();\n return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i);\n });\n d3_time[day + \"s\"] = interval.range;\n d3_time[day + \"s\"].utc = interval.utc.range;\n d3_time[day + \"OfYear\"] = function(date) {\n var day = d3_time.year(date).getDay();\n return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7);\n };\n });\n d3_time.week = d3_time.sunday;\n d3_time.weeks = d3_time.sunday.range;\n d3_time.weeks.utc = d3_time.sunday.utc.range;\n d3_time.weekOfYear = d3_time.sundayOfYear;\n function d3_locale_timeFormat(locale) {\n var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;\n function d3_time_format(template) {\n var n = template.length;\n function format(date) {\n var string = [], i = -1, j = 0, c, p, f;\n while (++i < n) {\n if (template.charCodeAt(i) === 37) {\n string.push(template.slice(j, i));\n if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);\n if (f = d3_time_formats[c]) c = f(date, p == null ? c === \"e\" ? \" \" : \"0\" : p);\n string.push(c);\n j = i + 1;\n }\n }\n string.push(template.slice(j, i));\n return string.join(\"\");\n }\n format.parse = function(string) {\n var d = {\n y: 1900,\n m: 0,\n d: 1,\n H: 0,\n M: 0,\n S: 0,\n L: 0,\n Z: null\n }, i = d3_time_parse(d, template, string, 0);\n if (i != string.length) return null;\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();\n if (\"j\" in d) date.setFullYear(d.y, 0, d.j); else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"W\" in d ? 1 : 0;\n date.setFullYear(d.y, 0, 1);\n date.setFullYear(d.y, 0, \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);\n } else date.setFullYear(d.y, d.m, d.d);\n date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L);\n return localZ ? date._ : date;\n };\n format.toString = function() {\n return template;\n };\n return format;\n }\n function d3_time_parse(date, template, string, j) {\n var c, p, t, i = 0, n = template.length, m = string.length;\n while (i < n) {\n if (j >= m) return -1;\n c = template.charCodeAt(i++);\n if (c === 37) {\n t = template.charAt(i++);\n p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t];\n if (!p || (j = p(date, string, j)) < 0) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n return j;\n }\n d3_time_format.utc = function(template) {\n var local = d3_time_format(template);\n function format(date) {\n try {\n d3_date = d3_date_utc;\n var utc = new d3_date();\n utc._ = date;\n return local(utc);\n } finally {\n d3_date = Date;\n }\n }\n format.parse = function(string) {\n try {\n d3_date = d3_date_utc;\n var date = local.parse(string);\n return date && date._;\n } finally {\n d3_date = Date;\n }\n };\n format.toString = local.toString;\n return format;\n };\n d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti;\n var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths);\n locale_periods.forEach(function(p, i) {\n d3_time_periodLookup.set(p.toLowerCase(), i);\n });\n var d3_time_formats = {\n a: function(d) {\n return locale_shortDays[d.getDay()];\n },\n A: function(d) {\n return locale_days[d.getDay()];\n },\n b: function(d) {\n return locale_shortMonths[d.getMonth()];\n },\n B: function(d) {\n return locale_months[d.getMonth()];\n },\n c: d3_time_format(locale_dateTime),\n d: function(d, p) {\n return d3_time_formatPad(d.getDate(), p, 2);\n },\n e: function(d, p) {\n return d3_time_formatPad(d.getDate(), p, 2);\n },\n H: function(d, p) {\n return d3_time_formatPad(d.getHours(), p, 2);\n },\n I: function(d, p) {\n return d3_time_formatPad(d.getHours() % 12 || 12, p, 2);\n },\n j: function(d, p) {\n return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3);\n },\n L: function(d, p) {\n return d3_time_formatPad(d.getMilliseconds(), p, 3);\n },\n m: function(d, p) {\n return d3_time_formatPad(d.getMonth() + 1, p, 2);\n },\n M: function(d, p) {\n return d3_time_formatPad(d.getMinutes(), p, 2);\n },\n p: function(d) {\n return locale_periods[+(d.getHours() >= 12)];\n },\n S: function(d, p) {\n return d3_time_formatPad(d.getSeconds(), p, 2);\n },\n U: function(d, p) {\n return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2);\n },\n w: function(d) {\n return d.getDay();\n },\n W: function(d, p) {\n return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2);\n },\n x: d3_time_format(locale_date),\n X: d3_time_format(locale_time),\n y: function(d, p) {\n return d3_time_formatPad(d.getFullYear() % 100, p, 2);\n },\n Y: function(d, p) {\n return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);\n },\n Z: d3_time_zone,\n \"%\": function() {\n return \"%\";\n }\n };\n var d3_time_parsers = {\n a: d3_time_parseWeekdayAbbrev,\n A: d3_time_parseWeekday,\n b: d3_time_parseMonthAbbrev,\n B: d3_time_parseMonth,\n c: d3_time_parseLocaleFull,\n d: d3_time_parseDay,\n e: d3_time_parseDay,\n H: d3_time_parseHour24,\n I: d3_time_parseHour24,\n j: d3_time_parseDayOfYear,\n L: d3_time_parseMilliseconds,\n m: d3_time_parseMonthNumber,\n M: d3_time_parseMinutes,\n p: d3_time_parseAmPm,\n S: d3_time_parseSeconds,\n U: d3_time_parseWeekNumberSunday,\n w: d3_time_parseWeekdayNumber,\n W: d3_time_parseWeekNumberMonday,\n x: d3_time_parseLocaleDate,\n X: d3_time_parseLocaleTime,\n y: d3_time_parseYear,\n Y: d3_time_parseFullYear,\n Z: d3_time_parseZone,\n \"%\": d3_time_parseLiteralPercent\n };\n function d3_time_parseWeekdayAbbrev(date, string, i) {\n d3_time_dayAbbrevRe.lastIndex = 0;\n var n = d3_time_dayAbbrevRe.exec(string.slice(i));\n return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n function d3_time_parseWeekday(date, string, i) {\n d3_time_dayRe.lastIndex = 0;\n var n = d3_time_dayRe.exec(string.slice(i));\n return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n function d3_time_parseMonthAbbrev(date, string, i) {\n d3_time_monthAbbrevRe.lastIndex = 0;\n var n = d3_time_monthAbbrevRe.exec(string.slice(i));\n return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n function d3_time_parseMonth(date, string, i) {\n d3_time_monthRe.lastIndex = 0;\n var n = d3_time_monthRe.exec(string.slice(i));\n return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n function d3_time_parseLocaleFull(date, string, i) {\n return d3_time_parse(date, d3_time_formats.c.toString(), string, i);\n }\n function d3_time_parseLocaleDate(date, string, i) {\n return d3_time_parse(date, d3_time_formats.x.toString(), string, i);\n }\n function d3_time_parseLocaleTime(date, string, i) {\n return d3_time_parse(date, d3_time_formats.X.toString(), string, i);\n }\n function d3_time_parseAmPm(date, string, i) {\n var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase());\n return n == null ? -1 : (date.p = n, i);\n }\n return d3_time_format;\n }\n var d3_time_formatPads = {\n \"-\": \"\",\n _: \" \",\n \"0\": \"0\"\n }, d3_time_numberRe = /^\\s*\\d+/, d3_time_percentRe = /^%/;\n function d3_time_formatPad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\", string = (sign ? -value : value) + \"\", length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n }\n function d3_time_formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(d3.requote).join(\"|\") + \")\", \"i\");\n }\n function d3_time_formatLookup(names) {\n var map = new d3_Map(), i = -1, n = names.length;\n while (++i < n) map.set(names[i].toLowerCase(), i);\n return map;\n }\n function d3_time_parseWeekdayNumber(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 1));\n return n ? (date.w = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseWeekNumberSunday(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i));\n return n ? (date.U = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseWeekNumberMonday(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i));\n return n ? (date.W = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseFullYear(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 4));\n return n ? (date.y = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseYear(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;\n }\n function d3_time_parseZone(date, string, i) {\n return /^[+-]\\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, \n i + 5) : -1;\n }\n function d3_time_expandYear(d) {\n return d + (d > 68 ? 1900 : 2e3);\n }\n function d3_time_parseMonthNumber(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n return n ? (date.m = n[0] - 1, i + n[0].length) : -1;\n }\n function d3_time_parseDay(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n return n ? (date.d = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseDayOfYear(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 3));\n return n ? (date.j = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseHour24(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n return n ? (date.H = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseMinutes(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n return n ? (date.M = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseSeconds(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n return n ? (date.S = +n[0], i + n[0].length) : -1;\n }\n function d3_time_parseMilliseconds(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.slice(i, i + 3));\n return n ? (date.L = +n[0], i + n[0].length) : -1;\n }\n function d3_time_zone(d) {\n var z = d.getTimezoneOffset(), zs = z > 0 ? \"-\" : \"+\", zh = abs(z) / 60 | 0, zm = abs(z) % 60;\n return zs + d3_time_formatPad(zh, \"0\", 2) + d3_time_formatPad(zm, \"0\", 2);\n }\n function d3_time_parseLiteralPercent(date, string, i) {\n d3_time_percentRe.lastIndex = 0;\n var n = d3_time_percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n }\n function d3_time_formatMulti(formats) {\n var n = formats.length, i = -1;\n while (++i < n) formats[i][0] = this(formats[i][0]);\n return function(date) {\n var i = 0, f = formats[i];\n while (!f[1](date)) f = formats[++i];\n return f[0](date);\n };\n }\n d3.locale = function(locale) {\n return {\n numberFormat: d3_locale_numberFormat(locale),\n timeFormat: d3_locale_timeFormat(locale)\n };\n };\n var d3_locale_enUS = d3.locale({\n decimal: \".\",\n thousands: \",\",\n grouping: [ 3 ],\n currency: [ \"$\", \"\" ],\n dateTime: \"%a %b %e %X %Y\",\n date: \"%m/%d/%Y\",\n time: \"%H:%M:%S\",\n periods: [ \"AM\", \"PM\" ],\n days: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ],\n shortDays: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ],\n months: [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n shortMonths: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ]\n });\n d3.format = d3_locale_enUS.numberFormat;\n d3.geo = {};\n function d3_adder() {}\n d3_adder.prototype = {\n s: 0,\n t: 0,\n add: function(y) {\n d3_adderSum(y, this.t, d3_adderTemp);\n d3_adderSum(d3_adderTemp.s, this.s, this);\n if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t;\n },\n reset: function() {\n this.s = this.t = 0;\n },\n valueOf: function() {\n return this.s;\n }\n };\n var d3_adderTemp = new d3_adder();\n function d3_adderSum(a, b, o) {\n var x = o.s = a + b, bv = x - a, av = x - bv;\n o.t = a - av + (b - bv);\n }\n d3.geo.stream = function(object, listener) {\n if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) {\n d3_geo_streamObjectType[object.type](object, listener);\n } else {\n d3_geo_streamGeometry(object, listener);\n }\n };\n function d3_geo_streamGeometry(geometry, listener) {\n if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) {\n d3_geo_streamGeometryType[geometry.type](geometry, listener);\n }\n }\n var d3_geo_streamObjectType = {\n Feature: function(feature, listener) {\n d3_geo_streamGeometry(feature.geometry, listener);\n },\n FeatureCollection: function(object, listener) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);\n }\n };\n var d3_geo_streamGeometryType = {\n Sphere: function(object, listener) {\n listener.sphere();\n },\n Point: function(object, listener) {\n object = object.coordinates;\n listener.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, listener) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]);\n },\n LineString: function(object, listener) {\n d3_geo_streamLine(object.coordinates, listener, 0);\n },\n MultiLineString: function(object, listener) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0);\n },\n Polygon: function(object, listener) {\n d3_geo_streamPolygon(object.coordinates, listener);\n },\n MultiPolygon: function(object, listener) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);\n },\n GeometryCollection: function(object, listener) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) d3_geo_streamGeometry(geometries[i], listener);\n }\n };\n function d3_geo_streamLine(coordinates, listener, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n listener.lineStart();\n while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]);\n listener.lineEnd();\n }\n function d3_geo_streamPolygon(coordinates, listener) {\n var i = -1, n = coordinates.length;\n listener.polygonStart();\n while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1);\n listener.polygonEnd();\n }\n d3.geo.area = function(object) {\n d3_geo_areaSum = 0;\n d3.geo.stream(object, d3_geo_area);\n return d3_geo_areaSum;\n };\n var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder();\n var d3_geo_area = {\n sphere: function() {\n d3_geo_areaSum += 4 * π;\n },\n point: d3_noop,\n lineStart: d3_noop,\n lineEnd: d3_noop,\n polygonStart: function() {\n d3_geo_areaRingSum.reset();\n d3_geo_area.lineStart = d3_geo_areaRingStart;\n },\n polygonEnd: function() {\n var area = 2 * d3_geo_areaRingSum;\n d3_geo_areaSum += area < 0 ? 4 * π + area : area;\n d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop;\n }\n };\n function d3_geo_areaRingStart() {\n var λ00, φ00, λ0, cosφ0, sinφ0;\n d3_geo_area.point = function(λ, φ) {\n d3_geo_area.point = nextPoint;\n λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), \n sinφ0 = Math.sin(φ);\n };\n function nextPoint(λ, φ) {\n λ *= d3_radians;\n φ = φ * d3_radians / 2 + π / 4;\n var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ);\n d3_geo_areaRingSum.add(Math.atan2(v, u));\n λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;\n }\n d3_geo_area.lineEnd = function() {\n nextPoint(λ00, φ00);\n };\n }\n function d3_geo_cartesian(spherical) {\n var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);\n return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ];\n }\n function d3_geo_cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n function d3_geo_cartesianCross(a, b) {\n return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ];\n }\n function d3_geo_cartesianAdd(a, b) {\n a[0] += b[0];\n a[1] += b[1];\n a[2] += b[2];\n }\n function d3_geo_cartesianScale(vector, k) {\n return [ vector[0] * k, vector[1] * k, vector[2] * k ];\n }\n function d3_geo_cartesianNormalize(d) {\n var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l;\n d[1] /= l;\n d[2] /= l;\n }\n function d3_geo_spherical(cartesian) {\n return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ];\n }\n function d3_geo_sphericalEqual(a, b) {\n return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε;\n }\n d3.geo.bounds = function() {\n var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;\n var bound = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n bound.point = ringPoint;\n bound.lineStart = ringStart;\n bound.lineEnd = ringEnd;\n dλSum = 0;\n d3_geo_area.polygonStart();\n },\n polygonEnd: function() {\n d3_geo_area.polygonEnd();\n bound.point = point;\n bound.lineStart = lineStart;\n bound.lineEnd = lineEnd;\n if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90;\n range[0] = λ0, range[1] = λ1;\n }\n };\n function point(λ, φ) {\n ranges.push(range = [ λ0 = λ, λ1 = λ ]);\n if (φ < φ0) φ0 = φ;\n if (φ > φ1) φ1 = φ;\n }\n function linePoint(λ, φ) {\n var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);\n if (p0) {\n var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);\n d3_geo_cartesianNormalize(inflection);\n inflection = d3_geo_spherical(inflection);\n var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180;\n if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) {\n var φi = inflection[1] * d3_degrees;\n if (φi > φ1) φ1 = φi;\n } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) {\n var φi = -inflection[1] * d3_degrees;\n if (φi < φ0) φ0 = φi;\n } else {\n if (φ < φ0) φ0 = φ;\n if (φ > φ1) φ1 = φ;\n }\n if (antimeridian) {\n if (λ < λ_) {\n if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;\n } else {\n if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;\n }\n } else {\n if (λ1 >= λ0) {\n if (λ < λ0) λ0 = λ;\n if (λ > λ1) λ1 = λ;\n } else {\n if (λ > λ_) {\n if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;\n } else {\n if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;\n }\n }\n }\n } else {\n point(λ, φ);\n }\n p0 = p, λ_ = λ;\n }\n function lineStart() {\n bound.point = linePoint;\n }\n function lineEnd() {\n range[0] = λ0, range[1] = λ1;\n bound.point = point;\n p0 = null;\n }\n function ringPoint(λ, φ) {\n if (p0) {\n var dλ = λ - λ_;\n dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ;\n } else λ__ = λ, φ__ = φ;\n d3_geo_area.point(λ, φ);\n linePoint(λ, φ);\n }\n function ringStart() {\n d3_geo_area.lineStart();\n }\n function ringEnd() {\n ringPoint(λ__, φ__);\n d3_geo_area.lineEnd();\n if (abs(dλSum) > ε) λ0 = -(λ1 = 180);\n range[0] = λ0, range[1] = λ1;\n p0 = null;\n }\n function angle(λ0, λ1) {\n return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1;\n }\n function compareRanges(a, b) {\n return a[0] - b[0];\n }\n function withinRange(x, range) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n }\n return function(feature) {\n φ1 = λ1 = -(λ0 = φ0 = Infinity);\n ranges = [];\n d3.geo.stream(feature, bound);\n var n = ranges.length;\n if (n) {\n ranges.sort(compareRanges);\n for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) {\n b = ranges[i];\n if (withinRange(b[0], a) || withinRange(b[1], a)) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n var best = -Infinity, dλ;\n for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) {\n b = merged[i];\n if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1];\n }\n }\n ranges = range = null;\n return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ];\n };\n }();\n d3.geo.centroid = function(object) {\n d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;\n d3.geo.stream(object, d3_geo_centroid);\n var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z;\n if (m < ε2) {\n x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1;\n if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0;\n m = x * x + y * y + z * z;\n if (m < ε2) return [ NaN, NaN ];\n }\n return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ];\n };\n var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2;\n var d3_geo_centroid = {\n sphere: d3_noop,\n point: d3_geo_centroidPoint,\n lineStart: d3_geo_centroidLineStart,\n lineEnd: d3_geo_centroidLineEnd,\n polygonStart: function() {\n d3_geo_centroid.lineStart = d3_geo_centroidRingStart;\n },\n polygonEnd: function() {\n d3_geo_centroid.lineStart = d3_geo_centroidLineStart;\n }\n };\n function d3_geo_centroidPoint(λ, φ) {\n λ *= d3_radians;\n var cosφ = Math.cos(φ *= d3_radians);\n d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ));\n }\n function d3_geo_centroidPointXYZ(x, y, z) {\n ++d3_geo_centroidW0;\n d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0;\n d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0;\n d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0;\n }\n function d3_geo_centroidLineStart() {\n var x0, y0, z0;\n d3_geo_centroid.point = function(λ, φ) {\n λ *= d3_radians;\n var cosφ = Math.cos(φ *= d3_radians);\n x0 = cosφ * Math.cos(λ);\n y0 = cosφ * Math.sin(λ);\n z0 = Math.sin(φ);\n d3_geo_centroid.point = nextPoint;\n d3_geo_centroidPointXYZ(x0, y0, z0);\n };\n function nextPoint(λ, φ) {\n λ *= d3_radians;\n var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n d3_geo_centroidW1 += w;\n d3_geo_centroidX1 += w * (x0 + (x0 = x));\n d3_geo_centroidY1 += w * (y0 + (y0 = y));\n d3_geo_centroidZ1 += w * (z0 + (z0 = z));\n d3_geo_centroidPointXYZ(x0, y0, z0);\n }\n }\n function d3_geo_centroidLineEnd() {\n d3_geo_centroid.point = d3_geo_centroidPoint;\n }\n function d3_geo_centroidRingStart() {\n var λ00, φ00, x0, y0, z0;\n d3_geo_centroid.point = function(λ, φ) {\n λ00 = λ, φ00 = φ;\n d3_geo_centroid.point = nextPoint;\n λ *= d3_radians;\n var cosφ = Math.cos(φ *= d3_radians);\n x0 = cosφ * Math.cos(λ);\n y0 = cosφ * Math.sin(λ);\n z0 = Math.sin(φ);\n d3_geo_centroidPointXYZ(x0, y0, z0);\n };\n d3_geo_centroid.lineEnd = function() {\n nextPoint(λ00, φ00);\n d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd;\n d3_geo_centroid.point = d3_geo_centroidPoint;\n };\n function nextPoint(λ, φ) {\n λ *= d3_radians;\n var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u);\n d3_geo_centroidX2 += v * cx;\n d3_geo_centroidY2 += v * cy;\n d3_geo_centroidZ2 += v * cz;\n d3_geo_centroidW1 += w;\n d3_geo_centroidX1 += w * (x0 + (x0 = x));\n d3_geo_centroidY1 += w * (y0 + (y0 = y));\n d3_geo_centroidZ1 += w * (z0 + (z0 = z));\n d3_geo_centroidPointXYZ(x0, y0, z0);\n }\n }\n function d3_geo_compose(a, b) {\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n return compose;\n }\n function d3_true() {\n return true;\n }\n function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {\n var subject = [], clip = [];\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n];\n if (d3_geo_sphericalEqual(p0, p1)) {\n listener.lineStart();\n for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]);\n listener.lineEnd();\n return;\n }\n var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false);\n a.o = b;\n subject.push(a);\n clip.push(b);\n a = new d3_geo_clipPolygonIntersection(p1, segment, null, false);\n b = new d3_geo_clipPolygonIntersection(p1, null, a, true);\n a.o = b;\n subject.push(a);\n clip.push(b);\n });\n clip.sort(compare);\n d3_geo_clipPolygonLinkCircular(subject);\n d3_geo_clipPolygonLinkCircular(clip);\n if (!subject.length) return;\n for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {\n clip[i].e = entry = !entry;\n }\n var start = subject[0], points, point;\n while (1) {\n var current = start, isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n listener.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, listener);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, listener);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n listener.lineEnd();\n }\n }\n function d3_geo_clipPolygonLinkCircular(array) {\n if (!(n = array.length)) return;\n var n, i = 0, a = array[0], b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n }\n function d3_geo_clipPolygonIntersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other;\n this.e = entry;\n this.v = false;\n this.n = this.p = null;\n }\n function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {\n return function(rotate, listener) {\n var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = d3.merge(segments);\n var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);\n if (segments.length) {\n if (!polygonStarted) listener.polygonStart(), polygonStarted = true;\n d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);\n } else if (clipStartInside) {\n if (!polygonStarted) listener.polygonStart(), polygonStarted = true;\n listener.lineStart();\n interpolate(null, null, 1, listener);\n listener.lineEnd();\n }\n if (polygonStarted) listener.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n listener.polygonStart();\n listener.lineStart();\n interpolate(null, null, 1, listener);\n listener.lineEnd();\n listener.polygonEnd();\n }\n };\n function point(λ, φ) {\n var point = rotate(λ, φ);\n if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);\n }\n function pointLine(λ, φ) {\n var point = rotate(λ, φ);\n line.point(point[0], point[1]);\n }\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n var segments;\n var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;\n function pointRing(λ, φ) {\n ring.push([ λ, φ ]);\n var point = rotate(λ, φ);\n ringListener.point(point[0], point[1]);\n }\n function ringStart() {\n ringListener.lineStart();\n ring = [];\n }\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringListener.lineEnd();\n var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length;\n ring.pop();\n polygon.push(ring);\n ring = null;\n if (!n) return;\n if (clean & 1) {\n segment = ringSegments[0];\n var n = segment.length - 1, i = -1, point;\n if (n > 0) {\n if (!polygonStarted) listener.polygonStart(), polygonStarted = true;\n listener.lineStart();\n while (++i < n) listener.point((point = segment[i])[0], point[1]);\n listener.lineEnd();\n }\n return;\n }\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n segments.push(ringSegments.filter(d3_geo_clipSegmentLength1));\n }\n return clip;\n };\n }\n function d3_geo_clipSegmentLength1(segment) {\n return segment.length > 1;\n }\n function d3_geo_clipBufferListener() {\n var lines = [], line;\n return {\n lineStart: function() {\n lines.push(line = []);\n },\n point: function(λ, φ) {\n line.push([ λ, φ ]);\n },\n lineEnd: d3_noop,\n buffer: function() {\n var buffer = lines;\n lines = [];\n line = null;\n return buffer;\n },\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n }\n };\n }\n function d3_geo_clipSort(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);\n }\n var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);\n function d3_geo_clipAntimeridianLine(listener) {\n var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;\n return {\n lineStart: function() {\n listener.lineStart();\n clean = 1;\n },\n point: function(λ1, φ1) {\n var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0);\n if (abs(dλ - π) < ε) {\n listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);\n listener.point(sλ0, φ0);\n listener.lineEnd();\n listener.lineStart();\n listener.point(sλ1, φ0);\n listener.point(λ1, φ0);\n clean = 0;\n } else if (sλ0 !== sλ1 && dλ >= π) {\n if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε;\n if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε;\n φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1);\n listener.point(sλ0, φ0);\n listener.lineEnd();\n listener.lineStart();\n listener.point(sλ1, φ0);\n clean = 0;\n }\n listener.point(λ0 = λ1, φ0 = φ1);\n sλ0 = sλ1;\n },\n lineEnd: function() {\n listener.lineEnd();\n λ0 = φ0 = NaN;\n },\n clean: function() {\n return 2 - clean;\n }\n };\n }\n function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) {\n var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1);\n return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2;\n }\n function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {\n var φ;\n if (from == null) {\n φ = direction * halfπ;\n listener.point(-π, φ);\n listener.point(0, φ);\n listener.point(π, φ);\n listener.point(π, 0);\n listener.point(π, -φ);\n listener.point(0, -φ);\n listener.point(-π, -φ);\n listener.point(-π, 0);\n listener.point(-π, φ);\n } else if (abs(from[0] - to[0]) > ε) {\n var s = from[0] < to[0] ? π : -π;\n φ = direction * s / 2;\n listener.point(-s, φ);\n listener.point(0, φ);\n listener.point(s, φ);\n } else {\n listener.point(to[0], to[1]);\n }\n }\n function d3_geo_pointInPolygon(point, polygon) {\n var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;\n d3_geo_areaRingSum.reset();\n for (var i = 0, n = polygon.length; i < n; ++i) {\n var ring = polygon[i], m = ring.length;\n if (!m) continue;\n var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;\n while (true) {\n if (j === m) j = 0;\n point = ring[j];\n var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ;\n d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));\n polarAngle += antimeridian ? dλ + sdλ * τ : dλ;\n if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {\n var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));\n d3_geo_cartesianNormalize(arc);\n var intersection = d3_geo_cartesianCross(meridianNormal, arc);\n d3_geo_cartesianNormalize(intersection);\n var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);\n if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {\n winding += antimeridian ^ dλ >= 0 ? 1 : -1;\n }\n }\n if (!j++) break;\n λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;\n }\n }\n return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < -ε) ^ winding & 1;\n }\n function d3_geo_clipCircle(radius) {\n var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);\n return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);\n function visible(λ, φ) {\n return Math.cos(λ) * Math.cos(φ) > cr;\n }\n function clipLine(listener) {\n var point0, c0, v0, v00, clean;\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(λ, φ) {\n var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;\n if (!point0 && (v00 = v0 = v)) listener.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {\n point1[0] += ε;\n point1[1] += ε;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n listener.lineStart();\n point2 = intersect(point1, point0);\n listener.point(point2[0], point2[1]);\n } else {\n point2 = intersect(point0, point1);\n listener.point(point2[0], point2[1]);\n listener.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n listener.lineStart();\n listener.point(t[0][0], t[0][1]);\n listener.point(t[1][0], t[1][1]);\n listener.lineEnd();\n } else {\n listener.point(t[1][0], t[1][1]);\n listener.lineEnd();\n listener.lineStart();\n listener.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {\n listener.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) listener.lineEnd();\n point0 = null;\n },\n clean: function() {\n return clean | (v00 && v0) << 1;\n }\n };\n }\n function intersect(a, b, two) {\n var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b);\n var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;\n if (!determinant) return !two && a;\n var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2);\n d3_geo_cartesianAdd(A, B);\n var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1);\n if (t2 < 0) return;\n var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu);\n d3_geo_cartesianAdd(q, A);\n q = d3_geo_spherical(q);\n if (!two) return q;\n var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z;\n if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;\n var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε;\n if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;\n if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {\n var q1 = d3_geo_cartesianScale(u, (-w + t) / uu);\n d3_geo_cartesianAdd(q1, A);\n return [ q, d3_geo_spherical(q1) ];\n }\n }\n function code(λ, φ) {\n var r = smallRadius ? radius : π - radius, code = 0;\n if (λ < -r) code |= 1; else if (λ > r) code |= 2;\n if (φ < -r) code |= 4; else if (φ > r) code |= 8;\n return code;\n }\n }\n function d3_geom_clipLine(x0, y0, x1, y1) {\n return function(line) {\n var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n if (t0 > 0) line.a = {\n x: ax + t0 * dx,\n y: ay + t0 * dy\n };\n if (t1 < 1) line.b = {\n x: ax + t1 * dx,\n y: ay + t1 * dy\n };\n return line;\n };\n }\n var d3_geo_clipExtentMAX = 1e9;\n d3.geo.clipExtent = function() {\n var x0, y0, x1, y1, stream, clip, clipExtent = {\n stream: function(output) {\n if (stream) stream.valid = false;\n stream = clip(output);\n stream.valid = true;\n return stream;\n },\n extent: function(_) {\n if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];\n clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]);\n if (stream) stream.valid = false, stream = null;\n return clipExtent;\n }\n };\n return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]);\n };\n function d3_geo_clipExtent(x0, y0, x1, y1) {\n return function(listener) {\n var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n listener = bufferListener;\n segments = [];\n polygon = [];\n clean = true;\n },\n polygonEnd: function() {\n listener = listener_;\n segments = d3.merge(segments);\n var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;\n if (inside || visible) {\n listener.polygonStart();\n if (inside) {\n listener.lineStart();\n interpolate(null, null, 1, listener);\n listener.lineEnd();\n }\n if (visible) {\n d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);\n }\n listener.polygonEnd();\n }\n segments = polygon = ring = null;\n }\n };\n function insidePolygon(p) {\n var wn = 0, n = polygon.length, y = p[1];\n for (var i = 0; i < n; ++i) {\n for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) {\n b = v[j];\n if (a[1] <= y) {\n if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn;\n } else {\n if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn;\n }\n a = b;\n }\n }\n return wn !== 0;\n }\n function interpolate(from, to, direction, listener) {\n var a = 0, a1 = 0;\n if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) {\n do {\n listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n } while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n listener.point(to[0], to[1]);\n }\n }\n function pointVisible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n function point(x, y) {\n if (pointVisible(x, y)) listener.point(x, y);\n }\n var x__, y__, v__, x_, y_, v_, first, clean;\n function lineStart() {\n clip.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferListener.rejoin();\n segments.push(bufferListener.buffer());\n }\n clip.point = point;\n if (v_) listener.lineEnd();\n }\n function linePoint(x, y) {\n x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));\n y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));\n var v = pointVisible(x, y);\n if (polygon) ring.push([ x, y ]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n listener.lineStart();\n listener.point(x, y);\n }\n } else {\n if (v && v_) listener.point(x, y); else {\n var l = {\n a: {\n x: x_,\n y: y_\n },\n b: {\n x: x,\n y: y\n }\n };\n if (clipLine(l)) {\n if (!v_) {\n listener.lineStart();\n listener.point(l.a.x, l.a.y);\n }\n listener.point(l.b.x, l.b.y);\n if (!v) listener.lineEnd();\n clean = false;\n } else if (v) {\n listener.lineStart();\n listener.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n return clip;\n };\n function corner(p, direction) {\n return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;\n }\n function compare(a, b) {\n return comparePoints(a.x, b.x);\n }\n function comparePoints(a, b) {\n var ca = corner(a, 1), cb = corner(b, 1);\n return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];\n }\n }\n function d3_geo_conic(projectAt) {\n var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1);\n p.parallels = function(_) {\n if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ];\n return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);\n };\n return p;\n }\n function d3_geo_conicEqualArea(φ0, φ1) {\n var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n;\n function forward(λ, φ) {\n var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n;\n return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ];\n }\n forward.invert = function(x, y) {\n var ρ0_y = ρ0 - y;\n return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ];\n };\n return forward;\n }\n (d3.geo.conicEqualArea = function() {\n return d3_geo_conic(d3_geo_conicEqualArea);\n }).raw = d3_geo_conicEqualArea;\n d3.geo.albers = function() {\n return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);\n };\n d3.geo.albersUsa = function() {\n var lower48 = d3.geo.albers();\n var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);\n var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);\n var point, pointStream = {\n point: function(x, y) {\n point = [ x, y ];\n }\n }, lower48Point, alaskaPoint, hawaiiPoint;\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n point = null;\n (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y);\n return point;\n }\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;\n return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates);\n };\n albersUsa.stream = function(stream) {\n var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream);\n return {\n point: function(x, y) {\n lower48Stream.point(x, y);\n alaskaStream.point(x, y);\n hawaiiStream.point(x, y);\n },\n sphere: function() {\n lower48Stream.sphere();\n alaskaStream.sphere();\n hawaiiStream.sphere();\n },\n lineStart: function() {\n lower48Stream.lineStart();\n alaskaStream.lineStart();\n hawaiiStream.lineStart();\n },\n lineEnd: function() {\n lower48Stream.lineEnd();\n alaskaStream.lineEnd();\n hawaiiStream.lineEnd();\n },\n polygonStart: function() {\n lower48Stream.polygonStart();\n alaskaStream.polygonStart();\n hawaiiStream.polygonStart();\n },\n polygonEnd: function() {\n lower48Stream.polygonEnd();\n alaskaStream.polygonEnd();\n hawaiiStream.polygonEnd();\n }\n };\n };\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_);\n alaska.precision(_);\n hawaii.precision(_);\n return albersUsa;\n };\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_);\n alaska.scale(_ * .35);\n hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point;\n alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;\n hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;\n return albersUsa;\n };\n return albersUsa.scale(1070);\n };\n var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {\n point: d3_noop,\n lineStart: d3_noop,\n lineEnd: d3_noop,\n polygonStart: function() {\n d3_geo_pathAreaPolygon = 0;\n d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;\n },\n polygonEnd: function() {\n d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;\n d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);\n }\n };\n function d3_geo_pathAreaRingStart() {\n var x00, y00, x0, y0;\n d3_geo_pathArea.point = function(x, y) {\n d3_geo_pathArea.point = nextPoint;\n x00 = x0 = x, y00 = y0 = y;\n };\n function nextPoint(x, y) {\n d3_geo_pathAreaPolygon += y0 * x - x0 * y;\n x0 = x, y0 = y;\n }\n d3_geo_pathArea.lineEnd = function() {\n nextPoint(x00, y00);\n };\n }\n var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;\n var d3_geo_pathBounds = {\n point: d3_geo_pathBoundsPoint,\n lineStart: d3_noop,\n lineEnd: d3_noop,\n polygonStart: d3_noop,\n polygonEnd: d3_noop\n };\n function d3_geo_pathBoundsPoint(x, y) {\n if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;\n if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;\n if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;\n if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;\n }\n function d3_geo_pathBuffer() {\n var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];\n var stream = {\n point: point,\n lineStart: function() {\n stream.point = pointLineStart;\n },\n lineEnd: lineEnd,\n polygonStart: function() {\n stream.lineEnd = lineEndPolygon;\n },\n polygonEnd: function() {\n stream.lineEnd = lineEnd;\n stream.point = point;\n },\n pointRadius: function(_) {\n pointCircle = d3_geo_pathBufferCircle(_);\n return stream;\n },\n result: function() {\n if (buffer.length) {\n var result = buffer.join(\"\");\n buffer = [];\n return result;\n }\n }\n };\n function point(x, y) {\n buffer.push(\"M\", x, \",\", y, pointCircle);\n }\n function pointLineStart(x, y) {\n buffer.push(\"M\", x, \",\", y);\n stream.point = pointLine;\n }\n function pointLine(x, y) {\n buffer.push(\"L\", x, \",\", y);\n }\n function lineEnd() {\n stream.point = point;\n }\n function lineEndPolygon() {\n buffer.push(\"Z\");\n }\n return stream;\n }\n function d3_geo_pathBufferCircle(radius) {\n return \"m0,\" + radius + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius + \"z\";\n }\n var d3_geo_pathCentroid = {\n point: d3_geo_pathCentroidPoint,\n lineStart: d3_geo_pathCentroidLineStart,\n lineEnd: d3_geo_pathCentroidLineEnd,\n polygonStart: function() {\n d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;\n },\n polygonEnd: function() {\n d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;\n d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;\n d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;\n }\n };\n function d3_geo_pathCentroidPoint(x, y) {\n d3_geo_centroidX0 += x;\n d3_geo_centroidY0 += y;\n ++d3_geo_centroidZ0;\n }\n function d3_geo_pathCentroidLineStart() {\n var x0, y0;\n d3_geo_pathCentroid.point = function(x, y) {\n d3_geo_pathCentroid.point = nextPoint;\n d3_geo_pathCentroidPoint(x0 = x, y0 = y);\n };\n function nextPoint(x, y) {\n var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);\n d3_geo_centroidX1 += z * (x0 + x) / 2;\n d3_geo_centroidY1 += z * (y0 + y) / 2;\n d3_geo_centroidZ1 += z;\n d3_geo_pathCentroidPoint(x0 = x, y0 = y);\n }\n }\n function d3_geo_pathCentroidLineEnd() {\n d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;\n }\n function d3_geo_pathCentroidRingStart() {\n var x00, y00, x0, y0;\n d3_geo_pathCentroid.point = function(x, y) {\n d3_geo_pathCentroid.point = nextPoint;\n d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);\n };\n function nextPoint(x, y) {\n var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);\n d3_geo_centroidX1 += z * (x0 + x) / 2;\n d3_geo_centroidY1 += z * (y0 + y) / 2;\n d3_geo_centroidZ1 += z;\n z = y0 * x - x0 * y;\n d3_geo_centroidX2 += z * (x0 + x);\n d3_geo_centroidY2 += z * (y0 + y);\n d3_geo_centroidZ2 += z * 3;\n d3_geo_pathCentroidPoint(x0 = x, y0 = y);\n }\n d3_geo_pathCentroid.lineEnd = function() {\n nextPoint(x00, y00);\n };\n }\n function d3_geo_pathContext(context) {\n var pointRadius = 4.5;\n var stream = {\n point: point,\n lineStart: function() {\n stream.point = pointLineStart;\n },\n lineEnd: lineEnd,\n polygonStart: function() {\n stream.lineEnd = lineEndPolygon;\n },\n polygonEnd: function() {\n stream.lineEnd = lineEnd;\n stream.point = point;\n },\n pointRadius: function(_) {\n pointRadius = _;\n return stream;\n },\n result: d3_noop\n };\n function point(x, y) {\n context.moveTo(x + pointRadius, y);\n context.arc(x, y, pointRadius, 0, τ);\n }\n function pointLineStart(x, y) {\n context.moveTo(x, y);\n stream.point = pointLine;\n }\n function pointLine(x, y) {\n context.lineTo(x, y);\n }\n function lineEnd() {\n stream.point = point;\n }\n function lineEndPolygon() {\n context.closePath();\n }\n return stream;\n }\n function d3_geo_resample(project) {\n var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;\n function resample(stream) {\n return (maxDepth ? resampleRecursive : resampleNone)(stream);\n }\n function resampleNone(stream) {\n return d3_geo_transformPoint(stream, function(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n });\n }\n function resampleRecursive(stream) {\n var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0;\n var resample = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n stream.polygonStart();\n resample.lineStart = ringStart;\n },\n polygonEnd: function() {\n stream.polygonEnd();\n resample.lineStart = lineStart;\n }\n };\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n function lineStart() {\n x0 = NaN;\n resample.point = linePoint;\n stream.lineStart();\n }\n function linePoint(λ, φ) {\n var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ);\n resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n function lineEnd() {\n resample.point = point;\n stream.lineEnd();\n }\n function ringStart() {\n lineStart();\n resample.point = ringPoint;\n resample.lineEnd = ringEnd;\n }\n function ringPoint(λ, φ) {\n linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resample.point = linePoint;\n }\n function ringEnd() {\n resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream);\n resample.lineEnd = lineEnd;\n lineEnd();\n }\n return resample;\n }\n function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy;\n if (d2 > 4 * δ2 && depth--) {\n var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {\n resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream);\n }\n }\n }\n resample.precision = function(_) {\n if (!arguments.length) return Math.sqrt(δ2);\n maxDepth = (δ2 = _ * _) > 0 && 16;\n return resample;\n };\n return resample;\n }\n d3.geo.path = function() {\n var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream;\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream);\n d3.geo.stream(object, cacheStream);\n }\n return contextStream.result();\n }\n path.area = function(object) {\n d3_geo_pathAreaSum = 0;\n d3.geo.stream(object, projectStream(d3_geo_pathArea));\n return d3_geo_pathAreaSum;\n };\n path.centroid = function(object) {\n d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;\n d3.geo.stream(object, projectStream(d3_geo_pathCentroid));\n return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ];\n };\n path.bounds = function(object) {\n d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity);\n d3.geo.stream(object, projectStream(d3_geo_pathBounds));\n return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ];\n };\n path.projection = function(_) {\n if (!arguments.length) return projection;\n projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity;\n return reset();\n };\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return reset();\n };\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n function reset() {\n cacheStream = null;\n return path;\n }\n return path.projection(d3.geo.albersUsa()).context(null);\n };\n function d3_geo_pathProjectStream(project) {\n var resample = d3_geo_resample(function(x, y) {\n return project([ x * d3_degrees, y * d3_degrees ]);\n });\n return function(stream) {\n return d3_geo_projectionRadians(resample(stream));\n };\n }\n d3.geo.transform = function(methods) {\n return {\n stream: function(stream) {\n var transform = new d3_geo_transform(stream);\n for (var k in methods) transform[k] = methods[k];\n return transform;\n }\n };\n };\n function d3_geo_transform(stream) {\n this.stream = stream;\n }\n d3_geo_transform.prototype = {\n point: function(x, y) {\n this.stream.point(x, y);\n },\n sphere: function() {\n this.stream.sphere();\n },\n lineStart: function() {\n this.stream.lineStart();\n },\n lineEnd: function() {\n this.stream.lineEnd();\n },\n polygonStart: function() {\n this.stream.polygonStart();\n },\n polygonEnd: function() {\n this.stream.polygonEnd();\n }\n };\n function d3_geo_transformPoint(stream, point) {\n return {\n point: point,\n sphere: function() {\n stream.sphere();\n },\n lineStart: function() {\n stream.lineStart();\n },\n lineEnd: function() {\n stream.lineEnd();\n },\n polygonStart: function() {\n stream.polygonStart();\n },\n polygonEnd: function() {\n stream.polygonEnd();\n }\n };\n }\n d3.geo.projection = d3_geo_projection;\n d3.geo.projectionMutator = d3_geo_projectionMutator;\n function d3_geo_projection(project) {\n return d3_geo_projectionMutator(function() {\n return project;\n })();\n }\n function d3_geo_projectionMutator(projectAt) {\n var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {\n x = project(x, y);\n return [ x[0] * k + δx, δy - x[1] * k ];\n }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;\n function projection(point) {\n point = projectRotate(point[0] * d3_radians, point[1] * d3_radians);\n return [ point[0] * k + δx, δy - point[1] * k ];\n }\n function invert(point) {\n point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k);\n return point && [ point[0] * d3_degrees, point[1] * d3_degrees ];\n }\n projection.stream = function(output) {\n if (stream) stream.valid = false;\n stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));\n stream.valid = true;\n return stream;\n };\n projection.clipAngle = function(_) {\n if (!arguments.length) return clipAngle;\n preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians);\n return invalidate();\n };\n projection.clipExtent = function(_) {\n if (!arguments.length) return clipExtent;\n clipExtent = _;\n postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity;\n return invalidate();\n };\n projection.scale = function(_) {\n if (!arguments.length) return k;\n k = +_;\n return reset();\n };\n projection.translate = function(_) {\n if (!arguments.length) return [ x, y ];\n x = +_[0];\n y = +_[1];\n return reset();\n };\n projection.center = function(_) {\n if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ];\n λ = _[0] % 360 * d3_radians;\n φ = _[1] % 360 * d3_radians;\n return reset();\n };\n projection.rotate = function(_) {\n if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ];\n δλ = _[0] % 360 * d3_radians;\n δφ = _[1] % 360 * d3_radians;\n δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0;\n return reset();\n };\n d3.rebind(projection, projectResample, \"precision\");\n function reset() {\n projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project);\n var center = project(λ, φ);\n δx = x - center[0] * k;\n δy = y + center[1] * k;\n return invalidate();\n }\n function invalidate() {\n if (stream) stream.valid = false, stream = null;\n return projection;\n }\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return reset();\n };\n }\n function d3_geo_projectionRadians(stream) {\n return d3_geo_transformPoint(stream, function(x, y) {\n stream.point(x * d3_radians, y * d3_radians);\n });\n }\n function d3_geo_equirectangular(λ, φ) {\n return [ λ, φ ];\n }\n (d3.geo.equirectangular = function() {\n return d3_geo_projection(d3_geo_equirectangular);\n }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;\n d3.geo.rotation = function(rotate) {\n rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0);\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);\n return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;\n }\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians);\n return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;\n };\n return forward;\n };\n function d3_geo_identityRotation(λ, φ) {\n return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];\n }\n d3_geo_identityRotation.invert = d3_geo_equirectangular;\n function d3_geo_rotation(δλ, δφ, δγ) {\n return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;\n }\n function d3_geo_forwardRotationλ(δλ) {\n return function(λ, φ) {\n return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];\n };\n }\n function d3_geo_rotationλ(δλ) {\n var rotation = d3_geo_forwardRotationλ(δλ);\n rotation.invert = d3_geo_forwardRotationλ(-δλ);\n return rotation;\n }\n function d3_geo_rotationφγ(δφ, δγ) {\n var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);\n function rotation(λ, φ) {\n var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;\n return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];\n }\n rotation.invert = function(λ, φ) {\n var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;\n return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];\n };\n return rotation;\n }\n d3.geo.circle = function() {\n var origin = [ 0, 0 ], angle, precision = 6, interpolate;\n function circle() {\n var center = typeof origin === \"function\" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = [];\n interpolate(null, null, 1, {\n point: function(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= d3_degrees, x[1] *= d3_degrees;\n }\n });\n return {\n type: \"Polygon\",\n coordinates: [ ring ]\n };\n }\n circle.origin = function(x) {\n if (!arguments.length) return origin;\n origin = x;\n return circle;\n };\n circle.angle = function(x) {\n if (!arguments.length) return angle;\n interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians);\n return circle;\n };\n circle.precision = function(_) {\n if (!arguments.length) return precision;\n interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians);\n return circle;\n };\n return circle.angle(90);\n };\n function d3_geo_circleInterpolate(radius, precision) {\n var cr = Math.cos(radius), sr = Math.sin(radius);\n return function(from, to, direction, listener) {\n var step = direction * precision;\n if (from != null) {\n from = d3_geo_circleAngle(cr, from);\n to = d3_geo_circleAngle(cr, to);\n if (direction > 0 ? from < to : from > to) from += direction * τ;\n } else {\n from = radius + direction * τ;\n to = radius - .5 * step;\n }\n for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {\n listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]);\n }\n };\n }\n function d3_geo_circleAngle(cr, point) {\n var a = d3_geo_cartesian(point);\n a[0] -= cr;\n d3_geo_cartesianNormalize(a);\n var angle = d3_acos(-a[1]);\n return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);\n }\n d3.geo.distance = function(a, b) {\n var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;\n return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);\n };\n d3.geo.graticule = function() {\n var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;\n function graticule() {\n return {\n type: \"MultiLineString\",\n coordinates: lines()\n };\n }\n function lines() {\n return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) {\n return abs(x % DX) > ε;\n }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) {\n return abs(y % DY) > ε;\n }).map(y));\n }\n graticule.lines = function() {\n return lines().map(function(coordinates) {\n return {\n type: \"LineString\",\n coordinates: coordinates\n };\n });\n };\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ]\n };\n };\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.minorExtent();\n return graticule.majorExtent(_).minorExtent(_);\n };\n graticule.majorExtent = function(_) {\n if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n graticule.minorExtent = function(_) {\n if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n graticule.step = function(_) {\n if (!arguments.length) return graticule.minorStep();\n return graticule.majorStep(_).minorStep(_);\n };\n graticule.majorStep = function(_) {\n if (!arguments.length) return [ DX, DY ];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n graticule.minorStep = function(_) {\n if (!arguments.length) return [ dx, dy ];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = d3_geo_graticuleX(y0, y1, 90);\n y = d3_geo_graticuleY(x0, x1, precision);\n X = d3_geo_graticuleX(Y0, Y1, 90);\n Y = d3_geo_graticuleY(X0, X1, precision);\n return graticule;\n };\n return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]);\n };\n function d3_geo_graticuleX(y0, y1, dy) {\n var y = d3.range(y0, y1 - ε, dy).concat(y1);\n return function(x) {\n return y.map(function(y) {\n return [ x, y ];\n });\n };\n }\n function d3_geo_graticuleY(x0, x1, dx) {\n var x = d3.range(x0, x1 - ε, dx).concat(x1);\n return function(y) {\n return x.map(function(x) {\n return [ x, y ];\n });\n };\n }\n function d3_source(d) {\n return d.source;\n }\n function d3_target(d) {\n return d.target;\n }\n d3.geo.greatArc = function() {\n var source = d3_source, source_, target = d3_target, target_;\n function greatArc() {\n return {\n type: \"LineString\",\n coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ]\n };\n }\n greatArc.distance = function() {\n return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments));\n };\n greatArc.source = function(_) {\n if (!arguments.length) return source;\n source = _, source_ = typeof _ === \"function\" ? null : _;\n return greatArc;\n };\n greatArc.target = function(_) {\n if (!arguments.length) return target;\n target = _, target_ = typeof _ === \"function\" ? null : _;\n return greatArc;\n };\n greatArc.precision = function() {\n return arguments.length ? greatArc : 0;\n };\n return greatArc;\n };\n d3.geo.interpolate = function(source, target) {\n return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians);\n };\n function d3_geo_interpolate(x0, y0, x1, y1) {\n var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d);\n var interpolate = d ? function(t) {\n var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;\n return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ];\n } : function() {\n return [ x0 * d3_degrees, y0 * d3_degrees ];\n };\n interpolate.distance = d;\n return interpolate;\n }\n d3.geo.length = function(object) {\n d3_geo_lengthSum = 0;\n d3.geo.stream(object, d3_geo_length);\n return d3_geo_lengthSum;\n };\n var d3_geo_lengthSum;\n var d3_geo_length = {\n sphere: d3_noop,\n point: d3_noop,\n lineStart: d3_geo_lengthLineStart,\n lineEnd: d3_noop,\n polygonStart: d3_noop,\n polygonEnd: d3_noop\n };\n function d3_geo_lengthLineStart() {\n var λ0, sinφ0, cosφ0;\n d3_geo_length.point = function(λ, φ) {\n λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ);\n d3_geo_length.point = nextPoint;\n };\n d3_geo_length.lineEnd = function() {\n d3_geo_length.point = d3_geo_length.lineEnd = d3_noop;\n };\n function nextPoint(λ, φ) {\n var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t);\n d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ);\n λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ;\n }\n }\n function d3_geo_azimuthal(scale, angle) {\n function azimuthal(λ, φ) {\n var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);\n return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ];\n }\n azimuthal.invert = function(x, y) {\n var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c);\n return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ];\n };\n return azimuthal;\n }\n var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) {\n return Math.sqrt(2 / (1 + cosλcosφ));\n }, function(ρ) {\n return 2 * Math.asin(ρ / 2);\n });\n (d3.geo.azimuthalEqualArea = function() {\n return d3_geo_projection(d3_geo_azimuthalEqualArea);\n }).raw = d3_geo_azimuthalEqualArea;\n var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) {\n var c = Math.acos(cosλcosφ);\n return c && c / Math.sin(c);\n }, d3_identity);\n (d3.geo.azimuthalEquidistant = function() {\n return d3_geo_projection(d3_geo_azimuthalEquidistant);\n }).raw = d3_geo_azimuthalEquidistant;\n function d3_geo_conicConformal(φ0, φ1) {\n var cosφ0 = Math.cos(φ0), t = function(φ) {\n return Math.tan(π / 4 + φ / 2);\n }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;\n if (!n) return d3_geo_mercator;\n function forward(λ, φ) {\n if (F > 0) {\n if (φ < -halfπ + ε) φ = -halfπ + ε;\n } else {\n if (φ > halfπ - ε) φ = halfπ - ε;\n }\n var ρ = F / Math.pow(t(φ), n);\n return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];\n }\n forward.invert = function(x, y) {\n var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y);\n return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ];\n };\n return forward;\n }\n (d3.geo.conicConformal = function() {\n return d3_geo_conic(d3_geo_conicConformal);\n }).raw = d3_geo_conicConformal;\n function d3_geo_conicEquidistant(φ0, φ1) {\n var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0;\n if (abs(n) < ε) return d3_geo_equirectangular;\n function forward(λ, φ) {\n var ρ = G - φ;\n return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ];\n }\n forward.invert = function(x, y) {\n var ρ0_y = G - y;\n return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ];\n };\n return forward;\n }\n (d3.geo.conicEquidistant = function() {\n return d3_geo_conic(d3_geo_conicEquidistant);\n }).raw = d3_geo_conicEquidistant;\n var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) {\n return 1 / cosλcosφ;\n }, Math.atan);\n (d3.geo.gnomonic = function() {\n return d3_geo_projection(d3_geo_gnomonic);\n }).raw = d3_geo_gnomonic;\n function d3_geo_mercator(λ, φ) {\n return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];\n }\n d3_geo_mercator.invert = function(x, y) {\n return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];\n };\n function d3_geo_mercatorProjection(project) {\n var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;\n m.scale = function() {\n var v = scale.apply(m, arguments);\n return v === m ? clipAuto ? m.clipExtent(null) : m : v;\n };\n m.translate = function() {\n var v = translate.apply(m, arguments);\n return v === m ? clipAuto ? m.clipExtent(null) : m : v;\n };\n m.clipExtent = function(_) {\n var v = clipExtent.apply(m, arguments);\n if (v === m) {\n if (clipAuto = _ == null) {\n var k = π * scale(), t = translate();\n clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]);\n }\n } else if (clipAuto) {\n v = null;\n }\n return v;\n };\n return m.clipExtent(null);\n }\n (d3.geo.mercator = function() {\n return d3_geo_mercatorProjection(d3_geo_mercator);\n }).raw = d3_geo_mercator;\n var d3_geo_orthographic = d3_geo_azimuthal(function() {\n return 1;\n }, Math.asin);\n (d3.geo.orthographic = function() {\n return d3_geo_projection(d3_geo_orthographic);\n }).raw = d3_geo_orthographic;\n var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) {\n return 1 / (1 + cosλcosφ);\n }, function(ρ) {\n return 2 * Math.atan(ρ);\n });\n (d3.geo.stereographic = function() {\n return d3_geo_projection(d3_geo_stereographic);\n }).raw = d3_geo_stereographic;\n function d3_geo_transverseMercator(λ, φ) {\n return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ];\n }\n d3_geo_transverseMercator.invert = function(x, y) {\n return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ];\n };\n (d3.geo.transverseMercator = function() {\n var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;\n projection.center = function(_) {\n return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);\n };\n projection.rotate = function(_) {\n return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), \n [ _[0], _[1], _[2] - 90 ]);\n };\n return rotate([ 0, 0, 90 ]);\n }).raw = d3_geo_transverseMercator;\n d3.geom = {};\n function d3_geom_pointX(d) {\n return d[0];\n }\n function d3_geom_pointY(d) {\n return d[1];\n }\n d3.geom.hull = function(vertices) {\n var x = d3_geom_pointX, y = d3_geom_pointY;\n if (arguments.length) return hull(vertices);\n function hull(data) {\n if (data.length < 3) return [];\n var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = [];\n for (i = 0; i < n; i++) {\n points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]);\n }\n points.sort(d3_geom_hullOrder);\n for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]);\n var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints);\n var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = [];\n for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]);\n for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]);\n return polygon;\n }\n hull.x = function(_) {\n return arguments.length ? (x = _, hull) : x;\n };\n hull.y = function(_) {\n return arguments.length ? (y = _, hull) : y;\n };\n return hull;\n };\n function d3_geom_hullUpper(points) {\n var n = points.length, hull = [ 0, 1 ], hs = 2;\n for (var i = 2; i < n; i++) {\n while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs;\n hull[hs++] = i;\n }\n return hull.slice(0, hs);\n }\n function d3_geom_hullOrder(a, b) {\n return a[0] - b[0] || a[1] - b[1];\n }\n d3.geom.polygon = function(coordinates) {\n d3_subclass(coordinates, d3_geom_polygonPrototype);\n return coordinates;\n };\n var d3_geom_polygonPrototype = d3.geom.polygon.prototype = [];\n d3_geom_polygonPrototype.area = function() {\n var i = -1, n = this.length, a, b = this[n - 1], area = 0;\n while (++i < n) {\n a = b;\n b = this[i];\n area += a[1] * b[0] - a[0] * b[1];\n }\n return area * .5;\n };\n d3_geom_polygonPrototype.centroid = function(k) {\n var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c;\n if (!arguments.length) k = -1 / (6 * this.area());\n while (++i < n) {\n a = b;\n b = this[i];\n c = a[0] * b[1] - b[0] * a[1];\n x += (a[0] + b[0]) * c;\n y += (a[1] + b[1]) * c;\n }\n return [ x * k, y * k ];\n };\n d3_geom_polygonPrototype.clip = function(subject) {\n var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d;\n while (++i < n) {\n input = subject.slice();\n subject.length = 0;\n b = this[i];\n c = input[(m = input.length - closed) - 1];\n j = -1;\n while (++j < m) {\n d = input[j];\n if (d3_geom_polygonInside(d, a, b)) {\n if (!d3_geom_polygonInside(c, a, b)) {\n subject.push(d3_geom_polygonIntersect(c, d, a, b));\n }\n subject.push(d);\n } else if (d3_geom_polygonInside(c, a, b)) {\n subject.push(d3_geom_polygonIntersect(c, d, a, b));\n }\n c = d;\n }\n if (closed) subject.push(subject[0]);\n a = b;\n }\n return subject;\n };\n function d3_geom_polygonInside(p, a, b) {\n return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);\n }\n function d3_geom_polygonIntersect(c, d, a, b) {\n var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21);\n return [ x1 + ua * x21, y1 + ua * y21 ];\n }\n function d3_geom_polygonClosed(coordinates) {\n var a = coordinates[0], b = coordinates[coordinates.length - 1];\n return !(a[0] - b[0] || a[1] - b[1]);\n }\n var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = [];\n function d3_geom_voronoiBeach() {\n d3_geom_voronoiRedBlackNode(this);\n this.edge = this.site = this.circle = null;\n }\n function d3_geom_voronoiCreateBeach(site) {\n var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach();\n beach.site = site;\n return beach;\n }\n function d3_geom_voronoiDetachBeach(beach) {\n d3_geom_voronoiDetachCircle(beach);\n d3_geom_voronoiBeaches.remove(beach);\n d3_geom_voronoiBeachPool.push(beach);\n d3_geom_voronoiRedBlackNode(beach);\n }\n function d3_geom_voronoiRemoveBeach(beach) {\n var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {\n x: x,\n y: y\n }, previous = beach.P, next = beach.N, disappearing = [ beach ];\n d3_geom_voronoiDetachBeach(beach);\n var lArc = previous;\n while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {\n previous = lArc.P;\n disappearing.unshift(lArc);\n d3_geom_voronoiDetachBeach(lArc);\n lArc = previous;\n }\n disappearing.unshift(lArc);\n d3_geom_voronoiDetachCircle(lArc);\n var rArc = next;\n while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {\n next = rArc.N;\n disappearing.push(rArc);\n d3_geom_voronoiDetachBeach(rArc);\n rArc = next;\n }\n disappearing.push(rArc);\n d3_geom_voronoiDetachCircle(rArc);\n var nArcs = disappearing.length, iArc;\n for (iArc = 1; iArc < nArcs; ++iArc) {\n rArc = disappearing[iArc];\n lArc = disappearing[iArc - 1];\n d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);\n }\n lArc = disappearing[0];\n rArc = disappearing[nArcs - 1];\n rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex);\n d3_geom_voronoiAttachCircle(lArc);\n d3_geom_voronoiAttachCircle(rArc);\n }\n function d3_geom_voronoiAddBeach(site) {\n var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._;\n while (node) {\n dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x;\n if (dxl > ε) node = node.L; else {\n dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix);\n if (dxr > ε) {\n if (!node.R) {\n lArc = node;\n break;\n }\n node = node.R;\n } else {\n if (dxl > -ε) {\n lArc = node.P;\n rArc = node;\n } else if (dxr > -ε) {\n lArc = node;\n rArc = node.N;\n } else {\n lArc = rArc = node;\n }\n break;\n }\n }\n }\n var newArc = d3_geom_voronoiCreateBeach(site);\n d3_geom_voronoiBeaches.insert(lArc, newArc);\n if (!lArc && !rArc) return;\n if (lArc === rArc) {\n d3_geom_voronoiDetachCircle(lArc);\n rArc = d3_geom_voronoiCreateBeach(lArc.site);\n d3_geom_voronoiBeaches.insert(newArc, rArc);\n newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);\n d3_geom_voronoiAttachCircle(lArc);\n d3_geom_voronoiAttachCircle(rArc);\n return;\n }\n if (!rArc) {\n newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);\n return;\n }\n d3_geom_voronoiDetachCircle(lArc);\n d3_geom_voronoiDetachCircle(rArc);\n var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = {\n x: (cy * hb - by * hc) / d + ax,\n y: (bx * hc - cx * hb) / d + ay\n };\n d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex);\n newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex);\n rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex);\n d3_geom_voronoiAttachCircle(lArc);\n d3_geom_voronoiAttachCircle(rArc);\n }\n function d3_geom_voronoiLeftBreakPoint(arc, directrix) {\n var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix;\n if (!pby2) return rfocx;\n var lArc = arc.P;\n if (!lArc) return -Infinity;\n site = lArc.site;\n var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix;\n if (!plby2) return lfocx;\n var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2;\n if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;\n return (rfocx + lfocx) / 2;\n }\n function d3_geom_voronoiRightBreakPoint(arc, directrix) {\n var rArc = arc.N;\n if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix);\n var site = arc.site;\n return site.y === directrix ? site.x : Infinity;\n }\n function d3_geom_voronoiCell(site) {\n this.site = site;\n this.edges = [];\n }\n d3_geom_voronoiCell.prototype.prepare = function() {\n var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge;\n while (iHalfEdge--) {\n edge = halfEdges[iHalfEdge].edge;\n if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1);\n }\n halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);\n return halfEdges.length;\n };\n function d3_geom_voronoiCloseCells(extent) {\n var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end;\n while (iCell--) {\n cell = cells[iCell];\n if (!cell || !cell.prepare()) continue;\n halfEdges = cell.edges;\n nHalfEdges = halfEdges.length;\n iHalfEdge = 0;\n while (iHalfEdge < nHalfEdges) {\n end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y;\n start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y;\n if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {\n halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {\n x: x0,\n y: abs(x2 - x0) < ε ? y2 : y1\n } : abs(y3 - y1) < ε && x1 - x3 > ε ? {\n x: abs(y2 - y1) < ε ? x2 : x1,\n y: y1\n } : abs(x3 - x1) < ε && y3 - y0 > ε ? {\n x: x1,\n y: abs(x2 - x1) < ε ? y2 : y0\n } : abs(y3 - y0) < ε && x3 - x0 > ε ? {\n x: abs(y2 - y0) < ε ? x2 : x0,\n y: y0\n } : null), cell.site, null));\n ++nHalfEdges;\n }\n }\n }\n }\n function d3_geom_voronoiHalfEdgeOrder(a, b) {\n return b.angle - a.angle;\n }\n function d3_geom_voronoiCircle() {\n d3_geom_voronoiRedBlackNode(this);\n this.x = this.y = this.arc = this.site = this.cy = null;\n }\n function d3_geom_voronoiAttachCircle(arc) {\n var lArc = arc.P, rArc = arc.N;\n if (!lArc || !rArc) return;\n var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;\n if (lSite === rSite) return;\n var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by;\n var d = 2 * (ax * cy - ay * cx);\n if (d >= -ε2) return;\n var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by;\n var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle();\n circle.arc = arc;\n circle.site = cSite;\n circle.x = x + bx;\n circle.y = cy + Math.sqrt(x * x + y * y);\n circle.cy = cy;\n arc.circle = circle;\n var before = null, node = d3_geom_voronoiCircles._;\n while (node) {\n if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) {\n if (node.L) node = node.L; else {\n before = node.P;\n break;\n }\n } else {\n if (node.R) node = node.R; else {\n before = node;\n break;\n }\n }\n }\n d3_geom_voronoiCircles.insert(before, circle);\n if (!before) d3_geom_voronoiFirstCircle = circle;\n }\n function d3_geom_voronoiDetachCircle(arc) {\n var circle = arc.circle;\n if (circle) {\n if (!circle.P) d3_geom_voronoiFirstCircle = circle.N;\n d3_geom_voronoiCircles.remove(circle);\n d3_geom_voronoiCirclePool.push(circle);\n d3_geom_voronoiRedBlackNode(circle);\n arc.circle = null;\n }\n }\n function d3_geom_voronoiClipEdges(extent) {\n var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e;\n while (i--) {\n e = edges[i];\n if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) {\n e.a = e.b = null;\n edges.splice(i, 1);\n }\n }\n }\n function d3_geom_voronoiConnectEdge(edge, extent) {\n var vb = edge.b;\n if (vb) return true;\n var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;\n if (ry === ly) {\n if (fx < x0 || fx >= x1) return;\n if (lx > rx) {\n if (!va) va = {\n x: fx,\n y: y0\n }; else if (va.y >= y1) return;\n vb = {\n x: fx,\n y: y1\n };\n } else {\n if (!va) va = {\n x: fx,\n y: y1\n }; else if (va.y < y0) return;\n vb = {\n x: fx,\n y: y0\n };\n }\n } else {\n fm = (lx - rx) / (ry - ly);\n fb = fy - fm * fx;\n if (fm < -1 || fm > 1) {\n if (lx > rx) {\n if (!va) va = {\n x: (y0 - fb) / fm,\n y: y0\n }; else if (va.y >= y1) return;\n vb = {\n x: (y1 - fb) / fm,\n y: y1\n };\n } else {\n if (!va) va = {\n x: (y1 - fb) / fm,\n y: y1\n }; else if (va.y < y0) return;\n vb = {\n x: (y0 - fb) / fm,\n y: y0\n };\n }\n } else {\n if (ly < ry) {\n if (!va) va = {\n x: x0,\n y: fm * x0 + fb\n }; else if (va.x >= x1) return;\n vb = {\n x: x1,\n y: fm * x1 + fb\n };\n } else {\n if (!va) va = {\n x: x1,\n y: fm * x1 + fb\n }; else if (va.x < x0) return;\n vb = {\n x: x0,\n y: fm * x0 + fb\n };\n }\n }\n }\n edge.a = va;\n edge.b = vb;\n return true;\n }\n function d3_geom_voronoiEdge(lSite, rSite) {\n this.l = lSite;\n this.r = rSite;\n this.a = this.b = null;\n }\n function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) {\n var edge = new d3_geom_voronoiEdge(lSite, rSite);\n d3_geom_voronoiEdges.push(edge);\n if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va);\n if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb);\n d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite));\n d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite));\n return edge;\n }\n function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) {\n var edge = new d3_geom_voronoiEdge(lSite, null);\n edge.a = va;\n edge.b = vb;\n d3_geom_voronoiEdges.push(edge);\n return edge;\n }\n function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) {\n if (!edge.a && !edge.b) {\n edge.a = vertex;\n edge.l = lSite;\n edge.r = rSite;\n } else if (edge.l === rSite) {\n edge.b = vertex;\n } else {\n edge.a = vertex;\n }\n }\n function d3_geom_voronoiHalfEdge(edge, lSite, rSite) {\n var va = edge.a, vb = edge.b;\n this.edge = edge;\n this.site = lSite;\n this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y);\n }\n d3_geom_voronoiHalfEdge.prototype = {\n start: function() {\n return this.edge.l === this.site ? this.edge.a : this.edge.b;\n },\n end: function() {\n return this.edge.l === this.site ? this.edge.b : this.edge.a;\n }\n };\n function d3_geom_voronoiRedBlackTree() {\n this._ = null;\n }\n function d3_geom_voronoiRedBlackNode(node) {\n node.U = node.C = node.L = node.R = node.P = node.N = null;\n }\n d3_geom_voronoiRedBlackTree.prototype = {\n insert: function(after, node) {\n var parent, grandpa, uncle;\n if (after) {\n node.P = after;\n node.N = after.N;\n if (after.N) after.N.P = node;\n after.N = node;\n if (after.R) {\n after = after.R;\n while (after.L) after = after.L;\n after.L = node;\n } else {\n after.R = node;\n }\n parent = after;\n } else if (this._) {\n after = d3_geom_voronoiRedBlackFirst(this._);\n node.P = null;\n node.N = after;\n after.P = after.L = node;\n parent = after;\n } else {\n node.P = node.N = null;\n this._ = node;\n parent = null;\n }\n node.L = node.R = null;\n node.U = parent;\n node.C = true;\n after = node;\n while (parent && parent.C) {\n grandpa = parent.U;\n if (parent === grandpa.L) {\n uncle = grandpa.R;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.R) {\n d3_geom_voronoiRedBlackRotateLeft(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n d3_geom_voronoiRedBlackRotateRight(this, grandpa);\n }\n } else {\n uncle = grandpa.L;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.L) {\n d3_geom_voronoiRedBlackRotateRight(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n d3_geom_voronoiRedBlackRotateLeft(this, grandpa);\n }\n }\n parent = after.U;\n }\n this._.C = false;\n },\n remove: function(node) {\n if (node.N) node.N.P = node.P;\n if (node.P) node.P.N = node.N;\n node.N = node.P = null;\n var parent = node.U, sibling, left = node.L, right = node.R, next, red;\n if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right);\n if (parent) {\n if (parent.L === node) parent.L = next; else parent.R = next;\n } else {\n this._ = next;\n }\n if (left && right) {\n red = next.C;\n next.C = node.C;\n next.L = left;\n left.U = next;\n if (next !== right) {\n parent = next.U;\n next.U = node.U;\n node = next.R;\n parent.L = node;\n next.R = right;\n right.U = next;\n } else {\n next.U = parent;\n parent = next;\n node = next.R;\n }\n } else {\n red = node.C;\n node = next;\n }\n if (node) node.U = parent;\n if (red) return;\n if (node && node.C) {\n node.C = false;\n return;\n }\n do {\n if (node === this._) break;\n if (node === parent.L) {\n sibling = parent.R;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n d3_geom_voronoiRedBlackRotateLeft(this, parent);\n sibling = parent.R;\n }\n if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {\n if (!sibling.R || !sibling.R.C) {\n sibling.L.C = false;\n sibling.C = true;\n d3_geom_voronoiRedBlackRotateRight(this, sibling);\n sibling = parent.R;\n }\n sibling.C = parent.C;\n parent.C = sibling.R.C = false;\n d3_geom_voronoiRedBlackRotateLeft(this, parent);\n node = this._;\n break;\n }\n } else {\n sibling = parent.L;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n d3_geom_voronoiRedBlackRotateRight(this, parent);\n sibling = parent.L;\n }\n if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {\n if (!sibling.L || !sibling.L.C) {\n sibling.R.C = false;\n sibling.C = true;\n d3_geom_voronoiRedBlackRotateLeft(this, sibling);\n sibling = parent.L;\n }\n sibling.C = parent.C;\n parent.C = sibling.L.C = false;\n d3_geom_voronoiRedBlackRotateRight(this, parent);\n node = this._;\n break;\n }\n }\n sibling.C = true;\n node = parent;\n parent = parent.U;\n } while (!node.C);\n if (node) node.C = false;\n }\n };\n function d3_geom_voronoiRedBlackRotateLeft(tree, node) {\n var p = node, q = node.R, parent = p.U;\n if (parent) {\n if (parent.L === p) parent.L = q; else parent.R = q;\n } else {\n tree._ = q;\n }\n q.U = parent;\n p.U = q;\n p.R = q.L;\n if (p.R) p.R.U = p;\n q.L = p;\n }\n function d3_geom_voronoiRedBlackRotateRight(tree, node) {\n var p = node, q = node.L, parent = p.U;\n if (parent) {\n if (parent.L === p) parent.L = q; else parent.R = q;\n } else {\n tree._ = q;\n }\n q.U = parent;\n p.U = q;\n p.L = q.R;\n if (p.L) p.L.U = p;\n q.R = p;\n }\n function d3_geom_voronoiRedBlackFirst(node) {\n while (node.L) node = node.L;\n return node;\n }\n function d3_geom_voronoi(sites, bbox) {\n var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;\n d3_geom_voronoiEdges = [];\n d3_geom_voronoiCells = new Array(sites.length);\n d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();\n d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree();\n while (true) {\n circle = d3_geom_voronoiFirstCircle;\n if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) {\n if (site.x !== x0 || site.y !== y0) {\n d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site);\n d3_geom_voronoiAddBeach(site);\n x0 = site.x, y0 = site.y;\n }\n site = sites.pop();\n } else if (circle) {\n d3_geom_voronoiRemoveBeach(circle.arc);\n } else {\n break;\n }\n }\n if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox);\n var diagram = {\n cells: d3_geom_voronoiCells,\n edges: d3_geom_voronoiEdges\n };\n d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null;\n return diagram;\n }\n function d3_geom_voronoiVertexOrder(a, b) {\n return b.y - a.y || b.x - a.x;\n }\n d3.geom.voronoi = function(points) {\n var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;\n if (points) return voronoi(points);\n function voronoi(data) {\n var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];\n d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) {\n var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) {\n var s = e.start();\n return [ s.x, s.y ];\n }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : [];\n polygon.point = data[i];\n });\n return polygons;\n }\n function sites(data) {\n return data.map(function(d, i) {\n return {\n x: Math.round(fx(d, i) / ε) * ε,\n y: Math.round(fy(d, i) / ε) * ε,\n i: i\n };\n });\n }\n voronoi.links = function(data) {\n return d3_geom_voronoi(sites(data)).edges.filter(function(edge) {\n return edge.l && edge.r;\n }).map(function(edge) {\n return {\n source: data[edge.l.i],\n target: data[edge.r.i]\n };\n });\n };\n voronoi.triangles = function(data) {\n var triangles = [];\n d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) {\n var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l;\n while (++j < m) {\n e0 = e1;\n s0 = s1;\n e1 = edges[j].edge;\n s1 = e1.l === site ? e1.r : e1.l;\n if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) {\n triangles.push([ data[i], data[s0.i], data[s1.i] ]);\n }\n }\n });\n return triangles;\n };\n voronoi.x = function(_) {\n return arguments.length ? (fx = d3_functor(x = _), voronoi) : x;\n };\n voronoi.y = function(_) {\n return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;\n };\n voronoi.clipExtent = function(_) {\n if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent;\n clipExtent = _ == null ? d3_geom_voronoiClipExtent : _;\n return voronoi;\n };\n voronoi.size = function(_) {\n if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1];\n return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]);\n };\n return voronoi;\n };\n var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ];\n function d3_geom_voronoiTriangleArea(a, b, c) {\n return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y);\n }\n d3.geom.delaunay = function(vertices) {\n return d3.geom.voronoi().triangles(vertices);\n };\n d3.geom.quadtree = function(points, x1, y1, x2, y2) {\n var x = d3_geom_pointX, y = d3_geom_pointY, compat;\n if (compat = arguments.length) {\n x = d3_geom_quadtreeCompatX;\n y = d3_geom_quadtreeCompatY;\n if (compat === 3) {\n y2 = y1;\n x2 = x1;\n y1 = x1 = 0;\n }\n return quadtree(points);\n }\n function quadtree(data) {\n var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;\n if (x1 != null) {\n x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;\n } else {\n x2_ = y2_ = -(x1_ = y1_ = Infinity);\n xs = [], ys = [];\n n = data.length;\n if (compat) for (i = 0; i < n; ++i) {\n d = data[i];\n if (d.x < x1_) x1_ = d.x;\n if (d.y < y1_) y1_ = d.y;\n if (d.x > x2_) x2_ = d.x;\n if (d.y > y2_) y2_ = d.y;\n xs.push(d.x);\n ys.push(d.y);\n } else for (i = 0; i < n; ++i) {\n var x_ = +fx(d = data[i], i), y_ = +fy(d, i);\n if (x_ < x1_) x1_ = x_;\n if (y_ < y1_) y1_ = y_;\n if (x_ > x2_) x2_ = x_;\n if (y_ > y2_) y2_ = y_;\n xs.push(x_);\n ys.push(y_);\n }\n }\n var dx = x2_ - x1_, dy = y2_ - y1_;\n if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy;\n function insert(n, d, x, y, x1, y1, x2, y2) {\n if (isNaN(x) || isNaN(y)) return;\n if (n.leaf) {\n var nx = n.x, ny = n.y;\n if (nx != null) {\n if (abs(nx - x) + abs(ny - y) < .01) {\n insertChild(n, d, x, y, x1, y1, x2, y2);\n } else {\n var nPoint = n.point;\n n.x = n.y = n.point = null;\n insertChild(n, nPoint, nx, ny, x1, y1, x2, y2);\n insertChild(n, d, x, y, x1, y1, x2, y2);\n }\n } else {\n n.x = x, n.y = y, n.point = d;\n }\n } else {\n insertChild(n, d, x, y, x1, y1, x2, y2);\n }\n }\n function insertChild(n, d, x, y, x1, y1, x2, y2) {\n var xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym, i = below << 1 | right;\n n.leaf = false;\n n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());\n if (right) x1 = xm; else x2 = xm;\n if (below) y1 = ym; else y2 = ym;\n insert(n, d, x, y, x1, y1, x2, y2);\n }\n var root = d3_geom_quadtreeNode();\n root.add = function(d) {\n insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);\n };\n root.visit = function(f) {\n d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_);\n };\n root.find = function(point) {\n return d3_geom_quadtreeFind(root, point[0], point[1], x1_, y1_, x2_, y2_);\n };\n i = -1;\n if (x1 == null) {\n while (++i < n) {\n insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_);\n }\n --i;\n } else data.forEach(root.add);\n xs = ys = data = d = null;\n return root;\n }\n quadtree.x = function(_) {\n return arguments.length ? (x = _, quadtree) : x;\n };\n quadtree.y = function(_) {\n return arguments.length ? (y = _, quadtree) : y;\n };\n quadtree.extent = function(_) {\n if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];\n if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], \n y2 = +_[1][1];\n return quadtree;\n };\n quadtree.size = function(_) {\n if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ];\n if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1];\n return quadtree;\n };\n return quadtree;\n };\n function d3_geom_quadtreeCompatX(d) {\n return d.x;\n }\n function d3_geom_quadtreeCompatY(d) {\n return d.y;\n }\n function d3_geom_quadtreeNode() {\n return {\n leaf: true,\n nodes: [],\n point: null,\n x: null,\n y: null\n };\n }\n function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {\n if (!f(node, x1, y1, x2, y2)) {\n var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes;\n if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);\n if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);\n if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);\n if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);\n }\n }\n function d3_geom_quadtreeFind(root, x, y, x0, y0, x3, y3) {\n var minDistance2 = Infinity, closestPoint;\n (function find(node, x1, y1, x2, y2) {\n if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return;\n if (point = node.point) {\n var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy;\n if (distance2 < minDistance2) {\n var distance = Math.sqrt(minDistance2 = distance2);\n x0 = x - distance, y0 = y - distance;\n x3 = x + distance, y3 = y + distance;\n closestPoint = point;\n }\n }\n var children = node.nodes, xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym;\n for (var i = below << 1 | right, j = i + 4; i < j; ++i) {\n if (node = children[i & 3]) switch (i & 3) {\n case 0:\n find(node, x1, y1, xm, ym);\n break;\n\n case 1:\n find(node, xm, y1, x2, ym);\n break;\n\n case 2:\n find(node, x1, ym, xm, y2);\n break;\n\n case 3:\n find(node, xm, ym, x2, y2);\n break;\n }\n }\n })(root, x0, y0, x3, y3);\n return closestPoint;\n }\n d3.interpolateRgb = d3_interpolateRgb;\n function d3_interpolateRgb(a, b) {\n a = d3.rgb(a);\n b = d3.rgb(b);\n var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab;\n return function(t) {\n return \"#\" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t));\n };\n }\n d3.interpolateObject = d3_interpolateObject;\n function d3_interpolateObject(a, b) {\n var i = {}, c = {}, k;\n for (k in a) {\n if (k in b) {\n i[k] = d3_interpolate(a[k], b[k]);\n } else {\n c[k] = a[k];\n }\n }\n for (k in b) {\n if (!(k in a)) {\n c[k] = b[k];\n }\n }\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n }\n d3.interpolateNumber = d3_interpolateNumber;\n function d3_interpolateNumber(a, b) {\n a = +a, b = +b;\n return function(t) {\n return a * (1 - t) + b * t;\n };\n }\n d3.interpolateString = d3_interpolateString;\n function d3_interpolateString(a, b) {\n var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];\n a = a + \"\", b = b + \"\";\n while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {\n if ((bs = bm.index) > bi) {\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) {\n if (s[i]) s[i] += bm; else s[++i] = bm;\n } else {\n s[++i] = null;\n q.push({\n i: i,\n x: d3_interpolateNumber(am, bm)\n });\n }\n bi = d3_interpolate_numberB.lastIndex;\n }\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; else s[++i] = bs;\n }\n return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {\n return b(t) + \"\";\n }) : function() {\n return b;\n } : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n }\n var d3_interpolate_numberA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, \"g\");\n d3.interpolate = d3_interpolate;\n function d3_interpolate(a, b) {\n var i = d3.interpolators.length, f;\n while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ;\n return f;\n }\n d3.interpolators = [ function(a, b) {\n var t = typeof b;\n return (t === \"string\" ? d3_rgb_names.has(b.toLowerCase()) || /^(#|rgb\\(|hsl\\()/i.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === \"object\" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);\n } ];\n d3.interpolateArray = d3_interpolateArray;\n function d3_interpolateArray(a, b) {\n var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i;\n for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));\n for (;i < na; ++i) c[i] = a[i];\n for (;i < nb; ++i) c[i] = b[i];\n return function(t) {\n for (i = 0; i < n0; ++i) c[i] = x[i](t);\n return c;\n };\n }\n var d3_ease_default = function() {\n return d3_identity;\n };\n var d3_ease = d3.map({\n linear: d3_ease_default,\n poly: d3_ease_poly,\n quad: function() {\n return d3_ease_quad;\n },\n cubic: function() {\n return d3_ease_cubic;\n },\n sin: function() {\n return d3_ease_sin;\n },\n exp: function() {\n return d3_ease_exp;\n },\n circle: function() {\n return d3_ease_circle;\n },\n elastic: d3_ease_elastic,\n back: d3_ease_back,\n bounce: function() {\n return d3_ease_bounce;\n }\n });\n var d3_ease_mode = d3.map({\n \"in\": d3_identity,\n out: d3_ease_reverse,\n \"in-out\": d3_ease_reflect,\n \"out-in\": function(f) {\n return d3_ease_reflect(d3_ease_reverse(f));\n }\n });\n d3.ease = function(name) {\n var i = name.indexOf(\"-\"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : \"in\";\n t = d3_ease.get(t) || d3_ease_default;\n m = d3_ease_mode.get(m) || d3_identity;\n return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));\n };\n function d3_ease_clamp(f) {\n return function(t) {\n return t <= 0 ? 0 : t >= 1 ? 1 : f(t);\n };\n }\n function d3_ease_reverse(f) {\n return function(t) {\n return 1 - f(1 - t);\n };\n }\n function d3_ease_reflect(f) {\n return function(t) {\n return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t));\n };\n }\n function d3_ease_quad(t) {\n return t * t;\n }\n function d3_ease_cubic(t) {\n return t * t * t;\n }\n function d3_ease_cubicInOut(t) {\n if (t <= 0) return 0;\n if (t >= 1) return 1;\n var t2 = t * t, t3 = t2 * t;\n return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);\n }\n function d3_ease_poly(e) {\n return function(t) {\n return Math.pow(t, e);\n };\n }\n function d3_ease_sin(t) {\n return 1 - Math.cos(t * halfπ);\n }\n function d3_ease_exp(t) {\n return Math.pow(2, 10 * (t - 1));\n }\n function d3_ease_circle(t) {\n return 1 - Math.sqrt(1 - t * t);\n }\n function d3_ease_elastic(a, p) {\n var s;\n if (arguments.length < 2) p = .45;\n if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4;\n return function(t) {\n return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p);\n };\n }\n function d3_ease_back(s) {\n if (!s) s = 1.70158;\n return function(t) {\n return t * t * ((s + 1) * t - s);\n };\n }\n function d3_ease_bounce(t) {\n return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;\n }\n d3.interpolateHcl = d3_interpolateHcl;\n function d3_interpolateHcl(a, b) {\n a = d3.hcl(a);\n b = d3.hcl(b);\n var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al;\n if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;\n if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;\n return function(t) {\n return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + \"\";\n };\n }\n d3.interpolateHsl = d3_interpolateHsl;\n function d3_interpolateHsl(a, b) {\n a = d3.hsl(a);\n b = d3.hsl(b);\n var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al;\n if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;\n if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;\n return function(t) {\n return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + \"\";\n };\n }\n d3.interpolateLab = d3_interpolateLab;\n function d3_interpolateLab(a, b) {\n a = d3.lab(a);\n b = d3.lab(b);\n var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab;\n return function(t) {\n return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + \"\";\n };\n }\n d3.interpolateRound = d3_interpolateRound;\n function d3_interpolateRound(a, b) {\n b -= a;\n return function(t) {\n return Math.round(a + b * t);\n };\n }\n d3.transform = function(string) {\n var g = d3_document.createElementNS(d3.ns.prefix.svg, \"g\");\n return (d3.transform = function(string) {\n if (string != null) {\n g.setAttribute(\"transform\", string);\n var t = g.transform.baseVal.consolidate();\n }\n return new d3_transform(t ? t.matrix : d3_transformIdentity);\n })(string);\n };\n function d3_transform(m) {\n var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;\n if (r0[0] * r1[1] < r1[0] * r0[1]) {\n r0[0] *= -1;\n r0[1] *= -1;\n kx *= -1;\n kz *= -1;\n }\n this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees;\n this.translate = [ m.e, m.f ];\n this.scale = [ kx, ky ];\n this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0;\n }\n d3_transform.prototype.toString = function() {\n return \"translate(\" + this.translate + \")rotate(\" + this.rotate + \")skewX(\" + this.skew + \")scale(\" + this.scale + \")\";\n };\n function d3_transformDot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n function d3_transformNormalize(a) {\n var k = Math.sqrt(d3_transformDot(a, a));\n if (k) {\n a[0] /= k;\n a[1] /= k;\n }\n return k;\n }\n function d3_transformCombine(a, b, k) {\n a[0] += k * b[0];\n a[1] += k * b[1];\n return a;\n }\n var d3_transformIdentity = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: 0,\n f: 0\n };\n d3.interpolateTransform = d3_interpolateTransform;\n function d3_interpolateTransformPop(s) {\n return s.length ? s.pop() + \",\" : \"\";\n }\n function d3_interpolateTranslate(ta, tb, s, q) {\n if (ta[0] !== tb[0] || ta[1] !== tb[1]) {\n var i = s.push(\"translate(\", null, \",\", null, \")\");\n q.push({\n i: i - 4,\n x: d3_interpolateNumber(ta[0], tb[0])\n }, {\n i: i - 2,\n x: d3_interpolateNumber(ta[1], tb[1])\n });\n } else if (tb[0] || tb[1]) {\n s.push(\"translate(\" + tb + \")\");\n }\n }\n function d3_interpolateRotate(ra, rb, s, q) {\n if (ra !== rb) {\n if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;\n q.push({\n i: s.push(d3_interpolateTransformPop(s) + \"rotate(\", null, \")\") - 2,\n x: d3_interpolateNumber(ra, rb)\n });\n } else if (rb) {\n s.push(d3_interpolateTransformPop(s) + \"rotate(\" + rb + \")\");\n }\n }\n function d3_interpolateSkew(wa, wb, s, q) {\n if (wa !== wb) {\n q.push({\n i: s.push(d3_interpolateTransformPop(s) + \"skewX(\", null, \")\") - 2,\n x: d3_interpolateNumber(wa, wb)\n });\n } else if (wb) {\n s.push(d3_interpolateTransformPop(s) + \"skewX(\" + wb + \")\");\n }\n }\n function d3_interpolateScale(ka, kb, s, q) {\n if (ka[0] !== kb[0] || ka[1] !== kb[1]) {\n var i = s.push(d3_interpolateTransformPop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({\n i: i - 4,\n x: d3_interpolateNumber(ka[0], kb[0])\n }, {\n i: i - 2,\n x: d3_interpolateNumber(ka[1], kb[1])\n });\n } else if (kb[0] !== 1 || kb[1] !== 1) {\n s.push(d3_interpolateTransformPop(s) + \"scale(\" + kb + \")\");\n }\n }\n function d3_interpolateTransform(a, b) {\n var s = [], q = [];\n a = d3.transform(a), b = d3.transform(b);\n d3_interpolateTranslate(a.translate, b.translate, s, q);\n d3_interpolateRotate(a.rotate, b.rotate, s, q);\n d3_interpolateSkew(a.skew, b.skew, s, q);\n d3_interpolateScale(a.scale, b.scale, s, q);\n a = b = null;\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n }\n function d3_uninterpolateNumber(a, b) {\n b = (b -= a = +a) || 1 / b;\n return function(x) {\n return (x - a) / b;\n };\n }\n function d3_uninterpolateClamp(a, b) {\n b = (b -= a = +a) || 1 / b;\n return function(x) {\n return Math.max(0, Math.min(1, (x - a) / b));\n };\n }\n d3.layout = {};\n d3.layout.bundle = function() {\n return function(links) {\n var paths = [], i = -1, n = links.length;\n while (++i < n) paths.push(d3_layout_bundlePath(links[i]));\n return paths;\n };\n };\n function d3_layout_bundlePath(link) {\n var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ];\n while (start !== lca) {\n start = start.parent;\n points.push(start);\n }\n var k = points.length;\n while (end !== lca) {\n points.splice(k, 0, end);\n end = end.parent;\n }\n return points;\n }\n function d3_layout_bundleAncestors(node) {\n var ancestors = [], parent = node.parent;\n while (parent != null) {\n ancestors.push(node);\n node = parent;\n parent = parent.parent;\n }\n ancestors.push(node);\n return ancestors;\n }\n function d3_layout_bundleLeastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null;\n while (aNode === bNode) {\n sharedNode = aNode;\n aNode = aNodes.pop();\n bNode = bNodes.pop();\n }\n return sharedNode;\n }\n d3.layout.chord = function() {\n var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;\n function relayout() {\n var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;\n chords = [];\n groups = [];\n k = 0, i = -1;\n while (++i < n) {\n x = 0, j = -1;\n while (++j < n) {\n x += matrix[i][j];\n }\n groupSums.push(x);\n subgroupIndex.push(d3.range(n));\n k += x;\n }\n if (sortGroups) {\n groupIndex.sort(function(a, b) {\n return sortGroups(groupSums[a], groupSums[b]);\n });\n }\n if (sortSubgroups) {\n subgroupIndex.forEach(function(d, i) {\n d.sort(function(a, b) {\n return sortSubgroups(matrix[i][a], matrix[i][b]);\n });\n });\n }\n k = (τ - padding * n) / k;\n x = 0, i = -1;\n while (++i < n) {\n x0 = x, j = -1;\n while (++j < n) {\n var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;\n subgroups[di + \"-\" + dj] = {\n index: di,\n subindex: dj,\n startAngle: a0,\n endAngle: a1,\n value: v\n };\n }\n groups[di] = {\n index: di,\n startAngle: x0,\n endAngle: x,\n value: groupSums[di]\n };\n x += padding;\n }\n i = -1;\n while (++i < n) {\n j = i - 1;\n while (++j < n) {\n var source = subgroups[i + \"-\" + j], target = subgroups[j + \"-\" + i];\n if (source.value || target.value) {\n chords.push(source.value < target.value ? {\n source: target,\n target: source\n } : {\n source: source,\n target: target\n });\n }\n }\n }\n if (sortChords) resort();\n }\n function resort() {\n chords.sort(function(a, b) {\n return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2);\n });\n }\n chord.matrix = function(x) {\n if (!arguments.length) return matrix;\n n = (matrix = x) && matrix.length;\n chords = groups = null;\n return chord;\n };\n chord.padding = function(x) {\n if (!arguments.length) return padding;\n padding = x;\n chords = groups = null;\n return chord;\n };\n chord.sortGroups = function(x) {\n if (!arguments.length) return sortGroups;\n sortGroups = x;\n chords = groups = null;\n return chord;\n };\n chord.sortSubgroups = function(x) {\n if (!arguments.length) return sortSubgroups;\n sortSubgroups = x;\n chords = null;\n return chord;\n };\n chord.sortChords = function(x) {\n if (!arguments.length) return sortChords;\n sortChords = x;\n if (chords) resort();\n return chord;\n };\n chord.chords = function() {\n if (!chords) relayout();\n return chords;\n };\n chord.groups = function() {\n if (!groups) relayout();\n return groups;\n };\n return chord;\n };\n d3.layout.force = function() {\n var force = {}, event = d3.dispatch(\"start\", \"tick\", \"end\"), timer, size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;\n function repulse(node) {\n return function(quad, x1, _, x2) {\n if (quad.point !== node) {\n var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy;\n if (dw * dw / theta2 < dn) {\n if (dn < chargeDistance2) {\n var k = quad.charge / dn;\n node.px -= dx * k;\n node.py -= dy * k;\n }\n return true;\n }\n if (quad.point && dn && dn < chargeDistance2) {\n var k = quad.pointCharge / dn;\n node.px -= dx * k;\n node.py -= dy * k;\n }\n }\n return !quad.charge;\n };\n }\n force.tick = function() {\n if ((alpha *= .99) < .005) {\n timer = null;\n event.end({\n type: \"end\",\n alpha: alpha = 0\n });\n return true;\n }\n var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y;\n for (i = 0; i < m; ++i) {\n o = links[i];\n s = o.source;\n t = o.target;\n x = t.x - s.x;\n y = t.y - s.y;\n if (l = x * x + y * y) {\n l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;\n x *= l;\n y *= l;\n t.x -= x * (k = s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5);\n t.y -= y * k;\n s.x += x * (k = 1 - k);\n s.y += y * k;\n }\n }\n if (k = alpha * gravity) {\n x = size[0] / 2;\n y = size[1] / 2;\n i = -1;\n if (k) while (++i < n) {\n o = nodes[i];\n o.x += (x - o.x) * k;\n o.y += (y - o.y) * k;\n }\n }\n if (charge) {\n d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);\n i = -1;\n while (++i < n) {\n if (!(o = nodes[i]).fixed) {\n q.visit(repulse(o));\n }\n }\n }\n i = -1;\n while (++i < n) {\n o = nodes[i];\n if (o.fixed) {\n o.x = o.px;\n o.y = o.py;\n } else {\n o.x -= (o.px - (o.px = o.x)) * friction;\n o.y -= (o.py - (o.py = o.y)) * friction;\n }\n }\n event.tick({\n type: \"tick\",\n alpha: alpha\n });\n };\n force.nodes = function(x) {\n if (!arguments.length) return nodes;\n nodes = x;\n return force;\n };\n force.links = function(x) {\n if (!arguments.length) return links;\n links = x;\n return force;\n };\n force.size = function(x) {\n if (!arguments.length) return size;\n size = x;\n return force;\n };\n force.linkDistance = function(x) {\n if (!arguments.length) return linkDistance;\n linkDistance = typeof x === \"function\" ? x : +x;\n return force;\n };\n force.distance = force.linkDistance;\n force.linkStrength = function(x) {\n if (!arguments.length) return linkStrength;\n linkStrength = typeof x === \"function\" ? x : +x;\n return force;\n };\n force.friction = function(x) {\n if (!arguments.length) return friction;\n friction = +x;\n return force;\n };\n force.charge = function(x) {\n if (!arguments.length) return charge;\n charge = typeof x === \"function\" ? x : +x;\n return force;\n };\n force.chargeDistance = function(x) {\n if (!arguments.length) return Math.sqrt(chargeDistance2);\n chargeDistance2 = x * x;\n return force;\n };\n force.gravity = function(x) {\n if (!arguments.length) return gravity;\n gravity = +x;\n return force;\n };\n force.theta = function(x) {\n if (!arguments.length) return Math.sqrt(theta2);\n theta2 = x * x;\n return force;\n };\n force.alpha = function(x) {\n if (!arguments.length) return alpha;\n x = +x;\n if (alpha) {\n if (x > 0) {\n alpha = x;\n } else {\n timer.c = null, timer.t = NaN, timer = null;\n event.end({\n type: \"end\",\n alpha: alpha = 0\n });\n }\n } else if (x > 0) {\n event.start({\n type: \"start\",\n alpha: alpha = x\n });\n timer = d3_timer(force.tick);\n }\n return force;\n };\n force.start = function() {\n var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o;\n for (i = 0; i < n; ++i) {\n (o = nodes[i]).index = i;\n o.weight = 0;\n }\n for (i = 0; i < m; ++i) {\n o = links[i];\n if (typeof o.source == \"number\") o.source = nodes[o.source];\n if (typeof o.target == \"number\") o.target = nodes[o.target];\n ++o.source.weight;\n ++o.target.weight;\n }\n for (i = 0; i < n; ++i) {\n o = nodes[i];\n if (isNaN(o.x)) o.x = position(\"x\", w);\n if (isNaN(o.y)) o.y = position(\"y\", h);\n if (isNaN(o.px)) o.px = o.x;\n if (isNaN(o.py)) o.py = o.y;\n }\n distances = [];\n if (typeof linkDistance === \"function\") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance;\n strengths = [];\n if (typeof linkStrength === \"function\") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength;\n charges = [];\n if (typeof charge === \"function\") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;\n function position(dimension, size) {\n if (!neighbors) {\n neighbors = new Array(n);\n for (j = 0; j < n; ++j) {\n neighbors[j] = [];\n }\n for (j = 0; j < m; ++j) {\n var o = links[j];\n neighbors[o.source.index].push(o.target);\n neighbors[o.target.index].push(o.source);\n }\n }\n var candidates = neighbors[i], j = -1, l = candidates.length, x;\n while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x;\n return Math.random() * size;\n }\n return force.resume();\n };\n force.resume = function() {\n return force.alpha(.1);\n };\n force.stop = function() {\n return force.alpha(0);\n };\n force.drag = function() {\n if (!drag) drag = d3.behavior.drag().origin(d3_identity).on(\"dragstart.force\", d3_layout_forceDragstart).on(\"drag.force\", dragmove).on(\"dragend.force\", d3_layout_forceDragend);\n if (!arguments.length) return drag;\n this.on(\"mouseover.force\", d3_layout_forceMouseover).on(\"mouseout.force\", d3_layout_forceMouseout).call(drag);\n };\n function dragmove(d) {\n d.px = d3.event.x, d.py = d3.event.y;\n force.resume();\n }\n return d3.rebind(force, event, \"on\");\n };\n function d3_layout_forceDragstart(d) {\n d.fixed |= 2;\n }\n function d3_layout_forceDragend(d) {\n d.fixed &= ~6;\n }\n function d3_layout_forceMouseover(d) {\n d.fixed |= 4;\n d.px = d.x, d.py = d.y;\n }\n function d3_layout_forceMouseout(d) {\n d.fixed &= ~4;\n }\n function d3_layout_forceAccumulate(quad, alpha, charges) {\n var cx = 0, cy = 0;\n quad.charge = 0;\n if (!quad.leaf) {\n var nodes = quad.nodes, n = nodes.length, i = -1, c;\n while (++i < n) {\n c = nodes[i];\n if (c == null) continue;\n d3_layout_forceAccumulate(c, alpha, charges);\n quad.charge += c.charge;\n cx += c.charge * c.cx;\n cy += c.charge * c.cy;\n }\n }\n if (quad.point) {\n if (!quad.leaf) {\n quad.point.x += Math.random() - .5;\n quad.point.y += Math.random() - .5;\n }\n var k = alpha * charges[quad.point.index];\n quad.charge += quad.pointCharge = k;\n cx += k * quad.point.x;\n cy += k * quad.point.y;\n }\n quad.cx = cx / quad.charge;\n quad.cy = cy / quad.charge;\n }\n var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;\n d3.layout.hierarchy = function() {\n var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;\n function hierarchy(root) {\n var stack = [ root ], nodes = [], node;\n root.depth = 0;\n while ((node = stack.pop()) != null) {\n nodes.push(node);\n if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {\n var n, childs, child;\n while (--n >= 0) {\n stack.push(child = childs[n]);\n child.parent = node;\n child.depth = node.depth + 1;\n }\n if (value) node.value = 0;\n node.children = childs;\n } else {\n if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;\n delete node.children;\n }\n }\n d3_layout_hierarchyVisitAfter(root, function(node) {\n var childs, parent;\n if (sort && (childs = node.children)) childs.sort(sort);\n if (value && (parent = node.parent)) parent.value += node.value;\n });\n return nodes;\n }\n hierarchy.sort = function(x) {\n if (!arguments.length) return sort;\n sort = x;\n return hierarchy;\n };\n hierarchy.children = function(x) {\n if (!arguments.length) return children;\n children = x;\n return hierarchy;\n };\n hierarchy.value = function(x) {\n if (!arguments.length) return value;\n value = x;\n return hierarchy;\n };\n hierarchy.revalue = function(root) {\n if (value) {\n d3_layout_hierarchyVisitBefore(root, function(node) {\n if (node.children) node.value = 0;\n });\n d3_layout_hierarchyVisitAfter(root, function(node) {\n var parent;\n if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;\n if (parent = node.parent) parent.value += node.value;\n });\n }\n return root;\n };\n return hierarchy;\n };\n function d3_layout_hierarchyRebind(object, hierarchy) {\n d3.rebind(object, hierarchy, \"sort\", \"children\", \"value\");\n object.nodes = object;\n object.links = d3_layout_hierarchyLinks;\n return object;\n }\n function d3_layout_hierarchyVisitBefore(node, callback) {\n var nodes = [ node ];\n while ((node = nodes.pop()) != null) {\n callback(node);\n if ((children = node.children) && (n = children.length)) {\n var n, children;\n while (--n >= 0) nodes.push(children[n]);\n }\n }\n }\n function d3_layout_hierarchyVisitAfter(node, callback) {\n var nodes = [ node ], nodes2 = [];\n while ((node = nodes.pop()) != null) {\n nodes2.push(node);\n if ((children = node.children) && (n = children.length)) {\n var i = -1, n, children;\n while (++i < n) nodes.push(children[i]);\n }\n }\n while ((node = nodes2.pop()) != null) {\n callback(node);\n }\n }\n function d3_layout_hierarchyChildren(d) {\n return d.children;\n }\n function d3_layout_hierarchyValue(d) {\n return d.value;\n }\n function d3_layout_hierarchySort(a, b) {\n return b.value - a.value;\n }\n function d3_layout_hierarchyLinks(nodes) {\n return d3.merge(nodes.map(function(parent) {\n return (parent.children || []).map(function(child) {\n return {\n source: parent,\n target: child\n };\n });\n }));\n }\n d3.layout.partition = function() {\n var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ];\n function position(node, x, dx, dy) {\n var children = node.children;\n node.x = x;\n node.y = node.depth * dy;\n node.dx = dx;\n node.dy = dy;\n if (children && (n = children.length)) {\n var i = -1, n, c, d;\n dx = node.value ? dx / node.value : 0;\n while (++i < n) {\n position(c = children[i], x, d = c.value * dx, dy);\n x += d;\n }\n }\n }\n function depth(node) {\n var children = node.children, d = 0;\n if (children && (n = children.length)) {\n var i = -1, n;\n while (++i < n) d = Math.max(d, depth(children[i]));\n }\n return 1 + d;\n }\n function partition(d, i) {\n var nodes = hierarchy.call(this, d, i);\n position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));\n return nodes;\n }\n partition.size = function(x) {\n if (!arguments.length) return size;\n size = x;\n return partition;\n };\n return d3_layout_hierarchyRebind(partition, hierarchy);\n };\n d3.layout.pie = function() {\n var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ, padAngle = 0;\n function pie(data) {\n var n = data.length, values = data.map(function(d, i) {\n return +value.call(pie, d, i);\n }), a = +(typeof startAngle === \"function\" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === \"function\" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === \"function\" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), sum = d3.sum(values), k = sum ? (da - n * pa) / sum : 0, index = d3.range(n), arcs = [], v;\n if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {\n return values[j] - values[i];\n } : function(i, j) {\n return sort(data[i], data[j]);\n });\n index.forEach(function(i) {\n arcs[i] = {\n data: data[i],\n value: v = values[i],\n startAngle: a,\n endAngle: a += v * k + pa,\n padAngle: p\n };\n });\n return arcs;\n }\n pie.value = function(_) {\n if (!arguments.length) return value;\n value = _;\n return pie;\n };\n pie.sort = function(_) {\n if (!arguments.length) return sort;\n sort = _;\n return pie;\n };\n pie.startAngle = function(_) {\n if (!arguments.length) return startAngle;\n startAngle = _;\n return pie;\n };\n pie.endAngle = function(_) {\n if (!arguments.length) return endAngle;\n endAngle = _;\n return pie;\n };\n pie.padAngle = function(_) {\n if (!arguments.length) return padAngle;\n padAngle = _;\n return pie;\n };\n return pie;\n };\n var d3_layout_pieSortByValue = {};\n d3.layout.stack = function() {\n var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;\n function stack(data, index) {\n if (!(n = data.length)) return data;\n var series = data.map(function(d, i) {\n return values.call(stack, d, i);\n });\n var points = series.map(function(d) {\n return d.map(function(v, i) {\n return [ x.call(stack, v, i), y.call(stack, v, i) ];\n });\n });\n var orders = order.call(stack, points, index);\n series = d3.permute(series, orders);\n points = d3.permute(points, orders);\n var offsets = offset.call(stack, points, index);\n var m = series[0].length, n, i, j, o;\n for (j = 0; j < m; ++j) {\n out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);\n for (i = 1; i < n; ++i) {\n out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);\n }\n }\n return data;\n }\n stack.values = function(x) {\n if (!arguments.length) return values;\n values = x;\n return stack;\n };\n stack.order = function(x) {\n if (!arguments.length) return order;\n order = typeof x === \"function\" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;\n return stack;\n };\n stack.offset = function(x) {\n if (!arguments.length) return offset;\n offset = typeof x === \"function\" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;\n return stack;\n };\n stack.x = function(z) {\n if (!arguments.length) return x;\n x = z;\n return stack;\n };\n stack.y = function(z) {\n if (!arguments.length) return y;\n y = z;\n return stack;\n };\n stack.out = function(z) {\n if (!arguments.length) return out;\n out = z;\n return stack;\n };\n return stack;\n };\n function d3_layout_stackX(d) {\n return d.x;\n }\n function d3_layout_stackY(d) {\n return d.y;\n }\n function d3_layout_stackOut(d, y0, y) {\n d.y0 = y0;\n d.y = y;\n }\n var d3_layout_stackOrders = d3.map({\n \"inside-out\": function(data) {\n var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) {\n return max[a] - max[b];\n }), top = 0, bottom = 0, tops = [], bottoms = [];\n for (i = 0; i < n; ++i) {\n j = index[i];\n if (top < bottom) {\n top += sums[j];\n tops.push(j);\n } else {\n bottom += sums[j];\n bottoms.push(j);\n }\n }\n return bottoms.reverse().concat(tops);\n },\n reverse: function(data) {\n return d3.range(data.length).reverse();\n },\n \"default\": d3_layout_stackOrderDefault\n });\n var d3_layout_stackOffsets = d3.map({\n silhouette: function(data) {\n var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = [];\n for (j = 0; j < m; ++j) {\n for (i = 0, o = 0; i < n; i++) o += data[i][j][1];\n if (o > max) max = o;\n sums.push(o);\n }\n for (j = 0; j < m; ++j) {\n y0[j] = (max - sums[j]) / 2;\n }\n return y0;\n },\n wiggle: function(data) {\n var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];\n y0[0] = o = o0 = 0;\n for (j = 1; j < m; ++j) {\n for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];\n for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {\n for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {\n s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;\n }\n s2 += s3 * data[i][j][1];\n }\n y0[j] = o -= s1 ? s2 / s1 * dx : 0;\n if (o < o0) o0 = o;\n }\n for (j = 0; j < m; ++j) y0[j] -= o0;\n return y0;\n },\n expand: function(data) {\n var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = [];\n for (j = 0; j < m; ++j) {\n for (i = 0, o = 0; i < n; i++) o += data[i][j][1];\n if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k;\n }\n for (j = 0; j < m; ++j) y0[j] = 0;\n return y0;\n },\n zero: d3_layout_stackOffsetZero\n });\n function d3_layout_stackOrderDefault(data) {\n return d3.range(data.length);\n }\n function d3_layout_stackOffsetZero(data) {\n var j = -1, m = data[0].length, y0 = [];\n while (++j < m) y0[j] = 0;\n return y0;\n }\n function d3_layout_stackMaxIndex(array) {\n var i = 1, j = 0, v = array[0][1], k, n = array.length;\n for (;i < n; ++i) {\n if ((k = array[i][1]) > v) {\n j = i;\n v = k;\n }\n }\n return j;\n }\n function d3_layout_stackReduceSum(d) {\n return d.reduce(d3_layout_stackSum, 0);\n }\n function d3_layout_stackSum(p, d) {\n return p + d[1];\n }\n d3.layout.histogram = function() {\n var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges;\n function histogram(data, i) {\n var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x;\n while (++i < m) {\n bin = bins[i] = [];\n bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);\n bin.y = 0;\n }\n if (m > 0) {\n i = -1;\n while (++i < n) {\n x = values[i];\n if (x >= range[0] && x <= range[1]) {\n bin = bins[d3.bisect(thresholds, x, 1, m) - 1];\n bin.y += k;\n bin.push(data[i]);\n }\n }\n }\n return bins;\n }\n histogram.value = function(x) {\n if (!arguments.length) return valuer;\n valuer = x;\n return histogram;\n };\n histogram.range = function(x) {\n if (!arguments.length) return ranger;\n ranger = d3_functor(x);\n return histogram;\n };\n histogram.bins = function(x) {\n if (!arguments.length) return binner;\n binner = typeof x === \"number\" ? function(range) {\n return d3_layout_histogramBinFixed(range, x);\n } : d3_functor(x);\n return histogram;\n };\n histogram.frequency = function(x) {\n if (!arguments.length) return frequency;\n frequency = !!x;\n return histogram;\n };\n return histogram;\n };\n function d3_layout_histogramBinSturges(range, values) {\n return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));\n }\n function d3_layout_histogramBinFixed(range, n) {\n var x = -1, b = +range[0], m = (range[1] - b) / n, f = [];\n while (++x <= n) f[x] = m * x + b;\n return f;\n }\n function d3_layout_histogramRange(values) {\n return [ d3.min(values), d3.max(values) ];\n }\n d3.layout.pack = function() {\n var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;\n function pack(d, i) {\n var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === \"function\" ? radius : function() {\n return radius;\n };\n root.x = root.y = 0;\n d3_layout_hierarchyVisitAfter(root, function(d) {\n d.r = +r(d.value);\n });\n d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);\n if (padding) {\n var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;\n d3_layout_hierarchyVisitAfter(root, function(d) {\n d.r += dr;\n });\n d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);\n d3_layout_hierarchyVisitAfter(root, function(d) {\n d.r -= dr;\n });\n }\n d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h));\n return nodes;\n }\n pack.size = function(_) {\n if (!arguments.length) return size;\n size = _;\n return pack;\n };\n pack.radius = function(_) {\n if (!arguments.length) return radius;\n radius = _ == null || typeof _ === \"function\" ? _ : +_;\n return pack;\n };\n pack.padding = function(_) {\n if (!arguments.length) return padding;\n padding = +_;\n return pack;\n };\n return d3_layout_hierarchyRebind(pack, hierarchy);\n };\n function d3_layout_packSort(a, b) {\n return a.value - b.value;\n }\n function d3_layout_packInsert(a, b) {\n var c = a._pack_next;\n a._pack_next = b;\n b._pack_prev = a;\n b._pack_next = c;\n c._pack_prev = b;\n }\n function d3_layout_packSplice(a, b) {\n a._pack_next = b;\n b._pack_prev = a;\n }\n function d3_layout_packIntersects(a, b) {\n var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r;\n return .999 * dr * dr > dx * dx + dy * dy;\n }\n function d3_layout_packSiblings(node) {\n if (!(nodes = node.children) || !(n = nodes.length)) return;\n var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;\n function bound(node) {\n xMin = Math.min(node.x - node.r, xMin);\n xMax = Math.max(node.x + node.r, xMax);\n yMin = Math.min(node.y - node.r, yMin);\n yMax = Math.max(node.y + node.r, yMax);\n }\n nodes.forEach(d3_layout_packLink);\n a = nodes[0];\n a.x = -a.r;\n a.y = 0;\n bound(a);\n if (n > 1) {\n b = nodes[1];\n b.x = b.r;\n b.y = 0;\n bound(b);\n if (n > 2) {\n c = nodes[2];\n d3_layout_packPlace(a, b, c);\n bound(c);\n d3_layout_packInsert(a, c);\n a._pack_prev = c;\n d3_layout_packInsert(c, b);\n b = a._pack_next;\n for (i = 3; i < n; i++) {\n d3_layout_packPlace(a, b, c = nodes[i]);\n var isect = 0, s1 = 1, s2 = 1;\n for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {\n if (d3_layout_packIntersects(j, c)) {\n isect = 1;\n break;\n }\n }\n if (isect == 1) {\n for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {\n if (d3_layout_packIntersects(k, c)) {\n break;\n }\n }\n }\n if (isect) {\n if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);\n i--;\n } else {\n d3_layout_packInsert(a, c);\n b = c;\n bound(c);\n }\n }\n }\n }\n var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0;\n for (i = 0; i < n; i++) {\n c = nodes[i];\n c.x -= cx;\n c.y -= cy;\n cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y));\n }\n node.r = cr;\n nodes.forEach(d3_layout_packUnlink);\n }\n function d3_layout_packLink(node) {\n node._pack_next = node._pack_prev = node;\n }\n function d3_layout_packUnlink(node) {\n delete node._pack_next;\n delete node._pack_prev;\n }\n function d3_layout_packTransform(node, x, y, k) {\n var children = node.children;\n node.x = x += k * node.x;\n node.y = y += k * node.y;\n node.r *= k;\n if (children) {\n var i = -1, n = children.length;\n while (++i < n) d3_layout_packTransform(children[i], x, y, k);\n }\n }\n function d3_layout_packPlace(a, b, c) {\n var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;\n if (db && (dx || dy)) {\n var da = b.r + c.r, dc = dx * dx + dy * dy;\n da *= da;\n db *= db;\n var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);\n c.x = a.x + x * dx + y * dy;\n c.y = a.y + x * dy - y * dx;\n } else {\n c.x = a.x + db;\n c.y = a.y;\n }\n }\n d3.layout.tree = function() {\n var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;\n function tree(d, i) {\n var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);\n d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;\n d3_layout_hierarchyVisitBefore(root1, secondWalk);\n if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {\n var left = root0, right = root0, bottom = root0;\n d3_layout_hierarchyVisitBefore(root0, function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);\n d3_layout_hierarchyVisitBefore(root0, function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n return nodes;\n }\n function wrapTree(root0) {\n var root1 = {\n A: null,\n children: [ root0 ]\n }, queue = [ root1 ], node1;\n while ((node1 = queue.pop()) != null) {\n for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {\n queue.push((children[i] = child = {\n _: children[i],\n parent: node1,\n children: (child = children[i].children) && child.slice() || [],\n A: null,\n a: null,\n z: 0,\n m: 0,\n c: 0,\n s: 0,\n t: null,\n i: i\n }).a = child);\n }\n }\n return root1.children[0];\n }\n function firstWalk(v) {\n var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;\n if (children.length) {\n d3_layout_treeShift(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;\n while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {\n vom = d3_layout_treeLeft(vom);\n vop = d3_layout_treeRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !d3_layout_treeRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !d3_layout_treeLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n function sizeNode(node) {\n node.x *= size[0];\n node.y = node.depth * size[1];\n }\n tree.separation = function(x) {\n if (!arguments.length) return separation;\n separation = x;\n return tree;\n };\n tree.size = function(x) {\n if (!arguments.length) return nodeSize ? null : size;\n nodeSize = (size = x) == null ? sizeNode : null;\n return tree;\n };\n tree.nodeSize = function(x) {\n if (!arguments.length) return nodeSize ? size : null;\n nodeSize = (size = x) == null ? null : sizeNode;\n return tree;\n };\n return d3_layout_hierarchyRebind(tree, hierarchy);\n };\n function d3_layout_treeSeparation(a, b) {\n return a.parent == b.parent ? 1 : 2;\n }\n function d3_layout_treeLeft(v) {\n var children = v.children;\n return children.length ? children[0] : v.t;\n }\n function d3_layout_treeRight(v) {\n var children = v.children, n;\n return (n = children.length) ? children[n - 1] : v.t;\n }\n function d3_layout_treeMove(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n }\n function d3_layout_treeShift(v) {\n var shift = 0, change = 0, children = v.children, i = children.length, w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n }\n function d3_layout_treeAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n }\n d3.layout.cluster = function() {\n var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;\n function cluster(d, i) {\n var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;\n d3_layout_hierarchyVisitAfter(root, function(node) {\n var children = node.children;\n if (children && children.length) {\n node.x = d3_layout_clusterX(children);\n node.y = d3_layout_clusterY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;\n d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {\n node.x = (node.x - root.x) * size[0];\n node.y = (root.y - node.y) * size[1];\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * size[0];\n node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1];\n });\n return nodes;\n }\n cluster.separation = function(x) {\n if (!arguments.length) return separation;\n separation = x;\n return cluster;\n };\n cluster.size = function(x) {\n if (!arguments.length) return nodeSize ? null : size;\n nodeSize = (size = x) == null;\n return cluster;\n };\n cluster.nodeSize = function(x) {\n if (!arguments.length) return nodeSize ? size : null;\n nodeSize = (size = x) != null;\n return cluster;\n };\n return d3_layout_hierarchyRebind(cluster, hierarchy);\n };\n function d3_layout_clusterY(children) {\n return 1 + d3.max(children, function(child) {\n return child.y;\n });\n }\n function d3_layout_clusterX(children) {\n return children.reduce(function(x, child) {\n return x + child.x;\n }, 0) / children.length;\n }\n function d3_layout_clusterLeft(node) {\n var children = node.children;\n return children && children.length ? d3_layout_clusterLeft(children[0]) : node;\n }\n function d3_layout_clusterRight(node) {\n var children = node.children, n;\n return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;\n }\n d3.layout.treemap = function() {\n var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = \"squarify\", ratio = .5 * (1 + Math.sqrt(5));\n function scale(children, k) {\n var i = -1, n = children.length, child, area;\n while (++i < n) {\n area = (child = children[i]).value * (k < 0 ? 0 : k);\n child.area = isNaN(area) || area <= 0 ? 0 : area;\n }\n }\n function squarify(node) {\n var children = node.children;\n if (children && children.length) {\n var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === \"slice\" ? rect.dx : mode === \"dice\" ? rect.dy : mode === \"slice-dice\" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n;\n scale(remaining, rect.dx * rect.dy / node.value);\n row.area = 0;\n while ((n = remaining.length) > 0) {\n row.push(child = remaining[n - 1]);\n row.area += child.area;\n if (mode !== \"squarify\" || (score = worst(row, u)) <= best) {\n remaining.pop();\n best = score;\n } else {\n row.area -= row.pop().area;\n position(row, u, rect, false);\n u = Math.min(rect.dx, rect.dy);\n row.length = row.area = 0;\n best = Infinity;\n }\n }\n if (row.length) {\n position(row, u, rect, true);\n row.length = row.area = 0;\n }\n children.forEach(squarify);\n }\n }\n function stickify(node) {\n var children = node.children;\n if (children && children.length) {\n var rect = pad(node), remaining = children.slice(), child, row = [];\n scale(remaining, rect.dx * rect.dy / node.value);\n row.area = 0;\n while (child = remaining.pop()) {\n row.push(child);\n row.area += child.area;\n if (child.z != null) {\n position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);\n row.length = row.area = 0;\n }\n }\n children.forEach(stickify);\n }\n }\n function worst(row, u) {\n var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length;\n while (++i < n) {\n if (!(r = row[i].area)) continue;\n if (r < rmin) rmin = r;\n if (r > rmax) rmax = r;\n }\n s *= s;\n u *= u;\n return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity;\n }\n function position(row, u, rect, flush) {\n var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;\n if (u == rect.dx) {\n if (flush || v > rect.dy) v = rect.dy;\n while (++i < n) {\n o = row[i];\n o.x = x;\n o.y = y;\n o.dy = v;\n x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);\n }\n o.z = true;\n o.dx += rect.x + rect.dx - x;\n rect.y += v;\n rect.dy -= v;\n } else {\n if (flush || v > rect.dx) v = rect.dx;\n while (++i < n) {\n o = row[i];\n o.x = x;\n o.y = y;\n o.dx = v;\n y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);\n }\n o.z = false;\n o.dy += rect.y + rect.dy - y;\n rect.x += v;\n rect.dx -= v;\n }\n }\n function treemap(d) {\n var nodes = stickies || hierarchy(d), root = nodes[0];\n root.x = root.y = 0;\n if (root.value) root.dx = size[0], root.dy = size[1]; else root.dx = root.dy = 0;\n if (stickies) hierarchy.revalue(root);\n scale([ root ], root.dx * root.dy / root.value);\n (stickies ? stickify : squarify)(root);\n if (sticky) stickies = nodes;\n return nodes;\n }\n treemap.size = function(x) {\n if (!arguments.length) return size;\n size = x;\n return treemap;\n };\n treemap.padding = function(x) {\n if (!arguments.length) return padding;\n function padFunction(node) {\n var p = x.call(treemap, node, node.depth);\n return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === \"number\" ? [ p, p, p, p ] : p);\n }\n function padConstant(node) {\n return d3_layout_treemapPad(node, x);\n }\n var type;\n pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === \"function\" ? padFunction : type === \"number\" ? (x = [ x, x, x, x ], \n padConstant) : padConstant;\n return treemap;\n };\n treemap.round = function(x) {\n if (!arguments.length) return round != Number;\n round = x ? Math.round : Number;\n return treemap;\n };\n treemap.sticky = function(x) {\n if (!arguments.length) return sticky;\n sticky = x;\n stickies = null;\n return treemap;\n };\n treemap.ratio = function(x) {\n if (!arguments.length) return ratio;\n ratio = x;\n return treemap;\n };\n treemap.mode = function(x) {\n if (!arguments.length) return mode;\n mode = x + \"\";\n return treemap;\n };\n return d3_layout_hierarchyRebind(treemap, hierarchy);\n };\n function d3_layout_treemapPadNull(node) {\n return {\n x: node.x,\n y: node.y,\n dx: node.dx,\n dy: node.dy\n };\n }\n function d3_layout_treemapPad(node, padding) {\n var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2];\n if (dx < 0) {\n x += dx / 2;\n dx = 0;\n }\n if (dy < 0) {\n y += dy / 2;\n dy = 0;\n }\n return {\n x: x,\n y: y,\n dx: dx,\n dy: dy\n };\n }\n d3.random = {\n normal: function(µ, σ) {\n var n = arguments.length;\n if (n < 2) σ = 1;\n if (n < 1) µ = 0;\n return function() {\n var x, y, r;\n do {\n x = Math.random() * 2 - 1;\n y = Math.random() * 2 - 1;\n r = x * x + y * y;\n } while (!r || r > 1);\n return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);\n };\n },\n logNormal: function() {\n var random = d3.random.normal.apply(d3, arguments);\n return function() {\n return Math.exp(random());\n };\n },\n bates: function(m) {\n var random = d3.random.irwinHall(m);\n return function() {\n return random() / m;\n };\n },\n irwinHall: function(m) {\n return function() {\n for (var s = 0, j = 0; j < m; j++) s += Math.random();\n return s;\n };\n }\n };\n d3.scale = {};\n function d3_scaleExtent(domain) {\n var start = domain[0], stop = domain[domain.length - 1];\n return start < stop ? [ start, stop ] : [ stop, start ];\n }\n function d3_scaleRange(scale) {\n return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());\n }\n function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {\n var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]);\n return function(x) {\n return i(u(x));\n };\n }\n function d3_scale_nice(domain, nice) {\n var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx;\n if (x1 < x0) {\n dx = i0, i0 = i1, i1 = dx;\n dx = x0, x0 = x1, x1 = dx;\n }\n domain[i0] = nice.floor(x0);\n domain[i1] = nice.ceil(x1);\n return domain;\n }\n function d3_scale_niceStep(step) {\n return step ? {\n floor: function(x) {\n return Math.floor(x / step) * step;\n },\n ceil: function(x) {\n return Math.ceil(x / step) * step;\n }\n } : d3_scale_niceIdentity;\n }\n var d3_scale_niceIdentity = {\n floor: d3_identity,\n ceil: d3_identity\n };\n function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {\n var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1;\n if (domain[k] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n while (++j <= k) {\n u.push(uninterpolate(domain[j - 1], domain[j]));\n i.push(interpolate(range[j - 1], range[j]));\n }\n return function(x) {\n var j = d3.bisect(domain, x, 1, k) - 1;\n return i[j](u[j](x));\n };\n }\n d3.scale.linear = function() {\n return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false);\n };\n function d3_scale_linear(domain, range, interpolate, clamp) {\n var output, input;\n function rescale() {\n var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;\n output = linear(domain, range, uninterpolate, interpolate);\n input = linear(range, domain, uninterpolate, d3_interpolate);\n return scale;\n }\n function scale(x) {\n return output(x);\n }\n scale.invert = function(y) {\n return input(y);\n };\n scale.domain = function(x) {\n if (!arguments.length) return domain;\n domain = x.map(Number);\n return rescale();\n };\n scale.range = function(x) {\n if (!arguments.length) return range;\n range = x;\n return rescale();\n };\n scale.rangeRound = function(x) {\n return scale.range(x).interpolate(d3_interpolateRound);\n };\n scale.clamp = function(x) {\n if (!arguments.length) return clamp;\n clamp = x;\n return rescale();\n };\n scale.interpolate = function(x) {\n if (!arguments.length) return interpolate;\n interpolate = x;\n return rescale();\n };\n scale.ticks = function(m) {\n return d3_scale_linearTicks(domain, m);\n };\n scale.tickFormat = function(m, format) {\n return d3_scale_linearTickFormat(domain, m, format);\n };\n scale.nice = function(m) {\n d3_scale_linearNice(domain, m);\n return rescale();\n };\n scale.copy = function() {\n return d3_scale_linear(domain, range, interpolate, clamp);\n };\n return rescale();\n }\n function d3_scale_linearRebind(scale, linear) {\n return d3.rebind(scale, linear, \"range\", \"rangeRound\", \"interpolate\", \"clamp\");\n }\n function d3_scale_linearNice(domain, m) {\n d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));\n d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));\n return domain;\n }\n function d3_scale_linearTickRange(domain, m) {\n if (m == null) m = 10;\n var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step;\n if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2;\n extent[0] = Math.ceil(extent[0] / step) * step;\n extent[1] = Math.floor(extent[1] / step) * step + step * .5;\n extent[2] = step;\n return extent;\n }\n function d3_scale_linearTicks(domain, m) {\n return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));\n }\n function d3_scale_linearTickFormat(domain, m, format) {\n var range = d3_scale_linearTickRange(domain, m);\n if (format) {\n var match = d3_format_re.exec(format);\n match.shift();\n if (match[8] === \"s\") {\n var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));\n if (!match[7]) match[7] = \".\" + d3_scale_linearPrecision(prefix.scale(range[2]));\n match[8] = \"f\";\n format = d3.format(match.join(\"\"));\n return function(d) {\n return format(prefix.scale(d)) + prefix.symbol;\n };\n }\n if (!match[7]) match[7] = \".\" + d3_scale_linearFormatPrecision(match[8], range);\n format = match.join(\"\");\n } else {\n format = \",.\" + d3_scale_linearPrecision(range[2]) + \"f\";\n }\n return d3.format(format);\n }\n var d3_scale_linearFormatSignificant = {\n s: 1,\n g: 1,\n p: 1,\n r: 1,\n e: 1\n };\n function d3_scale_linearPrecision(value) {\n return -Math.floor(Math.log(value) / Math.LN10 + .01);\n }\n function d3_scale_linearFormatPrecision(type, range) {\n var p = d3_scale_linearPrecision(range[2]);\n return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== \"e\") : p - (type === \"%\") * 2;\n }\n d3.scale.log = function() {\n return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);\n };\n function d3_scale_log(linear, base, positive, domain) {\n function log(x) {\n return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);\n }\n function pow(x) {\n return positive ? Math.pow(base, x) : -Math.pow(base, -x);\n }\n function scale(x) {\n return linear(log(x));\n }\n scale.invert = function(x) {\n return pow(linear.invert(x));\n };\n scale.domain = function(x) {\n if (!arguments.length) return domain;\n positive = x[0] >= 0;\n linear.domain((domain = x.map(Number)).map(log));\n return scale;\n };\n scale.base = function(_) {\n if (!arguments.length) return base;\n base = +_;\n linear.domain(domain.map(log));\n return scale;\n };\n scale.nice = function() {\n var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative);\n linear.domain(niced);\n domain = niced.map(pow);\n return scale;\n };\n scale.ticks = function() {\n var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base;\n if (isFinite(j - i)) {\n if (positive) {\n for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k);\n ticks.push(pow(i));\n } else {\n ticks.push(pow(i));\n for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k);\n }\n for (i = 0; ticks[i] < u; i++) {}\n for (j = ticks.length; ticks[j - 1] > v; j--) {}\n ticks = ticks.slice(i, j);\n }\n return ticks;\n };\n scale.tickFormat = function(n, format) {\n if (!arguments.length) return d3_scale_logFormat;\n if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== \"function\") format = d3.format(format);\n var k = Math.max(1, base * n / scale.ticks().length);\n return function(d) {\n var i = d / pow(Math.round(log(d)));\n if (i * base < base - .5) i *= base;\n return i <= k ? format(d) : \"\";\n };\n };\n scale.copy = function() {\n return d3_scale_log(linear.copy(), base, positive, domain);\n };\n return d3_scale_linearRebind(scale, linear);\n }\n var d3_scale_logFormat = d3.format(\".0e\"), d3_scale_logNiceNegative = {\n floor: function(x) {\n return -Math.ceil(-x);\n },\n ceil: function(x) {\n return -Math.floor(-x);\n }\n };\n d3.scale.pow = function() {\n return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]);\n };\n function d3_scale_pow(linear, exponent, domain) {\n var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent);\n function scale(x) {\n return linear(powp(x));\n }\n scale.invert = function(x) {\n return powb(linear.invert(x));\n };\n scale.domain = function(x) {\n if (!arguments.length) return domain;\n linear.domain((domain = x.map(Number)).map(powp));\n return scale;\n };\n scale.ticks = function(m) {\n return d3_scale_linearTicks(domain, m);\n };\n scale.tickFormat = function(m, format) {\n return d3_scale_linearTickFormat(domain, m, format);\n };\n scale.nice = function(m) {\n return scale.domain(d3_scale_linearNice(domain, m));\n };\n scale.exponent = function(x) {\n if (!arguments.length) return exponent;\n powp = d3_scale_powPow(exponent = x);\n powb = d3_scale_powPow(1 / exponent);\n linear.domain(domain.map(powp));\n return scale;\n };\n scale.copy = function() {\n return d3_scale_pow(linear.copy(), exponent, domain);\n };\n return d3_scale_linearRebind(scale, linear);\n }\n function d3_scale_powPow(e) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);\n };\n }\n d3.scale.sqrt = function() {\n return d3.scale.pow().exponent(.5);\n };\n d3.scale.ordinal = function() {\n return d3_scale_ordinal([], {\n t: \"range\",\n a: [ [] ]\n });\n };\n function d3_scale_ordinal(domain, ranger) {\n var index, range, rangeBand;\n function scale(x) {\n return range[((index.get(x) || (ranger.t === \"range\" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];\n }\n function steps(start, step) {\n return d3.range(domain.length).map(function(i) {\n return start + step * i;\n });\n }\n scale.domain = function(x) {\n if (!arguments.length) return domain;\n domain = [];\n index = new d3_Map();\n var i = -1, n = x.length, xi;\n while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));\n return scale[ranger.t].apply(scale, ranger.a);\n };\n scale.range = function(x) {\n if (!arguments.length) return range;\n range = x;\n rangeBand = 0;\n ranger = {\n t: \"range\",\n a: arguments\n };\n return scale;\n };\n scale.rangePoints = function(x, padding) {\n if (arguments.length < 2) padding = 0;\n var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2, \n 0) : (stop - start) / (domain.length - 1 + padding);\n range = steps(start + step * padding / 2, step);\n rangeBand = 0;\n ranger = {\n t: \"rangePoints\",\n a: arguments\n };\n return scale;\n };\n scale.rangeRoundPoints = function(x, padding) {\n if (arguments.length < 2) padding = 0;\n var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2), \n 0) : (stop - start) / (domain.length - 1 + padding) | 0;\n range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step);\n rangeBand = 0;\n ranger = {\n t: \"rangeRoundPoints\",\n a: arguments\n };\n return scale;\n };\n scale.rangeBands = function(x, padding, outerPadding) {\n if (arguments.length < 2) padding = 0;\n if (arguments.length < 3) outerPadding = padding;\n var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding);\n range = steps(start + step * outerPadding, step);\n if (reverse) range.reverse();\n rangeBand = step * (1 - padding);\n ranger = {\n t: \"rangeBands\",\n a: arguments\n };\n return scale;\n };\n scale.rangeRoundBands = function(x, padding, outerPadding) {\n if (arguments.length < 2) padding = 0;\n if (arguments.length < 3) outerPadding = padding;\n var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding));\n range = steps(start + Math.round((stop - start - (domain.length - padding) * step) / 2), step);\n if (reverse) range.reverse();\n rangeBand = Math.round(step * (1 - padding));\n ranger = {\n t: \"rangeRoundBands\",\n a: arguments\n };\n return scale;\n };\n scale.rangeBand = function() {\n return rangeBand;\n };\n scale.rangeExtent = function() {\n return d3_scaleExtent(ranger.a[0]);\n };\n scale.copy = function() {\n return d3_scale_ordinal(domain, ranger);\n };\n return scale.domain(domain);\n }\n d3.scale.category10 = function() {\n return d3.scale.ordinal().range(d3_category10);\n };\n d3.scale.category20 = function() {\n return d3.scale.ordinal().range(d3_category20);\n };\n d3.scale.category20b = function() {\n return d3.scale.ordinal().range(d3_category20b);\n };\n d3.scale.category20c = function() {\n return d3.scale.ordinal().range(d3_category20c);\n };\n var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString);\n var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString);\n var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString);\n var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString);\n d3.scale.quantile = function() {\n return d3_scale_quantile([], []);\n };\n function d3_scale_quantile(domain, range) {\n var thresholds;\n function rescale() {\n var k = 0, q = range.length;\n thresholds = [];\n while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);\n return scale;\n }\n function scale(x) {\n if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)];\n }\n scale.domain = function(x) {\n if (!arguments.length) return domain;\n domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending);\n return rescale();\n };\n scale.range = function(x) {\n if (!arguments.length) return range;\n range = x;\n return rescale();\n };\n scale.quantiles = function() {\n return thresholds;\n };\n scale.invertExtent = function(y) {\n y = range.indexOf(y);\n return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ];\n };\n scale.copy = function() {\n return d3_scale_quantile(domain, range);\n };\n return rescale();\n }\n d3.scale.quantize = function() {\n return d3_scale_quantize(0, 1, [ 0, 1 ]);\n };\n function d3_scale_quantize(x0, x1, range) {\n var kx, i;\n function scale(x) {\n return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];\n }\n function rescale() {\n kx = range.length / (x1 - x0);\n i = range.length - 1;\n return scale;\n }\n scale.domain = function(x) {\n if (!arguments.length) return [ x0, x1 ];\n x0 = +x[0];\n x1 = +x[x.length - 1];\n return rescale();\n };\n scale.range = function(x) {\n if (!arguments.length) return range;\n range = x;\n return rescale();\n };\n scale.invertExtent = function(y) {\n y = range.indexOf(y);\n y = y < 0 ? NaN : y / kx + x0;\n return [ y, y + 1 / kx ];\n };\n scale.copy = function() {\n return d3_scale_quantize(x0, x1, range);\n };\n return rescale();\n }\n d3.scale.threshold = function() {\n return d3_scale_threshold([ .5 ], [ 0, 1 ]);\n };\n function d3_scale_threshold(domain, range) {\n function scale(x) {\n if (x <= x) return range[d3.bisect(domain, x)];\n }\n scale.domain = function(_) {\n if (!arguments.length) return domain;\n domain = _;\n return scale;\n };\n scale.range = function(_) {\n if (!arguments.length) return range;\n range = _;\n return scale;\n };\n scale.invertExtent = function(y) {\n y = range.indexOf(y);\n return [ domain[y - 1], domain[y] ];\n };\n scale.copy = function() {\n return d3_scale_threshold(domain, range);\n };\n return scale;\n }\n d3.scale.identity = function() {\n return d3_scale_identity([ 0, 1 ]);\n };\n function d3_scale_identity(domain) {\n function identity(x) {\n return +x;\n }\n identity.invert = identity;\n identity.domain = identity.range = function(x) {\n if (!arguments.length) return domain;\n domain = x.map(identity);\n return identity;\n };\n identity.ticks = function(m) {\n return d3_scale_linearTicks(domain, m);\n };\n identity.tickFormat = function(m, format) {\n return d3_scale_linearTickFormat(domain, m, format);\n };\n identity.copy = function() {\n return d3_scale_identity(domain);\n };\n return identity;\n }\n d3.svg = {};\n function d3_zero() {\n return 0;\n }\n d3.svg.arc = function() {\n var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle, padAngle = d3_svg_arcPadAngle;\n function arc() {\n var r0 = Math.max(0, +innerRadius.apply(this, arguments)), r1 = Math.max(0, +outerRadius.apply(this, arguments)), a0 = startAngle.apply(this, arguments) - halfπ, a1 = endAngle.apply(this, arguments) - halfπ, da = Math.abs(a1 - a0), cw = a0 > a1 ? 0 : 1;\n if (r1 < r0) rc = r1, r1 = r0, r0 = rc;\n if (da >= τε) return circleSegment(r1, cw) + (r0 ? circleSegment(r0, 1 - cw) : \"\") + \"Z\";\n var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = [];\n if (ap = (+padAngle.apply(this, arguments) || 0) / 2) {\n rp = padRadius === d3_svg_arcAuto ? Math.sqrt(r0 * r0 + r1 * r1) : +padRadius.apply(this, arguments);\n if (!cw) p1 *= -1;\n if (r1) p1 = d3_asin(rp / r1 * Math.sin(ap));\n if (r0) p0 = d3_asin(rp / r0 * Math.sin(ap));\n }\n if (r1) {\n x0 = r1 * Math.cos(a0 + p1);\n y0 = r1 * Math.sin(a0 + p1);\n x1 = r1 * Math.cos(a1 - p1);\n y1 = r1 * Math.sin(a1 - p1);\n var l1 = Math.abs(a1 - a0 - 2 * p1) <= π ? 0 : 1;\n if (p1 && d3_svg_arcSweep(x0, y0, x1, y1) === cw ^ l1) {\n var h1 = (a0 + a1) / 2;\n x0 = r1 * Math.cos(h1);\n y0 = r1 * Math.sin(h1);\n x1 = y1 = null;\n }\n } else {\n x0 = y0 = 0;\n }\n if (r0) {\n x2 = r0 * Math.cos(a1 - p0);\n y2 = r0 * Math.sin(a1 - p0);\n x3 = r0 * Math.cos(a0 + p0);\n y3 = r0 * Math.sin(a0 + p0);\n var l0 = Math.abs(a0 - a1 + 2 * p0) <= π ? 0 : 1;\n if (p0 && d3_svg_arcSweep(x2, y2, x3, y3) === 1 - cw ^ l0) {\n var h0 = (a0 + a1) / 2;\n x2 = r0 * Math.cos(h0);\n y2 = r0 * Math.sin(h0);\n x3 = y3 = null;\n }\n } else {\n x2 = y2 = 0;\n }\n if (da > ε && (rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) {\n cr = r0 < r1 ^ cw ? 0 : 1;\n var rc1 = rc, rc0 = rc;\n if (da < π) {\n var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = Math.min(rc, (r0 - lc) / (kc - 1));\n rc1 = Math.min(rc, (r1 - lc) / (kc + 1));\n }\n if (x1 != null) {\n var t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw);\n if (rc === rc1) {\n path.push(\"M\", t30[0], \"A\", rc1, \",\", rc1, \" 0 0,\", cr, \" \", t30[1], \"A\", r1, \",\", r1, \" 0 \", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), \",\", cw, \" \", t12[1], \"A\", rc1, \",\", rc1, \" 0 0,\", cr, \" \", t12[0]);\n } else {\n path.push(\"M\", t30[0], \"A\", rc1, \",\", rc1, \" 0 1,\", cr, \" \", t12[0]);\n }\n } else {\n path.push(\"M\", x0, \",\", y0);\n }\n if (x3 != null) {\n var t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw);\n if (rc === rc0) {\n path.push(\"L\", t21[0], \"A\", rc0, \",\", rc0, \" 0 0,\", cr, \" \", t21[1], \"A\", r0, \",\", r0, \" 0 \", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), \",\", 1 - cw, \" \", t03[1], \"A\", rc0, \",\", rc0, \" 0 0,\", cr, \" \", t03[0]);\n } else {\n path.push(\"L\", t21[0], \"A\", rc0, \",\", rc0, \" 0 0,\", cr, \" \", t03[0]);\n }\n } else {\n path.push(\"L\", x2, \",\", y2);\n }\n } else {\n path.push(\"M\", x0, \",\", y0);\n if (x1 != null) path.push(\"A\", r1, \",\", r1, \" 0 \", l1, \",\", cw, \" \", x1, \",\", y1);\n path.push(\"L\", x2, \",\", y2);\n if (x3 != null) path.push(\"A\", r0, \",\", r0, \" 0 \", l0, \",\", 1 - cw, \" \", x3, \",\", y3);\n }\n path.push(\"Z\");\n return path.join(\"\");\n }\n function circleSegment(r1, cw) {\n return \"M0,\" + r1 + \"A\" + r1 + \",\" + r1 + \" 0 1,\" + cw + \" 0,\" + -r1 + \"A\" + r1 + \",\" + r1 + \" 0 1,\" + cw + \" 0,\" + r1;\n }\n arc.innerRadius = function(v) {\n if (!arguments.length) return innerRadius;\n innerRadius = d3_functor(v);\n return arc;\n };\n arc.outerRadius = function(v) {\n if (!arguments.length) return outerRadius;\n outerRadius = d3_functor(v);\n return arc;\n };\n arc.cornerRadius = function(v) {\n if (!arguments.length) return cornerRadius;\n cornerRadius = d3_functor(v);\n return arc;\n };\n arc.padRadius = function(v) {\n if (!arguments.length) return padRadius;\n padRadius = v == d3_svg_arcAuto ? d3_svg_arcAuto : d3_functor(v);\n return arc;\n };\n arc.startAngle = function(v) {\n if (!arguments.length) return startAngle;\n startAngle = d3_functor(v);\n return arc;\n };\n arc.endAngle = function(v) {\n if (!arguments.length) return endAngle;\n endAngle = d3_functor(v);\n return arc;\n };\n arc.padAngle = function(v) {\n if (!arguments.length) return padAngle;\n padAngle = d3_functor(v);\n return arc;\n };\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - halfπ;\n return [ Math.cos(a) * r, Math.sin(a) * r ];\n };\n return arc;\n };\n var d3_svg_arcAuto = \"auto\";\n function d3_svg_arcInnerRadius(d) {\n return d.innerRadius;\n }\n function d3_svg_arcOuterRadius(d) {\n return d.outerRadius;\n }\n function d3_svg_arcStartAngle(d) {\n return d.startAngle;\n }\n function d3_svg_arcEndAngle(d) {\n return d.endAngle;\n }\n function d3_svg_arcPadAngle(d) {\n return d && d.padAngle;\n }\n function d3_svg_arcSweep(x0, y0, x1, y1) {\n return (x0 - x1) * y0 - (y0 - y1) * x0 > 0 ? 0 : 1;\n }\n function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) {\n var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3;\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ];\n }\n function d3_svg_line(projection) {\n var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;\n function line(data) {\n var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);\n function segment() {\n segments.push(\"M\", interpolate(projection(points), tension));\n }\n while (++i < n) {\n if (defined.call(this, d = data[i], i)) {\n points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);\n } else if (points.length) {\n segment();\n points = [];\n }\n }\n if (points.length) segment();\n return segments.length ? segments.join(\"\") : null;\n }\n line.x = function(_) {\n if (!arguments.length) return x;\n x = _;\n return line;\n };\n line.y = function(_) {\n if (!arguments.length) return y;\n y = _;\n return line;\n };\n line.defined = function(_) {\n if (!arguments.length) return defined;\n defined = _;\n return line;\n };\n line.interpolate = function(_) {\n if (!arguments.length) return interpolateKey;\n if (typeof _ === \"function\") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;\n return line;\n };\n line.tension = function(_) {\n if (!arguments.length) return tension;\n tension = _;\n return line;\n };\n return line;\n }\n d3.svg.line = function() {\n return d3_svg_line(d3_identity);\n };\n var d3_svg_lineInterpolators = d3.map({\n linear: d3_svg_lineLinear,\n \"linear-closed\": d3_svg_lineLinearClosed,\n step: d3_svg_lineStep,\n \"step-before\": d3_svg_lineStepBefore,\n \"step-after\": d3_svg_lineStepAfter,\n basis: d3_svg_lineBasis,\n \"basis-open\": d3_svg_lineBasisOpen,\n \"basis-closed\": d3_svg_lineBasisClosed,\n bundle: d3_svg_lineBundle,\n cardinal: d3_svg_lineCardinal,\n \"cardinal-open\": d3_svg_lineCardinalOpen,\n \"cardinal-closed\": d3_svg_lineCardinalClosed,\n monotone: d3_svg_lineMonotone\n });\n d3_svg_lineInterpolators.forEach(function(key, value) {\n value.key = key;\n value.closed = /-closed$/.test(key);\n });\n function d3_svg_lineLinear(points) {\n return points.length > 1 ? points.join(\"L\") : points + \"Z\";\n }\n function d3_svg_lineLinearClosed(points) {\n return points.join(\"L\") + \"Z\";\n }\n function d3_svg_lineStep(points) {\n var i = 0, n = points.length, p = points[0], path = [ p[0], \",\", p[1] ];\n while (++i < n) path.push(\"H\", (p[0] + (p = points[i])[0]) / 2, \"V\", p[1]);\n if (n > 1) path.push(\"H\", p[0]);\n return path.join(\"\");\n }\n function d3_svg_lineStepBefore(points) {\n var i = 0, n = points.length, p = points[0], path = [ p[0], \",\", p[1] ];\n while (++i < n) path.push(\"V\", (p = points[i])[1], \"H\", p[0]);\n return path.join(\"\");\n }\n function d3_svg_lineStepAfter(points) {\n var i = 0, n = points.length, p = points[0], path = [ p[0], \",\", p[1] ];\n while (++i < n) path.push(\"H\", (p = points[i])[0], \"V\", p[1]);\n return path.join(\"\");\n }\n function d3_svg_lineCardinalOpen(points, tension) {\n return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension));\n }\n function d3_svg_lineCardinalClosed(points, tension) {\n return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), \n points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));\n }\n function d3_svg_lineCardinal(points, tension) {\n return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));\n }\n function d3_svg_lineHermite(points, tangents) {\n if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) {\n return d3_svg_lineLinear(points);\n }\n var quad = points.length != tangents.length, path = \"\", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;\n if (quad) {\n path += \"Q\" + (p[0] - t0[0] * 2 / 3) + \",\" + (p[1] - t0[1] * 2 / 3) + \",\" + p[0] + \",\" + p[1];\n p0 = points[1];\n pi = 2;\n }\n if (tangents.length > 1) {\n t = tangents[1];\n p = points[pi];\n pi++;\n path += \"C\" + (p0[0] + t0[0]) + \",\" + (p0[1] + t0[1]) + \",\" + (p[0] - t[0]) + \",\" + (p[1] - t[1]) + \",\" + p[0] + \",\" + p[1];\n for (var i = 2; i < tangents.length; i++, pi++) {\n p = points[pi];\n t = tangents[i];\n path += \"S\" + (p[0] - t[0]) + \",\" + (p[1] - t[1]) + \",\" + p[0] + \",\" + p[1];\n }\n }\n if (quad) {\n var lp = points[pi];\n path += \"Q\" + (p[0] + t[0] * 2 / 3) + \",\" + (p[1] + t[1] * 2 / 3) + \",\" + lp[0] + \",\" + lp[1];\n }\n return path;\n }\n function d3_svg_lineCardinalTangents(points, tension) {\n var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length;\n while (++i < n) {\n p0 = p1;\n p1 = p2;\n p2 = points[i];\n tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]);\n }\n return tangents;\n }\n function d3_svg_lineBasis(points) {\n if (points.length < 3) return d3_svg_lineLinear(points);\n var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, \",\", y0, \"L\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];\n points.push(points[n - 1]);\n while (++i <= n) {\n pi = points[i];\n px.shift();\n px.push(pi[0]);\n py.shift();\n py.push(pi[1]);\n d3_svg_lineBasisBezier(path, px, py);\n }\n points.pop();\n path.push(\"L\", pi);\n return path.join(\"\");\n }\n function d3_svg_lineBasisOpen(points) {\n if (points.length < 4) return d3_svg_lineLinear(points);\n var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];\n while (++i < 3) {\n pi = points[i];\n px.push(pi[0]);\n py.push(pi[1]);\n }\n path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + \",\" + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));\n --i;\n while (++i < n) {\n pi = points[i];\n px.shift();\n px.push(pi[0]);\n py.shift();\n py.push(pi[1]);\n d3_svg_lineBasisBezier(path, px, py);\n }\n return path.join(\"\");\n }\n function d3_svg_lineBasisClosed(points) {\n var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];\n while (++i < 4) {\n pi = points[i % n];\n px.push(pi[0]);\n py.push(pi[1]);\n }\n path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];\n --i;\n while (++i < m) {\n pi = points[i % n];\n px.shift();\n px.push(pi[0]);\n py.shift();\n py.push(pi[1]);\n d3_svg_lineBasisBezier(path, px, py);\n }\n return path.join(\"\");\n }\n function d3_svg_lineBundle(points, tension) {\n var n = points.length - 1;\n if (n) {\n var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t;\n while (++i <= n) {\n p = points[i];\n t = i / n;\n p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);\n p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);\n }\n }\n return d3_svg_lineBasis(points);\n }\n function d3_svg_lineDot4(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ];\n function d3_svg_lineBasisBezier(path, x, y) {\n path.push(\"C\", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));\n }\n function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n }\n function d3_svg_lineFiniteDifferences(points) {\n var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);\n while (++i < j) {\n m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;\n }\n m[i] = d;\n return m;\n }\n function d3_svg_lineMonotoneTangents(points) {\n var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;\n while (++i < j) {\n d = d3_svg_lineSlope(points[i], points[i + 1]);\n if (abs(d) < ε) {\n m[i] = m[i + 1] = 0;\n } else {\n a = m[i] / d;\n b = m[i + 1] / d;\n s = a * a + b * b;\n if (s > 9) {\n s = d * 3 / Math.sqrt(s);\n m[i] = s * a;\n m[i + 1] = s * b;\n }\n }\n }\n i = -1;\n while (++i <= j) {\n s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i]));\n tangents.push([ s || 0, m[i] * s || 0 ]);\n }\n return tangents;\n }\n function d3_svg_lineMonotone(points) {\n return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));\n }\n d3.svg.line.radial = function() {\n var line = d3_svg_line(d3_svg_lineRadial);\n line.radius = line.x, delete line.x;\n line.angle = line.y, delete line.y;\n return line;\n };\n function d3_svg_lineRadial(points) {\n var point, i = -1, n = points.length, r, a;\n while (++i < n) {\n point = points[i];\n r = point[0];\n a = point[1] - halfπ;\n point[0] = r * Math.cos(a);\n point[1] = r * Math.sin(a);\n }\n return points;\n }\n function d3_svg_area(projection) {\n var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = \"L\", tension = .7;\n function area(data) {\n var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {\n return x;\n } : d3_functor(x1), fy1 = y0 === y1 ? function() {\n return y;\n } : d3_functor(y1), x, y;\n function segment() {\n segments.push(\"M\", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), \"Z\");\n }\n while (++i < n) {\n if (defined.call(this, d = data[i], i)) {\n points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]);\n points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]);\n } else if (points0.length) {\n segment();\n points0 = [];\n points1 = [];\n }\n }\n if (points0.length) segment();\n return segments.length ? segments.join(\"\") : null;\n }\n area.x = function(_) {\n if (!arguments.length) return x1;\n x0 = x1 = _;\n return area;\n };\n area.x0 = function(_) {\n if (!arguments.length) return x0;\n x0 = _;\n return area;\n };\n area.x1 = function(_) {\n if (!arguments.length) return x1;\n x1 = _;\n return area;\n };\n area.y = function(_) {\n if (!arguments.length) return y1;\n y0 = y1 = _;\n return area;\n };\n area.y0 = function(_) {\n if (!arguments.length) return y0;\n y0 = _;\n return area;\n };\n area.y1 = function(_) {\n if (!arguments.length) return y1;\n y1 = _;\n return area;\n };\n area.defined = function(_) {\n if (!arguments.length) return defined;\n defined = _;\n return area;\n };\n area.interpolate = function(_) {\n if (!arguments.length) return interpolateKey;\n if (typeof _ === \"function\") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;\n interpolateReverse = interpolate.reverse || interpolate;\n L = interpolate.closed ? \"M\" : \"L\";\n return area;\n };\n area.tension = function(_) {\n if (!arguments.length) return tension;\n tension = _;\n return area;\n };\n return area;\n }\n d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;\n d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;\n d3.svg.area = function() {\n return d3_svg_area(d3_identity);\n };\n d3.svg.area.radial = function() {\n var area = d3_svg_area(d3_svg_lineRadial);\n area.radius = area.x, delete area.x;\n area.innerRadius = area.x0, delete area.x0;\n area.outerRadius = area.x1, delete area.x1;\n area.angle = area.y, delete area.y;\n area.startAngle = area.y0, delete area.y0;\n area.endAngle = area.y1, delete area.y1;\n return area;\n };\n d3.svg.chord = function() {\n var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;\n function chord(d, i) {\n var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);\n return \"M\" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + \"Z\";\n }\n function subgroup(self, f, d, i) {\n var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) - halfπ, a1 = endAngle.call(self, subgroup, i) - halfπ;\n return {\n r: r,\n a0: a0,\n a1: a1,\n p0: [ r * Math.cos(a0), r * Math.sin(a0) ],\n p1: [ r * Math.cos(a1), r * Math.sin(a1) ]\n };\n }\n function equals(a, b) {\n return a.a0 == b.a0 && a.a1 == b.a1;\n }\n function arc(r, p, a) {\n return \"A\" + r + \",\" + r + \" 0 \" + +(a > π) + \",1 \" + p;\n }\n function curve(r0, p0, r1, p1) {\n return \"Q 0,0 \" + p1;\n }\n chord.radius = function(v) {\n if (!arguments.length) return radius;\n radius = d3_functor(v);\n return chord;\n };\n chord.source = function(v) {\n if (!arguments.length) return source;\n source = d3_functor(v);\n return chord;\n };\n chord.target = function(v) {\n if (!arguments.length) return target;\n target = d3_functor(v);\n return chord;\n };\n chord.startAngle = function(v) {\n if (!arguments.length) return startAngle;\n startAngle = d3_functor(v);\n return chord;\n };\n chord.endAngle = function(v) {\n if (!arguments.length) return endAngle;\n endAngle = d3_functor(v);\n return chord;\n };\n return chord;\n };\n function d3_svg_chordRadius(d) {\n return d.radius;\n }\n d3.svg.diagonal = function() {\n var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection;\n function diagonal(d, i) {\n var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {\n x: p0.x,\n y: m\n }, {\n x: p3.x,\n y: m\n }, p3 ];\n p = p.map(projection);\n return \"M\" + p[0] + \"C\" + p[1] + \" \" + p[2] + \" \" + p[3];\n }\n diagonal.source = function(x) {\n if (!arguments.length) return source;\n source = d3_functor(x);\n return diagonal;\n };\n diagonal.target = function(x) {\n if (!arguments.length) return target;\n target = d3_functor(x);\n return diagonal;\n };\n diagonal.projection = function(x) {\n if (!arguments.length) return projection;\n projection = x;\n return diagonal;\n };\n return diagonal;\n };\n function d3_svg_diagonalProjection(d) {\n return [ d.x, d.y ];\n }\n d3.svg.diagonal.radial = function() {\n var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection;\n diagonal.projection = function(x) {\n return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection;\n };\n return diagonal;\n };\n function d3_svg_diagonalRadialProjection(projection) {\n return function() {\n var d = projection.apply(this, arguments), r = d[0], a = d[1] - halfπ;\n return [ r * Math.cos(a), r * Math.sin(a) ];\n };\n }\n d3.svg.symbol = function() {\n var type = d3_svg_symbolType, size = d3_svg_symbolSize;\n function symbol(d, i) {\n return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i));\n }\n symbol.type = function(x) {\n if (!arguments.length) return type;\n type = d3_functor(x);\n return symbol;\n };\n symbol.size = function(x) {\n if (!arguments.length) return size;\n size = d3_functor(x);\n return symbol;\n };\n return symbol;\n };\n function d3_svg_symbolSize() {\n return 64;\n }\n function d3_svg_symbolType() {\n return \"circle\";\n }\n function d3_svg_symbolCircle(size) {\n var r = Math.sqrt(size / π);\n return \"M0,\" + r + \"A\" + r + \",\" + r + \" 0 1,1 0,\" + -r + \"A\" + r + \",\" + r + \" 0 1,1 0,\" + r + \"Z\";\n }\n var d3_svg_symbols = d3.map({\n circle: d3_svg_symbolCircle,\n cross: function(size) {\n var r = Math.sqrt(size / 5) / 2;\n return \"M\" + -3 * r + \",\" + -r + \"H\" + -r + \"V\" + -3 * r + \"H\" + r + \"V\" + -r + \"H\" + 3 * r + \"V\" + r + \"H\" + r + \"V\" + 3 * r + \"H\" + -r + \"V\" + r + \"H\" + -3 * r + \"Z\";\n },\n diamond: function(size) {\n var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30;\n return \"M0,\" + -ry + \"L\" + rx + \",0\" + \" 0,\" + ry + \" \" + -rx + \",0\" + \"Z\";\n },\n square: function(size) {\n var r = Math.sqrt(size) / 2;\n return \"M\" + -r + \",\" + -r + \"L\" + r + \",\" + -r + \" \" + r + \",\" + r + \" \" + -r + \",\" + r + \"Z\";\n },\n \"triangle-down\": function(size) {\n var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;\n return \"M0,\" + ry + \"L\" + rx + \",\" + -ry + \" \" + -rx + \",\" + -ry + \"Z\";\n },\n \"triangle-up\": function(size) {\n var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;\n return \"M0,\" + -ry + \"L\" + rx + \",\" + ry + \" \" + -rx + \",\" + ry + \"Z\";\n }\n });\n d3.svg.symbolTypes = d3_svg_symbols.keys();\n var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);\n d3_selectionPrototype.transition = function(name) {\n var id = d3_transitionInheritId || ++d3_transitionId, ns = d3_transitionNamespace(name), subgroups = [], subgroup, node, transition = d3_transitionInherit || {\n time: Date.now(),\n ease: d3_ease_cubicInOut,\n delay: 0,\n duration: 250\n };\n for (var j = -1, m = this.length; ++j < m; ) {\n subgroups.push(subgroup = []);\n for (var group = this[j], i = -1, n = group.length; ++i < n; ) {\n if (node = group[i]) d3_transitionNode(node, i, ns, id, transition);\n subgroup.push(node);\n }\n }\n return d3_transition(subgroups, ns, id);\n };\n d3_selectionPrototype.interrupt = function(name) {\n return this.each(name == null ? d3_selection_interrupt : d3_selection_interruptNS(d3_transitionNamespace(name)));\n };\n var d3_selection_interrupt = d3_selection_interruptNS(d3_transitionNamespace());\n function d3_selection_interruptNS(ns) {\n return function() {\n var lock, activeId, active;\n if ((lock = this[ns]) && (active = lock[activeId = lock.active])) {\n active.timer.c = null;\n active.timer.t = NaN;\n if (--lock.count) delete lock[activeId]; else delete this[ns];\n lock.active += .5;\n active.event && active.event.interrupt.call(this, this.__data__, active.index);\n }\n };\n }\n function d3_transition(groups, ns, id) {\n d3_subclass(groups, d3_transitionPrototype);\n groups.namespace = ns;\n groups.id = id;\n return groups;\n }\n var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit;\n d3_transitionPrototype.call = d3_selectionPrototype.call;\n d3_transitionPrototype.empty = d3_selectionPrototype.empty;\n d3_transitionPrototype.node = d3_selectionPrototype.node;\n d3_transitionPrototype.size = d3_selectionPrototype.size;\n d3.transition = function(selection, name) {\n return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection);\n };\n d3.transition.prototype = d3_transitionPrototype;\n d3_transitionPrototype.select = function(selector) {\n var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnode, node;\n selector = d3_selection_selector(selector);\n for (var j = -1, m = this.length; ++j < m; ) {\n subgroups.push(subgroup = []);\n for (var group = this[j], i = -1, n = group.length; ++i < n; ) {\n if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n d3_transitionNode(subnode, i, ns, id, node[ns][id]);\n subgroup.push(subnode);\n } else {\n subgroup.push(null);\n }\n }\n }\n return d3_transition(subgroups, ns, id);\n };\n d3_transitionPrototype.selectAll = function(selector) {\n var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnodes, node, subnode, transition;\n selector = d3_selection_selectorAll(selector);\n for (var j = -1, m = this.length; ++j < m; ) {\n for (var group = this[j], i = -1, n = group.length; ++i < n; ) {\n if (node = group[i]) {\n transition = node[ns][id];\n subnodes = selector.call(node, node.__data__, i, j);\n subgroups.push(subgroup = []);\n for (var k = -1, o = subnodes.length; ++k < o; ) {\n if (subnode = subnodes[k]) d3_transitionNode(subnode, k, ns, id, transition);\n subgroup.push(subnode);\n }\n }\n }\n }\n return d3_transition(subgroups, ns, id);\n };\n d3_transitionPrototype.filter = function(filter) {\n var subgroups = [], subgroup, group, node;\n if (typeof filter !== \"function\") filter = d3_selection_filter(filter);\n for (var j = 0, m = this.length; j < m; j++) {\n subgroups.push(subgroup = []);\n for (var group = this[j], i = 0, n = group.length; i < n; i++) {\n if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {\n subgroup.push(node);\n }\n }\n }\n return d3_transition(subgroups, this.namespace, this.id);\n };\n d3_transitionPrototype.tween = function(name, tween) {\n var id = this.id, ns = this.namespace;\n if (arguments.length < 2) return this.node()[ns][id].tween.get(name);\n return d3_selection_each(this, tween == null ? function(node) {\n node[ns][id].tween.remove(name);\n } : function(node) {\n node[ns][id].tween.set(name, tween);\n });\n };\n function d3_transition_tween(groups, name, value, tween) {\n var id = groups.id, ns = groups.namespace;\n return d3_selection_each(groups, typeof value === \"function\" ? function(node, i, j) {\n node[ns][id].tween.set(name, tween(value.call(node, node.__data__, i, j)));\n } : (value = tween(value), function(node) {\n node[ns][id].tween.set(name, value);\n }));\n }\n d3_transitionPrototype.attr = function(nameNS, value) {\n if (arguments.length < 2) {\n for (value in nameNS) this.attr(value, nameNS[value]);\n return this;\n }\n var interpolate = nameNS == \"transform\" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS);\n function attrNull() {\n this.removeAttribute(name);\n }\n function attrNullNS() {\n this.removeAttributeNS(name.space, name.local);\n }\n function attrTween(b) {\n return b == null ? attrNull : (b += \"\", function() {\n var a = this.getAttribute(name), i;\n return a !== b && (i = interpolate(a, b), function(t) {\n this.setAttribute(name, i(t));\n });\n });\n }\n function attrTweenNS(b) {\n return b == null ? attrNullNS : (b += \"\", function() {\n var a = this.getAttributeNS(name.space, name.local), i;\n return a !== b && (i = interpolate(a, b), function(t) {\n this.setAttributeNS(name.space, name.local, i(t));\n });\n });\n }\n return d3_transition_tween(this, \"attr.\" + nameNS, value, name.local ? attrTweenNS : attrTween);\n };\n d3_transitionPrototype.attrTween = function(nameNS, tween) {\n var name = d3.ns.qualify(nameNS);\n function attrTween(d, i) {\n var f = tween.call(this, d, i, this.getAttribute(name));\n return f && function(t) {\n this.setAttribute(name, f(t));\n };\n }\n function attrTweenNS(d, i) {\n var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));\n return f && function(t) {\n this.setAttributeNS(name.space, name.local, f(t));\n };\n }\n return this.tween(\"attr.\" + nameNS, name.local ? attrTweenNS : attrTween);\n };\n d3_transitionPrototype.style = function(name, value, priority) {\n var n = arguments.length;\n if (n < 3) {\n if (typeof name !== \"string\") {\n if (n < 2) value = \"\";\n for (priority in name) this.style(priority, name[priority], value);\n return this;\n }\n priority = \"\";\n }\n function styleNull() {\n this.style.removeProperty(name);\n }\n function styleString(b) {\n return b == null ? styleNull : (b += \"\", function() {\n var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i;\n return a !== b && (i = d3_interpolate(a, b), function(t) {\n this.style.setProperty(name, i(t), priority);\n });\n });\n }\n return d3_transition_tween(this, \"style.\" + name, value, styleString);\n };\n d3_transitionPrototype.styleTween = function(name, tween, priority) {\n if (arguments.length < 3) priority = \"\";\n function styleTween(d, i) {\n var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));\n return f && function(t) {\n this.style.setProperty(name, f(t), priority);\n };\n }\n return this.tween(\"style.\" + name, styleTween);\n };\n d3_transitionPrototype.text = function(value) {\n return d3_transition_tween(this, \"text\", value, d3_transition_text);\n };\n function d3_transition_text(b) {\n if (b == null) b = \"\";\n return function() {\n this.textContent = b;\n };\n }\n d3_transitionPrototype.remove = function() {\n var ns = this.namespace;\n return this.each(\"end.transition\", function() {\n var p;\n if (this[ns].count < 2 && (p = this.parentNode)) p.removeChild(this);\n });\n };\n d3_transitionPrototype.ease = function(value) {\n var id = this.id, ns = this.namespace;\n if (arguments.length < 1) return this.node()[ns][id].ease;\n if (typeof value !== \"function\") value = d3.ease.apply(d3, arguments);\n return d3_selection_each(this, function(node) {\n node[ns][id].ease = value;\n });\n };\n d3_transitionPrototype.delay = function(value) {\n var id = this.id, ns = this.namespace;\n if (arguments.length < 1) return this.node()[ns][id].delay;\n return d3_selection_each(this, typeof value === \"function\" ? function(node, i, j) {\n node[ns][id].delay = +value.call(node, node.__data__, i, j);\n } : (value = +value, function(node) {\n node[ns][id].delay = value;\n }));\n };\n d3_transitionPrototype.duration = function(value) {\n var id = this.id, ns = this.namespace;\n if (arguments.length < 1) return this.node()[ns][id].duration;\n return d3_selection_each(this, typeof value === \"function\" ? function(node, i, j) {\n node[ns][id].duration = Math.max(1, value.call(node, node.__data__, i, j));\n } : (value = Math.max(1, value), function(node) {\n node[ns][id].duration = value;\n }));\n };\n d3_transitionPrototype.each = function(type, listener) {\n var id = this.id, ns = this.namespace;\n if (arguments.length < 2) {\n var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId;\n try {\n d3_transitionInheritId = id;\n d3_selection_each(this, function(node, i, j) {\n d3_transitionInherit = node[ns][id];\n type.call(node, node.__data__, i, j);\n });\n } finally {\n d3_transitionInherit = inherit;\n d3_transitionInheritId = inheritId;\n }\n } else {\n d3_selection_each(this, function(node) {\n var transition = node[ns][id];\n (transition.event || (transition.event = d3.dispatch(\"start\", \"end\", \"interrupt\"))).on(type, listener);\n });\n }\n return this;\n };\n d3_transitionPrototype.transition = function() {\n var id0 = this.id, id1 = ++d3_transitionId, ns = this.namespace, subgroups = [], subgroup, group, node, transition;\n for (var j = 0, m = this.length; j < m; j++) {\n subgroups.push(subgroup = []);\n for (var group = this[j], i = 0, n = group.length; i < n; i++) {\n if (node = group[i]) {\n transition = node[ns][id0];\n d3_transitionNode(node, i, ns, id1, {\n time: transition.time,\n ease: transition.ease,\n delay: transition.delay + transition.duration,\n duration: transition.duration\n });\n }\n subgroup.push(node);\n }\n }\n return d3_transition(subgroups, ns, id1);\n };\n function d3_transitionNamespace(name) {\n return name == null ? \"__transition__\" : \"__transition_\" + name + \"__\";\n }\n function d3_transitionNode(node, i, ns, id, inherit) {\n var lock = node[ns] || (node[ns] = {\n active: 0,\n count: 0\n }), transition = lock[id], time, timer, duration, ease, tweens;\n function schedule(elapsed) {\n var delay = transition.delay;\n timer.t = delay + time;\n if (delay <= elapsed) return start(elapsed - delay);\n timer.c = start;\n }\n function start(elapsed) {\n var activeId = lock.active, active = lock[activeId];\n if (active) {\n active.timer.c = null;\n active.timer.t = NaN;\n --lock.count;\n delete lock[activeId];\n active.event && active.event.interrupt.call(node, node.__data__, active.index);\n }\n for (var cancelId in lock) {\n if (+cancelId < id) {\n var cancel = lock[cancelId];\n cancel.timer.c = null;\n cancel.timer.t = NaN;\n --lock.count;\n delete lock[cancelId];\n }\n }\n timer.c = tick;\n d3_timer(function() {\n if (timer.c && tick(elapsed || 1)) {\n timer.c = null;\n timer.t = NaN;\n }\n return 1;\n }, 0, time);\n lock.active = id;\n transition.event && transition.event.start.call(node, node.__data__, i);\n tweens = [];\n transition.tween.forEach(function(key, value) {\n if (value = value.call(node, node.__data__, i)) {\n tweens.push(value);\n }\n });\n ease = transition.ease;\n duration = transition.duration;\n }\n function tick(elapsed) {\n var t = elapsed / duration, e = ease(t), n = tweens.length;\n while (n > 0) {\n tweens[--n].call(node, e);\n }\n if (t >= 1) {\n transition.event && transition.event.end.call(node, node.__data__, i);\n if (--lock.count) delete lock[id]; else delete node[ns];\n return 1;\n }\n }\n if (!transition) {\n time = inherit.time;\n timer = d3_timer(schedule, 0, time);\n transition = lock[id] = {\n tween: new d3_Map(),\n time: time,\n timer: timer,\n delay: inherit.delay,\n duration: inherit.duration,\n ease: inherit.ease,\n index: i\n };\n inherit = null;\n ++lock.count;\n }\n }\n d3.svg.axis = function() {\n var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;\n function axis(g) {\n g.each(function() {\n var g = d3.select(this);\n var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();\n var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(\".tick\").data(ticks, scale1), tickEnter = tick.enter().insert(\"g\", \".domain\").attr(\"class\", \"tick\").style(\"opacity\", ε), tickExit = d3.transition(tick.exit()).style(\"opacity\", ε).remove(), tickUpdate = d3.transition(tick.order()).style(\"opacity\", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform;\n var range = d3_scaleRange(scale1), path = g.selectAll(\".domain\").data([ 0 ]), pathUpdate = (path.enter().append(\"path\").attr(\"class\", \"domain\"), \n d3.transition(path));\n tickEnter.append(\"line\");\n tickEnter.append(\"text\");\n var lineEnter = tickEnter.select(\"line\"), lineUpdate = tickUpdate.select(\"line\"), text = tick.select(\"text\").text(tickFormat), textEnter = tickEnter.select(\"text\"), textUpdate = tickUpdate.select(\"text\"), sign = orient === \"top\" || orient === \"left\" ? -1 : 1, x1, x2, y1, y2;\n if (orient === \"bottom\" || orient === \"top\") {\n tickTransform = d3_svg_axisX, x1 = \"x\", y1 = \"y\", x2 = \"x2\", y2 = \"y2\";\n text.attr(\"dy\", sign < 0 ? \"0em\" : \".71em\").style(\"text-anchor\", \"middle\");\n pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + sign * outerTickSize + \"V0H\" + range[1] + \"V\" + sign * outerTickSize);\n } else {\n tickTransform = d3_svg_axisY, x1 = \"y\", y1 = \"x\", x2 = \"y2\", y2 = \"x2\";\n text.attr(\"dy\", \".32em\").style(\"text-anchor\", sign < 0 ? \"end\" : \"start\");\n pathUpdate.attr(\"d\", \"M\" + sign * outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + sign * outerTickSize);\n }\n lineEnter.attr(y2, sign * innerTickSize);\n textEnter.attr(y1, sign * tickSpacing);\n lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize);\n textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing);\n if (scale1.rangeBand) {\n var x = scale1, dx = x.rangeBand() / 2;\n scale0 = scale1 = function(d) {\n return x(d) + dx;\n };\n } else if (scale0.rangeBand) {\n scale0 = scale1;\n } else {\n tickExit.call(tickTransform, scale1, scale0);\n }\n tickEnter.call(tickTransform, scale0, scale1);\n tickUpdate.call(tickTransform, scale1, scale1);\n });\n }\n axis.scale = function(x) {\n if (!arguments.length) return scale;\n scale = x;\n return axis;\n };\n axis.orient = function(x) {\n if (!arguments.length) return orient;\n orient = x in d3_svg_axisOrients ? x + \"\" : d3_svg_axisDefaultOrient;\n return axis;\n };\n axis.ticks = function() {\n if (!arguments.length) return tickArguments_;\n tickArguments_ = d3_array(arguments);\n return axis;\n };\n axis.tickValues = function(x) {\n if (!arguments.length) return tickValues;\n tickValues = x;\n return axis;\n };\n axis.tickFormat = function(x) {\n if (!arguments.length) return tickFormat_;\n tickFormat_ = x;\n return axis;\n };\n axis.tickSize = function(x) {\n var n = arguments.length;\n if (!n) return innerTickSize;\n innerTickSize = +x;\n outerTickSize = +arguments[n - 1];\n return axis;\n };\n axis.innerTickSize = function(x) {\n if (!arguments.length) return innerTickSize;\n innerTickSize = +x;\n return axis;\n };\n axis.outerTickSize = function(x) {\n if (!arguments.length) return outerTickSize;\n outerTickSize = +x;\n return axis;\n };\n axis.tickPadding = function(x) {\n if (!arguments.length) return tickPadding;\n tickPadding = +x;\n return axis;\n };\n axis.tickSubdivide = function() {\n return arguments.length && axis;\n };\n return axis;\n };\n var d3_svg_axisDefaultOrient = \"bottom\", d3_svg_axisOrients = {\n top: 1,\n right: 1,\n bottom: 1,\n left: 1\n };\n function d3_svg_axisX(selection, x0, x1) {\n selection.attr(\"transform\", function(d) {\n var v0 = x0(d);\n return \"translate(\" + (isFinite(v0) ? v0 : x1(d)) + \",0)\";\n });\n }\n function d3_svg_axisY(selection, y0, y1) {\n selection.attr(\"transform\", function(d) {\n var v0 = y0(d);\n return \"translate(0,\" + (isFinite(v0) ? v0 : y1(d)) + \")\";\n });\n }\n d3.svg.brush = function() {\n var event = d3_eventDispatch(brush, \"brushstart\", \"brush\", \"brushend\"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0];\n function brush(g) {\n g.each(function() {\n var g = d3.select(this).style(\"pointer-events\", \"all\").style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\").on(\"mousedown.brush\", brushstart).on(\"touchstart.brush\", brushstart);\n var background = g.selectAll(\".background\").data([ 0 ]);\n background.enter().append(\"rect\").attr(\"class\", \"background\").style(\"visibility\", \"hidden\").style(\"cursor\", \"crosshair\");\n g.selectAll(\".extent\").data([ 0 ]).enter().append(\"rect\").attr(\"class\", \"extent\").style(\"cursor\", \"move\");\n var resize = g.selectAll(\".resize\").data(resizes, d3_identity);\n resize.exit().remove();\n resize.enter().append(\"g\").attr(\"class\", function(d) {\n return \"resize \" + d;\n }).style(\"cursor\", function(d) {\n return d3_svg_brushCursor[d];\n }).append(\"rect\").attr(\"x\", function(d) {\n return /[ew]$/.test(d) ? -3 : null;\n }).attr(\"y\", function(d) {\n return /^[ns]/.test(d) ? -3 : null;\n }).attr(\"width\", 6).attr(\"height\", 6).style(\"visibility\", \"hidden\");\n resize.style(\"display\", brush.empty() ? \"none\" : null);\n var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range;\n if (x) {\n range = d3_scaleRange(x);\n backgroundUpdate.attr(\"x\", range[0]).attr(\"width\", range[1] - range[0]);\n redrawX(gUpdate);\n }\n if (y) {\n range = d3_scaleRange(y);\n backgroundUpdate.attr(\"y\", range[0]).attr(\"height\", range[1] - range[0]);\n redrawY(gUpdate);\n }\n redraw(gUpdate);\n });\n }\n brush.event = function(g) {\n g.each(function() {\n var event_ = event.of(this, arguments), extent1 = {\n x: xExtent,\n y: yExtent,\n i: xExtentDomain,\n j: yExtentDomain\n }, extent0 = this.__chart__ || extent1;\n this.__chart__ = extent1;\n if (d3_transitionInheritId) {\n d3.select(this).transition().each(\"start.brush\", function() {\n xExtentDomain = extent0.i;\n yExtentDomain = extent0.j;\n xExtent = extent0.x;\n yExtent = extent0.y;\n event_({\n type: \"brushstart\"\n });\n }).tween(\"brush:brush\", function() {\n var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);\n xExtentDomain = yExtentDomain = null;\n return function(t) {\n xExtent = extent1.x = xi(t);\n yExtent = extent1.y = yi(t);\n event_({\n type: \"brush\",\n mode: \"resize\"\n });\n };\n }).each(\"end.brush\", function() {\n xExtentDomain = extent1.i;\n yExtentDomain = extent1.j;\n event_({\n type: \"brush\",\n mode: \"resize\"\n });\n event_({\n type: \"brushend\"\n });\n });\n } else {\n event_({\n type: \"brushstart\"\n });\n event_({\n type: \"brush\",\n mode: \"resize\"\n });\n event_({\n type: \"brushend\"\n });\n }\n });\n };\n function redraw(g) {\n g.selectAll(\".resize\").attr(\"transform\", function(d) {\n return \"translate(\" + xExtent[+/e$/.test(d)] + \",\" + yExtent[+/^s/.test(d)] + \")\";\n });\n }\n function redrawX(g) {\n g.select(\".extent\").attr(\"x\", xExtent[0]);\n g.selectAll(\".extent,.n>rect,.s>rect\").attr(\"width\", xExtent[1] - xExtent[0]);\n }\n function redrawY(g) {\n g.select(\".extent\").attr(\"y\", yExtent[0]);\n g.selectAll(\".extent,.e>rect,.w>rect\").attr(\"height\", yExtent[1] - yExtent[0]);\n }\n function brushstart() {\n var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed(\"extent\"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset;\n var w = d3.select(d3_window(target)).on(\"keydown.brush\", keydown).on(\"keyup.brush\", keyup);\n if (d3.event.changedTouches) {\n w.on(\"touchmove.brush\", brushmove).on(\"touchend.brush\", brushend);\n } else {\n w.on(\"mousemove.brush\", brushmove).on(\"mouseup.brush\", brushend);\n }\n g.interrupt().selectAll(\"*\").interrupt();\n if (dragging) {\n origin[0] = xExtent[0] - origin[0];\n origin[1] = yExtent[0] - origin[1];\n } else if (resizing) {\n var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing);\n offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ];\n origin[0] = xExtent[ex];\n origin[1] = yExtent[ey];\n } else if (d3.event.altKey) center = origin.slice();\n g.style(\"pointer-events\", \"none\").selectAll(\".resize\").style(\"display\", null);\n d3.select(\"body\").style(\"cursor\", eventTarget.style(\"cursor\"));\n event_({\n type: \"brushstart\"\n });\n brushmove();\n function keydown() {\n if (d3.event.keyCode == 32) {\n if (!dragging) {\n center = null;\n origin[0] -= xExtent[1];\n origin[1] -= yExtent[1];\n dragging = 2;\n }\n d3_eventPreventDefault();\n }\n }\n function keyup() {\n if (d3.event.keyCode == 32 && dragging == 2) {\n origin[0] += xExtent[1];\n origin[1] += yExtent[1];\n dragging = 0;\n d3_eventPreventDefault();\n }\n }\n function brushmove() {\n var point = d3.mouse(target), moved = false;\n if (offset) {\n point[0] += offset[0];\n point[1] += offset[1];\n }\n if (!dragging) {\n if (d3.event.altKey) {\n if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ];\n origin[0] = xExtent[+(point[0] < center[0])];\n origin[1] = yExtent[+(point[1] < center[1])];\n } else center = null;\n }\n if (resizingX && move1(point, x, 0)) {\n redrawX(g);\n moved = true;\n }\n if (resizingY && move1(point, y, 1)) {\n redrawY(g);\n moved = true;\n }\n if (moved) {\n redraw(g);\n event_({\n type: \"brush\",\n mode: dragging ? \"move\" : \"resize\"\n });\n }\n }\n function move1(point, scale, i) {\n var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max;\n if (dragging) {\n r0 -= position;\n r1 -= size + position;\n }\n min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i];\n if (dragging) {\n max = (min += position) + size;\n } else {\n if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));\n if (position < min) {\n max = min;\n min = position;\n } else {\n max = position;\n }\n }\n if (extent[0] != min || extent[1] != max) {\n if (i) yExtentDomain = null; else xExtentDomain = null;\n extent[0] = min;\n extent[1] = max;\n return true;\n }\n }\n function brushend() {\n brushmove();\n g.style(\"pointer-events\", \"all\").selectAll(\".resize\").style(\"display\", brush.empty() ? \"none\" : null);\n d3.select(\"body\").style(\"cursor\", null);\n w.on(\"mousemove.brush\", null).on(\"mouseup.brush\", null).on(\"touchmove.brush\", null).on(\"touchend.brush\", null).on(\"keydown.brush\", null).on(\"keyup.brush\", null);\n dragRestore();\n event_({\n type: \"brushend\"\n });\n }\n }\n brush.x = function(z) {\n if (!arguments.length) return x;\n x = z;\n resizes = d3_svg_brushResizes[!x << 1 | !y];\n return brush;\n };\n brush.y = function(z) {\n if (!arguments.length) return y;\n y = z;\n resizes = d3_svg_brushResizes[!x << 1 | !y];\n return brush;\n };\n brush.clamp = function(z) {\n if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null;\n if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z;\n return brush;\n };\n brush.extent = function(z) {\n var x0, x1, y0, y1, t;\n if (!arguments.length) {\n if (x) {\n if (xExtentDomain) {\n x0 = xExtentDomain[0], x1 = xExtentDomain[1];\n } else {\n x0 = xExtent[0], x1 = xExtent[1];\n if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1);\n if (x1 < x0) t = x0, x0 = x1, x1 = t;\n }\n }\n if (y) {\n if (yExtentDomain) {\n y0 = yExtentDomain[0], y1 = yExtentDomain[1];\n } else {\n y0 = yExtent[0], y1 = yExtent[1];\n if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1);\n if (y1 < y0) t = y0, y0 = y1, y1 = t;\n }\n }\n return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ];\n }\n if (x) {\n x0 = z[0], x1 = z[1];\n if (y) x0 = x0[0], x1 = x1[0];\n xExtentDomain = [ x0, x1 ];\n if (x.invert) x0 = x(x0), x1 = x(x1);\n if (x1 < x0) t = x0, x0 = x1, x1 = t;\n if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];\n }\n if (y) {\n y0 = z[0], y1 = z[1];\n if (x) y0 = y0[1], y1 = y1[1];\n yExtentDomain = [ y0, y1 ];\n if (y.invert) y0 = y(y0), y1 = y(y1);\n if (y1 < y0) t = y0, y0 = y1, y1 = t;\n if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];\n }\n return brush;\n };\n brush.clear = function() {\n if (!brush.empty()) {\n xExtent = [ 0, 0 ], yExtent = [ 0, 0 ];\n xExtentDomain = yExtentDomain = null;\n }\n return brush;\n };\n brush.empty = function() {\n return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];\n };\n return d3.rebind(brush, event, \"on\");\n };\n var d3_svg_brushCursor = {\n n: \"ns-resize\",\n e: \"ew-resize\",\n s: \"ns-resize\",\n w: \"ew-resize\",\n nw: \"nwse-resize\",\n ne: \"nesw-resize\",\n se: \"nwse-resize\",\n sw: \"nesw-resize\"\n };\n var d3_svg_brushResizes = [ [ \"n\", \"e\", \"s\", \"w\", \"nw\", \"ne\", \"se\", \"sw\" ], [ \"e\", \"w\" ], [ \"n\", \"s\" ], [] ];\n var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat;\n var d3_time_formatUtc = d3_time_format.utc;\n var d3_time_formatIso = d3_time_formatUtc(\"%Y-%m-%dT%H:%M:%S.%LZ\");\n d3_time_format.iso = Date.prototype.toISOString && +new Date(\"2000-01-01T00:00:00.000Z\") ? d3_time_formatIsoNative : d3_time_formatIso;\n function d3_time_formatIsoNative(date) {\n return date.toISOString();\n }\n d3_time_formatIsoNative.parse = function(string) {\n var date = new Date(string);\n return isNaN(date) ? null : date;\n };\n d3_time_formatIsoNative.toString = d3_time_formatIso.toString;\n d3_time.second = d3_time_interval(function(date) {\n return new d3_date(Math.floor(date / 1e3) * 1e3);\n }, function(date, offset) {\n date.setTime(date.getTime() + Math.floor(offset) * 1e3);\n }, function(date) {\n return date.getSeconds();\n });\n d3_time.seconds = d3_time.second.range;\n d3_time.seconds.utc = d3_time.second.utc.range;\n d3_time.minute = d3_time_interval(function(date) {\n return new d3_date(Math.floor(date / 6e4) * 6e4);\n }, function(date, offset) {\n date.setTime(date.getTime() + Math.floor(offset) * 6e4);\n }, function(date) {\n return date.getMinutes();\n });\n d3_time.minutes = d3_time.minute.range;\n d3_time.minutes.utc = d3_time.minute.utc.range;\n d3_time.hour = d3_time_interval(function(date) {\n var timezone = date.getTimezoneOffset() / 60;\n return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);\n }, function(date, offset) {\n date.setTime(date.getTime() + Math.floor(offset) * 36e5);\n }, function(date) {\n return date.getHours();\n });\n d3_time.hours = d3_time.hour.range;\n d3_time.hours.utc = d3_time.hour.utc.range;\n d3_time.month = d3_time_interval(function(date) {\n date = d3_time.day(date);\n date.setDate(1);\n return date;\n }, function(date, offset) {\n date.setMonth(date.getMonth() + offset);\n }, function(date) {\n return date.getMonth();\n });\n d3_time.months = d3_time.month.range;\n d3_time.months.utc = d3_time.month.utc.range;\n function d3_time_scale(linear, methods, format) {\n function scale(x) {\n return linear(x);\n }\n scale.invert = function(x) {\n return d3_time_scaleDate(linear.invert(x));\n };\n scale.domain = function(x) {\n if (!arguments.length) return linear.domain().map(d3_time_scaleDate);\n linear.domain(x);\n return scale;\n };\n function tickMethod(extent, count) {\n var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target);\n return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) {\n return d / 31536e6;\n }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i];\n }\n scale.nice = function(interval, skip) {\n var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === \"number\" && tickMethod(extent, interval);\n if (method) interval = method[0], skip = method[1];\n function skipped(date) {\n return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length;\n }\n return scale.domain(d3_scale_nice(domain, skip > 1 ? {\n floor: function(date) {\n while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1);\n return date;\n },\n ceil: function(date) {\n while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1);\n return date;\n }\n } : interval));\n };\n scale.ticks = function(interval, skip) {\n var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === \"number\" ? tickMethod(extent, interval) : !interval.range && [ {\n range: interval\n }, skip ];\n if (method) interval = method[0], skip = method[1];\n return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip);\n };\n scale.tickFormat = function() {\n return format;\n };\n scale.copy = function() {\n return d3_time_scale(linear.copy(), methods, format);\n };\n return d3_scale_linearRebind(scale, linear);\n }\n function d3_time_scaleDate(t) {\n return new Date(t);\n }\n var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];\n var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ];\n var d3_time_scaleLocalFormat = d3_time_format.multi([ [ \".%L\", function(d) {\n return d.getMilliseconds();\n } ], [ \":%S\", function(d) {\n return d.getSeconds();\n } ], [ \"%I:%M\", function(d) {\n return d.getMinutes();\n } ], [ \"%I %p\", function(d) {\n return d.getHours();\n } ], [ \"%a %d\", function(d) {\n return d.getDay() && d.getDate() != 1;\n } ], [ \"%b %d\", function(d) {\n return d.getDate() != 1;\n } ], [ \"%B\", function(d) {\n return d.getMonth();\n } ], [ \"%Y\", d3_true ] ]);\n var d3_time_scaleMilliseconds = {\n range: function(start, stop, step) {\n return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);\n },\n floor: d3_identity,\n ceil: d3_identity\n };\n d3_time_scaleLocalMethods.year = d3_time.year;\n d3_time.scale = function() {\n return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat);\n };\n var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) {\n return [ m[0].utc, m[1] ];\n });\n var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ \".%L\", function(d) {\n return d.getUTCMilliseconds();\n } ], [ \":%S\", function(d) {\n return d.getUTCSeconds();\n } ], [ \"%I:%M\", function(d) {\n return d.getUTCMinutes();\n } ], [ \"%I %p\", function(d) {\n return d.getUTCHours();\n } ], [ \"%a %d\", function(d) {\n return d.getUTCDay() && d.getUTCDate() != 1;\n } ], [ \"%b %d\", function(d) {\n return d.getUTCDate() != 1;\n } ], [ \"%B\", function(d) {\n return d.getUTCMonth();\n } ], [ \"%Y\", d3_true ] ]);\n d3_time_scaleUtcMethods.year = d3_time.year.utc;\n d3_time.scale.utc = function() {\n return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat);\n };\n d3.text = d3_xhrType(function(request) {\n return request.responseText;\n });\n d3.json = function(url, callback) {\n return d3_xhr(url, \"application/json\", d3_json, callback);\n };\n function d3_json(request) {\n return JSON.parse(request.responseText);\n }\n d3.html = function(url, callback) {\n return d3_xhr(url, \"text/html\", d3_html, callback);\n };\n function d3_html(request) {\n var range = d3_document.createRange();\n range.selectNode(d3_document.body);\n return range.createContextualFragment(request.responseText);\n }\n d3.xml = d3_xhrType(function(request) {\n return request.responseXML;\n });\n if (typeof define === \"function\" && define.amd) this.d3 = d3, define(d3); else if (typeof module === \"object\" && module.exports) module.exports = d3; else this.d3 = d3;\n}();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/d3/d3.js\n// module id = 3\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar tinycolor = require('tinycolor2');\nvar isNumeric = require('fast-isnumeric');\n\nvar color = module.exports = {};\n\nvar colorAttrs = require('./attributes');\ncolor.defaults = colorAttrs.defaults;\nvar defaultLine = color.defaultLine = colorAttrs.defaultLine;\ncolor.lightLine = colorAttrs.lightLine;\nvar background = color.background = colorAttrs.background;\n\n/*\n * tinyRGB: turn a tinycolor into an rgb string, but\n * unlike the built-in tinycolor.toRgbString this never includes alpha\n */\ncolor.tinyRGB = function(tc) {\n var c = tc.toRgb();\n return 'rgb(' + Math.round(c.r) + ', ' +\n Math.round(c.g) + ', ' + Math.round(c.b) + ')';\n};\n\ncolor.rgb = function(cstr) { return color.tinyRGB(tinycolor(cstr)); };\n\ncolor.opacity = function(cstr) { return cstr ? tinycolor(cstr).getAlpha() : 0; };\n\ncolor.addOpacity = function(cstr, op) {\n var c = tinycolor(cstr).toRgb();\n return 'rgba(' + Math.round(c.r) + ', ' +\n Math.round(c.g) + ', ' + Math.round(c.b) + ', ' + op + ')';\n};\n\n// combine two colors into one apparent color\n// if back has transparency or is missing,\n// color.background is assumed behind it\ncolor.combine = function(front, back) {\n var fc = tinycolor(front).toRgb();\n if(fc.a === 1) return tinycolor(front).toRgbString();\n\n var bc = tinycolor(back || background).toRgb(),\n bcflat = bc.a === 1 ? bc : {\n r: 255 * (1 - bc.a) + bc.r * bc.a,\n g: 255 * (1 - bc.a) + bc.g * bc.a,\n b: 255 * (1 - bc.a) + bc.b * bc.a\n },\n fcflat = {\n r: bcflat.r * (1 - fc.a) + fc.r * fc.a,\n g: bcflat.g * (1 - fc.a) + fc.g * fc.a,\n b: bcflat.b * (1 - fc.a) + fc.b * fc.a\n };\n return tinycolor(fcflat).toRgbString();\n};\n\n/*\n * Create a color that contrasts with cstr.\n *\n * If cstr is a dark color, we lighten it; if it's light, we darken.\n *\n * If lightAmount / darkAmount are used, we adjust by these percentages,\n * otherwise we go all the way to white or black.\n */\ncolor.contrast = function(cstr, lightAmount, darkAmount) {\n var tc = tinycolor(cstr);\n\n if(tc.getAlpha() !== 1) tc = tinycolor(color.combine(cstr, background));\n\n var newColor = tc.isDark() ?\n (lightAmount ? tc.lighten(lightAmount) : background) :\n (darkAmount ? tc.darken(darkAmount) : defaultLine);\n\n return newColor.toString();\n};\n\ncolor.stroke = function(s, c) {\n var tc = tinycolor(c);\n s.style({'stroke': color.tinyRGB(tc), 'stroke-opacity': tc.getAlpha()});\n};\n\ncolor.fill = function(s, c) {\n var tc = tinycolor(c);\n s.style({\n 'fill': color.tinyRGB(tc),\n 'fill-opacity': tc.getAlpha()\n });\n};\n\n// search container for colors with the deprecated rgb(fractions) format\n// and convert them to rgb(0-255 values)\ncolor.clean = function(container) {\n if(!container || typeof container !== 'object') return;\n\n var keys = Object.keys(container),\n i,\n j,\n key,\n val;\n\n for(i = 0; i < keys.length; i++) {\n key = keys[i];\n val = container[key];\n\n // only sanitize keys that end in \"color\" or \"colorscale\"\n if(key.substr(key.length - 5) === 'color') {\n if(Array.isArray(val)) {\n for(j = 0; j < val.length; j++) val[j] = cleanOne(val[j]);\n }\n else container[key] = cleanOne(val);\n }\n else if(key.substr(key.length - 10) === 'colorscale' && Array.isArray(val)) {\n // colorscales have the format [[0, color1], [frac, color2], ... [1, colorN]]\n for(j = 0; j < val.length; j++) {\n if(Array.isArray(val[j])) val[j][1] = cleanOne(val[j][1]);\n }\n }\n // recurse into arrays of objects, and plain objects\n else if(Array.isArray(val)) {\n var el0 = val[0];\n if(!Array.isArray(el0) && el0 && typeof el0 === 'object') {\n for(j = 0; j < val.length; j++) color.clean(val[j]);\n }\n }\n else if(val && typeof val === 'object') color.clean(val);\n }\n};\n\nfunction cleanOne(val) {\n if(isNumeric(val) || typeof val !== 'string') return val;\n\n var valTrim = val.trim();\n if(valTrim.substr(0, 3) !== 'rgb') return val;\n\n var match = valTrim.match(/^rgba?\\s*\\(([^()]*)\\)$/);\n if(!match) return val;\n\n var parts = match[1].trim().split(/\\s*[\\s,]\\s*/),\n rgba = valTrim.charAt(3) === 'a' && parts.length === 4;\n if(!rgba && parts.length !== 3) return val;\n\n for(var i = 0; i < parts.length; i++) {\n if(!parts[i].length) return val;\n parts[i] = Number(parts[i]);\n\n // all parts must be non-negative numbers\n if(!(parts[i] >= 0)) return val;\n // alpha>1 gets clipped to 1\n if(i === 3) {\n if(parts[i] > 1) parts[i] = 1;\n }\n // r, g, b must be < 1 (ie 1 itself is not allowed)\n else if(parts[i] >= 1) return val;\n }\n\n var rgbStr = Math.round(parts[0] * 255) + ', ' +\n Math.round(parts[1] * 255) + ', ' +\n Math.round(parts[2] * 255);\n\n if(rgba) return 'rgba(' + rgbStr + ', ' + parts[3] + ')';\n return 'rgb(' + rgbStr + ')';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/color/index.js\n// module id = 4\n// module chunks = 0","/**\n * inspired by is-number \n * but significantly simplified and sped up by ignoring number and string constructors\n * ie these return false:\n * new Number(1)\n * new String('1')\n */\n\n'use strict';\n\n/**\n * Is this string all whitespace?\n * This solution kind of makes my brain hurt, but it's significantly faster\n * than !str.trim() or any other solution I could find.\n *\n * whitespace codes from: http://en.wikipedia.org/wiki/Whitespace_character\n * and verified with:\n *\n * for(var i = 0; i < 65536; i++) {\n * var s = String.fromCharCode(i);\n * if(+s===0 && !s.trim()) console.log(i, s);\n * }\n *\n * which counts a couple of these as *not* whitespace, but finds nothing else\n * that *is* whitespace. Note that charCodeAt stops at 16 bits, but it appears\n * that there are no whitespace characters above this, and code points above\n * this do not map onto white space characters.\n */\nfunction allBlankCharCodes(str){\n var l = str.length,\n a;\n for(var i = 0; i < l; i++) {\n a = str.charCodeAt(i);\n if((a < 9 || a > 13) && (a !== 32) && (a !== 133) && (a !== 160) &&\n (a !== 5760) && (a !== 6158) && (a < 8192 || a > 8205) &&\n (a !== 8232) && (a !== 8233) && (a !== 8239) && (a !== 8287) &&\n (a !== 8288) && (a !== 12288) && (a !== 65279)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = function(n) {\n var type = typeof n;\n if(type === 'string') {\n var original = n;\n n = +n;\n // whitespace strings cast to zero - filter them out\n if(n===0 && allBlankCharCodes(original)) return false;\n }\n else if(type !== 'number') return false;\n\n return n - n < 1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fast-isnumeric/index.js\n// module id = 5\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Loggers = require('./lib/loggers');\nvar noop = require('./lib/noop');\nvar pushUnique = require('./lib/push_unique');\nvar ExtendModule = require('./lib/extend');\nvar extendFlat = ExtendModule.extendFlat;\nvar extendDeepAll = ExtendModule.extendDeepAll;\n\nvar basePlotAttributes = require('./plots/attributes');\nvar baseLayoutAttributes = require('./plots/layout_attributes');\n\nexports.modules = {};\nexports.allCategories = {};\nexports.allTypes = [];\nexports.subplotsRegistry = {};\nexports.transformsRegistry = {};\nexports.componentsRegistry = {};\nexports.layoutArrayContainers = [];\nexports.layoutArrayRegexes = [];\nexports.traceLayoutAttributes = {};\n\n/**\n * register a module as the handler for a trace type\n *\n * @param {object} _module the module that will handle plotting this trace type\n * @param {string} thisType\n * @param {array of strings} categoriesIn all the categories this type is in,\n * tested by calls: traceIs(trace, oneCategory)\n * @param {object} meta meta information about the trace type\n */\nexports.register = function(_module, thisType, categoriesIn, meta) {\n if(exports.modules[thisType]) {\n Loggers.log('Type ' + thisType + ' already registered');\n return;\n }\n\n var categoryObj = {};\n for(var i = 0; i < categoriesIn.length; i++) {\n categoryObj[categoriesIn[i]] = true;\n exports.allCategories[categoriesIn[i]] = true;\n }\n\n exports.modules[thisType] = {\n _module: _module,\n categories: categoryObj\n };\n\n if(meta && Object.keys(meta).length) {\n exports.modules[thisType].meta = meta;\n }\n\n exports.allTypes.push(thisType);\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToTrace(componentName, thisType);\n }\n\n /*\n * Collect all trace layout attributes in one place for easier lookup later\n * but don't merge them into the base schema as it would confuse the docs\n * (at least after https://github.com/plotly/documentation/issues/202 gets done!)\n */\n if(_module.layoutAttributes) {\n extendFlat(exports.traceLayoutAttributes, _module.layoutAttributes);\n }\n};\n\n/**\n * register a subplot type\n *\n * @param {object} _module subplot module:\n *\n * @param {string or array of strings} attr\n * attribute name in traces and layout\n * @param {string or array of strings} idRoot\n * root of id (setting the possible value for attrName)\n * @param {object} attributes\n * attribute(s) for traces of this subplot type\n *\n * In trace objects `attr` is the object key taking a valid `id` as value\n * (the set of all valid ids is generated below and stored in idRegex).\n *\n * In the layout object, a or several valid `attr` name(s) can be keys linked\n * to a nested attribute objects\n * (the set of all valid attr names is generated below and stored in attrRegex).\n */\nexports.registerSubplot = function(_module) {\n var plotType = _module.name;\n\n if(exports.subplotsRegistry[plotType]) {\n Loggers.log('Plot type ' + plotType + ' already registered.');\n return;\n }\n\n // relayout array handling will look for component module methods with this\n // name and won't find them because this is a subplot module... but that\n // should be fine, it will just fall back on redrawing the plot.\n findArrayRegexps(_module);\n\n // not sure what's best for the 'cartesian' type at this point\n exports.subplotsRegistry[plotType] = _module;\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToSubplot(componentName, _module.name);\n }\n};\n\nexports.registerComponent = function(_module) {\n var name = _module.name;\n\n exports.componentsRegistry[name] = _module;\n\n if(_module.layoutAttributes) {\n if(_module.layoutAttributes._isLinkedToArray) {\n pushUnique(exports.layoutArrayContainers, name);\n }\n findArrayRegexps(_module);\n }\n\n for(var traceType in exports.modules) {\n mergeComponentAttrsToTrace(name, traceType);\n }\n\n for(var subplotName in exports.subplotsRegistry) {\n mergeComponentAttrsToSubplot(name, subplotName);\n }\n\n for(var transformType in exports.transformsRegistry) {\n mergeComponentAttrsToTransform(name, transformType);\n }\n\n if(_module.schema && _module.schema.layout) {\n extendDeepAll(baseLayoutAttributes, _module.schema.layout);\n }\n};\n\nexports.registerTransform = function(_module) {\n exports.transformsRegistry[_module.name] = _module;\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToTransform(componentName, _module.name);\n }\n};\n\nfunction findArrayRegexps(_module) {\n if(_module.layoutAttributes) {\n var arrayAttrRegexps = _module.layoutAttributes._arrayAttrRegexps;\n if(arrayAttrRegexps) {\n for(var i = 0; i < arrayAttrRegexps.length; i++) {\n pushUnique(exports.layoutArrayRegexes, arrayAttrRegexps[i]);\n }\n }\n }\n}\n\nfunction mergeComponentAttrsToTrace(componentName, traceType) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.traces) return;\n\n var traceAttrs = componentSchema.traces[traceType];\n if(traceAttrs) {\n extendDeepAll(exports.modules[traceType]._module.attributes, traceAttrs);\n }\n}\n\nfunction mergeComponentAttrsToTransform(componentName, transformType) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.transforms) return;\n\n var transformAttrs = componentSchema.transforms[transformType];\n if(transformAttrs) {\n extendDeepAll(exports.transformsRegistry[transformType].attributes, transformAttrs);\n }\n}\n\nfunction mergeComponentAttrsToSubplot(componentName, subplotName) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.subplots) return;\n\n var subplotModule = exports.subplotsRegistry[subplotName];\n var subplotAttrs = subplotModule.layoutAttributes;\n var subplotAttr = subplotModule.attr === 'subplot' ? subplotModule.name : subplotModule.attr;\n if(Array.isArray(subplotAttr)) subplotAttr = subplotAttr[0];\n\n var componentLayoutAttrs = componentSchema.subplots[subplotAttr];\n if(subplotAttrs && componentLayoutAttrs) {\n extendDeepAll(subplotAttrs, componentLayoutAttrs);\n }\n}\n\n/**\n * Get registered module using trace object or trace type\n *\n * @param {object||string} trace\n * trace object with prop 'type' or trace type as a string\n * @return {object}\n * module object corresponding to trace type\n */\nexports.getModule = function(trace) {\n if(trace.r !== undefined) {\n Loggers.warn('Tried to put a polar trace ' +\n 'on an incompatible graph of cartesian ' +\n 'data. Ignoring this dataset.', trace\n );\n return false;\n }\n\n var _module = exports.modules[getTraceType(trace)];\n if(!_module) return false;\n return _module._module;\n};\n\n/**\n * Determine if this trace type is in a given category\n *\n * @param {object||string} traceType\n * a trace (object) or trace type (string)\n * @param {string} category\n * category in question\n * @return {boolean}\n */\nexports.traceIs = function(traceType, category) {\n traceType = getTraceType(traceType);\n\n // old plot.ly workspace hack, nothing to see here\n if(traceType === 'various') return false;\n\n var _module = exports.modules[traceType];\n\n if(!_module) {\n if(traceType && traceType !== 'area') {\n Loggers.log('Unrecognized trace type ' + traceType + '.');\n }\n\n _module = exports.modules[basePlotAttributes.type.dflt];\n }\n\n return !!_module.categories[category];\n};\n\n/**\n * Determine if this trace has a transform of the given type and return\n * array of matching indices.\n *\n * @param {object} data\n * a trace object (member of data or fullData)\n * @param {string} type\n * type of trace to test\n * @return {array}\n * array of matching indices. If none found, returns []\n */\nexports.getTransformIndices = function(data, type) {\n var indices = [];\n var transforms = data.transforms || [];\n for(var i = 0; i < transforms.length; i++) {\n if(transforms[i].type === type) {\n indices.push(i);\n }\n }\n return indices;\n};\n\n/**\n * Determine if this trace has a transform of the given type\n *\n * @param {object} data\n * a trace object (member of data or fullData)\n * @param {string} type\n * type of trace to test\n * @return {boolean}\n */\nexports.hasTransform = function(data, type) {\n var transforms = data.transforms || [];\n for(var i = 0; i < transforms.length; i++) {\n if(transforms[i].type === type) {\n return true;\n }\n }\n return false;\n\n};\n\n/**\n * Retrieve component module method. Falls back on noop if either the\n * module or the method is missing, so the result can always be safely called\n *\n * @param {string} name\n * name of component (as declared in component module)\n * @param {string} method\n * name of component module method\n * @return {function}\n */\nexports.getComponentMethod = function(name, method) {\n var _module = exports.componentsRegistry[name];\n\n if(!_module) return noop;\n return _module[method] || noop;\n};\n\nfunction getTraceType(traceType) {\n if(typeof traceType === 'object') traceType = traceType.type;\n return traceType;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/registry.js\n// module id = 7\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\nvar tinycolor = require('tinycolor2');\n\nvar Registry = require('../../registry');\nvar Color = require('../color');\nvar Colorscale = require('../colorscale');\nvar Lib = require('../../lib');\nvar svgTextUtils = require('../../lib/svg_text_utils');\n\nvar xmlnsNamespaces = require('../../constants/xmlns_namespaces');\nvar alignment = require('../../constants/alignment');\nvar LINE_SPACING = alignment.LINE_SPACING;\n\nvar subTypes = require('../../traces/scatter/subtypes');\nvar makeBubbleSizeFn = require('../../traces/scatter/make_bubble_size_func');\n\nvar drawing = module.exports = {};\n\n// -----------------------------------------------------\n// styling functions for plot elements\n// -----------------------------------------------------\n\ndrawing.font = function(s, family, size, color) {\n // also allow the form font(s, {family, size, color})\n if(Lib.isPlainObject(family)) {\n color = family.color;\n size = family.size;\n family = family.family;\n }\n if(family) s.style('font-family', family);\n if(size + 1) s.style('font-size', size + 'px');\n if(color) s.call(Color.fill, color);\n};\n\n/*\n * Positioning helpers\n * Note: do not use `setPosition` with nodes modified by\n * `svgTextUtils.convertToTspans`. Use `svgTextUtils.positionText`\n * instead, so that elements get updated to match.\n */\ndrawing.setPosition = function(s, x, y) { s.attr('x', x).attr('y', y); };\ndrawing.setSize = function(s, w, h) { s.attr('width', w).attr('height', h); };\ndrawing.setRect = function(s, x, y, w, h) {\n s.call(drawing.setPosition, x, y).call(drawing.setSize, w, h);\n};\n\n/** Translate node\n *\n * @param {object} d : calcdata point item\n * @param {sel} sel : d3 selction of node to translate\n * @param {object} xa : corresponding full xaxis object\n * @param {object} ya : corresponding full yaxis object\n *\n * @return {boolean} :\n * true if selection got translated\n * false if selection could not get translated\n */\ndrawing.translatePoint = function(d, sel, xa, ya) {\n var x = xa.c2p(d.x);\n var y = ya.c2p(d.y);\n\n if(isNumeric(x) && isNumeric(y) && sel.node()) {\n // for multiline text this works better\n if(sel.node().nodeName === 'text') {\n sel.attr('x', x).attr('y', y);\n } else {\n sel.attr('transform', 'translate(' + x + ',' + y + ')');\n }\n } else {\n return false;\n }\n\n return true;\n};\n\ndrawing.translatePoints = function(s, xa, ya) {\n s.each(function(d) {\n var sel = d3.select(this);\n drawing.translatePoint(d, sel, xa, ya);\n });\n};\n\ndrawing.hideOutsideRangePoint = function(d, sel, xa, ya) {\n sel.attr(\n 'display',\n xa.isPtWithinRange(d) && ya.isPtWithinRange(d) ? null : 'none'\n );\n};\n\ndrawing.hideOutsideRangePoints = function(points, subplot) {\n if(!subplot._hasClipOnAxisFalse) return;\n\n var xa = subplot.xaxis;\n var ya = subplot.yaxis;\n\n points.each(function(d) {\n drawing.hideOutsideRangePoint(d, d3.select(this), xa, ya);\n });\n};\n\ndrawing.crispRound = function(gd, lineWidth, dflt) {\n // for lines that disable antialiasing we want to\n // make sure the width is an integer, and at least 1 if it's nonzero\n\n if(!lineWidth || !isNumeric(lineWidth)) return dflt || 0;\n\n // but not for static plots - these don't get antialiased anyway.\n if(gd._context.staticPlot) return lineWidth;\n\n if(lineWidth < 1) return 1;\n return Math.round(lineWidth);\n};\n\ndrawing.singleLineStyle = function(d, s, lw, lc, ld) {\n s.style('fill', 'none');\n var line = (((d || [])[0] || {}).trace || {}).line || {},\n lw1 = lw || line.width||0,\n dash = ld || line.dash || '';\n\n Color.stroke(s, lc || line.color);\n drawing.dashLine(s, dash, lw1);\n};\n\ndrawing.lineGroupStyle = function(s, lw, lc, ld) {\n s.style('fill', 'none')\n .each(function(d) {\n var line = (((d || [])[0] || {}).trace || {}).line || {},\n lw1 = lw || line.width||0,\n dash = ld || line.dash || '';\n\n d3.select(this)\n .call(Color.stroke, lc || line.color)\n .call(drawing.dashLine, dash, lw1);\n });\n};\n\ndrawing.dashLine = function(s, dash, lineWidth) {\n lineWidth = +lineWidth || 0;\n\n dash = drawing.dashStyle(dash, lineWidth);\n\n s.style({\n 'stroke-dasharray': dash,\n 'stroke-width': lineWidth + 'px'\n });\n};\n\ndrawing.dashStyle = function(dash, lineWidth) {\n lineWidth = +lineWidth || 1;\n var dlw = Math.max(lineWidth, 3);\n\n if(dash === 'solid') dash = '';\n else if(dash === 'dot') dash = dlw + 'px,' + dlw + 'px';\n else if(dash === 'dash') dash = (3 * dlw) + 'px,' + (3 * dlw) + 'px';\n else if(dash === 'longdash') dash = (5 * dlw) + 'px,' + (5 * dlw) + 'px';\n else if(dash === 'dashdot') {\n dash = (3 * dlw) + 'px,' + dlw + 'px,' + dlw + 'px,' + dlw + 'px';\n }\n else if(dash === 'longdashdot') {\n dash = (5 * dlw) + 'px,' + (2 * dlw) + 'px,' + dlw + 'px,' + (2 * dlw) + 'px';\n }\n // otherwise user wrote the dasharray themselves - leave it be\n\n return dash;\n};\n\n// Same as fillGroupStyle, except in this case the selection may be a transition\ndrawing.singleFillStyle = function(sel) {\n var node = d3.select(sel.node());\n var data = node.data();\n var fillcolor = (((data[0] || [])[0] || {}).trace || {}).fillcolor;\n if(fillcolor) {\n sel.call(Color.fill, fillcolor);\n }\n};\n\ndrawing.fillGroupStyle = function(s) {\n s.style('stroke-width', 0)\n .each(function(d) {\n var shape = d3.select(this);\n try {\n shape.call(Color.fill, d[0].trace.fillcolor);\n }\n catch(e) {\n Lib.error(e, s);\n shape.remove();\n }\n });\n};\n\nvar SYMBOLDEFS = require('./symbol_defs');\n\ndrawing.symbolNames = [];\ndrawing.symbolFuncs = [];\ndrawing.symbolNeedLines = {};\ndrawing.symbolNoDot = {};\ndrawing.symbolList = [];\n\nObject.keys(SYMBOLDEFS).forEach(function(k) {\n var symDef = SYMBOLDEFS[k];\n drawing.symbolList = drawing.symbolList.concat(\n [symDef.n, k, symDef.n + 100, k + '-open']);\n drawing.symbolNames[symDef.n] = k;\n drawing.symbolFuncs[symDef.n] = symDef.f;\n if(symDef.needLine) {\n drawing.symbolNeedLines[symDef.n] = true;\n }\n if(symDef.noDot) {\n drawing.symbolNoDot[symDef.n] = true;\n }\n else {\n drawing.symbolList = drawing.symbolList.concat(\n [symDef.n + 200, k + '-dot', symDef.n + 300, k + '-open-dot']);\n }\n});\nvar MAXSYMBOL = drawing.symbolNames.length,\n // add a dot in the middle of the symbol\n DOTPATH = 'M0,0.5L0.5,0L0,-0.5L-0.5,0Z';\n\ndrawing.symbolNumber = function(v) {\n if(typeof v === 'string') {\n var vbase = 0;\n if(v.indexOf('-open') > 0) {\n vbase = 100;\n v = v.replace('-open', '');\n }\n if(v.indexOf('-dot') > 0) {\n vbase += 200;\n v = v.replace('-dot', '');\n }\n v = drawing.symbolNames.indexOf(v);\n if(v >= 0) { v += vbase; }\n }\n if((v % 100 >= MAXSYMBOL) || v >= 400) { return 0; }\n return Math.floor(Math.max(v, 0));\n};\n\nfunction singlePointStyle(d, sel, trace, markerScale, lineScale, marker, markerLine, gd) {\n // only scatter & box plots get marker path and opacity\n // bars, histograms don't\n if(Registry.traceIs(trace, 'symbols')) {\n var sizeFn = makeBubbleSizeFn(trace);\n\n sel.attr('d', function(d) {\n var r;\n\n // handle multi-trace graph edit case\n if(d.ms === 'various' || marker.size === 'various') r = 3;\n else {\n r = subTypes.isBubble(trace) ?\n sizeFn(d.ms) : (marker.size || 6) / 2;\n }\n\n // store the calculated size so hover can use it\n d.mrc = r;\n\n // turn the symbol into a sanitized number\n var x = drawing.symbolNumber(d.mx || marker.symbol) || 0,\n xBase = x % 100;\n\n // save if this marker is open\n // because that impacts how to handle colors\n d.om = x % 200 >= 100;\n\n return drawing.symbolFuncs[xBase](r) +\n (x >= 200 ? DOTPATH : '');\n })\n .style('opacity', function(d) {\n return (d.mo + 1 || marker.opacity + 1) - 1;\n });\n }\n\n var perPointGradient = false;\n\n // 'so' is suspected outliers, for box plots\n var fillColor,\n lineColor,\n lineWidth;\n if(d.so) {\n lineWidth = markerLine.outlierwidth;\n lineColor = markerLine.outliercolor;\n fillColor = marker.outliercolor;\n }\n else {\n lineWidth = (d.mlw + 1 || markerLine.width + 1 ||\n // TODO: we need the latter for legends... can we get rid of it?\n (d.trace ? d.trace.marker.line.width : 0) + 1) - 1;\n\n if('mlc' in d) lineColor = d.mlcc = lineScale(d.mlc);\n // weird case: array wasn't long enough to apply to every point\n else if(Array.isArray(markerLine.color)) lineColor = Color.defaultLine;\n else lineColor = markerLine.color;\n\n if(Array.isArray(marker.color)) {\n fillColor = Color.defaultLine;\n perPointGradient = true;\n }\n\n if('mc' in d) fillColor = d.mcc = markerScale(d.mc);\n else fillColor = marker.color || 'rgba(0,0,0,0)';\n }\n\n if(d.om) {\n // open markers can't have zero linewidth, default to 1px,\n // and use fill color as stroke color\n sel.call(Color.stroke, fillColor)\n .style({\n 'stroke-width': (lineWidth || 1) + 'px',\n fill: 'none'\n });\n }\n else {\n sel.style('stroke-width', lineWidth + 'px');\n\n var markerGradient = marker.gradient;\n\n var gradientType = d.mgt;\n if(gradientType) perPointGradient = true;\n else gradientType = markerGradient && markerGradient.type;\n\n if(gradientType && gradientType !== 'none') {\n var gradientColor = d.mgc;\n if(gradientColor) perPointGradient = true;\n else gradientColor = markerGradient.color;\n\n var gradientID = 'g' + gd._fullLayout._uid + '-' + trace.uid;\n if(perPointGradient) gradientID += '-' + d.i;\n\n sel.call(drawing.gradient, gd, gradientID, gradientType, fillColor, gradientColor);\n }\n else {\n sel.call(Color.fill, fillColor);\n }\n\n if(lineWidth) {\n sel.call(Color.stroke, lineColor);\n }\n }\n}\n\nvar HORZGRADIENT = {x1: 1, x2: 0, y1: 0, y2: 0};\nvar VERTGRADIENT = {x1: 0, x2: 0, y1: 1, y2: 0};\n\ndrawing.gradient = function(sel, gd, gradientID, type, color1, color2) {\n var gradient = gd._fullLayout._defs.select('.gradients')\n .selectAll('#' + gradientID)\n .data([type + color1 + color2], Lib.identity);\n\n gradient.exit().remove();\n\n gradient.enter()\n .append(type === 'radial' ? 'radialGradient' : 'linearGradient')\n .each(function() {\n var el = d3.select(this);\n if(type === 'horizontal') el.attr(HORZGRADIENT);\n else if(type === 'vertical') el.attr(VERTGRADIENT);\n\n el.attr('id', gradientID);\n\n var tc1 = tinycolor(color1);\n var tc2 = tinycolor(color2);\n\n el.append('stop').attr({\n offset: '0%',\n 'stop-color': Color.tinyRGB(tc2),\n 'stop-opacity': tc2.getAlpha()\n });\n\n el.append('stop').attr({\n offset: '100%',\n 'stop-color': Color.tinyRGB(tc1),\n 'stop-opacity': tc1.getAlpha()\n });\n });\n\n sel.style({\n fill: 'url(#' + gradientID + ')',\n 'fill-opacity': null\n });\n};\n\n/*\n * Make the gradients container and clear out any previous gradients.\n * We never collect all the gradients we need in one place,\n * so we can't ever remove gradients that have stopped being useful,\n * except all at once before a full redraw.\n * The upside of this is arbitrary points can share gradient defs\n */\ndrawing.initGradients = function(gd) {\n var gradientsGroup = gd._fullLayout._defs.selectAll('.gradients').data([0]);\n gradientsGroup.enter().append('g').classed('gradients', true);\n\n gradientsGroup.selectAll('linearGradient,radialGradient').remove();\n};\n\ndrawing.singlePointStyle = function(d, sel, trace, markerScale, lineScale, gd) {\n var marker = trace.marker;\n\n singlePointStyle(d, sel, trace, markerScale, lineScale, marker, marker.line, gd);\n\n};\n\ndrawing.pointStyle = function(s, trace, gd) {\n if(!s.size()) return;\n\n // allow array marker and marker line colors to be\n // scaled by given max and min to colorscales\n var marker = trace.marker;\n var markerScale = drawing.tryColorscale(marker, '');\n var lineScale = drawing.tryColorscale(marker, 'line');\n\n s.each(function(d) {\n drawing.singlePointStyle(d, d3.select(this), trace, markerScale, lineScale, gd);\n });\n};\n\ndrawing.tryColorscale = function(marker, prefix) {\n var cont = prefix ? Lib.nestedProperty(marker, prefix).get() : marker,\n scl = cont.colorscale,\n colorArray = cont.color;\n\n if(scl && Array.isArray(colorArray)) {\n return Colorscale.makeColorScaleFunc(\n Colorscale.extractScale(scl, cont.cmin, cont.cmax)\n );\n }\n else return Lib.identity;\n};\n\n// draw text at points\nvar TEXTOFFSETSIGN = {start: 1, end: -1, middle: 0, bottom: 1, top: -1};\ndrawing.textPointStyle = function(s, trace, gd) {\n s.each(function(d) {\n var p = d3.select(this);\n var text = Lib.extractOption(d, trace, 'tx', 'text');\n\n if(!text) {\n p.remove();\n return;\n }\n\n var pos = d.tp || trace.textposition,\n v = pos.indexOf('top') !== -1 ? 'top' :\n pos.indexOf('bottom') !== -1 ? 'bottom' : 'middle',\n h = pos.indexOf('left') !== -1 ? 'end' :\n pos.indexOf('right') !== -1 ? 'start' : 'middle',\n fontSize = d.ts || trace.textfont.size,\n // if markers are shown, offset a little more than\n // the nominal marker size\n // ie 2/1.6 * nominal, bcs some markers are a bit bigger\n r = d.mrc ? (d.mrc / 0.8 + 1) : 0;\n\n fontSize = (isNumeric(fontSize) && fontSize > 0) ? fontSize : 0;\n\n p.call(drawing.font,\n d.tf || trace.textfont.family,\n fontSize,\n d.tc || trace.textfont.color)\n .attr('text-anchor', h)\n .text(text)\n .call(svgTextUtils.convertToTspans, gd);\n\n var pgroup = d3.select(this.parentNode);\n var numLines = (svgTextUtils.lineCount(p) - 1) * LINE_SPACING + 1;\n var dx = TEXTOFFSETSIGN[h] * r;\n var dy = fontSize * 0.75 + TEXTOFFSETSIGN[v] * r +\n (TEXTOFFSETSIGN[v] - 1) * numLines * fontSize / 2;\n\n // fix the overall text group position\n pgroup.attr('transform', 'translate(' + dx + ',' + dy + ')');\n });\n};\n\n// generalized Catmull-Rom splines, per\n// http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\nvar CatmullRomExp = 0.5;\ndrawing.smoothopen = function(pts, smoothness) {\n if(pts.length < 3) { return 'M' + pts.join('L');}\n var path = 'M' + pts[0],\n tangents = [], i;\n for(i = 1; i < pts.length - 1; i++) {\n tangents.push(makeTangent(pts[i - 1], pts[i], pts[i + 1], smoothness));\n }\n path += 'Q' + tangents[0][0] + ' ' + pts[1];\n for(i = 2; i < pts.length - 1; i++) {\n path += 'C' + tangents[i - 2][1] + ' ' + tangents[i - 1][0] + ' ' + pts[i];\n }\n path += 'Q' + tangents[pts.length - 3][1] + ' ' + pts[pts.length - 1];\n return path;\n};\n\ndrawing.smoothclosed = function(pts, smoothness) {\n if(pts.length < 3) { return 'M' + pts.join('L') + 'Z'; }\n var path = 'M' + pts[0],\n pLast = pts.length - 1,\n tangents = [makeTangent(pts[pLast],\n pts[0], pts[1], smoothness)],\n i;\n for(i = 1; i < pLast; i++) {\n tangents.push(makeTangent(pts[i - 1], pts[i], pts[i + 1], smoothness));\n }\n tangents.push(\n makeTangent(pts[pLast - 1], pts[pLast], pts[0], smoothness)\n );\n\n for(i = 1; i <= pLast; i++) {\n path += 'C' + tangents[i - 1][1] + ' ' + tangents[i][0] + ' ' + pts[i];\n }\n path += 'C' + tangents[pLast][1] + ' ' + tangents[0][0] + ' ' + pts[0] + 'Z';\n return path;\n};\n\nfunction makeTangent(prevpt, thispt, nextpt, smoothness) {\n var d1x = prevpt[0] - thispt[0],\n d1y = prevpt[1] - thispt[1],\n d2x = nextpt[0] - thispt[0],\n d2y = nextpt[1] - thispt[1],\n d1a = Math.pow(d1x * d1x + d1y * d1y, CatmullRomExp / 2),\n d2a = Math.pow(d2x * d2x + d2y * d2y, CatmullRomExp / 2),\n numx = (d2a * d2a * d1x - d1a * d1a * d2x) * smoothness,\n numy = (d2a * d2a * d1y - d1a * d1a * d2y) * smoothness,\n denom1 = 3 * d2a * (d1a + d2a),\n denom2 = 3 * d1a * (d1a + d2a);\n return [\n [\n d3.round(thispt[0] + (denom1 && numx / denom1), 2),\n d3.round(thispt[1] + (denom1 && numy / denom1), 2)\n ], [\n d3.round(thispt[0] - (denom2 && numx / denom2), 2),\n d3.round(thispt[1] - (denom2 && numy / denom2), 2)\n ]\n ];\n}\n\n// step paths - returns a generator function for paths\n// with the given step shape\nvar STEPPATH = {\n hv: function(p0, p1) {\n return 'H' + d3.round(p1[0], 2) + 'V' + d3.round(p1[1], 2);\n },\n vh: function(p0, p1) {\n return 'V' + d3.round(p1[1], 2) + 'H' + d3.round(p1[0], 2);\n },\n hvh: function(p0, p1) {\n return 'H' + d3.round((p0[0] + p1[0]) / 2, 2) + 'V' +\n d3.round(p1[1], 2) + 'H' + d3.round(p1[0], 2);\n },\n vhv: function(p0, p1) {\n return 'V' + d3.round((p0[1] + p1[1]) / 2, 2) + 'H' +\n d3.round(p1[0], 2) + 'V' + d3.round(p1[1], 2);\n }\n};\nvar STEPLINEAR = function(p0, p1) {\n return 'L' + d3.round(p1[0], 2) + ',' + d3.round(p1[1], 2);\n};\ndrawing.steps = function(shape) {\n var onestep = STEPPATH[shape] || STEPLINEAR;\n return function(pts) {\n var path = 'M' + d3.round(pts[0][0], 2) + ',' + d3.round(pts[0][1], 2);\n for(var i = 1; i < pts.length; i++) {\n path += onestep(pts[i - 1], pts[i]);\n }\n return path;\n };\n};\n\n// off-screen svg render testing element, shared by the whole page\n// uses the id 'js-plotly-tester' and stores it in drawing.tester\ndrawing.makeTester = function() {\n var tester = d3.select('body')\n .selectAll('#js-plotly-tester')\n .data([0]);\n\n tester.enter().append('svg')\n .attr('id', 'js-plotly-tester')\n .attr(xmlnsNamespaces.svgAttrs)\n .style({\n position: 'absolute',\n left: '-10000px',\n top: '-10000px',\n width: '9000px',\n height: '9000px',\n 'z-index': '1'\n });\n\n // browsers differ on how they describe the bounding rect of\n // the svg if its contents spill over... so make a 1x1px\n // reference point we can measure off of.\n var testref = tester.selectAll('.js-reference-point').data([0]);\n testref.enter().append('path')\n .classed('js-reference-point', true)\n .attr('d', 'M0,0H1V1H0Z')\n .style({\n 'stroke-width': 0,\n fill: 'black'\n });\n\n drawing.tester = tester;\n drawing.testref = testref;\n};\n\n/*\n * use our offscreen tester to get a clientRect for an element,\n * in a reference frame where it isn't translated (or transformed) and\n * its anchor point is at (0,0)\n * always returns a copy of the bbox, so the caller can modify it safely\n *\n * @param {SVGElement} node: the element to measure. If possible this should be\n * a or MathJax element that's already passed through\n * `convertToTspans` because in that case we can cache the results, but it's\n * possible to pass in any svg element.\n *\n * @param {boolean} inTester: is this element already in `drawing.tester`?\n * If you are measuring a dummy element, rather than one you really intend\n * to use on the plot, making it in `drawing.tester` in the first place\n * allows us to test faster because it cuts out cloning and appending it.\n *\n * @param {string} hash: for internal use only, if we already know the cache key\n * for this element beforehand.\n *\n * @return {object}: a plain object containing the width, height, left, right,\n * top, and bottom of `node`\n */\ndrawing.savedBBoxes = {};\nvar savedBBoxesCount = 0;\nvar maxSavedBBoxes = 10000;\n\ndrawing.bBox = function(node, inTester, hash) {\n /*\n * Cache elements we've already measured so we don't have to\n * remeasure the same thing many times\n * We have a few bBox callers though who pass a node larger than\n * a or a MathJax , such as an axis group containing many labels.\n * These will not generate a hash (unless we figure out an appropriate\n * hash key for them) and thus we will not hash them.\n */\n if(!hash) hash = nodeHash(node);\n var out;\n if(hash) {\n out = drawing.savedBBoxes[hash];\n if(out) return Lib.extendFlat({}, out);\n }\n else if(node.childNodes.length === 1) {\n /*\n * If we have only one child element, which is itself hashable, make\n * a new hash from this element plus its x,y,transform\n * These bounding boxes *include* x,y,transform - mostly for use by\n * callers trying to avoid overlaps (ie titles)\n */\n var innerNode = node.childNodes[0];\n\n hash = nodeHash(innerNode);\n if(hash) {\n var x = +innerNode.getAttribute('x') || 0;\n var y = +innerNode.getAttribute('y') || 0;\n var transform = innerNode.getAttribute('transform');\n\n if(!transform) {\n // in this case, just varying x and y, don't bother caching\n // the final bBox because the alteration is quick.\n var innerBB = drawing.bBox(innerNode, false, hash);\n if(x) {\n innerBB.left += x;\n innerBB.right += x;\n }\n if(y) {\n innerBB.top += y;\n innerBB.bottom += y;\n }\n return innerBB;\n }\n /*\n * else we have a transform - rather than make a complicated\n * (and error-prone and probably slow) transform parser/calculator,\n * just continue on calculating the boundingClientRect of the group\n * and use the new composite hash to cache it.\n * That said, `innerNode.transform.baseVal` is an array of\n * `SVGTransform` objects, that *do* seem to have a nice matrix\n * multiplication interface that we could use to avoid making\n * another getBoundingClientRect call...\n */\n hash += '~' + x + '~' + y + '~' + transform;\n\n out = drawing.savedBBoxes[hash];\n if(out) return Lib.extendFlat({}, out);\n }\n }\n var testNode, tester;\n if(inTester) {\n testNode = node;\n }\n else {\n tester = drawing.tester.node();\n\n // copy the node to test into the tester\n testNode = node.cloneNode(true);\n tester.appendChild(testNode);\n }\n\n // standardize its position (and newline tspans if any)\n d3.select(testNode)\n .attr('transform', null)\n .call(svgTextUtils.positionText, 0, 0);\n\n var testRect = testNode.getBoundingClientRect();\n var refRect = drawing.testref\n .node()\n .getBoundingClientRect();\n\n if(!inTester) tester.removeChild(testNode);\n\n var bb = {\n height: testRect.height,\n width: testRect.width,\n left: testRect.left - refRect.left,\n top: testRect.top - refRect.top,\n right: testRect.right - refRect.left,\n bottom: testRect.bottom - refRect.top\n };\n\n // make sure we don't have too many saved boxes,\n // or a long session could overload on memory\n // by saving boxes for long-gone elements\n if(savedBBoxesCount >= maxSavedBBoxes) {\n drawing.savedBBoxes = {};\n savedBBoxesCount = 0;\n }\n\n // cache this bbox\n if(hash) drawing.savedBBoxes[hash] = bb;\n savedBBoxesCount++;\n\n return Lib.extendFlat({}, bb);\n};\n\n// capture everything about a node (at least in our usage) that\n// impacts its bounding box, given that bBox clears x, y, and transform\nfunction nodeHash(node) {\n var inputText = node.getAttribute('data-unformatted');\n if(inputText === null) return;\n return inputText +\n node.getAttribute('data-math') +\n node.getAttribute('text-anchor') +\n node.getAttribute('style');\n}\n\n/*\n * make a robust clipPath url from a local id\n * note! We'd better not be exporting from a page\n * with a or the svg will not be portable!\n */\ndrawing.setClipUrl = function(s, localId) {\n if(!localId) {\n s.attr('clip-path', null);\n return;\n }\n\n var url = '#' + localId,\n base = d3.select('base');\n\n // add id to location href w/o hashes if any)\n if(base.size() && base.attr('href')) {\n url = window.location.href.split('#')[0] + url;\n }\n\n s.attr('clip-path', 'url(' + url + ')');\n};\n\ndrawing.getTranslate = function(element) {\n // Note the separator [^\\d] between x and y in this regex\n // We generally use ',' but IE will convert it to ' '\n var re = /.*\\btranslate\\((-?\\d*\\.?\\d*)[^-\\d]*(-?\\d*\\.?\\d*)[^\\d].*/,\n getter = element.attr ? 'attr' : 'getAttribute',\n transform = element[getter]('transform') || '';\n\n var translate = transform.replace(re, function(match, p1, p2) {\n return [p1, p2].join(' ');\n })\n .split(' ');\n\n return {\n x: +translate[0] || 0,\n y: +translate[1] || 0\n };\n};\n\ndrawing.setTranslate = function(element, x, y) {\n\n var re = /(\\btranslate\\(.*?\\);?)/,\n getter = element.attr ? 'attr' : 'getAttribute',\n setter = element.attr ? 'attr' : 'setAttribute',\n transform = element[getter]('transform') || '';\n\n x = x || 0;\n y = y || 0;\n\n transform = transform.replace(re, '').trim();\n transform += ' translate(' + x + ', ' + y + ')';\n transform = transform.trim();\n\n element[setter]('transform', transform);\n\n return transform;\n};\n\ndrawing.getScale = function(element) {\n\n var re = /.*\\bscale\\((\\d*\\.?\\d*)[^\\d]*(\\d*\\.?\\d*)[^\\d].*/,\n getter = element.attr ? 'attr' : 'getAttribute',\n transform = element[getter]('transform') || '';\n\n var translate = transform.replace(re, function(match, p1, p2) {\n return [p1, p2].join(' ');\n })\n .split(' ');\n\n return {\n x: +translate[0] || 1,\n y: +translate[1] || 1\n };\n};\n\ndrawing.setScale = function(element, x, y) {\n\n var re = /(\\bscale\\(.*?\\);?)/,\n getter = element.attr ? 'attr' : 'getAttribute',\n setter = element.attr ? 'attr' : 'setAttribute',\n transform = element[getter]('transform') || '';\n\n x = x || 1;\n y = y || 1;\n\n transform = transform.replace(re, '').trim();\n transform += ' scale(' + x + ', ' + y + ')';\n transform = transform.trim();\n\n element[setter]('transform', transform);\n\n return transform;\n};\n\ndrawing.setPointGroupScale = function(selection, x, y) {\n var t, scale, re;\n\n x = x || 1;\n y = y || 1;\n\n if(x === 1 && y === 1) {\n scale = '';\n } else {\n // The same scale transform for every point:\n scale = ' scale(' + x + ',' + y + ')';\n }\n\n // A regex to strip any existing scale:\n re = /\\s*sc.*/;\n\n selection.each(function() {\n // Get the transform:\n t = (this.getAttribute('transform') || '').replace(re, '');\n t += scale;\n t = t.trim();\n\n // Append the scale transform\n this.setAttribute('transform', t);\n });\n\n return scale;\n};\n\nvar TEXT_POINT_LAST_TRANSLATION_RE = /translate\\([^)]*\\)\\s*$/;\n\ndrawing.setTextPointsScale = function(selection, xScale, yScale) {\n selection.each(function() {\n var transforms;\n var el = d3.select(this);\n var text = el.select('text');\n\n if(!text.node()) return;\n\n var x = parseFloat(text.attr('x') || 0);\n var y = parseFloat(text.attr('y') || 0);\n\n var existingTransform = (el.attr('transform') || '').match(TEXT_POINT_LAST_TRANSLATION_RE);\n\n if(xScale === 1 && yScale === 1) {\n transforms = [];\n } else {\n transforms = [\n 'translate(' + x + ',' + y + ')',\n 'scale(' + xScale + ',' + yScale + ')',\n 'translate(' + (-x) + ',' + (-y) + ')',\n ];\n }\n\n if(existingTransform) {\n transforms.push(existingTransform);\n }\n\n el.attr('transform', transforms.join(' '));\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/drawing/index.js\n// module id = 8\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar Registry = require('../../registry');\nvar Lib = require('../../lib');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar Titles = require('../../components/titles');\nvar Color = require('../../components/color');\nvar Drawing = require('../../components/drawing');\n\nvar constants = require('../../constants/numerical');\nvar FP_SAFE = constants.FP_SAFE;\nvar ONEAVGYEAR = constants.ONEAVGYEAR;\nvar ONEAVGMONTH = constants.ONEAVGMONTH;\nvar ONEDAY = constants.ONEDAY;\nvar ONEHOUR = constants.ONEHOUR;\nvar ONEMIN = constants.ONEMIN;\nvar ONESEC = constants.ONESEC;\nvar MINUS_SIGN = constants.MINUS_SIGN;\n\nvar MID_SHIFT = require('../../constants/alignment').MID_SHIFT;\n\nvar axes = module.exports = {};\n\naxes.layoutAttributes = require('./layout_attributes');\naxes.supplyLayoutDefaults = require('./layout_defaults');\n\naxes.setConvert = require('./set_convert');\nvar autoType = require('./axis_autotype');\n\nvar axisIds = require('./axis_ids');\naxes.id2name = axisIds.id2name;\naxes.cleanId = axisIds.cleanId;\naxes.list = axisIds.list;\naxes.listIds = axisIds.listIds;\naxes.getFromId = axisIds.getFromId;\naxes.getFromTrace = axisIds.getFromTrace;\n\n/*\n * find the list of possible axes to reference with an xref or yref attribute\n * and coerce it to that list\n *\n * attr: the attribute we're generating a reference for. Should end in 'x' or 'y'\n * but can be prefixed, like 'ax' for annotation's arrow x\n * dflt: the default to coerce to, or blank to use the first axis (falling back on\n * extraOption if there is no axis)\n * extraOption: aside from existing axes with this letter, what non-axis value is allowed?\n * Only required if it's different from `dflt`\n */\naxes.coerceRef = function(containerIn, containerOut, gd, attr, dflt, extraOption) {\n var axLetter = attr.charAt(attr.length - 1),\n axlist = axes.listIds(gd, axLetter),\n refAttr = attr + 'ref',\n attrDef = {};\n\n if(!dflt) dflt = axlist[0] || extraOption;\n if(!extraOption) extraOption = dflt;\n\n // data-ref annotations are not supported in gl2d yet\n\n attrDef[refAttr] = {\n valType: 'enumerated',\n values: axlist.concat(extraOption ? [extraOption] : []),\n dflt: dflt\n };\n\n // xref, yref\n return Lib.coerce(containerIn, containerOut, attrDef, refAttr);\n};\n\n/*\n * coerce position attributes (range-type) that can be either on axes or absolute\n * (paper or pixel) referenced. The biggest complication here is that we don't know\n * before looking at the axis whether the value must be a number or not (it may be\n * a date string), so we can't use the regular valType='number' machinery\n *\n * axRef (string): the axis this position is referenced to, or:\n * paper: fraction of the plot area\n * pixel: pixels relative to some starting position\n * attr (string): the attribute in containerOut we are coercing\n * dflt (number): the default position, as a fraction or pixels. If the attribute\n * is to be axis-referenced, this will be converted to an axis data value\n *\n * Also cleans the values, since the attribute definition itself has to say\n * valType: 'any' to handle date axes. This allows us to accept:\n * - for category axes: category names, and convert them here into serial numbers.\n * Note that this will NOT work for axis range endpoints, because we don't know\n * the category list yet (it's set by ax.makeCalcdata during calc)\n * but it works for component (note, shape, images) positions.\n * - for date axes: JS Dates or milliseconds, and convert to date strings\n * - for other types: coerce them to numbers\n */\naxes.coercePosition = function(containerOut, gd, coerce, axRef, attr, dflt) {\n var cleanPos, pos;\n\n if(axRef === 'paper' || axRef === 'pixel') {\n cleanPos = Lib.ensureNumber;\n pos = coerce(attr, dflt);\n } else {\n var ax = axes.getFromId(gd, axRef);\n dflt = ax.fraction2r(dflt);\n pos = coerce(attr, dflt);\n cleanPos = ax.cleanPos;\n }\n\n containerOut[attr] = cleanPos(pos);\n};\n\naxes.cleanPosition = function(pos, gd, axRef) {\n var cleanPos = (axRef === 'paper' || axRef === 'pixel') ?\n Lib.ensureNumber :\n axes.getFromId(gd, axRef).cleanPos;\n\n return cleanPos(pos);\n};\n\nvar getDataConversions = axes.getDataConversions = function(gd, trace, target, targetArray) {\n var ax;\n\n // If target points to an axis, use the type we already have for that\n // axis to find the data type. Otherwise use the values to autotype.\n var d2cTarget = (target === 'x' || target === 'y' || target === 'z') ?\n target :\n targetArray;\n\n // In the case of an array target, make a mock data array\n // and call supplyDefaults to the data type and\n // setup the data-to-calc method.\n if(Array.isArray(d2cTarget)) {\n ax = {\n type: autoType(targetArray),\n _categories: []\n };\n axes.setConvert(ax);\n\n // build up ax._categories (usually done during ax.makeCalcdata()\n if(ax.type === 'category') {\n for(var i = 0; i < targetArray.length; i++) {\n ax.d2c(targetArray[i]);\n }\n }\n } else {\n ax = axes.getFromTrace(gd, trace, d2cTarget);\n }\n\n // if 'target' has corresponding axis\n // -> use setConvert method\n if(ax) return {d2c: ax.d2c, c2d: ax.c2d};\n\n // special case for 'ids'\n // -> cast to String\n if(d2cTarget === 'ids') return {d2c: toString, c2d: toString};\n\n // otherwise (e.g. numeric-array of 'marker.color' or 'marker.size')\n // -> cast to Number\n\n return {d2c: toNum, c2d: toNum};\n};\n\nfunction toNum(v) { return +v; }\nfunction toString(v) { return String(v); }\n\naxes.getDataToCoordFunc = function(gd, trace, target, targetArray) {\n return getDataConversions(gd, trace, target, targetArray).d2c;\n};\n\n// get counteraxis letter for this axis (name or id)\n// this can also be used as the id for default counter axis\naxes.counterLetter = function(id) {\n var axLetter = id.charAt(0);\n if(axLetter === 'x') return 'y';\n if(axLetter === 'y') return 'x';\n};\n\n// incorporate a new minimum difference and first tick into\n// forced\n// note that _forceTick0 is linearized, so needs to be turned into\n// a range value for setting tick0\naxes.minDtick = function(ax, newDiff, newFirst, allow) {\n // doesn't make sense to do forced min dTick on log or category axes,\n // and the plot itself may decide to cancel (ie non-grouped bars)\n if(['log', 'category'].indexOf(ax.type) !== -1 || !allow) {\n ax._minDtick = 0;\n }\n // undefined means there's nothing there yet\n else if(ax._minDtick === undefined) {\n ax._minDtick = newDiff;\n ax._forceTick0 = newFirst;\n }\n else if(ax._minDtick) {\n // existing minDtick is an integer multiple of newDiff\n // (within rounding err)\n // and forceTick0 can be shifted to newFirst\n if((ax._minDtick / newDiff + 1e-6) % 1 < 2e-6 &&\n (((newFirst - ax._forceTick0) / newDiff % 1) +\n 1.000001) % 1 < 2e-6) {\n ax._minDtick = newDiff;\n ax._forceTick0 = newFirst;\n }\n // if the converse is true (newDiff is a multiple of minDtick and\n // newFirst can be shifted to forceTick0) then do nothing - same\n // forcing stands. Otherwise, cancel forced minimum\n else if((newDiff / ax._minDtick + 1e-6) % 1 > 2e-6 ||\n (((newFirst - ax._forceTick0) / ax._minDtick % 1) +\n 1.000001) % 1 > 2e-6) {\n ax._minDtick = 0;\n }\n }\n};\n\n// Find the autorange for this axis\n//\n// assumes ax._min and ax._max have already been set by calling axes.expand\n// using calcdata from all traces. These are arrays of:\n// {val: calcdata value, pad: extra pixels beyond this value}\n//\n// Returns an array of [min, max]. These are calcdata for log and category axes\n// and data for linear and date axes.\n//\n// TODO: we want to change log to data as well, but it's hard to do this\n// maintaining backward compatibility. category will always have to use calcdata\n// though, because otherwise values between categories (or outside all categories)\n// would be impossible.\naxes.getAutoRange = function(ax) {\n var newRange = [];\n\n var minmin = ax._min[0].val,\n maxmax = ax._max[0].val,\n i;\n\n for(i = 1; i < ax._min.length; i++) {\n if(minmin !== maxmax) break;\n minmin = Math.min(minmin, ax._min[i].val);\n }\n for(i = 1; i < ax._max.length; i++) {\n if(minmin !== maxmax) break;\n maxmax = Math.max(maxmax, ax._max[i].val);\n }\n\n var j, minpt, maxpt, minbest, maxbest, dp, dv,\n mbest = 0,\n axReverse = false;\n\n if(ax.range) {\n var rng = Lib.simpleMap(ax.range, ax.r2l);\n axReverse = rng[1] < rng[0];\n }\n\n // one-time setting to easily reverse the axis\n // when plotting from code\n if(ax.autorange === 'reversed') {\n axReverse = true;\n ax.autorange = true;\n }\n\n for(i = 0; i < ax._min.length; i++) {\n minpt = ax._min[i];\n for(j = 0; j < ax._max.length; j++) {\n maxpt = ax._max[j];\n dv = maxpt.val - minpt.val;\n dp = ax._length - minpt.pad - maxpt.pad;\n if(dv > 0 && dp > 0 && dv / dp > mbest) {\n minbest = minpt;\n maxbest = maxpt;\n mbest = dv / dp;\n }\n }\n }\n\n if(minmin === maxmax) {\n var lower = minmin - 1;\n var upper = minmin + 1;\n if(ax.rangemode === 'tozero') {\n newRange = minmin < 0 ? [lower, 0] : [0, upper];\n }\n else if(ax.rangemode === 'nonnegative') {\n newRange = [Math.max(0, lower), Math.max(0, upper)];\n }\n else {\n newRange = [lower, upper];\n }\n }\n else if(mbest) {\n if(ax.type === 'linear' || ax.type === '-') {\n if(ax.rangemode === 'tozero') {\n if(minbest.val >= 0) {\n minbest = {val: 0, pad: 0};\n }\n if(maxbest.val <= 0) {\n maxbest = {val: 0, pad: 0};\n }\n }\n else if(ax.rangemode === 'nonnegative') {\n if(minbest.val - mbest * minbest.pad < 0) {\n minbest = {val: 0, pad: 0};\n }\n if(maxbest.val < 0) {\n maxbest = {val: 1, pad: 0};\n }\n }\n\n // in case it changed again...\n mbest = (maxbest.val - minbest.val) /\n (ax._length - minbest.pad - maxbest.pad);\n\n }\n\n newRange = [\n minbest.val - mbest * minbest.pad,\n maxbest.val + mbest * maxbest.pad\n ];\n }\n\n // don't let axis have zero size, while still respecting tozero and nonnegative\n if(newRange[0] === newRange[1]) {\n if(ax.rangemode === 'tozero') {\n if(newRange[0] < 0) {\n newRange = [newRange[0], 0];\n }\n else if(newRange[0] > 0) {\n newRange = [0, newRange[0]];\n }\n else {\n newRange = [0, 1];\n }\n }\n else {\n newRange = [newRange[0] - 1, newRange[0] + 1];\n if(ax.rangemode === 'nonnegative') {\n newRange[0] = Math.max(0, newRange[0]);\n }\n }\n }\n\n // maintain reversal\n if(axReverse) newRange.reverse();\n\n return Lib.simpleMap(newRange, ax.l2r || Number);\n};\n\naxes.doAutoRange = function(ax) {\n if(!ax._length) ax.setScale();\n\n // TODO do we really need this?\n var hasDeps = (ax._min && ax._max && ax._min.length && ax._max.length);\n\n if(ax.autorange && hasDeps) {\n ax.range = axes.getAutoRange(ax);\n\n ax._r = ax.range.slice();\n ax._rl = Lib.simpleMap(ax._r, ax.r2l);\n\n // doAutoRange will get called on fullLayout,\n // but we want to report its results back to layout\n\n var axIn = ax._input;\n axIn.range = ax.range.slice();\n axIn.autorange = ax.autorange;\n }\n};\n\n// save a copy of the initial axis ranges in fullLayout\n// use them in mode bar and dblclick events\naxes.saveRangeInitial = function(gd, overwrite) {\n var axList = axes.list(gd, '', true),\n hasOneAxisChanged = false;\n\n for(var i = 0; i < axList.length; i++) {\n var ax = axList[i];\n\n var isNew = (ax._rangeInitial === undefined);\n var hasChanged = (\n isNew || !(\n ax.range[0] === ax._rangeInitial[0] &&\n ax.range[1] === ax._rangeInitial[1]\n )\n );\n\n if((isNew && ax.autorange === false) || (overwrite && hasChanged)) {\n ax._rangeInitial = ax.range.slice();\n hasOneAxisChanged = true;\n }\n }\n\n return hasOneAxisChanged;\n};\n\n// save a copy of the initial spike visibility\naxes.saveShowSpikeInitial = function(gd, overwrite) {\n var axList = axes.list(gd, '', true),\n hasOneAxisChanged = false,\n allEnabled = 'on';\n\n for(var i = 0; i < axList.length; i++) {\n var ax = axList[i];\n\n var isNew = (ax._showSpikeInitial === undefined);\n var hasChanged = (\n isNew || !(\n ax.showspikes === ax._showspikes\n )\n );\n\n if((isNew) || (overwrite && hasChanged)) {\n ax._showSpikeInitial = ax.showspikes;\n hasOneAxisChanged = true;\n }\n\n if(allEnabled === 'on' && !ax.showspikes) {\n allEnabled = 'off';\n }\n }\n gd._fullLayout._cartesianSpikesEnabled = allEnabled;\n return hasOneAxisChanged;\n};\n\n// axes.expand: if autoranging, include new data in the outer limits\n// for this axis\n// data is an array of numbers (ie already run through ax.d2c)\n// available options:\n// vpad: (number or number array) pad values (data value +-vpad)\n// ppad: (number or number array) pad pixels (pixel location +-ppad)\n// ppadplus, ppadminus, vpadplus, vpadminus:\n// separate padding for each side, overrides symmetric\n// padded: (boolean) add 5% padding to both ends\n// (unless one end is overridden by tozero)\n// tozero: (boolean) make sure to include zero if axis is linear,\n// and make it a tight bound if possible\naxes.expand = function(ax, data, options) {\n var needsAutorange = (\n ax.autorange ||\n !!Lib.nestedProperty(ax, 'rangeslider.autorange').get()\n );\n\n if(!needsAutorange || !data) return;\n\n if(!ax._min) ax._min = [];\n if(!ax._max) ax._max = [];\n if(!options) options = {};\n if(!ax._m) ax.setScale();\n\n var len = data.length,\n extrappad = options.padded ? ax._length * 0.05 : 0,\n tozero = options.tozero && (ax.type === 'linear' || ax.type === '-'),\n i, j, v, di, dmin, dmax,\n ppadiplus, ppadiminus, includeThis, vmin, vmax;\n\n // domain-constrained axes: base extrappad on the unconstrained\n // domain so it's consistent as the domain changes\n if(extrappad && (ax.constrain === 'domain') && ax._inputDomain) {\n extrappad *= (ax._inputDomain[1] - ax._inputDomain[0]) /\n (ax.domain[1] - ax.domain[0]);\n }\n\n function getPad(item) {\n if(Array.isArray(item)) {\n return function(i) { return Math.max(Number(item[i]||0), 0); };\n }\n else {\n var v = Math.max(Number(item||0), 0);\n return function() { return v; };\n }\n }\n var ppadplus = getPad((ax._m > 0 ?\n options.ppadplus : options.ppadminus) || options.ppad || 0),\n ppadminus = getPad((ax._m > 0 ?\n options.ppadminus : options.ppadplus) || options.ppad || 0),\n vpadplus = getPad(options.vpadplus || options.vpad),\n vpadminus = getPad(options.vpadminus || options.vpad);\n\n function addItem(i) {\n di = data[i];\n if(!isNumeric(di)) return;\n ppadiplus = ppadplus(i) + extrappad;\n ppadiminus = ppadminus(i) + extrappad;\n vmin = di - vpadminus(i);\n vmax = di + vpadplus(i);\n // special case for log axes: if vpad makes this object span\n // more than an order of mag, clip it to one order. This is so\n // we don't have non-positive errors or absurdly large lower\n // range due to rounding errors\n if(ax.type === 'log' && vmin < vmax / 10) { vmin = vmax / 10; }\n\n dmin = ax.c2l(vmin);\n dmax = ax.c2l(vmax);\n\n if(tozero) {\n dmin = Math.min(0, dmin);\n dmax = Math.max(0, dmax);\n }\n\n // In order to stop overflow errors, don't consider points\n // too close to the limits of js floating point\n function goodNumber(v) {\n return isNumeric(v) && Math.abs(v) < FP_SAFE;\n }\n\n if(goodNumber(dmin)) {\n includeThis = true;\n // take items v from ax._min and compare them to the\n // presently active point:\n // - if the item supercedes the new point, set includethis false\n // - if the new pt supercedes the item, delete it from ax._min\n for(j = 0; j < ax._min.length && includeThis; j++) {\n v = ax._min[j];\n if(v.val <= dmin && v.pad >= ppadiminus) {\n includeThis = false;\n }\n else if(v.val >= dmin && v.pad <= ppadiminus) {\n ax._min.splice(j, 1);\n j--;\n }\n }\n if(includeThis) {\n ax._min.push({\n val: dmin,\n pad: (tozero && dmin === 0) ? 0 : ppadiminus\n });\n }\n }\n\n if(goodNumber(dmax)) {\n includeThis = true;\n for(j = 0; j < ax._max.length && includeThis; j++) {\n v = ax._max[j];\n if(v.val >= dmax && v.pad >= ppadiplus) {\n includeThis = false;\n }\n else if(v.val <= dmax && v.pad <= ppadiplus) {\n ax._max.splice(j, 1);\n j--;\n }\n }\n if(includeThis) {\n ax._max.push({\n val: dmax,\n pad: (tozero && dmax === 0) ? 0 : ppadiplus\n });\n }\n }\n }\n\n // For efficiency covering monotonic or near-monotonic data,\n // check a few points at both ends first and then sweep\n // through the middle\n for(i = 0; i < 6; i++) addItem(i);\n for(i = len - 1; i > 5; i--) addItem(i);\n\n};\n\naxes.autoBin = function(data, ax, nbins, is2d, calendar) {\n var dataMin = Lib.aggNums(Math.min, null, data),\n dataMax = Lib.aggNums(Math.max, null, data);\n\n if(!calendar) calendar = ax.calendar;\n\n if(ax.type === 'category') {\n return {\n start: dataMin - 0.5,\n end: dataMax + 0.5,\n size: 1,\n _count: dataMax - dataMin + 1\n };\n }\n\n var size0;\n if(nbins) size0 = ((dataMax - dataMin) / nbins);\n else {\n // totally auto: scale off std deviation so the highest bin is\n // somewhat taller than the total number of bins, but don't let\n // the size get smaller than the 'nice' rounded down minimum\n // difference between values\n var distinctData = Lib.distinctVals(data),\n msexp = Math.pow(10, Math.floor(\n Math.log(distinctData.minDiff) / Math.LN10)),\n minSize = msexp * Lib.roundUp(\n distinctData.minDiff / msexp, [0.9, 1.9, 4.9, 9.9], true);\n size0 = Math.max(minSize, 2 * Lib.stdev(data) /\n Math.pow(data.length, is2d ? 0.25 : 0.4));\n\n // fallback if ax.d2c output BADNUMs\n // e.g. when user try to plot categorical bins\n // on a layout.xaxis.type: 'linear'\n if(!isNumeric(size0)) size0 = 1;\n }\n\n // piggyback off autotick code to make \"nice\" bin sizes\n var dummyAx;\n if(ax.type === 'log') {\n dummyAx = {\n type: 'linear',\n range: [dataMin, dataMax]\n };\n }\n else {\n dummyAx = {\n type: ax.type,\n range: Lib.simpleMap([dataMin, dataMax], ax.c2r, 0, calendar),\n calendar: calendar\n };\n }\n axes.setConvert(dummyAx);\n\n axes.autoTicks(dummyAx, size0);\n var binStart = axes.tickIncrement(\n axes.tickFirst(dummyAx), dummyAx.dtick, 'reverse', calendar);\n var binEnd, bincount;\n\n // check for too many data points right at the edges of bins\n // (>50% within 1% of bin edges) or all data points integral\n // and offset the bins accordingly\n if(typeof dummyAx.dtick === 'number') {\n binStart = autoShiftNumericBins(binStart, data, dummyAx, dataMin, dataMax);\n\n bincount = 1 + Math.floor((dataMax - binStart) / dummyAx.dtick);\n binEnd = binStart + bincount * dummyAx.dtick;\n }\n else {\n // month ticks - should be the only nonlinear kind we have at this point.\n // dtick (as supplied by axes.autoTick) only has nonlinear values on\n // date and log axes, but even if you display a histogram on a log axis\n // we bin it on a linear axis (which one could argue against, but that's\n // a separate issue)\n if(dummyAx.dtick.charAt(0) === 'M') {\n binStart = autoShiftMonthBins(binStart, data, dummyAx.dtick, dataMin, calendar);\n }\n\n // calculate the endpoint for nonlinear ticks - you have to\n // just increment until you're done\n binEnd = binStart;\n bincount = 0;\n while(binEnd <= dataMax) {\n binEnd = axes.tickIncrement(binEnd, dummyAx.dtick, false, calendar);\n bincount++;\n }\n }\n\n return {\n start: ax.c2r(binStart, 0, calendar),\n end: ax.c2r(binEnd, 0, calendar),\n size: dummyAx.dtick,\n _count: bincount\n };\n};\n\n\nfunction autoShiftNumericBins(binStart, data, ax, dataMin, dataMax) {\n var edgecount = 0,\n midcount = 0,\n intcount = 0,\n blankCount = 0;\n\n function nearEdge(v) {\n // is a value within 1% of a bin edge?\n return (1 + (v - binStart) * 100 / ax.dtick) % 100 < 2;\n }\n\n for(var i = 0; i < data.length; i++) {\n if(data[i] % 1 === 0) intcount++;\n else if(!isNumeric(data[i])) blankCount++;\n\n if(nearEdge(data[i])) edgecount++;\n if(nearEdge(data[i] + ax.dtick / 2)) midcount++;\n }\n var dataCount = data.length - blankCount;\n\n if(intcount === dataCount && ax.type !== 'date') {\n // all integers: if bin size is <1, it's because\n // that was specifically requested (large nbins)\n // so respect that... but center the bins containing\n // integers on those integers\n if(ax.dtick < 1) {\n binStart = dataMin - 0.5 * ax.dtick;\n }\n // otherwise start half an integer down regardless of\n // the bin size, just enough to clear up endpoint\n // ambiguity about which integers are in which bins.\n else {\n binStart -= 0.5;\n if(binStart + ax.dtick < dataMin) binStart += ax.dtick;\n }\n }\n else if(midcount < dataCount * 0.1) {\n if(edgecount > dataCount * 0.3 ||\n nearEdge(dataMin) || nearEdge(dataMax)) {\n // lots of points at the edge, not many in the middle\n // shift half a bin\n var binshift = ax.dtick / 2;\n binStart += (binStart + binshift < dataMin) ? binshift : -binshift;\n }\n }\n return binStart;\n}\n\n\nfunction autoShiftMonthBins(binStart, data, dtick, dataMin, calendar) {\n var stats = Lib.findExactDates(data, calendar);\n // number of data points that needs to be an exact value\n // to shift that increment to (near) the bin center\n var threshold = 0.8;\n\n if(stats.exactDays > threshold) {\n var numMonths = Number(dtick.substr(1));\n\n if((stats.exactYears > threshold) && (numMonths % 12 === 0)) {\n // The exact middle of a non-leap-year is 1.5 days into July\n // so if we start the bins here, all but leap years will\n // get hover-labeled as exact years.\n binStart = axes.tickIncrement(binStart, 'M6', 'reverse') + ONEDAY * 1.5;\n }\n else if(stats.exactMonths > threshold) {\n // Months are not as clean, but if we shift half the *longest*\n // month (31/2 days) then 31-day months will get labeled exactly\n // and shorter months will get labeled with the correct month\n // but shifted 12-36 hours into it.\n binStart = axes.tickIncrement(binStart, 'M1', 'reverse') + ONEDAY * 15.5;\n }\n else {\n // Shifting half a day is exact, but since these are month bins it\n // will always give a somewhat odd-looking label, until we do something\n // smarter like showing the bin boundaries (or the bounds of the actual\n // data in each bin)\n binStart -= ONEDAY / 2;\n }\n var nextBinStart = axes.tickIncrement(binStart, dtick);\n\n if(nextBinStart <= dataMin) return nextBinStart;\n }\n return binStart;\n}\n\n// ----------------------------------------------------\n// Ticks and grids\n// ----------------------------------------------------\n\n// calculate the ticks: text, values, positioning\n// if ticks are set to automatic, determine the right values (tick0,dtick)\n// in any case, set tickround to # of digits to round tick labels to,\n// or codes to this effect for log and date scales\naxes.calcTicks = function calcTicks(ax) {\n var rng = Lib.simpleMap(ax.range, ax.r2l);\n\n // calculate max number of (auto) ticks to display based on plot size\n if(ax.tickmode === 'auto' || !ax.dtick) {\n var nt = ax.nticks,\n minPx;\n if(!nt) {\n if(ax.type === 'category') {\n minPx = ax.tickfont ? (ax.tickfont.size || 12) * 1.2 : 15;\n nt = ax._length / minPx;\n }\n else {\n minPx = ax._id.charAt(0) === 'y' ? 40 : 80;\n nt = Lib.constrain(ax._length / minPx, 4, 9) + 1;\n }\n }\n\n // add a couple of extra digits for filling in ticks when we\n // have explicit tickvals without tick text\n if(ax.tickmode === 'array') nt *= 100;\n\n axes.autoTicks(ax, Math.abs(rng[1] - rng[0]) / nt);\n // check for a forced minimum dtick\n if(ax._minDtick > 0 && ax.dtick < ax._minDtick * 2) {\n ax.dtick = ax._minDtick;\n ax.tick0 = ax.l2r(ax._forceTick0);\n }\n }\n\n // check for missing tick0\n if(!ax.tick0) {\n ax.tick0 = (ax.type === 'date') ? '2000-01-01' : 0;\n }\n\n // now figure out rounding of tick values\n autoTickRound(ax);\n\n // now that we've figured out the auto values for formatting\n // in case we're missing some ticktext, we can break out for array ticks\n if(ax.tickmode === 'array') return arrayTicks(ax);\n\n // find the first tick\n ax._tmin = axes.tickFirst(ax);\n\n // check for reversed axis\n var axrev = (rng[1] < rng[0]);\n\n // return the full set of tick vals\n var vals = [],\n // add a tiny bit so we get ticks which may have rounded out\n endtick = rng[1] * 1.0001 - rng[0] * 0.0001;\n if(ax.type === 'category') {\n endtick = (axrev) ? Math.max(-0.5, endtick) :\n Math.min(ax._categories.length - 0.5, endtick);\n }\n\n var xPrevious = null;\n var maxTicks = Math.max(1000, ax._length || 0);\n for(var x = ax._tmin;\n (axrev) ? (x >= endtick) : (x <= endtick);\n x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)) {\n // prevent infinite loops - no more than one tick per pixel,\n // and make sure each value is different from the previous\n if(vals.length > maxTicks || x === xPrevious) break;\n xPrevious = x;\n\n vals.push(x);\n }\n\n // save the last tick as well as first, so we can\n // show the exponent only on the last one\n ax._tmax = vals[vals.length - 1];\n\n // for showing the rest of a date when the main tick label is only the\n // latter part: ax._prevDateHead holds what we showed most recently.\n // Start with it cleared and mark that we're in calcTicks (ie calculating a\n // whole string of these so we should care what the previous date head was!)\n ax._prevDateHead = '';\n ax._inCalcTicks = true;\n\n var ticksOut = new Array(vals.length);\n for(var i = 0; i < vals.length; i++) ticksOut[i] = axes.tickText(ax, vals[i]);\n\n ax._inCalcTicks = false;\n\n return ticksOut;\n};\n\nfunction arrayTicks(ax) {\n var vals = ax.tickvals,\n text = ax.ticktext,\n ticksOut = new Array(vals.length),\n rng = Lib.simpleMap(ax.range, ax.r2l),\n r0expanded = rng[0] * 1.0001 - rng[1] * 0.0001,\n r1expanded = rng[1] * 1.0001 - rng[0] * 0.0001,\n tickMin = Math.min(r0expanded, r1expanded),\n tickMax = Math.max(r0expanded, r1expanded),\n vali,\n i,\n j = 0;\n\n // without a text array, just format the given values as any other ticks\n // except with more precision to the numbers\n if(!Array.isArray(text)) text = [];\n\n // make sure showing ticks doesn't accidentally add new categories\n var tickVal2l = ax.type === 'category' ? ax.d2l_noadd : ax.d2l;\n\n // array ticks on log axes always show the full number\n // (if no explicit ticktext overrides it)\n if(ax.type === 'log' && String(ax.dtick).charAt(0) !== 'L') {\n ax.dtick = 'L' + Math.pow(10, Math.floor(Math.min(ax.range[0], ax.range[1])) - 1);\n }\n\n for(i = 0; i < vals.length; i++) {\n vali = tickVal2l(vals[i]);\n if(vali > tickMin && vali < tickMax) {\n if(text[i] === undefined) ticksOut[j] = axes.tickText(ax, vali);\n else ticksOut[j] = tickTextObj(ax, vali, String(text[i]));\n j++;\n }\n }\n\n if(j < vals.length) ticksOut.splice(j, vals.length - j);\n\n return ticksOut;\n}\n\nvar roundBase10 = [2, 5, 10],\n roundBase24 = [1, 2, 3, 6, 12],\n roundBase60 = [1, 2, 5, 10, 15, 30],\n // 2&3 day ticks are weird, but need something btwn 1&7\n roundDays = [1, 2, 3, 7, 14],\n // approx. tick positions for log axes, showing all (1) and just 1, 2, 5 (2)\n // these don't have to be exact, just close enough to round to the right value\n roundLog1 = [-0.046, 0, 0.301, 0.477, 0.602, 0.699, 0.778, 0.845, 0.903, 0.954, 1],\n roundLog2 = [-0.301, 0, 0.301, 0.699, 1];\n\nfunction roundDTick(roughDTick, base, roundingSet) {\n return base * Lib.roundUp(roughDTick / base, roundingSet);\n}\n\n// autoTicks: calculate best guess at pleasant ticks for this axis\n// inputs:\n// ax - an axis object\n// roughDTick - rough tick spacing (to be turned into a nice round number)\n// outputs (into ax):\n// tick0: starting point for ticks (not necessarily on the graph)\n// usually 0 for numeric (=10^0=1 for log) or jan 1, 2000 for dates\n// dtick: the actual, nice round tick spacing, usually a little larger than roughDTick\n// if the ticks are spaced linearly (linear scale, categories,\n// log with only full powers, date ticks < month),\n// this will just be a number\n// months: M#\n// years: M# where # is 12*number of years\n// log with linear ticks: L# where # is the linear tick spacing\n// log showing powers plus some intermediates:\n// D1 shows all digits, D2 shows 2 and 5\naxes.autoTicks = function(ax, roughDTick) {\n var base;\n\n if(ax.type === 'date') {\n ax.tick0 = Lib.dateTick0(ax.calendar);\n // the criteria below are all based on the rough spacing we calculate\n // being > half of the final unit - so precalculate twice the rough val\n var roughX2 = 2 * roughDTick;\n\n if(roughX2 > ONEAVGYEAR) {\n roughDTick /= ONEAVGYEAR;\n base = Math.pow(10, Math.floor(Math.log(roughDTick) / Math.LN10));\n ax.dtick = 'M' + (12 * roundDTick(roughDTick, base, roundBase10));\n }\n else if(roughX2 > ONEAVGMONTH) {\n roughDTick /= ONEAVGMONTH;\n ax.dtick = 'M' + roundDTick(roughDTick, 1, roundBase24);\n }\n else if(roughX2 > ONEDAY) {\n ax.dtick = roundDTick(roughDTick, ONEDAY, roundDays);\n // get week ticks on sunday\n // this will also move the base tick off 2000-01-01 if dtick is\n // 2 or 3 days... but that's a weird enough case that we'll ignore it.\n ax.tick0 = Lib.dateTick0(ax.calendar, true);\n }\n else if(roughX2 > ONEHOUR) {\n ax.dtick = roundDTick(roughDTick, ONEHOUR, roundBase24);\n }\n else if(roughX2 > ONEMIN) {\n ax.dtick = roundDTick(roughDTick, ONEMIN, roundBase60);\n }\n else if(roughX2 > ONESEC) {\n ax.dtick = roundDTick(roughDTick, ONESEC, roundBase60);\n }\n else {\n // milliseconds\n base = Math.pow(10, Math.floor(Math.log(roughDTick) / Math.LN10));\n ax.dtick = roundDTick(roughDTick, base, roundBase10);\n }\n }\n else if(ax.type === 'log') {\n ax.tick0 = 0;\n var rng = Lib.simpleMap(ax.range, ax.r2l);\n\n if(roughDTick > 0.7) {\n // only show powers of 10\n ax.dtick = Math.ceil(roughDTick);\n }\n else if(Math.abs(rng[1] - rng[0]) < 1) {\n // span is less than one power of 10\n var nt = 1.5 * Math.abs((rng[1] - rng[0]) / roughDTick);\n\n // ticks on a linear scale, labeled fully\n roughDTick = Math.abs(Math.pow(10, rng[1]) -\n Math.pow(10, rng[0])) / nt;\n base = Math.pow(10, Math.floor(Math.log(roughDTick) / Math.LN10));\n ax.dtick = 'L' + roundDTick(roughDTick, base, roundBase10);\n }\n else {\n // include intermediates between powers of 10,\n // labeled with small digits\n // ax.dtick = \"D2\" (show 2 and 5) or \"D1\" (show all digits)\n ax.dtick = (roughDTick > 0.3) ? 'D2' : 'D1';\n }\n }\n else if(ax.type === 'category') {\n ax.tick0 = 0;\n ax.dtick = Math.ceil(Math.max(roughDTick, 1));\n }\n else {\n // auto ticks always start at 0\n ax.tick0 = 0;\n base = Math.pow(10, Math.floor(Math.log(roughDTick) / Math.LN10));\n ax.dtick = roundDTick(roughDTick, base, roundBase10);\n }\n\n // prevent infinite loops\n if(ax.dtick === 0) ax.dtick = 1;\n\n // TODO: this is from log axis histograms with autorange off\n if(!isNumeric(ax.dtick) && typeof ax.dtick !== 'string') {\n var olddtick = ax.dtick;\n ax.dtick = 1;\n throw 'ax.dtick error: ' + String(olddtick);\n }\n};\n\n// after dtick is already known, find tickround = precision\n// to display in tick labels\n// for numeric ticks, integer # digits after . to round to\n// for date ticks, the last date part to show (y,m,d,H,M,S)\n// or an integer # digits past seconds\nfunction autoTickRound(ax) {\n var dtick = ax.dtick;\n\n ax._tickexponent = 0;\n if(!isNumeric(dtick) && typeof dtick !== 'string') {\n dtick = 1;\n }\n\n if(ax.type === 'category') {\n ax._tickround = null;\n }\n if(ax.type === 'date') {\n // If tick0 is unusual, give tickround a bit more information\n // not necessarily *all* the information in tick0 though, if it's really odd\n // minimal string length for tick0: 'd' is 10, 'M' is 16, 'S' is 19\n // take off a leading minus (year < 0) and i (intercalary month) so length is consistent\n var tick0ms = ax.r2l(ax.tick0),\n tick0str = ax.l2r(tick0ms).replace(/(^-|i)/g, ''),\n tick0len = tick0str.length;\n\n if(String(dtick).charAt(0) === 'M') {\n // any tick0 more specific than a year: alway show the full date\n if(tick0len > 10 || tick0str.substr(5) !== '01-01') ax._tickround = 'd';\n // show the month unless ticks are full multiples of a year\n else ax._tickround = (+(dtick.substr(1)) % 12 === 0) ? 'y' : 'm';\n }\n else if((dtick >= ONEDAY && tick0len <= 10) || (dtick >= ONEDAY * 15)) ax._tickround = 'd';\n else if((dtick >= ONEMIN && tick0len <= 16) || (dtick >= ONEHOUR)) ax._tickround = 'M';\n else if((dtick >= ONESEC && tick0len <= 19) || (dtick >= ONEMIN)) ax._tickround = 'S';\n else {\n // tickround is a number of digits of fractional seconds\n // of any two adjacent ticks, at least one will have the maximum fractional digits\n // of all possible ticks - so take the max. length of tick0 and the next one\n var tick1len = ax.l2r(tick0ms + dtick).replace(/^-/, '').length;\n ax._tickround = Math.max(tick0len, tick1len) - 20;\n }\n }\n else if(isNumeric(dtick) || dtick.charAt(0) === 'L') {\n // linear or log (except D1, D2)\n var rng = ax.range.map(ax.r2d || Number);\n if(!isNumeric(dtick)) dtick = Number(dtick.substr(1));\n // 2 digits past largest digit of dtick\n ax._tickround = 2 - Math.floor(Math.log(dtick) / Math.LN10 + 0.01);\n\n var maxend = Math.max(Math.abs(rng[0]), Math.abs(rng[1]));\n\n var rangeexp = Math.floor(Math.log(maxend) / Math.LN10 + 0.01);\n if(Math.abs(rangeexp) > 3) {\n if(isSIFormat(ax.exponentformat) && !beyondSI(rangeexp)) {\n ax._tickexponent = 3 * Math.round((rangeexp - 1) / 3);\n }\n else ax._tickexponent = rangeexp;\n }\n }\n // D1 or D2 (log)\n else ax._tickround = null;\n}\n\n// months and years don't have constant millisecond values\n// (but a year is always 12 months so we only need months)\n// log-scale ticks are also not consistently spaced, except\n// for pure powers of 10\n// numeric ticks always have constant differences, other datetime ticks\n// can all be calculated as constant number of milliseconds\naxes.tickIncrement = function(x, dtick, axrev, calendar) {\n var axSign = axrev ? -1 : 1;\n\n // includes linear, all dates smaller than month, and pure 10^n in log\n if(isNumeric(dtick)) return x + axSign * dtick;\n\n // everything else is a string, one character plus a number\n var tType = dtick.charAt(0),\n dtSigned = axSign * Number(dtick.substr(1));\n\n // Dates: months (or years - see Lib.incrementMonth)\n if(tType === 'M') return Lib.incrementMonth(x, dtSigned, calendar);\n\n // Log scales: Linear, Digits\n else if(tType === 'L') return Math.log(Math.pow(10, x) + dtSigned) / Math.LN10;\n\n // log10 of 2,5,10, or all digits (logs just have to be\n // close enough to round)\n else if(tType === 'D') {\n var tickset = (dtick === 'D2') ? roundLog2 : roundLog1,\n x2 = x + axSign * 0.01,\n frac = Lib.roundUp(Lib.mod(x2, 1), tickset, axrev);\n\n return Math.floor(x2) +\n Math.log(d3.round(Math.pow(10, frac), 1)) / Math.LN10;\n }\n else throw 'unrecognized dtick ' + String(dtick);\n};\n\n// calculate the first tick on an axis\naxes.tickFirst = function(ax) {\n var r2l = ax.r2l || Number,\n rng = Lib.simpleMap(ax.range, r2l),\n axrev = rng[1] < rng[0],\n sRound = axrev ? Math.floor : Math.ceil,\n // add a tiny extra bit to make sure we get ticks\n // that may have been rounded out\n r0 = rng[0] * 1.0001 - rng[1] * 0.0001,\n dtick = ax.dtick,\n tick0 = r2l(ax.tick0);\n\n if(isNumeric(dtick)) {\n var tmin = sRound((r0 - tick0) / dtick) * dtick + tick0;\n\n // make sure no ticks outside the category list\n if(ax.type === 'category') {\n tmin = Lib.constrain(tmin, 0, ax._categories.length - 1);\n }\n return tmin;\n }\n\n var tType = dtick.charAt(0),\n dtNum = Number(dtick.substr(1));\n\n // Dates: months (or years)\n if(tType === 'M') {\n var cnt = 0,\n t0 = tick0,\n t1,\n mult,\n newDTick;\n\n // This algorithm should work for *any* nonlinear (but close to linear!)\n // tick spacing. Limit to 10 iterations, for gregorian months it's normally <=3.\n while(cnt < 10) {\n t1 = axes.tickIncrement(t0, dtick, axrev, ax.calendar);\n if((t1 - r0) * (t0 - r0) <= 0) {\n // t1 and t0 are on opposite sides of r0! we've succeeded!\n if(axrev) return Math.min(t0, t1);\n return Math.max(t0, t1);\n }\n mult = (r0 - ((t0 + t1) / 2)) / (t1 - t0);\n newDTick = tType + ((Math.abs(Math.round(mult)) || 1) * dtNum);\n t0 = axes.tickIncrement(t0, newDTick, mult < 0 ? !axrev : axrev, ax.calendar);\n cnt++;\n }\n Lib.error('tickFirst did not converge', ax);\n return t0;\n }\n\n // Log scales: Linear, Digits\n else if(tType === 'L') {\n return Math.log(sRound(\n (Math.pow(10, r0) - tick0) / dtNum) * dtNum + tick0) / Math.LN10;\n }\n else if(tType === 'D') {\n var tickset = (dtick === 'D2') ? roundLog2 : roundLog1,\n frac = Lib.roundUp(Lib.mod(r0, 1), tickset, axrev);\n\n return Math.floor(r0) +\n Math.log(d3.round(Math.pow(10, frac), 1)) / Math.LN10;\n }\n else throw 'unrecognized dtick ' + String(dtick);\n};\n\n// draw the text for one tick.\n// px,py are the location on gd.paper\n// prefix is there so the x axis ticks can be dropped a line\n// ax is the axis layout, x is the tick value\n// hover is a (truthy) flag for whether to show numbers with a bit\n// more precision for hovertext\naxes.tickText = function(ax, x, hover) {\n var out = tickTextObj(ax, x),\n hideexp,\n arrayMode = ax.tickmode === 'array',\n extraPrecision = hover || arrayMode,\n i,\n tickVal2l = ax.type === 'category' ? ax.d2l_noadd : ax.d2l;\n\n if(arrayMode && Array.isArray(ax.ticktext)) {\n var rng = Lib.simpleMap(ax.range, ax.r2l),\n minDiff = Math.abs(rng[1] - rng[0]) / 10000;\n for(i = 0; i < ax.ticktext.length; i++) {\n if(Math.abs(x - tickVal2l(ax.tickvals[i])) < minDiff) break;\n }\n if(i < ax.ticktext.length) {\n out.text = String(ax.ticktext[i]);\n return out;\n }\n }\n\n function isHidden(showAttr) {\n var first_or_last;\n\n if(showAttr === undefined) return true;\n if(hover) return showAttr === 'none';\n\n first_or_last = {\n first: ax._tmin,\n last: ax._tmax\n }[showAttr];\n\n return showAttr !== 'all' && x !== first_or_last;\n }\n\n if(hover) {\n hideexp = 'never';\n } else {\n hideexp = ax.exponentformat !== 'none' && isHidden(ax.showexponent) ? 'hide' : '';\n }\n\n if(ax.type === 'date') formatDate(ax, out, hover, extraPrecision);\n else if(ax.type === 'log') formatLog(ax, out, hover, extraPrecision, hideexp);\n else if(ax.type === 'category') formatCategory(ax, out);\n else formatLinear(ax, out, hover, extraPrecision, hideexp);\n\n // add prefix and suffix\n if(ax.tickprefix && !isHidden(ax.showtickprefix)) out.text = ax.tickprefix + out.text;\n if(ax.ticksuffix && !isHidden(ax.showticksuffix)) out.text += ax.ticksuffix;\n\n return out;\n};\n\nfunction tickTextObj(ax, x, text) {\n var tf = ax.tickfont || {};\n\n return {\n x: x,\n dx: 0,\n dy: 0,\n text: text || '',\n fontSize: tf.size,\n font: tf.family,\n fontColor: tf.color\n };\n}\n\nfunction formatDate(ax, out, hover, extraPrecision) {\n var tr = ax._tickround,\n fmt = (hover && ax.hoverformat) || ax.tickformat;\n\n if(extraPrecision) {\n // second or sub-second precision: extra always shows max digits.\n // for other fields, extra precision just adds one field.\n if(isNumeric(tr)) tr = 4;\n else tr = {y: 'm', m: 'd', d: 'M', M: 'S', S: 4}[tr];\n }\n\n var dateStr = Lib.formatDate(out.x, fmt, tr, ax.calendar),\n headStr;\n\n var splitIndex = dateStr.indexOf('\\n');\n if(splitIndex !== -1) {\n headStr = dateStr.substr(splitIndex + 1);\n dateStr = dateStr.substr(0, splitIndex);\n }\n\n if(extraPrecision) {\n // if extraPrecision led to trailing zeros, strip them off\n // actually, this can lead to removing even more zeros than\n // in the original rounding, but that's fine because in these\n // contexts uniformity is not so important (if there's even\n // anything to be uniform with!)\n\n // can we remove the whole time part?\n if(dateStr === '00:00:00' || dateStr === '00:00') {\n dateStr = headStr;\n headStr = '';\n }\n else if(dateStr.length === 8) {\n // strip off seconds if they're zero (zero fractional seconds\n // are already omitted)\n // but we never remove minutes and leave just hours\n dateStr = dateStr.replace(/:00$/, '');\n }\n }\n\n if(headStr) {\n if(hover) {\n // hover puts it all on one line, so headPart works best up front\n // except for year headPart: turn this into \"Jan 1, 2000\" etc.\n if(tr === 'd') dateStr += ', ' + headStr;\n else dateStr = headStr + (dateStr ? ', ' + dateStr : '');\n }\n else if(!ax._inCalcTicks || (headStr !== ax._prevDateHead)) {\n dateStr += '
' + headStr;\n ax._prevDateHead = headStr;\n }\n }\n\n out.text = dateStr;\n}\n\nfunction formatLog(ax, out, hover, extraPrecision, hideexp) {\n var dtick = ax.dtick,\n x = out.x;\n\n if(hideexp === 'never') {\n // If this is a hover label, then we must *never* hide the exponent\n // for the sake of display, which could give the wrong value by\n // potentially many orders of magnitude. If hideexp was 'never', then\n // it's now succeeded by preventing the other condition from automating\n // this choice. Thus we can unset it so that the axis formatting takes\n // precedence.\n hideexp = '';\n }\n\n if(extraPrecision && ((typeof dtick !== 'string') || dtick.charAt(0) !== 'L')) dtick = 'L3';\n\n if(ax.tickformat || (typeof dtick === 'string' && dtick.charAt(0) === 'L')) {\n out.text = numFormat(Math.pow(10, x), ax, hideexp, extraPrecision);\n }\n else if(isNumeric(dtick) || ((dtick.charAt(0) === 'D') && (Lib.mod(x + 0.01, 1) < 0.1))) {\n var p = Math.round(x);\n if(['e', 'E', 'power'].indexOf(ax.exponentformat) !== -1 ||\n (isSIFormat(ax.exponentformat) && beyondSI(p))) {\n if(p === 0) out.text = 1;\n else if(p === 1) out.text = '10';\n else if(p > 1) out.text = '10' + p + '';\n else out.text = '10' + MINUS_SIGN + -p + '';\n\n out.fontSize *= 1.25;\n }\n else {\n out.text = numFormat(Math.pow(10, x), ax, '', 'fakehover');\n if(dtick === 'D1' && ax._id.charAt(0) === 'y') {\n out.dy -= out.fontSize / 6;\n }\n }\n }\n else if(dtick.charAt(0) === 'D') {\n out.text = String(Math.round(Math.pow(10, Lib.mod(x, 1))));\n out.fontSize *= 0.75;\n }\n else throw 'unrecognized dtick ' + String(dtick);\n\n // if 9's are printed on log scale, move the 10's away a bit\n if(ax.dtick === 'D1') {\n var firstChar = String(out.text).charAt(0);\n if(firstChar === '0' || firstChar === '1') {\n if(ax._id.charAt(0) === 'y') {\n out.dx -= out.fontSize / 4;\n }\n else {\n out.dy += out.fontSize / 2;\n out.dx += (ax.range[1] > ax.range[0] ? 1 : -1) *\n out.fontSize * (x < 0 ? 0.5 : 0.25);\n }\n }\n }\n}\n\nfunction formatCategory(ax, out) {\n var tt = ax._categories[Math.round(out.x)];\n if(tt === undefined) tt = '';\n out.text = String(tt);\n}\n\nfunction formatLinear(ax, out, hover, extraPrecision, hideexp) {\n if(hideexp === 'never') {\n // If this is a hover label, then we must *never* hide the exponent\n // for the sake of display, which could give the wrong value by\n // potentially many orders of magnitude. If hideexp was 'never', then\n // it's now succeeded by preventing the other condition from automating\n // this choice. Thus we can unset it so that the axis formatting takes\n // precedence.\n hideexp = '';\n } else if(ax.showexponent === 'all' && Math.abs(out.x / ax.dtick) < 1e-6) {\n // don't add an exponent to zero if we're showing all exponents\n // so the only reason you'd show an exponent on zero is if it's the\n // ONLY tick to get an exponent (first or last)\n hideexp = 'hide';\n }\n out.text = numFormat(out.x, ax, hideexp, extraPrecision);\n}\n\n// format a number (tick value) according to the axis settings\n// new, more reliable procedure than d3.round or similar:\n// add half the rounding increment, then stringify and truncate\n// also automatically switch to sci. notation\nvar SIPREFIXES = ['f', 'p', 'n', 'μ', 'm', '', 'k', 'M', 'G', 'T'];\n\nfunction isSIFormat(exponentFormat) {\n return exponentFormat === 'SI' || exponentFormat === 'B';\n}\n\n// are we beyond the range of common SI prefixes?\n// 10^-16 -> 1x10^-16\n// 10^-15 -> 1f\n// ...\n// 10^14 -> 100T\n// 10^15 -> 1x10^15\n// 10^16 -> 1x10^16\nfunction beyondSI(exponent) {\n return exponent > 14 || exponent < -15;\n}\n\nfunction numFormat(v, ax, fmtoverride, hover) {\n // negative?\n var isNeg = v < 0,\n // max number of digits past decimal point to show\n tickRound = ax._tickround,\n exponentFormat = fmtoverride || ax.exponentformat || 'B',\n exponent = ax._tickexponent,\n tickformat = ax.tickformat,\n separatethousands = ax.separatethousands;\n\n // special case for hover: set exponent just for this value, and\n // add a couple more digits of precision over tick labels\n if(hover) {\n // make a dummy axis obj to get the auto rounding and exponent\n var ah = {\n exponentformat: ax.exponentformat,\n dtick: ax.showexponent === 'none' ? ax.dtick :\n (isNumeric(v) ? Math.abs(v) || 1 : 1),\n // if not showing any exponents, don't change the exponent\n // from what we calculate\n range: ax.showexponent === 'none' ? ax.range.map(ax.r2d) : [0, v || 1]\n };\n autoTickRound(ah);\n tickRound = (Number(ah._tickround) || 0) + 4;\n exponent = ah._tickexponent;\n if(ax.hoverformat) tickformat = ax.hoverformat;\n }\n\n if(tickformat) return d3.format(tickformat)(v).replace(/-/g, MINUS_SIGN);\n\n // 'epsilon' - rounding increment\n var e = Math.pow(10, -tickRound) / 2;\n\n // exponentFormat codes:\n // 'e' (1.2e+6, default)\n // 'E' (1.2E+6)\n // 'SI' (1.2M)\n // 'B' (same as SI except 10^9=B not G)\n // 'none' (1200000)\n // 'power' (1.2x10^6)\n // 'hide' (1.2, use 3rd argument=='hide' to eg\n // only show exponent on last tick)\n if(exponentFormat === 'none') exponent = 0;\n\n // take the sign out, put it back manually at the end\n // - makes cases easier\n v = Math.abs(v);\n if(v < e) {\n // 0 is just 0, but may get exponent if it's the last tick\n v = '0';\n isNeg = false;\n }\n else {\n v += e;\n // take out a common exponent, if any\n if(exponent) {\n v *= Math.pow(10, -exponent);\n tickRound += exponent;\n }\n // round the mantissa\n if(tickRound === 0) v = String(Math.floor(v));\n else if(tickRound < 0) {\n v = String(Math.round(v));\n v = v.substr(0, v.length + tickRound);\n for(var i = tickRound; i < 0; i++) v += '0';\n }\n else {\n v = String(v);\n var dp = v.indexOf('.') + 1;\n if(dp) v = v.substr(0, dp + tickRound).replace(/\\.?0+$/, '');\n }\n // insert appropriate decimal point and thousands separator\n v = Lib.numSeparate(v, ax._separators, separatethousands);\n }\n\n // add exponent\n if(exponent && exponentFormat !== 'hide') {\n if(isSIFormat(exponentFormat) && beyondSI(exponent)) exponentFormat = 'power';\n\n var signedExponent;\n if(exponent < 0) signedExponent = MINUS_SIGN + -exponent;\n else if(exponentFormat !== 'power') signedExponent = '+' + exponent;\n else signedExponent = String(exponent);\n\n if(exponentFormat === 'e') {\n v += 'e' + signedExponent;\n }\n else if(exponentFormat === 'E') {\n v += 'E' + signedExponent;\n }\n else if(exponentFormat === 'power') {\n v += '×10' + signedExponent + '';\n }\n else if(exponentFormat === 'B' && exponent === 9) {\n v += 'B';\n }\n else if(isSIFormat(exponentFormat)) {\n v += SIPREFIXES[exponent / 3 + 5];\n }\n }\n\n // put sign back in and return\n // replace standard minus character (which is technically a hyphen)\n // with a true minus sign\n if(isNeg) return MINUS_SIGN + v;\n return v;\n}\n\naxes.subplotMatch = /^x([0-9]*)y([0-9]*)$/;\n\n// getSubplots - extract all combinations of axes we need to make plots for\n// as an array of items like 'xy', 'x2y', 'x2y2'...\n// sorted by x (x,x2,x3...) then y\n// optionally restrict to only subplots containing axis object ax\n// looks both for combinations of x and y found in the data\n// and at axes and their anchors\naxes.getSubplots = function(gd, ax) {\n var subplots = [];\n var i, j, sp;\n\n // look for subplots in the data\n var data = gd._fullData || gd.data || [];\n\n for(i = 0; i < data.length; i++) {\n var trace = data[i];\n\n if(trace.visible === false || trace.visible === 'legendonly' ||\n !(Registry.traceIs(trace, 'cartesian') || Registry.traceIs(trace, 'gl2d'))\n ) continue;\n\n var xId = trace.xaxis || 'x',\n yId = trace.yaxis || 'y';\n sp = xId + yId;\n\n if(subplots.indexOf(sp) === -1) subplots.push(sp);\n }\n\n // look for subplots in the axes/anchors, so that we at least draw all axes\n var axesList = axes.list(gd, '', true);\n\n function hasAx2(sp, ax2) {\n return sp.indexOf(ax2._id) !== -1;\n }\n\n for(i = 0; i < axesList.length; i++) {\n var ax2 = axesList[i],\n ax2Letter = ax2._id.charAt(0),\n ax3Id = (ax2.anchor === 'free') ?\n ((ax2Letter === 'x') ? 'y' : 'x') :\n ax2.anchor,\n ax3 = axes.getFromId(gd, ax3Id);\n\n // look if ax2 is already represented in the data\n var foundAx2 = false;\n for(j = 0; j < subplots.length; j++) {\n if(hasAx2(subplots[j], ax2)) {\n foundAx2 = true;\n break;\n }\n }\n\n // ignore free axes that already represented in the data\n if(ax2.anchor === 'free' && foundAx2) continue;\n\n // ignore anchor-less axes\n if(!ax3) continue;\n\n sp = (ax2Letter === 'x') ?\n ax2._id + ax3._id :\n ax3._id + ax2._id;\n\n if(subplots.indexOf(sp) === -1) subplots.push(sp);\n }\n\n // filter invalid subplots\n var spMatch = axes.subplotMatch,\n allSubplots = [];\n\n for(i = 0; i < subplots.length; i++) {\n sp = subplots[i];\n if(spMatch.test(sp)) allSubplots.push(sp);\n }\n\n // sort the subplot ids\n allSubplots.sort(function(a, b) {\n var aMatch = a.match(spMatch),\n bMatch = b.match(spMatch);\n\n if(aMatch[1] === bMatch[1]) {\n return +(aMatch[2] || 1) - (bMatch[2] || 1);\n }\n\n return +(aMatch[1]||0) - (bMatch[1]||0);\n });\n\n if(ax) return axes.findSubplotsWithAxis(allSubplots, ax);\n return allSubplots;\n};\n\n// find all subplots with axis 'ax'\naxes.findSubplotsWithAxis = function(subplots, ax) {\n var axMatch = new RegExp(\n (ax._id.charAt(0) === 'x') ? ('^' + ax._id + 'y') : (ax._id + '$')\n );\n var subplotsWithAxis = [];\n\n for(var i = 0; i < subplots.length; i++) {\n var sp = subplots[i];\n if(axMatch.test(sp)) subplotsWithAxis.push(sp);\n }\n\n return subplotsWithAxis;\n};\n\n// makeClipPaths: prepare clipPaths for all single axes and all possible xy pairings\naxes.makeClipPaths = function(gd) {\n var fullLayout = gd._fullLayout;\n var fullWidth = {_offset: 0, _length: fullLayout.width, _id: ''};\n var fullHeight = {_offset: 0, _length: fullLayout.height, _id: ''};\n var xaList = axes.list(gd, 'x', true);\n var yaList = axes.list(gd, 'y', true);\n var clipList = [];\n var i, j;\n\n for(i = 0; i < xaList.length; i++) {\n clipList.push({x: xaList[i], y: fullHeight});\n for(j = 0; j < yaList.length; j++) {\n if(i === 0) clipList.push({x: fullWidth, y: yaList[j]});\n clipList.push({x: xaList[i], y: yaList[j]});\n }\n }\n\n // selectors don't work right with camelCase tags,\n // have to use class instead\n // https://groups.google.com/forum/#!topic/d3-js/6EpAzQ2gU9I\n var axClips = fullLayout._clips.selectAll('.axesclip')\n .data(clipList, function(d) { return d.x._id + d.y._id; });\n\n axClips.enter().append('clipPath')\n .classed('axesclip', true)\n .attr('id', function(d) { return 'clip' + fullLayout._uid + d.x._id + d.y._id; })\n .append('rect');\n\n axClips.exit().remove();\n\n axClips.each(function(d) {\n d3.select(this).select('rect').attr({\n x: d.x._offset || 0,\n y: d.y._offset || 0,\n width: d.x._length || 1,\n height: d.y._length || 1\n });\n });\n};\n\n// doTicks: draw ticks, grids, and tick labels\n// axid: 'x', 'y', 'x2' etc,\n// blank to do all,\n// 'redraw' to force full redraw, and reset:\n// ax._r (stored range for use by zoom/pan)\n// ax._rl (stored linearized range for use by zoom/pan)\n// or can pass in an axis object directly\naxes.doTicks = function(gd, axid, skipTitle) {\n var fullLayout = gd._fullLayout,\n ax,\n independent = false;\n\n // allow passing an independent axis object instead of id\n if(typeof axid === 'object') {\n ax = axid;\n axid = ax._id;\n independent = true;\n }\n else {\n ax = axes.getFromId(gd, axid);\n\n if(axid === 'redraw') {\n fullLayout._paper.selectAll('g.subplot').each(function(subplot) {\n var plotinfo = fullLayout._plots[subplot],\n xa = plotinfo.xaxis,\n ya = plotinfo.yaxis;\n\n plotinfo.xaxislayer\n .selectAll('.' + xa._id + 'tick').remove();\n plotinfo.yaxislayer\n .selectAll('.' + ya._id + 'tick').remove();\n plotinfo.gridlayer\n .selectAll('path').remove();\n plotinfo.zerolinelayer\n .selectAll('path').remove();\n fullLayout._infolayer.select('.g-' + xa._id + 'title').remove();\n fullLayout._infolayer.select('.g-' + ya._id + 'title').remove();\n });\n }\n\n if(!axid || axid === 'redraw') {\n return Lib.syncOrAsync(axes.list(gd, '', true).map(function(ax) {\n return function() {\n if(!ax._id) return;\n var axDone = axes.doTicks(gd, ax._id);\n if(axid === 'redraw') {\n ax._r = ax.range.slice();\n ax._rl = Lib.simpleMap(ax._r, ax.r2l);\n }\n return axDone;\n };\n }));\n }\n }\n\n // make sure we only have allowed options for exponents\n // (others can make confusing errors)\n if(!ax.tickformat) {\n if(['none', 'e', 'E', 'power', 'SI', 'B'].indexOf(ax.exponentformat) === -1) {\n ax.exponentformat = 'e';\n }\n if(['all', 'first', 'last', 'none'].indexOf(ax.showexponent) === -1) {\n ax.showexponent = 'all';\n }\n }\n\n // set scaling to pixels\n ax.setScale();\n\n var axLetter = axid.charAt(0),\n counterLetter = axes.counterLetter(axid),\n vals = axes.calcTicks(ax),\n datafn = function(d) { return [d.text, d.x, ax.mirror].join('_'); },\n tcls = axid + 'tick',\n gcls = axid + 'grid',\n zcls = axid + 'zl',\n pad = (ax.linewidth || 1) / 2,\n labelStandoff = (ax.ticks === 'outside' ? ax.ticklen : 0),\n labelShift = 0,\n gridWidth = Drawing.crispRound(gd, ax.gridwidth, 1),\n zeroLineWidth = Drawing.crispRound(gd, ax.zerolinewidth, gridWidth),\n tickWidth = Drawing.crispRound(gd, ax.tickwidth, 1),\n sides, transfn, tickpathfn, subplots,\n i;\n\n if(ax._counterangle && ax.ticks === 'outside') {\n var caRad = ax._counterangle * Math.PI / 180;\n labelStandoff = ax.ticklen * Math.cos(caRad) + 1;\n labelShift = ax.ticklen * Math.sin(caRad);\n }\n\n if(ax.showticklabels && (ax.ticks === 'outside' || ax.showline)) {\n labelStandoff += 0.2 * ax.tickfont.size;\n }\n\n // positioning arguments for x vs y axes\n if(axLetter === 'x') {\n sides = ['bottom', 'top'];\n transfn = function(d) {\n return 'translate(' + ax.l2p(d.x) + ',0)';\n };\n tickpathfn = function(shift, len) {\n if(ax._counterangle) {\n var caRad = ax._counterangle * Math.PI / 180;\n return 'M0,' + shift + 'l' + (Math.sin(caRad) * len) + ',' + (Math.cos(caRad) * len);\n }\n else return 'M0,' + shift + 'v' + len;\n };\n }\n else if(axLetter === 'y') {\n sides = ['left', 'right'];\n transfn = function(d) {\n return 'translate(0,' + ax.l2p(d.x) + ')';\n };\n tickpathfn = function(shift, len) {\n if(ax._counterangle) {\n var caRad = ax._counterangle * Math.PI / 180;\n return 'M' + shift + ',0l' + (Math.cos(caRad) * len) + ',' + (-Math.sin(caRad) * len);\n }\n else return 'M' + shift + ',0h' + len;\n };\n }\n else {\n Lib.warn('Unrecognized doTicks axis:', axid);\n return;\n }\n var axside = ax.side || sides[0],\n // which direction do the side[0], side[1], and free ticks go?\n // then we flip if outside XOR y axis\n ticksign = [-1, 1, axside === sides[1] ? 1 : -1];\n if((ax.ticks !== 'inside') === (axLetter === 'x')) {\n ticksign = ticksign.map(function(v) { return -v; });\n }\n\n if(!ax.visible) return;\n\n // remove zero lines, grid lines, and inside ticks if they're within\n // 1 pixel of the end\n // The key case here is removing zero lines when the axis bound is zero.\n function clipEnds(d) {\n var p = ax.l2p(d.x);\n return (p > 1 && p < ax._length - 1);\n }\n var valsClipped = vals.filter(clipEnds);\n\n function drawTicks(container, tickpath) {\n var ticks = container.selectAll('path.' + tcls)\n .data(ax.ticks === 'inside' ? valsClipped : vals, datafn);\n if(tickpath && ax.ticks) {\n ticks.enter().append('path').classed(tcls, 1).classed('ticks', 1)\n .classed('crisp', 1)\n .call(Color.stroke, ax.tickcolor)\n .style('stroke-width', tickWidth + 'px')\n .attr('d', tickpath);\n ticks.attr('transform', transfn);\n ticks.exit().remove();\n }\n else ticks.remove();\n }\n\n function drawLabels(container, position) {\n // tick labels - for now just the main labels.\n // TODO: mirror labels, esp for subplots\n var tickLabels = container.selectAll('g.' + tcls).data(vals, datafn);\n\n if(!isNumeric(position)) {\n tickLabels.remove();\n drawAxTitle();\n return;\n }\n if(!ax.showticklabels) {\n tickLabels.remove();\n drawAxTitle();\n calcBoundingBox();\n return;\n }\n\n var labelx, labely, labelanchor, labelpos0, flipit;\n if(axLetter === 'x') {\n flipit = (axside === 'bottom') ? 1 : -1;\n labelx = function(d) { return d.dx + labelShift * flipit; };\n labelpos0 = position + (labelStandoff + pad) * flipit;\n labely = function(d) {\n return d.dy + labelpos0 + d.fontSize *\n ((axside === 'bottom') ? 1 : -0.2);\n };\n labelanchor = function(angle) {\n if(!isNumeric(angle) || angle === 0 || angle === 180) {\n return 'middle';\n }\n return (angle * flipit < 0) ? 'end' : 'start';\n };\n }\n else {\n flipit = (axside === 'right') ? 1 : -1;\n labely = function(d) {\n return d.dy + d.fontSize * MID_SHIFT - labelShift * flipit;\n };\n labelx = function(d) {\n return d.dx + position + (labelStandoff + pad +\n ((Math.abs(ax.tickangle) === 90) ? d.fontSize / 2 : 0)) * flipit;\n };\n labelanchor = function(angle) {\n if(isNumeric(angle) && Math.abs(angle) === 90) {\n return 'middle';\n }\n return axside === 'right' ? 'start' : 'end';\n };\n }\n var maxFontSize = 0,\n autoangle = 0,\n labelsReady = [];\n tickLabels.enter().append('g').classed(tcls, 1)\n .append('text')\n // only so tex has predictable alignment that we can\n // alter later\n .attr('text-anchor', 'middle')\n .each(function(d) {\n var thisLabel = d3.select(this),\n newPromise = gd._promises.length;\n thisLabel\n .call(svgTextUtils.positionText, labelx(d), labely(d))\n .call(Drawing.font, d.font, d.fontSize, d.fontColor)\n .text(d.text)\n .call(svgTextUtils.convertToTspans, gd);\n newPromise = gd._promises[newPromise];\n if(newPromise) {\n // if we have an async label, we'll deal with that\n // all here so take it out of gd._promises and\n // instead position the label and promise this in\n // labelsReady\n labelsReady.push(gd._promises.pop().then(function() {\n positionLabels(thisLabel, ax.tickangle);\n }));\n }\n else {\n // sync label: just position it now.\n positionLabels(thisLabel, ax.tickangle);\n }\n });\n tickLabels.exit().remove();\n\n tickLabels.each(function(d) {\n maxFontSize = Math.max(maxFontSize, d.fontSize);\n });\n\n function positionLabels(s, angle) {\n s.each(function(d) {\n var anchor = labelanchor(angle);\n var thisLabel = d3.select(this),\n mathjaxGroup = thisLabel.select('.text-math-group'),\n transform = transfn(d) +\n ((isNumeric(angle) && +angle !== 0) ?\n (' rotate(' + angle + ',' + labelx(d) + ',' +\n (labely(d) - d.fontSize / 2) + ')') :\n '');\n if(mathjaxGroup.empty()) {\n thisLabel.select('text').attr({\n transform: transform,\n 'text-anchor': anchor\n });\n }\n else {\n var mjShift =\n Drawing.bBox(mathjaxGroup.node()).width *\n {end: -0.5, start: 0.5}[anchor];\n mathjaxGroup.attr('transform', transform +\n (mjShift ? 'translate(' + mjShift + ',0)' : ''));\n }\n });\n }\n\n // make sure all labels are correctly positioned at their base angle\n // the positionLabels call above is only for newly drawn labels.\n // do this without waiting, using the last calculated angle to\n // minimize flicker, then do it again when we know all labels are\n // there, putting back the prescribed angle to check for overlaps.\n positionLabels(tickLabels, ax._lastangle || ax.tickangle);\n\n function allLabelsReady() {\n return labelsReady.length && Promise.all(labelsReady);\n }\n\n function fixLabelOverlaps() {\n positionLabels(tickLabels, ax.tickangle);\n\n // check for auto-angling if x labels overlap\n // don't auto-angle at all for log axes with\n // base and digit format\n if(axLetter === 'x' && !isNumeric(ax.tickangle) &&\n (ax.type !== 'log' || String(ax.dtick).charAt(0) !== 'D')) {\n var lbbArray = [];\n tickLabels.each(function(d) {\n var s = d3.select(this),\n thisLabel = s.select('.text-math-group'),\n x = ax.l2p(d.x);\n if(thisLabel.empty()) thisLabel = s.select('text');\n\n var bb = Drawing.bBox(thisLabel.node());\n\n lbbArray.push({\n // ignore about y, just deal with x overlaps\n top: 0,\n bottom: 10,\n height: 10,\n left: x - bb.width / 2,\n // impose a 2px gap\n right: x + bb.width / 2 + 2,\n width: bb.width + 2\n });\n });\n for(i = 0; i < lbbArray.length - 1; i++) {\n if(Lib.bBoxIntersect(lbbArray[i], lbbArray[i + 1])) {\n // any overlap at all - set 30 degrees\n autoangle = 30;\n break;\n }\n }\n if(autoangle) {\n var tickspacing = Math.abs(\n (vals[vals.length - 1].x - vals[0].x) * ax._m\n ) / (vals.length - 1);\n if(tickspacing < maxFontSize * 2.5) {\n autoangle = 90;\n }\n positionLabels(tickLabels, autoangle);\n }\n ax._lastangle = autoangle;\n }\n\n // update the axis title\n // (so it can move out of the way if needed)\n // TODO: separate out scoot so we don't need to do\n // a full redraw of the title (mostly relevant for MathJax)\n drawAxTitle();\n return axid + ' done';\n }\n\n function calcBoundingBox() {\n if(ax.showticklabels) {\n var gdBB = gd.getBoundingClientRect();\n var bBox = container.node().getBoundingClientRect();\n\n /*\n * the way we're going to use this, the positioning that matters\n * is relative to the origin of gd. This is important particularly\n * if gd is scrollable, and may have been scrolled between the time\n * we calculate this and the time we use it\n */\n\n ax._boundingBox = {\n width: bBox.width,\n height: bBox.height,\n left: bBox.left - gdBB.left,\n right: bBox.right - gdBB.left,\n top: bBox.top - gdBB.top,\n bottom: bBox.bottom - gdBB.top\n };\n } else {\n var gs = fullLayout._size;\n var pos;\n\n // set dummy bbox for ticklabel-less axes\n\n if(axLetter === 'x') {\n pos = ax.anchor === 'free' ?\n gs.t + gs.h * (1 - ax.position) :\n gs.t + gs.h * (1 - ax._anchorAxis.domain[{bottom: 0, top: 1}[ax.side]]);\n\n ax._boundingBox = {\n top: pos,\n bottom: pos,\n left: ax._offset,\n rigth: ax._offset + ax._length,\n width: ax._length,\n height: 0\n };\n } else {\n pos = ax.anchor === 'free' ?\n gs.l + gs.w * ax.position :\n gs.l + gs.w * ax._anchorAxis.domain[{left: 0, right: 1}[ax.side]];\n\n ax._boundingBox = {\n left: pos,\n right: pos,\n bottom: ax._offset + ax._length,\n top: ax._offset,\n height: ax._length,\n width: 0\n };\n }\n }\n\n /*\n * for spikelines: what's the full domain of positions in the\n * opposite direction that are associated with this axis?\n * This means any axes that we make a subplot with, plus the\n * position of the axis itself if it's free.\n */\n if(subplots) {\n var fullRange = ax._counterSpan = [Infinity, -Infinity];\n\n for(i = 0; i < subplots.length; i++) {\n var subplot = fullLayout._plots[subplots[i]];\n var counterAxis = subplot[(axLetter === 'x') ? 'yaxis' : 'xaxis'];\n\n extendRange(fullRange, [\n counterAxis._offset,\n counterAxis._offset + counterAxis._length\n ]);\n }\n\n if(ax.anchor === 'free') {\n extendRange(fullRange, (axLetter === 'x') ?\n [ax._boundingBox.bottom, ax._boundingBox.top] :\n [ax._boundingBox.right, ax._boundingBox.left]);\n }\n }\n\n function extendRange(range, newRange) {\n range[0] = Math.min(range[0], newRange[0]);\n range[1] = Math.max(range[1], newRange[1]);\n }\n }\n\n var done = Lib.syncOrAsync([\n allLabelsReady,\n fixLabelOverlaps,\n calcBoundingBox\n ]);\n if(done && done.then) gd._promises.push(done);\n return done;\n }\n\n function drawAxTitle() {\n if(skipTitle) return;\n\n // now this only applies to regular cartesian axes; colorbars and\n // others ALWAYS call doTicks with skipTitle=true so they can\n // configure their own titles.\n var ax = axisIds.getFromId(gd, axid),\n avoidSelection = d3.select(gd).selectAll('g.' + axid + 'tick'),\n avoid = {\n selection: avoidSelection,\n side: ax.side\n },\n axLetter = axid.charAt(0),\n gs = gd._fullLayout._size,\n offsetBase = 1.5,\n fontSize = ax.titlefont.size,\n transform,\n counterAxis,\n x,\n y;\n if(avoidSelection.size()) {\n var translation = Drawing.getTranslate(avoidSelection.node().parentNode);\n avoid.offsetLeft = translation.x;\n avoid.offsetTop = translation.y;\n }\n\n var titleStandoff = 10 + fontSize * offsetBase +\n (ax.linewidth ? ax.linewidth - 1 : 0);\n\n if(axLetter === 'x') {\n counterAxis = (ax.anchor === 'free') ?\n {_offset: gs.t + (1 - (ax.position || 0)) * gs.h, _length: 0} :\n axisIds.getFromId(gd, ax.anchor);\n\n x = ax._offset + ax._length / 2;\n if(ax.side === 'top') {\n y = -titleStandoff - fontSize * (ax.showticklabels ? 1 : 0);\n }\n else {\n y = counterAxis._length + titleStandoff +\n fontSize * (ax.showticklabels ? 1.5 : 0.5);\n }\n y += counterAxis._offset;\n\n if(ax.rangeslider && ax.rangeslider.visible && ax._boundingBox) {\n y += (fullLayout.height - fullLayout.margin.b - fullLayout.margin.t) *\n ax.rangeslider.thickness + ax._boundingBox.height;\n }\n\n if(!avoid.side) avoid.side = 'bottom';\n }\n else {\n counterAxis = (ax.anchor === 'free') ?\n {_offset: gs.l + (ax.position || 0) * gs.w, _length: 0} :\n axisIds.getFromId(gd, ax.anchor);\n\n y = ax._offset + ax._length / 2;\n if(ax.side === 'right') {\n x = counterAxis._length + titleStandoff +\n fontSize * (ax.showticklabels ? 1 : 0.5);\n }\n else {\n x = -titleStandoff - fontSize * (ax.showticklabels ? 0.5 : 0);\n }\n x += counterAxis._offset;\n\n transform = {rotate: '-90', offset: 0};\n if(!avoid.side) avoid.side = 'left';\n }\n\n Titles.draw(gd, axid + 'title', {\n propContainer: ax,\n propName: ax._name + '.title',\n dfltName: axLetter.toUpperCase() + ' axis',\n avoid: avoid,\n transform: transform,\n attributes: {x: x, y: y, 'text-anchor': 'middle'}\n });\n }\n\n function traceHasBarsOrFill(trace, subplot) {\n if(trace.visible !== true || trace.xaxis + trace.yaxis !== subplot) return false;\n if(Registry.traceIs(trace, 'bar') && trace.orientation === {x: 'h', y: 'v'}[axLetter]) return true;\n return trace.fill && trace.fill.charAt(trace.fill.length - 1) === axLetter;\n }\n\n function drawGrid(plotinfo, counteraxis, subplot) {\n var gridcontainer = plotinfo.gridlayer,\n zlcontainer = plotinfo.zerolinelayer,\n gridvals = plotinfo['hidegrid' + axLetter] ? [] : valsClipped,\n gridpath = ax._gridpath ||\n 'M0,0' + ((axLetter === 'x') ? 'v' : 'h') + counteraxis._length,\n grid = gridcontainer.selectAll('path.' + gcls)\n .data((ax.showgrid === false) ? [] : gridvals, datafn);\n grid.enter().append('path').classed(gcls, 1)\n .classed('crisp', 1)\n .attr('d', gridpath)\n .each(function(d) {\n if(ax.zeroline && (ax.type === 'linear' || ax.type === '-') &&\n Math.abs(d.x) < ax.dtick / 100) {\n d3.select(this).remove();\n }\n });\n grid.attr('transform', transfn)\n .call(Color.stroke, ax.gridcolor || '#ddd')\n .style('stroke-width', gridWidth + 'px');\n grid.exit().remove();\n\n // zero line\n if(zlcontainer) {\n var hasBarsOrFill = false;\n for(var i = 0; i < gd._fullData.length; i++) {\n if(traceHasBarsOrFill(gd._fullData[i], subplot)) {\n hasBarsOrFill = true;\n break;\n }\n }\n var rng = Lib.simpleMap(ax.range, ax.r2l),\n showZl = (rng[0] * rng[1] <= 0) && ax.zeroline &&\n (ax.type === 'linear' || ax.type === '-') && gridvals.length &&\n (hasBarsOrFill || clipEnds({x: 0}) || !ax.showline);\n var zl = zlcontainer.selectAll('path.' + zcls)\n .data(showZl ? [{x: 0}] : []);\n zl.enter().append('path').classed(zcls, 1).classed('zl', 1)\n .classed('crisp', 1)\n .attr('d', gridpath);\n zl.attr('transform', transfn)\n .call(Color.stroke, ax.zerolinecolor || Color.defaultLine)\n .style('stroke-width', zeroLineWidth + 'px');\n zl.exit().remove();\n }\n }\n\n if(independent) {\n drawTicks(ax._axislayer, tickpathfn(ax._pos + pad * ticksign[2], ticksign[2] * ax.ticklen));\n if(ax._counteraxis) {\n var fictionalPlotinfo = {\n gridlayer: ax._gridlayer,\n zerolinelayer: ax._zerolinelayer\n };\n drawGrid(fictionalPlotinfo, ax._counteraxis);\n }\n return drawLabels(ax._axislayer, ax._pos);\n }\n else {\n subplots = axes.getSubplots(gd, ax);\n var alldone = subplots.map(function(subplot) {\n var plotinfo = fullLayout._plots[subplot];\n\n if(!fullLayout._has('cartesian')) return;\n\n var container = plotinfo[axLetter + 'axislayer'],\n\n // [bottom or left, top or right, free, main]\n linepositions = ax._linepositions[subplot] || [],\n counteraxis = plotinfo[counterLetter + 'axis'],\n mainSubplot = counteraxis._id === ax.anchor,\n ticksides = [false, false, false],\n tickpath = '';\n\n // ticks\n if(ax.mirror === 'allticks') ticksides = [true, true, false];\n else if(mainSubplot) {\n if(ax.mirror === 'ticks') ticksides = [true, true, false];\n else ticksides[sides.indexOf(axside)] = true;\n }\n if(ax.mirrors) {\n for(i = 0; i < 2; i++) {\n var thisMirror = ax.mirrors[counteraxis._id + sides[i]];\n if(thisMirror === 'ticks' || thisMirror === 'labels') {\n ticksides[i] = true;\n }\n }\n }\n\n // free axis ticks\n if(linepositions[2] !== undefined) ticksides[2] = true;\n\n ticksides.forEach(function(showside, sidei) {\n var pos = linepositions[sidei],\n tsign = ticksign[sidei];\n if(showside && isNumeric(pos)) {\n tickpath += tickpathfn(pos + pad * tsign, tsign * ax.ticklen);\n }\n });\n\n drawTicks(container, tickpath);\n drawGrid(plotinfo, counteraxis, subplot);\n return drawLabels(container, linepositions[3]);\n }).filter(function(onedone) { return onedone && onedone.then; });\n\n return alldone.length ? Promise.all(alldone) : 0;\n }\n};\n\n// swap all the presentation attributes of the axes showing these traces\naxes.swap = function(gd, traces) {\n var axGroups = makeAxisGroups(gd, traces);\n\n for(var i = 0; i < axGroups.length; i++) {\n swapAxisGroup(gd, axGroups[i].x, axGroups[i].y);\n }\n};\n\nfunction makeAxisGroups(gd, traces) {\n var groups = [],\n i,\n j;\n\n for(i = 0; i < traces.length; i++) {\n var groupsi = [],\n xi = gd._fullData[traces[i]].xaxis,\n yi = gd._fullData[traces[i]].yaxis;\n if(!xi || !yi) continue; // not a 2D cartesian trace?\n\n for(j = 0; j < groups.length; j++) {\n if(groups[j].x.indexOf(xi) !== -1 || groups[j].y.indexOf(yi) !== -1) {\n groupsi.push(j);\n }\n }\n\n if(!groupsi.length) {\n groups.push({x: [xi], y: [yi]});\n continue;\n }\n\n var group0 = groups[groupsi[0]],\n groupj;\n\n if(groupsi.length > 1) {\n for(j = 1; j < groupsi.length; j++) {\n groupj = groups[groupsi[j]];\n mergeAxisGroups(group0.x, groupj.x);\n mergeAxisGroups(group0.y, groupj.y);\n }\n }\n mergeAxisGroups(group0.x, [xi]);\n mergeAxisGroups(group0.y, [yi]);\n }\n\n return groups;\n}\n\nfunction mergeAxisGroups(intoSet, fromSet) {\n for(var i = 0; i < fromSet.length; i++) {\n if(intoSet.indexOf(fromSet[i]) === -1) intoSet.push(fromSet[i]);\n }\n}\n\nfunction swapAxisGroup(gd, xIds, yIds) {\n var i,\n j,\n xFullAxes = [],\n yFullAxes = [],\n layout = gd.layout;\n\n for(i = 0; i < xIds.length; i++) xFullAxes.push(axes.getFromId(gd, xIds[i]));\n for(i = 0; i < yIds.length; i++) yFullAxes.push(axes.getFromId(gd, yIds[i]));\n\n var allAxKeys = Object.keys(xFullAxes[0]),\n noSwapAttrs = [\n 'anchor', 'domain', 'overlaying', 'position', 'side', 'tickangle'\n ],\n numericTypes = ['linear', 'log'];\n\n for(i = 0; i < allAxKeys.length; i++) {\n var keyi = allAxKeys[i],\n xVal = xFullAxes[0][keyi],\n yVal = yFullAxes[0][keyi],\n allEqual = true,\n coerceLinearX = false,\n coerceLinearY = false;\n if(keyi.charAt(0) === '_' || typeof xVal === 'function' ||\n noSwapAttrs.indexOf(keyi) !== -1) {\n continue;\n }\n for(j = 1; j < xFullAxes.length && allEqual; j++) {\n var xVali = xFullAxes[j][keyi];\n if(keyi === 'type' && numericTypes.indexOf(xVal) !== -1 &&\n numericTypes.indexOf(xVali) !== -1 && xVal !== xVali) {\n // type is special - if we find a mixture of linear and log,\n // coerce them all to linear on flipping\n coerceLinearX = true;\n }\n else if(xVali !== xVal) allEqual = false;\n }\n for(j = 1; j < yFullAxes.length && allEqual; j++) {\n var yVali = yFullAxes[j][keyi];\n if(keyi === 'type' && numericTypes.indexOf(yVal) !== -1 &&\n numericTypes.indexOf(yVali) !== -1 && yVal !== yVali) {\n // type is special - if we find a mixture of linear and log,\n // coerce them all to linear on flipping\n coerceLinearY = true;\n }\n else if(yFullAxes[j][keyi] !== yVal) allEqual = false;\n }\n if(allEqual) {\n if(coerceLinearX) layout[xFullAxes[0]._name].type = 'linear';\n if(coerceLinearY) layout[yFullAxes[0]._name].type = 'linear';\n swapAxisAttrs(layout, keyi, xFullAxes, yFullAxes);\n }\n }\n\n // now swap x&y for any annotations anchored to these x & y\n for(i = 0; i < gd._fullLayout.annotations.length; i++) {\n var ann = gd._fullLayout.annotations[i];\n if(xIds.indexOf(ann.xref) !== -1 &&\n yIds.indexOf(ann.yref) !== -1) {\n Lib.swapAttrs(layout.annotations[i], ['?']);\n }\n }\n}\n\nfunction swapAxisAttrs(layout, key, xFullAxes, yFullAxes) {\n // in case the value is the default for either axis,\n // look at the first axis in each list and see if\n // this key's value is undefined\n var np = Lib.nestedProperty,\n xVal = np(layout[xFullAxes[0]._name], key).get(),\n yVal = np(layout[yFullAxes[0]._name], key).get(),\n i;\n if(key === 'title') {\n // special handling of placeholder titles\n if(xVal === 'Click to enter X axis title') {\n xVal = 'Click to enter Y axis title';\n }\n if(yVal === 'Click to enter Y axis title') {\n yVal = 'Click to enter X axis title';\n }\n }\n\n for(i = 0; i < xFullAxes.length; i++) {\n np(layout, xFullAxes[i]._name + '.' + key).set(yVal);\n }\n for(i = 0; i < yFullAxes.length; i++) {\n np(layout, yFullAxes[i]._name + '.' + key).set(xVal);\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/axes.js\n// module id = 9\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * Pack internal modules unto an object.\n *\n * This object is require'ed in as 'Plotly' in numerous src and test files.\n * Require'ing 'Plotly' bypasses circular dependencies.\n *\n * Future development should move away from this pattern.\n *\n */\n\n// configuration\nexports.defaultConfig = require('./plot_api/plot_config');\n\n// plots\nexports.Plots = require('./plots/plots');\nexports.Axes = require('./plots/cartesian/axes');\n\n// components\nexports.ModeBar = require('./components/modebar');\n\n// plot api\nrequire('./plot_api/plot_api');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plotly.js\n// module id = 12\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar Plotly = require('../plotly');\nvar PlotSchema = require('../plot_api/plot_schema');\nvar Registry = require('../registry');\nvar Lib = require('../lib');\nvar Color = require('../components/color');\nvar BADNUM = require('../constants/numerical').BADNUM;\n\nvar plots = module.exports = {};\n\nvar animationAttrs = require('./animation_attributes');\nvar frameAttrs = require('./frame_attributes');\n\nvar relinkPrivateKeys = Lib.relinkPrivateKeys;\n\n// Expose registry methods on Plots for backward-compatibility\nLib.extendFlat(plots, Registry);\n\nplots.attributes = require('./attributes');\nplots.attributes.type.values = plots.allTypes;\nplots.fontAttrs = require('./font_attributes');\nplots.layoutAttributes = require('./layout_attributes');\n\n// TODO make this a plot attribute?\nplots.fontWeight = 'normal';\n\nvar subplotsRegistry = plots.subplotsRegistry;\nvar transformsRegistry = plots.transformsRegistry;\n\nvar ErrorBars = require('../components/errorbars');\n\nvar commandModule = require('./command');\nplots.executeAPICommand = commandModule.executeAPICommand;\nplots.computeAPICommandBindings = commandModule.computeAPICommandBindings;\nplots.manageCommandObserver = commandModule.manageCommandObserver;\nplots.hasSimpleAPICommandBindings = commandModule.hasSimpleAPICommandBindings;\n\n/**\n * Find subplot ids in data.\n * Meant to be used in the defaults step.\n *\n * Use plots.getSubplotIds to grab the current\n * subplot ids later on in Plotly.plot.\n *\n * @param {array} data plotly data array\n * (intended to be _fullData, but does not have to be).\n * @param {string} type subplot type to look for.\n *\n * @return {array} list of subplot ids (strings).\n * N.B. these ids possibly un-ordered.\n *\n * TODO incorporate cartesian/gl2d axis finders in this paradigm.\n */\nplots.findSubplotIds = function findSubplotIds(data, type) {\n var subplotIds = [];\n\n if(!plots.subplotsRegistry[type]) return subplotIds;\n\n var attr = plots.subplotsRegistry[type].attr;\n\n for(var i = 0; i < data.length; i++) {\n var trace = data[i];\n\n if(plots.traceIs(trace, type) && subplotIds.indexOf(trace[attr]) === -1) {\n subplotIds.push(trace[attr]);\n }\n }\n\n return subplotIds;\n};\n\n/**\n * Get the ids of the current subplots.\n *\n * @param {object} layout plotly full layout object.\n * @param {string} type subplot type to look for.\n *\n * @return {array} list of ordered subplot ids (strings).\n *\n */\nplots.getSubplotIds = function getSubplotIds(layout, type) {\n var _module = plots.subplotsRegistry[type];\n\n if(!_module) return [];\n\n // layout must be 'fullLayout' here\n if(type === 'cartesian' && (!layout._has || !layout._has('cartesian'))) return [];\n if(type === 'gl2d' && (!layout._has || !layout._has('gl2d'))) return [];\n if(type === 'cartesian' || type === 'gl2d') {\n return Object.keys(layout._plots || {});\n }\n\n var attrRegex = _module.attrRegex,\n layoutKeys = Object.keys(layout),\n subplotIds = [];\n\n for(var i = 0; i < layoutKeys.length; i++) {\n var layoutKey = layoutKeys[i];\n\n if(attrRegex.test(layoutKey)) subplotIds.push(layoutKey);\n }\n\n // order the ids\n var idLen = _module.idRoot.length;\n subplotIds.sort(function(a, b) {\n var aNum = +(a.substr(idLen) || 1),\n bNum = +(b.substr(idLen) || 1);\n return aNum - bNum;\n });\n\n return subplotIds;\n};\n\n/**\n * Get the data trace(s) associated with a given subplot.\n *\n * @param {array} data plotly full data array.\n * @param {string} type subplot type to look for.\n * @param {string} subplotId subplot id to look for.\n *\n * @return {array} list of trace objects.\n *\n */\nplots.getSubplotData = function getSubplotData(data, type, subplotId) {\n if(!plots.subplotsRegistry[type]) return [];\n\n var attr = plots.subplotsRegistry[type].attr,\n subplotData = [],\n trace;\n\n for(var i = 0; i < data.length; i++) {\n trace = data[i];\n\n if(type === 'gl2d' && plots.traceIs(trace, 'gl2d')) {\n var spmatch = Plotly.Axes.subplotMatch,\n subplotX = 'x' + subplotId.match(spmatch)[1],\n subplotY = 'y' + subplotId.match(spmatch)[2];\n\n if(trace[attr[0]] === subplotX && trace[attr[1]] === subplotY) {\n subplotData.push(trace);\n }\n }\n else {\n if(trace[attr] === subplotId) subplotData.push(trace);\n }\n }\n\n return subplotData;\n};\n\n/**\n * Get calcdata traces(s) associated with a given subplot\n *\n * @param {array} calcData (as in gd.calcdata)\n * @param {string} type subplot type\n * @param {string} subplotId subplot id to look for\n *\n * @return {array} array of calcdata traces\n */\nplots.getSubplotCalcData = function(calcData, type, subplotId) {\n if(!plots.subplotsRegistry[type]) return [];\n\n var attr = plots.subplotsRegistry[type].attr;\n var subplotCalcData = [];\n\n for(var i = 0; i < calcData.length; i++) {\n var calcTrace = calcData[i],\n trace = calcTrace[0].trace;\n\n if(trace[attr] === subplotId) subplotCalcData.push(calcTrace);\n }\n\n return subplotCalcData;\n};\n\n// in some cases the browser doesn't seem to know how big\n// the text is at first, so it needs to draw it,\n// then wait a little, then draw it again\nplots.redrawText = function(gd) {\n\n // do not work if polar is present\n if((gd.data && gd.data[0] && gd.data[0].r)) return;\n\n return new Promise(function(resolve) {\n setTimeout(function() {\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n\n (gd.calcdata || []).forEach(function(d) {\n if(d[0] && d[0].t && d[0].t.cb) d[0].t.cb();\n });\n\n resolve(plots.previousPromises(gd));\n }, 300);\n });\n};\n\n// resize plot about the container size\nplots.resize = function(gd) {\n return new Promise(function(resolve, reject) {\n\n function isHidden(gd) {\n var display = window.getComputedStyle(gd).display;\n return !display || display === 'none';\n }\n\n if(!gd || isHidden(gd)) {\n reject(new Error('Resize must be passed a displayed plot div element.'));\n }\n\n if(gd._redrawTimer) clearTimeout(gd._redrawTimer);\n\n gd._redrawTimer = setTimeout(function() {\n // return if there is nothing to resize\n if(gd.layout.width && gd.layout.height) {\n resolve(gd);\n return;\n }\n\n delete gd.layout.width;\n delete gd.layout.height;\n\n // autosizing doesn't count as a change that needs saving\n var oldchanged = gd.changed;\n\n // nor should it be included in the undo queue\n gd.autoplay = true;\n\n Plotly.relayout(gd, { autosize: true }).then(function() {\n gd.changed = oldchanged;\n resolve(gd);\n });\n }, 100);\n });\n};\n\n\n// for use in Lib.syncOrAsync, check if there are any\n// pending promises in this plot and wait for them\nplots.previousPromises = function(gd) {\n if((gd._promises || []).length) {\n return Promise.all(gd._promises)\n .then(function() { gd._promises = []; });\n }\n};\n\n/**\n * Adds the 'Edit chart' link.\n * Note that now Plotly.plot() calls this so it can regenerate whenever it replots\n *\n * Add source links to your graph inside the 'showSources' config argument.\n */\nplots.addLinks = function(gd) {\n // Do not do anything if showLink and showSources are not set to true in config\n if(!gd._context.showLink && !gd._context.showSources) return;\n\n var fullLayout = gd._fullLayout;\n\n var linkContainer = fullLayout._paper\n .selectAll('text.js-plot-link-container').data([0]);\n\n linkContainer.enter().append('text')\n .classed('js-plot-link-container', true)\n .style({\n 'font-family': '\"Open Sans\", Arial, sans-serif',\n 'font-size': '12px',\n 'fill': Color.defaultLine,\n 'pointer-events': 'all'\n })\n .each(function() {\n var links = d3.select(this);\n links.append('tspan').classed('js-link-to-tool', true);\n links.append('tspan').classed('js-link-spacer', true);\n links.append('tspan').classed('js-sourcelinks', true);\n });\n\n // The text node inside svg\n var text = linkContainer.node(),\n attrs = {\n y: fullLayout._paper.attr('height') - 9\n };\n\n // If text's width is bigger than the layout\n // Check that text is a child node or document.body\n // because otherwise IE/Edge might throw an exception\n // when calling getComputedTextLength().\n // Apparently offsetParent is null for invisibles.\n if(document.body.contains(text) && text.getComputedTextLength() >= (fullLayout.width - 20)) {\n // Align the text at the left\n attrs['text-anchor'] = 'start';\n attrs.x = 5;\n }\n else {\n // Align the text at the right\n attrs['text-anchor'] = 'end';\n attrs.x = fullLayout._paper.attr('width') - 7;\n }\n\n linkContainer.attr(attrs);\n\n var toolspan = linkContainer.select('.js-link-to-tool'),\n spacespan = linkContainer.select('.js-link-spacer'),\n sourcespan = linkContainer.select('.js-sourcelinks');\n\n if(gd._context.showSources) gd._context.showSources(gd);\n\n // 'view in plotly' link for embedded plots\n if(gd._context.showLink) positionPlayWithData(gd, toolspan);\n\n // separator if we have both sources and tool link\n spacespan.text((toolspan.text() && sourcespan.text()) ? ' - ' : '');\n};\n\n// note that now this function is only adding the brand in\n// iframes and 3rd-party apps\nfunction positionPlayWithData(gd, container) {\n container.text('');\n var link = container.append('a')\n .attr({\n 'xlink:xlink:href': '#',\n 'class': 'link--impt link--embedview',\n 'font-weight': 'bold'\n })\n .text(gd._context.linkText + ' ' + String.fromCharCode(187));\n\n if(gd._context.sendData) {\n link.on('click', function() {\n plots.sendDataToCloud(gd);\n });\n }\n else {\n var path = window.location.pathname.split('/');\n var query = window.location.search;\n link.attr({\n 'xlink:xlink:show': 'new',\n 'xlink:xlink:href': '/' + path[2].split('.')[0] + '/' + path[1] + query\n });\n }\n}\n\nplots.sendDataToCloud = function(gd) {\n gd.emit('plotly_beforeexport');\n\n var baseUrl = (window.PLOTLYENV && window.PLOTLYENV.BASE_URL) || 'https://plot.ly';\n\n var hiddenformDiv = d3.select(gd)\n .append('div')\n .attr('id', 'hiddenform')\n .style('display', 'none');\n\n var hiddenform = hiddenformDiv\n .append('form')\n .attr({\n action: baseUrl + '/external',\n method: 'post',\n target: '_blank'\n });\n\n var hiddenformInput = hiddenform\n .append('input')\n .attr({\n type: 'text',\n name: 'data'\n });\n\n hiddenformInput.node().value = plots.graphJson(gd, false, 'keepdata');\n hiddenform.node().submit();\n hiddenformDiv.remove();\n\n gd.emit('plotly_afterexport');\n return false;\n};\n\n// Fill in default values:\n//\n// gd.data, gd.layout:\n// are precisely what the user specified,\n// these fields shouldn't be modified nor used directly\n// after the supply defaults step.\n//\n// gd._fullData, gd._fullLayout:\n// are complete descriptions of how to draw the plot,\n// use these fields in all required computations.\n//\n// gd._fullLayout._modules\n// is a list of all the trace modules required to draw the plot.\n//\n// gd._fullLayout._basePlotModules\n// is a list of all the plot modules required to draw the plot.\n//\n// gd._fullLayout._transformModules\n// is a list of all the transform modules invoked.\n//\nplots.supplyDefaults = function(gd) {\n var oldFullLayout = gd._fullLayout || {},\n newFullLayout = gd._fullLayout = {},\n newLayout = gd.layout || {};\n\n var oldFullData = gd._fullData || [],\n newFullData = gd._fullData = [],\n newData = gd.data || [];\n\n var i;\n\n // Create all the storage space for frames, but only if doesn't already exist\n if(!gd._transitionData) plots.createTransitionData(gd);\n\n // first fill in what we can of layout without looking at data\n // because fullData needs a few things from layout\n\n if(oldFullLayout._initialAutoSizeIsDone) {\n\n // coerce the updated layout while preserving width and height\n var oldWidth = oldFullLayout.width,\n oldHeight = oldFullLayout.height;\n\n plots.supplyLayoutGlobalDefaults(newLayout, newFullLayout);\n\n if(!newLayout.width) newFullLayout.width = oldWidth;\n if(!newLayout.height) newFullLayout.height = oldHeight;\n }\n else {\n\n // coerce the updated layout and autosize if needed\n plots.supplyLayoutGlobalDefaults(newLayout, newFullLayout);\n\n var missingWidthOrHeight = (!newLayout.width || !newLayout.height),\n autosize = newFullLayout.autosize,\n autosizable = gd._context && gd._context.autosizable,\n initialAutoSize = missingWidthOrHeight && (autosize || autosizable);\n\n if(initialAutoSize) plots.plotAutoSize(gd, newLayout, newFullLayout);\n else if(missingWidthOrHeight) plots.sanitizeMargins(gd);\n\n // for backwards-compatibility with Plotly v1.x.x\n if(!autosize && missingWidthOrHeight) {\n newLayout.width = newFullLayout.width;\n newLayout.height = newFullLayout.height;\n }\n }\n\n newFullLayout._initialAutoSizeIsDone = true;\n\n // keep track of how many traces are inputted\n newFullLayout._dataLength = newData.length;\n\n // then do the data\n newFullLayout._globalTransforms = (gd._context || {}).globalTransforms;\n plots.supplyDataDefaults(newData, newFullData, newLayout, newFullLayout);\n\n // attach helper method to check whether a plot type is present on graph\n newFullLayout._has = plots._hasPlotType.bind(newFullLayout);\n\n // special cases that introduce interactions between traces\n var _modules = newFullLayout._modules;\n for(i = 0; i < _modules.length; i++) {\n var _module = _modules[i];\n if(_module.cleanData) _module.cleanData(newFullData);\n }\n\n if(oldFullData.length === newData.length) {\n for(i = 0; i < newFullData.length; i++) {\n relinkPrivateKeys(newFullData[i], oldFullData[i]);\n }\n }\n\n // finally, fill in the pieces of layout that may need to look at data\n plots.supplyLayoutModuleDefaults(newLayout, newFullLayout, newFullData, gd._transitionData);\n\n // TODO remove in v2.0.0\n // add has-plot-type refs to fullLayout for backward compatibility\n newFullLayout._hasCartesian = newFullLayout._has('cartesian');\n newFullLayout._hasGeo = newFullLayout._has('geo');\n newFullLayout._hasGL3D = newFullLayout._has('gl3d');\n newFullLayout._hasGL2D = newFullLayout._has('gl2d');\n newFullLayout._hasTernary = newFullLayout._has('ternary');\n newFullLayout._hasPie = newFullLayout._has('pie');\n\n // clean subplots and other artifacts from previous plot calls\n plots.cleanPlot(newFullData, newFullLayout, oldFullData, oldFullLayout);\n\n // relink / initialize subplot axis objects\n plots.linkSubplots(newFullData, newFullLayout, oldFullData, oldFullLayout);\n\n // relink functions and _ attributes to promote consistency between plots\n relinkPrivateKeys(newFullLayout, oldFullLayout);\n\n // TODO may return a promise\n plots.doAutoMargin(gd);\n\n // set scale after auto margin routine\n var axList = Plotly.Axes.list(gd);\n for(i = 0; i < axList.length; i++) {\n var ax = axList[i];\n ax.setScale();\n }\n\n // update object references in calcdata\n if((gd.calcdata || []).length === newFullData.length) {\n for(i = 0; i < newFullData.length; i++) {\n var newTrace = newFullData[i];\n var cd0 = gd.calcdata[i][0];\n if(cd0 && cd0.trace) {\n if(cd0.trace._hasCalcTransform) {\n remapTransformedArrays(cd0, newTrace);\n } else {\n cd0.trace = newTrace;\n }\n }\n }\n }\n};\n\nfunction remapTransformedArrays(cd0, newTrace) {\n var oldTrace = cd0.trace;\n var arrayAttrs = oldTrace._arrayAttrs;\n var transformedArrayHash = {};\n var i, astr;\n\n for(i = 0; i < arrayAttrs.length; i++) {\n astr = arrayAttrs[i];\n transformedArrayHash[astr] = Lib.nestedProperty(oldTrace, astr).get().slice();\n }\n\n cd0.trace = newTrace;\n\n for(i = 0; i < arrayAttrs.length; i++) {\n astr = arrayAttrs[i];\n Lib.nestedProperty(cd0.trace, astr).set(transformedArrayHash[astr]);\n }\n}\n\n// Create storage for all of the data related to frames and transitions:\nplots.createTransitionData = function(gd) {\n // Set up the default keyframe if it doesn't exist:\n if(!gd._transitionData) {\n gd._transitionData = {};\n }\n\n if(!gd._transitionData._frames) {\n gd._transitionData._frames = [];\n }\n\n if(!gd._transitionData._frameHash) {\n gd._transitionData._frameHash = {};\n }\n\n if(!gd._transitionData._counter) {\n gd._transitionData._counter = 0;\n }\n\n if(!gd._transitionData._interruptCallbacks) {\n gd._transitionData._interruptCallbacks = [];\n }\n};\n\n// helper function to be bound to fullLayout to check\n// whether a certain plot type is present on plot\nplots._hasPlotType = function(category) {\n var basePlotModules = this._basePlotModules || [];\n\n for(var i = 0; i < basePlotModules.length; i++) {\n var _module = basePlotModules[i];\n\n if(_module.name === category) return true;\n }\n\n return false;\n};\n\nplots.cleanPlot = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var i, j;\n\n var basePlotModules = oldFullLayout._basePlotModules || [];\n for(i = 0; i < basePlotModules.length; i++) {\n var _module = basePlotModules[i];\n\n if(_module.clean) {\n _module.clean(newFullData, newFullLayout, oldFullData, oldFullLayout);\n }\n }\n\n var hasPaper = !!oldFullLayout._paper;\n var hasInfoLayer = !!oldFullLayout._infolayer;\n\n oldLoop:\n for(i = 0; i < oldFullData.length; i++) {\n var oldTrace = oldFullData[i],\n oldUid = oldTrace.uid;\n\n for(j = 0; j < newFullData.length; j++) {\n var newTrace = newFullData[j];\n\n if(oldUid === newTrace.uid) continue oldLoop;\n }\n\n var query = (\n '.hm' + oldUid +\n ',.contour' + oldUid +\n ',.carpet' + oldUid +\n ',#clip' + oldUid +\n ',.trace' + oldUid\n );\n\n // clean old heatmap, contour traces and clip paths\n // that rely on uid identifiers\n if(hasPaper) {\n oldFullLayout._paper.selectAll(query).remove();\n }\n\n // clean old colorbars and range slider plot\n if(hasInfoLayer) {\n oldFullLayout._infolayer.selectAll('.cb' + oldUid).remove();\n\n oldFullLayout._infolayer.selectAll('g.rangeslider-container')\n .selectAll(query).remove();\n }\n }\n\n if(oldFullLayout._zoomlayer) {\n oldFullLayout._zoomlayer.selectAll('.select-outline').remove();\n }\n};\n\nplots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldSubplots = oldFullLayout._plots || {},\n newSubplots = newFullLayout._plots = {};\n\n var mockGd = {\n _fullData: newFullData,\n _fullLayout: newFullLayout\n };\n\n var ids = Plotly.Axes.getSubplots(mockGd);\n\n var i;\n\n for(i = 0; i < ids.length; i++) {\n var id = ids[i];\n var oldSubplot = oldSubplots[id];\n var xaxis = Plotly.Axes.getFromId(mockGd, id, 'x');\n var yaxis = Plotly.Axes.getFromId(mockGd, id, 'y');\n var plotinfo;\n\n if(oldSubplot) {\n plotinfo = newSubplots[id] = oldSubplot;\n\n if(plotinfo._scene2d) {\n plotinfo._scene2d.updateRefs(newFullLayout);\n }\n\n if(plotinfo.xaxis.layer !== xaxis.layer) {\n plotinfo.xlines.attr('d', null);\n plotinfo.xaxislayer.selectAll('*').remove();\n }\n\n if(plotinfo.yaxis.layer !== yaxis.layer) {\n plotinfo.ylines.attr('d', null);\n plotinfo.yaxislayer.selectAll('*').remove();\n }\n } else {\n plotinfo = newSubplots[id] = {};\n plotinfo.id = id;\n }\n\n plotinfo.xaxis = xaxis;\n plotinfo.yaxis = yaxis;\n\n // By default, we clip at the subplot level,\n // but if one trace on a given subplot has *cliponaxis* set to false,\n // we need to clip at the trace module layer level;\n // find this out here, once of for all.\n plotinfo._hasClipOnAxisFalse = false;\n\n for(var j = 0; j < newFullData.length; j++) {\n var trace = newFullData[j];\n\n if(\n trace.xaxis === plotinfo.xaxis._id &&\n trace.yaxis === plotinfo.yaxis._id &&\n trace.cliponaxis === false\n ) {\n plotinfo._hasClipOnAxisFalse = true;\n break;\n }\n }\n }\n\n // while we're at it, link overlaying axes to their main axes and\n // anchored axes to the axes they're anchored to\n var axList = Plotly.Axes.list(mockGd, null, true);\n for(i = 0; i < axList.length; i++) {\n var ax = axList[i];\n var mainAx = null;\n\n if(ax.overlaying) {\n mainAx = Plotly.Axes.getFromId(mockGd, ax.overlaying);\n\n // you cannot overlay an axis that's already overlaying another\n if(mainAx && mainAx.overlaying) {\n ax.overlaying = false;\n mainAx = null;\n }\n }\n ax._mainAxis = mainAx || ax;\n\n /*\n * For now force overlays to overlay completely... so they\n * can drag together correctly and share backgrounds.\n * Later perhaps we make separate axis domain and\n * tick/line domain or something, so they can still share\n * the (possibly larger) dragger and background but don't\n * have to both be drawn over that whole domain\n */\n if(mainAx) ax.domain = mainAx.domain.slice();\n\n ax._anchorAxis = ax.anchor === 'free' ?\n null :\n Plotly.Axes.getFromId(mockGd, ax.anchor);\n }\n};\n\n// This function clears any trace attributes with valType: color and\n// no set dflt filed in the plot schema. This is needed because groupby (which\n// is the only transform for which this currently applies) supplies parent\n// trace defaults, then expanded trace defaults. The result is that `null`\n// colors are default-supplied and inherited as a color instead of a null.\n// The result is that expanded trace default colors have no effect, with\n// the final result that groups are indistinguishable. This function clears\n// those colors so that individual groupby groups get unique colors.\nplots.clearExpandedTraceDefaultColors = function(trace) {\n var colorAttrs, path, i;\n\n // This uses weird closure state in order to satisfy the linter rule\n // that we can't create functions in a loop.\n function locateColorAttrs(attr, attrName, attrs, level) {\n path[level] = attrName;\n path.length = level + 1;\n if(attr.valType === 'color' && attr.dflt === undefined) {\n colorAttrs.push(path.join('.'));\n }\n }\n\n path = [];\n\n // Get the cached colorAttrs:\n colorAttrs = trace._module._colorAttrs;\n\n // Or else compute and cache the colorAttrs on the module:\n if(!colorAttrs) {\n trace._module._colorAttrs = colorAttrs = [];\n PlotSchema.crawl(\n trace._module.attributes,\n locateColorAttrs\n );\n }\n\n for(i = 0; i < colorAttrs.length; i++) {\n var origprop = Lib.nestedProperty(trace, '_input.' + colorAttrs[i]);\n\n if(!origprop.get()) {\n Lib.nestedProperty(trace, colorAttrs[i]).set(null);\n }\n }\n};\n\n\nplots.supplyDataDefaults = function(dataIn, dataOut, layout, fullLayout) {\n var i, fullTrace, trace;\n var modules = fullLayout._modules = [],\n basePlotModules = fullLayout._basePlotModules = [],\n cnt = 0;\n\n fullLayout._transformModules = [];\n\n function pushModule(fullTrace) {\n dataOut.push(fullTrace);\n\n var _module = fullTrace._module;\n if(!_module) return;\n\n Lib.pushUnique(modules, _module);\n Lib.pushUnique(basePlotModules, fullTrace._module.basePlotModule);\n\n cnt++;\n }\n\n var carpetIndex = {};\n var carpetDependents = [];\n\n for(i = 0; i < dataIn.length; i++) {\n trace = dataIn[i];\n fullTrace = plots.supplyTraceDefaults(trace, cnt, fullLayout, i);\n\n fullTrace.index = i;\n fullTrace._input = trace;\n fullTrace._expandedIndex = cnt;\n\n if(fullTrace.transforms && fullTrace.transforms.length) {\n var expandedTraces = applyTransforms(fullTrace, dataOut, layout, fullLayout);\n\n for(var j = 0; j < expandedTraces.length; j++) {\n var expandedTrace = expandedTraces[j];\n var fullExpandedTrace = plots.supplyTraceDefaults(expandedTrace, cnt, fullLayout, i);\n\n // relink private (i.e. underscore) keys expanded trace to full expanded trace so\n // that transform supply-default methods can set _ keys for future use.\n relinkPrivateKeys(fullExpandedTrace, expandedTrace);\n\n // mutate uid here using parent uid and expanded index\n // to promote consistency between update calls\n expandedTrace.uid = fullExpandedTrace.uid = fullTrace.uid + j;\n\n // add info about parent data trace\n fullExpandedTrace.index = i;\n fullExpandedTrace._input = trace;\n fullExpandedTrace._fullInput = fullTrace;\n\n // add info about the expanded data\n fullExpandedTrace._expandedIndex = cnt;\n fullExpandedTrace._expandedInput = expandedTrace;\n\n pushModule(fullExpandedTrace);\n }\n }\n else {\n\n // add identify refs for consistency with transformed traces\n fullTrace._fullInput = fullTrace;\n fullTrace._expandedInput = fullTrace;\n\n pushModule(fullTrace);\n }\n\n if(Registry.traceIs(fullTrace, 'carpetAxis')) {\n carpetIndex[fullTrace.carpet] = fullTrace;\n }\n\n if(Registry.traceIs(fullTrace, 'carpetDependent')) {\n carpetDependents.push(i);\n }\n }\n\n for(i = 0; i < carpetDependents.length; i++) {\n fullTrace = dataOut[carpetDependents[i]];\n\n if(!fullTrace.visible) continue;\n\n var carpetAxis = carpetIndex[fullTrace.carpet];\n fullTrace._carpet = carpetAxis;\n\n if(!carpetAxis || !carpetAxis.visible) {\n fullTrace.visible = false;\n continue;\n }\n\n fullTrace.xaxis = carpetAxis.xaxis;\n fullTrace.yaxis = carpetAxis.yaxis;\n }\n};\n\nplots.supplyAnimationDefaults = function(opts) {\n opts = opts || {};\n var i;\n var optsOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(opts || {}, optsOut, animationAttrs, attr, dflt);\n }\n\n coerce('mode');\n coerce('direction');\n coerce('fromcurrent');\n\n if(Array.isArray(opts.frame)) {\n optsOut.frame = [];\n for(i = 0; i < opts.frame.length; i++) {\n optsOut.frame[i] = plots.supplyAnimationFrameDefaults(opts.frame[i] || {});\n }\n } else {\n optsOut.frame = plots.supplyAnimationFrameDefaults(opts.frame || {});\n }\n\n if(Array.isArray(opts.transition)) {\n optsOut.transition = [];\n for(i = 0; i < opts.transition.length; i++) {\n optsOut.transition[i] = plots.supplyAnimationTransitionDefaults(opts.transition[i] || {});\n }\n } else {\n optsOut.transition = plots.supplyAnimationTransitionDefaults(opts.transition || {});\n }\n\n return optsOut;\n};\n\nplots.supplyAnimationFrameDefaults = function(opts) {\n var optsOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(opts || {}, optsOut, animationAttrs.frame, attr, dflt);\n }\n\n coerce('duration');\n coerce('redraw');\n\n return optsOut;\n};\n\nplots.supplyAnimationTransitionDefaults = function(opts) {\n var optsOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(opts || {}, optsOut, animationAttrs.transition, attr, dflt);\n }\n\n coerce('duration');\n coerce('easing');\n\n return optsOut;\n};\n\nplots.supplyFrameDefaults = function(frameIn) {\n var frameOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(frameIn, frameOut, frameAttrs, attr, dflt);\n }\n\n coerce('group');\n coerce('name');\n coerce('traces');\n coerce('baseframe');\n coerce('data');\n coerce('layout');\n\n return frameOut;\n};\n\nplots.supplyTraceDefaults = function(traceIn, traceOutIndex, layout, traceInIndex) {\n var traceOut = {},\n defaultColor = Color.defaults[traceOutIndex % Color.defaults.length];\n\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, plots.attributes, attr, dflt);\n }\n\n function coerceSubplotAttr(subplotType, subplotAttr) {\n if(!plots.traceIs(traceOut, subplotType)) return;\n\n return Lib.coerce(traceIn, traceOut,\n plots.subplotsRegistry[subplotType].attributes, subplotAttr);\n }\n\n var visible = coerce('visible');\n\n coerce('type');\n coerce('uid');\n coerce('name', 'trace ' + traceInIndex);\n\n // coerce subplot attributes of all registered subplot types\n var subplotTypes = Object.keys(subplotsRegistry);\n for(var i = 0; i < subplotTypes.length; i++) {\n var subplotType = subplotTypes[i];\n\n // done below (only when visible is true)\n // TODO unified this pattern\n if(['cartesian', 'gl2d'].indexOf(subplotType) !== -1) continue;\n\n var attr = subplotsRegistry[subplotType].attr;\n\n if(attr) coerceSubplotAttr(subplotType, attr);\n }\n\n if(visible) {\n coerce('customdata');\n coerce('ids');\n\n var _module = plots.getModule(traceOut);\n traceOut._module = _module;\n\n if(plots.traceIs(traceOut, 'showLegend')) {\n coerce('showlegend');\n coerce('legendgroup');\n }\n\n Registry.getComponentMethod(\n 'fx',\n 'supplyDefaults'\n )(traceIn, traceOut, defaultColor, layout);\n\n // TODO add per-base-plot-module trace defaults step\n\n if(_module) {\n _module.supplyDefaults(traceIn, traceOut, defaultColor, layout);\n Lib.coerceHoverinfo(traceIn, traceOut, layout);\n }\n\n if(!plots.traceIs(traceOut, 'noOpacity')) coerce('opacity');\n\n coerceSubplotAttr('cartesian', 'xaxis');\n coerceSubplotAttr('cartesian', 'yaxis');\n\n coerceSubplotAttr('gl2d', 'xaxis');\n coerceSubplotAttr('gl2d', 'yaxis');\n\n if(plots.traceIs(traceOut, 'notLegendIsolatable')) {\n // This clears out the legendonly state for traces like carpet that\n // cannot be isolated in the legend\n traceOut.visible = !!traceOut.visible;\n }\n\n plots.supplyTransformDefaults(traceIn, traceOut, layout);\n }\n\n return traceOut;\n};\n\nplots.supplyTransformDefaults = function(traceIn, traceOut, layout) {\n var globalTransforms = layout._globalTransforms || [];\n var transformModules = layout._transformModules || [];\n\n if(!Array.isArray(traceIn.transforms) && globalTransforms.length === 0) return;\n\n var containerIn = traceIn.transforms || [],\n transformList = globalTransforms.concat(containerIn),\n containerOut = traceOut.transforms = [];\n\n for(var i = 0; i < transformList.length; i++) {\n var transformIn = transformList[i],\n type = transformIn.type,\n _module = transformsRegistry[type],\n transformOut;\n\n /*\n * Supply defaults may run twice. First pass runs all supply defaults steps\n * and adds the _module to any output transforms.\n * If transforms exist another pass is run so that any generated traces also\n * go through supply defaults. This has the effect of rerunning\n * supplyTransformDefaults. If the transform does not have a `transform`\n * function it could not have generated any new traces and the second stage\n * is unnecessary. We detect this case with the following variables.\n */\n var isFirstStage = !(transformIn._module && transformIn._module === _module),\n doLaterStages = _module && typeof _module.transform === 'function';\n\n if(!_module) Lib.warn('Unrecognized transform type ' + type + '.');\n\n if(_module && _module.supplyDefaults && (isFirstStage || doLaterStages)) {\n transformOut = _module.supplyDefaults(transformIn, traceOut, layout, traceIn);\n transformOut.type = type;\n transformOut._module = _module;\n\n Lib.pushUnique(transformModules, _module);\n }\n else {\n transformOut = Lib.extendFlat({}, transformIn);\n }\n\n containerOut.push(transformOut);\n }\n};\n\nfunction applyTransforms(fullTrace, fullData, layout, fullLayout) {\n var container = fullTrace.transforms,\n dataOut = [fullTrace];\n\n for(var i = 0; i < container.length; i++) {\n var transform = container[i],\n _module = transformsRegistry[transform.type];\n\n if(_module && _module.transform) {\n dataOut = _module.transform(dataOut, {\n transform: transform,\n fullTrace: fullTrace,\n fullData: fullData,\n layout: layout,\n fullLayout: fullLayout,\n transformIndex: i\n });\n }\n }\n\n return dataOut;\n}\n\nplots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, plots.layoutAttributes, attr, dflt);\n }\n\n var globalFont = Lib.coerceFont(coerce, 'font');\n\n coerce('title');\n\n Lib.coerceFont(coerce, 'titlefont', {\n family: globalFont.family,\n size: Math.round(globalFont.size * 1.4),\n color: globalFont.color\n });\n\n // Make sure that autosize is defaulted to *true*\n // on layouts with no set width and height for backward compatibly,\n // in particular https://plot.ly/javascript/responsive-fluid-layout/\n //\n // Before https://github.com/plotly/plotly.js/pull/635 ,\n // layouts with no set width and height were set temporary set to 'initial'\n // to pass through the autosize routine\n //\n // This behavior is subject to change in v2.\n coerce('autosize', !(layoutIn.width && layoutIn.height));\n\n coerce('width');\n coerce('height');\n coerce('margin.l');\n coerce('margin.r');\n coerce('margin.t');\n coerce('margin.b');\n coerce('margin.pad');\n coerce('margin.autoexpand');\n\n if(layoutIn.width && layoutIn.height) plots.sanitizeMargins(layoutOut);\n\n coerce('paper_bgcolor');\n\n coerce('separators');\n coerce('hidesources');\n coerce('smith');\n\n Registry.getComponentMethod(\n 'calendars',\n 'handleDefaults'\n )(layoutIn, layoutOut, 'calendar');\n\n Registry.getComponentMethod(\n 'fx',\n 'supplyLayoutGlobalDefaults'\n )(layoutIn, layoutOut, coerce);\n};\n\nplots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) {\n var context = gd._context || {},\n frameMargins = context.frameMargins,\n newWidth,\n newHeight;\n\n var isPlotDiv = Lib.isPlotDiv(gd);\n\n if(isPlotDiv) gd.emit('plotly_autosize');\n\n // embedded in an iframe - just take the full iframe size\n // if we get to this point, with no aspect ratio restrictions\n if(context.fillFrame) {\n newWidth = window.innerWidth;\n newHeight = window.innerHeight;\n\n // somehow we get a few extra px height sometimes...\n // just hide it\n document.body.style.overflow = 'hidden';\n }\n else if(isNumeric(frameMargins) && frameMargins > 0) {\n var reservedMargins = calculateReservedMargins(gd._boundingBoxMargins),\n reservedWidth = reservedMargins.left + reservedMargins.right,\n reservedHeight = reservedMargins.bottom + reservedMargins.top,\n factor = 1 - 2 * frameMargins;\n\n var gdBB = fullLayout._container && fullLayout._container.node ?\n fullLayout._container.node().getBoundingClientRect() : {\n width: fullLayout.width,\n height: fullLayout.height\n };\n\n newWidth = Math.round(factor * (gdBB.width - reservedWidth));\n newHeight = Math.round(factor * (gdBB.height - reservedHeight));\n }\n else {\n // plotly.js - let the developers do what they want, either\n // provide height and width for the container div,\n // specify size in layout, or take the defaults,\n // but don't enforce any ratio restrictions\n var computedStyle = isPlotDiv ? window.getComputedStyle(gd) : {};\n\n newWidth = parseFloat(computedStyle.width) || fullLayout.width;\n newHeight = parseFloat(computedStyle.height) || fullLayout.height;\n }\n\n var minWidth = plots.layoutAttributes.width.min,\n minHeight = plots.layoutAttributes.height.min;\n if(newWidth < minWidth) newWidth = minWidth;\n if(newHeight < minHeight) newHeight = minHeight;\n\n var widthHasChanged = !layout.width &&\n (Math.abs(fullLayout.width - newWidth) > 1),\n heightHasChanged = !layout.height &&\n (Math.abs(fullLayout.height - newHeight) > 1);\n\n if(heightHasChanged || widthHasChanged) {\n if(widthHasChanged) fullLayout.width = newWidth;\n if(heightHasChanged) fullLayout.height = newHeight;\n }\n\n // cache initial autosize value, used in relayout when\n // width or height values are set to null\n if(!gd._initialAutoSize) {\n gd._initialAutoSize = { width: newWidth, height: newHeight };\n }\n\n plots.sanitizeMargins(fullLayout);\n};\n\n/**\n * Reduce all reserved margin objects to a single required margin reservation.\n *\n * @param {Object} margins\n * @returns {{left: number, right: number, bottom: number, top: number}}\n */\nfunction calculateReservedMargins(margins) {\n var resultingMargin = {left: 0, right: 0, bottom: 0, top: 0},\n marginName;\n\n if(margins) {\n for(marginName in margins) {\n if(margins.hasOwnProperty(marginName)) {\n resultingMargin.left += margins[marginName].left || 0;\n resultingMargin.right += margins[marginName].right || 0;\n resultingMargin.bottom += margins[marginName].bottom || 0;\n resultingMargin.top += margins[marginName].top || 0;\n }\n }\n }\n return resultingMargin;\n}\n\nplots.supplyLayoutModuleDefaults = function(layoutIn, layoutOut, fullData, transitionData) {\n var i, _module;\n\n // can't be be part of basePlotModules loop\n // in order to handle the orphan axes case\n Plotly.Axes.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n\n // base plot module layout defaults\n var basePlotModules = layoutOut._basePlotModules;\n for(i = 0; i < basePlotModules.length; i++) {\n _module = basePlotModules[i];\n\n // done above already\n if(_module.name === 'cartesian') continue;\n\n // e.g. gl2d does not have a layout-defaults step\n if(_module.supplyLayoutDefaults) {\n _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n }\n }\n\n // trace module layout defaults\n var modules = layoutOut._modules;\n for(i = 0; i < modules.length; i++) {\n _module = modules[i];\n\n if(_module.supplyLayoutDefaults) {\n _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n }\n }\n\n // transform module layout defaults\n var transformModules = layoutOut._transformModules;\n for(i = 0; i < transformModules.length; i++) {\n _module = transformModules[i];\n\n if(_module.supplyLayoutDefaults) {\n _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData, transitionData);\n }\n }\n\n var components = Object.keys(Registry.componentsRegistry);\n for(i = 0; i < components.length; i++) {\n _module = Registry.componentsRegistry[components[i]];\n\n if(_module.supplyLayoutDefaults) {\n _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n }\n }\n};\n\n// Remove all plotly attributes from a div so it can be replotted fresh\n// TODO: these really need to be encapsulated into a much smaller set...\nplots.purge = function(gd) {\n\n // note: we DO NOT remove _context because it doesn't change when we insert\n // a new plot, and may have been set outside of our scope.\n\n var fullLayout = gd._fullLayout || {};\n if(fullLayout._glcontainer !== undefined) fullLayout._glcontainer.remove();\n if(fullLayout._geocontainer !== undefined) fullLayout._geocontainer.remove();\n\n // remove modebar\n if(fullLayout._modeBar) fullLayout._modeBar.destroy();\n\n if(gd._transitionData) {\n // Ensure any dangling callbacks are simply dropped if the plot is purged.\n // This is more or less only actually important for testing.\n if(gd._transitionData._interruptCallbacks) {\n gd._transitionData._interruptCallbacks.length = 0;\n }\n\n if(gd._transitionData._animationRaf) {\n window.cancelAnimationFrame(gd._transitionData._animationRaf);\n }\n }\n\n // data and layout\n delete gd.data;\n delete gd.layout;\n delete gd._fullData;\n delete gd._fullLayout;\n delete gd.calcdata;\n delete gd.framework;\n delete gd.empty;\n\n delete gd.fid;\n\n delete gd.undoqueue; // action queue\n delete gd.undonum;\n delete gd.autoplay; // are we doing an action that doesn't go in undo queue?\n delete gd.changed;\n\n // these get recreated on Plotly.plot anyway, but just to be safe\n // (and to have a record of them...)\n delete gd._promises;\n delete gd._redrawTimer;\n delete gd.firstscatter;\n delete gd._hmlumcount;\n delete gd._hmpixcount;\n delete gd.numboxes;\n delete gd._transitionData;\n delete gd._transitioning;\n delete gd._initialAutoSize;\n delete gd._transitioningWithDuration;\n\n // created during certain events, that *should* clean them up\n // themselves, but may not if there was an error\n delete gd._dragging;\n delete gd._dragged;\n delete gd._hoverdata;\n delete gd._snapshotInProgress;\n delete gd._editing;\n delete gd._replotPending;\n delete gd._mouseDownTime;\n delete gd._legendMouseDownTime;\n\n // remove all event listeners\n if(gd.removeAllListeners) gd.removeAllListeners();\n};\n\nplots.style = function(gd) {\n var _modules = gd._fullLayout._modules;\n\n for(var i = 0; i < _modules.length; i++) {\n var _module = _modules[i];\n\n if(_module.style) _module.style(gd);\n }\n};\n\nplots.sanitizeMargins = function(fullLayout) {\n // polar doesn't do margins...\n if(!fullLayout || !fullLayout.margin) return;\n\n var width = fullLayout.width,\n height = fullLayout.height,\n margin = fullLayout.margin,\n plotWidth = width - (margin.l + margin.r),\n plotHeight = height - (margin.t + margin.b),\n correction;\n\n // if margin.l + margin.r = 0 then plotWidth > 0\n // as width >= 10 by supplyDefaults\n // similarly for margin.t + margin.b\n\n if(plotWidth < 0) {\n correction = (width - 1) / (margin.l + margin.r);\n margin.l = Math.floor(correction * margin.l);\n margin.r = Math.floor(correction * margin.r);\n }\n\n if(plotHeight < 0) {\n correction = (height - 1) / (margin.t + margin.b);\n margin.t = Math.floor(correction * margin.t);\n margin.b = Math.floor(correction * margin.b);\n }\n};\n\n// called by components to see if we need to\n// expand the margins to show them\n// o is {x,l,r,y,t,b} where x and y are plot fractions,\n// the rest are pixels in each direction\n// or leave o out to delete this entry (like if it's hidden)\nplots.autoMargin = function(gd, id, o) {\n var fullLayout = gd._fullLayout;\n\n if(!fullLayout._pushmargin) fullLayout._pushmargin = {};\n\n if(fullLayout.margin.autoexpand !== false) {\n if(!o) delete fullLayout._pushmargin[id];\n else {\n var pad = o.pad === undefined ? 12 : o.pad;\n\n // if the item is too big, just give it enough automargin to\n // make sure you can still grab it and bring it back\n if(o.l + o.r > fullLayout.width * 0.5) o.l = o.r = 0;\n if(o.b + o.t > fullLayout.height * 0.5) o.b = o.t = 0;\n\n fullLayout._pushmargin[id] = {\n l: {val: o.x, size: o.l + pad},\n r: {val: o.x, size: o.r + pad},\n b: {val: o.y, size: o.b + pad},\n t: {val: o.y, size: o.t + pad}\n };\n }\n\n if(!fullLayout._replotting) plots.doAutoMargin(gd);\n }\n};\n\nplots.doAutoMargin = function(gd) {\n var fullLayout = gd._fullLayout;\n if(!fullLayout._size) fullLayout._size = {};\n if(!fullLayout._pushmargin) fullLayout._pushmargin = {};\n\n var gs = fullLayout._size,\n oldmargins = JSON.stringify(gs);\n\n // adjust margins for outside components\n // fullLayout.margin is the requested margin,\n // fullLayout._size has margins and plotsize after adjustment\n var ml = Math.max(fullLayout.margin.l || 0, 0),\n mr = Math.max(fullLayout.margin.r || 0, 0),\n mt = Math.max(fullLayout.margin.t || 0, 0),\n mb = Math.max(fullLayout.margin.b || 0, 0),\n pm = fullLayout._pushmargin;\n\n if(fullLayout.margin.autoexpand !== false) {\n\n // fill in the requested margins\n pm.base = {\n l: {val: 0, size: ml},\n r: {val: 1, size: mr},\n t: {val: 1, size: mt},\n b: {val: 0, size: mb}\n };\n\n // now cycle through all the combinations of l and r\n // (and t and b) to find the required margins\n\n var pmKeys = Object.keys(pm);\n\n for(var i = 0; i < pmKeys.length; i++) {\n var k1 = pmKeys[i];\n\n var pushleft = pm[k1].l || {},\n pushbottom = pm[k1].b || {},\n fl = pushleft.val,\n pl = pushleft.size,\n fb = pushbottom.val,\n pb = pushbottom.size;\n\n for(var j = 0; j < pmKeys.length; j++) {\n var k2 = pmKeys[j];\n\n if(isNumeric(pl) && pm[k2].r) {\n var fr = pm[k2].r.val,\n pr = pm[k2].r.size;\n\n if(fr > fl) {\n var newl = (pl * fr +\n (pr - fullLayout.width) * fl) / (fr - fl),\n newr = (pr * (1 - fl) +\n (pl - fullLayout.width) * (1 - fr)) / (fr - fl);\n if(newl >= 0 && newr >= 0 && newl + newr > ml + mr) {\n ml = newl;\n mr = newr;\n }\n }\n }\n\n if(isNumeric(pb) && pm[k2].t) {\n var ft = pm[k2].t.val,\n pt = pm[k2].t.size;\n\n if(ft > fb) {\n var newb = (pb * ft +\n (pt - fullLayout.height) * fb) / (ft - fb),\n newt = (pt * (1 - fb) +\n (pb - fullLayout.height) * (1 - ft)) / (ft - fb);\n if(newb >= 0 && newt >= 0 && newb + newt > mb + mt) {\n mb = newb;\n mt = newt;\n }\n }\n }\n }\n }\n }\n\n gs.l = Math.round(ml);\n gs.r = Math.round(mr);\n gs.t = Math.round(mt);\n gs.b = Math.round(mb);\n gs.p = Math.round(fullLayout.margin.pad);\n gs.w = Math.round(fullLayout.width) - gs.l - gs.r;\n gs.h = Math.round(fullLayout.height) - gs.t - gs.b;\n\n // if things changed and we're not already redrawing, trigger a redraw\n if(!fullLayout._replotting && oldmargins !== '{}' &&\n oldmargins !== JSON.stringify(fullLayout._size)) {\n return Plotly.plot(gd);\n }\n};\n\n/**\n * JSONify the graph data and layout\n *\n * This function needs to recurse because some src can be inside\n * sub-objects.\n *\n * It also strips out functions and private (starts with _) elements.\n * Therefore, we can add temporary things to data and layout that don't\n * get saved.\n *\n * @param gd The graphDiv\n * @param {Boolean} dataonly If true, don't return layout.\n * @param {'keepref'|'keepdata'|'keepall'} [mode='keepref'] Filter what's kept\n * keepref: remove data for which there's a src present\n * eg if there's xsrc present (and xsrc is well-formed,\n * ie has : and some chars before it), strip out x\n * keepdata: remove all src tags, don't remove the data itself\n * keepall: keep data and src\n * @param {String} output If you specify 'object', the result will not be stringified\n * @param {Boolean} useDefaults If truthy, use _fullLayout and _fullData\n * @returns {Object|String}\n */\nplots.graphJson = function(gd, dataonly, mode, output, useDefaults) {\n // if the defaults aren't supplied yet, we need to do that...\n if((useDefaults && dataonly && !gd._fullData) ||\n (useDefaults && !dataonly && !gd._fullLayout)) {\n plots.supplyDefaults(gd);\n }\n\n var data = (useDefaults) ? gd._fullData : gd.data,\n layout = (useDefaults) ? gd._fullLayout : gd.layout,\n frames = (gd._transitionData || {})._frames;\n\n function stripObj(d) {\n if(typeof d === 'function') {\n return null;\n }\n if(Lib.isPlainObject(d)) {\n var o = {}, v, src;\n for(v in d) {\n // remove private elements and functions\n // _ is for private, [ is a mistake ie [object Object]\n if(typeof d[v] === 'function' ||\n ['_', '['].indexOf(v.charAt(0)) !== -1) {\n continue;\n }\n\n // look for src/data matches and remove the appropriate one\n if(mode === 'keepdata') {\n // keepdata: remove all ...src tags\n if(v.substr(v.length - 3) === 'src') {\n continue;\n }\n }\n else if(mode === 'keepstream') {\n // keep sourced data if it's being streamed.\n // similar to keepref, but if the 'stream' object exists\n // in a trace, we will keep the data array.\n src = d[v + 'src'];\n if(typeof src === 'string' && src.indexOf(':') > 0) {\n if(!Lib.isPlainObject(d.stream)) {\n continue;\n }\n }\n }\n else if(mode !== 'keepall') {\n // keepref: remove sourced data but only\n // if the source tag is well-formed\n src = d[v + 'src'];\n if(typeof src === 'string' && src.indexOf(':') > 0) {\n continue;\n }\n }\n\n // OK, we're including this... recurse into it\n o[v] = stripObj(d[v]);\n }\n return o;\n }\n\n if(Array.isArray(d)) {\n return d.map(stripObj);\n }\n\n // convert native dates to date strings...\n // mostly for external users exporting to plotly\n if(Lib.isJSDate(d)) return Lib.ms2DateTimeLocal(+d);\n\n return d;\n }\n\n var obj = {\n data: (data || []).map(function(v) {\n var d = stripObj(v);\n // fit has some little arrays in it that don't contain data,\n // just fit params and meta\n if(dataonly) { delete d.fit; }\n return d;\n })\n };\n if(!dataonly) { obj.layout = stripObj(layout); }\n\n if(gd.framework && gd.framework.isPolar) obj = gd.framework.getConfig();\n\n if(frames) obj.frames = stripObj(frames);\n\n return (output === 'object') ? obj : JSON.stringify(obj);\n};\n\n/**\n * Modify a keyframe using a list of operations:\n *\n * @param {array of objects} operations\n * Sequence of operations to be performed on the keyframes\n */\nplots.modifyFrames = function(gd, operations) {\n var i, op, frame;\n var _frames = gd._transitionData._frames;\n var _hash = gd._transitionData._frameHash;\n\n for(i = 0; i < operations.length; i++) {\n op = operations[i];\n\n switch(op.type) {\n // No reason this couldn't exist, but is currently unused/untested:\n /* case 'rename':\n frame = _frames[op.index];\n delete _hash[frame.name];\n _hash[op.name] = frame;\n frame.name = op.name;\n break;*/\n case 'replace':\n frame = op.value;\n var oldName = (_frames[op.index] || {}).name;\n var newName = frame.name;\n _frames[op.index] = _hash[newName] = frame;\n\n if(newName !== oldName) {\n // If name has changed in addition to replacement, then update\n // the lookup table:\n delete _hash[oldName];\n _hash[newName] = frame;\n }\n\n break;\n case 'insert':\n frame = op.value;\n _hash[frame.name] = frame;\n _frames.splice(op.index, 0, frame);\n break;\n case 'delete':\n frame = _frames[op.index];\n delete _hash[frame.name];\n _frames.splice(op.index, 1);\n break;\n }\n }\n\n return Promise.resolve();\n};\n\n/*\n * Compute a keyframe. Merge a keyframe into its base frame(s) and\n * expand properties.\n *\n * @param {object} frameLookup\n * An object containing frames keyed by name (i.e. gd._transitionData._frameHash)\n * @param {string} frame\n * The name of the keyframe to be computed\n *\n * Returns: a new object with the merged content\n */\nplots.computeFrame = function(gd, frameName) {\n var frameLookup = gd._transitionData._frameHash;\n var i, traceIndices, traceIndex, destIndex;\n\n // Null or undefined will fail on .toString(). We'll allow numbers since we\n // make it clear frames must be given string names, but we'll allow numbers\n // here since they're otherwise fine for looking up frames as long as they're\n // properly cast to strings. We really just want to ensure here that this\n // 1) doesn't fail, and\n // 2) doens't give an incorrect answer (which String(frameName) would)\n if(!frameName) {\n throw new Error('computeFrame must be given a string frame name');\n }\n\n var framePtr = frameLookup[frameName.toString()];\n\n // Return false if the name is invalid:\n if(!framePtr) {\n return false;\n }\n\n var frameStack = [framePtr];\n var frameNameStack = [framePtr.name];\n\n // Follow frame pointers:\n while(framePtr.baseframe && (framePtr = frameLookup[framePtr.baseframe.toString()])) {\n // Avoid infinite loops:\n if(frameNameStack.indexOf(framePtr.name) !== -1) break;\n\n frameStack.push(framePtr);\n frameNameStack.push(framePtr.name);\n }\n\n // A new object for the merged result:\n var result = {};\n\n // Merge, starting with the last and ending with the desired frame:\n while((framePtr = frameStack.pop())) {\n if(framePtr.layout) {\n result.layout = plots.extendLayout(result.layout, framePtr.layout);\n }\n\n if(framePtr.data) {\n if(!result.data) {\n result.data = [];\n }\n traceIndices = framePtr.traces;\n\n if(!traceIndices) {\n // If not defined, assume serial order starting at zero\n traceIndices = [];\n for(i = 0; i < framePtr.data.length; i++) {\n traceIndices[i] = i;\n }\n }\n\n if(!result.traces) {\n result.traces = [];\n }\n\n for(i = 0; i < framePtr.data.length; i++) {\n // Loop through this frames data, find out where it should go,\n // and merge it!\n traceIndex = traceIndices[i];\n if(traceIndex === undefined || traceIndex === null) {\n continue;\n }\n\n destIndex = result.traces.indexOf(traceIndex);\n if(destIndex === -1) {\n destIndex = result.data.length;\n result.traces[destIndex] = traceIndex;\n }\n\n result.data[destIndex] = plots.extendTrace(result.data[destIndex], framePtr.data[i]);\n }\n }\n }\n\n return result;\n};\n\n/*\n * Recompute the lookup table that maps frame name -> frame object. addFrames/\n * deleteFrames already manages this data one at a time, so the only time this\n * is necessary is if you poke around manually in `gd._transitionData._frames`\n * and create and haven't updated the lookup table.\n */\nplots.recomputeFrameHash = function(gd) {\n var hash = gd._transitionData._frameHash = {};\n var frames = gd._transitionData._frames;\n for(var i = 0; i < frames.length; i++) {\n var frame = frames[i];\n if(frame && frame.name) {\n hash[frame.name] = frame;\n }\n }\n};\n\n/**\n * Extend an object, treating container arrays very differently by extracting\n * their contents and merging them separately.\n *\n * This exists so that we can extendDeepNoArrays and avoid stepping into data\n * arrays without knowledge of the plot schema, but so that we may also manually\n * recurse into known container arrays, such as transforms.\n *\n * See extendTrace and extendLayout below for usage.\n */\nplots.extendObjectWithContainers = function(dest, src, containerPaths) {\n var containerProp, containerVal, i, j, srcProp, destProp, srcContainer, destContainer;\n var copy = Lib.extendDeepNoArrays({}, src || {});\n var expandedObj = Lib.expandObjectPaths(copy);\n var containerObj = {};\n\n // Step through and extract any container properties. Otherwise extendDeepNoArrays\n // will clobber any existing properties with an empty array and then supplyDefaults\n // will reset everything to defaults.\n if(containerPaths && containerPaths.length) {\n for(i = 0; i < containerPaths.length; i++) {\n containerProp = Lib.nestedProperty(expandedObj, containerPaths[i]);\n containerVal = containerProp.get();\n\n if(containerVal === undefined) {\n Lib.nestedProperty(containerObj, containerPaths[i]).set(null);\n }\n else {\n containerProp.set(null);\n Lib.nestedProperty(containerObj, containerPaths[i]).set(containerVal);\n }\n }\n }\n\n dest = Lib.extendDeepNoArrays(dest || {}, expandedObj);\n\n if(containerPaths && containerPaths.length) {\n for(i = 0; i < containerPaths.length; i++) {\n srcProp = Lib.nestedProperty(containerObj, containerPaths[i]);\n srcContainer = srcProp.get();\n\n if(!srcContainer) continue;\n\n destProp = Lib.nestedProperty(dest, containerPaths[i]);\n destContainer = destProp.get();\n\n if(!Array.isArray(destContainer)) {\n destContainer = [];\n destProp.set(destContainer);\n }\n\n for(j = 0; j < srcContainer.length; j++) {\n var srcObj = srcContainer[j];\n\n if(srcObj === null) destContainer[j] = null;\n else {\n destContainer[j] = plots.extendObjectWithContainers(destContainer[j], srcObj);\n }\n }\n\n destProp.set(destContainer);\n }\n }\n\n return dest;\n};\n\nplots.dataArrayContainers = ['transforms'];\nplots.layoutArrayContainers = Registry.layoutArrayContainers;\n\n/*\n * Extend a trace definition. This method:\n *\n * 1. directly transfers any array references\n * 2. manually recurses into container arrays like transforms\n *\n * The result is the original object reference with the new contents merged in.\n */\nplots.extendTrace = function(destTrace, srcTrace) {\n return plots.extendObjectWithContainers(destTrace, srcTrace, plots.dataArrayContainers);\n};\n\n/*\n * Extend a layout definition. This method:\n *\n * 1. directly transfers any array references (not critically important for\n * layout since there aren't really data arrays)\n * 2. manually recurses into container arrays like annotations\n *\n * The result is the original object reference with the new contents merged in.\n */\nplots.extendLayout = function(destLayout, srcLayout) {\n return plots.extendObjectWithContainers(destLayout, srcLayout, plots.layoutArrayContainers);\n};\n\n/**\n * Transition to a set of new data and layout properties\n *\n * @param {DOM element} gd\n * the DOM element of the graph container div\n * @param {Object[]} data\n * an array of data objects following the normal Plotly data definition format\n * @param {Object} layout\n * a layout object, following normal Plotly layout format\n * @param {Number[]} traces\n * indices of the corresponding traces specified in `data`\n * @param {Object} frameOpts\n * options for the frame (i.e. whether to redraw post-transition)\n * @param {Object} transitionOpts\n * options for the transition\n */\nplots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts) {\n var i, traceIdx;\n\n var dataLength = Array.isArray(data) ? data.length : 0;\n var traceIndices = traces.slice(0, dataLength);\n\n var transitionedTraces = [];\n\n function prepareTransitions() {\n var i;\n\n for(i = 0; i < traceIndices.length; i++) {\n var traceIdx = traceIndices[i];\n var trace = gd._fullData[traceIdx];\n var module = trace._module;\n\n // There's nothing to do if this module is not defined:\n if(!module) continue;\n\n // Don't register the trace as transitioned if it doens't know what to do.\n // If it *is* registered, it will receive a callback that it's responsible\n // for calling in order to register the transition as having completed.\n if(module.animatable) {\n transitionedTraces.push(traceIdx);\n }\n\n gd.data[traceIndices[i]] = plots.extendTrace(gd.data[traceIndices[i]], data[i]);\n }\n\n // Follow the same procedure. Clone it so we don't mangle the input, then\n // expand any object paths so we can merge deep into gd.layout:\n var layoutUpdate = Lib.expandObjectPaths(Lib.extendDeepNoArrays({}, layout));\n\n // Before merging though, we need to modify the incoming layout. We only\n // know how to *transition* layout ranges, so it's imperative that a new\n // range not be sent to the layout before the transition has started. So\n // we must remove the things we can transition:\n var axisAttrRe = /^[xy]axis[0-9]*$/;\n for(var attr in layoutUpdate) {\n if(!axisAttrRe.test(attr)) continue;\n delete layoutUpdate[attr].range;\n }\n\n plots.extendLayout(gd.layout, layoutUpdate);\n\n // Supply defaults after applying the incoming properties. Note that any attempt\n // to simplify this step and reduce the amount of work resulted in the reconstruction\n // of essentially the whole supplyDefaults step, so that it seems sensible to just use\n // supplyDefaults even though it's heavier than would otherwise be desired for\n // transitions:\n\n // first delete calcdata so supplyDefaults knows a calc step is coming\n delete gd.calcdata;\n\n plots.supplyDefaults(gd);\n\n plots.doCalcdata(gd);\n\n ErrorBars.calc(gd);\n\n return Promise.resolve();\n }\n\n function executeCallbacks(list) {\n var p = Promise.resolve();\n if(!list) return p;\n while(list.length) {\n p = p.then((list.shift()));\n }\n return p;\n }\n\n function flushCallbacks(list) {\n if(!list) return;\n while(list.length) {\n list.shift();\n }\n }\n\n var aborted = false;\n\n function executeTransitions() {\n\n gd.emit('plotly_transitioning', []);\n\n return new Promise(function(resolve) {\n // This flag is used to disabled things like autorange:\n gd._transitioning = true;\n\n // When instantaneous updates are coming through quickly, it's too much to simply disable\n // all interaction, so store this flag so we can disambiguate whether mouse interactions\n // should be fully disabled or not:\n if(transitionOpts.duration > 0) {\n gd._transitioningWithDuration = true;\n }\n\n\n // If another transition is triggered, this callback will be executed simply because it's\n // in the interruptCallbacks queue. If this transition completes, it will instead flush\n // that queue and forget about this callback.\n gd._transitionData._interruptCallbacks.push(function() {\n aborted = true;\n });\n\n if(frameOpts.redraw) {\n gd._transitionData._interruptCallbacks.push(function() {\n return Plotly.redraw(gd);\n });\n }\n\n // Emit this and make sure it happens last:\n gd._transitionData._interruptCallbacks.push(function() {\n gd.emit('plotly_transitioninterrupted', []);\n });\n\n // Construct callbacks that are executed on transition end. This ensures the d3 transitions\n // are *complete* before anything else is done.\n var numCallbacks = 0;\n var numCompleted = 0;\n function makeCallback() {\n numCallbacks++;\n return function() {\n numCompleted++;\n // When all are complete, perform a redraw:\n if(!aborted && numCompleted === numCallbacks) {\n completeTransition(resolve);\n }\n };\n }\n\n var traceTransitionOpts;\n var j;\n var basePlotModules = gd._fullLayout._basePlotModules;\n var hasAxisTransition = false;\n\n if(layout) {\n for(j = 0; j < basePlotModules.length; j++) {\n if(basePlotModules[j].transitionAxes) {\n var newLayout = Lib.expandObjectPaths(layout);\n hasAxisTransition = basePlotModules[j].transitionAxes(gd, newLayout, transitionOpts, makeCallback) || hasAxisTransition;\n }\n }\n }\n\n // Here handle the exception that we refuse to animate scales and axes at the same\n // time. In other words, if there's an axis transition, then set the data transition\n // to instantaneous.\n if(hasAxisTransition) {\n traceTransitionOpts = Lib.extendFlat({}, transitionOpts);\n traceTransitionOpts.duration = 0;\n } else {\n traceTransitionOpts = transitionOpts;\n }\n\n for(j = 0; j < basePlotModules.length; j++) {\n // Note that we pass a callback to *create* the callback that must be invoked on completion.\n // This is since not all traces know about transitions, so it greatly simplifies matters if\n // the trace is responsible for creating a callback, if needed, and then executing it when\n // the time is right.\n basePlotModules[j].plot(gd, transitionedTraces, traceTransitionOpts, makeCallback);\n }\n\n // If nothing else creates a callback, then this will trigger the completion in the next tick:\n setTimeout(makeCallback());\n\n });\n }\n\n function completeTransition(callback) {\n // This a simple workaround for tests which purge the graph before animations\n // have completed. That's not a very common case, so this is the simplest\n // fix.\n if(!gd._transitionData) return;\n\n flushCallbacks(gd._transitionData._interruptCallbacks);\n\n return Promise.resolve().then(function() {\n if(frameOpts.redraw) {\n return Plotly.redraw(gd);\n }\n }).then(function() {\n // Set transitioning false again once the redraw has occurred. This is used, for example,\n // to prevent the trailing redraw from autoranging:\n gd._transitioning = false;\n gd._transitioningWithDuration = false;\n\n gd.emit('plotly_transitioned', []);\n }).then(callback);\n }\n\n function interruptPreviousTransitions() {\n // Fail-safe against purged plot:\n if(!gd._transitionData) return;\n\n // If a transition is interrupted, set this to false. At the moment, the only thing that would\n // interrupt a transition is another transition, so that it will momentarily be set to true\n // again, but this determines whether autorange or dragbox work, so it's for the sake of\n // cleanliness:\n gd._transitioning = false;\n\n return executeCallbacks(gd._transitionData._interruptCallbacks);\n }\n\n for(i = 0; i < traceIndices.length; i++) {\n traceIdx = traceIndices[i];\n var contFull = gd._fullData[traceIdx];\n var module = contFull._module;\n\n if(!module) continue;\n\n if(!module.animatable) {\n var thisUpdate = {};\n\n for(var ai in data[i]) {\n thisUpdate[ai] = [data[i][ai]];\n }\n }\n }\n\n var seq = [plots.previousPromises, interruptPreviousTransitions, prepareTransitions, plots.rehover, executeTransitions];\n\n var transitionStarting = Lib.syncOrAsync(seq, gd);\n\n if(!transitionStarting || !transitionStarting.then) {\n transitionStarting = Promise.resolve();\n }\n\n return transitionStarting.then(function() {\n return gd;\n });\n};\n\nplots.doCalcdata = function(gd, traces) {\n var axList = Plotly.Axes.list(gd),\n fullData = gd._fullData,\n fullLayout = gd._fullLayout;\n\n var trace, _module, i, j;\n\n // XXX: Is this correct? Needs a closer look so that *some* traces can be recomputed without\n // *all* needing doCalcdata:\n var calcdata = new Array(fullData.length);\n var oldCalcdata = (gd.calcdata || []).slice(0);\n gd.calcdata = calcdata;\n\n // extra helper variables\n // firstscatter: fill-to-next on the first trace goes to zero\n gd.firstscatter = true;\n\n // how many box plots do we have (in case they're grouped)\n gd.numboxes = 0;\n\n // for calculating avg luminosity of heatmaps\n gd._hmpixcount = 0;\n gd._hmlumcount = 0;\n\n // for sharing colors across pies (and for legend)\n fullLayout._piecolormap = {};\n fullLayout._piedefaultcolorcount = 0;\n\n // If traces were specified and this trace was not included,\n // then transfer it over from the old calcdata:\n for(i = 0; i < fullData.length; i++) {\n if(Array.isArray(traces) && traces.indexOf(i) === -1) {\n calcdata[i] = oldCalcdata[i];\n continue;\n }\n }\n\n // find array attributes in trace\n for(i = 0; i < fullData.length; i++) {\n trace = fullData[i];\n trace._arrayAttrs = PlotSchema.findArrayAttributes(trace);\n }\n\n initCategories(axList);\n\n var hasCalcTransform = false;\n\n // transform loop\n for(i = 0; i < fullData.length; i++) {\n trace = fullData[i];\n\n if(trace.visible === true && trace.transforms) {\n _module = trace._module;\n\n // we need one round of trace module calc before\n // the calc transform to 'fill in' the categories list\n // used for example in the data-to-coordinate method\n if(_module && _module.calc) _module.calc(gd, trace);\n\n for(j = 0; j < trace.transforms.length; j++) {\n var transform = trace.transforms[j];\n\n _module = transformsRegistry[transform.type];\n if(_module && _module.calcTransform) {\n trace._hasCalcTransform = true;\n hasCalcTransform = true;\n _module.calcTransform(gd, trace, transform);\n }\n }\n }\n }\n\n // clear stuff that should recomputed in 'regular' loop\n if(hasCalcTransform) {\n for(i = 0; i < axList.length; i++) {\n axList[i]._min = [];\n axList[i]._max = [];\n axList[i]._categories = [];\n axList[i]._categoriesMap = {};\n }\n initCategories(axList);\n }\n\n // 'regular' loop\n for(i = 0; i < fullData.length; i++) {\n var cd = [];\n\n trace = fullData[i];\n\n if(trace.visible === true) {\n _module = trace._module;\n if(_module && _module.calc) cd = _module.calc(gd, trace);\n }\n\n // Make sure there is a first point.\n //\n // This ensures there is a calcdata item for every trace,\n // even if cartesian logic doesn't handle it (for things like legends).\n if(!Array.isArray(cd) || !cd[0]) {\n cd = [{x: BADNUM, y: BADNUM}];\n }\n\n // add the trace-wide properties to the first point,\n // per point properties to every point\n // t is the holder for trace-wide properties\n if(!cd[0].t) cd[0].t = {};\n cd[0].trace = trace;\n\n calcdata[i] = cd;\n }\n\n Registry.getComponentMethod('fx', 'calc')(gd);\n};\n\n// initialize the category list, if there is one, so we start over\n// to be filled in later by ax.d2c\nfunction initCategories(axList) {\n for(var i = 0; i < axList.length; i++) {\n axList[i]._categories = axList[i]._initialCategories.slice();\n\n // Build the lookup map for initialized categories\n axList[i]._categoriesMap = {};\n for(var j = 0; j < axList[i]._categories.length; j++) {\n axList[i]._categoriesMap[axList[i]._categories[j]] = j;\n }\n }\n}\n\nplots.rehover = function(gd) {\n if(gd._fullLayout._rehover) {\n gd._fullLayout._rehover();\n }\n};\n\nplots.generalUpdatePerTraceModule = function(subplot, subplotCalcData, subplotLayout) {\n var traceHashOld = subplot.traceHash,\n traceHash = {},\n i;\n\n function filterVisible(calcDataIn) {\n var calcDataOut = [];\n\n for(var i = 0; i < calcDataIn.length; i++) {\n var calcTrace = calcDataIn[i],\n trace = calcTrace[0].trace;\n\n if(trace.visible === true) calcDataOut.push(calcTrace);\n }\n\n return calcDataOut;\n }\n\n // build up moduleName -> calcData hash\n for(i = 0; i < subplotCalcData.length; i++) {\n var calcTraces = subplotCalcData[i],\n trace = calcTraces[0].trace;\n\n // skip over visible === false traces\n // as they don't have `_module` ref\n if(trace.visible) {\n traceHash[trace.type] = traceHash[trace.type] || [];\n traceHash[trace.type].push(calcTraces);\n }\n }\n\n var moduleNamesOld = Object.keys(traceHashOld);\n var moduleNames = Object.keys(traceHash);\n\n // when a trace gets deleted, make sure that its module's\n // plot method is called so that it is properly\n // removed from the DOM.\n for(i = 0; i < moduleNamesOld.length; i++) {\n var moduleName = moduleNamesOld[i];\n\n if(moduleNames.indexOf(moduleName) === -1) {\n var fakeCalcTrace = traceHashOld[moduleName][0],\n fakeTrace = fakeCalcTrace[0].trace;\n\n fakeTrace.visible = false;\n traceHash[moduleName] = [fakeCalcTrace];\n }\n }\n\n // update list of module names to include 'fake' traces added above\n moduleNames = Object.keys(traceHash);\n\n // call module plot method\n for(i = 0; i < moduleNames.length; i++) {\n var moduleCalcData = traceHash[moduleNames[i]],\n _module = moduleCalcData[0][0].trace._module;\n\n _module.plot(subplot, filterVisible(moduleCalcData), subplotLayout);\n }\n\n // update moduleName -> calcData hash\n subplot.traceHash = traceHash;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/plots.js\n// module id = 15\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isPlainObject = require('./is_plain_object.js');\nvar isArray = Array.isArray;\n\nfunction primitivesLoopSplice(source, target) {\n var i, value;\n for(i = 0; i < source.length; i++) {\n value = source[i];\n if(value !== null && typeof(value) === 'object') {\n return false;\n }\n if(value !== void(0)) {\n target[i] = value;\n }\n }\n return true;\n}\n\nexports.extendFlat = function() {\n return _extend(arguments, false, false, false);\n};\n\nexports.extendDeep = function() {\n return _extend(arguments, true, false, false);\n};\n\nexports.extendDeepAll = function() {\n return _extend(arguments, true, true, false);\n};\n\nexports.extendDeepNoArrays = function() {\n return _extend(arguments, true, false, true);\n};\n\n/*\n * Inspired by https://github.com/justmoon/node-extend/blob/master/index.js\n * All credit to the jQuery authors for perfecting this amazing utility.\n *\n * API difference with jQuery version:\n * - No optional boolean (true -> deep extend) first argument,\n * use `extendFlat` for first-level only extend and\n * use `extendDeep` for a deep extend.\n *\n * Other differences with jQuery version:\n * - Uses a modern (and faster) isPlainObject routine.\n * - Expected to work with object {} and array [] arguments only.\n * - Does not check for circular structure.\n * FYI: jQuery only does a check across one level.\n * Warning: this might result in infinite loops.\n *\n */\nfunction _extend(inputs, isDeep, keepAllKeys, noArrayCopies) {\n var target = inputs[0],\n length = inputs.length;\n\n var input, key, src, copy, copyIsArray, clone, allPrimitives;\n\n if(length === 2 && isArray(target) && isArray(inputs[1]) && target.length === 0) {\n\n allPrimitives = primitivesLoopSplice(inputs[1], target);\n\n if(allPrimitives) {\n return target;\n } else {\n target.splice(0, target.length); // reset target and continue to next block\n }\n }\n\n for(var i = 1; i < length; i++) {\n input = inputs[i];\n\n for(key in input) {\n src = target[key];\n copy = input[key];\n\n // Stop early and just transfer the array if array copies are disallowed:\n if(noArrayCopies && isArray(copy)) {\n target[key] = copy;\n }\n\n // recurse if we're merging plain objects or arrays\n else if(isDeep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n if(copyIsArray) {\n copyIsArray = false;\n clone = src && isArray(src) ? src : [];\n } else {\n clone = src && isPlainObject(src) ? src : {};\n }\n\n // never move original objects, clone them\n target[key] = _extend([clone, copy], isDeep, keepAllKeys, noArrayCopies);\n }\n\n // don't bring in undefined values, except for extendDeepAll\n else if(typeof copy !== 'undefined' || keepAllKeys) {\n target[key] = copy;\n }\n }\n }\n\n return target;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/extend.js\n// module id = 19\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * make a font attribute group\n *\n * @param {object} opts\n * @param {string}\n * opts.description: where & how this font is used\n * @param {optional bool} arrayOk:\n * should each part (family, size, color) be arrayOk? default false.\n * @param {string} editType:\n * the editType for all pieces of this font\n * @param {optional string} colorEditType:\n * a separate editType just for color\n *\n * @return {object} attributes object containing {family, size, color} as specified\n */\nmodule.exports = function(opts) {\n var editType = opts.editType;\n var colorEditType = opts.colorEditType;\n if(colorEditType === undefined) colorEditType = editType;\n var attrs = {\n family: {\n valType: 'string',\n \n noBlank: true,\n strict: true,\n editType: editType,\n \n },\n size: {\n valType: 'number',\n \n min: 1,\n editType: editType\n },\n color: {\n valType: 'color',\n \n editType: colorEditType\n },\n editType: editType,\n // blank strings so compress_attributes can remove\n // TODO - that's uber hacky... better solution?\n \n };\n\n if(opts.arrayOk) {\n attrs.family.arrayOk = true;\n attrs.size.arrayOk = true;\n attrs.color.arrayOk = true;\n }\n\n return attrs;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/font_attributes.js\n// module id = 20\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n /**\n * Standardize all missing data in calcdata to use undefined\n * never null or NaN.\n * That way we can use !==undefined, or !== BADNUM,\n * to test for real data\n */\n BADNUM: undefined,\n\n /*\n * Limit certain operations to well below floating point max value\n * to avoid glitches: Make sure that even when you multiply it by the\n * number of pixels on a giant screen it still works\n */\n FP_SAFE: Number.MAX_VALUE / 10000,\n\n /*\n * conversion of date units to milliseconds\n * year and month constants are marked \"AVG\"\n * to remind us that not all years and months\n * have the same length\n */\n ONEAVGYEAR: 31557600000, // 365.25 days\n ONEAVGMONTH: 2629800000, // 1/12 of ONEAVGYEAR\n ONEDAY: 86400000,\n ONEHOUR: 3600000,\n ONEMIN: 60000,\n ONESEC: 1000,\n\n /*\n * For fast conversion btwn world calendars and epoch ms, the Julian Day Number\n * of the unix epoch. From calendars.instance().newDate(1970, 1, 1).toJD()\n */\n EPOCHJD: 2440587.5,\n\n /*\n * Are two values nearly equal? Compare to 1PPM\n */\n ALMOST_EQUAL: 1 - 1e-6,\n\n /*\n * not a number, but for displaying numbers: the \"minus sign\" symbol is\n * wider than the regular ascii dash \"-\"\n */\n MINUS_SIGN: '\\u2212'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/constants/numerical.js\n// module id = 21\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\nvar counterRegex = require('../../lib').counterRegex;\n\n\nmodule.exports = {\n\n idRegex: {\n x: counterRegex('x'),\n y: counterRegex('y')\n },\n\n attrRegex: counterRegex('[xy]axis'),\n\n // axis match regular expression\n xAxisMatch: counterRegex('xaxis'),\n yAxisMatch: counterRegex('yaxis'),\n\n // pattern matching axis ids and names\n // note that this is more permissive than counterRegex, as\n // id2name, name2id, and cleanId accept \"x1\" etc\n AX_ID_PATTERN: /^[xyz][0-9]*$/,\n AX_NAME_PATTERN: /^[xyz]axis[0-9]*$/,\n\n // pixels to move mouse before you stop clamping to starting point\n MINDRAG: 8,\n\n // smallest dimension allowed for a select box\n MINSELECT: 12,\n\n // smallest dimension allowed for a zoombox\n MINZOOM: 20,\n\n // width of axis drag regions\n DRAGGERSIZE: 20,\n\n // max pixels off straight before a lasso select line counts as bent\n BENDPX: 1.5,\n\n // delay before a redraw (relayout) after smooth panning and zooming\n REDRAWDELAY: 50,\n\n // throttling limit (ms) for selectPoints calls\n SELECTDELAY: 100,\n\n // cache ID suffix for throttle\n SELECTID: '-select',\n\n // last resort axis ranges for x and y axes if we have no data\n DFLTRANGEX: [-1, 6],\n DFLTRANGEY: [-1, 4],\n\n // Layers to keep trace types in the right order.\n // from back to front:\n // 1. heatmaps, 2D histos and contour maps\n // 2. bars / 1D histos\n // 3. errorbars for bars and scatter\n // 4. scatter\n // 5. box plots\n traceLayerClasses: [\n 'imagelayer',\n 'maplayer',\n 'barlayer',\n 'carpetlayer',\n 'boxlayer',\n 'scatterlayer'\n ],\n\n layerValue2layerClass: {\n 'above traces': 'above',\n 'below traces': 'below'\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/constants.js\n// module id = 22\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/* global MathJax:false */\n\nvar d3 = require('d3');\n\nvar Lib = require('../lib');\nvar xmlnsNamespaces = require('../constants/xmlns_namespaces');\nvar stringMappings = require('../constants/string_mappings');\nvar LINE_SPACING = require('../constants/alignment').LINE_SPACING;\n\n// text converter\n\nfunction getSize(_selection, _dimension) {\n return _selection.node().getBoundingClientRect()[_dimension];\n}\n\nvar FIND_TEX = /([^$]*)([$]+[^$]*[$]+)([^$]*)/;\n\nexports.convertToTspans = function(_context, gd, _callback) {\n var str = _context.text();\n\n // Until we get tex integrated more fully (so it can be used along with non-tex)\n // allow some elements to prohibit it by attaching 'data-notex' to the original\n var tex = (!_context.attr('data-notex')) &&\n (typeof MathJax !== 'undefined') &&\n str.match(FIND_TEX);\n\n var parent = d3.select(_context.node().parentNode);\n if(parent.empty()) return;\n var svgClass = (_context.attr('class')) ? _context.attr('class').split(' ')[0] : 'text';\n svgClass += '-math';\n parent.selectAll('svg.' + svgClass).remove();\n parent.selectAll('g.' + svgClass + '-group').remove();\n _context.style('display', null)\n .attr({\n // some callers use data-unformatted *from the element* in 'cancel'\n // so we need it here even if we're going to turn it into math\n // these two (plus style and text-anchor attributes) form the key we're\n // going to use for Drawing.bBox\n 'data-unformatted': str,\n 'data-math': 'N'\n });\n\n function showText() {\n if(!parent.empty()) {\n svgClass = _context.attr('class') + '-math';\n parent.select('svg.' + svgClass).remove();\n }\n _context.text('')\n .style('white-space', 'pre');\n\n var hasLink = buildSVGText(_context.node(), str);\n\n if(hasLink) {\n // at least in Chrome, pointer-events does not seem\n // to be honored in children of elements\n // so if we have an anchor, we have to make the\n // whole element respond\n _context.style('pointer-events', 'all');\n }\n\n exports.positionText(_context);\n\n if(_callback) _callback.call(_context);\n }\n\n if(tex) {\n ((gd && gd._promises) || []).push(new Promise(function(resolve) {\n _context.style('display', 'none');\n var fontSize = parseInt(_context.node().style.fontSize, 10);\n var config = {fontSize: fontSize};\n\n texToSVG(tex[2], config, function(_svgEl, _glyphDefs, _svgBBox) {\n parent.selectAll('svg.' + svgClass).remove();\n parent.selectAll('g.' + svgClass + '-group').remove();\n\n var newSvg = _svgEl && _svgEl.select('svg');\n if(!newSvg || !newSvg.node()) {\n showText();\n resolve();\n return;\n }\n\n var mathjaxGroup = parent.append('g')\n .classed(svgClass + '-group', true)\n .attr({\n 'pointer-events': 'none',\n 'data-unformatted': str,\n 'data-math': 'Y'\n });\n\n mathjaxGroup.node().appendChild(newSvg.node());\n\n // stitch the glyph defs\n if(_glyphDefs && _glyphDefs.node()) {\n newSvg.node().insertBefore(_glyphDefs.node().cloneNode(true),\n newSvg.node().firstChild);\n }\n\n newSvg.attr({\n 'class': svgClass,\n height: _svgBBox.height,\n preserveAspectRatio: 'xMinYMin meet'\n })\n .style({overflow: 'visible', 'pointer-events': 'none'});\n\n var fill = _context.node().style.fill || 'black';\n newSvg.select('g').attr({fill: fill, stroke: fill});\n\n var newSvgW = getSize(newSvg, 'width'),\n newSvgH = getSize(newSvg, 'height'),\n newX = +_context.attr('x') - newSvgW *\n {start: 0, middle: 0.5, end: 1}[_context.attr('text-anchor') || 'start'],\n // font baseline is about 1/4 fontSize below centerline\n textHeight = fontSize || getSize(_context, 'height'),\n dy = -textHeight / 4;\n\n if(svgClass[0] === 'y') {\n mathjaxGroup.attr({\n transform: 'rotate(' + [-90, +_context.attr('x'), +_context.attr('y')] +\n ') translate(' + [-newSvgW / 2, dy - newSvgH / 2] + ')'\n });\n newSvg.attr({x: +_context.attr('x'), y: +_context.attr('y')});\n }\n else if(svgClass[0] === 'l') {\n newSvg.attr({x: _context.attr('x'), y: dy - (newSvgH / 2)});\n }\n else if(svgClass[0] === 'a') {\n newSvg.attr({x: 0, y: dy});\n }\n else {\n newSvg.attr({x: newX, y: (+_context.attr('y') + dy - newSvgH / 2)});\n }\n\n if(_callback) _callback.call(_context, mathjaxGroup);\n resolve(mathjaxGroup);\n });\n }));\n }\n else showText();\n\n return _context;\n};\n\n\n// MathJax\n\nvar LT_MATCH = /(<|<|<)/g;\nvar GT_MATCH = /(>|>|>)/g;\n\nfunction cleanEscapesForTex(s) {\n return s.replace(LT_MATCH, '\\\\lt ')\n .replace(GT_MATCH, '\\\\gt ');\n}\n\nfunction texToSVG(_texString, _config, _callback) {\n var randomID = 'math-output-' + Lib.randstr([], 64);\n var tmpDiv = d3.select('body').append('div')\n .attr({id: randomID})\n .style({visibility: 'hidden', position: 'absolute'})\n .style({'font-size': _config.fontSize + 'px'})\n .text(cleanEscapesForTex(_texString));\n\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, tmpDiv.node()], function() {\n var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');\n\n if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {\n Lib.log('There was an error in the tex syntax.', _texString);\n _callback();\n }\n else {\n var svgBBox = tmpDiv.select('svg').node().getBoundingClientRect();\n _callback(tmpDiv.select('.MathJax_SVG'), glyphDefs, svgBBox);\n }\n\n tmpDiv.remove();\n });\n}\n\nvar TAG_STYLES = {\n // would like to use baseline-shift for sub/sup but FF doesn't support it\n // so we need to use dy along with the uber hacky shift-back-to\n // baseline below\n sup: 'font-size:70%',\n sub: 'font-size:70%',\n b: 'font-weight:bold',\n i: 'font-style:italic',\n a: 'cursor:pointer',\n span: '',\n em: 'font-style:italic;font-weight:bold'\n};\n\n// baseline shifts for sub and sup\nvar SHIFT_DY = {\n sub: '0.3em',\n sup: '-0.6em'\n};\n// reset baseline by adding a tspan (empty except for a zero-width space)\n// with dy of -70% * SHIFT_DY (because font-size=70%)\nvar RESET_DY = {\n sub: '-0.21em',\n sup: '0.42em'\n};\nvar ZERO_WIDTH_SPACE = '\\u200b';\n\n/*\n * Whitelist of protocols in user-supplied urls. Mostly we want to avoid javascript\n * and related attack vectors. The empty items are there for IE, that in various\n * versions treats relative paths as having different flavors of no protocol, while\n * other browsers have these explicitly inherit the protocol of the page they're in.\n */\nvar PROTOCOLS = ['http:', 'https:', 'mailto:', '', undefined, ':'];\n\nvar STRIP_TAGS = new RegExp(']*)?/?>', 'g');\n\nvar ENTITY_TO_UNICODE = Object.keys(stringMappings.entityToUnicode).map(function(k) {\n return {\n regExp: new RegExp('&' + k + ';', 'g'),\n sub: stringMappings.entityToUnicode[k]\n };\n});\n\nvar NEWLINES = /(\\r\\n?|\\n)/g;\n\nvar SPLIT_TAGS = /(<[^<>]*>)/;\n\nvar ONE_TAG = /<(\\/?)([^ >]*)(\\s+(.*))?>/i;\n\nvar BR_TAG = //i;\n\n/*\n * style and href: pull them out of either single or double quotes. Also\n * - target: (_blank|_self|_parent|_top|framename)\n * note that you can't use target to get a popup but if you use popup,\n * a `framename` will be passed along as the name of the popup window.\n * per the spec, cannot contain whitespace.\n * for backward compatibility we default to '_blank'\n * - popup: a custom one for us to enable popup (new window) links. String\n * for window.open -> strWindowFeatures, like 'menubar=yes,width=500,height=550'\n * note that at least in Chrome, you need to give at least one property\n * in this string or the page will open in a new tab anyway. We follow this\n * convention and will not make a popup if this string is empty.\n * per the spec, cannot contain whitespace.\n *\n * Because we hack in other attributes with style (sub & sup), drop any trailing\n * semicolon in user-supplied styles so we can consistently append the tag-dependent style\n */\nvar STYLEMATCH = /(^|[\\s\"'])style\\s*=\\s*(\"([^\"]*);?\"|'([^']*);?')/i;\nvar HREFMATCH = /(^|[\\s\"'])href\\s*=\\s*(\"([^\"]*)\"|'([^']*)')/i;\nvar TARGETMATCH = /(^|[\\s\"'])target\\s*=\\s*(\"([^\"\\s]*)\"|'([^'\\s]*)')/i;\nvar POPUPMATCH = /(^|[\\s\"'])popup\\s*=\\s*(\"([\\w=,]*)\"|'([\\w=,]*)')/i;\n\n// dedicated matcher for these quoted regexes, that can return their results\n// in two different places\nfunction getQuotedMatch(_str, re) {\n if(!_str) return null;\n var match = _str.match(re);\n return match && (match[3] || match[4]);\n}\n\nvar COLORMATCH = /(^|;)\\s*color:/;\n\nexports.plainText = function(_str) {\n // strip out our pseudo-html so we have a readable\n // version to put into text fields\n return (_str || '').replace(STRIP_TAGS, ' ');\n};\n\nfunction replaceFromMapObject(_str, list) {\n if(!_str) return '';\n\n for(var i = 0; i < list.length; i++) {\n var item = list[i];\n _str = _str.replace(item.regExp, item.sub);\n }\n\n return _str;\n}\n\nfunction convertEntities(_str) {\n return replaceFromMapObject(_str, ENTITY_TO_UNICODE);\n}\n\n/*\n * buildSVGText: convert our pseudo-html into SVG tspan elements, and attach these\n * to containerNode\n *\n * @param {svg text element} containerNode: the node to insert this text into\n * @param {string} str: the pseudo-html string to convert to svg\n *\n * @returns {bool}: does the result contain any links? We need to handle the text element\n * somewhat differently if it does, so just keep track of this when it happens.\n */\nfunction buildSVGText(containerNode, str) {\n str = convertEntities(str)\n /*\n * Normalize behavior between IE and others wrt newlines and whitespace:pre\n * this combination makes IE barf https://github.com/plotly/plotly.js/issues/746\n * Chrome and FF display \\n, \\r, or \\r\\n as a space in this mode.\n * I feel like at some point we turned these into
but currently we don't so\n * I'm just going to cement what we do now in Chrome and FF\n */\n .replace(NEWLINES, ' ');\n\n var hasLink = false;\n\n // as we're building the text, keep track of what elements we're nested inside\n // nodeStack will be an array of {node, type, style, href, target, popup}\n // where only type: 'a' gets the last 3 and node is only added when it's created\n var nodeStack = [];\n var currentNode;\n var currentLine = -1;\n\n function newLine() {\n currentLine++;\n\n var lineNode = document.createElementNS(xmlnsNamespaces.svg, 'tspan');\n d3.select(lineNode).attr({\n class: 'line',\n dy: (currentLine * LINE_SPACING) + 'em'\n });\n containerNode.appendChild(lineNode);\n\n currentNode = lineNode;\n\n var oldNodeStack = nodeStack;\n nodeStack = [{node: lineNode}];\n\n if(oldNodeStack.length > 1) {\n for(var i = 1; i < oldNodeStack.length; i++) {\n enterNode(oldNodeStack[i]);\n }\n }\n }\n\n function enterNode(nodeSpec) {\n var type = nodeSpec.type;\n var nodeAttrs = {};\n var nodeType;\n\n if(type === 'a') {\n nodeType = 'a';\n var target = nodeSpec.target;\n var href = nodeSpec.href;\n var popup = nodeSpec.popup;\n if(href) {\n nodeAttrs = {\n 'xlink:xlink:show': (target === '_blank' || target.charAt(0) !== '_') ? 'new' : 'replace',\n target: target,\n 'xlink:xlink:href': href\n };\n if(popup) {\n // security: href and target are not inserted as code but\n // as attributes. popup is, but limited to /[A-Za-z0-9_=,]/\n nodeAttrs.onclick = 'window.open(this.href.baseVal,this.target.baseVal,\"' +\n popup + '\");return false;';\n }\n }\n }\n else nodeType = 'tspan';\n\n if(nodeSpec.style) nodeAttrs.style = nodeSpec.style;\n\n var newNode = document.createElementNS(xmlnsNamespaces.svg, nodeType);\n\n if(type === 'sup' || type === 'sub') {\n addTextNode(currentNode, ZERO_WIDTH_SPACE);\n currentNode.appendChild(newNode);\n\n var resetter = document.createElementNS(xmlnsNamespaces.svg, 'tspan');\n addTextNode(resetter, ZERO_WIDTH_SPACE);\n d3.select(resetter).attr('dy', RESET_DY[type]);\n nodeAttrs.dy = SHIFT_DY[type];\n\n currentNode.appendChild(newNode);\n currentNode.appendChild(resetter);\n }\n else {\n currentNode.appendChild(newNode);\n }\n\n d3.select(newNode).attr(nodeAttrs);\n\n currentNode = nodeSpec.node = newNode;\n nodeStack.push(nodeSpec);\n }\n\n function addTextNode(node, text) {\n node.appendChild(document.createTextNode(text));\n }\n\n function exitNode(type) {\n // A bare closing tag can't close the root node. If we encounter this it\n // means there's an extra closing tag that can just be ignored:\n if(nodeStack.length === 1) {\n Lib.log('Ignoring unexpected end tag .', str);\n return;\n }\n\n var innerNode = nodeStack.pop();\n\n if(type !== innerNode.type) {\n Lib.log('Start tag <' + innerNode.type + '> doesnt match end tag <' +\n type + '>. Pretending it did match.', str);\n }\n currentNode = nodeStack[nodeStack.length - 1].node;\n }\n\n var hasLines = BR_TAG.test(str);\n\n if(hasLines) newLine();\n else {\n currentNode = containerNode;\n nodeStack = [{node: containerNode}];\n }\n\n var parts = str.split(SPLIT_TAGS);\n for(var i = 0; i < parts.length; i++) {\n var parti = parts[i];\n var match = parti.match(ONE_TAG);\n var tagType = match && match[2].toLowerCase();\n var tagStyle = TAG_STYLES[tagType];\n\n if(tagType === 'br') {\n newLine();\n }\n else if(tagStyle === undefined) {\n addTextNode(currentNode, parti);\n }\n else {\n // tag - open or close\n if(match[1]) {\n exitNode(tagType);\n }\n else {\n var extra = match[4];\n\n var nodeSpec = {type: tagType};\n\n // now add style, from both the tag name and any extra css\n // Most of the svg css that users will care about is just like html,\n // but font color is different (uses fill). Let our users ignore this.\n var css = getQuotedMatch(extra, STYLEMATCH);\n if(css) {\n css = css.replace(COLORMATCH, '$1 fill:');\n if(tagStyle) css += ';' + tagStyle;\n }\n else if(tagStyle) css = tagStyle;\n\n if(css) nodeSpec.style = css;\n\n if(tagType === 'a') {\n hasLink = true;\n\n var href = getQuotedMatch(extra, HREFMATCH);\n\n if(href) {\n // check safe protocols\n var dummyAnchor = document.createElement('a');\n dummyAnchor.href = href;\n if(PROTOCOLS.indexOf(dummyAnchor.protocol) !== -1) {\n nodeSpec.href = encodeURI(href);\n nodeSpec.target = getQuotedMatch(extra, TARGETMATCH) || '_blank';\n nodeSpec.popup = getQuotedMatch(extra, POPUPMATCH);\n }\n }\n }\n\n enterNode(nodeSpec);\n }\n }\n }\n\n return hasLink;\n}\n\nexports.lineCount = function lineCount(s) {\n return s.selectAll('tspan.line').size() || 1;\n};\n\nexports.positionText = function positionText(s, x, y) {\n return s.each(function() {\n var text = d3.select(this);\n\n function setOrGet(attr, val) {\n if(val === undefined) {\n val = text.attr(attr);\n if(val === null) {\n text.attr(attr, 0);\n val = 0;\n }\n }\n else text.attr(attr, val);\n return val;\n }\n\n var thisX = setOrGet('x', x);\n var thisY = setOrGet('y', y);\n\n if(this.nodeName === 'text') {\n text.selectAll('tspan.line').attr({x: thisX, y: thisY});\n }\n });\n};\n\nfunction alignHTMLWith(_base, container, options) {\n var alignH = options.horizontalAlign,\n alignV = options.verticalAlign || 'top',\n bRect = _base.node().getBoundingClientRect(),\n cRect = container.node().getBoundingClientRect(),\n thisRect,\n getTop,\n getLeft;\n\n if(alignV === 'bottom') {\n getTop = function() { return bRect.bottom - thisRect.height; };\n } else if(alignV === 'middle') {\n getTop = function() { return bRect.top + (bRect.height - thisRect.height) / 2; };\n } else { // default: top\n getTop = function() { return bRect.top; };\n }\n\n if(alignH === 'right') {\n getLeft = function() { return bRect.right - thisRect.width; };\n } else if(alignH === 'center') {\n getLeft = function() { return bRect.left + (bRect.width - thisRect.width) / 2; };\n } else { // default: left\n getLeft = function() { return bRect.left; };\n }\n\n return function() {\n thisRect = this.node().getBoundingClientRect();\n this.style({\n top: (getTop() - cRect.top) + 'px',\n left: (getLeft() - cRect.left) + 'px',\n 'z-index': 1000\n });\n return this;\n };\n}\n\n/*\n * Editable title\n * @param {d3.selection} context: the element being edited. Normally text,\n * but if it isn't, you should provide the styling options\n * @param {object} options:\n * @param {div} options.gd: graphDiv\n * @param {d3.selection} options.delegate: item to bind events to if not this\n * @param {boolean} options.immediate: start editing now (true) or on click (false, default)\n * @param {string} options.fill: font color if not as shown\n * @param {string} options.background: background color if not as shown\n * @param {string} options.text: initial text, if not as shown\n * @param {string} options.horizontalAlign: alignment of the edit box wrt. the bound element\n * @param {string} options.verticalAlign: alignment of the edit box wrt. the bound element\n */\n\nexports.makeEditable = function(context, options) {\n var gd = options.gd;\n var _delegate = options.delegate;\n var dispatch = d3.dispatch('edit', 'input', 'cancel');\n var handlerElement = _delegate || context;\n\n context.style({'pointer-events': _delegate ? 'none' : 'all'});\n\n if(context.size() !== 1) throw new Error('boo');\n\n function handleClick() {\n appendEditable();\n context.style({opacity: 0});\n // also hide any mathjax svg\n var svgClass = handlerElement.attr('class'),\n mathjaxClass;\n if(svgClass) mathjaxClass = '.' + svgClass.split(' ')[0] + '-math-group';\n else mathjaxClass = '[class*=-math-group]';\n if(mathjaxClass) {\n d3.select(context.node().parentNode).select(mathjaxClass).style({opacity: 0});\n }\n }\n\n function selectElementContents(_el) {\n var el = _el.node();\n var range = document.createRange();\n range.selectNodeContents(el);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n el.focus();\n }\n\n function appendEditable() {\n var plotDiv = d3.select(gd);\n var container = plotDiv.select('.svg-container');\n var div = container.append('div');\n var cStyle = context.node().style;\n var fontSize = parseFloat(cStyle.fontSize || 12);\n\n div.classed('plugin-editable editable', true)\n .style({\n position: 'absolute',\n 'font-family': cStyle.fontFamily || 'Arial',\n 'font-size': fontSize,\n color: options.fill || cStyle.fill || 'black',\n opacity: 1,\n 'background-color': options.background || 'transparent',\n outline: '#ffffff33 1px solid',\n margin: [-fontSize / 8 + 1, 0, 0, -1].join('px ') + 'px',\n padding: '0',\n 'box-sizing': 'border-box'\n })\n .attr({contenteditable: true})\n .text(options.text || context.attr('data-unformatted'))\n .call(alignHTMLWith(context, container, options))\n .on('blur', function() {\n gd._editing = false;\n context.text(this.textContent)\n .style({opacity: 1});\n var svgClass = d3.select(this).attr('class'),\n mathjaxClass;\n if(svgClass) mathjaxClass = '.' + svgClass.split(' ')[0] + '-math-group';\n else mathjaxClass = '[class*=-math-group]';\n if(mathjaxClass) {\n d3.select(context.node().parentNode).select(mathjaxClass).style({opacity: 0});\n }\n var text = this.textContent;\n d3.select(this).transition().duration(0).remove();\n d3.select(document).on('mouseup', null);\n dispatch.edit.call(context, text);\n })\n .on('focus', function() {\n var editDiv = this;\n gd._editing = true;\n d3.select(document).on('mouseup', function() {\n if(d3.event.target === editDiv) return false;\n if(document.activeElement === div.node()) div.node().blur();\n });\n })\n .on('keyup', function() {\n if(d3.event.which === 27) {\n gd._editing = false;\n context.style({opacity: 1});\n d3.select(this)\n .style({opacity: 0})\n .on('blur', function() { return false; })\n .transition().remove();\n dispatch.cancel.call(context, this.textContent);\n }\n else {\n dispatch.input.call(context, this.textContent);\n d3.select(this).call(alignHTMLWith(context, container, options));\n }\n })\n .on('keydown', function() {\n if(d3.event.which === 13) this.blur();\n })\n .call(selectElementContents);\n }\n\n if(options.immediate) handleClick();\n else handlerElement.on('click', handleClick);\n\n return d3.rebind(context, dispatch, 'on');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/svg_text_utils.js\n// module id = 23\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// fraction of some size to get to a named position\nmodule.exports = {\n // from bottom left: this is the origin of our paper-reference\n // positioning system\n FROM_BL: {\n left: 0,\n center: 0.5,\n right: 1,\n bottom: 0,\n middle: 0.5,\n top: 1\n },\n // from top left: this is the screen pixel positioning origin\n FROM_TL: {\n left: 0,\n center: 0.5,\n right: 1,\n bottom: 1,\n middle: 0.5,\n top: 0\n },\n // multiple of fontSize to get the vertical offset between lines\n LINE_SPACING: 1.3,\n\n // multiple of fontSize to shift from the baseline to the midline\n // (to use when we don't calculate this shift from Drawing.bBox)\n // To be precise this should be half the cap height (capital letter)\n // of the font, and according to wikipedia:\n // an \"average\" font might have a cap height of 70% of the em\n // https://en.wikipedia.org/wiki/Em_(typography)#History\n MID_SHIFT: 0.35\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/constants/alignment.js\n// module id = 26\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\nmodule.exports = {\n hasLines: function(trace) {\n return trace.visible && trace.mode &&\n trace.mode.indexOf('lines') !== -1;\n },\n\n hasMarkers: function(trace) {\n return trace.visible && trace.mode &&\n trace.mode.indexOf('markers') !== -1;\n },\n\n hasText: function(trace) {\n return trace.visible && trace.mode &&\n trace.mode.indexOf('text') !== -1;\n },\n\n isBubble: function(trace) {\n return Lib.isPlainObject(trace.marker) &&\n Array.isArray(trace.marker.size);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/subtypes.js\n// module id = 27\n// module chunks = 0","// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n color = (color) ? color : '';\n opts = opts || { };\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n this._originalInput = color,\n this._r = rgb.r,\n this._g = rgb.g,\n this._b = rgb.b,\n this._a = rgb.a,\n this._roundA = mathRound(100*this._a) / 100,\n this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) { this._r = mathRound(this._r); }\n if (this._g < 1) { this._g = mathRound(this._g); }\n if (this._b < 1) { this._b = mathRound(this._b); }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r/255;\n GsRGB = rgb.g/255;\n BsRGB = rgb.b/255;\n\n if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100*this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n return (this._a == 1) ?\n \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" :\n \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n return (this._a == 1) ?\n \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" :\n \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function(allow4Char) {\n return '#' + this.toHex8(allow4Char);\n },\n toRgb: function() {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function() {\n return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n },\n toPercentageRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function() {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function() {\n return tinycolor(this.toString());\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n }\n else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// \n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// \n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if(max == min) {\n h = s = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if(s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if(max == min) {\n h = 0; // achromatic\n }\n else {\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) { return false; }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// \n\nfunction desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// \n\nfunction complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\n\nfunction triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n ];\n}\n\nfunction analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\n\nfunction monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h, s = hsv.s, v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v}));\n v = (v + modification) % 1;\n }\n\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n amount = (amount === 0) ? 0 : (amount || 50);\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n\n var rgba = {\n r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n };\n\n return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n\n out = false;\n\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size ;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors ;\n level = args.level;\n size = args.size;\n\n for (var i= 0; i < colorList.length ; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n\n if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n return bestColor;\n }\n else {\n args.includeFallbackColors=false;\n return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n }\n};\n\n\n// Big List of Colors\n// ------------------\n// \nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = { };\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) { n = \"100%\"; }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if ((Math.abs(n - max) < 0.000001)) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// \nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n // \n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // \n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if ((match = matchers.hex4.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n a: convertHexToDecimal(match[4] + '' + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n\n return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (typeof define === 'function' && define.amd) {\n define(function () {return tinycolor;});\n}\n// Browser: Expose to window\nelse {\n window.tinycolor = tinycolor;\n}\n\n})(Math);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/tinycolor2/tinycolor.js\n// module id = 31\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = require('../../registry');\nvar Plots = require('../plots');\nvar Lib = require('../../lib');\n\nvar constants = require('./constants');\n\n\n// convert between axis names (xaxis, xaxis2, etc, elements of gd.layout)\n// and axis id's (x, x2, etc). Would probably have ditched 'xaxis'\n// completely in favor of just 'x' if it weren't ingrained in the API etc.\nexports.id2name = function id2name(id) {\n if(typeof id !== 'string' || !id.match(constants.AX_ID_PATTERN)) return;\n var axNum = id.substr(1);\n if(axNum === '1') axNum = '';\n return id.charAt(0) + 'axis' + axNum;\n};\n\nexports.name2id = function name2id(name) {\n if(!name.match(constants.AX_NAME_PATTERN)) return;\n var axNum = name.substr(5);\n if(axNum === '1') axNum = '';\n return name.charAt(0) + axNum;\n};\n\nexports.cleanId = function cleanId(id, axLetter) {\n if(!id.match(constants.AX_ID_PATTERN)) return;\n if(axLetter && id.charAt(0) !== axLetter) return;\n\n var axNum = id.substr(1).replace(/^0+/, '');\n if(axNum === '1') axNum = '';\n return id.charAt(0) + axNum;\n};\n\n// get all axis object names\n// optionally restricted to only x or y or z by string axLetter\n// and optionally 2D axes only, not those inside 3D scenes\nfunction listNames(gd, axLetter, only2d) {\n var fullLayout = gd._fullLayout;\n if(!fullLayout) return [];\n\n function filterAxis(obj, extra) {\n var keys = Object.keys(obj),\n axMatch = /^[xyz]axis[0-9]*/,\n out = [];\n\n for(var i = 0; i < keys.length; i++) {\n var k = keys[i];\n if(axLetter && k.charAt(0) !== axLetter) continue;\n if(axMatch.test(k)) out.push(extra + k);\n }\n\n return out.sort();\n }\n\n var names = filterAxis(fullLayout, '');\n if(only2d) return names;\n\n var sceneIds3D = Plots.getSubplotIds(fullLayout, 'gl3d') || [];\n for(var i = 0; i < sceneIds3D.length; i++) {\n var sceneId = sceneIds3D[i];\n names = names.concat(\n filterAxis(fullLayout[sceneId], sceneId + '.')\n );\n }\n\n return names;\n}\n\n// get all axis objects, as restricted in listNames\nexports.list = function(gd, axletter, only2d) {\n return listNames(gd, axletter, only2d)\n .map(function(axName) {\n return Lib.nestedProperty(gd._fullLayout, axName).get();\n });\n};\n\n// get all axis ids, optionally restricted by letter\n// this only makes sense for 2d axes\nexports.listIds = function(gd, axletter) {\n return listNames(gd, axletter, true).map(exports.name2id);\n};\n\n// get an axis object from its id 'x','x2' etc\n// optionally, id can be a subplot (ie 'x2y3') and type gets x or y from it\nexports.getFromId = function(gd, id, type) {\n var fullLayout = gd._fullLayout;\n\n if(type === 'x') id = id.replace(/y[0-9]*/, '');\n else if(type === 'y') id = id.replace(/x[0-9]*/, '');\n\n return fullLayout[exports.id2name(id)];\n};\n\n// get an axis object of specified type from the containing trace\nexports.getFromTrace = function(gd, fullTrace, type) {\n var fullLayout = gd._fullLayout;\n var ax = null;\n\n if(Registry.traceIs(fullTrace, 'gl3d')) {\n var scene = fullTrace.scene;\n if(scene.substr(0, 5) === 'scene') {\n ax = fullLayout[scene][type + 'axis'];\n }\n }\n else {\n ax = exports.getFromId(gd, fullTrace[type + 'axis'] || type);\n }\n\n return ax;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/axis_ids.js\n// module id = 35\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\n// IMPORTANT - default colors should be in hex for compatibility\nexports.defaults = [\n '#1f77b4', // muted blue\n '#ff7f0e', // safety orange\n '#2ca02c', // cooked asparagus green\n '#d62728', // brick red\n '#9467bd', // muted purple\n '#8c564b', // chestnut brown\n '#e377c2', // raspberry yogurt pink\n '#7f7f7f', // middle gray\n '#bcbd22', // curry yellow-green\n '#17becf' // blue-teal\n];\n\nexports.defaultLine = '#444';\n\nexports.lightLine = '#eee';\n\nexports.background = '#fff';\n\nexports.borderLine = '#BEC8D9';\n\n// with axis.color and Color.interp we aren't using lightLine\n// itself anymore, instead interpolating between axis.color\n// and the background color using tinycolor.mix. lightFraction\n// gives back exactly lightLine if the other colors are defaults.\nexports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/color/attributes.js\n// module id = 37\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar mouseOffset = require('mouse-event-offset');\nvar hasHover = require('has-hover');\n\nvar Plotly = require('../../plotly');\nvar Lib = require('../../lib');\n\nvar constants = require('../../plots/cartesian/constants');\nvar interactConstants = require('../../constants/interactions');\n\nvar dragElement = module.exports = {};\n\ndragElement.align = require('./align');\ndragElement.getCursor = require('./cursor');\n\nvar unhover = require('./unhover');\ndragElement.unhover = unhover.wrapped;\ndragElement.unhoverRaw = unhover.raw;\n\n/**\n * Abstracts click & drag interactions\n *\n * During the interaction, a \"coverSlip\" element - a transparent\n * div covering the whole page - is created, which has two key effects:\n * - Lets you drag beyond the boundaries of the plot itself without\n * dropping (but if you drag all the way out of the browser window the\n * interaction will end)\n * - Freezes the cursor: whatever mouse cursor the drag element had when the\n * interaction started gets copied to the coverSlip for use until mouseup\n *\n * @param {object} options with keys:\n * element (required) the DOM element to drag\n * prepFn (optional) function(event, startX, startY)\n * executed on mousedown\n * startX and startY are the clientX and clientY pixel position\n * of the mousedown event\n * moveFn (optional) function(dx, dy, dragged)\n * executed on move\n * dx and dy are the net pixel offset of the drag,\n * dragged is true/false, has the mouse moved enough to\n * constitute a drag\n * doneFn (optional) function(dragged, numClicks, e)\n * executed on mouseup, or mouseout of window since\n * we don't get events after that\n * dragged is as in moveFn\n * numClicks is how many clicks we've registered within\n * a doubleclick time\n * e is the original event\n */\ndragElement.init = function init(options) {\n var gd = options.gd;\n var numClicks = 1;\n var DBLCLICKDELAY = interactConstants.DBLCLICKDELAY;\n var element = options.element;\n\n var startX,\n startY,\n newMouseDownTime,\n cursor,\n dragCover,\n initialTarget;\n\n if(!gd._mouseDownTime) gd._mouseDownTime = 0;\n\n element.style.pointerEvents = 'all';\n\n element.onmousedown = onStart;\n element.ontouchstart = onStart;\n\n function onStart(e) {\n if(e.buttons && e.buttons === 2) { // right click\n return;\n }\n\n // make dragging and dragged into properties of gd\n // so that others can look at and modify them\n gd._dragged = false;\n gd._dragging = true;\n var offset = pointerOffset(e);\n startX = offset[0];\n startY = offset[1];\n initialTarget = e.target;\n\n newMouseDownTime = (new Date()).getTime();\n if(newMouseDownTime - gd._mouseDownTime < DBLCLICKDELAY) {\n // in a click train\n numClicks += 1;\n }\n else {\n // new click train\n numClicks = 1;\n gd._mouseDownTime = newMouseDownTime;\n }\n\n if(options.prepFn) options.prepFn(e, startX, startY);\n\n if(hasHover) {\n dragCover = coverSlip();\n dragCover.style.cursor = window.getComputedStyle(element).cursor;\n }\n else {\n // document acts as a dragcover for mobile, bc we can't create dragcover dynamically\n dragCover = document;\n cursor = window.getComputedStyle(document.documentElement).cursor;\n document.documentElement.style.cursor = window.getComputedStyle(element).cursor;\n }\n\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onDone);\n document.addEventListener('touchmove', onMove);\n document.addEventListener('touchend', onDone);\n\n return Lib.pauseEvent(e);\n }\n\n function onMove(e) {\n var offset = pointerOffset(e);\n var dx = offset[0] - startX;\n var dy = offset[1] - startY;\n var minDrag = options.minDrag || constants.MINDRAG;\n\n if(Math.abs(dx) < minDrag) dx = 0;\n if(Math.abs(dy) < minDrag) dy = 0;\n if(dx || dy) {\n gd._dragged = true;\n dragElement.unhover(gd);\n }\n\n if(options.moveFn) options.moveFn(dx, dy, gd._dragged);\n\n return Lib.pauseEvent(e);\n }\n\n function onDone(e) {\n document.removeEventListener('mousemove', onMove);\n document.removeEventListener('mouseup', onDone);\n document.removeEventListener('touchmove', onMove);\n document.removeEventListener('touchend', onDone);\n\n if(hasHover) {\n Lib.removeElement(dragCover);\n }\n else if(cursor) {\n dragCover.documentElement.style.cursor = cursor;\n cursor = null;\n }\n\n if(!gd._dragging) {\n gd._dragged = false;\n return;\n }\n gd._dragging = false;\n\n // don't count as a dblClick unless the mouseUp is also within\n // the dblclick delay\n if((new Date()).getTime() - gd._mouseDownTime > DBLCLICKDELAY) {\n numClicks = Math.max(numClicks - 1, 1);\n }\n\n if(options.doneFn) options.doneFn(gd._dragged, numClicks, e);\n\n if(!gd._dragged) {\n var e2;\n\n try {\n e2 = new MouseEvent('click', e);\n }\n catch(err) {\n var offset = pointerOffset(e);\n e2 = document.createEvent('MouseEvents');\n e2.initMouseEvent('click',\n e.bubbles, e.cancelable,\n e.view, e.detail,\n e.screenX, e.screenY,\n offset[0], offset[1],\n e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,\n e.button, e.relatedTarget);\n }\n\n initialTarget.dispatchEvent(e2);\n }\n\n finishDrag(gd);\n\n gd._dragged = false;\n\n return Lib.pauseEvent(e);\n }\n};\n\nfunction coverSlip() {\n var cover = document.createElement('div');\n\n cover.className = 'dragcover';\n var cStyle = cover.style;\n cStyle.position = 'fixed';\n cStyle.left = 0;\n cStyle.right = 0;\n cStyle.top = 0;\n cStyle.bottom = 0;\n cStyle.zIndex = 999999999;\n cStyle.background = 'none';\n\n document.body.appendChild(cover);\n\n return cover;\n}\n\ndragElement.coverSlip = coverSlip;\n\nfunction finishDrag(gd) {\n gd._dragging = false;\n if(gd._replotPending) Plotly.plot(gd);\n}\n\nfunction pointerOffset(e) {\n return mouseOffset(\n e.changedTouches ? e.changedTouches[0] : e,\n document.body\n );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/dragelement/index.js\n// module id = 38\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = require('../font_attributes');\nvar colorAttrs = require('../../components/color/attributes');\nvar dash = require('../../components/drawing/attributes').dash;\nvar extendFlat = require('../../lib/extend').extendFlat;\n\nvar constants = require('./constants');\n\n\nmodule.exports = {\n visible: {\n valType: 'boolean',\n \n editType: 'plot',\n \n },\n color: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'ticks',\n \n },\n title: {\n valType: 'string',\n \n editType: 'ticks',\n \n },\n titlefont: fontAttrs({\n editType: 'ticks',\n \n }),\n type: {\n valType: 'enumerated',\n // '-' means we haven't yet run autotype or couldn't find any data\n // it gets turned into linear in gd._fullLayout but not copied back\n // to gd.data like the others are.\n values: ['-', 'linear', 'log', 'date', 'category'],\n dflt: '-',\n \n editType: 'calc',\n \n },\n autorange: {\n valType: 'enumerated',\n values: [true, false, 'reversed'],\n dflt: true,\n \n editType: 'calc',\n impliedEdits: {'range[0]': undefined, 'range[1]': undefined},\n \n },\n rangemode: {\n valType: 'enumerated',\n values: ['normal', 'tozero', 'nonnegative'],\n dflt: 'normal',\n \n editType: 'calc',\n \n },\n range: {\n valType: 'info_array',\n \n items: [\n {valType: 'any', editType: 'plot', impliedEdits: {'^autorange': false}},\n {valType: 'any', editType: 'plot', impliedEdits: {'^autorange': false}}\n ],\n editType: 'plot',\n impliedEdits: {'autorange': false},\n \n },\n fixedrange: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n // scaleanchor: not used directly, just put here for reference\n // values are any opposite-letter axis id\n scaleanchor: {\n valType: 'enumerated',\n values: [\n constants.idRegex.x.toString(),\n constants.idRegex.y.toString()\n ],\n \n editType: 'calc',\n \n },\n scaleratio: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'calc',\n \n },\n constrain: {\n valType: 'enumerated',\n values: ['range', 'domain'],\n dflt: 'range',\n \n editType: 'calc',\n \n },\n // constraintoward: not used directly, just put here for reference\n constraintoward: {\n valType: 'enumerated',\n values: ['left', 'center', 'right', 'top', 'middle', 'bottom'],\n \n editType: 'calc',\n \n },\n // ticks\n tickmode: {\n valType: 'enumerated',\n values: ['auto', 'linear', 'array'],\n \n editType: 'ticks',\n impliedEdits: {tick0: undefined, dtick: undefined},\n \n },\n nticks: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'ticks',\n \n },\n tick0: {\n valType: 'any',\n \n editType: 'ticks',\n impliedEdits: {tickmode: 'linear'},\n \n },\n dtick: {\n valType: 'any',\n \n editType: 'ticks',\n impliedEdits: {tickmode: 'linear'},\n \n },\n tickvals: {\n valType: 'data_array',\n editType: 'ticks',\n \n },\n ticktext: {\n valType: 'data_array',\n editType: 'ticks',\n \n },\n ticks: {\n valType: 'enumerated',\n values: ['outside', 'inside', ''],\n \n editType: 'ticks',\n \n },\n mirror: {\n valType: 'enumerated',\n values: [true, 'ticks', false, 'all', 'allticks'],\n dflt: false,\n \n editType: 'ticks+layoutstyle',\n \n },\n ticklen: {\n valType: 'number',\n min: 0,\n dflt: 5,\n \n editType: 'ticks',\n \n },\n tickwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'ticks',\n \n },\n tickcolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'ticks',\n \n },\n showticklabels: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'ticks',\n \n },\n showspikes: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'modebar',\n \n },\n spikecolor: {\n valType: 'color',\n dflt: null,\n \n editType: 'none',\n \n },\n spikethickness: {\n valType: 'number',\n dflt: 3,\n \n editType: 'none',\n \n },\n spikedash: extendFlat({}, dash, {dflt: 'dash', editType: 'none'}),\n spikemode: {\n valType: 'flaglist',\n flags: ['toaxis', 'across', 'marker'],\n \n dflt: 'toaxis',\n editType: 'none',\n \n },\n tickfont: fontAttrs({\n editType: 'ticks',\n \n }),\n tickangle: {\n valType: 'angle',\n dflt: 'auto',\n \n editType: 'ticks',\n \n },\n tickprefix: {\n valType: 'string',\n dflt: '',\n \n editType: 'ticks',\n \n },\n showtickprefix: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'ticks',\n \n },\n ticksuffix: {\n valType: 'string',\n dflt: '',\n \n editType: 'ticks',\n \n },\n showticksuffix: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'ticks',\n \n },\n showexponent: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'ticks',\n \n },\n exponentformat: {\n valType: 'enumerated',\n values: ['none', 'e', 'E', 'power', 'SI', 'B'],\n dflt: 'B',\n \n editType: 'ticks',\n \n },\n separatethousands: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'ticks',\n \n },\n tickformat: {\n valType: 'string',\n dflt: '',\n \n editType: 'ticks',\n \n },\n hoverformat: {\n valType: 'string',\n dflt: '',\n \n editType: 'none',\n \n },\n // lines and grids\n showline: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'layoutstyle',\n \n },\n linecolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'layoutstyle',\n \n },\n linewidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'ticks+layoutstyle',\n \n },\n showgrid: {\n valType: 'boolean',\n \n editType: 'ticks',\n \n },\n gridcolor: {\n valType: 'color',\n dflt: colorAttrs.lightLine,\n \n editType: 'ticks',\n \n },\n gridwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'ticks',\n \n },\n zeroline: {\n valType: 'boolean',\n \n editType: 'ticks',\n \n },\n zerolinecolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'ticks',\n \n },\n zerolinewidth: {\n valType: 'number',\n dflt: 1,\n \n editType: 'ticks',\n \n },\n // positioning attributes\n // anchor: not used directly, just put here for reference\n // values are any opposite-letter axis id\n anchor: {\n valType: 'enumerated',\n values: [\n 'free',\n constants.idRegex.x.toString(),\n constants.idRegex.y.toString()\n ],\n \n editType: 'plot',\n \n },\n // side: not used directly, as values depend on direction\n // values are top, bottom for x axes, and left, right for y\n side: {\n valType: 'enumerated',\n values: ['top', 'bottom', 'left', 'right'],\n \n editType: 'plot',\n \n },\n // overlaying: not used directly, just put here for reference\n // values are false and any other same-letter axis id that's not\n // itself overlaying anything\n overlaying: {\n valType: 'enumerated',\n values: [\n 'free',\n constants.idRegex.x.toString(),\n constants.idRegex.y.toString()\n ],\n \n editType: 'calc',\n \n },\n layer: {\n valType: 'enumerated',\n values: ['above traces', 'below traces'],\n dflt: 'above traces',\n \n editType: 'plot',\n \n },\n domain: {\n valType: 'info_array',\n \n items: [\n {valType: 'number', min: 0, max: 1, editType: 'calc'},\n {valType: 'number', min: 0, max: 1, editType: 'calc'}\n ],\n dflt: [0, 1],\n editType: 'calc',\n \n },\n position: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n \n editType: 'plot',\n \n },\n categoryorder: {\n valType: 'enumerated',\n values: [\n 'trace', 'category ascending', 'category descending', 'array'\n /* , 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later\n ],\n dflt: 'trace',\n \n editType: 'calc',\n \n },\n categoryarray: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n editType: 'calc',\n\n _deprecated: {\n autotick: {\n valType: 'boolean',\n \n editType: 'ticks',\n \n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/layout_attributes.js\n// module id = 40\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar errorBars = module.exports = {};\n\nerrorBars.attributes = require('./attributes');\n\nerrorBars.supplyDefaults = require('./defaults');\n\nerrorBars.calc = require('./calc');\n\nerrorBars.calcFromTrace = function(trace, layout) {\n var x = trace.x || [],\n y = trace.y || [],\n len = x.length || y.length;\n\n var calcdataMock = new Array(len);\n\n for(var i = 0; i < len; i++) {\n calcdataMock[i] = {\n x: x[i],\n y: y[i]\n };\n }\n\n calcdataMock[0].trace = trace;\n\n errorBars.calc({\n calcdata: [calcdataMock],\n _fullLayout: layout\n });\n\n return calcdataMock;\n};\n\nerrorBars.plot = require('./plot');\n\nerrorBars.style = require('./style');\n\nerrorBars.hoverInfo = function(calcPoint, trace, hoverPoint) {\n if((trace.error_y || {}).visible) {\n hoverPoint.yerr = calcPoint.yh - calcPoint.y;\n if(!trace.error_y.symmetric) hoverPoint.yerrneg = calcPoint.y - calcPoint.ys;\n }\n if((trace.error_x || {}).visible) {\n hoverPoint.xerr = calcPoint.xh - calcPoint.x;\n if(!trace.error_x.symmetric) hoverPoint.xerrneg = calcPoint.x - calcPoint.xs;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/errorbars/index.js\n// module id = 41\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n// WEBPACK FOOTER //\n// ./external_modules/helpers/helper.less","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n 'Greys': [\n [0, 'rgb(0,0,0)'], [1, 'rgb(255,255,255)']\n ],\n\n 'YlGnBu': [\n [0, 'rgb(8,29,88)'], [0.125, 'rgb(37,52,148)'],\n [0.25, 'rgb(34,94,168)'], [0.375, 'rgb(29,145,192)'],\n [0.5, 'rgb(65,182,196)'], [0.625, 'rgb(127,205,187)'],\n [0.75, 'rgb(199,233,180)'], [0.875, 'rgb(237,248,217)'],\n [1, 'rgb(255,255,217)']\n ],\n\n 'Greens': [\n [0, 'rgb(0,68,27)'], [0.125, 'rgb(0,109,44)'],\n [0.25, 'rgb(35,139,69)'], [0.375, 'rgb(65,171,93)'],\n [0.5, 'rgb(116,196,118)'], [0.625, 'rgb(161,217,155)'],\n [0.75, 'rgb(199,233,192)'], [0.875, 'rgb(229,245,224)'],\n [1, 'rgb(247,252,245)']\n ],\n\n 'YlOrRd': [\n [0, 'rgb(128,0,38)'], [0.125, 'rgb(189,0,38)'],\n [0.25, 'rgb(227,26,28)'], [0.375, 'rgb(252,78,42)'],\n [0.5, 'rgb(253,141,60)'], [0.625, 'rgb(254,178,76)'],\n [0.75, 'rgb(254,217,118)'], [0.875, 'rgb(255,237,160)'],\n [1, 'rgb(255,255,204)']\n ],\n\n 'Bluered': [\n [0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']\n ],\n\n // modified RdBu based on\n // www.sandia.gov/~kmorel/documents/ColorMaps/ColorMapsExpanded.pdf\n 'RdBu': [\n [0, 'rgb(5,10,172)'], [0.35, 'rgb(106,137,247)'],\n [0.5, 'rgb(190,190,190)'], [0.6, 'rgb(220,170,132)'],\n [0.7, 'rgb(230,145,90)'], [1, 'rgb(178,10,28)']\n ],\n\n // Scale for non-negative numeric values\n 'Reds': [\n [0, 'rgb(220,220,220)'], [0.2, 'rgb(245,195,157)'],\n [0.4, 'rgb(245,160,105)'], [1, 'rgb(178,10,28)']\n ],\n\n // Scale for non-positive numeric values\n 'Blues': [\n [0, 'rgb(5,10,172)'], [0.35, 'rgb(40,60,190)'],\n [0.5, 'rgb(70,100,245)'], [0.6, 'rgb(90,120,245)'],\n [0.7, 'rgb(106,137,247)'], [1, 'rgb(220,220,220)']\n ],\n\n 'Picnic': [\n [0, 'rgb(0,0,255)'], [0.1, 'rgb(51,153,255)'],\n [0.2, 'rgb(102,204,255)'], [0.3, 'rgb(153,204,255)'],\n [0.4, 'rgb(204,204,255)'], [0.5, 'rgb(255,255,255)'],\n [0.6, 'rgb(255,204,255)'], [0.7, 'rgb(255,153,255)'],\n [0.8, 'rgb(255,102,204)'], [0.9, 'rgb(255,102,102)'],\n [1, 'rgb(255,0,0)']\n ],\n\n 'Rainbow': [\n [0, 'rgb(150,0,90)'], [0.125, 'rgb(0,0,200)'],\n [0.25, 'rgb(0,25,255)'], [0.375, 'rgb(0,152,255)'],\n [0.5, 'rgb(44,255,150)'], [0.625, 'rgb(151,255,0)'],\n [0.75, 'rgb(255,234,0)'], [0.875, 'rgb(255,111,0)'],\n [1, 'rgb(255,0,0)']\n ],\n\n 'Portland': [\n [0, 'rgb(12,51,131)'], [0.25, 'rgb(10,136,186)'],\n [0.5, 'rgb(242,211,56)'], [0.75, 'rgb(242,143,56)'],\n [1, 'rgb(217,30,30)']\n ],\n\n 'Jet': [\n [0, 'rgb(0,0,131)'], [0.125, 'rgb(0,60,170)'],\n [0.375, 'rgb(5,255,255)'], [0.625, 'rgb(255,255,0)'],\n [0.875, 'rgb(250,0,0)'], [1, 'rgb(128,0,0)']\n ],\n\n 'Hot': [\n [0, 'rgb(0,0,0)'], [0.3, 'rgb(230,0,0)'],\n [0.6, 'rgb(255,210,0)'], [1, 'rgb(255,255,255)']\n ],\n\n 'Blackbody': [\n [0, 'rgb(0,0,0)'], [0.2, 'rgb(230,0,0)'],\n [0.4, 'rgb(230,210,0)'], [0.7, 'rgb(255,255,255)'],\n [1, 'rgb(160,200,255)']\n ],\n\n 'Earth': [\n [0, 'rgb(0,0,130)'], [0.1, 'rgb(0,180,180)'],\n [0.2, 'rgb(40,210,40)'], [0.4, 'rgb(230,230,50)'],\n [0.6, 'rgb(120,70,20)'], [1, 'rgb(255,255,255)']\n ],\n\n 'Electric': [\n [0, 'rgb(0,0,0)'], [0.15, 'rgb(30,0,100)'],\n [0.4, 'rgb(120,0,100)'], [0.6, 'rgb(160,90,0)'],\n [0.8, 'rgb(230,200,0)'], [1, 'rgb(255,250,220)']\n ],\n\n 'Viridis': [\n [0, '#440154'], [0.06274509803921569, '#48186a'],\n [0.12549019607843137, '#472d7b'], [0.18823529411764706, '#424086'],\n [0.25098039215686274, '#3b528b'], [0.3137254901960784, '#33638d'],\n [0.3764705882352941, '#2c728e'], [0.4392156862745098, '#26828e'],\n [0.5019607843137255, '#21918c'], [0.5647058823529412, '#1fa088'],\n [0.6274509803921569, '#28ae80'], [0.6901960784313725, '#3fbc73'],\n [0.7529411764705882, '#5ec962'], [0.8156862745098039, '#84d44b'],\n [0.8784313725490196, '#addc30'], [0.9411764705882353, '#d8e219'],\n [1, '#fde725']\n ]\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/scales.js\n// module id = 50\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../lib');\nvar extendFlat = Lib.extendFlat;\nvar isPlainObject = Lib.isPlainObject;\n\nvar traceOpts = {\n valType: 'flaglist',\n extras: ['none'],\n flags: ['calc', 'calcIfAutorange', 'clearAxisTypes', 'plot', 'style', 'colorbars'],\n \n};\n\nvar layoutOpts = {\n valType: 'flaglist',\n extras: ['none'],\n flags: [\n 'calc', 'calcIfAutorange', 'plot', 'legend', 'ticks',\n 'layoutstyle', 'modebar', 'camera', 'arraydraw'\n ],\n \n};\n\n// flags for inside restyle/relayout include a few extras\n// that shouldn't be used in attributes, to deal with certain\n// combinations and conditionals efficiently\nvar traceEditTypeFlags = traceOpts.flags.slice()\n .concat(['clearCalc', 'fullReplot']);\n\nvar layoutEditTypeFlags = layoutOpts.flags.slice()\n .concat('layoutReplot');\n\nmodule.exports = {\n traces: traceOpts,\n layout: layoutOpts,\n /*\n * default (all false) edit flags for restyle (traces)\n * creates a new object each call, so the caller can mutate freely\n */\n traceFlags: function() { return falseObj(traceEditTypeFlags); },\n\n /*\n * default (all false) edit flags for relayout\n * creates a new object each call, so the caller can mutate freely\n */\n layoutFlags: function() { return falseObj(layoutEditTypeFlags); },\n\n /*\n * update `flags` with the `editType` values found in `attr`\n */\n update: function(flags, attr) {\n var editType = attr.editType;\n if(editType && editType !== 'none') {\n var editTypeParts = editType.split('+');\n for(var i = 0; i < editTypeParts.length; i++) {\n flags[editTypeParts[i]] = true;\n }\n }\n },\n\n overrideAll: overrideAll\n};\n\nfunction falseObj(keys) {\n var out = {};\n for(var i = 0; i < keys.length; i++) out[keys[i]] = false;\n return out;\n}\n\n/**\n * For attributes that are largely copied from elsewhere into a plot type that doesn't\n * support partial redraws - overrides the editType field of all attributes in the object\n *\n * @param {object} attrs: the attributes to override. Will not be mutated.\n * @param {string} editTypeOverride: the new editType to use\n * @param {'nested'|'from-root'} overrideContainers:\n * - 'nested' will override editType for nested containers but not the root.\n * - 'from-root' will also override editType of the root container.\n * Containers below the absolute top level (trace or layout root) DO need an\n * editType even if they are not `valObject`s themselves (eg `scatter.marker`)\n * to handle the case where you edit the whole container.\n *\n * @return {object} a new attributes object with `editType` modified as directed\n */\nfunction overrideAll(attrs, editTypeOverride, overrideContainers) {\n var out = extendFlat({}, attrs);\n for(var key in out) {\n var attr = out[key];\n if(isPlainObject(attr)) {\n out[key] = overrideOne(attr, editTypeOverride, overrideContainers, key);\n }\n }\n if(overrideContainers === 'from-root') out.editType = editTypeOverride;\n\n return out;\n}\n\nfunction overrideOne(attr, editTypeOverride, overrideContainers, key) {\n if(attr.valType) {\n var out = extendFlat({}, attr);\n out.editType = editTypeOverride;\n\n if(Array.isArray(attr.items)) {\n out.items = new Array(attr.items.length);\n for(var i = 0; i < attr.items.length; i++) {\n out.items[i] = overrideOne(attr.items[i], editTypeOverride, 'from-root');\n }\n }\n return out;\n }\n else {\n // don't provide an editType for the _deprecated container\n return overrideAll(attr, editTypeOverride,\n (key.charAt(0) === '_') ? 'nested' : 'from-root');\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/edit_types.js\n// module id = 51\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = require('d3');\nvar Lib = require('../../lib');\nvar dragElement = require('../dragelement');\nvar helpers = require('./helpers');\nvar layoutAttributes = require('./layout_attributes');\n\nmodule.exports = {\n moduleType: 'component',\n name: 'fx',\n\n constants: require('./constants'),\n schema: {\n layout: layoutAttributes\n },\n\n attributes: require('./attributes'),\n layoutAttributes: layoutAttributes,\n\n supplyLayoutGlobalDefaults: require('./layout_global_defaults'),\n supplyDefaults: require('./defaults'),\n supplyLayoutDefaults: require('./layout_defaults'),\n\n calc: require('./calc'),\n\n getDistanceFunction: helpers.getDistanceFunction,\n getClosest: helpers.getClosest,\n inbox: helpers.inbox,\n appendArrayPointValue: helpers.appendArrayPointValue,\n\n castHoverOption: castHoverOption,\n castHoverinfo: castHoverinfo,\n\n hover: require('./hover').hover,\n unhover: dragElement.unhover,\n\n loneHover: require('./hover').loneHover,\n loneUnhover: loneUnhover,\n\n click: require('./click')\n};\n\nfunction loneUnhover(containerOrSelection) {\n // duck type whether the arg is a d3 selection because ie9 doesn't\n // handle instanceof like modern browsers do.\n var selection = Lib.isD3Selection(containerOrSelection) ?\n containerOrSelection :\n d3.select(containerOrSelection);\n\n selection.selectAll('g.hovertext').remove();\n selection.selectAll('.spikeline').remove();\n}\n\n// helpers for traces that use Fx.loneHover\n\nfunction castHoverOption(trace, ptNumber, attr) {\n return Lib.castOption(trace, ptNumber, 'hoverlabel.' + attr);\n}\n\nfunction castHoverinfo(trace, fullLayout, ptNumber) {\n function _coerce(val) {\n return Lib.coerceHoverinfo({hoverinfo: val}, {_module: trace._module}, fullLayout);\n }\n\n return Lib.castOption(trace, ptNumber, 'hoverinfo', _coerce);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/index.js\n// module id = 52\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Lib = require('../../lib');\n\nvar isValidScale = require('./is_valid_scale');\n\n\nmodule.exports = function hasColorscale(trace, containerStr) {\n var container = containerStr ?\n Lib.nestedProperty(trace, containerStr).get() || {} :\n trace,\n color = container.color,\n isArrayWithOneNumber = false;\n\n if(Array.isArray(color)) {\n for(var i = 0; i < color.length; i++) {\n if(isNumeric(color[i])) {\n isArrayWithOneNumber = true;\n break;\n }\n }\n }\n\n return (\n Lib.isPlainObject(container) && (\n isArrayWithOneNumber ||\n container.showscale === true ||\n (isNumeric(container.cmin) && isNumeric(container.cmax)) ||\n isValidScale(container.colorscale) ||\n Lib.isPlainObject(container.colorbar)\n )\n );\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/has_colorscale.js\n// module id = 59\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// works with our CSS cursor classes (see css/_cursor.scss)\n// to apply cursors to d3 single-element selections.\n// omit cursor to revert to the default.\nmodule.exports = function setCursor(el3, csr) {\n (el3.attr('class') || '').split(' ').forEach(function(cls) {\n if(cls.indexOf('cursor-') === 0) el3.classed(cls, false);\n });\n\n if(csr) el3.classed('cursor-' + csr, true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/setcursor.js\n// module id = 61\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../lib');\n\n\n/** Convenience wrapper for making array container logic DRY and consistent\n *\n * @param {object} parentObjIn\n * user input object where the container in question is linked\n * (i.e. either a user trace object or the user layout object)\n *\n * @param {object} parentObjOut\n * full object where the coerced container will be linked\n * (i.e. either a full trace object or the full layout object)\n *\n * @param {object} opts\n * options object:\n * - name {string}\n * name of the key linking the container in question\n * - handleItemDefaults {function}\n * defaults method to be called on each item in the array container in question\n *\n * Its arguments are:\n * - itemIn {object} item in user layout\n * - itemOut {object} item in full layout\n * - parentObj {object} (as in closure)\n * - opts {object} (as in closure)\n * - itemOpts {object}\n * - itemIsNotPlainObject {boolean}\n * N.B.\n *\n * - opts is passed to handleItemDefaults so it can also store\n * links to supplementary data (e.g. fullData for layout components)\n *\n */\nmodule.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut, opts) {\n var name = opts.name;\n\n var previousContOut = parentObjOut[name];\n\n var contIn = Lib.isArray(parentObjIn[name]) ? parentObjIn[name] : [],\n contOut = parentObjOut[name] = [],\n i;\n\n for(i = 0; i < contIn.length; i++) {\n var itemIn = contIn[i],\n itemOut = {},\n itemOpts = {};\n\n if(!Lib.isPlainObject(itemIn)) {\n itemOpts.itemIsNotPlainObject = true;\n itemIn = {};\n }\n\n opts.handleItemDefaults(itemIn, itemOut, parentObjOut, opts, itemOpts);\n\n itemOut._input = itemIn;\n itemOut._index = i;\n\n contOut.push(itemOut);\n }\n\n // in case this array gets its defaults rebuilt independent of the whole layout,\n // relink the private keys just for this array.\n if(Lib.isArray(previousContOut)) {\n var len = Math.min(previousContOut.length, contOut.length);\n for(i = 0; i < len; i++) {\n Lib.relinkPrivateKeys(contOut[i], previousContOut[i]);\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/array_container_defaults.js\n// module id = 62\n// module chunks = 0","import $ from 'jquery';\nimport 'bootstrap';\n\nrequire.resolve('./helper.less');\n\nexport function ensure(dlg, do_show, immediate, hide_func) {\n $(dlg).on('hidden.bs.modal', function(event) {\n var body = $('body');\n\n $(this).removeClass('fv-modal-stack');\n body.data('fv_open_modals', body.data('fv_open_modals') - 1);\n });\n\n $(dlg).on('shown.bs.modal', function(event) {\n var body = $('body');\n\n if (typeof body.data('fv_open_modals') == 'undefined')\n body.data('fv_open_modals', 0);\n\n if ($(this).hasClass('fv-modal-stack')) return;\n\n $(this).addClass('fv-modal-stack');\n body.data('fv_open_modals', body.data('fv_open_modals') + 1);\n $(this).css('z-index', 1040 + 10 * body.data('fv_open_modals'));\n\n $('.modal-backdrop')\n .not('.fv-modal-stack')\n .css('z-index', 1039 + 10 * body.data('fv_open_modals'))\n .addClass('fv-modal-stack');\n });\n\n var delay = immediate ? 0 : 500;\n dlg.data(\n 'timed-dialog',\n setTimeout(function() {\n do_show();\n }, delay)\n );\n dlg.data('multi-hide-function', function() {\n if (hide_func) hide_func();\n else dlg.modal('hide');\n });\n}\n\nexport function end(dlg) {\n clearTimeout(dlg.data('timed-dialog'));\n dlg.data('multi-hide-function')();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./external_modules/helpers/multimodal.js","import $ from 'jquery';\nimport 'bootstrap';\nimport * as multi from 'helpers/multimodal';\n\nrequire.resolve('./helper.less');\n\nlet code = [\n '
',\n '
',\n '
',\n '
',\n '',\n '

Error

',\n '
',\n '
',\n '
',\n '
',\n '',\n '
',\n '
',\n '
',\n '
',\n].join('');\nlet errorDialog = $(code);\n\nexport function show(msg) {\n console.log('Show error dialog with ' + msg);\n $('.modal-body', errorDialog).text(msg);\n multi.ensure(errorDialog, function() {\n errorDialog.modal();\n });\n}\n\nexport function hide() {\n multi.end(errorDialog);\n errorDialog.modal('hide');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./external_modules/helpers/error.js","define(['jquery'], function($) {\n var self = this;\n\n self.queryString = (function(paramsArray) {\n let params = {};\n\n for (let i = 0; i < paramsArray.length; ++i) {\n let param = paramsArray[i].split('=', 2);\n\n if (param.length !== 2) continue;\n\n params[param[0]] = decodeURIComponent(param[1].replace(/\\+/g, ' '));\n }\n\n return params;\n })(window.location.search.substr(1).split('&'));\n\n self.addNewState = function() {\n console.log(self.queryString);\n history.pushState({}, '', '?' + $.param(self.queryString));\n };\n\n return self;\n});\n\n\n\n// WEBPACK FOOTER //\n// ./external_modules/helpers/params.js","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/* eslint-disable no-console */\n\nvar config = require('../plot_api/plot_config');\n\nvar loggers = module.exports = {};\n\n/**\n * ------------------------------------------\n * debugging tools\n * ------------------------------------------\n */\n\nloggers.log = function() {\n if(config.logging > 1) {\n var messages = ['LOG:'];\n\n for(var i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n\n apply(console.trace || console.log, messages);\n }\n};\n\nloggers.warn = function() {\n if(config.logging > 0) {\n var messages = ['WARN:'];\n\n for(var i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n\n apply(console.trace || console.log, messages);\n }\n};\n\nloggers.error = function() {\n if(config.logging > 0) {\n var messages = ['ERROR:'];\n\n for(var i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n\n apply(console.error, messages);\n }\n};\n\n/*\n * Robust apply, for IE9 where console.log doesn't support\n * apply like other functions do\n */\nfunction apply(f, args) {\n if(f.apply) {\n f.apply(f, args);\n }\n else {\n for(var i = 0; i < args.length; i++) {\n f(args[i]);\n }\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/loggers.js\n// module id = 79\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// more info: http://stackoverflow.com/questions/18531624/isplainobject-thing\nmodule.exports = function isPlainObject(obj) {\n\n // We need to be a little less strict in the `imagetest` container because\n // of how async image requests are handled.\n //\n // N.B. isPlainObject(new Constructor()) will return true in `imagetest`\n if(window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj) === Object.prototype\n );\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/is_plain_object.js\n// module id = 80\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fxAttrs = require('../components/fx/attributes');\n\nmodule.exports = {\n type: {\n valType: 'enumerated',\n \n values: [], // listed dynamically\n dflt: 'scatter',\n editType: 'calc+clearAxisTypes'\n },\n visible: {\n valType: 'enumerated',\n values: [true, false, 'legendonly'],\n \n dflt: true,\n editType: 'calc',\n \n },\n showlegend: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'style',\n \n },\n legendgroup: {\n valType: 'string',\n \n dflt: '',\n editType: 'style',\n \n },\n opacity: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n editType: 'style',\n \n },\n name: {\n valType: 'string',\n \n editType: 'style',\n \n },\n uid: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc'\n },\n ids: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n customdata: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n hoverinfo: {\n valType: 'flaglist',\n \n flags: ['x', 'y', 'z', 'text', 'name'],\n extras: ['all', 'none', 'skip'],\n arrayOk: true,\n dflt: 'all',\n editType: 'none',\n \n },\n hoverlabel: fxAttrs.hoverlabel,\n stream: {\n token: {\n valType: 'string',\n noBlank: true,\n strict: true,\n \n editType: 'calc',\n \n },\n maxpoints: {\n valType: 'number',\n min: 0,\n max: 10000,\n dflt: 500,\n \n editType: 'calc',\n \n },\n editType: 'calc'\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/attributes.js\n// module id = 81\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = require('./font_attributes');\nvar colorAttrs = require('../components/color/attributes');\n\nvar globalFont = fontAttrs({\n editType: 'calc',\n \n});\nglobalFont.family.dflt = '\"Open Sans\", verdana, arial, sans-serif';\nglobalFont.size.dflt = 12;\nglobalFont.color.dflt = colorAttrs.defaultLine;\n\nmodule.exports = {\n font: globalFont,\n title: {\n valType: 'string',\n \n dflt: 'Click to enter Plot title',\n editType: 'layoutstyle',\n \n },\n titlefont: fontAttrs({\n editType: 'layoutstyle',\n \n }),\n autosize: {\n valType: 'boolean',\n \n dflt: false,\n // autosize, width, and height get special editType treatment in _relayout\n // so we can handle noop resizes more efficiently\n editType: 'none',\n \n },\n width: {\n valType: 'number',\n \n min: 10,\n dflt: 700,\n editType: 'none',\n \n },\n height: {\n valType: 'number',\n \n min: 10,\n dflt: 450,\n editType: 'none',\n \n },\n margin: {\n l: {\n valType: 'number',\n \n min: 0,\n dflt: 80,\n editType: 'calc',\n \n },\n r: {\n valType: 'number',\n \n min: 0,\n dflt: 80,\n editType: 'calc',\n \n },\n t: {\n valType: 'number',\n \n min: 0,\n dflt: 100,\n editType: 'calc',\n \n },\n b: {\n valType: 'number',\n \n min: 0,\n dflt: 80,\n editType: 'calc',\n \n },\n pad: {\n valType: 'number',\n \n min: 0,\n dflt: 0,\n editType: 'calc',\n \n },\n autoexpand: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc'\n },\n editType: 'calc'\n },\n paper_bgcolor: {\n valType: 'color',\n \n dflt: colorAttrs.background,\n editType: 'plot',\n \n },\n plot_bgcolor: {\n // defined here, but set in Axes.supplyLayoutDefaults\n // because it needs to know if there are (2D) axes or not\n valType: 'color',\n \n dflt: colorAttrs.background,\n editType: 'layoutstyle',\n \n },\n separators: {\n valType: 'string',\n \n dflt: '.,',\n editType: 'plot',\n \n },\n hidesources: {\n valType: 'boolean',\n \n dflt: false,\n editType: 'plot',\n \n },\n smith: {\n // will become a boolean if/when we implement this\n valType: 'enumerated',\n \n values: [false],\n dflt: false,\n editType: 'none'\n },\n showlegend: {\n // handled in legend.supplyLayoutDefaults\n // but included here because it's not in the legend object\n valType: 'boolean',\n \n editType: 'legend',\n \n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/layout_attributes.js\n// module id = 82\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorAttributes = require('../../components/colorscale/color_attributes');\nvar errorBarAttrs = require('../../components/errorbars/attributes');\nvar colorbarAttrs = require('../../components/colorbar/attributes');\nvar fontAttrs = require('../../plots/font_attributes');\nvar dash = require('../../components/drawing/attributes').dash;\n\nvar Drawing = require('../../components/drawing');\nvar constants = require('./constants');\nvar extendFlat = require('../../lib/extend').extendFlat;\n\nmodule.exports = {\n x: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n x0: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc+clearAxisTypes',\n \n },\n dx: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n y: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n y0: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc+clearAxisTypes',\n \n },\n dy: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n text: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'calc',\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'style',\n \n },\n mode: {\n valType: 'flaglist',\n flags: ['lines', 'markers', 'text'],\n extras: ['none'],\n \n editType: 'calc',\n \n },\n hoveron: {\n valType: 'flaglist',\n flags: ['points', 'fills'],\n \n editType: 'style',\n \n },\n line: {\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n width: {\n valType: 'number',\n min: 0,\n dflt: 2,\n \n editType: 'style',\n \n },\n shape: {\n valType: 'enumerated',\n values: ['linear', 'spline', 'hv', 'vh', 'hvh', 'vhv'],\n dflt: 'linear',\n \n editType: 'plot',\n \n },\n smoothing: {\n valType: 'number',\n min: 0,\n max: 1.3,\n dflt: 1,\n \n editType: 'plot',\n \n },\n dash: extendFlat({}, dash, {editType: 'style'}),\n simplify: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n editType: 'plot'\n },\n\n connectgaps: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n cliponaxis: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n\n fill: {\n valType: 'enumerated',\n values: ['none', 'tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'],\n dflt: 'none',\n \n editType: 'calc',\n \n },\n fillcolor: {\n valType: 'color',\n \n editType: 'style',\n \n },\n marker: extendFlat({\n symbol: {\n valType: 'enumerated',\n values: Drawing.symbolList,\n dflt: 'circle',\n arrayOk: true,\n \n editType: 'style',\n \n },\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n arrayOk: true,\n \n editType: 'style',\n \n },\n size: {\n valType: 'number',\n min: 0,\n dflt: 6,\n arrayOk: true,\n \n editType: 'calcIfAutorange',\n \n },\n maxdisplayed: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'plot',\n \n },\n sizeref: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n sizemin: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'calc',\n \n },\n sizemode: {\n valType: 'enumerated',\n values: ['diameter', 'area'],\n dflt: 'diameter',\n \n editType: 'calc',\n \n },\n\n showscale: {\n valType: 'boolean',\n \n dflt: false,\n editType: 'calc',\n \n },\n colorbar: colorbarAttrs,\n\n line: extendFlat({\n width: {\n valType: 'number',\n min: 0,\n arrayOk: true,\n \n editType: 'style',\n \n },\n editType: 'calc'\n },\n colorAttributes('marker.line')\n ),\n gradient: {\n type: {\n valType: 'enumerated',\n values: ['radial', 'horizontal', 'vertical', 'none'],\n arrayOk: true,\n dflt: 'none',\n \n editType: 'calc',\n \n },\n color: {\n valType: 'color',\n arrayOk: true,\n \n editType: 'calc',\n \n },\n editType: 'calc'\n },\n editType: 'calc'\n },\n colorAttributes('marker')\n ),\n textposition: {\n valType: 'enumerated',\n values: [\n 'top left', 'top center', 'top right',\n 'middle left', 'middle center', 'middle right',\n 'bottom left', 'bottom center', 'bottom right'\n ],\n dflt: 'middle center',\n arrayOk: true,\n \n editType: 'calc',\n \n },\n textfont: fontAttrs({\n editType: 'calc',\n colorEditType: 'style',\n arrayOk: true,\n \n }),\n\n r: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n t: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n error_y: errorBarAttrs,\n error_x: errorBarAttrs\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/attributes.js\n// module id = 83\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nexports.xmlns = 'http://www.w3.org/2000/xmlns/';\nexports.svg = 'http://www.w3.org/2000/svg';\nexports.xlink = 'http://www.w3.org/1999/xlink';\n\n// the 'old' d3 quirk got fix in v3.5.7\n// https://github.com/mbostock/d3/commit/a6f66e9dd37f764403fc7c1f26be09ab4af24fed\nexports.svgAttrs = {\n xmlns: exports.svg,\n 'xmlns:xlink': exports.xlink\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/constants/xmlns_namespaces.js\n// module id = 84\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n /**\n * Timing information for interactive elements\n */\n SHOW_PLACEHOLDER: 100,\n HIDE_PLACEHOLDER: 1000,\n\n // ms between first mousedown and 2nd mouseup to constitute dblclick...\n // we don't seem to have access to the system setting\n DBLCLICKDELAY: 300,\n\n // opacity dimming fraction for points that are not in selection\n DESELECTDIM: 0.2\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/constants/interactions.js\n// module id = 85\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n // max pixels away from mouse to allow a point to highlight\n MAXDIST: 20,\n\n // hover labels for multiple horizontal bars get tilted by this angle\n YANGLE: 60,\n\n // size and display constants for hover text\n\n // pixel size of hover arrows\n HOVERARROWSIZE: 6,\n // pixels padding around text\n HOVERTEXTPAD: 3,\n // hover font\n HOVERFONTSIZE: 13,\n HOVERFONT: 'Arial, sans-serif',\n\n // minimum time (msec) between hover calls\n HOVERMINTIME: 50,\n\n // ID suffix (with fullLayout._uid) for hover events in the throttle cache\n HOVERID: '-hover'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/constants.js\n// module id = 86\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../registry');\nvar Lib = require('../lib');\n\nvar baseAttributes = require('../plots/attributes');\nvar baseLayoutAttributes = require('../plots/layout_attributes');\nvar frameAttributes = require('../plots/frame_attributes');\nvar animationAttributes = require('../plots/animation_attributes');\n\n// polar attributes are not part of the Registry yet\nvar polarAreaAttrs = require('../plots/polar/area_attributes');\nvar polarAxisAttrs = require('../plots/polar/axis_attributes');\n\nvar editTypes = require('./edit_types');\n\nvar extendFlat = Lib.extendFlat;\nvar extendDeepAll = Lib.extendDeepAll;\n\nvar IS_SUBPLOT_OBJ = '_isSubplotObj';\nvar IS_LINKED_TO_ARRAY = '_isLinkedToArray';\nvar ARRAY_ATTR_REGEXPS = '_arrayAttrRegexps';\nvar DEPRECATED = '_deprecated';\nvar UNDERSCORE_ATTRS = [IS_SUBPLOT_OBJ, IS_LINKED_TO_ARRAY, ARRAY_ATTR_REGEXPS, DEPRECATED];\n\nexports.IS_SUBPLOT_OBJ = IS_SUBPLOT_OBJ;\nexports.IS_LINKED_TO_ARRAY = IS_LINKED_TO_ARRAY;\nexports.DEPRECATED = DEPRECATED;\nexports.UNDERSCORE_ATTRS = UNDERSCORE_ATTRS;\n\n/** Outputs the full plotly.js plot schema\n *\n * @return {object}\n * - defs\n * - traces\n * - layout\n * - transforms\n * - frames\n * - animations\n * - config (coming soon ...)\n */\nexports.get = function() {\n var traces = {};\n\n Registry.allTypes.concat('area').forEach(function(type) {\n traces[type] = getTraceAttributes(type);\n });\n\n var transforms = {};\n\n Object.keys(Registry.transformsRegistry).forEach(function(type) {\n transforms[type] = getTransformAttributes(type);\n });\n\n return {\n defs: {\n valObjects: Lib.valObjectMeta,\n metaKeys: UNDERSCORE_ATTRS.concat(['description', 'role', 'editType', 'impliedEdits']),\n editType: {\n traces: editTypes.traces,\n layout: editTypes.layout\n },\n impliedEdits: {\n \n }\n },\n\n traces: traces,\n layout: getLayoutAttributes(),\n\n transforms: transforms,\n\n frames: getFramesAttributes(),\n animation: formatAttributes(animationAttributes)\n };\n};\n\n/**\n * Crawl the attribute tree, recursively calling a callback function\n *\n * @param {object} attrs\n * The node of the attribute tree (e.g. the root) from which recursion originates\n * @param {Function} callback\n * A callback function with the signature:\n * @callback callback\n * @param {object} attr an attribute\n * @param {String} attrName name string\n * @param {object[]} attrs all the attributes\n * @param {Number} level the recursion level, 0 at the root\n * @param {Number} [specifiedLevel]\n * The level in the tree, in order to let the callback function detect descend or backtrack,\n * typically unsupplied (implied 0), just used by the self-recursive call.\n * The necessity arises because the tree traversal is not controlled by callback return values.\n * The decision to not use callback return values for controlling tree pruning arose from\n * the goal of keeping the crawler backwards compatible. Observe that one of the pruning conditions\n * precedes the callback call.\n * @param {string} [attrString]\n * the path to the current attribute, as an attribute string (ie 'marker.line')\n * typically unsupplied, but you may supply it if you want to disambiguate which attrs tree you\n * are starting from\n *\n * @return {object} transformOut\n * copy of transformIn that contains attribute defaults\n */\nexports.crawl = function(attrs, callback, specifiedLevel, attrString) {\n var level = specifiedLevel || 0;\n attrString = attrString || '';\n\n Object.keys(attrs).forEach(function(attrName) {\n var attr = attrs[attrName];\n\n if(UNDERSCORE_ATTRS.indexOf(attrName) !== -1) return;\n\n var fullAttrString = (attrString ? attrString + '.' : '') + attrName;\n callback(attr, attrName, attrs, level, fullAttrString);\n\n if(exports.isValObject(attr)) return;\n\n if(Lib.isPlainObject(attr) && attrName !== 'impliedEdits') {\n exports.crawl(attr, callback, level + 1, fullAttrString);\n }\n });\n};\n\n/** Is object a value object (or a container object)?\n *\n * @param {object} obj\n * @return {boolean}\n * returns true for a valid value object and\n * false for tree nodes in the attribute hierarchy\n */\nexports.isValObject = function(obj) {\n return obj && obj.valType !== undefined;\n};\n\n/**\n * Find all data array attributes in a given trace object - including\n * `arrayOk` attributes.\n *\n * @param {object} trace\n * full trace object that contains a reference to `_module.attributes`\n *\n * @return {array} arrayAttributes\n * list of array attributes for the given trace\n */\nexports.findArrayAttributes = function(trace) {\n var arrayAttributes = [];\n var stack = [];\n\n function callback(attr, attrName, attrs, level) {\n stack = stack.slice(0, level).concat([attrName]);\n\n var splittableAttr = (\n attr &&\n (attr.valType === 'data_array' || attr.arrayOk === true) &&\n !(stack[level - 1] === 'colorbar' && (attrName === 'ticktext' || attrName === 'tickvals'))\n );\n\n // Manually exclude 'colorbar.tickvals' and 'colorbar.ticktext' for now\n // which are declared as `valType: 'data_array'` but scale independently of\n // the coordinate arrays.\n //\n // Down the road, we might want to add a schema field (e.g `uncorrelatedArray: true`)\n // to distinguish attributes of the likes.\n\n if(!splittableAttr) return;\n\n var astr = toAttrString(stack);\n var val = Lib.nestedProperty(trace, astr).get();\n if(!Array.isArray(val)) return;\n\n arrayAttributes.push(astr);\n }\n\n function toAttrString(stack) {\n return stack.join('.');\n }\n\n exports.crawl(baseAttributes, callback);\n if(trace._module && trace._module.attributes) {\n exports.crawl(trace._module.attributes, callback);\n }\n\n if(trace.transforms) {\n var transforms = trace.transforms;\n\n for(var i = 0; i < transforms.length; i++) {\n var transform = transforms[i];\n var module = transform._module;\n\n if(module) {\n stack = ['transforms[' + i + ']'];\n\n exports.crawl(module.attributes, callback, 1);\n }\n }\n }\n\n // Look into the fullInput module attributes for array attributes\n // to make sure that 'custom' array attributes are detected.\n //\n // At the moment, we need this block to make sure that\n // ohlc and candlestick 'open', 'high', 'low', 'close' can be\n // used with filter and groupby transforms.\n if(trace._fullInput && trace._fullInput._module && trace._fullInput._module.attributes) {\n exports.crawl(trace._fullInput._module.attributes, callback);\n arrayAttributes = Lib.filterUnique(arrayAttributes);\n }\n\n return arrayAttributes;\n};\n\n/*\n * Find the valObject for one attribute in an existing trace\n *\n * @param {object} trace\n * full trace object that contains a reference to `_module.attributes`\n * @param {object} parts\n * an array of parts, like ['transforms', 1, 'value']\n * typically from nestedProperty(...).parts\n *\n * @return {object|false}\n * the valObject for this attribute, or the last found parent\n * in some cases the innermost valObject will not exist, for example\n * `valType: 'any'` attributes where we might set a part of the attribute.\n * In that case, stop at the deepest valObject we *do* find.\n */\nexports.getTraceValObject = function(trace, parts) {\n var head = parts[0];\n var i = 1; // index to start recursing from\n var moduleAttrs, valObject;\n\n if(head === 'transforms') {\n if(!Array.isArray(trace.transforms)) return false;\n var tNum = parts[1];\n if(!isIndex(tNum) || tNum >= trace.transforms.length) {\n return false;\n }\n moduleAttrs = (Registry.transformsRegistry[trace.transforms[tNum].type] || {}).attributes;\n valObject = moduleAttrs && moduleAttrs[parts[2]];\n i = 3; // start recursing only inside the transform\n }\n else if(trace.type === 'area') {\n valObject = polarAreaAttrs[head];\n }\n else {\n // first look in the module for this trace\n // components have already merged their trace attributes in here\n var _module = trace._module;\n if(!_module) _module = (Registry.modules[trace.type || baseAttributes.type.dflt] || {})._module;\n if(!_module) return false;\n\n moduleAttrs = _module.attributes;\n valObject = moduleAttrs && moduleAttrs[head];\n\n // then look in the subplot attributes\n if(!valObject) {\n var subplotModule = _module.basePlotModule;\n if(subplotModule && subplotModule.attributes) {\n valObject = subplotModule.attributes[head];\n }\n }\n\n // finally look in the global attributes\n if(!valObject) valObject = baseAttributes[head];\n }\n\n return recurseIntoValObject(valObject, parts, i);\n};\n\n/*\n * Find the valObject for one layout attribute\n *\n * @param {array} parts\n * an array of parts, like ['annotations', 1, 'x']\n * typically from nestedProperty(...).parts\n *\n * @return {object|false}\n * the valObject for this attribute, or the last found parent\n * in some cases the innermost valObject will not exist, for example\n * `valType: 'any'` attributes where we might set a part of the attribute.\n * In that case, stop at the deepest valObject we *do* find.\n */\nexports.getLayoutValObject = function(fullLayout, parts) {\n var valObject = layoutHeadAttr(fullLayout, parts[0]);\n\n return recurseIntoValObject(valObject, parts, 1);\n};\n\nfunction layoutHeadAttr(fullLayout, head) {\n var i, key, _module, attributes;\n\n // look for attributes of the subplot types used on the plot\n var basePlotModules = fullLayout._basePlotModules;\n if(basePlotModules) {\n var out;\n for(i = 0; i < basePlotModules.length; i++) {\n _module = basePlotModules[i];\n if(_module.attrRegex && _module.attrRegex.test(head)) {\n // if a module defines overrides, these take precedence\n // initially this is to allow gl2d different editTypes from svg cartesian\n if(_module.layoutAttrOverrides) return _module.layoutAttrOverrides;\n\n // otherwise take the first attributes we find\n if(!out && _module.layoutAttributes) out = _module.layoutAttributes;\n }\n\n // a module can also override the behavior of base (and component) module layout attrs\n // again see gl2d for initial use case\n var baseOverrides = _module.baseLayoutAttrOverrides;\n if(baseOverrides && head in baseOverrides) return baseOverrides[head];\n }\n if(out) return out;\n }\n\n // look for layout attributes contributed by traces on the plot\n var modules = fullLayout._modules;\n if(modules) {\n for(i = 0; i < modules.length; i++) {\n attributes = modules[i].layoutAttributes;\n if(attributes && head in attributes) {\n return attributes[head];\n }\n }\n }\n\n /*\n * Next look in components.\n * Components that define a schema have already merged this into\n * base and subplot attribute defs, so ignore these.\n * Others (older style) all put all their attributes\n * inside a container matching the module `name`\n * eg `attributes` (array) or `legend` (object)\n */\n for(key in Registry.componentsRegistry) {\n _module = Registry.componentsRegistry[key];\n if(!_module.schema && (head === _module.name)) {\n return _module.layoutAttributes;\n }\n }\n\n if(head in baseLayoutAttributes) return baseLayoutAttributes[head];\n\n // Polar doesn't populate _modules or _basePlotModules\n // just fall back on these when the others fail\n if(head === 'radialaxis' || head === 'angularaxis') {\n return polarAxisAttrs[head];\n }\n return polarAxisAttrs.layout[head] || false;\n}\n\nfunction recurseIntoValObject(valObject, parts, i) {\n if(!valObject) return false;\n\n if(valObject._isLinkedToArray) {\n // skip array index, abort if we try to dive into an array without an index\n if(isIndex(parts[i])) i++;\n else if(i < parts.length) return false;\n }\n\n // now recurse as far as we can. Occasionally we have an attribute\n // setting an internal part below what's\n for(; i < parts.length; i++) {\n var newValObject = valObject[parts[i]];\n if(Lib.isPlainObject(newValObject)) valObject = newValObject;\n else break;\n\n if(i === parts.length - 1) break;\n\n if(valObject._isLinkedToArray) {\n i++;\n if(!isIndex(parts[i])) return false;\n }\n else if(valObject.valType === 'info_array') {\n i++;\n var index = parts[i];\n if(!isIndex(index) || index >= valObject.items.length) return false;\n valObject = valObject.items[index];\n }\n }\n\n return valObject;\n}\n\nfunction isIndex(val) {\n return val === Math.round(val) && val >= 0;\n}\n\nfunction getTraceAttributes(type) {\n var _module, basePlotModule;\n\n if(type === 'area') {\n _module = { attributes: polarAreaAttrs };\n basePlotModule = {};\n }\n else {\n _module = Registry.modules[type]._module,\n basePlotModule = _module.basePlotModule;\n }\n\n var attributes = {};\n\n // make 'type' the first attribute in the object\n attributes.type = null;\n\n // base attributes (same for all trace types)\n extendDeepAll(attributes, baseAttributes);\n\n // module attributes\n extendDeepAll(attributes, _module.attributes);\n\n // subplot attributes\n if(basePlotModule.attributes) {\n extendDeepAll(attributes, basePlotModule.attributes);\n }\n\n // 'type' gets overwritten by baseAttributes; reset it here\n attributes.type = type;\n\n var out = {\n meta: _module.meta || {},\n attributes: formatAttributes(attributes),\n };\n\n // trace-specific layout attributes\n if(_module.layoutAttributes) {\n var layoutAttributes = {};\n\n extendDeepAll(layoutAttributes, _module.layoutAttributes);\n out.layoutAttributes = formatAttributes(layoutAttributes);\n }\n\n return out;\n}\n\nfunction getLayoutAttributes() {\n var layoutAttributes = {};\n var key, _module;\n\n // global layout attributes\n extendDeepAll(layoutAttributes, baseLayoutAttributes);\n\n // add base plot module layout attributes\n for(key in Registry.subplotsRegistry) {\n _module = Registry.subplotsRegistry[key];\n\n if(!_module.layoutAttributes) continue;\n\n if(_module.name === 'cartesian') {\n handleBasePlotModule(layoutAttributes, _module, 'xaxis');\n handleBasePlotModule(layoutAttributes, _module, 'yaxis');\n }\n else {\n var astr = _module.attr === 'subplot' ? _module.name : _module.attr;\n\n handleBasePlotModule(layoutAttributes, _module, astr);\n }\n }\n\n // polar layout attributes\n layoutAttributes = assignPolarLayoutAttrs(layoutAttributes);\n\n // add registered components layout attributes\n for(key in Registry.componentsRegistry) {\n _module = Registry.componentsRegistry[key];\n var schema = _module.schema;\n\n /*\n * Components with defined schema have already been merged in at register time\n * but a few components define attributes that apply only to xaxis\n * not yaxis (rangeselector, rangeslider) - delete from y schema.\n * Note that the input attributes for xaxis/yaxis are the same object\n * so it's not possible to only add them to xaxis from the start.\n * If we ever have such asymmetry the other way, or anywhere else,\n * we will need to extend both this code and mergeComponentAttrsToSubplot\n * (which will not find yaxis only for example)\n */\n if(schema && (schema.subplots || schema.layout)) {\n var subplots = schema.subplots;\n if(subplots && subplots.xaxis && !subplots.yaxis) {\n for(var xkey in subplots.xaxis) delete layoutAttributes.yaxis[xkey];\n }\n }\n // older style without schema need to be explicitly merged in now\n else if(_module.layoutAttributes) {\n insertAttrs(layoutAttributes, _module.layoutAttributes, _module.name);\n }\n }\n\n return {\n layoutAttributes: formatAttributes(layoutAttributes)\n };\n}\n\nfunction getTransformAttributes(type) {\n var _module = Registry.transformsRegistry[type];\n var attributes = extendDeepAll({}, _module.attributes);\n\n // add registered components transform attributes\n Object.keys(Registry.componentsRegistry).forEach(function(k) {\n var _module = Registry.componentsRegistry[k];\n\n if(_module.schema && _module.schema.transforms && _module.schema.transforms[type]) {\n Object.keys(_module.schema.transforms[type]).forEach(function(v) {\n insertAttrs(attributes, _module.schema.transforms[type][v], v);\n });\n }\n });\n\n return {\n attributes: formatAttributes(attributes)\n };\n}\n\nfunction getFramesAttributes() {\n var attrs = {\n frames: Lib.extendDeepAll({}, frameAttributes)\n };\n\n formatAttributes(attrs);\n\n return attrs.frames;\n}\n\nfunction formatAttributes(attrs) {\n mergeValTypeAndRole(attrs);\n formatArrayContainers(attrs);\n\n return attrs;\n}\n\nfunction mergeValTypeAndRole(attrs) {\n\n function makeSrcAttr(attrName) {\n return {\n valType: 'string',\n \n \n editType: 'none'\n };\n }\n\n function callback(attr, attrName, attrs) {\n if(exports.isValObject(attr)) {\n if(attr.valType === 'data_array') {\n // all 'data_array' attrs have role 'data'\n attr.role = 'data';\n // all 'data_array' attrs have a corresponding 'src' attr\n attrs[attrName + 'src'] = makeSrcAttr(attrName);\n }\n else if(attr.arrayOk === true) {\n // all 'arrayOk' attrs have a corresponding 'src' attr\n attrs[attrName + 'src'] = makeSrcAttr(attrName);\n }\n }\n else if(Lib.isPlainObject(attr)) {\n // all attrs container objects get role 'object'\n attr.role = 'object';\n }\n }\n\n exports.crawl(attrs, callback);\n}\n\nfunction formatArrayContainers(attrs) {\n\n function callback(attr, attrName, attrs) {\n if(!attr) return;\n\n var itemName = attr[IS_LINKED_TO_ARRAY];\n\n if(!itemName) return;\n\n delete attr[IS_LINKED_TO_ARRAY];\n\n attrs[attrName] = { items: {} };\n attrs[attrName].items[itemName] = attr;\n attrs[attrName].role = 'object';\n }\n\n exports.crawl(attrs, callback);\n}\n\nfunction assignPolarLayoutAttrs(layoutAttributes) {\n extendFlat(layoutAttributes, {\n radialaxis: polarAxisAttrs.radialaxis,\n angularaxis: polarAxisAttrs.angularaxis\n });\n\n extendFlat(layoutAttributes, polarAxisAttrs.layout);\n\n return layoutAttributes;\n}\n\nfunction handleBasePlotModule(layoutAttributes, _module, astr) {\n var np = Lib.nestedProperty(layoutAttributes, astr),\n attrs = extendDeepAll({}, _module.layoutAttributes);\n\n attrs[IS_SUBPLOT_OBJ] = true;\n np.set(attrs);\n}\n\nfunction insertAttrs(baseAttrs, newAttrs, astr) {\n var np = Lib.nestedProperty(baseAttrs, astr);\n\n np.set(extendDeepAll(np.get() || {}, newAttrs));\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/plot_schema.js\n// module id = 95\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar isArray = require('./is_array');\nvar isPlainObject = require('./is_plain_object');\nvar containerArrayMatch = require('../plot_api/container_array_match');\n\n/**\n * convert a string s (such as 'xaxis.range[0]')\n * representing a property of nested object into set and get methods\n * also return the string and object so we don't have to keep track of them\n * allows [-1] for an array index, to set a property inside all elements\n * of an array\n * eg if obj = {arr: [{a: 1}, {a: 2}]}\n * you can do p = nestedProperty(obj, 'arr[-1].a')\n * but you cannot set the array itself this way, to do that\n * just set the whole array.\n * eg if obj = {arr: [1, 2, 3]}\n * you can't do nestedProperty(obj, 'arr[-1]').set(5)\n * but you can do nestedProperty(obj, 'arr').set([5, 5, 5])\n */\nmodule.exports = function nestedProperty(container, propStr) {\n if(isNumeric(propStr)) propStr = String(propStr);\n else if(typeof propStr !== 'string' ||\n propStr.substr(propStr.length - 4) === '[-1]') {\n throw 'bad property string';\n }\n\n var j = 0,\n propParts = propStr.split('.'),\n indexed,\n indices,\n i;\n\n // check for parts of the nesting hierarchy that are numbers (ie array elements)\n while(j < propParts.length) {\n // look for non-bracket chars, then any number of [##] blocks\n indexed = String(propParts[j]).match(/^([^\\[\\]]*)((\\[\\-?[0-9]*\\])+)$/);\n if(indexed) {\n if(indexed[1]) propParts[j] = indexed[1];\n // allow propStr to start with bracketed array indices\n else if(j === 0) propParts.splice(0, 1);\n else throw 'bad property string';\n\n indices = indexed[2]\n .substr(1, indexed[2].length - 2)\n .split('][');\n\n for(i = 0; i < indices.length; i++) {\n j++;\n propParts.splice(j, 0, Number(indices[i]));\n }\n }\n j++;\n }\n\n if(typeof container !== 'object') {\n return badContainer(container, propStr, propParts);\n }\n\n return {\n set: npSet(container, propParts, propStr),\n get: npGet(container, propParts),\n astr: propStr,\n parts: propParts,\n obj: container\n };\n};\n\nfunction npGet(cont, parts) {\n return function() {\n var curCont = cont,\n curPart,\n allSame,\n out,\n i,\n j;\n\n for(i = 0; i < parts.length - 1; i++) {\n curPart = parts[i];\n if(curPart === -1) {\n allSame = true;\n out = [];\n for(j = 0; j < curCont.length; j++) {\n out[j] = npGet(curCont[j], parts.slice(i + 1))();\n if(out[j] !== out[0]) allSame = false;\n }\n return allSame ? out[0] : out;\n }\n if(typeof curPart === 'number' && !isArray(curCont)) {\n return undefined;\n }\n curCont = curCont[curPart];\n if(typeof curCont !== 'object' || curCont === null) {\n return undefined;\n }\n }\n\n // only hit this if parts.length === 1\n if(typeof curCont !== 'object' || curCont === null) return undefined;\n\n out = curCont[parts[i]];\n if(out === null) return undefined;\n return out;\n };\n}\n\n/*\n * Can this value be deleted? We can delete any empty object (null, undefined, [], {})\n * EXCEPT empty data arrays, {} inside an array, or anything INSIDE an *args* array.\n *\n * Info arrays can be safely deleted, but not deleting them has no ill effects other\n * than leaving a trace or layout object with some cruft in it.\n *\n * Deleting data arrays can change the meaning of the object, as `[]` means there is\n * data for this attribute, it's just empty right now while `undefined` means the data\n * should be filled in with defaults to match other data arrays.\n *\n * `{}` inside an array means \"the default object\" which is clearly different from\n * popping it off the end of the array, or setting it `undefined` inside the array.\n *\n * *args* arrays get passed directly to API methods and we should respect precisely\n * what the user has put there - although if the whole *args* array is empty it's fine\n * to delete that.\n *\n * So we do some simple tests here to find known non-data arrays but don't worry too\n * much about not deleting some arrays that would actually be safe to delete.\n */\nvar INFO_PATTERNS = /(^|\\.)((domain|range)(\\.[xy])?|args|parallels)$/;\nvar ARGS_PATTERN = /(^|\\.)args\\[/;\nfunction isDeletable(val, propStr) {\n if(!emptyObj(val) ||\n (isPlainObject(val) && propStr.charAt(propStr.length - 1) === ']') ||\n (propStr.match(ARGS_PATTERN) && val !== undefined)\n ) {\n return false;\n }\n if(!isArray(val)) return true;\n\n if(propStr.match(INFO_PATTERNS)) return true;\n\n var match = containerArrayMatch(propStr);\n // if propStr matches the container array itself, index is an empty string\n // otherwise we've matched something inside the container array, which may\n // still be a data array.\n return match && (match.index === '');\n}\n\nfunction npSet(cont, parts, propStr) {\n return function(val) {\n var curCont = cont,\n propPart = '',\n containerLevels = [[cont, propPart]],\n toDelete = isDeletable(val, propStr),\n curPart,\n i;\n\n for(i = 0; i < parts.length - 1; i++) {\n curPart = parts[i];\n\n if(typeof curPart === 'number' && !isArray(curCont)) {\n throw 'array index but container is not an array';\n }\n\n // handle special -1 array index\n if(curPart === -1) {\n toDelete = !setArrayAll(curCont, parts.slice(i + 1), val, propStr);\n if(toDelete) break;\n else return;\n }\n\n if(!checkNewContainer(curCont, curPart, parts[i + 1], toDelete)) {\n break;\n }\n\n curCont = curCont[curPart];\n\n if(typeof curCont !== 'object' || curCont === null) {\n throw 'container is not an object';\n }\n\n propPart = joinPropStr(propPart, curPart);\n\n containerLevels.push([curCont, propPart]);\n }\n\n if(toDelete) {\n if(i === parts.length - 1) delete curCont[parts[i]];\n pruneContainers(containerLevels);\n }\n else curCont[parts[i]] = val;\n };\n}\n\nfunction joinPropStr(propStr, newPart) {\n var toAdd = newPart;\n if(isNumeric(newPart)) toAdd = '[' + newPart + ']';\n else if(propStr) toAdd = '.' + newPart;\n\n return propStr + toAdd;\n}\n\n// handle special -1 array index\nfunction setArrayAll(containerArray, innerParts, val, propStr) {\n var arrayVal = isArray(val),\n allSet = true,\n thisVal = val,\n thisPropStr = propStr.replace('-1', 0),\n deleteThis = arrayVal ? false : isDeletable(val, thisPropStr),\n firstPart = innerParts[0],\n i;\n\n for(i = 0; i < containerArray.length; i++) {\n thisPropStr = propStr.replace('-1', i);\n if(arrayVal) {\n thisVal = val[i % val.length];\n deleteThis = isDeletable(thisVal, thisPropStr);\n }\n if(deleteThis) allSet = false;\n if(!checkNewContainer(containerArray, i, firstPart, deleteThis)) {\n continue;\n }\n npSet(containerArray[i], innerParts, propStr.replace('-1', i))(thisVal);\n }\n return allSet;\n}\n\n/**\n * make new sub-container as needed.\n * returns false if there's no container and none is needed\n * because we're only deleting an attribute\n */\nfunction checkNewContainer(container, part, nextPart, toDelete) {\n if(container[part] === undefined) {\n if(toDelete) return false;\n\n if(typeof nextPart === 'number') container[part] = [];\n else container[part] = {};\n }\n return true;\n}\n\nfunction pruneContainers(containerLevels) {\n var i,\n j,\n curCont,\n propPart,\n keys,\n remainingKeys;\n for(i = containerLevels.length - 1; i >= 0; i--) {\n curCont = containerLevels[i][0];\n propPart = containerLevels[i][1];\n\n remainingKeys = false;\n if(isArray(curCont)) {\n for(j = curCont.length - 1; j >= 0; j--) {\n if(isDeletable(curCont[j], joinPropStr(propPart, j))) {\n if(remainingKeys) curCont[j] = undefined;\n else curCont.pop();\n }\n else remainingKeys = true;\n }\n }\n else if(typeof curCont === 'object' && curCont !== null) {\n keys = Object.keys(curCont);\n remainingKeys = false;\n for(j = keys.length - 1; j >= 0; j--) {\n if(isDeletable(curCont[keys[j]], joinPropStr(propPart, keys[j]))) {\n delete curCont[keys[j]];\n }\n else remainingKeys = true;\n }\n }\n if(remainingKeys) return;\n }\n}\n\nfunction emptyObj(obj) {\n if(obj === undefined || obj === null) return true;\n if(typeof obj !== 'object') return false; // any plain value\n if(isArray(obj)) return !obj.length; // []\n return !Object.keys(obj).length; // {}\n}\n\nfunction badContainer(container, propStr, propParts) {\n return {\n set: function() { throw 'bad container'; },\n get: function() {},\n astr: propStr,\n parts: propParts,\n obj: container\n };\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/nested_property.js\n// module id = 96\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n visible: {\n valType: 'boolean',\n \n editType: 'calc',\n \n },\n type: {\n valType: 'enumerated',\n values: ['percent', 'constant', 'sqrt', 'data'],\n \n editType: 'calc',\n \n },\n symmetric: {\n valType: 'boolean',\n \n editType: 'calc',\n \n },\n array: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n arrayminus: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n value: {\n valType: 'number',\n min: 0,\n dflt: 10,\n \n editType: 'calc',\n \n },\n valueminus: {\n valType: 'number',\n min: 0,\n dflt: 10,\n \n editType: 'calc',\n \n },\n traceref: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'style'\n },\n tracerefminus: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'style'\n },\n copy_ystyle: {\n valType: 'boolean',\n \n editType: 'plot'\n },\n copy_zstyle: {\n valType: 'boolean',\n \n editType: 'style'\n },\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n thickness: {\n valType: 'number',\n min: 0,\n dflt: 2,\n \n editType: 'style',\n \n },\n width: {\n valType: 'number',\n min: 0,\n \n editType: 'plot',\n \n },\n editType: 'calc',\n\n _deprecated: {\n opacity: {\n valType: 'number',\n \n editType: 'style',\n \n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/errorbars/attributes.js\n// module id = 97\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar axesAttrs = require('../../plots/cartesian/layout_attributes');\nvar fontAttrs = require('../../plots/font_attributes');\nvar extendFlat = require('../../lib/extend').extendFlat;\nvar overrideAll = require('../../plot_api/edit_types').overrideAll;\n\n\nmodule.exports = overrideAll({\n// TODO: only right is supported currently\n// orient: {\n// valType: 'enumerated',\n// \n// values: ['left', 'right', 'top', 'bottom'],\n// dflt: 'right',\n// \n// },\n thicknessmode: {\n valType: 'enumerated',\n values: ['fraction', 'pixels'],\n \n dflt: 'pixels',\n \n },\n thickness: {\n valType: 'number',\n \n min: 0,\n dflt: 30,\n \n },\n lenmode: {\n valType: 'enumerated',\n values: ['fraction', 'pixels'],\n \n dflt: 'fraction',\n \n },\n len: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n \n },\n x: {\n valType: 'number',\n dflt: 1.02,\n min: -2,\n max: 3,\n \n \n },\n xanchor: {\n valType: 'enumerated',\n values: ['left', 'center', 'right'],\n dflt: 'left',\n \n \n },\n xpad: {\n valType: 'number',\n \n min: 0,\n dflt: 10,\n \n },\n y: {\n valType: 'number',\n \n dflt: 0.5,\n min: -2,\n max: 3,\n \n },\n yanchor: {\n valType: 'enumerated',\n values: ['top', 'middle', 'bottom'],\n \n dflt: 'middle',\n \n },\n ypad: {\n valType: 'number',\n \n min: 0,\n dflt: 10,\n \n },\n // a possible line around the bar itself\n outlinecolor: axesAttrs.linecolor,\n outlinewidth: axesAttrs.linewidth,\n // Should outlinewidth have {dflt: 0} ?\n // another possible line outside the padding and tick labels\n bordercolor: axesAttrs.linecolor,\n borderwidth: {\n valType: 'number',\n \n min: 0,\n dflt: 0,\n \n },\n bgcolor: {\n valType: 'color',\n \n dflt: 'rgba(0,0,0,0)',\n \n },\n // tick and title properties named and function exactly as in axes\n tickmode: axesAttrs.tickmode,\n nticks: axesAttrs.nticks,\n tick0: axesAttrs.tick0,\n dtick: axesAttrs.dtick,\n tickvals: axesAttrs.tickvals,\n ticktext: axesAttrs.ticktext,\n ticks: extendFlat({}, axesAttrs.ticks, {dflt: ''}),\n ticklen: axesAttrs.ticklen,\n tickwidth: axesAttrs.tickwidth,\n tickcolor: axesAttrs.tickcolor,\n showticklabels: axesAttrs.showticklabels,\n tickfont: fontAttrs({\n \n }),\n tickangle: axesAttrs.tickangle,\n tickformat: axesAttrs.tickformat,\n tickprefix: axesAttrs.tickprefix,\n showtickprefix: axesAttrs.showtickprefix,\n ticksuffix: axesAttrs.ticksuffix,\n showticksuffix: axesAttrs.showticksuffix,\n separatethousands: axesAttrs.separatethousands,\n exponentformat: axesAttrs.exponentformat,\n showexponent: axesAttrs.showexponent,\n title: {\n valType: 'string',\n \n dflt: 'Click to enter colorscale title',\n \n },\n titlefont: fontAttrs({\n \n }),\n titleside: {\n valType: 'enumerated',\n values: ['right', 'top', 'bottom'],\n \n dflt: 'top',\n \n }\n}, 'colorbars', 'from-root');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorbar/attributes.js\n// module id = 98\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Lib = require('../../lib');\n\nvar hasColorbar = require('../colorbar/has_colorbar');\nvar colorbarDefaults = require('../colorbar/defaults');\nvar isValidScale = require('./is_valid_scale');\nvar flipScale = require('./flip_scale');\n\n\nmodule.exports = function colorScaleDefaults(traceIn, traceOut, layout, coerce, opts) {\n var prefix = opts.prefix,\n cLetter = opts.cLetter,\n containerStr = prefix.slice(0, prefix.length - 1),\n containerIn = prefix ?\n Lib.nestedProperty(traceIn, containerStr).get() || {} :\n traceIn,\n containerOut = prefix ?\n Lib.nestedProperty(traceOut, containerStr).get() || {} :\n traceOut,\n minIn = containerIn[cLetter + 'min'],\n maxIn = containerIn[cLetter + 'max'],\n sclIn = containerIn.colorscale;\n\n var validMinMax = isNumeric(minIn) && isNumeric(maxIn) && (minIn < maxIn);\n coerce(prefix + cLetter + 'auto', !validMinMax);\n coerce(prefix + cLetter + 'min');\n coerce(prefix + cLetter + 'max');\n\n // handles both the trace case (autocolorscale is false by default) and\n // the marker and marker.line case (autocolorscale is true by default)\n var autoColorscaleDftl;\n if(sclIn !== undefined) autoColorscaleDftl = !isValidScale(sclIn);\n coerce(prefix + 'autocolorscale', autoColorscaleDftl);\n var sclOut = coerce(prefix + 'colorscale');\n\n // reversescale is handled at the containerOut level\n var reverseScale = coerce(prefix + 'reversescale');\n if(reverseScale) containerOut.colorscale = flipScale(sclOut);\n\n // ... until Scatter.colorbar can handle marker line colorbars\n if(prefix === 'marker.line.') return;\n\n // handle both the trace case where the dflt is listed in attributes and\n // the marker case where the dflt is determined by hasColorbar\n var showScaleDftl;\n if(prefix) showScaleDftl = hasColorbar(containerIn);\n var showScale = coerce(prefix + 'showscale', showScaleDftl);\n\n if(showScale) colorbarDefaults(containerIn, containerOut, layout);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/defaults.js\n// module id = 99\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n/**\n * Determine the position anchor property of x/y xanchor/yanchor components.\n *\n * - values < 1/3 align the low side at that fraction,\n * - values [1/3, 2/3] align the center at that fraction,\n * - values > 2/3 align the right at that fraction.\n */\n\nexports.isRightAnchor = function isRightAnchor(opts) {\n return (\n opts.xanchor === 'right' ||\n (opts.xanchor === 'auto' && opts.x >= 2 / 3)\n );\n};\n\nexports.isCenterAnchor = function isCenterAnchor(opts) {\n return (\n opts.xanchor === 'center' ||\n (opts.xanchor === 'auto' && opts.x > 1 / 3 && opts.x < 2 / 3)\n );\n};\n\nexports.isBottomAnchor = function isBottomAnchor(opts) {\n return (\n opts.yanchor === 'bottom' ||\n (opts.yanchor === 'auto' && opts.y <= 1 / 3)\n );\n};\n\nexports.isMiddleAnchor = function isMiddleAnchor(opts) {\n return (\n opts.yanchor === 'middle' ||\n (opts.yanchor === 'auto' && opts.y > 1 / 3 && opts.y < 2 / 3)\n );\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/anchor_utils.js\n// module id = 100\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar ARROWPATHS = require('./arrow_paths');\nvar fontAttrs = require('../../plots/font_attributes');\nvar cartesianConstants = require('../../plots/cartesian/constants');\n\n\nmodule.exports = {\n _isLinkedToArray: 'annotation',\n\n visible: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calcIfAutorange',\n \n },\n\n text: {\n valType: 'string',\n \n editType: 'calcIfAutorange',\n \n },\n textangle: {\n valType: 'angle',\n dflt: 0,\n \n editType: 'calcIfAutorange',\n \n },\n font: fontAttrs({\n editType: 'calcIfAutorange',\n colorEditType: 'arraydraw',\n \n }),\n width: {\n valType: 'number',\n min: 1,\n dflt: null,\n \n editType: 'calcIfAutorange',\n \n },\n height: {\n valType: 'number',\n min: 1,\n dflt: null,\n \n editType: 'calcIfAutorange',\n \n },\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 1,\n \n editType: 'arraydraw',\n \n },\n align: {\n valType: 'enumerated',\n values: ['left', 'center', 'right'],\n dflt: 'center',\n \n editType: 'arraydraw',\n \n },\n valign: {\n valType: 'enumerated',\n values: ['top', 'middle', 'bottom'],\n dflt: 'middle',\n \n editType: 'arraydraw',\n \n },\n bgcolor: {\n valType: 'color',\n dflt: 'rgba(0,0,0,0)',\n \n editType: 'arraydraw',\n \n },\n bordercolor: {\n valType: 'color',\n dflt: 'rgba(0,0,0,0)',\n \n editType: 'arraydraw',\n \n },\n borderpad: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'calcIfAutorange',\n \n },\n borderwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'calcIfAutorange',\n \n },\n // arrow\n showarrow: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calcIfAutorange',\n \n },\n arrowcolor: {\n valType: 'color',\n \n editType: 'arraydraw',\n \n },\n arrowhead: {\n valType: 'integer',\n min: 0,\n max: ARROWPATHS.length,\n dflt: 1,\n \n editType: 'arraydraw',\n \n },\n arrowsize: {\n valType: 'number',\n min: 0.3,\n dflt: 1,\n \n editType: 'calcIfAutorange',\n \n },\n arrowwidth: {\n valType: 'number',\n min: 0.1,\n \n editType: 'calcIfAutorange',\n \n },\n standoff: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'calcIfAutorange',\n \n },\n ax: {\n valType: 'any',\n \n editType: 'calcIfAutorange',\n \n },\n ay: {\n valType: 'any',\n \n editType: 'calcIfAutorange',\n \n },\n axref: {\n valType: 'enumerated',\n dflt: 'pixel',\n values: [\n 'pixel',\n cartesianConstants.idRegex.x.toString()\n ],\n \n editType: 'calc',\n \n },\n ayref: {\n valType: 'enumerated',\n dflt: 'pixel',\n values: [\n 'pixel',\n cartesianConstants.idRegex.y.toString()\n ],\n \n editType: 'calc',\n \n },\n // positioning\n xref: {\n valType: 'enumerated',\n values: [\n 'paper',\n cartesianConstants.idRegex.x.toString()\n ],\n \n editType: 'calc',\n \n },\n x: {\n valType: 'any',\n \n editType: 'calcIfAutorange',\n \n },\n xanchor: {\n valType: 'enumerated',\n values: ['auto', 'left', 'center', 'right'],\n dflt: 'auto',\n \n editType: 'calcIfAutorange',\n \n },\n xshift: {\n valType: 'number',\n dflt: 0,\n \n editType: 'calcIfAutorange',\n \n },\n yref: {\n valType: 'enumerated',\n values: [\n 'paper',\n cartesianConstants.idRegex.y.toString()\n ],\n \n editType: 'calc',\n \n },\n y: {\n valType: 'any',\n \n editType: 'calcIfAutorange',\n \n },\n yanchor: {\n valType: 'enumerated',\n values: ['auto', 'top', 'middle', 'bottom'],\n dflt: 'auto',\n \n editType: 'calcIfAutorange',\n \n },\n yshift: {\n valType: 'number',\n dflt: 0,\n \n editType: 'calcIfAutorange',\n \n },\n clicktoshow: {\n valType: 'enumerated',\n values: [false, 'onoff', 'onout'],\n dflt: false,\n \n editType: 'arraydraw',\n \n },\n xclick: {\n valType: 'any',\n \n editType: 'arraydraw',\n \n },\n yclick: {\n valType: 'any',\n \n editType: 'arraydraw',\n \n },\n hovertext: {\n valType: 'string',\n \n editType: 'arraydraw',\n \n },\n hoverlabel: {\n bgcolor: {\n valType: 'color',\n \n editType: 'arraydraw',\n \n },\n bordercolor: {\n valType: 'color',\n \n editType: 'arraydraw',\n \n },\n font: fontAttrs({\n editType: 'arraydraw',\n \n }),\n editType: 'arraydraw'\n },\n captureevents: {\n valType: 'boolean',\n \n editType: 'arraydraw',\n \n },\n editType: 'calc',\n\n _deprecated: {\n ref: {\n valType: 'string',\n \n editType: 'calc',\n \n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/attributes.js\n// module id = 101\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n\n // layout attribute name\n name: 'sliders',\n\n // class names\n containerClassName: 'slider-container',\n groupClassName: 'slider-group',\n inputAreaClass: 'slider-input-area',\n railRectClass: 'slider-rail-rect',\n railTouchRectClass: 'slider-rail-touch-rect',\n gripRectClass: 'slider-grip-rect',\n tickRectClass: 'slider-tick-rect',\n inputProxyClass: 'slider-input-proxy',\n labelsClass: 'slider-labels',\n labelGroupClass: 'slider-label-group',\n labelClass: 'slider-label',\n currentValueClass: 'slider-current-value',\n\n railHeight: 5,\n\n // DOM attribute name in button group keeping track\n // of active update menu\n menuIndexAttrName: 'slider-active-index',\n\n // id root pass to Plots.autoMargin\n autoMarginIdRoot: 'slider-',\n\n // min item width / height\n minWidth: 30,\n minHeight: 30,\n\n // padding around item text\n textPadX: 40,\n\n // arrow offset off right edge\n arrowOffsetX: 4,\n\n railRadius: 2,\n railWidth: 5,\n railBorder: 4,\n railBorderWidth: 1,\n railBorderColor: '#bec8d9',\n railBgColor: '#f8fafc',\n\n // The distance of the rail from the edge of the touchable area\n // Slightly less than the step inset because of the curved edges\n // of the rail\n railInset: 8,\n\n // The distance from the extremal tick marks to the edge of the\n // touchable area. This is basically the same as the grip radius,\n // but for other styles it wouldn't really need to be.\n stepInset: 10,\n\n gripRadius: 10,\n gripWidth: 20,\n gripHeight: 20,\n gripBorder: 20,\n gripBorderWidth: 1,\n gripBorderColor: '#bec8d9',\n gripBgColor: '#f6f8fa',\n gripBgActiveColor: '#dbdde0',\n\n labelPadding: 8,\n labelOffset: 0,\n\n tickWidth: 1,\n tickColor: '#333',\n tickOffset: 25,\n tickLength: 7,\n\n minorTickOffset: 25,\n minorTickColor: '#333',\n minorTickLength: 4,\n\n // Extra space below the current value label:\n currentValuePadding: 8,\n currentValueInset: 0,\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/sliders/constants.js\n// module id = 102\n// module chunks = 0","import * as wait from 'helpers/wait';\nimport * as error from 'helpers/error';\n\nexport function request(uri, method, data, options) {\n var request = {\n url: uri,\n type: method,\n contentType: 'application/json',\n accepts: 'application/json',\n cache: false,\n dataType: 'json',\n data: JSON.stringify(data),\n };\n\n var d = { cb: [], error_cb: [], fd: false, fe: false, d: null };\n console.log(request);\n\n if (options) {\n if (options.cache) request.cache = options.cache;\n }\n\n function success(data) {\n wait.hide();\n if (data.error !== undefined && data.error != 'none') {\n error.show(data.error);\n return;\n }\n for (var i in d.cb) {\n d.cb[i](data);\n }\n d.d = data;\n }\n\n function failure() {\n d.fe = true;\n console.log('Got a failure');\n wait.hide();\n console.log(d.error_cb);\n for (var i in d.error_cb) {\n d.error_cb[i]();\n }\n }\n\n request.error = failure;\n\n d.done = function(cb) {\n if (d.fd) {\n cb(d.d);\n return;\n }\n d.cb.push(cb);\n };\n\n d.error = function(cb) {\n if (d.fe) {\n cb();\n }\n d.error_cb.push(cb);\n };\n\n wait.show();\n let req = $.ajax(request);\n\n req.done(success);\n req.fail(failure);\n\n return d;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./external_modules/helpers/ajax.js","import sprintf from 'sprintf';\nimport 'bootstrap';\n\nimport * as multi from 'helpers/multimodal';\n\nrequire.resolve('./helper.less');\n\nvar code = [\n '
',\n '
',\n '
',\n '

%(process_msg)s

',\n '
',\n '
',\n '
',\n '
',\n '
',\n '
',\n '
',\n '
',\n '
',\n].join('');\n\ncode = sprintf(code, { process_msg: 'Processing...' });\nvar pleaseWaitDiv = $(code);\nvar pleaseWaitDivInit = $(code);\nvar recurse = 0;\n\nfunction show(immediate) {\n if (recurse > 0) {\n recurse++;\n return;\n }\n recurse = 1;\n multi.ensure(\n pleaseWaitDiv,\n function() {\n pleaseWaitDiv.modal();\n },\n immediate,\n function() {\n pleaseWaitDiv.modal('hide');\n recurse--;\n }\n );\n}\n\nfunction hide(force) {\n multi.end(pleaseWaitDiv);\n}\n\nfunction showInit(immediate) {\n multi.ensure(\n pleaseWaitDivInit,\n function() {\n pleaseWaitDivInit.modal();\n },\n immediate\n );\n}\n\nfunction hideInit(force) {\n multi.end(pleaseWaitDivInit);\n}\n\nexport { show, hide, showInit, hideInit };\n\n\n\n// WEBPACK FOOTER //\n// ./external_modules/helpers/wait.js","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * This will be transferred over to gd and overridden by\n * config args to Plotly.plot.\n *\n * The defaults are the appropriate settings for plotly.js,\n * so we get the right experience without any config argument.\n */\n\nmodule.exports = {\n\n // no interactivity, for export or image generation\n staticPlot: false,\n\n // we can edit titles, move annotations, etc - sets all pieces of `edits`\n // unless a separate `edits` config item overrides individual parts\n editable: false,\n edits: {\n // annotationPosition: the main anchor of the annotation, which is the\n // text (if no arrow) or the arrow (which drags the whole thing leaving\n // the arrow length & direction unchanged)\n annotationPosition: false,\n // just for annotations with arrows, change the length and direction of the arrow\n annotationTail: false,\n annotationText: false,\n axisTitleText: false,\n colorbarPosition: false,\n colorbarTitleText: false,\n legendPosition: false,\n // edit the trace name fields from the legend\n legendText: false,\n shapePosition: false,\n // the global `layout.title`\n titleText: false\n },\n\n // DO autosize once regardless of layout.autosize\n // (use default width or height values otherwise)\n autosizable: false,\n\n // set the length of the undo/redo queue\n queueLength: 0,\n\n // if we DO autosize, do we fill the container or the screen?\n fillFrame: false,\n\n // if we DO autosize, set the frame margins in percents of plot size\n frameMargins: 0,\n\n // mousewheel or two-finger scroll zooms the plot\n scrollZoom: false,\n\n // double click interaction (false, 'reset', 'autosize' or 'reset+autosize')\n doubleClick: 'reset+autosize',\n\n // new users see some hints about interactivity\n showTips: true,\n\n // enable axis pan/zoom drag handles\n showAxisDragHandles: true,\n\n // enable direct range entry at the pan/zoom drag points (drag handles must be enabled above)\n showAxisRangeEntryBoxes: true,\n\n // link to open this plot in plotly\n showLink: false,\n\n // if we show a link, does it contain data or just link to a plotly file?\n sendData: true,\n\n // text appearing in the sendData link\n linkText: 'Edit chart',\n\n // false or function adding source(s) to linkText \n showSources: false,\n\n // display the mode bar (true, false, or 'hover')\n displayModeBar: 'hover',\n\n // remove mode bar button by name\n // (see ./components/modebar/buttons.js for the list of names)\n modeBarButtonsToRemove: [],\n\n // add mode bar button using config objects\n // (see ./components/modebar/buttons.js for list of arguments)\n modeBarButtonsToAdd: [],\n\n // fully custom mode bar buttons as nested array,\n // where the outer arrays represents button groups, and\n // the inner arrays have buttons config objects or names of default buttons\n // (see ./components/modebar/buttons.js for more info)\n modeBarButtons: false,\n\n // add the plotly logo on the end of the mode bar\n displaylogo: true,\n\n // increase the pixel ratio for Gl plot images\n plotGlPixelRatio: 2,\n\n // background setting function\n // 'transparent' sets the background `layout.paper_color`\n // 'opaque' blends bg color with white ensuring an opaque background\n // or any other custom function of gd\n setBackground: 'transparent',\n\n // URL to topojson files used in geo charts\n topojsonURL: 'https://cdn.plot.ly/',\n\n // Mapbox access token (required to plot mapbox trace types)\n // If using an Mapbox Atlas server, set this option to '',\n // so that plotly.js won't attempt to authenticate to the public Mapbox server.\n mapboxAccessToken: null,\n\n // Turn all console logging on or off (errors will be thrown)\n // This should ONLY be set via Plotly.setPlotConfig\n logging: false,\n\n // Set global transform to be applied to all traces with no\n // specification needed\n globalTransforms: []\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/plot_config.js\n// module id = 131\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function noop() {};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/noop.js\n// module id = 132\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = require('../../plots/font_attributes');\n\nmodule.exports = {\n hoverlabel: {\n bgcolor: {\n valType: 'color',\n \n arrayOk: true,\n editType: 'none',\n \n },\n bordercolor: {\n valType: 'color',\n \n arrayOk: true,\n editType: 'none',\n \n },\n font: fontAttrs({\n arrayOk: true,\n editType: 'none',\n \n }),\n namelength: {\n valType: 'integer',\n min: -1,\n arrayOk: true,\n \n editType: 'none',\n \n },\n editType: 'calc'\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/attributes.js\n// module id = 133\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Return true for arrays, whether they're untyped or not.\n */\n\n// IE9 fallback\nvar ab = (typeof ArrayBuffer === 'undefined' || !ArrayBuffer.isView) ?\n {isView: function() { return false; }} :\n ArrayBuffer;\n\nmodule.exports = function isArray(a) {\n return Array.isArray(a) || ab.isView(a);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/is_array.js\n// module id = 134\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * sanitized modulus function that always returns in the range [0, d)\n * rather than (-d, 0] if v is negative\n */\nmodule.exports = function mod(v, d) {\n var out = v % d;\n return out < 0 ? out + d : out;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/mod.js\n// module id = 135\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\n/**\n * convert a linear value into a logged value, folding negative numbers into\n * the given range\n */\nmodule.exports = function toLogRange(val, range) {\n if(val > 0) return Math.log(val) / Math.LN10;\n\n // move a negative value reference to a log axis - just put the\n // result at the lowest range value on the plot (or if the range also went negative,\n // one millionth of the top of the range)\n var newVal = Math.log(Math.min(range[0], range[1])) / Math.LN10;\n if(!isNumeric(newVal)) newVal = Math.log(Math.max(range[0], range[1])) / Math.LN10 - 6;\n return newVal;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/to_log_range.js\n// module id = 136\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar timerCache = {};\n\n/**\n * Throttle a callback. `callback` executes synchronously only if\n * more than `minInterval` milliseconds have already elapsed since the latest\n * call (if any). Otherwise we wait until `minInterval` is over and execute the\n * last callback received while waiting.\n * So the first and last events in a train are always executed (eventually)\n * but some of the events in the middle can be dropped.\n *\n * @param {string} id: an identifier to mark events to throttle together\n * @param {number} minInterval: minimum time, in milliseconds, between\n * invocations of `callback`\n * @param {function} callback: the function to throttle. `callback` itself\n * should be a purely synchronous function.\n */\nexports.throttle = function throttle(id, minInterval, callback) {\n var cache = timerCache[id];\n var now = Date.now();\n\n if(!cache) {\n /*\n * Throw out old items before making a new one, to prevent the cache\n * getting overgrown, for example from old plots that have been replaced.\n * 1 minute age is arbitrary.\n */\n for(var idi in timerCache) {\n if(timerCache[idi].ts < now - 60000) {\n delete timerCache[idi];\n }\n }\n cache = timerCache[id] = {ts: 0, timer: null};\n }\n\n _clearTimeout(cache);\n\n function exec() {\n callback();\n cache.ts = Date.now();\n if(cache.onDone) {\n cache.onDone();\n cache.onDone = null;\n }\n }\n\n if(now > cache.ts + minInterval) {\n exec();\n return;\n }\n\n cache.timer = setTimeout(function() {\n exec();\n cache.timer = null;\n }, minInterval);\n};\n\nexports.done = function(id) {\n var cache = timerCache[id];\n if(!cache || !cache.timer) return Promise.resolve();\n\n return new Promise(function(resolve) {\n var previousOnDone = cache.onDone;\n cache.onDone = function onDone() {\n if(previousOnDone) previousOnDone();\n resolve();\n cache.onDone = null;\n };\n });\n};\n\n/**\n * Clear the throttle cache for one or all timers\n * @param {optional string} id:\n * if provided, clear just this timer\n * if omitted, clear all timers (mainly useful for testing)\n */\nexports.clear = function(id) {\n if(id) {\n _clearTimeout(timerCache[id]);\n delete timerCache[id];\n }\n else {\n for(var idi in timerCache) exports.clear(idi);\n }\n};\n\nfunction _clearTimeout(cache) {\n if(cache && cache.timer !== null) {\n clearTimeout(cache.timer);\n cache.timer = null;\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/throttle.js\n// module id = 137\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n mode: {\n valType: 'enumerated',\n dflt: 'afterall',\n \n values: ['immediate', 'next', 'afterall'],\n \n },\n direction: {\n valType: 'enumerated',\n \n values: ['forward', 'reverse'],\n dflt: 'forward',\n \n },\n fromcurrent: {\n valType: 'boolean',\n dflt: false,\n \n \n },\n frame: {\n duration: {\n valType: 'number',\n \n min: 0,\n dflt: 500,\n \n },\n redraw: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n },\n transition: {\n duration: {\n valType: 'number',\n \n min: 0,\n dflt: 500,\n \n },\n easing: {\n valType: 'enumerated',\n dflt: 'cubic-in-out',\n values: [\n 'linear',\n 'quad',\n 'cubic',\n 'sin',\n 'exp',\n 'circle',\n 'elastic',\n 'back',\n 'bounce',\n 'linear-in',\n 'quad-in',\n 'cubic-in',\n 'sin-in',\n 'exp-in',\n 'circle-in',\n 'elastic-in',\n 'back-in',\n 'bounce-in',\n 'linear-out',\n 'quad-out',\n 'cubic-out',\n 'sin-out',\n 'exp-out',\n 'circle-out',\n 'elastic-out',\n 'back-out',\n 'bounce-out',\n 'linear-in-out',\n 'quad-in-out',\n 'cubic-in-out',\n 'sin-in-out',\n 'exp-in-out',\n 'circle-in-out',\n 'elastic-in-out',\n 'back-in-out',\n 'bounce-in-out'\n ],\n \n \n },\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/animation_attributes.js\n// module id = 138\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nexports.dash = {\n valType: 'string',\n // string type usually doesn't take values... this one should really be\n // a special type or at least a special coercion function, from the GUI\n // you only get these values but elsewhere the user can supply a list of\n // dash lengths in px, and it will be honored\n values: ['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'],\n dflt: 'solid',\n \n editType: 'style',\n \n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/drawing/attributes.js\n// module id = 139\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar scales = require('./scales');\nvar isValidScaleArray = require('./is_valid_scale_array');\n\n\nmodule.exports = function isValidScale(scl) {\n if(scales[scl] !== undefined) return true;\n else return isValidScaleArray(scl);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/is_valid_scale.js\n// module id = 140\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = function flipScale(scl) {\n var N = scl.length,\n sclNew = new Array(N),\n si;\n\n for(var i = N - 1, j = 0; i >= 0; i--, j++) {\n si = scl[i];\n sclNew[j] = [1 - si[0], si[1]];\n }\n\n return sclNew;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/flip_scale.js\n// module id = 141\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\nvar scales = require('./scales');\nvar flipScale = require('./flip_scale');\n\n\nmodule.exports = function calc(trace, vals, containerStr, cLetter) {\n var container, inputContainer;\n\n if(containerStr) {\n container = Lib.nestedProperty(trace, containerStr).get();\n inputContainer = Lib.nestedProperty(trace._input, containerStr).get();\n }\n else {\n container = trace;\n inputContainer = trace._input;\n }\n\n var autoAttr = cLetter + 'auto',\n minAttr = cLetter + 'min',\n maxAttr = cLetter + 'max',\n auto = container[autoAttr],\n min = container[minAttr],\n max = container[maxAttr],\n scl = container.colorscale;\n\n if(auto !== false || min === undefined) {\n min = Lib.aggNums(Math.min, null, vals);\n }\n\n if(auto !== false || max === undefined) {\n max = Lib.aggNums(Math.max, null, vals);\n }\n\n if(min === max) {\n min -= 0.5;\n max += 0.5;\n }\n\n container[minAttr] = min;\n container[maxAttr] = max;\n\n inputContainer[minAttr] = min;\n inputContainer[maxAttr] = max;\n\n /*\n * If auto was explicitly false but min or max was missing,\n * we filled in the missing piece here but later the trace does\n * not look auto.\n * Otherwise make sure the trace still looks auto as far as later\n * changes are concerned.\n */\n inputContainer[autoAttr] = (auto !== false ||\n (min === undefined && max === undefined));\n\n if(container.autocolorscale) {\n if(min * max < 0) scl = scales.RdBu;\n else if(min >= 0) scl = scales.Reds;\n else scl = scales.Blues;\n\n // reversescale is handled at the containerOut level\n inputContainer.colorscale = scl;\n if(container.reversescale) scl = flipScale(scl);\n container.colorscale = scl;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/calc.js\n// module id = 142\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n PTS_LINESONLY: 20,\n\n // fixed parameters of clustering and clipping algorithms\n\n // fraction of clustering tolerance \"so close we don't even consider it a new point\"\n minTolerance: 0.2,\n // how fast does clustering tolerance increase as you get away from the visible region\n toleranceGrowth: 10,\n\n // number of viewport sizes away from the visible region\n // at which we clip all lines to the perimeter\n maxScreensAway: 20\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/constants.js\n// module id = 143\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Registry = require('../../registry');\nvar Lib = require('../../lib');\n\nvar attributes = require('./attributes');\n\n\nmodule.exports = function(traceIn, traceOut, defaultColor, opts) {\n var objName = 'error_' + opts.axis,\n containerOut = traceOut[objName] = {},\n containerIn = traceIn[objName] || {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);\n }\n\n var hasErrorBars = (\n containerIn.array !== undefined ||\n containerIn.value !== undefined ||\n containerIn.type === 'sqrt'\n );\n\n var visible = coerce('visible', hasErrorBars);\n\n if(visible === false) return;\n\n var type = coerce('type', 'array' in containerIn ? 'data' : 'percent'),\n symmetric = true;\n\n if(type !== 'sqrt') {\n symmetric = coerce('symmetric',\n !((type === 'data' ? 'arrayminus' : 'valueminus') in containerIn));\n }\n\n if(type === 'data') {\n var array = coerce('array');\n if(!array) containerOut.array = [];\n coerce('traceref');\n if(!symmetric) {\n var arrayminus = coerce('arrayminus');\n if(!arrayminus) containerOut.arrayminus = [];\n coerce('tracerefminus');\n }\n }\n else if(type === 'percent' || type === 'constant') {\n coerce('value');\n if(!symmetric) coerce('valueminus');\n }\n\n var copyAttr = 'copy_' + opts.inherit + 'style';\n if(opts.inherit) {\n var inheritObj = traceOut['error_' + opts.inherit];\n if((inheritObj || {}).visible) {\n coerce(copyAttr, !(containerIn.color ||\n isNumeric(containerIn.thickness) ||\n isNumeric(containerIn.width)));\n }\n }\n if(!opts.inherit || !containerOut[copyAttr]) {\n coerce('color', defaultColor);\n coerce('thickness');\n coerce('width', Registry.traceIs(traceOut, 'gl3d') ? 0 : 4);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/errorbars/defaults.js\n// module id = 144\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar Plotly = require('../../plotly');\nvar Plots = require('../../plots/plots');\nvar Lib = require('../../lib');\nvar Drawing = require('../drawing');\nvar Color = require('../color');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar interactConstants = require('../../constants/interactions');\n\nvar PLACEHOLDER_RE = /Click to enter .+ title/;\n\nvar Titles = module.exports = {};\n\n/**\n * Titles - (re)draw titles on the axes and plot:\n * @param {DOM element} gd - the graphDiv\n * @param {string} titleClass - the css class of this title\n * @param {object} options - how and what to draw\n * propContainer - the layout object containing `title` and `titlefont`\n * attributes that apply to this title\n * propName - the full name of the title property (for Plotly.relayout)\n * [traceIndex] - include only if this property applies to one trace\n * (such as a colorbar title) - then editing pipes to Plotly.restyle\n * instead of Plotly.relayout\n * dfltName - the name of the title in placeholder text\n * [avoid] {object} - include if this title should move to avoid other elements\n * selection - d3 selection of elements to avoid\n * side - which direction to move if there is a conflict\n * [offsetLeft] - if these elements are subject to a translation\n * wrt the title element\n * [offsetTop]\n * attributes {object} - position and alignment attributes\n * x - pixels\n * y - pixels\n * text-anchor - start|middle|end\n * transform {object} - how to transform the title after positioning\n * rotate - degrees\n * offset - shift up/down in the rotated frame (unused?)\n * containerGroup - if an svg element already exists to hold this\n * title, include here. Otherwise it will go in fullLayout._infolayer\n */\nTitles.draw = function(gd, titleClass, options) {\n var cont = options.propContainer;\n var prop = options.propName;\n var traceIndex = options.traceIndex;\n var name = options.dfltName;\n var avoid = options.avoid || {};\n var attributes = options.attributes;\n var transform = options.transform;\n var group = options.containerGroup;\n\n var fullLayout = gd._fullLayout;\n var font = cont.titlefont.family;\n var fontSize = cont.titlefont.size;\n var fontColor = cont.titlefont.color;\n\n var opacity = 1;\n var isplaceholder = false;\n var txt = cont.title.trim();\n\n // only make this title editable if we positively identify its property\n // as one that has editing enabled.\n var editAttr;\n if(prop === 'title') editAttr = 'titleText';\n else if(prop.indexOf('axis') !== -1) editAttr = 'axisTitleText';\n else if(prop.indexOf('colorbar' !== -1)) editAttr = 'colorbarTitleText';\n var editable = gd._context.edits[editAttr];\n\n if(txt === '') opacity = 0;\n if(txt.match(PLACEHOLDER_RE)) {\n opacity = 0.2;\n isplaceholder = true;\n if(!editable) txt = '';\n }\n\n var elShouldExist = txt || editable;\n\n if(!group) {\n group = fullLayout._infolayer.selectAll('.g-' + titleClass)\n .data([0]);\n group.enter().append('g')\n .classed('g-' + titleClass, true);\n }\n\n var el = group.selectAll('text')\n .data(elShouldExist ? [0] : []);\n el.enter().append('text');\n el.text(txt)\n // this is hacky, but convertToTspans uses the class\n // to determine whether to rotate mathJax...\n // so we need to clear out any old class and put the\n // correct one (only relevant for colorbars, at least\n // for now) - ie don't use .classed\n .attr('class', titleClass);\n el.exit().remove();\n\n if(!elShouldExist) return;\n\n function titleLayout(titleEl) {\n Lib.syncOrAsync([drawTitle, scootTitle], titleEl);\n }\n\n function drawTitle(titleEl) {\n titleEl.attr('transform', transform ?\n 'rotate(' + [transform.rotate, attributes.x, attributes.y] +\n ') translate(0, ' + transform.offset + ')' :\n null);\n\n titleEl.style({\n 'font-family': font,\n 'font-size': d3.round(fontSize, 2) + 'px',\n fill: Color.rgb(fontColor),\n opacity: opacity * Color.opacity(fontColor),\n 'font-weight': Plots.fontWeight\n })\n .attr(attributes)\n .call(svgTextUtils.convertToTspans, gd);\n\n return Plots.previousPromises(gd);\n }\n\n function scootTitle(titleElIn) {\n var titleGroup = d3.select(titleElIn.node().parentNode);\n\n if(avoid && avoid.selection && avoid.side && txt) {\n titleGroup.attr('transform', null);\n\n // move toward avoid.side (= left, right, top, bottom) if needed\n // can include pad (pixels, default 2)\n var shift = 0;\n var backside = {\n left: 'right',\n right: 'left',\n top: 'bottom',\n bottom: 'top'\n }[avoid.side];\n var shiftSign = (['left', 'top'].indexOf(avoid.side) !== -1) ?\n -1 : 1;\n var pad = isNumeric(avoid.pad) ? avoid.pad : 2;\n var titlebb = Drawing.bBox(titleGroup.node());\n var paperbb = {\n left: 0,\n top: 0,\n right: fullLayout.width,\n bottom: fullLayout.height\n };\n var maxshift = avoid.maxShift || (\n (paperbb[avoid.side] - titlebb[avoid.side]) *\n ((avoid.side === 'left' || avoid.side === 'top') ? -1 : 1));\n // Prevent the title going off the paper\n if(maxshift < 0) shift = maxshift;\n else {\n // so we don't have to offset each avoided element,\n // give the title the opposite offset\n var offsetLeft = avoid.offsetLeft || 0;\n var offsetTop = avoid.offsetTop || 0;\n titlebb.left -= offsetLeft;\n titlebb.right -= offsetLeft;\n titlebb.top -= offsetTop;\n titlebb.bottom -= offsetTop;\n\n // iterate over a set of elements (avoid.selection)\n // to avoid collisions with\n avoid.selection.each(function() {\n var avoidbb = Drawing.bBox(this);\n\n if(Lib.bBoxIntersect(titlebb, avoidbb, pad)) {\n shift = Math.max(shift, shiftSign * (\n avoidbb[avoid.side] - titlebb[backside]) + pad);\n }\n });\n shift = Math.min(maxshift, shift);\n }\n if(shift > 0 || maxshift < 0) {\n var shiftTemplate = {\n left: [-shift, 0],\n right: [shift, 0],\n top: [0, -shift],\n bottom: [0, shift]\n }[avoid.side];\n titleGroup.attr('transform',\n 'translate(' + shiftTemplate + ')');\n }\n }\n }\n\n el.call(titleLayout);\n\n var placeholderText = 'Click to enter ' + name + ' title';\n\n function setPlaceholder() {\n opacity = 0;\n isplaceholder = true;\n txt = placeholderText;\n el.text(txt)\n .on('mouseover.opacity', function() {\n d3.select(this).transition()\n .duration(interactConstants.SHOW_PLACEHOLDER).style('opacity', 1);\n })\n .on('mouseout.opacity', function() {\n d3.select(this).transition()\n .duration(interactConstants.HIDE_PLACEHOLDER).style('opacity', 0);\n });\n }\n\n if(editable) {\n if(!txt) setPlaceholder();\n else el.on('.opacity', null);\n\n el.call(svgTextUtils.makeEditable, {gd: gd})\n .on('edit', function(text) {\n if(traceIndex !== undefined) Plotly.restyle(gd, prop, text, traceIndex);\n else Plotly.relayout(gd, prop, text);\n })\n .on('cancel', function() {\n this.text(this.attr('data-unformatted'))\n .call(titleLayout);\n })\n .on('input', function(d) {\n this.text(d || ' ')\n .call(svgTextUtils.positionText, attributes.x, attributes.y);\n });\n }\n el.classed('js-placeholder', isplaceholder);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/titles/index.js\n// module id = 145\n// module chunks = 0","'use strict';\n\nmodule.exports = {\n 'undo': {\n 'width': 857.1,\n 'path': 'm857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z',\n 'ascent': 850,\n 'descent': -150\n },\n 'home': {\n 'width': 928.6,\n 'path': 'm786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z',\n 'ascent': 850,\n 'descent': -150\n },\n 'camera-retro': {\n 'width': 1000,\n 'path': 'm518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z',\n 'ascent': 850,\n 'descent': -150\n },\n 'zoombox': {\n 'width': 1000,\n 'path': 'm1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z',\n 'ascent': 850,\n 'descent': -150\n },\n 'pan': {\n 'width': 1000,\n 'path': 'm1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z',\n 'ascent': 850,\n 'descent': -150\n },\n 'zoom_plus': {\n 'width': 1000,\n 'path': 'm1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z',\n 'ascent': 850,\n 'descent': -150\n },\n 'zoom_minus': {\n 'width': 1000,\n 'path': 'm0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z',\n 'ascent': 850,\n 'descent': -150\n },\n 'autoscale': {\n 'width': 1000,\n 'path': 'm250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z',\n 'ascent': 850,\n 'descent': -150\n },\n 'tooltip_basic': {\n 'width': 1500,\n 'path': 'm375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z',\n 'ascent': 850,\n 'descent': -150\n },\n 'tooltip_compare': {\n 'width': 1125,\n 'path': 'm187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z',\n 'ascent': 850,\n 'descent': -150\n },\n 'plotlylogo': {\n 'width': 1542,\n 'path': 'm0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z',\n 'ascent': 850,\n 'descent': -150\n },\n 'z-axis': {\n 'width': 1000,\n 'path': 'm833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z',\n 'ascent': 850,\n 'descent': -150\n },\n '3d_rotate': {\n 'width': 1000,\n 'path': 'm922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z',\n 'ascent': 850,\n 'descent': -150\n },\n 'camera': {\n 'width': 1000,\n 'path': 'm500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z',\n 'ascent': 850,\n 'descent': -150\n },\n 'movie': {\n 'width': 1000,\n 'path': 'm938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z',\n 'ascent': 850,\n 'descent': -150\n },\n 'question': {\n 'width': 857.1,\n 'path': 'm500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z',\n 'ascent': 850,\n 'descent': -150\n },\n 'disk': {\n 'width': 857.1,\n 'path': 'm214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z',\n 'ascent': 850,\n 'descent': -150\n },\n 'lasso': {\n 'width': 1031,\n 'path': 'm1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z',\n 'ascent': 850,\n 'descent': -150\n },\n 'selectbox': {\n 'width': 1000,\n 'path': 'm0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z',\n 'ascent': 850,\n 'descent': -150\n },\n 'spikeline': {\n 'width': 1000,\n 'path': 'M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z',\n 'ascent': 850,\n 'descent': -150\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/build/ploticon.js\n// module id = 146\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar toImage = require('../plot_api/to_image');\nvar Lib = require('../lib'); // for isIE\nvar fileSaver = require('./filesaver');\n\n/**\n * @param {object} gd figure Object\n * @param {object} opts option object\n * @param opts.format 'jpeg' | 'png' | 'webp' | 'svg'\n * @param opts.width width of snapshot in px\n * @param opts.height height of snapshot in px\n * @param opts.filename name of file excluding extension\n */\nfunction downloadImage(gd, opts) {\n\n // check for undefined opts\n opts = opts || {};\n\n // default to png\n opts.format = opts.format || 'png';\n\n return new Promise(function(resolve, reject) {\n if(gd._snapshotInProgress) {\n reject(new Error('Snapshotting already in progress.'));\n }\n\n // see comments within svgtoimg for additional\n // discussion of problems with IE\n // can now draw to canvas, but CORS tainted canvas\n // does not allow toDataURL\n // svg format will work though\n if(Lib.isIE() && opts.format !== 'svg') {\n reject(new Error('Sorry IE does not support downloading from canvas. Try {format:\\'svg\\'} instead.'));\n }\n\n gd._snapshotInProgress = true;\n var promise = toImage(gd, opts);\n\n var filename = opts.filename || gd.fn || 'newplot';\n filename += '.' + opts.format;\n\n promise.then(function(result) {\n gd._snapshotInProgress = false;\n return fileSaver(result, filename);\n }).then(function(name) {\n resolve(name);\n }).catch(function(err) {\n gd._snapshotInProgress = false;\n reject(err);\n });\n });\n}\n\nmodule.exports = downloadImage;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/snapshot/download.js\n// module id = 147\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nexports.getDelay = function(fullLayout) {\n\n // polar clears fullLayout._has for some reason\n if(!fullLayout._has) return 0;\n\n // maybe we should add a 'gl' (and 'svg') layoutCategory ??\n return (fullLayout._has('gl3d') || fullLayout._has('gl2d')) ? 500 : 0;\n};\n\nexports.getRedrawFunc = function(gd) {\n\n // do not work if polar is present\n if((gd.data && gd.data[0] && gd.data[0].r)) return;\n\n return function() {\n (gd.calcdata || []).forEach(function(d) {\n if(d[0] && d[0].t && d[0].t.cb) d[0].t.cb();\n });\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/snapshot/helpers.js\n// module id = 148\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Lib = require('../lib');\nvar Drawing = require('../components/drawing');\nvar Color = require('../components/color');\n\nvar xmlnsNamespaces = require('../constants/xmlns_namespaces');\nvar DOUBLEQUOTE_REGEX = /\"/g;\nvar DUMMY_SUB = 'TOBESTRIPPED';\nvar DUMMY_REGEX = new RegExp('(\"' + DUMMY_SUB + ')|(' + DUMMY_SUB + '\")', 'g');\n\nfunction htmlEntityDecode(s) {\n var hiddenDiv = d3.select('body').append('div').style({display: 'none'}).html('');\n var replaced = s.replace(/(&[^;]*;)/gi, function(d) {\n if(d === '<') { return '<'; } // special handling for brackets\n if(d === '&rt;') { return '>'; }\n if(d.indexOf('<') !== -1 || d.indexOf('>') !== -1) { return ''; }\n return hiddenDiv.html(d).text(); // everything else, let the browser decode it to unicode\n });\n hiddenDiv.remove();\n return replaced;\n}\n\nfunction xmlEntityEncode(str) {\n return str.replace(/&(?!\\w+;|\\#[0-9]+;| \\#x[0-9A-F]+;)/g, '&');\n}\n\nmodule.exports = function toSVG(gd, format, scale) {\n var fullLayout = gd._fullLayout;\n var svg = fullLayout._paper;\n var toppaper = fullLayout._toppaper;\n var width = fullLayout.width;\n var height = fullLayout.height;\n var i;\n\n // make background color a rect in the svg, then revert after scraping\n // all other alterations have been dealt with by properly preparing the svg\n // in the first place... like setting cursors with css classes so we don't\n // have to remove them, and providing the right namespaces in the svg to\n // begin with\n svg.insert('rect', ':first-child')\n .call(Drawing.setRect, 0, 0, width, height)\n .call(Color.fill, fullLayout.paper_bgcolor);\n\n // subplot-specific to-SVG methods\n // which notably add the contents of the gl-container\n // into the main svg node\n var basePlotModules = fullLayout._basePlotModules || [];\n for(i = 0; i < basePlotModules.length; i++) {\n var _module = basePlotModules[i];\n\n if(_module.toSVG) _module.toSVG(gd);\n }\n\n // add top items above them assumes everything in toppaper is either\n // a group or a defs, and if it's empty (like hoverlayer) we can ignore it.\n if(toppaper) {\n var nodes = toppaper.node().childNodes;\n\n // make copy of nodes as childNodes prop gets mutated in loop below\n var topGroups = Array.prototype.slice.call(nodes);\n\n for(i = 0; i < topGroups.length; i++) {\n var topGroup = topGroups[i];\n\n if(topGroup.childNodes.length) svg.node().appendChild(topGroup);\n }\n }\n\n // remove draglayer for Adobe Illustrator compatibility\n if(fullLayout._draggers) {\n fullLayout._draggers.remove();\n }\n\n // in case the svg element had an explicit background color, remove this\n // we want the rect to get the color so it's the right size; svg bg will\n // fill whatever container it's displayed in regardless of plot size.\n svg.node().style.background = '';\n\n svg.selectAll('text')\n .attr({'data-unformatted': null, 'data-math': null})\n .each(function() {\n var txt = d3.select(this);\n\n // hidden text is pre-formatting mathjax, the browser ignores it\n // but in a static plot it's useless and it can confuse batik\n // we've tried to standardize on display:none but make sure we still\n // catch visibility:hidden if it ever arises\n if(this.style.visibility === 'hidden' || this.style.display === 'none') {\n txt.remove();\n return;\n }\n else {\n // clear other visibility/display values to default\n // to not potentially confuse non-browser SVG implementations\n txt.style({visibility: null, display: null});\n }\n\n // Font family styles break things because of quotation marks,\n // so we must remove them *after* the SVG DOM has been serialized\n // to a string (browsers convert singles back)\n var ff = this.style.fontFamily;\n if(ff && ff.indexOf('\"') !== -1) {\n txt.style('font-family', ff.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));\n }\n });\n\n svg.selectAll('.point,.scatterpts').each(function() {\n var pt = d3.select(this);\n var fill = this.style.fill;\n\n // similar to font family styles above,\n // we must remove \" after the SVG DOM has been serialized\n if(fill && fill.indexOf('url(') !== -1) {\n pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));\n }\n });\n\n if(format === 'pdf' || format === 'eps') {\n // these formats make the extra line MathJax adds around symbols look super thick in some cases\n // it looks better if this is removed entirely.\n svg.selectAll('#MathJax_SVG_glyphs path')\n .attr('stroke-width', 0);\n }\n\n // fix for IE namespacing quirk?\n // http://stackoverflow.com/questions/19610089/unwanted-namespaces-on-svg-markup-when-using-xmlserializer-in-javascript-with-ie\n svg.node().setAttributeNS(xmlnsNamespaces.xmlns, 'xmlns', xmlnsNamespaces.svg);\n svg.node().setAttributeNS(xmlnsNamespaces.xmlns, 'xmlns:xlink', xmlnsNamespaces.xlink);\n\n if(format === 'svg' && scale) {\n svg.attr('width', scale * width);\n svg.attr('height', scale * height);\n svg.attr('viewBox', '0 0 ' + width + ' ' + height);\n }\n\n var s = new window.XMLSerializer().serializeToString(svg.node());\n s = htmlEntityDecode(s);\n s = xmlEntityEncode(s);\n\n // Fix quotations around font strings and gradient URLs\n s = s.replace(DUMMY_REGEX, '\\'');\n\n // IE is very strict, so we will need to clean\n // svg with the following regex\n // yes this is messy, but do not know a better way\n // Even with this IE will not work due to tainted canvas\n // see https://github.com/kangax/fabric.js/issues/1957\n // http://stackoverflow.com/questions/18112047/canvas-todataurl-working-in-all-browsers-except-ie10\n // Leave here just in case the CORS/tainted IE issue gets resolved\n if(Lib.isIE()) {\n // replace double quote with single quote\n s = s.replace(/\"/gi, '\\'');\n // url in svg are single quoted\n // since we changed double to single\n // we'll need to change these to double-quoted\n s = s.replace(/(\\('#)([^']*)('\\))/gi, '(\\\"#$2\\\")');\n // font names with spaces will be escaped single-quoted\n // we'll need to change these to double-quoted\n s = s.replace(/(\\\\')/gi, '\\\"');\n }\n\n return s;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/snapshot/tosvg.js\n// module id = 149\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../lib');\nvar EventEmitter = require('events').EventEmitter;\n\nfunction svgToImg(opts) {\n var ev = opts.emitter || new EventEmitter();\n\n var promise = new Promise(function(resolve, reject) {\n var Image = window.Image;\n var svg = opts.svg;\n var format = opts.format || 'png';\n\n // IE only support svg\n if(Lib.isIE() && format !== 'svg') {\n var ieSvgError = new Error('Sorry IE does not support downloading from canvas. Try {format:\\'svg\\'} instead.');\n reject(ieSvgError);\n // eventually remove the ev\n // in favor of promises\n if(!opts.promise) {\n return ev.emit('error', ieSvgError);\n } else {\n return promise;\n }\n }\n\n var canvas = opts.canvas;\n var scale = opts.scale || 1;\n var w0 = opts.width || 300;\n var h0 = opts.height || 150;\n var w1 = scale * w0;\n var h1 = scale * h0;\n\n var ctx = canvas.getContext('2d');\n var img = new Image();\n\n // for Safari support, eliminate createObjectURL\n // this decision could cause problems if content\n // is not restricted to svg\n var url = 'data:image/svg+xml,' + encodeURIComponent(svg);\n\n canvas.width = w1;\n canvas.height = h1;\n\n img.onload = function() {\n var imgData;\n\n // don't need to draw to canvas if svg\n // save some time and also avoid failure on IE\n if(format !== 'svg') {\n ctx.drawImage(img, 0, 0, w1, h1);\n }\n\n switch(format) {\n case 'jpeg':\n imgData = canvas.toDataURL('image/jpeg');\n break;\n case 'png':\n imgData = canvas.toDataURL('image/png');\n break;\n case 'webp':\n imgData = canvas.toDataURL('image/webp');\n break;\n case 'svg':\n imgData = url;\n break;\n default:\n var errorMsg = 'Image format is not jpeg, png, svg or webp.';\n reject(new Error(errorMsg));\n // eventually remove the ev\n // in favor of promises\n if(!opts.promise) {\n return ev.emit('error', errorMsg);\n }\n }\n resolve(imgData);\n // eventually remove the ev\n // in favor of promises\n if(!opts.promise) {\n ev.emit('success', imgData);\n }\n };\n\n img.onerror = function(err) {\n reject(err);\n // eventually remove the ev\n // in favor of promises\n if(!opts.promise) {\n return ev.emit('error', err);\n }\n };\n\n img.src = url;\n });\n\n // temporary for backward compatibility\n // move to only Promise in 2.0.0\n // and eliminate the EventEmitter\n if(opts.promise) {\n return promise;\n }\n\n return ev;\n}\n\nmodule.exports = svgToImg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/snapshot/svgtoimg.js\n// module id = 150\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/* global jQuery:false */\n\nvar EventEmitter = require('events').EventEmitter;\n\nvar Events = {\n\n init: function(plotObj) {\n\n /*\n * If we have already instantiated an emitter for this plot\n * return early.\n */\n if(plotObj._ev instanceof EventEmitter) return plotObj;\n\n var ev = new EventEmitter();\n var internalEv = new EventEmitter();\n\n /*\n * Assign to plot._ev while we still live in a land\n * where plot is a DOM element with stuff attached to it.\n * In the future we can make plot the event emitter itself.\n */\n plotObj._ev = ev;\n\n /*\n * Create a second event handler that will manage events *internally*.\n * This allows parts of plotly to respond to thing like relayout without\n * having to use the user-facing event handler. They cannot peacefully\n * coexist on the same handler because a user invoking\n * plotObj.removeAllListeners() would detach internal events, breaking\n * plotly.\n */\n plotObj._internalEv = internalEv;\n\n /*\n * Assign bound methods from the ev to the plot object. These methods\n * will reference the 'this' of plot._ev even though they are methods\n * of plot. This will keep the event machinery away from the plot object\n * which currently is often a DOM element but presents an API that will\n * continue to function when plot becomes an emitter. Not all EventEmitter\n * methods have been bound to `plot` as some do not currently add value to\n * the Plotly event API.\n */\n plotObj.on = ev.on.bind(ev);\n plotObj.once = ev.once.bind(ev);\n plotObj.removeListener = ev.removeListener.bind(ev);\n plotObj.removeAllListeners = ev.removeAllListeners.bind(ev);\n\n /*\n * Create funtions for managing internal events. These are *only* triggered\n * by the mirroring of external events via the emit function.\n */\n plotObj._internalOn = internalEv.on.bind(internalEv);\n plotObj._internalOnce = internalEv.once.bind(internalEv);\n plotObj._removeInternalListener = internalEv.removeListener.bind(internalEv);\n plotObj._removeAllInternalListeners = internalEv.removeAllListeners.bind(internalEv);\n\n /*\n * We must wrap emit to continue to support JQuery events. The idea\n * is to check to see if the user is using JQuery events, if they are\n * we emit JQuery events to trigger user handlers as well as the EventEmitter\n * events.\n */\n plotObj.emit = function(event, data) {\n if(typeof jQuery !== 'undefined') {\n jQuery(plotObj).trigger(event, data);\n }\n\n ev.emit(event, data);\n internalEv.emit(event, data);\n };\n\n return plotObj;\n },\n\n /*\n * This function behaves like jQueries triggerHandler. It calls\n * all handlers for a particular event and returns the return value\n * of the LAST handler. This function also triggers jQuery's\n * triggerHandler for backwards compatibility.\n *\n * Note: triggerHandler has been recommended for deprecation in v2.0.0,\n * so the additional behavior of triggerHandler triggering internal events\n * is deliberate excluded in order to avoid reinforcing more usage.\n */\n triggerHandler: function(plotObj, event, data) {\n var jQueryHandlerValue;\n var nodeEventHandlerValue;\n /*\n * If Jquery exists run all its handlers for this event and\n * collect the return value of the LAST handler function\n */\n if(typeof jQuery !== 'undefined') {\n jQueryHandlerValue = jQuery(plotObj).triggerHandler(event, data);\n }\n\n /*\n * Now run all the node style event handlers\n */\n var ev = plotObj._ev;\n if(!ev) return jQueryHandlerValue;\n\n var handlers = ev._events[event];\n if(!handlers) return jQueryHandlerValue;\n\n /*\n * handlers can be function or an array of functions\n */\n if(typeof handlers === 'function') handlers = [handlers];\n var lastHandler = handlers.pop();\n\n /*\n * Call all the handlers except the last one.\n */\n for(var i = 0; i < handlers.length; i++) {\n handlers[i](data);\n }\n\n /*\n * Now call the final handler and collect its value\n */\n nodeEventHandlerValue = lastHandler(data);\n\n /*\n * Return either the jquery handler value if it exists or the\n * nodeEventHandler value. Jquery event value superceeds nodejs\n * events for backwards compatability reasons.\n */\n return jQueryHandlerValue !== undefined ? jQueryHandlerValue :\n nodeEventHandlerValue;\n },\n\n purge: function(plotObj) {\n delete plotObj._ev;\n delete plotObj.on;\n delete plotObj.once;\n delete plotObj.removeListener;\n delete plotObj.removeAllListeners;\n delete plotObj.emit;\n\n delete plotObj._ev;\n delete plotObj._internalEv;\n delete plotObj._internalOn;\n delete plotObj._internalOnce;\n delete plotObj._removeInternalListener;\n delete plotObj._removeAllInternalListeners;\n\n return plotObj;\n }\n\n};\n\nmodule.exports = Events;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/events.js\n// module id = 151\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar constants = require('./constants');\n\n// look for either subplot or xaxis and yaxis attributes\nexports.getSubplot = function getSubplot(trace) {\n return trace.subplot || (trace.xaxis + trace.yaxis) || trace.geo;\n};\n\n// convenience functions for mapping all relevant axes\nexports.flat = function flat(subplots, v) {\n var out = new Array(subplots.length);\n for(var i = 0; i < subplots.length; i++) {\n out[i] = v;\n }\n return out;\n};\n\nexports.p2c = function p2c(axArray, v) {\n var out = new Array(axArray.length);\n for(var i = 0; i < axArray.length; i++) {\n out[i] = axArray[i].p2c(v);\n }\n return out;\n};\n\nexports.getDistanceFunction = function getDistanceFunction(mode, dx, dy, dxy) {\n if(mode === 'closest') return dxy || quadrature(dx, dy);\n return mode === 'x' ? dx : dy;\n};\n\nexports.getClosest = function getClosest(cd, distfn, pointData) {\n // do we already have a point number? (array mode only)\n if(pointData.index !== false) {\n if(pointData.index >= 0 && pointData.index < cd.length) {\n pointData.distance = 0;\n }\n else pointData.index = false;\n }\n else {\n // apply the distance function to each data point\n // this is the longest loop... if this bogs down, we may need\n // to create pre-sorted data (by x or y), not sure how to\n // do this for 'closest'\n for(var i = 0; i < cd.length; i++) {\n var newDistance = distfn(cd[i]);\n if(newDistance <= pointData.distance) {\n pointData.index = i;\n pointData.distance = newDistance;\n }\n }\n }\n return pointData;\n};\n\n// for bar charts and others with finite-size objects: you must be inside\n// it to see its hover info, so distance is infinite outside.\n// But make distance inside be at least 1/4 MAXDIST, and a little bigger\n// for bigger bars, to prioritize scatter and smaller bars over big bars\n//\n// note that for closest mode, two inbox's will get added in quadrature\n// args are (signed) difference from the two opposite edges\n// count one edge as in, so that over continuous ranges you never get a gap\nexports.inbox = function inbox(v0, v1) {\n if(v0 * v1 < 0 || v0 === 0) {\n return constants.MAXDIST * (0.6 - 0.3 / Math.max(3, Math.abs(v0 - v1)));\n }\n return Infinity;\n};\n\nfunction quadrature(dx, dy) {\n return function(di) {\n var x = dx(di),\n y = dy(di);\n return Math.sqrt(x * x + y * y);\n };\n}\n\n/** Appends values inside array attributes corresponding to given point number\n *\n * @param {object} pointData : point data object (gets mutated here)\n * @param {object} trace : full trace object\n * @param {number} pointNumber : point number\n */\nexports.appendArrayPointValue = function(pointData, trace, pointNumber) {\n var arrayAttrs = trace._arrayAttrs;\n\n if(!arrayAttrs) {\n return;\n }\n\n for(var i = 0; i < arrayAttrs.length; i++) {\n var astr = arrayAttrs[i];\n var key;\n\n if(astr === 'ids') key = 'id';\n else if(astr === 'locations') key = 'location';\n else key = astr;\n\n if(pointData[key] === undefined) {\n var val = Lib.nestedProperty(trace, astr).get();\n\n if(Array.isArray(pointNumber)) {\n if(Array.isArray(val) && Array.isArray(val[pointNumber[0]])) {\n pointData[key] = val[pointNumber[0]][pointNumber[1]];\n }\n } else {\n pointData[key] = val[pointNumber];\n }\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/helpers.js\n// module id = 152\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = require('./constants');\n\nvar fontAttrs = require('../../plots/font_attributes')({\n editType: 'none',\n \n});\nfontAttrs.family.dflt = constants.HOVERFONT;\nfontAttrs.size.dflt = constants.HOVERFONTSIZE;\n\nmodule.exports = {\n dragmode: {\n valType: 'enumerated',\n \n values: ['zoom', 'pan', 'select', 'lasso', 'orbit', 'turntable'],\n dflt: 'zoom',\n editType: 'modebar',\n \n },\n hovermode: {\n valType: 'enumerated',\n \n values: ['x', 'y', 'closest', false],\n editType: 'modebar',\n \n },\n\n hoverlabel: {\n bgcolor: {\n valType: 'color',\n \n editType: 'none',\n \n },\n bordercolor: {\n valType: 'color',\n \n editType: 'none',\n \n },\n font: fontAttrs,\n namelength: {\n valType: 'integer',\n min: -1,\n dflt: 15,\n \n editType: 'none',\n \n },\n editType: 'none'\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/layout_attributes.js\n// module id = 153\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\nvar tinycolor = require('tinycolor2');\n\nvar Lib = require('../../lib');\nvar Events = require('../../lib/events');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar overrideCursor = require('../../lib/override_cursor');\nvar Drawing = require('../drawing');\nvar Color = require('../color');\nvar dragElement = require('../dragelement');\nvar Axes = require('../../plots/cartesian/axes');\nvar Registry = require('../../registry');\n\nvar helpers = require('./helpers');\nvar constants = require('./constants');\n\n// hover labels for multiple horizontal bars get tilted by some angle,\n// then need to be offset differently if they overlap\nvar YANGLE = constants.YANGLE;\nvar YA_RADIANS = Math.PI * YANGLE / 180;\n\n// expansion of projected height\nvar YFACTOR = 1 / Math.sin(YA_RADIANS);\n\n// to make the appropriate post-rotation x offset,\n// you need both x and y offsets\nvar YSHIFTX = Math.cos(YA_RADIANS);\nvar YSHIFTY = Math.sin(YA_RADIANS);\n\n// size and display constants for hover text\nvar HOVERARROWSIZE = constants.HOVERARROWSIZE;\nvar HOVERTEXTPAD = constants.HOVERTEXTPAD;\n\n// fx.hover: highlight data on hover\n// evt can be a mousemove event, or an object with data about what points\n// to hover on\n// {xpx,ypx[,hovermode]} - pixel locations from top left\n// (with optional overriding hovermode)\n// {xval,yval[,hovermode]} - data values\n// [{curveNumber,(pointNumber|xval and/or yval)}] -\n// array of specific points to highlight\n// pointNumber is a single integer if gd.data[curveNumber] is 1D,\n// or a two-element array if it's 2D\n// xval and yval are data values,\n// 1D data may specify either or both,\n// 2D data must specify both\n// subplot is an id string (default \"xy\")\n// makes use of gl.hovermode, which can be:\n// x (find the points with the closest x values, ie a column),\n// closest (find the single closest point)\n// internally there are two more that occasionally get used:\n// y (pick out a row - only used for multiple horizontal bar charts)\n// array (used when the user specifies an explicit\n// array of points to hover on)\n//\n// We wrap the hovers in a timer, to limit their frequency.\n// The actual rendering is done by private function _hover.\nexports.hover = function hover(gd, evt, subplot, noHoverEvent) {\n gd = Lib.getGraphDiv(gd);\n\n Lib.throttle(\n gd._fullLayout._uid + constants.HOVERID,\n constants.HOVERMINTIME,\n function() { _hover(gd, evt, subplot, noHoverEvent); }\n );\n};\n\n/*\n * Draw a single hover item in a pre-existing svg container somewhere\n * hoverItem should have keys:\n * - x and y (or x0, x1, y0, and y1):\n * the pixel position to mark, relative to opts.container\n * - xLabel, yLabel, zLabel, text, and name:\n * info to go in the label\n * - color:\n * the background color for the label.\n * - idealAlign (optional):\n * 'left' or 'right' for which side of the x/y box to try to put this on first\n * - borderColor (optional):\n * color for the border, defaults to strongest contrast with color\n * - fontFamily (optional):\n * string, the font for this label, defaults to constants.HOVERFONT\n * - fontSize (optional):\n * the label font size, defaults to constants.HOVERFONTSIZE\n * - fontColor (optional):\n * defaults to borderColor\n * opts should have keys:\n * - bgColor:\n * the background color this is against, used if the trace is\n * non-opaque, and for the name, which goes outside the box\n * - container:\n * a or element to add the hover label to\n * - outerContainer:\n * normally a parent of `container`, sets the bounding box to use to\n * constrain the hover label and determine whether to show it on the left or right\n */\nexports.loneHover = function loneHover(hoverItem, opts) {\n var pointData = {\n color: hoverItem.color || Color.defaultLine,\n x0: hoverItem.x0 || hoverItem.x || 0,\n x1: hoverItem.x1 || hoverItem.x || 0,\n y0: hoverItem.y0 || hoverItem.y || 0,\n y1: hoverItem.y1 || hoverItem.y || 0,\n xLabel: hoverItem.xLabel,\n yLabel: hoverItem.yLabel,\n zLabel: hoverItem.zLabel,\n text: hoverItem.text,\n name: hoverItem.name,\n idealAlign: hoverItem.idealAlign,\n\n // optional extra bits of styling\n borderColor: hoverItem.borderColor,\n fontFamily: hoverItem.fontFamily,\n fontSize: hoverItem.fontSize,\n fontColor: hoverItem.fontColor,\n\n // filler to make createHoverText happy\n trace: {\n index: 0,\n hoverinfo: ''\n },\n xa: {_offset: 0},\n ya: {_offset: 0},\n index: 0\n };\n\n var container3 = d3.select(opts.container),\n outerContainer3 = opts.outerContainer ?\n d3.select(opts.outerContainer) : container3;\n\n var fullOpts = {\n hovermode: 'closest',\n rotateLabels: false,\n bgColor: opts.bgColor || Color.background,\n container: container3,\n outerContainer: outerContainer3\n };\n\n var hoverLabel = createHoverText([pointData], fullOpts, opts.gd);\n alignHoverText(hoverLabel, fullOpts.rotateLabels);\n\n return hoverLabel.node();\n};\n\n// The actual implementation is here:\nfunction _hover(gd, evt, subplot, noHoverEvent) {\n if((subplot === 'pie' || subplot === 'sankey') && !noHoverEvent) {\n gd.emit('plotly_hover', {\n event: evt.originalEvent,\n points: [evt]\n });\n return;\n }\n\n if(!subplot) subplot = 'xy';\n\n // if the user passed in an array of subplots,\n // use those instead of finding overlayed plots\n var subplots = Array.isArray(subplot) ? subplot : [subplot];\n\n var fullLayout = gd._fullLayout,\n plots = fullLayout._plots || [],\n plotinfo = plots[subplot];\n\n // list of all overlaid subplots to look at\n if(plotinfo) {\n var overlayedSubplots = plotinfo.overlays.map(function(pi) {\n return pi.id;\n });\n\n subplots = subplots.concat(overlayedSubplots);\n }\n\n var len = subplots.length,\n xaArray = new Array(len),\n yaArray = new Array(len);\n\n for(var i = 0; i < len; i++) {\n var spId = subplots[i];\n\n // 'cartesian' case\n var plotObj = plots[spId];\n if(plotObj) {\n\n // TODO make sure that fullLayout_plots axis refs\n // get updated properly so that we don't have\n // to use Axes.getFromId in general.\n\n xaArray[i] = Axes.getFromId(gd, plotObj.xaxis._id);\n yaArray[i] = Axes.getFromId(gd, plotObj.yaxis._id);\n continue;\n }\n\n // other subplot types\n var _subplot = fullLayout[spId]._subplot;\n xaArray[i] = _subplot.xaxis;\n yaArray[i] = _subplot.yaxis;\n }\n\n var hovermode = evt.hovermode || fullLayout.hovermode;\n\n if(['x', 'y', 'closest'].indexOf(hovermode) === -1 || !gd.calcdata ||\n gd.querySelector('.zoombox') || gd._dragging) {\n return dragElement.unhoverRaw(gd, evt);\n }\n\n // hoverData: the set of candidate points we've found to highlight\n var hoverData = [],\n\n // searchData: the data to search in. Mostly this is just a copy of\n // gd.calcdata, filtered to the subplot and overlays we're on\n // but if a point array is supplied it will be a mapping\n // of indicated curves\n searchData = [],\n\n // [x|y]valArray: the axis values of the hover event\n // mapped onto each of the currently selected overlaid subplots\n xvalArray,\n yvalArray,\n\n // used in loops\n itemnum,\n curvenum,\n cd,\n trace,\n subplotId,\n subploti,\n mode,\n xval,\n yval,\n pointData,\n closedataPreviousLength;\n\n // Figure out what we're hovering on:\n // mouse location or user-supplied data\n\n if(Array.isArray(evt)) {\n // user specified an array of points to highlight\n hovermode = 'array';\n for(itemnum = 0; itemnum < evt.length; itemnum++) {\n cd = gd.calcdata[evt[itemnum].curveNumber||0];\n if(cd[0].trace.hoverinfo !== 'skip') {\n searchData.push(cd);\n }\n }\n }\n else {\n for(curvenum = 0; curvenum < gd.calcdata.length; curvenum++) {\n cd = gd.calcdata[curvenum];\n trace = cd[0].trace;\n if(trace.hoverinfo !== 'skip' && subplots.indexOf(helpers.getSubplot(trace)) !== -1) {\n searchData.push(cd);\n }\n }\n\n // [x|y]px: the pixels (from top left) of the mouse location\n // on the currently selected plot area\n var hasUserCalledHover = !evt.target,\n xpx, ypx;\n\n if(hasUserCalledHover) {\n if('xpx' in evt) xpx = evt.xpx;\n else xpx = xaArray[0]._length / 2;\n\n if('ypx' in evt) ypx = evt.ypx;\n else ypx = yaArray[0]._length / 2;\n }\n else {\n // fire the beforehover event and quit if it returns false\n // note that we're only calling this on real mouse events, so\n // manual calls to fx.hover will always run.\n if(Events.triggerHandler(gd, 'plotly_beforehover', evt) === false) {\n return;\n }\n\n var dbb = evt.target.getBoundingClientRect();\n\n xpx = evt.clientX - dbb.left;\n ypx = evt.clientY - dbb.top;\n\n // in case hover was called from mouseout into hovertext,\n // it's possible you're not actually over the plot anymore\n if(xpx < 0 || xpx > dbb.width || ypx < 0 || ypx > dbb.height) {\n return dragElement.unhoverRaw(gd, evt);\n }\n }\n\n if('xval' in evt) xvalArray = helpers.flat(subplots, evt.xval);\n else xvalArray = helpers.p2c(xaArray, xpx);\n\n if('yval' in evt) yvalArray = helpers.flat(subplots, evt.yval);\n else yvalArray = helpers.p2c(yaArray, ypx);\n\n if(!isNumeric(xvalArray[0]) || !isNumeric(yvalArray[0])) {\n Lib.warn('Fx.hover failed', evt, gd);\n return dragElement.unhoverRaw(gd, evt);\n }\n }\n\n // the pixel distance to beat as a matching point\n // in 'x' or 'y' mode this resets for each trace\n var distance = Infinity;\n\n // find the closest point in each trace\n // this is minimum dx and/or dy, depending on mode\n // and the pixel position for the label (labelXpx, labelYpx)\n for(curvenum = 0; curvenum < searchData.length; curvenum++) {\n cd = searchData[curvenum];\n\n // filter out invisible or broken data\n if(!cd || !cd[0] || !cd[0].trace || cd[0].trace.visible !== true) continue;\n\n trace = cd[0].trace;\n\n // Explicitly bail out for these two. I don't know how to otherwise prevent\n // the rest of this function from running and failing\n if(['carpet', 'contourcarpet'].indexOf(trace._module.name) !== -1) continue;\n\n subplotId = helpers.getSubplot(trace);\n subploti = subplots.indexOf(subplotId);\n\n // within one trace mode can sometimes be overridden\n mode = hovermode;\n\n // container for new point, also used to pass info into module.hoverPoints\n pointData = {\n // trace properties\n cd: cd,\n trace: trace,\n xa: xaArray[subploti],\n ya: yaArray[subploti],\n // point properties - override all of these\n index: false, // point index in trace - only used by plotly.js hoverdata consumers\n distance: Math.min(distance, constants.MAXDIST), // pixel distance or pseudo-distance\n color: Color.defaultLine, // trace color\n name: trace.name,\n x0: undefined,\n x1: undefined,\n y0: undefined,\n y1: undefined,\n xLabelVal: undefined,\n yLabelVal: undefined,\n zLabelVal: undefined,\n text: undefined\n };\n\n // add ref to subplot object (non-cartesian case)\n if(fullLayout[subplotId]) {\n pointData.subplot = fullLayout[subplotId]._subplot;\n }\n\n closedataPreviousLength = hoverData.length;\n\n // for a highlighting array, figure out what\n // we're searching for with this element\n if(mode === 'array') {\n var selection = evt[curvenum];\n if('pointNumber' in selection) {\n pointData.index = selection.pointNumber;\n mode = 'closest';\n }\n else {\n mode = '';\n if('xval' in selection) {\n xval = selection.xval;\n mode = 'x';\n }\n if('yval' in selection) {\n yval = selection.yval;\n mode = mode ? 'closest' : 'y';\n }\n }\n }\n else {\n xval = xvalArray[subploti];\n yval = yvalArray[subploti];\n }\n\n // Now find the points.\n if(trace._module && trace._module.hoverPoints) {\n var newPoints = trace._module.hoverPoints(pointData, xval, yval, mode);\n if(newPoints) {\n var newPoint;\n for(var newPointNum = 0; newPointNum < newPoints.length; newPointNum++) {\n newPoint = newPoints[newPointNum];\n if(isNumeric(newPoint.x0) && isNumeric(newPoint.y0)) {\n hoverData.push(cleanPoint(newPoint, hovermode));\n }\n }\n }\n }\n else {\n Lib.log('Unrecognized trace type in hover:', trace);\n }\n\n // in closest mode, remove any existing (farther) points\n // and don't look any farther than this latest point (or points, if boxes)\n if(hovermode === 'closest' && hoverData.length > closedataPreviousLength) {\n hoverData.splice(0, closedataPreviousLength);\n distance = hoverData[0].distance;\n }\n }\n\n // nothing left: remove all labels and quit\n if(hoverData.length === 0) return dragElement.unhoverRaw(gd, evt);\n\n hoverData.sort(function(d1, d2) { return d1.distance - d2.distance; });\n\n // lastly, emit custom hover/unhover events\n var oldhoverdata = gd._hoverdata,\n newhoverdata = [];\n\n // pull out just the data that's useful to\n // other people and send it to the event\n for(itemnum = 0; itemnum < hoverData.length; itemnum++) {\n var pt = hoverData[itemnum];\n\n var out = {\n data: pt.trace._input,\n fullData: pt.trace,\n curveNumber: pt.trace.index,\n pointNumber: pt.index\n };\n\n if(pt.trace._module.eventData) out = pt.trace._module.eventData(out, pt);\n else {\n out.x = pt.xVal;\n out.y = pt.yVal;\n out.xaxis = pt.xa;\n out.yaxis = pt.ya;\n\n if(pt.zLabelVal !== undefined) out.z = pt.zLabelVal;\n }\n\n helpers.appendArrayPointValue(out, pt.trace, pt.index);\n newhoverdata.push(out);\n }\n\n gd._hoverdata = newhoverdata;\n\n if(hoverChanged(gd, evt, oldhoverdata) && fullLayout._hasCartesian) {\n var spikelineOpts = {\n hovermode: hovermode,\n fullLayout: fullLayout,\n container: fullLayout._hoverlayer,\n outerContainer: fullLayout._paperdiv\n };\n createSpikelines(hoverData, spikelineOpts);\n }\n\n // if there's more than one horz bar trace,\n // rotate the labels so they don't overlap\n var rotateLabels = hovermode === 'y' && searchData.length > 1;\n\n var bgColor = Color.combine(\n fullLayout.plot_bgcolor || Color.background,\n fullLayout.paper_bgcolor\n );\n\n var labelOpts = {\n hovermode: hovermode,\n rotateLabels: rotateLabels,\n bgColor: bgColor,\n container: fullLayout._hoverlayer,\n outerContainer: fullLayout._paperdiv,\n commonLabelOpts: fullLayout.hoverlabel\n };\n\n var hoverLabels = createHoverText(hoverData, labelOpts, gd);\n\n hoverAvoidOverlaps(hoverData, rotateLabels ? 'xa' : 'ya');\n\n alignHoverText(hoverLabels, rotateLabels);\n\n // TODO: tagName hack is needed to appease geo.js's hack of using evt.target=true\n // we should improve the \"fx\" API so other plots can use it without these hack.\n if(evt.target && evt.target.tagName) {\n var hasClickToShow = Registry.getComponentMethod('annotations', 'hasClickToShow')(gd, newhoverdata);\n overrideCursor(d3.select(evt.target), hasClickToShow ? 'pointer' : '');\n }\n\n // don't emit events if called manually\n if(!evt.target || noHoverEvent || !hoverChanged(gd, evt, oldhoverdata)) return;\n\n if(oldhoverdata) {\n gd.emit('plotly_unhover', {\n event: evt,\n points: oldhoverdata\n });\n }\n\n gd.emit('plotly_hover', {\n event: evt,\n points: gd._hoverdata,\n xaxes: xaArray,\n yaxes: yaArray,\n xvals: xvalArray,\n yvals: yvalArray\n });\n}\n\nfunction createHoverText(hoverData, opts, gd) {\n var hovermode = opts.hovermode;\n var rotateLabels = opts.rotateLabels;\n var bgColor = opts.bgColor;\n var container = opts.container;\n var outerContainer = opts.outerContainer;\n var commonLabelOpts = opts.commonLabelOpts || {};\n\n // opts.fontFamily/Size are used for the common label\n // and as defaults for each hover label, though the individual labels\n // can override this.\n var fontFamily = opts.fontFamily || constants.HOVERFONT;\n var fontSize = opts.fontSize || constants.HOVERFONTSIZE;\n\n var c0 = hoverData[0];\n var xa = c0.xa;\n var ya = c0.ya;\n var commonAttr = hovermode === 'y' ? 'yLabel' : 'xLabel';\n var t0 = c0[commonAttr];\n var t00 = (String(t0) || '').split(' ')[0];\n var outerContainerBB = outerContainer.node().getBoundingClientRect();\n var outerTop = outerContainerBB.top;\n var outerWidth = outerContainerBB.width;\n var outerHeight = outerContainerBB.height;\n\n // show the common label, if any, on the axis\n // never show a common label in array mode,\n // even if sometimes there could be one\n var showCommonLabel = c0.distance <= constants.MAXDIST &&\n (hovermode === 'x' || hovermode === 'y');\n\n // all hover traces hoverinfo must contain the hovermode\n // to have common labels\n var i, traceHoverinfo;\n for(i = 0; i < hoverData.length; i++) {\n traceHoverinfo = hoverData[i].hoverinfo || hoverData[i].trace.hoverinfo;\n var parts = traceHoverinfo.split('+');\n if(parts.indexOf('all') === -1 &&\n parts.indexOf(hovermode) === -1) {\n showCommonLabel = false;\n break;\n }\n }\n\n var commonLabel = container.selectAll('g.axistext')\n .data(showCommonLabel ? [0] : []);\n commonLabel.enter().append('g')\n .classed('axistext', true);\n commonLabel.exit().remove();\n\n commonLabel.each(function() {\n var label = d3.select(this),\n lpath = label.selectAll('path').data([0]),\n ltext = label.selectAll('text').data([0]);\n\n lpath.enter().append('path')\n .style({'stroke-width': '1px'});\n\n lpath.style({\n fill: commonLabelOpts.bgcolor || Color.defaultLine,\n stroke: commonLabelOpts.bordercolor || Color.background,\n });\n\n ltext.enter().append('text')\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n .attr('data-notex', 1);\n\n ltext.text(t0)\n .call(Drawing.font,\n commonLabelOpts.font.family || fontFamily,\n commonLabelOpts.font.size || fontSize,\n commonLabelOpts.font.color || Color.background\n )\n .call(svgTextUtils.positionText, 0, 0)\n .call(svgTextUtils.convertToTspans, gd);\n\n label.attr('transform', '');\n\n var tbb = ltext.node().getBoundingClientRect();\n if(hovermode === 'x') {\n ltext.attr('text-anchor', 'middle')\n .call(svgTextUtils.positionText, 0, (xa.side === 'top' ?\n (outerTop - tbb.bottom - HOVERARROWSIZE - HOVERTEXTPAD) :\n (outerTop - tbb.top + HOVERARROWSIZE + HOVERTEXTPAD)));\n\n var topsign = xa.side === 'top' ? '-' : '';\n lpath.attr('d', 'M0,0' +\n 'L' + HOVERARROWSIZE + ',' + topsign + HOVERARROWSIZE +\n 'H' + (HOVERTEXTPAD + tbb.width / 2) +\n 'v' + topsign + (HOVERTEXTPAD * 2 + tbb.height) +\n 'H-' + (HOVERTEXTPAD + tbb.width / 2) +\n 'V' + topsign + HOVERARROWSIZE + 'H-' + HOVERARROWSIZE + 'Z');\n\n label.attr('transform', 'translate(' +\n (xa._offset + (c0.x0 + c0.x1) / 2) + ',' +\n (ya._offset + (xa.side === 'top' ? 0 : ya._length)) + ')');\n }\n else {\n ltext.attr('text-anchor', ya.side === 'right' ? 'start' : 'end')\n .call(svgTextUtils.positionText,\n (ya.side === 'right' ? 1 : -1) * (HOVERTEXTPAD + HOVERARROWSIZE),\n outerTop - tbb.top - tbb.height / 2);\n\n var leftsign = ya.side === 'right' ? '' : '-';\n lpath.attr('d', 'M0,0' +\n 'L' + leftsign + HOVERARROWSIZE + ',' + HOVERARROWSIZE +\n 'V' + (HOVERTEXTPAD + tbb.height / 2) +\n 'h' + leftsign + (HOVERTEXTPAD * 2 + tbb.width) +\n 'V-' + (HOVERTEXTPAD + tbb.height / 2) +\n 'H' + leftsign + HOVERARROWSIZE + 'V-' + HOVERARROWSIZE + 'Z');\n\n label.attr('transform', 'translate(' +\n (xa._offset + (ya.side === 'right' ? xa._length : 0)) + ',' +\n (ya._offset + (c0.y0 + c0.y1) / 2) + ')');\n }\n // remove the \"close but not quite\" points\n // because of error bars, only take up to a space\n hoverData = hoverData.filter(function(d) {\n return (d.zLabelVal !== undefined) ||\n (d[commonAttr] || '').split(' ')[0] === t00;\n });\n });\n\n // show all the individual labels\n\n // first create the objects\n var hoverLabels = container.selectAll('g.hovertext')\n .data(hoverData, function(d) {\n return [d.trace.index, d.index, d.x0, d.y0, d.name, d.attr, d.xa, d.ya || ''].join(',');\n });\n hoverLabels.enter().append('g')\n .classed('hovertext', true)\n .each(function() {\n var g = d3.select(this);\n // trace name label (rect and text.name)\n g.append('rect')\n .call(Color.fill, Color.addOpacity(bgColor, 0.8));\n g.append('text').classed('name', true);\n // trace data label (path and text.nums)\n g.append('path')\n .style('stroke-width', '1px');\n g.append('text').classed('nums', true)\n .call(Drawing.font, fontFamily, fontSize);\n });\n hoverLabels.exit().remove();\n\n // then put the text in, position the pointer to the data,\n // and figure out sizes\n hoverLabels.each(function(d) {\n var g = d3.select(this).attr('transform', ''),\n name = '',\n text = '';\n\n // combine possible non-opaque trace color with bgColor\n var baseColor = Color.opacity(d.color) ? d.color : Color.defaultLine;\n var traceColor = Color.combine(baseColor, bgColor);\n\n // find a contrasting color for border and text\n var contrastColor = d.borderColor || Color.contrast(traceColor);\n\n // to get custom 'name' labels pass cleanPoint\n if(d.nameOverride !== undefined) d.name = d.nameOverride;\n\n if(d.name) {\n // strip out our pseudo-html elements from d.name (if it exists at all)\n name = svgTextUtils.plainText(d.name || '');\n\n var nameLength = Math.round(d.nameLength);\n\n if(nameLength > -1 && name.length > nameLength) {\n if(nameLength > 3) name = name.substr(0, nameLength - 3) + '...';\n else name = name.substr(0, nameLength);\n }\n }\n\n // used by other modules (initially just ternary) that\n // manage their own hoverinfo independent of cleanPoint\n // the rest of this will still apply, so such modules\n // can still put things in (x|y|z)Label, text, and name\n // and hoverinfo will still determine their visibility\n if(d.extraText !== undefined) text += d.extraText;\n\n if(d.zLabel !== undefined) {\n if(d.xLabel !== undefined) text += 'x: ' + d.xLabel + '
';\n if(d.yLabel !== undefined) text += 'y: ' + d.yLabel + '
';\n text += (text ? 'z: ' : '') + d.zLabel;\n }\n else if(showCommonLabel && d[hovermode + 'Label'] === t0) {\n text = d[(hovermode === 'x' ? 'y' : 'x') + 'Label'] || '';\n }\n else if(d.xLabel === undefined) {\n if(d.yLabel !== undefined) text = d.yLabel;\n }\n else if(d.yLabel === undefined) text = d.xLabel;\n else text = '(' + d.xLabel + ', ' + d.yLabel + ')';\n\n if(d.text && !Array.isArray(d.text)) {\n text += (text ? '
' : '') + d.text;\n }\n\n // if 'text' is empty at this point,\n // put 'name' in main label and don't show secondary label\n if(text === '') {\n // if 'name' is also empty, remove entire label\n if(name === '') g.remove();\n text = name;\n }\n\n // main label\n var tx = g.select('text.nums')\n .call(Drawing.font,\n d.fontFamily || fontFamily,\n d.fontSize || fontSize,\n d.fontColor || contrastColor)\n .text(text)\n .attr('data-notex', 1)\n .call(svgTextUtils.positionText, 0, 0)\n .call(svgTextUtils.convertToTspans, gd);\n\n var tx2 = g.select('text.name'),\n tx2width = 0;\n\n // secondary label for non-empty 'name'\n if(name && name !== text) {\n tx2.call(Drawing.font,\n d.fontFamily || fontFamily,\n d.fontSize || fontSize,\n traceColor)\n .text(name)\n .attr('data-notex', 1)\n .call(svgTextUtils.positionText, 0, 0)\n .call(svgTextUtils.convertToTspans, gd);\n tx2width = tx2.node().getBoundingClientRect().width + 2 * HOVERTEXTPAD;\n }\n else {\n tx2.remove();\n g.select('rect').remove();\n }\n\n g.select('path')\n .style({\n fill: traceColor,\n stroke: contrastColor\n });\n var tbb = tx.node().getBoundingClientRect(),\n htx = d.xa._offset + (d.x0 + d.x1) / 2,\n hty = d.ya._offset + (d.y0 + d.y1) / 2,\n dx = Math.abs(d.x1 - d.x0),\n dy = Math.abs(d.y1 - d.y0),\n txTotalWidth = tbb.width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width,\n anchorStartOK,\n anchorEndOK;\n\n d.ty0 = outerTop - tbb.top;\n d.bx = tbb.width + 2 * HOVERTEXTPAD;\n d.by = tbb.height + 2 * HOVERTEXTPAD;\n d.anchor = 'start';\n d.txwidth = tbb.width;\n d.tx2width = tx2width;\n d.offset = 0;\n\n if(rotateLabels) {\n d.pos = htx;\n anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight;\n anchorEndOK = hty - dy / 2 - txTotalWidth >= 0;\n if((d.idealAlign === 'top' || !anchorStartOK) && anchorEndOK) {\n hty -= dy / 2;\n d.anchor = 'end';\n } else if(anchorStartOK) {\n hty += dy / 2;\n d.anchor = 'start';\n } else d.anchor = 'middle';\n }\n else {\n d.pos = hty;\n anchorStartOK = htx + dx / 2 + txTotalWidth <= outerWidth;\n anchorEndOK = htx - dx / 2 - txTotalWidth >= 0;\n if((d.idealAlign === 'left' || !anchorStartOK) && anchorEndOK) {\n htx -= dx / 2;\n d.anchor = 'end';\n } else if(anchorStartOK) {\n htx += dx / 2;\n d.anchor = 'start';\n } else d.anchor = 'middle';\n }\n\n tx.attr('text-anchor', d.anchor);\n if(tx2width) tx2.attr('text-anchor', d.anchor);\n g.attr('transform', 'translate(' + htx + ',' + hty + ')' +\n (rotateLabels ? 'rotate(' + YANGLE + ')' : ''));\n });\n\n return hoverLabels;\n}\n\n// Make groups of touching points, and within each group\n// move each point so that no labels overlap, but the average\n// label position is the same as it was before moving. Indicentally,\n// this is equivalent to saying all the labels are on equal linear\n// springs about their initial position. Initially, each point is\n// its own group, but as we find overlaps we will clump the points.\n//\n// Also, there are hard constraints at the edges of the graphs,\n// that push all groups to the middle so they are visible. I don't\n// know what happens if the group spans all the way from one edge to\n// the other, though it hardly matters - there's just too much\n// information then.\nfunction hoverAvoidOverlaps(hoverData, ax) {\n var nummoves = 0,\n\n // make groups of touching points\n pointgroups = hoverData\n .map(function(d, i) {\n var axis = d[ax];\n return [{\n i: i,\n dp: 0,\n pos: d.pos,\n posref: d.posref,\n size: d.by * (axis._id.charAt(0) === 'x' ? YFACTOR : 1) / 2,\n pmin: axis._offset,\n pmax: axis._offset + axis._length\n }];\n })\n .sort(function(a, b) { return a[0].posref - b[0].posref; }),\n donepositioning,\n topOverlap,\n bottomOverlap,\n i, j,\n pti,\n sumdp;\n\n function constrainGroup(grp) {\n var minPt = grp[0],\n maxPt = grp[grp.length - 1];\n\n // overlap with the top - positive vals are overlaps\n topOverlap = minPt.pmin - minPt.pos - minPt.dp + minPt.size;\n\n // overlap with the bottom - positive vals are overlaps\n bottomOverlap = maxPt.pos + maxPt.dp + maxPt.size - minPt.pmax;\n\n // check for min overlap first, so that we always\n // see the largest labels\n // allow for .01px overlap, so we don't get an\n // infinite loop from rounding errors\n if(topOverlap > 0.01) {\n for(j = grp.length - 1; j >= 0; j--) grp[j].dp += topOverlap;\n donepositioning = false;\n }\n if(bottomOverlap < 0.01) return;\n if(topOverlap < -0.01) {\n // make sure we're not pushing back and forth\n for(j = grp.length - 1; j >= 0; j--) grp[j].dp -= bottomOverlap;\n donepositioning = false;\n }\n if(!donepositioning) return;\n\n // no room to fix positioning, delete off-screen points\n\n // first see how many points we need to delete\n var deleteCount = 0;\n for(i = 0; i < grp.length; i++) {\n pti = grp[i];\n if(pti.pos + pti.dp + pti.size > minPt.pmax) deleteCount++;\n }\n\n // start by deleting points whose data is off screen\n for(i = grp.length - 1; i >= 0; i--) {\n if(deleteCount <= 0) break;\n pti = grp[i];\n\n // pos has already been constrained to [pmin,pmax]\n // so look for points close to that to delete\n if(pti.pos > minPt.pmax - 1) {\n pti.del = true;\n deleteCount--;\n }\n }\n for(i = 0; i < grp.length; i++) {\n if(deleteCount <= 0) break;\n pti = grp[i];\n\n // pos has already been constrained to [pmin,pmax]\n // so look for points close to that to delete\n if(pti.pos < minPt.pmin + 1) {\n pti.del = true;\n deleteCount--;\n\n // shift the whole group minus into this new space\n bottomOverlap = pti.size * 2;\n for(j = grp.length - 1; j >= 0; j--) grp[j].dp -= bottomOverlap;\n }\n }\n // then delete points that go off the bottom\n for(i = grp.length - 1; i >= 0; i--) {\n if(deleteCount <= 0) break;\n pti = grp[i];\n if(pti.pos + pti.dp + pti.size > minPt.pmax) {\n pti.del = true;\n deleteCount--;\n }\n }\n }\n\n // loop through groups, combining them if they overlap,\n // until nothing moves\n while(!donepositioning && nummoves <= hoverData.length) {\n // to avoid infinite loops, don't move more times\n // than there are traces\n nummoves++;\n\n // assume nothing will move in this iteration,\n // reverse this if it does\n donepositioning = true;\n i = 0;\n while(i < pointgroups.length - 1) {\n // the higher (g0) and lower (g1) point group\n var g0 = pointgroups[i],\n g1 = pointgroups[i + 1],\n\n // the lowest point in the higher group (p0)\n // the highest point in the lower group (p1)\n p0 = g0[g0.length - 1],\n p1 = g1[0];\n topOverlap = p0.pos + p0.dp + p0.size - p1.pos - p1.dp + p1.size;\n\n // Only group points that lie on the same axes\n if(topOverlap > 0.01 && (p0.pmin === p1.pmin) && (p0.pmax === p1.pmax)) {\n // push the new point(s) added to this group out of the way\n for(j = g1.length - 1; j >= 0; j--) g1[j].dp += topOverlap;\n\n // add them to the group\n g0.push.apply(g0, g1);\n pointgroups.splice(i + 1, 1);\n\n // adjust for minimum average movement\n sumdp = 0;\n for(j = g0.length - 1; j >= 0; j--) sumdp += g0[j].dp;\n bottomOverlap = sumdp / g0.length;\n for(j = g0.length - 1; j >= 0; j--) g0[j].dp -= bottomOverlap;\n donepositioning = false;\n }\n else i++;\n }\n\n // check if we're going off the plot on either side and fix\n pointgroups.forEach(constrainGroup);\n }\n\n // now put these offsets into hoverData\n for(i = pointgroups.length - 1; i >= 0; i--) {\n var grp = pointgroups[i];\n for(j = grp.length - 1; j >= 0; j--) {\n var pt = grp[j],\n hoverPt = hoverData[pt.i];\n hoverPt.offset = pt.dp;\n hoverPt.del = pt.del;\n }\n }\n}\n\nfunction alignHoverText(hoverLabels, rotateLabels) {\n // finally set the text positioning relative to the data and draw the\n // box around it\n hoverLabels.each(function(d) {\n var g = d3.select(this);\n if(d.del) {\n g.remove();\n return;\n }\n var horzSign = d.anchor === 'end' ? -1 : 1,\n tx = g.select('text.nums'),\n alignShift = {start: 1, end: -1, middle: 0}[d.anchor],\n txx = alignShift * (HOVERARROWSIZE + HOVERTEXTPAD),\n tx2x = txx + alignShift * (d.txwidth + HOVERTEXTPAD),\n offsetX = 0,\n offsetY = d.offset;\n if(d.anchor === 'middle') {\n txx -= d.tx2width / 2;\n tx2x -= d.tx2width / 2;\n }\n if(rotateLabels) {\n offsetY *= -YSHIFTY;\n offsetX = d.offset * YSHIFTX;\n }\n\n g.select('path').attr('d', d.anchor === 'middle' ?\n // middle aligned: rect centered on data\n ('M-' + (d.bx / 2) + ',-' + (d.by / 2) + 'h' + d.bx + 'v' + d.by + 'h-' + d.bx + 'Z') :\n // left or right aligned: side rect with arrow to data\n ('M0,0L' + (horzSign * HOVERARROWSIZE + offsetX) + ',' + (HOVERARROWSIZE + offsetY) +\n 'v' + (d.by / 2 - HOVERARROWSIZE) +\n 'h' + (horzSign * d.bx) +\n 'v-' + d.by +\n 'H' + (horzSign * HOVERARROWSIZE + offsetX) +\n 'V' + (offsetY - HOVERARROWSIZE) +\n 'Z'));\n\n tx.call(svgTextUtils.positionText,\n txx + offsetX, offsetY + d.ty0 - d.by / 2 + HOVERTEXTPAD);\n\n if(d.tx2width) {\n g.select('text.name')\n .call(svgTextUtils.positionText,\n tx2x + alignShift * HOVERTEXTPAD + offsetX,\n offsetY + d.ty0 - d.by / 2 + HOVERTEXTPAD);\n g.select('rect')\n .call(Drawing.setRect,\n tx2x + (alignShift - 1) * d.tx2width / 2 + offsetX,\n offsetY - d.by / 2 - 1,\n d.tx2width, d.by + 2);\n }\n });\n}\n\nfunction cleanPoint(d, hovermode) {\n var index = d.index;\n var trace = d.trace || {};\n var cd0 = d.cd[0];\n var cd = d.cd[index] || {};\n\n var getVal = Array.isArray(index) ?\n function(calcKey, traceKey) {\n return Lib.castOption(cd0, index, calcKey) ||\n Lib.extractOption({}, trace, '', traceKey);\n } :\n function(calcKey, traceKey) {\n return Lib.extractOption(cd, trace, calcKey, traceKey);\n };\n\n function fill(key, calcKey, traceKey) {\n var val = getVal(calcKey, traceKey);\n if(val) d[key] = val;\n }\n\n fill('hoverinfo', 'hi', 'hoverinfo');\n fill('color', 'hbg', 'hoverlabel.bgcolor');\n fill('borderColor', 'hbc', 'hoverlabel.bordercolor');\n fill('fontFamily', 'htf', 'hoverlabel.font.family');\n fill('fontSize', 'hts', 'hoverlabel.font.size');\n fill('fontColor', 'htc', 'hoverlabel.font.color');\n fill('nameLength', 'hnl', 'hoverlabel.namelength');\n\n d.posref = hovermode === 'y' ? (d.x0 + d.x1) / 2 : (d.y0 + d.y1) / 2;\n\n // then constrain all the positions to be on the plot\n d.x0 = Lib.constrain(d.x0, 0, d.xa._length);\n d.x1 = Lib.constrain(d.x1, 0, d.xa._length);\n d.y0 = Lib.constrain(d.y0, 0, d.ya._length);\n d.y1 = Lib.constrain(d.y1, 0, d.ya._length);\n\n // and convert the x and y label values into objects\n // formatted as text, with font info\n var logOffScale;\n if(d.xLabelVal !== undefined) {\n logOffScale = (d.xa.type === 'log' && d.xLabelVal <= 0);\n var xLabelObj = Axes.tickText(d.xa,\n d.xa.c2l(logOffScale ? -d.xLabelVal : d.xLabelVal), 'hover');\n if(logOffScale) {\n if(d.xLabelVal === 0) d.xLabel = '0';\n else d.xLabel = '-' + xLabelObj.text;\n }\n // TODO: should we do something special if the axis calendar and\n // the data calendar are different? Somehow display both dates with\n // their system names? Right now it will just display in the axis calendar\n // but users could add the other one as text.\n else d.xLabel = xLabelObj.text;\n d.xVal = d.xa.c2d(d.xLabelVal);\n }\n\n if(d.yLabelVal !== undefined) {\n logOffScale = (d.ya.type === 'log' && d.yLabelVal <= 0);\n var yLabelObj = Axes.tickText(d.ya,\n d.ya.c2l(logOffScale ? -d.yLabelVal : d.yLabelVal), 'hover');\n if(logOffScale) {\n if(d.yLabelVal === 0) d.yLabel = '0';\n else d.yLabel = '-' + yLabelObj.text;\n }\n // TODO: see above TODO\n else d.yLabel = yLabelObj.text;\n d.yVal = d.ya.c2d(d.yLabelVal);\n }\n\n if(d.zLabelVal !== undefined) d.zLabel = String(d.zLabelVal);\n\n // for box means and error bars, add the range to the label\n if(!isNaN(d.xerr) && !(d.xa.type === 'log' && d.xerr <= 0)) {\n var xeText = Axes.tickText(d.xa, d.xa.c2l(d.xerr), 'hover').text;\n if(d.xerrneg !== undefined) {\n d.xLabel += ' +' + xeText + ' / -' +\n Axes.tickText(d.xa, d.xa.c2l(d.xerrneg), 'hover').text;\n }\n else d.xLabel += ' ± ' + xeText;\n\n // small distance penalty for error bars, so that if there are\n // traces with errors and some without, the error bar label will\n // hoist up to the point\n if(hovermode === 'x') d.distance += 1;\n }\n if(!isNaN(d.yerr) && !(d.ya.type === 'log' && d.yerr <= 0)) {\n var yeText = Axes.tickText(d.ya, d.ya.c2l(d.yerr), 'hover').text;\n if(d.yerrneg !== undefined) {\n d.yLabel += ' +' + yeText + ' / -' +\n Axes.tickText(d.ya, d.ya.c2l(d.yerrneg), 'hover').text;\n }\n else d.yLabel += ' ± ' + yeText;\n\n if(hovermode === 'y') d.distance += 1;\n }\n\n var infomode = d.hoverinfo || d.trace.hoverinfo;\n if(infomode !== 'all') {\n infomode = infomode.split('+');\n if(infomode.indexOf('x') === -1) d.xLabel = undefined;\n if(infomode.indexOf('y') === -1) d.yLabel = undefined;\n if(infomode.indexOf('z') === -1) d.zLabel = undefined;\n if(infomode.indexOf('text') === -1) d.text = undefined;\n if(infomode.indexOf('name') === -1) d.name = undefined;\n }\n\n return d;\n}\n\nfunction createSpikelines(hoverData, opts) {\n var hovermode = opts.hovermode;\n var container = opts.container;\n var c0 = hoverData[0];\n var xa = c0.xa;\n var ya = c0.ya;\n var showX = xa.showspikes;\n var showY = ya.showspikes;\n\n // Remove old spikeline items\n container.selectAll('.spikeline').remove();\n\n if(hovermode !== 'closest' || !(showX || showY)) return;\n\n var fullLayout = opts.fullLayout;\n var xPoint = xa._offset + (c0.x0 + c0.x1) / 2;\n var yPoint = ya._offset + (c0.y0 + c0.y1) / 2;\n var contrastColor = Color.combine(fullLayout.plot_bgcolor, fullLayout.paper_bgcolor);\n var dfltDashColor = tinycolor.readability(c0.color, contrastColor) < 1.5 ?\n Color.contrast(contrastColor) : c0.color;\n\n if(showY) {\n var yMode = ya.spikemode;\n var yThickness = ya.spikethickness;\n var yColor = ya.spikecolor || dfltDashColor;\n var yBB = ya._boundingBox;\n var xEdge = ((yBB.left + yBB.right) / 2) < xPoint ? yBB.right : yBB.left;\n\n if(yMode.indexOf('toaxis') !== -1 || yMode.indexOf('across') !== -1) {\n var xBase = xEdge;\n var xEndSpike = xPoint;\n if(yMode.indexOf('across') !== -1) {\n xBase = ya._counterSpan[0];\n xEndSpike = ya._counterSpan[1];\n }\n\n // Background horizontal Line (to y-axis)\n container.append('line')\n .attr({\n 'x1': xBase,\n 'x2': xEndSpike,\n 'y1': yPoint,\n 'y2': yPoint,\n 'stroke-width': yThickness + 2,\n 'stroke': contrastColor\n })\n .classed('spikeline', true)\n .classed('crisp', true);\n\n // Foreground horizontal line (to y-axis)\n container.append('line')\n .attr({\n 'x1': xBase,\n 'x2': xEndSpike,\n 'y1': yPoint,\n 'y2': yPoint,\n 'stroke-width': yThickness,\n 'stroke': yColor,\n 'stroke-dasharray': Drawing.dashStyle(ya.spikedash, yThickness)\n })\n .classed('spikeline', true)\n .classed('crisp', true);\n }\n // Y axis marker\n if(yMode.indexOf('marker') !== -1) {\n container.append('circle')\n .attr({\n 'cx': xEdge + (ya.side !== 'right' ? yThickness : -yThickness),\n 'cy': yPoint,\n 'r': yThickness,\n 'fill': yColor\n })\n .classed('spikeline', true);\n }\n }\n\n if(showX) {\n var xMode = xa.spikemode;\n var xThickness = xa.spikethickness;\n var xColor = xa.spikecolor || dfltDashColor;\n var xBB = xa._boundingBox;\n var yEdge = ((xBB.top + xBB.bottom) / 2) < yPoint ? xBB.bottom : xBB.top;\n\n if(xMode.indexOf('toaxis') !== -1 || xMode.indexOf('across') !== -1) {\n var yBase = yEdge;\n var yEndSpike = yPoint;\n if(xMode.indexOf('across') !== -1) {\n yBase = xa._counterSpan[0];\n yEndSpike = xa._counterSpan[1];\n }\n\n // Background vertical line (to x-axis)\n container.append('line')\n .attr({\n 'x1': xPoint,\n 'x2': xPoint,\n 'y1': yBase,\n 'y2': yEndSpike,\n 'stroke-width': xThickness + 2,\n 'stroke': contrastColor\n })\n .classed('spikeline', true)\n .classed('crisp', true);\n\n // Foreground vertical line (to x-axis)\n container.append('line')\n .attr({\n 'x1': xPoint,\n 'x2': xPoint,\n 'y1': yBase,\n 'y2': yEndSpike,\n 'stroke-width': xThickness,\n 'stroke': xColor,\n 'stroke-dasharray': Drawing.dashStyle(xa.spikedash, xThickness)\n })\n .classed('spikeline', true)\n .classed('crisp', true);\n }\n\n // X axis marker\n if(xMode.indexOf('marker') !== -1) {\n container.append('circle')\n .attr({\n 'cx': xPoint,\n 'cy': yEdge - (xa.side !== 'top' ? xThickness : -xThickness),\n 'r': xThickness,\n 'fill': xColor\n })\n .classed('spikeline', true);\n }\n }\n}\n\nfunction hoverChanged(gd, evt, oldhoverdata) {\n // don't emit any events if nothing changed\n if(!oldhoverdata || oldhoverdata.length !== gd._hoverdata.length) return true;\n\n for(var i = oldhoverdata.length - 1; i >= 0; i--) {\n var oldPt = oldhoverdata[i],\n newPt = gd._hoverdata[i];\n if(oldPt.curveNumber !== newPt.curveNumber ||\n String(oldPt.pointNumber) !== String(newPt.pointNumber)) {\n return true;\n }\n }\n return false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/hover.js\n// module id = 154\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar Lib = require('../../lib');\nvar Plots = require('../plots');\n\nvar axisIds = require('./axis_ids');\nvar constants = require('./constants');\n\nexports.name = 'cartesian';\n\nexports.attr = ['xaxis', 'yaxis'];\n\nexports.idRoot = ['x', 'y'];\n\nexports.idRegex = constants.idRegex;\n\nexports.attrRegex = constants.attrRegex;\n\nexports.attributes = require('./attributes');\n\nexports.layoutAttributes = require('./layout_attributes');\n\nexports.transitionAxes = require('./transition_axes');\n\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = gd._fullLayout,\n subplots = Plots.getSubplotIds(fullLayout, 'cartesian'),\n calcdata = gd.calcdata,\n i;\n\n // If traces is not provided, then it's a complete replot and missing\n // traces are removed\n if(!Array.isArray(traces)) {\n traces = [];\n\n for(i = 0; i < calcdata.length; i++) {\n traces.push(i);\n }\n }\n\n for(i = 0; i < subplots.length; i++) {\n var subplot = subplots[i],\n subplotInfo = fullLayout._plots[subplot];\n\n // Get all calcdata for this subplot:\n var cdSubplot = [];\n var pcd;\n\n for(var j = 0; j < calcdata.length; j++) {\n var cd = calcdata[j],\n trace = cd[0].trace;\n\n // Skip trace if whitelist provided and it's not whitelisted:\n // if (Array.isArray(traces) && traces.indexOf(i) === -1) continue;\n if(trace.xaxis + trace.yaxis === subplot) {\n // XXX: Should trace carpet dependencies. Only replot all carpet plots if the carpet\n // axis has actually changed:\n //\n // If this trace is specifically requested, add it to the list:\n if(traces.indexOf(trace.index) !== -1 || trace.carpet) {\n // Okay, so example: traces 0, 1, and 2 have fill = tonext. You animate\n // traces 0 and 2. Trace 1 also needs to be updated, otherwise its fill\n // is outdated. So this retroactively adds the previous trace if the\n // traces are interdependent.\n if(\n pcd &&\n pcd[0].trace.xaxis + pcd[0].trace.yaxis === subplot &&\n ['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1 &&\n cdSubplot.indexOf(pcd) === -1\n ) {\n cdSubplot.push(pcd);\n }\n\n cdSubplot.push(cd);\n }\n\n // Track the previous trace on this subplot for the retroactive-add step\n // above:\n pcd = cd;\n }\n }\n\n plotOne(gd, subplotInfo, cdSubplot, transitionOpts, makeOnCompleteCallback);\n }\n};\n\nfunction plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = gd._fullLayout,\n modules = fullLayout._modules;\n\n // remove old traces, then redraw everything\n //\n // TODO: scatterlayer is manually excluded from this since it knows how\n // to update instead of fully removing and redrawing every time. The\n // remaining plot traces should also be able to do this. Once implemented,\n // we won't need this - which should sometimes be a big speedup.\n if(plotinfo.plot) {\n plotinfo.plot.selectAll('g:not(.scatterlayer)').selectAll('g.trace').remove();\n }\n\n // plot all traces for each module at once\n for(var j = 0; j < modules.length; j++) {\n var _module = modules[j];\n\n // skip over non-cartesian trace modules\n if(_module.basePlotModule.name !== 'cartesian') continue;\n\n // plot all traces of this type on this subplot at once\n var cdModule = [];\n for(var k = 0; k < cdSubplot.length; k++) {\n var cd = cdSubplot[k],\n trace = cd[0].trace;\n\n if((trace._module === _module) && (trace.visible === true)) {\n cdModule.push(cd);\n }\n }\n\n _module.plot(gd, plotinfo, cdModule, transitionOpts, makeOnCompleteCallback);\n }\n}\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldModules = oldFullLayout._modules || [],\n newModules = newFullLayout._modules || [];\n\n var hadScatter, hasScatter, i;\n\n for(i = 0; i < oldModules.length; i++) {\n if(oldModules[i].name === 'scatter') {\n hadScatter = true;\n break;\n }\n }\n\n for(i = 0; i < newModules.length; i++) {\n if(newModules[i].name === 'scatter') {\n hasScatter = true;\n break;\n }\n }\n\n if(hadScatter && !hasScatter) {\n var oldPlots = oldFullLayout._plots,\n ids = Object.keys(oldPlots || {});\n\n for(i = 0; i < ids.length; i++) {\n var subplotInfo = oldPlots[ids[i]];\n\n if(subplotInfo.plot) {\n subplotInfo.plot.select('g.scatterlayer')\n .selectAll('g.trace')\n .remove();\n }\n }\n\n oldFullLayout._infolayer.selectAll('g.rangeslider-container')\n .select('g.scatterlayer')\n .selectAll('g.trace')\n .remove();\n }\n\n var hadCartesian = (oldFullLayout._has && oldFullLayout._has('cartesian'));\n var hasCartesian = (newFullLayout._has && newFullLayout._has('cartesian'));\n\n if(hadCartesian && !hasCartesian) {\n var subplotLayers = oldFullLayout._cartesianlayer.selectAll('.subplot');\n var axIds = axisIds.listIds({ _fullLayout: oldFullLayout });\n\n subplotLayers.call(purgeSubplotLayers, oldFullLayout);\n oldFullLayout._defs.selectAll('.axesclip').remove();\n\n for(i = 0; i < axIds.length; i++) {\n oldFullLayout._infolayer.select('.' + axIds[i] + 'title').remove();\n }\n }\n};\n\nexports.drawFramework = function(gd) {\n var fullLayout = gd._fullLayout,\n subplotData = makeSubplotData(gd);\n\n var subplotLayers = fullLayout._cartesianlayer.selectAll('.subplot')\n .data(subplotData, Lib.identity);\n\n subplotLayers.enter().append('g')\n .attr('class', function(name) { return 'subplot ' + name; });\n\n subplotLayers.order();\n\n subplotLayers.exit()\n .call(purgeSubplotLayers, fullLayout);\n\n subplotLayers.each(function(name) {\n var plotinfo = fullLayout._plots[name];\n\n // keep ref to plot group\n plotinfo.plotgroup = d3.select(this);\n\n // initialize list of overlay subplots\n plotinfo.overlays = [];\n\n makeSubplotLayer(plotinfo);\n\n // fill in list of overlay subplots\n if(plotinfo.mainplot) {\n var mainplot = fullLayout._plots[plotinfo.mainplot];\n mainplot.overlays.push(plotinfo);\n }\n\n // make separate drag layers for each subplot,\n // but append them to paper rather than the plot groups,\n // so they end up on top of the rest\n plotinfo.draglayer = joinLayer(fullLayout._draggers, 'g', name);\n });\n};\n\nexports.rangePlot = function(gd, plotinfo, cdSubplot) {\n makeSubplotLayer(plotinfo);\n plotOne(gd, plotinfo, cdSubplot);\n Plots.style(gd);\n};\n\nfunction makeSubplotData(gd) {\n var fullLayout = gd._fullLayout,\n subplots = Object.keys(fullLayout._plots);\n\n var subplotData = [],\n overlays = [];\n\n for(var i = 0; i < subplots.length; i++) {\n var subplot = subplots[i],\n plotinfo = fullLayout._plots[subplot];\n\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var xa2 = xa._mainAxis;\n var ya2 = ya._mainAxis;\n\n var mainplot = xa2._id + ya2._id;\n if(mainplot !== subplot && subplots.indexOf(mainplot) !== -1) {\n plotinfo.mainplot = mainplot;\n plotinfo.mainplotinfo = fullLayout._plots[mainplot];\n overlays.push(subplot);\n }\n else {\n subplotData.push(subplot);\n }\n }\n\n // main subplots before overlays\n subplotData = subplotData.concat(overlays);\n\n return subplotData;\n}\n\nfunction makeSubplotLayer(plotinfo) {\n var plotgroup = plotinfo.plotgroup;\n var id = plotinfo.id;\n var xLayer = constants.layerValue2layerClass[plotinfo.xaxis.layer];\n var yLayer = constants.layerValue2layerClass[plotinfo.yaxis.layer];\n\n if(!plotinfo.mainplot) {\n var backLayer = joinLayer(plotgroup, 'g', 'layer-subplot');\n plotinfo.shapelayer = joinLayer(backLayer, 'g', 'shapelayer');\n plotinfo.imagelayer = joinLayer(backLayer, 'g', 'imagelayer');\n\n plotinfo.gridlayer = joinLayer(plotgroup, 'g', 'gridlayer');\n plotinfo.overgrid = joinLayer(plotgroup, 'g', 'overgrid');\n\n plotinfo.zerolinelayer = joinLayer(plotgroup, 'g', 'zerolinelayer');\n plotinfo.overzero = joinLayer(plotgroup, 'g', 'overzero');\n\n joinLayer(plotgroup, 'path', 'xlines-below');\n joinLayer(plotgroup, 'path', 'ylines-below');\n plotinfo.overlinesBelow = joinLayer(plotgroup, 'g', 'overlines-below');\n\n joinLayer(plotgroup, 'g', 'xaxislayer-below');\n joinLayer(plotgroup, 'g', 'yaxislayer-below');\n plotinfo.overaxesBelow = joinLayer(plotgroup, 'g', 'overaxes-below');\n\n plotinfo.plot = joinLayer(plotgroup, 'g', 'plot');\n plotinfo.overplot = joinLayer(plotgroup, 'g', 'overplot');\n\n joinLayer(plotgroup, 'path', 'xlines-above');\n joinLayer(plotgroup, 'path', 'ylines-above');\n plotinfo.overlinesAbove = joinLayer(plotgroup, 'g', 'overlines-above');\n\n joinLayer(plotgroup, 'g', 'xaxislayer-above');\n joinLayer(plotgroup, 'g', 'yaxislayer-above');\n plotinfo.overaxesAbove = joinLayer(plotgroup, 'g', 'overaxes-above');\n\n // set refs to correct layers as determined by 'axis.layer'\n plotinfo.xlines = plotgroup.select('.xlines-' + xLayer);\n plotinfo.ylines = plotgroup.select('.ylines-' + yLayer);\n plotinfo.xaxislayer = plotgroup.select('.xaxislayer-' + xLayer);\n plotinfo.yaxislayer = plotgroup.select('.yaxislayer-' + yLayer);\n }\n else {\n var mainplotinfo = plotinfo.mainplotinfo;\n var mainplotgroup = mainplotinfo.plotgroup;\n var xId = id + '-x';\n var yId = id + '-y';\n\n // now make the components of overlaid subplots\n // overlays don't have backgrounds, and append all\n // their other components to the corresponding\n // extra groups of their main plots.\n\n plotinfo.gridlayer = joinLayer(mainplotinfo.overgrid, 'g', id);\n plotinfo.zerolinelayer = joinLayer(mainplotinfo.overzero, 'g', id);\n\n joinLayer(mainplotinfo.overlinesBelow, 'path', xId);\n joinLayer(mainplotinfo.overlinesBelow, 'path', yId);\n joinLayer(mainplotinfo.overaxesBelow, 'g', xId);\n joinLayer(mainplotinfo.overaxesBelow, 'g', yId);\n\n plotinfo.plot = joinLayer(mainplotinfo.overplot, 'g', id);\n\n joinLayer(mainplotinfo.overlinesAbove, 'path', xId);\n joinLayer(mainplotinfo.overlinesAbove, 'path', yId);\n joinLayer(mainplotinfo.overaxesAbove, 'g', xId);\n joinLayer(mainplotinfo.overaxesAbove, 'g', yId);\n\n // set refs to correct layers as determined by 'abovetraces'\n plotinfo.xlines = mainplotgroup.select('.overlines-' + xLayer).select('.' + xId);\n plotinfo.ylines = mainplotgroup.select('.overlines-' + yLayer).select('.' + yId);\n plotinfo.xaxislayer = mainplotgroup.select('.overaxes-' + xLayer).select('.' + xId);\n plotinfo.yaxislayer = mainplotgroup.select('.overaxes-' + yLayer).select('.' + yId);\n }\n\n // common attributes for all subplots, overlays or not\n\n for(var i = 0; i < constants.traceLayerClasses.length; i++) {\n joinLayer(plotinfo.plot, 'g', constants.traceLayerClasses[i]);\n }\n\n plotinfo.xlines\n .style('fill', 'none')\n .classed('crisp', true);\n\n plotinfo.ylines\n .style('fill', 'none')\n .classed('crisp', true);\n}\n\nfunction purgeSubplotLayers(layers, fullLayout) {\n if(!layers) return;\n\n var overlayIdsToRemove = {};\n\n layers.each(function(subplotId) {\n var plotgroup = d3.select(this);\n var clipId = 'clip' + fullLayout._uid + subplotId + 'plot';\n\n plotgroup.remove();\n fullLayout._draggers.selectAll('g.' + subplotId).remove();\n fullLayout._defs.select('#' + clipId).remove();\n\n overlayIdsToRemove[subplotId] = true;\n\n // do not remove individual axis s here\n // as other subplots may need them\n });\n\n // must remove overlaid subplot trace layers 'manually'\n\n var subplots = fullLayout._plots;\n var subplotIds = Object.keys(subplots);\n\n for(var i = 0; i < subplotIds.length; i++) {\n var subplotInfo = subplots[subplotIds[i]];\n var overlays = subplotInfo.overlays || [];\n\n for(var j = 0; j < overlays.length; j++) {\n var overlayInfo = overlays[j];\n\n if(overlayIdsToRemove[overlayInfo.id]) {\n overlayInfo.plot.selectAll('.trace').remove();\n }\n }\n }\n}\n\nfunction joinLayer(parent, nodeType, className) {\n var layer = parent.selectAll('.' + className)\n .data([0]);\n\n layer.enter().append(nodeType)\n .classed(className, true);\n\n return layer;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/index.js\n// module id = 155\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../../registry');\n\n\nexports.legendGetsTrace = function legendGetsTrace(trace) {\n return trace.visible && Registry.traceIs(trace, 'showLegend');\n};\n\nexports.isGrouped = function isGrouped(legendLayout) {\n return (legendLayout.traceorder || '').indexOf('grouped') !== -1;\n};\n\nexports.isVertical = function isVertical(legendLayout) {\n return legendLayout.orientation !== 'h';\n};\n\nexports.isReversed = function isReversed(legendLayout) {\n return (legendLayout.traceorder || '').indexOf('reversed') !== -1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/helpers.js\n// module id = 156\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = require('../../components/color');\n\nmodule.exports = function styleOne(s, pt, trace) {\n var lineColor = trace.marker.line.color;\n if(Array.isArray(lineColor)) lineColor = lineColor[pt.i] || Color.defaultLine;\n\n var lineWidth = trace.marker.line.width || 0;\n if(Array.isArray(lineWidth)) lineWidth = lineWidth[pt.i] || 0;\n\n s.style({'stroke-width': lineWidth})\n .call(Color.fill, pt.color)\n .call(Color.stroke, lineColor);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/style_one.js\n// module id = 157\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Plotly = require('../../plotly');\nvar Plots = require('../../plots/plots');\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\nvar Color = require('../color');\nvar Drawing = require('../drawing');\nvar Fx = require('../fx');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar setCursor = require('../../lib/setcursor');\nvar dragElement = require('../dragelement');\n\nvar drawArrowHead = require('./draw_arrow_head');\n\n\n// Annotations are stored in gd.layout.annotations, an array of objects\n// index can point to one item in this array,\n// or non-numeric to simply add a new one\n// or -1 to modify all existing\n// opt can be the full options object, or one key (to be set to value)\n// or undefined to simply redraw\n// if opt is blank, val can be 'add' or a full options object to add a new\n// annotation at that point in the array, or 'remove' to delete this one\n\nmodule.exports = {\n draw: draw,\n drawOne: drawOne,\n drawRaw: drawRaw\n};\n\n/*\n * draw: draw all annotations without any new modifications\n */\nfunction draw(gd) {\n var fullLayout = gd._fullLayout;\n\n fullLayout._infolayer.selectAll('.annotation').remove();\n\n for(var i = 0; i < fullLayout.annotations.length; i++) {\n if(fullLayout.annotations[i].visible) {\n drawOne(gd, i);\n }\n }\n\n return Plots.previousPromises(gd);\n}\n\n/*\n * drawOne: draw a single cartesian or paper-ref annotation, potentially with modifications\n *\n * index (int): the annotation to draw\n */\nfunction drawOne(gd, index) {\n var fullLayout = gd._fullLayout;\n var options = fullLayout.annotations[index] || {};\n var xa = Axes.getFromId(gd, options.xref);\n var ya = Axes.getFromId(gd, options.yref);\n\n drawRaw(gd, options, index, false, xa, ya);\n}\n\n/**\n * drawRaw: draw a single annotation, potentially with modifications\n *\n * @param {DOM element} gd\n * @param {object} options : this annotation's fullLayout options\n * @param {integer} index : index in 'annotations' container of the annotation to draw\n * @param {string} subplotId : id of the annotation's subplot\n * - use false for 2d (i.e. cartesian or paper-ref) annotations\n * @param {object | undefined} xa : full x-axis object to compute subplot pos-to-px\n * @param {object | undefined} ya : ... y-axis\n */\nfunction drawRaw(gd, options, index, subplotId, xa, ya) {\n var fullLayout = gd._fullLayout;\n var gs = gd._fullLayout._size;\n var edits = gd._context.edits;\n\n var className;\n var annbase;\n\n if(subplotId) {\n className = 'annotation-' + subplotId;\n annbase = subplotId + '.annotations[' + index + ']';\n } else {\n className = 'annotation';\n annbase = 'annotations[' + index + ']';\n }\n\n // remove the existing annotation if there is one\n fullLayout._infolayer\n .selectAll('.' + className + '[data-index=\"' + index + '\"]')\n .remove();\n\n var annClipID = 'clip' + fullLayout._uid + '_ann' + index;\n\n // this annotation is gone - quit now after deleting it\n // TODO: use d3 idioms instead of deleting and redrawing every time\n if(!options._input || options.visible === false) {\n d3.selectAll('#' + annClipID).remove();\n return;\n }\n\n // calculated pixel positions\n // x & y each will get text, head, and tail as appropriate\n var annPosPx = {x: {}, y: {}},\n textangle = +options.textangle || 0;\n\n // create the components\n // made a single group to contain all, so opacity can work right\n // with border/arrow together this could handle a whole bunch of\n // cleanup at this point, but works for now\n var annGroup = fullLayout._infolayer.append('g')\n .classed(className, true)\n .attr('data-index', String(index))\n .style('opacity', options.opacity);\n\n // another group for text+background so that they can rotate together\n var annTextGroup = annGroup.append('g')\n .classed('annotation-text-g', true);\n\n var editTextPosition = edits[options.showarrow ? 'annotationTail' : 'annotationPosition'];\n var textEvents = options.captureevents || edits.annotationText || editTextPosition;\n\n var annTextGroupInner = annTextGroup.append('g')\n .style('pointer-events', textEvents ? 'all' : null)\n .call(setCursor, 'default')\n .on('click', function() {\n gd._dragging = false;\n\n var eventData = {\n index: index,\n annotation: options._input,\n fullAnnotation: options,\n event: d3.event\n };\n\n if(subplotId) {\n eventData.subplotId = subplotId;\n }\n\n gd.emit('plotly_clickannotation', eventData);\n });\n\n if(options.hovertext) {\n annTextGroupInner\n .on('mouseover', function() {\n var hoverOptions = options.hoverlabel;\n var hoverFont = hoverOptions.font;\n var bBox = this.getBoundingClientRect();\n var bBoxRef = gd.getBoundingClientRect();\n\n Fx.loneHover({\n x0: bBox.left - bBoxRef.left,\n x1: bBox.right - bBoxRef.left,\n y: (bBox.top + bBox.bottom) / 2 - bBoxRef.top,\n text: options.hovertext,\n color: hoverOptions.bgcolor,\n borderColor: hoverOptions.bordercolor,\n fontFamily: hoverFont.family,\n fontSize: hoverFont.size,\n fontColor: hoverFont.color\n }, {\n container: fullLayout._hoverlayer.node(),\n outerContainer: fullLayout._paper.node(),\n gd: gd\n });\n })\n .on('mouseout', function() {\n Fx.loneUnhover(fullLayout._hoverlayer.node());\n });\n }\n\n var borderwidth = options.borderwidth,\n borderpad = options.borderpad,\n borderfull = borderwidth + borderpad;\n\n var annTextBG = annTextGroupInner.append('rect')\n .attr('class', 'bg')\n .style('stroke-width', borderwidth + 'px')\n .call(Color.stroke, options.bordercolor)\n .call(Color.fill, options.bgcolor);\n\n var isSizeConstrained = options.width || options.height;\n\n var annTextClip = fullLayout._topclips\n .selectAll('#' + annClipID)\n .data(isSizeConstrained ? [0] : []);\n\n annTextClip.enter().append('clipPath')\n .classed('annclip', true)\n .attr('id', annClipID)\n .append('rect');\n annTextClip.exit().remove();\n\n var font = options.font;\n\n var annText = annTextGroupInner.append('text')\n .classed('annotation-text', true)\n .text(options.text);\n\n function textLayout(s) {\n s.call(Drawing.font, font)\n .attr({\n 'text-anchor': {\n left: 'start',\n right: 'end'\n }[options.align] || 'middle'\n });\n\n svgTextUtils.convertToTspans(s, gd, drawGraphicalElements);\n return s;\n }\n\n function drawGraphicalElements() {\n // if the text has *only* a link, make the whole box into a link\n var anchor3 = annText.selectAll('a');\n if(anchor3.size() === 1 && anchor3.text() === annText.text()) {\n var wholeLink = annTextGroupInner.insert('a', ':first-child').attr({\n 'xlink:xlink:href': anchor3.attr('xlink:href'),\n 'xlink:xlink:show': anchor3.attr('xlink:show')\n })\n .style({cursor: 'pointer'});\n\n wholeLink.node().appendChild(annTextBG.node());\n }\n\n var mathjaxGroup = annTextGroupInner.select('.annotation-text-math-group');\n var hasMathjax = !mathjaxGroup.empty();\n var anntextBB = Drawing.bBox(\n (hasMathjax ? mathjaxGroup : annText).node());\n var textWidth = anntextBB.width;\n var textHeight = anntextBB.height;\n var annWidth = options.width || textWidth;\n var annHeight = options.height || textHeight;\n var outerWidth = Math.round(annWidth + 2 * borderfull);\n var outerHeight = Math.round(annHeight + 2 * borderfull);\n\n\n // save size in the annotation object for use by autoscale\n options._w = annWidth;\n options._h = annHeight;\n\n function shiftFraction(v, anchor) {\n if(anchor === 'auto') {\n if(v < 1 / 3) anchor = 'left';\n else if(v > 2 / 3) anchor = 'right';\n else anchor = 'center';\n }\n return {\n center: 0,\n middle: 0,\n left: 0.5,\n bottom: -0.5,\n right: -0.5,\n top: 0.5\n }[anchor];\n }\n\n var annotationIsOffscreen = false;\n var letters = ['x', 'y'];\n\n for(var i = 0; i < letters.length; i++) {\n var axLetter = letters[i],\n axRef = options[axLetter + 'ref'] || axLetter,\n tailRef = options['a' + axLetter + 'ref'],\n ax = {x: xa, y: ya}[axLetter],\n dimAngle = (textangle + (axLetter === 'x' ? 0 : -90)) * Math.PI / 180,\n // note that these two can be either positive or negative\n annSizeFromWidth = outerWidth * Math.cos(dimAngle),\n annSizeFromHeight = outerHeight * Math.sin(dimAngle),\n // but this one is the positive total size\n annSize = Math.abs(annSizeFromWidth) + Math.abs(annSizeFromHeight),\n anchor = options[axLetter + 'anchor'],\n overallShift = options[axLetter + 'shift'] * (axLetter === 'x' ? 1 : -1),\n posPx = annPosPx[axLetter],\n basePx,\n textPadShift,\n alignPosition,\n autoAlignFraction,\n textShift;\n\n /*\n * calculate the *primary* pixel position\n * which is the arrowhead if there is one,\n * otherwise the text anchor point\n */\n if(ax) {\n /*\n * hide the annotation if it's pointing outside the visible plot\n * as long as the axis isn't autoranged - then we need to draw it\n * anyway to get its bounding box. When we're dragging, an axis can\n * still look autoranged even though it won't be when the drag finishes.\n */\n var posFraction = ax.r2fraction(options[axLetter]);\n if((gd._dragging || !ax.autorange) && (posFraction < 0 || posFraction > 1)) {\n if(tailRef === axRef) {\n posFraction = ax.r2fraction(options['a' + axLetter]);\n if(posFraction < 0 || posFraction > 1) {\n annotationIsOffscreen = true;\n }\n }\n else {\n annotationIsOffscreen = true;\n }\n\n if(annotationIsOffscreen) continue;\n }\n basePx = ax._offset + ax.r2p(options[axLetter]);\n autoAlignFraction = 0.5;\n }\n else {\n if(axLetter === 'x') {\n alignPosition = options[axLetter];\n basePx = gs.l + gs.w * alignPosition;\n }\n else {\n alignPosition = 1 - options[axLetter];\n basePx = gs.t + gs.h * alignPosition;\n }\n autoAlignFraction = options.showarrow ? 0.5 : alignPosition;\n }\n\n // now translate this into pixel positions of head, tail, and text\n // as well as paddings for autorange\n if(options.showarrow) {\n posPx.head = basePx;\n\n var arrowLength = options['a' + axLetter];\n\n // with an arrow, the text rotates around the anchor point\n textShift = annSizeFromWidth * shiftFraction(0.5, options.xanchor) -\n annSizeFromHeight * shiftFraction(0.5, options.yanchor);\n\n if(tailRef === axRef) {\n posPx.tail = ax._offset + ax.r2p(arrowLength);\n // tail is data-referenced: autorange pads the text in px from the tail\n textPadShift = textShift;\n }\n else {\n posPx.tail = basePx + arrowLength;\n // tail is specified in px from head, so autorange also pads vs head\n textPadShift = textShift + arrowLength;\n }\n\n posPx.text = posPx.tail + textShift;\n\n // constrain pixel/paper referenced so the draggers are at least\n // partially visible\n var maxPx = fullLayout[(axLetter === 'x') ? 'width' : 'height'];\n if(axRef === 'paper') {\n posPx.head = Lib.constrain(posPx.head, 1, maxPx - 1);\n }\n if(tailRef === 'pixel') {\n var shiftPlus = -Math.max(posPx.tail - 3, posPx.text),\n shiftMinus = Math.min(posPx.tail + 3, posPx.text) - maxPx;\n if(shiftPlus > 0) {\n posPx.tail += shiftPlus;\n posPx.text += shiftPlus;\n }\n else if(shiftMinus > 0) {\n posPx.tail -= shiftMinus;\n posPx.text -= shiftMinus;\n }\n }\n\n posPx.tail += overallShift;\n posPx.head += overallShift;\n }\n else {\n // with no arrow, the text rotates and *then* we put the anchor\n // relative to the new bounding box\n textShift = annSize * shiftFraction(autoAlignFraction, anchor);\n textPadShift = textShift;\n posPx.text = basePx + textShift;\n }\n\n posPx.text += overallShift;\n textShift += overallShift;\n textPadShift += overallShift;\n\n // padplus/minus are used by autorange\n options['_' + axLetter + 'padplus'] = (annSize / 2) + textPadShift;\n options['_' + axLetter + 'padminus'] = (annSize / 2) - textPadShift;\n\n // size/shift are used during dragging\n options['_' + axLetter + 'size'] = annSize;\n options['_' + axLetter + 'shift'] = textShift;\n }\n\n if(annotationIsOffscreen) {\n annTextGroupInner.remove();\n return;\n }\n\n var xShift = 0;\n var yShift = 0;\n\n if(options.align !== 'left') {\n xShift = (annWidth - textWidth) * (options.align === 'center' ? 0.5 : 1);\n }\n if(options.valign !== 'top') {\n yShift = (annHeight - textHeight) * (options.valign === 'middle' ? 0.5 : 1);\n }\n\n if(hasMathjax) {\n mathjaxGroup.select('svg').attr({\n x: borderfull + xShift - 1,\n y: borderfull + yShift\n })\n .call(Drawing.setClipUrl, isSizeConstrained ? annClipID : null);\n }\n else {\n var texty = borderfull + yShift - anntextBB.top;\n var textx = borderfull + xShift - anntextBB.left;\n\n annText.call(svgTextUtils.positionText, textx, texty)\n .call(Drawing.setClipUrl, isSizeConstrained ? annClipID : null);\n }\n\n annTextClip.select('rect').call(Drawing.setRect, borderfull, borderfull,\n annWidth, annHeight);\n\n annTextBG.call(Drawing.setRect, borderwidth / 2, borderwidth / 2,\n outerWidth - borderwidth, outerHeight - borderwidth);\n\n annTextGroupInner.call(Drawing.setTranslate,\n Math.round(annPosPx.x.text - outerWidth / 2),\n Math.round(annPosPx.y.text - outerHeight / 2));\n\n /*\n * rotate text and background\n * we already calculated the text center position *as rotated*\n * because we needed that for autoranging anyway, so now whether\n * we have an arrow or not, we rotate about the text center.\n */\n annTextGroup.attr({transform: 'rotate(' + textangle + ',' +\n annPosPx.x.text + ',' + annPosPx.y.text + ')'});\n\n /*\n * add the arrow\n * uses options[arrowwidth,arrowcolor,arrowhead] for styling\n * dx and dy are normally zero, but when you are dragging the textbox\n * while the head stays put, dx and dy are the pixel offsets\n */\n var drawArrow = function(dx, dy) {\n annGroup\n .selectAll('.annotation-arrow-g')\n .remove();\n\n var headX = annPosPx.x.head,\n headY = annPosPx.y.head,\n tailX = annPosPx.x.tail + dx,\n tailY = annPosPx.y.tail + dy,\n textX = annPosPx.x.text + dx,\n textY = annPosPx.y.text + dy,\n\n // find the edge of the text box, where we'll start the arrow:\n // create transform matrix to rotate the text box corners\n transform = Lib.rotationXYMatrix(textangle, textX, textY),\n applyTransform = Lib.apply2DTransform(transform),\n applyTransform2 = Lib.apply2DTransform2(transform),\n\n // calculate and transform bounding box\n width = +annTextBG.attr('width'),\n height = +annTextBG.attr('height'),\n xLeft = textX - 0.5 * width,\n xRight = xLeft + width,\n yTop = textY - 0.5 * height,\n yBottom = yTop + height,\n edges = [\n [xLeft, yTop, xLeft, yBottom],\n [xLeft, yBottom, xRight, yBottom],\n [xRight, yBottom, xRight, yTop],\n [xRight, yTop, xLeft, yTop]\n ].map(applyTransform2);\n\n // Remove the line if it ends inside the box. Use ray\n // casting for rotated boxes: see which edges intersect a\n // line from the arrowhead to far away and reduce with xor\n // to get the parity of the number of intersections.\n if(edges.reduce(function(a, x) {\n return a ^\n !!Lib.segmentsIntersect(headX, headY, headX + 1e6, headY + 1e6,\n x[0], x[1], x[2], x[3]);\n }, false)) {\n // no line or arrow - so quit drawArrow now\n return;\n }\n\n edges.forEach(function(x) {\n var p = Lib.segmentsIntersect(tailX, tailY, headX, headY,\n x[0], x[1], x[2], x[3]);\n if(p) {\n tailX = p.x;\n tailY = p.y;\n }\n });\n\n var strokewidth = options.arrowwidth,\n arrowColor = options.arrowcolor;\n\n var arrowGroup = annGroup.append('g')\n .style({opacity: Color.opacity(arrowColor)})\n .classed('annotation-arrow-g', true);\n\n var arrow = arrowGroup.append('path')\n .attr('d', 'M' + tailX + ',' + tailY + 'L' + headX + ',' + headY)\n .style('stroke-width', strokewidth + 'px')\n .call(Color.stroke, Color.rgb(arrowColor));\n\n drawArrowHead(arrow, 'end', options);\n\n // the arrow dragger is a small square right at the head, then a line to the tail,\n // all expanded by a stroke width of 6px plus the arrow line width\n if(edits.annotationPosition && arrow.node().parentNode && !subplotId) {\n var arrowDragHeadX = headX;\n var arrowDragHeadY = headY;\n if(options.standoff) {\n var arrowLength = Math.sqrt(Math.pow(headX - tailX, 2) + Math.pow(headY - tailY, 2));\n arrowDragHeadX += options.standoff * (tailX - headX) / arrowLength;\n arrowDragHeadY += options.standoff * (tailY - headY) / arrowLength;\n }\n var arrowDrag = arrowGroup.append('path')\n .classed('annotation-arrow', true)\n .classed('anndrag', true)\n .attr({\n d: 'M3,3H-3V-3H3ZM0,0L' + (tailX - arrowDragHeadX) + ',' + (tailY - arrowDragHeadY),\n transform: 'translate(' + arrowDragHeadX + ',' + arrowDragHeadY + ')'\n })\n .style('stroke-width', (strokewidth + 6) + 'px')\n .call(Color.stroke, 'rgba(0,0,0,0)')\n .call(Color.fill, 'rgba(0,0,0,0)');\n\n var update,\n annx0,\n anny0;\n\n // dragger for the arrow & head: translates the whole thing\n // (head/tail/text) all together\n dragElement.init({\n element: arrowDrag.node(),\n gd: gd,\n prepFn: function() {\n var pos = Drawing.getTranslate(annTextGroupInner);\n\n annx0 = pos.x;\n anny0 = pos.y;\n update = {};\n if(xa && xa.autorange) {\n update[xa._name + '.autorange'] = true;\n }\n if(ya && ya.autorange) {\n update[ya._name + '.autorange'] = true;\n }\n },\n moveFn: function(dx, dy) {\n var annxy0 = applyTransform(annx0, anny0),\n xcenter = annxy0[0] + dx,\n ycenter = annxy0[1] + dy;\n annTextGroupInner.call(Drawing.setTranslate, xcenter, ycenter);\n\n update[annbase + '.x'] = xa ?\n xa.p2r(xa.r2p(options.x) + dx) :\n (options.x + (dx / gs.w));\n update[annbase + '.y'] = ya ?\n ya.p2r(ya.r2p(options.y) + dy) :\n (options.y - (dy / gs.h));\n\n if(options.axref === options.xref) {\n update[annbase + '.ax'] = xa.p2r(xa.r2p(options.ax) + dx);\n }\n\n if(options.ayref === options.yref) {\n update[annbase + '.ay'] = ya.p2r(ya.r2p(options.ay) + dy);\n }\n\n arrowGroup.attr('transform', 'translate(' + dx + ',' + dy + ')');\n annTextGroup.attr({\n transform: 'rotate(' + textangle + ',' +\n xcenter + ',' + ycenter + ')'\n });\n },\n doneFn: function(dragged) {\n if(dragged) {\n Plotly.relayout(gd, update);\n var notesBox = document.querySelector('.js-notes-box-panel');\n if(notesBox) notesBox.redraw(notesBox.selectedObj);\n }\n }\n });\n }\n };\n\n if(options.showarrow) drawArrow(0, 0);\n\n // user dragging the annotation (text, not arrow)\n if(editTextPosition) {\n var update,\n baseTextTransform;\n\n // dragger for the textbox: if there's an arrow, just drag the\n // textbox and tail, leave the head untouched\n dragElement.init({\n element: annTextGroupInner.node(),\n gd: gd,\n prepFn: function() {\n baseTextTransform = annTextGroup.attr('transform');\n update = {};\n },\n moveFn: function(dx, dy) {\n var csr = 'pointer';\n if(options.showarrow) {\n if(options.axref === options.xref) {\n update[annbase + '.ax'] = xa.p2r(xa.r2p(options.ax) + dx);\n } else {\n update[annbase + '.ax'] = options.ax + dx;\n }\n\n if(options.ayref === options.yref) {\n update[annbase + '.ay'] = ya.p2r(ya.r2p(options.ay) + dy);\n } else {\n update[annbase + '.ay'] = options.ay + dy;\n }\n\n drawArrow(dx, dy);\n }\n else if(!subplotId) {\n if(xa) update[annbase + '.x'] = options.x + dx / xa._m;\n else {\n var widthFraction = options._xsize / gs.w,\n xLeft = options.x + (options._xshift - options.xshift) / gs.w -\n widthFraction / 2;\n\n update[annbase + '.x'] = dragElement.align(xLeft + dx / gs.w,\n widthFraction, 0, 1, options.xanchor);\n }\n\n if(ya) update[annbase + '.y'] = options.y + dy / ya._m;\n else {\n var heightFraction = options._ysize / gs.h,\n yBottom = options.y - (options._yshift + options.yshift) / gs.h -\n heightFraction / 2;\n\n update[annbase + '.y'] = dragElement.align(yBottom - dy / gs.h,\n heightFraction, 0, 1, options.yanchor);\n }\n if(!xa || !ya) {\n csr = dragElement.getCursor(\n xa ? 0.5 : update[annbase + '.x'],\n ya ? 0.5 : update[annbase + '.y'],\n options.xanchor, options.yanchor\n );\n }\n }\n else return;\n\n annTextGroup.attr({\n transform: 'translate(' + dx + ',' + dy + ')' + baseTextTransform\n });\n\n setCursor(annTextGroupInner, csr);\n },\n doneFn: function(dragged) {\n setCursor(annTextGroupInner);\n if(dragged) {\n Plotly.relayout(gd, update);\n var notesBox = document.querySelector('.js-notes-box-panel');\n if(notesBox) notesBox.redraw(notesBox.selectedObj);\n }\n }\n });\n }\n }\n\n if(edits.annotationText) {\n annText.call(svgTextUtils.makeEditable, {delegate: annTextGroupInner, gd: gd})\n .call(textLayout)\n .on('edit', function(_text) {\n options.text = _text;\n this.call(textLayout);\n\n var update = {};\n update[annbase + '.text'] = options.text;\n\n if(xa && xa.autorange) {\n update[xa._name + '.autorange'] = true;\n }\n if(ya && ya.autorange) {\n update[ya._name + '.autorange'] = true;\n }\n\n Plotly.relayout(gd, update);\n });\n }\n else annText.call(textLayout);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/draw.js\n// module id = 158\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar annAtts = require('../annotations/attributes');\nvar overrideAll = require('../../plot_api/edit_types').overrideAll;\n\nmodule.exports = overrideAll({\n _isLinkedToArray: 'annotation',\n\n visible: annAtts.visible,\n x: {\n valType: 'any',\n \n \n },\n y: {\n valType: 'any',\n \n \n },\n z: {\n valType: 'any',\n \n \n },\n ax: {\n valType: 'number',\n \n \n },\n ay: {\n valType: 'number',\n \n \n },\n\n xanchor: annAtts.xanchor,\n xshift: annAtts.xshift,\n yanchor: annAtts.yanchor,\n yshift: annAtts.yshift,\n\n text: annAtts.text,\n textangle: annAtts.textangle,\n font: annAtts.font,\n width: annAtts.width,\n height: annAtts.height,\n opacity: annAtts.opacity,\n align: annAtts.align,\n valign: annAtts.valign,\n bgcolor: annAtts.bgcolor,\n bordercolor: annAtts.bordercolor,\n borderpad: annAtts.borderpad,\n borderwidth: annAtts.borderwidth,\n showarrow: annAtts.showarrow,\n arrowcolor: annAtts.arrowcolor,\n arrowhead: annAtts.arrowhead,\n arrowsize: annAtts.arrowsize,\n arrowwidth: annAtts.arrowwidth,\n standoff: annAtts.standoff,\n hovertext: annAtts.hovertext,\n hoverlabel: annAtts.hoverlabel,\n captureevents: annAtts.captureevents,\n\n // maybes later?\n // clicktoshow: annAtts.clicktoshow,\n // xclick: annAtts.xclick,\n // yclick: annAtts.yclick,\n\n // not needed!\n // axref: 'pixel'\n // ayref: 'pixel'\n // xref: 'x'\n // yref: 'y\n // zref: 'z'\n}, 'calc', 'from-root');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations3d/attributes.js\n// module id = 159\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// special position conversion functions... category axis positions can't be\n// specified by their data values, because they don't make a continuous mapping.\n// so these have to be specified in terms of the category serial numbers,\n// but can take fractional values. Other axis types we specify position based on\n// the actual data values.\n// TODO: in V2.0 (when log axis ranges are in data units) range and shape position\n// will be identical, so rangeToShapePosition and shapePositionToRange can be\n// removed entirely.\n\nexports.rangeToShapePosition = function(ax) {\n return (ax.type === 'log') ? ax.r2d : function(v) { return v; };\n};\n\nexports.shapePositionToRange = function(ax) {\n return (ax.type === 'log') ? ax.d2r : function(v) { return v; };\n};\n\nexports.decodeDate = function(convertToPx) {\n return function(v) {\n if(v.replace) v = v.replace('_', ' ');\n return convertToPx(v);\n };\n};\n\nexports.encodeDate = function(convertToDate) {\n return function(v) { return convertToDate(v).replace(' ', '_'); };\n};\n\nexports.getDataToPixel = function(gd, axis, isVertical) {\n var gs = gd._fullLayout._size,\n dataToPixel;\n\n if(axis) {\n var d2r = exports.shapePositionToRange(axis);\n\n dataToPixel = function(v) {\n return axis._offset + axis.r2p(d2r(v, true));\n };\n\n if(axis.type === 'date') dataToPixel = exports.decodeDate(dataToPixel);\n }\n else if(isVertical) {\n dataToPixel = function(v) { return gs.t + gs.h * (1 - v); };\n }\n else {\n dataToPixel = function(v) { return gs.l + gs.w * v; };\n }\n\n return dataToPixel;\n};\n\nexports.getPixelToData = function(gd, axis, isVertical) {\n var gs = gd._fullLayout._size,\n pixelToData;\n\n if(axis) {\n var r2d = exports.rangeToShapePosition(axis);\n pixelToData = function(p) { return r2d(axis.p2r(p - axis._offset)); };\n }\n else if(isVertical) {\n pixelToData = function(p) { return 1 - (p - gs.t) / gs.h; };\n }\n else {\n pixelToData = function(p) { return (p - gs.l) / gs.w; };\n }\n\n return pixelToData;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/shapes/helpers.js\n// module id = 160\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n\n // layout attribute name\n name: 'updatemenus',\n\n // class names\n containerClassName: 'updatemenu-container',\n headerGroupClassName: 'updatemenu-header-group',\n headerClassName: 'updatemenu-header',\n headerArrowClassName: 'updatemenu-header-arrow',\n dropdownButtonGroupClassName: 'updatemenu-dropdown-button-group',\n dropdownButtonClassName: 'updatemenu-dropdown-button',\n buttonClassName: 'updatemenu-button',\n itemRectClassName: 'updatemenu-item-rect',\n itemTextClassName: 'updatemenu-item-text',\n\n // DOM attribute name in button group keeping track\n // of active update menu\n menuIndexAttrName: 'updatemenu-active-index',\n\n // id root pass to Plots.autoMargin\n autoMarginIdRoot: 'updatemenu-',\n\n // options when 'active: -1'\n blankHeaderOpts: { label: ' ' },\n\n // min item width / height\n minWidth: 30,\n minHeight: 30,\n\n // padding around item text\n textPadX: 24,\n arrowPadX: 16,\n\n // item rect radii\n rx: 2,\n ry: 2,\n\n // item text x offset off left edge\n textOffsetX: 12,\n\n // item text y offset (w.r.t. middle)\n textOffsetY: 3,\n\n // arrow offset off right edge\n arrowOffsetX: 4,\n\n // gap between header and buttons\n gapButtonHeader: 5,\n\n // gap between between buttons\n gapButton: 2,\n\n // color given to active buttons\n activeColor: '#F4FAFF',\n\n // color given to hovered buttons\n hoverColor: '#F4FAFF',\n\n // symbol for menu open arrow\n arrowSymbol: {\n left: '◄',\n right: '►',\n up: '▲',\n down: '▼'\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/updatemenus/constants.js\n// module id = 161\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorAttributes = require('../color/attributes');\n\nmodule.exports = {\n bgcolor: {\n valType: 'color',\n dflt: colorAttributes.background,\n \n editType: 'calc',\n \n },\n bordercolor: {\n valType: 'color',\n dflt: colorAttributes.defaultLine,\n \n editType: 'calc',\n \n },\n borderwidth: {\n valType: 'integer',\n dflt: 0,\n min: 0,\n \n editType: 'calc',\n \n },\n autorange: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n },\n range: {\n valType: 'info_array',\n \n items: [\n {valType: 'any', editType: 'calc'},\n {valType: 'any', editType: 'calc'}\n ],\n editType: 'calc',\n \n },\n thickness: {\n valType: 'number',\n dflt: 0.15,\n min: 0,\n max: 1,\n \n editType: 'calc',\n \n },\n visible: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n },\n editType: 'calc'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeslider/attributes.js\n// module id = 162\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = require('../../plots/font_attributes');\nvar colorAttrs = require('../color/attributes');\nvar extendFlat = require('../../lib/extend').extendFlat;\nvar buttonAttrs = require('./button_attributes');\n\nbuttonAttrs = extendFlat(buttonAttrs, {\n _isLinkedToArray: 'button',\n\n \n});\n\nmodule.exports = {\n visible: {\n valType: 'boolean',\n \n editType: 'plot',\n \n },\n\n buttons: buttonAttrs,\n\n x: {\n valType: 'number',\n min: -2,\n max: 3,\n \n editType: 'plot',\n \n },\n xanchor: {\n valType: 'enumerated',\n values: ['auto', 'left', 'center', 'right'],\n dflt: 'left',\n \n editType: 'plot',\n \n },\n y: {\n valType: 'number',\n min: -2,\n max: 3,\n \n editType: 'plot',\n \n },\n yanchor: {\n valType: 'enumerated',\n values: ['auto', 'top', 'middle', 'bottom'],\n dflt: 'bottom',\n \n editType: 'plot',\n \n },\n\n font: fontAttrs({\n editType: 'plot',\n \n }),\n\n bgcolor: {\n valType: 'color',\n dflt: colorAttrs.lightLine,\n \n editType: 'plot',\n \n },\n activecolor: {\n valType: 'color',\n \n editType: 'plot',\n \n },\n bordercolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'plot',\n \n },\n borderwidth: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'plot',\n \n },\n editType: 'plot'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeselector/attributes.js\n// module id = 163\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = require('../scatter/attributes');\nvar colorAttributes = require('../../components/colorscale/color_attributes');\nvar errorBarAttrs = require('../../components/errorbars/attributes');\nvar colorbarAttrs = require('../../components/colorbar/attributes');\nvar fontAttrs = require('../../plots/font_attributes');\n\nvar extendFlat = require('../../lib/extend').extendFlat;\n\nvar textFontAttrs = fontAttrs({\n editType: 'calc',\n arrayOk: true,\n \n});\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nvar markerLineWidth = extendFlat({},\n scatterMarkerLineAttrs.width, { dflt: 0 });\n\nvar markerLine = extendFlat({\n width: markerLineWidth,\n editType: 'calc'\n}, colorAttributes('marker.line'));\n\nvar marker = extendFlat({\n line: markerLine,\n editType: 'calc'\n}, colorAttributes('marker'), {\n showscale: scatterMarkerAttrs.showscale,\n colorbar: colorbarAttrs\n});\n\n\nmodule.exports = {\n x: scatterAttrs.x,\n x0: scatterAttrs.x0,\n dx: scatterAttrs.dx,\n y: scatterAttrs.y,\n y0: scatterAttrs.y0,\n dy: scatterAttrs.dy,\n\n text: scatterAttrs.text,\n hovertext: scatterAttrs.hovertext,\n\n textposition: {\n valType: 'enumerated',\n \n values: ['inside', 'outside', 'auto', 'none'],\n dflt: 'none',\n arrayOk: true,\n editType: 'calc',\n \n },\n\n textfont: extendFlat({}, textFontAttrs, {\n \n }),\n\n insidetextfont: extendFlat({}, textFontAttrs, {\n \n }),\n\n outsidetextfont: extendFlat({}, textFontAttrs, {\n \n }),\n\n constraintext: {\n valType: 'enumerated',\n values: ['inside', 'outside', 'both', 'none'],\n \n dflt: 'both',\n editType: 'calc',\n \n },\n\n orientation: {\n valType: 'enumerated',\n \n values: ['v', 'h'],\n editType: 'calc+clearAxisTypes',\n \n },\n\n base: {\n valType: 'any',\n dflt: null,\n arrayOk: true,\n \n editType: 'calc',\n \n },\n\n offset: {\n valType: 'number',\n dflt: null,\n arrayOk: true,\n \n editType: 'calc',\n \n },\n\n width: {\n valType: 'number',\n dflt: null,\n min: 0,\n arrayOk: true,\n \n editType: 'calc',\n \n },\n\n marker: marker,\n\n r: scatterAttrs.r,\n t: scatterAttrs.t,\n\n error_y: errorBarAttrs,\n error_x: errorBarAttrs,\n\n _deprecated: {\n bardir: {\n valType: 'enumerated',\n \n editType: 'calc',\n values: ['v', 'h'],\n \n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/attributes.js\n// module id = 164\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Push array with unique items\n *\n * @param {array} array\n * array to be filled\n * @param {any} item\n * item to be or not to be inserted\n * @return {array}\n * ref to array (now possibly containing one more item)\n *\n */\nmodule.exports = function pushUnique(array, item) {\n if(item instanceof RegExp) {\n var itemStr = item.toString(),\n i;\n for(i = 0; i < array.length; i++) {\n if(array[i] instanceof RegExp && array[i].toString() === itemStr) {\n return array;\n }\n }\n array.push(item);\n }\n else if(item && array.indexOf(item) === -1) array.push(item);\n\n return array;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/push_unique.js\n// module id = 213\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../registry');\n\n/*\n * containerArrayMatch: does this attribute string point into a\n * layout container array?\n *\n * @param {String} astr: an attribute string, like *annotations[2].text*\n *\n * @returns {Object | false} Returns false if `astr` doesn't match a container\n * array. If it does, returns:\n * {array: {String}, index: {Number}, property: {String}}\n * ie the attribute string for the array, the index within the array (or ''\n * if the whole array) and the property within that (or '' if the whole array\n * or the whole object)\n */\nmodule.exports = function containerArrayMatch(astr) {\n var rootContainers = Registry.layoutArrayContainers,\n regexpContainers = Registry.layoutArrayRegexes,\n rootPart = astr.split('[')[0],\n arrayStr,\n match;\n\n // look for regexp matches first, because they may be nested inside root matches\n // eg updatemenus[i].buttons is nested inside updatemenus\n for(var i = 0; i < regexpContainers.length; i++) {\n match = astr.match(regexpContainers[i]);\n if(match && match.index === 0) {\n arrayStr = match[0];\n break;\n }\n }\n\n // now look for root matches\n if(!arrayStr) arrayStr = rootContainers[rootContainers.indexOf(rootPart)];\n\n if(!arrayStr) return false;\n\n var tail = astr.substr(arrayStr.length);\n if(!tail) return {array: arrayStr, index: '', property: ''};\n\n match = tail.match(/^\\[(0|[1-9][0-9]*)\\](\\.(.+))?$/);\n if(!match) return false;\n\n return {array: arrayStr, index: Number(match[1]), property: match[3] || ''};\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/container_array_match.js\n// module id = 214\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar scales = require('./scales');\nvar defaultScale = require('./default_scale');\nvar isValidScaleArray = require('./is_valid_scale_array');\n\n\nmodule.exports = function getScale(scl, dflt) {\n if(!dflt) dflt = defaultScale;\n if(!scl) return dflt;\n\n function parseScale() {\n try {\n scl = scales[scl] || JSON.parse(scl);\n }\n catch(e) {\n scl = dflt;\n }\n }\n\n if(typeof scl === 'string') {\n parseScale();\n // occasionally scl is double-JSON encoded...\n if(typeof scl === 'string') parseScale();\n }\n\n if(!isValidScaleArray(scl)) return dflt;\n return scl;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/get_scale.js\n// module id = 215\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scales = require('./scales');\n\n\nmodule.exports = scales.RdBu;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/default_scale.js\n// module id = 216\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar tinycolor = require('tinycolor2');\n\n\nmodule.exports = function isValidScaleArray(scl) {\n var highestVal = 0;\n\n if(!Array.isArray(scl) || scl.length < 2) return false;\n\n if(!scl[0] || !scl[scl.length - 1]) return false;\n\n if(+scl[0][0] !== 0 || +scl[scl.length - 1][0] !== 1) return false;\n\n for(var i = 0; i < scl.length; i++) {\n var si = scl[i];\n\n if(si.length !== 2 || +si[0] < highestVal || !tinycolor(si[1]).isValid()) {\n return false;\n }\n\n highestVal = +si[0];\n }\n\n return true;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/is_valid_scale_array.js\n// module id = 217\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Simple helper functions\n// none of these need any external deps\n\n/*\n * make a regex for matching counter ids/names ie xaxis, xaxis2, xaxis10...\n * eg: regexCounter('x')\n * tail is an optional piece after the id\n * eg regexCounter('scene', '.annotations') for scene2.annotations etc.\n */\nexports.counter = function(head, tail, openEnded) {\n return new RegExp('^' + head + '([2-9]|[1-9][0-9]+)?' +\n (tail || '') + (openEnded ? '' : '$'));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/regex.js\n// module id = 218\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar loggers = require('./loggers');\n\n\n/**\n * findBin - find the bin for val - note that it can return outside the\n * bin range any pos. or neg. integer for linear bins, or -1 or\n * bins.length-1 for explicit.\n * bins is either an object {start,size,end} or an array length #bins+1\n * bins can be either increasing or decreasing but must be monotonic\n * for linear bins, we can just calculate. For listed bins, run a binary\n * search linelow (truthy) says the bin boundary should be attributed to\n * the lower bin rather than the default upper bin\n */\nexports.findBin = function(val, bins, linelow) {\n if(isNumeric(bins.start)) {\n return linelow ?\n Math.ceil((val - bins.start) / bins.size) - 1 :\n Math.floor((val - bins.start) / bins.size);\n }\n else {\n var n1 = 0,\n n2 = bins.length,\n c = 0,\n n,\n test;\n if(bins[bins.length - 1] >= bins[0]) {\n test = linelow ? lessThan : lessOrEqual;\n } else {\n test = linelow ? greaterOrEqual : greaterThan;\n }\n // c is just to avoid infinite loops if there's an error\n while(n1 < n2 && c++ < 100) {\n n = Math.floor((n1 + n2) / 2);\n if(test(bins[n], val)) n1 = n + 1;\n else n2 = n;\n }\n if(c > 90) loggers.log('Long binary search...');\n return n1 - 1;\n }\n};\n\nfunction lessThan(a, b) { return a < b; }\nfunction lessOrEqual(a, b) { return a <= b; }\nfunction greaterThan(a, b) { return a > b; }\nfunction greaterOrEqual(a, b) { return a >= b; }\n\nexports.sorterAsc = function(a, b) { return a - b; };\nexports.sorterDes = function(a, b) { return b - a; };\n\n/**\n * find distinct values in an array, lumping together ones that appear to\n * just be off by a rounding error\n * return the distinct values and the minimum difference between any two\n */\nexports.distinctVals = function(valsIn) {\n var vals = valsIn.slice(); // otherwise we sort the original array...\n vals.sort(exports.sorterAsc);\n\n var l = vals.length - 1,\n minDiff = (vals[l] - vals[0]) || 1,\n errDiff = minDiff / (l || 1) / 10000,\n v2 = [vals[0]];\n\n for(var i = 0; i < l; i++) {\n // make sure values aren't just off by a rounding error\n if(vals[i + 1] > vals[i] + errDiff) {\n minDiff = Math.min(minDiff, vals[i + 1] - vals[i]);\n v2.push(vals[i + 1]);\n }\n }\n\n return {vals: v2, minDiff: minDiff};\n};\n\n/**\n * return the smallest element from (sorted) array arrayIn that's bigger than val,\n * or (reverse) the largest element smaller than val\n * used to find the best tick given the minimum (non-rounded) tick\n * particularly useful for date/time where things are not powers of 10\n * binary search is probably overkill here...\n */\nexports.roundUp = function(val, arrayIn, reverse) {\n var low = 0,\n high = arrayIn.length - 1,\n mid,\n c = 0,\n dlow = reverse ? 0 : 1,\n dhigh = reverse ? 1 : 0,\n rounded = reverse ? Math.ceil : Math.floor;\n // c is just to avoid infinite loops if there's an error\n while(low < high && c++ < 100) {\n mid = rounded((low + high) / 2);\n if(arrayIn[mid] <= val) low = mid + dlow;\n else high = mid - dhigh;\n }\n return arrayIn[low];\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/search.js\n// module id = 219\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nexports.init2dArray = function(rowLength, colLength) {\n var array = new Array(rowLength);\n for(var i = 0; i < rowLength; i++) array[i] = new Array(colLength);\n return array;\n};\n\n/**\n * transpose a (possibly ragged) 2d array z. inspired by\n * http://stackoverflow.com/questions/17428587/\n * transposing-a-2d-array-in-javascript\n */\nexports.transposeRagged = function(z) {\n var maxlen = 0,\n zlen = z.length,\n i,\n j;\n // Maximum row length:\n for(i = 0; i < zlen; i++) maxlen = Math.max(maxlen, z[i].length);\n\n var t = new Array(maxlen);\n for(i = 0; i < maxlen; i++) {\n t[i] = new Array(zlen);\n for(j = 0; j < zlen; j++) t[i][j] = z[j][i];\n }\n\n return t;\n};\n\n// our own dot function so that we don't need to include numeric\nexports.dot = function(x, y) {\n if(!(x.length && y.length) || x.length !== y.length) return null;\n\n var len = x.length,\n out,\n i;\n\n if(x[0].length) {\n // mat-vec or mat-mat\n out = new Array(len);\n for(i = 0; i < len; i++) out[i] = exports.dot(x[i], y);\n }\n else if(y[0].length) {\n // vec-mat\n var yTranspose = exports.transposeRagged(y);\n out = new Array(yTranspose.length);\n for(i = 0; i < yTranspose.length; i++) out[i] = exports.dot(x, yTranspose[i]);\n }\n else {\n // vec-vec\n out = 0;\n for(i = 0; i < len; i++) out += x[i] * y[i];\n }\n\n return out;\n};\n\n// translate by (x,y)\nexports.translationMatrix = function(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n};\n\n// rotate by alpha around (0,0)\nexports.rotationMatrix = function(alpha) {\n var a = alpha * Math.PI / 180;\n return [[Math.cos(a), -Math.sin(a), 0],\n [Math.sin(a), Math.cos(a), 0],\n [0, 0, 1]];\n};\n\n// rotate by alpha around (x,y)\nexports.rotationXYMatrix = function(a, x, y) {\n return exports.dot(\n exports.dot(exports.translationMatrix(x, y),\n exports.rotationMatrix(a)),\n exports.translationMatrix(-x, -y));\n};\n\n// applies a 2D transformation matrix to either x and y params or an [x,y] array\nexports.apply2DTransform = function(transform) {\n return function() {\n var args = arguments;\n if(args.length === 3) {\n args = args[0];\n }// from map\n var xy = arguments.length === 1 ? args[0] : [args[0], args[1]];\n return exports.dot(transform, [xy[0], xy[1], 1]).slice(0, 2);\n };\n};\n\n// applies a 2D transformation matrix to an [x1,y1,x2,y2] array (to transform a segment)\nexports.apply2DTransform2 = function(transform) {\n var at = exports.apply2DTransform(transform);\n return function(xys) {\n return at(xys.slice(0, 2)).concat(at(xys.slice(2, 4)));\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/matrix.js\n// module id = 220\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Allow referencing a graph DOM element either directly\n * or by its id string\n *\n * @param {HTMLDivElement|string} gd: a graph element or its id\n *\n * @returns {HTMLDivElement} the DOM element of the graph\n */\nmodule.exports = function(gd) {\n var gdElement;\n\n if(typeof gd === 'string') {\n gdElement = document.getElementById(gd);\n\n if(gdElement === null) {\n throw new Error('No DOM element with id \\'' + gd + '\\' exists on the page.');\n }\n\n return gdElement;\n }\n else if(gd === null || gd === undefined) {\n throw new Error('DOM element provided is null or undefined');\n }\n\n return gd; // otherwise assume that gd is a DOM element\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/get_graph_div.js\n// module id = 221\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n _isLinkedToArray: 'frames_entry',\n\n group: {\n valType: 'string',\n \n \n },\n name: {\n valType: 'string',\n \n \n },\n traces: {\n valType: 'any',\n \n \n },\n baseframe: {\n valType: 'string',\n \n \n },\n data: {\n valType: 'any',\n \n \n },\n layout: {\n valType: 'any',\n \n \n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/frame_attributes.js\n// module id = 222\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorScaleAttributes = require('./attributes');\nvar extendFlat = require('../../lib/extend').extendFlat;\nvar palettes = require('./scales.js');\n\n/*\n * Make all the attributes for a regular colorscale:\n * color, colorscale, cauto, cmin, cmax, autocolorscale, reversescale\n *\n * @param {string} context:\n * the container this is in (*marker*, *marker.line* etc)\n * @param {optional string} editTypeOverride:\n * most of these attributes already require a recalc, but the ones that do not\n * have editType *style* or *plot* unless you override (presumably with *calc*)\n * @param {optional bool} autoColorDflt:\n * normally autocolorscale.dflt is `true`, but pass `false` to override\n *\n * @return {object} the finished attributes object\n */\nmodule.exports = function makeColorScaleAttributes(context, editTypeOverride, autoColorDflt) {\n var contextHead = context ? (context + '.') : '';\n\n return {\n color: {\n valType: 'color',\n arrayOk: true,\n \n editType: editTypeOverride || 'style',\n \n },\n colorscale: extendFlat({}, colorScaleAttributes.colorscale, {\n \n }),\n cauto: extendFlat({}, colorScaleAttributes.zauto, {\n impliedEdits: {cmin: undefined, cmax: undefined},\n \n }),\n cmax: extendFlat({}, colorScaleAttributes.zmax, {\n editType: editTypeOverride || colorScaleAttributes.zmax.editType,\n impliedEdits: {cauto: false},\n \n }),\n cmin: extendFlat({}, colorScaleAttributes.zmin, {\n editType: editTypeOverride || colorScaleAttributes.zmin.editType,\n impliedEdits: {cauto: false},\n \n }),\n autocolorscale: extendFlat({}, colorScaleAttributes.autocolorscale, {\n \n dflt: autoColorDflt === false ? autoColorDflt : colorScaleAttributes.autocolorscale.dflt\n }),\n reversescale: extendFlat({}, colorScaleAttributes.reversescale, {\n \n })\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/color_attributes.js\n// module id = 223\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n zauto: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n impliedEdits: {zmin: undefined, zmax: undefined},\n \n },\n zmin: {\n valType: 'number',\n \n dflt: null,\n editType: 'plot',\n impliedEdits: {zauto: false},\n \n },\n zmax: {\n valType: 'number',\n \n dflt: null,\n editType: 'plot',\n impliedEdits: {zauto: false},\n \n },\n colorscale: {\n valType: 'colorscale',\n \n editType: 'calc',\n impliedEdits: {autocolorscale: false},\n \n },\n autocolorscale: {\n valType: 'boolean',\n \n dflt: true, // gets overrode in 'heatmap' & 'surface' for backwards comp.\n editType: 'calc',\n impliedEdits: {colorscale: undefined},\n \n },\n reversescale: {\n valType: 'boolean',\n \n dflt: false,\n editType: 'calc',\n \n },\n showscale: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/attributes.js\n// module id = 224\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nexports.scales = require('./scales');\n\nexports.defaultScale = require('./default_scale');\n\nexports.attributes = require('./attributes');\n\nexports.handleDefaults = require('./defaults');\n\nexports.calc = require('./calc');\n\nexports.hasColorscale = require('./has_colorscale');\n\nexports.isValidScale = require('./is_valid_scale');\n\nexports.getScale = require('./get_scale');\n\nexports.flipScale = require('./flip_scale');\n\nexports.extractScale = require('./extract_scale');\n\nexports.makeColorScaleFunc = require('./make_color_scale_func');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/index.js\n// module id = 225\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar Lib = require('../../lib');\nvar ONEDAY = require('../../constants/numerical').ONEDAY;\n\n\nmodule.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType) {\n var tickmodeDefault = 'auto';\n\n if(containerIn.tickmode === 'array' &&\n (axType === 'log' || axType === 'date')) {\n containerIn.tickmode = 'auto';\n }\n\n if(Array.isArray(containerIn.tickvals)) tickmodeDefault = 'array';\n else if(containerIn.dtick) {\n tickmodeDefault = 'linear';\n }\n var tickmode = coerce('tickmode', tickmodeDefault);\n\n if(tickmode === 'auto') coerce('nticks');\n else if(tickmode === 'linear') {\n // dtick is usually a positive number, but there are some\n // special strings available for log or date axes\n // default is 1 day for dates, otherwise 1\n var dtickDflt = (axType === 'date') ? ONEDAY : 1;\n var dtick = coerce('dtick', dtickDflt);\n if(isNumeric(dtick)) {\n containerOut.dtick = (dtick > 0) ? Number(dtick) : dtickDflt;\n }\n else if(typeof dtick !== 'string') {\n containerOut.dtick = dtickDflt;\n }\n else {\n // date and log special cases are all one character plus a number\n var prefix = dtick.charAt(0),\n dtickNum = dtick.substr(1);\n\n dtickNum = isNumeric(dtickNum) ? Number(dtickNum) : 0;\n if((dtickNum <= 0) || !(\n // \"M\" gives ticks every (integer) n months\n (axType === 'date' && prefix === 'M' && dtickNum === Math.round(dtickNum)) ||\n // \"L\" gives ticks linearly spaced in data (not in position) every (float) f\n (axType === 'log' && prefix === 'L') ||\n // \"D1\" gives powers of 10 with all small digits between, \"D2\" gives only 2 and 5\n (axType === 'log' && prefix === 'D' && (dtickNum === 1 || dtickNum === 2))\n )) {\n containerOut.dtick = dtickDflt;\n }\n }\n\n // tick0 can have different valType for different axis types, so\n // validate that now. Also for dates, change milliseconds to date strings\n var tick0Dflt = (axType === 'date') ? Lib.dateTick0(containerOut.calendar) : 0;\n var tick0 = coerce('tick0', tick0Dflt);\n if(axType === 'date') {\n containerOut.tick0 = Lib.cleanDate(tick0, tick0Dflt);\n }\n // Aside from date axes, dtick must be numeric; D1 and D2 modes ignore tick0 entirely\n else if(isNumeric(tick0) && dtick !== 'D1' && dtick !== 'D2') {\n containerOut.tick0 = Number(tick0);\n }\n else {\n containerOut.tick0 = tick0Dflt;\n }\n }\n else {\n var tickvals = coerce('tickvals');\n if(tickvals === undefined) containerOut.tickmode = 'auto';\n else coerce('ticktext');\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/tick_value_defaults.js\n// module id = 226\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\nvar layoutAttributes = require('./layout_attributes');\n\n\n/**\n * options: inherits outerTicks from axes.handleAxisDefaults\n */\nmodule.exports = function handleTickDefaults(containerIn, containerOut, coerce, options) {\n var tickLen = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'ticklen'),\n tickWidth = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'tickwidth'),\n tickColor = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'tickcolor', containerOut.color),\n showTicks = coerce('ticks', (options.outerTicks || tickLen || tickWidth || tickColor) ? 'outside' : '');\n\n if(!showTicks) {\n delete containerOut.ticklen;\n delete containerOut.tickwidth;\n delete containerOut.tickcolor;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/tick_mark_defaults.js\n// module id = 227\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\n\n/**\n * options: inherits font, outerTicks, noHover from axes.handleAxisDefaults\n */\nmodule.exports = function handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options) {\n var showAttrDflt = getShowAttrDflt(containerIn);\n\n var tickPrefix = coerce('tickprefix');\n if(tickPrefix) coerce('showtickprefix', showAttrDflt);\n\n var tickSuffix = coerce('ticksuffix');\n if(tickSuffix) coerce('showticksuffix', showAttrDflt);\n\n var showTickLabels = coerce('showticklabels');\n if(showTickLabels) {\n var font = options.font || {};\n // as with titlefont.color, inherit axis.color only if one was\n // explicitly provided\n var dfltFontColor = (containerOut.color === containerIn.color) ?\n containerOut.color : font.color;\n Lib.coerceFont(coerce, 'tickfont', {\n family: font.family,\n size: font.size,\n color: dfltFontColor\n });\n coerce('tickangle');\n\n if(axType !== 'category') {\n var tickFormat = coerce('tickformat');\n if(!tickFormat && axType !== 'date') {\n coerce('showexponent', showAttrDflt);\n coerce('exponentformat');\n coerce('separatethousands');\n }\n }\n }\n\n if(axType !== 'category' && !options.noHover) coerce('hoverformat');\n};\n\n/*\n * Attributes 'showexponent', 'showtickprefix' and 'showticksuffix'\n * share values.\n *\n * If only 1 attribute is set,\n * the remaining attributes inherit that value.\n *\n * If 2 attributes are set to the same value,\n * the remaining attribute inherits that value.\n *\n * If 2 attributes are set to different values,\n * the remaining is set to its dflt value.\n *\n */\nfunction getShowAttrDflt(containerIn) {\n var showAttrsAll = ['showexponent',\n 'showtickprefix',\n 'showticksuffix'],\n showAttrs = showAttrsAll.filter(function(a) {\n return containerIn[a] !== undefined;\n }),\n sameVal = function(a) {\n return containerIn[a] === containerIn[showAttrs[0]];\n };\n\n if(showAttrs.every(sameVal) || showAttrs.length === 1) {\n return containerIn[showAttrs[0]];\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/tick_label_defaults.js\n// module id = 228\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Lib = require('../../lib');\nvar BADNUM = require('../../constants/numerical').BADNUM;\n\nmodule.exports = function autoType(array, calendar) {\n if(moreDates(array, calendar)) return 'date';\n if(category(array)) return 'category';\n if(linearOK(array)) return 'linear';\n else return '-';\n};\n\n// is there at least one number in array? If not, we should leave\n// ax.type empty so it can be autoset later\nfunction linearOK(array) {\n if(!array) return false;\n\n for(var i = 0; i < array.length; i++) {\n if(isNumeric(array[i])) return true;\n }\n\n return false;\n}\n\n// does the array a have mostly dates rather than numbers?\n// note: some values can be neither (such as blanks, text)\n// 2- or 4-digit integers can be both, so require twice as many\n// dates as non-dates, to exclude cases with mostly 2 & 4 digit\n// numbers and a few dates\nfunction moreDates(a, calendar) {\n var dcnt = 0,\n ncnt = 0,\n // test at most 1000 points, evenly spaced\n inc = Math.max(1, (a.length - 1) / 1000),\n ai;\n\n for(var i = 0; i < a.length; i += inc) {\n ai = a[Math.round(i)];\n if(Lib.isDateTime(ai, calendar)) dcnt += 1;\n if(isNumeric(ai)) ncnt += 1;\n }\n\n return (dcnt > ncnt * 2);\n}\n\n// are the (x,y)-values in gd.data mostly text?\n// require twice as many categories as numbers\nfunction category(a) {\n // test at most 1000 points\n var inc = Math.max(1, (a.length - 1) / 1000),\n curvenums = 0,\n curvecats = 0,\n ai;\n\n for(var i = 0; i < a.length; i += inc) {\n ai = a[Math.round(i)];\n if(Lib.cleanNumber(ai) !== BADNUM) curvenums++;\n else if(typeof ai === 'string' && ai !== '' && ai !== 'None') curvecats++;\n }\n\n return curvecats > curvenums * 2;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/axis_autotype.js\n// module id = 229\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar colorMix = require('tinycolor2').mix;\n\nvar Registry = require('../../registry');\nvar Lib = require('../../lib');\nvar lightFraction = require('../../components/color/attributes').lightFraction;\n\nvar layoutAttributes = require('./layout_attributes');\nvar handleTickValueDefaults = require('./tick_value_defaults');\nvar handleTickMarkDefaults = require('./tick_mark_defaults');\nvar handleTickLabelDefaults = require('./tick_label_defaults');\nvar handleCategoryOrderDefaults = require('./category_order_defaults');\nvar setConvert = require('./set_convert');\nvar orderedCategories = require('./ordered_categories');\n\n\n/**\n * options: object containing:\n *\n * letter: 'x' or 'y'\n * title: name of the axis (ie 'Colorbar') to go in default title\n * font: the default font to inherit\n * outerTicks: boolean, should ticks default to outside?\n * showGrid: boolean, should gridlines be shown by default?\n * noHover: boolean, this axis doesn't support hover effects?\n * data: the plot data, used to manage categories\n * bgColor: the plot background color, to calculate default gridline colors\n */\nmodule.exports = function handleAxisDefaults(containerIn, containerOut, coerce, options, layoutOut) {\n var letter = options.letter,\n font = options.font || {},\n defaultTitle = 'Click to enter ' +\n (options.title || (letter.toUpperCase() + ' axis')) +\n ' title';\n\n function coerce2(attr, dflt) {\n return Lib.coerce2(containerIn, containerOut, layoutAttributes, attr, dflt);\n }\n\n var visible = coerce('visible', !options.cheateronly);\n\n var axType = containerOut.type;\n\n if(axType === 'date') {\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleDefaults');\n handleCalendarDefaults(containerIn, containerOut, 'calendar', options.calendar);\n }\n\n setConvert(containerOut, layoutOut);\n\n var autoRange = coerce('autorange', !containerOut.isValidRange(containerIn.range));\n\n if(autoRange) coerce('rangemode');\n\n coerce('range');\n containerOut.cleanRange();\n\n handleCategoryOrderDefaults(containerIn, containerOut, coerce);\n containerOut._initialCategories = axType === 'category' ?\n orderedCategories(letter, containerOut.categoryorder, containerOut.categoryarray, options.data) :\n [];\n\n if(!visible) return containerOut;\n\n var dfltColor = coerce('color');\n // if axis.color was provided, use it for fonts too; otherwise,\n // inherit from global font color in case that was provided.\n var dfltFontColor = (dfltColor === containerIn.color) ? dfltColor : font.color;\n\n coerce('title', defaultTitle);\n Lib.coerceFont(coerce, 'titlefont', {\n family: font.family,\n size: Math.round(font.size * 1.2),\n color: dfltFontColor\n });\n\n handleTickValueDefaults(containerIn, containerOut, coerce, axType);\n handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options);\n handleTickMarkDefaults(containerIn, containerOut, coerce, options);\n\n var lineColor = coerce2('linecolor', dfltColor),\n lineWidth = coerce2('linewidth'),\n showLine = coerce('showline', !!lineColor || !!lineWidth);\n\n if(!showLine) {\n delete containerOut.linecolor;\n delete containerOut.linewidth;\n }\n\n if(showLine || containerOut.ticks) coerce('mirror');\n\n var gridColor = coerce2('gridcolor', colorMix(dfltColor, options.bgColor, lightFraction).toRgbString()),\n gridWidth = coerce2('gridwidth'),\n showGridLines = coerce('showgrid', options.showGrid || !!gridColor || !!gridWidth);\n\n if(!showGridLines) {\n delete containerOut.gridcolor;\n delete containerOut.gridwidth;\n }\n\n var zeroLineColor = coerce2('zerolinecolor', dfltColor),\n zeroLineWidth = coerce2('zerolinewidth'),\n showZeroLine = coerce('zeroline', options.showGrid || !!zeroLineColor || !!zeroLineWidth);\n\n if(!showZeroLine) {\n delete containerOut.zerolinecolor;\n delete containerOut.zerolinewidth;\n }\n\n return containerOut;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/axis_defaults.js\n// module id = 230\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar Lib = require('../../lib');\nvar cleanNumber = Lib.cleanNumber;\nvar ms2DateTime = Lib.ms2DateTime;\nvar dateTime2ms = Lib.dateTime2ms;\nvar ensureNumber = Lib.ensureNumber;\n\nvar numConstants = require('../../constants/numerical');\nvar FP_SAFE = numConstants.FP_SAFE;\nvar BADNUM = numConstants.BADNUM;\n\nvar constants = require('./constants');\nvar axisIds = require('./axis_ids');\n\nfunction fromLog(v) {\n return Math.pow(10, v);\n}\n\n/**\n * Define the conversion functions for an axis data is used in 5 ways:\n *\n * d: data, in whatever form it's provided\n * c: calcdata: turned into numbers, but not linearized\n * l: linearized - same as c except for log axes (and other nonlinear\n * mappings later?) this is used when we need to know if it's\n * *possible* to show some data on this axis, without caring about\n * the current range\n * p: pixel value - mapped to the screen with current size and zoom\n * r: ranges, tick0, and annotation positions match one of the above\n * but are handled differently for different types:\n * - linear and date: data format (d)\n * - category: calcdata format (c), and will stay that way because\n * the data format has no continuous mapping\n * - log: linearized (l) format\n * TODO: in v2.0 we plan to change it to data format. At that point\n * shapes will work the same way as ranges, tick0, and annotations\n * so they can use this conversion too.\n *\n * Creates/updates these conversion functions, and a few more utilities\n * like cleanRange, and makeCalcdata\n *\n * also clears the autorange bounds ._min and ._max\n * and the autotick constraints ._minDtick, ._forceTick0\n */\nmodule.exports = function setConvert(ax, fullLayout) {\n fullLayout = fullLayout || {};\n\n var axLetter = (ax._id || 'x').charAt(0);\n\n // clipMult: how many axis lengths past the edge do we render?\n // for panning, 1-2 would suffice, but for zooming more is nice.\n // also, clipping can affect the direction of lines off the edge...\n var clipMult = 10;\n\n function toLog(v, clip) {\n if(v > 0) return Math.log(v) / Math.LN10;\n\n else if(v <= 0 && clip && ax.range && ax.range.length === 2) {\n // clip NaN (ie past negative infinity) to clipMult axis\n // length past the negative edge\n var r0 = ax.range[0],\n r1 = ax.range[1];\n return 0.5 * (r0 + r1 - 3 * clipMult * Math.abs(r0 - r1));\n }\n\n else return BADNUM;\n }\n\n /*\n * wrapped dateTime2ms that:\n * - accepts ms numbers for backward compatibility\n * - inserts a dummy arg so calendar is the 3rd arg (see notes below).\n * - defaults to ax.calendar\n */\n function dt2ms(v, _, calendar) {\n // NOTE: Changed this behavior: previously we took any numeric value\n // to be a ms, even if it was a string that could be a bare year.\n // Now we convert it as a date if at all possible, and only try\n // as (local) ms if that fails.\n var ms = dateTime2ms(v, calendar || ax.calendar);\n if(ms === BADNUM) {\n if(isNumeric(v)) ms = dateTime2ms(new Date(+v));\n else return BADNUM;\n }\n return ms;\n }\n\n // wrapped ms2DateTime to insert default ax.calendar\n function ms2dt(v, r, calendar) {\n return ms2DateTime(v, r, calendar || ax.calendar);\n }\n\n function getCategoryName(v) {\n return ax._categories[Math.round(v)];\n }\n\n /*\n * setCategoryIndex: return the index of category v,\n * inserting it in the list if it's not already there\n *\n * this will enter the categories in the order it\n * encounters them, ie all the categories from the\n * first data set, then all the ones from the second\n * that aren't in the first etc.\n *\n * it is assumed that this function is being invoked in the\n * already sorted category order; otherwise there would be\n * a disconnect between the array and the index returned\n */\n function setCategoryIndex(v) {\n if(v !== null && v !== undefined) {\n if(ax._categoriesMap === undefined) {\n ax._categoriesMap = {};\n }\n\n if(ax._categoriesMap[v] !== undefined) {\n return ax._categoriesMap[v];\n } else {\n ax._categories.push(v);\n\n var curLength = ax._categories.length - 1;\n ax._categoriesMap[v] = curLength;\n\n return curLength;\n }\n }\n return BADNUM;\n }\n\n function getCategoryIndex(v) {\n // d2l/d2c variant that that won't add categories but will also\n // allow numbers to be mapped to the linearized axis positions\n if(ax._categoriesMap) {\n var index = ax._categoriesMap[v];\n if(index !== undefined) return index;\n }\n\n if(isNumeric(v)) return +v;\n }\n\n function l2p(v) {\n if(!isNumeric(v)) return BADNUM;\n\n // include 2 fractional digits on pixel, for PDF zooming etc\n return d3.round(ax._b + ax._m * v, 2);\n }\n\n function p2l(px) { return (px - ax._b) / ax._m; }\n\n // conversions among c/l/p are fairly simple - do them together for all axis types\n ax.c2l = (ax.type === 'log') ? toLog : ensureNumber;\n ax.l2c = (ax.type === 'log') ? fromLog : ensureNumber;\n\n ax.l2p = l2p;\n ax.p2l = p2l;\n\n ax.c2p = (ax.type === 'log') ? function(v, clip) { return l2p(toLog(v, clip)); } : l2p;\n ax.p2c = (ax.type === 'log') ? function(px) { return fromLog(p2l(px)); } : p2l;\n\n /*\n * now type-specific conversions for **ALL** other combinations\n * they're all written out, instead of being combinations of each other, for\n * both clarity and speed.\n */\n if(['linear', '-'].indexOf(ax.type) !== -1) {\n // all are data vals, but d and r need cleaning\n ax.d2r = ax.r2d = ax.d2c = ax.r2c = ax.d2l = ax.r2l = cleanNumber;\n ax.c2d = ax.c2r = ax.l2d = ax.l2r = ensureNumber;\n\n ax.d2p = ax.r2p = function(v) { return ax.l2p(cleanNumber(v)); };\n ax.p2d = ax.p2r = p2l;\n\n ax.cleanPos = ensureNumber;\n }\n else if(ax.type === 'log') {\n // d and c are data vals, r and l are logged (but d and r need cleaning)\n ax.d2r = ax.d2l = function(v, clip) { return toLog(cleanNumber(v), clip); };\n ax.r2d = ax.r2c = function(v) { return fromLog(cleanNumber(v)); };\n\n ax.d2c = ax.r2l = cleanNumber;\n ax.c2d = ax.l2r = ensureNumber;\n\n ax.c2r = toLog;\n ax.l2d = fromLog;\n\n ax.d2p = function(v, clip) { return ax.l2p(ax.d2r(v, clip)); };\n ax.p2d = function(px) { return fromLog(p2l(px)); };\n\n ax.r2p = function(v) { return ax.l2p(cleanNumber(v)); };\n ax.p2r = p2l;\n\n ax.cleanPos = ensureNumber;\n }\n else if(ax.type === 'date') {\n // r and d are date strings, l and c are ms\n\n /*\n * Any of these functions with r and d on either side, calendar is the\n * **3rd** argument. log has reserved the second argument.\n *\n * Unless you need the special behavior of the second arg (ms2DateTime\n * uses this to limit precision, toLog uses true to clip negatives\n * to offscreen low rather than undefined), it's safe to pass 0.\n */\n ax.d2r = ax.r2d = Lib.identity;\n\n ax.d2c = ax.r2c = ax.d2l = ax.r2l = dt2ms;\n ax.c2d = ax.c2r = ax.l2d = ax.l2r = ms2dt;\n\n ax.d2p = ax.r2p = function(v, _, calendar) { return ax.l2p(dt2ms(v, 0, calendar)); };\n ax.p2d = ax.p2r = function(px, r, calendar) { return ms2dt(p2l(px), r, calendar); };\n\n ax.cleanPos = function(v) { return Lib.cleanDate(v, BADNUM, ax.calendar); };\n }\n else if(ax.type === 'category') {\n // d is categories (string)\n // c and l are indices (numbers)\n // r is categories or numbers\n\n ax.d2c = ax.d2l = setCategoryIndex;\n ax.r2d = ax.c2d = ax.l2d = getCategoryName;\n\n ax.d2r = ax.d2l_noadd = getCategoryIndex;\n\n ax.r2c = function(v) {\n var index = getCategoryIndex(v);\n return index !== undefined ? index : ax.fraction2r(0.5);\n };\n\n ax.l2r = ax.c2r = ensureNumber;\n ax.r2l = getCategoryIndex;\n\n ax.d2p = function(v) { return ax.l2p(ax.r2c(v)); };\n ax.p2d = function(px) { return getCategoryName(p2l(px)); };\n ax.r2p = ax.d2p;\n ax.p2r = p2l;\n\n ax.cleanPos = function(v) {\n if(typeof v === 'string' && v !== '') return v;\n return ensureNumber(v);\n };\n }\n\n // find the range value at the specified (linear) fraction of the axis\n ax.fraction2r = function(v) {\n var rl0 = ax.r2l(ax.range[0]),\n rl1 = ax.r2l(ax.range[1]);\n return ax.l2r(rl0 + v * (rl1 - rl0));\n };\n\n // find the fraction of the range at the specified range value\n ax.r2fraction = function(v) {\n var rl0 = ax.r2l(ax.range[0]),\n rl1 = ax.r2l(ax.range[1]);\n return (ax.r2l(v) - rl0) / (rl1 - rl0);\n };\n\n /*\n * cleanRange: make sure range is a couplet of valid & distinct values\n * keep numbers away from the limits of floating point numbers,\n * and dates away from the ends of our date system (+/- 9999 years)\n *\n * optional param rangeAttr: operate on a different attribute, like\n * ax._r, rather than ax.range\n */\n ax.cleanRange = function(rangeAttr) {\n if(!rangeAttr) rangeAttr = 'range';\n var range = Lib.nestedProperty(ax, rangeAttr).get(),\n i, dflt;\n\n if(ax.type === 'date') dflt = Lib.dfltRange(ax.calendar);\n else if(axLetter === 'y') dflt = constants.DFLTRANGEY;\n else dflt = constants.DFLTRANGEX;\n\n // make sure we don't later mutate the defaults\n dflt = dflt.slice();\n\n if(!range || range.length !== 2) {\n Lib.nestedProperty(ax, rangeAttr).set(dflt);\n return;\n }\n\n if(ax.type === 'date') {\n // check if milliseconds or js date objects are provided for range\n // and convert to date strings\n range[0] = Lib.cleanDate(range[0], BADNUM, ax.calendar);\n range[1] = Lib.cleanDate(range[1], BADNUM, ax.calendar);\n }\n\n for(i = 0; i < 2; i++) {\n if(ax.type === 'date') {\n if(!Lib.isDateTime(range[i], ax.calendar)) {\n ax[rangeAttr] = dflt;\n break;\n }\n\n if(ax.r2l(range[0]) === ax.r2l(range[1])) {\n // split by +/- 1 second\n var linCenter = Lib.constrain(ax.r2l(range[0]),\n Lib.MIN_MS + 1000, Lib.MAX_MS - 1000);\n range[0] = ax.l2r(linCenter - 1000);\n range[1] = ax.l2r(linCenter + 1000);\n break;\n }\n }\n else {\n if(!isNumeric(range[i])) {\n if(isNumeric(range[1 - i])) {\n range[i] = range[1 - i] * (i ? 10 : 0.1);\n }\n else {\n ax[rangeAttr] = dflt;\n break;\n }\n }\n\n if(range[i] < -FP_SAFE) range[i] = -FP_SAFE;\n else if(range[i] > FP_SAFE) range[i] = FP_SAFE;\n\n if(range[0] === range[1]) {\n // somewhat arbitrary: split by 1 or 1ppm, whichever is bigger\n var inc = Math.max(1, Math.abs(range[0] * 1e-6));\n range[0] -= inc;\n range[1] += inc;\n }\n }\n }\n };\n\n // set scaling to pixels\n ax.setScale = function(usePrivateRange) {\n var gs = fullLayout._size;\n\n // TODO cleaner way to handle this case\n if(!ax._categories) ax._categories = [];\n // Add a map to optimize the performance of category collection\n if(!ax._categoriesMap) ax._categoriesMap = {};\n\n // make sure we have a domain (pull it in from the axis\n // this one is overlaying if necessary)\n if(ax.overlaying) {\n var ax2 = axisIds.getFromId({ _fullLayout: fullLayout }, ax.overlaying);\n ax.domain = ax2.domain;\n }\n\n // While transitions are occuring, occurring, we get a double-transform\n // issue if we transform the drawn layer *and* use the new axis range to\n // draw the data. This allows us to construct setConvert using the pre-\n // interaction values of the range:\n var rangeAttr = (usePrivateRange && ax._r) ? '_r' : 'range',\n calendar = ax.calendar;\n ax.cleanRange(rangeAttr);\n\n var rl0 = ax.r2l(ax[rangeAttr][0], calendar),\n rl1 = ax.r2l(ax[rangeAttr][1], calendar);\n\n if(axLetter === 'y') {\n ax._offset = gs.t + (1 - ax.domain[1]) * gs.h;\n ax._length = gs.h * (ax.domain[1] - ax.domain[0]);\n ax._m = ax._length / (rl0 - rl1);\n ax._b = -ax._m * rl1;\n }\n else {\n ax._offset = gs.l + ax.domain[0] * gs.w;\n ax._length = gs.w * (ax.domain[1] - ax.domain[0]);\n ax._m = ax._length / (rl1 - rl0);\n ax._b = -ax._m * rl0;\n }\n\n if(!isFinite(ax._m) || !isFinite(ax._b)) {\n Lib.notifier(\n 'Something went wrong with axis scaling',\n 'long');\n fullLayout._replotting = false;\n throw new Error('axis scaling');\n }\n };\n\n // makeCalcdata: takes an x or y array and converts it\n // to a position on the axis object \"ax\"\n // inputs:\n // trace - a data object from gd.data\n // axLetter - a string, either 'x' or 'y', for which item\n // to convert (TODO: is this now always the same as\n // the first letter of ax._id?)\n // in case the expected data isn't there, make a list of\n // integers based on the opposite data\n ax.makeCalcdata = function(trace, axLetter) {\n var arrayIn, arrayOut, i;\n\n var cal = ax.type === 'date' && trace[axLetter + 'calendar'];\n\n if(axLetter in trace) {\n arrayIn = trace[axLetter];\n arrayOut = new Array(arrayIn.length);\n\n for(i = 0; i < arrayIn.length; i++) {\n arrayOut[i] = ax.d2c(arrayIn[i], 0, cal);\n }\n }\n else {\n var v0 = ((axLetter + '0') in trace) ?\n ax.d2c(trace[axLetter + '0'], 0, cal) : 0,\n dv = (trace['d' + axLetter]) ?\n Number(trace['d' + axLetter]) : 1;\n\n // the opposing data, for size if we have x and dx etc\n arrayIn = trace[{x: 'y', y: 'x'}[axLetter]];\n arrayOut = new Array(arrayIn.length);\n\n for(i = 0; i < arrayIn.length; i++) arrayOut[i] = v0 + i * dv;\n }\n return arrayOut;\n };\n\n ax.isValidRange = function(range) {\n return (\n Array.isArray(range) &&\n range.length === 2 &&\n isNumeric(ax.r2l(range[0])) &&\n isNumeric(ax.r2l(range[1]))\n );\n };\n\n if(axLetter === 'x') {\n ax.isPtWithinRange = function(d) {\n var x = d.x;\n return x >= ax.range[0] && x <= ax.range[1];\n };\n } else {\n ax.isPtWithinRange = function(d) {\n var y = d.y;\n return y >= ax.range[0] && y <= ax.range[1];\n };\n }\n\n // for autoranging: arrays of objects:\n // {val: axis value, pad: pixel padding}\n // on the low and high sides\n ax._min = [];\n ax._max = [];\n\n // copy ref to fullLayout.separators so that\n // methods in Axes can use it w/o having to pass fullLayout\n ax._separators = fullLayout.separators;\n\n // and for bar charts and box plots: reset forced minimum tick spacing\n delete ax._minDtick;\n delete ax._forceTick0;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/set_convert.js\n// module id = 231\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Lib = require('../../lib');\n\n\nmodule.exports = function handlePositionDefaults(containerIn, containerOut, coerce, options) {\n var counterAxes = options.counterAxes || [],\n overlayableAxes = options.overlayableAxes || [],\n letter = options.letter;\n\n var anchor = Lib.coerce(containerIn, containerOut, {\n anchor: {\n valType: 'enumerated',\n values: ['free'].concat(counterAxes),\n dflt: isNumeric(containerIn.position) ? 'free' :\n (counterAxes[0] || 'free')\n }\n }, 'anchor');\n\n if(anchor === 'free') coerce('position');\n\n Lib.coerce(containerIn, containerOut, {\n side: {\n valType: 'enumerated',\n values: letter === 'x' ? ['bottom', 'top'] : ['left', 'right'],\n dflt: letter === 'x' ? 'bottom' : 'left'\n }\n }, 'side');\n\n var overlaying = false;\n if(overlayableAxes.length) {\n overlaying = Lib.coerce(containerIn, containerOut, {\n overlaying: {\n valType: 'enumerated',\n values: [false].concat(overlayableAxes),\n dflt: false\n }\n }, 'overlaying');\n }\n\n if(!overlaying) {\n // TODO: right now I'm copying this domain over to overlaying axes\n // in ax.setscale()... but this means we still need (imperfect) logic\n // in the axes popover to hide domain for the overlaying axis.\n // perhaps I should make a private version _domain that all axes get???\n var domain = coerce('domain');\n if(domain[0] > domain[1] - 0.01) containerOut.domain = [0, 1];\n Lib.noneOrAll(containerIn.domain, containerOut.domain, [0, 1]);\n }\n\n coerce('layer');\n\n return containerOut;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/position_defaults.js\n// module id = 232\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nexports.manage = require('./manage');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/modebar/index.js\n// module id = 233\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Plotly = require('../plotly');\nvar Lib = require('../lib');\n\nvar helpers = require('../snapshot/helpers');\nvar toSVG = require('../snapshot/tosvg');\nvar svgToImg = require('../snapshot/svgtoimg');\n\nvar attrs = {\n format: {\n valType: 'enumerated',\n values: ['png', 'jpeg', 'webp', 'svg'],\n dflt: 'png',\n \n },\n width: {\n valType: 'number',\n min: 1,\n \n },\n height: {\n valType: 'number',\n min: 1,\n \n },\n scale: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n },\n setBackground: {\n valType: 'any',\n dflt: false,\n \n },\n imageDataOnly: {\n valType: 'boolean',\n dflt: false,\n \n }\n};\n\nvar IMAGE_URL_PREFIX = /^data:image\\/\\w+;base64,/;\n\n/** Plotly.toImage\n *\n * @param {object | string | HTML div} gd\n * can either be a data/layout/config object\n * or an existing graph
\n * or an id to an existing graph
\n * @param {object} opts (see above)\n * @return {promise}\n */\nfunction toImage(gd, opts) {\n opts = opts || {};\n\n var data;\n var layout;\n var config;\n\n if(Lib.isPlainObject(gd)) {\n data = gd.data || [];\n layout = gd.layout || {};\n config = gd.config || {};\n } else {\n gd = Lib.getGraphDiv(gd);\n data = Lib.extendDeep([], gd.data);\n layout = Lib.extendDeep({}, gd.layout);\n config = gd._context;\n }\n\n function isImpliedOrValid(attr) {\n return !(attr in opts) || Lib.validate(opts[attr], attrs[attr]);\n }\n\n if(!isImpliedOrValid('width') || !isImpliedOrValid('height')) {\n throw new Error('Height and width should be pixel values.');\n }\n\n if(!isImpliedOrValid('format')) {\n throw new Error('Image format is not jpeg, png, svg or webp.');\n }\n\n var fullOpts = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(opts, fullOpts, attrs, attr, dflt);\n }\n\n var format = coerce('format');\n var width = coerce('width');\n var height = coerce('height');\n var scale = coerce('scale');\n var setBackground = coerce('setBackground');\n var imageDataOnly = coerce('imageDataOnly');\n\n // put the cloned div somewhere off screen before attaching to DOM\n var clonedGd = document.createElement('div');\n clonedGd.style.position = 'absolute';\n clonedGd.style.left = '-5000px';\n document.body.appendChild(clonedGd);\n\n // extend layout with image options\n var layoutImage = Lib.extendFlat({}, layout);\n if(width) layoutImage.width = width;\n if(height) layoutImage.height = height;\n\n // extend config for static plot\n var configImage = Lib.extendFlat({}, config, {\n staticPlot: true,\n setBackground: setBackground\n });\n\n var redrawFunc = helpers.getRedrawFunc(clonedGd);\n\n function wait() {\n return new Promise(function(resolve) {\n setTimeout(resolve, helpers.getDelay(clonedGd._fullLayout));\n });\n }\n\n function convert() {\n return new Promise(function(resolve, reject) {\n var svg = toSVG(clonedGd, format, scale);\n var width = clonedGd._fullLayout.width;\n var height = clonedGd._fullLayout.height;\n\n Plotly.purge(clonedGd);\n document.body.removeChild(clonedGd);\n\n if(format === 'svg') {\n if(imageDataOnly) {\n return resolve(svg);\n } else {\n return resolve('data:image/svg+xml,' + encodeURIComponent(svg));\n }\n }\n\n var canvas = document.createElement('canvas');\n canvas.id = Lib.randstr();\n\n svgToImg({\n format: format,\n width: width,\n height: height,\n scale: scale,\n canvas: canvas,\n svg: svg,\n // ask svgToImg to return a Promise\n // rather than EventEmitter\n // leave EventEmitter for backward\n // compatibility\n promise: true\n })\n .then(resolve)\n .catch(reject);\n });\n }\n\n function urlToImageData(url) {\n if(imageDataOnly) {\n return url.replace(IMAGE_URL_PREFIX, '');\n } else {\n return url;\n }\n }\n\n return new Promise(function(resolve, reject) {\n Plotly.plot(clonedGd, data, layoutImage, configImage)\n .then(redrawFunc)\n .then(wait)\n .then(convert)\n .then(function(url) { resolve(urlToImageData(url)); })\n .catch(function(err) { reject(err); });\n });\n}\n\nmodule.exports = toImage;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/to_image.js\n// module id = 234\n// module chunks = 0","'use strict'\r\n\r\nvar isBrowser = require('is-browser')\r\nvar hasHover\r\n\r\nif (typeof global.matchMedia === 'function') {\r\n\thasHover = !global.matchMedia('(hover: none)').matches\r\n}\r\nelse {\r\n\thasHover = isBrowser\r\n}\r\n\r\nmodule.exports = hasHover\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/has-hover/index.js\n// module id = 235\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../lib');\nvar config = require('../plot_api/plot_config');\n\n\n/**\n * Copy arg array *without* removing `undefined` values from objects.\n *\n * @param gd\n * @param args\n * @returns {Array}\n */\nfunction copyArgArray(gd, args) {\n var copy = [];\n var arg;\n\n for(var i = 0; i < args.length; i++) {\n arg = args[i];\n\n if(arg === gd) copy[i] = arg;\n else if(typeof arg === 'object') {\n copy[i] = Array.isArray(arg) ?\n Lib.extendDeep([], arg) :\n Lib.extendDeepAll({}, arg);\n }\n else copy[i] = arg;\n }\n\n return copy;\n}\n\n\n// -----------------------------------------------------\n// Undo/Redo queue for plots\n// -----------------------------------------------------\n\n\nvar queue = {};\n\n// TODO: disable/enable undo and redo buttons appropriately\n\n/**\n * Add an item to the undoQueue for a graphDiv\n *\n * @param gd\n * @param undoFunc Function undo this operation\n * @param undoArgs Args to supply undoFunc with\n * @param redoFunc Function to redo this operation\n * @param redoArgs Args to supply redoFunc with\n */\nqueue.add = function(gd, undoFunc, undoArgs, redoFunc, redoArgs) {\n var queueObj,\n queueIndex;\n\n // make sure we have the queue and our position in it\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n queueIndex = gd.undoQueue.index;\n\n // if we're already playing an undo or redo, or if this is an auto operation\n // (like pane resize... any others?) then we don't save this to the undo queue\n if(gd.autoplay) {\n if(!gd.undoQueue.inSequence) gd.autoplay = false;\n return;\n }\n\n // if we're not in a sequence or are just starting, we need a new queue item\n if(!gd.undoQueue.sequence || gd.undoQueue.beginSequence) {\n queueObj = {undo: {calls: [], args: []}, redo: {calls: [], args: []}};\n gd.undoQueue.queue.splice(queueIndex, gd.undoQueue.queue.length - queueIndex, queueObj);\n gd.undoQueue.index += 1;\n } else {\n queueObj = gd.undoQueue.queue[queueIndex - 1];\n }\n gd.undoQueue.beginSequence = false;\n\n // we unshift to handle calls for undo in a forward for loop later\n if(queueObj) {\n queueObj.undo.calls.unshift(undoFunc);\n queueObj.undo.args.unshift(undoArgs);\n queueObj.redo.calls.push(redoFunc);\n queueObj.redo.args.push(redoArgs);\n }\n\n if(gd.undoQueue.queue.length > config.queueLength) {\n gd.undoQueue.queue.shift();\n gd.undoQueue.index--;\n }\n};\n\n/**\n * Begin a sequence of undoQueue changes\n *\n * @param gd\n */\nqueue.startSequence = function(gd) {\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n gd.undoQueue.sequence = true;\n gd.undoQueue.beginSequence = true;\n};\n\n/**\n * Stop a sequence of undoQueue changes\n *\n * Call this *after* you're sure your undo chain has ended\n *\n * @param gd\n */\nqueue.stopSequence = function(gd) {\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n gd.undoQueue.sequence = false;\n gd.undoQueue.beginSequence = false;\n};\n\n/**\n * Move one step back in the undo queue, and undo the object there.\n *\n * @param gd\n */\nqueue.undo = function undo(gd) {\n var queueObj, i;\n\n if(gd.framework && gd.framework.isPolar) {\n gd.framework.undo();\n return;\n }\n if(gd.undoQueue === undefined ||\n isNaN(gd.undoQueue.index) ||\n gd.undoQueue.index <= 0) {\n return;\n }\n\n // index is pointing to next *forward* queueObj, point to the one we're undoing\n gd.undoQueue.index--;\n\n // get the queueObj for instructions on how to undo\n queueObj = gd.undoQueue.queue[gd.undoQueue.index];\n\n // this sequence keeps things from adding to the queue during undo/redo\n gd.undoQueue.inSequence = true;\n for(i = 0; i < queueObj.undo.calls.length; i++) {\n queue.plotDo(gd, queueObj.undo.calls[i], queueObj.undo.args[i]);\n }\n gd.undoQueue.inSequence = false;\n gd.autoplay = false;\n};\n\n/**\n * Redo the current object in the undo, then move forward in the queue.\n *\n * @param gd\n */\nqueue.redo = function redo(gd) {\n var queueObj, i;\n\n if(gd.framework && gd.framework.isPolar) {\n gd.framework.redo();\n return;\n }\n if(gd.undoQueue === undefined ||\n isNaN(gd.undoQueue.index) ||\n gd.undoQueue.index >= gd.undoQueue.queue.length) {\n return;\n }\n\n // get the queueObj for instructions on how to undo\n queueObj = gd.undoQueue.queue[gd.undoQueue.index];\n\n // this sequence keeps things from adding to the queue during undo/redo\n gd.undoQueue.inSequence = true;\n for(i = 0; i < queueObj.redo.calls.length; i++) {\n queue.plotDo(gd, queueObj.redo.calls[i], queueObj.redo.args[i]);\n }\n gd.undoQueue.inSequence = false;\n gd.autoplay = false;\n\n // index is pointing to the thing we just redid, move it\n gd.undoQueue.index++;\n};\n\n/**\n * Called by undo/redo to make the actual changes.\n *\n * Not meant to be called publically, but included for mocking out in tests.\n *\n * @param gd\n * @param func\n * @param args\n */\nqueue.plotDo = function(gd, func, args) {\n gd.autoplay = true;\n\n // this *won't* copy gd and it preserves `undefined` properties!\n args = copyArgArray(gd, args);\n\n // call the supplied function\n func.apply(null, args);\n};\n\nmodule.exports = queue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/queue.js\n// module id = 236\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nvar d3 = require('d3');\nvar Lib = require('../../lib');\nvar extendDeepAll = Lib.extendDeepAll;\nvar MID_SHIFT = require('../../constants/alignment').MID_SHIFT;\n\nvar µ = module.exports = { version: '0.2.2' };\n\nµ.Axis = function module() {\n var config = {\n data: [],\n layout: {}\n }, inputConfig = {}, liveConfig = {};\n var svg, container, dispatch = d3.dispatch('hover'), radialScale, angularScale;\n var exports = {};\n function render(_container) {\n container = _container || container;\n var data = config.data;\n var axisConfig = config.layout;\n if (typeof container == 'string' || container.nodeName) container = d3.select(container);\n container.datum(data).each(function(_data, _index) {\n var dataOriginal = _data.slice();\n liveConfig = {\n data: µ.util.cloneJson(dataOriginal),\n layout: µ.util.cloneJson(axisConfig)\n };\n var colorIndex = 0;\n dataOriginal.forEach(function(d, i) {\n if (!d.color) {\n d.color = axisConfig.defaultColorRange[colorIndex];\n colorIndex = (colorIndex + 1) % axisConfig.defaultColorRange.length;\n }\n if (!d.strokeColor) {\n d.strokeColor = d.geometry === 'LinePlot' ? d.color : d3.rgb(d.color).darker().toString();\n }\n liveConfig.data[i].color = d.color;\n liveConfig.data[i].strokeColor = d.strokeColor;\n liveConfig.data[i].strokeDash = d.strokeDash;\n liveConfig.data[i].strokeSize = d.strokeSize;\n });\n var data = dataOriginal.filter(function(d, i) {\n var visible = d.visible;\n return typeof visible === 'undefined' || visible === true;\n });\n var isStacked = false;\n var dataWithGroupId = data.map(function(d, i) {\n isStacked = isStacked || typeof d.groupId !== 'undefined';\n return d;\n });\n if (isStacked) {\n var grouped = d3.nest().key(function(d, i) {\n return typeof d.groupId != 'undefined' ? d.groupId : 'unstacked';\n }).entries(dataWithGroupId);\n var dataYStack = [];\n var stacked = grouped.map(function(d, i) {\n if (d.key === 'unstacked') return d.values; else {\n var prevArray = d.values[0].r.map(function(d, i) {\n return 0;\n });\n d.values.forEach(function(d, i, a) {\n d.yStack = [ prevArray ];\n dataYStack.push(prevArray);\n prevArray = µ.util.sumArrays(d.r, prevArray);\n });\n return d.values;\n }\n });\n data = d3.merge(stacked);\n }\n data.forEach(function(d, i) {\n d.t = Array.isArray(d.t[0]) ? d.t : [ d.t ];\n d.r = Array.isArray(d.r[0]) ? d.r : [ d.r ];\n });\n var radius = Math.min(axisConfig.width - axisConfig.margin.left - axisConfig.margin.right, axisConfig.height - axisConfig.margin.top - axisConfig.margin.bottom) / 2;\n radius = Math.max(10, radius);\n var chartCenter = [ axisConfig.margin.left + radius, axisConfig.margin.top + radius ];\n var extent;\n if (isStacked) {\n var highestStackedValue = d3.max(µ.util.sumArrays(µ.util.arrayLast(data).r[0], µ.util.arrayLast(dataYStack)));\n extent = [ 0, highestStackedValue ];\n } else extent = d3.extent(µ.util.flattenArray(data.map(function(d, i) {\n return d.r;\n })));\n if (axisConfig.radialAxis.domain != µ.DATAEXTENT) extent[0] = 0;\n radialScale = d3.scale.linear().domain(axisConfig.radialAxis.domain != µ.DATAEXTENT && axisConfig.radialAxis.domain ? axisConfig.radialAxis.domain : extent).range([ 0, radius ]);\n liveConfig.layout.radialAxis.domain = radialScale.domain();\n var angularDataMerged = µ.util.flattenArray(data.map(function(d, i) {\n return d.t;\n }));\n var isOrdinal = typeof angularDataMerged[0] === 'string';\n var ticks;\n if (isOrdinal) {\n angularDataMerged = µ.util.deduplicate(angularDataMerged);\n ticks = angularDataMerged.slice();\n angularDataMerged = d3.range(angularDataMerged.length);\n data = data.map(function(d, i) {\n var result = d;\n d.t = [ angularDataMerged ];\n if (isStacked) result.yStack = d.yStack;\n return result;\n });\n }\n var hasOnlyLineOrDotPlot = data.filter(function(d, i) {\n return d.geometry === 'LinePlot' || d.geometry === 'DotPlot';\n }).length === data.length;\n var needsEndSpacing = axisConfig.needsEndSpacing === null ? isOrdinal || !hasOnlyLineOrDotPlot : axisConfig.needsEndSpacing;\n var useProvidedDomain = axisConfig.angularAxis.domain && axisConfig.angularAxis.domain != µ.DATAEXTENT && !isOrdinal && axisConfig.angularAxis.domain[0] >= 0;\n var angularDomain = useProvidedDomain ? axisConfig.angularAxis.domain : d3.extent(angularDataMerged);\n var angularDomainStep = Math.abs(angularDataMerged[1] - angularDataMerged[0]);\n if (hasOnlyLineOrDotPlot && !isOrdinal) angularDomainStep = 0;\n var angularDomainWithPadding = angularDomain.slice();\n if (needsEndSpacing && isOrdinal) angularDomainWithPadding[1] += angularDomainStep;\n var tickCount = axisConfig.angularAxis.ticksCount || 4;\n if (tickCount > 8) tickCount = tickCount / (tickCount / 8) + tickCount % 8;\n if (axisConfig.angularAxis.ticksStep) {\n tickCount = (angularDomainWithPadding[1] - angularDomainWithPadding[0]) / tickCount;\n }\n var angularTicksStep = axisConfig.angularAxis.ticksStep || (angularDomainWithPadding[1] - angularDomainWithPadding[0]) / (tickCount * (axisConfig.minorTicks + 1));\n if (ticks) angularTicksStep = Math.max(Math.round(angularTicksStep), 1);\n if (!angularDomainWithPadding[2]) angularDomainWithPadding[2] = angularTicksStep;\n var angularAxisRange = d3.range.apply(this, angularDomainWithPadding);\n angularAxisRange = angularAxisRange.map(function(d, i) {\n return parseFloat(d.toPrecision(12));\n });\n angularScale = d3.scale.linear().domain(angularDomainWithPadding.slice(0, 2)).range(axisConfig.direction === 'clockwise' ? [ 0, 360 ] : [ 360, 0 ]);\n liveConfig.layout.angularAxis.domain = angularScale.domain();\n liveConfig.layout.angularAxis.endPadding = needsEndSpacing ? angularDomainStep : 0;\n svg = d3.select(this).select('svg.chart-root');\n if (typeof svg === 'undefined' || svg.empty()) {\n var skeleton = \"' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '\";\n var doc = new DOMParser().parseFromString(skeleton, 'application/xml');\n var newSvg = this.appendChild(this.ownerDocument.importNode(doc.documentElement, true));\n svg = d3.select(newSvg);\n }\n svg.select('.guides-group').style({\n 'pointer-events': 'none'\n });\n svg.select('.angular.axis-group').style({\n 'pointer-events': 'none'\n });\n svg.select('.radial.axis-group').style({\n 'pointer-events': 'none'\n });\n var chartGroup = svg.select('.chart-group');\n var lineStyle = {\n fill: 'none',\n stroke: axisConfig.tickColor\n };\n var fontStyle = {\n 'font-size': axisConfig.font.size,\n 'font-family': axisConfig.font.family,\n fill: axisConfig.font.color,\n 'text-shadow': [ '-1px 0px', '1px -1px', '-1px 1px', '1px 1px' ].map(function(d, i) {\n return ' ' + d + ' 0 ' + axisConfig.font.outlineColor;\n }).join(',')\n };\n var legendContainer;\n if (axisConfig.showLegend) {\n legendContainer = svg.select('.legend-group').attr({\n transform: 'translate(' + [ radius, axisConfig.margin.top ] + ')'\n }).style({\n display: 'block'\n });\n var elements = data.map(function(d, i) {\n var datumClone = µ.util.cloneJson(d);\n datumClone.symbol = d.geometry === 'DotPlot' ? d.dotType || 'circle' : d.geometry != 'LinePlot' ? 'square' : 'line';\n datumClone.visibleInLegend = typeof d.visibleInLegend === 'undefined' || d.visibleInLegend;\n datumClone.color = d.geometry === 'LinePlot' ? d.strokeColor : d.color;\n return datumClone;\n });\n\n µ.Legend().config({\n data: data.map(function(d, i) {\n return d.name || 'Element' + i;\n }),\n legendConfig: extendDeepAll({},\n µ.Legend.defaultConfig().legendConfig,\n {\n container: legendContainer,\n elements: elements,\n reverseOrder: axisConfig.legend.reverseOrder\n }\n )\n })();\n\n var legendBBox = legendContainer.node().getBBox();\n radius = Math.min(axisConfig.width - legendBBox.width - axisConfig.margin.left - axisConfig.margin.right, axisConfig.height - axisConfig.margin.top - axisConfig.margin.bottom) / 2;\n radius = Math.max(10, radius);\n chartCenter = [ axisConfig.margin.left + radius, axisConfig.margin.top + radius ];\n radialScale.range([ 0, radius ]);\n liveConfig.layout.radialAxis.domain = radialScale.domain();\n legendContainer.attr('transform', 'translate(' + [ chartCenter[0] + radius, chartCenter[1] - radius ] + ')');\n } else {\n legendContainer = svg.select('.legend-group').style({\n display: 'none'\n });\n }\n svg.attr({\n width: axisConfig.width,\n height: axisConfig.height\n }).style({\n opacity: axisConfig.opacity\n });\n chartGroup.attr('transform', 'translate(' + chartCenter + ')').style({\n cursor: 'crosshair'\n });\n var centeringOffset = [ (axisConfig.width - (axisConfig.margin.left + axisConfig.margin.right + radius * 2 + (legendBBox ? legendBBox.width : 0))) / 2, (axisConfig.height - (axisConfig.margin.top + axisConfig.margin.bottom + radius * 2)) / 2 ];\n centeringOffset[0] = Math.max(0, centeringOffset[0]);\n centeringOffset[1] = Math.max(0, centeringOffset[1]);\n svg.select('.outer-group').attr('transform', 'translate(' + centeringOffset + ')');\n if (axisConfig.title) {\n var title = svg.select('g.title-group text').style(fontStyle).text(axisConfig.title);\n var titleBBox = title.node().getBBox();\n title.attr({\n x: chartCenter[0] - titleBBox.width / 2,\n y: chartCenter[1] - radius - 20\n });\n }\n var radialAxis = svg.select('.radial.axis-group');\n if (axisConfig.radialAxis.gridLinesVisible) {\n var gridCircles = radialAxis.selectAll('circle.grid-circle').data(radialScale.ticks(5));\n gridCircles.enter().append('circle').attr({\n 'class': 'grid-circle'\n }).style(lineStyle);\n gridCircles.attr('r', radialScale);\n gridCircles.exit().remove();\n }\n radialAxis.select('circle.outside-circle').attr({\n r: radius\n }).style(lineStyle);\n var backgroundCircle = svg.select('circle.background-circle').attr({\n r: radius\n }).style({\n fill: axisConfig.backgroundColor,\n stroke: axisConfig.stroke\n });\n function currentAngle(d, i) {\n return angularScale(d) % 360 + axisConfig.orientation;\n }\n if (axisConfig.radialAxis.visible) {\n var axis = d3.svg.axis().scale(radialScale).ticks(5).tickSize(5);\n radialAxis.call(axis).attr({\n transform: 'rotate(' + axisConfig.radialAxis.orientation + ')'\n });\n radialAxis.selectAll('.domain').style(lineStyle);\n radialAxis.selectAll('g>text').text(function(d, i) {\n return this.textContent + axisConfig.radialAxis.ticksSuffix;\n }).style(fontStyle).style({\n 'text-anchor': 'start'\n }).attr({\n x: 0,\n y: 0,\n dx: 0,\n dy: 0,\n transform: function(d, i) {\n if (axisConfig.radialAxis.tickOrientation === 'horizontal') {\n return 'rotate(' + -axisConfig.radialAxis.orientation + ') translate(' + [ 0, fontStyle['font-size'] ] + ')';\n } else return 'translate(' + [ 0, fontStyle['font-size'] ] + ')';\n }\n });\n radialAxis.selectAll('g>line').style({\n stroke: 'black'\n });\n }\n var angularAxis = svg.select('.angular.axis-group').selectAll('g.angular-tick').data(angularAxisRange);\n var angularAxisEnter = angularAxis.enter().append('g').classed('angular-tick', true);\n angularAxis.attr({\n transform: function(d, i) {\n return 'rotate(' + currentAngle(d, i) + ')';\n }\n }).style({\n display: axisConfig.angularAxis.visible ? 'block' : 'none'\n });\n angularAxis.exit().remove();\n angularAxisEnter.append('line').classed('grid-line', true).classed('major', function(d, i) {\n return i % (axisConfig.minorTicks + 1) == 0;\n }).classed('minor', function(d, i) {\n return !(i % (axisConfig.minorTicks + 1) == 0);\n }).style(lineStyle);\n angularAxisEnter.selectAll('.minor').style({\n stroke: axisConfig.minorTickColor\n });\n angularAxis.select('line.grid-line').attr({\n x1: axisConfig.tickLength ? radius - axisConfig.tickLength : 0,\n x2: radius\n }).style({\n display: axisConfig.angularAxis.gridLinesVisible ? 'block' : 'none'\n });\n angularAxisEnter.append('text').classed('axis-text', true).style(fontStyle);\n var ticksText = angularAxis.select('text.axis-text').attr({\n x: radius + axisConfig.labelOffset,\n dy: MID_SHIFT + 'em',\n transform: function(d, i) {\n var angle = currentAngle(d, i);\n var rad = radius + axisConfig.labelOffset;\n var orient = axisConfig.angularAxis.tickOrientation;\n if (orient == 'horizontal') return 'rotate(' + -angle + ' ' + rad + ' 0)'; else if (orient == 'radial') return angle < 270 && angle > 90 ? 'rotate(180 ' + rad + ' 0)' : null; else return 'rotate(' + (angle <= 180 && angle > 0 ? -90 : 90) + ' ' + rad + ' 0)';\n }\n }).style({\n 'text-anchor': 'middle',\n display: axisConfig.angularAxis.labelsVisible ? 'block' : 'none'\n }).text(function(d, i) {\n if (i % (axisConfig.minorTicks + 1) != 0) return '';\n if (ticks) {\n return ticks[d] + axisConfig.angularAxis.ticksSuffix;\n } else return d + axisConfig.angularAxis.ticksSuffix;\n }).style(fontStyle);\n if (axisConfig.angularAxis.rewriteTicks) ticksText.text(function(d, i) {\n if (i % (axisConfig.minorTicks + 1) != 0) return '';\n return axisConfig.angularAxis.rewriteTicks(this.textContent, i);\n });\n var rightmostTickEndX = d3.max(chartGroup.selectAll('.angular-tick text')[0].map(function(d, i) {\n return d.getCTM().e + d.getBBox().width;\n }));\n legendContainer.attr({\n transform: 'translate(' + [ radius + rightmostTickEndX, axisConfig.margin.top ] + ')'\n });\n var hasGeometry = svg.select('g.geometry-group').selectAll('g').size() > 0;\n var geometryContainer = svg.select('g.geometry-group').selectAll('g.geometry').data(data);\n geometryContainer.enter().append('g').attr({\n 'class': function(d, i) {\n return 'geometry geometry' + i;\n }\n });\n geometryContainer.exit().remove();\n if (data[0] || hasGeometry) {\n var geometryConfigs = [];\n data.forEach(function(d, i) {\n var geometryConfig = {};\n geometryConfig.radialScale = radialScale;\n geometryConfig.angularScale = angularScale;\n geometryConfig.container = geometryContainer.filter(function(dB, iB) {\n return iB == i;\n });\n geometryConfig.geometry = d.geometry;\n geometryConfig.orientation = axisConfig.orientation;\n geometryConfig.direction = axisConfig.direction;\n geometryConfig.index = i;\n geometryConfigs.push({\n data: d,\n geometryConfig: geometryConfig\n });\n });\n var geometryConfigsGrouped = d3.nest().key(function(d, i) {\n return typeof d.data.groupId != 'undefined' || 'unstacked';\n }).entries(geometryConfigs);\n var geometryConfigsGrouped2 = [];\n geometryConfigsGrouped.forEach(function(d, i) {\n if (d.key === 'unstacked') geometryConfigsGrouped2 = geometryConfigsGrouped2.concat(d.values.map(function(d, i) {\n return [ d ];\n })); else geometryConfigsGrouped2.push(d.values);\n });\n geometryConfigsGrouped2.forEach(function(d, i) {\n var geometry;\n if (Array.isArray(d)) geometry = d[0].geometryConfig.geometry; else geometry = d.geometryConfig.geometry;\n var finalGeometryConfig = d.map(function(dB, iB) {\n return extendDeepAll(µ[geometry].defaultConfig(), dB);\n });\n µ[geometry]().config(finalGeometryConfig)();\n });\n }\n var guides = svg.select('.guides-group');\n var tooltipContainer = svg.select('.tooltips-group');\n var angularTooltip = µ.tooltipPanel().config({\n container: tooltipContainer,\n fontSize: 8\n })();\n var radialTooltip = µ.tooltipPanel().config({\n container: tooltipContainer,\n fontSize: 8\n })();\n var geometryTooltip = µ.tooltipPanel().config({\n container: tooltipContainer,\n hasTick: true\n })();\n var angularValue, radialValue;\n if (!isOrdinal) {\n var angularGuideLine = guides.select('line').attr({\n x1: 0,\n y1: 0,\n y2: 0\n }).style({\n stroke: 'grey',\n 'pointer-events': 'none'\n });\n chartGroup.on('mousemove.angular-guide', function(d, i) {\n var mouseAngle = µ.util.getMousePos(backgroundCircle).angle;\n angularGuideLine.attr({\n x2: -radius,\n transform: 'rotate(' + mouseAngle + ')'\n }).style({\n opacity: .5\n });\n var angleWithOriginOffset = (mouseAngle + 180 + 360 - axisConfig.orientation) % 360;\n angularValue = angularScale.invert(angleWithOriginOffset);\n var pos = µ.util.convertToCartesian(radius + 12, mouseAngle + 180);\n angularTooltip.text(µ.util.round(angularValue)).move([ pos[0] + chartCenter[0], pos[1] + chartCenter[1] ]);\n }).on('mouseout.angular-guide', function(d, i) {\n guides.select('line').style({\n opacity: 0\n });\n });\n }\n var angularGuideCircle = guides.select('circle').style({\n stroke: 'grey',\n fill: 'none'\n });\n chartGroup.on('mousemove.radial-guide', function(d, i) {\n var r = µ.util.getMousePos(backgroundCircle).radius;\n angularGuideCircle.attr({\n r: r\n }).style({\n opacity: .5\n });\n radialValue = radialScale.invert(µ.util.getMousePos(backgroundCircle).radius);\n var pos = µ.util.convertToCartesian(r, axisConfig.radialAxis.orientation);\n radialTooltip.text(µ.util.round(radialValue)).move([ pos[0] + chartCenter[0], pos[1] + chartCenter[1] ]);\n }).on('mouseout.radial-guide', function(d, i) {\n angularGuideCircle.style({\n opacity: 0\n });\n geometryTooltip.hide();\n angularTooltip.hide();\n radialTooltip.hide();\n });\n svg.selectAll('.geometry-group .mark').on('mouseover.tooltip', function(d, i) {\n var el = d3.select(this);\n var color = this.style.fill;\n var newColor = 'black';\n var opacity = this.style.opacity || 1;\n el.attr({\n 'data-opacity': opacity\n });\n if (color && color !== 'none') {\n el.attr({\n 'data-fill': color\n });\n newColor = d3.hsl(color).darker().toString();\n el.style({\n fill: newColor,\n opacity: 1\n });\n var textData = {\n t: µ.util.round(d[0]),\n r: µ.util.round(d[1])\n };\n if (isOrdinal) textData.t = ticks[d[0]];\n var text = 't: ' + textData.t + ', r: ' + textData.r;\n var bbox = this.getBoundingClientRect();\n var svgBBox = svg.node().getBoundingClientRect();\n var pos = [ bbox.left + bbox.width / 2 - centeringOffset[0] - svgBBox.left, bbox.top + bbox.height / 2 - centeringOffset[1] - svgBBox.top ];\n geometryTooltip.config({\n color: newColor\n }).text(text);\n geometryTooltip.move(pos);\n } else {\n color = this.style.stroke || 'black';\n el.attr({\n 'data-stroke': color\n });\n newColor = d3.hsl(color).darker().toString();\n el.style({\n stroke: newColor,\n opacity: 1\n });\n }\n }).on('mousemove.tooltip', function(d, i) {\n if (d3.event.which != 0) return false;\n if (d3.select(this).attr('data-fill')) geometryTooltip.show();\n }).on('mouseout.tooltip', function(d, i) {\n geometryTooltip.hide();\n var el = d3.select(this);\n var fillColor = el.attr('data-fill');\n if (fillColor) el.style({\n fill: fillColor,\n opacity: el.attr('data-opacity')\n }); else el.style({\n stroke: el.attr('data-stroke'),\n opacity: el.attr('data-opacity')\n });\n });\n });\n return exports;\n }\n exports.render = function(_container) {\n render(_container);\n return this;\n };\n exports.config = function(_x) {\n if (!arguments.length) return config;\n var xClone = µ.util.cloneJson(_x);\n xClone.data.forEach(function(d, i) {\n if (!config.data[i]) config.data[i] = {};\n extendDeepAll(config.data[i], µ.Axis.defaultConfig().data[0]);\n extendDeepAll(config.data[i], d);\n });\n extendDeepAll(config.layout, µ.Axis.defaultConfig().layout);\n extendDeepAll(config.layout, xClone.layout);\n return this;\n };\n exports.getLiveConfig = function() {\n return liveConfig;\n };\n exports.getinputConfig = function() {\n return inputConfig;\n };\n exports.radialScale = function(_x) {\n return radialScale;\n };\n exports.angularScale = function(_x) {\n return angularScale;\n };\n exports.svg = function() {\n return svg;\n };\n d3.rebind(exports, dispatch, 'on');\n return exports;\n};\n\nµ.Axis.defaultConfig = function(d, i) {\n var config = {\n data: [ {\n t: [ 1, 2, 3, 4 ],\n r: [ 10, 11, 12, 13 ],\n name: 'Line1',\n geometry: 'LinePlot',\n color: null,\n strokeDash: 'solid',\n strokeColor: null,\n strokeSize: '1',\n visibleInLegend: true,\n opacity: 1\n } ],\n layout: {\n defaultColorRange: d3.scale.category10().range(),\n title: null,\n height: 450,\n width: 500,\n margin: {\n top: 40,\n right: 40,\n bottom: 40,\n left: 40\n },\n font: {\n size: 12,\n color: 'gray',\n outlineColor: 'white',\n family: 'Tahoma, sans-serif'\n },\n direction: 'clockwise',\n orientation: 0,\n labelOffset: 10,\n radialAxis: {\n domain: null,\n orientation: -45,\n ticksSuffix: '',\n visible: true,\n gridLinesVisible: true,\n tickOrientation: 'horizontal',\n rewriteTicks: null\n },\n angularAxis: {\n domain: [ 0, 360 ],\n ticksSuffix: '',\n visible: true,\n gridLinesVisible: true,\n labelsVisible: true,\n tickOrientation: 'horizontal',\n rewriteTicks: null,\n ticksCount: null,\n ticksStep: null\n },\n minorTicks: 0,\n tickLength: null,\n tickColor: 'silver',\n minorTickColor: '#eee',\n backgroundColor: 'none',\n needsEndSpacing: null,\n showLegend: true,\n legend: {\n reverseOrder: false\n },\n opacity: 1\n }\n };\n return config;\n};\n\nµ.util = {};\n\nµ.DATAEXTENT = 'dataExtent';\n\nµ.AREA = 'AreaChart';\n\nµ.LINE = 'LinePlot';\n\nµ.DOT = 'DotPlot';\n\nµ.BAR = 'BarChart';\n\nµ.util._override = function(_objA, _objB) {\n for (var x in _objA) if (x in _objB) _objB[x] = _objA[x];\n};\n\nµ.util._extend = function(_objA, _objB) {\n for (var x in _objA) _objB[x] = _objA[x];\n};\n\nµ.util._rndSnd = function() {\n return Math.random() * 2 - 1 + (Math.random() * 2 - 1) + (Math.random() * 2 - 1);\n};\n\nµ.util.dataFromEquation2 = function(_equation, _step) {\n var step = _step || 6;\n var data = d3.range(0, 360 + step, step).map(function(deg, index) {\n var theta = deg * Math.PI / 180;\n var radius = _equation(theta);\n return [ deg, radius ];\n });\n return data;\n};\n\nµ.util.dataFromEquation = function(_equation, _step, _name) {\n var step = _step || 6;\n var t = [], r = [];\n d3.range(0, 360 + step, step).forEach(function(deg, index) {\n var theta = deg * Math.PI / 180;\n var radius = _equation(theta);\n t.push(deg);\n r.push(radius);\n });\n var result = {\n t: t,\n r: r\n };\n if (_name) result.name = _name;\n return result;\n};\n\nµ.util.ensureArray = function(_val, _count) {\n if (typeof _val === 'undefined') return null;\n var arr = [].concat(_val);\n return d3.range(_count).map(function(d, i) {\n return arr[i] || arr[0];\n });\n};\n\nµ.util.fillArrays = function(_obj, _valueNames, _count) {\n _valueNames.forEach(function(d, i) {\n _obj[d] = µ.util.ensureArray(_obj[d], _count);\n });\n return _obj;\n};\n\nµ.util.cloneJson = function(json) {\n return JSON.parse(JSON.stringify(json));\n};\n\nµ.util.validateKeys = function(obj, keys) {\n if (typeof keys === 'string') keys = keys.split('.');\n var next = keys.shift();\n return obj[next] && (!keys.length || objHasKeys(obj[next], keys));\n};\n\nµ.util.sumArrays = function(a, b) {\n return d3.zip(a, b).map(function(d, i) {\n return d3.sum(d);\n });\n};\n\nµ.util.arrayLast = function(a) {\n return a[a.length - 1];\n};\n\nµ.util.arrayEqual = function(a, b) {\n var i = Math.max(a.length, b.length, 1);\n while (i-- >= 0 && a[i] === b[i]) ;\n return i === -2;\n};\n\nµ.util.flattenArray = function(arr) {\n var r = [];\n while (!µ.util.arrayEqual(r, arr)) {\n r = arr;\n arr = [].concat.apply([], arr);\n }\n return arr;\n};\n\nµ.util.deduplicate = function(arr) {\n return arr.filter(function(v, i, a) {\n return a.indexOf(v) == i;\n });\n};\n\nµ.util.convertToCartesian = function(radius, theta) {\n var thetaRadians = theta * Math.PI / 180;\n var x = radius * Math.cos(thetaRadians);\n var y = radius * Math.sin(thetaRadians);\n return [ x, y ];\n};\n\nµ.util.round = function(_value, _digits) {\n var digits = _digits || 2;\n var mult = Math.pow(10, digits);\n return Math.round(_value * mult) / mult;\n};\n\nµ.util.getMousePos = function(_referenceElement) {\n var mousePos = d3.mouse(_referenceElement.node());\n var mouseX = mousePos[0];\n var mouseY = mousePos[1];\n var mouse = {};\n mouse.x = mouseX;\n mouse.y = mouseY;\n mouse.pos = mousePos;\n mouse.angle = (Math.atan2(mouseY, mouseX) + Math.PI) * 180 / Math.PI;\n mouse.radius = Math.sqrt(mouseX * mouseX + mouseY * mouseY);\n return mouse;\n};\n\nµ.util.duplicatesCount = function(arr) {\n var uniques = {}, val;\n var dups = {};\n for (var i = 0, len = arr.length; i < len; i++) {\n val = arr[i];\n if (val in uniques) {\n uniques[val]++;\n dups[val] = uniques[val];\n } else {\n uniques[val] = 1;\n }\n }\n return dups;\n};\n\nµ.util.duplicates = function(arr) {\n return Object.keys(µ.util.duplicatesCount(arr));\n};\n\nµ.util.translator = function(obj, sourceBranch, targetBranch, reverse) {\n if (reverse) {\n var targetBranchCopy = targetBranch.slice();\n targetBranch = sourceBranch;\n sourceBranch = targetBranchCopy;\n }\n var value = sourceBranch.reduce(function(previousValue, currentValue) {\n if (typeof previousValue != 'undefined') return previousValue[currentValue];\n }, obj);\n if (typeof value === 'undefined') return;\n sourceBranch.reduce(function(previousValue, currentValue, index) {\n if (typeof previousValue == 'undefined') return;\n if (index === sourceBranch.length - 1) delete previousValue[currentValue];\n return previousValue[currentValue];\n }, obj);\n targetBranch.reduce(function(previousValue, currentValue, index) {\n if (typeof previousValue[currentValue] === 'undefined') previousValue[currentValue] = {};\n if (index === targetBranch.length - 1) previousValue[currentValue] = value;\n return previousValue[currentValue];\n }, obj);\n};\n\nµ.PolyChart = function module() {\n var config = [ µ.PolyChart.defaultConfig() ];\n var dispatch = d3.dispatch('hover');\n var dashArray = {\n solid: 'none',\n dash: [ 5, 2 ],\n dot: [ 2, 5 ]\n };\n var colorScale;\n function exports() {\n var geometryConfig = config[0].geometryConfig;\n var container = geometryConfig.container;\n if (typeof container == 'string') container = d3.select(container);\n container.datum(config).each(function(_config, _index) {\n var isStack = !!_config[0].data.yStack;\n var data = _config.map(function(d, i) {\n if (isStack) return d3.zip(d.data.t[0], d.data.r[0], d.data.yStack[0]); else return d3.zip(d.data.t[0], d.data.r[0]);\n });\n var angularScale = geometryConfig.angularScale;\n var domainMin = geometryConfig.radialScale.domain()[0];\n var generator = {};\n generator.bar = function(d, i, pI) {\n var dataConfig = _config[pI].data;\n var h = geometryConfig.radialScale(d[1]) - geometryConfig.radialScale(0);\n var stackTop = geometryConfig.radialScale(d[2] || 0);\n var w = dataConfig.barWidth;\n d3.select(this).attr({\n 'class': 'mark bar',\n d: 'M' + [ [ h + stackTop, -w / 2 ], [ h + stackTop, w / 2 ], [ stackTop, w / 2 ], [ stackTop, -w / 2 ] ].join('L') + 'Z',\n transform: function(d, i) {\n return 'rotate(' + (geometryConfig.orientation + angularScale(d[0])) + ')';\n }\n });\n };\n generator.dot = function(d, i, pI) {\n var stackedData = d[2] ? [ d[0], d[1] + d[2] ] : d;\n var symbol = d3.svg.symbol().size(_config[pI].data.dotSize).type(_config[pI].data.dotType)(d, i);\n d3.select(this).attr({\n 'class': 'mark dot',\n d: symbol,\n transform: function(d, i) {\n var coord = convertToCartesian(getPolarCoordinates(stackedData));\n return 'translate(' + [ coord.x, coord.y ] + ')';\n }\n });\n };\n var line = d3.svg.line.radial().interpolate(_config[0].data.lineInterpolation).radius(function(d) {\n return geometryConfig.radialScale(d[1]);\n }).angle(function(d) {\n return geometryConfig.angularScale(d[0]) * Math.PI / 180;\n });\n generator.line = function(d, i, pI) {\n var lineData = d[2] ? data[pI].map(function(d, i) {\n return [ d[0], d[1] + d[2] ];\n }) : data[pI];\n d3.select(this).each(generator['dot']).style({\n opacity: function(dB, iB) {\n return +_config[pI].data.dotVisible;\n },\n fill: markStyle.stroke(d, i, pI)\n }).attr({\n 'class': 'mark dot'\n });\n if (i > 0) return;\n var lineSelection = d3.select(this.parentNode).selectAll('path.line').data([ 0 ]);\n lineSelection.enter().insert('path');\n lineSelection.attr({\n 'class': 'line',\n d: line(lineData),\n transform: function(dB, iB) {\n return 'rotate(' + (geometryConfig.orientation + 90) + ')';\n },\n 'pointer-events': 'none'\n }).style({\n fill: function(dB, iB) {\n return markStyle.fill(d, i, pI);\n },\n 'fill-opacity': 0,\n stroke: function(dB, iB) {\n return markStyle.stroke(d, i, pI);\n },\n 'stroke-width': function(dB, iB) {\n return markStyle['stroke-width'](d, i, pI);\n },\n 'stroke-dasharray': function(dB, iB) {\n return markStyle['stroke-dasharray'](d, i, pI);\n },\n opacity: function(dB, iB) {\n return markStyle.opacity(d, i, pI);\n },\n display: function(dB, iB) {\n return markStyle.display(d, i, pI);\n }\n });\n };\n var angularRange = geometryConfig.angularScale.range();\n var triangleAngle = Math.abs(angularRange[1] - angularRange[0]) / data[0].length * Math.PI / 180;\n var arc = d3.svg.arc().startAngle(function(d) {\n return -triangleAngle / 2;\n }).endAngle(function(d) {\n return triangleAngle / 2;\n }).innerRadius(function(d) {\n return geometryConfig.radialScale(domainMin + (d[2] || 0));\n }).outerRadius(function(d) {\n return geometryConfig.radialScale(domainMin + (d[2] || 0)) + geometryConfig.radialScale(d[1]);\n });\n generator.arc = function(d, i, pI) {\n d3.select(this).attr({\n 'class': 'mark arc',\n d: arc,\n transform: function(d, i) {\n return 'rotate(' + (geometryConfig.orientation + angularScale(d[0]) + 90) + ')';\n }\n });\n };\n var markStyle = {\n fill: function(d, i, pI) {\n return _config[pI].data.color;\n },\n stroke: function(d, i, pI) {\n return _config[pI].data.strokeColor;\n },\n 'stroke-width': function(d, i, pI) {\n return _config[pI].data.strokeSize + 'px';\n },\n 'stroke-dasharray': function(d, i, pI) {\n return dashArray[_config[pI].data.strokeDash];\n },\n opacity: function(d, i, pI) {\n return _config[pI].data.opacity;\n },\n display: function(d, i, pI) {\n return typeof _config[pI].data.visible === 'undefined' || _config[pI].data.visible ? 'block' : 'none';\n }\n };\n var geometryLayer = d3.select(this).selectAll('g.layer').data(data);\n geometryLayer.enter().append('g').attr({\n 'class': 'layer'\n });\n var geometry = geometryLayer.selectAll('path.mark').data(function(d, i) {\n return d;\n });\n geometry.enter().append('path').attr({\n 'class': 'mark'\n });\n geometry.style(markStyle).each(generator[geometryConfig.geometryType]);\n geometry.exit().remove();\n geometryLayer.exit().remove();\n function getPolarCoordinates(d, i) {\n var r = geometryConfig.radialScale(d[1]);\n var t = (geometryConfig.angularScale(d[0]) + geometryConfig.orientation) * Math.PI / 180;\n return {\n r: r,\n t: t\n };\n }\n function convertToCartesian(polarCoordinates) {\n var x = polarCoordinates.r * Math.cos(polarCoordinates.t);\n var y = polarCoordinates.r * Math.sin(polarCoordinates.t);\n return {\n x: x,\n y: y\n };\n }\n });\n }\n exports.config = function(_x) {\n if (!arguments.length) return config;\n _x.forEach(function(d, i) {\n if (!config[i]) config[i] = {};\n extendDeepAll(config[i], µ.PolyChart.defaultConfig());\n extendDeepAll(config[i], d);\n });\n return this;\n };\n exports.getColorScale = function() {\n return colorScale;\n };\n d3.rebind(exports, dispatch, 'on');\n return exports;\n};\n\nµ.PolyChart.defaultConfig = function() {\n var config = {\n data: {\n name: 'geom1',\n t: [ [ 1, 2, 3, 4 ] ],\n r: [ [ 1, 2, 3, 4 ] ],\n dotType: 'circle',\n dotSize: 64,\n dotVisible: false,\n barWidth: 20,\n color: '#ffa500',\n strokeSize: 1,\n strokeColor: 'silver',\n strokeDash: 'solid',\n opacity: 1,\n index: 0,\n visible: true,\n visibleInLegend: true\n },\n geometryConfig: {\n geometry: 'LinePlot',\n geometryType: 'arc',\n direction: 'clockwise',\n orientation: 0,\n container: 'body',\n radialScale: null,\n angularScale: null,\n colorScale: d3.scale.category20()\n }\n };\n return config;\n};\n\nµ.BarChart = function module() {\n return µ.PolyChart();\n};\n\nµ.BarChart.defaultConfig = function() {\n var config = {\n geometryConfig: {\n geometryType: 'bar'\n }\n };\n return config;\n};\n\nµ.AreaChart = function module() {\n return µ.PolyChart();\n};\n\nµ.AreaChart.defaultConfig = function() {\n var config = {\n geometryConfig: {\n geometryType: 'arc'\n }\n };\n return config;\n};\n\nµ.DotPlot = function module() {\n return µ.PolyChart();\n};\n\nµ.DotPlot.defaultConfig = function() {\n var config = {\n geometryConfig: {\n geometryType: 'dot',\n dotType: 'circle'\n }\n };\n return config;\n};\n\nµ.LinePlot = function module() {\n return µ.PolyChart();\n};\n\nµ.LinePlot.defaultConfig = function() {\n var config = {\n geometryConfig: {\n geometryType: 'line'\n }\n };\n return config;\n};\n\nµ.Legend = function module() {\n var config = µ.Legend.defaultConfig();\n var dispatch = d3.dispatch('hover');\n function exports() {\n var legendConfig = config.legendConfig;\n var flattenData = config.data.map(function(d, i) {\n return [].concat(d).map(function(dB, iB) {\n var element = extendDeepAll({}, legendConfig.elements[i]);\n element.name = dB;\n element.color = [].concat(legendConfig.elements[i].color)[iB];\n return element;\n });\n });\n var data = d3.merge(flattenData);\n data = data.filter(function(d, i) {\n return legendConfig.elements[i] && (legendConfig.elements[i].visibleInLegend || typeof legendConfig.elements[i].visibleInLegend === 'undefined');\n });\n if (legendConfig.reverseOrder) data = data.reverse();\n var container = legendConfig.container;\n if (typeof container == 'string' || container.nodeName) container = d3.select(container);\n var colors = data.map(function(d, i) {\n return d.color;\n });\n var lineHeight = legendConfig.fontSize;\n var isContinuous = legendConfig.isContinuous == null ? typeof data[0] === 'number' : legendConfig.isContinuous;\n var height = isContinuous ? legendConfig.height : lineHeight * data.length;\n var legendContainerGroup = container.classed('legend-group', true);\n var svg = legendContainerGroup.selectAll('svg').data([ 0 ]);\n var svgEnter = svg.enter().append('svg').attr({\n width: 300,\n height: height + lineHeight,\n xmlns: 'http://www.w3.org/2000/svg',\n 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n version: '1.1'\n });\n svgEnter.append('g').classed('legend-axis', true);\n svgEnter.append('g').classed('legend-marks', true);\n var dataNumbered = d3.range(data.length);\n var colorScale = d3.scale[isContinuous ? 'linear' : 'ordinal']().domain(dataNumbered).range(colors);\n var dataScale = d3.scale[isContinuous ? 'linear' : 'ordinal']().domain(dataNumbered)[isContinuous ? 'range' : 'rangePoints']([ 0, height ]);\n var shapeGenerator = function(_type, _size) {\n var squareSize = _size * 3;\n if (_type === 'line') {\n return 'M' + [ [ -_size / 2, -_size / 12 ], [ _size / 2, -_size / 12 ], [ _size / 2, _size / 12 ], [ -_size / 2, _size / 12 ] ] + 'Z';\n } else if (d3.svg.symbolTypes.indexOf(_type) != -1) return d3.svg.symbol().type(_type).size(squareSize)(); else return d3.svg.symbol().type('square').size(squareSize)();\n };\n if (isContinuous) {\n var gradient = svg.select('.legend-marks').append('defs').append('linearGradient').attr({\n id: 'grad1',\n x1: '0%',\n y1: '0%',\n x2: '0%',\n y2: '100%'\n }).selectAll('stop').data(colors);\n gradient.enter().append('stop');\n gradient.attr({\n offset: function(d, i) {\n return i / (colors.length - 1) * 100 + '%';\n }\n }).style({\n 'stop-color': function(d, i) {\n return d;\n }\n });\n svg.append('rect').classed('legend-mark', true).attr({\n height: legendConfig.height,\n width: legendConfig.colorBandWidth,\n fill: 'url(#grad1)'\n });\n } else {\n var legendElement = svg.select('.legend-marks').selectAll('path.legend-mark').data(data);\n legendElement.enter().append('path').classed('legend-mark', true);\n legendElement.attr({\n transform: function(d, i) {\n return 'translate(' + [ lineHeight / 2, dataScale(i) + lineHeight / 2 ] + ')';\n },\n d: function(d, i) {\n var symbolType = d.symbol;\n return shapeGenerator(symbolType, lineHeight);\n },\n fill: function(d, i) {\n return colorScale(i);\n }\n });\n legendElement.exit().remove();\n }\n var legendAxis = d3.svg.axis().scale(dataScale).orient('right');\n var axis = svg.select('g.legend-axis').attr({\n transform: 'translate(' + [ isContinuous ? legendConfig.colorBandWidth : lineHeight, lineHeight / 2 ] + ')'\n }).call(legendAxis);\n axis.selectAll('.domain').style({\n fill: 'none',\n stroke: 'none'\n });\n axis.selectAll('line').style({\n fill: 'none',\n stroke: isContinuous ? legendConfig.textColor : 'none'\n });\n axis.selectAll('text').style({\n fill: legendConfig.textColor,\n 'font-size': legendConfig.fontSize\n }).text(function(d, i) {\n return data[i].name;\n });\n return exports;\n }\n exports.config = function(_x) {\n if (!arguments.length) return config;\n extendDeepAll(config, _x);\n return this;\n };\n d3.rebind(exports, dispatch, 'on');\n return exports;\n};\n\nµ.Legend.defaultConfig = function(d, i) {\n var config = {\n data: [ 'a', 'b', 'c' ],\n legendConfig: {\n elements: [ {\n symbol: 'line',\n color: 'red'\n }, {\n symbol: 'square',\n color: 'yellow'\n }, {\n symbol: 'diamond',\n color: 'limegreen'\n } ],\n height: 150,\n colorBandWidth: 30,\n fontSize: 12,\n container: 'body',\n isContinuous: null,\n textColor: 'grey',\n reverseOrder: false\n }\n };\n return config;\n};\n\nµ.tooltipPanel = function() {\n var tooltipEl, tooltipTextEl, backgroundEl;\n var config = {\n container: null,\n hasTick: false,\n fontSize: 12,\n color: 'white',\n padding: 5\n };\n var id = 'tooltip-' + µ.tooltipPanel.uid++;\n var tickSize = 10;\n var exports = function() {\n tooltipEl = config.container.selectAll('g.' + id).data([ 0 ]);\n var tooltipEnter = tooltipEl.enter().append('g').classed(id, true).style({\n 'pointer-events': 'none',\n display: 'none'\n });\n backgroundEl = tooltipEnter.append('path').style({\n fill: 'white',\n 'fill-opacity': .9\n }).attr({\n d: 'M0 0'\n });\n tooltipTextEl = tooltipEnter.append('text').attr({\n dx: config.padding + tickSize,\n dy: +config.fontSize * .3\n });\n return exports;\n };\n exports.text = function(_text) {\n var l = d3.hsl(config.color).l;\n var strokeColor = l >= .5 ? '#aaa' : 'white';\n var fillColor = l >= .5 ? 'black' : 'white';\n var text = _text || '';\n tooltipTextEl.style({\n fill: fillColor,\n 'font-size': config.fontSize + 'px'\n }).text(text);\n var padding = config.padding;\n var bbox = tooltipTextEl.node().getBBox();\n var boxStyle = {\n fill: config.color,\n stroke: strokeColor,\n 'stroke-width': '2px'\n };\n var backGroundW = bbox.width + padding * 2 + tickSize;\n var backGroundH = bbox.height + padding * 2;\n backgroundEl.attr({\n d: 'M' + [ [ tickSize, -backGroundH / 2 ], [ tickSize, -backGroundH / 4 ], [ config.hasTick ? 0 : tickSize, 0 ], [ tickSize, backGroundH / 4 ], [ tickSize, backGroundH / 2 ], [ backGroundW, backGroundH / 2 ], [ backGroundW, -backGroundH / 2 ] ].join('L') + 'Z'\n }).style(boxStyle);\n tooltipEl.attr({\n transform: 'translate(' + [ tickSize, -backGroundH / 2 + padding * 2 ] + ')'\n });\n tooltipEl.style({\n display: 'block'\n });\n return exports;\n };\n exports.move = function(_pos) {\n if (!tooltipEl) return;\n tooltipEl.attr({\n transform: 'translate(' + [ _pos[0], _pos[1] ] + ')'\n }).style({\n display: 'block'\n });\n return exports;\n };\n exports.hide = function() {\n if (!tooltipEl) return;\n tooltipEl.style({\n display: 'none'\n });\n return exports;\n };\n exports.show = function() {\n if (!tooltipEl) return;\n tooltipEl.style({\n display: 'block'\n });\n return exports;\n };\n exports.config = function(_x) {\n extendDeepAll(config, _x);\n return exports;\n };\n return exports;\n};\n\nµ.tooltipPanel.uid = 1;\n\nµ.adapter = {};\n\nµ.adapter.plotly = function module() {\n var exports = {};\n exports.convert = function(_inputConfig, reverse) {\n var outputConfig = {};\n if (_inputConfig.data) {\n outputConfig.data = _inputConfig.data.map(function(d, i) {\n var r = extendDeepAll({}, d);\n var toTranslate = [\n [ r, [ 'marker', 'color' ], [ 'color' ] ],\n [ r, [ 'marker', 'opacity' ], [ 'opacity' ] ],\n [ r, [ 'marker', 'line', 'color' ], [ 'strokeColor' ] ],\n [ r, [ 'marker', 'line', 'dash' ], [ 'strokeDash' ] ],\n [ r, [ 'marker', 'line', 'width' ], [ 'strokeSize' ] ],\n [ r, [ 'marker', 'symbol' ], [ 'dotType' ] ],\n [ r, [ 'marker', 'size' ], [ 'dotSize' ] ],\n [ r, [ 'marker', 'barWidth' ], [ 'barWidth' ] ],\n [ r, [ 'line', 'interpolation' ], [ 'lineInterpolation' ] ],\n [ r, [ 'showlegend' ], [ 'visibleInLegend' ] ]\n ];\n toTranslate.forEach(function(d, i) {\n µ.util.translator.apply(null, d.concat(reverse));\n });\n\n if (!reverse) delete r.marker;\n if (reverse) delete r.groupId;\n if (!reverse) {\n if (r.type === 'scatter') {\n if (r.mode === 'lines') r.geometry = 'LinePlot'; else if (r.mode === 'markers') r.geometry = 'DotPlot'; else if (r.mode === 'lines+markers') {\n r.geometry = 'LinePlot';\n r.dotVisible = true;\n }\n } else if (r.type === 'area') r.geometry = 'AreaChart'; else if (r.type === 'bar') r.geometry = 'BarChart';\n delete r.mode;\n delete r.type;\n } else {\n if (r.geometry === 'LinePlot') {\n r.type = 'scatter';\n if (r.dotVisible === true) {\n delete r.dotVisible;\n r.mode = 'lines+markers';\n } else r.mode = 'lines';\n } else if (r.geometry === 'DotPlot') {\n r.type = 'scatter';\n r.mode = 'markers';\n } else if (r.geometry === 'AreaChart') r.type = 'area'; else if (r.geometry === 'BarChart') r.type = 'bar';\n delete r.geometry;\n }\n return r;\n });\n if (!reverse && _inputConfig.layout && _inputConfig.layout.barmode === 'stack') {\n var duplicates = µ.util.duplicates(outputConfig.data.map(function(d, i) {\n return d.geometry;\n }));\n outputConfig.data.forEach(function(d, i) {\n var idx = duplicates.indexOf(d.geometry);\n if (idx != -1) outputConfig.data[i].groupId = idx;\n });\n }\n }\n if (_inputConfig.layout) {\n var r = extendDeepAll({}, _inputConfig.layout);\n var toTranslate = [\n [ r, [ 'plot_bgcolor' ], [ 'backgroundColor' ] ],\n [ r, [ 'showlegend' ], [ 'showLegend' ] ],\n [ r, [ 'radialaxis' ], [ 'radialAxis' ] ],\n [ r, [ 'angularaxis' ], [ 'angularAxis' ] ],\n [ r.angularaxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n [ r.angularaxis, [ 'showticklabels' ], [ 'labelsVisible' ] ],\n [ r.angularaxis, [ 'nticks' ], [ 'ticksCount' ] ],\n [ r.angularaxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n [ r.angularaxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n [ r.angularaxis, [ 'range' ], [ 'domain' ] ],\n [ r.angularaxis, [ 'endpadding' ], [ 'endPadding' ] ],\n [ r.radialaxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n [ r.radialaxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n [ r.radialaxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n [ r.radialaxis, [ 'range' ], [ 'domain' ] ],\n [ r.angularAxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n [ r.angularAxis, [ 'showticklabels' ], [ 'labelsVisible' ] ],\n [ r.angularAxis, [ 'nticks' ], [ 'ticksCount' ] ],\n [ r.angularAxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n [ r.angularAxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n [ r.angularAxis, [ 'range' ], [ 'domain' ] ],\n [ r.angularAxis, [ 'endpadding' ], [ 'endPadding' ] ],\n [ r.radialAxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n [ r.radialAxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n [ r.radialAxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n [ r.radialAxis, [ 'range' ], [ 'domain' ] ],\n [ r.font, [ 'outlinecolor' ], [ 'outlineColor' ] ],\n [ r.legend, [ 'traceorder' ], [ 'reverseOrder' ] ],\n [ r, [ 'labeloffset' ], [ 'labelOffset' ] ],\n [ r, [ 'defaultcolorrange' ], [ 'defaultColorRange' ] ]\n ];\n toTranslate.forEach(function(d, i) {\n µ.util.translator.apply(null, d.concat(reverse));\n });\n\n if (!reverse) {\n if (r.angularAxis && typeof r.angularAxis.ticklen !== 'undefined') r.tickLength = r.angularAxis.ticklen;\n if (r.angularAxis && typeof r.angularAxis.tickcolor !== 'undefined') r.tickColor = r.angularAxis.tickcolor;\n } else {\n if (typeof r.tickLength !== 'undefined') {\n r.angularaxis.ticklen = r.tickLength;\n delete r.tickLength;\n }\n if (r.tickColor) {\n r.angularaxis.tickcolor = r.tickColor;\n delete r.tickColor;\n }\n }\n if (r.legend && typeof r.legend.reverseOrder != 'boolean') {\n r.legend.reverseOrder = r.legend.reverseOrder != 'normal';\n }\n if (r.legend && typeof r.legend.traceorder == 'boolean') {\n r.legend.traceorder = r.legend.traceorder ? 'reversed' : 'normal';\n delete r.legend.reverseOrder;\n }\n if (r.margin && typeof r.margin.t != 'undefined') {\n var source = [ 't', 'r', 'b', 'l', 'pad' ];\n var target = [ 'top', 'right', 'bottom', 'left', 'pad' ];\n var margin = {};\n d3.entries(r.margin).forEach(function(dB, iB) {\n margin[target[source.indexOf(dB.key)]] = dB.value;\n });\n r.margin = margin;\n }\n if (reverse) {\n delete r.needsEndSpacing;\n delete r.minorTickColor;\n delete r.minorTicks;\n delete r.angularaxis.ticksCount;\n delete r.angularaxis.ticksCount;\n delete r.angularaxis.ticksStep;\n delete r.angularaxis.rewriteTicks;\n delete r.angularaxis.nticks;\n delete r.radialaxis.ticksCount;\n delete r.radialaxis.ticksCount;\n delete r.radialaxis.ticksStep;\n delete r.radialaxis.rewriteTicks;\n delete r.radialaxis.nticks;\n }\n outputConfig.layout = r;\n }\n return outputConfig;\n };\n return exports;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/polar/micropolar.js\n// module id = 237\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Fx = require('../../components/fx');\nvar dragElement = require('../../components/dragelement');\n\nvar constants = require('./constants');\nvar dragBox = require('./dragbox');\n\nmodule.exports = function initInteractions(gd) {\n var fullLayout = gd._fullLayout;\n\n if((!fullLayout._has('cartesian') && !fullLayout._has('gl2d')) || gd._context.staticPlot) return;\n\n var subplots = Object.keys(fullLayout._plots || {}).sort(function(a, b) {\n // sort overlays last, then by x axis number, then y axis number\n if((fullLayout._plots[a].mainplot && true) ===\n (fullLayout._plots[b].mainplot && true)) {\n var aParts = a.split('y'),\n bParts = b.split('y');\n return (aParts[0] === bParts[0]) ?\n (Number(aParts[1] || 1) - Number(bParts[1] || 1)) :\n (Number(aParts[0] || 1) - Number(bParts[0] || 1));\n }\n return fullLayout._plots[a].mainplot ? 1 : -1;\n });\n\n subplots.forEach(function(subplot) {\n var plotinfo = fullLayout._plots[subplot];\n\n var xa = plotinfo.xaxis,\n ya = plotinfo.yaxis,\n\n // the y position of the main x axis line\n y0 = (xa._linepositions[subplot] || [])[3],\n\n // the x position of the main y axis line\n x0 = (ya._linepositions[subplot] || [])[3];\n\n var DRAGGERSIZE = constants.DRAGGERSIZE;\n if(isNumeric(y0) && xa.side === 'top') y0 -= DRAGGERSIZE;\n if(isNumeric(x0) && ya.side !== 'right') x0 -= DRAGGERSIZE;\n\n // main and corner draggers need not be repeated for\n // overlaid subplots - these draggers drag them all\n if(!plotinfo.mainplot) {\n // main dragger goes over the grids and data, so we use its\n // mousemove events for all data hover effects\n var maindrag = dragBox(gd, plotinfo, 0, 0,\n xa._length, ya._length, 'ns', 'ew');\n\n maindrag.onmousemove = function(evt) {\n // This is on `gd._fullLayout`, *not* fullLayout because the reference\n // changes by the time this is called again.\n gd._fullLayout._rehover = function() {\n if(gd._fullLayout._hoversubplot === subplot) {\n Fx.hover(gd, evt, subplot);\n }\n };\n\n Fx.hover(gd, evt, subplot);\n\n // Note that we have *not* used the cached fullLayout variable here\n // since that may be outdated when this is called as a callback later on\n gd._fullLayout._lasthover = maindrag;\n gd._fullLayout._hoversubplot = subplot;\n };\n\n /*\n * IMPORTANT:\n * We must check for the presence of the drag cover here.\n * If we don't, a 'mouseout' event is triggered on the\n * maindrag before each 'click' event, which has the effect\n * of clearing the hoverdata; thus, cancelling the click event.\n */\n maindrag.onmouseout = function(evt) {\n if(gd._dragging) return;\n\n // When the mouse leaves this maindrag, unset the hovered subplot.\n // This may cause problems if it leaves the subplot directly *onto*\n // another subplot, but that's a tiny corner case at the moment.\n gd._fullLayout._hoversubplot = null;\n\n dragElement.unhover(gd, evt);\n };\n\n maindrag.onclick = function(evt) {\n Fx.click(gd, evt, subplot);\n };\n\n // corner draggers\n if(gd._context.showAxisDragHandles) {\n dragBox(gd, plotinfo, -DRAGGERSIZE, -DRAGGERSIZE,\n DRAGGERSIZE, DRAGGERSIZE, 'n', 'w');\n dragBox(gd, plotinfo, xa._length, -DRAGGERSIZE,\n DRAGGERSIZE, DRAGGERSIZE, 'n', 'e');\n dragBox(gd, plotinfo, -DRAGGERSIZE, ya._length,\n DRAGGERSIZE, DRAGGERSIZE, 's', 'w');\n dragBox(gd, plotinfo, xa._length, ya._length,\n DRAGGERSIZE, DRAGGERSIZE, 's', 'e');\n }\n }\n if(gd._context.showAxisDragHandles) {\n // x axis draggers - if you have overlaid plots,\n // these drag each axis separately\n if(isNumeric(y0)) {\n if(xa.anchor === 'free') y0 -= fullLayout._size.h * (1 - ya.domain[1]);\n dragBox(gd, plotinfo, xa._length * 0.1, y0,\n xa._length * 0.8, DRAGGERSIZE, '', 'ew');\n dragBox(gd, plotinfo, 0, y0,\n xa._length * 0.1, DRAGGERSIZE, '', 'w');\n dragBox(gd, plotinfo, xa._length * 0.9, y0,\n xa._length * 0.1, DRAGGERSIZE, '', 'e');\n }\n // y axis draggers\n if(isNumeric(x0)) {\n if(ya.anchor === 'free') x0 -= fullLayout._size.w * xa.domain[0];\n dragBox(gd, plotinfo, x0, ya._length * 0.1,\n DRAGGERSIZE, ya._length * 0.8, 'ns', '');\n dragBox(gd, plotinfo, x0, ya._length * 0.9,\n DRAGGERSIZE, ya._length * 0.1, 's', '');\n dragBox(gd, plotinfo, x0, 0,\n DRAGGERSIZE, ya._length * 0.1, 'n', '');\n }\n }\n });\n\n // In case you mousemove over some hovertext, send it to Fx.hover too\n // we do this so that we can put the hover text in front of everything,\n // but still be able to interact with everything as if it isn't there\n var hoverLayer = fullLayout._hoverlayer.node();\n\n hoverLayer.onmousemove = function(evt) {\n evt.target = fullLayout._lasthover;\n Fx.hover(gd, evt, fullLayout._hoversubplot);\n };\n\n hoverLayer.onclick = function(evt) {\n evt.target = fullLayout._lasthover;\n Fx.click(gd, evt);\n };\n\n // also delegate mousedowns... TODO: does this actually work?\n hoverLayer.onmousedown = function(evt) {\n fullLayout._lasthover.onmousedown(evt);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/graph_interact.js\n// module id = 238\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\n\nmodule.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts) {\n opts = opts || {};\n\n coerce('hoverlabel.bgcolor', opts.bgcolor);\n coerce('hoverlabel.bordercolor', opts.bordercolor);\n coerce('hoverlabel.namelength', opts.namelength);\n Lib.coerceFont(coerce, 'hoverlabel.font', opts.font);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/hoverlabel_defaults.js\n// module id = 239\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar dot = require('./matrix').dot;\nvar BADNUM = require('../constants/numerical').BADNUM;\n\nvar polygon = module.exports = {};\n\n/**\n * Turn an array of [x, y] pairs into a polygon object\n * that can test if points are inside it\n *\n * @param ptsIn Array of [x, y] pairs\n *\n * @returns polygon Object {xmin, xmax, ymin, ymax, pts, contains}\n * (x|y)(min|max) are the bounding rect of the polygon\n * pts is the original array, with the first pair repeated at the end\n * contains is a function: (pt, omitFirstEdge)\n * pt is the [x, y] pair to test\n * omitFirstEdge truthy means points exactly on the first edge don't\n * count. This is for use adding one polygon to another so we\n * don't double-count the edge where they meet.\n * returns boolean: is pt inside the polygon (including on its edges)\n */\npolygon.tester = function tester(ptsIn) {\n var pts = ptsIn.slice(),\n xmin = pts[0][0],\n xmax = xmin,\n ymin = pts[0][1],\n ymax = ymin;\n\n pts.push(pts[0]);\n for(var i = 1; i < pts.length; i++) {\n xmin = Math.min(xmin, pts[i][0]);\n xmax = Math.max(xmax, pts[i][0]);\n ymin = Math.min(ymin, pts[i][1]);\n ymax = Math.max(ymax, pts[i][1]);\n }\n\n // do we have a rectangle? Handle this here, so we can use the same\n // tester for the rectangular case without sacrificing speed\n\n var isRect = false,\n rectFirstEdgeTest;\n\n if(pts.length === 5) {\n if(pts[0][0] === pts[1][0]) { // vert, horz, vert, horz\n if(pts[2][0] === pts[3][0] &&\n pts[0][1] === pts[3][1] &&\n pts[1][1] === pts[2][1]) {\n isRect = true;\n rectFirstEdgeTest = function(pt) { return pt[0] === pts[0][0]; };\n }\n }\n else if(pts[0][1] === pts[1][1]) { // horz, vert, horz, vert\n if(pts[2][1] === pts[3][1] &&\n pts[0][0] === pts[3][0] &&\n pts[1][0] === pts[2][0]) {\n isRect = true;\n rectFirstEdgeTest = function(pt) { return pt[1] === pts[0][1]; };\n }\n }\n }\n\n function rectContains(pt, omitFirstEdge) {\n var x = pt[0],\n y = pt[1];\n\n if(x === BADNUM || x < xmin || x > xmax || y === BADNUM || y < ymin || y > ymax) {\n // pt is outside the bounding box of polygon\n return false;\n }\n if(omitFirstEdge && rectFirstEdgeTest(pt)) return false;\n\n return true;\n }\n\n function contains(pt, omitFirstEdge) {\n var x = pt[0],\n y = pt[1];\n\n if(x === BADNUM || x < xmin || x > xmax || y === BADNUM || y < ymin || y > ymax) {\n // pt is outside the bounding box of polygon\n return false;\n }\n\n var imax = pts.length,\n x1 = pts[0][0],\n y1 = pts[0][1],\n crossings = 0,\n i,\n x0,\n y0,\n xmini,\n ycross;\n\n for(i = 1; i < imax; i++) {\n // find all crossings of a vertical line upward from pt with\n // polygon segments\n // crossings exactly at xmax don't count, unless the point is\n // exactly on the segment, then it counts as inside.\n x0 = x1;\n y0 = y1;\n x1 = pts[i][0];\n y1 = pts[i][1];\n xmini = Math.min(x0, x1);\n\n // outside the bounding box of this segment, it's only a crossing\n // if it's below the box.\n if(x < xmini || x > Math.max(x0, x1) || y > Math.max(y0, y1)) {\n continue;\n }\n else if(y < Math.min(y0, y1)) {\n // don't count the left-most point of the segment as a crossing\n // because we don't want to double-count adjacent crossings\n // UNLESS the polygon turns past vertical at exactly this x\n // Note that this is repeated below, but we can't factor it out\n // because\n if(x !== xmini) crossings++;\n }\n // inside the bounding box, check the actual line intercept\n else {\n // vertical segment - we know already that the point is exactly\n // on the segment, so mark the crossing as exactly at the point.\n if(x1 === x0) ycross = y;\n // any other angle\n else ycross = y0 + (x - x0) * (y1 - y0) / (x1 - x0);\n\n // exactly on the edge: counts as inside the polygon, unless it's the\n // first edge and we're omitting it.\n if(y === ycross) {\n if(i === 1 && omitFirstEdge) return false;\n return true;\n }\n\n if(y <= ycross && x !== xmini) crossings++;\n }\n }\n\n // if we've gotten this far, odd crossings means inside, even is outside\n return crossings % 2 === 1;\n }\n\n return {\n xmin: xmin,\n xmax: xmax,\n ymin: ymin,\n ymax: ymax,\n pts: pts,\n contains: isRect ? rectContains : contains,\n isRect: isRect\n };\n};\n\n/**\n * Test if a segment of a points array is bent or straight\n *\n * @param pts Array of [x, y] pairs\n * @param start the index of the proposed start of the straight section\n * @param end the index of the proposed end point\n * @param tolerance the max distance off the line connecting start and end\n * before the line counts as bent\n * @returns boolean: true means this segment is bent, false means straight\n */\nvar isBent = polygon.isSegmentBent = function isBent(pts, start, end, tolerance) {\n var startPt = pts[start],\n segment = [pts[end][0] - startPt[0], pts[end][1] - startPt[1]],\n segmentSquared = dot(segment, segment),\n segmentLen = Math.sqrt(segmentSquared),\n unitPerp = [-segment[1] / segmentLen, segment[0] / segmentLen],\n i,\n part,\n partParallel;\n\n for(i = start + 1; i < end; i++) {\n part = [pts[i][0] - startPt[0], pts[i][1] - startPt[1]];\n partParallel = dot(part, segment);\n\n if(partParallel < 0 || partParallel > segmentSquared ||\n Math.abs(dot(part, unitPerp)) > tolerance) return true;\n }\n return false;\n};\n\n/**\n * Make a filtering polygon, to minimize the number of segments\n *\n * @param pts Array of [x, y] pairs (must start with at least 1 pair)\n * @param tolerance the maximum deviation from straight allowed for\n * removing points to simplify the polygon\n *\n * @returns Object {addPt, raw, filtered}\n * addPt is a function(pt: [x, y] pair) to add a raw point and\n * continue filtering\n * raw is all the input points\n * filtered is the resulting filtered Array of [x, y] pairs\n */\npolygon.filter = function filter(pts, tolerance) {\n var ptsFiltered = [pts[0]],\n doneRawIndex = 0,\n doneFilteredIndex = 0;\n\n function addPt(pt) {\n pts.push(pt);\n var prevFilterLen = ptsFiltered.length,\n iLast = doneRawIndex;\n ptsFiltered.splice(doneFilteredIndex + 1);\n\n for(var i = iLast + 1; i < pts.length; i++) {\n if(i === pts.length - 1 || isBent(pts, iLast, i + 1, tolerance)) {\n ptsFiltered.push(pts[i]);\n if(ptsFiltered.length < prevFilterLen - 2) {\n doneRawIndex = i;\n doneFilteredIndex = ptsFiltered.length - 1;\n }\n iLast = i;\n }\n }\n }\n\n if(pts.length > 1) {\n var lastPt = pts.pop();\n addPt(lastPt);\n }\n\n return {\n addPt: addPt,\n raw: pts,\n filtered: ptsFiltered\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/polygon.js\n// module id = 240\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar FROM_BL = require('../../constants/alignment').FROM_BL;\n\nmodule.exports = function scaleZoom(ax, factor, centerFraction) {\n if(centerFraction === undefined) {\n centerFraction = FROM_BL[ax.constraintoward || 'center'];\n }\n\n var rangeLinear = [ax.r2l(ax.range[0]), ax.r2l(ax.range[1])];\n var center = rangeLinear[0] + (rangeLinear[1] - rangeLinear[0]) * centerFraction;\n\n ax.range = ax._input.range = [\n ax.l2r(center + (rangeLinear[0] - center) * factor),\n ax.l2r(center + (rangeLinear[1] - center) * factor)\n ];\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/scale_zoom.js\n// module id = 241\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../../registry');\n\n\nmodule.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {\n var len,\n x = coerce('x'),\n y = coerce('y');\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n\n if(x) {\n if(y) {\n len = Math.min(x.length, y.length);\n // TODO: not sure we should do this here... but I think\n // the way it works in calc is wrong, because it'll delete data\n // which could be a problem eg in streaming / editing if x and y\n // come in at different times\n // so we need to revisit calc before taking this out\n if(len < x.length) traceOut.x = x.slice(0, len);\n if(len < y.length) traceOut.y = y.slice(0, len);\n }\n else {\n len = x.length;\n coerce('y0');\n coerce('dy');\n }\n }\n else {\n if(!y) return 0;\n\n len = traceOut.y.length;\n coerce('x0');\n coerce('dx');\n }\n return len;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/xy_defaults.js\n// module id = 242\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\n\n// arrayOk attributes, merge them into calcdata array\nmodule.exports = function arraysToCalcdata(cd, trace) {\n\n // so each point knows which index it originally came from\n for(var i = 0; i < cd.length; i++) cd[i].i = i;\n\n Lib.mergeArray(trace.text, cd, 'tx');\n Lib.mergeArray(trace.hovertext, cd, 'htx');\n Lib.mergeArray(trace.customdata, cd, 'data');\n Lib.mergeArray(trace.textposition, cd, 'tp');\n if(trace.textfont) {\n Lib.mergeArray(trace.textfont.size, cd, 'ts');\n Lib.mergeArray(trace.textfont.color, cd, 'tc');\n Lib.mergeArray(trace.textfont.family, cd, 'tf');\n }\n\n var marker = trace.marker;\n if(marker) {\n Lib.mergeArray(marker.size, cd, 'ms');\n Lib.mergeArray(marker.opacity, cd, 'mo');\n Lib.mergeArray(marker.symbol, cd, 'mx');\n Lib.mergeArray(marker.color, cd, 'mc');\n\n var markerLine = marker.line;\n if(marker.line) {\n Lib.mergeArray(markerLine.color, cd, 'mlc');\n Lib.mergeArray(markerLine.width, cd, 'mlw');\n }\n\n var markerGradient = marker.gradient;\n if(markerGradient && markerGradient.type !== 'none') {\n Lib.mergeArray(markerGradient.type, cd, 'mgt');\n Lib.mergeArray(markerGradient.color, cd, 'mgc');\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/arrays_to_calcdata.js\n// module id = 243\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Lib = require('../../lib');\nvar Plots = require('../../plots/plots');\nvar Colorscale = require('../../components/colorscale');\nvar drawColorbar = require('../../components/colorbar/draw');\n\n\nmodule.exports = function colorbar(gd, cd) {\n var trace = cd[0].trace,\n marker = trace.marker,\n cbId = 'cb' + trace.uid;\n\n gd._fullLayout._infolayer.selectAll('.' + cbId).remove();\n\n // TODO make Colorbar.draw support multiple colorbar per trace\n\n if((marker === undefined) || !marker.showscale) {\n Plots.autoMargin(gd, cbId);\n return;\n }\n\n var vals = marker.color,\n cmin = marker.cmin,\n cmax = marker.cmax;\n\n if(!isNumeric(cmin)) cmin = Lib.aggNums(Math.min, null, vals);\n if(!isNumeric(cmax)) cmax = Lib.aggNums(Math.max, null, vals);\n\n var cb = cd[0].t.cb = drawColorbar(gd, cbId);\n var sclFunc = Colorscale.makeColorScaleFunc(\n Colorscale.extractScale(\n marker.colorscale,\n cmin,\n cmax\n ),\n { noNumericCheck: true }\n );\n\n cb.fillcolor(sclFunc)\n .filllevels({start: cmin, end: cmax, size: (cmax - cmin) / 254})\n .options(marker.colorbar)();\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/colorbar.js\n// module id = 244\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\n\n/** Fill hover 'pointData' container with 'correct' hover text value\n *\n * - If trace hoverinfo contains a 'text' flag and hovertext is not set,\n * the text elements will be seen in the hover labels.\n *\n * - If trace hoverinfo contains a 'text' flag and hovertext is set,\n * hovertext takes precedence over text\n * i.e. the hoverinfo elements will be seen in the hover labels\n *\n * @param {object} calcPt\n * @param {object} trace\n * @param {object || array} contOut (mutated here)\n */\nmodule.exports = function fillHoverText(calcPt, trace, contOut) {\n var fill = Array.isArray(contOut) ?\n function(v) { contOut.push(v); } :\n function(v) { contOut.text = v; };\n\n var htx = Lib.extractOption(calcPt, trace, 'htx', 'hovertext');\n if(isValid(htx)) return fill(htx);\n\n var tx = Lib.extractOption(calcPt, trace, 'tx', 'text');\n if(isValid(tx)) return fill(tx);\n};\n\n// accept all truthy values and 0 (which gets cast to '0' in the hover labels)\nfunction isValid(v) {\n return v || v === 0;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/fill_hover_text.js\n// module id = 245\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = require('../../plots/font_attributes');\nvar colorAttrs = require('../color/attributes');\n\n\nmodule.exports = {\n bgcolor: {\n valType: 'color',\n \n editType: 'legend',\n \n },\n bordercolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'legend',\n \n },\n borderwidth: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'legend',\n \n },\n font: fontAttrs({\n editType: 'legend',\n \n }),\n orientation: {\n valType: 'enumerated',\n values: ['v', 'h'],\n dflt: 'v',\n \n editType: 'legend',\n \n },\n traceorder: {\n valType: 'flaglist',\n flags: ['reversed', 'grouped'],\n extras: ['normal'],\n \n editType: 'legend',\n \n },\n tracegroupgap: {\n valType: 'number',\n min: 0,\n dflt: 10,\n \n editType: 'legend',\n \n },\n x: {\n valType: 'number',\n min: -2,\n max: 3,\n dflt: 1.02,\n \n editType: 'legend',\n \n },\n xanchor: {\n valType: 'enumerated',\n values: ['auto', 'left', 'center', 'right'],\n dflt: 'left',\n \n editType: 'legend',\n \n },\n y: {\n valType: 'number',\n min: -2,\n max: 3,\n dflt: 1,\n \n editType: 'legend',\n \n },\n yanchor: {\n valType: 'enumerated',\n values: ['auto', 'top', 'middle', 'bottom'],\n dflt: 'auto',\n \n editType: 'legend',\n \n },\n editType: 'legend'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/attributes.js\n// module id = 246\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Registry = require('../../registry');\nvar Lib = require('../../lib');\nvar Drawing = require('../drawing');\nvar Color = require('../color');\n\nvar subTypes = require('../../traces/scatter/subtypes');\nvar stylePie = require('../../traces/pie/style_one');\n\n\nmodule.exports = function style(s, gd) {\n s.each(function(d) {\n var traceGroup = d3.select(this);\n\n var layers = traceGroup.selectAll('g.layers')\n .data([0]);\n layers.enter().append('g')\n .classed('layers', true);\n layers.style('opacity', d[0].trace.opacity);\n\n var fill = layers\n .selectAll('g.legendfill')\n .data([d]);\n fill.enter().append('g')\n .classed('legendfill', true);\n\n var line = layers\n .selectAll('g.legendlines')\n .data([d]);\n line.enter().append('g')\n .classed('legendlines', true);\n\n var symbol = layers\n .selectAll('g.legendsymbols')\n .data([d]);\n symbol.enter().append('g')\n .classed('legendsymbols', true);\n\n symbol.selectAll('g.legendpoints')\n .data([d])\n .enter().append('g')\n .classed('legendpoints', true);\n })\n .each(styleBars)\n .each(styleBoxes)\n .each(stylePies)\n .each(styleLines)\n .each(stylePoints);\n\n function styleLines(d) {\n var trace = d[0].trace,\n showFill = trace.visible && trace.fill && trace.fill !== 'none',\n showLine = subTypes.hasLines(trace);\n\n if(trace && trace._module && trace._module.name === 'contourcarpet') {\n showLine = trace.contours.showlines;\n showFill = trace.contours.coloring === 'fill';\n }\n\n var fill = d3.select(this).select('.legendfill').selectAll('path')\n .data(showFill ? [d] : []);\n fill.enter().append('path').classed('js-fill', true);\n fill.exit().remove();\n fill.attr('d', 'M5,0h30v6h-30z')\n .call(Drawing.fillGroupStyle);\n\n var line = d3.select(this).select('.legendlines').selectAll('path')\n .data(showLine ? [d] : []);\n line.enter().append('path').classed('js-line', true)\n .attr('d', 'M5,0h30');\n line.exit().remove();\n line.call(Drawing.lineGroupStyle);\n }\n\n function stylePoints(d) {\n var d0 = d[0],\n trace = d0.trace,\n showMarkers = subTypes.hasMarkers(trace),\n showText = subTypes.hasText(trace),\n showLines = subTypes.hasLines(trace);\n\n var dMod, tMod;\n\n // 'scatter3d' and 'scattergeo' don't use gd.calcdata yet;\n // use d0.trace to infer arrayOk attributes\n\n function boundVal(attrIn, arrayToValFn, bounds) {\n var valIn = Lib.nestedProperty(trace, attrIn).get(),\n valToBound = (Array.isArray(valIn) && arrayToValFn) ?\n arrayToValFn(valIn) : valIn;\n\n if(bounds) {\n if(valToBound < bounds[0]) return bounds[0];\n else if(valToBound > bounds[1]) return bounds[1];\n }\n return valToBound;\n }\n\n function pickFirst(array) { return array[0]; }\n\n // constrain text, markers, etc so they'll fit on the legend\n if(showMarkers || showText || showLines) {\n var dEdit = {},\n tEdit = {};\n\n if(showMarkers) {\n dEdit.mc = boundVal('marker.color', pickFirst);\n dEdit.mo = boundVal('marker.opacity', Lib.mean, [0.2, 1]);\n dEdit.ms = boundVal('marker.size', Lib.mean, [2, 16]);\n dEdit.mlc = boundVal('marker.line.color', pickFirst);\n dEdit.mlw = boundVal('marker.line.width', Lib.mean, [0, 5]);\n tEdit.marker = {\n sizeref: 1,\n sizemin: 1,\n sizemode: 'diameter'\n };\n }\n\n if(showLines) {\n tEdit.line = {\n width: boundVal('line.width', pickFirst, [0, 10])\n };\n }\n\n if(showText) {\n dEdit.tx = 'Aa';\n dEdit.tp = boundVal('textposition', pickFirst);\n dEdit.ts = 10;\n dEdit.tc = boundVal('textfont.color', pickFirst);\n dEdit.tf = boundVal('textfont.family', pickFirst);\n }\n\n dMod = [Lib.minExtend(d0, dEdit)];\n tMod = Lib.minExtend(trace, tEdit);\n }\n\n var ptgroup = d3.select(this).select('g.legendpoints');\n\n var pts = ptgroup.selectAll('path.scatterpts')\n .data(showMarkers ? dMod : []);\n pts.enter().append('path').classed('scatterpts', true)\n .attr('transform', 'translate(20,0)');\n pts.exit().remove();\n pts.call(Drawing.pointStyle, tMod, gd);\n\n // 'mrc' is set in pointStyle and used in textPointStyle:\n // constrain it here\n if(showMarkers) dMod[0].mrc = 3;\n\n var txt = ptgroup.selectAll('g.pointtext')\n .data(showText ? dMod : []);\n txt.enter()\n .append('g').classed('pointtext', true)\n .append('text').attr('transform', 'translate(20,0)');\n txt.exit().remove();\n txt.selectAll('text').call(Drawing.textPointStyle, tMod, gd);\n }\n\n function styleBars(d) {\n var trace = d[0].trace,\n marker = trace.marker || {},\n markerLine = marker.line || {},\n barpath = d3.select(this).select('g.legendpoints')\n .selectAll('path.legendbar')\n .data(Registry.traceIs(trace, 'bar') ? [d] : []);\n barpath.enter().append('path').classed('legendbar', true)\n .attr('d', 'M6,6H-6V-6H6Z')\n .attr('transform', 'translate(20,0)');\n barpath.exit().remove();\n barpath.each(function(d) {\n var p = d3.select(this),\n d0 = d[0],\n w = (d0.mlw + 1 || markerLine.width + 1) - 1;\n\n p.style('stroke-width', w + 'px')\n .call(Color.fill, d0.mc || marker.color);\n\n if(w) {\n p.call(Color.stroke, d0.mlc || markerLine.color);\n }\n });\n }\n\n function styleBoxes(d) {\n var trace = d[0].trace,\n pts = d3.select(this).select('g.legendpoints')\n .selectAll('path.legendbox')\n .data(Registry.traceIs(trace, 'box') && trace.visible ? [d] : []);\n pts.enter().append('path').classed('legendbox', true)\n // if we want the median bar, prepend M6,0H-6\n .attr('d', 'M6,6H-6V-6H6Z')\n .attr('transform', 'translate(20,0)');\n pts.exit().remove();\n pts.each(function() {\n var w = trace.line.width,\n p = d3.select(this);\n\n p.style('stroke-width', w + 'px')\n .call(Color.fill, trace.fillcolor);\n\n if(w) {\n p.call(Color.stroke, trace.line.color);\n }\n });\n }\n\n function stylePies(d) {\n var trace = d[0].trace,\n pts = d3.select(this).select('g.legendpoints')\n .selectAll('path.legendpie')\n .data(Registry.traceIs(trace, 'pie') && trace.visible ? [d] : []);\n pts.enter().append('path').classed('legendpie', true)\n .attr('d', 'M6,6H-6V-6H6Z')\n .attr('transform', 'translate(20,0)');\n pts.exit().remove();\n\n if(pts.size()) pts.call(stylePie, d[0], trace);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/style.js\n// module id = 247\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * All paths are tuned for maximum scalability of the arrowhead,\n * ie throughout arrowwidth=0.3..3 the head is joined smoothly\n * to the line, with the line coming from the left and ending at (0, 0).\n *\n * `backoff` is the distance to move the arrowhead and the end of the line,\n * in order that the arrowhead points to the desired place, either at\n * the tip of the arrow or (in the case of circle or square)\n * the center of the symbol.\n *\n * `noRotate`, if truthy, says that this arrowhead should not rotate with the\n * arrow. That's the case for squares, which should always be straight, and\n * circles, for which it's irrelevant.\n */\n\nmodule.exports = [\n // no arrow\n {\n path: '',\n backoff: 0\n },\n // wide with flat back\n {\n path: 'M-2.4,-3V3L0.6,0Z',\n backoff: 0.6\n },\n // narrower with flat back\n {\n path: 'M-3.7,-2.5V2.5L1.3,0Z',\n backoff: 1.3\n },\n // barbed\n {\n path: 'M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z',\n backoff: 1.55\n },\n // wide line-drawn\n {\n path: 'M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z',\n backoff: 1.6\n },\n // narrower line-drawn\n {\n path: 'M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z',\n backoff: 2\n },\n // circle\n {\n path: 'M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z',\n backoff: 0,\n noRotate: true\n },\n // square\n {\n path: 'M2,2V-2H-2V2Z',\n backoff: 0,\n noRotate: true\n }\n];\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/arrow_paths.js\n// module id = 248\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Color = require('../color');\n\n// defaults common to 'annotations' and 'annotations3d'\nmodule.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayout, coerce) {\n coerce('opacity');\n var bgColor = coerce('bgcolor');\n\n var borderColor = coerce('bordercolor');\n var borderOpacity = Color.opacity(borderColor);\n\n coerce('borderpad');\n\n var borderWidth = coerce('borderwidth');\n var showArrow = coerce('showarrow');\n\n coerce('text', showArrow ? ' ' : 'new text');\n coerce('textangle');\n Lib.coerceFont(coerce, 'font', fullLayout.font);\n\n coerce('width');\n coerce('align');\n\n var h = coerce('height');\n if(h) coerce('valign');\n\n if(showArrow) {\n coerce('arrowcolor', borderOpacity ? annOut.bordercolor : Color.defaultLine);\n coerce('arrowhead');\n coerce('arrowsize');\n coerce('arrowwidth', ((borderOpacity && borderWidth) || 1) * 2);\n coerce('standoff');\n\n }\n\n var hoverText = coerce('hovertext');\n var globalHoverLabel = fullLayout.hoverlabel || {};\n\n if(hoverText) {\n var hoverBG = coerce('hoverlabel.bgcolor', globalHoverLabel.bgcolor ||\n (Color.opacity(bgColor) ? Color.rgb(bgColor) : Color.defaultLine)\n );\n\n var hoverBorder = coerce('hoverlabel.bordercolor', globalHoverLabel.bordercolor ||\n Color.contrast(hoverBG)\n );\n\n Lib.coerceFont(coerce, 'hoverlabel.font', {\n family: globalHoverLabel.font.family,\n size: globalHoverLabel.font.size,\n color: globalHoverLabel.font.color || hoverBorder\n });\n }\n\n coerce('captureevents', !!hoverText);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/common_defaults.js\n// module id = 249\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n segmentRE: /[MLHVQCTSZ][^MLHVQCTSZ]*/g,\n paramRE: /[^\\s,]+/g,\n\n // which numbers in each path segment are x (or y) values\n // drawn is which param is a drawn point, as opposed to a\n // control point (which doesn't count toward autorange.\n // TODO: this means curved paths could extend beyond the\n // autorange bounds. This is a bit tricky to get right\n // unless we revert to bounding boxes, but perhaps there's\n // a calculation we could do...)\n paramIsX: {\n M: {0: true, drawn: 0},\n L: {0: true, drawn: 0},\n H: {0: true, drawn: 0},\n V: {},\n Q: {0: true, 2: true, drawn: 2},\n C: {0: true, 2: true, 4: true, drawn: 4},\n T: {0: true, drawn: 0},\n S: {0: true, 2: true, drawn: 2},\n // A: {0: true, 5: true},\n Z: {}\n },\n\n paramIsY: {\n M: {1: true, drawn: 1},\n L: {1: true, drawn: 1},\n H: {},\n V: {0: true, drawn: 0},\n Q: {1: true, 3: true, drawn: 3},\n C: {1: true, 3: true, 5: true, drawn: 5},\n T: {1: true, drawn: 1},\n S: {1: true, 3: true, drawn: 5},\n // A: {1: true, 6: true},\n Z: {}\n },\n\n numParams: {\n M: 2,\n L: 2,\n H: 1,\n V: 1,\n Q: 4,\n C: 6,\n T: 2,\n S: 4,\n // A: 7,\n Z: 0\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/shapes/constants.js\n// module id = 250\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar annAttrs = require('../annotations/attributes');\nvar scatterLineAttrs = require('../../traces/scatter/attributes').line;\nvar dash = require('../drawing/attributes').dash;\nvar extendFlat = require('../../lib/extend').extendFlat;\n\nmodule.exports = {\n _isLinkedToArray: 'shape',\n\n visible: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calcIfAutorange',\n \n },\n\n type: {\n valType: 'enumerated',\n values: ['circle', 'rect', 'path', 'line'],\n \n editType: 'calcIfAutorange',\n \n },\n\n layer: {\n valType: 'enumerated',\n values: ['below', 'above'],\n dflt: 'above',\n \n editType: 'arraydraw',\n \n },\n\n xref: extendFlat({}, annAttrs.xref, {\n \n }),\n x0: {\n valType: 'any',\n \n editType: 'calcIfAutorange',\n \n },\n x1: {\n valType: 'any',\n \n editType: 'calcIfAutorange',\n \n },\n\n yref: extendFlat({}, annAttrs.yref, {\n \n }),\n y0: {\n valType: 'any',\n \n editType: 'calcIfAutorange',\n \n },\n y1: {\n valType: 'any',\n \n editType: 'calcIfAutorange',\n \n },\n\n path: {\n valType: 'string',\n \n editType: 'calcIfAutorange',\n \n },\n\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 1,\n \n editType: 'arraydraw',\n \n },\n line: {\n color: extendFlat({}, scatterLineAttrs.color, {editType: 'arraydraw'}),\n width: extendFlat({}, scatterLineAttrs.width, {editType: 'calcIfAutorange'}),\n dash: extendFlat({}, dash, {editType: 'arraydraw'}),\n \n editType: 'calcIfAutorange'\n },\n fillcolor: {\n valType: 'color',\n dflt: 'rgba(0,0,0,0)',\n \n editType: 'arraydraw',\n \n },\n editType: 'arraydraw'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/shapes/attributes.js\n// module id = 251\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar cartesianConstants = require('../../plots/cartesian/constants');\n\n\nmodule.exports = {\n _isLinkedToArray: 'image',\n\n visible: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'arraydraw',\n \n },\n\n source: {\n valType: 'string',\n \n editType: 'arraydraw',\n \n },\n\n layer: {\n valType: 'enumerated',\n values: ['below', 'above'],\n dflt: 'above',\n \n editType: 'arraydraw',\n \n },\n\n sizex: {\n valType: 'number',\n \n dflt: 0,\n editType: 'arraydraw',\n \n },\n\n sizey: {\n valType: 'number',\n \n dflt: 0,\n editType: 'arraydraw',\n \n },\n\n sizing: {\n valType: 'enumerated',\n values: ['fill', 'contain', 'stretch'],\n dflt: 'contain',\n \n editType: 'arraydraw',\n \n },\n\n opacity: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n editType: 'arraydraw',\n \n },\n\n x: {\n valType: 'any',\n \n dflt: 0,\n editType: 'arraydraw',\n \n },\n\n y: {\n valType: 'any',\n \n dflt: 0,\n editType: 'arraydraw',\n \n },\n\n xanchor: {\n valType: 'enumerated',\n values: ['left', 'center', 'right'],\n dflt: 'left',\n \n editType: 'arraydraw',\n \n },\n\n yanchor: {\n valType: 'enumerated',\n values: ['top', 'middle', 'bottom'],\n dflt: 'top',\n \n editType: 'arraydraw',\n \n },\n\n xref: {\n valType: 'enumerated',\n values: [\n 'paper',\n cartesianConstants.idRegex.x.toString()\n ],\n dflt: 'paper',\n \n editType: 'arraydraw',\n \n },\n\n yref: {\n valType: 'enumerated',\n values: [\n 'paper',\n cartesianConstants.idRegex.y.toString()\n ],\n dflt: 'paper',\n \n editType: 'arraydraw',\n \n },\n editType: 'arraydraw'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/images/attributes.js\n// module id = 252\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = require('../../plots/font_attributes');\nvar colorAttrs = require('../color/attributes');\nvar extendFlat = require('../../lib/extend').extendFlat;\nvar overrideAll = require('../../plot_api/edit_types').overrideAll;\nvar padAttrs = require('../../plots/pad_attributes');\n\nvar buttonsAttrs = {\n _isLinkedToArray: 'button',\n\n method: {\n valType: 'enumerated',\n values: ['restyle', 'relayout', 'animate', 'update', 'skip'],\n dflt: 'restyle',\n \n \n },\n args: {\n valType: 'info_array',\n \n freeLength: true,\n items: [\n {valType: 'any'},\n {valType: 'any'},\n {valType: 'any'}\n ],\n \n },\n label: {\n valType: 'string',\n \n dflt: '',\n \n },\n execute: {\n valType: 'boolean',\n \n dflt: true,\n \n }\n};\n\nmodule.exports = overrideAll({\n _isLinkedToArray: 'updatemenu',\n _arrayAttrRegexps: [/^updatemenus\\[(0|[1-9][0-9]+)\\]\\.buttons/],\n\n visible: {\n valType: 'boolean',\n \n \n },\n\n type: {\n valType: 'enumerated',\n values: ['dropdown', 'buttons'],\n dflt: 'dropdown',\n \n \n },\n\n direction: {\n valType: 'enumerated',\n values: ['left', 'right', 'up', 'down'],\n dflt: 'down',\n \n \n },\n\n active: {\n valType: 'integer',\n \n min: -1,\n dflt: 0,\n \n },\n\n showactive: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n\n buttons: buttonsAttrs,\n\n x: {\n valType: 'number',\n min: -2,\n max: 3,\n dflt: -0.05,\n \n \n },\n xanchor: {\n valType: 'enumerated',\n values: ['auto', 'left', 'center', 'right'],\n dflt: 'right',\n \n \n },\n y: {\n valType: 'number',\n min: -2,\n max: 3,\n dflt: 1,\n \n \n },\n yanchor: {\n valType: 'enumerated',\n values: ['auto', 'top', 'middle', 'bottom'],\n dflt: 'top',\n \n \n },\n\n pad: extendFlat({}, padAttrs, {\n \n }),\n\n font: fontAttrs({\n \n }),\n\n bgcolor: {\n valType: 'color',\n \n \n },\n bordercolor: {\n valType: 'color',\n dflt: colorAttrs.borderLine,\n \n \n },\n borderwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'arraydraw',\n \n }\n}, 'arraydraw', 'from-root');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/updatemenus/attributes.js\n// module id = 253\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// This is used exclusively by components inside component arrays,\n// hence the 'arraydraw' editType. If this ever gets used elsewhere\n// we could generalize it as a function ala font_attributes\nmodule.exports = {\n t: {\n valType: 'number',\n dflt: 0,\n \n editType: 'arraydraw',\n \n },\n r: {\n valType: 'number',\n dflt: 0,\n \n editType: 'arraydraw',\n \n },\n b: {\n valType: 'number',\n dflt: 0,\n \n editType: 'arraydraw',\n \n },\n l: {\n valType: 'number',\n dflt: 0,\n \n editType: 'arraydraw',\n \n },\n editType: 'arraydraw'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/pad_attributes.js\n// module id = 254\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = require('../../plots/font_attributes');\nvar padAttrs = require('../../plots/pad_attributes');\nvar extendDeepAll = require('../../lib/extend').extendDeepAll;\nvar overrideAll = require('../../plot_api/edit_types').overrideAll;\nvar animationAttrs = require('../../plots/animation_attributes');\nvar constants = require('./constants');\n\nvar stepsAttrs = {\n _isLinkedToArray: 'step',\n\n method: {\n valType: 'enumerated',\n values: ['restyle', 'relayout', 'animate', 'update', 'skip'],\n dflt: 'restyle',\n \n \n },\n args: {\n valType: 'info_array',\n \n freeLength: true,\n items: [\n { valType: 'any' },\n { valType: 'any' },\n { valType: 'any' }\n ],\n \n },\n label: {\n valType: 'string',\n \n \n },\n value: {\n valType: 'string',\n \n \n },\n execute: {\n valType: 'boolean',\n \n dflt: true,\n \n }\n};\n\nmodule.exports = overrideAll({\n _isLinkedToArray: 'slider',\n\n visible: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n\n active: {\n valType: 'number',\n \n min: 0,\n dflt: 0,\n \n },\n\n steps: stepsAttrs,\n\n lenmode: {\n valType: 'enumerated',\n values: ['fraction', 'pixels'],\n \n dflt: 'fraction',\n \n },\n len: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n \n },\n x: {\n valType: 'number',\n min: -2,\n max: 3,\n dflt: 0,\n \n \n },\n pad: extendDeepAll({}, padAttrs, {\n \n }, {t: {dflt: 20}}),\n xanchor: {\n valType: 'enumerated',\n values: ['auto', 'left', 'center', 'right'],\n dflt: 'left',\n \n \n },\n y: {\n valType: 'number',\n min: -2,\n max: 3,\n dflt: 0,\n \n \n },\n yanchor: {\n valType: 'enumerated',\n values: ['auto', 'top', 'middle', 'bottom'],\n dflt: 'top',\n \n \n },\n\n transition: {\n duration: {\n valType: 'number',\n \n min: 0,\n dflt: 150,\n \n },\n easing: {\n valType: 'enumerated',\n values: animationAttrs.transition.easing.values,\n \n dflt: 'cubic-in-out',\n \n }\n },\n\n currentvalue: {\n visible: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n\n xanchor: {\n valType: 'enumerated',\n values: ['left', 'center', 'right'],\n dflt: 'left',\n \n \n },\n\n offset: {\n valType: 'number',\n dflt: 10,\n \n \n },\n\n prefix: {\n valType: 'string',\n \n \n },\n\n suffix: {\n valType: 'string',\n \n \n },\n\n font: fontAttrs({\n \n })\n },\n\n font: fontAttrs({\n \n }),\n\n activebgcolor: {\n valType: 'color',\n \n dflt: constants.gripBgActiveColor,\n \n },\n bgcolor: {\n valType: 'color',\n \n dflt: constants.railBgColor,\n \n },\n bordercolor: {\n valType: 'color',\n dflt: constants.railBorderColor,\n \n \n },\n borderwidth: {\n valType: 'number',\n min: 0,\n dflt: constants.railBorderWidth,\n \n \n },\n ticklen: {\n valType: 'number',\n min: 0,\n dflt: constants.tickLength,\n \n \n },\n tickcolor: {\n valType: 'color',\n dflt: constants.tickColor,\n \n \n },\n tickwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n \n },\n minorticklen: {\n valType: 'number',\n min: 0,\n dflt: constants.minorTickLength,\n \n \n }\n}, 'arraydraw', 'from-root');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/sliders/attributes.js\n// module id = 255\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n\n // attribute container name\n name: 'rangeslider',\n\n // class names\n\n containerClassName: 'rangeslider-container',\n bgClassName: 'rangeslider-bg',\n rangePlotClassName: 'rangeslider-rangeplot',\n\n maskMinClassName: 'rangeslider-mask-min',\n maskMaxClassName: 'rangeslider-mask-max',\n slideBoxClassName: 'rangeslider-slidebox',\n\n grabberMinClassName: 'rangeslider-grabber-min',\n grabAreaMinClassName: 'rangeslider-grabarea-min',\n handleMinClassName: 'rangeslider-handle-min',\n\n grabberMaxClassName: 'rangeslider-grabber-max',\n grabAreaMaxClassName: 'rangeslider-grabarea-max',\n handleMaxClassName: 'rangeslider-handle-max',\n\n // style constants\n\n maskColor: 'rgba(0,0,0,0.4)',\n\n slideBoxFill: 'transparent',\n slideBoxCursor: 'ew-resize',\n\n grabAreaFill: 'transparent',\n grabAreaCursor: 'col-resize',\n grabAreaWidth: 10,\n\n handleWidth: 4,\n handleRadius: 1,\n handleStrokeWidth: 1,\n\n extraPad: 15\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeslider/constants.js\n// module id = 256\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n step: {\n valType: 'enumerated',\n \n values: ['month', 'year', 'day', 'hour', 'minute', 'second', 'all'],\n dflt: 'month',\n editType: 'plot',\n \n },\n stepmode: {\n valType: 'enumerated',\n \n values: ['backward', 'todate'],\n dflt: 'backward',\n editType: 'plot',\n \n },\n count: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n editType: 'plot',\n \n },\n label: {\n valType: 'string',\n \n editType: 'plot',\n \n },\n editType: 'plot'\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeselector/button_attributes.js\n// module id = 257\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n\n // 'y' position pad above counter axis domain\n yPad: 0.02,\n\n // minimum button width (regardless of text size)\n minButtonWidth: 30,\n\n // buttons rect radii\n rx: 3,\n ry: 3,\n\n // light fraction used to compute the 'activecolor' default\n lightAmount: 25,\n darkAmount: 10\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeselector/constants.js\n// module id = 258\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../lib');\nvar Plots = require('../plots/plots');\n\nvar extendFlat = Lib.extendFlat;\nvar extendDeep = Lib.extendDeep;\n\n// Put default plotTile layouts here\nfunction cloneLayoutOverride(tileClass) {\n var override;\n\n switch(tileClass) {\n case 'themes__thumb':\n override = {\n autosize: true,\n width: 150,\n height: 150,\n title: '',\n showlegend: false,\n margin: {l: 5, r: 5, t: 5, b: 5, pad: 0},\n annotations: []\n };\n break;\n\n case 'thumbnail':\n override = {\n title: '',\n hidesources: true,\n showlegend: false,\n borderwidth: 0,\n bordercolor: '',\n margin: {l: 1, r: 1, t: 1, b: 1, pad: 0},\n annotations: []\n };\n break;\n\n default:\n override = {};\n }\n\n\n return override;\n}\n\nfunction keyIsAxis(keyName) {\n var types = ['xaxis', 'yaxis', 'zaxis'];\n return (types.indexOf(keyName.slice(0, 5)) > -1);\n}\n\n\nmodule.exports = function clonePlot(graphObj, options) {\n\n // Polar plot compatibility\n if(graphObj.framework && graphObj.framework.isPolar) {\n graphObj = graphObj.framework.getConfig();\n }\n\n var i;\n var oldData = graphObj.data;\n var oldLayout = graphObj.layout;\n var newData = extendDeep([], oldData);\n var newLayout = extendDeep({}, oldLayout, cloneLayoutOverride(options.tileClass));\n var context = graphObj._context || {};\n\n if(options.width) newLayout.width = options.width;\n if(options.height) newLayout.height = options.height;\n\n if(options.tileClass === 'thumbnail' || options.tileClass === 'themes__thumb') {\n // kill annotations\n newLayout.annotations = [];\n var keys = Object.keys(newLayout);\n\n for(i = 0; i < keys.length; i++) {\n if(keyIsAxis(keys[i])) {\n newLayout[keys[i]].title = '';\n }\n }\n\n // kill colorbar and pie labels\n for(i = 0; i < newData.length; i++) {\n var trace = newData[i];\n trace.showscale = false;\n if(trace.marker) trace.marker.showscale = false;\n if(trace.type === 'pie') trace.textposition = 'none';\n }\n }\n\n if(Array.isArray(options.annotations)) {\n for(i = 0; i < options.annotations.length; i++) {\n newLayout.annotations.push(options.annotations[i]);\n }\n }\n\n var sceneIds = Plots.getSubplotIds(newLayout, 'gl3d');\n\n if(sceneIds.length) {\n var axesImageOverride = {};\n if(options.tileClass === 'thumbnail') {\n axesImageOverride = {\n title: '',\n showaxeslabels: false,\n showticklabels: false,\n linetickenable: false\n };\n }\n for(i = 0; i < sceneIds.length; i++) {\n var scene = newLayout[sceneIds[i]];\n\n if(!scene.xaxis) {\n scene.xaxis = {};\n }\n\n if(!scene.yaxis) {\n scene.yaxis = {};\n }\n\n if(!scene.zaxis) {\n scene.zaxis = {};\n }\n\n extendFlat(scene.xaxis, axesImageOverride);\n extendFlat(scene.yaxis, axesImageOverride);\n extendFlat(scene.zaxis, axesImageOverride);\n\n // TODO what does this do?\n scene._scene = null;\n }\n }\n\n var gd = document.createElement('div');\n if(options.tileClass) gd.className = options.tileClass;\n\n var plotTile = {\n gd: gd,\n td: gd, // for external (image server) compatibility\n layout: newLayout,\n data: newData,\n config: {\n staticPlot: (options.staticPlot === undefined) ?\n true :\n options.staticPlot,\n plotGlPixelRatio: (options.plotGlPixelRatio === undefined) ?\n 2 :\n options.plotGlPixelRatio,\n displaylogo: options.displaylogo || false,\n showLink: options.showLink || false,\n showTips: options.showTips || false,\n mapboxAccessToken: context.mapboxAccessToken\n }\n };\n\n if(options.setBackground !== 'transparent') {\n plotTile.config.setBackground = options.setBackground || 'opaque';\n }\n\n // attaching the default Layout the gd, so you can grab it later\n plotTile.gd.defaultLayout = cloneLayoutOverride(options.tileClass);\n\n return plotTile;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/snapshot/cloneplot.js\n// module id = 259\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n barmode: {\n valType: 'enumerated',\n values: ['stack', 'group', 'overlay', 'relative'],\n dflt: 'group',\n \n editType: 'calc',\n \n },\n barnorm: {\n valType: 'enumerated',\n values: ['', 'fraction', 'percent'],\n dflt: '',\n \n editType: 'calc',\n \n },\n bargap: {\n valType: 'number',\n min: 0,\n max: 1,\n \n editType: 'calc',\n \n },\n bargroupgap: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n \n editType: 'calc',\n \n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/layout_attributes.js\n// module id = 260\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar mergeArray = require('../../lib').mergeArray;\n\n\n// arrayOk attributes, merge them into calcdata array\nmodule.exports = function arraysToCalcdata(cd, trace) {\n mergeArray(trace.text, cd, 'tx');\n mergeArray(trace.hovertext, cd, 'htx');\n\n var marker = trace.marker;\n if(marker) {\n mergeArray(marker.opacity, cd, 'mo');\n mergeArray(marker.color, cd, 'mc');\n\n var markerLine = marker.line;\n if(markerLine) {\n mergeArray(markerLine.color, cd, 'mlc');\n mergeArray(markerLine.width, cd, 'mlw');\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/arrays_to_calcdata.js\n// module id = 261\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorAttrs = require('../../components/color/attributes');\nvar fontAttrs = require('../../plots/font_attributes');\nvar plotAttrs = require('../../plots/attributes');\n\nvar extendFlat = require('../../lib/extend').extendFlat;\n\nvar textFontAttrs = fontAttrs({\n editType: 'calc',\n colorEditType: 'style',\n \n});\n\nmodule.exports = {\n labels: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n // equivalent of x0 and dx, if label is missing\n label0: {\n valType: 'number',\n \n dflt: 0,\n editType: 'calc',\n \n },\n dlabel: {\n valType: 'number',\n \n dflt: 1,\n editType: 'calc',\n \n },\n\n values: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n marker: {\n colors: {\n valType: 'data_array', // TODO 'color_array' ?\n editType: 'calc',\n \n },\n\n line: {\n color: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n arrayOk: true,\n editType: 'style',\n \n },\n width: {\n valType: 'number',\n \n min: 0,\n dflt: 0,\n arrayOk: true,\n editType: 'style',\n \n },\n editType: 'calc'\n },\n editType: 'calc'\n },\n\n text: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'style',\n \n },\n\n// 'see eg:'\n// 'https://www.e-education.psu.edu/natureofgeoinfo/sites/www.e-education.psu.edu.natureofgeoinfo/files/image/hisp_pies.gif',\n// '(this example involves a map too - may someday be a whole trace type',\n// 'of its own. but the point is the size of the whole pie is important.)'\n scalegroup: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc',\n \n },\n\n // labels (legend is handled by plots.attributes.showlegend and layout.hiddenlabels)\n textinfo: {\n valType: 'flaglist',\n \n flags: ['label', 'text', 'value', 'percent'],\n extras: ['none'],\n editType: 'calc',\n \n },\n hoverinfo: extendFlat({}, plotAttrs.hoverinfo, {\n flags: ['label', 'text', 'value', 'percent', 'name']\n }),\n textposition: {\n valType: 'enumerated',\n \n values: ['inside', 'outside', 'auto', 'none'],\n dflt: 'auto',\n arrayOk: true,\n editType: 'calc',\n \n },\n // TODO make those arrayOk?\n textfont: extendFlat({}, textFontAttrs, {\n \n }),\n insidetextfont: extendFlat({}, textFontAttrs, {\n \n }),\n outsidetextfont: extendFlat({}, textFontAttrs, {\n \n }),\n\n // position and shape\n domain: {\n x: {\n valType: 'info_array',\n \n items: [\n {valType: 'number', min: 0, max: 1, editType: 'calc'},\n {valType: 'number', min: 0, max: 1, editType: 'calc'}\n ],\n dflt: [0, 1],\n editType: 'calc',\n \n },\n y: {\n valType: 'info_array',\n \n items: [\n {valType: 'number', min: 0, max: 1, editType: 'calc'},\n {valType: 'number', min: 0, max: 1, editType: 'calc'}\n ],\n dflt: [0, 1],\n editType: 'calc',\n \n },\n editType: 'calc'\n },\n hole: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 0,\n editType: 'calc',\n \n },\n\n // ordering and direction\n sort: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \n },\n direction: {\n /**\n * there are two common conventions, both of which place the first\n * (largest, if sorted) slice with its left edge at 12 o'clock but\n * succeeding slices follow either cw or ccw from there.\n *\n * see http://visage.co/data-visualization-101-pie-charts/\n */\n valType: 'enumerated',\n values: ['clockwise', 'counterclockwise'],\n \n dflt: 'counterclockwise',\n editType: 'calc',\n \n },\n rotation: {\n valType: 'number',\n \n min: -360,\n max: 360,\n dflt: 0,\n editType: 'calc',\n \n },\n\n pull: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 0,\n arrayOk: true,\n editType: 'calc',\n \n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/attributes.js\n// module id = 262\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n /**\n * hiddenlabels is the pie chart analog of visible:'legendonly'\n * but it can contain many labels, and can hide slices\n * from several pies simultaneously\n */\n hiddenlabels: {\n valType: 'data_array',\n editType: 'calc'\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/layout_attributes.js\n// module id = 263\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\n\nexports.formatPiePercent = function formatPiePercent(v, separators) {\n var vRounded = (v * 100).toPrecision(3);\n if(vRounded.lastIndexOf('.') !== -1) {\n vRounded = vRounded.replace(/[.]?0+$/, '');\n }\n return Lib.numSeparate(vRounded, separators) + '%';\n};\n\nexports.formatPieValue = function formatPieValue(v, separators) {\n var vRounded = v.toPrecision(10);\n if(vRounded.lastIndexOf('.') !== -1) {\n vRounded = vRounded.replace(/[.]?0+$/, '');\n }\n return Lib.numSeparate(vRounded, separators);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/helpers.js\n// module id = 264\n// module chunks = 0","import { request as ajax } from 'helpers/ajax';\nimport { queryString, addNewState } from 'helpers/params';\nimport * as error from 'helpers/error';\nimport * as Plotly from 'plotly.js/lib/index-basic';\n\nfunction losView() {\n var self = this;\n\n self.lon = ko.observable(300);\n self.lat = ko.observable(30);\n self.czmax = ko.observable(15000);\n self.numSteps = ko.observable(100);\n self.plotAvailable = ko.observable(false);\n\n let needState = false;\n\n for (var key in self) {\n if (key in queryString) {\n self[key](queryString[key]);\n } else {\n queryString[key] = self[key]();\n needState = true;\n }\n }\n\n self.graphDiv = document.getElementById('placeholder');\n\n $(document).ready(() => {\n $(window).resize(() => {\n Plotly.Plots.resize(self.graphDiv);\n });\n });\n\n self.currentPlot = Plotly.newPlot(self.graphDiv, [], {\n title: 'Distance vs velocity',\n xaxis: { title: 'Mpc/h', linewidth: 4 },\n yaxis: { title: 'cz (km/s)', linewidth: 4 },\n });\n\n $(self.currentPlot).ready(() => {\n Plotly.Plots.resize(self.graphDiv);\n });\n\n self.update_sky = function() {\n var num = self.numSteps();\n let lon = [],\n lat = [],\n cz = [];\n\n queryString['lon'] = self.lon();\n queryString['lat'] = self.lat();\n queryString['czmax'] = self.czmax();\n queryString['numSteps'] = self.numSteps();\n queryString['plotAvailable'] = self.plotAvailable();\n\n if (self._needState) addNewState();\n\n for (var i = 0; i < num; i++) {\n lon.push(self.lon());\n lat.push(self.lat());\n cz.push(self.czmax() * i / num + 2000);\n }\n\n let req = ajax('/flow_query/get_flow/distance', 'POST', {\n lon: lon,\n lat: lat,\n cz: cz,\n });\n\n let promise = new Promise((resolve, _) => {\n console.log('Setup promise');\n req.error(function() {\n error.show('Impossible to grab data to plot.');\n });\n\n req.done(function(data) {\n console.log(data);\n\n if (self.graphDiv.data !== undefined && self.graphDiv.data.length > 0)\n Plotly.deleteTraces(self.graphDiv, [0]);\n Plotly.addTraces(self.graphDiv, [\n {\n type: 'scatter',\n y: data.cz,\n x: data.d,\n mode: 'lines',\n line: { shape: 'spline' },\n },\n ]);\n\n self.plotAvailable(true);\n\n resolve(self);\n });\n });\n return promise;\n };\n\n self.reset_selection = function() {};\n\n function check_coordinates() {\n if (self._needState) addNewState();\n }\n\n self._needState = false;\n if (self.plotAvailable()) {\n self.update_sky().then(check_coordinates);\n }\n self._needState = true;\n\n if (needState) addNewState();\n\n return self;\n}\n\nlet los = new losView();\n\nko.applyBindings(los);\n\n\n\n// WEBPACK FOOTER //\n// ./app/los_plot.js","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Plotly = require('./core');\n\nPlotly.register([\n require('./bar'),\n require('./pie')\n]);\n\nmodule.exports = Plotly;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/lib/index-basic.js\n// module id = 368\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = require('../src/core');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/lib/core.js\n// module id = 369\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * Export the plotly.js API methods.\n */\n\nvar Plotly = require('./plotly');\n\n// package version injected by `npm run preprocess`\nexports.version = '1.31.2';\n\n// inject promise polyfill\nrequire('es6-promise').polyfill();\n\n// inject plot css\nrequire('../build/plotcss');\n\n// inject default MathJax config\nrequire('./fonts/mathjax_config');\n\n// plot api\nexports.plot = Plotly.plot;\nexports.newPlot = Plotly.newPlot;\nexports.restyle = Plotly.restyle;\nexports.relayout = Plotly.relayout;\nexports.redraw = Plotly.redraw;\nexports.update = Plotly.update;\nexports.extendTraces = Plotly.extendTraces;\nexports.prependTraces = Plotly.prependTraces;\nexports.addTraces = Plotly.addTraces;\nexports.deleteTraces = Plotly.deleteTraces;\nexports.moveTraces = Plotly.moveTraces;\nexports.purge = Plotly.purge;\nexports.setPlotConfig = require('./plot_api/set_plot_config');\nexports.register = require('./plot_api/register');\nexports.toImage = require('./plot_api/to_image');\nexports.downloadImage = require('./snapshot/download');\nexports.validate = require('./plot_api/validate');\nexports.addFrames = Plotly.addFrames;\nexports.deleteFrames = Plotly.deleteFrames;\nexports.animate = Plotly.animate;\n\n// scatter is the only trace included by default\nexports.register(require('./traces/scatter'));\n\n// register all registrable components modules\nexports.register([\n require('./components/fx'),\n require('./components/legend'),\n require('./components/annotations'),\n require('./components/annotations3d'),\n require('./components/shapes'),\n require('./components/images'),\n require('./components/updatemenus'),\n require('./components/sliders'),\n require('./components/rangeslider'),\n require('./components/rangeselector')\n]);\n\n// plot icons\nexports.Icons = require('../build/ploticon');\n\n// unofficial 'beta' plot methods, use at your own risk\nexports.Plots = Plotly.Plots;\nexports.Fx = require('./components/fx');\nexports.Snapshot = require('./snapshot');\nexports.PlotSchema = require('./plot_api/plot_schema');\nexports.Queue = require('./lib/queue');\n\n// export d3 used in the bundle\nexports.d3 = require('d3');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/core.js\n// module id = 370\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar nestedProperty = require('./nested_property');\n\nvar SIMPLE_PROPERTY_REGEX = /^\\w*$/;\n\n// bitmask for deciding what's updated. Sometimes the name needs to be updated,\n// sometimes the value needs to be updated, and sometimes both do. This is just\n// a simple way to track what's updated such that it's a simple OR operation to\n// assimilate new updates.\n//\n// The only exception is the UNSET bit that tracks when we need to explicitly\n// unset and remove the property. This concrn arises because of the special\n// way in which nestedProperty handles null/undefined. When you specify `null`,\n// it prunes any unused items in the tree. I ran into some issues with it getting\n// null vs undefined confused, so UNSET is just a bit that forces the property\n// update to send `null`, removing the property explicitly rather than setting\n// it to undefined.\nvar NONE = 0;\nvar NAME = 1;\nvar VALUE = 2;\nvar BOTH = 3;\nvar UNSET = 4;\n\nmodule.exports = function keyedContainer(baseObj, path, keyName, valueName) {\n keyName = keyName || 'name';\n valueName = valueName || 'value';\n var i, arr;\n var changeTypes = {};\n\n if(path && path.length) { arr = nestedProperty(baseObj, path).get();\n } else {\n arr = baseObj;\n }\n\n path = path || '';\n arr = arr || [];\n\n // Construct an index:\n var indexLookup = {};\n for(i = 0; i < arr.length; i++) {\n indexLookup[arr[i][keyName]] = i;\n }\n\n var isSimpleValueProp = SIMPLE_PROPERTY_REGEX.test(valueName);\n\n var obj = {\n // NB: this does not actually modify the baseObj\n set: function(name, value) {\n var changeType = value === null ? UNSET : NONE;\n\n var idx = indexLookup[name];\n if(idx === undefined) {\n changeType = changeType | BOTH;\n idx = arr.length;\n indexLookup[name] = idx;\n } else if(value !== (isSimpleValueProp ? arr[idx][valueName] : nestedProperty(arr[idx], valueName).get())) {\n changeType = changeType | VALUE;\n }\n\n var newValue = arr[idx] = arr[idx] || {};\n newValue[keyName] = name;\n\n if(isSimpleValueProp) {\n newValue[valueName] = value;\n } else {\n nestedProperty(newValue, valueName).set(value);\n }\n\n // If it's not an unset, force that bit to be unset. This is all related to the fact\n // that undefined and null are a bit specially implemented in nestedProperties.\n if(value !== null) {\n changeType = changeType & ~UNSET;\n }\n\n changeTypes[idx] = changeTypes[idx] | changeType;\n\n return obj;\n },\n get: function(name) {\n var idx = indexLookup[name];\n\n if(idx === undefined) {\n return undefined;\n } else if(isSimpleValueProp) {\n return arr[idx][valueName];\n } else {\n return nestedProperty(arr[idx], valueName).get();\n }\n },\n rename: function(name, newName) {\n var idx = indexLookup[name];\n\n if(idx === undefined) return obj;\n changeTypes[idx] = changeTypes[idx] | NAME;\n\n indexLookup[newName] = idx;\n delete indexLookup[name];\n\n arr[idx][keyName] = newName;\n\n return obj;\n },\n remove: function(name) {\n var idx = indexLookup[name];\n\n if(idx === undefined) return obj;\n\n var object = arr[idx];\n if(Object.keys(object).length > 2) {\n // This object contains more than just the key/value, so unset\n // the value without modifying the entry otherwise:\n changeTypes[idx] = changeTypes[idx] | VALUE;\n return obj.set(name, null);\n }\n\n if(isSimpleValueProp) {\n for(i = idx; i < arr.length; i++) {\n changeTypes[i] = changeTypes[i] | BOTH;\n }\n for(i = idx; i < arr.length; i++) {\n indexLookup[arr[i][keyName]]--;\n }\n arr.splice(idx, 1);\n delete(indexLookup[name]);\n } else {\n // Perform this update *strictly* so we can check whether the result's\n // been pruned. If so, it's a removal. If not, it's a value unset only.\n nestedProperty(object, valueName).set(null);\n\n // Now check if the top level nested property has any keys left. If so,\n // the object still has values so we only want to unset the key. If not,\n // the entire object can be removed since there's no other data.\n // var topLevelKeys = Object.keys(object[valueName.split('.')[0]] || []);\n\n changeTypes[idx] = changeTypes[idx] | VALUE | UNSET;\n }\n\n return obj;\n },\n constructUpdate: function() {\n var astr, idx;\n var update = {};\n var changed = Object.keys(changeTypes);\n for(var i = 0; i < changed.length; i++) {\n idx = changed[i];\n astr = path + '[' + idx + ']';\n if(arr[idx]) {\n if(changeTypes[idx] & NAME) {\n update[astr + '.' + keyName] = arr[idx][keyName];\n }\n if(changeTypes[idx] & VALUE) {\n if(isSimpleValueProp) {\n update[astr + '.' + valueName] = (changeTypes[idx] & UNSET) ? null : arr[idx][valueName];\n } else {\n update[astr + '.' + valueName] = (changeTypes[idx] & UNSET) ? null : nestedProperty(arr[idx], valueName).get();\n }\n }\n } else {\n update[astr] = null;\n }\n }\n\n return update;\n }\n };\n\n return obj;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/keyed_container.js\n// module id = 371\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// ASCEND: chop off the last nesting level - either [] or . - to ascend\n// the attribute tree. the remaining attrString is in match[1]\nvar ASCEND = /^(.*)(\\.[^\\.\\[\\]]+|\\[\\d\\])$/;\n\n// SIMPLEATTR: is this an un-nested attribute? (no dots or brackets)\nvar SIMPLEATTR = /^[^\\.\\[\\]]+$/;\n\n/*\n * calculate a relative attribute string, similar to a relative path\n *\n * @param {string} baseAttr:\n * an attribute string, such as 'annotations[3].x'. The \"current location\"\n * is the attribute string minus the last component ('annotations[3]')\n * @param {string} relativeAttr:\n * a route to the desired attribute string, using '^' to ascend\n *\n * @return {string} attrString:\n * for example:\n * relativeAttr('annotations[3].x', 'y') = 'annotations[3].y'\n * relativeAttr('annotations[3].x', '^[2].z') = 'annotations[2].z'\n * relativeAttr('annotations[3].x', '^^margin') = 'margin'\n * relativeAttr('annotations[3].x', '^^margin.r') = 'margin.r'\n */\nmodule.exports = function(baseAttr, relativeAttr) {\n while(relativeAttr) {\n var match = baseAttr.match(ASCEND);\n\n if(match) baseAttr = match[1];\n else if(baseAttr.match(SIMPLEATTR)) baseAttr = '';\n else throw new Error('bad relativeAttr call:' + [baseAttr, relativeAttr]);\n\n if(relativeAttr.charAt(0) === '^') relativeAttr = relativeAttr.slice(1);\n else break;\n }\n\n if(baseAttr && relativeAttr.charAt(0) !== '[') {\n return baseAttr + '.' + relativeAttr;\n }\n return baseAttr + relativeAttr;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/relative_attr.js\n// module id = 372\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isArray = require('./is_array');\nvar isPlainObject = require('./is_plain_object');\n\n/**\n * Relink private _keys and keys with a function value from one container\n * to the new container.\n * Relink means copying if object is pass-by-value and adding a reference\n * if object is pass-by-ref.\n * This prevents deepCopying massive structures like a webgl context.\n */\nmodule.exports = function relinkPrivateKeys(toContainer, fromContainer) {\n var keys = Object.keys(fromContainer || {});\n\n for(var i = 0; i < keys.length; i++) {\n var k = keys[i],\n fromVal = fromContainer[k],\n toVal = toContainer[k];\n\n if(k.charAt(0) === '_' || typeof fromVal === 'function') {\n\n // if it already exists at this point, it's something\n // that we recreate each time around, so ignore it\n if(k in toContainer) continue;\n\n toContainer[k] = fromVal;\n }\n else if(isArray(fromVal) && isArray(toVal) && isPlainObject(fromVal[0])) {\n\n // recurse into arrays containers\n for(var j = 0; j < fromVal.length; j++) {\n if(isPlainObject(fromVal[j]) && isPlainObject(toVal[j])) {\n relinkPrivateKeys(toVal[j], fromVal[j]);\n }\n }\n }\n else if(isPlainObject(fromVal) && isPlainObject(toVal)) {\n\n // recurse into objects, but only if they still exist\n relinkPrivateKeys(toVal, fromVal);\n\n if(!Object.keys(toVal).length) delete toContainer[k];\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/relink_private.js\n// module id = 373\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * Ensures an array has the right amount of storage space. If it doesn't\n * exist, it creates an array. If it does exist, it returns it if too\n * short or truncates it in-place.\n *\n * The goal is to just reuse memory to avoid a bit of excessive garbage\n * collection.\n */\nmodule.exports = function ensureArray(out, n) {\n if(!Array.isArray(out)) out = [];\n\n // If too long, truncate. (If too short, it will grow\n // automatically so we don't care about that case)\n out.length = n;\n\n return out;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/ensure_array.js\n// module id = 374\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar tinycolor = require('tinycolor2');\n\nvar baseTraceAttrs = require('../plots/attributes');\nvar getColorscale = require('../components/colorscale/get_scale');\nvar colorscaleNames = Object.keys(require('../components/colorscale/scales'));\nvar nestedProperty = require('./nested_property');\nvar counterRegex = require('./regex').counter;\n\nexports.valObjectMeta = {\n data_array: {\n // You can use *dflt=[] to force said array to exist though.\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(Array.isArray(v)) propOut.set(v);\n else if(dflt !== undefined) propOut.set(dflt);\n }\n },\n enumerated: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(opts.coerceNumber) v = +v;\n if(opts.values.indexOf(v) === -1) propOut.set(dflt);\n else propOut.set(v);\n },\n validateFunction: function(v, opts) {\n if(opts.coerceNumber) v = +v;\n\n var values = opts.values;\n for(var i = 0; i < values.length; i++) {\n var k = String(values[i]);\n\n if((k.charAt(0) === '/' && k.charAt(k.length - 1) === '/')) {\n var regex = new RegExp(k.substr(1, k.length - 2));\n if(regex.test(v)) return true;\n } else if(v === values[i]) return true;\n }\n return false;\n }\n },\n 'boolean': {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(v === true || v === false) propOut.set(v);\n else propOut.set(dflt);\n }\n },\n number: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(!isNumeric(v) ||\n (opts.min !== undefined && v < opts.min) ||\n (opts.max !== undefined && v > opts.max)) {\n propOut.set(dflt);\n }\n else propOut.set(+v);\n }\n },\n integer: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(v % 1 || !isNumeric(v) ||\n (opts.min !== undefined && v < opts.min) ||\n (opts.max !== undefined && v > opts.max)) {\n propOut.set(dflt);\n }\n else propOut.set(+v);\n }\n },\n string: {\n \n \n // TODO 'values shouldn't be in there (edge case: 'dash' in Scatter)\n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(typeof v !== 'string') {\n var okToCoerce = (typeof v === 'number');\n\n if(opts.strict === true || !okToCoerce) propOut.set(dflt);\n else propOut.set(String(v));\n }\n else if(opts.noBlank && !v) propOut.set(dflt);\n else propOut.set(v);\n }\n },\n color: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(tinycolor(v).isValid()) propOut.set(v);\n else propOut.set(dflt);\n }\n },\n colorscale: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n propOut.set(getColorscale(v, dflt));\n }\n },\n angle: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(v === 'auto') propOut.set('auto');\n else if(!isNumeric(v)) propOut.set(dflt);\n else {\n if(Math.abs(v) > 180) v -= Math.round(v / 360) * 360;\n propOut.set(+v);\n }\n }\n },\n subplotid: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(typeof v === 'string' && counterRegex(dflt).test(v)) {\n propOut.set(v);\n return;\n }\n propOut.set(dflt);\n },\n validateFunction: function(v, opts) {\n var dflt = opts.dflt;\n\n if(v === dflt) return true;\n if(typeof v !== 'string') return false;\n if(counterRegex(dflt).test(v)) return true;\n\n return false;\n }\n },\n flaglist: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(typeof v !== 'string') {\n propOut.set(dflt);\n return;\n }\n if((opts.extras || []).indexOf(v) !== -1) {\n propOut.set(v);\n return;\n }\n var vParts = v.split('+'),\n i = 0;\n while(i < vParts.length) {\n var vi = vParts[i];\n if(opts.flags.indexOf(vi) === -1 || vParts.indexOf(vi) < i) {\n vParts.splice(i, 1);\n }\n else i++;\n }\n if(!vParts.length) propOut.set(dflt);\n else propOut.set(vParts.join('+'));\n }\n },\n any: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(v === undefined) propOut.set(dflt);\n else propOut.set(v);\n }\n },\n info_array: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(!Array.isArray(v)) {\n propOut.set(dflt);\n return;\n }\n\n var items = opts.items,\n vOut = [];\n dflt = Array.isArray(dflt) ? dflt : [];\n\n for(var i = 0; i < items.length; i++) {\n exports.coerce(v, vOut, items, '[' + i + ']', dflt[i]);\n }\n\n propOut.set(vOut);\n },\n validateFunction: function(v, opts) {\n if(!Array.isArray(v)) return false;\n\n var items = opts.items;\n\n // when free length is off, input and declared lengths must match\n if(!opts.freeLength && v.length !== items.length) return false;\n\n // valid when all input items are valid\n for(var i = 0; i < v.length; i++) {\n var isItemValid = exports.validate(v[i], opts.items[i]);\n\n if(!isItemValid) return false;\n }\n\n return true;\n }\n }\n};\n\n/**\n * Ensures that container[attribute] has a valid value.\n *\n * attributes[attribute] is an object with possible keys:\n * - valType: data_array, enumerated, boolean, ... as in valObjectMeta\n * - values: (enumerated only) array of allowed vals\n * - min, max: (number, integer only) inclusive bounds on allowed vals\n * either or both may be omitted\n * - dflt: if attribute is invalid or missing, use this default\n * if dflt is provided as an argument to lib.coerce it takes precedence\n * as a convenience, returns the value it finally set\n */\nexports.coerce = function(containerIn, containerOut, attributes, attribute, dflt) {\n var opts = nestedProperty(attributes, attribute).get(),\n propIn = nestedProperty(containerIn, attribute),\n propOut = nestedProperty(containerOut, attribute),\n v = propIn.get();\n\n if(dflt === undefined) dflt = opts.dflt;\n\n /**\n * arrayOk: value MAY be an array, then we do no value checking\n * at this point, because it can be more complicated than the\n * individual form (eg. some array vals can be numbers, even if the\n * single values must be color strings)\n */\n if(opts.arrayOk && Array.isArray(v)) {\n propOut.set(v);\n return v;\n }\n\n exports.valObjectMeta[opts.valType].coerceFunction(v, propOut, dflt, opts);\n\n return propOut.get();\n};\n\n/**\n * Variation on coerce\n *\n * Uses coerce to get attribute value if user input is valid,\n * returns attribute default if user input it not valid or\n * returns false if there is no user input.\n */\nexports.coerce2 = function(containerIn, containerOut, attributes, attribute, dflt) {\n var propIn = nestedProperty(containerIn, attribute),\n propOut = exports.coerce(containerIn, containerOut, attributes, attribute, dflt),\n valIn = propIn.get();\n\n return (valIn !== undefined && valIn !== null) ? propOut : false;\n};\n\n/*\n * Shortcut to coerce the three font attributes\n *\n * 'coerce' is a lib.coerce wrapper with implied first three arguments\n */\nexports.coerceFont = function(coerce, attr, dfltObj) {\n var out = {};\n\n dfltObj = dfltObj || {};\n\n out.family = coerce(attr + '.family', dfltObj.family);\n out.size = coerce(attr + '.size', dfltObj.size);\n out.color = coerce(attr + '.color', dfltObj.color);\n\n return out;\n};\n\n/** Coerce shortcut for 'hoverinfo'\n * handling 1-vs-multi-trace dflt logic\n *\n * @param {object} traceIn : user trace object\n * @param {object} traceOut : full trace object (requires _module ref)\n * @param {object} layoutOut : full layout object (require _dataLength ref)\n * @return {any} : the coerced value\n */\nexports.coerceHoverinfo = function(traceIn, traceOut, layoutOut) {\n var moduleAttrs = traceOut._module.attributes;\n var attrs = moduleAttrs.hoverinfo ?\n {hoverinfo: moduleAttrs.hoverinfo} :\n baseTraceAttrs;\n\n var valObj = attrs.hoverinfo;\n var dflt;\n\n if(layoutOut._dataLength === 1) {\n var flags = valObj.dflt === 'all' ?\n valObj.flags.slice() :\n valObj.dflt.split('+');\n\n flags.splice(flags.indexOf('name'), 1);\n dflt = flags.join('+');\n }\n\n return exports.coerce(traceIn, traceOut, attrs, 'hoverinfo', dflt);\n};\n\nexports.validate = function(value, opts) {\n var valObjectDef = exports.valObjectMeta[opts.valType];\n\n if(opts.arrayOk && Array.isArray(value)) return true;\n\n if(valObjectDef.validateFunction) {\n return valObjectDef.validateFunction(value, opts);\n }\n\n var failed = {},\n out = failed,\n propMock = { set: function(v) { out = v; } };\n\n // 'failed' just something mutable that won't be === anything else\n\n valObjectDef.coerceFunction(value, propMock, failed, opts);\n return out !== failed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/coerce.js\n// module id = 375\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar logError = require('./loggers').error;\nvar mod = require('./mod');\n\nvar constants = require('../constants/numerical');\nvar BADNUM = constants.BADNUM;\nvar ONEDAY = constants.ONEDAY;\nvar ONEHOUR = constants.ONEHOUR;\nvar ONEMIN = constants.ONEMIN;\nvar ONESEC = constants.ONESEC;\nvar EPOCHJD = constants.EPOCHJD;\n\nvar Registry = require('../registry');\n\nvar utcFormat = d3.time.format.utc;\n\nvar DATETIME_REGEXP = /^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\d)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m;\n// special regex for chinese calendars to support yyyy-mmi-dd etc for intercalary months\nvar DATETIME_REGEXP_CN = /^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\di?)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m;\n\n// for 2-digit years, the first year we map them onto\nvar YFIRST = new Date().getFullYear() - 70;\n\nfunction isWorldCalendar(calendar) {\n return (\n calendar &&\n Registry.componentsRegistry.calendars &&\n typeof calendar === 'string' && calendar !== 'gregorian'\n );\n}\n\n/*\n * dateTick0: get the canonical tick for this calendar\n *\n * bool sunday is for week ticks, shift it to a Sunday.\n */\nexports.dateTick0 = function(calendar, sunday) {\n if(isWorldCalendar(calendar)) {\n return sunday ?\n Registry.getComponentMethod('calendars', 'CANONICAL_SUNDAY')[calendar] :\n Registry.getComponentMethod('calendars', 'CANONICAL_TICK')[calendar];\n }\n else {\n return sunday ? '2000-01-02' : '2000-01-01';\n }\n};\n\n/*\n * dfltRange: for each calendar, give a valid default range\n */\nexports.dfltRange = function(calendar) {\n if(isWorldCalendar(calendar)) {\n return Registry.getComponentMethod('calendars', 'DFLTRANGE')[calendar];\n }\n else {\n return ['2000-01-01', '2001-01-01'];\n }\n};\n\n// is an object a javascript date?\nexports.isJSDate = function(v) {\n return typeof v === 'object' && v !== null && typeof v.getTime === 'function';\n};\n\n// The absolute limits of our date-time system\n// This is a little weird: we use MIN_MS and MAX_MS in dateTime2ms\n// but we use dateTime2ms to calculate them (after defining it!)\nvar MIN_MS, MAX_MS;\n\n/**\n * dateTime2ms - turn a date object or string s into milliseconds\n * (relative to 1970-01-01, per javascript standard)\n * optional calendar (string) to use a non-gregorian calendar\n *\n * Returns BADNUM if it doesn't find a date\n *\n * strings should have the form:\n *\n * -?YYYY-mm-ddHH:MM:SS.sss?\n *\n * : space (our normal standard) or T or t (ISO-8601)\n * : Z, z, or [+\\-]HH:?MM and we THROW IT AWAY\n * this format comes from https://tools.ietf.org/html/rfc3339#section-5.6\n * but we allow it even with a space as the separator\n *\n * May truncate after any full field, and sss can be any length\n * even >3 digits, though javascript dates truncate to milliseconds,\n * we keep as much as javascript numeric precision can hold, but we only\n * report back up to 100 microsecond precision, because most dates support\n * this precision (close to 1970 support more, very far away support less)\n *\n * Expanded to support negative years to -9999 but you must always\n * give 4 digits, except for 2-digit positive years which we assume are\n * near the present time.\n * Note that we follow ISO 8601:2004: there *is* a year 0, which\n * is 1BC/BCE, and -1===2BC etc.\n *\n * World calendars: not all of these *have* agreed extensions to this full range,\n * if you have another calendar system but want a date range outside its validity,\n * you can use a gregorian date string prefixed with 'G' or 'g'.\n *\n * Where to cut off 2-digit years between 1900s and 2000s?\n * from http://support.microsoft.com/kb/244664:\n * 1930-2029 (the most retro of all...)\n * but in my mac chrome from eg. d=new Date(Date.parse('8/19/50')):\n * 1950-2049\n * by Java, from http://stackoverflow.com/questions/2024273/:\n * now-80 - now+19\n * or FileMaker Pro, from\n * http://www.filemaker.com/12help/html/add_view_data.4.21.html:\n * now-70 - now+29\n * but python strptime etc, via\n * http://docs.python.org/py3k/library/time.html:\n * 1969-2068 (super forward-looking, but static, not sliding!)\n *\n * lets go with now-70 to now+29, and if anyone runs into this problem\n * they can learn the hard way not to use 2-digit years, as no choice we\n * make now will cover all possibilities. mostly this will all be taken\n * care of in initial parsing, should only be an issue for hand-entered data\n * currently (2016) this range is:\n * 1946-2045\n */\nexports.dateTime2ms = function(s, calendar) {\n // first check if s is a date object\n if(exports.isJSDate(s)) {\n // Convert to the UTC milliseconds that give the same\n // hours as this date has in the local timezone\n s = Number(s) - s.getTimezoneOffset() * ONEMIN;\n if(s >= MIN_MS && s <= MAX_MS) return s;\n return BADNUM;\n }\n // otherwise only accept strings and numbers\n if(typeof s !== 'string' && typeof s !== 'number') return BADNUM;\n\n s = String(s);\n\n var isWorld = isWorldCalendar(calendar);\n\n // to handle out-of-range dates in international calendars, accept\n // 'G' as a prefix to force the built-in gregorian calendar.\n var s0 = s.charAt(0);\n if(isWorld && (s0 === 'G' || s0 === 'g')) {\n s = s.substr(1);\n calendar = '';\n }\n\n var isChinese = isWorld && calendar.substr(0, 7) === 'chinese';\n\n var match = s.match(isChinese ? DATETIME_REGEXP_CN : DATETIME_REGEXP);\n if(!match) return BADNUM;\n var y = match[1],\n m = match[3] || '1',\n d = Number(match[5] || 1),\n H = Number(match[7] || 0),\n M = Number(match[9] || 0),\n S = Number(match[11] || 0);\n\n if(isWorld) {\n // disallow 2-digit years for world calendars\n if(y.length === 2) return BADNUM;\n y = Number(y);\n\n var cDate;\n try {\n var calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar);\n if(isChinese) {\n var isIntercalary = m.charAt(m.length - 1) === 'i';\n m = parseInt(m, 10);\n cDate = calInstance.newDate(y, calInstance.toMonthIndex(y, m, isIntercalary), d);\n }\n else {\n cDate = calInstance.newDate(y, Number(m), d);\n }\n }\n catch(e) { return BADNUM; } // Invalid ... date\n\n if(!cDate) return BADNUM;\n\n return ((cDate.toJD() - EPOCHJD) * ONEDAY) +\n (H * ONEHOUR) + (M * ONEMIN) + (S * ONESEC);\n }\n\n if(y.length === 2) {\n y = (Number(y) + 2000 - YFIRST) % 100 + YFIRST;\n }\n else y = Number(y);\n\n // new Date uses months from 0; subtract 1 here just so we\n // don't have to do it again during the validity test below\n m -= 1;\n\n // javascript takes new Date(0..99,m,d) to mean 1900-1999, so\n // to support years 0-99 we need to use setFullYear explicitly\n // Note that 2000 is a leap year.\n var date = new Date(Date.UTC(2000, m, d, H, M));\n date.setUTCFullYear(y);\n\n if(date.getUTCMonth() !== m) return BADNUM;\n if(date.getUTCDate() !== d) return BADNUM;\n\n return date.getTime() + S * ONESEC;\n};\n\nMIN_MS = exports.MIN_MS = exports.dateTime2ms('-9999');\nMAX_MS = exports.MAX_MS = exports.dateTime2ms('9999-12-31 23:59:59.9999');\n\n// is string s a date? (see above)\nexports.isDateTime = function(s, calendar) {\n return (exports.dateTime2ms(s, calendar) !== BADNUM);\n};\n\n// pad a number with zeroes, to given # of digits before the decimal point\nfunction lpad(val, digits) {\n return String(val + Math.pow(10, digits)).substr(1);\n}\n\n/**\n * Turn ms into string of the form YYYY-mm-dd HH:MM:SS.ssss\n * Crop any trailing zeros in time, except never stop right after hours\n * (we could choose to crop '-01' from date too but for now we always\n * show the whole date)\n * Optional range r is the data range that applies, also in ms.\n * If rng is big, the later parts of time will be omitted\n */\nvar NINETYDAYS = 90 * ONEDAY;\nvar THREEHOURS = 3 * ONEHOUR;\nvar FIVEMIN = 5 * ONEMIN;\nexports.ms2DateTime = function(ms, r, calendar) {\n if(typeof ms !== 'number' || !(ms >= MIN_MS && ms <= MAX_MS)) return BADNUM;\n\n if(!r) r = 0;\n\n var msecTenths = Math.floor(mod(ms + 0.05, 1) * 10),\n msRounded = Math.round(ms - msecTenths / 10),\n dateStr, h, m, s, msec10, d;\n\n if(isWorldCalendar(calendar)) {\n var dateJD = Math.floor(msRounded / ONEDAY) + EPOCHJD,\n timeMs = Math.floor(mod(ms, ONEDAY));\n try {\n dateStr = Registry.getComponentMethod('calendars', 'getCal')(calendar)\n .fromJD(dateJD).formatDate('yyyy-mm-dd');\n }\n catch(e) {\n // invalid date in this calendar - fall back to Gyyyy-mm-dd\n dateStr = utcFormat('G%Y-%m-%d')(new Date(msRounded));\n }\n\n // yyyy does NOT guarantee 4-digit years. YYYY mostly does, but does\n // other things for a few calendars, so we can't trust it. Just pad\n // it manually (after the '-' if there is one)\n if(dateStr.charAt(0) === '-') {\n while(dateStr.length < 11) dateStr = '-0' + dateStr.substr(1);\n }\n else {\n while(dateStr.length < 10) dateStr = '0' + dateStr;\n }\n\n // TODO: if this is faster, we could use this block for extracting\n // the time components of regular gregorian too\n h = (r < NINETYDAYS) ? Math.floor(timeMs / ONEHOUR) : 0;\n m = (r < NINETYDAYS) ? Math.floor((timeMs % ONEHOUR) / ONEMIN) : 0;\n s = (r < THREEHOURS) ? Math.floor((timeMs % ONEMIN) / ONESEC) : 0;\n msec10 = (r < FIVEMIN) ? (timeMs % ONESEC) * 10 + msecTenths : 0;\n }\n else {\n d = new Date(msRounded);\n\n dateStr = utcFormat('%Y-%m-%d')(d);\n\n // <90 days: add hours and minutes - never *only* add hours\n h = (r < NINETYDAYS) ? d.getUTCHours() : 0;\n m = (r < NINETYDAYS) ? d.getUTCMinutes() : 0;\n // <3 hours: add seconds\n s = (r < THREEHOURS) ? d.getUTCSeconds() : 0;\n // <5 minutes: add ms (plus one extra digit, this is msec*10)\n msec10 = (r < FIVEMIN) ? d.getUTCMilliseconds() * 10 + msecTenths : 0;\n }\n\n return includeTime(dateStr, h, m, s, msec10);\n};\n\n// For converting old-style milliseconds to date strings,\n// we use the local timezone rather than UTC like we use\n// everywhere else, both for backward compatibility and\n// because that's how people mostly use javasript date objects.\n// Clip one extra day off our date range though so we can't get\n// thrown beyond the range by the timezone shift.\nexports.ms2DateTimeLocal = function(ms) {\n if(!(ms >= MIN_MS + ONEDAY && ms <= MAX_MS - ONEDAY)) return BADNUM;\n\n var msecTenths = Math.floor(mod(ms + 0.05, 1) * 10),\n d = new Date(Math.round(ms - msecTenths / 10)),\n dateStr = d3.time.format('%Y-%m-%d')(d),\n h = d.getHours(),\n m = d.getMinutes(),\n s = d.getSeconds(),\n msec10 = d.getUTCMilliseconds() * 10 + msecTenths;\n\n return includeTime(dateStr, h, m, s, msec10);\n};\n\nfunction includeTime(dateStr, h, m, s, msec10) {\n // include each part that has nonzero data in or after it\n if(h || m || s || msec10) {\n dateStr += ' ' + lpad(h, 2) + ':' + lpad(m, 2);\n if(s || msec10) {\n dateStr += ':' + lpad(s, 2);\n if(msec10) {\n var digits = 4;\n while(msec10 % 10 === 0) {\n digits -= 1;\n msec10 /= 10;\n }\n dateStr += '.' + lpad(msec10, digits);\n }\n }\n }\n return dateStr;\n}\n\n// normalize date format to date string, in case it starts as\n// a Date object or milliseconds\n// optional dflt is the return value if cleaning fails\nexports.cleanDate = function(v, dflt, calendar) {\n if(exports.isJSDate(v) || typeof v === 'number') {\n // do not allow milliseconds (old) or jsdate objects (inherently\n // described as gregorian dates) with world calendars\n if(isWorldCalendar(calendar)) {\n logError('JS Dates and milliseconds are incompatible with world calendars', v);\n return dflt;\n }\n\n // NOTE: if someone puts in a year as a number rather than a string,\n // this will mistakenly convert it thinking it's milliseconds from 1970\n // that is: '2012' -> Jan. 1, 2012, but 2012 -> 2012 epoch milliseconds\n v = exports.ms2DateTimeLocal(+v);\n if(!v && dflt !== undefined) return dflt;\n }\n else if(!exports.isDateTime(v, calendar)) {\n logError('unrecognized date', v);\n return dflt;\n }\n return v;\n};\n\n/*\n * Date formatting for ticks and hovertext\n */\n\n/*\n * modDateFormat: Support world calendars, and add one item to\n * d3's vocabulary:\n * %{n}f where n is the max number of digits of fractional seconds\n */\nvar fracMatch = /%\\d?f/g;\nfunction modDateFormat(fmt, x, calendar) {\n\n fmt = fmt.replace(fracMatch, function(match) {\n var digits = Math.min(+(match.charAt(1)) || 6, 6),\n fracSecs = ((x / 1000 % 1) + 2)\n .toFixed(digits)\n .substr(2).replace(/0+$/, '') || '0';\n return fracSecs;\n });\n\n var d = new Date(Math.floor(x + 0.05));\n\n if(isWorldCalendar(calendar)) {\n try {\n fmt = Registry.getComponentMethod('calendars', 'worldCalFmt')(fmt, x, calendar);\n }\n catch(e) {\n return 'Invalid';\n }\n }\n return utcFormat(fmt)(d);\n}\n\n/*\n * formatTime: create a time string from:\n * x: milliseconds\n * tr: tickround ('M', 'S', or # digits)\n * only supports UTC times (where every day is 24 hours and 0 is at midnight)\n */\nvar MAXSECONDS = [59, 59.9, 59.99, 59.999, 59.9999];\nfunction formatTime(x, tr) {\n var timePart = mod(x + 0.05, ONEDAY);\n\n var timeStr = lpad(Math.floor(timePart / ONEHOUR), 2) + ':' +\n lpad(mod(Math.floor(timePart / ONEMIN), 60), 2);\n\n if(tr !== 'M') {\n if(!isNumeric(tr)) tr = 0; // should only be 'S'\n\n /*\n * this is a weird one - and shouldn't come up unless people\n * monkey with tick0 in weird ways, but we need to do something!\n * IN PARTICULAR we had better not display garbage (see below)\n * for numbers we always round to the nearest increment of the\n * precision we're showing, and this seems like the right way to\n * handle seconds and milliseconds, as they have a decimal point\n * and people will interpret that to mean rounding like numbers.\n * but for larger increments we floor the value: it's always\n * 2013 until the ball drops on the new year. We could argue about\n * which field it is where we start rounding (should 12:08:59\n * round to 12:09 if we're stopping at minutes?) but for now I'll\n * say we round seconds but floor everything else. BUT that means\n * we need to never round up to 60 seconds, ie 23:59:60\n */\n var sec = Math.min(mod(x / ONESEC, 60), MAXSECONDS[tr]);\n\n var secStr = (100 + sec).toFixed(tr).substr(1);\n if(tr > 0) {\n secStr = secStr.replace(/0+$/, '').replace(/[\\.]$/, '');\n }\n\n timeStr += ':' + secStr;\n }\n return timeStr;\n}\n\nvar yearFormat = utcFormat('%Y'),\n monthFormat = utcFormat('%b %Y'),\n dayFormat = utcFormat('%b %-d'),\n yearMonthDayFormat = utcFormat('%b %-d, %Y');\n\nfunction yearFormatWorld(cDate) { return cDate.formatDate('yyyy'); }\nfunction monthFormatWorld(cDate) { return cDate.formatDate('M yyyy'); }\nfunction dayFormatWorld(cDate) { return cDate.formatDate('M d'); }\nfunction yearMonthDayFormatWorld(cDate) { return cDate.formatDate('M d, yyyy'); }\n\n/*\n * formatDate: turn a date into tick or hover label text.\n *\n * x: milliseconds, the value to convert\n * fmt: optional, an explicit format string (d3 format, even for world calendars)\n * tr: tickround ('y', 'm', 'd', 'M', 'S', or # digits)\n * used if no explicit fmt is provided\n * calendar: optional string, the world calendar system to use\n *\n * returns the date/time as a string, potentially with the leading portion\n * on a separate line (after '\\n')\n * Note that this means if you provide an explicit format which includes '\\n'\n * the axis may choose to strip things after it when they don't change from\n * one tick to the next (as it does with automatic formatting)\n */\nexports.formatDate = function(x, fmt, tr, calendar) {\n var headStr,\n dateStr;\n\n calendar = isWorldCalendar(calendar) && calendar;\n\n if(fmt) return modDateFormat(fmt, x, calendar);\n\n if(calendar) {\n try {\n var dateJD = Math.floor((x + 0.05) / ONEDAY) + EPOCHJD,\n cDate = Registry.getComponentMethod('calendars', 'getCal')(calendar)\n .fromJD(dateJD);\n\n if(tr === 'y') dateStr = yearFormatWorld(cDate);\n else if(tr === 'm') dateStr = monthFormatWorld(cDate);\n else if(tr === 'd') {\n headStr = yearFormatWorld(cDate);\n dateStr = dayFormatWorld(cDate);\n }\n else {\n headStr = yearMonthDayFormatWorld(cDate);\n dateStr = formatTime(x, tr);\n }\n }\n catch(e) { return 'Invalid'; }\n }\n else {\n var d = new Date(Math.floor(x + 0.05));\n\n if(tr === 'y') dateStr = yearFormat(d);\n else if(tr === 'm') dateStr = monthFormat(d);\n else if(tr === 'd') {\n headStr = yearFormat(d);\n dateStr = dayFormat(d);\n }\n else {\n headStr = yearMonthDayFormat(d);\n dateStr = formatTime(x, tr);\n }\n }\n\n return dateStr + (headStr ? '\\n' + headStr : '');\n};\n\n/*\n * incrementMonth: make a new milliseconds value from the given one,\n * having changed the month\n *\n * special case for world calendars: multiples of 12 are treated as years,\n * even for calendar systems that don't have (always or ever) 12 months/year\n * TODO: perhaps we need a different code for year increments to support this?\n *\n * ms (number): the initial millisecond value\n * dMonth (int): the (signed) number of months to shift\n * calendar (string): the calendar system to use\n *\n * changing month does not (and CANNOT) always preserve day, since\n * months have different lengths. The worst example of this is:\n * d = new Date(1970,0,31); d.setMonth(1) -> Feb 31 turns into Mar 3\n *\n * But we want to be able to iterate over the last day of each month,\n * regardless of what its number is.\n * So shift 3 days forward, THEN set the new month, then unshift:\n * 1/31 -> 2/28 (or 29) -> 3/31 -> 4/30 -> ...\n *\n * Note that odd behavior still exists if you start from the 26th-28th:\n * 1/28 -> 2/28 -> 3/31\n * but at least you can't shift any dates into the wrong month,\n * and ticks on these days incrementing by month would be very unusual\n */\nvar THREEDAYS = 3 * ONEDAY;\nexports.incrementMonth = function(ms, dMonth, calendar) {\n calendar = isWorldCalendar(calendar) && calendar;\n\n // pull time out and operate on pure dates, then add time back at the end\n // this gives maximum precision - not that we *normally* care if we're\n // incrementing by month, but better to be safe!\n var timeMs = mod(ms, ONEDAY);\n ms = Math.round(ms - timeMs);\n\n if(calendar) {\n try {\n var dateJD = Math.round(ms / ONEDAY) + EPOCHJD,\n calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar),\n cDate = calInstance.fromJD(dateJD);\n\n if(dMonth % 12) calInstance.add(cDate, dMonth, 'm');\n else calInstance.add(cDate, dMonth / 12, 'y');\n\n return (cDate.toJD() - EPOCHJD) * ONEDAY + timeMs;\n }\n catch(e) {\n logError('invalid ms ' + ms + ' in calendar ' + calendar);\n // then keep going in gregorian even though the result will be 'Invalid'\n }\n }\n\n var y = new Date(ms + THREEDAYS);\n return y.setUTCMonth(y.getUTCMonth() + dMonth) + timeMs - THREEDAYS;\n};\n\n/*\n * findExactDates: what fraction of data is exact days, months, or years?\n *\n * data: array of millisecond values\n * calendar (string) the calendar to test against\n */\nexports.findExactDates = function(data, calendar) {\n var exactYears = 0,\n exactMonths = 0,\n exactDays = 0,\n blankCount = 0,\n d,\n di;\n\n var calInstance = (\n isWorldCalendar(calendar) &&\n Registry.getComponentMethod('calendars', 'getCal')(calendar)\n );\n\n for(var i = 0; i < data.length; i++) {\n di = data[i];\n\n // not date data at all\n if(!isNumeric(di)) {\n blankCount ++;\n continue;\n }\n\n // not an exact date\n if(di % ONEDAY) continue;\n\n if(calInstance) {\n try {\n d = calInstance.fromJD(di / ONEDAY + EPOCHJD);\n if(d.day() === 1) {\n if(d.month() === 1) exactYears++;\n else exactMonths++;\n }\n else exactDays++;\n }\n catch(e) {\n // invalid date in this calendar - ignore it here.\n }\n }\n else {\n d = new Date(di);\n if(d.getUTCDate() === 1) {\n if(d.getUTCMonth() === 0) exactYears++;\n else exactMonths++;\n }\n else exactDays++;\n }\n }\n exactMonths += exactYears;\n exactDays += exactMonths;\n\n var dataCount = data.length - blankCount;\n\n return {\n exactYears: exactYears / dataCount,\n exactMonths: exactMonths / dataCount,\n exactDays: exactDays / dataCount\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/dates.js\n// module id = 376\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\n\n/**\n * aggNums() returns the result of an aggregate function applied to an array of\n * values, where non-numerical values have been tossed out.\n *\n * @param {function} f - aggregation function (e.g., Math.min)\n * @param {Number} v - initial value (continuing from previous calls)\n * if there's no continuing value, use null for selector-type\n * functions (max,min), or 0 for summations\n * @param {Array} a - array to aggregate (may be nested, we will recurse,\n * but all elements must have the same dimension)\n * @param {Number} len - maximum length of a to aggregate\n * @return {Number} - result of f applied to a starting from v\n */\nexports.aggNums = function(f, v, a, len) {\n var i,\n b;\n if(!len) len = a.length;\n if(!isNumeric(v)) v = false;\n if(Array.isArray(a[0])) {\n b = new Array(len);\n for(i = 0; i < len; i++) b[i] = exports.aggNums(f, v, a[i]);\n a = b;\n }\n\n for(i = 0; i < len; i++) {\n if(!isNumeric(v)) v = a[i];\n else if(isNumeric(a[i])) v = f(+v, +a[i]);\n }\n return v;\n};\n\n/**\n * mean & std dev functions using aggNums, so it handles non-numerics nicely\n * even need to use aggNums instead of .length, to toss out non-numerics\n */\nexports.len = function(data) {\n return exports.aggNums(function(a) { return a + 1; }, 0, data);\n};\n\nexports.mean = function(data, len) {\n if(!len) len = exports.len(data);\n return exports.aggNums(function(a, b) { return a + b; }, 0, data) / len;\n};\n\nexports.variance = function(data, len, mean) {\n if(!len) len = exports.len(data);\n if(!isNumeric(mean)) mean = exports.mean(data, len);\n\n return exports.aggNums(function(a, b) {\n return a + Math.pow(b - mean, 2);\n }, 0, data) / len;\n};\n\nexports.stdev = function(data, len, mean) {\n return Math.sqrt(exports.variance(data, len, mean));\n};\n\n/**\n * interp() computes a percentile (quantile) for a given distribution.\n * We interpolate the distribution (to compute quantiles, we follow method #10 here:\n * http://www.amstat.org/publications/jse/v14n3/langford.html).\n * Typically the index or rank (n * arr.length) may be non-integer.\n * For reference: ends are clipped to the extreme values in the array;\n * For box plots: index you get is half a point too high (see\n * http://en.wikipedia.org/wiki/Percentile#Nearest_rank) but note that this definition\n * indexes from 1 rather than 0, so we subtract 1/2 (instead of add).\n *\n * @param {Array} arr - This array contains the values that make up the distribution.\n * @param {Number} n - Between 0 and 1, n = p/100 is such that we compute the p^th percentile.\n * For example, the 50th percentile (or median) corresponds to n = 0.5\n * @return {Number} - percentile\n */\nexports.interp = function(arr, n) {\n if(!isNumeric(n)) throw 'n should be a finite number';\n n = n * arr.length - 0.5;\n if(n < 0) return arr[0];\n if(n > arr.length - 1) return arr[arr.length - 1];\n var frac = n % 1;\n return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)];\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/stats.js\n// module id = 377\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar mod = require('./mod');\n\n/*\n * look for intersection of two line segments\n * (1->2 and 3->4) - returns array [x,y] if they do, null if not\n */\nexports.segmentsIntersect = segmentsIntersect;\nfunction segmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n var a = x2 - x1,\n b = x3 - x1,\n c = x4 - x3,\n d = y2 - y1,\n e = y3 - y1,\n f = y4 - y3,\n det = a * f - c * d;\n // parallel lines? intersection is undefined\n // ignore the case where they are colinear\n if(det === 0) return null;\n var t = (b * f - c * e) / det,\n u = (b * d - a * e) / det;\n // segments do not intersect?\n if(u < 0 || u > 1 || t < 0 || t > 1) return null;\n\n return {x: x1 + a * t, y: y1 + d * t};\n}\n\n/*\n * find the minimum distance between two line segments (1->2 and 3->4)\n */\nexports.segmentDistance = function segmentDistance(x1, y1, x2, y2, x3, y3, x4, y4) {\n if(segmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4)) return 0;\n\n // the two segments and their lengths squared\n var x12 = x2 - x1;\n var y12 = y2 - y1;\n var x34 = x4 - x3;\n var y34 = y4 - y3;\n var l2_12 = x12 * x12 + y12 * y12;\n var l2_34 = x34 * x34 + y34 * y34;\n\n // calculate distance squared, then take the sqrt at the very end\n var dist2 = Math.min(\n perpDistance2(x12, y12, l2_12, x3 - x1, y3 - y1),\n perpDistance2(x12, y12, l2_12, x4 - x1, y4 - y1),\n perpDistance2(x34, y34, l2_34, x1 - x3, y1 - y3),\n perpDistance2(x34, y34, l2_34, x2 - x3, y2 - y3)\n );\n\n return Math.sqrt(dist2);\n};\n\n/*\n * distance squared from segment ab to point c\n * [xab, yab] is the vector b-a\n * [xac, yac] is the vector c-a\n * l2_ab is the length squared of (b-a), just to simplify calculation\n */\nfunction perpDistance2(xab, yab, l2_ab, xac, yac) {\n var fc_ab = (xac * xab + yac * yab);\n if(fc_ab < 0) {\n // point c is closer to point a\n return xac * xac + yac * yac;\n }\n else if(fc_ab > l2_ab) {\n // point c is closer to point b\n var xbc = xac - xab;\n var ybc = yac - yab;\n return xbc * xbc + ybc * ybc;\n }\n else {\n // perpendicular distance is the shortest\n var crossProduct = xac * yab - yac * xab;\n return crossProduct * crossProduct / l2_ab;\n }\n}\n\n// a very short-term cache for getTextLocation, just because\n// we're often looping over the same locations multiple times\n// invalidated as soon as we look at a different path\nvar locationCache, workingPath, workingTextWidth;\n\n// turn a path and position along it into x, y, and angle for the given text\nexports.getTextLocation = function getTextLocation(path, totalPathLen, positionOnPath, textWidth) {\n if(path !== workingPath || textWidth !== workingTextWidth) {\n locationCache = {};\n workingPath = path;\n workingTextWidth = textWidth;\n }\n if(locationCache[positionOnPath]) {\n return locationCache[positionOnPath];\n }\n\n // for the angle, use points on the path separated by the text width\n // even though due to curvature, the text will cover a bit more than that\n var p0 = path.getPointAtLength(mod(positionOnPath - textWidth / 2, totalPathLen));\n var p1 = path.getPointAtLength(mod(positionOnPath + textWidth / 2, totalPathLen));\n // note: atan handles 1/0 nicely\n var theta = Math.atan((p1.y - p0.y) / (p1.x - p0.x));\n // center the text at 2/3 of the center position plus 1/3 the p0/p1 midpoint\n // that's the average position of this segment, assuming it's roughly quadratic\n var pCenter = path.getPointAtLength(mod(positionOnPath, totalPathLen));\n var x = (pCenter.x * 4 + p0.x + p1.x) / 6;\n var y = (pCenter.y * 4 + p0.y + p1.y) / 6;\n\n var out = {x: x, y: y, theta: theta};\n locationCache[positionOnPath] = out;\n return out;\n};\n\nexports.clearLocationCache = function() {\n workingPath = null;\n};\n\n/*\n * Find the segment of `path` that's within the visible area\n * given by `bounds` {left, right, top, bottom}, to within a\n * precision of `buffer` px\n *\n * returns: undefined if nothing is visible, else object:\n * {\n * min: position where the path first enters bounds, or 0 if it\n * starts within bounds\n * max: position where the path last exits bounds, or the path length\n * if it finishes within bounds\n * len: max - min, ie the length of visible path\n * total: the total path length - just included so the caller doesn't\n * need to call path.getTotalLength() again\n * isClosed: true iff the start and end points of the path are both visible\n * and are at the same point\n * }\n *\n * Works by starting from either end and repeatedly finding the distance from\n * that point to the plot area, and if it's outside the plot, moving along the\n * path by that distance (because the plot must be at least that far away on\n * the path). Note that if a path enters, exits, and re-enters the plot, we\n * will not capture this behavior.\n */\nexports.getVisibleSegment = function getVisibleSegment(path, bounds, buffer) {\n var left = bounds.left;\n var right = bounds.right;\n var top = bounds.top;\n var bottom = bounds.bottom;\n\n var pMin = 0;\n var pTotal = path.getTotalLength();\n var pMax = pTotal;\n\n var pt0, ptTotal;\n\n function getDistToPlot(len) {\n var pt = path.getPointAtLength(len);\n\n // hold on to the start and end points for `closed`\n if(len === 0) pt0 = pt;\n else if(len === pTotal) ptTotal = pt;\n\n var dx = (pt.x < left) ? left - pt.x : (pt.x > right ? pt.x - right : 0);\n var dy = (pt.y < top) ? top - pt.y : (pt.y > bottom ? pt.y - bottom : 0);\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n var distToPlot = getDistToPlot(pMin);\n while(distToPlot) {\n pMin += distToPlot + buffer;\n if(pMin > pMax) return;\n distToPlot = getDistToPlot(pMin);\n }\n\n distToPlot = getDistToPlot(pMax);\n while(distToPlot) {\n pMax -= distToPlot + buffer;\n if(pMin > pMax) return;\n distToPlot = getDistToPlot(pMax);\n }\n\n return {\n min: pMin,\n max: pMax,\n len: pMax - pMin,\n total: pTotal,\n isClosed: pMin === 0 && pMax === pTotal &&\n Math.abs(pt0.x - ptTotal.x) < 0.1 &&\n Math.abs(pt0.y - ptTotal.y) < 0.1\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/geometry2d.js\n// module id = 378\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar NOTEDATA = [];\n\n/**\n * notifier\n * @param {String} text The person's user name\n * @param {Number} [delay=1000] The delay time in milliseconds\n * or 'long' which provides 2000 ms delay time.\n * @return {undefined} this function does not return a value\n */\nmodule.exports = function(text, displayLength) {\n if(NOTEDATA.indexOf(text) !== -1) return;\n\n NOTEDATA.push(text);\n\n var ts = 1000;\n if(isNumeric(displayLength)) ts = displayLength;\n else if(displayLength === 'long') ts = 3000;\n\n var notifierContainer = d3.select('body')\n .selectAll('.plotly-notifier')\n .data([0]);\n notifierContainer.enter()\n .append('div')\n .classed('plotly-notifier', true);\n\n var notes = notifierContainer.selectAll('.notifier-note').data(NOTEDATA);\n\n function killNote(transition) {\n transition\n .duration(700)\n .style('opacity', 0)\n .each('end', function(thisText) {\n var thisIndex = NOTEDATA.indexOf(thisText);\n if(thisIndex !== -1) NOTEDATA.splice(thisIndex, 1);\n d3.select(this).remove();\n });\n }\n\n notes.enter().append('div')\n .classed('notifier-note', true)\n .style('opacity', 0)\n .each(function(thisText) {\n var note = d3.select(this);\n\n note.append('button')\n .classed('notifier-close', true)\n .html('×')\n .on('click', function() {\n note.transition().call(killNote);\n });\n\n var p = note.append('p');\n var lines = thisText.split(//g);\n for(var i = 0; i < lines.length; i++) {\n if(i) p.append('br');\n p.append('span').text(lines[i]);\n }\n\n note.transition()\n .duration(700)\n .style('opacity', 1)\n .transition()\n .delay(ts)\n .call(killNote);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/notifier.js\n// module id = 379\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n/**\n * Return news array containing only the unique items\n * found in input array.\n *\n * IMPORTANT: Note that items are considered unique\n * if `String({})` is unique. For example;\n *\n * Lib.filterUnique([ { a: 1 }, { b: 2 } ])\n *\n * returns [{ a: 1 }]\n *\n * and\n *\n * Lib.filterUnique([ '1', 1 ])\n *\n * returns ['1']\n *\n *\n * @param {array} array base array\n * @return {array} new filtered array\n */\nmodule.exports = function filterUnique(array) {\n var seen = {},\n out = [],\n j = 0;\n\n for(var i = 0; i < array.length; i++) {\n var item = array[i];\n\n if(seen[item] !== 1) {\n seen[item] = 1;\n out[j++] = item;\n }\n }\n\n return out;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/filter_unique.js\n// module id = 380\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/** Filter out object items with visible !== true\n * insider array container.\n *\n * @param {array of objects} container\n * @return {array of objects} of length <= container\n *\n */\nmodule.exports = function filterVisible(container) {\n var out = [];\n\n for(var i = 0; i < container.length; i++) {\n var item = container[i];\n\n if(item.visible === true) out.push(item);\n }\n\n return out;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/filter_visible.js\n// module id = 381\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar BADNUM = require('../constants/numerical').BADNUM;\n\n// precompile for speed\nvar JUNK = /^['\"%,$#\\s']+|[, ]|['\"%,$#\\s']+$/g;\n\n/**\n * cleanNumber: remove common leading and trailing cruft\n * Always returns either a number or BADNUM.\n */\nmodule.exports = function cleanNumber(v) {\n if(typeof v === 'string') {\n v = v.replace(JUNK, '');\n }\n\n if(isNumeric(v)) return Number(v);\n\n return BADNUM;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/clean_number.js\n// module id = 382\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function identity(d) { return d; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/identity.js\n// module id = 383\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = require('../../traces/scatter/attributes');\nvar scatterMarkerAttrs = scatterAttrs.marker;\n\nmodule.exports = {\n r: scatterAttrs.r,\n t: scatterAttrs.t,\n marker: {\n color: scatterMarkerAttrs.color,\n size: scatterMarkerAttrs.size,\n symbol: scatterMarkerAttrs.symbol,\n opacity: scatterMarkerAttrs.opacity,\n editType: 'calc'\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/polar/area_attributes.js\n// module id = 384\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\n\nmodule.exports = function hasColorbar(container) {\n return Lib.isPlainObject(container.colorbar);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorbar/has_colorbar.js\n// module id = 385\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar handleTickValueDefaults = require('../../plots/cartesian/tick_value_defaults');\nvar handleTickMarkDefaults = require('../../plots/cartesian/tick_mark_defaults');\nvar handleTickLabelDefaults = require('../../plots/cartesian/tick_label_defaults');\n\nvar attributes = require('./attributes');\n\n\nmodule.exports = function colorbarDefaults(containerIn, containerOut, layout) {\n var colorbarOut = containerOut.colorbar = {},\n colorbarIn = containerIn.colorbar || {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(colorbarIn, colorbarOut, attributes, attr, dflt);\n }\n\n var thicknessmode = coerce('thicknessmode');\n coerce('thickness', (thicknessmode === 'fraction') ?\n 30 / (layout.width - layout.margin.l - layout.margin.r) :\n 30\n );\n\n var lenmode = coerce('lenmode');\n coerce('len', (lenmode === 'fraction') ?\n 1 :\n layout.height - layout.margin.t - layout.margin.b\n );\n\n coerce('x');\n coerce('xanchor');\n coerce('xpad');\n coerce('y');\n coerce('yanchor');\n coerce('ypad');\n Lib.noneOrAll(colorbarIn, colorbarOut, ['x', 'y']);\n\n coerce('outlinecolor');\n coerce('outlinewidth');\n coerce('bordercolor');\n coerce('borderwidth');\n coerce('bgcolor');\n\n handleTickValueDefaults(colorbarIn, colorbarOut, coerce, 'linear');\n\n handleTickLabelDefaults(colorbarIn, colorbarOut, coerce, 'linear',\n {outerTicks: false, font: layout.font, noHover: true});\n\n handleTickMarkDefaults(colorbarIn, colorbarOut, coerce, 'linear',\n {outerTicks: false, font: layout.font, noHover: true});\n\n coerce('title');\n Lib.coerceFont(coerce, 'titlefont', layout.font);\n coerce('titleside');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorbar/defaults.js\n// module id = 386\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/**\n * Extract colorscale into numeric domain and color range.\n *\n * @param {array} scl colorscale array of arrays\n * @param {number} cmin minimum color value (used to clamp scale)\n * @param {number} cmax maximum color value (used to clamp scale)\n */\nmodule.exports = function extractScale(scl, cmin, cmax) {\n var N = scl.length,\n domain = new Array(N),\n range = new Array(N);\n\n for(var i = 0; i < N; i++) {\n var si = scl[i];\n\n domain[i] = cmin + si[0] * (cmax - cmin);\n range[i] = si[1];\n }\n\n return {\n domain: domain,\n range: range\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/extract_scale.js\n// module id = 387\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar tinycolor = require('tinycolor2');\nvar isNumeric = require('fast-isnumeric');\n\nvar Color = require('../color');\n\n/**\n * General colorscale function generator.\n *\n * @param {object} specs output of Colorscale.extractScale or precomputed domain, range.\n * - domain {array}\n * - range {array}\n *\n * @param {object} opts\n * - noNumericCheck {boolean} if true, scale func bypasses numeric checks\n * - returnArray {boolean} if true, scale func return 4-item array instead of color strings\n *\n * @return {function}\n */\nmodule.exports = function makeColorScaleFunc(specs, opts) {\n opts = opts || {};\n\n var domain = specs.domain,\n range = specs.range,\n N = range.length,\n _range = new Array(N);\n\n for(var i = 0; i < N; i++) {\n var rgba = tinycolor(range[i]).toRgb();\n _range[i] = [rgba.r, rgba.g, rgba.b, rgba.a];\n }\n\n var _sclFunc = d3.scale.linear()\n .domain(domain)\n .range(_range)\n .clamp(true);\n\n var noNumericCheck = opts.noNumericCheck,\n returnArray = opts.returnArray,\n sclFunc;\n\n if(noNumericCheck && returnArray) {\n sclFunc = _sclFunc;\n }\n else if(noNumericCheck) {\n sclFunc = function(v) {\n return colorArray2rbga(_sclFunc(v));\n };\n }\n else if(returnArray) {\n sclFunc = function(v) {\n if(isNumeric(v)) return _sclFunc(v);\n else if(tinycolor(v).isValid()) return v;\n else return Color.defaultLine;\n };\n }\n else {\n sclFunc = function(v) {\n if(isNumeric(v)) return colorArray2rbga(_sclFunc(v));\n else if(tinycolor(v).isValid()) return v;\n else return Color.defaultLine;\n };\n }\n\n // colorbar draw looks into the d3 scale closure for domain and range\n\n sclFunc.domain = _sclFunc.domain;\n\n sclFunc.range = function() { return range; };\n\n return sclFunc;\n};\n\nfunction colorArray2rbga(colorArray) {\n var colorObj = {\n r: colorArray[0],\n g: colorArray[1],\n b: colorArray[2],\n a: colorArray[3]\n };\n\n return tinycolor(colorObj).toRgbString();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorscale/make_color_scale_func.js\n// module id = 388\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// N.B. HTML entities are listed without the leading '&' and trailing ';'\n// https://www.freeformatter.com/html-entities.html\n\nmodule.exports = {\n entityToUnicode: {\n 'mu': 'μ',\n '#956': 'μ',\n\n 'amp': '&',\n '#28': '&',\n\n 'lt': '<',\n '#60': '<',\n\n 'gt': '>',\n '#62': '>',\n\n 'nbsp': ' ',\n '#160': ' ',\n\n 'times': '×',\n '#215': '×',\n\n 'plusmn': '±',\n '#177': '±',\n\n 'deg': '°',\n '#176': '°'\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/constants/string_mappings.js\n// module id = 389\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\n\n// used in the drawing step for 'scatter' and 'scattegeo' and\n// in the convert step for 'scatter3d'\nmodule.exports = function makeBubbleSizeFn(trace) {\n var marker = trace.marker,\n sizeRef = marker.sizeref || 1,\n sizeMin = marker.sizemin || 0;\n\n // for bubble charts, allow scaling the provided value linearly\n // and by area or diameter.\n // Note this only applies to the array-value sizes\n\n var baseFn = (marker.sizemode === 'area') ?\n function(v) { return Math.sqrt(v / sizeRef); } :\n function(v) { return v / sizeRef; };\n\n // TODO add support for position/negative bubbles?\n // TODO add 'sizeoffset' attribute?\n return function(v) {\n var baseSize = baseFn(v / 2);\n\n // don't show non-numeric and negative sizes\n return (isNumeric(baseSize) && (baseSize > 0)) ?\n Math.max(baseSize, sizeMin) :\n 0;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/make_bubble_size_func.js\n// module id = 390\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\n/** Marker symbol definitions\n * users can specify markers either by number or name\n * add 100 (or '-open') and you get an open marker\n * open markers have no fill and use line color as the stroke color\n * add 200 (or '-dot') and you get a dot in the middle\n * add both and you get both\n */\n\nmodule.exports = {\n circle: {\n n: 0,\n f: function(r) {\n var rs = d3.round(r, 2);\n return 'M' + rs + ',0A' + rs + ',' + rs + ' 0 1,1 0,-' + rs +\n 'A' + rs + ',' + rs + ' 0 0,1 ' + rs + ',0Z';\n }\n },\n square: {\n n: 1,\n f: function(r) {\n var rs = d3.round(r, 2);\n return 'M' + rs + ',' + rs + 'H-' + rs + 'V-' + rs + 'H' + rs + 'Z';\n }\n },\n diamond: {\n n: 2,\n f: function(r) {\n var rd = d3.round(r * 1.3, 2);\n return 'M' + rd + ',0L0,' + rd + 'L-' + rd + ',0L0,-' + rd + 'Z';\n }\n },\n cross: {\n n: 3,\n f: function(r) {\n var rc = d3.round(r * 0.4, 2),\n rc2 = d3.round(r * 1.2, 2);\n return 'M' + rc2 + ',' + rc + 'H' + rc + 'V' + rc2 + 'H-' + rc +\n 'V' + rc + 'H-' + rc2 + 'V-' + rc + 'H-' + rc + 'V-' + rc2 +\n 'H' + rc + 'V-' + rc + 'H' + rc2 + 'Z';\n }\n },\n x: {\n n: 4,\n f: function(r) {\n var rx = d3.round(r * 0.8 / Math.sqrt(2), 2),\n ne = 'l' + rx + ',' + rx,\n se = 'l' + rx + ',-' + rx,\n sw = 'l-' + rx + ',-' + rx,\n nw = 'l-' + rx + ',' + rx;\n return 'M0,' + rx + ne + se + sw + se + sw + nw + sw + nw + ne + nw + ne + 'Z';\n }\n },\n 'triangle-up': {\n n: 5,\n f: function(r) {\n var rt = d3.round(r * 2 / Math.sqrt(3), 2),\n r2 = d3.round(r / 2, 2),\n rs = d3.round(r, 2);\n return 'M-' + rt + ',' + r2 + 'H' + rt + 'L0,-' + rs + 'Z';\n }\n },\n 'triangle-down': {\n n: 6,\n f: function(r) {\n var rt = d3.round(r * 2 / Math.sqrt(3), 2),\n r2 = d3.round(r / 2, 2),\n rs = d3.round(r, 2);\n return 'M-' + rt + ',-' + r2 + 'H' + rt + 'L0,' + rs + 'Z';\n }\n },\n 'triangle-left': {\n n: 7,\n f: function(r) {\n var rt = d3.round(r * 2 / Math.sqrt(3), 2),\n r2 = d3.round(r / 2, 2),\n rs = d3.round(r, 2);\n return 'M' + r2 + ',-' + rt + 'V' + rt + 'L-' + rs + ',0Z';\n }\n },\n 'triangle-right': {\n n: 8,\n f: function(r) {\n var rt = d3.round(r * 2 / Math.sqrt(3), 2),\n r2 = d3.round(r / 2, 2),\n rs = d3.round(r, 2);\n return 'M-' + r2 + ',-' + rt + 'V' + rt + 'L' + rs + ',0Z';\n }\n },\n 'triangle-ne': {\n n: 9,\n f: function(r) {\n var r1 = d3.round(r * 0.6, 2),\n r2 = d3.round(r * 1.2, 2);\n return 'M-' + r2 + ',-' + r1 + 'H' + r1 + 'V' + r2 + 'Z';\n }\n },\n 'triangle-se': {\n n: 10,\n f: function(r) {\n var r1 = d3.round(r * 0.6, 2),\n r2 = d3.round(r * 1.2, 2);\n return 'M' + r1 + ',-' + r2 + 'V' + r1 + 'H-' + r2 + 'Z';\n }\n },\n 'triangle-sw': {\n n: 11,\n f: function(r) {\n var r1 = d3.round(r * 0.6, 2),\n r2 = d3.round(r * 1.2, 2);\n return 'M' + r2 + ',' + r1 + 'H-' + r1 + 'V-' + r2 + 'Z';\n }\n },\n 'triangle-nw': {\n n: 12,\n f: function(r) {\n var r1 = d3.round(r * 0.6, 2),\n r2 = d3.round(r * 1.2, 2);\n return 'M-' + r1 + ',' + r2 + 'V-' + r1 + 'H' + r2 + 'Z';\n }\n },\n pentagon: {\n n: 13,\n f: function(r) {\n var x1 = d3.round(r * 0.951, 2),\n x2 = d3.round(r * 0.588, 2),\n y0 = d3.round(-r, 2),\n y1 = d3.round(r * -0.309, 2),\n y2 = d3.round(r * 0.809, 2);\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2 + 'H-' + x2 +\n 'L-' + x1 + ',' + y1 + 'L0,' + y0 + 'Z';\n }\n },\n hexagon: {\n n: 14,\n f: function(r) {\n var y0 = d3.round(r, 2),\n y1 = d3.round(r / 2, 2),\n x = d3.round(r * Math.sqrt(3) / 2, 2);\n return 'M' + x + ',-' + y1 + 'V' + y1 + 'L0,' + y0 +\n 'L-' + x + ',' + y1 + 'V-' + y1 + 'L0,-' + y0 + 'Z';\n }\n },\n hexagon2: {\n n: 15,\n f: function(r) {\n var x0 = d3.round(r, 2),\n x1 = d3.round(r / 2, 2),\n y = d3.round(r * Math.sqrt(3) / 2, 2);\n return 'M-' + x1 + ',' + y + 'H' + x1 + 'L' + x0 +\n ',0L' + x1 + ',-' + y + 'H-' + x1 + 'L-' + x0 + ',0Z';\n }\n },\n octagon: {\n n: 16,\n f: function(r) {\n var a = d3.round(r * 0.924, 2),\n b = d3.round(r * 0.383, 2);\n return 'M-' + b + ',-' + a + 'H' + b + 'L' + a + ',-' + b + 'V' + b +\n 'L' + b + ',' + a + 'H-' + b + 'L-' + a + ',' + b + 'V-' + b + 'Z';\n }\n },\n star: {\n n: 17,\n f: function(r) {\n var rs = r * 1.4,\n x1 = d3.round(rs * 0.225, 2),\n x2 = d3.round(rs * 0.951, 2),\n x3 = d3.round(rs * 0.363, 2),\n x4 = d3.round(rs * 0.588, 2),\n y0 = d3.round(-rs, 2),\n y1 = d3.round(rs * -0.309, 2),\n y3 = d3.round(rs * 0.118, 2),\n y4 = d3.round(rs * 0.809, 2),\n y5 = d3.round(rs * 0.382, 2);\n return 'M' + x1 + ',' + y1 + 'H' + x2 + 'L' + x3 + ',' + y3 +\n 'L' + x4 + ',' + y4 + 'L0,' + y5 + 'L-' + x4 + ',' + y4 +\n 'L-' + x3 + ',' + y3 + 'L-' + x2 + ',' + y1 + 'H-' + x1 +\n 'L0,' + y0 + 'Z';\n }\n },\n hexagram: {\n n: 18,\n f: function(r) {\n var y = d3.round(r * 0.66, 2),\n x1 = d3.round(r * 0.38, 2),\n x2 = d3.round(r * 0.76, 2);\n return 'M-' + x2 + ',0l-' + x1 + ',-' + y + 'h' + x2 +\n 'l' + x1 + ',-' + y + 'l' + x1 + ',' + y + 'h' + x2 +\n 'l-' + x1 + ',' + y + 'l' + x1 + ',' + y + 'h-' + x2 +\n 'l-' + x1 + ',' + y + 'l-' + x1 + ',-' + y + 'h-' + x2 + 'Z';\n }\n },\n 'star-triangle-up': {\n n: 19,\n f: function(r) {\n var x = d3.round(r * Math.sqrt(3) * 0.8, 2),\n y1 = d3.round(r * 0.8, 2),\n y2 = d3.round(r * 1.6, 2),\n rc = d3.round(r * 4, 2),\n aPart = 'A ' + rc + ',' + rc + ' 0 0 1 ';\n return 'M-' + x + ',' + y1 + aPart + x + ',' + y1 +\n aPart + '0,-' + y2 + aPart + '-' + x + ',' + y1 + 'Z';\n }\n },\n 'star-triangle-down': {\n n: 20,\n f: function(r) {\n var x = d3.round(r * Math.sqrt(3) * 0.8, 2),\n y1 = d3.round(r * 0.8, 2),\n y2 = d3.round(r * 1.6, 2),\n rc = d3.round(r * 4, 2),\n aPart = 'A ' + rc + ',' + rc + ' 0 0 1 ';\n return 'M' + x + ',-' + y1 + aPart + '-' + x + ',-' + y1 +\n aPart + '0,' + y2 + aPart + x + ',-' + y1 + 'Z';\n }\n },\n 'star-square': {\n n: 21,\n f: function(r) {\n var rp = d3.round(r * 1.1, 2),\n rc = d3.round(r * 2, 2),\n aPart = 'A ' + rc + ',' + rc + ' 0 0 1 ';\n return 'M-' + rp + ',-' + rp + aPart + '-' + rp + ',' + rp +\n aPart + rp + ',' + rp + aPart + rp + ',-' + rp +\n aPart + '-' + rp + ',-' + rp + 'Z';\n }\n },\n 'star-diamond': {\n n: 22,\n f: function(r) {\n var rp = d3.round(r * 1.4, 2),\n rc = d3.round(r * 1.9, 2),\n aPart = 'A ' + rc + ',' + rc + ' 0 0 1 ';\n return 'M-' + rp + ',0' + aPart + '0,' + rp +\n aPart + rp + ',0' + aPart + '0,-' + rp +\n aPart + '-' + rp + ',0' + 'Z';\n }\n },\n 'diamond-tall': {\n n: 23,\n f: function(r) {\n var x = d3.round(r * 0.7, 2),\n y = d3.round(r * 1.4, 2);\n return 'M0,' + y + 'L' + x + ',0L0,-' + y + 'L-' + x + ',0Z';\n }\n },\n 'diamond-wide': {\n n: 24,\n f: function(r) {\n var x = d3.round(r * 1.4, 2),\n y = d3.round(r * 0.7, 2);\n return 'M0,' + y + 'L' + x + ',0L0,-' + y + 'L-' + x + ',0Z';\n }\n },\n hourglass: {\n n: 25,\n f: function(r) {\n var rs = d3.round(r, 2);\n return 'M' + rs + ',' + rs + 'H-' + rs + 'L' + rs + ',-' + rs + 'H-' + rs + 'Z';\n },\n noDot: true\n },\n bowtie: {\n n: 26,\n f: function(r) {\n var rs = d3.round(r, 2);\n return 'M' + rs + ',' + rs + 'V-' + rs + 'L-' + rs + ',' + rs + 'V-' + rs + 'Z';\n },\n noDot: true\n },\n 'circle-cross': {\n n: 27,\n f: function(r) {\n var rs = d3.round(r, 2);\n return 'M0,' + rs + 'V-' + rs + 'M' + rs + ',0H-' + rs +\n 'M' + rs + ',0A' + rs + ',' + rs + ' 0 1,1 0,-' + rs +\n 'A' + rs + ',' + rs + ' 0 0,1 ' + rs + ',0Z';\n },\n needLine: true,\n noDot: true\n },\n 'circle-x': {\n n: 28,\n f: function(r) {\n var rs = d3.round(r, 2),\n rc = d3.round(r / Math.sqrt(2), 2);\n return 'M' + rc + ',' + rc + 'L-' + rc + ',-' + rc +\n 'M' + rc + ',-' + rc + 'L-' + rc + ',' + rc +\n 'M' + rs + ',0A' + rs + ',' + rs + ' 0 1,1 0,-' + rs +\n 'A' + rs + ',' + rs + ' 0 0,1 ' + rs + ',0Z';\n },\n needLine: true,\n noDot: true\n },\n 'square-cross': {\n n: 29,\n f: function(r) {\n var rs = d3.round(r, 2);\n return 'M0,' + rs + 'V-' + rs + 'M' + rs + ',0H-' + rs +\n 'M' + rs + ',' + rs + 'H-' + rs + 'V-' + rs + 'H' + rs + 'Z';\n },\n needLine: true,\n noDot: true\n },\n 'square-x': {\n n: 30,\n f: function(r) {\n var rs = d3.round(r, 2);\n return 'M' + rs + ',' + rs + 'L-' + rs + ',-' + rs +\n 'M' + rs + ',-' + rs + 'L-' + rs + ',' + rs +\n 'M' + rs + ',' + rs + 'H-' + rs + 'V-' + rs + 'H' + rs + 'Z';\n },\n needLine: true,\n noDot: true\n },\n 'diamond-cross': {\n n: 31,\n f: function(r) {\n var rd = d3.round(r * 1.3, 2);\n return 'M' + rd + ',0L0,' + rd + 'L-' + rd + ',0L0,-' + rd + 'Z' +\n 'M0,-' + rd + 'V' + rd + 'M-' + rd + ',0H' + rd;\n },\n needLine: true,\n noDot: true\n },\n 'diamond-x': {\n n: 32,\n f: function(r) {\n var rd = d3.round(r * 1.3, 2),\n r2 = d3.round(r * 0.65, 2);\n return 'M' + rd + ',0L0,' + rd + 'L-' + rd + ',0L0,-' + rd + 'Z' +\n 'M-' + r2 + ',-' + r2 + 'L' + r2 + ',' + r2 +\n 'M-' + r2 + ',' + r2 + 'L' + r2 + ',-' + r2;\n },\n needLine: true,\n noDot: true\n },\n 'cross-thin': {\n n: 33,\n f: function(r) {\n var rc = d3.round(r * 1.4, 2);\n return 'M0,' + rc + 'V-' + rc + 'M' + rc + ',0H-' + rc;\n },\n needLine: true,\n noDot: true\n },\n 'x-thin': {\n n: 34,\n f: function(r) {\n var rx = d3.round(r, 2);\n return 'M' + rx + ',' + rx + 'L-' + rx + ',-' + rx +\n 'M' + rx + ',-' + rx + 'L-' + rx + ',' + rx;\n },\n needLine: true,\n noDot: true\n },\n asterisk: {\n n: 35,\n f: function(r) {\n var rc = d3.round(r * 1.2, 2);\n var rs = d3.round(r * 0.85, 2);\n return 'M0,' + rc + 'V-' + rc + 'M' + rc + ',0H-' + rc +\n 'M' + rs + ',' + rs + 'L-' + rs + ',-' + rs +\n 'M' + rs + ',-' + rs + 'L-' + rs + ',' + rs;\n },\n needLine: true,\n noDot: true\n },\n hash: {\n n: 36,\n f: function(r) {\n var r1 = d3.round(r / 2, 2),\n r2 = d3.round(r, 2);\n return 'M' + r1 + ',' + r2 + 'V-' + r2 +\n 'm-' + r2 + ',0V' + r2 +\n 'M' + r2 + ',' + r1 + 'H-' + r2 +\n 'm0,-' + r2 + 'H' + r2;\n },\n needLine: true\n },\n 'y-up': {\n n: 37,\n f: function(r) {\n var x = d3.round(r * 1.2, 2),\n y0 = d3.round(r * 1.6, 2),\n y1 = d3.round(r * 0.8, 2);\n return 'M-' + x + ',' + y1 + 'L0,0M' + x + ',' + y1 + 'L0,0M0,-' + y0 + 'L0,0';\n },\n needLine: true,\n noDot: true\n },\n 'y-down': {\n n: 38,\n f: function(r) {\n var x = d3.round(r * 1.2, 2),\n y0 = d3.round(r * 1.6, 2),\n y1 = d3.round(r * 0.8, 2);\n return 'M-' + x + ',-' + y1 + 'L0,0M' + x + ',-' + y1 + 'L0,0M0,' + y0 + 'L0,0';\n },\n needLine: true,\n noDot: true\n },\n 'y-left': {\n n: 39,\n f: function(r) {\n var y = d3.round(r * 1.2, 2),\n x0 = d3.round(r * 1.6, 2),\n x1 = d3.round(r * 0.8, 2);\n return 'M' + x1 + ',' + y + 'L0,0M' + x1 + ',-' + y + 'L0,0M-' + x0 + ',0L0,0';\n },\n needLine: true,\n noDot: true\n },\n 'y-right': {\n n: 40,\n f: function(r) {\n var y = d3.round(r * 1.2, 2),\n x0 = d3.round(r * 1.6, 2),\n x1 = d3.round(r * 0.8, 2);\n return 'M-' + x1 + ',' + y + 'L0,0M-' + x1 + ',-' + y + 'L0,0M' + x0 + ',0L0,0';\n },\n needLine: true,\n noDot: true\n },\n 'line-ew': {\n n: 41,\n f: function(r) {\n var rc = d3.round(r * 1.4, 2);\n return 'M' + rc + ',0H-' + rc;\n },\n needLine: true,\n noDot: true\n },\n 'line-ns': {\n n: 42,\n f: function(r) {\n var rc = d3.round(r * 1.4, 2);\n return 'M0,' + rc + 'V-' + rc;\n },\n needLine: true,\n noDot: true\n },\n 'line-ne': {\n n: 43,\n f: function(r) {\n var rx = d3.round(r, 2);\n return 'M' + rx + ',-' + rx + 'L-' + rx + ',' + rx;\n },\n needLine: true,\n noDot: true\n },\n 'line-nw': {\n n: 44,\n f: function(r) {\n var rx = d3.round(r, 2);\n return 'M' + rx + ',' + rx + 'L-' + rx + ',-' + rx;\n },\n needLine: true,\n noDot: true\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/drawing/symbol_defs.js\n// module id = 391\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar axesAttrs = require('../cartesian/layout_attributes');\nvar extendFlat = require('../../lib/extend').extendFlat;\nvar overrideAll = require('../../plot_api/edit_types').overrideAll;\n\nvar domainAttr = extendFlat({}, axesAttrs.domain, {\n \n});\n\nfunction mergeAttrs(axisName, nonCommonAttrs) {\n var commonAttrs = {\n showline: {\n valType: 'boolean',\n \n \n },\n showticklabels: {\n valType: 'boolean',\n \n \n },\n tickorientation: {\n valType: 'enumerated',\n values: ['horizontal', 'vertical'],\n \n \n },\n ticklen: {\n valType: 'number',\n min: 0,\n \n \n },\n tickcolor: {\n valType: 'color',\n \n \n },\n ticksuffix: {\n valType: 'string',\n \n \n },\n endpadding: {\n valType: 'number',\n \n },\n visible: {\n valType: 'boolean',\n \n \n }\n };\n\n return extendFlat({}, nonCommonAttrs, commonAttrs);\n}\n\nmodule.exports = overrideAll({\n radialaxis: mergeAttrs('radial', {\n range: {\n valType: 'info_array',\n \n items: [\n { valType: 'number' },\n { valType: 'number' }\n ],\n \n },\n domain: domainAttr,\n orientation: {\n valType: 'number',\n \n \n }\n }),\n\n angularaxis: mergeAttrs('angular', {\n range: {\n valType: 'info_array',\n \n items: [\n { valType: 'number', dflt: 0 },\n { valType: 'number', dflt: 360 }\n ],\n \n },\n domain: domainAttr\n }),\n\n // attributes that appear at layout root\n layout: {\n direction: {\n valType: 'enumerated',\n values: ['clockwise', 'counterclockwise'],\n \n \n },\n orientation: {\n valType: 'angle',\n \n \n }\n }\n}, 'plot', 'nested');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/polar/axis_attributes.js\n// module id = 392\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Registry = require('../../registry');\nvar Axes = require('../../plots/cartesian/axes');\n\nvar makeComputeError = require('./compute_error');\n\n\nmodule.exports = function calc(gd) {\n var calcdata = gd.calcdata;\n\n for(var i = 0; i < calcdata.length; i++) {\n var calcTrace = calcdata[i],\n trace = calcTrace[0].trace;\n\n if(!Registry.traceIs(trace, 'errorBarsOK')) continue;\n\n var xa = Axes.getFromId(gd, trace.xaxis),\n ya = Axes.getFromId(gd, trace.yaxis);\n\n calcOneAxis(calcTrace, trace, xa, 'x');\n calcOneAxis(calcTrace, trace, ya, 'y');\n }\n};\n\nfunction calcOneAxis(calcTrace, trace, axis, coord) {\n var opts = trace['error_' + coord] || {},\n isVisible = (opts.visible && ['linear', 'log'].indexOf(axis.type) !== -1),\n vals = [];\n\n if(!isVisible) return;\n\n var computeError = makeComputeError(opts);\n\n for(var i = 0; i < calcTrace.length; i++) {\n var calcPt = calcTrace[i],\n calcCoord = calcPt[coord];\n\n if(!isNumeric(axis.c2l(calcCoord))) continue;\n\n var errors = computeError(calcCoord, i);\n if(isNumeric(errors[0]) && isNumeric(errors[1])) {\n var shoe = calcPt[coord + 's'] = calcCoord - errors[0],\n hat = calcPt[coord + 'h'] = calcCoord + errors[1];\n vals.push(shoe, hat);\n }\n }\n\n Axes.expand(axis, vals, {padded: true});\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/errorbars/calc.js\n// module id = 393\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../../registry');\nvar Lib = require('../../lib');\nvar Color = require('../../components/color');\nvar basePlotLayoutAttributes = require('../layout_attributes');\n\nvar constants = require('./constants');\nvar layoutAttributes = require('./layout_attributes');\nvar handleTypeDefaults = require('./type_defaults');\nvar handleAxisDefaults = require('./axis_defaults');\nvar handleConstraintDefaults = require('./constraint_defaults');\nvar handlePositionDefaults = require('./position_defaults');\nvar axisIds = require('./axis_ids');\n\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n var layoutKeys = Object.keys(layoutIn),\n xaListCartesian = [],\n yaListCartesian = [],\n xaListGl2d = [],\n yaListGl2d = [],\n xaListCheater = [],\n xaListNonCheater = [],\n outerTicks = {},\n noGrids = {},\n i;\n\n // look for axes in the data\n for(i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n var listX, listY;\n\n if(Registry.traceIs(trace, 'cartesian')) {\n listX = xaListCartesian;\n listY = yaListCartesian;\n }\n else if(Registry.traceIs(trace, 'gl2d')) {\n listX = xaListGl2d;\n listY = yaListGl2d;\n }\n else continue;\n\n var xaName = axisIds.id2name(trace.xaxis),\n yaName = axisIds.id2name(trace.yaxis);\n\n // Two things trigger axis visibility:\n // 1. is not carpet\n // 2. carpet that's not cheater\n if(!Registry.traceIs(trace, 'carpet') || (trace.type === 'carpet' && !trace._cheater)) {\n if(xaName) Lib.pushUnique(xaListNonCheater, xaName);\n }\n\n // The above check for definitely-not-cheater is not adequate. This\n // second list tracks which axes *could* be a cheater so that the\n // full condition triggering hiding is:\n // *could* be a cheater and *is not definitely visible*\n if(trace.type === 'carpet' && trace._cheater) {\n if(xaName) Lib.pushUnique(xaListCheater, xaName);\n }\n\n // add axes implied by traces\n if(xaName && listX.indexOf(xaName) === -1) listX.push(xaName);\n if(yaName && listY.indexOf(yaName) === -1) listY.push(yaName);\n\n // check for default formatting tweaks\n if(Registry.traceIs(trace, '2dMap')) {\n outerTicks[xaName] = true;\n outerTicks[yaName] = true;\n }\n\n if(Registry.traceIs(trace, 'oriented')) {\n var positionAxis = trace.orientation === 'h' ? yaName : xaName;\n noGrids[positionAxis] = true;\n }\n }\n\n // N.B. Ignore orphan axes (i.e. axes that have no data attached to them)\n // if gl3d or geo is present on graph. This is retain backward compatible.\n //\n // TODO drop this in version 2.0\n var ignoreOrphan = (layoutOut._has('gl3d') || layoutOut._has('geo'));\n\n if(!ignoreOrphan) {\n for(i = 0; i < layoutKeys.length; i++) {\n var key = layoutKeys[i];\n\n // orphan layout axes are considered cartesian subplots\n\n if(xaListGl2d.indexOf(key) === -1 &&\n xaListCartesian.indexOf(key) === -1 &&\n constants.xAxisMatch.test(key)) {\n xaListCartesian.push(key);\n }\n else if(yaListGl2d.indexOf(key) === -1 &&\n yaListCartesian.indexOf(key) === -1 &&\n constants.yAxisMatch.test(key)) {\n yaListCartesian.push(key);\n }\n }\n }\n\n // make sure that plots with orphan cartesian axes\n // are considered 'cartesian'\n if(xaListCartesian.length && yaListCartesian.length) {\n Lib.pushUnique(layoutOut._basePlotModules, Registry.subplotsRegistry.cartesian);\n }\n\n function axSort(a, b) {\n var aNum = Number(a.substr(5) || 1),\n bNum = Number(b.substr(5) || 1);\n return aNum - bNum;\n }\n\n var xaList = xaListCartesian.concat(xaListGl2d).sort(axSort),\n yaList = yaListCartesian.concat(yaListGl2d).sort(axSort),\n axesList = xaList.concat(yaList);\n\n // plot_bgcolor only makes sense if there's a (2D) plot!\n // TODO: bgcolor for each subplot, to inherit from the main one\n var plot_bgcolor = Color.background;\n if(xaList.length && yaList.length) {\n plot_bgcolor = Lib.coerce(layoutIn, layoutOut, basePlotLayoutAttributes, 'plot_bgcolor');\n }\n\n var bgColor = Color.combine(plot_bgcolor, layoutOut.paper_bgcolor);\n\n var axName, axLetter, axLayoutIn, axLayoutOut;\n\n function coerce(attr, dflt) {\n return Lib.coerce(axLayoutIn, axLayoutOut, layoutAttributes, attr, dflt);\n }\n\n function getCounterAxes(axLetter) {\n var list = {x: yaList, y: xaList}[axLetter];\n return Lib.simpleMap(list, axisIds.name2id);\n }\n\n var counterAxes = {x: getCounterAxes('x'), y: getCounterAxes('y')};\n\n function getOverlayableAxes(axLetter, axName) {\n var list = {x: xaList, y: yaList}[axLetter];\n var out = [];\n\n for(var j = 0; j < list.length; j++) {\n var axName2 = list[j];\n\n if(axName2 !== axName && !(layoutIn[axName2] || {}).overlaying) {\n out.push(axisIds.name2id(axName2));\n }\n }\n\n return out;\n }\n\n // first pass creates the containers, determines types, and handles most of the settings\n for(i = 0; i < axesList.length; i++) {\n axName = axesList[i];\n\n if(!Lib.isPlainObject(layoutIn[axName])) {\n layoutIn[axName] = {};\n }\n\n axLayoutIn = layoutIn[axName];\n axLayoutOut = layoutOut[axName] = {};\n\n handleTypeDefaults(axLayoutIn, axLayoutOut, coerce, fullData, axName);\n\n axLetter = axName.charAt(0);\n var overlayableAxes = getOverlayableAxes(axLetter, axName);\n\n var defaultOptions = {\n letter: axLetter,\n font: layoutOut.font,\n outerTicks: outerTicks[axName],\n showGrid: !noGrids[axName],\n data: fullData,\n bgColor: bgColor,\n calendar: layoutOut.calendar,\n cheateronly: axLetter === 'x' && (xaListCheater.indexOf(axName) !== -1 && xaListNonCheater.indexOf(axName) === -1)\n };\n\n handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions, layoutOut);\n\n var showSpikes = coerce('showspikes');\n if(showSpikes) {\n coerce('spikecolor');\n coerce('spikethickness');\n coerce('spikedash');\n coerce('spikemode');\n }\n\n var positioningOptions = {\n letter: axLetter,\n counterAxes: counterAxes[axLetter],\n overlayableAxes: overlayableAxes\n };\n\n handlePositionDefaults(axLayoutIn, axLayoutOut, coerce, positioningOptions);\n\n axLayoutOut._input = axLayoutIn;\n }\n\n // quick second pass for range slider and selector defaults\n var rangeSliderDefaults = Registry.getComponentMethod('rangeslider', 'handleDefaults'),\n rangeSelectorDefaults = Registry.getComponentMethod('rangeselector', 'handleDefaults');\n\n for(i = 0; i < xaList.length; i++) {\n axName = xaList[i];\n axLayoutIn = layoutIn[axName];\n axLayoutOut = layoutOut[axName];\n\n rangeSliderDefaults(layoutIn, layoutOut, axName);\n\n if(axLayoutOut.type === 'date') {\n rangeSelectorDefaults(\n axLayoutIn,\n axLayoutOut,\n layoutOut,\n yaList,\n axLayoutOut.calendar\n );\n }\n\n coerce('fixedrange');\n }\n\n for(i = 0; i < yaList.length; i++) {\n axName = yaList[i];\n axLayoutIn = layoutIn[axName];\n axLayoutOut = layoutOut[axName];\n\n var anchoredAxis = layoutOut[axisIds.id2name(axLayoutOut.anchor)];\n\n var fixedRangeDflt = (\n anchoredAxis &&\n anchoredAxis.rangeslider &&\n anchoredAxis.rangeslider.visible\n );\n\n coerce('fixedrange', fixedRangeDflt);\n }\n\n // Finally, handle scale constraints. We need to do this after all axes have\n // coerced both `type` (so we link only axes of the same type) and\n // `fixedrange` (so we can avoid linking from OR TO a fixed axis).\n\n // sets of axes linked by `scaleanchor` along with the scaleratios compounded\n // together, populated in handleConstraintDefaults\n layoutOut._axisConstraintGroups = [];\n var allAxisIds = counterAxes.x.concat(counterAxes.y);\n\n for(i = 0; i < axesList.length; i++) {\n axName = axesList[i];\n axLetter = axName.charAt(0);\n\n axLayoutIn = layoutIn[axName];\n axLayoutOut = layoutOut[axName];\n\n handleConstraintDefaults(axLayoutIn, axLayoutOut, coerce, allAxisIds, layoutOut);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/layout_defaults.js\n// module id = 394\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../../registry');\nvar autoType = require('./axis_autotype');\nvar name2id = require('./axis_ids').name2id;\n\n/*\n * data: the plot data to use in choosing auto type\n * name: axis object name (ie 'xaxis') if one should be stored\n */\nmodule.exports = function handleTypeDefaults(containerIn, containerOut, coerce, data, name) {\n // set up some private properties\n if(name) {\n containerOut._name = name;\n containerOut._id = name2id(name);\n }\n\n var axType = coerce('type');\n if(axType === '-') {\n setAutoType(containerOut, data);\n\n if(containerOut.type === '-') {\n containerOut.type = 'linear';\n }\n else {\n // copy autoType back to input axis\n // note that if this object didn't exist\n // in the input layout, we have to put it in\n // this happens in the main supplyDefaults function\n containerIn.type = containerOut.type;\n }\n }\n};\n\nfunction setAutoType(ax, data) {\n // new logic: let people specify any type they want,\n // only autotype if type is '-'\n if(ax.type !== '-') return;\n\n var id = ax._id,\n axLetter = id.charAt(0);\n\n // support 3d\n if(id.indexOf('scene') !== -1) id = axLetter;\n\n var d0 = getFirstNonEmptyTrace(data, id, axLetter);\n if(!d0) return;\n\n // first check for histograms, as the count direction\n // should always default to a linear axis\n if(d0.type === 'histogram' &&\n axLetter === {v: 'y', h: 'x'}[d0.orientation || 'v']) {\n ax.type = 'linear';\n return;\n }\n\n var calAttr = axLetter + 'calendar',\n calendar = d0[calAttr];\n\n // check all boxes on this x axis to see\n // if they're dates, numbers, or categories\n if(isBoxWithoutPositionCoords(d0, axLetter)) {\n var posLetter = getBoxPosLetter(d0),\n boxPositions = [],\n trace;\n\n for(var i = 0; i < data.length; i++) {\n trace = data[i];\n if(!Registry.traceIs(trace, 'box') ||\n (trace[axLetter + 'axis'] || axLetter) !== id) continue;\n\n if(trace[posLetter] !== undefined) boxPositions.push(trace[posLetter][0]);\n else if(trace.name !== undefined) boxPositions.push(trace.name);\n else boxPositions.push('text');\n\n if(trace[calAttr] !== calendar) calendar = undefined;\n }\n\n ax.type = autoType(boxPositions, calendar);\n }\n else {\n ax.type = autoType(d0[axLetter] || [d0[axLetter + '0']], calendar);\n }\n}\n\nfunction getFirstNonEmptyTrace(data, id, axLetter) {\n for(var i = 0; i < data.length; i++) {\n var trace = data[i];\n\n if((trace[axLetter + 'axis'] || axLetter) === id) {\n if(isBoxWithoutPositionCoords(trace, axLetter)) {\n return trace;\n }\n else if((trace[axLetter] || []).length || trace[axLetter + '0']) {\n return trace;\n }\n }\n }\n}\n\nfunction getBoxPosLetter(trace) {\n return {v: 'x', h: 'y'}[trace.orientation || 'v'];\n}\n\nfunction isBoxWithoutPositionCoords(trace, axLetter) {\n var posLetter = getBoxPosLetter(trace),\n isBox = Registry.traceIs(trace, 'box'),\n isCandlestick = Registry.traceIs(trace._fullInput || {}, 'candlestick');\n\n return (\n isBox &&\n !isCandlestick &&\n axLetter === posLetter &&\n trace[posLetter] === undefined &&\n trace[posLetter + '0'] === undefined\n );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/type_defaults.js\n// module id = 395\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = function handleCategoryOrderDefaults(containerIn, containerOut, coerce) {\n if(containerOut.type !== 'category') return;\n\n var arrayIn = containerIn.categoryarray,\n orderDefault;\n\n var isValidArray = (Array.isArray(arrayIn) && arrayIn.length > 0);\n\n // override default 'categoryorder' value when non-empty array is supplied\n if(isValidArray) orderDefault = 'array';\n\n var order = coerce('categoryorder', orderDefault);\n\n // coerce 'categoryarray' only in array order case\n if(order === 'array') coerce('categoryarray');\n\n // cannot set 'categoryorder' to 'array' with an invalid 'categoryarray'\n if(!isValidArray && order === 'array') {\n containerOut.categoryorder = 'trace';\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/category_order_defaults.js\n// module id = 396\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\n// flattenUniqueSort :: String -> Function -> [[String]] -> [String]\nfunction flattenUniqueSort(axisLetter, sortFunction, data) {\n\n // Bisection based insertion sort of distinct values for logarithmic time complexity.\n // Can't use a hashmap, which is O(1), because ES5 maps coerce keys to strings. If it ever becomes a bottleneck,\n // code can be separated: a hashmap (JS object) based version if all values encountered are strings; and\n // downgrading to this O(log(n)) array on the first encounter of a non-string value.\n\n var categoryArray = [];\n\n var traceLines = data.map(function(d) {return d[axisLetter];});\n\n var i, j, tracePoints, category, insertionIndex;\n\n var bisector = d3.bisector(sortFunction).left;\n\n for(i = 0; i < traceLines.length; i++) {\n\n tracePoints = traceLines[i];\n\n for(j = 0; j < tracePoints.length; j++) {\n\n category = tracePoints[j];\n\n // skip loop: ignore null and undefined categories\n if(category === null || category === undefined) continue;\n\n insertionIndex = bisector(categoryArray, category);\n\n // skip loop on already encountered values\n if(insertionIndex < categoryArray.length && categoryArray[insertionIndex] === category) continue;\n\n // insert value\n categoryArray.splice(insertionIndex, 0, category);\n }\n }\n\n return categoryArray;\n}\n\n\n/**\n * This pure function returns the ordered categories for specified axisLetter, categoryorder, categoryarray and data.\n *\n * If categoryorder is 'array', the result is a fresh copy of categoryarray, or if unspecified, an empty array.\n *\n * If categoryorder is 'category ascending' or 'category descending', the result is an array of ascending or descending\n * order of the unique categories encountered in the data for specified axisLetter.\n *\n * See cartesian/layout_attributes.js for the definition of categoryorder and categoryarray\n *\n */\n\n// orderedCategories :: String -> String -> [String] -> [[String]] -> [String]\nmodule.exports = function orderedCategories(axisLetter, categoryorder, categoryarray, data) {\n\n switch(categoryorder) {\n case 'array': return Array.isArray(categoryarray) ? categoryarray.slice() : [];\n case 'category ascending': return flattenUniqueSort(axisLetter, d3.ascending, data);\n case 'category descending': return flattenUniqueSort(axisLetter, d3.descending, data);\n case 'trace': return [];\n default: return [];\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/ordered_categories.js\n// module id = 397\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar id2name = require('./axis_ids').id2name;\n\n\nmodule.exports = function handleConstraintDefaults(containerIn, containerOut, coerce, allAxisIds, layoutOut) {\n var constraintGroups = layoutOut._axisConstraintGroups;\n var thisID = containerOut._id;\n var letter = thisID.charAt(0);\n\n if(containerOut.fixedrange) return;\n\n // coerce the constraint mechanics even if this axis has no scaleanchor\n // because it may be the anchor of another axis.\n coerce('constrain');\n Lib.coerce(containerIn, containerOut, {\n constraintoward: {\n valType: 'enumerated',\n values: letter === 'x' ? ['left', 'center', 'right'] : ['bottom', 'middle', 'top'],\n dflt: letter === 'x' ? 'center' : 'middle'\n }\n }, 'constraintoward');\n\n if(!containerIn.scaleanchor) return;\n\n var constraintOpts = getConstraintOpts(constraintGroups, thisID, allAxisIds, layoutOut);\n\n var scaleanchor = Lib.coerce(containerIn, containerOut, {\n scaleanchor: {\n valType: 'enumerated',\n values: constraintOpts.linkableAxes\n }\n }, 'scaleanchor');\n\n if(scaleanchor) {\n var scaleratio = coerce('scaleratio');\n // TODO: I suppose I could do attribute.min: Number.MIN_VALUE to avoid zero,\n // but that seems hacky. Better way to say \"must be a positive number\"?\n // Of course if you use several super-tiny values you could eventually\n // force a product of these to zero and all hell would break loose...\n // Likewise with super-huge values.\n if(!scaleratio) scaleratio = containerOut.scaleratio = 1;\n\n updateConstraintGroups(constraintGroups, constraintOpts.thisGroup,\n thisID, scaleanchor, scaleratio);\n }\n else if(allAxisIds.indexOf(containerIn.scaleanchor) !== -1) {\n Lib.warn('ignored ' + containerOut._name + '.scaleanchor: \"' +\n containerIn.scaleanchor + '\" to avoid either an infinite loop ' +\n 'and possibly inconsistent scaleratios, or because the target' +\n 'axis has fixed range.');\n }\n};\n\nfunction getConstraintOpts(constraintGroups, thisID, allAxisIds, layoutOut) {\n // If this axis is already part of a constraint group, we can't\n // scaleanchor any other axis in that group, or we'd make a loop.\n // Filter allAxisIds to enforce this, also matching axis types.\n\n var thisType = layoutOut[id2name(thisID)].type;\n\n var i, j, idj, axj;\n\n var linkableAxes = [];\n for(j = 0; j < allAxisIds.length; j++) {\n idj = allAxisIds[j];\n if(idj === thisID) continue;\n\n axj = layoutOut[id2name(idj)];\n if(axj.type === thisType && !axj.fixedrange) linkableAxes.push(idj);\n }\n\n for(i = 0; i < constraintGroups.length; i++) {\n if(constraintGroups[i][thisID]) {\n var thisGroup = constraintGroups[i];\n\n var linkableAxesNoLoops = [];\n for(j = 0; j < linkableAxes.length; j++) {\n idj = linkableAxes[j];\n if(!thisGroup[idj]) linkableAxesNoLoops.push(idj);\n }\n return {linkableAxes: linkableAxesNoLoops, thisGroup: thisGroup};\n }\n }\n\n return {linkableAxes: linkableAxes, thisGroup: null};\n}\n\n\n/*\n * Add this axis to the axis constraint groups, which is the collection\n * of axes that are all constrained together on scale.\n *\n * constraintGroups: a list of objects. each object is\n * {axis_id: scale_within_group}, where scale_within_group is\n * only important relative to the rest of the group, and defines\n * the relative scales between all axes in the group\n *\n * thisGroup: the group the current axis is already in\n * thisID: the id if the current axis\n * scaleanchor: the id of the axis to scale it with\n * scaleratio: the ratio of this axis to the scaleanchor axis\n */\nfunction updateConstraintGroups(constraintGroups, thisGroup, thisID, scaleanchor, scaleratio) {\n var i, j, groupi, keyj, thisGroupIndex;\n\n if(thisGroup === null) {\n thisGroup = {};\n thisGroup[thisID] = 1;\n thisGroupIndex = constraintGroups.length;\n constraintGroups.push(thisGroup);\n }\n else {\n thisGroupIndex = constraintGroups.indexOf(thisGroup);\n }\n\n var thisGroupKeys = Object.keys(thisGroup);\n\n // we know that this axis isn't in any other groups, but we don't know\n // about the scaleanchor axis. If it is, we need to merge the groups.\n for(i = 0; i < constraintGroups.length; i++) {\n groupi = constraintGroups[i];\n if(i !== thisGroupIndex && groupi[scaleanchor]) {\n var baseScale = groupi[scaleanchor];\n for(j = 0; j < thisGroupKeys.length; j++) {\n keyj = thisGroupKeys[j];\n groupi[keyj] = baseScale * scaleratio * thisGroup[keyj];\n }\n constraintGroups.splice(thisGroupIndex, 1);\n return;\n }\n }\n\n // otherwise, we insert the new scaleanchor axis as the base scale (1)\n // in its group, and scale the rest of the group to it\n if(scaleratio !== 1) {\n for(j = 0; j < thisGroupKeys.length; j++) {\n thisGroup[thisGroupKeys[j]] *= scaleratio;\n }\n }\n thisGroup[scaleanchor] = 1;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/constraint_defaults.js\n// module id = 398\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n/**\n * Error bar computing function generator\n *\n * N.B. The generated function does not clean the dataPt entries. Non-numeric\n * entries result in undefined error magnitudes.\n *\n * @param {object} opts error bar attributes\n *\n * @return {function} :\n * @param {numeric} dataPt data point from where to compute the error magnitude\n * @param {number} index index of dataPt in its corresponding data array\n * @return {array}\n * - error[0] : error magnitude in the negative direction\n * - error[1] : \" \" \" \" positive \"\n */\nmodule.exports = function makeComputeError(opts) {\n var type = opts.type,\n symmetric = opts.symmetric;\n\n if(type === 'data') {\n var array = opts.array,\n arrayminus = opts.arrayminus;\n\n if(symmetric || arrayminus === undefined) {\n return function computeError(dataPt, index) {\n var val = +(array[index]);\n return [val, val];\n };\n }\n else {\n return function computeError(dataPt, index) {\n return [+arrayminus[index], +array[index]];\n };\n }\n }\n else {\n var computeErrorValue = makeComputeErrorValue(type, opts.value),\n computeErrorValueMinus = makeComputeErrorValue(type, opts.valueminus);\n\n if(symmetric || opts.valueminus === undefined) {\n return function computeError(dataPt) {\n var val = computeErrorValue(dataPt);\n return [val, val];\n };\n }\n else {\n return function computeError(dataPt) {\n return [\n computeErrorValueMinus(dataPt),\n computeErrorValue(dataPt)\n ];\n };\n }\n }\n};\n\n/**\n * Compute error bar magnitude (for all types except data)\n *\n * @param {string} type error bar type\n * @param {numeric} value error bar value\n *\n * @return {function} :\n * @param {numeric} dataPt\n */\nfunction makeComputeErrorValue(type, value) {\n if(type === 'percent') {\n return function(dataPt) {\n return Math.abs(dataPt * value / 100);\n };\n }\n if(type === 'constant') {\n return function() {\n return Math.abs(value);\n };\n }\n if(type === 'sqrt') {\n return function(dataPt) {\n return Math.sqrt(Math.abs(dataPt));\n };\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/errorbars/compute_error.js\n// module id = 399\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar Drawing = require('../drawing');\nvar subTypes = require('../../traces/scatter/subtypes');\n\nmodule.exports = function plot(traces, plotinfo, transitionOpts) {\n var isNew;\n\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n var hasAnimation = transitionOpts && transitionOpts.duration > 0;\n\n traces.each(function(d) {\n var trace = d[0].trace,\n // || {} is in case the trace (specifically scatterternary)\n // doesn't support error bars at all, but does go through\n // the scatter.plot mechanics, which calls ErrorBars.plot\n // internally\n xObj = trace.error_x || {},\n yObj = trace.error_y || {};\n\n var keyFunc;\n\n if(trace.ids) {\n keyFunc = function(d) {return d.id;};\n }\n\n var sparse = (\n subTypes.hasMarkers(trace) &&\n trace.marker.maxdisplayed > 0\n );\n\n if(!yObj.visible && !xObj.visible) d = [];\n\n var errorbars = d3.select(this).selectAll('g.errorbar')\n .data(d, keyFunc);\n\n errorbars.exit().remove();\n\n if(!d.length) return;\n\n if(!xObj.visible) errorbars.selectAll('path.xerror').remove();\n if(!yObj.visible) errorbars.selectAll('path.yerror').remove();\n\n errorbars.style('opacity', 1);\n\n var enter = errorbars.enter().append('g')\n .classed('errorbar', true);\n\n if(hasAnimation) {\n enter.style('opacity', 0).transition()\n .duration(transitionOpts.duration)\n .style('opacity', 1);\n }\n\n Drawing.setClipUrl(errorbars, plotinfo.layerClipId);\n\n errorbars.each(function(d) {\n var errorbar = d3.select(this);\n var coords = errorCoords(d, xa, ya);\n\n if(sparse && !d.vis) return;\n\n var path;\n\n if(yObj.visible && isNumeric(coords.x) &&\n isNumeric(coords.yh) &&\n isNumeric(coords.ys)) {\n var yw = yObj.width;\n\n path = 'M' + (coords.x - yw) + ',' +\n coords.yh + 'h' + (2 * yw) + // hat\n 'm-' + yw + ',0V' + coords.ys; // bar\n\n\n if(!coords.noYS) path += 'm-' + yw + ',0h' + (2 * yw); // shoe\n\n var yerror = errorbar.select('path.yerror');\n\n isNew = !yerror.size();\n\n if(isNew) {\n yerror = errorbar.append('path')\n .style('vector-effect', 'non-scaling-stroke')\n .classed('yerror', true);\n } else if(hasAnimation) {\n yerror = yerror\n .transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing);\n }\n\n yerror.attr('d', path);\n }\n\n if(xObj.visible && isNumeric(coords.y) &&\n isNumeric(coords.xh) &&\n isNumeric(coords.xs)) {\n var xw = (xObj.copy_ystyle ? yObj : xObj).width;\n\n path = 'M' + coords.xh + ',' +\n (coords.y - xw) + 'v' + (2 * xw) + // hat\n 'm0,-' + xw + 'H' + coords.xs; // bar\n\n if(!coords.noXS) path += 'm0,-' + xw + 'v' + (2 * xw); // shoe\n\n var xerror = errorbar.select('path.xerror');\n\n isNew = !xerror.size();\n\n if(isNew) {\n xerror = errorbar.append('path')\n .style('vector-effect', 'non-scaling-stroke')\n .classed('xerror', true);\n } else if(hasAnimation) {\n xerror = xerror\n .transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing);\n }\n\n xerror.attr('d', path);\n }\n });\n });\n};\n\n// compute the coordinates of the error-bar objects\nfunction errorCoords(d, xa, ya) {\n var out = {\n x: xa.c2p(d.x),\n y: ya.c2p(d.y)\n };\n\n // calculate the error bar size and hat and shoe locations\n if(d.yh !== undefined) {\n out.yh = ya.c2p(d.yh);\n out.ys = ya.c2p(d.ys);\n\n // if the shoes go off-scale (ie log scale, error bars past zero)\n // clip the bar and hide the shoes\n if(!isNumeric(out.ys)) {\n out.noYS = true;\n out.ys = ya.c2p(d.ys, true);\n }\n }\n\n if(d.xh !== undefined) {\n out.xh = xa.c2p(d.xh);\n out.xs = xa.c2p(d.xs);\n\n if(!isNumeric(out.xs)) {\n out.noXS = true;\n out.xs = xa.c2p(d.xs, true);\n }\n }\n\n return out;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/errorbars/plot.js\n// module id = 400\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Color = require('../color');\n\n\nmodule.exports = function style(traces) {\n traces.each(function(d) {\n var trace = d[0].trace,\n yObj = trace.error_y || {},\n xObj = trace.error_x || {};\n\n var s = d3.select(this);\n\n s.selectAll('path.yerror')\n .style('stroke-width', yObj.thickness + 'px')\n .call(Color.stroke, yObj.color);\n\n if(xObj.copy_ystyle) xObj = yObj;\n\n s.selectAll('path.xerror')\n .style('stroke-width', xObj.thickness + 'px')\n .call(Color.stroke, xObj.color);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/errorbars/style.js\n// module id = 401\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Plotly = require('../plotly');\nvar Lib = require('../lib');\n\n/*\n * Create or update an observer. This function is designed to be\n * idempotent so that it can be called over and over as the component\n * updates, and will attach and detach listeners as needed.\n *\n * @param {optional object} container\n * An object on which the observer is stored. This is the mechanism\n * by which it is idempotent. If it already exists, another won't be\n * added. Each time it's called, the value lookup table is updated.\n * @param {array} commandList\n * An array of commands, following either `buttons` of `updatemenus`\n * or `steps` of `sliders`.\n * @param {function} onchange\n * A listener called when the value is changed. Receives data object\n * with information about the new state.\n */\nexports.manageCommandObserver = function(gd, container, commandList, onchange) {\n var ret = {};\n var enabled = true;\n\n if(container && container._commandObserver) {\n ret = container._commandObserver;\n }\n\n if(!ret.cache) {\n ret.cache = {};\n }\n\n // Either create or just recompute this:\n ret.lookupTable = {};\n\n var binding = exports.hasSimpleAPICommandBindings(gd, commandList, ret.lookupTable);\n\n if(container && container._commandObserver) {\n if(!binding) {\n // If container exists and there are no longer any bindings,\n // remove existing:\n if(container._commandObserver.remove) {\n container._commandObserver.remove();\n container._commandObserver = null;\n return ret;\n }\n } else {\n // If container exists and there *are* bindings, then the lookup\n // table should have been updated and check is already attached,\n // so there's nothing to be done:\n return ret;\n\n\n }\n }\n\n // Determine whether there's anything to do for this binding:\n\n if(binding) {\n // Build the cache:\n bindingValueHasChanged(gd, binding, ret.cache);\n\n ret.check = function check() {\n if(!enabled) return;\n\n var update = bindingValueHasChanged(gd, binding, ret.cache);\n\n if(update.changed && onchange) {\n // Disable checks for the duration of this command in order to avoid\n // infinite loops:\n if(ret.lookupTable[update.value] !== undefined) {\n ret.disable();\n Promise.resolve(onchange({\n value: update.value,\n type: binding.type,\n prop: binding.prop,\n traces: binding.traces,\n index: ret.lookupTable[update.value]\n })).then(ret.enable, ret.enable);\n }\n }\n\n return update.changed;\n };\n\n var checkEvents = [\n 'plotly_relayout',\n 'plotly_redraw',\n 'plotly_restyle',\n 'plotly_update',\n 'plotly_animatingframe',\n 'plotly_afterplot'\n ];\n\n for(var i = 0; i < checkEvents.length; i++) {\n gd._internalOn(checkEvents[i], ret.check);\n }\n\n ret.remove = function() {\n for(var i = 0; i < checkEvents.length; i++) {\n gd._removeInternalListener(checkEvents[i], ret.check);\n }\n };\n } else {\n // TODO: It'd be really neat to actually give a *reason* for this, but at least a warning\n // is a start\n Lib.warn('Unable to automatically bind plot updates to API command');\n\n ret.lookupTable = {};\n ret.remove = function() {};\n }\n\n ret.disable = function disable() {\n enabled = false;\n };\n\n ret.enable = function enable() {\n enabled = true;\n };\n\n if(container) {\n container._commandObserver = ret;\n }\n\n return ret;\n};\n\n/*\n * This function checks to see if an array of objects containing\n * method and args properties is compatible with automatic two-way\n * binding. The criteria right now are that\n *\n * 1. multiple traces may be affected\n * 2. only one property may be affected\n * 3. the same property must be affected by all commands\n */\nexports.hasSimpleAPICommandBindings = function(gd, commandList, bindingsByValue) {\n var i;\n var n = commandList.length;\n\n var refBinding;\n\n for(i = 0; i < n; i++) {\n var binding;\n var command = commandList[i];\n var method = command.method;\n var args = command.args;\n\n if(!Array.isArray(args)) args = [];\n\n // If any command has no method, refuse to bind:\n if(!method) {\n return false;\n }\n var bindings = exports.computeAPICommandBindings(gd, method, args);\n\n // Right now, handle one and *only* one property being set:\n if(bindings.length !== 1) {\n return false;\n }\n\n if(!refBinding) {\n refBinding = bindings[0];\n if(Array.isArray(refBinding.traces)) {\n refBinding.traces.sort();\n }\n } else {\n binding = bindings[0];\n if(binding.type !== refBinding.type) {\n return false;\n }\n if(binding.prop !== refBinding.prop) {\n return false;\n }\n if(Array.isArray(refBinding.traces)) {\n if(Array.isArray(binding.traces)) {\n binding.traces.sort();\n for(var j = 0; j < refBinding.traces.length; j++) {\n if(refBinding.traces[j] !== binding.traces[j]) {\n return false;\n }\n }\n } else {\n return false;\n }\n } else {\n if(binding.prop !== refBinding.prop) {\n return false;\n }\n }\n }\n\n binding = bindings[0];\n var value = binding.value;\n if(Array.isArray(value)) {\n if(value.length === 1) {\n value = value[0];\n } else {\n return false;\n }\n }\n if(bindingsByValue) {\n bindingsByValue[value] = i;\n }\n }\n\n return refBinding;\n};\n\nfunction bindingValueHasChanged(gd, binding, cache) {\n var container, value, obj;\n var changed = false;\n\n if(binding.type === 'data') {\n // If it's data, we need to get a trace. Based on the limited scope\n // of what we cover, we can just take the first trace from the list,\n // or otherwise just the first trace:\n container = gd._fullData[binding.traces !== null ? binding.traces[0] : 0];\n } else if(binding.type === 'layout') {\n container = gd._fullLayout;\n } else {\n return false;\n }\n\n value = Lib.nestedProperty(container, binding.prop).get();\n\n obj = cache[binding.type] = cache[binding.type] || {};\n\n if(obj.hasOwnProperty(binding.prop)) {\n if(obj[binding.prop] !== value) {\n changed = true;\n }\n }\n\n obj[binding.prop] = value;\n\n return {\n changed: changed,\n value: value\n };\n}\n\n/*\n * Execute an API command. There's really not much to this; it just provides\n * a common hook so that implementations don't need to be synchronized across\n * multiple components with the ability to invoke API commands.\n *\n * @param {string} method\n * The name of the plotly command to execute. Must be one of 'animate',\n * 'restyle', 'relayout', 'update'.\n * @param {array} args\n * A list of arguments passed to the API command\n */\nexports.executeAPICommand = function(gd, method, args) {\n if(method === 'skip') return Promise.resolve();\n\n var apiMethod = Plotly[method];\n\n var allArgs = [gd];\n\n if(!Array.isArray(args)) args = [];\n\n for(var i = 0; i < args.length; i++) {\n allArgs.push(args[i]);\n }\n\n return apiMethod.apply(null, allArgs).catch(function(err) {\n Lib.warn('API call to Plotly.' + method + ' rejected.', err);\n return Promise.reject(err);\n });\n};\n\nexports.computeAPICommandBindings = function(gd, method, args) {\n var bindings;\n\n if(!Array.isArray(args)) args = [];\n\n switch(method) {\n case 'restyle':\n bindings = computeDataBindings(gd, args);\n break;\n case 'relayout':\n bindings = computeLayoutBindings(gd, args);\n break;\n case 'update':\n bindings = computeDataBindings(gd, [args[0], args[2]])\n .concat(computeLayoutBindings(gd, [args[1]]));\n break;\n case 'animate':\n bindings = computeAnimateBindings(gd, args);\n break;\n default:\n // This is the case where intelligent logic about what affects\n // this command is not implemented. It causes no ill effects.\n // For example, addFrames simply won't bind to a control component.\n bindings = [];\n }\n return bindings;\n};\n\nfunction computeAnimateBindings(gd, args) {\n // We'll assume that the only relevant modification an animation\n // makes that's meaningfully tracked is the frame:\n if(Array.isArray(args[0]) && args[0].length === 1 && ['string', 'number'].indexOf(typeof args[0][0]) !== -1) {\n return [{type: 'layout', prop: '_currentFrame', value: args[0][0].toString()}];\n } else {\n return [];\n }\n}\n\nfunction computeLayoutBindings(gd, args) {\n var bindings = [];\n\n var astr = args[0];\n var aobj = {};\n if(typeof astr === 'string') {\n aobj[astr] = args[1];\n } else if(Lib.isPlainObject(astr)) {\n aobj = astr;\n } else {\n return bindings;\n }\n\n crawl(aobj, function(path, attrName, attr) {\n bindings.push({type: 'layout', prop: path, value: attr});\n }, '', 0);\n\n return bindings;\n}\n\nfunction computeDataBindings(gd, args) {\n var traces, astr, val, aobj;\n var bindings = [];\n\n // Logic copied from Plotly.restyle:\n astr = args[0];\n val = args[1];\n traces = args[2];\n aobj = {};\n if(typeof astr === 'string') {\n aobj[astr] = val;\n } else if(Lib.isPlainObject(astr)) {\n // the 3-arg form\n aobj = astr;\n\n if(traces === undefined) {\n traces = val;\n }\n } else {\n return bindings;\n }\n\n if(traces === undefined) {\n // Explicitly assign this to null instead of undefined:\n traces = null;\n }\n\n crawl(aobj, function(path, attrName, attr) {\n var thisTraces;\n if(Array.isArray(attr)) {\n var nAttr = Math.min(attr.length, gd.data.length);\n if(traces) {\n nAttr = Math.min(nAttr, traces.length);\n }\n thisTraces = [];\n for(var j = 0; j < nAttr; j++) {\n thisTraces[j] = traces ? traces[j] : j;\n }\n } else {\n thisTraces = traces ? traces.slice(0) : null;\n }\n\n // Convert [7] to just 7 when traces is null:\n if(thisTraces === null) {\n if(Array.isArray(attr)) {\n attr = attr[0];\n }\n } else if(Array.isArray(thisTraces)) {\n if(!Array.isArray(attr)) {\n var tmp = attr;\n attr = [];\n for(var i = 0; i < thisTraces.length; i++) {\n attr[i] = tmp;\n }\n }\n attr.length = Math.min(thisTraces.length, attr.length);\n }\n\n bindings.push({\n type: 'data',\n prop: path,\n traces: thisTraces,\n value: attr\n });\n }, '', 0);\n\n return bindings;\n}\n\nfunction crawl(attrs, callback, path, depth) {\n Object.keys(attrs).forEach(function(attrName) {\n var attr = attrs[attrName];\n\n if(attrName[0] === '_') return;\n\n var thisPath = path + (depth > 0 ? '.' : '') + attrName;\n\n if(Lib.isPlainObject(attr)) {\n crawl(attr, callback, thisPath, depth + 1);\n } else {\n // Only execute the callback on leaf nodes:\n callback(thisPath, attrName, attr);\n }\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/command.js\n// module id = 402\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Axes = require('../../plots/cartesian/axes');\nvar scatterSubTypes = require('../../traces/scatter/subtypes');\nvar Registry = require('../../registry');\n\nvar createModeBar = require('./modebar');\nvar modeBarButtons = require('./buttons');\n\n/**\n * ModeBar wrapper around 'create' and 'update',\n * chooses buttons to pass to ModeBar constructor based on\n * plot type and plot config.\n *\n * @param {object} gd main plot object\n *\n */\nmodule.exports = function manageModeBar(gd) {\n var fullLayout = gd._fullLayout,\n context = gd._context,\n modeBar = fullLayout._modeBar;\n\n if(!context.displayModeBar) {\n if(modeBar) {\n modeBar.destroy();\n delete fullLayout._modeBar;\n }\n return;\n }\n\n if(!Array.isArray(context.modeBarButtonsToRemove)) {\n throw new Error([\n '*modeBarButtonsToRemove* configuration options',\n 'must be an array.'\n ].join(' '));\n }\n\n if(!Array.isArray(context.modeBarButtonsToAdd)) {\n throw new Error([\n '*modeBarButtonsToAdd* configuration options',\n 'must be an array.'\n ].join(' '));\n }\n\n var customButtons = context.modeBarButtons;\n var buttonGroups;\n\n if(Array.isArray(customButtons) && customButtons.length) {\n buttonGroups = fillCustomButton(customButtons);\n }\n else {\n buttonGroups = getButtonGroups(\n gd,\n context.modeBarButtonsToRemove,\n context.modeBarButtonsToAdd\n );\n }\n\n if(modeBar) modeBar.update(gd, buttonGroups);\n else fullLayout._modeBar = createModeBar(gd, buttonGroups);\n};\n\n// logic behind which buttons are displayed by default\nfunction getButtonGroups(gd, buttonsToRemove, buttonsToAdd) {\n var fullLayout = gd._fullLayout;\n var fullData = gd._fullData;\n\n var hasCartesian = fullLayout._has('cartesian');\n var hasGL3D = fullLayout._has('gl3d');\n var hasGeo = fullLayout._has('geo');\n var hasPie = fullLayout._has('pie');\n var hasGL2D = fullLayout._has('gl2d');\n var hasTernary = fullLayout._has('ternary');\n var hasMapbox = fullLayout._has('mapbox');\n\n var groups = [];\n\n function addGroup(newGroup) {\n var out = [];\n\n for(var i = 0; i < newGroup.length; i++) {\n var button = newGroup[i];\n if(buttonsToRemove.indexOf(button) !== -1) continue;\n out.push(modeBarButtons[button]);\n }\n\n groups.push(out);\n }\n\n // buttons common to all plot types\n addGroup(['toImage', 'sendDataToCloud']);\n\n // graphs with more than one plot types get 'union buttons'\n // which reset the view or toggle hover labels across all subplots.\n if((hasCartesian || hasGL2D || hasPie || hasTernary) + hasGeo + hasGL3D > 1) {\n addGroup(['resetViews', 'toggleHover']);\n return appendButtonsToGroups(groups, buttonsToAdd);\n }\n\n if(hasGL3D) {\n addGroup(['zoom3d', 'pan3d', 'orbitRotation', 'tableRotation']);\n addGroup(['resetCameraDefault3d', 'resetCameraLastSave3d']);\n addGroup(['hoverClosest3d']);\n }\n\n var allAxesFixed = areAllAxesFixed(fullLayout),\n dragModeGroup = [];\n\n if(((hasCartesian || hasGL2D) && !allAxesFixed) || hasTernary) {\n dragModeGroup = ['zoom2d', 'pan2d'];\n }\n if(hasMapbox || hasGeo) {\n dragModeGroup = ['pan2d'];\n }\n if(isSelectable(fullData)) {\n dragModeGroup.push('select2d');\n dragModeGroup.push('lasso2d');\n }\n if(dragModeGroup.length) addGroup(dragModeGroup);\n\n if((hasCartesian || hasGL2D) && !allAxesFixed && !hasTernary) {\n addGroup(['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d']);\n }\n\n if(hasCartesian && hasPie) {\n addGroup(['toggleHover']);\n } else if(hasGL2D) {\n addGroup(['hoverClosestGl2d']);\n } else if(hasCartesian) {\n addGroup(['toggleSpikelines', 'hoverClosestCartesian', 'hoverCompareCartesian']);\n } else if(hasPie) {\n addGroup(['hoverClosestPie']);\n } else if(hasMapbox) {\n addGroup(['resetViewMapbox', 'toggleHover']);\n } else if(hasGeo) {\n addGroup(['zoomInGeo', 'zoomOutGeo', 'resetGeo']);\n addGroup(['hoverClosestGeo']);\n }\n\n return appendButtonsToGroups(groups, buttonsToAdd);\n}\n\nfunction areAllAxesFixed(fullLayout) {\n var axList = Axes.list({_fullLayout: fullLayout}, null, true);\n var allFixed = true;\n\n for(var i = 0; i < axList.length; i++) {\n if(!axList[i].fixedrange) {\n allFixed = false;\n break;\n }\n }\n\n return allFixed;\n}\n\n// look for traces that support selection\n// to be updated as we add more selectPoints handlers\nfunction isSelectable(fullData) {\n var selectable = false;\n\n for(var i = 0; i < fullData.length; i++) {\n if(selectable) break;\n\n var trace = fullData[i];\n\n if(!trace._module || !trace._module.selectPoints) continue;\n\n if(Registry.traceIs(trace, 'scatter-like')) {\n if(scatterSubTypes.hasMarkers(trace) || scatterSubTypes.hasText(trace)) {\n selectable = true;\n }\n }\n // assume that in general if the trace module has selectPoints,\n // then it's selectable. Scatter is an exception to this because it must\n // have markers or text, not just be a scatter type.\n else selectable = true;\n }\n\n return selectable;\n}\n\nfunction appendButtonsToGroups(groups, buttons) {\n if(buttons.length) {\n if(Array.isArray(buttons[0])) {\n for(var i = 0; i < buttons.length; i++) {\n groups.push(buttons[i]);\n }\n }\n else groups.push(buttons);\n }\n\n return groups;\n}\n\n// fill in custom buttons referring to default mode bar buttons\nfunction fillCustomButton(customButtons) {\n for(var i = 0; i < customButtons.length; i++) {\n var buttonGroup = customButtons[i];\n\n for(var j = 0; j < buttonGroup.length; j++) {\n var button = buttonGroup[j];\n\n if(typeof button === 'string') {\n if(modeBarButtons[button] !== undefined) {\n customButtons[i][j] = modeBarButtons[button];\n }\n else {\n throw new Error([\n '*modeBarButtons* configuration options',\n 'invalid button name'\n ].join(' '));\n }\n }\n }\n }\n\n return customButtons;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/modebar/manage.js\n// module id = 403\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Lib = require('../../lib');\nvar Icons = require('../../../build/ploticon');\n\n\n/**\n * UI controller for interactive plots\n * @Class\n * @Param {object} opts\n * @Param {object} opts.buttons nested arrays of grouped buttons config objects\n * @Param {object} opts.container container div to append modeBar\n * @Param {object} opts.graphInfo primary plot object containing data and layout\n */\nfunction ModeBar(opts) {\n this.container = opts.container;\n this.element = document.createElement('div');\n\n this.update(opts.graphInfo, opts.buttons);\n\n this.container.appendChild(this.element);\n}\n\nvar proto = ModeBar.prototype;\n\n/**\n * Update modeBar (buttons and logo)\n *\n * @param {object} graphInfo primary plot object containing data and layout\n * @param {array of arrays} buttons nested arrays of grouped buttons to initialize\n *\n */\nproto.update = function(graphInfo, buttons) {\n this.graphInfo = graphInfo;\n\n var context = this.graphInfo._context;\n\n if(context.displayModeBar === 'hover') {\n this.element.className = 'modebar modebar--hover';\n }\n else this.element.className = 'modebar';\n\n // if buttons or logo have changed, redraw modebar interior\n var needsNewButtons = !this.hasButtons(buttons),\n needsNewLogo = (this.hasLogo !== context.displaylogo);\n\n if(needsNewButtons || needsNewLogo) {\n this.removeAllButtons();\n\n this.updateButtons(buttons);\n\n if(context.displaylogo) {\n this.element.appendChild(this.getLogo());\n this.hasLogo = true;\n }\n }\n\n this.updateActiveButton();\n};\n\nproto.updateButtons = function(buttons) {\n var _this = this;\n\n this.buttons = buttons;\n this.buttonElements = [];\n this.buttonsNames = [];\n\n this.buttons.forEach(function(buttonGroup) {\n var group = _this.createGroup();\n\n buttonGroup.forEach(function(buttonConfig) {\n var buttonName = buttonConfig.name;\n if(!buttonName) {\n throw new Error('must provide button \\'name\\' in button config');\n }\n if(_this.buttonsNames.indexOf(buttonName) !== -1) {\n throw new Error('button name \\'' + buttonName + '\\' is taken');\n }\n _this.buttonsNames.push(buttonName);\n\n var button = _this.createButton(buttonConfig);\n _this.buttonElements.push(button);\n group.appendChild(button);\n });\n\n _this.element.appendChild(group);\n });\n};\n\n/**\n * Empty div for containing a group of buttons\n * @Return {HTMLelement}\n */\nproto.createGroup = function() {\n var group = document.createElement('div');\n group.className = 'modebar-group';\n\n return group;\n};\n\n/**\n * Create a new button div and set constant and configurable attributes\n * @Param {object} config (see ./buttons.js for more info)\n * @Return {HTMLelement}\n */\nproto.createButton = function(config) {\n var _this = this,\n button = document.createElement('a');\n\n button.setAttribute('rel', 'tooltip');\n button.className = 'modebar-btn';\n\n var title = config.title;\n if(title === undefined) title = config.name;\n if(title || title === 0) button.setAttribute('data-title', title);\n\n if(config.attr !== undefined) button.setAttribute('data-attr', config.attr);\n\n var val = config.val;\n if(val !== undefined) {\n if(typeof val === 'function') val = val(this.graphInfo);\n button.setAttribute('data-val', val);\n }\n\n var click = config.click;\n if(typeof click !== 'function') {\n throw new Error('must provide button \\'click\\' function in button config');\n }\n else {\n button.addEventListener('click', function(ev) {\n config.click(_this.graphInfo, ev);\n\n // only needed for 'hoverClosestGeo' which does not call relayout\n _this.updateActiveButton(ev.currentTarget);\n });\n }\n\n button.setAttribute('data-toggle', config.toggle || false);\n if(config.toggle) d3.select(button).classed('active', true);\n\n button.appendChild(this.createIcon(config.icon || Icons.question, config.name));\n button.setAttribute('data-gravity', config.gravity || 'n');\n\n return button;\n};\n\n/**\n * Add an icon to a button\n * @Param {object} thisIcon\n * @Param {number} thisIcon.width\n * @Param {string} thisIcon.path\n * @Return {HTMLelement}\n */\nproto.createIcon = function(thisIcon, name) {\n var iconHeight = thisIcon.ascent - thisIcon.descent,\n svgNS = 'http://www.w3.org/2000/svg',\n icon = document.createElementNS(svgNS, 'svg'),\n path = document.createElementNS(svgNS, 'path');\n\n icon.setAttribute('height', '1em');\n icon.setAttribute('width', (thisIcon.width / iconHeight) + 'em');\n icon.setAttribute('viewBox', [0, 0, thisIcon.width, iconHeight].join(' '));\n\n var transform = name === 'toggleSpikelines' ?\n 'matrix(1.5 0 0 -1.5 0 ' + thisIcon.ascent + ')' :\n 'matrix(1 0 0 -1 0 ' + thisIcon.ascent + ')';\n\n path.setAttribute('d', thisIcon.path);\n path.setAttribute('transform', transform);\n icon.appendChild(path);\n\n return icon;\n};\n\n/**\n * Updates active button with attribute specified in layout\n * @Param {object} graphInfo plot object containing data and layout\n * @Return {HTMLelement}\n */\nproto.updateActiveButton = function(buttonClicked) {\n var fullLayout = this.graphInfo._fullLayout,\n dataAttrClicked = (buttonClicked !== undefined) ?\n buttonClicked.getAttribute('data-attr') :\n null;\n\n this.buttonElements.forEach(function(button) {\n var thisval = button.getAttribute('data-val') || true,\n dataAttr = button.getAttribute('data-attr'),\n isToggleButton = (button.getAttribute('data-toggle') === 'true'),\n button3 = d3.select(button);\n\n // Use 'data-toggle' and 'buttonClicked' to toggle buttons\n // that have no one-to-one equivalent in fullLayout\n if(isToggleButton) {\n if(dataAttr === dataAttrClicked) {\n button3.classed('active', !button3.classed('active'));\n }\n }\n else {\n var val = (dataAttr === null) ?\n dataAttr :\n Lib.nestedProperty(fullLayout, dataAttr).get();\n\n button3.classed('active', val === thisval);\n }\n\n });\n};\n\n/**\n * Check if modeBar is configured as button configuration argument\n *\n * @Param {object} buttons 2d array of grouped button config objects\n * @Return {boolean}\n */\nproto.hasButtons = function(buttons) {\n var currentButtons = this.buttons;\n\n if(!currentButtons) return false;\n\n if(buttons.length !== currentButtons.length) return false;\n\n for(var i = 0; i < buttons.length; ++i) {\n if(buttons[i].length !== currentButtons[i].length) return false;\n for(var j = 0; j < buttons[i].length; j++) {\n if(buttons[i][j].name !== currentButtons[i][j].name) return false;\n }\n }\n\n return true;\n};\n\n/**\n * @return {HTMLDivElement} The logo image wrapped in a group\n */\nproto.getLogo = function() {\n var group = this.createGroup(),\n a = document.createElement('a');\n\n a.href = 'https://plot.ly/';\n a.target = '_blank';\n a.setAttribute('data-title', 'Produced with Plotly');\n a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';\n\n a.appendChild(this.createIcon(Icons.plotlylogo));\n\n group.appendChild(a);\n return group;\n};\n\nproto.removeAllButtons = function() {\n while(this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n\n this.hasLogo = false;\n};\n\nproto.destroy = function() {\n Lib.removeElement(this.container.querySelector('.modebar'));\n};\n\nfunction createModeBar(gd, buttons) {\n var fullLayout = gd._fullLayout;\n\n var modeBar = new ModeBar({\n graphInfo: gd,\n container: fullLayout._paperdiv.node(),\n buttons: buttons\n });\n\n if(fullLayout._privateplot) {\n d3.select(modeBar.element).append('span')\n .classed('badge-private float--left', true)\n .text('PRIVATE');\n }\n\n return modeBar;\n}\n\nmodule.exports = createModeBar;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/modebar/modebar.js\n// module id = 404\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Plotly = require('../../plotly');\nvar Plots = require('../../plots/plots');\nvar Axes = require('../../plots/cartesian/axes');\nvar Lib = require('../../lib');\nvar downloadImage = require('../../snapshot/download');\nvar Icons = require('../../../build/ploticon');\n\n\nvar modeBarButtons = module.exports = {};\n\n/**\n * ModeBar buttons configuration\n *\n * @param {string} name\n * name / id of the buttons (for tracking)\n * @param {string} title\n * text that appears while hovering over the button,\n * enter null, false or '' for no hover text\n * @param {string} icon\n * svg icon object associated with the button\n * can be linked to Plotly.Icons to use the default plotly icons\n * @param {string} [gravity]\n * icon positioning\n * @param {function} click\n * click handler associated with the button, a function of\n * 'gd' (the main graph object) and\n * 'ev' (the event object)\n * @param {string} [attr]\n * attribute associated with button,\n * use this with 'val' to keep track of the state\n * @param {*} [val]\n * initial 'attr' value, can be a function of gd\n * @param {boolean} [toggle]\n * is the button a toggle button?\n */\n\nmodeBarButtons.toImage = {\n name: 'toImage',\n title: 'Download plot as a png',\n icon: Icons.camera,\n click: function(gd) {\n var format = 'png';\n\n Lib.notifier('Taking snapshot - this may take a few seconds', 'long');\n\n if(Lib.isIE()) {\n Lib.notifier('IE only supports svg. Changing format to svg.', 'long');\n format = 'svg';\n }\n\n downloadImage(gd, {'format': format})\n .then(function(filename) {\n Lib.notifier('Snapshot succeeded - ' + filename, 'long');\n })\n .catch(function() {\n Lib.notifier('Sorry there was a problem downloading your snapshot!', 'long');\n });\n }\n};\n\nmodeBarButtons.sendDataToCloud = {\n name: 'sendDataToCloud',\n title: 'Save and edit plot in cloud',\n icon: Icons.disk,\n click: function(gd) {\n Plots.sendDataToCloud(gd);\n }\n};\n\nmodeBarButtons.zoom2d = {\n name: 'zoom2d',\n title: 'Zoom',\n attr: 'dragmode',\n val: 'zoom',\n icon: Icons.zoombox,\n click: handleCartesian\n};\n\nmodeBarButtons.pan2d = {\n name: 'pan2d',\n title: 'Pan',\n attr: 'dragmode',\n val: 'pan',\n icon: Icons.pan,\n click: handleCartesian\n};\n\nmodeBarButtons.select2d = {\n name: 'select2d',\n title: 'Box Select',\n attr: 'dragmode',\n val: 'select',\n icon: Icons.selectbox,\n click: handleCartesian\n};\n\nmodeBarButtons.lasso2d = {\n name: 'lasso2d',\n title: 'Lasso Select',\n attr: 'dragmode',\n val: 'lasso',\n icon: Icons.lasso,\n click: handleCartesian\n};\n\nmodeBarButtons.zoomIn2d = {\n name: 'zoomIn2d',\n title: 'Zoom in',\n attr: 'zoom',\n val: 'in',\n icon: Icons.zoom_plus,\n click: handleCartesian\n};\n\nmodeBarButtons.zoomOut2d = {\n name: 'zoomOut2d',\n title: 'Zoom out',\n attr: 'zoom',\n val: 'out',\n icon: Icons.zoom_minus,\n click: handleCartesian\n};\n\nmodeBarButtons.autoScale2d = {\n name: 'autoScale2d',\n title: 'Autoscale',\n attr: 'zoom',\n val: 'auto',\n icon: Icons.autoscale,\n click: handleCartesian\n};\n\nmodeBarButtons.resetScale2d = {\n name: 'resetScale2d',\n title: 'Reset axes',\n attr: 'zoom',\n val: 'reset',\n icon: Icons.home,\n click: handleCartesian\n};\n\nmodeBarButtons.hoverClosestCartesian = {\n name: 'hoverClosestCartesian',\n title: 'Show closest data on hover',\n attr: 'hovermode',\n val: 'closest',\n icon: Icons.tooltip_basic,\n gravity: 'ne',\n click: handleCartesian\n};\n\nmodeBarButtons.hoverCompareCartesian = {\n name: 'hoverCompareCartesian',\n title: 'Compare data on hover',\n attr: 'hovermode',\n val: function(gd) {\n return gd._fullLayout._isHoriz ? 'y' : 'x';\n },\n icon: Icons.tooltip_compare,\n gravity: 'ne',\n click: handleCartesian\n};\n\nfunction handleCartesian(gd, ev) {\n var button = ev.currentTarget,\n astr = button.getAttribute('data-attr'),\n val = button.getAttribute('data-val') || true,\n fullLayout = gd._fullLayout,\n aobj = {},\n axList = Axes.list(gd, null, true),\n ax,\n allEnabled = 'on',\n i;\n\n if(astr === 'zoom') {\n var mag = (val === 'in') ? 0.5 : 2,\n r0 = (1 + mag) / 2,\n r1 = (1 - mag) / 2;\n\n var axName;\n\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n\n if(!ax.fixedrange) {\n axName = ax._name;\n if(val === 'auto') aobj[axName + '.autorange'] = true;\n else if(val === 'reset') {\n if(ax._rangeInitial === undefined) {\n aobj[axName + '.autorange'] = true;\n }\n else {\n var rangeInitial = ax._rangeInitial.slice();\n aobj[axName + '.range[0]'] = rangeInitial[0];\n aobj[axName + '.range[1]'] = rangeInitial[1];\n }\n if(ax._showSpikeInitial !== undefined) {\n aobj[axName + '.showspikes'] = ax._showSpikeInitial;\n if(allEnabled === 'on' && !ax._showSpikeInitial) {\n allEnabled = 'off';\n }\n }\n }\n else {\n var rangeNow = [\n ax.r2l(ax.range[0]),\n ax.r2l(ax.range[1]),\n ];\n\n var rangeNew = [\n r0 * rangeNow[0] + r1 * rangeNow[1],\n r0 * rangeNow[1] + r1 * rangeNow[0]\n ];\n\n aobj[axName + '.range[0]'] = ax.l2r(rangeNew[0]);\n aobj[axName + '.range[1]'] = ax.l2r(rangeNew[1]);\n }\n }\n }\n fullLayout._cartesianSpikesEnabled = allEnabled;\n }\n else {\n // if ALL traces have orientation 'h', 'hovermode': 'x' otherwise: 'y'\n if(astr === 'hovermode' && (val === 'x' || val === 'y')) {\n val = fullLayout._isHoriz ? 'y' : 'x';\n button.setAttribute('data-val', val);\n if(val !== 'closest') {\n fullLayout._cartesianSpikesEnabled = 'off';\n }\n } else if(astr === 'hovermode' && val === 'closest') {\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n if(allEnabled === 'on' && !ax.showspikes) {\n allEnabled = 'off';\n }\n }\n fullLayout._cartesianSpikesEnabled = allEnabled;\n }\n\n aobj[astr] = val;\n }\n\n Plotly.relayout(gd, aobj);\n}\n\nmodeBarButtons.zoom3d = {\n name: 'zoom3d',\n title: 'Zoom',\n attr: 'scene.dragmode',\n val: 'zoom',\n icon: Icons.zoombox,\n click: handleDrag3d\n};\n\nmodeBarButtons.pan3d = {\n name: 'pan3d',\n title: 'Pan',\n attr: 'scene.dragmode',\n val: 'pan',\n icon: Icons.pan,\n click: handleDrag3d\n};\n\nmodeBarButtons.orbitRotation = {\n name: 'orbitRotation',\n title: 'orbital rotation',\n attr: 'scene.dragmode',\n val: 'orbit',\n icon: Icons['3d_rotate'],\n click: handleDrag3d\n};\n\nmodeBarButtons.tableRotation = {\n name: 'tableRotation',\n title: 'turntable rotation',\n attr: 'scene.dragmode',\n val: 'turntable',\n icon: Icons['z-axis'],\n click: handleDrag3d\n};\n\nfunction handleDrag3d(gd, ev) {\n var button = ev.currentTarget,\n attr = button.getAttribute('data-attr'),\n val = button.getAttribute('data-val') || true,\n fullLayout = gd._fullLayout,\n sceneIds = Plots.getSubplotIds(fullLayout, 'gl3d'),\n layoutUpdate = {};\n\n var parts = attr.split('.');\n\n for(var i = 0; i < sceneIds.length; i++) {\n layoutUpdate[sceneIds[i] + '.' + parts[1]] = val;\n }\n\n Plotly.relayout(gd, layoutUpdate);\n}\n\nmodeBarButtons.resetCameraDefault3d = {\n name: 'resetCameraDefault3d',\n title: 'Reset camera to default',\n attr: 'resetDefault',\n icon: Icons.home,\n click: handleCamera3d\n};\n\nmodeBarButtons.resetCameraLastSave3d = {\n name: 'resetCameraLastSave3d',\n title: 'Reset camera to last save',\n attr: 'resetLastSave',\n icon: Icons.movie,\n click: handleCamera3d\n};\n\nfunction handleCamera3d(gd, ev) {\n var button = ev.currentTarget,\n attr = button.getAttribute('data-attr'),\n fullLayout = gd._fullLayout,\n sceneIds = Plots.getSubplotIds(fullLayout, 'gl3d'),\n aobj = {};\n\n for(var i = 0; i < sceneIds.length; i++) {\n var sceneId = sceneIds[i],\n key = sceneId + '.camera',\n scene = fullLayout[sceneId]._scene;\n\n if(attr === 'resetDefault') {\n aobj[key] = null;\n }\n else if(attr === 'resetLastSave') {\n aobj[key] = Lib.extendDeep({}, scene.cameraInitial);\n }\n }\n\n Plotly.relayout(gd, aobj);\n}\n\nmodeBarButtons.hoverClosest3d = {\n name: 'hoverClosest3d',\n title: 'Toggle show closest data on hover',\n attr: 'hovermode',\n val: null,\n toggle: true,\n icon: Icons.tooltip_basic,\n gravity: 'ne',\n click: handleHover3d\n};\n\nfunction handleHover3d(gd, ev) {\n var button = ev.currentTarget,\n val = button._previousVal || false,\n layout = gd.layout,\n fullLayout = gd._fullLayout,\n sceneIds = Plots.getSubplotIds(fullLayout, 'gl3d');\n\n var axes = ['xaxis', 'yaxis', 'zaxis'],\n spikeAttrs = ['showspikes', 'spikesides', 'spikethickness', 'spikecolor'];\n\n // initialize 'current spike' object to be stored in the DOM\n var currentSpikes = {},\n axisSpikes = {},\n layoutUpdate = {};\n\n if(val) {\n layoutUpdate = Lib.extendDeep(layout, val);\n button._previousVal = null;\n }\n else {\n layoutUpdate = {\n 'allaxes.showspikes': false\n };\n\n for(var i = 0; i < sceneIds.length; i++) {\n var sceneId = sceneIds[i],\n sceneLayout = fullLayout[sceneId],\n sceneSpikes = currentSpikes[sceneId] = {};\n\n sceneSpikes.hovermode = sceneLayout.hovermode;\n layoutUpdate[sceneId + '.hovermode'] = false;\n\n // copy all the current spike attrs\n for(var j = 0; j < 3; j++) {\n var axis = axes[j];\n axisSpikes = sceneSpikes[axis] = {};\n\n for(var k = 0; k < spikeAttrs.length; k++) {\n var spikeAttr = spikeAttrs[k];\n axisSpikes[spikeAttr] = sceneLayout[axis][spikeAttr];\n }\n }\n }\n\n button._previousVal = Lib.extendDeep({}, currentSpikes);\n }\n\n Plotly.relayout(gd, layoutUpdate);\n}\n\nmodeBarButtons.zoomInGeo = {\n name: 'zoomInGeo',\n title: 'Zoom in',\n attr: 'zoom',\n val: 'in',\n icon: Icons.zoom_plus,\n click: handleGeo\n};\n\nmodeBarButtons.zoomOutGeo = {\n name: 'zoomOutGeo',\n title: 'Zoom out',\n attr: 'zoom',\n val: 'out',\n icon: Icons.zoom_minus,\n click: handleGeo\n};\n\nmodeBarButtons.resetGeo = {\n name: 'resetGeo',\n title: 'Reset',\n attr: 'reset',\n val: null,\n icon: Icons.autoscale,\n click: handleGeo\n};\n\nmodeBarButtons.hoverClosestGeo = {\n name: 'hoverClosestGeo',\n title: 'Toggle show closest data on hover',\n attr: 'hovermode',\n val: null,\n toggle: true,\n icon: Icons.tooltip_basic,\n gravity: 'ne',\n click: toggleHover\n};\n\nfunction handleGeo(gd, ev) {\n var button = ev.currentTarget;\n var attr = button.getAttribute('data-attr');\n var val = button.getAttribute('data-val') || true;\n var fullLayout = gd._fullLayout;\n var geoIds = Plots.getSubplotIds(fullLayout, 'geo');\n\n for(var i = 0; i < geoIds.length; i++) {\n var id = geoIds[i];\n var geoLayout = fullLayout[id];\n\n if(attr === 'zoom') {\n var scale = geoLayout.projection.scale;\n var newScale = (val === 'in') ? 2 * scale : 0.5 * scale;\n\n Plotly.relayout(gd, id + '.projection.scale', newScale);\n } else if(attr === 'reset') {\n resetView(gd, 'geo');\n }\n }\n}\n\nmodeBarButtons.hoverClosestGl2d = {\n name: 'hoverClosestGl2d',\n title: 'Toggle show closest data on hover',\n attr: 'hovermode',\n val: null,\n toggle: true,\n icon: Icons.tooltip_basic,\n gravity: 'ne',\n click: toggleHover\n};\n\nmodeBarButtons.hoverClosestPie = {\n name: 'hoverClosestPie',\n title: 'Toggle show closest data on hover',\n attr: 'hovermode',\n val: 'closest',\n icon: Icons.tooltip_basic,\n gravity: 'ne',\n click: toggleHover\n};\n\nfunction toggleHover(gd) {\n var fullLayout = gd._fullLayout;\n\n var onHoverVal;\n if(fullLayout._has('cartesian')) {\n onHoverVal = fullLayout._isHoriz ? 'y' : 'x';\n }\n else onHoverVal = 'closest';\n\n var newHover = gd._fullLayout.hovermode ? false : onHoverVal;\n\n Plotly.relayout(gd, 'hovermode', newHover);\n}\n\n// buttons when more then one plot types are present\n\nmodeBarButtons.toggleHover = {\n name: 'toggleHover',\n title: 'Toggle show closest data on hover',\n attr: 'hovermode',\n val: null,\n toggle: true,\n icon: Icons.tooltip_basic,\n gravity: 'ne',\n click: function(gd, ev) {\n toggleHover(gd);\n\n // the 3d hovermode update must come\n // last so that layout.hovermode update does not\n // override scene?.hovermode?.layout.\n handleHover3d(gd, ev);\n }\n};\n\nmodeBarButtons.resetViews = {\n name: 'resetViews',\n title: 'Reset views',\n icon: Icons.home,\n click: function(gd, ev) {\n var button = ev.currentTarget;\n\n button.setAttribute('data-attr', 'zoom');\n button.setAttribute('data-val', 'reset');\n handleCartesian(gd, ev);\n\n button.setAttribute('data-attr', 'resetLastSave');\n handleCamera3d(gd, ev);\n\n resetView(gd, 'geo');\n resetView(gd, 'mapbox');\n }\n};\n\nmodeBarButtons.toggleSpikelines = {\n name: 'toggleSpikelines',\n title: 'Toggle Spike Lines',\n icon: Icons.spikeline,\n attr: '_cartesianSpikesEnabled',\n val: 'on',\n click: function(gd) {\n var fullLayout = gd._fullLayout;\n\n fullLayout._cartesianSpikesEnabled = fullLayout.hovermode === 'closest' ?\n (fullLayout._cartesianSpikesEnabled === 'on' ? 'off' : 'on') : 'on';\n\n var aobj = setSpikelineVisibility(gd);\n\n aobj.hovermode = 'closest';\n Plotly.relayout(gd, aobj);\n }\n};\n\nfunction setSpikelineVisibility(gd) {\n var fullLayout = gd._fullLayout,\n axList = Axes.list(gd, null, true),\n ax,\n axName,\n aobj = {};\n\n for(var i = 0; i < axList.length; i++) {\n ax = axList[i];\n axName = ax._name;\n aobj[axName + '.showspikes'] = fullLayout._cartesianSpikesEnabled === 'on' ? true : false;\n }\n\n return aobj;\n}\n\nmodeBarButtons.resetViewMapbox = {\n name: 'resetViewMapbox',\n title: 'Reset view',\n attr: 'reset',\n icon: Icons.home,\n click: function(gd) {\n resetView(gd, 'mapbox');\n }\n};\n\nfunction resetView(gd, subplotType) {\n var fullLayout = gd._fullLayout;\n var subplotIds = Plots.getSubplotIds(fullLayout, subplotType);\n var aObj = {};\n\n for(var i = 0; i < subplotIds.length; i++) {\n var id = subplotIds[i];\n var subplotObj = fullLayout[id]._subplot;\n var viewInitial = subplotObj.viewInitial;\n var viewKeys = Object.keys(viewInitial);\n\n for(var j = 0; j < viewKeys.length; j++) {\n var key = viewKeys[j];\n aObj[id + '.' + key] = viewInitial[key];\n }\n }\n\n Plotly.relayout(gd, aObj);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/modebar/buttons.js\n// module id = 405\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n/*\n* substantial portions of this code from FileSaver.js\n* https://github.com/eligrey/FileSaver.js\n* License: https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n* FileSaver.js\n* A saveAs() FileSaver implementation.\n* 1.1.20160328\n*\n* By Eli Grey, http://eligrey.com\n* License: MIT\n* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n*/\n\n'use strict';\n\nvar fileSaver = function(url, name) {\n var saveLink = document.createElement('a');\n var canUseSaveLink = 'download' in saveLink;\n var isSafari = /Version\\/[\\d\\.]+.*Safari/.test(navigator.userAgent);\n var promise = new Promise(function(resolve, reject) {\n // IE <10 is explicitly unsupported\n if(typeof navigator !== 'undefined' && /MSIE [1-9]\\./.test(navigator.userAgent)) {\n reject(new Error('IE < 10 unsupported'));\n }\n\n // First try a.download, then web filesystem, then object URLs\n if(isSafari) {\n // Safari doesn't allow downloading of blob urls\n document.location.href = 'data:application/octet-stream' + url.slice(url.search(/[,;]/));\n resolve(name);\n }\n\n if(!name) {\n name = 'download';\n }\n\n if(canUseSaveLink) {\n saveLink.href = url;\n saveLink.download = name;\n document.body.appendChild(saveLink);\n saveLink.click();\n document.body.removeChild(saveLink);\n resolve(name);\n }\n\n // IE 10+ (native saveAs)\n if(typeof navigator !== 'undefined' && navigator.msSaveBlob) {\n // At this point we are only dealing with a SVG encoded as\n // a data URL (since IE only supports SVG)\n var encoded = url.split(/^data:image\\/svg\\+xml,/)[1];\n var svg = decodeURIComponent(encoded);\n navigator.msSaveBlob(new Blob([svg]), name);\n resolve(name);\n }\n\n reject(new Error('download error'));\n });\n\n return promise;\n};\n\nmodule.exports = fileSaver;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/snapshot/filesaver.js\n// module id = 406\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\nvar hasHover = require('has-hover');\n\nvar Plotly = require('../plotly');\nvar Lib = require('../lib');\nvar Events = require('../lib/events');\nvar Queue = require('../lib/queue');\n\nvar Registry = require('../registry');\nvar PlotSchema = require('./plot_schema');\nvar Plots = require('../plots/plots');\nvar Polar = require('../plots/polar');\nvar initInteractions = require('../plots/cartesian/graph_interact');\n\nvar Drawing = require('../components/drawing');\nvar Color = require('../components/color');\nvar ErrorBars = require('../components/errorbars');\nvar xmlnsNamespaces = require('../constants/xmlns_namespaces');\nvar svgTextUtils = require('../lib/svg_text_utils');\n\nvar manageArrays = require('./manage_arrays');\nvar helpers = require('./helpers');\nvar subroutines = require('./subroutines');\nvar editTypes = require('./edit_types');\n\nvar cartesianConstants = require('../plots/cartesian/constants');\nvar axisConstraints = require('../plots/cartesian/constraints');\nvar enforceAxisConstraints = axisConstraints.enforce;\nvar cleanAxisConstraints = axisConstraints.clean;\nvar axisIds = require('../plots/cartesian/axis_ids');\n\n\n/**\n * Main plot-creation function\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n * @param {array of objects} data\n * array of traces, containing the data and display information for each trace\n * @param {object} layout\n * object describing the overall display of the plot,\n * all the stuff that doesn't pertain to any individual trace\n * @param {object} config\n * configuration options (see ./plot_config.js for more info)\n *\n */\nPlotly.plot = function(gd, data, layout, config) {\n var frames;\n\n gd = Lib.getGraphDiv(gd);\n\n // Events.init is idempotent and bails early if gd has already been init'd\n Events.init(gd);\n\n if(Lib.isPlainObject(data)) {\n var obj = data;\n data = obj.data;\n layout = obj.layout;\n config = obj.config;\n frames = obj.frames;\n }\n\n var okToPlot = Events.triggerHandler(gd, 'plotly_beforeplot', [data, layout, config]);\n if(okToPlot === false) return Promise.reject();\n\n // if there's no data or layout, and this isn't yet a plotly plot\n // container, log a warning to help plotly.js users debug\n if(!data && !layout && !Lib.isPlotDiv(gd)) {\n Lib.warn('Calling Plotly.plot as if redrawing ' +\n 'but this container doesn\\'t yet have a plot.', gd);\n }\n\n function addFrames() {\n if(frames) {\n return Plotly.addFrames(gd, frames);\n }\n }\n\n // transfer configuration options to gd until we move over to\n // a more OO like model\n setPlotContext(gd, config);\n\n if(!layout) layout = {};\n\n // hook class for plots main container (in case of plotly.js\n // this won't be #embedded-graph or .js-tab-contents)\n d3.select(gd).classed('js-plotly-plot', true);\n\n // off-screen getBoundingClientRect testing space,\n // in #js-plotly-tester (and stored as Drawing.tester)\n // so we can share cached text across tabs\n Drawing.makeTester();\n\n // collect promises for any async actions during plotting\n // any part of the plotting code can push to gd._promises, then\n // before we move to the next step, we check that they're all\n // complete, and empty out the promise list again.\n if(!Array.isArray(gd._promises)) gd._promises = [];\n\n var graphWasEmpty = ((gd.data || []).length === 0 && Array.isArray(data));\n\n // if there is already data on the graph, append the new data\n // if you only want to redraw, pass a non-array for data\n if(Array.isArray(data)) {\n helpers.cleanData(data, gd.data);\n\n if(graphWasEmpty) gd.data = data;\n else gd.data.push.apply(gd.data, data);\n\n // for routines outside graph_obj that want a clean tab\n // (rather than appending to an existing one) gd.empty\n // is used to determine whether to make a new tab\n gd.empty = false;\n }\n\n if(!gd.layout || graphWasEmpty) gd.layout = helpers.cleanLayout(layout);\n\n // if the user is trying to drag the axes, allow new data and layout\n // to come in but don't allow a replot.\n if(gd._dragging && !gd._transitioning) {\n // signal to drag handler that after everything else is done\n // we need to replot, because something has changed\n gd._replotPending = true;\n return Promise.reject();\n } else {\n // we're going ahead with a replot now\n gd._replotPending = false;\n }\n\n Plots.supplyDefaults(gd);\n\n var fullLayout = gd._fullLayout;\n\n // Polar plots\n if(data && data[0] && data[0].r) return plotPolar(gd, data, layout);\n\n // so we don't try to re-call Plotly.plot from inside\n // legend and colorbar, if margins changed\n fullLayout._replotting = true;\n\n // make or remake the framework if we need to\n if(graphWasEmpty) makePlotFramework(gd);\n\n // polar need a different framework\n if(gd.framework !== makePlotFramework) {\n gd.framework = makePlotFramework;\n makePlotFramework(gd);\n }\n\n // clear gradient defs on each .plot call, because we know we'll loop through all traces\n Drawing.initGradients(gd);\n\n // save initial show spikes once per graph\n if(graphWasEmpty) Plotly.Axes.saveShowSpikeInitial(gd);\n\n // prepare the data and find the autorange\n\n // generate calcdata, if we need to\n // to force redoing calcdata, just delete it before calling Plotly.plot\n var recalc = !gd.calcdata || gd.calcdata.length !== (gd._fullData || []).length;\n if(recalc) Plots.doCalcdata(gd);\n\n // in case it has changed, attach fullData traces to calcdata\n for(var i = 0; i < gd.calcdata.length; i++) {\n gd.calcdata[i][0].trace = gd._fullData[i];\n }\n\n /*\n * start async-friendly code - now we're actually drawing things\n */\n\n var oldmargins = JSON.stringify(fullLayout._size);\n\n // draw framework first so that margin-pushing\n // components can position themselves correctly\n function drawFramework() {\n var basePlotModules = fullLayout._basePlotModules;\n\n for(var i = 0; i < basePlotModules.length; i++) {\n if(basePlotModules[i].drawFramework) {\n basePlotModules[i].drawFramework(gd);\n }\n }\n\n return Lib.syncOrAsync([\n subroutines.layoutStyles\n ], gd);\n }\n\n // draw anything that can affect margins.\n function marginPushers() {\n var calcdata = gd.calcdata;\n var i, cd, trace;\n\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\n for(i = 0; i < calcdata.length; i++) {\n cd = calcdata[i];\n trace = cd[0].trace;\n if(trace.visible !== true || !trace._module.colorbar) {\n Plots.autoMargin(gd, 'cb' + trace.uid);\n }\n else trace._module.colorbar(gd, cd);\n }\n\n Plots.doAutoMargin(gd);\n return Plots.previousPromises(gd);\n }\n\n // in case the margins changed, draw margin pushers again\n function marginPushersAgain() {\n if(JSON.stringify(fullLayout._size) === oldmargins) return;\n\n return Lib.syncOrAsync([\n marginPushers,\n subroutines.layoutStyles\n ], gd);\n }\n\n function positionAndAutorange() {\n if(!recalc) {\n enforceAxisConstraints(gd);\n return;\n }\n\n var subplots = Plots.getSubplotIds(fullLayout, 'cartesian');\n var modules = fullLayout._modules;\n var setPositionsArray = [];\n\n // position and range calculations for traces that\n // depend on each other ie bars (stacked or grouped)\n // and boxes (grouped) push each other out of the way\n\n var subplotInfo, i, j;\n\n for(j = 0; j < modules.length; j++) {\n Lib.pushUnique(setPositionsArray, modules[j].setPositions);\n }\n\n if(setPositionsArray.length) {\n for(i = 0; i < subplots.length; i++) {\n subplotInfo = fullLayout._plots[subplots[i]];\n\n for(j = 0; j < setPositionsArray.length; j++) {\n setPositionsArray[j](gd, subplotInfo);\n }\n }\n }\n\n // calc and autorange for errorbars\n ErrorBars.calc(gd);\n\n // TODO: autosize extra for text markers and images\n // see https://github.com/plotly/plotly.js/issues/1111\n return Lib.syncOrAsync([\n Registry.getComponentMethod('shapes', 'calcAutorange'),\n Registry.getComponentMethod('annotations', 'calcAutorange'),\n doAutoRangeAndConstraints,\n Registry.getComponentMethod('rangeslider', 'calcAutorange')\n ], gd);\n }\n\n function doAutoRangeAndConstraints() {\n if(gd._transitioning) return;\n\n var axList = Plotly.Axes.list(gd, '', true);\n for(var i = 0; i < axList.length; i++) {\n var ax = axList[i];\n cleanAxisConstraints(gd, ax);\n\n Plotly.Axes.doAutoRange(ax);\n }\n\n enforceAxisConstraints(gd);\n\n // store initial ranges *after* enforcing constraints, otherwise\n // we will never look like we're at the initial ranges\n if(graphWasEmpty) Plotly.Axes.saveRangeInitial(gd);\n }\n\n // draw ticks, titles, and calculate axis scaling (._b, ._m)\n function drawAxes() {\n return Plotly.Axes.doTicks(gd, 'redraw');\n }\n\n // Now plot the data\n function drawData() {\n var calcdata = gd.calcdata,\n i,\n rangesliderContainers = fullLayout._infolayer.selectAll('g.rangeslider-container');\n\n // in case of traces that were heatmaps or contour maps\n // previously, remove them and their colorbars explicitly\n for(i = 0; i < calcdata.length; i++) {\n var trace = calcdata[i][0].trace,\n isVisible = (trace.visible === true),\n uid = trace.uid;\n\n if(!isVisible || !Registry.traceIs(trace, '2dMap')) {\n var query = (\n '.hm' + uid +\n ',.contour' + uid +\n ',#clip' + uid\n );\n\n fullLayout._paper\n .selectAll(query)\n .remove();\n\n rangesliderContainers\n .selectAll(query)\n .remove();\n }\n\n if(!isVisible || !trace._module.colorbar) {\n fullLayout._infolayer.selectAll('.cb' + uid).remove();\n }\n }\n\n // loop over the base plot modules present on graph\n var basePlotModules = fullLayout._basePlotModules;\n for(i = 0; i < basePlotModules.length; i++) {\n basePlotModules[i].plot(gd);\n }\n\n // keep reference to shape layers in subplots\n var layerSubplot = fullLayout._paper.selectAll('.layer-subplot');\n fullLayout._shapeSubplotLayers = layerSubplot.selectAll('.shapelayer');\n\n // styling separate from drawing\n Plots.style(gd);\n\n // show annotations and shapes\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n\n // source links\n Plots.addLinks(gd);\n\n // Mark the first render as complete\n fullLayout._replotting = false;\n\n return Plots.previousPromises(gd);\n }\n\n // An initial paint must be completed before these components can be\n // correctly sized and the whole plot re-margined. fullLayout._replotting must\n // be set to false before these will work properly.\n function finalDraw() {\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n }\n\n var seq = [\n Plots.previousPromises,\n addFrames,\n drawFramework,\n marginPushers,\n marginPushersAgain,\n positionAndAutorange,\n subroutines.layoutStyles,\n drawAxes,\n drawData,\n finalDraw,\n initInteractions,\n Plots.rehover,\n Plots.previousPromises\n ];\n\n // even if everything we did was synchronous, return a promise\n // so that the caller doesn't care which route we took\n var plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve();\n\n return plotDone.then(function() {\n gd.emit('plotly_afterplot');\n return gd;\n });\n};\n\nfunction setBackground(gd, bgColor) {\n try {\n gd._fullLayout._paper.style('background', bgColor);\n } catch(e) {\n Lib.error(e);\n }\n}\n\nfunction opaqueSetBackground(gd, bgColor) {\n var blend = Color.combine(bgColor, 'white');\n setBackground(gd, blend);\n}\n\nfunction setPlotContext(gd, config) {\n if(!gd._context) gd._context = Lib.extendDeep({}, Plotly.defaultConfig);\n var context = gd._context;\n\n var i, keys, key;\n\n if(config) {\n keys = Object.keys(config);\n for(i = 0; i < keys.length; i++) {\n key = keys[i];\n if(key === 'editable' || key === 'edits') continue;\n if(key in context) {\n if(key === 'setBackground' && config[key] === 'opaque') {\n context[key] = opaqueSetBackground;\n } else {\n context[key] = config[key];\n }\n }\n }\n\n // map plot3dPixelRatio to plotGlPixelRatio for backward compatibility\n if(config.plot3dPixelRatio && !context.plotGlPixelRatio) {\n context.plotGlPixelRatio = context.plot3dPixelRatio;\n }\n\n // now deal with editable and edits - first editable overrides\n // everything, then edits refines\n var editable = config.editable;\n if(editable !== undefined) {\n // we're not going to *use* context.editable, we're only going to\n // use context.edits... but keep it for the record\n context.editable = editable;\n\n keys = Object.keys(context.edits);\n for(i = 0; i < keys.length; i++) {\n context.edits[keys[i]] = editable;\n }\n }\n if(config.edits) {\n keys = Object.keys(config.edits);\n for(i = 0; i < keys.length; i++) {\n key = keys[i];\n if(key in context.edits) {\n context.edits[key] = config.edits[key];\n }\n }\n }\n }\n\n // staticPlot forces a bunch of others:\n if(context.staticPlot) {\n context.editable = false;\n context.edits = {};\n context.autosizable = false;\n context.scrollZoom = false;\n context.doubleClick = false;\n context.showTips = false;\n context.showLink = false;\n context.displayModeBar = false;\n }\n\n // make sure hover-only devices have mode bar visible\n if(context.displayModeBar === 'hover' && !hasHover) {\n context.displayModeBar = true;\n }\n\n // default and fallback for setBackground\n if(context.setBackground === 'transparent' || typeof context.setBackground !== 'function') {\n context.setBackground = setBackground;\n }\n}\n\nfunction plotPolar(gd, data, layout) {\n // build or reuse the container skeleton\n var plotContainer = d3.select(gd).selectAll('.plot-container')\n .data([0]);\n plotContainer.enter()\n .insert('div', ':first-child')\n .classed('plot-container plotly', true);\n var paperDiv = plotContainer.selectAll('.svg-container')\n .data([0]);\n paperDiv.enter().append('div')\n .classed('svg-container', true)\n .style('position', 'relative');\n\n // empty it everytime for now\n paperDiv.html('');\n\n // fulfill gd requirements\n if(data) gd.data = data;\n if(layout) gd.layout = layout;\n Polar.manager.fillLayout(gd);\n\n // resize canvas\n paperDiv.style({\n width: gd._fullLayout.width + 'px',\n height: gd._fullLayout.height + 'px'\n });\n\n // instantiate framework\n gd.framework = Polar.manager.framework(gd);\n\n // plot\n gd.framework({data: gd.data, layout: gd.layout}, paperDiv.node());\n\n // set undo point\n gd.framework.setUndoPoint();\n\n // get the resulting svg for extending it\n var polarPlotSVG = gd.framework.svg();\n\n // editable title\n var opacity = 1;\n var txt = gd._fullLayout.title;\n if(txt === '' || !txt) opacity = 0;\n var placeholderText = 'Click to enter title';\n\n var titleLayout = function() {\n this.call(svgTextUtils.convertToTspans, gd);\n // TODO: html/mathjax\n // TODO: center title\n };\n\n var title = polarPlotSVG.select('.title-group text')\n .call(titleLayout);\n\n if(gd._context.edits.titleText) {\n if(!txt || txt === placeholderText) {\n opacity = 0.2;\n // placeholder is not going through convertToTspans\n // so needs explicit data-unformatted\n title.attr({'data-unformatted': placeholderText})\n .text(placeholderText)\n .style({opacity: opacity})\n .on('mouseover.opacity', function() {\n d3.select(this).transition().duration(100)\n .style('opacity', 1);\n })\n .on('mouseout.opacity', function() {\n d3.select(this).transition().duration(1000)\n .style('opacity', 0);\n });\n }\n\n var setContenteditable = function() {\n this.call(svgTextUtils.makeEditable, {gd: gd})\n .on('edit', function(text) {\n gd.framework({layout: {title: text}});\n this.text(text)\n .call(titleLayout);\n this.call(setContenteditable);\n })\n .on('cancel', function() {\n var txt = this.attr('data-unformatted');\n this.text(txt).call(titleLayout);\n });\n };\n title.call(setContenteditable);\n }\n\n gd._context.setBackground(gd, gd._fullLayout.paper_bgcolor);\n Plots.addLinks(gd);\n\n return Promise.resolve();\n}\n\n// convenience function to force a full redraw, mostly for use by plotly.js\nPlotly.redraw = function(gd) {\n gd = Lib.getGraphDiv(gd);\n\n if(!Lib.isPlotDiv(gd)) {\n throw new Error('This element is not a Plotly plot: ' + gd);\n }\n\n helpers.cleanData(gd.data, gd.data);\n helpers.cleanLayout(gd.layout);\n\n gd.calcdata = undefined;\n return Plotly.plot(gd).then(function() {\n gd.emit('plotly_redraw');\n return gd;\n });\n};\n\n/**\n * Convenience function to make idempotent plot option obvious to users.\n *\n * @param gd\n * @param {Object[]} data\n * @param {Object} layout\n * @param {Object} config\n */\nPlotly.newPlot = function(gd, data, layout, config) {\n gd = Lib.getGraphDiv(gd);\n\n // remove gl contexts\n Plots.cleanPlot([], {}, gd._fullData || {}, gd._fullLayout || {});\n\n Plots.purge(gd);\n return Plotly.plot(gd, data, layout, config);\n};\n\n/**\n * Wrap negative indicies to their positive counterparts.\n *\n * @param {Number[]} indices An array of indices\n * @param {Number} maxIndex The maximum index allowable (arr.length - 1)\n */\nfunction positivifyIndices(indices, maxIndex) {\n var parentLength = maxIndex + 1,\n positiveIndices = [],\n i,\n index;\n\n for(i = 0; i < indices.length; i++) {\n index = indices[i];\n if(index < 0) {\n positiveIndices.push(parentLength + index);\n } else {\n positiveIndices.push(index);\n }\n }\n return positiveIndices;\n}\n\n/**\n * Ensures that an index array for manipulating gd.data is valid.\n *\n * Intended for use with addTraces, deleteTraces, and moveTraces.\n *\n * @param gd\n * @param indices\n * @param arrayName\n */\nfunction assertIndexArray(gd, indices, arrayName) {\n var i,\n index;\n\n for(i = 0; i < indices.length; i++) {\n index = indices[i];\n\n // validate that indices are indeed integers\n if(index !== parseInt(index, 10)) {\n throw new Error('all values in ' + arrayName + ' must be integers');\n }\n\n // check that all indices are in bounds for given gd.data array length\n if(index >= gd.data.length || index < -gd.data.length) {\n throw new Error(arrayName + ' must be valid indices for gd.data.');\n }\n\n // check that indices aren't repeated\n if(indices.indexOf(index, i + 1) > -1 ||\n index >= 0 && indices.indexOf(-gd.data.length + index) > -1 ||\n index < 0 && indices.indexOf(gd.data.length + index) > -1) {\n throw new Error('each index in ' + arrayName + ' must be unique.');\n }\n }\n}\n\n/**\n * Private function used by Plotly.moveTraces to check input args\n *\n * @param gd\n * @param currentIndices\n * @param newIndices\n */\nfunction checkMoveTracesArgs(gd, currentIndices, newIndices) {\n\n // check that gd has attribute 'data' and 'data' is array\n if(!Array.isArray(gd.data)) {\n throw new Error('gd.data must be an array.');\n }\n\n // validate currentIndices array\n if(typeof currentIndices === 'undefined') {\n throw new Error('currentIndices is a required argument.');\n } else if(!Array.isArray(currentIndices)) {\n currentIndices = [currentIndices];\n }\n assertIndexArray(gd, currentIndices, 'currentIndices');\n\n // validate newIndices array if it exists\n if(typeof newIndices !== 'undefined' && !Array.isArray(newIndices)) {\n newIndices = [newIndices];\n }\n if(typeof newIndices !== 'undefined') {\n assertIndexArray(gd, newIndices, 'newIndices');\n }\n\n // check currentIndices and newIndices are the same length if newIdices exists\n if(typeof newIndices !== 'undefined' && currentIndices.length !== newIndices.length) {\n throw new Error('current and new indices must be of equal length.');\n }\n\n}\n/**\n * A private function to reduce the type checking clutter in addTraces.\n *\n * @param gd\n * @param traces\n * @param newIndices\n */\nfunction checkAddTracesArgs(gd, traces, newIndices) {\n var i, value;\n\n // check that gd has attribute 'data' and 'data' is array\n if(!Array.isArray(gd.data)) {\n throw new Error('gd.data must be an array.');\n }\n\n // make sure traces exists\n if(typeof traces === 'undefined') {\n throw new Error('traces must be defined.');\n }\n\n // make sure traces is an array\n if(!Array.isArray(traces)) {\n traces = [traces];\n }\n\n // make sure each value in traces is an object\n for(i = 0; i < traces.length; i++) {\n value = traces[i];\n if(typeof value !== 'object' || (Array.isArray(value) || value === null)) {\n throw new Error('all values in traces array must be non-array objects');\n }\n }\n\n // make sure we have an index for each trace\n if(typeof newIndices !== 'undefined' && !Array.isArray(newIndices)) {\n newIndices = [newIndices];\n }\n if(typeof newIndices !== 'undefined' && newIndices.length !== traces.length) {\n throw new Error(\n 'if indices is specified, traces.length must equal indices.length'\n );\n }\n}\n\n/**\n * A private function to reduce the type checking clutter in spliceTraces.\n * Get all update Properties from gd.data. Validate inputs and outputs.\n * Used by prependTrace and extendTraces\n *\n * @param gd\n * @param update\n * @param indices\n * @param maxPoints\n */\nfunction assertExtendTracesArgs(gd, update, indices, maxPoints) {\n\n var maxPointsIsObject = Lib.isPlainObject(maxPoints);\n\n if(!Array.isArray(gd.data)) {\n throw new Error('gd.data must be an array');\n }\n if(!Lib.isPlainObject(update)) {\n throw new Error('update must be a key:value object');\n }\n\n if(typeof indices === 'undefined') {\n throw new Error('indices must be an integer or array of integers');\n }\n\n assertIndexArray(gd, indices, 'indices');\n\n for(var key in update) {\n\n /*\n * Verify that the attribute to be updated contains as many trace updates\n * as indices. Failure must result in throw and no-op\n */\n if(!Array.isArray(update[key]) || update[key].length !== indices.length) {\n throw new Error('attribute ' + key + ' must be an array of length equal to indices array length');\n }\n\n /*\n * if maxPoints is an object it must match keys and array lengths of 'update' 1:1\n */\n if(maxPointsIsObject &&\n (!(key in maxPoints) || !Array.isArray(maxPoints[key]) ||\n maxPoints[key].length !== update[key].length)) {\n throw new Error('when maxPoints is set as a key:value object it must contain a 1:1 ' +\n 'corrispondence with the keys and number of traces in the update object');\n }\n }\n}\n\n/**\n * A private function to reduce the type checking clutter in spliceTraces.\n *\n * @param {Object|HTMLDivElement} gd\n * @param {Object} update\n * @param {Number[]} indices\n * @param {Number||Object} maxPoints\n * @return {Object[]}\n */\nfunction getExtendProperties(gd, update, indices, maxPoints) {\n\n var maxPointsIsObject = Lib.isPlainObject(maxPoints),\n updateProps = [];\n var trace, target, prop, insert, maxp;\n\n // allow scalar index to represent a single trace position\n if(!Array.isArray(indices)) indices = [indices];\n\n // negative indices are wrapped around to their positive value. Equivalent to python indexing.\n indices = positivifyIndices(indices, gd.data.length - 1);\n\n // loop through all update keys and traces and harvest validated data.\n for(var key in update) {\n\n for(var j = 0; j < indices.length; j++) {\n\n /*\n * Choose the trace indexed by the indices map argument and get the prop setter-getter\n * instance that references the key and value for this particular trace.\n */\n trace = gd.data[indices[j]];\n prop = Lib.nestedProperty(trace, key);\n\n /*\n * Target is the existing gd.data.trace.dataArray value like \"x\" or \"marker.size\"\n * Target must exist as an Array to allow the extend operation to be performed.\n */\n target = prop.get();\n insert = update[key][j];\n\n if(!Array.isArray(insert)) {\n throw new Error('attribute: ' + key + ' index: ' + j + ' must be an array');\n }\n if(!Array.isArray(target)) {\n throw new Error('cannot extend missing or non-array attribute: ' + key);\n }\n\n /*\n * maxPoints may be an object map or a scalar. If object select the key:value, else\n * Use the scalar maxPoints for all key and trace combinations.\n */\n maxp = maxPointsIsObject ? maxPoints[key][j] : maxPoints;\n\n // could have chosen null here, -1 just tells us to not take a window\n if(!isNumeric(maxp)) maxp = -1;\n\n /*\n * Wrap the nestedProperty in an object containing required data\n * for lengthening and windowing this particular trace - key combination.\n * Flooring maxp mirrors the behaviour of floats in the Array.slice JSnative function.\n */\n updateProps.push({\n prop: prop,\n target: target,\n insert: insert,\n maxp: Math.floor(maxp)\n });\n }\n }\n\n // all target and insertion data now validated\n return updateProps;\n}\n\n/**\n * A private function to key Extend and Prepend traces DRY\n *\n * @param {Object|HTMLDivElement} gd\n * @param {Object} update\n * @param {Number[]} indices\n * @param {Number||Object} maxPoints\n * @param {Function} lengthenArray\n * @param {Function} spliceArray\n * @return {Object}\n */\nfunction spliceTraces(gd, update, indices, maxPoints, lengthenArray, spliceArray) {\n\n assertExtendTracesArgs(gd, update, indices, maxPoints);\n\n var updateProps = getExtendProperties(gd, update, indices, maxPoints),\n remainder = [],\n undoUpdate = {},\n undoPoints = {};\n var target, prop, maxp;\n\n for(var i = 0; i < updateProps.length; i++) {\n\n /*\n * prop is the object returned by Lib.nestedProperties\n */\n prop = updateProps[i].prop;\n maxp = updateProps[i].maxp;\n\n target = lengthenArray(updateProps[i].target, updateProps[i].insert);\n\n /*\n * If maxp is set within post-extension trace.length, splice to maxp length.\n * Otherwise skip function call as splice op will have no effect anyway.\n */\n if(maxp >= 0 && maxp < target.length) remainder = spliceArray(target, maxp);\n\n /*\n * to reverse this operation we need the size of the original trace as the reverse\n * operation will need to window out any lengthening operation performed in this pass.\n */\n maxp = updateProps[i].target.length;\n\n /*\n * Magic happens here! update gd.data.trace[key] with new array data.\n */\n prop.set(target);\n\n if(!Array.isArray(undoUpdate[prop.astr])) undoUpdate[prop.astr] = [];\n if(!Array.isArray(undoPoints[prop.astr])) undoPoints[prop.astr] = [];\n\n /*\n * build the inverse update object for the undo operation\n */\n undoUpdate[prop.astr].push(remainder);\n\n /*\n * build the matching maxPoints undo object containing original trace lengths.\n */\n undoPoints[prop.astr].push(maxp);\n }\n\n return {update: undoUpdate, maxPoints: undoPoints};\n}\n\n/**\n * extend && prepend traces at indices with update arrays, window trace lengths to maxPoints\n *\n * Extend and Prepend have identical APIs. Prepend inserts an array at the head while Extend\n * inserts an array off the tail. Prepend truncates the tail of the array - counting maxPoints\n * from the head, whereas Extend truncates the head of the array, counting backward maxPoints\n * from the tail.\n *\n * If maxPoints is undefined, nonNumeric, negative or greater than extended trace length no\n * truncation / windowing will be performed. If its zero, well the whole trace is truncated.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object} update The key:array map of target attributes to extend\n * @param {Number|Number[]} indices The locations of traces to be extended\n * @param {Number|Object} [maxPoints] Number of points for trace window after lengthening.\n *\n */\nPlotly.extendTraces = function extendTraces(gd, update, indices, maxPoints) {\n gd = Lib.getGraphDiv(gd);\n\n var undo = spliceTraces(gd, update, indices, maxPoints,\n\n /*\n * The Lengthen operation extends trace from end with insert\n */\n function(target, insert) {\n return target.concat(insert);\n },\n\n /*\n * Window the trace keeping maxPoints, counting back from the end\n */\n function(target, maxPoints) {\n return target.splice(0, target.length - maxPoints);\n });\n\n var promise = Plotly.redraw(gd);\n\n var undoArgs = [gd, undo.update, indices, undo.maxPoints];\n Queue.add(gd, Plotly.prependTraces, undoArgs, extendTraces, arguments);\n\n return promise;\n};\n\nPlotly.prependTraces = function prependTraces(gd, update, indices, maxPoints) {\n gd = Lib.getGraphDiv(gd);\n\n var undo = spliceTraces(gd, update, indices, maxPoints,\n\n /*\n * The Lengthen operation extends trace by appending insert to start\n */\n function(target, insert) {\n return insert.concat(target);\n },\n\n /*\n * Window the trace keeping maxPoints, counting forward from the start\n */\n function(target, maxPoints) {\n return target.splice(maxPoints, target.length);\n });\n\n var promise = Plotly.redraw(gd);\n\n var undoArgs = [gd, undo.update, indices, undo.maxPoints];\n Queue.add(gd, Plotly.extendTraces, undoArgs, prependTraces, arguments);\n\n return promise;\n};\n\n/**\n * Add data traces to an existing graph div.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're adding to\n * @param {Object[]|Object} traces The object or array of objects to add\n * @param {Number[]|Number} [newIndices=[gd.data.length]] Locations to add traces\n *\n */\nPlotly.addTraces = function addTraces(gd, traces, newIndices) {\n gd = Lib.getGraphDiv(gd);\n\n var currentIndices = [],\n undoFunc = Plotly.deleteTraces,\n redoFunc = addTraces,\n undoArgs = [gd, currentIndices],\n redoArgs = [gd, traces], // no newIndices here\n i,\n promise;\n\n // all validation is done elsewhere to remove clutter here\n checkAddTracesArgs(gd, traces, newIndices);\n\n // make sure traces is an array\n if(!Array.isArray(traces)) {\n traces = [traces];\n }\n\n // make sure traces do not repeat existing ones\n traces = traces.map(function(trace) {\n return Lib.extendFlat({}, trace);\n });\n\n helpers.cleanData(traces, gd.data);\n\n // add the traces to gd.data (no redrawing yet!)\n for(i = 0; i < traces.length; i++) {\n gd.data.push(traces[i]);\n }\n\n // to continue, we need to call moveTraces which requires currentIndices\n for(i = 0; i < traces.length; i++) {\n currentIndices.push(-traces.length + i);\n }\n\n // if the user didn't define newIndices, they just want the traces appended\n // i.e., we can simply redraw and be done\n if(typeof newIndices === 'undefined') {\n promise = Plotly.redraw(gd);\n Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n return promise;\n }\n\n // make sure indices is property defined\n if(!Array.isArray(newIndices)) {\n newIndices = [newIndices];\n }\n\n try {\n\n // this is redundant, but necessary to not catch later possible errors!\n checkMoveTracesArgs(gd, currentIndices, newIndices);\n }\n catch(error) {\n\n // something went wrong, reset gd to be safe and rethrow error\n gd.data.splice(gd.data.length - traces.length, traces.length);\n throw error;\n }\n\n // if we're here, the user has defined specific places to place the new traces\n // this requires some extra work that moveTraces will do\n Queue.startSequence(gd);\n Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n promise = Plotly.moveTraces(gd, currentIndices, newIndices);\n Queue.stopSequence(gd);\n return promise;\n};\n\n/**\n * Delete traces at `indices` from gd.data array.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're removing from\n * @param {Number|Number[]} indices The indices\n */\nPlotly.deleteTraces = function deleteTraces(gd, indices) {\n gd = Lib.getGraphDiv(gd);\n\n var traces = [],\n undoFunc = Plotly.addTraces,\n redoFunc = deleteTraces,\n undoArgs = [gd, traces, indices],\n redoArgs = [gd, indices],\n i,\n deletedTrace;\n\n // make sure indices are defined\n if(typeof indices === 'undefined') {\n throw new Error('indices must be an integer or array of integers.');\n } else if(!Array.isArray(indices)) {\n indices = [indices];\n }\n assertIndexArray(gd, indices, 'indices');\n\n // convert negative indices to positive indices\n indices = positivifyIndices(indices, gd.data.length - 1);\n\n // we want descending here so that splicing later doesn't affect indexing\n indices.sort(Lib.sorterDes);\n for(i = 0; i < indices.length; i += 1) {\n deletedTrace = gd.data.splice(indices[i], 1)[0];\n traces.push(deletedTrace);\n }\n\n var promise = Plotly.redraw(gd);\n Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n return promise;\n};\n\n/**\n * Move traces at currentIndices array to locations in newIndices array.\n *\n * If newIndices is omitted, currentIndices will be moved to the end. E.g.,\n * these are equivalent:\n *\n * Plotly.moveTraces(gd, [1, 2, 3], [-3, -2, -1])\n * Plotly.moveTraces(gd, [1, 2, 3])\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're removing from\n * @param {Number|Number[]} currentIndices The locations of traces to be moved\n * @param {Number|Number[]} [newIndices] The locations to move traces to\n *\n * Example calls:\n *\n * // move trace i to location x\n * Plotly.moveTraces(gd, i, x)\n *\n * // move trace i to end of array\n * Plotly.moveTraces(gd, i)\n *\n * // move traces i, j, k to end of array (i != j != k)\n * Plotly.moveTraces(gd, [i, j, k])\n *\n * // move traces [i, j, k] to [x, y, z] (i != j != k) (x != y != z)\n * Plotly.moveTraces(gd, [i, j, k], [x, y, z])\n *\n * // reorder all traces (assume there are 5--a, b, c, d, e)\n * Plotly.moveTraces(gd, [b, d, e, a, c]) // same as 'move to end'\n */\nPlotly.moveTraces = function moveTraces(gd, currentIndices, newIndices) {\n gd = Lib.getGraphDiv(gd);\n\n var newData = [],\n movingTraceMap = [],\n undoFunc = moveTraces,\n redoFunc = moveTraces,\n undoArgs = [gd, newIndices, currentIndices],\n redoArgs = [gd, currentIndices, newIndices],\n i;\n\n // to reduce complexity here, check args elsewhere\n // this throws errors where appropriate\n checkMoveTracesArgs(gd, currentIndices, newIndices);\n\n // make sure currentIndices is an array\n currentIndices = Array.isArray(currentIndices) ? currentIndices : [currentIndices];\n\n // if undefined, define newIndices to point to the end of gd.data array\n if(typeof newIndices === 'undefined') {\n newIndices = [];\n for(i = 0; i < currentIndices.length; i++) {\n newIndices.push(-currentIndices.length + i);\n }\n }\n\n // make sure newIndices is an array if it's user-defined\n newIndices = Array.isArray(newIndices) ? newIndices : [newIndices];\n\n // convert negative indices to positive indices (they're the same length)\n currentIndices = positivifyIndices(currentIndices, gd.data.length - 1);\n newIndices = positivifyIndices(newIndices, gd.data.length - 1);\n\n // at this point, we've coerced the index arrays into predictable forms\n\n // get the traces that aren't being moved around\n for(i = 0; i < gd.data.length; i++) {\n\n // if index isn't in currentIndices, include it in ignored!\n if(currentIndices.indexOf(i) === -1) {\n newData.push(gd.data[i]);\n }\n }\n\n // get a mapping of indices to moving traces\n for(i = 0; i < currentIndices.length; i++) {\n movingTraceMap.push({newIndex: newIndices[i], trace: gd.data[currentIndices[i]]});\n }\n\n // reorder this mapping by newIndex, ascending\n movingTraceMap.sort(function(a, b) {\n return a.newIndex - b.newIndex;\n });\n\n // now, add the moving traces back in, in order!\n for(i = 0; i < movingTraceMap.length; i += 1) {\n newData.splice(movingTraceMap[i].newIndex, 0, movingTraceMap[i].trace);\n }\n\n gd.data = newData;\n\n var promise = Plotly.redraw(gd);\n Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n return promise;\n};\n\n/**\n * restyle: update trace attributes of an existing plot\n *\n * Can be called two ways.\n *\n * Signature 1:\n * @param {String | HTMLDivElement} gd\n * the id or DOM element of the graph container div\n * @param {String} astr\n * attribute string (like `'marker.symbol'`) to update\n * @param {*} val\n * value to give this attribute\n * @param {Number[] | Number} [traces]\n * integer or array of integers for the traces to alter (all if omitted)\n *\n * Signature 2:\n * @param {String | HTMLDivElement} gd\n * (as in signature 1)\n * @param {Object} aobj\n * attribute object `{astr1: val1, astr2: val2 ...}`\n * allows setting multiple attributes simultaneously\n * @param {Number[] | Number} [traces]\n * (as in signature 1)\n *\n * `val` (or `val1`, `val2` ... in the object form) can be an array,\n * to apply different values to each trace.\n *\n * If the array is too short, it will wrap around (useful for\n * style files that want to specify cyclical default values).\n */\nPlotly.restyle = function restyle(gd, astr, val, _traces) {\n gd = Lib.getGraphDiv(gd);\n helpers.clearPromiseQueue(gd);\n\n var aobj = {};\n if(typeof astr === 'string') aobj[astr] = val;\n else if(Lib.isPlainObject(astr)) {\n // the 3-arg form\n aobj = Lib.extendFlat({}, astr);\n if(_traces === undefined) _traces = val;\n }\n else {\n Lib.warn('Restyle fail.', astr, val, _traces);\n return Promise.reject();\n }\n\n if(Object.keys(aobj).length) gd.changed = true;\n\n var traces = helpers.coerceTraceIndices(gd, _traces);\n\n var specs = _restyle(gd, aobj, traces),\n flags = specs.flags;\n\n // clear calcdata and/or axis types if required so they get regenerated\n if(flags.clearCalc) gd.calcdata = undefined;\n if(flags.clearAxisTypes) helpers.clearAxisTypes(gd, traces, {});\n\n // fill in redraw sequence\n var seq = [];\n\n if(flags.fullReplot) {\n seq.push(Plotly.plot);\n } else {\n seq.push(Plots.previousPromises);\n\n Plots.supplyDefaults(gd);\n\n if(flags.style) seq.push(subroutines.doTraceStyle);\n if(flags.colorbars) seq.push(subroutines.doColorBars);\n }\n\n seq.push(Plots.rehover);\n\n Queue.add(gd,\n restyle, [gd, specs.undoit, specs.traces],\n restyle, [gd, specs.redoit, specs.traces]\n );\n\n var plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve();\n\n return plotDone.then(function() {\n gd.emit('plotly_restyle', specs.eventData);\n return gd;\n });\n};\n\n// for undo: undefined initial vals must be turned into nulls\n// so that we unset rather than ignore them\nfunction undefinedToNull(val) {\n if(val === undefined) return null;\n return val;\n}\n\nfunction _restyle(gd, aobj, traces) {\n var fullLayout = gd._fullLayout,\n fullData = gd._fullData,\n data = gd.data,\n i;\n\n // initialize flags\n var flags = editTypes.traceFlags();\n\n // copies of the change (and previous values of anything affected)\n // for the undo / redo queue\n var redoit = {},\n undoit = {},\n axlist,\n flagAxForDelete = {};\n\n // make a new empty vals array for undoit\n function a0() { return traces.map(function() { return undefined; }); }\n\n // for autoranging multiple axes\n function addToAxlist(axid) {\n var axName = Plotly.Axes.id2name(axid);\n if(axlist.indexOf(axName) === -1) axlist.push(axName);\n }\n\n function autorangeAttr(axName) { return 'LAYOUT' + axName + '.autorange'; }\n\n function rangeAttr(axName) { return 'LAYOUT' + axName + '.range'; }\n\n // for attrs that interact (like scales & autoscales), save the\n // old vals before making the change\n // val=undefined will not set a value, just record what the value was.\n // val=null will delete the attribute\n // attr can be an array to set several at once (all to the same val)\n function doextra(attr, val, i) {\n if(Array.isArray(attr)) {\n attr.forEach(function(a) { doextra(a, val, i); });\n return;\n }\n // quit if explicitly setting this elsewhere\n if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n var extraparam;\n if(attr.substr(0, 6) === 'LAYOUT') {\n extraparam = Lib.nestedProperty(gd.layout, attr.replace('LAYOUT', ''));\n } else {\n extraparam = Lib.nestedProperty(data[traces[i]], attr);\n }\n\n if(!(attr in undoit)) {\n undoit[attr] = a0();\n }\n if(undoit[attr][i] === undefined) {\n undoit[attr][i] = undefinedToNull(extraparam.get());\n }\n if(val !== undefined) {\n extraparam.set(val);\n }\n }\n\n // now make the changes to gd.data (and occasionally gd.layout)\n // and figure out what kind of graphics update we need to do\n for(var ai in aobj) {\n if(helpers.hasParent(aobj, ai)) {\n throw new Error('cannot set ' + ai + 'and a parent attribute simultaneously');\n }\n\n var vi = aobj[ai],\n cont,\n contFull,\n param,\n oldVal,\n newVal,\n valObject;\n\n redoit[ai] = vi;\n\n if(ai.substr(0, 6) === 'LAYOUT') {\n param = Lib.nestedProperty(gd.layout, ai.replace('LAYOUT', ''));\n undoit[ai] = [undefinedToNull(param.get())];\n // since we're allowing val to be an array, allow it here too,\n // even though that's meaningless\n param.set(Array.isArray(vi) ? vi[0] : vi);\n // ironically, the layout attrs in restyle only require replot,\n // not relayout\n flags.calc = true;\n continue;\n }\n\n // set attribute in gd.data\n undoit[ai] = a0();\n for(i = 0; i < traces.length; i++) {\n cont = data[traces[i]];\n contFull = fullData[traces[i]];\n param = Lib.nestedProperty(cont, ai);\n oldVal = param.get();\n newVal = Array.isArray(vi) ? vi[i % vi.length] : vi;\n\n if(newVal === undefined) continue;\n\n valObject = PlotSchema.getTraceValObject(contFull, param.parts);\n\n if(valObject && valObject.impliedEdits && newVal !== null) {\n for(var impliedKey in valObject.impliedEdits) {\n doextra(Lib.relativeAttr(ai, impliedKey), valObject.impliedEdits[impliedKey], i);\n }\n }\n\n // changing colorbar size modes,\n // make the resulting size not change\n // note that colorbar fractional sizing is based on the\n // original plot size, before anything (like a colorbar)\n // increases the margins\n else if(ai === 'colorbar.thicknessmode' && param.get() !== newVal &&\n ['fraction', 'pixels'].indexOf(newVal) !== -1 &&\n contFull.colorbar) {\n var thicknorm =\n ['top', 'bottom'].indexOf(contFull.colorbar.orient) !== -1 ?\n (fullLayout.height - fullLayout.margin.t - fullLayout.margin.b) :\n (fullLayout.width - fullLayout.margin.l - fullLayout.margin.r);\n doextra('colorbar.thickness', contFull.colorbar.thickness *\n (newVal === 'fraction' ? 1 / thicknorm : thicknorm), i);\n }\n else if(ai === 'colorbar.lenmode' && param.get() !== newVal &&\n ['fraction', 'pixels'].indexOf(newVal) !== -1 &&\n contFull.colorbar) {\n var lennorm =\n ['top', 'bottom'].indexOf(contFull.colorbar.orient) !== -1 ?\n (fullLayout.width - fullLayout.margin.l - fullLayout.margin.r) :\n (fullLayout.height - fullLayout.margin.t - fullLayout.margin.b);\n doextra('colorbar.len', contFull.colorbar.len *\n (newVal === 'fraction' ? 1 / lennorm : lennorm), i);\n }\n else if(ai === 'colorbar.tick0' || ai === 'colorbar.dtick') {\n doextra('colorbar.tickmode', 'linear', i);\n }\n\n if(ai === 'type' && (newVal === 'pie') !== (oldVal === 'pie')) {\n var labelsTo = 'x',\n valuesTo = 'y';\n if((newVal === 'bar' || oldVal === 'bar') && cont.orientation === 'h') {\n labelsTo = 'y';\n valuesTo = 'x';\n }\n Lib.swapAttrs(cont, ['?', '?src'], 'labels', labelsTo);\n Lib.swapAttrs(cont, ['d?', '?0'], 'label', labelsTo);\n Lib.swapAttrs(cont, ['?', '?src'], 'values', valuesTo);\n\n if(oldVal === 'pie') {\n Lib.nestedProperty(cont, 'marker.color')\n .set(Lib.nestedProperty(cont, 'marker.colors').get());\n\n // super kludgy - but if all pies are gone we won't remove them otherwise\n fullLayout._pielayer.selectAll('g.trace').remove();\n } else if(Registry.traceIs(cont, 'cartesian')) {\n Lib.nestedProperty(cont, 'marker.colors')\n .set(Lib.nestedProperty(cont, 'marker.color').get());\n // look for axes that are no longer in use and delete them\n flagAxForDelete[cont.xaxis || 'x'] = true;\n flagAxForDelete[cont.yaxis || 'y'] = true;\n }\n }\n\n undoit[ai][i] = undefinedToNull(oldVal);\n // set the new value - if val is an array, it's one el per trace\n // first check for attributes that get more complex alterations\n var swapAttrs = [\n 'swapxy', 'swapxyaxes', 'orientation', 'orientationaxes'\n ];\n if(swapAttrs.indexOf(ai) !== -1) {\n // setting an orientation: make sure it's changing\n // before we swap everything else\n if(ai === 'orientation') {\n param.set(newVal);\n // obnoxious that we need this level of coupling... but in order to\n // properly handle setting orientation to `null` we need to mimic\n // the logic inside Bars.supplyDefaults for default orientation\n var defaultOrientation = (cont.x && !cont.y) ? 'h' : 'v';\n if((param.get() || defaultOrientation) === contFull.orientation) {\n continue;\n }\n }\n // orientationaxes has no value,\n // it flips everything and the axes\n else if(ai === 'orientationaxes') {\n cont.orientation =\n {v: 'h', h: 'v'}[contFull.orientation];\n }\n helpers.swapXYData(cont);\n flags.calc = flags.clearAxisTypes = true;\n }\n else if(Plots.dataArrayContainers.indexOf(param.parts[0]) !== -1) {\n // TODO: use manageArrays.applyContainerArrayChanges here too\n helpers.manageArrayContainers(param, newVal, undoit);\n flags.calc = true;\n }\n else {\n if(valObject) {\n // must redo calcdata when restyling array values of arrayOk attributes\n if(valObject.arrayOk && (Array.isArray(newVal) || Array.isArray(oldVal))) {\n flags.calc = true;\n }\n else editTypes.update(flags, valObject);\n }\n else {\n /*\n * if we couldn't find valObject, assume a full recalc.\n * This can happen if you're changing type and making\n * some other edits too, so the modules we're\n * looking at don't have these attributes in them.\n */\n flags.calc = true;\n }\n\n // all the other ones, just modify that one attribute\n param.set(newVal);\n }\n }\n\n // swap the data attributes of the relevant x and y axes?\n if(['swapxyaxes', 'orientationaxes'].indexOf(ai) !== -1) {\n Plotly.Axes.swap(gd, traces);\n }\n\n // swap hovermode if set to \"compare x/y data\"\n if(ai === 'orientationaxes') {\n var hovermode = Lib.nestedProperty(gd.layout, 'hovermode');\n if(hovermode.get() === 'x') {\n hovermode.set('y');\n } else if(hovermode.get() === 'y') {\n hovermode.set('x');\n }\n }\n\n // major enough changes deserve autoscale, autobin, and\n // non-reversed axes so people don't get confused\n if(['orientation', 'type'].indexOf(ai) !== -1) {\n axlist = [];\n for(i = 0; i < traces.length; i++) {\n var trace = data[traces[i]];\n\n if(Registry.traceIs(trace, 'cartesian')) {\n addToAxlist(trace.xaxis || 'x');\n addToAxlist(trace.yaxis || 'y');\n\n if(ai === 'type') {\n doextra(['autobinx', 'autobiny'], true, i);\n }\n }\n }\n\n doextra(axlist.map(autorangeAttr), true, 0);\n doextra(axlist.map(rangeAttr), [0, 1], 0);\n }\n }\n\n // do we need to force a recalc?\n var autorangeOn = false;\n var axList = Plotly.Axes.list(gd);\n for(i = 0; i < axList.length; i++) {\n if(axList[i].autorange) {\n autorangeOn = true;\n break;\n }\n }\n\n // check axes we've flagged for possible deletion\n // flagAxForDelete is a hash so we can make sure we only get each axis once\n var axListForDelete = Object.keys(flagAxForDelete);\n axisLoop:\n for(i = 0; i < axListForDelete.length; i++) {\n var axId = axListForDelete[i],\n axLetter = axId.charAt(0),\n axAttr = axLetter + 'axis';\n\n for(var j = 0; j < data.length; j++) {\n if(Registry.traceIs(data[j], 'cartesian') &&\n (data[j][axAttr] || axLetter) === axId) {\n continue axisLoop;\n }\n }\n\n // no data on this axis - delete it.\n doextra('LAYOUT' + Plotly.Axes.id2name(axId), null, 0);\n }\n\n // combine a few flags together;\n if(flags.calc || (flags.calcIfAutorange && autorangeOn)) {\n flags.clearCalc = true;\n }\n if(flags.calc || flags.plot || flags.calcIfAutorange) {\n flags.fullReplot = true;\n }\n\n return {\n flags: flags,\n undoit: undoit,\n redoit: redoit,\n traces: traces,\n eventData: Lib.extendDeepNoArrays([], [redoit, traces])\n };\n}\n\n/**\n * relayout: update layout attributes of an existing plot\n *\n * Can be called two ways:\n *\n * Signature 1:\n * @param {String | HTMLDivElement} gd\n * the id or dom element of the graph container div\n * @param {String} astr\n * attribute string (like `'xaxis.range[0]'`) to update\n * @param {*} val\n * value to give this attribute\n *\n * Signature 2:\n * @param {String | HTMLDivElement} gd\n * (as in signature 1)\n * @param {Object} aobj\n * attribute object `{astr1: val1, astr2: val2 ...}`\n * allows setting multiple attributes simultaneously\n */\nPlotly.relayout = function relayout(gd, astr, val) {\n gd = Lib.getGraphDiv(gd);\n helpers.clearPromiseQueue(gd);\n\n if(gd.framework && gd.framework.isPolar) {\n return Promise.resolve(gd);\n }\n\n var aobj = {};\n if(typeof astr === 'string') {\n aobj[astr] = val;\n } else if(Lib.isPlainObject(astr)) {\n aobj = Lib.extendFlat({}, astr);\n } else {\n Lib.warn('Relayout fail.', astr, val);\n return Promise.reject();\n }\n\n if(Object.keys(aobj).length) gd.changed = true;\n\n var specs = _relayout(gd, aobj),\n flags = specs.flags;\n\n // clear calcdata if required\n if(flags.calc) gd.calcdata = undefined;\n\n // fill in redraw sequence\n\n // even if we don't have anything left in aobj,\n // something may have happened within relayout that we\n // need to wait for\n var seq = [Plots.previousPromises];\n\n if(flags.layoutReplot) {\n seq.push(subroutines.layoutReplot);\n }\n else if(Object.keys(aobj).length) {\n Plots.supplyDefaults(gd);\n\n if(flags.legend) seq.push(subroutines.doLegend);\n if(flags.layoutstyle) seq.push(subroutines.layoutStyles);\n if(flags.ticks) seq.push(subroutines.doTicksRelayout);\n if(flags.modebar) seq.push(subroutines.doModeBar);\n if(flags.camera) seq.push(subroutines.doCamera);\n }\n\n seq.push(Plots.rehover);\n\n Queue.add(gd,\n relayout, [gd, specs.undoit],\n relayout, [gd, specs.redoit]\n );\n\n var plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve(gd);\n\n return plotDone.then(function() {\n gd.emit('plotly_relayout', specs.eventData);\n return gd;\n });\n};\n\nfunction _relayout(gd, aobj) {\n var layout = gd.layout,\n fullLayout = gd._fullLayout,\n keys = Object.keys(aobj),\n axes = Plotly.Axes.list(gd),\n arrayEdits = {},\n arrayStr,\n i,\n j;\n\n // look for 'allaxes', split out into all axes\n // in case of 3D the axis are nested within a scene which is held in _id\n for(i = 0; i < keys.length; i++) {\n if(keys[i].indexOf('allaxes') === 0) {\n for(j = 0; j < axes.length; j++) {\n var scene = axes[j]._id.substr(1),\n axisAttr = (scene.indexOf('scene') !== -1) ? (scene + '.') : '',\n newkey = keys[i].replace('allaxes', axisAttr + axes[j]._name);\n\n if(!aobj[newkey]) aobj[newkey] = aobj[keys[i]];\n }\n\n delete aobj[keys[i]];\n }\n }\n\n // initialize flags\n var flags = editTypes.layoutFlags();\n\n // copies of the change (and previous values of anything affected)\n // for the undo / redo queue\n var redoit = {},\n undoit = {};\n\n // for attrs that interact (like scales & autoscales), save the\n // old vals before making the change\n // val=undefined will not set a value, just record what the value was.\n // attr can be an array to set several at once (all to the same val)\n function doextra(attr, val) {\n if(Array.isArray(attr)) {\n attr.forEach(function(a) { doextra(a, val); });\n return;\n }\n\n // if we have another value for this attribute (explicitly or\n // via a parent) do not override with this auto-generated extra\n if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n var p = Lib.nestedProperty(layout, attr);\n if(!(attr in undoit)) {\n undoit[attr] = undefinedToNull(p.get());\n }\n if(val !== undefined) p.set(val);\n }\n\n // for editing annotations or shapes - is it on autoscaled axes?\n function refAutorange(obj, axLetter) {\n if(!Lib.isPlainObject(obj)) return false;\n var axRef = obj[axLetter + 'ref'] || axLetter,\n ax = Plotly.Axes.getFromId(gd, axRef);\n\n if(!ax && axRef.charAt(0) === axLetter) {\n // fall back on the primary axis in case we've referenced a\n // nonexistent axis (as we do above if axRef is missing).\n // This assumes the object defaults to data referenced, which\n // is the case for shapes and annotations but not for images.\n // The only thing this is used for is to determine whether to\n // do a full `recalc`, so the only ill effect of this error is\n // to waste some time.\n ax = Plotly.Axes.getFromId(gd, axLetter);\n }\n return (ax || {}).autorange;\n }\n\n // for constraint enforcement: keep track of all axes (as {id: name})\n // we're editing the (auto)range of, so we can tell the others constrained\n // to scale with them that it's OK for them to shrink\n var rangesAltered = {};\n var axId;\n\n function recordAlteredAxis(pleafPlus) {\n var axId = axisIds.name2id(pleafPlus.split('.')[0]);\n rangesAltered[axId] = 1;\n return axId;\n }\n\n // alter gd.layout\n for(var ai in aobj) {\n if(helpers.hasParent(aobj, ai)) {\n throw new Error('cannot set ' + ai + 'and a parent attribute simultaneously');\n }\n\n var p = Lib.nestedProperty(layout, ai),\n vi = aobj[ai],\n plen = p.parts.length,\n // p.parts may end with an index integer if the property is an array\n pend = typeof p.parts[plen - 1] === 'string' ? (plen - 1) : (plen - 2),\n // last property in chain (leaf node)\n pleaf = p.parts[pend],\n // leaf plus immediate parent\n pleafPlus = p.parts[pend - 1] + '.' + pleaf,\n // trunk nodes (everything except the leaf)\n ptrunk = p.parts.slice(0, pend).join('.'),\n parentIn = Lib.nestedProperty(gd.layout, ptrunk).get(),\n parentFull = Lib.nestedProperty(fullLayout, ptrunk).get(),\n vOld = p.get();\n\n if(vi === undefined) continue;\n\n redoit[ai] = vi;\n\n // axis reverse is special - it is its own inverse\n // op and has no flag.\n undoit[ai] = (pleaf === 'reverse') ? vi : undefinedToNull(vOld);\n\n var valObject = PlotSchema.getLayoutValObject(fullLayout, p.parts);\n\n if(valObject && valObject.impliedEdits && vi !== null) {\n for(var impliedKey in valObject.impliedEdits) {\n doextra(Lib.relativeAttr(ai, impliedKey), valObject.impliedEdits[impliedKey]);\n }\n }\n\n // Setting width or height to null must reset the graph's width / height\n // back to its initial value as computed during the first pass in Plots.plotAutoSize.\n //\n // To do so, we must manually set them back here using the _initialAutoSize cache.\n if(['width', 'height'].indexOf(ai) !== -1 && vi === null) {\n fullLayout[ai] = gd._initialAutoSize[ai];\n }\n // check autorange vs range\n else if(pleafPlus.match(/^[xyz]axis[0-9]*\\.range(\\[[0|1]\\])?$/)) {\n recordAlteredAxis(pleafPlus);\n Lib.nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n }\n else if(pleafPlus.match(/^[xyz]axis[0-9]*\\.autorange$/)) {\n recordAlteredAxis(pleafPlus);\n Lib.nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n var axFull = Lib.nestedProperty(fullLayout, ptrunk).get();\n if(axFull._inputDomain) {\n // if we're autoranging and this axis has a constrained domain,\n // reset it so we don't get locked into a shrunken size\n axFull._input.domain = axFull._inputDomain.slice();\n }\n }\n else if(pleafPlus.match(/^[xyz]axis[0-9]*\\.domain(\\[[0|1]\\])?$/)) {\n Lib.nestedProperty(fullLayout, ptrunk + '._inputDomain').set(null);\n }\n\n // toggling axis type between log and linear: we need to convert\n // positions for components that are still using linearized values,\n // not data values like newer components.\n // previously we did this for log <-> not-log, but now only do it\n // for log <-> linear\n if(pleaf === 'type') {\n var ax = parentIn,\n toLog = parentFull.type === 'linear' && vi === 'log',\n fromLog = parentFull.type === 'log' && vi === 'linear';\n\n if(toLog || fromLog) {\n if(!ax || !ax.range) {\n // 2D never gets here, but 3D does\n // I don't think this is needed, but left here in case there\n // are edge cases I'm not thinking of.\n doextra(ptrunk + '.autorange', true);\n }\n else if(!parentFull.autorange) {\n // toggling log without autorange: need to also recalculate ranges\n // because log axes use linearized values for range endpoints\n var r0 = ax.range[0],\n r1 = ax.range[1];\n if(toLog) {\n // if both limits are negative, autorange\n if(r0 <= 0 && r1 <= 0) {\n doextra(ptrunk + '.autorange', true);\n }\n // if one is negative, set it 6 orders below the other.\n if(r0 <= 0) r0 = r1 / 1e6;\n else if(r1 <= 0) r1 = r0 / 1e6;\n // now set the range values as appropriate\n doextra(ptrunk + '.range[0]', Math.log(r0) / Math.LN10);\n doextra(ptrunk + '.range[1]', Math.log(r1) / Math.LN10);\n }\n else {\n doextra(ptrunk + '.range[0]', Math.pow(10, r0));\n doextra(ptrunk + '.range[1]', Math.pow(10, r1));\n }\n }\n else if(toLog) {\n // just make sure the range is positive and in the right\n // order, it'll get recalculated later\n ax.range = (ax.range[1] > ax.range[0]) ? [1, 2] : [2, 1];\n }\n\n // Annotations and images also need to convert to/from linearized coords\n // Shapes do not need this :)\n Registry.getComponentMethod('annotations', 'convertCoords')(gd, parentFull, vi, doextra);\n Registry.getComponentMethod('images', 'convertCoords')(gd, parentFull, vi, doextra);\n }\n else {\n // any other type changes: the range from the previous type\n // will not make sense, so autorange it.\n doextra(ptrunk + '.autorange', true);\n doextra(ptrunk + '.range', null);\n }\n Lib.nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n }\n else if(pleaf.match(cartesianConstants.AX_NAME_PATTERN)) {\n var fullProp = Lib.nestedProperty(fullLayout, ai).get(),\n newType = (vi || {}).type;\n\n // This can potentially cause strange behavior if the autotype is not\n // numeric (linear, because we don't auto-log) but the previous type\n // was log. That's a very strange edge case though\n if(!newType || newType === '-') newType = 'linear';\n Registry.getComponentMethod('annotations', 'convertCoords')(gd, fullProp, newType, doextra);\n Registry.getComponentMethod('images', 'convertCoords')(gd, fullProp, newType, doextra);\n }\n\n // alter gd.layout\n\n // collect array component edits for execution all together\n // so we can ensure consistent behavior adding/removing items\n // and order-independence for add/remove/edit all together in\n // one relayout call\n var containerArrayMatch = manageArrays.containerArrayMatch(ai);\n if(containerArrayMatch) {\n arrayStr = containerArrayMatch.array;\n i = containerArrayMatch.index;\n var propStr = containerArrayMatch.property;\n var componentArray = Lib.nestedProperty(layout, arrayStr);\n var obji = (componentArray || [])[i] || {};\n var objToAutorange = obji;\n\n var updateValObject = valObject || {editType: 'calc'};\n var checkForAutorange = updateValObject.editType.indexOf('calcIfAutorange') !== -1;\n\n if(i === '') {\n // replacing the entire array - too many possibilities, just recalc\n if(checkForAutorange) flags.calc = true;\n else editTypes.update(flags, updateValObject);\n checkForAutorange = false; // clear this, we're already doing a recalc\n }\n else if(propStr === '') {\n // special handling of undoit if we're adding or removing an element\n // ie 'annotations[2]' which can be {...} (add) or null (remove)\n objToAutorange = vi;\n if(manageArrays.isAddVal(vi)) {\n undoit[ai] = null;\n }\n else if(manageArrays.isRemoveVal(vi)) {\n undoit[ai] = obji;\n objToAutorange = obji;\n }\n else Lib.warn('unrecognized full object value', aobj);\n }\n\n if(checkForAutorange && (refAutorange(objToAutorange, 'x') || refAutorange(objToAutorange, 'y'))) {\n flags.calc = true;\n }\n else editTypes.update(flags, updateValObject);\n\n\n // prepare the edits object we'll send to applyContainerArrayChanges\n if(!arrayEdits[arrayStr]) arrayEdits[arrayStr] = {};\n var objEdits = arrayEdits[arrayStr][i];\n if(!objEdits) objEdits = arrayEdits[arrayStr][i] = {};\n objEdits[propStr] = vi;\n\n delete aobj[ai];\n }\n // handle axis reversal explicitly, as there's no 'reverse' attribute\n else if(pleaf === 'reverse') {\n if(parentIn.range) parentIn.range.reverse();\n else {\n doextra(ptrunk + '.autorange', true);\n parentIn.range = [1, 0];\n }\n\n if(parentFull.autorange) flags.calc = true;\n else flags.plot = true;\n }\n else {\n if(fullLayout._has('gl2d') &&\n (ai === 'dragmode' &&\n (vi === 'lasso' || vi === 'select') &&\n !(vOld === 'lasso' || vOld === 'select'))\n ) {\n flags.calc = true;\n }\n else if(valObject) editTypes.update(flags, valObject);\n else flags.calc = true;\n\n p.set(vi);\n }\n }\n\n // now we've collected component edits - execute them all together\n for(arrayStr in arrayEdits) {\n var finished = manageArrays.applyContainerArrayChanges(gd,\n Lib.nestedProperty(layout, arrayStr), arrayEdits[arrayStr], flags);\n if(!finished) flags.plot = true;\n }\n\n // figure out if we need to recalculate axis constraints\n var constraints = fullLayout._axisConstraintGroups;\n for(axId in rangesAltered) {\n for(i = 0; i < constraints.length; i++) {\n var group = constraints[i];\n if(group[axId]) {\n // Always recalc if we're changing constrained ranges.\n // Otherwise it's possible to violate the constraints by\n // specifying arbitrary ranges for all axes in the group.\n // this way some ranges may expand beyond what's specified,\n // as they do at first draw, to satisfy the constraints.\n flags.calc = true;\n for(var groupAxId in group) {\n if(!rangesAltered[groupAxId]) {\n axisIds.getFromId(gd, groupAxId)._constraintShrinkable = true;\n }\n }\n }\n }\n }\n\n var oldWidth = fullLayout.width,\n oldHeight = fullLayout.height;\n\n // calculate autosizing\n if(gd.layout.autosize) Plots.plotAutoSize(gd, gd.layout, fullLayout);\n\n // avoid unnecessary redraws\n var hasSizechanged = aobj.height || aobj.width ||\n (fullLayout.width !== oldWidth) ||\n (fullLayout.height !== oldHeight);\n\n if(hasSizechanged) flags.calc = true;\n\n if(flags.plot || flags.calc) {\n flags.layoutReplot = true;\n }\n\n // now all attribute mods are done, as are\n // redo and undo so we can save them\n\n return {\n flags: flags,\n undoit: undoit,\n redoit: redoit,\n eventData: Lib.extendDeep({}, redoit)\n };\n}\n\n/**\n * update: update trace and layout attributes of an existing plot\n *\n * @param {String | HTMLDivElement} gd\n * the id or DOM element of the graph container div\n * @param {Object} traceUpdate\n * attribute object `{astr1: val1, astr2: val2 ...}`\n * corresponding to updates in the plot's traces\n * @param {Object} layoutUpdate\n * attribute object `{astr1: val1, astr2: val2 ...}`\n * corresponding to updates in the plot's layout\n * @param {Number[] | Number} [traces]\n * integer or array of integers for the traces to alter (all if omitted)\n *\n */\nPlotly.update = function update(gd, traceUpdate, layoutUpdate, _traces) {\n gd = Lib.getGraphDiv(gd);\n helpers.clearPromiseQueue(gd);\n\n if(gd.framework && gd.framework.isPolar) {\n return Promise.resolve(gd);\n }\n\n if(!Lib.isPlainObject(traceUpdate)) traceUpdate = {};\n if(!Lib.isPlainObject(layoutUpdate)) layoutUpdate = {};\n\n if(Object.keys(traceUpdate).length) gd.changed = true;\n if(Object.keys(layoutUpdate).length) gd.changed = true;\n\n var traces = helpers.coerceTraceIndices(gd, _traces);\n\n var restyleSpecs = _restyle(gd, Lib.extendFlat({}, traceUpdate), traces),\n restyleFlags = restyleSpecs.flags;\n\n var relayoutSpecs = _relayout(gd, Lib.extendFlat({}, layoutUpdate)),\n relayoutFlags = relayoutSpecs.flags;\n\n // clear calcdata and/or axis types if required\n if(restyleFlags.clearCalc || relayoutFlags.calc) gd.calcdata = undefined;\n if(restyleFlags.clearAxisTypes) helpers.clearAxisTypes(gd, traces, layoutUpdate);\n\n // fill in redraw sequence\n var seq = [];\n\n if(restyleFlags.fullReplot && relayoutFlags.layoutReplot) {\n var data = gd.data,\n layout = gd.layout;\n\n // clear existing data/layout on gd\n // so that Plotly.plot doesn't try to extend them\n gd.data = undefined;\n gd.layout = undefined;\n\n seq.push(function() { return Plotly.plot(gd, data, layout); });\n }\n else if(restyleFlags.fullReplot) {\n seq.push(Plotly.plot);\n }\n else if(relayoutFlags.layoutReplot) {\n seq.push(subroutines.layoutReplot);\n }\n else {\n seq.push(Plots.previousPromises);\n Plots.supplyDefaults(gd);\n\n if(restyleFlags.style) seq.push(subroutines.doTraceStyle);\n if(restyleFlags.colorbars) seq.push(subroutines.doColorBars);\n if(relayoutFlags.legend) seq.push(subroutines.doLegend);\n if(relayoutFlags.layoutstyle) seq.push(subroutines.layoutStyles);\n if(relayoutFlags.ticks) seq.push(subroutines.doTicksRelayout);\n if(relayoutFlags.modebar) seq.push(subroutines.doModeBar);\n if(relayoutFlags.camera) seq.push(subroutines.doCamera);\n }\n\n seq.push(Plots.rehover);\n\n Queue.add(gd,\n update, [gd, restyleSpecs.undoit, relayoutSpecs.undoit, restyleSpecs.traces],\n update, [gd, restyleSpecs.redoit, relayoutSpecs.redoit, restyleSpecs.traces]\n );\n\n var plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve(gd);\n\n return plotDone.then(function() {\n gd.emit('plotly_update', {\n data: restyleSpecs.eventData,\n layout: relayoutSpecs.eventData\n });\n\n return gd;\n });\n};\n\n/**\n * Animate to a frame, sequence of frame, frame group, or frame definition\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n *\n * @param {string or object or array of strings or array of objects} frameOrGroupNameOrFrameList\n * a single frame, array of frames, or group to which to animate. The intent is\n * inferred by the type of the input. Valid inputs are:\n *\n * - string, e.g. 'groupname': animate all frames of a given `group` in the order\n * in which they are defined via `Plotly.addFrames`.\n *\n * - array of strings, e.g. ['frame1', frame2']: a list of frames by name to which\n * to animate in sequence\n *\n * - object: {data: ...}: a frame definition to which to animate. The frame is not\n * and does not need to be added via `Plotly.addFrames`. It may contain any of\n * the properties of a frame, including `data`, `layout`, and `traces`. The\n * frame is used as provided and does not use the `baseframe` property.\n *\n * - array of objects, e.g. [{data: ...}, {data: ...}]: a list of frame objects,\n * each following the same rules as a single `object`.\n *\n * @param {object} animationOpts\n * configuration for the animation\n */\nPlotly.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {\n gd = Lib.getGraphDiv(gd);\n\n if(!Lib.isPlotDiv(gd)) {\n throw new Error(\n 'This element is not a Plotly plot: ' + gd + '. It\\'s likely that you\\'ve failed ' +\n 'to create a plot before animating it. For more details, see ' +\n 'https://plot.ly/javascript/animations/'\n );\n }\n\n var trans = gd._transitionData;\n\n // This is the queue of frames that will be animated as soon as possible. They\n // are popped immediately upon the *start* of a transition:\n if(!trans._frameQueue) {\n trans._frameQueue = [];\n }\n\n animationOpts = Plots.supplyAnimationDefaults(animationOpts);\n var transitionOpts = animationOpts.transition;\n var frameOpts = animationOpts.frame;\n\n // Since frames are popped immediately, an empty queue only means all frames have\n // *started* to transition, not that the animation is complete. To solve that,\n // track a separate counter that increments at the same time as frames are added\n // to the queue, but decrements only when the transition is complete.\n if(trans._frameWaitingCnt === undefined) {\n trans._frameWaitingCnt = 0;\n }\n\n function getTransitionOpts(i) {\n if(Array.isArray(transitionOpts)) {\n if(i >= transitionOpts.length) {\n return transitionOpts[0];\n } else {\n return transitionOpts[i];\n }\n } else {\n return transitionOpts;\n }\n }\n\n function getFrameOpts(i) {\n if(Array.isArray(frameOpts)) {\n if(i >= frameOpts.length) {\n return frameOpts[0];\n } else {\n return frameOpts[i];\n }\n } else {\n return frameOpts;\n }\n }\n\n // Execute a callback after the wrapper function has been called n times.\n // This is used to defer the resolution until a transition has resovled *and*\n // the frame has completed. If it's not done this way, then we get a race\n // condition in which the animation might resolve before a transition is complete\n // or vice versa.\n function callbackOnNthTime(cb, n) {\n var cnt = 0;\n return function() {\n if(cb && ++cnt === n) {\n return cb();\n }\n };\n }\n\n return new Promise(function(resolve, reject) {\n function discardExistingFrames() {\n if(trans._frameQueue.length === 0) {\n return;\n }\n\n while(trans._frameQueue.length) {\n var next = trans._frameQueue.pop();\n if(next.onInterrupt) {\n next.onInterrupt();\n }\n }\n\n gd.emit('plotly_animationinterrupted', []);\n }\n\n function queueFrames(frameList) {\n if(frameList.length === 0) return;\n\n for(var i = 0; i < frameList.length; i++) {\n var computedFrame;\n\n if(frameList[i].type === 'byname') {\n // If it's a named frame, compute it:\n computedFrame = Plots.computeFrame(gd, frameList[i].name);\n } else {\n // Otherwise we must have been given a simple object, so treat\n // the input itself as the computed frame.\n computedFrame = frameList[i].data;\n }\n\n var frameOpts = getFrameOpts(i);\n var transitionOpts = getTransitionOpts(i);\n\n // It doesn't make much sense for the transition duration to be greater than\n // the frame duration, so limit it:\n transitionOpts.duration = Math.min(transitionOpts.duration, frameOpts.duration);\n\n var nextFrame = {\n frame: computedFrame,\n name: frameList[i].name,\n frameOpts: frameOpts,\n transitionOpts: transitionOpts,\n };\n if(i === frameList.length - 1) {\n // The last frame in this .animate call stores the promise resolve\n // and reject callbacks. This is how we ensure that the animation\n // loop (which may exist as a result of a *different* .animate call)\n // still resolves or rejecdts this .animate call's promise. once it's\n // complete.\n nextFrame.onComplete = callbackOnNthTime(resolve, 2);\n nextFrame.onInterrupt = reject;\n }\n\n trans._frameQueue.push(nextFrame);\n }\n\n // Set it as never having transitioned to a frame. This will cause the animation\n // loop to immediately transition to the next frame (which, for immediate mode,\n // is the first frame in the list since all others would have been discarded\n // below)\n if(animationOpts.mode === 'immediate') {\n trans._lastFrameAt = -Infinity;\n }\n\n // Only it's not already running, start a RAF loop. This could be avoided in the\n // case that there's only one frame, but it significantly complicated the logic\n // and only sped things up by about 5% or so for a lorenz attractor simulation.\n // It would be a fine thing to implement, but the benefit of that optimization\n // doesn't seem worth the extra complexity.\n if(!trans._animationRaf) {\n beginAnimationLoop();\n }\n }\n\n function stopAnimationLoop() {\n gd.emit('plotly_animated');\n\n // Be sure to unset also since it's how we know whether a loop is already running:\n window.cancelAnimationFrame(trans._animationRaf);\n trans._animationRaf = null;\n }\n\n function nextFrame() {\n if(trans._currentFrame && trans._currentFrame.onComplete) {\n // Execute the callback and unset it to ensure it doesn't\n // accidentally get called twice\n trans._currentFrame.onComplete();\n }\n\n var newFrame = trans._currentFrame = trans._frameQueue.shift();\n\n if(newFrame) {\n // Since it's sometimes necessary to do deep digging into frame data,\n // we'll consider it not 100% impossible for nulls or numbers to sneak through,\n // so check when casting the name, just to be absolutely certain:\n var stringName = newFrame.name ? newFrame.name.toString() : null;\n gd._fullLayout._currentFrame = stringName;\n\n trans._lastFrameAt = Date.now();\n trans._timeToNext = newFrame.frameOpts.duration;\n\n // This is simply called and it's left to .transition to decide how to manage\n // interrupting current transitions. That means we don't need to worry about\n // how it resolves or what happens after this:\n Plots.transition(gd,\n newFrame.frame.data,\n newFrame.frame.layout,\n helpers.coerceTraceIndices(gd, newFrame.frame.traces),\n newFrame.frameOpts,\n newFrame.transitionOpts\n ).then(function() {\n if(newFrame.onComplete) {\n newFrame.onComplete();\n }\n\n });\n\n gd.emit('plotly_animatingframe', {\n name: stringName,\n frame: newFrame.frame,\n animation: {\n frame: newFrame.frameOpts,\n transition: newFrame.transitionOpts,\n }\n });\n } else {\n // If there are no more frames, then stop the RAF loop:\n stopAnimationLoop();\n }\n }\n\n function beginAnimationLoop() {\n gd.emit('plotly_animating');\n\n // If no timer is running, then set last frame = long ago so that the next\n // frame is immediately transitioned:\n trans._lastFrameAt = -Infinity;\n trans._timeToNext = 0;\n trans._runningTransitions = 0;\n trans._currentFrame = null;\n\n var doFrame = function() {\n // This *must* be requested before nextFrame since nextFrame may decide\n // to cancel it if there's nothing more to animated:\n trans._animationRaf = window.requestAnimationFrame(doFrame);\n\n // Check if we're ready for a new frame:\n if(Date.now() - trans._lastFrameAt > trans._timeToNext) {\n nextFrame();\n }\n };\n\n doFrame();\n }\n\n // This is an animate-local counter that helps match up option input list\n // items with the particular frame.\n var configCounter = 0;\n function setTransitionConfig(frame) {\n if(Array.isArray(transitionOpts)) {\n if(configCounter >= transitionOpts.length) {\n frame.transitionOpts = transitionOpts[configCounter];\n } else {\n frame.transitionOpts = transitionOpts[0];\n }\n } else {\n frame.transitionOpts = transitionOpts;\n }\n configCounter++;\n return frame;\n }\n\n // Disambiguate what's sort of frames have been received\n var i, frame;\n var frameList = [];\n var allFrames = frameOrGroupNameOrFrameList === undefined || frameOrGroupNameOrFrameList === null;\n var isFrameArray = Array.isArray(frameOrGroupNameOrFrameList);\n var isSingleFrame = !allFrames && !isFrameArray && Lib.isPlainObject(frameOrGroupNameOrFrameList);\n\n if(isSingleFrame) {\n // In this case, a simple object has been passed to animate.\n frameList.push({\n type: 'object',\n data: setTransitionConfig(Lib.extendFlat({}, frameOrGroupNameOrFrameList))\n });\n } else if(allFrames || ['string', 'number'].indexOf(typeof frameOrGroupNameOrFrameList) !== -1) {\n // In this case, null or undefined has been passed so that we want to\n // animate *all* currently defined frames\n for(i = 0; i < trans._frames.length; i++) {\n frame = trans._frames[i];\n\n if(!frame) continue;\n\n if(allFrames || String(frame.group) === String(frameOrGroupNameOrFrameList)) {\n frameList.push({\n type: 'byname',\n name: String(frame.name),\n data: setTransitionConfig({name: frame.name})\n });\n }\n }\n } else if(isFrameArray) {\n for(i = 0; i < frameOrGroupNameOrFrameList.length; i++) {\n var frameOrName = frameOrGroupNameOrFrameList[i];\n if(['number', 'string'].indexOf(typeof frameOrName) !== -1) {\n frameOrName = String(frameOrName);\n // In this case, there's an array and this frame is a string name:\n frameList.push({\n type: 'byname',\n name: frameOrName,\n data: setTransitionConfig({name: frameOrName})\n });\n } else if(Lib.isPlainObject(frameOrName)) {\n frameList.push({\n type: 'object',\n data: setTransitionConfig(Lib.extendFlat({}, frameOrName))\n });\n }\n }\n }\n\n // Verify that all of these frames actually exist; return and reject if not:\n for(i = 0; i < frameList.length; i++) {\n frame = frameList[i];\n if(frame.type === 'byname' && !trans._frameHash[frame.data.name]) {\n Lib.warn('animate failure: frame not found: \"' + frame.data.name + '\"');\n reject();\n return;\n }\n }\n\n // If the mode is either next or immediate, then all currently queued frames must\n // be dumped and the corresponding .animate promises rejected.\n if(['next', 'immediate'].indexOf(animationOpts.mode) !== -1) {\n discardExistingFrames();\n }\n\n if(animationOpts.direction === 'reverse') {\n frameList.reverse();\n }\n\n var currentFrame = gd._fullLayout._currentFrame;\n if(currentFrame && animationOpts.fromcurrent) {\n var idx = -1;\n for(i = 0; i < frameList.length; i++) {\n frame = frameList[i];\n if(frame.type === 'byname' && frame.name === currentFrame) {\n idx = i;\n break;\n }\n }\n\n if(idx > 0 && idx < frameList.length - 1) {\n var filteredFrameList = [];\n for(i = 0; i < frameList.length; i++) {\n frame = frameList[i];\n if(frameList[i].type !== 'byname' || i > idx) {\n filteredFrameList.push(frame);\n }\n }\n frameList = filteredFrameList;\n }\n }\n\n if(frameList.length > 0) {\n queueFrames(frameList);\n } else {\n // This is the case where there were simply no frames. It's a little strange\n // since there's not much to do:\n gd.emit('plotly_animated');\n resolve();\n }\n });\n};\n\n/**\n * Register new frames\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n *\n * @param {array of objects} frameList\n * list of frame definitions, in which each object includes any of:\n * - name: {string} name of frame to add\n * - data: {array of objects} trace data\n * - layout {object} layout definition\n * - traces {array} trace indices\n * - baseframe {string} name of frame from which this frame gets defaults\n *\n * @param {array of integers) indices\n * an array of integer indices matching the respective frames in `frameList`. If not\n * provided, an index will be provided in serial order. If already used, the frame\n * will be overwritten.\n */\nPlotly.addFrames = function(gd, frameList, indices) {\n gd = Lib.getGraphDiv(gd);\n\n var numericNameWarningCount = 0;\n\n if(frameList === null || frameList === undefined) {\n return Promise.resolve();\n }\n\n if(!Lib.isPlotDiv(gd)) {\n throw new Error(\n 'This element is not a Plotly plot: ' + gd + '. It\\'s likely that you\\'ve failed ' +\n 'to create a plot before adding frames. For more details, see ' +\n 'https://plot.ly/javascript/animations/'\n );\n }\n\n var i, frame, j, idx;\n var _frames = gd._transitionData._frames;\n var _hash = gd._transitionData._frameHash;\n\n\n if(!Array.isArray(frameList)) {\n throw new Error('addFrames failure: frameList must be an Array of frame definitions' + frameList);\n }\n\n // Create a sorted list of insertions since we run into lots of problems if these\n // aren't in ascending order of index:\n //\n // Strictly for sorting. Make sure this is guaranteed to never collide with any\n // already-exisisting indices:\n var bigIndex = _frames.length + frameList.length * 2;\n\n var insertions = [];\n for(i = frameList.length - 1; i >= 0; i--) {\n if(!Lib.isPlainObject(frameList[i])) continue;\n\n var name = (_hash[frameList[i].name] || {}).name;\n var newName = frameList[i].name;\n\n if(name && newName && typeof newName === 'number' && _hash[name]) {\n numericNameWarningCount++;\n\n Lib.warn('addFrames: overwriting frame \"' + _hash[name].name +\n '\" with a frame whose name of type \"number\" also equates to \"' +\n name + '\". This is valid but may potentially lead to unexpected ' +\n 'behavior since all plotly.js frame names are stored internally ' +\n 'as strings.');\n\n if(numericNameWarningCount > 5) {\n Lib.warn('addFrames: This API call has yielded too many warnings. ' +\n 'For the rest of this call, further warnings about numeric frame ' +\n 'names will be suppressed.');\n }\n }\n\n insertions.push({\n frame: Plots.supplyFrameDefaults(frameList[i]),\n index: (indices && indices[i] !== undefined && indices[i] !== null) ? indices[i] : bigIndex + i\n });\n }\n\n // Sort this, taking note that undefined insertions end up at the end:\n insertions.sort(function(a, b) {\n if(a.index > b.index) return -1;\n if(a.index < b.index) return 1;\n return 0;\n });\n\n var ops = [];\n var revops = [];\n var frameCount = _frames.length;\n\n for(i = insertions.length - 1; i >= 0; i--) {\n frame = insertions[i].frame;\n\n if(typeof frame.name === 'number') {\n Lib.warn('Warning: addFrames accepts frames with numeric names, but the numbers are' +\n 'implicitly cast to strings');\n\n }\n\n if(!frame.name) {\n // Repeatedly assign a default name, incrementing the counter each time until\n // we get a name that's not in the hashed lookup table:\n while(_hash[(frame.name = 'frame ' + gd._transitionData._counter++)]);\n }\n\n if(_hash[frame.name]) {\n // If frame is present, overwrite its definition:\n for(j = 0; j < _frames.length; j++) {\n if((_frames[j] || {}).name === frame.name) break;\n }\n ops.push({type: 'replace', index: j, value: frame});\n revops.unshift({type: 'replace', index: j, value: _frames[j]});\n } else {\n // Otherwise insert it at the end of the list:\n idx = Math.max(0, Math.min(insertions[i].index, frameCount));\n\n ops.push({type: 'insert', index: idx, value: frame});\n revops.unshift({type: 'delete', index: idx});\n frameCount++;\n }\n }\n\n var undoFunc = Plots.modifyFrames,\n redoFunc = Plots.modifyFrames,\n undoArgs = [gd, revops],\n redoArgs = [gd, ops];\n\n if(Queue) Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n return Plots.modifyFrames(gd, ops);\n};\n\n/**\n * Delete frame\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n *\n * @param {array of integers} frameList\n * list of integer indices of frames to be deleted\n */\nPlotly.deleteFrames = function(gd, frameList) {\n gd = Lib.getGraphDiv(gd);\n\n if(!Lib.isPlotDiv(gd)) {\n throw new Error('This element is not a Plotly plot: ' + gd);\n }\n\n var i, idx;\n var _frames = gd._transitionData._frames;\n var ops = [];\n var revops = [];\n\n if(!frameList) {\n frameList = [];\n for(i = 0; i < _frames.length; i++) {\n frameList.push(i);\n }\n }\n\n frameList = frameList.slice(0);\n frameList.sort();\n\n for(i = frameList.length - 1; i >= 0; i--) {\n idx = frameList[i];\n ops.push({type: 'delete', index: idx});\n revops.unshift({type: 'insert', index: idx, value: _frames[idx]});\n }\n\n var undoFunc = Plots.modifyFrames,\n redoFunc = Plots.modifyFrames,\n undoArgs = [gd, revops],\n redoArgs = [gd, ops];\n\n if(Queue) Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n return Plots.modifyFrames(gd, ops);\n};\n\n/**\n * Purge a graph container div back to its initial pre-Plotly.plot state\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n */\nPlotly.purge = function purge(gd) {\n gd = Lib.getGraphDiv(gd);\n\n var fullLayout = gd._fullLayout || {},\n fullData = gd._fullData || [];\n\n // remove gl contexts\n Plots.cleanPlot([], {}, fullData, fullLayout);\n\n // purge properties\n Plots.purge(gd);\n\n // purge event emitter methods\n Events.purge(gd);\n\n // remove plot container\n if(fullLayout._container) fullLayout._container.remove();\n\n // in contrast to Plotly.Plots.purge which does NOT clear _context!\n delete gd._context;\n\n return gd;\n};\n\n// -------------------------------------------------------\n// makePlotFramework: Create the plot container and axes\n// -------------------------------------------------------\nfunction makePlotFramework(gd) {\n var gd3 = d3.select(gd);\n var fullLayout = gd._fullLayout;\n\n // Plot container\n fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n fullLayout._container.enter().insert('div', ':first-child')\n .classed('plot-container', true)\n .classed('plotly', true);\n\n // Make the svg container\n fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n fullLayout._paperdiv.enter().append('div')\n .classed('svg-container', true)\n .style('position', 'relative');\n\n // Make the graph containers\n // start fresh each time we get here, so we know the order comes out\n // right, rather than enter/exit which can muck up the order\n // TODO: sort out all the ordering so we don't have to\n // explicitly delete anything\n fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container')\n .data([0]);\n fullLayout._glcontainer.enter().append('div')\n .classed('gl-container', true);\n\n fullLayout._paperdiv.selectAll('.main-svg').remove();\n\n fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child')\n .classed('main-svg', true);\n\n fullLayout._toppaper = fullLayout._paperdiv.append('svg')\n .classed('main-svg', true);\n\n if(!fullLayout._uid) {\n var otherUids = [];\n d3.selectAll('defs').each(function() {\n if(this.id) otherUids.push(this.id.split('-')[1]);\n });\n fullLayout._uid = Lib.randstr(otherUids);\n }\n\n fullLayout._paperdiv.selectAll('.main-svg')\n .attr(xmlnsNamespaces.svgAttrs);\n\n fullLayout._defs = fullLayout._paper.append('defs')\n .attr('id', 'defs-' + fullLayout._uid);\n\n fullLayout._clips = fullLayout._defs.append('g')\n .classed('clips', true);\n\n fullLayout._topdefs = fullLayout._toppaper.append('defs')\n .attr('id', 'topdefs-' + fullLayout._uid);\n\n fullLayout._topclips = fullLayout._topdefs.append('g')\n .classed('clips', true);\n\n fullLayout._bgLayer = fullLayout._paper.append('g')\n .classed('bglayer', true);\n\n fullLayout._draggers = fullLayout._paper.append('g')\n .classed('draglayer', true);\n\n // lower shape/image layer - note that this is behind\n // all subplots data/grids but above the backgrounds\n // except inset subplots, whose backgrounds are drawn\n // inside their own group so that they appear above\n // the data for the main subplot\n // lower shapes and images which are fully referenced to\n // a subplot still get drawn within the subplot's group\n // so they will work correctly on insets\n var layerBelow = fullLayout._paper.append('g')\n .classed('layer-below', true);\n fullLayout._imageLowerLayer = layerBelow.append('g')\n .classed('imagelayer', true);\n fullLayout._shapeLowerLayer = layerBelow.append('g')\n .classed('shapelayer', true);\n\n // single cartesian layer for the whole plot\n fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n // single ternary layer for the whole plot\n fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n // single geo layer for the whole plot\n fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true);\n\n // upper shape layer\n // (only for shapes to be drawn above the whole plot, including subplots)\n var layerAbove = fullLayout._paper.append('g')\n .classed('layer-above', true);\n fullLayout._imageUpperLayer = layerAbove.append('g')\n .classed('imagelayer', true);\n fullLayout._shapeUpperLayer = layerAbove.append('g')\n .classed('shapelayer', true);\n\n // single pie layer for the whole plot\n fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n // fill in image server scrape-svg\n fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\n // lastly info (legend, annotations) and hover layers go on top\n // these are in a different svg element normally, but get collapsed into a single\n // svg when exporting (after inserting 3D)\n fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n fullLayout._hoverlayer = fullLayout._toppaper.append('g').classed('hoverlayer', true);\n\n gd.emit('plotly_framework');\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/plot_api.js\n// module id = 407\n// module chunks = 0","module.exports = true;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/is-browser/client.js\n// module id = 408\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Polar = module.exports = require('./micropolar');\n\nPolar.manager = require('./micropolar_manager');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/polar/index.js\n// module id = 409\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n/* eslint-disable new-cap */\n\n'use strict';\n\nvar d3 = require('d3');\nvar Lib = require('../../lib');\nvar Color = require('../../components/color');\n\nvar micropolar = require('./micropolar');\nvar UndoManager = require('./undo_manager');\nvar extendDeepAll = Lib.extendDeepAll;\n\nvar manager = module.exports = {};\n\nmanager.framework = function(_gd) {\n var config, previousConfigClone, plot, convertedInput, container;\n var undoManager = new UndoManager();\n\n function exports(_inputConfig, _container) {\n if(_container) container = _container;\n d3.select(d3.select(container).node().parentNode).selectAll('.svg-container>*:not(.chart-root)').remove();\n\n config = (!config) ?\n _inputConfig :\n extendDeepAll(config, _inputConfig);\n\n if(!plot) plot = micropolar.Axis();\n convertedInput = micropolar.adapter.plotly().convert(config);\n plot.config(convertedInput).render(container);\n _gd.data = config.data;\n _gd.layout = config.layout;\n manager.fillLayout(_gd);\n return config;\n }\n exports.isPolar = true;\n exports.svg = function() { return plot.svg(); };\n exports.getConfig = function() { return config; };\n exports.getLiveConfig = function() {\n return micropolar.adapter.plotly().convert(plot.getLiveConfig(), true);\n };\n exports.getLiveScales = function() { return {t: plot.angularScale(), r: plot.radialScale()}; };\n exports.setUndoPoint = function() {\n var that = this;\n var configClone = micropolar.util.cloneJson(config);\n (function(_configClone, _previousConfigClone) {\n undoManager.add({\n undo: function() {\n if(_previousConfigClone) that(_previousConfigClone);\n },\n redo: function() {\n that(_configClone);\n }\n });\n })(configClone, previousConfigClone);\n previousConfigClone = micropolar.util.cloneJson(configClone);\n };\n exports.undo = function() { undoManager.undo(); };\n exports.redo = function() { undoManager.redo(); };\n return exports;\n};\n\nmanager.fillLayout = function(_gd) {\n var container = d3.select(_gd).selectAll('.plot-container'),\n paperDiv = container.selectAll('.svg-container'),\n paper = _gd.framework && _gd.framework.svg && _gd.framework.svg(),\n dflts = {\n width: 800,\n height: 600,\n paper_bgcolor: Color.background,\n _container: container,\n _paperdiv: paperDiv,\n _paper: paper\n };\n\n _gd._fullLayout = extendDeepAll(dflts, _gd.layout);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/polar/micropolar_manager.js\n// module id = 410\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Modified from https://github.com/ArthurClemens/Javascript-Undo-Manager\n// Copyright (c) 2010-2013 Arthur Clemens, arthur@visiblearea.com\nmodule.exports = function UndoManager() {\n var undoCommands = [],\n index = -1,\n isExecuting = false,\n callback;\n\n function execute(command, action) {\n if(!command) return this;\n\n isExecuting = true;\n command[action]();\n isExecuting = false;\n\n return this;\n }\n\n return {\n add: function(command) {\n if(isExecuting) return this;\n undoCommands.splice(index + 1, undoCommands.length - index);\n undoCommands.push(command);\n index = undoCommands.length - 1;\n return this;\n },\n setCallback: function(callbackFunc) { callback = callbackFunc; },\n undo: function() {\n var command = undoCommands[index];\n if(!command) return this;\n execute(command, 'undo');\n index -= 1;\n if(callback) callback(command.undo);\n return this;\n },\n redo: function() {\n var command = undoCommands[index + 1];\n if(!command) return this;\n execute(command, 'redo');\n index += 1;\n if(callback) callback(command.redo);\n return this;\n },\n clear: function() {\n undoCommands = [];\n index = -1;\n },\n hasUndo: function() { return index !== -1; },\n hasRedo: function() { return index < (undoCommands.length - 1); },\n getCommands: function() { return undoCommands; },\n getPreviousCommand: function() { return undoCommands[index - 1]; },\n getIndex: function() { return index; }\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/polar/undo_manager.js\n// module id = 411\n// module chunks = 0","var rootPosition = { left: 0, top: 0 }\n\nmodule.exports = mouseEventOffset\nfunction mouseEventOffset (ev, target, out) {\n target = target || ev.currentTarget || ev.srcElement\n if (!Array.isArray(out)) {\n out = [ 0, 0 ]\n }\n var cx = ev.clientX || 0\n var cy = ev.clientY || 0\n var rect = getBoundingClientOffset(target)\n out[0] = cx - rect.left\n out[1] = cy - rect.top\n return out\n}\n\nfunction getBoundingClientOffset (element) {\n if (element === window ||\n element === document ||\n element === document.body) {\n return rootPosition\n } else {\n return element.getBoundingClientRect()\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mouse-event-offset/index.js\n// module id = 412\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n// for automatic alignment on dragging, <1/3 means left align,\n// >2/3 means right, and between is center. Pick the right fraction\n// based on where you are, and return the fraction corresponding to\n// that position on the object\nmodule.exports = function align(v, dv, v0, v1, anchor) {\n var vmin = (v - v0) / (v1 - v0),\n vmax = vmin + dv / (v1 - v0),\n vc = (vmin + vmax) / 2;\n\n // explicitly specified anchor\n if(anchor === 'left' || anchor === 'bottom') return vmin;\n if(anchor === 'center' || anchor === 'middle') return vc;\n if(anchor === 'right' || anchor === 'top') return vmax;\n\n // automatic based on position\n if(vmin < (2 / 3) - vc) return vmin;\n if(vmax > (4 / 3) - vc) return vmax;\n return vc;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/dragelement/align.js\n// module id = 413\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\n\n// set cursors pointing toward the closest corner/side,\n// to indicate alignment\n// x and y are 0-1, fractions of the plot area\nvar cursorset = [\n ['sw-resize', 's-resize', 'se-resize'],\n ['w-resize', 'move', 'e-resize'],\n ['nw-resize', 'n-resize', 'ne-resize']\n];\n\nmodule.exports = function getCursor(x, y, xanchor, yanchor) {\n if(xanchor === 'left') x = 0;\n else if(xanchor === 'center') x = 1;\n else if(xanchor === 'right') x = 2;\n else x = Lib.constrain(Math.floor(x * 3), 0, 2);\n\n if(yanchor === 'bottom') y = 0;\n else if(yanchor === 'middle') y = 1;\n else if(yanchor === 'top') y = 2;\n else y = Lib.constrain(Math.floor(y * 3), 0, 2);\n\n return cursorset[y][x];\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/dragelement/cursor.js\n// module id = 414\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nvar Events = require('../../lib/events');\nvar throttle = require('../../lib/throttle');\nvar getGraphDiv = require('../../lib/get_graph_div');\n\nvar hoverConstants = require('../fx/constants');\n\nvar unhover = module.exports = {};\n\n\nunhover.wrapped = function(gd, evt, subplot) {\n gd = getGraphDiv(gd);\n\n // Important, clear any queued hovers\n throttle.clear(gd._fullLayout._uid + hoverConstants.HOVERID);\n\n unhover.raw(gd, evt, subplot);\n};\n\n\n// remove hover effects on mouse out, and emit unhover event\nunhover.raw = function unhoverRaw(gd, evt) {\n var fullLayout = gd._fullLayout;\n var oldhoverdata = gd._hoverdata;\n\n if(!evt) evt = {};\n if(evt.target &&\n Events.triggerHandler(gd, 'plotly_beforehover', evt) === false) {\n return;\n }\n\n fullLayout._hoverlayer.selectAll('g').remove();\n fullLayout._hoverlayer.selectAll('line').remove();\n fullLayout._hoverlayer.selectAll('circle').remove();\n gd._hoverdata = undefined;\n\n if(evt.target && oldhoverdata) {\n gd.emit('plotly_unhover', {\n event: evt,\n points: oldhoverdata\n });\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/dragelement/unhover.js\n// module id = 415\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar handleHoverLabelDefaults = require('./hoverlabel_defaults');\nvar layoutAttributes = require('./layout_attributes');\n\nmodule.exports = function supplyLayoutGlobalDefaults(layoutIn, layoutOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n\n handleHoverLabelDefaults(layoutIn, layoutOut, coerce);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/layout_global_defaults.js\n// module id = 416\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar attributes = require('./attributes');\nvar handleHoverLabelDefaults = require('./hoverlabel_defaults');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n handleHoverLabelDefaults(traceIn, traceOut, coerce, layout.hoverlabel);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/defaults.js\n// module id = 417\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar layoutAttributes = require('./layout_attributes');\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n\n coerce('dragmode');\n\n var hovermodeDflt;\n if(layoutOut._has('cartesian')) {\n // flag for 'horizontal' plots:\n // determines the state of the mode bar 'compare' hovermode button\n layoutOut._isHoriz = isHoriz(fullData);\n hovermodeDflt = layoutOut._isHoriz ? 'y' : 'x';\n }\n else hovermodeDflt = 'closest';\n\n coerce('hovermode', hovermodeDflt);\n\n // if only mapbox or geo subplots is present on graph,\n // reset 'zoom' dragmode to 'pan' until 'zoom' is implemented,\n // so that the correct modebar button is active\n var hasMapbox = layoutOut._has('mapbox');\n var hasGeo = layoutOut._has('geo');\n var len = layoutOut._basePlotModules.length;\n\n if(layoutOut.dragmode === 'zoom' && (\n ((hasMapbox || hasGeo) && len === 1) ||\n (hasMapbox && hasGeo && len === 2)\n )) {\n layoutOut.dragmode = 'pan';\n }\n};\n\nfunction isHoriz(fullData) {\n var out = true;\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n\n if(trace.orientation !== 'h') {\n out = false;\n break;\n }\n }\n\n return out;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/layout_defaults.js\n// module id = 418\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Registry = require('../../registry');\n\nmodule.exports = function calc(gd) {\n var calcdata = gd.calcdata;\n var fullLayout = gd._fullLayout;\n\n function makeCoerceHoverInfo(trace) {\n return function(val) {\n return Lib.coerceHoverinfo({hoverinfo: val}, {_module: trace._module}, fullLayout);\n };\n }\n\n for(var i = 0; i < calcdata.length; i++) {\n var cd = calcdata[i];\n var trace = cd[0].trace;\n\n // don't include hover calc fields for pie traces\n // as calcdata items might be sorted by value and\n // won't match the data array order.\n if(Registry.traceIs(trace, 'pie')) continue;\n\n var fillFn = Registry.traceIs(trace, '2dMap') ? paste : Lib.fillArray;\n\n fillFn(trace.hoverinfo, cd, 'hi', makeCoerceHoverInfo(trace));\n\n if(!trace.hoverlabel) continue;\n\n fillFn(trace.hoverlabel.bgcolor, cd, 'hbg');\n fillFn(trace.hoverlabel.bordercolor, cd, 'hbc');\n fillFn(trace.hoverlabel.font.size, cd, 'hts');\n fillFn(trace.hoverlabel.font.color, cd, 'htc');\n fillFn(trace.hoverlabel.font.family, cd, 'htf');\n fillFn(trace.hoverlabel.namelength, cd, 'hnl');\n }\n};\n\nfunction paste(traceAttr, cd, cdAttr, fn) {\n fn = fn || Lib.identity;\n\n if(Array.isArray(traceAttr)) {\n cd[0][cdAttr] = fn(traceAttr);\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/calc.js\n// module id = 419\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar setCursor = require('./setcursor');\n\nvar STASHATTR = 'data-savedcursor';\nvar NO_CURSOR = '!!';\n\n/*\n * works with our CSS cursor classes (see css/_cursor.scss)\n * to override a previous cursor set on d3 single-element selections,\n * by moving the name of the original cursor to the data-savedcursor attr.\n * omit cursor to revert to the previously set value.\n */\nmodule.exports = function overrideCursor(el3, csr) {\n var savedCursor = el3.attr(STASHATTR);\n if(csr) {\n if(!savedCursor) {\n var classes = (el3.attr('class') || '').split(' ');\n for(var i = 0; i < classes.length; i++) {\n var cls = classes[i];\n if(cls.indexOf('cursor-') === 0) {\n el3.attr(STASHATTR, cls.substr(7))\n .classed(cls, false);\n }\n }\n if(!el3.attr(STASHATTR)) {\n el3.attr(STASHATTR, NO_CURSOR);\n }\n }\n setCursor(el3, csr);\n }\n else if(savedCursor) {\n el3.attr(STASHATTR, null);\n\n if(savedCursor === NO_CURSOR) setCursor(el3);\n else setCursor(el3, savedCursor);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/lib/override_cursor.js\n// module id = 420\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = require('../../registry');\nvar hover = require('./hover').hover;\n\nmodule.exports = function click(gd, evt, subplot) {\n var annotationsDone = Registry.getComponentMethod('annotations', 'onClick')(gd, gd._hoverdata);\n\n // fallback to fail-safe in case the plot type's hover method doesn't pass the subplot.\n // Ternary, for example, didn't, but it was caught because tested.\n if(subplot !== undefined) {\n // The true flag at the end causes it to re-run the hover computation to figure out *which*\n // point is being clicked. Without this, clicking is somewhat unreliable.\n hover(gd, evt, subplot, true);\n }\n\n function emitClick() { gd.emit('plotly_click', {points: gd._hoverdata, event: evt}); }\n\n if(gd._hoverdata && evt && evt.target) {\n if(annotationsDone && annotationsDone.then) {\n annotationsDone.then(emitClick);\n }\n else emitClick();\n\n // why do we get a double event without this???\n if(evt.stopImmediatePropagation) evt.stopImmediatePropagation();\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/fx/click.js\n// module id = 421\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar tinycolor = require('tinycolor2');\n\nvar Plotly = require('../../plotly');\nvar Registry = require('../../registry');\nvar Lib = require('../../lib');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar Color = require('../../components/color');\nvar Drawing = require('../../components/drawing');\nvar setCursor = require('../../lib/setcursor');\nvar dragElement = require('../../components/dragelement');\nvar FROM_TL = require('../../constants/alignment').FROM_TL;\n\nvar Plots = require('../plots');\n\nvar doTicks = require('./axes').doTicks;\nvar getFromId = require('./axis_ids').getFromId;\nvar prepSelect = require('./select');\nvar scaleZoom = require('./scale_zoom');\n\nvar constants = require('./constants');\nvar MINDRAG = constants.MINDRAG;\nvar MINZOOM = constants.MINZOOM;\n\n// flag for showing \"doubleclick to zoom out\" only at the beginning\nvar SHOWZOOMOUTTIP = true;\n\n// dragBox: create an element to drag one or more axis ends\n// inputs:\n// plotinfo - which subplot are we making dragboxes on?\n// x,y,w,h - left, top, width, height of the box\n// ns - how does this drag the vertical axis?\n// 'n' - top only\n// 's' - bottom only\n// 'ns' - top and bottom together, difference unchanged\n// ew - same for horizontal axis\nmodule.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {\n // mouseDown stores ms of first mousedown event in the last\n // DBLCLICKDELAY ms on the drag bars\n // numClicks stores how many mousedowns have been seen\n // within DBLCLICKDELAY so we can check for click or doubleclick events\n // dragged stores whether a drag has occurred, so we don't have to\n // redraw unnecessarily, ie if no move bigger than MINDRAG or MINZOOM px\n var fullLayout = gd._fullLayout,\n zoomlayer = gd._fullLayout._zoomlayer,\n isMainDrag = (ns + ew === 'nsew'),\n subplots,\n xa,\n ya,\n xs,\n ys,\n pw,\n ph,\n xActive,\n yActive,\n cursor,\n isSubplotConstrained,\n xaLinked,\n yaLinked;\n\n function recomputeAxisLists() {\n xa = [plotinfo.xaxis];\n ya = [plotinfo.yaxis];\n var xa0 = xa[0];\n var ya0 = ya[0];\n pw = xa0._length;\n ph = ya0._length;\n\n var constraintGroups = fullLayout._axisConstraintGroups;\n var xIDs = [xa0._id];\n var yIDs = [ya0._id];\n\n // if we're dragging two axes at once, also drag overlays\n subplots = [plotinfo].concat((ns && ew) ? plotinfo.overlays : []);\n\n for(var i = 1; i < subplots.length; i++) {\n var subplotXa = subplots[i].xaxis,\n subplotYa = subplots[i].yaxis;\n\n if(xa.indexOf(subplotXa) === -1) {\n xa.push(subplotXa);\n xIDs.push(subplotXa._id);\n }\n\n if(ya.indexOf(subplotYa) === -1) {\n ya.push(subplotYa);\n yIDs.push(subplotYa._id);\n }\n }\n\n xActive = isDirectionActive(xa, ew);\n yActive = isDirectionActive(ya, ns);\n cursor = getDragCursor(yActive + xActive, fullLayout.dragmode);\n xs = xa0._offset;\n ys = ya0._offset;\n\n var links = calcLinks(constraintGroups, xIDs, yIDs);\n isSubplotConstrained = links.xy;\n\n // finally make the list of axis objects to link\n xaLinked = [];\n for(var xLinkID in links.x) { xaLinked.push(getFromId(gd, xLinkID)); }\n yaLinked = [];\n for(var yLinkID in links.y) { yaLinked.push(getFromId(gd, yLinkID)); }\n }\n\n recomputeAxisLists();\n\n var dragger = makeDragger(plotinfo, ns + ew + 'drag', cursor, x, y, w, h);\n\n // still need to make the element if the axes are disabled\n // but nuke its events (except for maindrag which needs them for hover)\n // and stop there\n if(!yActive && !xActive && !isSelectOrLasso(fullLayout.dragmode)) {\n dragger.onmousedown = null;\n dragger.style.pointerEvents = isMainDrag ? 'all' : 'none';\n return dragger;\n }\n\n var dragOptions = {\n element: dragger,\n gd: gd,\n plotinfo: plotinfo,\n prepFn: function(e, startX, startY) {\n var dragModeNow = gd._fullLayout.dragmode;\n\n if(isMainDrag) {\n // main dragger handles all drag modes, and changes\n // to pan (or to zoom if it already is pan) on shift\n if(e.shiftKey) {\n if(dragModeNow === 'pan') dragModeNow = 'zoom';\n else dragModeNow = 'pan';\n }\n }\n // all other draggers just pan\n else dragModeNow = 'pan';\n\n if(dragModeNow === 'lasso') dragOptions.minDrag = 1;\n else dragOptions.minDrag = undefined;\n\n if(dragModeNow === 'zoom') {\n dragOptions.moveFn = zoomMove;\n dragOptions.doneFn = zoomDone;\n\n // zoomMove takes care of the threshold, but we need to\n // minimize this so that constrained zoom boxes will flip\n // orientation at the right place\n dragOptions.minDrag = 1;\n\n zoomPrep(e, startX, startY);\n }\n else if(dragModeNow === 'pan') {\n dragOptions.moveFn = plotDrag;\n dragOptions.doneFn = dragDone;\n clearSelect(zoomlayer);\n }\n else if(isSelectOrLasso(dragModeNow)) {\n dragOptions.xaxes = xa;\n dragOptions.yaxes = ya;\n prepSelect(e, startX, startY, dragOptions, dragModeNow);\n }\n }\n };\n\n dragElement.init(dragOptions);\n\n var x0,\n y0,\n box,\n lum,\n path0,\n dimmed,\n zoomMode,\n zb,\n corners;\n\n // collected changes to be made to the plot by relayout at the end\n var updates = {};\n\n function zoomPrep(e, startX, startY) {\n var dragBBox = dragger.getBoundingClientRect();\n x0 = startX - dragBBox.left;\n y0 = startY - dragBBox.top;\n box = {l: x0, r: x0, w: 0, t: y0, b: y0, h: 0};\n lum = gd._hmpixcount ?\n (gd._hmlumcount / gd._hmpixcount) :\n tinycolor(gd._fullLayout.plot_bgcolor).getLuminance();\n path0 = 'M0,0H' + pw + 'V' + ph + 'H0V0';\n dimmed = false;\n zoomMode = 'xy';\n\n zb = makeZoombox(zoomlayer, lum, xs, ys, path0);\n\n corners = makeCorners(zoomlayer, xs, ys);\n\n clearSelect(zoomlayer);\n }\n\n function zoomMove(dx0, dy0) {\n if(gd._transitioningWithDuration) {\n return false;\n }\n\n var x1 = Math.max(0, Math.min(pw, dx0 + x0)),\n y1 = Math.max(0, Math.min(ph, dy0 + y0)),\n dx = Math.abs(x1 - x0),\n dy = Math.abs(y1 - y0);\n\n box.l = Math.min(x0, x1);\n box.r = Math.max(x0, x1);\n box.t = Math.min(y0, y1);\n box.b = Math.max(y0, y1);\n\n function noZoom() {\n zoomMode = '';\n box.r = box.l;\n box.t = box.b;\n corners.attr('d', 'M0,0Z');\n }\n\n if(isSubplotConstrained) {\n if(dx > MINZOOM || dy > MINZOOM) {\n zoomMode = 'xy';\n if(dx / pw > dy / ph) {\n dy = dx * ph / pw;\n if(y0 > y1) box.t = y0 - dy;\n else box.b = y0 + dy;\n }\n else {\n dx = dy * pw / ph;\n if(x0 > x1) box.l = x0 - dx;\n else box.r = x0 + dx;\n }\n corners.attr('d', xyCorners(box));\n }\n else {\n noZoom();\n }\n }\n // look for small drags in one direction or the other,\n // and only drag the other axis\n else if(!yActive || dy < Math.min(Math.max(dx * 0.6, MINDRAG), MINZOOM)) {\n if(dx < MINDRAG) {\n noZoom();\n }\n else {\n box.t = 0;\n box.b = ph;\n zoomMode = 'x';\n corners.attr('d', xCorners(box, y0));\n }\n }\n else if(!xActive || dx < Math.min(dy * 0.6, MINZOOM)) {\n box.l = 0;\n box.r = pw;\n zoomMode = 'y';\n corners.attr('d', yCorners(box, x0));\n }\n else {\n zoomMode = 'xy';\n corners.attr('d', xyCorners(box));\n }\n box.w = box.r - box.l;\n box.h = box.b - box.t;\n\n updateZoombox(zb, corners, box, path0, dimmed, lum);\n dimmed = true;\n }\n\n function zoomDone(dragged, numClicks) {\n if(Math.min(box.h, box.w) < MINDRAG * 2) {\n if(numClicks === 2) doubleClick();\n\n return removeZoombox(gd);\n }\n\n // TODO: edit linked axes in zoomAxRanges and in dragTail\n if(zoomMode === 'xy' || zoomMode === 'x') zoomAxRanges(xa, box.l / pw, box.r / pw, updates, xaLinked);\n if(zoomMode === 'xy' || zoomMode === 'y') zoomAxRanges(ya, (ph - box.b) / ph, (ph - box.t) / ph, updates, yaLinked);\n\n removeZoombox(gd);\n dragTail(zoomMode);\n\n if(SHOWZOOMOUTTIP && gd.data && gd._context.showTips) {\n Lib.notifier('Double-click to
zoom back out', 'long');\n SHOWZOOMOUTTIP = false;\n }\n }\n\n function dragDone(dragged, numClicks) {\n var singleEnd = (ns + ew).length === 1;\n if(dragged) dragTail();\n else if(numClicks === 2 && !singleEnd) doubleClick();\n else if(numClicks === 1 && singleEnd) {\n var ax = ns ? ya[0] : xa[0],\n end = (ns === 's' || ew === 'w') ? 0 : 1,\n attrStr = ax._name + '.range[' + end + ']',\n initialText = getEndText(ax, end),\n hAlign = 'left',\n vAlign = 'middle';\n\n if(ax.fixedrange) return;\n\n if(ns) {\n vAlign = (ns === 'n') ? 'top' : 'bottom';\n if(ax.side === 'right') hAlign = 'right';\n }\n else if(ew === 'e') hAlign = 'right';\n\n if(gd._context.showAxisRangeEntryBoxes) {\n d3.select(dragger)\n .call(svgTextUtils.makeEditable, {\n gd: gd,\n immediate: true,\n background: fullLayout.paper_bgcolor,\n text: String(initialText),\n fill: ax.tickfont ? ax.tickfont.color : '#444',\n horizontalAlign: hAlign,\n verticalAlign: vAlign\n })\n .on('edit', function(text) {\n var v = ax.d2r(text);\n if(v !== undefined) {\n Plotly.relayout(gd, attrStr, v);\n }\n });\n }\n }\n }\n\n // scroll zoom, on all draggers except corners\n var scrollViewBox = [0, 0, pw, ph];\n // wait a little after scrolling before redrawing\n var redrawTimer = null;\n var REDRAWDELAY = constants.REDRAWDELAY;\n var mainplot = plotinfo.mainplot ?\n fullLayout._plots[plotinfo.mainplot] : plotinfo;\n\n function zoomWheel(e) {\n // deactivate mousewheel scrolling on embedded graphs\n // devs can override this with layout._enablescrollzoom,\n // but _ ensures this setting won't leave their page\n if(!gd._context.scrollZoom && !fullLayout._enablescrollzoom) {\n return;\n }\n\n // If a transition is in progress, then disable any behavior:\n if(gd._transitioningWithDuration) {\n return Lib.pauseEvent(e);\n }\n\n var pc = gd.querySelector('.plotly');\n\n recomputeAxisLists();\n\n // if the plot has scrollbars (more than a tiny excess)\n // disable scrollzoom too.\n if(pc.scrollHeight - pc.clientHeight > 10 ||\n pc.scrollWidth - pc.clientWidth > 10) {\n return;\n }\n\n clearTimeout(redrawTimer);\n\n var wheelDelta = -e.deltaY;\n if(!isFinite(wheelDelta)) wheelDelta = e.wheelDelta / 10;\n if(!isFinite(wheelDelta)) {\n Lib.log('Did not find wheel motion attributes: ', e);\n return;\n }\n\n var zoom = Math.exp(-Math.min(Math.max(wheelDelta, -20), 20) / 200),\n gbb = mainplot.draglayer.select('.nsewdrag')\n .node().getBoundingClientRect(),\n xfrac = (e.clientX - gbb.left) / gbb.width,\n yfrac = (gbb.bottom - e.clientY) / gbb.height,\n i;\n\n function zoomWheelOneAxis(ax, centerFraction, zoom) {\n if(ax.fixedrange) return;\n\n var axRange = Lib.simpleMap(ax.range, ax.r2l),\n v0 = axRange[0] + (axRange[1] - axRange[0]) * centerFraction;\n function doZoom(v) { return ax.l2r(v0 + (v - v0) * zoom); }\n ax.range = axRange.map(doZoom);\n }\n\n if(ew || isSubplotConstrained) {\n // if we're only zooming this axis because of constraints,\n // zoom it about the center\n if(!ew) xfrac = 0.5;\n\n for(i = 0; i < xa.length; i++) zoomWheelOneAxis(xa[i], xfrac, zoom);\n\n scrollViewBox[2] *= zoom;\n scrollViewBox[0] += scrollViewBox[2] * xfrac * (1 / zoom - 1);\n }\n if(ns || isSubplotConstrained) {\n if(!ns) yfrac = 0.5;\n\n for(i = 0; i < ya.length; i++) zoomWheelOneAxis(ya[i], yfrac, zoom);\n\n scrollViewBox[3] *= zoom;\n scrollViewBox[1] += scrollViewBox[3] * (1 - yfrac) * (1 / zoom - 1);\n }\n\n // viewbox redraw at first\n updateSubplots(scrollViewBox);\n ticksAndAnnotations(ns, ew);\n\n // then replot after a delay to make sure\n // no more scrolling is coming\n redrawTimer = setTimeout(function() {\n scrollViewBox = [0, 0, pw, ph];\n\n var zoomMode;\n if(isSubplotConstrained) zoomMode = 'xy';\n else zoomMode = (ew ? 'x' : '') + (ns ? 'y' : '');\n\n dragTail(zoomMode);\n }, REDRAWDELAY);\n\n return Lib.pauseEvent(e);\n }\n\n // everything but the corners gets wheel zoom\n if(ns.length * ew.length !== 1) {\n // still seems to be some confusion about onwheel vs onmousewheel...\n if(dragger.onwheel !== undefined) dragger.onwheel = zoomWheel;\n else if(dragger.onmousewheel !== undefined) dragger.onmousewheel = zoomWheel;\n }\n\n // plotDrag: move the plot in response to a drag\n function plotDrag(dx, dy) {\n // If a transition is in progress, then disable any behavior:\n if(gd._transitioningWithDuration) {\n return;\n }\n\n recomputeAxisLists();\n\n if(xActive === 'ew' || yActive === 'ns') {\n if(xActive) dragAxList(xa, dx);\n if(yActive) dragAxList(ya, dy);\n updateSubplots([xActive ? -dx : 0, yActive ? -dy : 0, pw, ph]);\n ticksAndAnnotations(yActive, xActive);\n return;\n }\n\n // dz: set a new value for one end (0 or 1) of an axis array axArray,\n // and return a pixel shift for that end for the viewbox\n // based on pixel drag distance d\n // TODO: this makes (generally non-fatal) errors when you get\n // near floating point limits\n function dz(axArray, end, d) {\n var otherEnd = 1 - end,\n movedAx,\n newLinearizedEnd;\n for(var i = 0; i < axArray.length; i++) {\n var axi = axArray[i];\n if(axi.fixedrange) continue;\n movedAx = axi;\n newLinearizedEnd = axi._rl[otherEnd] +\n (axi._rl[end] - axi._rl[otherEnd]) / dZoom(d / axi._length);\n var newEnd = axi.l2r(newLinearizedEnd);\n\n // if l2r comes back false or undefined, it means we've dragged off\n // the end of valid ranges - so stop.\n if(newEnd !== false && newEnd !== undefined) axi.range[end] = newEnd;\n }\n return movedAx._length * (movedAx._rl[end] - newLinearizedEnd) /\n (movedAx._rl[end] - movedAx._rl[otherEnd]);\n }\n\n if(isSubplotConstrained && xActive && yActive) {\n // dragging a corner of a constrained subplot:\n // respect the fixed corner, but harmonize dx and dy\n var dxySign = ((xActive === 'w') === (yActive === 'n')) ? 1 : -1;\n var dxyFraction = (dx / pw + dxySign * dy / ph) / 2;\n dx = dxyFraction * pw;\n dy = dxySign * dxyFraction * ph;\n }\n\n if(xActive === 'w') dx = dz(xa, 0, dx);\n else if(xActive === 'e') dx = dz(xa, 1, -dx);\n else if(!xActive) dx = 0;\n\n if(yActive === 'n') dy = dz(ya, 1, dy);\n else if(yActive === 's') dy = dz(ya, 0, -dy);\n else if(!yActive) dy = 0;\n\n var x0 = (xActive === 'w') ? dx : 0;\n var y0 = (yActive === 'n') ? dy : 0;\n\n if(isSubplotConstrained) {\n var i;\n if(!xActive && yActive.length === 1) {\n // dragging one end of the y axis of a constrained subplot\n // scale the other axis the same about its middle\n for(i = 0; i < xa.length; i++) {\n xa[i].range = xa[i]._r.slice();\n scaleZoom(xa[i], 1 - dy / ph);\n }\n dx = dy * pw / ph;\n x0 = dx / 2;\n }\n if(!yActive && xActive.length === 1) {\n for(i = 0; i < ya.length; i++) {\n ya[i].range = ya[i]._r.slice();\n scaleZoom(ya[i], 1 - dx / pw);\n }\n dy = dx * ph / pw;\n y0 = dy / 2;\n }\n }\n\n updateSubplots([x0, y0, pw - dx, ph - dy]);\n ticksAndAnnotations(yActive, xActive);\n }\n\n // Draw ticks and annotations (and other components) when ranges change.\n // Also records the ranges that have changed for use by update at the end.\n function ticksAndAnnotations(ns, ew) {\n var activeAxIds = [],\n i;\n\n function pushActiveAxIds(axList) {\n for(i = 0; i < axList.length; i++) {\n if(!axList[i].fixedrange) activeAxIds.push(axList[i]._id);\n }\n }\n\n if(ew || isSubplotConstrained) {\n pushActiveAxIds(xa);\n pushActiveAxIds(xaLinked);\n }\n if(ns || isSubplotConstrained) {\n pushActiveAxIds(ya);\n pushActiveAxIds(yaLinked);\n }\n\n updates = {};\n for(i = 0; i < activeAxIds.length; i++) {\n var axId = activeAxIds[i];\n doTicks(gd, axId, true);\n var ax = getFromId(gd, axId);\n updates[ax._name + '.range[0]'] = ax.range[0];\n updates[ax._name + '.range[1]'] = ax.range[1];\n }\n\n function redrawObjs(objArray, method, shortCircuit) {\n for(i = 0; i < objArray.length; i++) {\n var obji = objArray[i];\n\n if((ew && activeAxIds.indexOf(obji.xref) !== -1) ||\n (ns && activeAxIds.indexOf(obji.yref) !== -1)) {\n method(gd, i);\n // once is enough for images (which doesn't use the `i` arg anyway)\n if(shortCircuit) return;\n }\n }\n }\n\n // annotations and shapes 'draw' method is slow,\n // use the finer-grained 'drawOne' method instead\n\n redrawObjs(fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne'));\n redrawObjs(fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne'));\n redrawObjs(fullLayout.images || [], Registry.getComponentMethod('images', 'draw'), true);\n }\n\n function doubleClick() {\n if(gd._transitioningWithDuration) return;\n\n var doubleClickConfig = gd._context.doubleClick,\n axList = (xActive ? xa : []).concat(yActive ? ya : []),\n attrs = {};\n\n var ax, i, rangeInitial;\n\n // For reset+autosize mode:\n // If *any* of the main axes is not at its initial range\n // (or autoranged, if we have no initial range, to match the logic in\n // doubleClickConfig === 'reset' below), we reset.\n // If they are *all* at their initial ranges, then we autosize.\n if(doubleClickConfig === 'reset+autosize') {\n\n doubleClickConfig = 'autosize';\n\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n if((ax._rangeInitial && (\n ax.range[0] !== ax._rangeInitial[0] ||\n ax.range[1] !== ax._rangeInitial[1]\n )) ||\n (!ax._rangeInitial && !ax.autorange)\n ) {\n doubleClickConfig = 'reset';\n break;\n }\n }\n }\n\n if(doubleClickConfig === 'autosize') {\n // don't set the linked axes here, so relayout marks them as shrinkable\n // and we autosize just to the requested axis/axes\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n if(!ax.fixedrange) attrs[ax._name + '.autorange'] = true;\n }\n }\n else if(doubleClickConfig === 'reset') {\n // when we're resetting, reset all linked axes too, so we get back\n // to the fully-auto-with-constraints situation\n if(xActive || isSubplotConstrained) axList = axList.concat(xaLinked);\n if(yActive && !isSubplotConstrained) axList = axList.concat(yaLinked);\n\n if(isSubplotConstrained) {\n if(!xActive) axList = axList.concat(xa);\n else if(!yActive) axList = axList.concat(ya);\n }\n\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n\n if(!ax._rangeInitial) {\n attrs[ax._name + '.autorange'] = true;\n }\n else {\n rangeInitial = ax._rangeInitial;\n attrs[ax._name + '.range[0]'] = rangeInitial[0];\n attrs[ax._name + '.range[1]'] = rangeInitial[1];\n }\n }\n }\n\n gd.emit('plotly_doubleclick', null);\n Plotly.relayout(gd, attrs);\n }\n\n // dragTail - finish a drag event with a redraw\n function dragTail(zoommode) {\n if(zoommode === undefined) zoommode = (ew ? 'x' : '') + (ns ? 'y' : '');\n\n // put the subplot viewboxes back to default (Because we're going to)\n // be repositioning the data in the relayout. But DON'T call\n // ticksAndAnnotations again - it's unnecessary and would overwrite `updates`\n updateSubplots([0, 0, pw, ph]);\n\n // since we may have been redrawing some things during the drag, we may have\n // accumulated MathJax promises - wait for them before we relayout.\n Lib.syncOrAsync([\n Plots.previousPromises,\n function() { Plotly.relayout(gd, updates); }\n ], gd);\n }\n\n // updateSubplots - find all plot viewboxes that should be\n // affected by this drag, and update them. look for all plots\n // sharing an affected axis (including the one being dragged)\n function updateSubplots(viewBox) {\n var plotinfos = fullLayout._plots;\n var subplots = Object.keys(plotinfos);\n var xScaleFactor = viewBox[2] / xa[0]._length;\n var yScaleFactor = viewBox[3] / ya[0]._length;\n var editX = ew || isSubplotConstrained;\n var editY = ns || isSubplotConstrained;\n\n var i, xScaleFactor2, yScaleFactor2, clipDx, clipDy;\n\n // Find the appropriate scaling for this axis, if it's linked to the\n // dragged axes by constraints. 0 is special, it means this axis shouldn't\n // ever be scaled (will be converted to 1 if the other axis is scaled)\n function getLinkedScaleFactor(ax) {\n if(ax.fixedrange) return 0;\n\n if(editX && xaLinked.indexOf(ax) !== -1) {\n return xScaleFactor;\n }\n if(editY && (isSubplotConstrained ? xaLinked : yaLinked).indexOf(ax) !== -1) {\n return yScaleFactor;\n }\n return 0;\n }\n\n function scaleAndGetShift(ax, scaleFactor) {\n if(scaleFactor) {\n ax.range = ax._r.slice();\n scaleZoom(ax, scaleFactor);\n return getShift(ax, scaleFactor);\n }\n return 0;\n }\n\n function getShift(ax, scaleFactor) {\n return ax._length * (1 - scaleFactor) * FROM_TL[ax.constraintoward || 'middle'];\n }\n\n for(i = 0; i < subplots.length; i++) {\n\n var subplot = plotinfos[subplots[i]],\n xa2 = subplot.xaxis,\n ya2 = subplot.yaxis,\n editX2 = editX && !xa2.fixedrange && (xa.indexOf(xa2) !== -1),\n editY2 = editY && !ya2.fixedrange && (ya.indexOf(ya2) !== -1);\n\n if(editX2) {\n xScaleFactor2 = xScaleFactor;\n clipDx = ew ? viewBox[0] : getShift(xa2, xScaleFactor2);\n }\n else {\n xScaleFactor2 = getLinkedScaleFactor(xa2);\n clipDx = scaleAndGetShift(xa2, xScaleFactor2);\n }\n\n if(editY2) {\n yScaleFactor2 = yScaleFactor;\n clipDy = ns ? viewBox[1] : getShift(ya2, yScaleFactor2);\n }\n else {\n yScaleFactor2 = getLinkedScaleFactor(ya2);\n clipDy = scaleAndGetShift(ya2, yScaleFactor2);\n }\n\n // don't scale at all if neither axis is scalable here\n if(!xScaleFactor2 && !yScaleFactor2) continue;\n\n // but if only one is, reset the other axis scaling\n if(!xScaleFactor2) xScaleFactor2 = 1;\n if(!yScaleFactor2) yScaleFactor2 = 1;\n\n var plotDx = xa2._offset - clipDx / xScaleFactor2,\n plotDy = ya2._offset - clipDy / yScaleFactor2;\n\n fullLayout._defs.select('#' + subplot.clipId + '> rect')\n .call(Drawing.setTranslate, clipDx, clipDy)\n .call(Drawing.setScale, xScaleFactor2, yScaleFactor2);\n\n var scatterPoints = subplot.plot.selectAll('.scatterlayer .points, .boxlayer .points');\n\n subplot.plot\n .call(Drawing.setTranslate, plotDx, plotDy)\n .call(Drawing.setScale, 1 / xScaleFactor2, 1 / yScaleFactor2);\n\n // This is specifically directed at scatter traces, applying an inverse\n // scale to individual points to counteract the scale of the trace\n // as a whole:\n scatterPoints.selectAll('.point')\n .call(Drawing.setPointGroupScale, xScaleFactor2, yScaleFactor2)\n .call(Drawing.hideOutsideRangePoints, subplot);\n\n scatterPoints.selectAll('.textpoint')\n .call(Drawing.setTextPointsScale, xScaleFactor2, yScaleFactor2)\n .call(Drawing.hideOutsideRangePoints, subplot);\n }\n }\n\n return dragger;\n};\n\nfunction makeDragger(plotinfo, dragClass, cursor, x, y, w, h) {\n var dragger3 = plotinfo.draglayer.selectAll('.' + dragClass).data([0]);\n\n dragger3.enter().append('rect')\n .classed('drag', true)\n .classed(dragClass, true)\n .style({fill: 'transparent', 'stroke-width': 0})\n .attr('data-subplot', plotinfo.id);\n\n dragger3.call(Drawing.setRect, x, y, w, h)\n .call(setCursor, cursor);\n\n return dragger3.node();\n}\n\nfunction isDirectionActive(axList, activeVal) {\n for(var i = 0; i < axList.length; i++) {\n if(!axList[i].fixedrange) return activeVal;\n }\n return '';\n}\n\nfunction getEndText(ax, end) {\n var initialVal = ax.range[end],\n diff = Math.abs(initialVal - ax.range[1 - end]),\n dig;\n\n // TODO: this should basically be ax.r2d but we're doing extra\n // rounding here... can we clean up at all?\n if(ax.type === 'date') {\n return initialVal;\n }\n else if(ax.type === 'log') {\n dig = Math.ceil(Math.max(0, -Math.log(diff) / Math.LN10)) + 3;\n return d3.format('.' + dig + 'g')(Math.pow(10, initialVal));\n }\n else { // linear numeric (or category... but just show numbers here)\n dig = Math.floor(Math.log(Math.abs(initialVal)) / Math.LN10) -\n Math.floor(Math.log(diff) / Math.LN10) + 4;\n return d3.format('.' + String(dig) + 'g')(initialVal);\n }\n}\n\nfunction zoomAxRanges(axList, r0Fraction, r1Fraction, updates, linkedAxes) {\n var i,\n axi,\n axRangeLinear0,\n axRangeLinearSpan;\n\n for(i = 0; i < axList.length; i++) {\n axi = axList[i];\n if(axi.fixedrange) continue;\n\n axRangeLinear0 = axi._rl[0];\n axRangeLinearSpan = axi._rl[1] - axRangeLinear0;\n axi.range = [\n axi.l2r(axRangeLinear0 + axRangeLinearSpan * r0Fraction),\n axi.l2r(axRangeLinear0 + axRangeLinearSpan * r1Fraction)\n ];\n updates[axi._name + '.range[0]'] = axi.range[0];\n updates[axi._name + '.range[1]'] = axi.range[1];\n }\n\n // zoom linked axes about their centers\n if(linkedAxes && linkedAxes.length) {\n var linkedR0Fraction = (r0Fraction + (1 - r1Fraction)) / 2;\n\n zoomAxRanges(linkedAxes, linkedR0Fraction, 1 - linkedR0Fraction, updates);\n }\n}\n\nfunction dragAxList(axList, pix) {\n for(var i = 0; i < axList.length; i++) {\n var axi = axList[i];\n if(!axi.fixedrange) {\n axi.range = [\n axi.l2r(axi._rl[0] - pix / axi._m),\n axi.l2r(axi._rl[1] - pix / axi._m)\n ];\n }\n }\n}\n\n// common transform for dragging one end of an axis\n// d>0 is compressing scale (cursor is over the plot,\n// the axis end should move with the cursor)\n// d<0 is expanding (cursor is off the plot, axis end moves\n// nonlinearly so you can expand far)\nfunction dZoom(d) {\n return 1 - ((d >= 0) ? Math.min(d, 0.9) :\n 1 / (1 / Math.max(d, -0.3) + 3.222));\n}\n\nfunction getDragCursor(nsew, dragmode) {\n if(!nsew) return 'pointer';\n if(nsew === 'nsew') {\n if(dragmode === 'pan') return 'move';\n return 'crosshair';\n }\n return nsew.toLowerCase() + '-resize';\n}\n\nfunction makeZoombox(zoomlayer, lum, xs, ys, path0) {\n return zoomlayer.append('path')\n .attr('class', 'zoombox')\n .style({\n 'fill': lum > 0.2 ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)',\n 'stroke-width': 0\n })\n .attr('transform', 'translate(' + xs + ', ' + ys + ')')\n .attr('d', path0 + 'Z');\n}\n\nfunction makeCorners(zoomlayer, xs, ys) {\n return zoomlayer.append('path')\n .attr('class', 'zoombox-corners')\n .style({\n fill: Color.background,\n stroke: Color.defaultLine,\n 'stroke-width': 1,\n opacity: 0\n })\n .attr('transform', 'translate(' + xs + ', ' + ys + ')')\n .attr('d', 'M0,0Z');\n}\n\nfunction clearSelect(zoomlayer) {\n // until we get around to persistent selections, remove the outline\n // here. The selection itself will be removed when the plot redraws\n // at the end.\n zoomlayer.selectAll('.select-outline').remove();\n}\n\nfunction updateZoombox(zb, corners, box, path0, dimmed, lum) {\n zb.attr('d',\n path0 + 'M' + (box.l) + ',' + (box.t) + 'v' + (box.h) +\n 'h' + (box.w) + 'v-' + (box.h) + 'h-' + (box.w) + 'Z');\n if(!dimmed) {\n zb.transition()\n .style('fill', lum > 0.2 ? 'rgba(0,0,0,0.4)' :\n 'rgba(255,255,255,0.3)')\n .duration(200);\n corners.transition()\n .style('opacity', 1)\n .duration(200);\n }\n}\n\nfunction removeZoombox(gd) {\n d3.select(gd)\n .selectAll('.zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners')\n .remove();\n}\n\nfunction isSelectOrLasso(dragmode) {\n var modes = ['lasso', 'select'];\n\n return modes.indexOf(dragmode) !== -1;\n}\n\nfunction xCorners(box, y0) {\n return 'M' +\n (box.l - 0.5) + ',' + (y0 - MINZOOM - 0.5) +\n 'h-3v' + (2 * MINZOOM + 1) + 'h3ZM' +\n (box.r + 0.5) + ',' + (y0 - MINZOOM - 0.5) +\n 'h3v' + (2 * MINZOOM + 1) + 'h-3Z';\n}\n\nfunction yCorners(box, x0) {\n return 'M' +\n (x0 - MINZOOM - 0.5) + ',' + (box.t - 0.5) +\n 'v-3h' + (2 * MINZOOM + 1) + 'v3ZM' +\n (x0 - MINZOOM - 0.5) + ',' + (box.b + 0.5) +\n 'v3h' + (2 * MINZOOM + 1) + 'v-3Z';\n}\n\nfunction xyCorners(box) {\n var clen = Math.floor(Math.min(box.b - box.t, box.r - box.l, MINZOOM) / 2);\n return 'M' +\n (box.l - 3.5) + ',' + (box.t - 0.5 + clen) + 'h3v' + (-clen) +\n 'h' + clen + 'v-3h-' + (clen + 3) + 'ZM' +\n (box.r + 3.5) + ',' + (box.t - 0.5 + clen) + 'h-3v' + (-clen) +\n 'h' + (-clen) + 'v-3h' + (clen + 3) + 'ZM' +\n (box.r + 3.5) + ',' + (box.b + 0.5 - clen) + 'h-3v' + clen +\n 'h' + (-clen) + 'v3h' + (clen + 3) + 'ZM' +\n (box.l - 3.5) + ',' + (box.b + 0.5 - clen) + 'h3v' + clen +\n 'h' + clen + 'v3h-' + (clen + 3) + 'Z';\n}\n\nfunction calcLinks(constraintGroups, xIDs, yIDs) {\n var isSubplotConstrained = false;\n var xLinks = {};\n var yLinks = {};\n var i, j, k;\n\n var group, xLinkID, yLinkID;\n for(i = 0; i < constraintGroups.length; i++) {\n group = constraintGroups[i];\n // check if any of the x axes we're dragging is in this constraint group\n for(j = 0; j < xIDs.length; j++) {\n if(group[xIDs[j]]) {\n // put the rest of these axes into xLinks, if we're not already\n // dragging them, so we know to scale these axes automatically too\n // to match the changes in the dragged x axes\n for(xLinkID in group) {\n if((xLinkID.charAt(0) === 'x' ? xIDs : yIDs).indexOf(xLinkID) === -1) {\n xLinks[xLinkID] = 1;\n }\n }\n\n // check if the x and y axes of THIS drag are linked\n for(k = 0; k < yIDs.length; k++) {\n if(group[yIDs[k]]) isSubplotConstrained = true;\n }\n }\n }\n\n // now check if any of the y axes we're dragging is in this constraint group\n // only look for outside links, as we've already checked for links within the dragger\n for(j = 0; j < yIDs.length; j++) {\n if(group[yIDs[j]]) {\n for(yLinkID in group) {\n if((yLinkID.charAt(0) === 'x' ? xIDs : yIDs).indexOf(yLinkID) === -1) {\n yLinks[yLinkID] = 1;\n }\n }\n }\n }\n }\n\n if(isSubplotConstrained) {\n // merge xLinks and yLinks if the subplot is constrained,\n // since we'll always apply both anyway and the two will contain\n // duplicates\n Lib.extendFlat(xLinks, yLinks);\n yLinks = {};\n }\n return {\n x: xLinks,\n y: yLinks,\n xy: isSubplotConstrained\n };\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/dragbox.js\n// module id = 422\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar polygon = require('../../lib/polygon');\nvar throttle = require('../../lib/throttle');\nvar color = require('../../components/color');\nvar appendArrayPointValue = require('../../components/fx/helpers').appendArrayPointValue;\n\nvar axes = require('./axes');\nvar constants = require('./constants');\n\nvar filteredPolygon = polygon.filter;\nvar polygonTester = polygon.tester;\nvar MINSELECT = constants.MINSELECT;\n\nfunction getAxId(ax) { return ax._id; }\n\nmodule.exports = function prepSelect(e, startX, startY, dragOptions, mode) {\n var zoomLayer = dragOptions.gd._fullLayout._zoomlayer,\n dragBBox = dragOptions.element.getBoundingClientRect(),\n plotinfo = dragOptions.plotinfo,\n xs = plotinfo.xaxis._offset,\n ys = plotinfo.yaxis._offset,\n x0 = startX - dragBBox.left,\n y0 = startY - dragBBox.top,\n x1 = x0,\n y1 = y0,\n path0 = 'M' + x0 + ',' + y0,\n pw = dragOptions.xaxes[0]._length,\n ph = dragOptions.yaxes[0]._length,\n xAxisIds = dragOptions.xaxes.map(getAxId),\n yAxisIds = dragOptions.yaxes.map(getAxId),\n allAxes = dragOptions.xaxes.concat(dragOptions.yaxes),\n pts;\n\n if(mode === 'lasso') {\n pts = filteredPolygon([[x0, y0]], constants.BENDPX);\n }\n\n var outlines = zoomLayer.selectAll('path.select-outline').data([1, 2]);\n\n outlines.enter()\n .append('path')\n .attr('class', function(d) { return 'select-outline select-outline-' + d; })\n .attr('transform', 'translate(' + xs + ', ' + ys + ')')\n .attr('d', path0 + 'Z');\n\n var corners = zoomLayer.append('path')\n .attr('class', 'zoombox-corners')\n .style({\n fill: color.background,\n stroke: color.defaultLine,\n 'stroke-width': 1\n })\n .attr('transform', 'translate(' + xs + ', ' + ys + ')')\n .attr('d', 'M0,0Z');\n\n\n // find the traces to search for selection points\n var searchTraces = [];\n var gd = dragOptions.gd;\n var throttleID = gd._fullLayout._uid + constants.SELECTID;\n var selection = [];\n var i, cd, trace, searchInfo, eventData;\n\n for(i = 0; i < gd.calcdata.length; i++) {\n cd = gd.calcdata[i];\n trace = cd[0].trace;\n if(trace.visible !== true || !trace._module || !trace._module.selectPoints) continue;\n\n if(dragOptions.subplot) {\n if(\n trace.subplot === dragOptions.subplot ||\n trace.geo === dragOptions.subplot\n ) {\n searchTraces.push({\n selectPoints: trace._module.selectPoints,\n cd: cd,\n xaxis: dragOptions.xaxes[0],\n yaxis: dragOptions.yaxes[0]\n });\n }\n } else {\n if(xAxisIds.indexOf(trace.xaxis) === -1) continue;\n if(yAxisIds.indexOf(trace.yaxis) === -1) continue;\n\n searchTraces.push({\n selectPoints: trace._module.selectPoints,\n cd: cd,\n xaxis: axes.getFromId(gd, trace.xaxis),\n yaxis: axes.getFromId(gd, trace.yaxis)\n });\n }\n }\n\n function axValue(ax) {\n var index = (ax._id.charAt(0) === 'y') ? 1 : 0;\n return function(v) { return ax.p2d(v[index]); };\n }\n\n function ascending(a, b) { return a - b; }\n\n // allow subplots to override fillRangeItems routine\n var fillRangeItems;\n\n if(plotinfo.fillRangeItems) {\n fillRangeItems = plotinfo.fillRangeItems;\n } else {\n if(mode === 'select') {\n fillRangeItems = function(eventData, poly) {\n var ranges = eventData.range = {};\n\n for(i = 0; i < allAxes.length; i++) {\n var ax = allAxes[i];\n var axLetter = ax._id.charAt(0);\n\n ranges[ax._id] = [\n ax.p2d(poly[axLetter + 'min']),\n ax.p2d(poly[axLetter + 'max'])\n ].sort(ascending);\n }\n };\n } else {\n fillRangeItems = function(eventData, poly, pts) {\n var dataPts = eventData.lassoPoints = {};\n\n for(i = 0; i < allAxes.length; i++) {\n var ax = allAxes[i];\n dataPts[ax._id] = pts.filtered.map(axValue(ax));\n }\n };\n }\n }\n\n dragOptions.moveFn = function(dx0, dy0) {\n var poly;\n\n x1 = Math.max(0, Math.min(pw, dx0 + x0));\n y1 = Math.max(0, Math.min(ph, dy0 + y0));\n\n var dx = Math.abs(x1 - x0),\n dy = Math.abs(y1 - y0);\n\n if(mode === 'select') {\n if(dy < Math.min(dx * 0.6, MINSELECT)) {\n // horizontal motion: make a vertical box\n poly = polygonTester([[x0, 0], [x0, ph], [x1, ph], [x1, 0]]);\n // extras to guide users in keeping a straight selection\n corners.attr('d', 'M' + poly.xmin + ',' + (y0 - MINSELECT) +\n 'h-4v' + (2 * MINSELECT) + 'h4Z' +\n 'M' + (poly.xmax - 1) + ',' + (y0 - MINSELECT) +\n 'h4v' + (2 * MINSELECT) + 'h-4Z');\n\n }\n else if(dx < Math.min(dy * 0.6, MINSELECT)) {\n // vertical motion: make a horizontal box\n poly = polygonTester([[0, y0], [0, y1], [pw, y1], [pw, y0]]);\n corners.attr('d', 'M' + (x0 - MINSELECT) + ',' + poly.ymin +\n 'v-4h' + (2 * MINSELECT) + 'v4Z' +\n 'M' + (x0 - MINSELECT) + ',' + (poly.ymax - 1) +\n 'v4h' + (2 * MINSELECT) + 'v-4Z');\n }\n else {\n // diagonal motion\n poly = polygonTester([[x0, y0], [x0, y1], [x1, y1], [x1, y0]]);\n corners.attr('d', 'M0,0Z');\n }\n outlines.attr('d', 'M' + poly.xmin + ',' + poly.ymin +\n 'H' + (poly.xmax - 1) + 'V' + (poly.ymax - 1) +\n 'H' + poly.xmin + 'Z');\n }\n else if(mode === 'lasso') {\n pts.addPt([x1, y1]);\n poly = polygonTester(pts.filtered);\n outlines.attr('d', 'M' + pts.filtered.join('L') + 'Z');\n }\n\n throttle.throttle(\n throttleID,\n constants.SELECTDELAY,\n function() {\n selection = [];\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n var thisSelection = fillSelectionItem(\n searchInfo.selectPoints(searchInfo, poly), searchInfo\n );\n if(selection.length) {\n for(var j = 0; j < thisSelection.length; j++) {\n selection.push(thisSelection[j]);\n }\n }\n else selection = thisSelection;\n }\n\n eventData = {points: selection};\n fillRangeItems(eventData, poly, pts);\n dragOptions.gd.emit('plotly_selecting', eventData);\n }\n );\n };\n\n dragOptions.doneFn = function(dragged, numclicks) {\n corners.remove();\n throttle.done(throttleID).then(function() {\n throttle.clear(throttleID);\n\n if(!dragged && numclicks === 2) {\n // clear selection on doubleclick\n outlines.remove();\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n searchInfo.selectPoints(searchInfo, false);\n }\n\n gd.emit('plotly_deselect', null);\n }\n else {\n dragOptions.gd.emit('plotly_selected', eventData);\n }\n });\n };\n};\n\nfunction fillSelectionItem(selection, searchInfo) {\n if(Array.isArray(selection)) {\n var trace = searchInfo.cd[0].trace;\n\n for(var i = 0; i < selection.length; i++) {\n var sel = selection[i];\n\n sel.curveNumber = trace.index;\n sel.data = trace._input;\n sel.fullData = trace;\n appendArrayPointValue(sel, trace, sel.pointNumber);\n }\n }\n\n return selection;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/select.js\n// module id = 423\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar nestedProperty = require('../lib/nested_property');\nvar isPlainObject = require('../lib/is_plain_object');\nvar noop = require('../lib/noop');\nvar Loggers = require('../lib/loggers');\nvar sorterAsc = require('../lib/search').sorterAsc;\nvar Registry = require('../registry');\n\n\nexports.containerArrayMatch = require('./container_array_match');\n\nvar isAddVal = exports.isAddVal = function isAddVal(val) {\n return val === 'add' || isPlainObject(val);\n};\n\nvar isRemoveVal = exports.isRemoveVal = function isRemoveVal(val) {\n return val === null || val === 'remove';\n};\n\n/*\n * applyContainerArrayChanges: for managing arrays of layout components in relayout\n * handles them all with a consistent interface.\n *\n * Here are the supported actions -> relayout calls -> edits we get here\n * (as prepared in _relayout):\n *\n * add an empty obj -> {'annotations[2]': 'add'} -> {2: {'': 'add'}}\n * add a specific obj -> {'annotations[2]': {attrs}} -> {2: {'': {attrs}}}\n * delete an obj -> {'annotations[2]': 'remove'} -> {2: {'': 'remove'}}\n * -> {'annotations[2]': null} -> {2: {'': null}}\n * delete the whole array -> {'annotations': 'remove'} -> {'': {'': 'remove'}}\n * -> {'annotations': null} -> {'': {'': null}}\n * edit an object -> {'annotations[2].text': 'boo'} -> {2: {'text': 'boo'}}\n *\n * You can combine many edits to different objects. Objects are added and edited\n * in ascending order, then removed in descending order.\n * For example, starting with [a, b, c], if you want to:\n * - replace b with d:\n * {'annotations[1]': d, 'annotations[2]': null} (b is item 2 after adding d)\n * - add a new item d between a and b, and edit b:\n * {'annotations[1]': d, 'annotations[2].x': newX} (b is item 2 after adding d)\n * - delete b and edit c:\n * {'annotations[1]': null, 'annotations[2].x': newX} (c is edited before b is removed)\n *\n * You CANNOT combine adding/deleting an item at index `i` with edits to the same index `i`\n * You CANNOT combine replacing/deleting the whole array with anything else (for the same array).\n *\n * @param {HTMLDivElement} gd\n * the DOM element of the graph container div\n * @param {Lib.nestedProperty} componentType: the array we are editing\n * @param {Object} edits\n * the changes to make; keys are indices to edit, values are themselves objects:\n * {attr: newValue} of changes to make to that index (with add/remove behavior\n * in special values of the empty attr)\n * @param {Object} flags\n * the flags for which actions we're going to perform to display these (and\n * any other) changes. If we're already `recalc`ing, we don't need to redraw\n * individual items\n *\n * @returns {bool} `true` if it managed to complete drawing of the changes\n * `false` would mean the parent should replot.\n */\nexports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, edits, flags) {\n var componentType = np.astr,\n supplyComponentDefaults = Registry.getComponentMethod(componentType, 'supplyLayoutDefaults'),\n draw = Registry.getComponentMethod(componentType, 'draw'),\n drawOne = Registry.getComponentMethod(componentType, 'drawOne'),\n replotLater = flags.replot || flags.recalc || (supplyComponentDefaults === noop) ||\n (draw === noop),\n layout = gd.layout,\n fullLayout = gd._fullLayout;\n\n if(edits['']) {\n if(Object.keys(edits).length > 1) {\n Loggers.warn('Full array edits are incompatible with other edits',\n componentType);\n }\n\n var fullVal = edits[''][''];\n\n if(isRemoveVal(fullVal)) np.set(null);\n else if(Array.isArray(fullVal)) np.set(fullVal);\n else {\n Loggers.warn('Unrecognized full array edit value', componentType, fullVal);\n return true;\n }\n\n if(replotLater) return false;\n\n supplyComponentDefaults(layout, fullLayout);\n draw(gd);\n return true;\n }\n\n var componentNums = Object.keys(edits).map(Number).sort(sorterAsc),\n componentArrayIn = np.get(),\n componentArray = componentArrayIn || [],\n // componentArrayFull is used just to keep splices in line between\n // full and input arrays, so private keys can be copied over after\n // redoing supplyDefaults\n // TODO: this assumes componentArray is in gd.layout - which will not be\n // true after we extend this to restyle\n componentArrayFull = nestedProperty(fullLayout, componentType).get();\n\n var deletes = [],\n firstIndexChange = -1,\n maxIndex = componentArray.length,\n i,\n j,\n componentNum,\n objEdits,\n objKeys,\n objVal,\n adding;\n\n // first make the add and edit changes\n for(i = 0; i < componentNums.length; i++) {\n componentNum = componentNums[i];\n objEdits = edits[componentNum];\n objKeys = Object.keys(objEdits);\n objVal = objEdits[''],\n adding = isAddVal(objVal);\n\n if(componentNum < 0 || componentNum > componentArray.length - (adding ? 0 : 1)) {\n Loggers.warn('index out of range', componentType, componentNum);\n continue;\n }\n\n if(objVal !== undefined) {\n if(objKeys.length > 1) {\n Loggers.warn(\n 'Insertion & removal are incompatible with edits to the same index.',\n componentType, componentNum);\n }\n\n if(isRemoveVal(objVal)) {\n deletes.push(componentNum);\n }\n else if(adding) {\n if(objVal === 'add') objVal = {};\n componentArray.splice(componentNum, 0, objVal);\n if(componentArrayFull) componentArrayFull.splice(componentNum, 0, {});\n }\n else {\n Loggers.warn('Unrecognized full object edit value',\n componentType, componentNum, objVal);\n }\n\n if(firstIndexChange === -1) firstIndexChange = componentNum;\n }\n else {\n for(j = 0; j < objKeys.length; j++) {\n nestedProperty(componentArray[componentNum], objKeys[j]).set(objEdits[objKeys[j]]);\n }\n }\n }\n\n // now do deletes\n for(i = deletes.length - 1; i >= 0; i--) {\n componentArray.splice(deletes[i], 1);\n // TODO: this drops private keys that had been stored in componentArrayFull\n // does this have any ill effects?\n if(componentArrayFull) componentArrayFull.splice(deletes[i], 1);\n }\n\n if(!componentArray.length) np.set(null);\n else if(!componentArrayIn) np.set(componentArray);\n\n if(replotLater) return false;\n\n supplyComponentDefaults(layout, fullLayout);\n\n // finally draw all the components we need to\n // if we added or removed any, redraw all after it\n if(drawOne !== noop) {\n var indicesToDraw;\n if(firstIndexChange === -1) {\n // there's no re-indexing to do, so only redraw components that changed\n indicesToDraw = componentNums;\n }\n else {\n // in case the component array was shortened, we still need do call\n // drawOne on the latter items so they get properly removed\n maxIndex = Math.max(componentArray.length, maxIndex);\n indicesToDraw = [];\n for(i = 0; i < componentNums.length; i++) {\n componentNum = componentNums[i];\n if(componentNum >= firstIndexChange) break;\n indicesToDraw.push(componentNum);\n }\n for(i = firstIndexChange; i < maxIndex; i++) {\n indicesToDraw.push(i);\n }\n }\n for(i = 0; i < indicesToDraw.length; i++) {\n drawOne(gd, indicesToDraw[i]);\n }\n }\n else draw(gd);\n\n return true;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/manage_arrays.js\n// module id = 424\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar m4FromQuat = require('gl-mat4/fromQuat');\n\nvar Registry = require('../registry');\nvar Lib = require('../lib');\nvar Plots = require('../plots/plots');\nvar Axes = require('../plots/cartesian/axes');\nvar Color = require('../components/color');\n\n\n// clear the promise queue if one of them got rejected\nexports.clearPromiseQueue = function(gd) {\n if(Array.isArray(gd._promises) && gd._promises.length > 0) {\n Lib.log('Clearing previous rejected promises from queue.');\n }\n\n gd._promises = [];\n};\n\n// make a few changes to the layout right away\n// before it gets used for anything\n// backward compatibility and cleanup of nonstandard options\nexports.cleanLayout = function(layout) {\n var i, j;\n\n if(!layout) layout = {};\n\n // cannot have (x|y)axis1, numbering goes axis, axis2, axis3...\n if(layout.xaxis1) {\n if(!layout.xaxis) layout.xaxis = layout.xaxis1;\n delete layout.xaxis1;\n }\n if(layout.yaxis1) {\n if(!layout.yaxis) layout.yaxis = layout.yaxis1;\n delete layout.yaxis1;\n }\n\n var axList = Axes.list({_fullLayout: layout});\n for(i = 0; i < axList.length; i++) {\n var ax = axList[i];\n if(ax.anchor && ax.anchor !== 'free') {\n ax.anchor = Axes.cleanId(ax.anchor);\n }\n if(ax.overlaying) ax.overlaying = Axes.cleanId(ax.overlaying);\n\n // old method of axis type - isdate and islog (before category existed)\n if(!ax.type) {\n if(ax.isdate) ax.type = 'date';\n else if(ax.islog) ax.type = 'log';\n else if(ax.isdate === false && ax.islog === false) ax.type = 'linear';\n }\n if(ax.autorange === 'withzero' || ax.autorange === 'tozero') {\n ax.autorange = true;\n ax.rangemode = 'tozero';\n }\n delete ax.islog;\n delete ax.isdate;\n delete ax.categories; // replaced by _categories\n\n // prune empty domain arrays made before the new nestedProperty\n if(emptyContainer(ax, 'domain')) delete ax.domain;\n\n // autotick -> tickmode\n if(ax.autotick !== undefined) {\n if(ax.tickmode === undefined) {\n ax.tickmode = ax.autotick ? 'auto' : 'linear';\n }\n delete ax.autotick;\n }\n }\n\n var annotationsLen = Array.isArray(layout.annotations) ? layout.annotations.length : 0;\n for(i = 0; i < annotationsLen; i++) {\n var ann = layout.annotations[i];\n\n if(!Lib.isPlainObject(ann)) continue;\n\n if(ann.ref) {\n if(ann.ref === 'paper') {\n ann.xref = 'paper';\n ann.yref = 'paper';\n }\n else if(ann.ref === 'data') {\n ann.xref = 'x';\n ann.yref = 'y';\n }\n delete ann.ref;\n }\n\n cleanAxRef(ann, 'xref');\n cleanAxRef(ann, 'yref');\n }\n\n var shapesLen = Array.isArray(layout.shapes) ? layout.shapes.length : 0;\n for(i = 0; i < shapesLen; i++) {\n var shape = layout.shapes[i];\n\n if(!Lib.isPlainObject(shape)) continue;\n\n cleanAxRef(shape, 'xref');\n cleanAxRef(shape, 'yref');\n }\n\n var legend = layout.legend;\n if(legend) {\n // check for old-style legend positioning (x or y is +/- 100)\n if(legend.x > 3) {\n legend.x = 1.02;\n legend.xanchor = 'left';\n }\n else if(legend.x < -2) {\n legend.x = -0.02;\n legend.xanchor = 'right';\n }\n\n if(legend.y > 3) {\n legend.y = 1.02;\n legend.yanchor = 'bottom';\n }\n else if(legend.y < -2) {\n legend.y = -0.02;\n legend.yanchor = 'top';\n }\n }\n\n /*\n * Moved from rotate -> orbit for dragmode\n */\n if(layout.dragmode === 'rotate') layout.dragmode = 'orbit';\n\n // cannot have scene1, numbering goes scene, scene2, scene3...\n if(layout.scene1) {\n if(!layout.scene) layout.scene = layout.scene1;\n delete layout.scene1;\n }\n\n /*\n * Clean up Scene layouts\n */\n var sceneIds = Plots.getSubplotIds(layout, 'gl3d');\n for(i = 0; i < sceneIds.length; i++) {\n var scene = layout[sceneIds[i]];\n\n // clean old Camera coords\n var cameraposition = scene.cameraposition;\n if(Array.isArray(cameraposition) && cameraposition[0].length === 4) {\n var rotation = cameraposition[0],\n center = cameraposition[1],\n radius = cameraposition[2],\n mat = m4FromQuat([], rotation),\n eye = [];\n\n for(j = 0; j < 3; ++j) {\n eye[j] = center[i] + radius * mat[2 + 4 * j];\n }\n\n scene.camera = {\n eye: {x: eye[0], y: eye[1], z: eye[2]},\n center: {x: center[0], y: center[1], z: center[2]},\n up: {x: mat[1], y: mat[5], z: mat[9]}\n };\n\n delete scene.cameraposition;\n }\n }\n\n // sanitize rgb(fractions) and rgba(fractions) that old tinycolor\n // supported, but new tinycolor does not because they're not valid css\n Color.clean(layout);\n\n return layout;\n};\n\nfunction cleanAxRef(container, attr) {\n var valIn = container[attr],\n axLetter = attr.charAt(0);\n if(valIn && valIn !== 'paper') {\n container[attr] = Axes.cleanId(valIn, axLetter);\n }\n}\n\n// Make a few changes to the data right away\n// before it gets used for anything\nexports.cleanData = function(data, existingData) {\n // Enforce unique IDs\n var suids = [], // seen uids --- so we can weed out incoming repeats\n uids = data.concat(Array.isArray(existingData) ? existingData : [])\n .filter(function(trace) { return 'uid' in trace; })\n .map(function(trace) { return trace.uid; });\n\n for(var tracei = 0; tracei < data.length; tracei++) {\n var trace = data[tracei];\n var i;\n\n // assign uids to each trace and detect collisions.\n if(!('uid' in trace) || suids.indexOf(trace.uid) !== -1) {\n var newUid;\n\n for(i = 0; i < 100; i++) {\n newUid = Lib.randstr(uids);\n if(suids.indexOf(newUid) === -1) break;\n }\n trace.uid = Lib.randstr(uids);\n uids.push(trace.uid);\n }\n // keep track of already seen uids, so that if there are\n // doubles we force the trace with a repeat uid to\n // acquire a new one\n suids.push(trace.uid);\n\n // BACKWARD COMPATIBILITY FIXES\n\n // use xbins to bin data in x, and ybins to bin data in y\n if(trace.type === 'histogramy' && 'xbins' in trace && !('ybins' in trace)) {\n trace.ybins = trace.xbins;\n delete trace.xbins;\n }\n\n // error_y.opacity is obsolete - merge into color\n if(trace.error_y && 'opacity' in trace.error_y) {\n var dc = Color.defaults,\n yeColor = trace.error_y.color ||\n (Registry.traceIs(trace, 'bar') ? Color.defaultLine : dc[tracei % dc.length]);\n trace.error_y.color = Color.addOpacity(\n Color.rgb(yeColor),\n Color.opacity(yeColor) * trace.error_y.opacity);\n delete trace.error_y.opacity;\n }\n\n // convert bardir to orientation, and put the data into\n // the axes it's eventually going to be used with\n if('bardir' in trace) {\n if(trace.bardir === 'h' && (Registry.traceIs(trace, 'bar') ||\n trace.type.substr(0, 9) === 'histogram')) {\n trace.orientation = 'h';\n exports.swapXYData(trace);\n }\n delete trace.bardir;\n }\n\n // now we have only one 1D histogram type, and whether\n // it uses x or y data depends on trace.orientation\n if(trace.type === 'histogramy') exports.swapXYData(trace);\n if(trace.type === 'histogramx' || trace.type === 'histogramy') {\n trace.type = 'histogram';\n }\n\n // scl->scale, reversescl->reversescale\n if('scl' in trace) {\n trace.colorscale = trace.scl;\n delete trace.scl;\n }\n if('reversescl' in trace) {\n trace.reversescale = trace.reversescl;\n delete trace.reversescl;\n }\n\n // axis ids x1 -> x, y1-> y\n if(trace.xaxis) trace.xaxis = Axes.cleanId(trace.xaxis, 'x');\n if(trace.yaxis) trace.yaxis = Axes.cleanId(trace.yaxis, 'y');\n\n // scene ids scene1 -> scene\n if(Registry.traceIs(trace, 'gl3d') && trace.scene) {\n trace.scene = Plots.subplotsRegistry.gl3d.cleanId(trace.scene);\n }\n\n if(!Registry.traceIs(trace, 'pie') && !Registry.traceIs(trace, 'bar')) {\n if(Array.isArray(trace.textposition)) {\n trace.textposition = trace.textposition.map(cleanTextPosition);\n }\n else if(trace.textposition) {\n trace.textposition = cleanTextPosition(trace.textposition);\n }\n }\n\n // fix typo in colorscale definition\n if(Registry.traceIs(trace, '2dMap')) {\n if(trace.colorscale === 'YIGnBu') trace.colorscale = 'YlGnBu';\n if(trace.colorscale === 'YIOrRd') trace.colorscale = 'YlOrRd';\n }\n if(Registry.traceIs(trace, 'markerColorscale') && trace.marker) {\n var cont = trace.marker;\n if(cont.colorscale === 'YIGnBu') cont.colorscale = 'YlGnBu';\n if(cont.colorscale === 'YIOrRd') cont.colorscale = 'YlOrRd';\n }\n\n // fix typo in surface 'highlight*' definitions\n if(trace.type === 'surface' && Lib.isPlainObject(trace.contours)) {\n var dims = ['x', 'y', 'z'];\n\n for(i = 0; i < dims.length; i++) {\n var opts = trace.contours[dims[i]];\n\n if(!Lib.isPlainObject(opts)) continue;\n\n if(opts.highlightColor) {\n opts.highlightcolor = opts.highlightColor;\n delete opts.highlightColor;\n }\n\n if(opts.highlightWidth) {\n opts.highlightwidth = opts.highlightWidth;\n delete opts.highlightWidth;\n }\n }\n }\n\n // transforms backward compatibility fixes\n if(Array.isArray(trace.transforms)) {\n var transforms = trace.transforms;\n\n for(i = 0; i < transforms.length; i++) {\n var transform = transforms[i];\n\n if(!Lib.isPlainObject(transform)) continue;\n\n switch(transform.type) {\n case 'filter':\n if(transform.filtersrc) {\n transform.target = transform.filtersrc;\n delete transform.filtersrc;\n }\n\n if(transform.calendar) {\n if(!transform.valuecalendar) {\n transform.valuecalendar = transform.calendar;\n }\n delete transform.calendar;\n }\n break;\n\n case 'groupby':\n // Name has changed from `style` to `styles`, so use `style` but prefer `styles`:\n transform.styles = transform.styles || transform.style;\n\n if(transform.styles && !Array.isArray(transform.styles)) {\n var prevStyles = transform.styles;\n var styleKeys = Object.keys(prevStyles);\n\n transform.styles = [];\n for(var j = 0; j < styleKeys.length; j++) {\n transform.styles.push({\n target: styleKeys[j],\n value: prevStyles[styleKeys[j]]\n });\n }\n }\n break;\n }\n }\n }\n\n // prune empty containers made before the new nestedProperty\n if(emptyContainer(trace, 'line')) delete trace.line;\n if('marker' in trace) {\n if(emptyContainer(trace.marker, 'line')) delete trace.marker.line;\n if(emptyContainer(trace, 'marker')) delete trace.marker;\n }\n\n // sanitize rgb(fractions) and rgba(fractions) that old tinycolor\n // supported, but new tinycolor does not because they're not valid css\n Color.clean(trace);\n }\n};\n\n// textposition - support partial attributes (ie just 'top')\n// and incorrect use of middle / center etc.\nfunction cleanTextPosition(textposition) {\n var posY = 'middle',\n posX = 'center';\n if(textposition.indexOf('top') !== -1) posY = 'top';\n else if(textposition.indexOf('bottom') !== -1) posY = 'bottom';\n\n if(textposition.indexOf('left') !== -1) posX = 'left';\n else if(textposition.indexOf('right') !== -1) posX = 'right';\n\n return posY + ' ' + posX;\n}\n\nfunction emptyContainer(outer, innerStr) {\n return (innerStr in outer) &&\n (typeof outer[innerStr] === 'object') &&\n (Object.keys(outer[innerStr]).length === 0);\n}\n\n\n// swap all the data and data attributes associated with x and y\nexports.swapXYData = function(trace) {\n var i;\n Lib.swapAttrs(trace, ['?', '?0', 'd?', '?bins', 'nbins?', 'autobin?', '?src', 'error_?']);\n if(Array.isArray(trace.z) && Array.isArray(trace.z[0])) {\n if(trace.transpose) delete trace.transpose;\n else trace.transpose = true;\n }\n if(trace.error_x && trace.error_y) {\n var errorY = trace.error_y,\n copyYstyle = ('copy_ystyle' in errorY) ? errorY.copy_ystyle :\n !(errorY.color || errorY.thickness || errorY.width);\n Lib.swapAttrs(trace, ['error_?.copy_ystyle']);\n if(copyYstyle) {\n Lib.swapAttrs(trace, ['error_?.color', 'error_?.thickness', 'error_?.width']);\n }\n }\n if(typeof trace.hoverinfo === 'string') {\n var hoverInfoParts = trace.hoverinfo.split('+');\n for(i = 0; i < hoverInfoParts.length; i++) {\n if(hoverInfoParts[i] === 'x') hoverInfoParts[i] = 'y';\n else if(hoverInfoParts[i] === 'y') hoverInfoParts[i] = 'x';\n }\n trace.hoverinfo = hoverInfoParts.join('+');\n }\n};\n\n// coerce traceIndices input to array of trace indices\nexports.coerceTraceIndices = function(gd, traceIndices) {\n if(isNumeric(traceIndices)) {\n return [traceIndices];\n }\n else if(!Array.isArray(traceIndices) || !traceIndices.length) {\n return gd.data.map(function(_, i) { return i; });\n }\n\n return traceIndices;\n};\n\n/**\n * Manages logic around array container item creation / deletion / update\n * that nested property alone can't handle.\n *\n * @param {Object} np\n * nested property of update attribute string about trace or layout object\n * @param {*} newVal\n * update value passed to restyle / relayout / update\n * @param {Object} undoit\n * undo hash (N.B. undoit may be mutated here).\n *\n */\nexports.manageArrayContainers = function(np, newVal, undoit) {\n var obj = np.obj,\n parts = np.parts,\n pLength = parts.length,\n pLast = parts[pLength - 1];\n\n var pLastIsNumber = isNumeric(pLast);\n\n // delete item\n if(pLastIsNumber && newVal === null) {\n\n // Clear item in array container when new value is null\n var contPath = parts.slice(0, pLength - 1).join('.'),\n cont = Lib.nestedProperty(obj, contPath).get();\n cont.splice(pLast, 1);\n\n // Note that nested property clears null / undefined at end of\n // array container, but not within them.\n }\n // create item\n else if(pLastIsNumber && np.get() === undefined) {\n\n // When adding a new item, make sure undo command will remove it\n if(np.get() === undefined) undoit[np.astr] = null;\n\n np.set(newVal);\n }\n // update item\n else {\n\n // If the last part of attribute string isn't a number,\n // np.set is all we need.\n np.set(newVal);\n }\n};\n\n/*\n * Match the part to strip off to turn an attribute into its parent\n * really it should be either '.some_characters' or '[number]'\n * but we're a little more permissive here and match either\n * '.not_brackets_or_dot' or '[not_brackets_or_dot]'\n */\nvar ATTR_TAIL_RE = /(\\.[^\\[\\]\\.]+|\\[[^\\[\\]\\.]+\\])$/;\n\nfunction getParent(attr) {\n var tail = attr.search(ATTR_TAIL_RE);\n if(tail > 0) return attr.substr(0, tail);\n}\n\n/*\n * hasParent: does an attribute object contain a parent of the given attribute?\n * for example, given 'images[2].x' do we also have 'images' or 'images[2]'?\n *\n * @param {Object} aobj\n * update object, whose keys are attribute strings and values are their new settings\n * @param {string} attr\n * the attribute string to test against\n * @returns {Boolean}\n * is a parent of attr present in aobj?\n */\nexports.hasParent = function(aobj, attr) {\n var attrParent = getParent(attr);\n while(attrParent) {\n if(attrParent in aobj) return true;\n attrParent = getParent(attrParent);\n }\n return false;\n};\n\n/**\n * Empty out types for all axes containing these traces so we auto-set them again\n *\n * @param {object} gd\n * @param {[integer]} traces: trace indices to search for axes to clear the types of\n * @param {object} layoutUpdate: any update being done concurrently to the layout,\n * which may supercede clearing the axis types\n */\nvar axLetters = ['x', 'y', 'z'];\nexports.clearAxisTypes = function(gd, traces, layoutUpdate) {\n for(var i = 0; i < traces.length; i++) {\n var trace = gd._fullData[i];\n for(var j = 0; j < 3; j++) {\n var ax = Axes.getFromTrace(gd, trace, axLetters[j]);\n\n // do not clear log type - that's never an auto result so must have been intentional\n if(ax && ax.type !== 'log') {\n var axAttr = ax._name;\n var sceneName = ax._id.substr(1);\n if(sceneName.substr(0, 5) === 'scene') {\n if(layoutUpdate[sceneName] !== undefined) continue;\n axAttr = sceneName + '.' + axAttr;\n }\n var typeAttr = axAttr + '.type';\n\n if(layoutUpdate[axAttr] === undefined && layoutUpdate[typeAttr] === undefined) {\n Lib.nestedProperty(gd.layout, typeAttr).set(null);\n }\n }\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/helpers.js\n// module id = 425\n// module chunks = 0","module.exports = fromQuat;\n\n/**\n * Creates a matrix from a quaternion rotation.\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @returns {mat4} out\n */\nfunction fromQuat(out, q) {\n var x = q[0], y = q[1], z = q[2], w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n\n xx = x * x2,\n yx = y * x2,\n yy = y * y2,\n zx = z * x2,\n zy = z * y2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/fromQuat.js\n// module id = 426\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar Plotly = require('../plotly');\nvar Registry = require('../registry');\nvar Plots = require('../plots/plots');\nvar Lib = require('../lib');\n\nvar Color = require('../components/color');\nvar Drawing = require('../components/drawing');\nvar Titles = require('../components/titles');\nvar ModeBar = require('../components/modebar');\nvar initInteractions = require('../plots/cartesian/graph_interact');\nvar cartesianConstants = require('../plots/cartesian/constants');\n\nexports.layoutStyles = function(gd) {\n return Lib.syncOrAsync([Plots.doAutoMargin, exports.lsInner], gd);\n};\n\nfunction overlappingDomain(xDomain, yDomain, domains) {\n for(var i = 0; i < domains.length; i++) {\n var existingX = domains[i][0],\n existingY = domains[i][1];\n\n if(existingX[0] >= xDomain[1] || existingX[1] <= xDomain[0]) {\n continue;\n }\n if(existingY[0] < yDomain[1] && existingY[1] > yDomain[0]) {\n return true;\n }\n }\n return false;\n}\n\nexports.lsInner = function(gd) {\n var fullLayout = gd._fullLayout;\n var gs = fullLayout._size;\n var pad = gs.p;\n var axList = Plotly.Axes.list(gd);\n\n // _has('cartesian') means SVG specifically, not GL2D - but GL2D\n // can still get here because it makes some of the SVG structure\n // for shared features like selections.\n var hasSVGCartesian = fullLayout._has('cartesian');\n var i;\n\n // clear axis line positions, to be set in the subplot loop below\n for(i = 0; i < axList.length; i++) axList[i]._linepositions = {};\n\n fullLayout._paperdiv\n .style({\n width: fullLayout.width + 'px',\n height: fullLayout.height + 'px'\n })\n .selectAll('.main-svg')\n .call(Drawing.setSize, fullLayout.width, fullLayout.height);\n\n gd._context.setBackground(gd, fullLayout.paper_bgcolor);\n\n var subplotSelection = fullLayout._paper.selectAll('g.subplot');\n\n // figure out which backgrounds we need to draw, and in which layers\n // to put them\n var lowerBackgroundIDs = [];\n var lowerDomains = [];\n subplotSelection.each(function(subplot) {\n var plotinfo = fullLayout._plots[subplot];\n\n if(plotinfo.mainplot) {\n // mainplot is a reference to the main plot this one is overlaid on\n // so if it exists, this is an overlaid plot and we don't need to\n // give it its own background\n if(plotinfo.bg) {\n plotinfo.bg.remove();\n }\n plotinfo.bg = undefined;\n return;\n }\n\n var xDomain = plotinfo.xaxis.domain;\n var yDomain = plotinfo.yaxis.domain;\n var plotgroupBgData = [];\n\n if(overlappingDomain(xDomain, yDomain, lowerDomains)) {\n plotgroupBgData = [0];\n }\n else {\n lowerBackgroundIDs.push(subplot);\n lowerDomains.push([xDomain, yDomain]);\n }\n\n // create the plot group backgrounds now, since\n // they're all independent selections\n var plotgroupBg = plotinfo.plotgroup.selectAll('.bg')\n .data(plotgroupBgData);\n\n plotgroupBg.enter().append('rect')\n .classed('bg', true);\n\n plotgroupBg.exit().remove();\n\n plotgroupBg.each(function() {\n plotinfo.bg = plotgroupBg;\n var pgNode = plotinfo.plotgroup.node();\n pgNode.insertBefore(this, pgNode.childNodes[0]);\n });\n });\n\n // now create all the lower-layer backgrounds at once now that\n // we have the list of subplots that need them\n var lowerBackgrounds = fullLayout._bgLayer.selectAll('.bg')\n .data(lowerBackgroundIDs);\n\n lowerBackgrounds.enter().append('rect')\n .classed('bg', true);\n\n lowerBackgrounds.exit().remove();\n\n lowerBackgrounds.each(function(subplot) {\n fullLayout._plots[subplot].bg = d3.select(this);\n });\n\n var freeFinished = {};\n subplotSelection.each(function(subplot) {\n var plotinfo = fullLayout._plots[subplot];\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n // reset scale in case the margins have changed\n xa.setScale();\n ya.setScale();\n\n if(plotinfo.bg && hasSVGCartesian) {\n plotinfo.bg\n .call(Drawing.setRect,\n xa._offset - pad, ya._offset - pad,\n xa._length + 2 * pad, ya._length + 2 * pad)\n .call(Color.fill, fullLayout.plot_bgcolor)\n .style('stroke-width', 0);\n }\n\n // Clip so that data only shows up on the plot area.\n plotinfo.clipId = 'clip' + fullLayout._uid + subplot + 'plot';\n\n var plotClip = fullLayout._clips.selectAll('#' + plotinfo.clipId)\n .data([0]);\n\n plotClip.enter().append('clipPath')\n .attr({\n 'class': 'plotclip',\n 'id': plotinfo.clipId\n })\n .append('rect');\n\n plotClip.selectAll('rect')\n .attr({\n 'width': xa._length,\n 'height': ya._length\n });\n\n Drawing.setTranslate(plotinfo.plot, xa._offset, ya._offset);\n\n var plotClipId;\n var layerClipId;\n\n if(plotinfo._hasClipOnAxisFalse) {\n plotClipId = null;\n layerClipId = plotinfo.clipId;\n } else {\n plotClipId = plotinfo.clipId;\n layerClipId = null;\n }\n\n Drawing.setClipUrl(plotinfo.plot, plotClipId);\n\n for(i = 0; i < cartesianConstants.traceLayerClasses.length; i++) {\n var layer = cartesianConstants.traceLayerClasses[i];\n if(layer !== 'scatterlayer') {\n plotinfo.plot.selectAll('g.' + layer).call(Drawing.setClipUrl, layerClipId);\n }\n }\n\n // stash layer clipId value (null or same as clipId)\n // to DRY up Drawing.setClipUrl calls downstream\n plotinfo.layerClipId = layerClipId;\n\n var xIsFree = !xa._anchorAxis;\n var showFreeX = xIsFree && !freeFinished[xa._id];\n var showBottom = shouldShowLine(xa, ya, 'bottom');\n var showTop = shouldShowLine(xa, ya, 'top');\n\n var yIsFree = !ya._anchorAxis;\n var showFreeY = yIsFree && !freeFinished[ya._id];\n var showLeft = shouldShowLine(ya, xa, 'left');\n var showRight = shouldShowLine(ya, xa, 'right');\n\n var xlw = Drawing.crispRound(gd, xa.linewidth, 1);\n var ylw = Drawing.crispRound(gd, ya.linewidth, 1);\n\n /*\n * x lines get longer where they meet y lines, to make a crisp corner.\n * The x lines get the padding (margin.pad) plus the y line width to\n * fill up the corner nicely. Free x lines are excluded - they always\n * span exactly the data area of the plot\n *\n * | XXXXX\n * | XXXXX\n * |\n * +------\n * x1\n * -----\n * x2\n */\n var leftYLineWidth = findCounterAxisLineWidth(gd, xa, ylw, showLeft, 'left', axList);\n var xLinesXLeft = (!xIsFree && leftYLineWidth) ?\n (-pad - leftYLineWidth) : 0;\n var rightYLineWidth = findCounterAxisLineWidth(gd, xa, ylw, showRight, 'right', axList);\n var xLinesXRight = xa._length + ((!xIsFree && rightYLineWidth) ?\n (pad + rightYLineWidth) : 0);\n var xLinesYFree = gs.h * (1 - (xa.position || 0)) + ((xlw / 2) % 1);\n var xLinesYBottom = ya._length + pad + xlw / 2;\n var xLinesYTop = -pad - xlw / 2;\n\n /*\n * y lines that meet x axes get longer only by margin.pad, because\n * the x axes fill in the corner space. Free y axes, like free x axes,\n * always span exactly the data area of the plot\n *\n * | | XXXX\n * y2| y1| XXXX\n * | | XXXX\n * |\n * +-----\n */\n var connectYBottom = !yIsFree && findCounterAxisLineWidth(\n gd, ya, xlw, showBottom, 'bottom', axList);\n var yLinesYBottom = ya._length + (connectYBottom ? pad : 0);\n var connectYTop = !yIsFree && findCounterAxisLineWidth(\n gd, ya, xlw, showTop, 'top', axList);\n var yLinesYTop = connectYTop ? -pad : 0;\n var yLinesXFree = gs.w * (ya.position || 0) + ((ylw / 2) % 1);\n var yLinesXLeft = -pad - ylw / 2;\n var yLinesXRight = xa._length + pad + ylw / 2;\n\n function xLinePath(y, showThis) {\n if(!showThis) return '';\n return 'M' + xLinesXLeft + ',' + y + 'H' + xLinesXRight;\n }\n\n function yLinePath(x, showThis) {\n if(!showThis) return '';\n return 'M' + x + ',' + yLinesYTop + 'V' + yLinesYBottom;\n }\n\n // save axis line positions for ticks, draggers, etc to reference\n // each subplot gets an entry:\n // [left or bottom, right or top, free, main]\n // main is the position at which to draw labels and draggers, if any\n xa._linepositions[subplot] = [\n showBottom ? xLinesYBottom : undefined,\n showTop ? xLinesYTop : undefined,\n showFreeX ? xLinesYFree : undefined\n ];\n if(xa._anchorAxis === ya) {\n xa._linepositions[subplot][3] = xa.side === 'top' ?\n xLinesYTop : xLinesYBottom;\n }\n else if(showFreeX) {\n xa._linepositions[subplot][3] = xLinesYFree;\n }\n\n ya._linepositions[subplot] = [\n showLeft ? yLinesXLeft : undefined,\n showRight ? yLinesXRight : undefined,\n showFreeY ? yLinesXFree : undefined\n ];\n if(ya._anchorAxis === xa) {\n ya._linepositions[subplot][3] = ya.side === 'right' ?\n yLinesXRight : yLinesXLeft;\n }\n else if(showFreeY) {\n ya._linepositions[subplot][3] = yLinesXFree;\n }\n\n // translate all the extra stuff to have the\n // same origin as the plot area or axes\n var origin = 'translate(' + xa._offset + ',' + ya._offset + ')';\n var originX = origin;\n var originY = origin;\n if(showFreeX) {\n originX = 'translate(' + xa._offset + ',' + gs.t + ')';\n xLinesYTop += ya._offset - gs.t;\n xLinesYBottom += ya._offset - gs.t;\n }\n if(showFreeY) {\n originY = 'translate(' + gs.l + ',' + ya._offset + ')';\n yLinesXLeft += xa._offset - gs.l;\n yLinesXRight += xa._offset - gs.l;\n }\n\n if(hasSVGCartesian) {\n plotinfo.xlines\n .attr('transform', originX)\n .attr('d', (\n xLinePath(xLinesYBottom, showBottom) +\n xLinePath(xLinesYTop, showTop) +\n xLinePath(xLinesYFree, showFreeX)) ||\n // so it doesn't barf with no lines shown\n 'M0,0')\n .style('stroke-width', xlw + 'px')\n .call(Color.stroke, xa.showline ?\n xa.linecolor : 'rgba(0,0,0,0)');\n plotinfo.ylines\n .attr('transform', originY)\n .attr('d', (\n yLinePath(yLinesXLeft, showLeft) +\n yLinePath(yLinesXRight, showRight) +\n yLinePath(yLinesXFree, showFreeY)) ||\n 'M0,0')\n .style('stroke-width', ylw + 'px')\n .call(Color.stroke, ya.showline ?\n ya.linecolor : 'rgba(0,0,0,0)');\n }\n\n plotinfo.xaxislayer.attr('transform', originX);\n plotinfo.yaxislayer.attr('transform', originY);\n plotinfo.gridlayer.attr('transform', origin);\n plotinfo.zerolinelayer.attr('transform', origin);\n plotinfo.draglayer.attr('transform', origin);\n\n // mark free axes as displayed, so we don't draw them again\n if(showFreeX) freeFinished[xa._id] = 1;\n if(showFreeY) freeFinished[ya._id] = 1;\n });\n\n Plotly.Axes.makeClipPaths(gd);\n exports.drawMainTitle(gd);\n ModeBar.manage(gd);\n\n return gd._promises.length && Promise.all(gd._promises);\n};\n\nfunction shouldShowLine(ax, counterAx, side) {\n return (ax._anchorAxis === counterAx && (ax.mirror || ax.side === side)) ||\n ax.mirror === 'all' || ax.mirror === 'allticks' ||\n (ax.mirrors && ax.mirrors[counterAx._id + side]);\n}\n\nfunction findCounterAxes(gd, ax, axList) {\n var counterAxes = [];\n var anchorAx = ax._anchorAxis;\n if(anchorAx) {\n var counterMain = anchorAx._mainAxis;\n if(counterAxes.indexOf(counterMain) === -1) {\n counterAxes.push(counterMain);\n for(var i = 0; i < axList.length; i++) {\n if(axList[i].overlaying === counterMain._id &&\n counterAxes.indexOf(axList[i]) === -1\n ) {\n counterAxes.push(axList[i]);\n }\n }\n }\n }\n return counterAxes;\n}\n\nfunction findLineWidth(gd, axes, side) {\n for(var i = 0; i < axes.length; i++) {\n var ax = axes[i];\n var anchorAx = ax._anchorAxis;\n if(anchorAx && shouldShowLine(ax, anchorAx, side)) {\n return Drawing.crispRound(gd, ax.linewidth);\n }\n }\n}\n\nfunction findCounterAxisLineWidth(gd, ax, subplotCounterLineWidth,\n subplotCounterIsShown, side, axList) {\n if(subplotCounterIsShown) return subplotCounterLineWidth;\n\n var i;\n\n // find all counteraxes for this one, then of these, find the\n // first one that has a visible line on this side\n var mainAxis = ax._mainAxis;\n var counterAxes = findCounterAxes(gd, mainAxis, axList);\n\n var lineWidth = findLineWidth(gd, counterAxes, side);\n if(lineWidth) return lineWidth;\n\n for(i = 0; i < axList.length; i++) {\n if(axList[i].overlaying === mainAxis._id) {\n counterAxes = findCounterAxes(gd, axList[i], axList);\n lineWidth = findLineWidth(gd, counterAxes, side);\n if(lineWidth) return lineWidth;\n }\n }\n return 0;\n}\n\nexports.drawMainTitle = function(gd) {\n var fullLayout = gd._fullLayout;\n\n Titles.draw(gd, 'gtitle', {\n propContainer: fullLayout,\n propName: 'title',\n dfltName: 'Plot',\n attributes: {\n x: fullLayout.width / 2,\n y: fullLayout._size.t / 2,\n 'text-anchor': 'middle'\n }\n });\n};\n\n// First, see if we need to do arraysToCalcdata\n// call it regardless of what change we made, in case\n// supplyDefaults brought in an array that was already\n// in gd.data but not in gd._fullData previously\nexports.doTraceStyle = function(gd) {\n for(var i = 0; i < gd.calcdata.length; i++) {\n var cdi = gd.calcdata[i],\n _module = ((cdi[0] || {}).trace || {})._module || {},\n arraysToCalcdata = _module.arraysToCalcdata;\n\n if(arraysToCalcdata) arraysToCalcdata(cdi, cdi[0].trace);\n }\n\n Plots.style(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n\n return Plots.previousPromises(gd);\n};\n\nexports.doColorBars = function(gd) {\n for(var i = 0; i < gd.calcdata.length; i++) {\n var cdi0 = gd.calcdata[i][0];\n\n if((cdi0.t || {}).cb) {\n var trace = cdi0.trace,\n cb = cdi0.t.cb;\n\n if(Registry.traceIs(trace, 'contour')) {\n cb.line({\n width: trace.contours.showlines !== false ?\n trace.line.width : 0,\n dash: trace.line.dash,\n color: trace.contours.coloring === 'line' ?\n cb._opts.line.color : trace.line.color\n });\n }\n if(Registry.traceIs(trace, 'markerColorscale')) {\n cb.options(trace.marker.colorbar)();\n }\n else cb.options(trace.colorbar)();\n }\n }\n\n return Plots.previousPromises(gd);\n};\n\n// force plot() to redo the layout and replot with the modified layout\nexports.layoutReplot = function(gd) {\n var layout = gd.layout;\n gd.layout = undefined;\n return Plotly.plot(gd, '', layout);\n};\n\nexports.doLegend = function(gd) {\n Registry.getComponentMethod('legend', 'draw')(gd);\n return Plots.previousPromises(gd);\n};\n\nexports.doTicksRelayout = function(gd) {\n Plotly.Axes.doTicks(gd, 'redraw');\n exports.drawMainTitle(gd);\n return Plots.previousPromises(gd);\n};\n\nexports.doModeBar = function(gd) {\n var fullLayout = gd._fullLayout;\n\n ModeBar.manage(gd);\n initInteractions(gd);\n\n for(var i = 0; i < fullLayout._basePlotModules.length; i++) {\n var updateFx = fullLayout._basePlotModules[i].updateFx;\n if(updateFx) updateFx(fullLayout);\n }\n\n\n return Plots.previousPromises(gd);\n};\n\nexports.doCamera = function(gd) {\n var fullLayout = gd._fullLayout,\n sceneIds = Plots.getSubplotIds(fullLayout, 'gl3d');\n\n for(var i = 0; i < sceneIds.length; i++) {\n var sceneLayout = fullLayout[sceneIds[i]],\n scene = sceneLayout._scene;\n\n scene.setCamera(sceneLayout.camera);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/subroutines.js\n// module id = 427\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar id2name = require('./axis_ids').id2name;\nvar scaleZoom = require('./scale_zoom');\n\nvar ALMOST_EQUAL = require('../../constants/numerical').ALMOST_EQUAL;\n\nvar FROM_BL = require('../../constants/alignment').FROM_BL;\n\n\nexports.enforce = function enforceAxisConstraints(gd) {\n var fullLayout = gd._fullLayout;\n var constraintGroups = fullLayout._axisConstraintGroups;\n\n var i, j, axisID, ax, normScale, mode, factor;\n\n for(i = 0; i < constraintGroups.length; i++) {\n var group = constraintGroups[i];\n var axisIDs = Object.keys(group);\n\n var minScale = Infinity;\n var maxScale = 0;\n // mostly matchScale will be the same as minScale\n // ie we expand axis ranges to encompass *everything*\n // that's currently in any of their ranges, but during\n // autorange of a subset of axes we will ignore other\n // axes for this purpose.\n var matchScale = Infinity;\n var normScales = {};\n var axes = {};\n var hasAnyDomainConstraint = false;\n\n // find the (normalized) scale of each axis in the group\n for(j = 0; j < axisIDs.length; j++) {\n axisID = axisIDs[j];\n axes[axisID] = ax = fullLayout[id2name(axisID)];\n\n if(ax._inputDomain) ax.domain = ax._inputDomain.slice();\n else ax._inputDomain = ax.domain.slice();\n\n if(!ax._inputRange) ax._inputRange = ax.range.slice();\n\n // set axis scale here so we can use _m rather than\n // having to calculate it from length and range\n ax.setScale();\n\n // abs: inverted scales still satisfy the constraint\n normScales[axisID] = normScale = Math.abs(ax._m) / group[axisID];\n minScale = Math.min(minScale, normScale);\n if(ax.constrain === 'domain' || !ax._constraintShrinkable) {\n matchScale = Math.min(matchScale, normScale);\n }\n\n // this has served its purpose, so remove it\n delete ax._constraintShrinkable;\n maxScale = Math.max(maxScale, normScale);\n\n if(ax.constrain === 'domain') hasAnyDomainConstraint = true;\n }\n\n // Do we have a constraint mismatch? Give a small buffer for rounding errors\n if(minScale > ALMOST_EQUAL * maxScale && !hasAnyDomainConstraint) continue;\n\n // now increase any ranges we need to until all normalized scales are equal\n for(j = 0; j < axisIDs.length; j++) {\n axisID = axisIDs[j];\n normScale = normScales[axisID];\n ax = axes[axisID];\n mode = ax.constrain;\n\n // even if the scale didn't change, if we're shrinking domain\n // we need to recalculate in case `constraintoward` changed\n if(normScale !== matchScale || mode === 'domain') {\n factor = normScale / matchScale;\n\n if(mode === 'range') {\n scaleZoom(ax, factor);\n }\n else {\n // mode === 'domain'\n\n var inputDomain = ax._inputDomain;\n var domainShrunk = (ax.domain[1] - ax.domain[0]) /\n (inputDomain[1] - inputDomain[0]);\n var rangeShrunk = (ax.r2l(ax.range[1]) - ax.r2l(ax.range[0])) /\n (ax.r2l(ax._inputRange[1]) - ax.r2l(ax._inputRange[0]));\n\n factor /= domainShrunk;\n\n if(factor * rangeShrunk < 1) {\n // we've asked to magnify the axis more than we can just by\n // enlarging the domain - so we need to constrict range\n ax.domain = ax._input.domain = inputDomain.slice();\n scaleZoom(ax, factor);\n continue;\n }\n\n if(rangeShrunk < 1) {\n // the range has previously been constricted by ^^, but we've\n // switched to the domain-constricted regime, so reset range\n ax.range = ax._input.range = ax._inputRange.slice();\n factor *= rangeShrunk;\n }\n\n if(ax.autorange && ax._min.length && ax._max.length) {\n /*\n * range & factor may need to change because range was\n * calculated for the larger scaling, so some pixel\n * paddings may get cut off when we reduce the domain.\n *\n * This is easier than the regular autorange calculation\n * because we already know the scaling `m`, but we still\n * need to cut out impossible constraints (like\n * annotations with super-long arrows). That's what\n * outerMin/Max are for - if the expansion was going to\n * go beyond the original domain, it must be impossible\n */\n var rl0 = ax.r2l(ax.range[0]);\n var rl1 = ax.r2l(ax.range[1]);\n var rangeCenter = (rl0 + rl1) / 2;\n var rangeMin = rangeCenter;\n var rangeMax = rangeCenter;\n var halfRange = Math.abs(rl1 - rangeCenter);\n // extra tiny bit for rounding errors, in case we actually\n // *are* expanding to the full domain\n var outerMin = rangeCenter - halfRange * factor * 1.0001;\n var outerMax = rangeCenter + halfRange * factor * 1.0001;\n\n updateDomain(ax, factor);\n ax.setScale();\n var m = Math.abs(ax._m);\n var newVal;\n var k;\n\n for(k = 0; k < ax._min.length; k++) {\n newVal = ax._min[k].val - ax._min[k].pad / m;\n if(newVal > outerMin && newVal < rangeMin) {\n rangeMin = newVal;\n }\n }\n\n for(k = 0; k < ax._max.length; k++) {\n newVal = ax._max[k].val + ax._max[k].pad / m;\n if(newVal < outerMax && newVal > rangeMax) {\n rangeMax = newVal;\n }\n }\n\n var domainExpand = (rangeMax - rangeMin) / (2 * halfRange);\n factor /= domainExpand;\n\n rangeMin = ax.l2r(rangeMin);\n rangeMax = ax.l2r(rangeMax);\n ax.range = ax._input.range = (rl0 < rl1) ?\n [rangeMin, rangeMax] : [rangeMax, rangeMin];\n }\n\n updateDomain(ax, factor);\n }\n }\n }\n }\n};\n\n// For use before autoranging, check if this axis was previously constrained\n// by domain but no longer is\nexports.clean = function cleanConstraints(gd, ax) {\n if(ax._inputDomain) {\n var isConstrained = false;\n var axId = ax._id;\n var constraintGroups = gd._fullLayout._axisConstraintGroups;\n for(var j = 0; j < constraintGroups.length; j++) {\n if(constraintGroups[j][axId]) {\n isConstrained = true;\n break;\n }\n }\n if(!isConstrained || ax.constrain !== 'domain') {\n ax._input.domain = ax.domain = ax._inputDomain;\n delete ax._inputDomain;\n }\n }\n};\n\nfunction updateDomain(ax, factor) {\n var inputDomain = ax._inputDomain;\n var centerFraction = FROM_BL[ax.constraintoward];\n var center = inputDomain[0] + (inputDomain[1] - inputDomain[0]) * centerFraction;\n\n ax.domain = ax._input.domain = [\n center + (inputDomain[0] - center) / factor,\n center + (inputDomain[1] - center) / factor\n ];\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/constraints.js\n// module id = 428\n// module chunks = 0","/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version 3.3.1\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n return typeof x === 'function' || typeof x === 'object' && x !== null;\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\nvar _isArray = undefined;\nif (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n} else {\n _isArray = Array.isArray;\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = undefined;\nvar customSchedulerFn = undefined;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n return function () {\n vertxNext(flush);\n };\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var r = require;\n var vertx = r('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = undefined;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var _arguments = arguments;\n\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n if (_state) {\n (function () {\n var callback = _arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n })();\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(16);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar GET_THEN_ERROR = new ErrorObject();\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n GET_THEN_ERROR.error = error;\n return GET_THEN_ERROR;\n }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n _resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n _reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n _reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n _reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return _resolve(promise, value);\n }, function (reason) {\n return _reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$) {\n if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$ === GET_THEN_ERROR) {\n _reject(promise, GET_THEN_ERROR.error);\n } else if (then$$ === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$)) {\n handleForeignThenable(promise, maybeThenable, then$$);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction _resolve(promise, value) {\n if (promise === value) {\n _reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n handleMaybeThenable(promise, value, getThen(value));\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction _reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = undefined,\n callback = undefined,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction ErrorObject() {\n this.error = null;\n}\n\nvar TRY_CATCH_ERROR = new ErrorObject();\n\nfunction tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = undefined,\n error = undefined,\n succeeded = undefined,\n failed = undefined;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n _reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n _resolve(promise, value);\n } else if (failed) {\n _reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n _reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n _resolve(promise, value);\n }, function rejectPromise(reason) {\n _reject(promise, reason);\n });\n } catch (e) {\n _reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this._input = input;\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate();\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n _reject(this.promise, validationError());\n }\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nEnumerator.prototype._enumerate = function () {\n var length = this.length;\n var _input = this._input;\n\n for (var i = 0; this._state === PENDING && i < length; i++) {\n this._eachEntry(_input[i], i);\n }\n};\n\nEnumerator.prototype._eachEntry = function (entry, i) {\n var c = this._instanceConstructor;\n var resolve$$ = c.resolve;\n\n if (resolve$$ === resolve) {\n var _then = getThen(entry);\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n handleMaybeThenable(promise, entry, _then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$) {\n return resolve$$(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$(entry), i);\n }\n};\n\nEnumerator.prototype._settledAt = function (state, i, value) {\n var promise = this.promise;\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n _reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n};\n\nEnumerator.prototype._willSettleAt = function (promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n};\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n*/\nfunction Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n}\n\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = resolve;\nPromise.reject = reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;\n\nPromise.prototype = {\n constructor: Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n \n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n \n Chaining\n --------\n \n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n \n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n \n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n \n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n \n Assimilation\n ------------\n \n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n \n If the assimliated promise rejects, then the downstream promise will also reject.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n \n Simple Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let result;\n \n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n \n Advanced Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let author, books;\n \n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n \n function foundBooks(books) {\n \n }\n \n function failure(reason) {\n \n }\n \n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n \n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: then,\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n \n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n \n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n \n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n \n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nfunction polyfill() {\n var local = undefined;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}\n\npolyfill();\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\n\nreturn Promise;\n\n})));\n//# sourceMappingURL=es6-promise.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/es6-promise/dist/es6-promise.js\n// module id = 429\n// module chunks = 0","/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// vertx (ignored)\n// module id = 430\n// module chunks = 0","'use strict';\n\nvar Lib = require('../src/lib');\nvar rules = {\n \"X,X div\": \"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;\",\n \"X input,X button\": \"font-family:'Open Sans', verdana, arial, sans-serif;\",\n \"X input:focus,X button:focus\": \"outline:none;\",\n \"X a\": \"text-decoration:none;\",\n \"X a:hover\": \"text-decoration:none;\",\n \"X .crisp\": \"shape-rendering:crispEdges;\",\n \"X .user-select-none\": \"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\n \"X svg\": \"overflow:hidden;\",\n \"X svg a\": \"fill:#447adb;\",\n \"X svg a:hover\": \"fill:#3c6dc5;\",\n \"X .main-svg\": \"position:absolute;top:0;left:0;pointer-events:none;\",\n \"X .main-svg .draglayer\": \"pointer-events:all;\",\n \"X .cursor-default\": \"cursor:default;\",\n \"X .cursor-pointer\": \"cursor:pointer;\",\n \"X .cursor-crosshair\": \"cursor:crosshair;\",\n \"X .cursor-move\": \"cursor:move;\",\n \"X .cursor-col-resize\": \"cursor:col-resize;\",\n \"X .cursor-row-resize\": \"cursor:row-resize;\",\n \"X .cursor-ns-resize\": \"cursor:ns-resize;\",\n \"X .cursor-ew-resize\": \"cursor:ew-resize;\",\n \"X .cursor-sw-resize\": \"cursor:sw-resize;\",\n \"X .cursor-s-resize\": \"cursor:s-resize;\",\n \"X .cursor-se-resize\": \"cursor:se-resize;\",\n \"X .cursor-w-resize\": \"cursor:w-resize;\",\n \"X .cursor-e-resize\": \"cursor:e-resize;\",\n \"X .cursor-nw-resize\": \"cursor:nw-resize;\",\n \"X .cursor-n-resize\": \"cursor:n-resize;\",\n \"X .cursor-ne-resize\": \"cursor:ne-resize;\",\n \"X .modebar\": \"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);\",\n \"X .modebar--hover\": \"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;\",\n \"X:hover .modebar--hover\": \"opacity:1;\",\n \"X .modebar-group\": \"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\n \"X .modebar-group:first-child\": \"margin-left:0px;\",\n \"X .modebar-btn\": \"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\n \"X .modebar-btn svg\": \"position:relative;top:2px;\",\n \"X .modebar-btn path\": \"fill:rgba(0,31,95,0.3);\",\n \"X .modebar-btn.active path,X .modebar-btn:hover path\": \"fill:rgba(0,22,72,0.5);\",\n \"X .modebar-btn.modebar-btn--logo\": \"padding:3px 1px;\",\n \"X .modebar-btn.modebar-btn--logo path\": \"fill:#447adb !important;\",\n \"X [data-title]:before,X [data-title]:after\": \"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\n \"X [data-title]:hover:before,X [data-title]:hover:after\": \"display:block;opacity:1;\",\n \"X [data-title]:before\": \"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;\",\n \"X [data-title]:after\": \"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;\",\n \"X .select-outline\": \"fill:none;stroke-width:1;shape-rendering:crispEdges;\",\n \"X .select-outline-1\": \"stroke:white;\",\n \"X .select-outline-2\": \"stroke:black;stroke-dasharray:2px 2px;\",\n Y: \"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;\",\n \"Y p\": \"margin:0;\",\n \"Y .notifier-note\": \"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;\",\n \"Y .notifier-close\": \"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;\",\n \"Y .notifier-close:hover\": \"color:#444;text-decoration:none;cursor:pointer;\"\n};\n\nfor(var selector in rules) {\n var fullSelector = selector.replace(/^,/,' ,')\n .replace(/X/g, '.js-plotly-plot .plotly')\n .replace(/Y/g, '.plotly-notifier');\n Lib.addStyleRule(fullSelector, rules[selector]);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/build/plotcss.js\n// module id = 431\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/* global MathJax:false */\n\n/**\n * Check and configure MathJax\n */\nif(typeof MathJax !== 'undefined') {\n exports.MathJax = true;\n\n MathJax.Hub.Config({\n messageStyle: 'none',\n skipStartupTypeset: true,\n displayAlign: 'left',\n tex2jax: {\n inlineMath: [['$', '$'], ['\\\\(', '\\\\)']]\n }\n });\n\n MathJax.Hub.Configured();\n} else {\n exports.MathJax = false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/fonts/mathjax_config.js\n// module id = 432\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Plotly = require('../plotly');\nvar Lib = require('../lib');\n\n/**\n * Extends the plot config\n *\n * @param {object} configObj partial plot configuration object\n * to extend the current plot configuration.\n *\n */\nmodule.exports = function setPlotConfig(configObj) {\n return Lib.extendFlat(Plotly.defaultConfig, configObj);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/set_plot_config.js\n// module id = 433\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = require('../registry');\nvar Lib = require('../lib');\n\n\nmodule.exports = function register(_modules) {\n if(!_modules) {\n throw new Error('No argument passed to Plotly.register.');\n }\n else if(_modules && !Array.isArray(_modules)) {\n _modules = [_modules];\n }\n\n for(var i = 0; i < _modules.length; i++) {\n var newModule = _modules[i];\n\n if(!newModule) {\n throw new Error('Invalid module was attempted to be registered!');\n }\n\n switch(newModule.moduleType) {\n case 'trace':\n registerTraceModule(newModule);\n break;\n\n case 'transform':\n registerTransformModule(newModule);\n break;\n\n case 'component':\n registerComponentModule(newModule);\n break;\n\n default:\n throw new Error('Invalid module was attempted to be registered!');\n }\n }\n};\n\nfunction registerTraceModule(newModule) {\n Registry.register(newModule, newModule.name, newModule.categories, newModule.meta);\n\n if(!Registry.subplotsRegistry[newModule.basePlotModule.name]) {\n Registry.registerSubplot(newModule.basePlotModule);\n }\n}\n\nfunction registerTransformModule(newModule) {\n if(typeof newModule.name !== 'string') {\n throw new Error('Transform module *name* must be a string.');\n }\n\n var prefix = 'Transform module ' + newModule.name;\n\n var hasTransform = typeof newModule.transform === 'function',\n hasCalcTransform = typeof newModule.calcTransform === 'function';\n\n\n if(!hasTransform && !hasCalcTransform) {\n throw new Error(prefix + ' is missing a *transform* or *calcTransform* method.');\n }\n\n if(hasTransform && hasCalcTransform) {\n Lib.log([\n prefix + ' has both a *transform* and *calcTransform* methods.',\n 'Please note that all *transform* methods are executed',\n 'before all *calcTransform* methods.'\n ].join(' '));\n }\n\n if(!Lib.isPlainObject(newModule.attributes)) {\n Lib.log(prefix + ' registered without an *attributes* object.');\n }\n\n if(typeof newModule.supplyDefaults !== 'function') {\n Lib.log(prefix + ' registered without a *supplyDefaults* method.');\n }\n\n Registry.registerTransform(newModule);\n}\n\nfunction registerComponentModule(newModule) {\n if(typeof newModule.name !== 'string') {\n throw new Error('Component module *name* must be a string.');\n }\n\n Registry.registerComponent(newModule);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/register.js\n// module id = 434\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nvar Lib = require('../lib');\nvar Plots = require('../plots/plots');\nvar PlotSchema = require('./plot_schema');\n\nvar isPlainObject = Lib.isPlainObject;\nvar isArray = Array.isArray;\n\n\n/**\n * Validate a data array and layout object.\n *\n * @param {array} data\n * @param {object} layout\n *\n * @return {array} array of error objects each containing:\n * - {string} code\n * error code ('object', 'array', 'schema', 'unused', 'invisible' or 'value')\n * - {string} container\n * container where the error occurs ('data' or 'layout')\n * - {number} trace\n * trace index of the 'data' container where the error occurs\n * - {array} path\n * nested path to the key that causes the error\n * - {string} astr\n * attribute string variant of 'path' compatible with Plotly.restyle and\n * Plotly.relayout.\n * - {string} msg\n * error message (shown in console in logger config argument is enable)\n */\nmodule.exports = function valiate(data, layout) {\n var schema = PlotSchema.get(),\n errorList = [],\n gd = {};\n\n var dataIn, layoutIn;\n\n if(isArray(data)) {\n gd.data = Lib.extendDeep([], data);\n dataIn = data;\n }\n else {\n gd.data = [];\n dataIn = [];\n errorList.push(format('array', 'data'));\n }\n\n if(isPlainObject(layout)) {\n gd.layout = Lib.extendDeep({}, layout);\n layoutIn = layout;\n }\n else {\n gd.layout = {};\n layoutIn = {};\n if(arguments.length > 1) {\n errorList.push(format('object', 'layout'));\n }\n }\n\n // N.B. dataIn and layoutIn are in general not the same as\n // gd.data and gd.layout after supplyDefaults as some attributes\n // in gd.data and gd.layout (still) get mutated during this step.\n\n Plots.supplyDefaults(gd);\n\n var dataOut = gd._fullData,\n len = dataIn.length;\n\n for(var i = 0; i < len; i++) {\n var traceIn = dataIn[i],\n base = ['data', i];\n\n if(!isPlainObject(traceIn)) {\n errorList.push(format('object', base));\n continue;\n }\n\n var traceOut = dataOut[i],\n traceType = traceOut.type,\n traceSchema = schema.traces[traceType].attributes;\n\n // PlotSchema does something fancy with trace 'type', reset it here\n // to make the trace schema compatible with Lib.validate.\n traceSchema.type = {\n valType: 'enumerated',\n values: [traceType]\n };\n\n if(traceOut.visible === false && traceIn.visible !== false) {\n errorList.push(format('invisible', base));\n }\n\n crawl(traceIn, traceOut, traceSchema, errorList, base);\n\n var transformsIn = traceIn.transforms,\n transformsOut = traceOut.transforms;\n\n if(transformsIn) {\n if(!isArray(transformsIn)) {\n errorList.push(format('array', base, ['transforms']));\n }\n\n base.push('transforms');\n\n for(var j = 0; j < transformsIn.length; j++) {\n var path = ['transforms', j],\n transformType = transformsIn[j].type;\n\n if(!isPlainObject(transformsIn[j])) {\n errorList.push(format('object', base, path));\n continue;\n }\n\n var transformSchema = schema.transforms[transformType] ?\n schema.transforms[transformType].attributes :\n {};\n\n // add 'type' to transform schema to validate the transform type\n transformSchema.type = {\n valType: 'enumerated',\n values: Object.keys(schema.transforms)\n };\n\n crawl(transformsIn[j], transformsOut[j], transformSchema, errorList, base, path);\n }\n }\n }\n\n var layoutOut = gd._fullLayout,\n layoutSchema = fillLayoutSchema(schema, dataOut);\n\n crawl(layoutIn, layoutOut, layoutSchema, errorList, 'layout');\n\n // return undefined if no validation errors were found\n return (errorList.length === 0) ? void(0) : errorList;\n};\n\nfunction crawl(objIn, objOut, schema, list, base, path) {\n path = path || [];\n\n var keys = Object.keys(objIn);\n\n for(var i = 0; i < keys.length; i++) {\n var k = keys[i];\n\n // transforms are handled separately\n if(k === 'transforms') continue;\n\n var p = path.slice();\n p.push(k);\n\n var valIn = objIn[k],\n valOut = objOut[k];\n\n var nestedSchema = getNestedSchema(schema, k),\n isInfoArray = (nestedSchema || {}).valType === 'info_array',\n isColorscale = (nestedSchema || {}).valType === 'colorscale';\n\n if(!isInSchema(schema, k)) {\n list.push(format('schema', base, p));\n }\n else if(isPlainObject(valIn) && isPlainObject(valOut)) {\n crawl(valIn, valOut, nestedSchema, list, base, p);\n }\n else if(nestedSchema.items && !isInfoArray && isArray(valIn)) {\n var items = nestedSchema.items,\n _nestedSchema = items[Object.keys(items)[0]],\n indexList = [];\n\n var j, _p;\n\n // loop over valOut items while keeping track of their\n // corresponding input container index (given by _index)\n for(j = 0; j < valOut.length; j++) {\n var _index = valOut[j]._index || j;\n\n _p = p.slice();\n _p.push(_index);\n\n if(isPlainObject(valIn[_index]) && isPlainObject(valOut[j])) {\n indexList.push(_index);\n crawl(valIn[_index], valOut[j], _nestedSchema, list, base, _p);\n }\n }\n\n // loop over valIn to determine where it went wrong for some items\n for(j = 0; j < valIn.length; j++) {\n _p = p.slice();\n _p.push(j);\n\n if(!isPlainObject(valIn[j])) {\n list.push(format('object', base, _p, valIn[j]));\n }\n else if(indexList.indexOf(j) === -1) {\n list.push(format('unused', base, _p));\n }\n }\n }\n else if(!isPlainObject(valIn) && isPlainObject(valOut)) {\n list.push(format('object', base, p, valIn));\n }\n else if(!isArray(valIn) && isArray(valOut) && !isInfoArray && !isColorscale) {\n list.push(format('array', base, p, valIn));\n }\n else if(!(k in objOut)) {\n list.push(format('unused', base, p, valIn));\n }\n else if(!Lib.validate(valIn, nestedSchema)) {\n list.push(format('value', base, p, valIn));\n }\n else if(nestedSchema.valType === 'enumerated' &&\n ((nestedSchema.coerceNumber && valIn !== +valOut) || valIn !== valOut)\n ) {\n list.push(format('dynamic', base, p, valIn, valOut));\n }\n }\n\n return list;\n}\n\n// the 'full' layout schema depends on the traces types presents\nfunction fillLayoutSchema(schema, dataOut) {\n for(var i = 0; i < dataOut.length; i++) {\n var traceType = dataOut[i].type,\n traceLayoutAttr = schema.traces[traceType].layoutAttributes;\n\n if(traceLayoutAttr) {\n Lib.extendFlat(schema.layout.layoutAttributes, traceLayoutAttr);\n }\n }\n\n return schema.layout.layoutAttributes;\n}\n\n// validation error codes\nvar code2msgFunc = {\n object: function(base, astr) {\n var prefix;\n\n if(base === 'layout' && astr === '') prefix = 'The layout argument';\n else if(base[0] === 'data' && astr === '') {\n prefix = 'Trace ' + base[1] + ' in the data argument';\n }\n else prefix = inBase(base) + 'key ' + astr;\n\n return prefix + ' must be linked to an object container';\n },\n array: function(base, astr) {\n var prefix;\n\n if(base === 'data') prefix = 'The data argument';\n else prefix = inBase(base) + 'key ' + astr;\n\n return prefix + ' must be linked to an array container';\n },\n schema: function(base, astr) {\n return inBase(base) + 'key ' + astr + ' is not part of the schema';\n },\n unused: function(base, astr, valIn) {\n var target = isPlainObject(valIn) ? 'container' : 'key';\n\n return inBase(base) + target + ' ' + astr + ' did not get coerced';\n },\n dynamic: function(base, astr, valIn, valOut) {\n return [\n inBase(base) + 'key',\n astr,\n '(set to \\'' + valIn + '\\')',\n 'got reset to',\n '\\'' + valOut + '\\'',\n 'during defaults.'\n ].join(' ');\n },\n invisible: function(base) {\n return 'Trace ' + base[1] + ' got defaulted to be not visible';\n },\n value: function(base, astr, valIn) {\n return [\n inBase(base) + 'key ' + astr,\n 'is set to an invalid value (' + valIn + ')'\n ].join(' ');\n }\n};\n\nfunction inBase(base) {\n if(isArray(base)) return 'In data trace ' + base[1] + ', ';\n\n return 'In ' + base + ', ';\n}\n\nfunction format(code, base, path, valIn, valOut) {\n path = path || '';\n\n var container, trace;\n\n // container is either 'data' or 'layout\n // trace is the trace index if 'data', null otherwise\n\n if(isArray(base)) {\n container = base[0];\n trace = base[1];\n }\n else {\n container = base;\n trace = null;\n }\n\n var astr = convertPathToAttributeString(path);\n var msg = code2msgFunc[code](base, astr, valIn, valOut);\n\n // log to console if logger config option is enabled\n Lib.log(msg);\n\n return {\n code: code,\n container: container,\n trace: trace,\n path: path,\n astr: astr,\n msg: msg\n };\n}\n\nfunction isInSchema(schema, key) {\n var parts = splitKey(key),\n keyMinusId = parts.keyMinusId,\n id = parts.id;\n\n if((keyMinusId in schema) && schema[keyMinusId]._isSubplotObj && id) {\n return true;\n }\n\n return (key in schema);\n}\n\nfunction getNestedSchema(schema, key) {\n var parts = splitKey(key);\n\n return schema[parts.keyMinusId];\n}\n\nvar idRegex = Lib.counterRegex('([a-z]+)');\n\nfunction splitKey(key) {\n var idMatch = key.match(idRegex);\n\n return {\n keyMinusId: idMatch && idMatch[1],\n id: idMatch && idMatch[2]\n };\n}\n\nfunction convertPathToAttributeString(path) {\n if(!isArray(path)) return String(path);\n\n var astr = '';\n\n for(var i = 0; i < path.length; i++) {\n var p = path[i];\n\n if(typeof p === 'number') {\n astr = astr.substr(0, astr.length - 1) + '[' + p + ']';\n }\n else {\n astr += p;\n }\n\n if(i < path.length - 1) astr += '.';\n }\n\n return astr;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plot_api/validate.js\n// module id = 435\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Scatter = {};\n\nvar subtypes = require('./subtypes');\nScatter.hasLines = subtypes.hasLines;\nScatter.hasMarkers = subtypes.hasMarkers;\nScatter.hasText = subtypes.hasText;\nScatter.isBubble = subtypes.isBubble;\n\n// traces with < this many points are by default shown\n// with points and lines, > just get lines\nScatter.attributes = require('./attributes');\nScatter.supplyDefaults = require('./defaults');\nScatter.cleanData = require('./clean_data');\nScatter.calc = require('./calc');\nScatter.arraysToCalcdata = require('./arrays_to_calcdata');\nScatter.plot = require('./plot');\nScatter.colorbar = require('./colorbar');\nScatter.style = require('./style');\nScatter.hoverPoints = require('./hover');\nScatter.selectPoints = require('./select');\nScatter.animatable = true;\n\nScatter.moduleType = 'trace';\nScatter.name = 'scatter';\nScatter.basePlotModule = require('../../plots/cartesian');\nScatter.categories = ['cartesian', 'symbols', 'markerColorscale', 'errorBarsOK', 'showLegend', 'scatter-like'];\nScatter.meta = {\n \n};\n\nmodule.exports = Scatter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/index.js\n// module id = 436\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\nvar attributes = require('./attributes');\nvar constants = require('./constants');\nvar subTypes = require('./subtypes');\nvar handleXYDefaults = require('./xy_defaults');\nvar handleMarkerDefaults = require('./marker_defaults');\nvar handleLineDefaults = require('./line_defaults');\nvar handleLineShapeDefaults = require('./line_shape_defaults');\nvar handleTextDefaults = require('./text_defaults');\nvar handleFillColorDefaults = require('./fillcolor_defaults');\nvar errorBarsSupplyDefaults = require('../../components/errorbars/defaults');\n\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n var len = handleXYDefaults(traceIn, traceOut, layout, coerce),\n // TODO: default mode by orphan points...\n defaultMode = len < constants.PTS_LINESONLY ? 'lines+markers' : 'lines';\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('text');\n coerce('hovertext');\n coerce('mode', defaultMode);\n\n if(subTypes.hasLines(traceOut)) {\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n handleLineShapeDefaults(traceIn, traceOut, coerce);\n coerce('connectgaps');\n coerce('line.simplify');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});\n }\n\n if(subTypes.hasText(traceOut)) {\n handleTextDefaults(traceIn, traceOut, layout, coerce);\n }\n\n var dfltHoverOn = [];\n\n if(subTypes.hasMarkers(traceOut) || subTypes.hasText(traceOut)) {\n coerce('marker.maxdisplayed');\n dfltHoverOn.push('points');\n }\n\n coerce('fill');\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);\n }\n\n if(traceOut.fill === 'tonext' || traceOut.fill === 'toself') {\n dfltHoverOn.push('fills');\n }\n coerce('hoveron', dfltHoverOn.join('+') || 'points');\n\n errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y'});\n errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'});\n\n coerce('cliponaxis');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/defaults.js\n// module id = 437\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = require('../../components/color');\nvar hasColorscale = require('../../components/colorscale/has_colorscale');\nvar colorscaleDefaults = require('../../components/colorscale/defaults');\n\nvar subTypes = require('./subtypes');\n\n/*\n * opts: object of flags to control features not all marker users support\n * noLine: caller does not support marker lines\n * gradient: caller supports gradients\n */\nmodule.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout, coerce, opts) {\n var isBubble = subTypes.isBubble(traceIn),\n lineColor = (traceIn.line || {}).color,\n defaultMLC;\n\n opts = opts || {};\n\n // marker.color inherit from line.color (even if line.color is an array)\n if(lineColor) defaultColor = lineColor;\n\n coerce('marker.symbol');\n coerce('marker.opacity', isBubble ? 0.7 : 1);\n coerce('marker.size');\n\n coerce('marker.color', defaultColor);\n if(hasColorscale(traceIn, 'marker')) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'});\n }\n\n if(!opts.noLine) {\n // if there's a line with a different color than the marker, use\n // that line color as the default marker line color\n // (except when it's an array)\n // mostly this is for transparent markers to behave nicely\n if(lineColor && !Array.isArray(lineColor) && (traceOut.marker.color !== lineColor)) {\n defaultMLC = lineColor;\n }\n else if(isBubble) defaultMLC = Color.background;\n else defaultMLC = Color.defaultLine;\n\n coerce('marker.line.color', defaultMLC);\n if(hasColorscale(traceIn, 'marker.line')) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.line.', cLetter: 'c'});\n }\n\n coerce('marker.line.width', isBubble ? 1 : 0);\n }\n\n if(isBubble) {\n coerce('marker.sizeref');\n coerce('marker.sizemin');\n coerce('marker.sizemode');\n }\n\n if(opts.gradient) {\n var gradientType = coerce('marker.gradient.type');\n if(gradientType !== 'none') {\n coerce('marker.gradient.color');\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/marker_defaults.js\n// module id = 438\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar hasColorscale = require('../../components/colorscale/has_colorscale');\nvar colorscaleDefaults = require('../../components/colorscale/defaults');\n\n\nmodule.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout, coerce, opts) {\n var markerColor = (traceIn.marker || {}).color;\n\n coerce('line.color', defaultColor);\n\n if(hasColorscale(traceIn, 'line')) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'});\n }\n else {\n var lineColorDflt = (Array.isArray(markerColor) ? false : markerColor) || defaultColor;\n coerce('line.color', lineColorDflt);\n }\n\n coerce('line.width');\n if(!(opts || {}).noDash) coerce('line.dash');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/line_defaults.js\n// module id = 439\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n// common to 'scatter' and 'scatterternary'\nmodule.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) {\n var shape = coerce('line.shape');\n if(shape === 'spline') coerce('line.smoothing');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/line_shape_defaults.js\n// module id = 440\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\n\n\n// common to 'scatter', 'scatter3d' and 'scattergeo'\nmodule.exports = function(traceIn, traceOut, layout, coerce) {\n coerce('textposition');\n Lib.coerceFont(coerce, 'textfont', layout.font);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/text_defaults.js\n// module id = 441\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = require('../../components/color');\n\n\nmodule.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coerce) {\n var inheritColorFromMarker = false;\n\n if(traceOut.marker) {\n // don't try to inherit a color array\n var markerColor = traceOut.marker.color,\n markerLineColor = (traceOut.marker.line || {}).color;\n\n if(markerColor && !Array.isArray(markerColor)) {\n inheritColorFromMarker = markerColor;\n }\n else if(markerLineColor && !Array.isArray(markerLineColor)) {\n inheritColorFromMarker = markerLineColor;\n }\n }\n\n coerce('fillcolor', Color.addOpacity(\n (traceOut.line || {}).color ||\n inheritColorFromMarker ||\n defaultColor, 0.5\n ));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/fillcolor_defaults.js\n// module id = 442\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n// remove opacity for any trace that has a fill or is filled to\nmodule.exports = function cleanData(fullData) {\n for(var i = 0; i < fullData.length; i++) {\n var tracei = fullData[i];\n if(tracei.type !== 'scatter') continue;\n\n var filli = tracei.fill;\n if(filli === 'none' || filli === 'toself') continue;\n\n tracei.opacity = undefined;\n\n if(filli === 'tonexty' || filli === 'tonextx') {\n for(var j = i - 1; j >= 0; j--) {\n var tracej = fullData[j];\n\n if((tracej.type === 'scatter') &&\n (tracej.xaxis === tracei.xaxis) &&\n (tracej.yaxis === tracei.yaxis)) {\n tracej.opacity = undefined;\n break;\n }\n }\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/clean_data.js\n// module id = 443\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Axes = require('../../plots/cartesian/axes');\nvar BADNUM = require('../../constants/numerical').BADNUM;\n\nvar subTypes = require('./subtypes');\nvar calcColorscale = require('./colorscale_calc');\nvar arraysToCalcdata = require('./arrays_to_calcdata');\n\n\nmodule.exports = function calc(gd, trace) {\n var xa = Axes.getFromId(gd, trace.xaxis || 'x'),\n ya = Axes.getFromId(gd, trace.yaxis || 'y');\n\n var x = xa.makeCalcdata(trace, 'x'),\n y = ya.makeCalcdata(trace, 'y');\n\n var serieslen = Math.min(x.length, y.length),\n marker,\n s,\n i;\n\n // cancel minimum tick spacings (only applies to bars and boxes)\n xa._minDtick = 0;\n ya._minDtick = 0;\n\n if(x.length > serieslen) x.splice(serieslen, x.length - serieslen);\n if(y.length > serieslen) y.splice(serieslen, y.length - serieslen);\n\n // check whether bounds should be tight, padded, extended to zero...\n // most cases both should be padded on both ends, so start with that.\n var xOptions = {padded: true},\n yOptions = {padded: true};\n\n if(subTypes.hasMarkers(trace)) {\n\n // Treat size like x or y arrays --- Run d2c\n // this needs to go before ppad computation\n marker = trace.marker;\n s = marker.size;\n\n if(Array.isArray(s)) {\n // I tried auto-type but category and dates dont make much sense.\n var ax = {type: 'linear'};\n Axes.setConvert(ax);\n s = ax.makeCalcdata(trace.marker, 'size');\n if(s.length > serieslen) s.splice(serieslen, s.length - serieslen);\n }\n\n var sizeref = 1.6 * (trace.marker.sizeref || 1),\n markerTrans;\n if(trace.marker.sizemode === 'area') {\n markerTrans = function(v) {\n return Math.max(Math.sqrt((v || 0) / sizeref), 3);\n };\n }\n else {\n markerTrans = function(v) {\n return Math.max((v || 0) / sizeref, 3);\n };\n }\n xOptions.ppad = yOptions.ppad = Array.isArray(s) ?\n s.map(markerTrans) : markerTrans(s);\n }\n\n calcColorscale(trace);\n\n // TODO: text size\n\n // include zero (tight) and extremes (padded) if fill to zero\n // (unless the shape is closed, then it's just filling the shape regardless)\n if(((trace.fill === 'tozerox') ||\n ((trace.fill === 'tonextx') && gd.firstscatter)) &&\n ((x[0] !== x[serieslen - 1]) || (y[0] !== y[serieslen - 1]))) {\n xOptions.tozero = true;\n }\n\n // if no error bars, markers or text, or fill to y=0 remove x padding\n else if(!trace.error_y.visible && (\n ['tonexty', 'tozeroy'].indexOf(trace.fill) !== -1 ||\n (!subTypes.hasMarkers(trace) && !subTypes.hasText(trace))\n )) {\n xOptions.padded = false;\n xOptions.ppad = 0;\n }\n\n // now check for y - rather different logic, though still mostly padded both ends\n // include zero (tight) and extremes (padded) if fill to zero\n // (unless the shape is closed, then it's just filling the shape regardless)\n if(((trace.fill === 'tozeroy') || ((trace.fill === 'tonexty') && gd.firstscatter)) &&\n ((x[0] !== x[serieslen - 1]) || (y[0] !== y[serieslen - 1]))) {\n yOptions.tozero = true;\n }\n\n // tight y: any x fill\n else if(['tonextx', 'tozerox'].indexOf(trace.fill) !== -1) {\n yOptions.padded = false;\n }\n\n Axes.expand(xa, x, xOptions);\n Axes.expand(ya, y, yOptions);\n\n // create the \"calculated data\" to plot\n var cd = new Array(serieslen);\n for(i = 0; i < serieslen; i++) {\n cd[i] = (isNumeric(x[i]) && isNumeric(y[i])) ?\n {x: x[i], y: y[i]} : {x: BADNUM, y: BADNUM};\n\n if(trace.ids) {\n cd[i].id = String(trace.ids[i]);\n }\n }\n\n arraysToCalcdata(cd, trace);\n\n gd.firstscatter = false;\n return cd;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/calc.js\n// module id = 444\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar hasColorscale = require('../../components/colorscale/has_colorscale');\nvar calcColorscale = require('../../components/colorscale/calc');\n\nvar subTypes = require('./subtypes');\n\n\nmodule.exports = function calcMarkerColorscale(trace) {\n if(subTypes.hasLines(trace) && hasColorscale(trace, 'line')) {\n calcColorscale(trace, trace.line.color, 'line', 'c');\n }\n\n if(subTypes.hasMarkers(trace)) {\n if(hasColorscale(trace, 'marker')) {\n calcColorscale(trace, trace.marker.color, 'marker', 'c');\n }\n if(hasColorscale(trace, 'marker.line')) {\n calcColorscale(trace, trace.marker.line.color, 'marker.line', 'c');\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/colorscale_calc.js\n// module id = 445\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Lib = require('../../lib');\nvar Drawing = require('../../components/drawing');\nvar ErrorBars = require('../../components/errorbars');\n\nvar subTypes = require('./subtypes');\nvar linePoints = require('./line_points');\nvar linkTraces = require('./link_traces');\nvar polygonTester = require('../../lib/polygon').tester;\n\nmodule.exports = function plot(gd, plotinfo, cdscatter, transitionOpts, makeOnCompleteCallback) {\n var i, uids, selection, join, onComplete;\n\n var scatterlayer = plotinfo.plot.select('g.scatterlayer');\n\n // If transition config is provided, then it is only a partial replot and traces not\n // updated are removed.\n var isFullReplot = !transitionOpts;\n var hasTransition = !!transitionOpts && transitionOpts.duration > 0;\n\n selection = scatterlayer.selectAll('g.trace');\n\n join = selection.data(cdscatter, function(d) { return d[0].trace.uid; });\n\n // Append new traces:\n join.enter().append('g')\n .attr('class', function(d) {\n return 'trace scatter trace' + d[0].trace.uid;\n })\n .style('stroke-miterlimit', 2);\n\n // After the elements are created but before they've been draw, we have to perform\n // this extra step of linking the traces. This allows appending of fill layers so that\n // the z-order of fill layers is correct.\n linkTraces(gd, plotinfo, cdscatter);\n\n createFills(gd, scatterlayer, plotinfo);\n\n // Sort the traces, once created, so that the ordering is preserved even when traces\n // are shown and hidden. This is needed since we're not just wiping everything out\n // and recreating on every update.\n for(i = 0, uids = {}; i < cdscatter.length; i++) {\n uids[cdscatter[i][0].trace.uid] = i;\n }\n\n scatterlayer.selectAll('g.trace').sort(function(a, b) {\n var idx1 = uids[a[0].trace.uid];\n var idx2 = uids[b[0].trace.uid];\n return idx1 > idx2 ? 1 : -1;\n });\n\n if(hasTransition) {\n if(makeOnCompleteCallback) {\n // If it was passed a callback to register completion, make a callback. If\n // this is created, then it must be executed on completion, otherwise the\n // pos-transition redraw will not execute:\n onComplete = makeOnCompleteCallback();\n }\n\n var transition = d3.transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing)\n .each('end', function() {\n onComplete && onComplete();\n })\n .each('interrupt', function() {\n onComplete && onComplete();\n });\n\n transition.each(function() {\n // Must run the selection again since otherwise enters/updates get grouped together\n // and these get executed out of order. Except we need them in order!\n scatterlayer.selectAll('g.trace').each(function(d, i) {\n plotOne(gd, i, plotinfo, d, cdscatter, this, transitionOpts);\n });\n });\n } else {\n scatterlayer.selectAll('g.trace').each(function(d, i) {\n plotOne(gd, i, plotinfo, d, cdscatter, this, transitionOpts);\n });\n }\n\n if(isFullReplot) {\n join.exit().remove();\n }\n\n // remove paths that didn't get used\n scatterlayer.selectAll('path:not([d])').remove();\n};\n\nfunction createFills(gd, scatterlayer, plotinfo) {\n var trace;\n\n scatterlayer.selectAll('g.trace').each(function(d) {\n var tr = d3.select(this);\n\n // Loop only over the traces being redrawn:\n trace = d[0].trace;\n\n // make the fill-to-next path now for the NEXT trace, so it shows\n // behind both lines.\n if(trace._nexttrace) {\n trace._nextFill = tr.select('.js-fill.js-tonext');\n if(!trace._nextFill.size()) {\n\n // If there is an existing tozero fill, we must insert this *after* that fill:\n var loc = ':first-child';\n if(tr.select('.js-fill.js-tozero').size()) {\n loc += ' + *';\n }\n\n trace._nextFill = tr.insert('path', loc).attr('class', 'js-fill js-tonext');\n }\n } else {\n tr.selectAll('.js-fill.js-tonext').remove();\n trace._nextFill = null;\n }\n\n if(trace.fill && (trace.fill.substr(0, 6) === 'tozero' || trace.fill === 'toself' ||\n (trace.fill.substr(0, 2) === 'to' && !trace._prevtrace))) {\n trace._ownFill = tr.select('.js-fill.js-tozero');\n if(!trace._ownFill.size()) {\n trace._ownFill = tr.insert('path', ':first-child').attr('class', 'js-fill js-tozero');\n }\n } else {\n tr.selectAll('.js-fill.js-tozero').remove();\n trace._ownFill = null;\n }\n\n tr.selectAll('.js-fill').call(Drawing.setClipUrl, plotinfo.layerClipId);\n });\n}\n\nfunction plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transitionOpts) {\n var join, i;\n\n // Since this has been reorganized and we're executing this on individual traces,\n // we need to pass it the full list of cdscatter as well as this trace's index (idx)\n // since it does an internal n^2 loop over comparisons with other traces:\n selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll);\n\n var hasTransition = !!transitionOpts && transitionOpts.duration > 0;\n\n function transition(selection) {\n return hasTransition ? selection.transition() : selection;\n }\n\n var xa = plotinfo.xaxis,\n ya = plotinfo.yaxis;\n\n var trace = cdscatter[0].trace,\n line = trace.line,\n tr = d3.select(element);\n\n // (so error bars can find them along with bars)\n // error bars are at the bottom\n tr.call(ErrorBars.plot, plotinfo, transitionOpts);\n\n if(trace.visible !== true) return;\n\n transition(tr).style('opacity', trace.opacity);\n\n // BUILD LINES AND FILLS\n var ownFillEl3, tonext;\n var ownFillDir = trace.fill.charAt(trace.fill.length - 1);\n if(ownFillDir !== 'x' && ownFillDir !== 'y') ownFillDir = '';\n\n // store node for tweaking by selectPoints\n cdscatter[0].node3 = tr;\n\n var prevRevpath = '';\n var prevPolygons = [];\n var prevtrace = trace._prevtrace;\n\n if(prevtrace) {\n prevRevpath = prevtrace._prevRevpath || '';\n tonext = prevtrace._nextFill;\n prevPolygons = prevtrace._polygons;\n }\n\n var thispath,\n thisrevpath,\n // fullpath is all paths for this curve, joined together straight\n // across gaps, for filling\n fullpath = '',\n // revpath is fullpath reversed, for fill-to-next\n revpath = '',\n // functions for converting a point array to a path\n pathfn, revpathbase, revpathfn,\n // variables used before and after the data join\n pt0, lastSegment, pt1, thisPolygons;\n\n // initialize line join data / method\n var segments = [],\n makeUpdate = Lib.noop;\n\n ownFillEl3 = trace._ownFill;\n\n if(subTypes.hasLines(trace) || trace.fill !== 'none') {\n\n if(tonext) {\n // This tells .style which trace to use for fill information:\n tonext.datum(cdscatter);\n }\n\n if(['hv', 'vh', 'hvh', 'vhv'].indexOf(line.shape) !== -1) {\n pathfn = Drawing.steps(line.shape);\n revpathbase = Drawing.steps(\n line.shape.split('').reverse().join('')\n );\n }\n else if(line.shape === 'spline') {\n pathfn = revpathbase = function(pts) {\n var pLast = pts[pts.length - 1];\n if(pts.length > 1 && pts[0][0] === pLast[0] && pts[0][1] === pLast[1]) {\n // identical start and end points: treat it as a\n // closed curve so we don't get a kink\n return Drawing.smoothclosed(pts.slice(1), line.smoothing);\n }\n else {\n return Drawing.smoothopen(pts, line.smoothing);\n }\n };\n }\n else {\n pathfn = revpathbase = function(pts) {\n return 'M' + pts.join('L');\n };\n }\n\n revpathfn = function(pts) {\n // note: this is destructive (reverses pts in place) so can't use pts after this\n return revpathbase(pts.reverse());\n };\n\n segments = linePoints(cdscatter, {\n xaxis: xa,\n yaxis: ya,\n connectGaps: trace.connectgaps,\n baseTolerance: Math.max(line.width || 1, 3) / 4,\n shape: line.shape,\n simplify: line.simplify\n });\n\n // since we already have the pixel segments here, use them to make\n // polygons for hover on fill\n // TODO: can we skip this if hoveron!=fills? That would mean we\n // need to redraw when you change hoveron...\n thisPolygons = trace._polygons = new Array(segments.length);\n for(i = 0; i < segments.length; i++) {\n trace._polygons[i] = polygonTester(segments[i]);\n }\n\n if(segments.length) {\n pt0 = segments[0][0];\n lastSegment = segments[segments.length - 1];\n pt1 = lastSegment[lastSegment.length - 1];\n }\n\n makeUpdate = function(isEnter) {\n return function(pts) {\n thispath = pathfn(pts);\n thisrevpath = revpathfn(pts);\n if(!fullpath) {\n fullpath = thispath;\n revpath = thisrevpath;\n }\n else if(ownFillDir) {\n fullpath += 'L' + thispath.substr(1);\n revpath = thisrevpath + ('L' + revpath.substr(1));\n }\n else {\n fullpath += 'Z' + thispath;\n revpath = thisrevpath + 'Z' + revpath;\n }\n\n if(subTypes.hasLines(trace) && pts.length > 1) {\n var el = d3.select(this);\n\n // This makes the coloring work correctly:\n el.datum(cdscatter);\n\n if(isEnter) {\n transition(el.style('opacity', 0)\n .attr('d', thispath)\n .call(Drawing.lineGroupStyle))\n .style('opacity', 1);\n } else {\n var sel = transition(el);\n sel.attr('d', thispath);\n Drawing.singleLineStyle(cdscatter, sel);\n }\n }\n };\n };\n }\n\n var lineJoin = tr.selectAll('.js-line').data(segments);\n\n transition(lineJoin.exit())\n .style('opacity', 0)\n .remove();\n\n lineJoin.each(makeUpdate(false));\n\n lineJoin.enter().append('path')\n .classed('js-line', true)\n .style('vector-effect', 'non-scaling-stroke')\n .call(Drawing.lineGroupStyle)\n .each(makeUpdate(true));\n\n Drawing.setClipUrl(lineJoin, plotinfo.layerClipId);\n\n if(segments.length) {\n if(ownFillEl3) {\n if(pt0 && pt1) {\n if(ownFillDir) {\n if(ownFillDir === 'y') {\n pt0[1] = pt1[1] = ya.c2p(0, true);\n }\n else if(ownFillDir === 'x') {\n pt0[0] = pt1[0] = xa.c2p(0, true);\n }\n\n // fill to zero: full trace path, plus extension of\n // the endpoints to the appropriate axis\n // For the sake of animations, wrap the points around so that\n // the points on the axes are the first two points. Otherwise\n // animations get a little crazy if the number of points changes.\n transition(ownFillEl3).attr('d', 'M' + pt1 + 'L' + pt0 + 'L' + fullpath.substr(1))\n .call(Drawing.singleFillStyle);\n } else {\n // fill to self: just join the path to itself\n transition(ownFillEl3).attr('d', fullpath + 'Z')\n .call(Drawing.singleFillStyle);\n }\n }\n }\n else if(trace.fill.substr(0, 6) === 'tonext' && fullpath && prevRevpath) {\n // fill to next: full trace path, plus the previous path reversed\n if(trace.fill === 'tonext') {\n // tonext: for use by concentric shapes, like manually constructed\n // contours, we just add the two paths closed on themselves.\n // This makes strange results if one path is *not* entirely\n // inside the other, but then that is a strange usage.\n transition(tonext).attr('d', fullpath + 'Z' + prevRevpath + 'Z')\n .call(Drawing.singleFillStyle);\n }\n else {\n // tonextx/y: for now just connect endpoints with lines. This is\n // the correct behavior if the endpoints are at the same value of\n // y/x, but if they *aren't*, we should ideally do more complicated\n // things depending on whether the new endpoint projects onto the\n // existing curve or off the end of it\n transition(tonext).attr('d', fullpath + 'L' + prevRevpath.substr(1) + 'Z')\n .call(Drawing.singleFillStyle);\n }\n trace._polygons = trace._polygons.concat(prevPolygons);\n }\n trace._prevRevpath = revpath;\n trace._prevPolygons = thisPolygons;\n }\n\n\n function visFilter(d) {\n return d.filter(function(v) { return v.vis; });\n }\n\n function keyFunc(d) {\n return d.id;\n }\n\n // Returns a function if the trace is keyed, otherwise returns undefined\n function getKeyFunc(trace) {\n if(trace.ids) {\n return keyFunc;\n }\n }\n\n function hideFilter() {\n return false;\n }\n\n function makePoints(d) {\n var join, selection, hasNode;\n\n var trace = d[0].trace,\n s = d3.select(this),\n showMarkers = subTypes.hasMarkers(trace),\n showText = subTypes.hasText(trace);\n\n var keyFunc = getKeyFunc(trace),\n markerFilter = hideFilter,\n textFilter = hideFilter;\n\n if(showMarkers) {\n markerFilter = (trace.marker.maxdisplayed || trace._needsCull) ? visFilter : Lib.identity;\n }\n\n if(showText) {\n textFilter = (trace.marker.maxdisplayed || trace._needsCull) ? visFilter : Lib.identity;\n }\n\n // marker points\n\n selection = s.selectAll('path.point');\n\n join = selection.data(markerFilter, keyFunc);\n\n var enter = join.enter().append('path')\n .classed('point', true);\n\n if(hasTransition) {\n enter\n .call(Drawing.pointStyle, trace, gd)\n .call(Drawing.translatePoints, xa, ya)\n .style('opacity', 0)\n .transition()\n .style('opacity', 1);\n }\n\n var markerScale = showMarkers && Drawing.tryColorscale(trace.marker, '');\n var lineScale = showMarkers && Drawing.tryColorscale(trace.marker, 'line');\n\n join.order();\n\n join.each(function(d) {\n var el = d3.select(this);\n var sel = transition(el);\n hasNode = Drawing.translatePoint(d, sel, xa, ya);\n\n if(hasNode) {\n Drawing.singlePointStyle(d, sel, trace, markerScale, lineScale, gd);\n\n if(plotinfo.layerClipId) {\n Drawing.hideOutsideRangePoint(d, sel, xa, ya);\n }\n\n if(trace.customdata) {\n el.classed('plotly-customdata', d.data !== null && d.data !== undefined);\n }\n } else {\n sel.remove();\n }\n });\n\n if(hasTransition) {\n join.exit().transition()\n .style('opacity', 0)\n .remove();\n } else {\n join.exit().remove();\n }\n\n // text points\n selection = s.selectAll('g');\n join = selection.data(textFilter, keyFunc);\n\n // each text needs to go in its own 'g' in case\n // it gets converted to mathjax\n join.enter().append('g').classed('textpoint', true).append('text');\n\n join.order();\n\n join.each(function(d) {\n var g = d3.select(this);\n var sel = transition(g.select('text'));\n hasNode = Drawing.translatePoint(d, sel, xa, ya);\n\n if(hasNode) {\n if(plotinfo.layerClipId) {\n Drawing.hideOutsideRangePoint(d, g, xa, ya);\n }\n } else {\n g.remove();\n }\n });\n\n join.selectAll('text')\n .call(Drawing.textPointStyle, trace, gd)\n .each(function(d) {\n // This just *has* to be totally custom becuase of SVG text positioning :(\n // It's obviously copied from translatePoint; we just can't use that\n var x = xa.c2p(d.x);\n var y = ya.c2p(d.y);\n\n d3.select(this).selectAll('tspan.line').each(function() {\n transition(d3.select(this)).attr({x: x, y: y});\n });\n });\n\n join.exit().remove();\n }\n\n // NB: selectAll is evaluated on instantiation:\n var pointSelection = tr.selectAll('.points');\n\n // Join with new data\n join = pointSelection.data([cdscatter]);\n\n // Transition existing, but don't defer this to an async .transition since\n // there's no timing involved:\n pointSelection.each(makePoints);\n\n join.enter().append('g')\n .classed('points', true)\n .each(makePoints);\n\n join.exit().remove();\n\n // lastly, clip points groups of `cliponaxis !== false` traces\n // on `plotinfo._hasClipOnAxisFalse === true` subplots\n join.each(function(d) {\n var hasClipOnAxisFalse = d[0].trace.cliponaxis === false;\n Drawing.setClipUrl(d3.select(this), hasClipOnAxisFalse ? null : plotinfo.layerClipId);\n });\n}\n\nfunction selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) {\n var xa = plotinfo.xaxis,\n ya = plotinfo.yaxis,\n xr = d3.extent(Lib.simpleMap(xa.range, xa.r2c)),\n yr = d3.extent(Lib.simpleMap(ya.range, ya.r2c));\n\n var trace = cdscatter[0].trace;\n if(!subTypes.hasMarkers(trace)) return;\n // if marker.maxdisplayed is used, select a maximum of\n // mnum markers to show, from the set that are in the viewport\n var mnum = trace.marker.maxdisplayed;\n\n // TODO: remove some as we get away from the viewport?\n if(mnum === 0) return;\n\n var cd = cdscatter.filter(function(v) {\n return v.x >= xr[0] && v.x <= xr[1] && v.y >= yr[0] && v.y <= yr[1];\n }),\n inc = Math.ceil(cd.length / mnum),\n tnum = 0;\n cdscatterAll.forEach(function(cdj, j) {\n var tracei = cdj[0].trace;\n if(subTypes.hasMarkers(tracei) &&\n tracei.marker.maxdisplayed > 0 && j < idx) {\n tnum++;\n }\n });\n\n // if multiple traces use maxdisplayed, stagger which markers we\n // display this formula offsets successive traces by 1/3 of the\n // increment, adding an extra small amount after each triplet so\n // it's not quite periodic\n var i0 = Math.round(tnum * inc / 3 + Math.floor(tnum / 3) * inc / 7.1);\n\n // for error bars: save in cd which markers to show\n // so we don't have to repeat this\n cdscatter.forEach(function(v) { delete v.vis; });\n cd.forEach(function(v, i) {\n if(Math.round((i + i0) % inc) === 0) v.vis = true;\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/plot.js\n// module id = 446\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar BADNUM = require('../../constants/numerical').BADNUM;\nvar Lib = require('../../lib');\nvar segmentsIntersect = Lib.segmentsIntersect;\nvar constrain = Lib.constrain;\nvar constants = require('./constants');\n\n\nmodule.exports = function linePoints(d, opts) {\n var xa = opts.xaxis;\n var ya = opts.yaxis;\n var simplify = opts.simplify;\n var connectGaps = opts.connectGaps;\n var baseTolerance = opts.baseTolerance;\n var shape = opts.shape;\n var linear = shape === 'linear';\n var segments = [];\n var minTolerance = constants.minTolerance;\n var pts = new Array(d.length);\n var pti = 0;\n\n var i;\n\n // pt variables are pixel coordinates [x,y] of one point\n // these four are the outputs of clustering on a line\n var clusterStartPt, clusterEndPt, clusterHighPt, clusterLowPt;\n\n // \"this\" is the next point we're considering adding to the cluster\n var thisPt;\n\n // did we encounter the high point first, then a low point, or vice versa?\n var clusterHighFirst;\n\n // the first two points in the cluster determine its unit vector\n // so the second is always in the \"High\" direction\n var clusterUnitVector;\n\n // the pixel delta from clusterStartPt\n var thisVector;\n\n // val variables are (signed) pixel distances along the cluster vector\n var clusterRefDist, clusterHighVal, clusterLowVal, thisVal;\n\n // deviation variables are (signed) pixel distances normal to the cluster vector\n var clusterMinDeviation, clusterMaxDeviation, thisDeviation;\n\n if(!simplify) {\n baseTolerance = minTolerance = -1;\n }\n\n // turn one calcdata point into pixel coordinates\n function getPt(index) {\n var x = xa.c2p(d[index].x);\n var y = ya.c2p(d[index].y);\n if(x === BADNUM || y === BADNUM) return false;\n return [x, y];\n }\n\n // if we're off-screen, increase tolerance over baseTolerance\n function getTolerance(pt) {\n var xFrac = pt[0] / xa._length;\n var yFrac = pt[1] / ya._length;\n return (1 + constants.toleranceGrowth * Math.max(0, -xFrac, xFrac - 1, -yFrac, yFrac - 1)) * baseTolerance;\n }\n\n function ptDist(pt1, pt2) {\n var dx = pt1[0] - pt2[0];\n var dy = pt1[1] - pt2[1];\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n // last bit of filtering: clip paths that are VERY far off-screen\n // so we don't get near the browser's hard limit (+/- 2^29 px in Chrome and FF)\n\n var maxScreensAway = constants.maxScreensAway;\n\n // find the intersections between the segment from pt1 to pt2\n // and the large rectangle maxScreensAway around the viewport\n // if one of pt1 and pt2 is inside and the other outside, there\n // will be only one intersection.\n // if both are outside there will be 0 or 2 intersections\n // (or 1 if it's right at a corner - we'll treat that like 0)\n // returns an array of intersection pts\n var xEdge0 = -xa._length * maxScreensAway;\n var xEdge1 = xa._length * (1 + maxScreensAway);\n var yEdge0 = -ya._length * maxScreensAway;\n var yEdge1 = ya._length * (1 + maxScreensAway);\n var edges = [\n [xEdge0, yEdge0, xEdge1, yEdge0],\n [xEdge1, yEdge0, xEdge1, yEdge1],\n [xEdge1, yEdge1, xEdge0, yEdge1],\n [xEdge0, yEdge1, xEdge0, yEdge0]\n ];\n var xEdge, yEdge, lastXEdge, lastYEdge, lastFarPt, edgePt;\n\n // for linear line shape, edge intersections should be linearly interpolated\n // spline uses this too, which isn't precisely correct but is actually pretty\n // good, because Catmull-Rom weights far-away points less in creating the curvature\n function getLinearEdgeIntersections(pt1, pt2) {\n var out = [];\n var ptCount = 0;\n for(var i = 0; i < 4; i++) {\n var edge = edges[i];\n var ptInt = segmentsIntersect(pt1[0], pt1[1], pt2[0], pt2[1],\n edge[0], edge[1], edge[2], edge[3]);\n if(ptInt && (!ptCount ||\n Math.abs(ptInt.x - out[0][0]) > 1 ||\n Math.abs(ptInt.y - out[0][1]) > 1\n )) {\n ptInt = [ptInt.x, ptInt.y];\n // if we have 2 intersections, make sure the closest one to pt1 comes first\n if(ptCount && ptDist(ptInt, pt1) < ptDist(out[0], pt1)) out.unshift(ptInt);\n else out.push(ptInt);\n ptCount++;\n }\n }\n return out;\n }\n\n function onlyConstrainedPoint(pt) {\n if(pt[0] < xEdge0 || pt[0] > xEdge1 || pt[1] < yEdge0 || pt[1] > yEdge1) {\n return [constrain(pt[0], xEdge0, xEdge1), constrain(pt[1], yEdge0, yEdge1)];\n }\n }\n\n function sameEdge(pt1, pt2) {\n if(pt1[0] === pt2[0] && (pt1[0] === xEdge0 || pt1[0] === xEdge1)) return true;\n if(pt1[1] === pt2[1] && (pt1[1] === yEdge0 || pt1[1] === yEdge1)) return true;\n }\n\n // for line shapes hv and vh, movement in the two dimensions is decoupled,\n // so all we need to do is constrain each dimension independently\n function getHVEdgeIntersections(pt1, pt2) {\n var out = [];\n var ptInt1 = onlyConstrainedPoint(pt1);\n var ptInt2 = onlyConstrainedPoint(pt2);\n if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n if(ptInt1) out.push(ptInt1);\n if(ptInt2) out.push(ptInt2);\n return out;\n }\n\n // hvh and vhv we sometimes have to move one of the intersection points\n // out BEYOND the clipping rect, by a maximum of a factor of 2, so that\n // the midpoint line is drawn in the right place\n function getABAEdgeIntersections(dim, limit0, limit1) {\n return function(pt1, pt2) {\n var ptInt1 = onlyConstrainedPoint(pt1);\n var ptInt2 = onlyConstrainedPoint(pt2);\n\n var out = [];\n if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n if(ptInt1) out.push(ptInt1);\n if(ptInt2) out.push(ptInt2);\n\n var midShift = 2 * Lib.constrain((pt1[dim] + pt2[dim]) / 2, limit0, limit1) -\n ((ptInt1 || pt1)[dim] + (ptInt2 || pt2)[dim]);\n if(midShift) {\n var ptToAlter;\n if(ptInt1 && ptInt2) {\n ptToAlter = (midShift > 0 === ptInt1[dim] > ptInt2[dim]) ? ptInt1 : ptInt2;\n }\n else ptToAlter = ptInt1 || ptInt2;\n\n ptToAlter[dim] += midShift;\n }\n\n return out;\n };\n }\n\n var getEdgeIntersections;\n if(shape === 'linear' || shape === 'spline') {\n getEdgeIntersections = getLinearEdgeIntersections;\n }\n else if(shape === 'hv' || shape === 'vh') {\n getEdgeIntersections = getHVEdgeIntersections;\n }\n else if(shape === 'hvh') getEdgeIntersections = getABAEdgeIntersections(0, xEdge0, xEdge1);\n else if(shape === 'vhv') getEdgeIntersections = getABAEdgeIntersections(1, yEdge0, yEdge1);\n\n // a segment pt1->pt2 entirely outside the nearby region:\n // find the corner it gets closest to touching\n function getClosestCorner(pt1, pt2) {\n var dx = pt2[0] - pt1[0];\n var m = (pt2[1] - pt1[1]) / dx;\n var b = (pt1[1] * pt2[0] - pt2[1] * pt1[0]) / dx;\n\n if(b > 0) return [m > 0 ? xEdge0 : xEdge1, yEdge1];\n else return [m > 0 ? xEdge1 : xEdge0, yEdge0];\n }\n\n function updateEdge(pt) {\n var x = pt[0];\n var y = pt[1];\n var xSame = x === pts[pti - 1][0];\n var ySame = y === pts[pti - 1][1];\n // duplicate point?\n if(xSame && ySame) return;\n if(pti > 1) {\n // backtracking along an edge?\n var xSame2 = x === pts[pti - 2][0];\n var ySame2 = y === pts[pti - 2][1];\n if(xSame && (x === xEdge0 || x === xEdge1) && xSame2) {\n if(ySame2) pti--; // backtracking exactly - drop prev pt and don't add\n else pts[pti - 1] = pt; // not exact: replace the prev pt\n }\n else if(ySame && (y === yEdge0 || y === yEdge1) && ySame2) {\n if(xSame2) pti--;\n else pts[pti - 1] = pt;\n }\n else pts[pti++] = pt;\n }\n else pts[pti++] = pt;\n }\n\n function updateEdgesForReentry(pt) {\n // if we're outside the nearby region and going back in,\n // we may need to loop around a corner point\n if(pts[pti - 1][0] !== pt[0] && pts[pti - 1][1] !== pt[1]) {\n updateEdge([lastXEdge, lastYEdge]);\n }\n updateEdge(pt);\n lastFarPt = null;\n lastXEdge = lastYEdge = 0;\n }\n\n function addPt(pt) {\n // Are we more than maxScreensAway off-screen any direction?\n // if so, clip to this box, but in such a way that on-screen\n // drawing is unchanged\n xEdge = (pt[0] < xEdge0) ? xEdge0 : (pt[0] > xEdge1) ? xEdge1 : 0;\n yEdge = (pt[1] < yEdge0) ? yEdge0 : (pt[1] > yEdge1) ? yEdge1 : 0;\n if(xEdge || yEdge) {\n // to get fills right - if first point is far, push it toward the\n // screen in whichever direction(s) are far\n if(!pti) {\n pts[pti++] = [xEdge || pt[0], yEdge || pt[1]];\n }\n else if(lastFarPt) {\n // both this point and the last are outside the nearby region\n // check if we're crossing the nearby region\n var intersections = getEdgeIntersections(lastFarPt, pt);\n if(intersections.length > 1) {\n updateEdgesForReentry(intersections[0]);\n pts[pti++] = intersections[1];\n }\n }\n // we're leaving the nearby region - add the point where we left it\n else {\n edgePt = getEdgeIntersections(pts[pti - 1], pt)[0];\n pts[pti++] = edgePt;\n }\n\n var lastPt = pts[pti - 1];\n if(xEdge && yEdge && (lastPt[0] !== xEdge || lastPt[1] !== yEdge)) {\n // we've gone out beyond a new corner: add the corner too\n // so that the next point will take the right winding\n if(lastFarPt) {\n if(lastXEdge !== xEdge && lastYEdge !== yEdge) {\n if(lastXEdge && lastYEdge) {\n // we've gone around to an opposite corner - we\n // need to add the correct extra corner\n // in order to get the right winding\n updateEdge(getClosestCorner(lastFarPt, pt));\n }\n else {\n // we're coming from a far edge - the extra corner\n // we need is determined uniquely by the sectors\n updateEdge([lastXEdge || xEdge, lastYEdge || yEdge]);\n }\n }\n else if(lastXEdge && lastYEdge) {\n updateEdge([lastXEdge, lastYEdge]);\n }\n }\n updateEdge([xEdge, yEdge]);\n }\n else if((lastXEdge - xEdge) && (lastYEdge - yEdge)) {\n // we're coming from an edge or far corner to an edge - again the\n // extra corner we need is uniquely determined by the sectors\n updateEdge([xEdge || lastXEdge, yEdge || lastYEdge]);\n }\n lastFarPt = pt;\n lastXEdge = xEdge;\n lastYEdge = yEdge;\n }\n else {\n if(lastFarPt) {\n // this point is in range but the previous wasn't: add its entry pt first\n updateEdgesForReentry(getEdgeIntersections(lastFarPt, pt)[0]);\n }\n\n pts[pti++] = pt;\n }\n }\n\n // loop over ALL points in this trace\n for(i = 0; i < d.length; i++) {\n clusterStartPt = getPt(i);\n if(!clusterStartPt) continue;\n\n pti = 0;\n lastFarPt = null;\n addPt(clusterStartPt);\n\n // loop over one segment of the trace\n for(i++; i < d.length; i++) {\n clusterHighPt = getPt(i);\n if(!clusterHighPt) {\n if(connectGaps) continue;\n else break;\n }\n\n // can't decimate if nonlinear line shape\n // TODO: we *could* decimate [hv]{2,3} shapes if we restricted clusters to horz or vert again\n // but spline would be verrry awkward to decimate\n if(!linear) {\n addPt(clusterHighPt);\n continue;\n }\n\n clusterRefDist = ptDist(clusterHighPt, clusterStartPt);\n\n if(clusterRefDist < getTolerance(clusterHighPt) * minTolerance) continue;\n\n clusterUnitVector = [\n (clusterHighPt[0] - clusterStartPt[0]) / clusterRefDist,\n (clusterHighPt[1] - clusterStartPt[1]) / clusterRefDist\n ];\n\n clusterLowPt = clusterStartPt;\n clusterHighVal = clusterRefDist;\n clusterLowVal = clusterMinDeviation = clusterMaxDeviation = 0;\n clusterHighFirst = false;\n clusterEndPt = clusterHighPt;\n\n // loop over one cluster of points that collapse onto one line\n for(i++; i < d.length; i++) {\n thisPt = getPt(i);\n if(!thisPt) {\n if(connectGaps) continue;\n else break;\n }\n thisVector = [\n thisPt[0] - clusterStartPt[0],\n thisPt[1] - clusterStartPt[1]\n ];\n // cross product (or dot with normal to the cluster vector)\n thisDeviation = thisVector[0] * clusterUnitVector[1] - thisVector[1] * clusterUnitVector[0];\n clusterMinDeviation = Math.min(clusterMinDeviation, thisDeviation);\n clusterMaxDeviation = Math.max(clusterMaxDeviation, thisDeviation);\n\n if(clusterMaxDeviation - clusterMinDeviation > getTolerance(thisPt)) break;\n\n clusterEndPt = thisPt;\n thisVal = thisVector[0] * clusterUnitVector[0] + thisVector[1] * clusterUnitVector[1];\n\n if(thisVal > clusterHighVal) {\n clusterHighVal = thisVal;\n clusterHighPt = thisPt;\n clusterHighFirst = false;\n } else if(thisVal < clusterLowVal) {\n clusterLowVal = thisVal;\n clusterLowPt = thisPt;\n clusterHighFirst = true;\n }\n }\n\n // insert this cluster into pts\n // we've already inserted the start pt, now check if we have high and low pts\n if(clusterHighFirst) {\n addPt(clusterHighPt);\n if(clusterEndPt !== clusterLowPt) addPt(clusterLowPt);\n } else {\n if(clusterLowPt !== clusterStartPt) addPt(clusterLowPt);\n if(clusterEndPt !== clusterHighPt) addPt(clusterHighPt);\n }\n // and finally insert the end pt\n addPt(clusterEndPt);\n\n // have we reached the end of this segment?\n if(i >= d.length || !thisPt) break;\n\n // otherwise we have an out-of-cluster point to insert as next clusterStartPt\n addPt(thisPt);\n clusterStartPt = thisPt;\n }\n\n // to get fills right - repeat what we did at the start\n if(lastFarPt) updateEdge([lastXEdge || lastFarPt[0], lastYEdge || lastFarPt[1]]);\n\n segments.push(pts.slice(0, pti));\n }\n\n return segments;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/line_points.js\n// module id = 447\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function linkTraces(gd, plotinfo, cdscatter) {\n var cd, trace;\n var prevtrace = null;\n\n for(var i = 0; i < cdscatter.length; ++i) {\n cd = cdscatter[i];\n trace = cd[0].trace;\n\n // Note: The check which ensures all cdscatter here are for the same axis and\n // are either cartesian or scatterternary has been removed. This code assumes\n // the passed scattertraces have been filtered to the proper plot types and\n // the proper subplots.\n if(trace.visible === true) {\n trace._nexttrace = null;\n\n if(['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1) {\n trace._prevtrace = prevtrace;\n\n if(prevtrace) {\n prevtrace._nexttrace = trace;\n }\n }\n\n prevtrace = trace;\n } else {\n trace._prevtrace = trace._nexttrace = null;\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/link_traces.js\n// module id = 448\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar tinycolor = require('tinycolor2');\n\nvar Plotly = require('../../plotly');\nvar Plots = require('../../plots/plots');\nvar Registry = require('../../registry');\nvar Axes = require('../../plots/cartesian/axes');\nvar dragElement = require('../dragelement');\nvar Lib = require('../../lib');\nvar extendFlat = require('../../lib/extend').extendFlat;\nvar setCursor = require('../../lib/setcursor');\nvar Drawing = require('../drawing');\nvar Color = require('../color');\nvar Titles = require('../titles');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar LINE_SPACING = require('../../constants/alignment').LINE_SPACING;\n\nvar handleAxisDefaults = require('../../plots/cartesian/axis_defaults');\nvar handleAxisPositionDefaults = require('../../plots/cartesian/position_defaults');\nvar axisLayoutAttrs = require('../../plots/cartesian/layout_attributes');\n\nvar attributes = require('./attributes');\n\n\nmodule.exports = function draw(gd, id) {\n // opts: options object, containing everything from attributes\n // plus a few others that are the equivalent of the colorbar \"data\"\n var opts = {};\n Object.keys(attributes).forEach(function(k) {\n opts[k] = null;\n });\n // fillcolor can be a d3 scale, domain is z values, range is colors\n // or leave it out for no fill,\n // or set to a string constant for single-color fill\n opts.fillcolor = null;\n // line.color has the same options as fillcolor\n opts.line = {color: null, width: null, dash: null};\n // levels of lines to draw.\n // note that this DOES NOT determine the extent of the bar\n // that's given by the domain of fillcolor\n // (or line.color if no fillcolor domain)\n opts.levels = {start: null, end: null, size: null};\n // separate fill levels (for example, heatmap coloring of a\n // contour map) if this is omitted, fillcolors will be\n // evaluated halfway between levels\n opts.filllevels = null;\n\n function component() {\n var fullLayout = gd._fullLayout,\n gs = fullLayout._size;\n if((typeof opts.fillcolor !== 'function') &&\n (typeof opts.line.color !== 'function')) {\n fullLayout._infolayer.selectAll('g.' + id).remove();\n return;\n }\n var zrange = d3.extent(((typeof opts.fillcolor === 'function') ?\n opts.fillcolor : opts.line.color).domain());\n var linelevels = [];\n var filllevels = [];\n var linecolormap = typeof opts.line.color === 'function' ?\n opts.line.color : function() { return opts.line.color; };\n var fillcolormap = typeof opts.fillcolor === 'function' ?\n opts.fillcolor : function() { return opts.fillcolor; };\n var l;\n var i;\n\n var l0 = opts.levels.end + opts.levels.size / 100,\n ls = opts.levels.size,\n zr0 = (1.001 * zrange[0] - 0.001 * zrange[1]),\n zr1 = (1.001 * zrange[1] - 0.001 * zrange[0]);\n for(i = 0; i < 1e5; i++) {\n l = opts.levels.start + i * ls;\n if(ls > 0 ? (l >= l0) : (l <= l0)) break;\n if(l > zr0 && l < zr1) linelevels.push(l);\n }\n\n if(typeof opts.fillcolor === 'function') {\n if(opts.filllevels) {\n l0 = opts.filllevels.end + opts.filllevels.size / 100;\n ls = opts.filllevels.size;\n for(i = 0; i < 1e5; i++) {\n l = opts.filllevels.start + i * ls;\n if(ls > 0 ? (l >= l0) : (l <= l0)) break;\n if(l > zrange[0] && l < zrange[1]) filllevels.push(l);\n }\n }\n else {\n filllevels = linelevels.map(function(v) {\n return v - opts.levels.size / 2;\n });\n filllevels.push(filllevels[filllevels.length - 1] +\n opts.levels.size);\n }\n }\n else if(opts.fillcolor && typeof opts.fillcolor === 'string') {\n // doesn't matter what this value is, with a single value\n // we'll make a single fill rect covering the whole bar\n filllevels = [0];\n }\n\n if(opts.levels.size < 0) {\n linelevels.reverse();\n filllevels.reverse();\n }\n\n // now make a Plotly Axes object to scale with and draw ticks\n // TODO: does not support orientation other than right\n\n // we calculate pixel sizes based on the specified graph size,\n // not the actual (in case something pushed the margins around)\n // which is a little odd but avoids an odd iterative effect\n // when the colorbar itself is pushing the margins.\n // but then the fractional size is calculated based on the\n // actual graph size, so that the axes will size correctly.\n var originalPlotHeight = fullLayout.height - fullLayout.margin.t - fullLayout.margin.b,\n originalPlotWidth = fullLayout.width - fullLayout.margin.l - fullLayout.margin.r,\n thickPx = Math.round(opts.thickness *\n (opts.thicknessmode === 'fraction' ? originalPlotWidth : 1)),\n thickFrac = thickPx / gs.w,\n lenPx = Math.round(opts.len *\n (opts.lenmode === 'fraction' ? originalPlotHeight : 1)),\n lenFrac = lenPx / gs.h,\n xpadFrac = opts.xpad / gs.w,\n yExtraPx = (opts.borderwidth + opts.outlinewidth) / 2,\n ypadFrac = opts.ypad / gs.h,\n\n // x positioning: do it initially just for left anchor,\n // then fix at the end (since we don't know the width yet)\n xLeft = Math.round(opts.x * gs.w + opts.xpad),\n // for dragging... this is getting a little muddled...\n xLeftFrac = opts.x - thickFrac *\n ({middle: 0.5, right: 1}[opts.xanchor]||0),\n\n // y positioning we can do correctly from the start\n yBottomFrac = opts.y + lenFrac *\n (({top: -0.5, bottom: 0.5}[opts.yanchor] || 0) - 0.5),\n yBottomPx = Math.round(gs.h * (1 - yBottomFrac)),\n yTopPx = yBottomPx - lenPx,\n titleEl,\n cbAxisIn = {\n type: 'linear',\n range: zrange,\n tickmode: opts.tickmode,\n nticks: opts.nticks,\n tick0: opts.tick0,\n dtick: opts.dtick,\n tickvals: opts.tickvals,\n ticktext: opts.ticktext,\n ticks: opts.ticks,\n ticklen: opts.ticklen,\n tickwidth: opts.tickwidth,\n tickcolor: opts.tickcolor,\n showticklabels: opts.showticklabels,\n tickfont: opts.tickfont,\n tickangle: opts.tickangle,\n tickformat: opts.tickformat,\n exponentformat: opts.exponentformat,\n separatethousands: opts.separatethousands,\n showexponent: opts.showexponent,\n showtickprefix: opts.showtickprefix,\n tickprefix: opts.tickprefix,\n showticksuffix: opts.showticksuffix,\n ticksuffix: opts.ticksuffix,\n title: opts.title,\n titlefont: opts.titlefont,\n showline: true,\n anchor: 'free',\n position: 1\n },\n cbAxisOut = {\n type: 'linear',\n _id: 'y' + id\n },\n axisOptions = {\n letter: 'y',\n font: fullLayout.font,\n noHover: true,\n calendar: fullLayout.calendar // not really necessary (yet?)\n };\n\n // Coerce w.r.t. Axes layoutAttributes:\n // re-use axes.js logic without updating _fullData\n function coerce(attr, dflt) {\n return Lib.coerce(cbAxisIn, cbAxisOut, axisLayoutAttrs, attr, dflt);\n }\n\n // Prepare the Plotly axis object\n handleAxisDefaults(cbAxisIn, cbAxisOut, coerce, axisOptions, fullLayout);\n handleAxisPositionDefaults(cbAxisIn, cbAxisOut, coerce, axisOptions);\n\n // position can't go in through supplyDefaults\n // because that restricts it to [0,1]\n cbAxisOut.position = opts.x + xpadFrac + thickFrac;\n\n // save for other callers to access this axis\n component.axis = cbAxisOut;\n\n if(['top', 'bottom'].indexOf(opts.titleside) !== -1) {\n cbAxisOut.titleside = opts.titleside;\n cbAxisOut.titlex = opts.x + xpadFrac;\n cbAxisOut.titley = yBottomFrac +\n (opts.titleside === 'top' ? lenFrac - ypadFrac : ypadFrac);\n }\n\n if(opts.line.color && opts.tickmode === 'auto') {\n cbAxisOut.tickmode = 'linear';\n cbAxisOut.tick0 = opts.levels.start;\n var dtick = opts.levels.size;\n // expand if too many contours, so we don't get too many ticks\n var autoNtick = Lib.constrain(\n (yBottomPx - yTopPx) / 50, 4, 15) + 1,\n dtFactor = (zrange[1] - zrange[0]) /\n ((opts.nticks || autoNtick) * dtick);\n if(dtFactor > 1) {\n var dtexp = Math.pow(10, Math.floor(\n Math.log(dtFactor) / Math.LN10));\n dtick *= dtexp * Lib.roundUp(dtFactor / dtexp, [2, 5, 10]);\n // if the contours are at round multiples, reset tick0\n // so they're still at round multiples. Otherwise,\n // keep the first label on the first contour level\n if((Math.abs(opts.levels.start) /\n opts.levels.size + 1e-6) % 1 < 2e-6) {\n cbAxisOut.tick0 = 0;\n }\n }\n cbAxisOut.dtick = dtick;\n }\n\n // set domain after init, because we may want to\n // allow it outside [0,1]\n cbAxisOut.domain = [\n yBottomFrac + ypadFrac,\n yBottomFrac + lenFrac - ypadFrac\n ];\n cbAxisOut.setScale();\n\n // now draw the elements\n var container = fullLayout._infolayer.selectAll('g.' + id).data([0]);\n container.enter().append('g').classed(id, true)\n .each(function() {\n var s = d3.select(this);\n s.append('rect').classed('cbbg', true);\n s.append('g').classed('cbfills', true);\n s.append('g').classed('cblines', true);\n s.append('g').classed('cbaxis', true).classed('crisp', true);\n s.append('g').classed('cbtitleunshift', true)\n .append('g').classed('cbtitle', true);\n s.append('rect').classed('cboutline', true);\n s.select('.cbtitle').datum(0);\n });\n container.attr('transform', 'translate(' + Math.round(gs.l) +\n ',' + Math.round(gs.t) + ')');\n // TODO: this opposite transform is a hack until we make it\n // more rational which items get this offset\n var titleCont = container.select('.cbtitleunshift')\n .attr('transform', 'translate(-' +\n Math.round(gs.l) + ',-' +\n Math.round(gs.t) + ')');\n\n cbAxisOut._axislayer = container.select('.cbaxis');\n var titleHeight = 0;\n if(['top', 'bottom'].indexOf(opts.titleside) !== -1) {\n // draw the title so we know how much room it needs\n // when we squish the axis. This one only applies to\n // top or bottom titles, not right side.\n var x = gs.l + (opts.x + xpadFrac) * gs.w,\n fontSize = cbAxisOut.titlefont.size,\n y;\n\n if(opts.titleside === 'top') {\n y = (1 - (yBottomFrac + lenFrac - ypadFrac)) * gs.h +\n gs.t + 3 + fontSize * 0.75;\n }\n else {\n y = (1 - (yBottomFrac + ypadFrac)) * gs.h +\n gs.t - 3 - fontSize * 0.25;\n }\n drawTitle(cbAxisOut._id + 'title', {\n attributes: {x: x, y: y, 'text-anchor': 'start'}\n });\n }\n\n function drawAxis() {\n if(['top', 'bottom'].indexOf(opts.titleside) !== -1) {\n // squish the axis top to make room for the title\n var titleGroup = container.select('.cbtitle'),\n titleText = titleGroup.select('text'),\n titleTrans =\n [-opts.outlinewidth / 2, opts.outlinewidth / 2],\n mathJaxNode = titleGroup\n .select('.h' + cbAxisOut._id + 'title-math-group')\n .node(),\n lineSize = 15.6;\n if(titleText.node()) {\n lineSize =\n parseInt(titleText.node().style.fontSize, 10) * LINE_SPACING;\n }\n if(mathJaxNode) {\n titleHeight = Drawing.bBox(mathJaxNode).height;\n if(titleHeight > lineSize) {\n // not entirely sure how mathjax is doing\n // vertical alignment, but this seems to work.\n titleTrans[1] -= (titleHeight - lineSize) / 2;\n }\n }\n else if(titleText.node() &&\n !titleText.classed('js-placeholder')) {\n titleHeight = Drawing.bBox(titleText.node()).height;\n }\n if(titleHeight) {\n // buffer btwn colorbar and title\n // TODO: configurable\n titleHeight += 5;\n\n if(opts.titleside === 'top') {\n cbAxisOut.domain[1] -= titleHeight / gs.h;\n titleTrans[1] *= -1;\n }\n else {\n cbAxisOut.domain[0] += titleHeight / gs.h;\n var nlines = svgTextUtils.lineCount(titleText);\n titleTrans[1] += (1 - nlines) * lineSize;\n }\n\n titleGroup.attr('transform',\n 'translate(' + titleTrans + ')');\n\n cbAxisOut.setScale();\n }\n }\n\n container.selectAll('.cbfills,.cblines,.cbaxis')\n .attr('transform', 'translate(0,' +\n Math.round(gs.h * (1 - cbAxisOut.domain[1])) + ')');\n\n var fills = container.select('.cbfills')\n .selectAll('rect.cbfill')\n .data(filllevels);\n fills.enter().append('rect')\n .classed('cbfill', true)\n .style('stroke', 'none');\n fills.exit().remove();\n fills.each(function(d, i) {\n var z = [\n (i === 0) ? zrange[0] :\n (filllevels[i] + filllevels[i - 1]) / 2,\n (i === filllevels.length - 1) ? zrange[1] :\n (filllevels[i] + filllevels[i + 1]) / 2\n ]\n .map(cbAxisOut.c2p)\n .map(Math.round);\n\n // offset the side adjoining the next rectangle so they\n // overlap, to prevent antialiasing gaps\n if(i !== filllevels.length - 1) {\n z[1] += (z[1] > z[0]) ? 1 : -1;\n }\n\n\n // Tinycolor can't handle exponents and\n // at this scale, removing it makes no difference.\n var colorString = fillcolormap(d).replace('e-', ''),\n opaqueColor = tinycolor(colorString).toHexString();\n\n // Colorbar cannot currently support opacities so we\n // use an opaque fill even when alpha channels present\n d3.select(this).attr({\n x: xLeft,\n width: Math.max(thickPx, 2),\n y: d3.min(z),\n height: Math.max(d3.max(z) - d3.min(z), 2),\n fill: opaqueColor\n });\n });\n\n var lines = container.select('.cblines')\n .selectAll('path.cbline')\n .data(opts.line.color && opts.line.width ?\n linelevels : []);\n lines.enter().append('path')\n .classed('cbline', true);\n lines.exit().remove();\n lines.each(function(d) {\n d3.select(this)\n .attr('d', 'M' + xLeft + ',' +\n (Math.round(cbAxisOut.c2p(d)) + (opts.line.width / 2) % 1) +\n 'h' + thickPx)\n .call(Drawing.lineGroupStyle,\n opts.line.width, linecolormap(d), opts.line.dash);\n });\n\n // force full redraw of labels and ticks\n cbAxisOut._axislayer.selectAll('g.' + cbAxisOut._id + 'tick,path')\n .remove();\n\n cbAxisOut._pos = xLeft + thickPx +\n (opts.outlinewidth||0) / 2 - (opts.ticks === 'outside' ? 1 : 0);\n cbAxisOut.side = 'right';\n\n // separate out axis and title drawing,\n // so we don't need such complicated logic in Titles.draw\n // if title is on the top or bottom, we've already drawn it\n // this title call only handles side=right\n return Lib.syncOrAsync([\n function() {\n return Axes.doTicks(gd, cbAxisOut, true);\n },\n function() {\n if(['top', 'bottom'].indexOf(opts.titleside) === -1) {\n var fontSize = cbAxisOut.titlefont.size,\n y = cbAxisOut._offset + cbAxisOut._length / 2,\n x = gs.l + (cbAxisOut.position || 0) * gs.w + ((cbAxisOut.side === 'right') ?\n 10 + fontSize * ((cbAxisOut.showticklabels ? 1 : 0.5)) :\n -10 - fontSize * ((cbAxisOut.showticklabels ? 0.5 : 0)));\n\n // the 'h' + is a hack to get around the fact that\n // convertToTspans rotates any 'y...' class by 90 degrees.\n // TODO: find a better way to control this.\n drawTitle('h' + cbAxisOut._id + 'title', {\n avoid: {\n selection: d3.select(gd).selectAll('g.' + cbAxisOut._id + 'tick'),\n side: opts.titleside,\n offsetLeft: gs.l,\n offsetTop: gs.t,\n maxShift: fullLayout.width\n },\n attributes: {x: x, y: y, 'text-anchor': 'middle'},\n transform: {rotate: '-90', offset: 0}\n });\n }\n }]);\n }\n\n function drawTitle(titleClass, titleOpts) {\n var trace = getTrace(),\n propName;\n if(Registry.traceIs(trace, 'markerColorscale')) {\n propName = 'marker.colorbar.title';\n }\n else propName = 'colorbar.title';\n\n var dfltTitleOpts = {\n propContainer: cbAxisOut,\n propName: propName,\n traceIndex: trace.index,\n dfltName: 'colorscale',\n containerGroup: container.select('.cbtitle')\n };\n\n // this class-to-rotate thing with convertToTspans is\n // getting hackier and hackier... delete groups with the\n // wrong class (in case earlier the colorbar was drawn on\n // a different side, I think?)\n var otherClass = titleClass.charAt(0) === 'h' ?\n titleClass.substr(1) : ('h' + titleClass);\n container.selectAll('.' + otherClass + ',.' + otherClass + '-math-group')\n .remove();\n\n Titles.draw(gd, titleClass,\n extendFlat(dfltTitleOpts, titleOpts || {}));\n }\n\n function positionCB() {\n // wait for the axis & title to finish rendering before\n // continuing positioning\n // TODO: why are we redrawing multiple times now with this?\n // I guess autoMargin doesn't like being post-promise?\n var innerWidth = thickPx + opts.outlinewidth / 2 +\n Drawing.bBox(cbAxisOut._axislayer.node()).width;\n titleEl = titleCont.select('text');\n if(titleEl.node() && !titleEl.classed('js-placeholder')) {\n var mathJaxNode = titleCont\n .select('.h' + cbAxisOut._id + 'title-math-group')\n .node(),\n titleWidth;\n if(mathJaxNode &&\n ['top', 'bottom'].indexOf(opts.titleside) !== -1) {\n titleWidth = Drawing.bBox(mathJaxNode).width;\n }\n else {\n // note: the formula below works for all titlesides,\n // (except for top/bottom mathjax, above)\n // but the weird gs.l is because the titleunshift\n // transform gets removed by Drawing.bBox\n titleWidth =\n Drawing.bBox(titleCont.node()).right -\n xLeft - gs.l;\n }\n innerWidth = Math.max(innerWidth, titleWidth);\n }\n\n var outerwidth = 2 * opts.xpad + innerWidth +\n opts.borderwidth + opts.outlinewidth / 2,\n outerheight = yBottomPx - yTopPx;\n\n container.select('.cbbg').attr({\n x: xLeft - opts.xpad -\n (opts.borderwidth + opts.outlinewidth) / 2,\n y: yTopPx - yExtraPx,\n width: Math.max(outerwidth, 2),\n height: Math.max(outerheight + 2 * yExtraPx, 2)\n })\n .call(Color.fill, opts.bgcolor)\n .call(Color.stroke, opts.bordercolor)\n .style({'stroke-width': opts.borderwidth});\n\n container.selectAll('.cboutline').attr({\n x: xLeft,\n y: yTopPx + opts.ypad +\n (opts.titleside === 'top' ? titleHeight : 0),\n width: Math.max(thickPx, 2),\n height: Math.max(outerheight - 2 * opts.ypad - titleHeight, 2)\n })\n .call(Color.stroke, opts.outlinecolor)\n .style({\n fill: 'None',\n 'stroke-width': opts.outlinewidth\n });\n\n // fix positioning for xanchor!='left'\n var xoffset = ({center: 0.5, right: 1}[opts.xanchor] || 0) *\n outerwidth;\n container.attr('transform',\n 'translate(' + (gs.l - xoffset) + ',' + gs.t + ')');\n\n // auto margin adjustment\n Plots.autoMargin(gd, id, {\n x: opts.x,\n y: opts.y,\n l: outerwidth * ({right: 1, center: 0.5}[opts.xanchor] || 0),\n r: outerwidth * ({left: 1, center: 0.5}[opts.xanchor] || 0),\n t: outerheight * ({bottom: 1, middle: 0.5}[opts.yanchor] || 0),\n b: outerheight * ({top: 1, middle: 0.5}[opts.yanchor] || 0)\n });\n }\n\n var cbDone = Lib.syncOrAsync([\n Plots.previousPromises,\n drawAxis,\n Plots.previousPromises,\n positionCB\n ], gd);\n\n if(cbDone && cbDone.then) (gd._promises || []).push(cbDone);\n\n // dragging...\n if(gd._context.edits.colorbarPosition) {\n var t0,\n xf,\n yf;\n\n dragElement.init({\n element: container.node(),\n gd: gd,\n prepFn: function() {\n t0 = container.attr('transform');\n setCursor(container);\n },\n moveFn: function(dx, dy) {\n container.attr('transform',\n t0 + ' ' + 'translate(' + dx + ',' + dy + ')');\n\n xf = dragElement.align(xLeftFrac + (dx / gs.w), thickFrac,\n 0, 1, opts.xanchor);\n yf = dragElement.align(yBottomFrac - (dy / gs.h), lenFrac,\n 0, 1, opts.yanchor);\n\n var csr = dragElement.getCursor(xf, yf,\n opts.xanchor, opts.yanchor);\n setCursor(container, csr);\n },\n doneFn: function(dragged) {\n setCursor(container);\n\n if(dragged && xf !== undefined && yf !== undefined) {\n Plotly.restyle(gd,\n {'colorbar.x': xf, 'colorbar.y': yf},\n getTrace().index);\n }\n }\n });\n }\n return cbDone;\n }\n\n function getTrace() {\n var idNum = id.substr(2),\n i,\n trace;\n for(i = 0; i < gd._fullData.length; i++) {\n trace = gd._fullData[i];\n if(trace.uid === idNum) return trace;\n }\n }\n\n // setter/getters for every item defined in opts\n Object.keys(opts).forEach(function(name) {\n component[name] = function(v) {\n // getter\n if(!arguments.length) return opts[name];\n\n // setter - for multi-part properties,\n // set only the parts that are provided\n opts[name] = Lib.isPlainObject(opts[name]) ?\n Lib.extendFlat(opts[name], v) :\n v;\n\n return component;\n };\n });\n\n // or use .options to set multiple options at once via a dictionary\n component.options = function(o) {\n Object.keys(o).forEach(function(name) {\n // in case something random comes through\n // that's not an option, ignore it\n if(typeof component[name] === 'function') {\n component[name](o[name]);\n }\n });\n return component;\n };\n\n component._opts = opts;\n\n return component;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/colorbar/draw.js\n// module id = 449\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Drawing = require('../../components/drawing');\nvar ErrorBars = require('../../components/errorbars');\n\n\nmodule.exports = function style(gd) {\n var s = d3.select(gd).selectAll('g.trace.scatter');\n\n s.style('opacity', function(d) {\n return d[0].trace.opacity;\n });\n\n s.selectAll('g.points')\n .each(function(d) {\n var el = d3.select(this);\n var pts = el.selectAll('path.point');\n var trace = d.trace || d[0].trace;\n\n pts.call(Drawing.pointStyle, trace, gd);\n\n el.selectAll('text')\n .call(Drawing.textPointStyle, trace, gd);\n });\n\n s.selectAll('g.trace path.js-line')\n .call(Drawing.lineGroupStyle);\n\n s.selectAll('g.trace path.js-fill')\n .call(Drawing.fillGroupStyle);\n\n s.call(ErrorBars.style);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/style.js\n// module id = 450\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Fx = require('../../components/fx');\nvar ErrorBars = require('../../components/errorbars');\nvar getTraceColor = require('./get_trace_color');\nvar Color = require('../../components/color');\nvar fillHoverText = require('./fill_hover_text');\n\nvar MAXDIST = Fx.constants.MAXDIST;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n var cd = pointData.cd,\n trace = cd[0].trace,\n xa = pointData.xa,\n ya = pointData.ya,\n xpx = xa.c2p(xval),\n ypx = ya.c2p(yval),\n pt = [xpx, ypx],\n hoveron = trace.hoveron || '';\n\n // look for points to hover on first, then take fills only if we\n // didn't find a point\n if(hoveron.indexOf('points') !== -1) {\n var dx = function(di) {\n // scatter points: d.mrc is the calculated marker radius\n // adjust the distance so if you're inside the marker it\n // always will show up regardless of point size, but\n // prioritize smaller points\n var rad = Math.max(3, di.mrc || 0);\n return Math.max(Math.abs(xa.c2p(di.x) - xpx) - rad, 1 - 3 / rad);\n },\n dy = function(di) {\n var rad = Math.max(3, di.mrc || 0);\n return Math.max(Math.abs(ya.c2p(di.y) - ypx) - rad, 1 - 3 / rad);\n },\n dxy = function(di) {\n var rad = Math.max(3, di.mrc || 0),\n dx = xa.c2p(di.x) - xpx,\n dy = ya.c2p(di.y) - ypx;\n return Math.max(Math.sqrt(dx * dx + dy * dy) - rad, 1 - 3 / rad);\n },\n distfn = Fx.getDistanceFunction(hovermode, dx, dy, dxy);\n\n Fx.getClosest(cd, distfn, pointData);\n\n // skip the rest (for this trace) if we didn't find a close point\n if(pointData.index !== false) {\n\n // the closest data point\n var di = cd[pointData.index],\n xc = xa.c2p(di.x, true),\n yc = ya.c2p(di.y, true),\n rad = di.mrc || 1;\n\n Lib.extendFlat(pointData, {\n color: getTraceColor(trace, di),\n\n x0: xc - rad,\n x1: xc + rad,\n xLabelVal: di.x,\n\n y0: yc - rad,\n y1: yc + rad,\n yLabelVal: di.y\n });\n\n fillHoverText(di, trace, pointData);\n ErrorBars.hoverInfo(di, trace, pointData);\n\n return [pointData];\n }\n }\n\n // even if hoveron is 'fills', only use it if we have polygons too\n if(hoveron.indexOf('fills') !== -1 && trace._polygons) {\n var polygons = trace._polygons,\n polygonsIn = [],\n inside = false,\n xmin = Infinity,\n xmax = -Infinity,\n ymin = Infinity,\n ymax = -Infinity,\n i, j, polygon, pts, xCross, x0, x1, y0, y1;\n\n for(i = 0; i < polygons.length; i++) {\n polygon = polygons[i];\n // TODO: this is not going to work right for curved edges, it will\n // act as though they're straight. That's probably going to need\n // the elements themselves to capture the events. Worth it?\n if(polygon.contains(pt)) {\n inside = !inside;\n // TODO: need better than just the overall bounding box\n polygonsIn.push(polygon);\n ymin = Math.min(ymin, polygon.ymin);\n ymax = Math.max(ymax, polygon.ymax);\n }\n }\n\n if(inside) {\n // constrain ymin/max to the visible plot, so the label goes\n // at the middle of the piece you can see\n ymin = Math.max(ymin, 0);\n ymax = Math.min(ymax, ya._length);\n\n // find the overall left-most and right-most points of the\n // polygon(s) we're inside at their combined vertical midpoint.\n // This is where we will draw the hover label.\n // Note that this might not be the vertical midpoint of the\n // whole trace, if it's disjoint.\n var yAvg = (ymin + ymax) / 2;\n for(i = 0; i < polygonsIn.length; i++) {\n pts = polygonsIn[i].pts;\n for(j = 1; j < pts.length; j++) {\n y0 = pts[j - 1][1];\n y1 = pts[j][1];\n if((y0 > yAvg) !== (y1 >= yAvg)) {\n x0 = pts[j - 1][0];\n x1 = pts[j][0];\n xCross = x0 + (x1 - x0) * (yAvg - y0) / (y1 - y0);\n xmin = Math.min(xmin, xCross);\n xmax = Math.max(xmax, xCross);\n }\n }\n }\n\n // constrain xmin/max to the visible plot now too\n xmin = Math.max(xmin, 0);\n xmax = Math.min(xmax, xa._length);\n\n // get only fill or line color for the hover color\n var color = Color.defaultLine;\n if(Color.opacity(trace.fillcolor)) color = trace.fillcolor;\n else if(Color.opacity((trace.line || {}).color)) {\n color = trace.line.color;\n }\n\n Lib.extendFlat(pointData, {\n // never let a 2D override 1D type as closest point\n distance: MAXDIST + 10,\n x0: xmin,\n x1: xmax,\n y0: yAvg,\n y1: yAvg,\n color: color\n });\n\n delete pointData.index;\n\n if(trace.text && !Array.isArray(trace.text)) {\n pointData.text = String(trace.text);\n }\n else pointData.text = trace.name;\n\n return [pointData];\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/hover.js\n// module id = 451\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = require('../../components/color');\nvar subtypes = require('./subtypes');\n\n\nmodule.exports = function getTraceColor(trace, di) {\n var lc, tc;\n\n // TODO: text modes\n\n if(trace.mode === 'lines') {\n lc = trace.line.color;\n return (lc && Color.opacity(lc)) ?\n lc : trace.fillcolor;\n }\n else if(trace.mode === 'none') {\n return trace.fill ? trace.fillcolor : '';\n }\n else {\n var mc = di.mcc || (trace.marker || {}).color,\n mlc = di.mlcc || ((trace.marker || {}).line || {}).color;\n\n tc = (mc && Color.opacity(mc)) ? mc :\n (mlc && Color.opacity(mlc) &&\n (di.mlw || ((trace.marker || {}).line || {}).width)) ? mlc : '';\n\n if(tc) {\n // make sure the points aren't TOO transparent\n if(Color.opacity(tc) < 0.3) {\n return Color.addOpacity(tc, 0.3);\n }\n else return tc;\n }\n else {\n lc = (trace.line || {}).color;\n return (lc && Color.opacity(lc) &&\n subtypes.hasLines(trace) && trace.line.width) ?\n lc : trace.fillcolor;\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/get_trace_color.js\n// module id = 452\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar subtypes = require('./subtypes');\nvar DESELECTDIM = require('../../constants/interactions').DESELECTDIM;\n\nmodule.exports = function selectPoints(searchInfo, polygon) {\n var cd = searchInfo.cd,\n xa = searchInfo.xaxis,\n ya = searchInfo.yaxis,\n selection = [],\n trace = cd[0].trace,\n marker = trace.marker,\n i,\n di,\n x,\n y;\n\n // TODO: include lines? that would require per-segment line properties\n var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace));\n if(hasOnlyLines) return [];\n\n var opacity = Array.isArray(marker.opacity) ? 1 : marker.opacity;\n\n if(polygon === false) { // clear selection\n for(i = 0; i < cd.length; i++) cd[i].dim = 0;\n }\n else {\n for(i = 0; i < cd.length; i++) {\n di = cd[i];\n x = xa.c2p(di.x);\n y = ya.c2p(di.y);\n\n if(polygon.contains([x, y])) {\n selection.push({\n pointNumber: i,\n x: di.x,\n y: di.y\n });\n di.dim = 0;\n }\n else di.dim = 1;\n }\n }\n\n // do the dimming here, as well as returning the selection\n // The logic here duplicates Drawing.pointStyle, but I don't want\n // d.dim in pointStyle in case something goes wrong with selection.\n cd[0].node3.selectAll('path.point')\n .style('opacity', function(d) {\n return ((d.mo + 1 || opacity + 1) - 1) * (d.dim ? DESELECTDIM : 1);\n });\n cd[0].node3.selectAll('text')\n .style('opacity', function(d) {\n return d.dim ? DESELECTDIM : 1;\n });\n\n return selection;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/scatter/select.js\n// module id = 453\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n xaxis: {\n valType: 'subplotid',\n \n dflt: 'x',\n editType: 'calc+clearAxisTypes',\n \n },\n yaxis: {\n valType: 'subplotid',\n \n dflt: 'y',\n editType: 'calc+clearAxisTypes',\n \n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/attributes.js\n// module id = 454\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Plotly = require('../../plotly');\nvar Registry = require('../../registry');\nvar Drawing = require('../../components/drawing');\nvar Axes = require('./axes');\nvar axisRegex = require('./constants').attrRegex;\n\nmodule.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = gd._fullLayout;\n var axes = [];\n\n function computeUpdates(layout) {\n var ai, attrList, match, axis, update;\n var updates = {};\n\n for(ai in layout) {\n attrList = ai.split('.');\n match = attrList[0].match(axisRegex);\n if(match) {\n var axisLetter = ai.charAt(0);\n var axisName = attrList[0];\n axis = fullLayout[axisName];\n update = {};\n\n if(Array.isArray(layout[ai])) {\n update.to = layout[ai].slice(0);\n } else {\n if(Array.isArray(layout[ai].range)) {\n update.to = layout[ai].range.slice(0);\n }\n }\n if(!update.to) continue;\n\n update.axisName = axisName;\n update.length = axis._length;\n\n axes.push(axisLetter);\n\n updates[axisLetter] = update;\n }\n }\n\n return updates;\n }\n\n function computeAffectedSubplots(fullLayout, updatedAxisIds, updates) {\n var plotName;\n var plotinfos = fullLayout._plots;\n var affectedSubplots = [];\n var toX, toY;\n\n for(plotName in plotinfos) {\n var plotinfo = plotinfos[plotName];\n\n if(affectedSubplots.indexOf(plotinfo) !== -1) continue;\n\n var x = plotinfo.xaxis._id;\n var y = plotinfo.yaxis._id;\n var fromX = plotinfo.xaxis.range;\n var fromY = plotinfo.yaxis.range;\n\n // Store the initial range at the beginning of this transition:\n plotinfo.xaxis._r = plotinfo.xaxis.range.slice();\n plotinfo.yaxis._r = plotinfo.yaxis.range.slice();\n\n if(updates[x]) {\n toX = updates[x].to;\n } else {\n toX = fromX;\n }\n if(updates[y]) {\n toY = updates[y].to;\n } else {\n toY = fromY;\n }\n\n if(fromX[0] === toX[0] && fromX[1] === toX[1] && fromY[0] === toY[0] && fromY[1] === toY[1]) continue;\n\n if(updatedAxisIds.indexOf(x) !== -1 || updatedAxisIds.indexOf(y) !== -1) {\n affectedSubplots.push(plotinfo);\n }\n }\n\n return affectedSubplots;\n }\n\n var updates = computeUpdates(newLayout);\n var updatedAxisIds = Object.keys(updates);\n var affectedSubplots = computeAffectedSubplots(fullLayout, updatedAxisIds, updates);\n\n function updateLayoutObjs() {\n function redrawObjs(objArray, method, shortCircuit) {\n for(var i = 0; i < objArray.length; i++) {\n method(gd, i);\n\n // once is enough for images (which doesn't use the `i` arg anyway)\n if(shortCircuit) return;\n }\n }\n\n redrawObjs(fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne'));\n redrawObjs(fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne'));\n redrawObjs(fullLayout.images || [], Registry.getComponentMethod('images', 'draw'), true);\n }\n\n if(!affectedSubplots.length) {\n updateLayoutObjs();\n return false;\n }\n\n function ticksAndAnnotations(xa, ya) {\n var activeAxIds = [],\n i;\n\n activeAxIds = [xa._id, ya._id];\n\n for(i = 0; i < activeAxIds.length; i++) {\n Axes.doTicks(gd, activeAxIds[i], true);\n }\n\n function redrawObjs(objArray, method, shortCircuit) {\n for(i = 0; i < objArray.length; i++) {\n var obji = objArray[i];\n\n if((activeAxIds.indexOf(obji.xref) !== -1) ||\n (activeAxIds.indexOf(obji.yref) !== -1)) {\n method(gd, i);\n }\n\n // once is enough for images (which doesn't use the `i` arg anyway)\n if(shortCircuit) return;\n }\n }\n\n redrawObjs(fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne'));\n redrawObjs(fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne'));\n redrawObjs(fullLayout.images || [], Registry.getComponentMethod('images', 'draw'), true);\n }\n\n function unsetSubplotTransform(subplot) {\n var xa2 = subplot.xaxis;\n var ya2 = subplot.yaxis;\n\n fullLayout._defs.select('#' + subplot.clipId + '> rect')\n .call(Drawing.setTranslate, 0, 0)\n .call(Drawing.setScale, 1, 1);\n\n subplot.plot\n .call(Drawing.setTranslate, xa2._offset, ya2._offset)\n .call(Drawing.setScale, 1, 1);\n\n var scatterPoints = subplot.plot.select('.scatterlayer').selectAll('.points');\n\n // This is specifically directed at scatter traces, applying an inverse\n // scale to individual points to counteract the scale of the trace\n // as a whole:\n scatterPoints.selectAll('.point')\n .call(Drawing.setPointGroupScale, 1, 1)\n .call(Drawing.hideOutsideRangePoints, subplot);\n\n scatterPoints.selectAll('.textpoint')\n .call(Drawing.setTextPointsScale, 1, 1)\n .call(Drawing.hideOutsideRangePoints, subplot);\n }\n\n function updateSubplot(subplot, progress) {\n var axis, r0, r1;\n var xUpdate = updates[subplot.xaxis._id];\n var yUpdate = updates[subplot.yaxis._id];\n\n var viewBox = [];\n\n if(xUpdate) {\n axis = gd._fullLayout[xUpdate.axisName];\n r0 = axis._r;\n r1 = xUpdate.to;\n viewBox[0] = (r0[0] * (1 - progress) + progress * r1[0] - r0[0]) / (r0[1] - r0[0]) * subplot.xaxis._length;\n var dx1 = r0[1] - r0[0];\n var dx2 = r1[1] - r1[0];\n\n axis.range[0] = r0[0] * (1 - progress) + progress * r1[0];\n axis.range[1] = r0[1] * (1 - progress) + progress * r1[1];\n\n viewBox[2] = subplot.xaxis._length * ((1 - progress) + progress * dx2 / dx1);\n } else {\n viewBox[0] = 0;\n viewBox[2] = subplot.xaxis._length;\n }\n\n if(yUpdate) {\n axis = gd._fullLayout[yUpdate.axisName];\n r0 = axis._r;\n r1 = yUpdate.to;\n viewBox[1] = (r0[1] * (1 - progress) + progress * r1[1] - r0[1]) / (r0[0] - r0[1]) * subplot.yaxis._length;\n var dy1 = r0[1] - r0[0];\n var dy2 = r1[1] - r1[0];\n\n axis.range[0] = r0[0] * (1 - progress) + progress * r1[0];\n axis.range[1] = r0[1] * (1 - progress) + progress * r1[1];\n\n viewBox[3] = subplot.yaxis._length * ((1 - progress) + progress * dy2 / dy1);\n } else {\n viewBox[1] = 0;\n viewBox[3] = subplot.yaxis._length;\n }\n\n ticksAndAnnotations(subplot.xaxis, subplot.yaxis);\n\n var xa2 = subplot.xaxis;\n var ya2 = subplot.yaxis;\n\n var editX = !!xUpdate;\n var editY = !!yUpdate;\n\n var xScaleFactor = editX ? xa2._length / viewBox[2] : 1,\n yScaleFactor = editY ? ya2._length / viewBox[3] : 1;\n\n var clipDx = editX ? viewBox[0] : 0,\n clipDy = editY ? viewBox[1] : 0;\n\n var fracDx = editX ? (viewBox[0] / viewBox[2] * xa2._length) : 0,\n fracDy = editY ? (viewBox[1] / viewBox[3] * ya2._length) : 0;\n\n var plotDx = xa2._offset - fracDx,\n plotDy = ya2._offset - fracDy;\n\n fullLayout._defs.select('#' + subplot.clipId + '> rect')\n .call(Drawing.setTranslate, clipDx, clipDy)\n .call(Drawing.setScale, 1 / xScaleFactor, 1 / yScaleFactor);\n\n subplot.plot\n .call(Drawing.setTranslate, plotDx, plotDy)\n .call(Drawing.setScale, xScaleFactor, yScaleFactor)\n\n // This is specifically directed at scatter traces, applying an inverse\n // scale to individual points to counteract the scale of the trace\n // as a whole:\n .selectAll('.points').selectAll('.point')\n .call(Drawing.setPointGroupScale, 1 / xScaleFactor, 1 / yScaleFactor);\n\n subplot.plot.selectAll('.points').selectAll('.textpoint')\n .call(Drawing.setTextPointsScale, 1 / xScaleFactor, 1 / yScaleFactor);\n }\n\n var onComplete;\n if(makeOnCompleteCallback) {\n // This module makes the choice whether or not it notifies Plotly.transition\n // about completion:\n onComplete = makeOnCompleteCallback();\n }\n\n function transitionComplete() {\n var aobj = {};\n for(var i = 0; i < updatedAxisIds.length; i++) {\n var axi = gd._fullLayout[updates[updatedAxisIds[i]].axisName];\n var to = updates[updatedAxisIds[i]].to;\n aobj[axi._name + '.range[0]'] = to[0];\n aobj[axi._name + '.range[1]'] = to[1];\n\n axi.range = to.slice();\n }\n\n // Signal that this transition has completed:\n onComplete && onComplete();\n\n return Plotly.relayout(gd, aobj).then(function() {\n for(var i = 0; i < affectedSubplots.length; i++) {\n unsetSubplotTransform(affectedSubplots[i]);\n }\n });\n }\n\n function transitionInterrupt() {\n var aobj = {};\n for(var i = 0; i < updatedAxisIds.length; i++) {\n var axi = gd._fullLayout[updatedAxisIds[i] + 'axis'];\n aobj[axi._name + '.range[0]'] = axi.range[0];\n aobj[axi._name + '.range[1]'] = axi.range[1];\n\n axi.range = axi._r.slice();\n }\n\n return Plotly.relayout(gd, aobj).then(function() {\n for(var i = 0; i < affectedSubplots.length; i++) {\n unsetSubplotTransform(affectedSubplots[i]);\n }\n });\n }\n\n var t1, t2, raf;\n var easeFn = d3.ease(transitionOpts.easing);\n\n gd._transitionData._interruptCallbacks.push(function() {\n window.cancelAnimationFrame(raf);\n raf = null;\n return transitionInterrupt();\n });\n\n function doFrame() {\n t2 = Date.now();\n\n var tInterp = Math.min(1, (t2 - t1) / transitionOpts.duration);\n var progress = easeFn(tInterp);\n\n for(var i = 0; i < affectedSubplots.length; i++) {\n updateSubplot(affectedSubplots[i], progress);\n }\n\n if(t2 - t1 > transitionOpts.duration) {\n transitionComplete();\n raf = window.cancelAnimationFrame(doFrame);\n } else {\n raf = window.requestAnimationFrame(doFrame);\n }\n }\n\n t1 = Date.now();\n raf = window.requestAnimationFrame(doFrame);\n\n return Promise.resolve();\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/cartesian/transition_axes.js\n// module id = 455\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n moduleType: 'component',\n name: 'legend',\n\n layoutAttributes: require('./attributes'),\n supplyLayoutDefaults: require('./defaults'),\n\n draw: require('./draw'),\n style: require('./style')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/index.js\n// module id = 456\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../../registry');\nvar Lib = require('../../lib');\n\nvar attributes = require('./attributes');\nvar basePlotLayoutAttributes = require('../../plots/layout_attributes');\nvar helpers = require('./helpers');\n\n\nmodule.exports = function legendDefaults(layoutIn, layoutOut, fullData) {\n var containerIn = layoutIn.legend || {},\n containerOut = layoutOut.legend = {};\n\n var visibleTraces = 0,\n defaultOrder = 'normal',\n defaultX,\n defaultY,\n defaultXAnchor,\n defaultYAnchor;\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n\n if(helpers.legendGetsTrace(trace)) {\n visibleTraces++;\n // always show the legend by default if there's a pie\n if(Registry.traceIs(trace, 'pie')) visibleTraces++;\n }\n\n if((Registry.traceIs(trace, 'bar') && layoutOut.barmode === 'stack') ||\n ['tonextx', 'tonexty'].indexOf(trace.fill) !== -1) {\n defaultOrder = helpers.isGrouped({traceorder: defaultOrder}) ?\n 'grouped+reversed' : 'reversed';\n }\n\n if(trace.legendgroup !== undefined && trace.legendgroup !== '') {\n defaultOrder = helpers.isReversed({traceorder: defaultOrder}) ?\n 'reversed+grouped' : 'grouped';\n }\n }\n\n function coerce(attr, dflt) {\n return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);\n }\n\n var showLegend = Lib.coerce(layoutIn, layoutOut,\n basePlotLayoutAttributes, 'showlegend', visibleTraces > 1);\n\n if(showLegend === false) return;\n\n coerce('bgcolor', layoutOut.paper_bgcolor);\n coerce('bordercolor');\n coerce('borderwidth');\n Lib.coerceFont(coerce, 'font', layoutOut.font);\n\n coerce('orientation');\n if(containerOut.orientation === 'h') {\n var xaxis = layoutIn.xaxis;\n if(xaxis && xaxis.rangeslider && xaxis.rangeslider.visible) {\n defaultX = 0;\n defaultXAnchor = 'left';\n defaultY = 1.1;\n defaultYAnchor = 'bottom';\n }\n else {\n defaultX = 0;\n defaultXAnchor = 'left';\n defaultY = -0.1;\n defaultYAnchor = 'top';\n }\n }\n\n coerce('traceorder', defaultOrder);\n if(helpers.isGrouped(layoutOut.legend)) coerce('tracegroupgap');\n\n coerce('x', defaultX);\n coerce('xanchor', defaultXAnchor);\n coerce('y', defaultY);\n coerce('yanchor', defaultYAnchor);\n Lib.noneOrAll(containerIn, containerOut, ['x', 'y']);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/defaults.js\n// module id = 457\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Plotly = require('../../plotly');\nvar Lib = require('../../lib');\nvar Plots = require('../../plots/plots');\nvar Registry = require('../../registry');\nvar dragElement = require('../dragelement');\nvar Drawing = require('../drawing');\nvar Color = require('../color');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar handleClick = require('./handle_click');\n\nvar constants = require('./constants');\nvar interactConstants = require('../../constants/interactions');\nvar LINE_SPACING = require('../../constants/alignment').LINE_SPACING;\n\nvar getLegendData = require('./get_legend_data');\nvar style = require('./style');\nvar helpers = require('./helpers');\nvar anchorUtils = require('./anchor_utils');\n\nvar DBLCLICKDELAY = interactConstants.DBLCLICKDELAY;\n\nmodule.exports = function draw(gd) {\n var fullLayout = gd._fullLayout;\n var clipId = 'legend' + fullLayout._uid;\n\n if(!fullLayout._infolayer || !gd.calcdata) return;\n\n if(!gd._legendMouseDownTime) gd._legendMouseDownTime = 0;\n\n var opts = fullLayout.legend,\n legendData = fullLayout.showlegend && getLegendData(gd.calcdata, opts),\n hiddenSlices = fullLayout.hiddenlabels || [];\n\n if(!fullLayout.showlegend || !legendData.length) {\n fullLayout._infolayer.selectAll('.legend').remove();\n fullLayout._topdefs.select('#' + clipId).remove();\n\n Plots.autoMargin(gd, 'legend');\n return;\n }\n\n var legend = fullLayout._infolayer.selectAll('g.legend')\n .data([0]);\n\n legend.enter().append('g')\n .attr({\n 'class': 'legend',\n 'pointer-events': 'all'\n });\n\n var clipPath = fullLayout._topdefs.selectAll('#' + clipId)\n .data([0]);\n\n clipPath.enter().append('clipPath')\n .attr('id', clipId)\n .append('rect');\n\n var bg = legend.selectAll('rect.bg')\n .data([0]);\n\n bg.enter().append('rect').attr({\n 'class': 'bg',\n 'shape-rendering': 'crispEdges'\n });\n\n bg.call(Color.stroke, opts.bordercolor);\n bg.call(Color.fill, opts.bgcolor);\n bg.style('stroke-width', opts.borderwidth + 'px');\n\n var scrollBox = legend.selectAll('g.scrollbox')\n .data([0]);\n\n scrollBox.enter().append('g')\n .attr('class', 'scrollbox');\n\n var scrollBar = legend.selectAll('rect.scrollbar')\n .data([0]);\n\n scrollBar.enter().append('rect')\n .attr({\n 'class': 'scrollbar',\n 'rx': 20,\n 'ry': 2,\n 'width': 0,\n 'height': 0\n })\n .call(Color.fill, '#808BA4');\n\n var groups = scrollBox.selectAll('g.groups')\n .data(legendData);\n\n groups.enter().append('g')\n .attr('class', 'groups');\n\n groups.exit().remove();\n\n var traces = groups.selectAll('g.traces')\n .data(Lib.identity);\n\n traces.enter().append('g').attr('class', 'traces');\n traces.exit().remove();\n\n traces.call(style, gd)\n .style('opacity', function(d) {\n var trace = d[0].trace;\n if(Registry.traceIs(trace, 'pie')) {\n return hiddenSlices.indexOf(d[0].label) !== -1 ? 0.5 : 1;\n } else {\n return trace.visible === 'legendonly' ? 0.5 : 1;\n }\n })\n .each(function() {\n d3.select(this)\n .call(drawTexts, gd)\n .call(setupTraceToggle, gd);\n });\n\n var firstRender = legend.enter().size() !== 0;\n if(firstRender) {\n computeLegendDimensions(gd, groups, traces);\n expandMargin(gd);\n }\n\n // Position and size the legend\n var lxMin = 0,\n lxMax = fullLayout.width,\n lyMin = 0,\n lyMax = fullLayout.height;\n\n computeLegendDimensions(gd, groups, traces);\n\n if(opts.height > lyMax) {\n // If the legend doesn't fit in the plot area,\n // do not expand the vertical margins.\n expandHorizontalMargin(gd);\n } else {\n expandMargin(gd);\n }\n\n // Scroll section must be executed after repositionLegend.\n // It requires the legend width, height, x and y to position the scrollbox\n // and these values are mutated in repositionLegend.\n var gs = fullLayout._size,\n lx = gs.l + gs.w * opts.x,\n ly = gs.t + gs.h * (1 - opts.y);\n\n if(anchorUtils.isRightAnchor(opts)) {\n lx -= opts.width;\n }\n else if(anchorUtils.isCenterAnchor(opts)) {\n lx -= opts.width / 2;\n }\n\n if(anchorUtils.isBottomAnchor(opts)) {\n ly -= opts.height;\n }\n else if(anchorUtils.isMiddleAnchor(opts)) {\n ly -= opts.height / 2;\n }\n\n // Make sure the legend left and right sides are visible\n var legendWidth = opts.width,\n legendWidthMax = gs.w;\n\n if(legendWidth > legendWidthMax) {\n lx = gs.l;\n legendWidth = legendWidthMax;\n }\n else {\n if(lx + legendWidth > lxMax) lx = lxMax - legendWidth;\n if(lx < lxMin) lx = lxMin;\n legendWidth = Math.min(lxMax - lx, opts.width);\n }\n\n // Make sure the legend top and bottom are visible\n // (legends with a scroll bar are not allowed to stretch beyond the extended\n // margins)\n var legendHeight = opts.height,\n legendHeightMax = gs.h;\n\n if(legendHeight > legendHeightMax) {\n ly = gs.t;\n legendHeight = legendHeightMax;\n }\n else {\n if(ly + legendHeight > lyMax) ly = lyMax - legendHeight;\n if(ly < lyMin) ly = lyMin;\n legendHeight = Math.min(lyMax - ly, opts.height);\n }\n\n // Set size and position of all the elements that make up a legend:\n // legend, background and border, scroll box and scroll bar\n Drawing.setTranslate(legend, lx, ly);\n\n var scrollBarYMax = legendHeight -\n constants.scrollBarHeight -\n 2 * constants.scrollBarMargin,\n scrollBoxYMax = opts.height - legendHeight,\n scrollBarY,\n scrollBoxY;\n\n if(opts.height <= legendHeight || gd._context.staticPlot) {\n // if scrollbar should not be shown.\n bg.attr({\n width: legendWidth - opts.borderwidth,\n height: legendHeight - opts.borderwidth,\n x: opts.borderwidth / 2,\n y: opts.borderwidth / 2\n });\n\n Drawing.setTranslate(scrollBox, 0, 0);\n\n clipPath.select('rect').attr({\n width: legendWidth - 2 * opts.borderwidth,\n height: legendHeight - 2 * opts.borderwidth,\n x: opts.borderwidth,\n y: opts.borderwidth\n });\n\n scrollBox.call(Drawing.setClipUrl, clipId);\n }\n else {\n scrollBarY = constants.scrollBarMargin,\n scrollBoxY = scrollBox.attr('data-scroll') || 0;\n\n // increase the background and clip-path width\n // by the scrollbar width and margin\n bg.attr({\n width: legendWidth -\n 2 * opts.borderwidth +\n constants.scrollBarWidth +\n constants.scrollBarMargin,\n height: legendHeight - opts.borderwidth,\n x: opts.borderwidth / 2,\n y: opts.borderwidth / 2\n });\n\n clipPath.select('rect').attr({\n width: legendWidth -\n 2 * opts.borderwidth +\n constants.scrollBarWidth +\n constants.scrollBarMargin,\n height: legendHeight - 2 * opts.borderwidth,\n x: opts.borderwidth,\n y: opts.borderwidth - scrollBoxY\n });\n\n scrollBox.call(Drawing.setClipUrl, clipId);\n\n if(firstRender) scrollHandler(scrollBarY, scrollBoxY);\n\n legend.on('wheel', null); // to be safe, remove previous listeners\n legend.on('wheel', function() {\n scrollBoxY = Lib.constrain(\n scrollBox.attr('data-scroll') -\n d3.event.deltaY / scrollBarYMax * scrollBoxYMax,\n -scrollBoxYMax, 0);\n scrollBarY = constants.scrollBarMargin -\n scrollBoxY / scrollBoxYMax * scrollBarYMax;\n scrollHandler(scrollBarY, scrollBoxY);\n if(scrollBoxY !== 0 && scrollBoxY !== -scrollBoxYMax) {\n d3.event.preventDefault();\n }\n });\n\n // to be safe, remove previous listeners\n scrollBar.on('.drag', null);\n scrollBox.on('.drag', null);\n\n var drag = d3.behavior.drag().on('drag', function() {\n scrollBarY = Lib.constrain(\n d3.event.y - constants.scrollBarHeight / 2,\n constants.scrollBarMargin,\n constants.scrollBarMargin + scrollBarYMax);\n scrollBoxY = - (scrollBarY - constants.scrollBarMargin) /\n scrollBarYMax * scrollBoxYMax;\n scrollHandler(scrollBarY, scrollBoxY);\n });\n\n scrollBar.call(drag);\n scrollBox.call(drag);\n }\n\n\n function scrollHandler(scrollBarY, scrollBoxY) {\n scrollBox\n .attr('data-scroll', scrollBoxY)\n .call(Drawing.setTranslate, 0, scrollBoxY);\n\n scrollBar.call(\n Drawing.setRect,\n legendWidth,\n scrollBarY,\n constants.scrollBarWidth,\n constants.scrollBarHeight\n );\n clipPath.select('rect').attr({\n y: opts.borderwidth - scrollBoxY\n });\n }\n\n if(gd._context.edits.legendPosition) {\n var xf, yf, x0, y0;\n\n legend.classed('cursor-move', true);\n\n dragElement.init({\n element: legend.node(),\n gd: gd,\n prepFn: function() {\n var transform = Drawing.getTranslate(legend);\n\n x0 = transform.x;\n y0 = transform.y;\n },\n moveFn: function(dx, dy) {\n var newX = x0 + dx,\n newY = y0 + dy;\n\n Drawing.setTranslate(legend, newX, newY);\n\n xf = dragElement.align(newX, 0, gs.l, gs.l + gs.w, opts.xanchor);\n yf = dragElement.align(newY, 0, gs.t + gs.h, gs.t, opts.yanchor);\n },\n doneFn: function(dragged, numClicks, e) {\n if(dragged && xf !== undefined && yf !== undefined) {\n Plotly.relayout(gd, {'legend.x': xf, 'legend.y': yf});\n } else {\n var clickedTrace =\n fullLayout._infolayer.selectAll('g.traces').filter(function() {\n var bbox = this.getBoundingClientRect();\n return (e.clientX >= bbox.left && e.clientX <= bbox.right &&\n e.clientY >= bbox.top && e.clientY <= bbox.bottom);\n });\n if(clickedTrace.size() > 0) {\n if(numClicks === 1) {\n legend._clickTimeout = setTimeout(function() { handleClick(clickedTrace, gd, numClicks); }, DBLCLICKDELAY);\n } else if(numClicks === 2) {\n if(legend._clickTimeout) {\n clearTimeout(legend._clickTimeout);\n }\n handleClick(clickedTrace, gd, numClicks);\n }\n }\n }\n }\n });\n }\n};\n\nfunction drawTexts(g, gd) {\n var legendItem = g.data()[0][0],\n fullLayout = gd._fullLayout,\n trace = legendItem.trace,\n isPie = Registry.traceIs(trace, 'pie'),\n traceIndex = trace.index,\n name = isPie ? legendItem.label : trace.name;\n\n var text = g.selectAll('text.legendtext')\n .data([0]);\n\n text.enter().append('text').classed('legendtext', true);\n\n text.attr('text-anchor', 'start')\n .classed('user-select-none', true)\n .call(Drawing.font, fullLayout.legend.font)\n .text(name);\n\n function textLayout(s) {\n svgTextUtils.convertToTspans(s, gd, function() {\n computeTextDimensions(g, gd);\n });\n }\n\n if(gd._context.edits.legendText && !isPie) {\n text.call(svgTextUtils.makeEditable, {gd: gd})\n .call(textLayout)\n .on('edit', function(text) {\n this.text(text)\n .call(textLayout);\n\n var origText = text;\n\n if(!this.text()) text = ' \\u0020\\u0020 ';\n\n var transforms, direction;\n var fullInput = legendItem.trace._fullInput || {};\n var update = {};\n\n // N.B. this block isn't super clean,\n // is unfortunately untested at the moment,\n // and only works for for 'ohlc' and 'candlestick',\n // but should be generalized for other one-to-many transforms\n if(['ohlc', 'candlestick'].indexOf(fullInput.type) !== -1) {\n transforms = legendItem.trace.transforms;\n direction = transforms[transforms.length - 1].direction;\n\n update[direction + '.name'] = text;\n } else if(Registry.hasTransform(fullInput, 'groupby')) {\n var groupbyIndices = Registry.getTransformIndices(fullInput, 'groupby');\n var index = groupbyIndices[groupbyIndices.length - 1];\n\n var kcont = Lib.keyedContainer(fullInput, 'transforms[' + index + '].styles', 'target', 'value.name');\n\n if(origText === '') {\n kcont.remove(legendItem.trace._group);\n } else {\n kcont.set(legendItem.trace._group, text);\n }\n\n update = kcont.constructUpdate();\n } else {\n update.name = text;\n }\n\n return Plotly.restyle(gd, update, traceIndex);\n });\n } else {\n text.call(textLayout);\n }\n}\n\nfunction setupTraceToggle(g, gd) {\n var newMouseDownTime,\n numClicks = 1;\n\n var traceToggle = g.selectAll('rect')\n .data([0]);\n\n traceToggle.enter().append('rect')\n .classed('legendtoggle', true)\n .style('cursor', 'pointer')\n .attr('pointer-events', 'all')\n .call(Color.fill, 'rgba(0,0,0,0)');\n\n\n traceToggle.on('mousedown', function() {\n newMouseDownTime = (new Date()).getTime();\n if(newMouseDownTime - gd._legendMouseDownTime < DBLCLICKDELAY) {\n // in a click train\n numClicks += 1;\n }\n else {\n // new click train\n numClicks = 1;\n gd._legendMouseDownTime = newMouseDownTime;\n }\n });\n traceToggle.on('mouseup', function() {\n if(gd._dragged || gd._editing) return;\n var legend = gd._fullLayout.legend;\n\n if((new Date()).getTime() - gd._legendMouseDownTime > DBLCLICKDELAY) {\n numClicks = Math.max(numClicks - 1, 1);\n }\n\n if(numClicks === 1) {\n legend._clickTimeout = setTimeout(function() { handleClick(g, gd, numClicks); }, DBLCLICKDELAY);\n } else if(numClicks === 2) {\n if(legend._clickTimeout) {\n clearTimeout(legend._clickTimeout);\n }\n gd._legendMouseDownTime = 0;\n handleClick(g, gd, numClicks);\n }\n });\n}\n\nfunction computeTextDimensions(g, gd) {\n var legendItem = g.data()[0][0];\n\n if(!legendItem.trace.showlegend) {\n g.remove();\n return;\n }\n\n var mathjaxGroup = g.select('g[class*=math-group]');\n var mathjaxNode = mathjaxGroup.node();\n var opts = gd._fullLayout.legend;\n var lineHeight = opts.font.size * LINE_SPACING;\n var height, width;\n\n if(mathjaxNode) {\n var mathjaxBB = Drawing.bBox(mathjaxNode);\n\n height = mathjaxBB.height;\n width = mathjaxBB.width;\n\n Drawing.setTranslate(mathjaxGroup, 0, (height / 4));\n }\n else {\n var text = g.select('.legendtext');\n var textLines = svgTextUtils.lineCount(text);\n var textNode = text.node();\n\n height = lineHeight * textLines;\n width = textNode ? Drawing.bBox(textNode).width : 0;\n\n // approximation to height offset to center the font\n // to avoid getBoundingClientRect\n var textY = lineHeight * (0.3 + (1 - textLines) / 2);\n // TODO: this 40 should go in a constants file (along with other\n // values related to the legend symbol size)\n svgTextUtils.positionText(text, 40, textY);\n }\n\n height = Math.max(height, 16) + 3;\n\n legendItem.height = height;\n legendItem.width = width;\n}\n\nfunction computeLegendDimensions(gd, groups, traces) {\n var fullLayout = gd._fullLayout;\n var opts = fullLayout.legend;\n var borderwidth = opts.borderwidth;\n var isGrouped = helpers.isGrouped(opts);\n\n var extraWidth = 0;\n\n opts.width = 0;\n opts.height = 0;\n\n if(helpers.isVertical(opts)) {\n if(isGrouped) {\n groups.each(function(d, i) {\n Drawing.setTranslate(this, 0, i * opts.tracegroupgap);\n });\n }\n\n traces.each(function(d) {\n var legendItem = d[0],\n textHeight = legendItem.height,\n textWidth = legendItem.width;\n\n Drawing.setTranslate(this,\n borderwidth,\n (5 + borderwidth + opts.height + textHeight / 2));\n\n opts.height += textHeight;\n opts.width = Math.max(opts.width, textWidth);\n });\n\n opts.width += 45 + borderwidth * 2;\n opts.height += 10 + borderwidth * 2;\n\n if(isGrouped) {\n opts.height += (opts._lgroupsLength - 1) * opts.tracegroupgap;\n }\n\n extraWidth = 40;\n }\n else if(isGrouped) {\n var groupXOffsets = [opts.width],\n groupData = groups.data();\n\n for(var i = 0, n = groupData.length; i < n; i++) {\n var textWidths = groupData[i].map(function(legendItemArray) {\n return legendItemArray[0].width;\n });\n\n var groupWidth = 40 + Math.max.apply(null, textWidths);\n\n opts.width += opts.tracegroupgap + groupWidth;\n\n groupXOffsets.push(opts.width);\n }\n\n groups.each(function(d, i) {\n Drawing.setTranslate(this, groupXOffsets[i], 0);\n });\n\n groups.each(function() {\n var group = d3.select(this),\n groupTraces = group.selectAll('g.traces'),\n groupHeight = 0;\n\n groupTraces.each(function(d) {\n var legendItem = d[0],\n textHeight = legendItem.height;\n\n Drawing.setTranslate(this,\n 0,\n (5 + borderwidth + groupHeight + textHeight / 2));\n\n groupHeight += textHeight;\n });\n\n opts.height = Math.max(opts.height, groupHeight);\n });\n\n opts.height += 10 + borderwidth * 2;\n opts.width += borderwidth * 2;\n }\n else {\n var rowHeight = 0,\n maxTraceHeight = 0,\n maxTraceWidth = 0,\n offsetX = 0;\n\n // calculate largest width for traces and use for width of all legend items\n traces.each(function(d) {\n maxTraceWidth = Math.max(40 + d[0].width, maxTraceWidth);\n });\n\n traces.each(function(d) {\n var legendItem = d[0],\n traceWidth = maxTraceWidth,\n traceGap = opts.tracegroupgap || 5;\n\n if((borderwidth + offsetX + traceGap + traceWidth) > (fullLayout.width - (fullLayout.margin.r + fullLayout.margin.l))) {\n offsetX = 0;\n rowHeight = rowHeight + maxTraceHeight;\n opts.height = opts.height + maxTraceHeight;\n // reset for next row\n maxTraceHeight = 0;\n }\n\n Drawing.setTranslate(this,\n (borderwidth + offsetX),\n (5 + borderwidth + legendItem.height / 2) + rowHeight);\n\n opts.width += traceGap + traceWidth;\n opts.height = Math.max(opts.height, legendItem.height);\n\n // keep track of tallest trace in group\n offsetX += traceGap + traceWidth;\n maxTraceHeight = Math.max(legendItem.height, maxTraceHeight);\n });\n\n opts.width += borderwidth * 2;\n opts.height += 10 + borderwidth * 2;\n\n }\n\n // make sure we're only getting full pixels\n opts.width = Math.ceil(opts.width);\n opts.height = Math.ceil(opts.height);\n\n traces.each(function(d) {\n var legendItem = d[0],\n bg = d3.select(this).select('.legendtoggle');\n\n bg.call(Drawing.setRect,\n 0,\n -legendItem.height / 2,\n (gd._context.edits.legendText ? 0 : opts.width) + extraWidth,\n legendItem.height\n );\n });\n}\n\nfunction expandMargin(gd) {\n var fullLayout = gd._fullLayout,\n opts = fullLayout.legend;\n\n var xanchor = 'left';\n if(anchorUtils.isRightAnchor(opts)) {\n xanchor = 'right';\n }\n else if(anchorUtils.isCenterAnchor(opts)) {\n xanchor = 'center';\n }\n\n var yanchor = 'top';\n if(anchorUtils.isBottomAnchor(opts)) {\n yanchor = 'bottom';\n }\n else if(anchorUtils.isMiddleAnchor(opts)) {\n yanchor = 'middle';\n }\n\n // lastly check if the margin auto-expand has changed\n Plots.autoMargin(gd, 'legend', {\n x: opts.x,\n y: opts.y,\n l: opts.width * ({right: 1, center: 0.5}[xanchor] || 0),\n r: opts.width * ({left: 1, center: 0.5}[xanchor] || 0),\n b: opts.height * ({top: 1, middle: 0.5}[yanchor] || 0),\n t: opts.height * ({bottom: 1, middle: 0.5}[yanchor] || 0)\n });\n}\n\nfunction expandHorizontalMargin(gd) {\n var fullLayout = gd._fullLayout,\n opts = fullLayout.legend;\n\n var xanchor = 'left';\n if(anchorUtils.isRightAnchor(opts)) {\n xanchor = 'right';\n }\n else if(anchorUtils.isCenterAnchor(opts)) {\n xanchor = 'center';\n }\n\n // lastly check if the margin auto-expand has changed\n Plots.autoMargin(gd, 'legend', {\n x: opts.x,\n y: 0.5,\n l: opts.width * ({right: 1, center: 0.5}[xanchor] || 0),\n r: opts.width * ({left: 1, center: 0.5}[xanchor] || 0),\n b: 0,\n t: 0\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/draw.js\n// module id = 458\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Plotly = require('../../plotly');\nvar Lib = require('../../lib');\nvar Registry = require('../../registry');\n\nvar SHOWISOLATETIP = true;\n\nmodule.exports = function handleClick(g, gd, numClicks) {\n if(gd._dragged || gd._editing) return;\n\n var hiddenSlices = gd._fullLayout.hiddenlabels ?\n gd._fullLayout.hiddenlabels.slice() :\n [];\n\n var legendItem = g.data()[0][0];\n var fullData = gd._fullData;\n var fullTrace = legendItem.trace;\n var legendgroup = fullTrace.legendgroup;\n\n var i, j, kcont, key, keys, val;\n var attrUpdate = {};\n var attrIndices = [];\n var carrs = [];\n var carrIdx = [];\n\n function insertUpdate(traceIndex, key, value) {\n var attrIndex = attrIndices.indexOf(traceIndex);\n var valueArray = attrUpdate[key];\n if(!valueArray) {\n valueArray = attrUpdate[key] = [];\n }\n\n if(attrIndices.indexOf(traceIndex) === -1) {\n attrIndices.push(traceIndex);\n attrIndex = attrIndices.length - 1;\n }\n\n valueArray[attrIndex] = value;\n\n return attrIndex;\n }\n\n function setVisibility(fullTrace, visibility) {\n var fullInput = fullTrace._fullInput;\n if(Registry.hasTransform(fullInput, 'groupby')) {\n var kcont = carrs[fullInput.index];\n if(!kcont) {\n var groupbyIndices = Registry.getTransformIndices(fullInput, 'groupby');\n var lastGroupbyIndex = groupbyIndices[groupbyIndices.length - 1];\n kcont = Lib.keyedContainer(fullInput, 'transforms[' + lastGroupbyIndex + '].styles', 'target', 'value.visible');\n carrs[fullInput.index] = kcont;\n }\n\n var curState = kcont.get(fullTrace._group);\n\n // If not specified, assume visible. This happens if there are other style\n // properties set for a group but not the visibility. There are many similar\n // ways to do this (e.g. why not just `curState = fullTrace.visible`??? The\n // answer is: because it breaks other things like groupby trace names in\n // subtle ways.)\n if(curState === undefined) {\n curState = true;\n }\n\n if(curState !== false) {\n // true -> legendonly. All others toggle to true:\n kcont.set(fullTrace._group, visibility);\n }\n carrIdx[fullInput.index] = insertUpdate(fullInput.index, 'visible', fullInput.visible === false ? false : true);\n } else {\n // false -> false (not possible since will not be visible in legend)\n // true -> legendonly\n // legendonly -> true\n var nextVisibility = fullInput.visible === false ? false : visibility;\n\n insertUpdate(fullInput.index, 'visible', nextVisibility);\n }\n }\n\n if(numClicks === 1 && SHOWISOLATETIP && gd.data && gd._context.showTips) {\n Lib.notifier('Double click on legend to isolate individual trace', 'long');\n SHOWISOLATETIP = false;\n } else {\n SHOWISOLATETIP = false;\n }\n\n if(Registry.traceIs(fullTrace, 'pie')) {\n var thisLabel = legendItem.label,\n thisLabelIndex = hiddenSlices.indexOf(thisLabel);\n\n if(numClicks === 1) {\n if(thisLabelIndex === -1) hiddenSlices.push(thisLabel);\n else hiddenSlices.splice(thisLabelIndex, 1);\n } else if(numClicks === 2) {\n hiddenSlices = [];\n gd.calcdata[0].forEach(function(d) {\n if(thisLabel !== d.label) {\n hiddenSlices.push(d.label);\n }\n });\n if(gd._fullLayout.hiddenlabels && gd._fullLayout.hiddenlabels.length === hiddenSlices.length && thisLabelIndex === -1) {\n hiddenSlices = [];\n }\n }\n\n Plotly.relayout(gd, 'hiddenlabels', hiddenSlices);\n } else {\n var hasLegendgroup = legendgroup && legendgroup.length;\n var traceIndicesInGroup = [];\n var tracei;\n if(hasLegendgroup) {\n for(i = 0; i < fullData.length; i++) {\n tracei = fullData[i];\n if(!tracei.visible) continue;\n if(tracei.legendgroup === legendgroup) {\n traceIndicesInGroup.push(i);\n }\n }\n }\n\n if(numClicks === 1) {\n var nextVisibility;\n\n switch(fullTrace.visible) {\n case true:\n nextVisibility = 'legendonly';\n break;\n case false:\n nextVisibility = false;\n break;\n case 'legendonly':\n nextVisibility = true;\n break;\n }\n\n if(hasLegendgroup) {\n for(i = 0; i < fullData.length; i++) {\n if(fullData[i].visible !== false && fullData[i].legendgroup === legendgroup) {\n setVisibility(fullData[i], nextVisibility);\n }\n }\n } else {\n setVisibility(fullTrace, nextVisibility);\n }\n } else if(numClicks === 2) {\n // Compute the clicked index. expandedIndex does what we want for expanded traces\n // but also culls hidden traces. That means we have some work to do.\n var isClicked, isInGroup, otherState;\n var isIsolated = true;\n for(i = 0; i < fullData.length; i++) {\n isClicked = fullData[i] === fullTrace;\n if(isClicked) continue;\n\n isInGroup = (hasLegendgroup && fullData[i].legendgroup === legendgroup);\n\n if(!isInGroup && fullData[i].visible === true && !Registry.traceIs(fullData[i], 'notLegendIsolatable')) {\n isIsolated = false;\n break;\n }\n }\n\n for(i = 0; i < fullData.length; i++) {\n // False is sticky; we don't change it.\n if(fullData[i].visible === false) continue;\n\n if(Registry.traceIs(fullData[i], 'notLegendIsolatable')) {\n continue;\n }\n\n switch(fullTrace.visible) {\n case 'legendonly':\n setVisibility(fullData[i], true);\n break;\n case true:\n otherState = isIsolated ? true : 'legendonly';\n isClicked = fullData[i] === fullTrace;\n isInGroup = isClicked || (hasLegendgroup && fullData[i].legendgroup === legendgroup);\n setVisibility(fullData[i], isInGroup ? true : otherState);\n break;\n }\n }\n }\n\n for(i = 0; i < carrs.length; i++) {\n kcont = carrs[i];\n if(!kcont) continue;\n var update = kcont.constructUpdate();\n\n var updateKeys = Object.keys(update);\n for(j = 0; j < updateKeys.length; j++) {\n key = updateKeys[j];\n val = attrUpdate[key] = attrUpdate[key] || [];\n val[carrIdx[i]] = update[key];\n }\n }\n\n // The length of the value arrays should be equal and any unspecified\n // values should be explicitly undefined for them to get properly culled\n // as updates and not accidentally reset to the default value. This fills\n // out sparse arrays with the required number of undefined values:\n keys = Object.keys(attrUpdate);\n for(i = 0; i < keys.length; i++) {\n key = keys[i];\n for(j = 0; j < attrIndices.length; j++) {\n // Use hasOwnPropety to protect against falsey values:\n if(!attrUpdate[key].hasOwnProperty(j)) {\n attrUpdate[key][j] = undefined;\n }\n }\n }\n\n Plotly.restyle(gd, attrUpdate, attrIndices);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/handle_click.js\n// module id = 459\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n scrollBarWidth: 4,\n scrollBarHeight: 20,\n scrollBarColor: '#808BA4',\n scrollBarMargin: 4\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/constants.js\n// module id = 460\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../../registry');\nvar helpers = require('./helpers');\n\n\nmodule.exports = function getLegendData(calcdata, opts) {\n var lgroupToTraces = {},\n lgroups = [],\n hasOneNonBlankGroup = false,\n slicesShown = {},\n lgroupi = 0;\n\n var i, j;\n\n function addOneItem(legendGroup, legendItem) {\n // each '' legend group is treated as a separate group\n if(legendGroup === '' || !helpers.isGrouped(opts)) {\n var uniqueGroup = '~~i' + lgroupi; // TODO: check this against fullData legendgroups?\n\n lgroups.push(uniqueGroup);\n lgroupToTraces[uniqueGroup] = [[legendItem]];\n lgroupi++;\n }\n else if(lgroups.indexOf(legendGroup) === -1) {\n lgroups.push(legendGroup);\n hasOneNonBlankGroup = true;\n lgroupToTraces[legendGroup] = [[legendItem]];\n }\n else lgroupToTraces[legendGroup].push([legendItem]);\n }\n\n // build an { legendgroup: [cd0, cd0], ... } object\n for(i = 0; i < calcdata.length; i++) {\n var cd = calcdata[i],\n cd0 = cd[0],\n trace = cd0.trace,\n lgroup = trace.legendgroup;\n\n if(!helpers.legendGetsTrace(trace) || !trace.showlegend) continue;\n\n if(Registry.traceIs(trace, 'pie')) {\n if(!slicesShown[lgroup]) slicesShown[lgroup] = {};\n\n for(j = 0; j < cd.length; j++) {\n var labelj = cd[j].label;\n\n if(!slicesShown[lgroup][labelj]) {\n addOneItem(lgroup, {\n label: labelj,\n color: cd[j].color,\n i: cd[j].i,\n trace: trace\n });\n\n slicesShown[lgroup][labelj] = true;\n }\n }\n }\n\n else addOneItem(lgroup, cd0);\n }\n\n // won't draw a legend in this case\n if(!lgroups.length) return [];\n\n // rearrange lgroupToTraces into a d3-friendly array of arrays\n var lgroupsLength = lgroups.length,\n ltraces,\n legendData;\n\n if(hasOneNonBlankGroup && helpers.isGrouped(opts)) {\n legendData = new Array(lgroupsLength);\n\n for(i = 0; i < lgroupsLength; i++) {\n ltraces = lgroupToTraces[lgroups[i]];\n legendData[i] = helpers.isReversed(opts) ? ltraces.reverse() : ltraces;\n }\n }\n else {\n // collapse all groups into one if all groups are blank\n legendData = [new Array(lgroupsLength)];\n\n for(i = 0; i < lgroupsLength; i++) {\n ltraces = lgroupToTraces[lgroups[i]][0];\n legendData[0][helpers.isReversed(opts) ? lgroupsLength - i - 1 : i] = ltraces;\n }\n lgroupsLength = 1;\n }\n\n // needed in repositionLegend\n opts._lgroupsLength = lgroupsLength;\n return legendData;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/legend/get_legend_data.js\n// module id = 461\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar drawModule = require('./draw');\nvar clickModule = require('./click');\n\nmodule.exports = {\n moduleType: 'component',\n name: 'annotations',\n\n layoutAttributes: require('./attributes'),\n supplyLayoutDefaults: require('./defaults'),\n\n calcAutorange: require('./calc_autorange'),\n draw: drawModule.draw,\n drawOne: drawModule.drawOne,\n drawRaw: drawModule.drawRaw,\n\n hasClickToShow: clickModule.hasClickToShow,\n onClick: clickModule.onClick,\n\n convertCoords: require('./convert_coords')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/index.js\n// module id = 462\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Color = require('../color');\n\nvar ARROWPATHS = require('./arrow_paths');\n\n/**\n * Add arrowhead(s) to a path or line element\n *\n * @param {d3.selection} el3: a d3-selected line or path element\n *\n * @param {string} ends: 'start', 'end', or 'start+end' for which ends get arrowheads\n *\n * @param {object} options: style information. Must have all the following:\n * @param {number} options.arrowhead: head style - see ./arrow_paths\n * @param {number} options.arrowsize: relative size of the head vs line width\n * @param {number} options.standoff: distance in px to move the arrow point from its target\n * @param {number} options.arrowwidth: width of the arrow line\n * @param {string} options.arrowcolor: color of the arrow line, for the head to match\n * Note that the opacity of this color is ignored, as it's assumed the container\n * of both the line and head has opacity applied to it so there isn't greater opacity\n * where they overlap.\n */\nmodule.exports = function drawArrowHead(el3, ends, options) {\n var el = el3.node();\n var headStyle = ARROWPATHS[options.arrowhead || 0];\n var scale = (options.arrowwidth || 1) * options.arrowsize;\n var doStart = ends.indexOf('start') >= 0;\n var doEnd = ends.indexOf('end') >= 0;\n var backOff = headStyle.backoff * scale + options.standoff;\n\n var start, end, startRot, endRot;\n\n if(el.nodeName === 'line') {\n start = {x: +el3.attr('x1'), y: +el3.attr('y1')};\n end = {x: +el3.attr('x2'), y: +el3.attr('y2')};\n\n var dx = start.x - end.x;\n var dy = start.y - end.y;\n\n startRot = Math.atan2(dy, dx);\n endRot = startRot + Math.PI;\n if(backOff) {\n if(backOff * backOff > dx * dx + dy * dy) {\n hideLine();\n return;\n }\n var backOffX = backOff * Math.cos(startRot),\n backOffY = backOff * Math.sin(startRot);\n\n if(doStart) {\n start.x -= backOffX;\n start.y -= backOffY;\n el3.attr({x1: start.x, y1: start.y});\n }\n if(doEnd) {\n end.x += backOffX;\n end.y += backOffY;\n el3.attr({x2: end.x, y2: end.y});\n }\n }\n }\n else if(el.nodeName === 'path') {\n var pathlen = el.getTotalLength(),\n // using dash to hide the backOff region of the path.\n // if we ever allow dash for the arrow we'll have to\n // do better than this hack... maybe just manually\n // combine the two\n dashArray = '';\n\n if(pathlen < backOff) {\n hideLine();\n return;\n }\n\n if(doStart) {\n var start0 = el.getPointAtLength(0);\n var dstart = el.getPointAtLength(0.1);\n\n startRot = Math.atan2(start0.y - dstart.y, start0.x - dstart.x);\n start = el.getPointAtLength(Math.min(backOff, pathlen));\n\n if(backOff) dashArray = '0px,' + backOff + 'px,';\n }\n\n if(doEnd) {\n var end0 = el.getPointAtLength(pathlen);\n var dend = el.getPointAtLength(pathlen - 0.1);\n\n endRot = Math.atan2(end0.y - dend.y, end0.x - dend.x);\n end = el.getPointAtLength(Math.max(0, pathlen - backOff));\n\n if(backOff) {\n var shortening = dashArray ? 2 * backOff : backOff;\n dashArray += (pathlen - shortening) + 'px,' + pathlen + 'px';\n }\n }\n else if(dashArray) dashArray += pathlen + 'px';\n\n if(dashArray) el3.style('stroke-dasharray', dashArray);\n }\n\n function hideLine() { el3.style('stroke-dasharray', '0px,100px'); }\n\n function drawhead(p, rot) {\n if(!headStyle.path) return;\n if(headStyle.noRotate) rot = 0;\n\n d3.select(el.parentNode).append('path')\n .attr({\n 'class': el3.attr('class'),\n d: headStyle.path,\n transform:\n 'translate(' + p.x + ',' + p.y + ')' +\n (rot ? 'rotate(' + (rot * 180 / Math.PI) + ')' : '') +\n 'scale(' + scale + ')'\n })\n .style({\n fill: Color.rgb(options.arrowcolor),\n 'stroke-width': 0\n });\n }\n\n if(doStart) drawhead(start, startRot);\n if(doEnd) drawhead(end, endRot);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/draw_arrow_head.js\n// module id = 463\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Plotly = require('../../plotly');\n\n\nmodule.exports = {\n hasClickToShow: hasClickToShow,\n onClick: onClick\n};\n\n/*\n * hasClickToShow: does the given hoverData have ANY annotations which will\n * turn ON if we click here? (used by hover events to set cursor)\n *\n * gd: graphDiv\n * hoverData: a hoverData array, as included with the *plotly_hover* or\n * *plotly_click* events in the `points` attribute\n *\n * returns: boolean\n */\nfunction hasClickToShow(gd, hoverData) {\n var sets = getToggleSets(gd, hoverData);\n return sets.on.length > 0 || sets.explicitOff.length > 0;\n}\n\n/*\n * onClick: perform the toggling (via Plotly.update) implied by clicking\n * at this hoverData\n *\n * gd: graphDiv\n * hoverData: a hoverData array, as included with the *plotly_hover* or\n * *plotly_click* events in the `points` attribute\n *\n * returns: Promise that the update is complete\n */\nfunction onClick(gd, hoverData) {\n var toggleSets = getToggleSets(gd, hoverData),\n onSet = toggleSets.on,\n offSet = toggleSets.off.concat(toggleSets.explicitOff),\n update = {},\n i;\n\n if(!(onSet.length || offSet.length)) return;\n\n for(i = 0; i < onSet.length; i++) {\n update['annotations[' + onSet[i] + '].visible'] = true;\n }\n\n for(i = 0; i < offSet.length; i++) {\n update['annotations[' + offSet[i] + '].visible'] = false;\n }\n\n return Plotly.update(gd, {}, update);\n}\n\n/*\n * getToggleSets: find the annotations which will turn on or off at this\n * hoverData\n *\n * gd: graphDiv\n * hoverData: a hoverData array, as included with the *plotly_hover* or\n * *plotly_click* events in the `points` attribute\n *\n * returns: {\n * on: Array (indices of annotations to turn on),\n * off: Array (indices to turn off because you're not hovering on them),\n * explicitOff: Array (indices to turn off because you *are* hovering on them)\n * }\n */\nfunction getToggleSets(gd, hoverData) {\n var annotations = gd._fullLayout.annotations,\n onSet = [],\n offSet = [],\n explicitOffSet = [],\n hoverLen = (hoverData || []).length;\n\n var i, j, anni, showMode, pointj, xa, ya, toggleType;\n\n for(i = 0; i < annotations.length; i++) {\n anni = annotations[i];\n showMode = anni.clicktoshow;\n\n if(showMode) {\n for(j = 0; j < hoverLen; j++) {\n pointj = hoverData[j];\n xa = pointj.xaxis;\n ya = pointj.yaxis;\n\n if(xa._id === anni.xref &&\n ya._id === anni.yref &&\n xa.d2r(pointj.x) === clickData2r(anni._xclick, xa) &&\n ya.d2r(pointj.y) === clickData2r(anni._yclick, ya)\n ) {\n // match! toggle this annotation\n // regardless of its clicktoshow mode\n // but if it's onout mode, off is implicit\n if(anni.visible) {\n if(showMode === 'onout') toggleType = offSet;\n else toggleType = explicitOffSet;\n }\n else {\n toggleType = onSet;\n }\n toggleType.push(i);\n break;\n }\n }\n\n if(j === hoverLen) {\n // no match - only turn this annotation OFF, and only if\n // showmode is 'onout'\n if(anni.visible && showMode === 'onout') offSet.push(i);\n }\n }\n }\n\n return {on: onSet, off: offSet, explicitOff: explicitOffSet};\n}\n\n// to handle log axes until v2\nfunction clickData2r(d, ax) {\n return ax.type === 'log' ? ax.l2r(d) : ax.d2r(d);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/click.js\n// module id = 464\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar handleArrayContainerDefaults = require('../../plots/array_container_defaults');\nvar handleAnnotationDefaults = require('./annotation_defaults');\n\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n var opts = {\n name: 'annotations',\n handleItemDefaults: handleAnnotationDefaults\n };\n\n handleArrayContainerDefaults(layoutIn, layoutOut, opts);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/defaults.js\n// module id = 465\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\nvar handleAnnotationCommonDefaults = require('./common_defaults');\nvar attributes = require('./attributes');\n\n\nmodule.exports = function handleAnnotationDefaults(annIn, annOut, fullLayout, opts, itemOpts) {\n opts = opts || {};\n itemOpts = itemOpts || {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(annIn, annOut, attributes, attr, dflt);\n }\n\n var visible = coerce('visible', !itemOpts.itemIsNotPlainObject);\n var clickToShow = coerce('clicktoshow');\n\n if(!(visible || clickToShow)) return annOut;\n\n handleAnnotationCommonDefaults(annIn, annOut, fullLayout, coerce);\n\n var showArrow = annOut.showarrow;\n\n // positioning\n var axLetters = ['x', 'y'],\n arrowPosDflt = [-10, -30],\n gdMock = {_fullLayout: fullLayout};\n for(var i = 0; i < 2; i++) {\n var axLetter = axLetters[i];\n\n // xref, yref\n var axRef = Axes.coerceRef(annIn, annOut, gdMock, axLetter, '', 'paper');\n\n // x, y\n Axes.coercePosition(annOut, gdMock, coerce, axRef, axLetter, 0.5);\n\n if(showArrow) {\n var arrowPosAttr = 'a' + axLetter,\n // axref, ayref\n aaxRef = Axes.coerceRef(annIn, annOut, gdMock, arrowPosAttr, 'pixel');\n\n // for now the arrow can only be on the same axis or specified as pixels\n // TODO: sometime it might be interesting to allow it to be on *any* axis\n // but that would require updates to drawing & autorange code and maybe more\n if(aaxRef !== 'pixel' && aaxRef !== axRef) {\n aaxRef = annOut[arrowPosAttr] = 'pixel';\n }\n\n // ax, ay\n var aDflt = (aaxRef === 'pixel') ? arrowPosDflt[i] : 0.4;\n Axes.coercePosition(annOut, gdMock, coerce, aaxRef, arrowPosAttr, aDflt);\n }\n\n // xanchor, yanchor\n coerce(axLetter + 'anchor');\n\n // xshift, yshift\n coerce(axLetter + 'shift');\n }\n\n // if you have one coordinate you should have both\n Lib.noneOrAll(annIn, annOut, ['x', 'y']);\n\n // if you have one part of arrow length you should have both\n if(showArrow) {\n Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);\n }\n\n if(clickToShow) {\n var xClick = coerce('xclick');\n var yClick = coerce('yclick');\n\n // put the actual click data to bind to into private attributes\n // so we don't have to do this little bit of logic on every hover event\n annOut._xclick = (xClick === undefined) ?\n annOut.x :\n Axes.cleanPosition(xClick, gdMock, annOut.xref);\n annOut._yclick = (yClick === undefined) ?\n annOut.y :\n Axes.cleanPosition(yClick, gdMock, annOut.yref);\n }\n\n return annOut;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/annotation_defaults.js\n// module id = 466\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\n\nvar draw = require('./draw').draw;\n\n\nmodule.exports = function calcAutorange(gd) {\n var fullLayout = gd._fullLayout,\n annotationList = Lib.filterVisible(fullLayout.annotations);\n\n if(!annotationList.length || !gd._fullData.length) return;\n\n var annotationAxes = {};\n annotationList.forEach(function(ann) {\n annotationAxes[ann.xref] = true;\n annotationAxes[ann.yref] = true;\n });\n\n var autorangedAnnos = Axes.list(gd).filter(function(ax) {\n return ax.autorange && annotationAxes[ax._id];\n });\n if(!autorangedAnnos.length) return;\n\n return Lib.syncOrAsync([\n draw,\n annAutorange\n ], gd);\n};\n\nfunction annAutorange(gd) {\n var fullLayout = gd._fullLayout;\n\n // find the bounding boxes for each of these annotations'\n // relative to their anchor points\n // use the arrow and the text bg rectangle,\n // as the whole anno may include hidden text in its bbox\n Lib.filterVisible(fullLayout.annotations).forEach(function(ann) {\n var xa = Axes.getFromId(gd, ann.xref),\n ya = Axes.getFromId(gd, ann.yref),\n headSize = 3 * ann.arrowsize * ann.arrowwidth || 0;\n\n var headPlus, headMinus;\n\n if(xa && xa.autorange) {\n headPlus = headSize + ann.xshift;\n headMinus = headSize - ann.xshift;\n\n if(ann.axref === ann.xref) {\n // expand for the arrowhead (padded by arrowhead)\n Axes.expand(xa, [xa.r2c(ann.x)], {\n ppadplus: headPlus,\n ppadminus: headMinus\n });\n // again for the textbox (padded by textbox)\n Axes.expand(xa, [xa.r2c(ann.ax)], {\n ppadplus: ann._xpadplus,\n ppadminus: ann._xpadminus\n });\n }\n else {\n Axes.expand(xa, [xa.r2c(ann.x)], {\n ppadplus: Math.max(ann._xpadplus, headPlus),\n ppadminus: Math.max(ann._xpadminus, headMinus)\n });\n }\n }\n\n if(ya && ya.autorange) {\n headPlus = headSize - ann.yshift;\n headMinus = headSize + ann.yshift;\n\n if(ann.ayref === ann.yref) {\n Axes.expand(ya, [ya.r2c(ann.y)], {\n ppadplus: headPlus,\n ppadminus: headMinus\n });\n Axes.expand(ya, [ya.r2c(ann.ay)], {\n ppadplus: ann._ypadplus,\n ppadminus: ann._ypadminus\n });\n }\n else {\n Axes.expand(ya, [ya.r2c(ann.y)], {\n ppadplus: Math.max(ann._ypadplus, headPlus),\n ppadminus: Math.max(ann._ypadminus, headMinus)\n });\n }\n }\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/calc_autorange.js\n// module id = 467\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar toLogRange = require('../../lib/to_log_range');\n\n/*\n * convertCoords: when converting an axis between log and linear\n * you need to alter any annotations on that axis to keep them\n * pointing at the same data point.\n * In v2.0 this will become obsolete\n *\n * gd: the plot div\n * ax: the axis being changed\n * newType: the type it's getting\n * doExtra: function(attr, val) from inside relayout that sets the attribute.\n * Use this to make the changes as it's aware if any other changes in the\n * same relayout call should override this conversion.\n */\nmodule.exports = function convertCoords(gd, ax, newType, doExtra) {\n ax = ax || {};\n\n var toLog = (newType === 'log') && (ax.type === 'linear'),\n fromLog = (newType === 'linear') && (ax.type === 'log');\n\n if(!(toLog || fromLog)) return;\n\n var annotations = gd._fullLayout.annotations,\n axLetter = ax._id.charAt(0),\n ann,\n attrPrefix;\n\n function convert(attr) {\n var currentVal = ann[attr],\n newVal = null;\n\n if(toLog) newVal = toLogRange(currentVal, ax.range);\n else newVal = Math.pow(10, currentVal);\n\n // if conversion failed, delete the value so it gets a default value\n if(!isNumeric(newVal)) newVal = null;\n\n doExtra(attrPrefix + attr, newVal);\n }\n\n for(var i = 0; i < annotations.length; i++) {\n ann = annotations[i];\n attrPrefix = 'annotations[' + i + '].';\n\n if(ann[axLetter + 'ref'] === ax._id) convert(axLetter);\n if(ann['a' + axLetter + 'ref'] === ax._id) convert('a' + axLetter);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations/convert_coords.js\n// module id = 468\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'component',\n name: 'annotations3d',\n\n schema: {\n subplots: {\n scene: {annotations: require('./attributes')}\n }\n },\n\n layoutAttributes: require('./attributes'),\n handleDefaults: require('./defaults'),\n\n convert: require('./convert'),\n draw: require('./draw')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations3d/index.js\n// module id = 469\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\nvar handleArrayContainerDefaults = require('../../plots/array_container_defaults');\nvar handleAnnotationCommonDefaults = require('../annotations/common_defaults');\nvar attributes = require('./attributes');\n\nmodule.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {\n handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {\n name: 'annotations',\n handleItemDefaults: handleAnnotationDefaults,\n fullLayout: opts.fullLayout\n });\n};\n\nfunction handleAnnotationDefaults(annIn, annOut, sceneLayout, opts, itemOpts) {\n function coerce(attr, dflt) {\n return Lib.coerce(annIn, annOut, attributes, attr, dflt);\n }\n\n function coercePosition(axLetter) {\n var axName = axLetter + 'axis';\n\n // mock in such way that getFromId grabs correct 3D axis\n var gdMock = { _fullLayout: {} };\n gdMock._fullLayout[axName] = sceneLayout[axName];\n\n return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);\n }\n\n\n var visible = coerce('visible', !itemOpts.itemIsNotPlainObject);\n if(!visible) return annOut;\n\n handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);\n\n coercePosition('x');\n coercePosition('y');\n coercePosition('z');\n\n // if you have one coordinate you should all three\n Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);\n\n // hard-set here for completeness\n annOut.xref = 'x';\n annOut.yref = 'y';\n annOut.zref = 'z';\n\n coerce('xanchor');\n coerce('yanchor');\n coerce('xshift');\n coerce('yshift');\n\n if(annOut.showarrow) {\n annOut.axref = 'pixel';\n annOut.ayref = 'pixel';\n\n // TODO maybe default values should be bigger than the 2D case?\n coerce('ax', -10);\n coerce('ay', -30);\n\n // if you have one part of arrow length you should have both\n Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);\n }\n\n return annOut;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations3d/defaults.js\n// module id = 470\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\n\nmodule.exports = function convert(scene) {\n var fullSceneLayout = scene.fullSceneLayout;\n var anns = fullSceneLayout.annotations;\n\n for(var i = 0; i < anns.length; i++) {\n mockAnnAxes(anns[i], scene);\n }\n\n scene.fullLayout._infolayer\n .selectAll('.annotation-' + scene.id)\n .remove();\n};\n\nfunction mockAnnAxes(ann, scene) {\n var fullSceneLayout = scene.fullSceneLayout;\n var domain = fullSceneLayout.domain;\n var size = scene.fullLayout._size;\n\n var base = {\n // this gets fill in on render\n pdata: null,\n\n // to get setConvert to not execute cleanly\n type: 'linear',\n\n // don't try to update them on `editable: true`\n autorange: false,\n\n // set infinite range so that annotation draw routine\n // does not try to remove 'outside-range' annotations,\n // this case is handled in the render loop\n range: [-Infinity, Infinity]\n };\n\n ann._xa = {};\n Lib.extendFlat(ann._xa, base);\n Axes.setConvert(ann._xa);\n ann._xa._offset = size.l + domain.x[0] * size.w;\n ann._xa.l2p = function() {\n return 0.5 * (1 + ann.pdata[0] / ann.pdata[3]) * size.w * (domain.x[1] - domain.x[0]);\n };\n\n ann._ya = {};\n Lib.extendFlat(ann._ya, base);\n Axes.setConvert(ann._ya);\n ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;\n ann._ya.l2p = function() {\n return 0.5 * (1 - ann.pdata[1] / ann.pdata[3]) * size.h * (domain.y[1] - domain.y[0]);\n };\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations3d/convert.js\n// module id = 471\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar drawRaw = require('../annotations/draw').drawRaw;\nvar project = require('../../plots/gl3d/project');\nvar axLetters = ['x', 'y', 'z'];\n\nmodule.exports = function draw(scene) {\n var fullSceneLayout = scene.fullSceneLayout;\n var dataScale = scene.dataScale;\n var anns = fullSceneLayout.annotations;\n\n for(var i = 0; i < anns.length; i++) {\n var ann = anns[i];\n var annotationIsOffscreen = false;\n\n for(var j = 0; j < 3; j++) {\n var axLetter = axLetters[j];\n var pos = ann[axLetter];\n var ax = fullSceneLayout[axLetter + 'axis'];\n var posFraction = ax.r2fraction(pos);\n\n if(posFraction < 0 || posFraction > 1) {\n annotationIsOffscreen = true;\n break;\n }\n }\n\n if(annotationIsOffscreen) {\n scene.fullLayout._infolayer\n .select('.annotation-' + scene.id + '[data-index=\"' + i + '\"]')\n .remove();\n } else {\n ann.pdata = project(scene.glplot.cameraParams, [\n fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],\n fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],\n fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]\n ]);\n\n drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/annotations3d/draw.js\n// module id = 472\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nfunction xformMatrix(m, v) {\n var out = [0, 0, 0, 0];\n var i, j;\n\n for(i = 0; i < 4; ++i) {\n for(j = 0; j < 4; ++j) {\n out[j] += m[4 * i + j] * v[i];\n }\n }\n\n return out;\n}\n\nfunction project(camera, v) {\n var p = xformMatrix(camera.projection,\n xformMatrix(camera.view,\n xformMatrix(camera.model, [v[0], v[1], v[2], 1])));\n return p;\n}\n\nmodule.exports = project;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/plots/gl3d/project.js\n// module id = 473\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar drawModule = require('./draw');\n\nmodule.exports = {\n moduleType: 'component',\n name: 'shapes',\n\n layoutAttributes: require('./attributes'),\n supplyLayoutDefaults: require('./defaults'),\n\n calcAutorange: require('./calc_autorange'),\n draw: drawModule.draw,\n drawOne: drawModule.drawOne\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/shapes/index.js\n// module id = 474\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Plotly = require('../../plotly');\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\nvar Color = require('../color');\nvar Drawing = require('../drawing');\n\nvar dragElement = require('../dragelement');\nvar setCursor = require('../../lib/setcursor');\n\nvar constants = require('./constants');\nvar helpers = require('./helpers');\n\n\n// Shapes are stored in gd.layout.shapes, an array of objects\n// index can point to one item in this array,\n// or non-numeric to simply add a new one\n// or -1 to modify all existing\n// opt can be the full options object, or one key (to be set to value)\n// or undefined to simply redraw\n// if opt is blank, val can be 'add' or a full options object to add a new\n// annotation at that point in the array, or 'remove' to delete this one\n\nmodule.exports = {\n draw: draw,\n drawOne: drawOne\n};\n\nfunction draw(gd) {\n var fullLayout = gd._fullLayout;\n\n // Remove previous shapes before drawing new in shapes in fullLayout.shapes\n fullLayout._shapeUpperLayer.selectAll('path').remove();\n fullLayout._shapeLowerLayer.selectAll('path').remove();\n fullLayout._shapeSubplotLayers.selectAll('path').remove();\n\n for(var i = 0; i < fullLayout.shapes.length; i++) {\n if(fullLayout.shapes[i].visible) {\n drawOne(gd, i);\n }\n }\n\n // may need to resurrect this if we put text (LaTeX) in shapes\n // return Plots.previousPromises(gd);\n}\n\nfunction drawOne(gd, index) {\n // remove the existing shape if there is one.\n // because indices can change, we need to look in all shape layers\n gd._fullLayout._paper\n .selectAll('.shapelayer [data-index=\"' + index + '\"]')\n .remove();\n\n var optionsIn = (gd.layout.shapes || [])[index],\n options = gd._fullLayout.shapes[index];\n\n // this shape is gone - quit now after deleting it\n // TODO: use d3 idioms instead of deleting and redrawing every time\n if(!optionsIn || options.visible === false) return;\n\n if(options.layer !== 'below') {\n drawShape(gd._fullLayout._shapeUpperLayer);\n }\n else if(options.xref === 'paper' || options.yref === 'paper') {\n drawShape(gd._fullLayout._shapeLowerLayer);\n }\n else {\n var plotinfo = gd._fullLayout._plots[options.xref + options.yref];\n if(plotinfo) {\n var mainPlot = plotinfo.mainplotinfo || plotinfo;\n drawShape(mainPlot.shapelayer);\n }\n else {\n // Fall back to _shapeLowerLayer in case the requested subplot doesn't exist.\n // This can happen if you reference the shape to an x / y axis combination\n // that doesn't have any data on it (and layer is below)\n drawShape(gd._fullLayout._shapeLowerLayer);\n }\n }\n\n function drawShape(shapeLayer) {\n var attrs = {\n 'data-index': index,\n 'fill-rule': 'evenodd',\n d: getPathString(gd, options)\n },\n lineColor = options.line.width ?\n options.line.color : 'rgba(0,0,0,0)';\n\n var path = shapeLayer.append('path')\n .attr(attrs)\n .style('opacity', options.opacity)\n .call(Color.stroke, lineColor)\n .call(Color.fill, options.fillcolor)\n .call(Drawing.dashLine, options.line.dash, options.line.width);\n\n // note that for layer=\"below\" the clipAxes can be different from the\n // subplot we're drawing this in. This could cause problems if the shape\n // spans two subplots. See https://github.com/plotly/plotly.js/issues/1452\n var clipAxes = (options.xref + options.yref).replace(/paper/g, '');\n\n path.call(Drawing.setClipUrl, clipAxes ?\n ('clip' + gd._fullLayout._uid + clipAxes) :\n null\n );\n\n if(gd._context.edits.shapePosition) setupDragElement(gd, path, options, index);\n }\n}\n\nfunction setupDragElement(gd, shapePath, shapeOptions, index) {\n var MINWIDTH = 10,\n MINHEIGHT = 10;\n\n var update;\n var x0, y0, x1, y1, astrX0, astrY0, astrX1, astrY1;\n var n0, s0, w0, e0, astrN, astrS, astrW, astrE, optN, optS, optW, optE;\n var pathIn, astrPath;\n\n var xa, ya, x2p, y2p, p2x, p2y;\n\n var dragOptions = {\n element: shapePath.node(),\n gd: gd,\n prepFn: startDrag,\n doneFn: endDrag\n },\n dragBBox = dragOptions.element.getBoundingClientRect(),\n dragMode;\n\n dragElement.init(dragOptions);\n\n shapePath.node().onmousemove = updateDragMode;\n\n function updateDragMode(evt) {\n // choose 'move' or 'resize'\n // based on initial position of cursor within the drag element\n var w = dragBBox.right - dragBBox.left,\n h = dragBBox.bottom - dragBBox.top,\n x = evt.clientX - dragBBox.left,\n y = evt.clientY - dragBBox.top,\n cursor = (w > MINWIDTH && h > MINHEIGHT && !evt.shiftKey) ?\n dragElement.getCursor(x / w, 1 - y / h) :\n 'move';\n\n setCursor(shapePath, cursor);\n\n // possible values 'move', 'sw', 'w', 'se', 'e', 'ne', 'n', 'nw' and 'w'\n dragMode = cursor.split('-')[0];\n }\n\n function startDrag(evt) {\n // setup conversion functions\n xa = Axes.getFromId(gd, shapeOptions.xref);\n ya = Axes.getFromId(gd, shapeOptions.yref);\n\n x2p = helpers.getDataToPixel(gd, xa);\n y2p = helpers.getDataToPixel(gd, ya, true);\n p2x = helpers.getPixelToData(gd, xa);\n p2y = helpers.getPixelToData(gd, ya, true);\n\n // setup update strings and initial values\n var astr = 'shapes[' + index + ']';\n if(shapeOptions.type === 'path') {\n pathIn = shapeOptions.path;\n astrPath = astr + '.path';\n }\n else {\n x0 = x2p(shapeOptions.x0);\n y0 = y2p(shapeOptions.y0);\n x1 = x2p(shapeOptions.x1);\n y1 = y2p(shapeOptions.y1);\n\n astrX0 = astr + '.x0';\n astrY0 = astr + '.y0';\n astrX1 = astr + '.x1';\n astrY1 = astr + '.y1';\n }\n\n if(x0 < x1) {\n w0 = x0; astrW = astr + '.x0'; optW = 'x0';\n e0 = x1; astrE = astr + '.x1'; optE = 'x1';\n }\n else {\n w0 = x1; astrW = astr + '.x1'; optW = 'x1';\n e0 = x0; astrE = astr + '.x0'; optE = 'x0';\n }\n if(y0 < y1) {\n n0 = y0; astrN = astr + '.y0'; optN = 'y0';\n s0 = y1; astrS = astr + '.y1'; optS = 'y1';\n }\n else {\n n0 = y1; astrN = astr + '.y1'; optN = 'y1';\n s0 = y0; astrS = astr + '.y0'; optS = 'y0';\n }\n\n update = {};\n\n // setup dragMode and the corresponding handler\n updateDragMode(evt);\n dragOptions.moveFn = (dragMode === 'move') ? moveShape : resizeShape;\n }\n\n function endDrag(dragged) {\n setCursor(shapePath);\n if(dragged) {\n Plotly.relayout(gd, update);\n }\n }\n\n function moveShape(dx, dy) {\n if(shapeOptions.type === 'path') {\n var moveX = function moveX(x) { return p2x(x2p(x) + dx); };\n if(xa && xa.type === 'date') moveX = helpers.encodeDate(moveX);\n\n var moveY = function moveY(y) { return p2y(y2p(y) + dy); };\n if(ya && ya.type === 'date') moveY = helpers.encodeDate(moveY);\n\n shapeOptions.path = movePath(pathIn, moveX, moveY);\n update[astrPath] = shapeOptions.path;\n }\n else {\n update[astrX0] = shapeOptions.x0 = p2x(x0 + dx);\n update[astrY0] = shapeOptions.y0 = p2y(y0 + dy);\n update[astrX1] = shapeOptions.x1 = p2x(x1 + dx);\n update[astrY1] = shapeOptions.y1 = p2y(y1 + dy);\n }\n\n shapePath.attr('d', getPathString(gd, shapeOptions));\n }\n\n function resizeShape(dx, dy) {\n if(shapeOptions.type === 'path') {\n // TODO: implement path resize\n var moveX = function moveX(x) { return p2x(x2p(x) + dx); };\n if(xa && xa.type === 'date') moveX = helpers.encodeDate(moveX);\n\n var moveY = function moveY(y) { return p2y(y2p(y) + dy); };\n if(ya && ya.type === 'date') moveY = helpers.encodeDate(moveY);\n\n shapeOptions.path = movePath(pathIn, moveX, moveY);\n update[astrPath] = shapeOptions.path;\n }\n else {\n var newN = (~dragMode.indexOf('n')) ? n0 + dy : n0,\n newS = (~dragMode.indexOf('s')) ? s0 + dy : s0,\n newW = (~dragMode.indexOf('w')) ? w0 + dx : w0,\n newE = (~dragMode.indexOf('e')) ? e0 + dx : e0;\n\n if(newS - newN > MINHEIGHT) {\n update[astrN] = shapeOptions[optN] = p2y(newN);\n update[astrS] = shapeOptions[optS] = p2y(newS);\n }\n\n if(newE - newW > MINWIDTH) {\n update[astrW] = shapeOptions[optW] = p2x(newW);\n update[astrE] = shapeOptions[optE] = p2x(newE);\n }\n }\n\n shapePath.attr('d', getPathString(gd, shapeOptions));\n }\n}\n\nfunction getPathString(gd, options) {\n var type = options.type,\n xa = Axes.getFromId(gd, options.xref),\n ya = Axes.getFromId(gd, options.yref),\n gs = gd._fullLayout._size,\n x2r,\n x2p,\n y2r,\n y2p;\n\n if(xa) {\n x2r = helpers.shapePositionToRange(xa);\n x2p = function(v) { return xa._offset + xa.r2p(x2r(v, true)); };\n }\n else {\n x2p = function(v) { return gs.l + gs.w * v; };\n }\n\n if(ya) {\n y2r = helpers.shapePositionToRange(ya);\n y2p = function(v) { return ya._offset + ya.r2p(y2r(v, true)); };\n }\n else {\n y2p = function(v) { return gs.t + gs.h * (1 - v); };\n }\n\n if(type === 'path') {\n if(xa && xa.type === 'date') x2p = helpers.decodeDate(x2p);\n if(ya && ya.type === 'date') y2p = helpers.decodeDate(y2p);\n return convertPath(options.path, x2p, y2p);\n }\n\n var x0 = x2p(options.x0),\n x1 = x2p(options.x1),\n y0 = y2p(options.y0),\n y1 = y2p(options.y1);\n\n if(type === 'line') return 'M' + x0 + ',' + y0 + 'L' + x1 + ',' + y1;\n if(type === 'rect') return 'M' + x0 + ',' + y0 + 'H' + x1 + 'V' + y1 + 'H' + x0 + 'Z';\n // circle\n var cx = (x0 + x1) / 2,\n cy = (y0 + y1) / 2,\n rx = Math.abs(cx - x0),\n ry = Math.abs(cy - y0),\n rArc = 'A' + rx + ',' + ry,\n rightPt = (cx + rx) + ',' + cy,\n topPt = cx + ',' + (cy - ry);\n return 'M' + rightPt + rArc + ' 0 1,1 ' + topPt +\n rArc + ' 0 0,1 ' + rightPt + 'Z';\n}\n\n\nfunction convertPath(pathIn, x2p, y2p) {\n // convert an SVG path string from data units to pixels\n return pathIn.replace(constants.segmentRE, function(segment) {\n var paramNumber = 0,\n segmentType = segment.charAt(0),\n xParams = constants.paramIsX[segmentType],\n yParams = constants.paramIsY[segmentType],\n nParams = constants.numParams[segmentType];\n\n var paramString = segment.substr(1).replace(constants.paramRE, function(param) {\n if(xParams[paramNumber]) param = x2p(param);\n else if(yParams[paramNumber]) param = y2p(param);\n paramNumber++;\n\n if(paramNumber > nParams) param = 'X';\n return param;\n });\n\n if(paramNumber > nParams) {\n paramString = paramString.replace(/[\\s,]*X.*/, '');\n Lib.log('Ignoring extra params in segment ' + segment);\n }\n\n return segmentType + paramString;\n });\n}\n\nfunction movePath(pathIn, moveX, moveY) {\n return pathIn.replace(constants.segmentRE, function(segment) {\n var paramNumber = 0,\n segmentType = segment.charAt(0),\n xParams = constants.paramIsX[segmentType],\n yParams = constants.paramIsY[segmentType],\n nParams = constants.numParams[segmentType];\n\n var paramString = segment.substr(1).replace(constants.paramRE, function(param) {\n if(paramNumber >= nParams) return param;\n\n if(xParams[paramNumber]) param = moveX(param);\n else if(yParams[paramNumber]) param = moveY(param);\n\n paramNumber++;\n\n return param;\n });\n\n return segmentType + paramString;\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/shapes/draw.js\n// module id = 475\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar handleArrayContainerDefaults = require('../../plots/array_container_defaults');\nvar handleShapeDefaults = require('./shape_defaults');\n\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n var opts = {\n name: 'shapes',\n handleItemDefaults: handleShapeDefaults\n };\n\n handleArrayContainerDefaults(layoutIn, layoutOut, opts);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/shapes/defaults.js\n// module id = 476\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\n\nvar attributes = require('./attributes');\nvar helpers = require('./helpers');\n\n\nmodule.exports = function handleShapeDefaults(shapeIn, shapeOut, fullLayout, opts, itemOpts) {\n opts = opts || {};\n itemOpts = itemOpts || {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(shapeIn, shapeOut, attributes, attr, dflt);\n }\n\n var visible = coerce('visible', !itemOpts.itemIsNotPlainObject);\n\n if(!visible) return shapeOut;\n\n coerce('layer');\n coerce('opacity');\n coerce('fillcolor');\n coerce('line.color');\n coerce('line.width');\n coerce('line.dash');\n\n var dfltType = shapeIn.path ? 'path' : 'rect',\n shapeType = coerce('type', dfltType);\n\n // positioning\n var axLetters = ['x', 'y'];\n for(var i = 0; i < 2; i++) {\n var axLetter = axLetters[i],\n gdMock = {_fullLayout: fullLayout};\n\n // xref, yref\n var axRef = Axes.coerceRef(shapeIn, shapeOut, gdMock, axLetter, '', 'paper');\n\n if(shapeType !== 'path') {\n var dflt0 = 0.25,\n dflt1 = 0.75,\n ax,\n pos2r,\n r2pos;\n\n if(axRef !== 'paper') {\n ax = Axes.getFromId(gdMock, axRef);\n r2pos = helpers.rangeToShapePosition(ax);\n pos2r = helpers.shapePositionToRange(ax);\n }\n else {\n pos2r = r2pos = Lib.identity;\n }\n\n // hack until V2.0 when log has regular range behavior - make it look like other\n // ranges to send to coerce, then put it back after\n // this is all to give reasonable default position behavior on log axes, which is\n // a pretty unimportant edge case so we could just ignore this.\n var attr0 = axLetter + '0',\n attr1 = axLetter + '1',\n in0 = shapeIn[attr0],\n in1 = shapeIn[attr1];\n shapeIn[attr0] = pos2r(shapeIn[attr0], true);\n shapeIn[attr1] = pos2r(shapeIn[attr1], true);\n\n // x0, x1 (and y0, y1)\n Axes.coercePosition(shapeOut, gdMock, coerce, axRef, attr0, dflt0);\n Axes.coercePosition(shapeOut, gdMock, coerce, axRef, attr1, dflt1);\n\n // hack part 2\n shapeOut[attr0] = r2pos(shapeOut[attr0]);\n shapeOut[attr1] = r2pos(shapeOut[attr1]);\n shapeIn[attr0] = in0;\n shapeIn[attr1] = in1;\n }\n }\n\n if(shapeType === 'path') {\n coerce('path');\n }\n else {\n Lib.noneOrAll(shapeIn, shapeOut, ['x0', 'x1', 'y0', 'y1']);\n }\n\n return shapeOut;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/shapes/shape_defaults.js\n// module id = 477\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\n\nvar constants = require('./constants');\nvar helpers = require('./helpers');\n\n\nmodule.exports = function calcAutorange(gd) {\n var fullLayout = gd._fullLayout,\n shapeList = Lib.filterVisible(fullLayout.shapes);\n\n if(!shapeList.length || !gd._fullData.length) return;\n\n for(var i = 0; i < shapeList.length; i++) {\n var shape = shapeList[i],\n ppad = shape.line.width / 2;\n\n var ax, bounds;\n\n if(shape.xref !== 'paper') {\n ax = Axes.getFromId(gd, shape.xref);\n bounds = shapeBounds(ax, shape.x0, shape.x1, shape.path, constants.paramIsX);\n if(bounds) Axes.expand(ax, bounds, {ppad: ppad});\n }\n\n if(shape.yref !== 'paper') {\n ax = Axes.getFromId(gd, shape.yref);\n bounds = shapeBounds(ax, shape.y0, shape.y1, shape.path, constants.paramIsY);\n if(bounds) Axes.expand(ax, bounds, {ppad: ppad});\n }\n }\n};\n\nfunction shapeBounds(ax, v0, v1, path, paramsToUse) {\n var convertVal = (ax.type === 'category') ? ax.r2c : ax.d2c;\n\n if(v0 !== undefined) return [convertVal(v0), convertVal(v1)];\n if(!path) return;\n\n var min = Infinity,\n max = -Infinity,\n segments = path.match(constants.segmentRE),\n i,\n segment,\n drawnParam,\n params,\n val;\n\n if(ax.type === 'date') convertVal = helpers.decodeDate(convertVal);\n\n for(i = 0; i < segments.length; i++) {\n segment = segments[i];\n drawnParam = paramsToUse[segment.charAt(0)].drawn;\n if(drawnParam === undefined) continue;\n\n params = segments[i].substr(1).match(constants.paramRE);\n if(!params || params.length < drawnParam) continue;\n\n val = convertVal(params[drawnParam]);\n if(val < min) min = val;\n if(val > max) max = val;\n }\n if(max >= min) return [min, max];\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/shapes/calc_autorange.js\n// module id = 478\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'component',\n name: 'images',\n\n layoutAttributes: require('./attributes'),\n supplyLayoutDefaults: require('./defaults'),\n\n draw: require('./draw'),\n\n convertCoords: require('./convert_coords')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/images/index.js\n// module id = 479\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\nvar handleArrayContainerDefaults = require('../../plots/array_container_defaults');\n\nvar attributes = require('./attributes');\nvar name = 'images';\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n var opts = {\n name: name,\n handleItemDefaults: imageDefaults\n };\n\n handleArrayContainerDefaults(layoutIn, layoutOut, opts);\n};\n\n\nfunction imageDefaults(imageIn, imageOut, fullLayout) {\n\n function coerce(attr, dflt) {\n return Lib.coerce(imageIn, imageOut, attributes, attr, dflt);\n }\n\n var source = coerce('source');\n var visible = coerce('visible', !!source);\n\n if(!visible) return imageOut;\n\n coerce('layer');\n coerce('xanchor');\n coerce('yanchor');\n coerce('sizex');\n coerce('sizey');\n coerce('sizing');\n coerce('opacity');\n\n var gdMock = { _fullLayout: fullLayout },\n axLetters = ['x', 'y'];\n\n for(var i = 0; i < 2; i++) {\n // 'paper' is the fallback axref\n var axLetter = axLetters[i],\n axRef = Axes.coerceRef(imageIn, imageOut, gdMock, axLetter, 'paper');\n\n Axes.coercePosition(imageOut, gdMock, coerce, axRef, axLetter, 0);\n }\n\n return imageOut;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/images/defaults.js\n// module id = 480\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = require('d3');\nvar Drawing = require('../drawing');\nvar Axes = require('../../plots/cartesian/axes');\nvar xmlnsNamespaces = require('../../constants/xmlns_namespaces');\n\nmodule.exports = function draw(gd) {\n var fullLayout = gd._fullLayout,\n imageDataAbove = [],\n imageDataSubplot = {},\n imageDataBelow = [],\n subplot,\n i;\n\n // Sort into top, subplot, and bottom layers\n for(i = 0; i < fullLayout.images.length; i++) {\n var img = fullLayout.images[i];\n\n if(img.visible) {\n if(img.layer === 'below' && img.xref !== 'paper' && img.yref !== 'paper') {\n subplot = img.xref + img.yref;\n\n var plotinfo = fullLayout._plots[subplot];\n\n if(!plotinfo) {\n // Fall back to _imageLowerLayer in case the requested subplot doesn't exist.\n // This can happen if you reference the image to an x / y axis combination\n // that doesn't have any data on it (and layer is below)\n imageDataBelow.push(img);\n continue;\n }\n\n if(plotinfo.mainplot) {\n subplot = plotinfo.mainplot.id;\n }\n\n if(!imageDataSubplot[subplot]) {\n imageDataSubplot[subplot] = [];\n }\n imageDataSubplot[subplot].push(img);\n } else if(img.layer === 'above') {\n imageDataAbove.push(img);\n } else {\n imageDataBelow.push(img);\n }\n }\n }\n\n\n var anchors = {\n x: {\n left: { sizing: 'xMin', offset: 0 },\n center: { sizing: 'xMid', offset: -1 / 2 },\n right: { sizing: 'xMax', offset: -1 }\n },\n y: {\n top: { sizing: 'YMin', offset: 0 },\n middle: { sizing: 'YMid', offset: -1 / 2 },\n bottom: { sizing: 'YMax', offset: -1 }\n }\n };\n\n\n // Images must be converted to dataURL's for exporting.\n function setImage(d) {\n var thisImage = d3.select(this);\n\n if(this.img && this.img.src === d.source) {\n return;\n }\n\n thisImage.attr('xmlns', xmlnsNamespaces.svg);\n\n var imagePromise = new Promise(function(resolve) {\n\n var img = new Image();\n this.img = img;\n\n // If not set, a `tainted canvas` error is thrown\n img.setAttribute('crossOrigin', 'anonymous');\n img.onerror = errorHandler;\n img.onload = function() {\n var canvas = document.createElement('canvas');\n canvas.width = this.width;\n canvas.height = this.height;\n\n var ctx = canvas.getContext('2d');\n ctx.drawImage(this, 0, 0);\n\n var dataURL = canvas.toDataURL('image/png');\n\n thisImage.attr('xlink:href', dataURL);\n\n // resolve promise in onload handler instead of on 'load' to support IE11\n // see https://github.com/plotly/plotly.js/issues/1685\n // for more details\n resolve();\n };\n\n\n thisImage.on('error', errorHandler);\n\n img.src = d.source;\n\n function errorHandler() {\n thisImage.remove();\n resolve();\n }\n }.bind(this));\n\n gd._promises.push(imagePromise);\n }\n\n function applyAttributes(d) {\n var thisImage = d3.select(this);\n\n // Axes if specified\n var xa = Axes.getFromId(gd, d.xref),\n ya = Axes.getFromId(gd, d.yref);\n\n var size = fullLayout._size,\n width = xa ? Math.abs(xa.l2p(d.sizex) - xa.l2p(0)) : d.sizex * size.w,\n height = ya ? Math.abs(ya.l2p(d.sizey) - ya.l2p(0)) : d.sizey * size.h;\n\n // Offsets for anchor positioning\n var xOffset = width * anchors.x[d.xanchor].offset,\n yOffset = height * anchors.y[d.yanchor].offset;\n\n var sizing = anchors.x[d.xanchor].sizing + anchors.y[d.yanchor].sizing;\n\n // Final positions\n var xPos = (xa ? xa.r2p(d.x) + xa._offset : d.x * size.w + size.l) + xOffset,\n yPos = (ya ? ya.r2p(d.y) + ya._offset : size.h - d.y * size.h + size.t) + yOffset;\n\n\n // Construct the proper aspectRatio attribute\n switch(d.sizing) {\n case 'fill':\n sizing += ' slice';\n break;\n\n case 'stretch':\n sizing = 'none';\n break;\n }\n\n thisImage.attr({\n x: xPos,\n y: yPos,\n width: width,\n height: height,\n preserveAspectRatio: sizing,\n opacity: d.opacity\n });\n\n\n // Set proper clipping on images\n var xId = xa ? xa._id : '',\n yId = ya ? ya._id : '',\n clipAxes = xId + yId;\n\n thisImage.call(Drawing.setClipUrl, clipAxes ?\n ('clip' + fullLayout._uid + clipAxes) :\n null\n );\n }\n\n var imagesBelow = fullLayout._imageLowerLayer.selectAll('image')\n .data(imageDataBelow),\n imagesAbove = fullLayout._imageUpperLayer.selectAll('image')\n .data(imageDataAbove);\n\n imagesBelow.enter().append('image');\n imagesAbove.enter().append('image');\n\n imagesBelow.exit().remove();\n imagesAbove.exit().remove();\n\n imagesBelow.each(function(d) {\n setImage.bind(this)(d);\n applyAttributes.bind(this)(d);\n });\n imagesAbove.each(function(d) {\n setImage.bind(this)(d);\n applyAttributes.bind(this)(d);\n });\n\n var allSubplots = Object.keys(fullLayout._plots);\n for(i = 0; i < allSubplots.length; i++) {\n subplot = allSubplots[i];\n var subplotObj = fullLayout._plots[subplot];\n\n // filter out overlaid plots (which havd their images on the main plot)\n // and gl2d plots (which don't support below images, at least not yet)\n if(!subplotObj.imagelayer) continue;\n\n var imagesOnSubplot = subplotObj.imagelayer.selectAll('image')\n // even if there are no images on this subplot, we need to run\n // enter and exit in case there were previously\n .data(imageDataSubplot[subplot] || []);\n\n imagesOnSubplot.enter().append('image');\n imagesOnSubplot.exit().remove();\n\n imagesOnSubplot.each(function(d) {\n setImage.bind(this)(d);\n applyAttributes.bind(this)(d);\n });\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/images/draw.js\n// module id = 481\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar toLogRange = require('../../lib/to_log_range');\n\n/*\n * convertCoords: when converting an axis between log and linear\n * you need to alter any images on that axis to keep them\n * pointing at the same data point.\n * In v2.0 this will become obsolete (or perhaps size will still need conversion?)\n * we convert size by declaring that the maximum extent *in data units* should be\n * the same, assuming the image is anchored by its center (could remove that restriction\n * if we think it's important) even though the actual left and right values will not be\n * quite the same since the scale becomes nonlinear (and central anchor means the pixel\n * center of the image, not the data units center)\n *\n * gd: the plot div\n * ax: the axis being changed\n * newType: the type it's getting\n * doExtra: function(attr, val) from inside relayout that sets the attribute.\n * Use this to make the changes as it's aware if any other changes in the\n * same relayout call should override this conversion.\n */\nmodule.exports = function convertCoords(gd, ax, newType, doExtra) {\n ax = ax || {};\n\n var toLog = (newType === 'log') && (ax.type === 'linear'),\n fromLog = (newType === 'linear') && (ax.type === 'log');\n\n if(!(toLog || fromLog)) return;\n\n var images = gd._fullLayout.images,\n axLetter = ax._id.charAt(0),\n image,\n attrPrefix;\n\n for(var i = 0; i < images.length; i++) {\n image = images[i];\n attrPrefix = 'images[' + i + '].';\n\n if(image[axLetter + 'ref'] === ax._id) {\n var currentPos = image[axLetter],\n currentSize = image['size' + axLetter],\n newPos = null,\n newSize = null;\n\n if(toLog) {\n newPos = toLogRange(currentPos, ax.range);\n\n // this is the inverse of the conversion we do in fromLog below\n // so that the conversion is reversible (notice the fromLog conversion\n // is like sinh, and this one looks like arcsinh)\n var dx = currentSize / Math.pow(10, newPos) / 2;\n newSize = 2 * Math.log(dx + Math.sqrt(1 + dx * dx)) / Math.LN10;\n }\n else {\n newPos = Math.pow(10, currentPos);\n newSize = newPos * (Math.pow(10, currentSize / 2) - Math.pow(10, -currentSize / 2));\n }\n\n // if conversion failed, delete the value so it can get a default later on\n if(!isNumeric(newPos)) {\n newPos = null;\n newSize = null;\n }\n else if(!isNumeric(newSize)) newSize = null;\n\n doExtra(attrPrefix + axLetter, newPos);\n doExtra(attrPrefix + 'size' + axLetter, newSize);\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/images/convert_coords.js\n// module id = 482\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = require('./constants');\n\nmodule.exports = {\n moduleType: 'component',\n name: constants.name,\n\n layoutAttributes: require('./attributes'),\n supplyLayoutDefaults: require('./defaults'),\n\n draw: require('./draw')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/updatemenus/index.js\n// module id = 483\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar handleArrayContainerDefaults = require('../../plots/array_container_defaults');\n\nvar attributes = require('./attributes');\nvar constants = require('./constants');\n\nvar name = constants.name;\nvar buttonAttrs = attributes.buttons;\n\n\nmodule.exports = function updateMenusDefaults(layoutIn, layoutOut) {\n var opts = {\n name: name,\n handleItemDefaults: menuDefaults\n };\n\n handleArrayContainerDefaults(layoutIn, layoutOut, opts);\n};\n\nfunction menuDefaults(menuIn, menuOut, layoutOut) {\n\n function coerce(attr, dflt) {\n return Lib.coerce(menuIn, menuOut, attributes, attr, dflt);\n }\n\n var buttons = buttonsDefaults(menuIn, menuOut);\n\n var visible = coerce('visible', buttons.length > 0);\n if(!visible) return;\n\n coerce('active');\n coerce('direction');\n coerce('type');\n coerce('showactive');\n\n coerce('x');\n coerce('y');\n Lib.noneOrAll(menuIn, menuOut, ['x', 'y']);\n\n coerce('xanchor');\n coerce('yanchor');\n\n coerce('pad.t');\n coerce('pad.r');\n coerce('pad.b');\n coerce('pad.l');\n\n Lib.coerceFont(coerce, 'font', layoutOut.font);\n\n coerce('bgcolor', layoutOut.paper_bgcolor);\n coerce('bordercolor');\n coerce('borderwidth');\n}\n\nfunction buttonsDefaults(menuIn, menuOut) {\n var buttonsIn = menuIn.buttons || [],\n buttonsOut = menuOut.buttons = [];\n\n var buttonIn, buttonOut;\n\n function coerce(attr, dflt) {\n return Lib.coerce(buttonIn, buttonOut, buttonAttrs, attr, dflt);\n }\n\n for(var i = 0; i < buttonsIn.length; i++) {\n buttonIn = buttonsIn[i];\n buttonOut = {};\n\n coerce('method');\n\n if(!Lib.isPlainObject(buttonIn) || (buttonOut.method !== 'skip' && !Array.isArray(buttonIn.args))) {\n continue;\n }\n\n coerce('args');\n coerce('label');\n coerce('execute');\n\n buttonOut._index = i;\n buttonsOut.push(buttonOut);\n }\n\n return buttonsOut;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/updatemenus/defaults.js\n// module id = 484\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Plots = require('../../plots/plots');\nvar Color = require('../color');\nvar Drawing = require('../drawing');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar anchorUtils = require('../legend/anchor_utils');\n\nvar LINE_SPACING = require('../../constants/alignment').LINE_SPACING;\n\nvar constants = require('./constants');\nvar ScrollBox = require('./scrollbox');\n\nmodule.exports = function draw(gd) {\n var fullLayout = gd._fullLayout,\n menuData = makeMenuData(fullLayout);\n\n /* Update menu data is bound to the header-group.\n * The items in the header group are always present.\n *\n * Upon clicking on a header its corresponding button\n * data is bound to the button-group.\n *\n * We draw all headers in one group before all buttons\n * so that the buttons *always* appear above the headers.\n *\n * Note that only one set of buttons are visible at once.\n *\n * \n *\n * \n * \n * \n * \n * \n * \n * ...\n *\n * \n * \n * \n * ...\n */\n\n // draw update menu container\n var menus = fullLayout._infolayer\n .selectAll('g.' + constants.containerClassName)\n .data(menuData.length > 0 ? [0] : []);\n\n menus.enter().append('g')\n .classed(constants.containerClassName, true)\n .style('cursor', 'pointer');\n\n menus.exit().remove();\n\n // remove push margin object(s)\n if(menus.exit().size()) clearPushMargins(gd);\n\n // return early if no update menus are visible\n if(menuData.length === 0) return;\n\n // join header group\n var headerGroups = menus.selectAll('g.' + constants.headerGroupClassName)\n .data(menuData, keyFunction);\n\n headerGroups.enter().append('g')\n .classed(constants.headerGroupClassName, true);\n\n // draw dropdown button container\n var gButton = menus.selectAll('g.' + constants.dropdownButtonGroupClassName)\n .data([0]);\n\n gButton.enter().append('g')\n .classed(constants.dropdownButtonGroupClassName, true)\n .style('pointer-events', 'all');\n\n // find dimensions before plotting anything (this mutates menuOpts)\n for(var i = 0; i < menuData.length; i++) {\n var menuOpts = menuData[i];\n findDimensions(gd, menuOpts);\n }\n\n // setup scrollbox\n var scrollBoxId = 'updatemenus' + fullLayout._uid,\n scrollBox = new ScrollBox(gd, gButton, scrollBoxId);\n\n // remove exiting header, remove dropped buttons and reset margins\n if(headerGroups.enter().size()) {\n gButton\n .call(removeAllButtons)\n .attr(constants.menuIndexAttrName, '-1');\n }\n\n headerGroups.exit().each(function(menuOpts) {\n d3.select(this).remove();\n\n gButton\n .call(removeAllButtons)\n .attr(constants.menuIndexAttrName, '-1');\n\n Plots.autoMargin(gd, constants.autoMarginIdRoot + menuOpts._index);\n });\n\n // draw headers!\n headerGroups.each(function(menuOpts) {\n var gHeader = d3.select(this);\n\n var _gButton = menuOpts.type === 'dropdown' ? gButton : null;\n Plots.manageCommandObserver(gd, menuOpts, menuOpts.buttons, function(data) {\n setActive(gd, menuOpts, menuOpts.buttons[data.index], gHeader, _gButton, scrollBox, data.index, true);\n });\n\n if(menuOpts.type === 'dropdown') {\n drawHeader(gd, gHeader, gButton, scrollBox, menuOpts);\n\n // if this menu is active, update the dropdown container\n if(isActive(gButton, menuOpts)) {\n drawButtons(gd, gHeader, gButton, scrollBox, menuOpts);\n }\n } else {\n drawButtons(gd, gHeader, null, null, menuOpts);\n }\n\n });\n};\n\nfunction makeMenuData(fullLayout) {\n var contOpts = fullLayout[constants.name],\n menuData = [];\n\n // Filter visible dropdowns and attach '_index' to each\n // fullLayout options object to be used for 'object constancy'\n // in the data join key function.\n\n for(var i = 0; i < contOpts.length; i++) {\n var item = contOpts[i];\n\n if(item.visible) menuData.push(item);\n }\n\n return menuData;\n}\n\n// Note that '_index' is set at the default step,\n// it corresponds to the menu index in the user layout update menu container.\n// Because a menu can b set invisible,\n// this is a more 'consistent' field than the index in the menuData.\nfunction keyFunction(menuOpts) {\n return menuOpts._index;\n}\n\nfunction isFolded(gButton) {\n return +gButton.attr(constants.menuIndexAttrName) === -1;\n}\n\nfunction isActive(gButton, menuOpts) {\n return +gButton.attr(constants.menuIndexAttrName) === menuOpts._index;\n}\n\nfunction setActive(gd, menuOpts, buttonOpts, gHeader, gButton, scrollBox, buttonIndex, isSilentUpdate) {\n // update 'active' attribute in menuOpts\n menuOpts._input.active = menuOpts.active = buttonIndex;\n\n if(menuOpts.type === 'buttons') {\n drawButtons(gd, gHeader, null, null, menuOpts);\n }\n else if(menuOpts.type === 'dropdown') {\n // fold up buttons and redraw header\n gButton.attr(constants.menuIndexAttrName, '-1');\n\n drawHeader(gd, gHeader, gButton, scrollBox, menuOpts);\n\n if(!isSilentUpdate) {\n drawButtons(gd, gHeader, gButton, scrollBox, menuOpts);\n }\n }\n}\n\nfunction drawHeader(gd, gHeader, gButton, scrollBox, menuOpts) {\n var header = gHeader.selectAll('g.' + constants.headerClassName)\n .data([0]);\n\n header.enter().append('g')\n .classed(constants.headerClassName, true)\n .style('pointer-events', 'all');\n\n var active = menuOpts.active,\n headerOpts = menuOpts.buttons[active] || constants.blankHeaderOpts,\n posOpts = { y: menuOpts.pad.t, yPad: 0, x: menuOpts.pad.l, xPad: 0, index: 0 },\n positionOverrides = {\n width: menuOpts.headerWidth,\n height: menuOpts.headerHeight\n };\n\n header\n .call(drawItem, menuOpts, headerOpts, gd)\n .call(setItemPosition, menuOpts, posOpts, positionOverrides);\n\n // draw drop arrow at the right edge\n var arrow = gHeader.selectAll('text.' + constants.headerArrowClassName)\n .data([0]);\n\n arrow.enter().append('text')\n .classed(constants.headerArrowClassName, true)\n .classed('user-select-none', true)\n .attr('text-anchor', 'end')\n .call(Drawing.font, menuOpts.font)\n .text(constants.arrowSymbol[menuOpts.direction]);\n\n arrow.attr({\n x: menuOpts.headerWidth - constants.arrowOffsetX + menuOpts.pad.l,\n y: menuOpts.headerHeight / 2 + constants.textOffsetY + menuOpts.pad.t\n });\n\n header.on('click', function() {\n gButton.call(removeAllButtons);\n\n\n // if this menu is active, fold the dropdown container\n // otherwise, make this menu active\n gButton.attr(\n constants.menuIndexAttrName,\n isActive(gButton, menuOpts) ?\n -1 :\n String(menuOpts._index)\n );\n\n drawButtons(gd, gHeader, gButton, scrollBox, menuOpts);\n });\n\n header.on('mouseover', function() {\n header.call(styleOnMouseOver);\n });\n\n header.on('mouseout', function() {\n header.call(styleOnMouseOut, menuOpts);\n });\n\n // translate header group\n Drawing.setTranslate(gHeader, menuOpts.lx, menuOpts.ly);\n}\n\nfunction drawButtons(gd, gHeader, gButton, scrollBox, menuOpts) {\n // If this is a set of buttons, set pointer events = all since we play\n // some minor games with which container is which in order to simplify\n // the drawing of *either* buttons or menus\n if(!gButton) {\n gButton = gHeader;\n gButton.attr('pointer-events', 'all');\n }\n\n var buttonData = (!isFolded(gButton) || menuOpts.type === 'buttons') ?\n menuOpts.buttons :\n [];\n\n var klass = menuOpts.type === 'dropdown' ? constants.dropdownButtonClassName : constants.buttonClassName;\n\n var buttons = gButton.selectAll('g.' + klass)\n .data(buttonData);\n\n var enter = buttons.enter().append('g')\n .classed(klass, true);\n\n var exit = buttons.exit();\n\n if(menuOpts.type === 'dropdown') {\n enter.attr('opacity', '0')\n .transition()\n .attr('opacity', '1');\n\n exit.transition()\n .attr('opacity', '0')\n .remove();\n } else {\n exit.remove();\n }\n\n var x0 = 0;\n var y0 = 0;\n\n var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n\n if(menuOpts.type === 'dropdown') {\n if(isVertical) {\n y0 = menuOpts.headerHeight + constants.gapButtonHeader;\n } else {\n x0 = menuOpts.headerWidth + constants.gapButtonHeader;\n }\n }\n\n if(menuOpts.type === 'dropdown' && menuOpts.direction === 'up') {\n y0 = -constants.gapButtonHeader + constants.gapButton - menuOpts.openHeight;\n }\n\n if(menuOpts.type === 'dropdown' && menuOpts.direction === 'left') {\n x0 = -constants.gapButtonHeader + constants.gapButton - menuOpts.openWidth;\n }\n\n var posOpts = {\n x: menuOpts.lx + x0 + menuOpts.pad.l,\n y: menuOpts.ly + y0 + menuOpts.pad.t,\n yPad: constants.gapButton,\n xPad: constants.gapButton,\n index: 0,\n };\n\n var scrollBoxPosition = {\n l: posOpts.x + menuOpts.borderwidth,\n t: posOpts.y + menuOpts.borderwidth\n };\n\n buttons.each(function(buttonOpts, buttonIndex) {\n var button = d3.select(this);\n\n button\n .call(drawItem, menuOpts, buttonOpts, gd)\n .call(setItemPosition, menuOpts, posOpts);\n\n button.on('click', function() {\n // skip `dragend` events\n if(d3.event.defaultPrevented) return;\n\n setActive(gd, menuOpts, buttonOpts, gHeader, gButton, scrollBox, buttonIndex);\n\n if(buttonOpts.execute) {\n Plots.executeAPICommand(gd, buttonOpts.method, buttonOpts.args);\n }\n\n gd.emit('plotly_buttonclicked', {menu: menuOpts, button: buttonOpts, active: menuOpts.active});\n });\n\n button.on('mouseover', function() {\n button.call(styleOnMouseOver);\n });\n\n button.on('mouseout', function() {\n button.call(styleOnMouseOut, menuOpts);\n buttons.call(styleButtons, menuOpts);\n });\n });\n\n buttons.call(styleButtons, menuOpts);\n\n if(isVertical) {\n scrollBoxPosition.w = Math.max(menuOpts.openWidth, menuOpts.headerWidth);\n scrollBoxPosition.h = posOpts.y - scrollBoxPosition.t;\n }\n else {\n scrollBoxPosition.w = posOpts.x - scrollBoxPosition.l;\n scrollBoxPosition.h = Math.max(menuOpts.openHeight, menuOpts.headerHeight);\n }\n\n scrollBoxPosition.direction = menuOpts.direction;\n\n if(scrollBox) {\n if(buttons.size()) {\n drawScrollBox(gd, gHeader, gButton, scrollBox, menuOpts, scrollBoxPosition);\n }\n else {\n hideScrollBox(scrollBox);\n }\n }\n}\n\nfunction drawScrollBox(gd, gHeader, gButton, scrollBox, menuOpts, position) {\n // enable the scrollbox\n var direction = menuOpts.direction,\n isVertical = (direction === 'up' || direction === 'down');\n\n var active = menuOpts.active,\n translateX, translateY,\n i;\n if(isVertical) {\n translateY = 0;\n for(i = 0; i < active; i++) {\n translateY += menuOpts.heights[i] + constants.gapButton;\n }\n }\n else {\n translateX = 0;\n for(i = 0; i < active; i++) {\n translateX += menuOpts.widths[i] + constants.gapButton;\n }\n }\n\n scrollBox.enable(position, translateX, translateY);\n\n if(scrollBox.hbar) {\n scrollBox.hbar\n .attr('opacity', '0')\n .transition()\n .attr('opacity', '1');\n }\n\n if(scrollBox.vbar) {\n scrollBox.vbar\n .attr('opacity', '0')\n .transition()\n .attr('opacity', '1');\n }\n}\n\nfunction hideScrollBox(scrollBox) {\n var hasHBar = !!scrollBox.hbar,\n hasVBar = !!scrollBox.vbar;\n\n if(hasHBar) {\n scrollBox.hbar\n .transition()\n .attr('opacity', '0')\n .each('end', function() {\n hasHBar = false;\n if(!hasVBar) scrollBox.disable();\n });\n }\n\n if(hasVBar) {\n scrollBox.vbar\n .transition()\n .attr('opacity', '0')\n .each('end', function() {\n hasVBar = false;\n if(!hasHBar) scrollBox.disable();\n });\n }\n}\n\nfunction drawItem(item, menuOpts, itemOpts, gd) {\n item.call(drawItemRect, menuOpts)\n .call(drawItemText, menuOpts, itemOpts, gd);\n}\n\nfunction drawItemRect(item, menuOpts) {\n var rect = item.selectAll('rect')\n .data([0]);\n\n rect.enter().append('rect')\n .classed(constants.itemRectClassName, true)\n .attr({\n rx: constants.rx,\n ry: constants.ry,\n 'shape-rendering': 'crispEdges'\n });\n\n rect.call(Color.stroke, menuOpts.bordercolor)\n .call(Color.fill, menuOpts.bgcolor)\n .style('stroke-width', menuOpts.borderwidth + 'px');\n}\n\nfunction drawItemText(item, menuOpts, itemOpts, gd) {\n var text = item.selectAll('text')\n .data([0]);\n\n text.enter().append('text')\n .classed(constants.itemTextClassName, true)\n .classed('user-select-none', true)\n .attr({\n 'text-anchor': 'start',\n 'data-notex': 1\n });\n\n text.call(Drawing.font, menuOpts.font)\n .text(itemOpts.label)\n .call(svgTextUtils.convertToTspans, gd);\n}\n\nfunction styleButtons(buttons, menuOpts) {\n var active = menuOpts.active;\n\n buttons.each(function(buttonOpts, i) {\n var button = d3.select(this);\n\n if(i === active && menuOpts.showactive) {\n button.select('rect.' + constants.itemRectClassName)\n .call(Color.fill, constants.activeColor);\n }\n });\n}\n\nfunction styleOnMouseOver(item) {\n item.select('rect.' + constants.itemRectClassName)\n .call(Color.fill, constants.hoverColor);\n}\n\nfunction styleOnMouseOut(item, menuOpts) {\n item.select('rect.' + constants.itemRectClassName)\n .call(Color.fill, menuOpts.bgcolor);\n}\n\n// find item dimensions (this mutates menuOpts)\nfunction findDimensions(gd, menuOpts) {\n menuOpts.width1 = 0;\n menuOpts.height1 = 0;\n menuOpts.heights = [];\n menuOpts.widths = [];\n menuOpts.totalWidth = 0;\n menuOpts.totalHeight = 0;\n menuOpts.openWidth = 0;\n menuOpts.openHeight = 0;\n menuOpts.lx = 0;\n menuOpts.ly = 0;\n\n var fakeButtons = Drawing.tester.selectAll('g.' + constants.dropdownButtonClassName)\n .data(menuOpts.buttons);\n\n fakeButtons.enter().append('g')\n .classed(constants.dropdownButtonClassName, true);\n\n var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n\n // loop over fake buttons to find width / height\n fakeButtons.each(function(buttonOpts, i) {\n var button = d3.select(this);\n\n button.call(drawItem, menuOpts, buttonOpts, gd);\n\n var text = button.select('.' + constants.itemTextClassName);\n\n // width is given by max width of all buttons\n var tWidth = text.node() && Drawing.bBox(text.node()).width;\n var wEff = Math.max(tWidth + constants.textPadX, constants.minWidth);\n\n // height is determined by item text\n var tHeight = menuOpts.font.size * LINE_SPACING;\n var tLines = svgTextUtils.lineCount(text);\n var hEff = Math.max(tHeight * tLines, constants.minHeight) + constants.textOffsetY;\n\n hEff = Math.ceil(hEff);\n wEff = Math.ceil(wEff);\n\n // Store per-item sizes since a row of horizontal buttons, for example,\n // don't all need to be the same width:\n menuOpts.widths[i] = wEff;\n menuOpts.heights[i] = hEff;\n\n // Height and width of individual element:\n menuOpts.height1 = Math.max(menuOpts.height1, hEff);\n menuOpts.width1 = Math.max(menuOpts.width1, wEff);\n\n if(isVertical) {\n menuOpts.totalWidth = Math.max(menuOpts.totalWidth, wEff);\n menuOpts.openWidth = menuOpts.totalWidth;\n menuOpts.totalHeight += hEff + constants.gapButton;\n menuOpts.openHeight += hEff + constants.gapButton;\n } else {\n menuOpts.totalWidth += wEff + constants.gapButton;\n menuOpts.openWidth += wEff + constants.gapButton;\n menuOpts.totalHeight = Math.max(menuOpts.totalHeight, hEff);\n menuOpts.openHeight = menuOpts.totalHeight;\n }\n });\n\n if(isVertical) {\n menuOpts.totalHeight -= constants.gapButton;\n } else {\n menuOpts.totalWidth -= constants.gapButton;\n }\n\n\n menuOpts.headerWidth = menuOpts.width1 + constants.arrowPadX;\n menuOpts.headerHeight = menuOpts.height1;\n\n if(menuOpts.type === 'dropdown') {\n if(isVertical) {\n menuOpts.width1 += constants.arrowPadX;\n menuOpts.totalHeight = menuOpts.height1;\n } else {\n menuOpts.totalWidth = menuOpts.width1;\n }\n menuOpts.totalWidth += constants.arrowPadX;\n }\n\n fakeButtons.remove();\n\n var paddedWidth = menuOpts.totalWidth + menuOpts.pad.l + menuOpts.pad.r;\n var paddedHeight = menuOpts.totalHeight + menuOpts.pad.t + menuOpts.pad.b;\n\n var graphSize = gd._fullLayout._size;\n menuOpts.lx = graphSize.l + graphSize.w * menuOpts.x;\n menuOpts.ly = graphSize.t + graphSize.h * (1 - menuOpts.y);\n\n var xanchor = 'left';\n if(anchorUtils.isRightAnchor(menuOpts)) {\n menuOpts.lx -= paddedWidth;\n xanchor = 'right';\n }\n if(anchorUtils.isCenterAnchor(menuOpts)) {\n menuOpts.lx -= paddedWidth / 2;\n xanchor = 'center';\n }\n\n var yanchor = 'top';\n if(anchorUtils.isBottomAnchor(menuOpts)) {\n menuOpts.ly -= paddedHeight;\n yanchor = 'bottom';\n }\n if(anchorUtils.isMiddleAnchor(menuOpts)) {\n menuOpts.ly -= paddedHeight / 2;\n yanchor = 'middle';\n }\n\n menuOpts.totalWidth = Math.ceil(menuOpts.totalWidth);\n menuOpts.totalHeight = Math.ceil(menuOpts.totalHeight);\n menuOpts.lx = Math.round(menuOpts.lx);\n menuOpts.ly = Math.round(menuOpts.ly);\n\n Plots.autoMargin(gd, constants.autoMarginIdRoot + menuOpts._index, {\n x: menuOpts.x,\n y: menuOpts.y,\n l: paddedWidth * ({right: 1, center: 0.5}[xanchor] || 0),\n r: paddedWidth * ({left: 1, center: 0.5}[xanchor] || 0),\n b: paddedHeight * ({top: 1, middle: 0.5}[yanchor] || 0),\n t: paddedHeight * ({bottom: 1, middle: 0.5}[yanchor] || 0)\n });\n}\n\n// set item positions (mutates posOpts)\nfunction setItemPosition(item, menuOpts, posOpts, overrideOpts) {\n overrideOpts = overrideOpts || {};\n var rect = item.select('.' + constants.itemRectClassName);\n var text = item.select('.' + constants.itemTextClassName);\n var borderWidth = menuOpts.borderwidth;\n var index = posOpts.index;\n\n Drawing.setTranslate(item, borderWidth + posOpts.x, borderWidth + posOpts.y);\n\n var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n var finalHeight = overrideOpts.height || (isVertical ? menuOpts.heights[index] : menuOpts.height1);\n\n rect.attr({\n x: 0,\n y: 0,\n width: overrideOpts.width || (isVertical ? menuOpts.width1 : menuOpts.widths[index]),\n height: finalHeight\n });\n\n var tHeight = menuOpts.font.size * LINE_SPACING;\n var tLines = svgTextUtils.lineCount(text);\n var spanOffset = ((tLines - 1) * tHeight / 2);\n\n svgTextUtils.positionText(text, constants.textOffsetX,\n finalHeight / 2 - spanOffset + constants.textOffsetY);\n\n if(isVertical) {\n posOpts.y += menuOpts.heights[index] + posOpts.yPad;\n } else {\n posOpts.x += menuOpts.widths[index] + posOpts.xPad;\n }\n\n posOpts.index++;\n}\n\nfunction removeAllButtons(gButton) {\n gButton.selectAll('g.' + constants.dropdownButtonClassName).remove();\n}\n\nfunction clearPushMargins(gd) {\n var pushMargins = gd._fullLayout._pushmargin || {};\n var keys = Object.keys(pushMargins);\n\n for(var i = 0; i < keys.length; i++) {\n var k = keys[i];\n\n if(k.indexOf(constants.autoMarginIdRoot) !== -1) {\n Plots.autoMargin(gd, k);\n }\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/updatemenus/draw.js\n// module id = 485\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = ScrollBox;\n\nvar d3 = require('d3');\n\nvar Color = require('../color');\nvar Drawing = require('../drawing');\n\nvar Lib = require('../../lib');\n\n/**\n * Helper class to setup a scroll box\n *\n * @class\n * @param gd Plotly's graph div\n * @param container Container to be scroll-boxed (as a D3 selection)\n * @param {string} id Id for the clip path to implement the scroll box\n */\nfunction ScrollBox(gd, container, id) {\n this.gd = gd;\n this.container = container;\n this.id = id;\n\n // See ScrollBox.prototype.enable for further definition\n this.position = null; // scrollbox position\n this.translateX = null; // scrollbox horizontal translation\n this.translateY = null; // scrollbox vertical translation\n this.hbar = null; // horizontal scrollbar D3 selection\n this.vbar = null; // vertical scrollbar D3 selection\n\n // element to capture pointer events\n this.bg = this.container.selectAll('rect.scrollbox-bg').data([0]);\n\n this.bg.exit()\n .on('.drag', null)\n .on('wheel', null)\n .remove();\n\n this.bg.enter().append('rect')\n .classed('scrollbox-bg', true)\n .style('pointer-events', 'all')\n .attr({\n opacity: 0,\n x: 0,\n y: 0,\n width: 0,\n height: 0\n });\n}\n\n// scroll bar dimensions\nScrollBox.barWidth = 2;\nScrollBox.barLength = 20;\nScrollBox.barRadius = 2;\nScrollBox.barPad = 1;\nScrollBox.barColor = '#808BA4';\n\n/**\n * If needed, setup a clip path and scrollbars\n *\n * @method\n * @param {Object} position\n * @param {number} position.l Left side position (in pixels)\n * @param {number} position.t Top side (in pixels)\n * @param {number} position.w Width (in pixels)\n * @param {number} position.h Height (in pixels)\n * @param {string} [position.direction='down']\n * Either 'down', 'left', 'right' or 'up'\n * @param {number} [translateX=0] Horizontal offset (in pixels)\n * @param {number} [translateY=0] Vertical offset (in pixels)\n */\nScrollBox.prototype.enable = function enable(position, translateX, translateY) {\n var fullLayout = this.gd._fullLayout,\n fullWidth = fullLayout.width,\n fullHeight = fullLayout.height;\n\n // compute position of scrollbox\n this.position = position;\n\n var l = this.position.l,\n w = this.position.w,\n t = this.position.t,\n h = this.position.h,\n direction = this.position.direction,\n isDown = (direction === 'down'),\n isLeft = (direction === 'left'),\n isRight = (direction === 'right'),\n isUp = (direction === 'up'),\n boxW = w,\n boxH = h,\n boxL, boxR,\n boxT, boxB;\n\n if(!isDown && !isLeft && !isRight && !isUp) {\n this.position.direction = 'down';\n isDown = true;\n }\n\n var isVertical = isDown || isUp;\n if(isVertical) {\n boxL = l;\n boxR = boxL + boxW;\n\n if(isDown) {\n // anchor to top side\n boxT = t;\n boxB = Math.min(boxT + boxH, fullHeight);\n boxH = boxB - boxT;\n }\n else {\n // anchor to bottom side\n boxB = t + boxH;\n boxT = Math.max(boxB - boxH, 0);\n boxH = boxB - boxT;\n }\n }\n else {\n boxT = t;\n boxB = boxT + boxH;\n\n if(isLeft) {\n // anchor to right side\n boxR = l + boxW;\n boxL = Math.max(boxR - boxW, 0);\n boxW = boxR - boxL;\n }\n else {\n // anchor to left side\n boxL = l;\n boxR = Math.min(boxL + boxW, fullWidth);\n boxW = boxR - boxL;\n }\n }\n\n this._box = {\n l: boxL,\n t: boxT,\n w: boxW,\n h: boxH\n };\n\n // compute position of horizontal scroll bar\n var needsHorizontalScrollBar = (w > boxW),\n hbarW = ScrollBox.barLength + 2 * ScrollBox.barPad,\n hbarH = ScrollBox.barWidth + 2 * ScrollBox.barPad,\n // draw horizontal scrollbar on the bottom side\n hbarL = l,\n hbarT = t + h;\n\n if(hbarT + hbarH > fullHeight) hbarT = fullHeight - hbarH;\n\n var hbar = this.container.selectAll('rect.scrollbar-horizontal').data(\n (needsHorizontalScrollBar) ? [0] : []);\n\n hbar.exit()\n .on('.drag', null)\n .remove();\n\n hbar.enter().append('rect')\n .classed('scrollbar-horizontal', true)\n .call(Color.fill, ScrollBox.barColor);\n\n if(needsHorizontalScrollBar) {\n this.hbar = hbar.attr({\n 'rx': ScrollBox.barRadius,\n 'ry': ScrollBox.barRadius,\n 'x': hbarL,\n 'y': hbarT,\n 'width': hbarW,\n 'height': hbarH\n });\n\n // hbar center moves between hbarXMin and hbarXMin + hbarTranslateMax\n this._hbarXMin = hbarL + hbarW / 2;\n this._hbarTranslateMax = boxW - hbarW;\n }\n else {\n delete this.hbar;\n delete this._hbarXMin;\n delete this._hbarTranslateMax;\n }\n\n // compute position of vertical scroll bar\n var needsVerticalScrollBar = (h > boxH),\n vbarW = ScrollBox.barWidth + 2 * ScrollBox.barPad,\n vbarH = ScrollBox.barLength + 2 * ScrollBox.barPad,\n // draw vertical scrollbar on the right side\n vbarL = l + w,\n vbarT = t;\n\n if(vbarL + vbarW > fullWidth) vbarL = fullWidth - vbarW;\n\n var vbar = this.container.selectAll('rect.scrollbar-vertical').data(\n (needsVerticalScrollBar) ? [0] : []);\n\n vbar.exit()\n .on('.drag', null)\n .remove();\n\n vbar.enter().append('rect')\n .classed('scrollbar-vertical', true)\n .call(Color.fill, ScrollBox.barColor);\n\n if(needsVerticalScrollBar) {\n this.vbar = vbar.attr({\n 'rx': ScrollBox.barRadius,\n 'ry': ScrollBox.barRadius,\n 'x': vbarL,\n 'y': vbarT,\n 'width': vbarW,\n 'height': vbarH\n });\n\n // vbar center moves between vbarYMin and vbarYMin + vbarTranslateMax\n this._vbarYMin = vbarT + vbarH / 2;\n this._vbarTranslateMax = boxH - vbarH;\n }\n else {\n delete this.vbar;\n delete this._vbarYMin;\n delete this._vbarTranslateMax;\n }\n\n // setup a clip path (if scroll bars are needed)\n var clipId = this.id,\n clipL = boxL - 0.5,\n clipR = (needsVerticalScrollBar) ? boxR + vbarW + 0.5 : boxR + 0.5,\n clipT = boxT - 0.5,\n clipB = (needsHorizontalScrollBar) ? boxB + hbarH + 0.5 : boxB + 0.5;\n\n var clipPath = fullLayout._topdefs.selectAll('#' + clipId)\n .data((needsHorizontalScrollBar || needsVerticalScrollBar) ? [0] : []);\n\n clipPath.exit().remove();\n\n clipPath.enter()\n .append('clipPath').attr('id', clipId)\n .append('rect');\n\n if(needsHorizontalScrollBar || needsVerticalScrollBar) {\n this._clipRect = clipPath.select('rect').attr({\n x: Math.floor(clipL),\n y: Math.floor(clipT),\n width: Math.ceil(clipR) - Math.floor(clipL),\n height: Math.ceil(clipB) - Math.floor(clipT)\n });\n\n this.container.call(Drawing.setClipUrl, clipId);\n\n this.bg.attr({\n x: l,\n y: t,\n width: w,\n height: h\n });\n }\n else {\n this.bg.attr({\n width: 0,\n height: 0\n });\n this.container\n .on('wheel', null)\n .on('.drag', null)\n .call(Drawing.setClipUrl, null);\n delete this._clipRect;\n }\n\n // set up drag listeners (if scroll bars are needed)\n if(needsHorizontalScrollBar || needsVerticalScrollBar) {\n var onBoxDrag = d3.behavior.drag()\n .on('dragstart', function() {\n d3.event.sourceEvent.preventDefault();\n })\n .on('drag', this._onBoxDrag.bind(this));\n\n this.container\n .on('wheel', null)\n .on('wheel', this._onBoxWheel.bind(this))\n .on('.drag', null)\n .call(onBoxDrag);\n\n var onBarDrag = d3.behavior.drag()\n .on('dragstart', function() {\n d3.event.sourceEvent.preventDefault();\n d3.event.sourceEvent.stopPropagation();\n })\n .on('drag', this._onBarDrag.bind(this));\n\n if(needsHorizontalScrollBar) {\n this.hbar\n .on('.drag', null)\n .call(onBarDrag);\n }\n\n if(needsVerticalScrollBar) {\n this.vbar\n .on('.drag', null)\n .call(onBarDrag);\n }\n }\n\n // set scrollbox translation\n this.setTranslate(translateX, translateY);\n};\n\n/**\n * If present, remove clip-path and scrollbars\n *\n * @method\n */\nScrollBox.prototype.disable = function disable() {\n if(this.hbar || this.vbar) {\n this.bg.attr({\n width: 0,\n height: 0\n });\n this.container\n .on('wheel', null)\n .on('.drag', null)\n .call(Drawing.setClipUrl, null);\n delete this._clipRect;\n }\n\n if(this.hbar) {\n this.hbar.on('.drag', null);\n this.hbar.remove();\n delete this.hbar;\n delete this._hbarXMin;\n delete this._hbarTranslateMax;\n }\n\n if(this.vbar) {\n this.vbar.on('.drag', null);\n this.vbar.remove();\n delete this.vbar;\n delete this._vbarYMin;\n delete this._vbarTranslateMax;\n }\n};\n\n/**\n * Handles scroll box drag events\n *\n * @method\n */\nScrollBox.prototype._onBoxDrag = function onBarDrag() {\n var translateX = this.translateX,\n translateY = this.translateY;\n\n if(this.hbar) {\n translateX -= d3.event.dx;\n }\n\n if(this.vbar) {\n translateY -= d3.event.dy;\n }\n\n this.setTranslate(translateX, translateY);\n};\n\n/**\n * Handles scroll box wheel events\n *\n * @method\n */\nScrollBox.prototype._onBoxWheel = function onBarWheel() {\n var translateX = this.translateX,\n translateY = this.translateY;\n\n if(this.hbar) {\n translateX += d3.event.deltaY;\n }\n\n if(this.vbar) {\n translateY += d3.event.deltaY;\n }\n\n this.setTranslate(translateX, translateY);\n};\n\n/**\n * Handles scroll bar drag events\n *\n * @method\n */\nScrollBox.prototype._onBarDrag = function onBarDrag() {\n var translateX = this.translateX,\n translateY = this.translateY;\n\n if(this.hbar) {\n var xMin = translateX + this._hbarXMin,\n xMax = xMin + this._hbarTranslateMax,\n x = Lib.constrain(d3.event.x, xMin, xMax),\n xf = (x - xMin) / (xMax - xMin);\n\n var translateXMax = this.position.w - this._box.w;\n\n translateX = xf * translateXMax;\n }\n\n if(this.vbar) {\n var yMin = translateY + this._vbarYMin,\n yMax = yMin + this._vbarTranslateMax,\n y = Lib.constrain(d3.event.y, yMin, yMax),\n yf = (y - yMin) / (yMax - yMin);\n\n var translateYMax = this.position.h - this._box.h;\n\n translateY = yf * translateYMax;\n }\n\n this.setTranslate(translateX, translateY);\n};\n\n/**\n * Set clip path and scroll bar translate transform\n *\n * @method\n * @param {number} [translateX=0] Horizontal offset (in pixels)\n * @param {number} [translateY=0] Vertical offset (in pixels)\n */\nScrollBox.prototype.setTranslate = function setTranslate(translateX, translateY) {\n // store translateX and translateY (needed by mouse event handlers)\n var translateXMax = this.position.w - this._box.w,\n translateYMax = this.position.h - this._box.h;\n\n translateX = Lib.constrain(translateX || 0, 0, translateXMax);\n translateY = Lib.constrain(translateY || 0, 0, translateYMax);\n\n this.translateX = translateX;\n this.translateY = translateY;\n\n this.container.call(Drawing.setTranslate,\n this._box.l - this.position.l - translateX,\n this._box.t - this.position.t - translateY);\n\n if(this._clipRect) {\n this._clipRect.attr({\n x: Math.floor(this.position.l + translateX - 0.5),\n y: Math.floor(this.position.t + translateY - 0.5)\n });\n }\n\n if(this.hbar) {\n var xf = translateX / translateXMax;\n\n this.hbar.call(Drawing.setTranslate,\n translateX + xf * this._hbarTranslateMax,\n translateY);\n }\n\n if(this.vbar) {\n var yf = translateY / translateYMax;\n\n this.vbar.call(Drawing.setTranslate,\n translateX,\n translateY + yf * this._vbarTranslateMax);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/updatemenus/scrollbox.js\n// module id = 486\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = require('./constants');\n\nmodule.exports = {\n moduleType: 'component',\n name: constants.name,\n\n layoutAttributes: require('./attributes'),\n supplyLayoutDefaults: require('./defaults'),\n\n draw: require('./draw')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/sliders/index.js\n// module id = 487\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar handleArrayContainerDefaults = require('../../plots/array_container_defaults');\n\nvar attributes = require('./attributes');\nvar constants = require('./constants');\n\nvar name = constants.name;\nvar stepAttrs = attributes.steps;\n\n\nmodule.exports = function slidersDefaults(layoutIn, layoutOut) {\n var opts = {\n name: name,\n handleItemDefaults: sliderDefaults\n };\n\n handleArrayContainerDefaults(layoutIn, layoutOut, opts);\n};\n\nfunction sliderDefaults(sliderIn, sliderOut, layoutOut) {\n\n function coerce(attr, dflt) {\n return Lib.coerce(sliderIn, sliderOut, attributes, attr, dflt);\n }\n\n var steps = stepsDefaults(sliderIn, sliderOut);\n\n var visible = coerce('visible', steps.length > 0);\n if(!visible) return;\n\n coerce('active');\n\n coerce('x');\n coerce('y');\n Lib.noneOrAll(sliderIn, sliderOut, ['x', 'y']);\n\n coerce('xanchor');\n coerce('yanchor');\n\n coerce('len');\n coerce('lenmode');\n\n coerce('pad.t');\n coerce('pad.r');\n coerce('pad.b');\n coerce('pad.l');\n\n Lib.coerceFont(coerce, 'font', layoutOut.font);\n\n var currentValueIsVisible = coerce('currentvalue.visible');\n\n if(currentValueIsVisible) {\n coerce('currentvalue.xanchor');\n coerce('currentvalue.prefix');\n coerce('currentvalue.suffix');\n coerce('currentvalue.offset');\n\n Lib.coerceFont(coerce, 'currentvalue.font', sliderOut.font);\n }\n\n coerce('transition.duration');\n coerce('transition.easing');\n\n coerce('bgcolor');\n coerce('activebgcolor');\n coerce('bordercolor');\n coerce('borderwidth');\n coerce('ticklen');\n coerce('tickwidth');\n coerce('tickcolor');\n coerce('minorticklen');\n}\n\nfunction stepsDefaults(sliderIn, sliderOut) {\n var valuesIn = sliderIn.steps || [],\n valuesOut = sliderOut.steps = [];\n\n var valueIn, valueOut;\n\n function coerce(attr, dflt) {\n return Lib.coerce(valueIn, valueOut, stepAttrs, attr, dflt);\n }\n\n for(var i = 0; i < valuesIn.length; i++) {\n valueIn = valuesIn[i];\n valueOut = {};\n\n coerce('method');\n\n if(!Lib.isPlainObject(valueIn) || (valueOut.method !== 'skip' && !Array.isArray(valueIn.args))) {\n continue;\n }\n\n coerce('args');\n coerce('label', 'step-' + i);\n coerce('value', valueOut.label);\n coerce('execute');\n\n valuesOut.push(valueOut);\n }\n\n return valuesOut;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/sliders/defaults.js\n// module id = 488\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Plots = require('../../plots/plots');\nvar Color = require('../color');\nvar Drawing = require('../drawing');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar anchorUtils = require('../legend/anchor_utils');\n\nvar constants = require('./constants');\nvar LINE_SPACING = require('../../constants/alignment').LINE_SPACING;\n\n\nmodule.exports = function draw(gd) {\n var fullLayout = gd._fullLayout,\n sliderData = makeSliderData(fullLayout, gd);\n\n // draw a container for *all* sliders:\n var sliders = fullLayout._infolayer\n .selectAll('g.' + constants.containerClassName)\n .data(sliderData.length > 0 ? [0] : []);\n\n sliders.enter().append('g')\n .classed(constants.containerClassName, true)\n .style('cursor', 'ew-resize');\n\n sliders.exit().remove();\n\n // If no more sliders, clear the margisn:\n if(sliders.exit().size()) clearPushMargins(gd);\n\n // Return early if no menus visible:\n if(sliderData.length === 0) return;\n\n var sliderGroups = sliders.selectAll('g.' + constants.groupClassName)\n .data(sliderData, keyFunction);\n\n sliderGroups.enter().append('g')\n .classed(constants.groupClassName, true);\n\n sliderGroups.exit().each(function(sliderOpts) {\n d3.select(this).remove();\n\n sliderOpts._commandObserver.remove();\n delete sliderOpts._commandObserver;\n\n Plots.autoMargin(gd, constants.autoMarginIdRoot + sliderOpts._index);\n });\n\n // Find the dimensions of the sliders:\n for(var i = 0; i < sliderData.length; i++) {\n var sliderOpts = sliderData[i];\n findDimensions(gd, sliderOpts);\n }\n\n sliderGroups.each(function(sliderOpts) {\n // If it has fewer than two options, it's not really a slider:\n if(sliderOpts.steps.length < 2) return;\n\n var gSlider = d3.select(this);\n\n computeLabelSteps(sliderOpts);\n\n Plots.manageCommandObserver(gd, sliderOpts, sliderOpts.steps, function(data) {\n // NB: Same as below. This is *not* always the same as sliderOpts since\n // if a new set of steps comes in, the reference in this callback would\n // be invalid. We need to refetch it from the slider group, which is\n // the join data that creates this slider. So if this slider still exists,\n // the group should be valid, *to the best of my knowledge.* If not,\n // we'd have to look it up by d3 data join index/key.\n var opts = gSlider.data()[0];\n\n if(opts.active === data.index) return;\n if(opts._dragging) return;\n\n setActive(gd, gSlider, opts, data.index, false, true);\n });\n\n drawSlider(gd, d3.select(this), sliderOpts);\n });\n};\n\n// This really only just filters by visibility:\nfunction makeSliderData(fullLayout, gd) {\n var contOpts = fullLayout[constants.name],\n sliderData = [];\n\n for(var i = 0; i < contOpts.length; i++) {\n var item = contOpts[i];\n if(!item.visible || !item.steps.length) continue;\n item.gd = gd;\n sliderData.push(item);\n }\n\n return sliderData;\n}\n\n// This is set in the defaults step:\nfunction keyFunction(opts) {\n return opts._index;\n}\n\n// Compute the dimensions (mutates sliderOpts):\nfunction findDimensions(gd, sliderOpts) {\n var sliderLabels = Drawing.tester.selectAll('g.' + constants.labelGroupClass)\n .data(sliderOpts.steps);\n\n sliderLabels.enter().append('g')\n .classed(constants.labelGroupClass, true);\n\n // loop over fake buttons to find width / height\n var maxLabelWidth = 0;\n var labelHeight = 0;\n sliderLabels.each(function(stepOpts) {\n var labelGroup = d3.select(this);\n\n var text = drawLabel(labelGroup, {step: stepOpts}, sliderOpts);\n\n var textNode = text.node();\n if(textNode) {\n var bBox = Drawing.bBox(textNode);\n labelHeight = Math.max(labelHeight, bBox.height);\n maxLabelWidth = Math.max(maxLabelWidth, bBox.width);\n }\n });\n\n sliderLabels.remove();\n\n sliderOpts.inputAreaWidth = Math.max(\n constants.railWidth,\n constants.gripHeight\n );\n\n // calculate some overall dimensions - some of these are needed for\n // calculating the currentValue dimensions\n var graphSize = gd._fullLayout._size;\n sliderOpts.lx = graphSize.l + graphSize.w * sliderOpts.x;\n sliderOpts.ly = graphSize.t + graphSize.h * (1 - sliderOpts.y);\n\n if(sliderOpts.lenmode === 'fraction') {\n // fraction:\n sliderOpts.outerLength = Math.round(graphSize.w * sliderOpts.len);\n } else {\n // pixels:\n sliderOpts.outerLength = sliderOpts.len;\n }\n\n // Set the length-wise padding so that the grip ends up *on* the end of\n // the bar when at either extreme\n sliderOpts.lenPad = Math.round(constants.gripWidth * 0.5);\n\n // The length of the rail, *excluding* padding on either end:\n sliderOpts.inputAreaStart = 0;\n sliderOpts.inputAreaLength = Math.round(sliderOpts.outerLength - sliderOpts.pad.l - sliderOpts.pad.r);\n\n var textableInputLength = sliderOpts.inputAreaLength - 2 * constants.stepInset;\n var availableSpacePerLabel = textableInputLength / (sliderOpts.steps.length - 1);\n var computedSpacePerLabel = maxLabelWidth + constants.labelPadding;\n sliderOpts.labelStride = Math.max(1, Math.ceil(computedSpacePerLabel / availableSpacePerLabel));\n sliderOpts.labelHeight = labelHeight;\n\n // loop over all possible values for currentValue to find the\n // area we need for it\n sliderOpts.currentValueMaxWidth = 0;\n sliderOpts.currentValueHeight = 0;\n sliderOpts.currentValueTotalHeight = 0;\n sliderOpts.currentValueMaxLines = 1;\n\n if(sliderOpts.currentvalue.visible) {\n // Get the dimensions of the current value label:\n var dummyGroup = Drawing.tester.append('g');\n\n sliderLabels.each(function(stepOpts) {\n var curValPrefix = drawCurrentValue(dummyGroup, sliderOpts, stepOpts.label);\n var curValSize = (curValPrefix.node() && Drawing.bBox(curValPrefix.node())) || {width: 0, height: 0};\n var lines = svgTextUtils.lineCount(curValPrefix);\n sliderOpts.currentValueMaxWidth = Math.max(sliderOpts.currentValueMaxWidth, Math.ceil(curValSize.width));\n sliderOpts.currentValueHeight = Math.max(sliderOpts.currentValueHeight, Math.ceil(curValSize.height));\n sliderOpts.currentValueMaxLines = Math.max(sliderOpts.currentValueMaxLines, lines);\n });\n\n sliderOpts.currentValueTotalHeight = sliderOpts.currentValueHeight + sliderOpts.currentvalue.offset;\n\n dummyGroup.remove();\n }\n\n sliderOpts.height = sliderOpts.currentValueTotalHeight + constants.tickOffset + sliderOpts.ticklen + constants.labelOffset + sliderOpts.labelHeight + sliderOpts.pad.t + sliderOpts.pad.b;\n\n var xanchor = 'left';\n if(anchorUtils.isRightAnchor(sliderOpts)) {\n sliderOpts.lx -= sliderOpts.outerLength;\n xanchor = 'right';\n }\n if(anchorUtils.isCenterAnchor(sliderOpts)) {\n sliderOpts.lx -= sliderOpts.outerLength / 2;\n xanchor = 'center';\n }\n\n var yanchor = 'top';\n if(anchorUtils.isBottomAnchor(sliderOpts)) {\n sliderOpts.ly -= sliderOpts.height;\n yanchor = 'bottom';\n }\n if(anchorUtils.isMiddleAnchor(sliderOpts)) {\n sliderOpts.ly -= sliderOpts.height / 2;\n yanchor = 'middle';\n }\n\n sliderOpts.outerLength = Math.ceil(sliderOpts.outerLength);\n sliderOpts.height = Math.ceil(sliderOpts.height);\n sliderOpts.lx = Math.round(sliderOpts.lx);\n sliderOpts.ly = Math.round(sliderOpts.ly);\n\n Plots.autoMargin(gd, constants.autoMarginIdRoot + sliderOpts._index, {\n x: sliderOpts.x,\n y: sliderOpts.y,\n l: sliderOpts.outerLength * ({right: 1, center: 0.5}[xanchor] || 0),\n r: sliderOpts.outerLength * ({left: 1, center: 0.5}[xanchor] || 0),\n b: sliderOpts.height * ({top: 1, middle: 0.5}[yanchor] || 0),\n t: sliderOpts.height * ({bottom: 1, middle: 0.5}[yanchor] || 0)\n });\n}\n\nfunction drawSlider(gd, sliderGroup, sliderOpts) {\n // This is related to the other long notes in this file regarding what happens\n // when slider steps disappear. This particular fix handles what happens when\n // the *current* slider step is removed. The drawing functions will error out\n // when they fail to find it, so the fix for now is that it will just draw the\n // slider in the first position but will not execute the command.\n if(sliderOpts.active >= sliderOpts.steps.length) {\n sliderOpts.active = 0;\n }\n\n // These are carefully ordered for proper z-ordering:\n sliderGroup\n .call(drawCurrentValue, sliderOpts)\n .call(drawRail, sliderOpts)\n .call(drawLabelGroup, sliderOpts)\n .call(drawTicks, sliderOpts)\n .call(drawTouchRect, gd, sliderOpts)\n .call(drawGrip, gd, sliderOpts);\n\n // Position the rectangle:\n Drawing.setTranslate(sliderGroup, sliderOpts.lx + sliderOpts.pad.l, sliderOpts.ly + sliderOpts.pad.t);\n\n sliderGroup.call(setGripPosition, sliderOpts, sliderOpts.active / (sliderOpts.steps.length - 1), false);\n sliderGroup.call(drawCurrentValue, sliderOpts);\n\n}\n\nfunction drawCurrentValue(sliderGroup, sliderOpts, valueOverride) {\n if(!sliderOpts.currentvalue.visible) return;\n\n var x0, textAnchor;\n var text = sliderGroup.selectAll('text')\n .data([0]);\n\n switch(sliderOpts.currentvalue.xanchor) {\n case 'right':\n // This is anchored left and adjusted by the width of the longest label\n // so that the prefix doesn't move. The goal of this is to emphasize\n // what's actually changing and make the update less distracting.\n x0 = sliderOpts.inputAreaLength - constants.currentValueInset - sliderOpts.currentValueMaxWidth;\n textAnchor = 'left';\n break;\n case 'center':\n x0 = sliderOpts.inputAreaLength * 0.5;\n textAnchor = 'middle';\n break;\n default:\n x0 = constants.currentValueInset;\n textAnchor = 'left';\n }\n\n text.enter().append('text')\n .classed(constants.labelClass, true)\n .classed('user-select-none', true)\n .attr({\n 'text-anchor': textAnchor,\n 'data-notex': 1\n });\n\n var str = sliderOpts.currentvalue.prefix ? sliderOpts.currentvalue.prefix : '';\n\n if(typeof valueOverride === 'string') {\n str += valueOverride;\n } else {\n var curVal = sliderOpts.steps[sliderOpts.active].label;\n str += curVal;\n }\n\n if(sliderOpts.currentvalue.suffix) {\n str += sliderOpts.currentvalue.suffix;\n }\n\n text.call(Drawing.font, sliderOpts.currentvalue.font)\n .text(str)\n .call(svgTextUtils.convertToTspans, sliderOpts.gd);\n\n var lines = svgTextUtils.lineCount(text);\n\n var y0 = (sliderOpts.currentValueMaxLines + 1 - lines) *\n sliderOpts.currentvalue.font.size * LINE_SPACING;\n\n svgTextUtils.positionText(text, x0, y0);\n\n return text;\n}\n\nfunction drawGrip(sliderGroup, gd, sliderOpts) {\n var grip = sliderGroup.selectAll('rect.' + constants.gripRectClass)\n .data([0]);\n\n grip.enter().append('rect')\n .classed(constants.gripRectClass, true)\n .call(attachGripEvents, gd, sliderGroup, sliderOpts)\n .style('pointer-events', 'all');\n\n grip.attr({\n width: constants.gripWidth,\n height: constants.gripHeight,\n rx: constants.gripRadius,\n ry: constants.gripRadius,\n })\n .call(Color.stroke, sliderOpts.bordercolor)\n .call(Color.fill, sliderOpts.bgcolor)\n .style('stroke-width', sliderOpts.borderwidth + 'px');\n}\n\nfunction drawLabel(item, data, sliderOpts) {\n var text = item.selectAll('text')\n .data([0]);\n\n text.enter().append('text')\n .classed(constants.labelClass, true)\n .classed('user-select-none', true)\n .attr({\n 'text-anchor': 'middle',\n 'data-notex': 1\n });\n\n text.call(Drawing.font, sliderOpts.font)\n .text(data.step.label)\n .call(svgTextUtils.convertToTspans, sliderOpts.gd);\n\n return text;\n}\n\nfunction drawLabelGroup(sliderGroup, sliderOpts) {\n var labels = sliderGroup.selectAll('g.' + constants.labelsClass)\n .data([0]);\n\n labels.enter().append('g')\n .classed(constants.labelsClass, true);\n\n var labelItems = labels.selectAll('g.' + constants.labelGroupClass)\n .data(sliderOpts.labelSteps);\n\n labelItems.enter().append('g')\n .classed(constants.labelGroupClass, true);\n\n labelItems.exit().remove();\n\n labelItems.each(function(d) {\n var item = d3.select(this);\n\n item.call(drawLabel, d, sliderOpts);\n\n Drawing.setTranslate(item,\n normalizedValueToPosition(sliderOpts, d.fraction),\n constants.tickOffset +\n sliderOpts.ticklen +\n // position is the baseline of the top line of text only, even\n // if the label spans multiple lines\n sliderOpts.font.size * LINE_SPACING +\n constants.labelOffset +\n sliderOpts.currentValueTotalHeight\n );\n });\n\n}\n\nfunction handleInput(gd, sliderGroup, sliderOpts, normalizedPosition, doTransition) {\n var quantizedPosition = Math.round(normalizedPosition * (sliderOpts.steps.length - 1));\n\n if(quantizedPosition !== sliderOpts.active) {\n setActive(gd, sliderGroup, sliderOpts, quantizedPosition, true, doTransition);\n }\n}\n\nfunction setActive(gd, sliderGroup, sliderOpts, index, doCallback, doTransition) {\n var previousActive = sliderOpts.active;\n sliderOpts._input.active = sliderOpts.active = index;\n\n var step = sliderOpts.steps[sliderOpts.active];\n\n sliderGroup.call(setGripPosition, sliderOpts, sliderOpts.active / (sliderOpts.steps.length - 1), doTransition);\n sliderGroup.call(drawCurrentValue, sliderOpts);\n\n gd.emit('plotly_sliderchange', {\n slider: sliderOpts,\n step: sliderOpts.steps[sliderOpts.active],\n interaction: doCallback,\n previousActive: previousActive\n });\n\n if(step && step.method && doCallback) {\n if(sliderGroup._nextMethod) {\n // If we've already queued up an update, just overwrite it with the most recent:\n sliderGroup._nextMethod.step = step;\n sliderGroup._nextMethod.doCallback = doCallback;\n sliderGroup._nextMethod.doTransition = doTransition;\n } else {\n sliderGroup._nextMethod = {step: step, doCallback: doCallback, doTransition: doTransition};\n sliderGroup._nextMethodRaf = window.requestAnimationFrame(function() {\n var _step = sliderGroup._nextMethod.step;\n if(!_step.method) return;\n\n if(_step.execute) {\n Plots.executeAPICommand(gd, _step.method, _step.args);\n }\n\n sliderGroup._nextMethod = null;\n sliderGroup._nextMethodRaf = null;\n });\n }\n }\n}\n\nfunction attachGripEvents(item, gd, sliderGroup) {\n var node = sliderGroup.node();\n var $gd = d3.select(gd);\n\n // NB: This is *not* the same as sliderOpts itself! These callbacks\n // are in a closure so this array won't actually be correct if the\n // steps have changed since this was initialized. The sliderGroup,\n // however, has not changed since that *is* the slider, so it must\n // be present to receive mouse events.\n function getSliderOpts() {\n return sliderGroup.data()[0];\n }\n\n item.on('mousedown', function() {\n var sliderOpts = getSliderOpts();\n gd.emit('plotly_sliderstart', {slider: sliderOpts});\n\n var grip = sliderGroup.select('.' + constants.gripRectClass);\n\n d3.event.stopPropagation();\n d3.event.preventDefault();\n grip.call(Color.fill, sliderOpts.activebgcolor);\n\n var normalizedPosition = positionToNormalizedValue(sliderOpts, d3.mouse(node)[0]);\n handleInput(gd, sliderGroup, sliderOpts, normalizedPosition, true);\n sliderOpts._dragging = true;\n\n $gd.on('mousemove', function() {\n var sliderOpts = getSliderOpts();\n var normalizedPosition = positionToNormalizedValue(sliderOpts, d3.mouse(node)[0]);\n handleInput(gd, sliderGroup, sliderOpts, normalizedPosition, false);\n });\n\n $gd.on('mouseup', function() {\n var sliderOpts = getSliderOpts();\n sliderOpts._dragging = false;\n grip.call(Color.fill, sliderOpts.bgcolor);\n $gd.on('mouseup', null);\n $gd.on('mousemove', null);\n\n gd.emit('plotly_sliderend', {\n slider: sliderOpts,\n step: sliderOpts.steps[sliderOpts.active]\n });\n });\n });\n}\n\nfunction drawTicks(sliderGroup, sliderOpts) {\n var tick = sliderGroup.selectAll('rect.' + constants.tickRectClass)\n .data(sliderOpts.steps);\n\n tick.enter().append('rect')\n .classed(constants.tickRectClass, true);\n\n tick.exit().remove();\n\n tick.attr({\n width: sliderOpts.tickwidth + 'px',\n 'shape-rendering': 'crispEdges'\n });\n\n tick.each(function(d, i) {\n var isMajor = i % sliderOpts.labelStride === 0;\n var item = d3.select(this);\n\n item\n .attr({height: isMajor ? sliderOpts.ticklen : sliderOpts.minorticklen})\n .call(Color.fill, isMajor ? sliderOpts.tickcolor : sliderOpts.tickcolor);\n\n Drawing.setTranslate(item,\n normalizedValueToPosition(sliderOpts, i / (sliderOpts.steps.length - 1)) - 0.5 * sliderOpts.tickwidth,\n (isMajor ? constants.tickOffset : constants.minorTickOffset) + sliderOpts.currentValueTotalHeight\n );\n });\n\n}\n\nfunction computeLabelSteps(sliderOpts) {\n sliderOpts.labelSteps = [];\n var i0 = 0;\n var nsteps = sliderOpts.steps.length;\n\n for(var i = i0; i < nsteps; i += sliderOpts.labelStride) {\n sliderOpts.labelSteps.push({\n fraction: i / (nsteps - 1),\n step: sliderOpts.steps[i]\n });\n }\n}\n\nfunction setGripPosition(sliderGroup, sliderOpts, position, doTransition) {\n var grip = sliderGroup.select('rect.' + constants.gripRectClass);\n\n var x = normalizedValueToPosition(sliderOpts, position);\n\n // If this is true, then *this component* is already invoking its own command\n // and has triggered its own animation.\n if(sliderOpts._invokingCommand) return;\n\n var el = grip;\n if(doTransition && sliderOpts.transition.duration > 0) {\n el = el.transition()\n .duration(sliderOpts.transition.duration)\n .ease(sliderOpts.transition.easing);\n }\n\n // Drawing.setTranslate doesn't work here becasue of the transition duck-typing.\n // It's also not necessary because there are no other transitions to preserve.\n el.attr('transform', 'translate(' + (x - constants.gripWidth * 0.5) + ',' + (sliderOpts.currentValueTotalHeight) + ')');\n}\n\n// Convert a number from [0-1] to a pixel position relative to the slider group container:\nfunction normalizedValueToPosition(sliderOpts, normalizedPosition) {\n return sliderOpts.inputAreaStart + constants.stepInset +\n (sliderOpts.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n}\n\n// Convert a position relative to the slider group to a nubmer in [0, 1]\nfunction positionToNormalizedValue(sliderOpts, position) {\n return Math.min(1, Math.max(0, (position - constants.stepInset - sliderOpts.inputAreaStart) / (sliderOpts.inputAreaLength - 2 * constants.stepInset - 2 * sliderOpts.inputAreaStart)));\n}\n\nfunction drawTouchRect(sliderGroup, gd, sliderOpts) {\n var rect = sliderGroup.selectAll('rect.' + constants.railTouchRectClass)\n .data([0]);\n\n rect.enter().append('rect')\n .classed(constants.railTouchRectClass, true)\n .call(attachGripEvents, gd, sliderGroup, sliderOpts)\n .style('pointer-events', 'all');\n\n rect.attr({\n width: sliderOpts.inputAreaLength,\n height: Math.max(sliderOpts.inputAreaWidth, constants.tickOffset + sliderOpts.ticklen + sliderOpts.labelHeight)\n })\n .call(Color.fill, sliderOpts.bgcolor)\n .attr('opacity', 0);\n\n Drawing.setTranslate(rect, 0, sliderOpts.currentValueTotalHeight);\n}\n\nfunction drawRail(sliderGroup, sliderOpts) {\n var rect = sliderGroup.selectAll('rect.' + constants.railRectClass)\n .data([0]);\n\n rect.enter().append('rect')\n .classed(constants.railRectClass, true);\n\n var computedLength = sliderOpts.inputAreaLength - constants.railInset * 2;\n\n rect.attr({\n width: computedLength,\n height: constants.railWidth,\n rx: constants.railRadius,\n ry: constants.railRadius,\n 'shape-rendering': 'crispEdges'\n })\n .call(Color.stroke, sliderOpts.bordercolor)\n .call(Color.fill, sliderOpts.bgcolor)\n .style('stroke-width', sliderOpts.borderwidth + 'px');\n\n Drawing.setTranslate(rect,\n constants.railInset,\n (sliderOpts.inputAreaWidth - constants.railWidth) * 0.5 + sliderOpts.currentValueTotalHeight\n );\n}\n\nfunction clearPushMargins(gd) {\n var pushMargins = gd._fullLayout._pushmargin || {},\n keys = Object.keys(pushMargins);\n\n for(var i = 0; i < keys.length; i++) {\n var k = keys[i];\n\n if(k.indexOf(constants.autoMarginIdRoot) !== -1) {\n Plots.autoMargin(gd, k);\n }\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/sliders/draw.js\n// module id = 489\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'component',\n name: 'rangeslider',\n\n schema: {\n subplots: {\n xaxis: {rangeslider: require('./attributes')}\n }\n },\n\n layoutAttributes: require('./attributes'),\n handleDefaults: require('./defaults'),\n calcAutorange: require('./calc_autorange'),\n draw: require('./draw')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeslider/index.js\n// module id = 490\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar attributes = require('./attributes');\n\nmodule.exports = function handleDefaults(layoutIn, layoutOut, axName) {\n if(!layoutIn[axName].rangeslider) return;\n\n // not super proud of this (maybe store _ in axis object instead\n if(!Lib.isPlainObject(layoutIn[axName].rangeslider)) {\n layoutIn[axName].rangeslider = {};\n }\n\n var containerIn = layoutIn[axName].rangeslider,\n axOut = layoutOut[axName],\n containerOut = axOut.rangeslider = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);\n }\n\n var visible = coerce('visible');\n if(!visible) return;\n\n coerce('bgcolor', layoutOut.plot_bgcolor);\n coerce('bordercolor');\n coerce('borderwidth');\n coerce('thickness');\n\n coerce('autorange', !axOut.isValidRange(containerIn.range));\n coerce('range');\n\n // Expand slider range to the axis range\n // TODO: what if the ranges are reversed?\n if(containerOut.range) {\n var outRange = containerOut.range,\n axRange = axOut.range;\n\n outRange[0] = axOut.l2r(Math.min(axOut.r2l(outRange[0]), axOut.r2l(axRange[0])));\n outRange[1] = axOut.l2r(Math.max(axOut.r2l(outRange[1]), axOut.r2l(axRange[1])));\n }\n\n axOut.cleanRange('rangeslider.range');\n\n // to map back range slider (auto) range\n containerOut._input = containerIn;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeslider/defaults.js\n// module id = 491\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = require('../../plots/cartesian/axes');\nvar constants = require('./constants');\n\nmodule.exports = function calcAutorange(gd) {\n var axes = Axes.list(gd, 'x', true);\n\n // Compute new slider range using axis autorange if necessary.\n //\n // Copy back range to input range slider container to skip\n // this step in subsequent draw calls.\n\n for(var i = 0; i < axes.length; i++) {\n var ax = axes[i],\n opts = ax[constants.name];\n\n // Don't try calling getAutoRange if _min and _max are filled in.\n // This happens on updates where the calc step is skipped.\n\n if(opts && opts.visible && opts.autorange && ax._min.length && ax._max.length) {\n opts._input.autorange = true;\n opts._input.range = opts.range = Axes.getAutoRange(ax);\n }\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeslider/calc_autorange.js\n// module id = 492\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Plotly = require('../../plotly');\nvar Plots = require('../../plots/plots');\n\nvar Lib = require('../../lib');\nvar Drawing = require('../drawing');\nvar Color = require('../color');\n\nvar Cartesian = require('../../plots/cartesian');\nvar Axes = require('../../plots/cartesian/axes');\n\nvar dragElement = require('../dragelement');\nvar setCursor = require('../../lib/setcursor');\n\nvar constants = require('./constants');\n\n\nmodule.exports = function(gd) {\n var fullLayout = gd._fullLayout,\n rangeSliderData = makeRangeSliderData(fullLayout);\n\n /*\n * \n * \n * < .... range plot />\n * \n * \n * \n * \n * \n * \n * \n * \n * \n *\n * ...\n */\n\n function keyFunction(axisOpts) {\n return axisOpts._name;\n }\n\n var rangeSliders = fullLayout._infolayer\n .selectAll('g.' + constants.containerClassName)\n .data(rangeSliderData, keyFunction);\n\n rangeSliders.enter().append('g')\n .classed(constants.containerClassName, true)\n .attr('pointer-events', 'all');\n\n // remove exiting sliders and their corresponding clip paths\n rangeSliders.exit().each(function(axisOpts) {\n var rangeSlider = d3.select(this),\n opts = axisOpts[constants.name];\n\n rangeSlider.remove();\n fullLayout._topdefs.select('#' + opts._clipId).remove();\n });\n\n // remove push margin object(s)\n if(rangeSliders.exit().size()) clearPushMargins(gd);\n\n // return early if no range slider is visible\n if(rangeSliderData.length === 0) return;\n\n // for all present range sliders\n rangeSliders.each(function(axisOpts) {\n var rangeSlider = d3.select(this),\n opts = axisOpts[constants.name],\n oppAxisOpts = fullLayout[Axes.id2name(axisOpts.anchor)];\n\n // update range slider dimensions\n\n var margin = fullLayout.margin,\n graphSize = fullLayout._size,\n domain = axisOpts.domain,\n oppDomain = oppAxisOpts.domain,\n tickHeight = (axisOpts._boundingBox || {}).height || 0;\n\n opts._id = constants.name + axisOpts._id;\n opts._clipId = opts._id + '-' + fullLayout._uid;\n\n opts._width = graphSize.w * (domain[1] - domain[0]);\n opts._height = (fullLayout.height - margin.b - margin.t) * opts.thickness;\n opts._offsetShift = Math.floor(opts.borderwidth / 2);\n\n var x = Math.round(margin.l + (graphSize.w * domain[0]));\n\n var y = Math.round(\n margin.t + graphSize.h * (1 - oppDomain[0]) +\n tickHeight +\n opts._offsetShift + constants.extraPad\n );\n\n rangeSlider.attr('transform', 'translate(' + x + ',' + y + ')');\n\n // update data <--> pixel coordinate conversion methods\n\n var range0 = axisOpts.r2l(opts.range[0]),\n range1 = axisOpts.r2l(opts.range[1]),\n dist = range1 - range0;\n\n opts.p2d = function(v) {\n return (v / opts._width) * dist + range0;\n };\n\n opts.d2p = function(v) {\n return (v - range0) / dist * opts._width;\n };\n\n opts._rl = [range0, range1];\n\n // update inner nodes\n\n rangeSlider\n .call(drawBg, gd, axisOpts, opts)\n .call(addClipPath, gd, axisOpts, opts)\n .call(drawRangePlot, gd, axisOpts, opts)\n .call(drawMasks, gd, axisOpts, opts)\n .call(drawSlideBox, gd, axisOpts, opts)\n .call(drawGrabbers, gd, axisOpts, opts);\n\n // setup drag element\n setupDragElement(rangeSlider, gd, axisOpts, opts);\n\n // update current range\n setPixelRange(rangeSlider, gd, axisOpts, opts);\n\n // update margins\n\n Plots.autoMargin(gd, opts._id, {\n x: domain[0],\n y: oppDomain[0],\n l: 0,\n r: 0,\n t: 0,\n b: opts._height + margin.b + tickHeight,\n pad: constants.extraPad + opts._offsetShift * 2\n });\n\n });\n};\n\nfunction makeRangeSliderData(fullLayout) {\n var axes = Axes.list({ _fullLayout: fullLayout }, 'x', true),\n name = constants.name,\n out = [];\n\n if(fullLayout._has('gl2d')) return out;\n\n for(var i = 0; i < axes.length; i++) {\n var ax = axes[i];\n\n if(ax[name] && ax[name].visible) out.push(ax);\n }\n\n return out;\n}\n\nfunction setupDragElement(rangeSlider, gd, axisOpts, opts) {\n var slideBox = rangeSlider.select('rect.' + constants.slideBoxClassName).node(),\n grabAreaMin = rangeSlider.select('rect.' + constants.grabAreaMinClassName).node(),\n grabAreaMax = rangeSlider.select('rect.' + constants.grabAreaMaxClassName).node();\n\n rangeSlider.on('mousedown', function() {\n var event = d3.event,\n target = event.target,\n startX = event.clientX,\n offsetX = startX - rangeSlider.node().getBoundingClientRect().left,\n minVal = opts.d2p(axisOpts._rl[0]),\n maxVal = opts.d2p(axisOpts._rl[1]);\n\n var dragCover = dragElement.coverSlip();\n\n dragCover.addEventListener('mousemove', mouseMove);\n dragCover.addEventListener('mouseup', mouseUp);\n\n function mouseMove(e) {\n var delta = +e.clientX - startX;\n var pixelMin, pixelMax, cursor;\n\n switch(target) {\n case slideBox:\n cursor = 'ew-resize';\n pixelMin = minVal + delta;\n pixelMax = maxVal + delta;\n break;\n\n case grabAreaMin:\n cursor = 'col-resize';\n pixelMin = minVal + delta;\n pixelMax = maxVal;\n break;\n\n case grabAreaMax:\n cursor = 'col-resize';\n pixelMin = minVal;\n pixelMax = maxVal + delta;\n break;\n\n default:\n cursor = 'ew-resize';\n pixelMin = offsetX;\n pixelMax = offsetX + delta;\n break;\n }\n\n if(pixelMax < pixelMin) {\n var tmp = pixelMax;\n pixelMax = pixelMin;\n pixelMin = tmp;\n }\n\n opts._pixelMin = pixelMin;\n opts._pixelMax = pixelMax;\n\n setCursor(d3.select(dragCover), cursor);\n setDataRange(rangeSlider, gd, axisOpts, opts);\n }\n\n function mouseUp() {\n dragCover.removeEventListener('mousemove', mouseMove);\n dragCover.removeEventListener('mouseup', mouseUp);\n Lib.removeElement(dragCover);\n }\n });\n}\n\nfunction setDataRange(rangeSlider, gd, axisOpts, opts) {\n\n function clamp(v) {\n return axisOpts.l2r(Lib.constrain(v, opts._rl[0], opts._rl[1]));\n }\n\n var dataMin = clamp(opts.p2d(opts._pixelMin)),\n dataMax = clamp(opts.p2d(opts._pixelMax));\n\n window.requestAnimationFrame(function() {\n Plotly.relayout(gd, axisOpts._name + '.range', [dataMin, dataMax]);\n });\n}\n\nfunction setPixelRange(rangeSlider, gd, axisOpts, opts) {\n var hw2 = constants.handleWidth / 2;\n\n function clamp(v) {\n return Lib.constrain(v, 0, opts._width);\n }\n\n function clampHandle(v) {\n return Lib.constrain(v, -hw2, opts._width + hw2);\n }\n\n var pixelMin = clamp(opts.d2p(axisOpts._rl[0])),\n pixelMax = clamp(opts.d2p(axisOpts._rl[1]));\n\n rangeSlider.select('rect.' + constants.slideBoxClassName)\n .attr('x', pixelMin)\n .attr('width', pixelMax - pixelMin);\n\n rangeSlider.select('rect.' + constants.maskMinClassName)\n .attr('width', pixelMin);\n\n rangeSlider.select('rect.' + constants.maskMaxClassName)\n .attr('x', pixelMax)\n .attr('width', opts._width - pixelMax);\n\n // add offset for crispier corners\n // https://github.com/plotly/plotly.js/pull/1409\n var offset = 0.5;\n\n var xMin = Math.round(clampHandle(pixelMin - hw2)) - offset,\n xMax = Math.round(clampHandle(pixelMax - hw2)) + offset;\n\n rangeSlider.select('g.' + constants.grabberMinClassName)\n .attr('transform', 'translate(' + xMin + ',' + offset + ')');\n\n rangeSlider.select('g.' + constants.grabberMaxClassName)\n .attr('transform', 'translate(' + xMax + ',' + offset + ')');\n}\n\nfunction drawBg(rangeSlider, gd, axisOpts, opts) {\n var bg = rangeSlider.selectAll('rect.' + constants.bgClassName)\n .data([0]);\n\n bg.enter().append('rect')\n .classed(constants.bgClassName, true)\n .attr({\n x: 0,\n y: 0,\n 'shape-rendering': 'crispEdges'\n });\n\n var borderCorrect = (opts.borderwidth % 2) === 0 ?\n opts.borderwidth :\n opts.borderwidth - 1;\n\n var offsetShift = -opts._offsetShift;\n var lw = Drawing.crispRound(gd, opts.borderwidth);\n\n bg.attr({\n width: opts._width + borderCorrect,\n height: opts._height + borderCorrect,\n transform: 'translate(' + offsetShift + ',' + offsetShift + ')',\n fill: opts.bgcolor,\n stroke: opts.bordercolor,\n 'stroke-width': lw\n });\n}\n\nfunction addClipPath(rangeSlider, gd, axisOpts, opts) {\n var fullLayout = gd._fullLayout;\n\n var clipPath = fullLayout._topdefs.selectAll('#' + opts._clipId)\n .data([0]);\n\n clipPath.enter().append('clipPath')\n .attr('id', opts._clipId)\n .append('rect')\n .attr({ x: 0, y: 0 });\n\n clipPath.select('rect').attr({\n width: opts._width,\n height: opts._height\n });\n}\n\nfunction drawRangePlot(rangeSlider, gd, axisOpts, opts) {\n var subplotData = Axes.getSubplots(gd, axisOpts),\n calcData = gd.calcdata;\n\n var rangePlots = rangeSlider.selectAll('g.' + constants.rangePlotClassName)\n .data(subplotData, Lib.identity);\n\n rangePlots.enter().append('g')\n .attr('class', function(id) { return constants.rangePlotClassName + ' ' + id; })\n .call(Drawing.setClipUrl, opts._clipId);\n\n rangePlots.order();\n\n rangePlots.exit().remove();\n\n var mainplotinfo;\n\n rangePlots.each(function(id, i) {\n var plotgroup = d3.select(this),\n isMainPlot = (i === 0);\n\n var oppAxisOpts = Axes.getFromId(gd, id, 'y'),\n oppAxisName = oppAxisOpts._name;\n\n var mockFigure = {\n data: [],\n layout: {\n xaxis: {\n type: axisOpts.type,\n domain: [0, 1],\n range: opts.range.slice(),\n calendar: axisOpts.calendar\n },\n width: opts._width,\n height: opts._height,\n margin: { t: 0, b: 0, l: 0, r: 0 }\n }\n };\n\n mockFigure.layout[oppAxisName] = {\n type: oppAxisOpts.type,\n domain: [0, 1],\n range: oppAxisOpts.range.slice(),\n calendar: oppAxisOpts.calendar\n };\n\n Plots.supplyDefaults(mockFigure);\n\n var xa = mockFigure._fullLayout.xaxis,\n ya = mockFigure._fullLayout[oppAxisName];\n\n var plotinfo = {\n id: id,\n plotgroup: plotgroup,\n xaxis: xa,\n yaxis: ya\n };\n\n if(isMainPlot) mainplotinfo = plotinfo;\n else {\n plotinfo.mainplot = 'xy';\n plotinfo.mainplotinfo = mainplotinfo;\n }\n\n Cartesian.rangePlot(gd, plotinfo, filterRangePlotCalcData(calcData, id));\n });\n}\n\nfunction filterRangePlotCalcData(calcData, subplotId) {\n var out = [];\n\n for(var i = 0; i < calcData.length; i++) {\n var calcTrace = calcData[i],\n trace = calcTrace[0].trace;\n\n if(trace.xaxis + trace.yaxis === subplotId) {\n out.push(calcTrace);\n }\n }\n\n return out;\n}\n\nfunction drawMasks(rangeSlider, gd, axisOpts, opts) {\n var maskMin = rangeSlider.selectAll('rect.' + constants.maskMinClassName)\n .data([0]);\n\n maskMin.enter().append('rect')\n .classed(constants.maskMinClassName, true)\n .attr({ x: 0, y: 0 })\n .attr('shape-rendering', 'crispEdges');\n\n maskMin\n .attr('height', opts._height)\n .call(Color.fill, constants.maskColor);\n\n var maskMax = rangeSlider.selectAll('rect.' + constants.maskMaxClassName)\n .data([0]);\n\n maskMax.enter().append('rect')\n .classed(constants.maskMaxClassName, true)\n .attr('y', 0)\n .attr('shape-rendering', 'crispEdges');\n\n maskMax\n .attr('height', opts._height)\n .call(Color.fill, constants.maskColor);\n}\n\nfunction drawSlideBox(rangeSlider, gd, axisOpts, opts) {\n if(gd._context.staticPlot) return;\n\n var slideBox = rangeSlider.selectAll('rect.' + constants.slideBoxClassName)\n .data([0]);\n\n slideBox.enter().append('rect')\n .classed(constants.slideBoxClassName, true)\n .attr('y', 0)\n .attr('cursor', constants.slideBoxCursor)\n .attr('shape-rendering', 'crispEdges');\n\n slideBox.attr({\n height: opts._height,\n fill: constants.slideBoxFill\n });\n}\n\nfunction drawGrabbers(rangeSlider, gd, axisOpts, opts) {\n\n // \n\n var grabberMin = rangeSlider.selectAll('g.' + constants.grabberMinClassName)\n .data([0]);\n grabberMin.enter().append('g')\n .classed(constants.grabberMinClassName, true);\n\n var grabberMax = rangeSlider.selectAll('g.' + constants.grabberMaxClassName)\n .data([0]);\n grabberMax.enter().append('g')\n .classed(constants.grabberMaxClassName, true);\n\n // \n\n var handleFixAttrs = {\n x: 0,\n width: constants.handleWidth,\n rx: constants.handleRadius,\n fill: Color.background,\n stroke: Color.defaultLine,\n 'stroke-width': constants.handleStrokeWidth,\n 'shape-rendering': 'crispEdges'\n };\n\n var handleDynamicAttrs = {\n y: Math.round(opts._height / 4),\n height: Math.round(opts._height / 2),\n };\n\n var handleMin = grabberMin.selectAll('rect.' + constants.handleMinClassName)\n .data([0]);\n handleMin.enter().append('rect')\n .classed(constants.handleMinClassName, true)\n .attr(handleFixAttrs);\n handleMin.attr(handleDynamicAttrs);\n\n var handleMax = grabberMax.selectAll('rect.' + constants.handleMaxClassName)\n .data([0]);\n handleMax.enter().append('rect')\n .classed(constants.handleMaxClassName, true)\n .attr(handleFixAttrs);\n handleMax.attr(handleDynamicAttrs);\n\n // \n\n if(gd._context.staticPlot) return;\n\n var grabAreaFixAttrs = {\n width: constants.grabAreaWidth,\n x: 0,\n y: 0,\n fill: constants.grabAreaFill,\n cursor: constants.grabAreaCursor\n };\n\n var grabAreaMin = grabberMin.selectAll('rect.' + constants.grabAreaMinClassName)\n .data([0]);\n grabAreaMin.enter().append('rect')\n .classed(constants.grabAreaMinClassName, true)\n .attr(grabAreaFixAttrs);\n grabAreaMin.attr('height', opts._height);\n\n var grabAreaMax = grabberMax.selectAll('rect.' + constants.grabAreaMaxClassName)\n .data([0]);\n grabAreaMax.enter().append('rect')\n .classed(constants.grabAreaMaxClassName, true)\n .attr(grabAreaFixAttrs);\n grabAreaMax.attr('height', opts._height);\n}\n\nfunction clearPushMargins(gd) {\n var pushMargins = gd._fullLayout._pushmargin || {},\n keys = Object.keys(pushMargins);\n\n for(var i = 0; i < keys.length; i++) {\n var k = keys[i];\n\n if(k.indexOf(constants.name) !== -1) {\n Plots.autoMargin(gd, k);\n }\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeslider/draw.js\n// module id = 493\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'component',\n name: 'rangeselector',\n\n schema: {\n subplots: {\n xaxis: {rangeselector: require('./attributes')}\n }\n },\n\n layoutAttributes: require('./attributes'),\n handleDefaults: require('./defaults'),\n\n draw: require('./draw')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeselector/index.js\n// module id = 494\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Color = require('../color');\n\nvar attributes = require('./attributes');\nvar buttonAttrs = require('./button_attributes');\nvar constants = require('./constants');\n\n\nmodule.exports = function handleDefaults(containerIn, containerOut, layout, counterAxes, calendar) {\n var selectorIn = containerIn.rangeselector || {},\n selectorOut = containerOut.rangeselector = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(selectorIn, selectorOut, attributes, attr, dflt);\n }\n\n var buttons = buttonsDefaults(selectorIn, selectorOut, calendar);\n\n var visible = coerce('visible', buttons.length > 0);\n if(!visible) return;\n\n var posDflt = getPosDflt(containerOut, layout, counterAxes);\n coerce('x', posDflt[0]);\n coerce('y', posDflt[1]);\n Lib.noneOrAll(containerIn, containerOut, ['x', 'y']);\n\n coerce('xanchor');\n coerce('yanchor');\n\n Lib.coerceFont(coerce, 'font', layout.font);\n\n var bgColor = coerce('bgcolor');\n coerce('activecolor', Color.contrast(bgColor, constants.lightAmount, constants.darkAmount));\n coerce('bordercolor');\n coerce('borderwidth');\n};\n\nfunction buttonsDefaults(containerIn, containerOut, calendar) {\n var buttonsIn = containerIn.buttons || [],\n buttonsOut = containerOut.buttons = [];\n\n var buttonIn, buttonOut;\n\n function coerce(attr, dflt) {\n return Lib.coerce(buttonIn, buttonOut, buttonAttrs, attr, dflt);\n }\n\n for(var i = 0; i < buttonsIn.length; i++) {\n buttonIn = buttonsIn[i];\n buttonOut = {};\n\n if(!Lib.isPlainObject(buttonIn)) continue;\n\n var step = coerce('step');\n if(step !== 'all') {\n if(calendar && calendar !== 'gregorian' && (step === 'month' || step === 'year')) {\n buttonOut.stepmode = 'backward';\n }\n else {\n coerce('stepmode');\n }\n\n coerce('count');\n }\n\n coerce('label');\n\n buttonOut._index = i;\n buttonsOut.push(buttonOut);\n }\n\n return buttonsOut;\n}\n\nfunction getPosDflt(containerOut, layout, counterAxes) {\n var anchoredList = counterAxes.filter(function(ax) {\n return layout[ax].anchor === containerOut._id;\n });\n\n var posY = 0;\n for(var i = 0; i < anchoredList.length; i++) {\n var domain = layout[anchoredList[i]].domain;\n if(domain) posY = Math.max(domain[1], posY);\n }\n\n return [containerOut.domain[0], posY + constants.yPad];\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeselector/defaults.js\n// module id = 495\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Plotly = require('../../plotly');\nvar Plots = require('../../plots/plots');\nvar Color = require('../color');\nvar Drawing = require('../drawing');\nvar svgTextUtils = require('../../lib/svg_text_utils');\nvar axisIds = require('../../plots/cartesian/axis_ids');\nvar anchorUtils = require('../legend/anchor_utils');\n\nvar LINE_SPACING = require('../../constants/alignment').LINE_SPACING;\n\nvar constants = require('./constants');\nvar getUpdateObject = require('./get_update_object');\n\n\nmodule.exports = function draw(gd) {\n var fullLayout = gd._fullLayout;\n\n var selectors = fullLayout._infolayer.selectAll('.rangeselector')\n .data(makeSelectorData(gd), selectorKeyFunc);\n\n selectors.enter().append('g')\n .classed('rangeselector', true);\n\n selectors.exit().remove();\n\n selectors.style({\n cursor: 'pointer',\n 'pointer-events': 'all'\n });\n\n selectors.each(function(d) {\n var selector = d3.select(this),\n axisLayout = d,\n selectorLayout = axisLayout.rangeselector;\n\n var buttons = selector.selectAll('g.button')\n .data(selectorLayout.buttons);\n\n buttons.enter().append('g')\n .classed('button', true);\n\n buttons.exit().remove();\n\n buttons.each(function(d) {\n var button = d3.select(this);\n var update = getUpdateObject(axisLayout, d);\n\n d.isActive = isActive(axisLayout, d, update);\n\n button.call(drawButtonRect, selectorLayout, d);\n button.call(drawButtonText, selectorLayout, d, gd);\n\n button.on('click', function() {\n if(gd._dragged) return;\n\n Plotly.relayout(gd, update);\n });\n\n button.on('mouseover', function() {\n d.isHovered = true;\n button.call(drawButtonRect, selectorLayout, d);\n });\n\n button.on('mouseout', function() {\n d.isHovered = false;\n button.call(drawButtonRect, selectorLayout, d);\n });\n });\n\n // N.B. this mutates selectorLayout\n reposition(gd, buttons, selectorLayout, axisLayout._name);\n\n selector.attr('transform', 'translate(' +\n selectorLayout.lx + ',' + selectorLayout.ly +\n ')');\n });\n\n};\n\nfunction makeSelectorData(gd) {\n var axes = axisIds.list(gd, 'x', true);\n var data = [];\n\n for(var i = 0; i < axes.length; i++) {\n var axis = axes[i];\n\n if(axis.rangeselector && axis.rangeselector.visible) {\n data.push(axis);\n }\n }\n\n return data;\n}\n\nfunction selectorKeyFunc(d) {\n return d._id;\n}\n\nfunction isActive(axisLayout, opts, update) {\n if(opts.step === 'all') {\n return axisLayout.autorange === true;\n }\n else {\n var keys = Object.keys(update);\n\n return (\n axisLayout.range[0] === update[keys[0]] &&\n axisLayout.range[1] === update[keys[1]]\n );\n }\n}\n\nfunction drawButtonRect(button, selectorLayout, d) {\n var rect = button.selectAll('rect')\n .data([0]);\n\n rect.enter().append('rect')\n .classed('selector-rect', true);\n\n rect.attr('shape-rendering', 'crispEdges');\n\n rect.attr({\n 'rx': constants.rx,\n 'ry': constants.ry\n });\n\n rect.call(Color.stroke, selectorLayout.bordercolor)\n .call(Color.fill, getFillColor(selectorLayout, d))\n .style('stroke-width', selectorLayout.borderwidth + 'px');\n}\n\nfunction getFillColor(selectorLayout, d) {\n return (d.isActive || d.isHovered) ?\n selectorLayout.activecolor :\n selectorLayout.bgcolor;\n}\n\nfunction drawButtonText(button, selectorLayout, d, gd) {\n function textLayout(s) {\n svgTextUtils.convertToTspans(s, gd);\n }\n\n var text = button.selectAll('text')\n .data([0]);\n\n text.enter().append('text')\n .classed('selector-text', true)\n .classed('user-select-none', true);\n\n text.attr('text-anchor', 'middle');\n\n text.call(Drawing.font, selectorLayout.font)\n .text(getLabel(d))\n .call(textLayout);\n}\n\nfunction getLabel(opts) {\n if(opts.label) return opts.label;\n\n if(opts.step === 'all') return 'all';\n\n return opts.count + opts.step.charAt(0);\n}\n\nfunction reposition(gd, buttons, opts, axName) {\n opts.width = 0;\n opts.height = 0;\n\n var borderWidth = opts.borderwidth;\n\n buttons.each(function() {\n var button = d3.select(this);\n var text = button.select('.selector-text');\n\n var tHeight = opts.font.size * LINE_SPACING;\n var hEff = Math.max(tHeight * svgTextUtils.lineCount(text), 16) + 3;\n\n opts.height = Math.max(opts.height, hEff);\n });\n\n buttons.each(function() {\n var button = d3.select(this);\n var rect = button.select('.selector-rect');\n var text = button.select('.selector-text');\n\n var tWidth = text.node() && Drawing.bBox(text.node()).width;\n var tHeight = opts.font.size * LINE_SPACING;\n var tLines = svgTextUtils.lineCount(text);\n\n var wEff = Math.max(tWidth + 10, constants.minButtonWidth);\n\n // TODO add MathJax support\n\n // TODO add buttongap attribute\n\n button.attr('transform', 'translate(' +\n (borderWidth + opts.width) + ',' + borderWidth +\n ')');\n\n rect.attr({\n x: 0,\n y: 0,\n width: wEff,\n height: opts.height\n });\n\n svgTextUtils.positionText(text, wEff / 2,\n opts.height / 2 - ((tLines - 1) * tHeight / 2) + 3);\n\n opts.width += wEff + 5;\n });\n\n buttons.selectAll('rect').attr('height', opts.height);\n\n var graphSize = gd._fullLayout._size;\n opts.lx = graphSize.l + graphSize.w * opts.x;\n opts.ly = graphSize.t + graphSize.h * (1 - opts.y);\n\n var xanchor = 'left';\n if(anchorUtils.isRightAnchor(opts)) {\n opts.lx -= opts.width;\n xanchor = 'right';\n }\n if(anchorUtils.isCenterAnchor(opts)) {\n opts.lx -= opts.width / 2;\n xanchor = 'center';\n }\n\n var yanchor = 'top';\n if(anchorUtils.isBottomAnchor(opts)) {\n opts.ly -= opts.height;\n yanchor = 'bottom';\n }\n if(anchorUtils.isMiddleAnchor(opts)) {\n opts.ly -= opts.height / 2;\n yanchor = 'middle';\n }\n\n opts.width = Math.ceil(opts.width);\n opts.height = Math.ceil(opts.height);\n opts.lx = Math.round(opts.lx);\n opts.ly = Math.round(opts.ly);\n\n Plots.autoMargin(gd, axName + '-range-selector', {\n x: opts.x,\n y: opts.y,\n l: opts.width * ({right: 1, center: 0.5}[xanchor] || 0),\n r: opts.width * ({left: 1, center: 0.5}[xanchor] || 0),\n b: opts.height * ({top: 1, middle: 0.5}[yanchor] || 0),\n t: opts.height * ({bottom: 1, middle: 0.5}[yanchor] || 0)\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeselector/draw.js\n// module id = 496\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nmodule.exports = function getUpdateObject(axisLayout, buttonLayout) {\n var axName = axisLayout._name;\n var update = {};\n\n if(buttonLayout.step === 'all') {\n update[axName + '.autorange'] = true;\n }\n else {\n var xrange = getXRange(axisLayout, buttonLayout);\n\n update[axName + '.range[0]'] = xrange[0];\n update[axName + '.range[1]'] = xrange[1];\n }\n\n return update;\n};\n\nfunction getXRange(axisLayout, buttonLayout) {\n var currentRange = axisLayout.range;\n var base = new Date(axisLayout.r2l(currentRange[1]));\n\n var step = buttonLayout.step,\n count = buttonLayout.count;\n\n var range0;\n\n switch(buttonLayout.stepmode) {\n case 'backward':\n range0 = axisLayout.l2r(+d3.time[step].utc.offset(base, -count));\n break;\n\n case 'todate':\n var base2 = d3.time[step].utc.offset(base, -count);\n\n range0 = axisLayout.l2r(+d3.time[step].utc.ceil(base2));\n break;\n }\n\n var range1 = currentRange[1];\n\n return [range0, range1];\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/components/rangeselector/get_update_object.js\n// module id = 497\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar helpers = require('./helpers');\n\nvar Snapshot = {\n getDelay: helpers.getDelay,\n getRedrawFunc: helpers.getRedrawFunc,\n clone: require('./cloneplot'),\n toSVG: require('./tosvg'),\n svgToImg: require('./svgtoimg'),\n toImage: require('./toimage'),\n downloadImage: require('./download')\n};\n\nmodule.exports = Snapshot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/snapshot/index.js\n// module id = 498\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar EventEmitter = require('events').EventEmitter;\n\nvar Plotly = require('../plotly');\nvar Lib = require('../lib');\n\nvar helpers = require('./helpers');\nvar clonePlot = require('./cloneplot');\nvar toSVG = require('./tosvg');\nvar svgToImg = require('./svgtoimg');\n\n\n/**\n * @param {object} gd figure Object\n * @param {object} opts option object\n * @param opts.format 'jpeg' | 'png' | 'webp' | 'svg'\n */\nfunction toImage(gd, opts) {\n\n // first clone the GD so we can operate in a clean environment\n var ev = new EventEmitter();\n\n var clone = clonePlot(gd, {format: 'png'});\n var clonedGd = clone.gd;\n\n // put the cloned div somewhere off screen before attaching to DOM\n clonedGd.style.position = 'absolute';\n clonedGd.style.left = '-5000px';\n document.body.appendChild(clonedGd);\n\n function wait() {\n var delay = helpers.getDelay(clonedGd._fullLayout);\n\n setTimeout(function() {\n var svg = toSVG(clonedGd);\n\n var canvas = document.createElement('canvas');\n canvas.id = Lib.randstr();\n\n ev = svgToImg({\n format: opts.format,\n width: clonedGd._fullLayout.width,\n height: clonedGd._fullLayout.height,\n canvas: canvas,\n emitter: ev,\n svg: svg\n });\n\n ev.clean = function() {\n if(clonedGd) document.body.removeChild(clonedGd);\n };\n\n }, delay);\n }\n\n var redrawFunc = helpers.getRedrawFunc(clonedGd);\n\n Plotly.plot(clonedGd, clone.data, clone.layout, clone.config)\n .then(redrawFunc)\n .then(wait)\n .catch(function(err) {\n ev.emit('error', err);\n });\n\n\n return ev;\n}\n\nmodule.exports = toImage;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/snapshot/toimage.js\n// module id = 499\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = require('../src/traces/bar');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/lib/bar.js\n// module id = 500\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Bar = {};\n\nBar.attributes = require('./attributes');\nBar.layoutAttributes = require('./layout_attributes');\nBar.supplyDefaults = require('./defaults');\nBar.supplyLayoutDefaults = require('./layout_defaults');\nBar.calc = require('./calc');\nBar.setPositions = require('./set_positions');\nBar.colorbar = require('../scatter/colorbar');\nBar.arraysToCalcdata = require('./arrays_to_calcdata');\nBar.plot = require('./plot');\nBar.style = require('./style');\nBar.hoverPoints = require('./hover');\nBar.selectPoints = require('./select');\n\nBar.moduleType = 'trace';\nBar.name = 'bar';\nBar.basePlotModule = require('../../plots/cartesian');\nBar.categories = ['cartesian', 'bar', 'oriented', 'markerColorscale', 'errorBarsOK', 'showLegend'];\nBar.meta = {\n \n};\n\nmodule.exports = Bar;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/index.js\n// module id = 501\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar Color = require('../../components/color');\n\nvar handleXYDefaults = require('../scatter/xy_defaults');\nvar handleStyleDefaults = require('../bar/style_defaults');\nvar errorBarsSupplyDefaults = require('../../components/errorbars/defaults');\nvar attributes = require('./attributes');\n\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n var coerceFont = Lib.coerceFont;\n\n var len = handleXYDefaults(traceIn, traceOut, layout, coerce);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('orientation', (traceOut.x && !traceOut.y) ? 'h' : 'v');\n coerce('base');\n coerce('offset');\n coerce('width');\n\n coerce('text');\n coerce('hovertext');\n\n var textPosition = coerce('textposition');\n\n var hasBoth = Array.isArray(textPosition) || textPosition === 'auto',\n hasInside = hasBoth || textPosition === 'inside',\n hasOutside = hasBoth || textPosition === 'outside';\n if(hasInside || hasOutside) {\n var textFont = coerceFont(coerce, 'textfont', layout.font);\n if(hasInside) coerceFont(coerce, 'insidetextfont', textFont);\n if(hasOutside) coerceFont(coerce, 'outsidetextfont', textFont);\n coerce('constraintext');\n }\n\n handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout);\n\n // override defaultColor for error bars with defaultLine\n errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'y'});\n errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'x', inherit: 'y'});\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/defaults.js\n// module id = 502\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = require('../../components/color');\nvar hasColorscale = require('../../components/colorscale/has_colorscale');\nvar colorscaleDefaults = require('../../components/colorscale/defaults');\n\n\nmodule.exports = function handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout) {\n coerce('marker.color', defaultColor);\n\n if(hasColorscale(traceIn, 'marker')) {\n colorscaleDefaults(\n traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'}\n );\n }\n\n coerce('marker.line.color', Color.defaultLine);\n\n if(hasColorscale(traceIn, 'marker.line')) {\n colorscaleDefaults(\n traceIn, traceOut, layout, coerce, {prefix: 'marker.line.', cLetter: 'c'}\n );\n }\n\n coerce('marker.line.width');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/style_defaults.js\n// module id = 503\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = require('../../registry');\nvar Axes = require('../../plots/cartesian/axes');\nvar Lib = require('../../lib');\n\nvar layoutAttributes = require('./layout_attributes');\n\n\nmodule.exports = function(layoutIn, layoutOut, fullData) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n\n var hasBars = false,\n shouldBeGapless = false,\n gappedAnyway = false,\n usedSubplots = {};\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n if(Registry.traceIs(trace, 'bar')) hasBars = true;\n else continue;\n\n // if we have at least 2 grouped bar traces on the same subplot,\n // we should default to a gap anyway, even if the data is histograms\n if(layoutIn.barmode !== 'overlay' && layoutIn.barmode !== 'stack') {\n var subploti = trace.xaxis + trace.yaxis;\n if(usedSubplots[subploti]) gappedAnyway = true;\n usedSubplots[subploti] = true;\n }\n\n if(trace.visible && trace.type === 'histogram') {\n var pa = Axes.getFromId({_fullLayout: layoutOut},\n trace[trace.orientation === 'v' ? 'xaxis' : 'yaxis']);\n if(pa.type !== 'category') shouldBeGapless = true;\n }\n }\n\n if(!hasBars) return;\n\n var mode = coerce('barmode');\n if(mode !== 'overlay') coerce('barnorm');\n\n coerce('bargap', (shouldBeGapless && !gappedAnyway) ? 0 : 0.2);\n coerce('bargroupgap');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/layout_defaults.js\n// module id = 504\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Axes = require('../../plots/cartesian/axes');\nvar hasColorscale = require('../../components/colorscale/has_colorscale');\nvar colorscaleCalc = require('../../components/colorscale/calc');\n\nvar arraysToCalcdata = require('./arrays_to_calcdata');\n\n\nmodule.exports = function calc(gd, trace) {\n // depending on bar direction, set position and size axes\n // and data ranges\n // note: this logic for choosing orientation is\n // duplicated in graph_obj->setstyles\n\n var xa = Axes.getFromId(gd, trace.xaxis || 'x'),\n ya = Axes.getFromId(gd, trace.yaxis || 'y'),\n orientation = trace.orientation || ((trace.x && !trace.y) ? 'h' : 'v'),\n sa, pos, size, i, scalendar;\n\n if(orientation === 'h') {\n sa = xa;\n size = xa.makeCalcdata(trace, 'x');\n pos = ya.makeCalcdata(trace, 'y');\n\n // not sure if it really makes sense to have dates for bar size data...\n // ideally if we want to make gantt charts or something we'd treat\n // the actual size (trace.x or y) as time delta but base as absolute\n // time. But included here for completeness.\n scalendar = trace.xcalendar;\n }\n else {\n sa = ya;\n size = ya.makeCalcdata(trace, 'y');\n pos = xa.makeCalcdata(trace, 'x');\n scalendar = trace.ycalendar;\n }\n\n // create the \"calculated data\" to plot\n var serieslen = Math.min(pos.length, size.length),\n cd = new Array(serieslen);\n\n // set position and size\n for(i = 0; i < serieslen; i++) {\n cd[i] = { p: pos[i], s: size[i] };\n }\n\n // set base\n var base = trace.base,\n b;\n\n if(Array.isArray(base)) {\n for(i = 0; i < Math.min(base.length, cd.length); i++) {\n b = sa.d2c(base[i], 0, scalendar);\n if(isNumeric(b)) {\n cd[i].b = +b;\n cd[i].hasB = 1;\n }\n else cd[i].b = 0;\n }\n for(; i < cd.length; i++) {\n cd[i].b = 0;\n }\n }\n else {\n b = sa.d2c(base, 0, scalendar);\n var hasBase = isNumeric(b);\n b = hasBase ? b : 0;\n for(i = 0; i < cd.length; i++) {\n cd[i].b = b;\n if(hasBase) cd[i].hasB = 1;\n }\n }\n\n // auto-z and autocolorscale if applicable\n if(hasColorscale(trace, 'marker')) {\n colorscaleCalc(trace, trace.marker.color, 'marker', 'c');\n }\n if(hasColorscale(trace, 'marker.line')) {\n colorscaleCalc(trace, trace.marker.line.color, 'marker.line', 'c');\n }\n\n arraysToCalcdata(cd, trace);\n\n return cd;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/calc.js\n// module id = 505\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar BADNUM = require('../../constants/numerical').BADNUM;\n\nvar Registry = require('../../registry');\nvar Axes = require('../../plots/cartesian/axes');\nvar Sieve = require('./sieve.js');\n\n/*\n * Bar chart stacking/grouping positioning and autoscaling calculations\n * for each direction separately calculate the ranges and positions\n * note that this handles histograms too\n * now doing this one subplot at a time\n */\n\nmodule.exports = function setPositions(gd, plotinfo) {\n var xa = plotinfo.xaxis,\n ya = plotinfo.yaxis;\n\n var fullTraces = gd._fullData,\n calcTraces = gd.calcdata,\n calcTracesHorizontal = [],\n calcTracesVertical = [],\n i;\n for(i = 0; i < fullTraces.length; i++) {\n var fullTrace = fullTraces[i];\n if(\n fullTrace.visible === true &&\n Registry.traceIs(fullTrace, 'bar') &&\n fullTrace.xaxis === xa._id &&\n fullTrace.yaxis === ya._id\n ) {\n if(fullTrace.orientation === 'h') {\n calcTracesHorizontal.push(calcTraces[i]);\n }\n else {\n calcTracesVertical.push(calcTraces[i]);\n }\n }\n }\n\n setGroupPositions(gd, xa, ya, calcTracesVertical);\n setGroupPositions(gd, ya, xa, calcTracesHorizontal);\n};\n\n\nfunction setGroupPositions(gd, pa, sa, calcTraces) {\n if(!calcTraces.length) return;\n\n var barmode = gd._fullLayout.barmode,\n overlay = (barmode === 'overlay'),\n group = (barmode === 'group'),\n excluded,\n included,\n i, calcTrace, fullTrace;\n\n if(overlay) {\n setGroupPositionsInOverlayMode(gd, pa, sa, calcTraces);\n }\n else if(group) {\n // exclude from the group those traces for which the user set an offset\n excluded = [];\n included = [];\n for(i = 0; i < calcTraces.length; i++) {\n calcTrace = calcTraces[i];\n fullTrace = calcTrace[0].trace;\n\n if(fullTrace.offset === undefined) included.push(calcTrace);\n else excluded.push(calcTrace);\n }\n\n if(included.length) {\n setGroupPositionsInGroupMode(gd, pa, sa, included);\n }\n if(excluded.length) {\n setGroupPositionsInOverlayMode(gd, pa, sa, excluded);\n }\n }\n else {\n // exclude from the stack those traces for which the user set a base\n excluded = [];\n included = [];\n for(i = 0; i < calcTraces.length; i++) {\n calcTrace = calcTraces[i];\n fullTrace = calcTrace[0].trace;\n\n if(fullTrace.base === undefined) included.push(calcTrace);\n else excluded.push(calcTrace);\n }\n\n if(included.length) {\n setGroupPositionsInStackOrRelativeMode(gd, pa, sa, included);\n }\n if(excluded.length) {\n setGroupPositionsInOverlayMode(gd, pa, sa, excluded);\n }\n }\n}\n\n\nfunction setGroupPositionsInOverlayMode(gd, pa, sa, calcTraces) {\n var barnorm = gd._fullLayout.barnorm,\n separateNegativeValues = false,\n dontMergeOverlappingData = !barnorm;\n\n // update position axis and set bar offsets and widths\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n\n var sieve = new Sieve(\n [calcTrace], separateNegativeValues, dontMergeOverlappingData\n );\n\n // set bar offsets and widths, and update position axis\n setOffsetAndWidth(gd, pa, sieve);\n\n // set bar bases and sizes, and update size axis\n //\n // (note that `setGroupPositionsInOverlayMode` handles the case barnorm\n // is defined, because this function is also invoked for traces that\n // can't be grouped or stacked)\n if(barnorm) {\n sieveBars(gd, sa, sieve);\n normalizeBars(gd, sa, sieve);\n }\n else {\n setBaseAndTop(gd, sa, sieve);\n }\n }\n}\n\n\nfunction setGroupPositionsInGroupMode(gd, pa, sa, calcTraces) {\n var fullLayout = gd._fullLayout,\n barnorm = fullLayout.barnorm,\n separateNegativeValues = false,\n dontMergeOverlappingData = !barnorm,\n sieve = new Sieve(\n calcTraces, separateNegativeValues, dontMergeOverlappingData\n );\n\n // set bar offsets and widths, and update position axis\n setOffsetAndWidthInGroupMode(gd, pa, sieve);\n\n // set bar bases and sizes, and update size axis\n if(barnorm) {\n sieveBars(gd, sa, sieve);\n normalizeBars(gd, sa, sieve);\n }\n else {\n setBaseAndTop(gd, sa, sieve);\n }\n}\n\n\nfunction setGroupPositionsInStackOrRelativeMode(gd, pa, sa, calcTraces) {\n var fullLayout = gd._fullLayout,\n barmode = fullLayout.barmode,\n stack = (barmode === 'stack'),\n relative = (barmode === 'relative'),\n barnorm = gd._fullLayout.barnorm,\n separateNegativeValues = relative,\n dontMergeOverlappingData = !(barnorm || stack || relative),\n sieve = new Sieve(\n calcTraces, separateNegativeValues, dontMergeOverlappingData\n );\n\n // set bar offsets and widths, and update position axis\n setOffsetAndWidth(gd, pa, sieve);\n\n // set bar bases and sizes, and update size axis\n stackBars(gd, sa, sieve);\n\n // flag the outmost bar (for text display purposes)\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n\n for(var j = 0; j < calcTrace.length; j++) {\n var bar = calcTrace[j];\n\n if(bar.s === BADNUM) continue;\n\n var isOutmostBar = ((bar.b + bar.s) === sieve.get(bar.p, bar.s));\n if(isOutmostBar) bar._outmost = true;\n }\n }\n\n // Note that marking the outmost bars has to be done\n // before `normalizeBars` changes `bar.b` and `bar.s`.\n if(barnorm) normalizeBars(gd, sa, sieve);\n}\n\n\nfunction setOffsetAndWidth(gd, pa, sieve) {\n var fullLayout = gd._fullLayout,\n bargap = fullLayout.bargap,\n bargroupgap = fullLayout.bargroupgap,\n minDiff = sieve.minDiff,\n calcTraces = sieve.traces,\n i, calcTrace, calcTrace0,\n t;\n\n // set bar offsets and widths\n var barGroupWidth = minDiff * (1 - bargap),\n barWidthPlusGap = barGroupWidth,\n barWidth = barWidthPlusGap * (1 - bargroupgap);\n\n // computer bar group center and bar offset\n var offsetFromCenter = -barWidth / 2;\n\n for(i = 0; i < calcTraces.length; i++) {\n calcTrace = calcTraces[i];\n calcTrace0 = calcTrace[0];\n\n // store bar width and offset for this trace\n t = calcTrace0.t;\n t.barwidth = barWidth;\n t.poffset = offsetFromCenter;\n t.bargroupwidth = barGroupWidth;\n }\n\n // stack bars that only differ by rounding\n sieve.binWidth = calcTraces[0][0].t.barwidth / 100;\n\n // if defined, apply trace offset and width\n applyAttributes(sieve);\n\n // store the bar center in each calcdata item\n setBarCenterAndWidth(gd, pa, sieve);\n\n // update position axes\n updatePositionAxis(gd, pa, sieve);\n}\n\n\nfunction setOffsetAndWidthInGroupMode(gd, pa, sieve) {\n var fullLayout = gd._fullLayout,\n bargap = fullLayout.bargap,\n bargroupgap = fullLayout.bargroupgap,\n positions = sieve.positions,\n distinctPositions = sieve.distinctPositions,\n minDiff = sieve.minDiff,\n calcTraces = sieve.traces,\n i, calcTrace, calcTrace0,\n t;\n\n // if there aren't any overlapping positions,\n // let them have full width even if mode is group\n var overlap = (positions.length !== distinctPositions.length);\n\n var nTraces = calcTraces.length,\n barGroupWidth = minDiff * (1 - bargap),\n barWidthPlusGap = (overlap) ? barGroupWidth / nTraces : barGroupWidth,\n barWidth = barWidthPlusGap * (1 - bargroupgap);\n\n for(i = 0; i < nTraces; i++) {\n calcTrace = calcTraces[i];\n calcTrace0 = calcTrace[0];\n\n // computer bar group center and bar offset\n var offsetFromCenter = (overlap) ?\n ((2 * i + 1 - nTraces) * barWidthPlusGap - barWidth) / 2 :\n -barWidth / 2;\n\n // store bar width and offset for this trace\n t = calcTrace0.t;\n t.barwidth = barWidth;\n t.poffset = offsetFromCenter;\n t.bargroupwidth = barGroupWidth;\n }\n\n // stack bars that only differ by rounding\n sieve.binWidth = calcTraces[0][0].t.barwidth / 100;\n\n // if defined, apply trace width\n applyAttributes(sieve);\n\n // store the bar center in each calcdata item\n setBarCenterAndWidth(gd, pa, sieve);\n\n // update position axes\n updatePositionAxis(gd, pa, sieve, overlap);\n}\n\n\nfunction applyAttributes(sieve) {\n var calcTraces = sieve.traces,\n i, calcTrace, calcTrace0, fullTrace,\n j,\n t;\n\n for(i = 0; i < calcTraces.length; i++) {\n calcTrace = calcTraces[i];\n calcTrace0 = calcTrace[0];\n fullTrace = calcTrace0.trace;\n t = calcTrace0.t;\n\n var offset = fullTrace.offset,\n initialPoffset = t.poffset,\n newPoffset;\n\n if(Array.isArray(offset)) {\n // if offset is an array, then clone it into t.poffset.\n newPoffset = offset.slice(0, calcTrace.length);\n\n // guard against non-numeric items\n for(j = 0; j < newPoffset.length; j++) {\n if(!isNumeric(newPoffset[j])) {\n newPoffset[j] = initialPoffset;\n }\n }\n\n // if the length of the array is too short,\n // then extend it with the initial value of t.poffset\n for(j = newPoffset.length; j < calcTrace.length; j++) {\n newPoffset.push(initialPoffset);\n }\n\n t.poffset = newPoffset;\n }\n else if(offset !== undefined) {\n t.poffset = offset;\n }\n\n var width = fullTrace.width,\n initialBarwidth = t.barwidth;\n\n if(Array.isArray(width)) {\n // if width is an array, then clone it into t.barwidth.\n var newBarwidth = width.slice(0, calcTrace.length);\n\n // guard against non-numeric items\n for(j = 0; j < newBarwidth.length; j++) {\n if(!isNumeric(newBarwidth[j])) newBarwidth[j] = initialBarwidth;\n }\n\n // if the length of the array is too short,\n // then extend it with the initial value of t.barwidth\n for(j = newBarwidth.length; j < calcTrace.length; j++) {\n newBarwidth.push(initialBarwidth);\n }\n\n t.barwidth = newBarwidth;\n\n // if user didn't set offset,\n // then correct t.poffset to ensure bars remain centered\n if(offset === undefined) {\n newPoffset = [];\n for(j = 0; j < calcTrace.length; j++) {\n newPoffset.push(\n initialPoffset + (initialBarwidth - newBarwidth[j]) / 2\n );\n }\n t.poffset = newPoffset;\n }\n }\n else if(width !== undefined) {\n t.barwidth = width;\n\n // if user didn't set offset,\n // then correct t.poffset to ensure bars remain centered\n if(offset === undefined) {\n t.poffset = initialPoffset + (initialBarwidth - width) / 2;\n }\n }\n }\n}\n\n\nfunction setBarCenterAndWidth(gd, pa, sieve) {\n var calcTraces = sieve.traces,\n pLetter = getAxisLetter(pa);\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i],\n t = calcTrace[0].t,\n poffset = t.poffset,\n poffsetIsArray = Array.isArray(poffset),\n barwidth = t.barwidth,\n barwidthIsArray = Array.isArray(barwidth);\n\n for(var j = 0; j < calcTrace.length; j++) {\n var calcBar = calcTrace[j];\n\n // store the actual bar width and position, for use by hover\n var width = calcBar.w = (barwidthIsArray) ? barwidth[j] : barwidth;\n calcBar[pLetter] = calcBar.p +\n ((poffsetIsArray) ? poffset[j] : poffset) +\n width / 2;\n\n\n }\n }\n}\n\n\nfunction updatePositionAxis(gd, pa, sieve, allowMinDtick) {\n var calcTraces = sieve.traces,\n distinctPositions = sieve.distinctPositions,\n distinctPositions0 = distinctPositions[0],\n minDiff = sieve.minDiff,\n vpad = minDiff / 2;\n\n Axes.minDtick(pa, minDiff, distinctPositions0, allowMinDtick);\n\n // If the user set the bar width or the offset,\n // then bars can be shifted away from their positions\n // and widths can be larger than minDiff.\n //\n // Here, we compute pMin and pMax to expand the position axis,\n // so that all bars are fully within the axis range.\n var pMin = Math.min.apply(Math, distinctPositions) - vpad,\n pMax = Math.max.apply(Math, distinctPositions) + vpad;\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i],\n calcTrace0 = calcTrace[0],\n fullTrace = calcTrace0.trace;\n\n if(fullTrace.width === undefined && fullTrace.offset === undefined) {\n continue;\n }\n\n var t = calcTrace0.t,\n poffset = t.poffset,\n barwidth = t.barwidth,\n poffsetIsArray = Array.isArray(poffset),\n barwidthIsArray = Array.isArray(barwidth);\n\n for(var j = 0; j < calcTrace.length; j++) {\n var calcBar = calcTrace[j],\n calcBarOffset = (poffsetIsArray) ? poffset[j] : poffset,\n calcBarWidth = (barwidthIsArray) ? barwidth[j] : barwidth,\n p = calcBar.p,\n l = p + calcBarOffset,\n r = l + calcBarWidth;\n\n pMin = Math.min(pMin, l);\n pMax = Math.max(pMax, r);\n }\n }\n\n Axes.expand(pa, [pMin, pMax], {padded: false});\n}\n\nfunction expandRange(range, newValue) {\n if(isNumeric(range[0])) range[0] = Math.min(range[0], newValue);\n else range[0] = newValue;\n\n if(isNumeric(range[1])) range[1] = Math.max(range[1], newValue);\n else range[1] = newValue;\n}\n\nfunction setBaseAndTop(gd, sa, sieve) {\n // store these bar bases and tops in calcdata\n // and make sure the size axis includes zero,\n // along with the bases and tops of each bar.\n var traces = sieve.traces,\n sLetter = getAxisLetter(sa),\n sRange = [null, null];\n\n for(var i = 0; i < traces.length; i++) {\n var trace = traces[i];\n\n for(var j = 0; j < trace.length; j++) {\n var bar = trace[j],\n barBase = bar.b,\n barTop = barBase + bar.s;\n\n bar[sLetter] = barTop;\n\n if(isNumeric(sa.c2l(barTop))) expandRange(sRange, barTop);\n if(bar.hasB && isNumeric(sa.c2l(barBase))) expandRange(sRange, barBase);\n }\n }\n\n Axes.expand(sa, sRange, {tozero: true, padded: true});\n}\n\n\nfunction stackBars(gd, sa, sieve) {\n var fullLayout = gd._fullLayout,\n barnorm = fullLayout.barnorm,\n sLetter = getAxisLetter(sa),\n traces = sieve.traces,\n i, trace,\n j, bar;\n\n var sRange = [null, null];\n\n for(i = 0; i < traces.length; i++) {\n trace = traces[i];\n\n for(j = 0; j < trace.length; j++) {\n bar = trace[j];\n\n if(bar.s === BADNUM) continue;\n\n // stack current bar and get previous sum\n var barBase = sieve.put(bar.p, bar.b + bar.s),\n barTop = barBase + bar.b + bar.s;\n\n // store the bar base and top in each calcdata item\n bar.b = barBase;\n bar[sLetter] = barTop;\n\n if(!barnorm) {\n if(isNumeric(sa.c2l(barTop))) expandRange(sRange, barTop);\n if(bar.hasB && isNumeric(sa.c2l(barBase))) expandRange(sRange, barBase);\n }\n }\n }\n\n // if barnorm is set, let normalizeBars update the axis range\n if(!barnorm) Axes.expand(sa, sRange, {tozero: true, padded: true});\n}\n\n\nfunction sieveBars(gd, sa, sieve) {\n var traces = sieve.traces;\n\n for(var i = 0; i < traces.length; i++) {\n var trace = traces[i];\n\n for(var j = 0; j < trace.length; j++) {\n var bar = trace[j];\n\n if(bar.s !== BADNUM) sieve.put(bar.p, bar.b + bar.s);\n }\n }\n}\n\n\nfunction normalizeBars(gd, sa, sieve) {\n // Note:\n //\n // normalizeBars requires that either sieveBars or stackBars has been\n // previously invoked.\n\n var traces = sieve.traces,\n sLetter = getAxisLetter(sa),\n sTop = (gd._fullLayout.barnorm === 'fraction') ? 1 : 100,\n sTiny = sTop / 1e9, // in case of rounding error in sum\n sMin = sa.l2c(sa.c2l(0)),\n sMax = (gd._fullLayout.barmode === 'stack') ? sTop : sMin,\n sRange = [sMin, sMax],\n padded = false;\n\n function maybeExpand(newValue) {\n if(isNumeric(sa.c2l(newValue)) &&\n ((newValue < sMin - sTiny) || (newValue > sMax + sTiny) || !isNumeric(sMin))\n ) {\n padded = true;\n expandRange(sRange, newValue);\n }\n }\n\n for(var i = 0; i < traces.length; i++) {\n var trace = traces[i];\n\n for(var j = 0; j < trace.length; j++) {\n var bar = trace[j];\n\n if(bar.s === BADNUM) continue;\n\n var scale = Math.abs(sTop / sieve.get(bar.p, bar.s));\n bar.b *= scale;\n bar.s *= scale;\n\n var barBase = bar.b,\n barTop = barBase + bar.s;\n bar[sLetter] = barTop;\n\n maybeExpand(barTop);\n if(bar.hasB) maybeExpand(barBase);\n }\n }\n\n // update range of size axis\n Axes.expand(sa, sRange, {tozero: true, padded: padded});\n}\n\n\nfunction getAxisLetter(ax) {\n return ax._id.charAt(0);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/set_positions.js\n// module id = 506\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = Sieve;\n\nvar Lib = require('../../lib');\nvar BADNUM = require('../../constants/numerical').BADNUM;\n\n/**\n * Helper class to sieve data from traces into bins\n *\n * @class\n * @param {Array} traces\n * Array of calculated traces\n * @param {boolean} [separateNegativeValues]\n * If true, then split data at the same position into a bar\n * for positive values and another for negative values\n * @param {boolean} [dontMergeOverlappingData]\n * If true, then don't merge overlapping bars into a single bar\n */\nfunction Sieve(traces, separateNegativeValues, dontMergeOverlappingData) {\n this.traces = traces;\n this.separateNegativeValues = separateNegativeValues;\n this.dontMergeOverlappingData = dontMergeOverlappingData;\n\n // for single-bin histograms - see histogram/calc\n var width1 = Infinity;\n\n var positions = [];\n for(var i = 0; i < traces.length; i++) {\n var trace = traces[i];\n for(var j = 0; j < trace.length; j++) {\n var bar = trace[j];\n if(bar.p !== BADNUM) positions.push(bar.p);\n }\n if(trace[0] && trace[0].width1) {\n width1 = Math.min(trace[0].width1, width1);\n }\n }\n this.positions = positions;\n\n var dv = Lib.distinctVals(positions);\n this.distinctPositions = dv.vals;\n if(dv.vals.length === 1 && width1 !== Infinity) this.minDiff = width1;\n else this.minDiff = Math.min(dv.minDiff, width1);\n\n this.binWidth = this.minDiff;\n\n this.bins = {};\n}\n\n/**\n * Sieve datum\n *\n * @method\n * @param {number} position\n * @param {number} value\n * @returns {number} Previous bin value\n */\nSieve.prototype.put = function put(position, value) {\n var label = this.getLabel(position, value),\n oldValue = this.bins[label] || 0;\n\n this.bins[label] = oldValue + value;\n\n return oldValue;\n};\n\n/**\n * Get current bin value for a given datum\n *\n * @method\n * @param {number} position Position of datum\n * @param {number} [value] Value of datum\n * (required if this.separateNegativeValues is true)\n * @returns {number} Current bin value\n */\nSieve.prototype.get = function put(position, value) {\n var label = this.getLabel(position, value);\n return this.bins[label] || 0;\n};\n\n/**\n * Get bin label for a given datum\n *\n * @method\n * @param {number} position Position of datum\n * @param {number} [value] Value of datum\n * (required if this.separateNegativeValues is true)\n * @returns {string} Bin label\n * (prefixed with a 'v' if value is negative and this.separateNegativeValues is\n * true; otherwise prefixed with '^')\n */\nSieve.prototype.getLabel = function getLabel(position, value) {\n var prefix = (value < 0 && this.separateNegativeValues) ? 'v' : '^',\n label = (this.dontMergeOverlappingData) ?\n position :\n Math.round(position / this.binWidth);\n return prefix + label;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/sieve.js\n// module id = 507\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\nvar isNumeric = require('fast-isnumeric');\nvar tinycolor = require('tinycolor2');\n\nvar Lib = require('../../lib');\nvar svgTextUtils = require('../../lib/svg_text_utils');\n\nvar Color = require('../../components/color');\nvar Drawing = require('../../components/drawing');\nvar ErrorBars = require('../../components/errorbars');\n\nvar attributes = require('./attributes'),\n attributeText = attributes.text,\n attributeTextPosition = attributes.textposition,\n attributeTextFont = attributes.textfont,\n attributeInsideTextFont = attributes.insidetextfont,\n attributeOutsideTextFont = attributes.outsidetextfont;\n\n// padding in pixels around text\nvar TEXTPAD = 3;\n\nmodule.exports = function plot(gd, plotinfo, cdbar) {\n var xa = plotinfo.xaxis,\n ya = plotinfo.yaxis,\n fullLayout = gd._fullLayout;\n\n var bartraces = plotinfo.plot.select('.barlayer')\n .selectAll('g.trace.bars')\n .data(cdbar);\n\n bartraces.enter().append('g')\n .attr('class', 'trace bars');\n\n bartraces.append('g')\n .attr('class', 'points')\n .each(function(d) {\n var sel = d[0].node3 = d3.select(this);\n var t = d[0].t;\n var trace = d[0].trace;\n var poffset = t.poffset;\n var poffsetIsArray = Array.isArray(poffset);\n\n sel.selectAll('g.point')\n .data(Lib.identity)\n .enter().append('g').classed('point', true)\n .each(function(di, i) {\n // now display the bar\n // clipped xf/yf (2nd arg true): non-positive\n // log values go off-screen by plotwidth\n // so you see them continue if you drag the plot\n var p0 = di.p + ((poffsetIsArray) ? poffset[i] : poffset),\n p1 = p0 + di.w,\n s0 = di.b,\n s1 = s0 + di.s;\n\n var x0, x1, y0, y1;\n if(trace.orientation === 'h') {\n y0 = ya.c2p(p0, true);\n y1 = ya.c2p(p1, true);\n x0 = xa.c2p(s0, true);\n x1 = xa.c2p(s1, true);\n\n // for selections\n di.ct = [x1, (y0 + y1) / 2];\n }\n else {\n x0 = xa.c2p(p0, true);\n x1 = xa.c2p(p1, true);\n y0 = ya.c2p(s0, true);\n y1 = ya.c2p(s1, true);\n\n // for selections\n di.ct = [(x0 + x1) / 2, y1];\n }\n\n if(!isNumeric(x0) || !isNumeric(x1) ||\n !isNumeric(y0) || !isNumeric(y1) ||\n x0 === x1 || y0 === y1) {\n d3.select(this).remove();\n return;\n }\n\n var lw = (di.mlw + 1 || trace.marker.line.width + 1 ||\n (di.trace ? di.trace.marker.line.width : 0) + 1) - 1,\n offset = d3.round((lw / 2) % 1, 2);\n\n function roundWithLine(v) {\n // if there are explicit gaps, don't round,\n // it can make the gaps look crappy\n return (fullLayout.bargap === 0 && fullLayout.bargroupgap === 0) ?\n d3.round(Math.round(v) - offset, 2) : v;\n }\n\n function expandToVisible(v, vc) {\n // if it's not in danger of disappearing entirely,\n // round more precisely\n return Math.abs(v - vc) >= 2 ? roundWithLine(v) :\n // but if it's very thin, expand it so it's\n // necessarily visible, even if it might overlap\n // its neighbor\n (v > vc ? Math.ceil(v) : Math.floor(v));\n }\n\n if(!gd._context.staticPlot) {\n // if bars are not fully opaque or they have a line\n // around them, round to integer pixels, mainly for\n // safari so we prevent overlaps from its expansive\n // pixelation. if the bars ARE fully opaque and have\n // no line, expand to a full pixel to make sure we\n // can see them\n var op = Color.opacity(di.mc || trace.marker.color),\n fixpx = (op < 1 || lw > 0.01) ?\n roundWithLine : expandToVisible;\n x0 = fixpx(x0, x1);\n x1 = fixpx(x1, x0);\n y0 = fixpx(y0, y1);\n y1 = fixpx(y1, y0);\n }\n\n // append bar path and text\n var bar = d3.select(this);\n\n bar.append('path')\n .style('vector-effect', 'non-scaling-stroke')\n .attr('d',\n 'M' + x0 + ',' + y0 + 'V' + y1 + 'H' + x1 + 'V' + y0 + 'Z');\n\n appendBarText(gd, bar, d, i, x0, x1, y0, y1);\n });\n });\n\n // error bars are on the top\n bartraces.call(ErrorBars.plot, plotinfo);\n\n};\n\nfunction appendBarText(gd, bar, calcTrace, i, x0, x1, y0, y1) {\n function appendTextNode(bar, text, textFont) {\n var textSelection = bar.append('text')\n .text(text)\n .attr({\n 'class': 'bartext',\n transform: '',\n 'text-anchor': 'middle',\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n 'data-notex': 1\n })\n .call(Drawing.font, textFont)\n .call(svgTextUtils.convertToTspans, gd);\n\n return textSelection;\n }\n\n // get trace attributes\n var trace = calcTrace[0].trace,\n orientation = trace.orientation;\n\n var text = getText(trace, i);\n if(!text) return;\n\n var textPosition = getTextPosition(trace, i);\n if(textPosition === 'none') return;\n\n var textFont = getTextFont(trace, i, gd._fullLayout.font),\n insideTextFont = getInsideTextFont(trace, i, textFont),\n outsideTextFont = getOutsideTextFont(trace, i, textFont);\n\n // compute text position\n var barmode = gd._fullLayout.barmode,\n inStackMode = (barmode === 'stack'),\n inRelativeMode = (barmode === 'relative'),\n inStackOrRelativeMode = inStackMode || inRelativeMode,\n\n calcBar = calcTrace[i],\n isOutmostBar = !inStackOrRelativeMode || calcBar._outmost,\n\n barWidth = Math.abs(x1 - x0) - 2 * TEXTPAD, // padding excluded\n barHeight = Math.abs(y1 - y0) - 2 * TEXTPAD, // padding excluded\n\n textSelection,\n textBB,\n textWidth,\n textHeight;\n\n if(textPosition === 'outside') {\n if(!isOutmostBar) textPosition = 'inside';\n }\n\n if(textPosition === 'auto') {\n if(isOutmostBar) {\n // draw text using insideTextFont and check if it fits inside bar\n textSelection = appendTextNode(bar, text, insideTextFont);\n\n textBB = Drawing.bBox(textSelection.node()),\n textWidth = textBB.width,\n textHeight = textBB.height;\n\n var textHasSize = (textWidth > 0 && textHeight > 0),\n fitsInside =\n (textWidth <= barWidth && textHeight <= barHeight),\n fitsInsideIfRotated =\n (textWidth <= barHeight && textHeight <= barWidth),\n fitsInsideIfShrunk = (orientation === 'h') ?\n (barWidth >= textWidth * (barHeight / textHeight)) :\n (barHeight >= textHeight * (barWidth / textWidth));\n if(textHasSize &&\n (fitsInside || fitsInsideIfRotated || fitsInsideIfShrunk)) {\n textPosition = 'inside';\n }\n else {\n textPosition = 'outside';\n textSelection.remove();\n textSelection = null;\n }\n }\n else textPosition = 'inside';\n }\n\n if(!textSelection) {\n textSelection = appendTextNode(bar, text,\n (textPosition === 'outside') ?\n outsideTextFont : insideTextFont);\n\n textBB = Drawing.bBox(textSelection.node()),\n textWidth = textBB.width,\n textHeight = textBB.height;\n\n if(textWidth <= 0 || textHeight <= 0) {\n textSelection.remove();\n return;\n }\n }\n\n // compute text transform\n var transform, constrained;\n if(textPosition === 'outside') {\n constrained = trace.constraintext === 'both' || trace.constraintext === 'outside';\n transform = getTransformToMoveOutsideBar(x0, x1, y0, y1, textBB,\n orientation, constrained);\n }\n else {\n constrained = trace.constraintext === 'both' || trace.constraintext === 'inside';\n transform = getTransformToMoveInsideBar(x0, x1, y0, y1, textBB,\n orientation, constrained);\n }\n\n textSelection.attr('transform', transform);\n}\n\nfunction getTransformToMoveInsideBar(x0, x1, y0, y1, textBB, orientation, constrained) {\n // compute text and target positions\n var textWidth = textBB.width,\n textHeight = textBB.height,\n textX = (textBB.left + textBB.right) / 2,\n textY = (textBB.top + textBB.bottom) / 2,\n barWidth = Math.abs(x1 - x0),\n barHeight = Math.abs(y1 - y0),\n targetWidth,\n targetHeight,\n targetX,\n targetY;\n\n // apply text padding\n var textpad;\n if(barWidth > (2 * TEXTPAD) && barHeight > (2 * TEXTPAD)) {\n textpad = TEXTPAD;\n barWidth -= 2 * textpad;\n barHeight -= 2 * textpad;\n }\n else textpad = 0;\n\n // compute rotation and scale\n var rotate,\n scale;\n\n if(textWidth <= barWidth && textHeight <= barHeight) {\n // no scale or rotation is required\n rotate = false;\n scale = 1;\n }\n else if(textWidth <= barHeight && textHeight <= barWidth) {\n // only rotation is required\n rotate = true;\n scale = 1;\n }\n else if((textWidth < textHeight) === (barWidth < barHeight)) {\n // only scale is required\n rotate = false;\n scale = constrained ? Math.min(barWidth / textWidth, barHeight / textHeight) : 1;\n }\n else {\n // both scale and rotation are required\n rotate = true;\n scale = constrained ? Math.min(barHeight / textWidth, barWidth / textHeight) : 1;\n }\n\n if(rotate) rotate = 90; // rotate clockwise\n\n // compute text and target positions\n if(rotate) {\n targetWidth = scale * textHeight;\n targetHeight = scale * textWidth;\n }\n else {\n targetWidth = scale * textWidth;\n targetHeight = scale * textHeight;\n }\n\n if(orientation === 'h') {\n if(x1 < x0) {\n // bar end is on the left hand side\n targetX = x1 + textpad + targetWidth / 2;\n targetY = (y0 + y1) / 2;\n }\n else {\n targetX = x1 - textpad - targetWidth / 2;\n targetY = (y0 + y1) / 2;\n }\n }\n else {\n if(y1 > y0) {\n // bar end is on the bottom\n targetX = (x0 + x1) / 2;\n targetY = y1 - textpad - targetHeight / 2;\n }\n else {\n targetX = (x0 + x1) / 2;\n targetY = y1 + textpad + targetHeight / 2;\n }\n }\n\n return getTransform(textX, textY, targetX, targetY, scale, rotate);\n}\n\nfunction getTransformToMoveOutsideBar(x0, x1, y0, y1, textBB, orientation, constrained) {\n var barWidth = (orientation === 'h') ?\n Math.abs(y1 - y0) :\n Math.abs(x1 - x0),\n textpad;\n\n // Keep the padding so the text doesn't sit right against\n // the bars, but don't factor it into barWidth\n if(barWidth > 2 * TEXTPAD) {\n textpad = TEXTPAD;\n }\n\n // compute rotation and scale\n var scale = 1;\n if(constrained) {\n scale = (orientation === 'h') ?\n Math.min(1, barWidth / textBB.height) :\n Math.min(1, barWidth / textBB.width);\n }\n\n // compute text and target positions\n var textX = (textBB.left + textBB.right) / 2,\n textY = (textBB.top + textBB.bottom) / 2,\n targetWidth,\n targetHeight,\n targetX,\n targetY;\n\n targetWidth = scale * textBB.width;\n targetHeight = scale * textBB.height;\n\n if(orientation === 'h') {\n if(x1 < x0) {\n // bar end is on the left hand side\n targetX = x1 - textpad - targetWidth / 2;\n targetY = (y0 + y1) / 2;\n }\n else {\n targetX = x1 + textpad + targetWidth / 2;\n targetY = (y0 + y1) / 2;\n }\n }\n else {\n if(y1 > y0) {\n // bar end is on the bottom\n targetX = (x0 + x1) / 2;\n targetY = y1 + textpad + targetHeight / 2;\n }\n else {\n targetX = (x0 + x1) / 2;\n targetY = y1 - textpad - targetHeight / 2;\n }\n }\n\n return getTransform(textX, textY, targetX, targetY, scale, false);\n}\n\nfunction getTransform(textX, textY, targetX, targetY, scale, rotate) {\n var transformScale,\n transformRotate,\n transformTranslate;\n\n if(scale < 1) transformScale = 'scale(' + scale + ') ';\n else {\n scale = 1;\n transformScale = '';\n }\n\n transformRotate = (rotate) ?\n 'rotate(' + rotate + ' ' + textX + ' ' + textY + ') ' : '';\n\n // Note that scaling also affects the center of the text box\n var translateX = (targetX - scale * textX),\n translateY = (targetY - scale * textY);\n transformTranslate = 'translate(' + translateX + ' ' + translateY + ')';\n\n return transformTranslate + transformScale + transformRotate;\n}\n\nfunction getText(trace, index) {\n var value = getValue(trace.text, index);\n return coerceString(attributeText, value);\n}\n\nfunction getTextPosition(trace, index) {\n var value = getValue(trace.textposition, index);\n return coerceEnumerated(attributeTextPosition, value);\n}\n\nfunction getTextFont(trace, index, defaultValue) {\n return getFontValue(\n attributeTextFont, trace.textfont, index, defaultValue);\n}\n\nfunction getInsideTextFont(trace, index, defaultValue) {\n return getFontValue(\n attributeInsideTextFont, trace.insidetextfont, index, defaultValue);\n}\n\nfunction getOutsideTextFont(trace, index, defaultValue) {\n return getFontValue(\n attributeOutsideTextFont, trace.outsidetextfont, index, defaultValue);\n}\n\nfunction getFontValue(attributeDefinition, attributeValue, index, defaultValue) {\n attributeValue = attributeValue || {};\n\n var familyValue = getValue(attributeValue.family, index),\n sizeValue = getValue(attributeValue.size, index),\n colorValue = getValue(attributeValue.color, index);\n\n return {\n family: coerceString(\n attributeDefinition.family, familyValue, defaultValue.family),\n size: coerceNumber(\n attributeDefinition.size, sizeValue, defaultValue.size),\n color: coerceColor(\n attributeDefinition.color, colorValue, defaultValue.color)\n };\n}\n\nfunction getValue(arrayOrScalar, index) {\n var value;\n if(!Array.isArray(arrayOrScalar)) value = arrayOrScalar;\n else if(index < arrayOrScalar.length) value = arrayOrScalar[index];\n return value;\n}\n\nfunction coerceString(attributeDefinition, value, defaultValue) {\n if(typeof value === 'string') {\n if(value || !attributeDefinition.noBlank) return value;\n }\n else if(typeof value === 'number') {\n if(!attributeDefinition.strict) return String(value);\n }\n\n return (defaultValue !== undefined) ?\n defaultValue :\n attributeDefinition.dflt;\n}\n\nfunction coerceEnumerated(attributeDefinition, value, defaultValue) {\n if(attributeDefinition.coerceNumber) value = +value;\n\n if(attributeDefinition.values.indexOf(value) !== -1) return value;\n\n return (defaultValue !== undefined) ?\n defaultValue :\n attributeDefinition.dflt;\n}\n\nfunction coerceNumber(attributeDefinition, value, defaultValue) {\n if(isNumeric(value)) {\n value = +value;\n\n var min = attributeDefinition.min,\n max = attributeDefinition.max,\n isOutOfBounds = (min !== undefined && value < min) ||\n (max !== undefined && value > max);\n\n if(!isOutOfBounds) return value;\n }\n\n return (defaultValue !== undefined) ?\n defaultValue :\n attributeDefinition.dflt;\n}\n\nfunction coerceColor(attributeDefinition, value, defaultValue) {\n if(tinycolor(value).isValid()) return value;\n\n return (defaultValue !== undefined) ?\n defaultValue :\n attributeDefinition.dflt;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/plot.js\n// module id = 508\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Color = require('../../components/color');\nvar Drawing = require('../../components/drawing');\nvar ErrorBars = require('../../components/errorbars');\n\n\nmodule.exports = function style(gd) {\n var s = d3.select(gd).selectAll('g.trace.bars'),\n barcount = s.size(),\n fullLayout = gd._fullLayout;\n\n // trace styling\n s.style('opacity', function(d) { return d[0].trace.opacity; })\n\n // for gapless (either stacked or neighboring grouped) bars use\n // crispEdges to turn off antialiasing so an artificial gap\n // isn't introduced.\n .each(function(d) {\n if((fullLayout.barmode === 'stack' && barcount > 1) ||\n (fullLayout.bargap === 0 &&\n fullLayout.bargroupgap === 0 &&\n !d[0].trace.marker.line.width)) {\n d3.select(this).attr('shape-rendering', 'crispEdges');\n }\n });\n\n // then style the individual bars\n s.selectAll('g.points').each(function(d) {\n var trace = d[0].trace,\n marker = trace.marker,\n markerLine = marker.line,\n markerScale = Drawing.tryColorscale(marker, ''),\n lineScale = Drawing.tryColorscale(marker, 'line');\n\n d3.select(this).selectAll('path').each(function(d) {\n // allow all marker and marker line colors to be scaled\n // by given max and min to colorscales\n var fillColor,\n lineColor,\n lineWidth = (d.mlw + 1 || markerLine.width + 1) - 1,\n p = d3.select(this);\n\n if('mc' in d) fillColor = d.mcc = markerScale(d.mc);\n else if(Array.isArray(marker.color)) fillColor = Color.defaultLine;\n else fillColor = marker.color;\n\n p.style('stroke-width', lineWidth + 'px')\n .call(Color.fill, fillColor);\n if(lineWidth) {\n if('mlc' in d) lineColor = d.mlcc = lineScale(d.mlc);\n // weird case: array wasn't long enough to apply to every point\n else if(Array.isArray(markerLine.color)) lineColor = Color.defaultLine;\n else lineColor = markerLine.color;\n\n p.call(Color.stroke, lineColor);\n }\n });\n });\n\n s.call(ErrorBars.style);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/style.js\n// module id = 509\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Fx = require('../../components/fx');\nvar ErrorBars = require('../../components/errorbars');\nvar Color = require('../../components/color');\nvar fillHoverText = require('../scatter/fill_hover_text');\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var t = cd[0].t;\n var xa = pointData.xa;\n var ya = pointData.ya;\n\n var posVal, thisBarMinPos, thisBarMaxPos, minPos, maxPos, dx, dy;\n\n var positionFn = function(di) {\n return Fx.inbox(minPos(di) - posVal, maxPos(di) - posVal);\n };\n\n if(trace.orientation === 'h') {\n posVal = yval;\n thisBarMinPos = function(di) { return di.y - di.w / 2; };\n thisBarMaxPos = function(di) { return di.y + di.w / 2; };\n dx = function(di) {\n // add a gradient so hovering near the end of a\n // bar makes it a little closer match\n return Fx.inbox(di.b - xval, di.x - xval) + (di.x - xval) / (di.x - di.b);\n };\n dy = positionFn;\n }\n else {\n posVal = xval;\n thisBarMinPos = function(di) { return di.x - di.w / 2; };\n thisBarMaxPos = function(di) { return di.x + di.w / 2; };\n dy = function(di) {\n return Fx.inbox(di.b - yval, di.y - yval) + (di.y - yval) / (di.y - di.b);\n };\n dx = positionFn;\n }\n\n minPos = (hovermode === 'closest') ?\n thisBarMinPos :\n function(di) {\n /*\n * In compare mode, accept a bar if you're on it *or* its group.\n * Nearly always it's the group that matters, but in case the bar\n * was explicitly set wider than its group we'd better accept the\n * whole bar.\n */\n return Math.min(thisBarMinPos(di), di.p - t.bargroupwidth / 2);\n };\n\n maxPos = (hovermode === 'closest') ?\n thisBarMaxPos :\n function(di) {\n return Math.max(thisBarMaxPos(di), di.p + t.bargroupwidth / 2);\n };\n\n var distfn = Fx.getDistanceFunction(hovermode, dx, dy);\n Fx.getClosest(cd, distfn, pointData);\n\n // skip the rest (for this trace) if we didn't find a close point\n if(pointData.index === false) return;\n\n // the closest data point\n var index = pointData.index,\n di = cd[index],\n mc = di.mcc || trace.marker.color,\n mlc = di.mlcc || trace.marker.line.color,\n mlw = di.mlw || trace.marker.line.width;\n if(Color.opacity(mc)) pointData.color = mc;\n else if(Color.opacity(mlc) && mlw) pointData.color = mlc;\n\n var size = (trace.base) ? di.b + di.s : di.s;\n if(trace.orientation === 'h') {\n pointData.x0 = pointData.x1 = xa.c2p(di.x, true);\n pointData.xLabelVal = size;\n\n pointData.y0 = ya.c2p(minPos(di), true);\n pointData.y1 = ya.c2p(maxPos(di), true);\n pointData.yLabelVal = di.p;\n }\n else {\n pointData.y0 = pointData.y1 = ya.c2p(di.y, true);\n pointData.yLabelVal = size;\n\n pointData.x0 = xa.c2p(minPos(di), true);\n pointData.x1 = xa.c2p(maxPos(di), true);\n pointData.xLabelVal = di.p;\n }\n\n fillHoverText(di, trace, pointData);\n ErrorBars.hoverInfo(di, trace, pointData);\n\n return [pointData];\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/hover.js\n// module id = 510\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar DESELECTDIM = require('../../constants/interactions').DESELECTDIM;\n\nmodule.exports = function selectPoints(searchInfo, polygon) {\n var cd = searchInfo.cd;\n var selection = [];\n var node3 = cd[0].node3;\n var i;\n\n if(polygon === false) {\n // clear selection\n for(i = 0; i < cd.length; i++) {\n cd[i].dim = 0;\n }\n } else {\n for(i = 0; i < cd.length; i++) {\n var di = cd[i];\n\n if(polygon.contains(di.ct)) {\n selection.push({\n pointNumber: i,\n x: di.x,\n y: di.y\n });\n di.dim = 0;\n } else {\n di.dim = 1;\n }\n }\n }\n\n node3.selectAll('.point').style('opacity', function(d) {\n return d.dim ? DESELECTDIM : 1;\n });\n node3.selectAll('text').style('opacity', function(d) {\n return d.dim ? DESELECTDIM : 1;\n });\n\n return selection;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/bar/select.js\n// module id = 511\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = require('../src/traces/pie');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/lib/pie.js\n// module id = 512\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Pie = {};\n\nPie.attributes = require('./attributes');\nPie.supplyDefaults = require('./defaults');\nPie.supplyLayoutDefaults = require('./layout_defaults');\nPie.layoutAttributes = require('./layout_attributes');\nPie.calc = require('./calc');\nPie.plot = require('./plot');\nPie.style = require('./style');\nPie.styleOne = require('./style_one');\n\nPie.moduleType = 'trace';\nPie.name = 'pie';\nPie.basePlotModule = require('./base_plot');\nPie.categories = ['pie', 'showLegend'];\nPie.meta = {\n \n};\n\nmodule.exports = Pie;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/index.js\n// module id = 513\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\nvar attributes = require('./attributes');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n var coerceFont = Lib.coerceFont;\n\n var vals = coerce('values');\n if(!Array.isArray(vals) || !vals.length) {\n traceOut.visible = false;\n return;\n }\n\n var labels = coerce('labels');\n if(!Array.isArray(labels)) {\n coerce('label0');\n coerce('dlabel');\n }\n\n var lineWidth = coerce('marker.line.width');\n if(lineWidth) coerce('marker.line.color');\n\n var colors = coerce('marker.colors');\n if(!Array.isArray(colors)) traceOut.marker.colors = []; // later this will get padded with default colors\n\n coerce('scalegroup');\n // TODO: tilt, depth, and hole all need to be coerced to the same values within a scaleegroup\n // (ideally actually, depth would get set the same *after* scaling, ie the same absolute depth)\n // and if colors aren't specified we should match these up - potentially even if separate pies\n // are NOT in the same sharegroup\n\n\n var textData = coerce('text');\n var textInfo = coerce('textinfo', Array.isArray(textData) ? 'text+percent' : 'percent');\n coerce('hovertext');\n\n if(textInfo && textInfo !== 'none') {\n var textPosition = coerce('textposition'),\n hasBoth = Array.isArray(textPosition) || textPosition === 'auto',\n hasInside = hasBoth || textPosition === 'inside',\n hasOutside = hasBoth || textPosition === 'outside';\n\n if(hasInside || hasOutside) {\n var dfltFont = coerceFont(coerce, 'textfont', layout.font);\n if(hasInside) coerceFont(coerce, 'insidetextfont', dfltFont);\n if(hasOutside) coerceFont(coerce, 'outsidetextfont', dfltFont);\n }\n }\n\n coerce('domain.x');\n coerce('domain.y');\n\n // 3D attributes commented out until I finish them in a later PR\n // var tilt = coerce('tilt');\n // if(tilt) {\n // coerce('tiltaxis');\n // coerce('depth');\n // coerce('shading');\n // }\n\n coerce('hole');\n\n coerce('sort');\n coerce('direction');\n coerce('rotation');\n\n coerce('pull');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/defaults.js\n// module id = 514\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = require('../../lib');\n\nvar layoutAttributes = require('./layout_attributes');\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n coerce('hiddenlabels');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/layout_defaults.js\n// module id = 515\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar tinycolor = require('tinycolor2');\n\nvar Color = require('../../components/color');\nvar helpers = require('./helpers');\n\nmodule.exports = function calc(gd, trace) {\n var vals = trace.values,\n labels = trace.labels,\n cd = [],\n fullLayout = gd._fullLayout,\n colorMap = fullLayout._piecolormap,\n allThisTraceLabels = {},\n needDefaults = false,\n vTotal = 0,\n hiddenLabels = fullLayout.hiddenlabels || [],\n i,\n v,\n label,\n color,\n hidden,\n pt;\n\n if(trace.dlabel) {\n labels = new Array(vals.length);\n for(i = 0; i < vals.length; i++) {\n labels[i] = String(trace.label0 + i * trace.dlabel);\n }\n }\n\n for(i = 0; i < vals.length; i++) {\n v = vals[i];\n if(!isNumeric(v)) continue;\n v = +v;\n if(v < 0) continue;\n\n label = labels[i];\n if(label === undefined || label === '') label = i;\n label = String(label);\n // only take the first occurrence of any given label.\n // TODO: perhaps (optionally?) sum values for a repeated label?\n if(allThisTraceLabels[label] === undefined) allThisTraceLabels[label] = true;\n else continue;\n\n color = tinycolor(trace.marker.colors[i]);\n if(color.isValid()) {\n color = Color.addOpacity(color, color.getAlpha());\n if(!colorMap[label]) {\n colorMap[label] = color;\n }\n }\n // have we seen this label and assigned a color to it in a previous trace?\n else if(colorMap[label]) color = colorMap[label];\n // color needs a default - mark it false, come back after sorting\n else {\n color = false;\n needDefaults = true;\n }\n\n hidden = hiddenLabels.indexOf(label) !== -1;\n\n if(!hidden) vTotal += v;\n\n cd.push({\n v: v,\n label: label,\n color: color,\n i: i,\n hidden: hidden\n });\n }\n\n if(trace.sort) cd.sort(function(a, b) { return b.v - a.v; });\n\n /**\n * now go back and fill in colors we're still missing\n * this is done after sorting, so we pick defaults\n * in the order slices will be displayed\n */\n\n if(needDefaults) {\n for(i = 0; i < cd.length; i++) {\n pt = cd[i];\n if(pt.color === false) {\n colorMap[pt.label] = pt.color = nextDefaultColor(fullLayout._piedefaultcolorcount);\n fullLayout._piedefaultcolorcount++;\n }\n }\n }\n\n // include the sum of all values in the first point\n if(cd[0]) cd[0].vTotal = vTotal;\n\n // now insert text\n if(trace.textinfo && trace.textinfo !== 'none') {\n var hasLabel = trace.textinfo.indexOf('label') !== -1,\n hasText = trace.textinfo.indexOf('text') !== -1,\n hasValue = trace.textinfo.indexOf('value') !== -1,\n hasPercent = trace.textinfo.indexOf('percent') !== -1,\n separators = fullLayout.separators,\n thisText;\n\n for(i = 0; i < cd.length; i++) {\n pt = cd[i];\n thisText = hasLabel ? [pt.label] : [];\n if(hasText && trace.text[pt.i]) thisText.push(trace.text[pt.i]);\n if(hasValue) thisText.push(helpers.formatPieValue(pt.v, separators));\n if(hasPercent) thisText.push(helpers.formatPiePercent(pt.v / vTotal, separators));\n pt.text = thisText.join('
');\n }\n }\n\n return cd;\n};\n\n/**\n * pick a default color from the main default set, augmented by\n * itself lighter then darker before repeating\n */\nvar pieDefaultColors;\n\nfunction nextDefaultColor(index) {\n if(!pieDefaultColors) {\n // generate this default set on demand (but then it gets saved in the module)\n var mainDefaults = Color.defaults;\n pieDefaultColors = mainDefaults.slice();\n\n var i;\n\n for(i = 0; i < mainDefaults.length; i++) {\n pieDefaultColors.push(tinycolor(mainDefaults[i]).lighten(20).toHexString());\n }\n\n for(i = 0; i < Color.defaults.length; i++) {\n pieDefaultColors.push(tinycolor(mainDefaults[i]).darken(20).toHexString());\n }\n }\n\n return pieDefaultColors[index % pieDefaultColors.length];\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/calc.js\n// module id = 516\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar Fx = require('../../components/fx');\nvar Color = require('../../components/color');\nvar Drawing = require('../../components/drawing');\nvar svgTextUtils = require('../../lib/svg_text_utils');\n\nvar helpers = require('./helpers');\n\nmodule.exports = function plot(gd, cdpie) {\n var fullLayout = gd._fullLayout;\n\n scalePies(cdpie, fullLayout._size);\n\n var pieGroups = fullLayout._pielayer.selectAll('g.trace').data(cdpie);\n\n pieGroups.enter().append('g')\n .attr({\n 'stroke-linejoin': 'round', // TODO: miter might look better but can sometimes cause problems\n // maybe miter with a small-ish stroke-miterlimit?\n 'class': 'trace'\n });\n pieGroups.exit().remove();\n pieGroups.order();\n\n pieGroups.each(function(cd) {\n var pieGroup = d3.select(this),\n cd0 = cd[0],\n trace = cd0.trace,\n tiltRads = 0, // trace.tilt * Math.PI / 180,\n depthLength = (trace.depth||0) * cd0.r * Math.sin(tiltRads) / 2,\n tiltAxis = trace.tiltaxis || 0,\n tiltAxisRads = tiltAxis * Math.PI / 180,\n depthVector = [\n depthLength * Math.sin(tiltAxisRads),\n depthLength * Math.cos(tiltAxisRads)\n ],\n rSmall = cd0.r * Math.cos(tiltRads);\n\n var pieParts = pieGroup.selectAll('g.part')\n .data(trace.tilt ? ['top', 'sides'] : ['top']);\n\n pieParts.enter().append('g').attr('class', function(d) {\n return d + ' part';\n });\n pieParts.exit().remove();\n pieParts.order();\n\n setCoords(cd);\n\n pieGroup.selectAll('.top').each(function() {\n var slices = d3.select(this).selectAll('g.slice').data(cd);\n\n slices.enter().append('g')\n .classed('slice', true);\n slices.exit().remove();\n\n var quadrants = [\n [[], []], // y<0: x<0, x>=0\n [[], []] // y>=0: x<0, x>=0\n ],\n hasOutsideText = false;\n\n slices.each(function(pt) {\n if(pt.hidden) {\n d3.select(this).selectAll('path,g').remove();\n return;\n }\n\n // to have consistent event data compared to other traces\n pt.pointNumber = pt.i;\n pt.curveNumber = trace.index;\n\n quadrants[pt.pxmid[1] < 0 ? 0 : 1][pt.pxmid[0] < 0 ? 0 : 1].push(pt);\n\n var cx = cd0.cx + depthVector[0],\n cy = cd0.cy + depthVector[1],\n sliceTop = d3.select(this),\n slicePath = sliceTop.selectAll('path.surface').data([pt]),\n hasHoverData = false;\n\n function handleMouseOver(evt) {\n evt.originalEvent = d3.event;\n\n // in case fullLayout or fullData has changed without a replot\n var fullLayout2 = gd._fullLayout;\n var trace2 = gd._fullData[trace.index];\n var hoverinfo = Fx.castHoverinfo(trace2, fullLayout2, pt.i);\n\n if(hoverinfo === 'all') hoverinfo = 'label+text+value+percent+name';\n\n // in case we dragged over the pie from another subplot,\n // or if hover is turned off\n if(gd._dragging || fullLayout2.hovermode === false ||\n hoverinfo === 'none' || hoverinfo === 'skip' || !hoverinfo) {\n Fx.hover(gd, evt, 'pie');\n return;\n }\n\n var rInscribed = getInscribedRadiusFraction(pt, cd0),\n hoverCenterX = cx + pt.pxmid[0] * (1 - rInscribed),\n hoverCenterY = cy + pt.pxmid[1] * (1 - rInscribed),\n separators = fullLayout.separators,\n thisText = [];\n\n if(hoverinfo.indexOf('label') !== -1) thisText.push(pt.label);\n if(hoverinfo.indexOf('text') !== -1) {\n if(trace2.hovertext) {\n thisText.push(\n Array.isArray(trace2.hovertext) ?\n trace2.hovertext[pt.i] :\n trace2.hovertext\n );\n } else if(trace2.text && trace2.text[pt.i]) {\n thisText.push(trace2.text[pt.i]);\n }\n }\n if(hoverinfo.indexOf('value') !== -1) thisText.push(helpers.formatPieValue(pt.v, separators));\n if(hoverinfo.indexOf('percent') !== -1) thisText.push(helpers.formatPiePercent(pt.v / cd0.vTotal, separators));\n\n Fx.loneHover({\n x0: hoverCenterX - rInscribed * cd0.r,\n x1: hoverCenterX + rInscribed * cd0.r,\n y: hoverCenterY,\n text: thisText.join('
'),\n name: hoverinfo.indexOf('name') !== -1 ? trace2.name : undefined,\n idealAlign: pt.pxmid[0] < 0 ? 'left' : 'right',\n color: Fx.castHoverOption(trace, pt.i, 'bgcolor') || pt.color,\n borderColor: Fx.castHoverOption(trace, pt.i, 'bordercolor'),\n fontFamily: Fx.castHoverOption(trace, pt.i, 'font.family'),\n fontSize: Fx.castHoverOption(trace, pt.i, 'font.size'),\n fontColor: Fx.castHoverOption(trace, pt.i, 'font.color')\n }, {\n container: fullLayout2._hoverlayer.node(),\n outerContainer: fullLayout2._paper.node(),\n gd: gd\n });\n\n Fx.hover(gd, evt, 'pie');\n\n hasHoverData = true;\n }\n\n function handleMouseOut(evt) {\n evt.originalEvent = d3.event;\n gd.emit('plotly_unhover', {\n event: d3.event,\n points: [evt]\n });\n\n if(hasHoverData) {\n Fx.loneUnhover(fullLayout._hoverlayer.node());\n hasHoverData = false;\n }\n }\n\n function handleClick() {\n gd._hoverdata = [pt];\n gd._hoverdata.trace = cd0.trace;\n Fx.click(gd, d3.event);\n }\n\n slicePath.enter().append('path')\n .classed('surface', true)\n .style({'pointer-events': 'all'});\n\n sliceTop.select('path.textline').remove();\n\n sliceTop\n .on('mouseover', handleMouseOver)\n .on('mouseout', handleMouseOut)\n .on('click', handleClick);\n\n if(trace.pull) {\n var pull = +(Array.isArray(trace.pull) ? trace.pull[pt.i] : trace.pull) || 0;\n if(pull > 0) {\n cx += pull * pt.pxmid[0];\n cy += pull * pt.pxmid[1];\n }\n }\n\n pt.cxFinal = cx;\n pt.cyFinal = cy;\n\n function arc(start, finish, cw, scale) {\n return 'a' + (scale * cd0.r) + ',' + (scale * rSmall) + ' ' + tiltAxis + ' ' +\n pt.largeArc + (cw ? ' 1 ' : ' 0 ') +\n (scale * (finish[0] - start[0])) + ',' + (scale * (finish[1] - start[1]));\n }\n\n var hole = trace.hole;\n if(pt.v === cd0.vTotal) { // 100% fails bcs arc start and end are identical\n var outerCircle = 'M' + (cx + pt.px0[0]) + ',' + (cy + pt.px0[1]) +\n arc(pt.px0, pt.pxmid, true, 1) +\n arc(pt.pxmid, pt.px0, true, 1) + 'Z';\n if(hole) {\n slicePath.attr('d',\n 'M' + (cx + hole * pt.px0[0]) + ',' + (cy + hole * pt.px0[1]) +\n arc(pt.px0, pt.pxmid, false, hole) +\n arc(pt.pxmid, pt.px0, false, hole) +\n 'Z' + outerCircle);\n }\n else slicePath.attr('d', outerCircle);\n } else {\n\n var outerArc = arc(pt.px0, pt.px1, true, 1);\n\n if(hole) {\n var rim = 1 - hole;\n slicePath.attr('d',\n 'M' + (cx + hole * pt.px1[0]) + ',' + (cy + hole * pt.px1[1]) +\n arc(pt.px1, pt.px0, false, hole) +\n 'l' + (rim * pt.px0[0]) + ',' + (rim * pt.px0[1]) +\n outerArc +\n 'Z');\n } else {\n slicePath.attr('d',\n 'M' + cx + ',' + cy +\n 'l' + pt.px0[0] + ',' + pt.px0[1] +\n outerArc +\n 'Z');\n }\n }\n\n // add text\n var textPosition = Array.isArray(trace.textposition) ?\n trace.textposition[pt.i] : trace.textposition,\n sliceTextGroup = sliceTop.selectAll('g.slicetext')\n .data(pt.text && (textPosition !== 'none') ? [0] : []);\n\n sliceTextGroup.enter().append('g')\n .classed('slicetext', true);\n sliceTextGroup.exit().remove();\n\n sliceTextGroup.each(function() {\n var sliceText = d3.select(this).selectAll('text').data([0]);\n\n sliceText.enter().append('text')\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n .attr('data-notex', 1);\n sliceText.exit().remove();\n\n sliceText.text(pt.text)\n .attr({\n 'class': 'slicetext',\n transform: '',\n 'text-anchor': 'middle'\n })\n .call(Drawing.font, textPosition === 'outside' ?\n trace.outsidetextfont : trace.insidetextfont)\n .call(svgTextUtils.convertToTspans, gd);\n\n // position the text relative to the slice\n // TODO: so far this only accounts for flat\n var textBB = Drawing.bBox(sliceText.node()),\n transform;\n\n if(textPosition === 'outside') {\n transform = transformOutsideText(textBB, pt);\n } else {\n transform = transformInsideText(textBB, pt, cd0);\n if(textPosition === 'auto' && transform.scale < 1) {\n sliceText.call(Drawing.font, trace.outsidetextfont);\n if(trace.outsidetextfont.family !== trace.insidetextfont.family ||\n trace.outsidetextfont.size !== trace.insidetextfont.size) {\n textBB = Drawing.bBox(sliceText.node());\n }\n transform = transformOutsideText(textBB, pt);\n }\n }\n\n var translateX = cx + pt.pxmid[0] * transform.rCenter + (transform.x || 0),\n translateY = cy + pt.pxmid[1] * transform.rCenter + (transform.y || 0);\n\n // save some stuff to use later ensure no labels overlap\n if(transform.outside) {\n pt.yLabelMin = translateY - textBB.height / 2;\n pt.yLabelMid = translateY;\n pt.yLabelMax = translateY + textBB.height / 2;\n pt.labelExtraX = 0;\n pt.labelExtraY = 0;\n hasOutsideText = true;\n }\n\n sliceText.attr('transform',\n 'translate(' + translateX + ',' + translateY + ')' +\n (transform.scale < 1 ? ('scale(' + transform.scale + ')') : '') +\n (transform.rotate ? ('rotate(' + transform.rotate + ')') : '') +\n 'translate(' +\n (-(textBB.left + textBB.right) / 2) + ',' +\n (-(textBB.top + textBB.bottom) / 2) +\n ')');\n });\n });\n\n // now make sure no labels overlap (at least within one pie)\n if(hasOutsideText) scootLabels(quadrants, trace);\n slices.each(function(pt) {\n if(pt.labelExtraX || pt.labelExtraY) {\n // first move the text to its new location\n var sliceTop = d3.select(this),\n sliceText = sliceTop.select('g.slicetext text');\n\n sliceText.attr('transform', 'translate(' + pt.labelExtraX + ',' + pt.labelExtraY + ')' +\n sliceText.attr('transform'));\n\n // then add a line to the new location\n var lineStartX = pt.cxFinal + pt.pxmid[0],\n lineStartY = pt.cyFinal + pt.pxmid[1],\n textLinePath = 'M' + lineStartX + ',' + lineStartY,\n finalX = (pt.yLabelMax - pt.yLabelMin) * (pt.pxmid[0] < 0 ? -1 : 1) / 4;\n if(pt.labelExtraX) {\n var yFromX = pt.labelExtraX * pt.pxmid[1] / pt.pxmid[0],\n yNet = pt.yLabelMid + pt.labelExtraY - (pt.cyFinal + pt.pxmid[1]);\n\n if(Math.abs(yFromX) > Math.abs(yNet)) {\n textLinePath +=\n 'l' + (yNet * pt.pxmid[0] / pt.pxmid[1]) + ',' + yNet +\n 'H' + (lineStartX + pt.labelExtraX + finalX);\n } else {\n textLinePath += 'l' + pt.labelExtraX + ',' + yFromX +\n 'v' + (yNet - yFromX) +\n 'h' + finalX;\n }\n } else {\n textLinePath +=\n 'V' + (pt.yLabelMid + pt.labelExtraY) +\n 'h' + finalX;\n }\n\n sliceTop.append('path')\n .classed('textline', true)\n .call(Color.stroke, trace.outsidetextfont.color)\n .attr({\n 'stroke-width': Math.min(2, trace.outsidetextfont.size / 8),\n d: textLinePath,\n fill: 'none'\n });\n }\n });\n });\n });\n\n // This is for a bug in Chrome (as of 2015-07-22, and does not affect FF)\n // if insidetextfont and outsidetextfont are different sizes, sometimes the size\n // of an \"em\" gets taken from the wrong element at first so lines are\n // spaced wrong. You just have to tell it to try again later and it gets fixed.\n // I have no idea why we haven't seen this in other contexts. Also, sometimes\n // it gets the initial draw correct but on redraw it gets confused.\n setTimeout(function() {\n pieGroups.selectAll('tspan').each(function() {\n var s = d3.select(this);\n if(s.attr('dy')) s.attr('dy', s.attr('dy'));\n });\n }, 0);\n};\n\n\nfunction transformInsideText(textBB, pt, cd0) {\n var textDiameter = Math.sqrt(textBB.width * textBB.width + textBB.height * textBB.height),\n textAspect = textBB.width / textBB.height,\n halfAngle = Math.PI * Math.min(pt.v / cd0.vTotal, 0.5),\n ring = 1 - cd0.trace.hole,\n rInscribed = getInscribedRadiusFraction(pt, cd0),\n\n // max size text can be inserted inside without rotating it\n // this inscribes the text rectangle in a circle, which is then inscribed\n // in the slice, so it will be an underestimate, which some day we may want\n // to improve so this case can get more use\n transform = {\n scale: rInscribed * cd0.r * 2 / textDiameter,\n\n // and the center position and rotation in this case\n rCenter: 1 - rInscribed,\n rotate: 0\n };\n\n if(transform.scale >= 1) return transform;\n\n // max size if text is rotated radially\n var Qr = textAspect + 1 / (2 * Math.tan(halfAngle)),\n maxHalfHeightRotRadial = cd0.r * Math.min(\n 1 / (Math.sqrt(Qr * Qr + 0.5) + Qr),\n ring / (Math.sqrt(textAspect * textAspect + ring / 2) + textAspect)\n ),\n radialTransform = {\n scale: maxHalfHeightRotRadial * 2 / textBB.height,\n rCenter: Math.cos(maxHalfHeightRotRadial / cd0.r) -\n maxHalfHeightRotRadial * textAspect / cd0.r,\n rotate: (180 / Math.PI * pt.midangle + 720) % 180 - 90\n },\n\n // max size if text is rotated tangentially\n aspectInv = 1 / textAspect,\n Qt = aspectInv + 1 / (2 * Math.tan(halfAngle)),\n maxHalfWidthTangential = cd0.r * Math.min(\n 1 / (Math.sqrt(Qt * Qt + 0.5) + Qt),\n ring / (Math.sqrt(aspectInv * aspectInv + ring / 2) + aspectInv)\n ),\n tangentialTransform = {\n scale: maxHalfWidthTangential * 2 / textBB.width,\n rCenter: Math.cos(maxHalfWidthTangential / cd0.r) -\n maxHalfWidthTangential / textAspect / cd0.r,\n rotate: (180 / Math.PI * pt.midangle + 810) % 180 - 90\n },\n // if we need a rotated transform, pick the biggest one\n // even if both are bigger than 1\n rotatedTransform = tangentialTransform.scale > radialTransform.scale ?\n tangentialTransform : radialTransform;\n\n if(transform.scale < 1 && rotatedTransform.scale > transform.scale) return rotatedTransform;\n return transform;\n}\n\nfunction getInscribedRadiusFraction(pt, cd0) {\n if(pt.v === cd0.vTotal && !cd0.trace.hole) return 1;// special case of 100% with no hole\n\n var halfAngle = Math.PI * Math.min(pt.v / cd0.vTotal, 0.5);\n return Math.min(1 / (1 + 1 / Math.sin(halfAngle)), (1 - cd0.trace.hole) / 2);\n}\n\nfunction transformOutsideText(textBB, pt) {\n var x = pt.pxmid[0],\n y = pt.pxmid[1],\n dx = textBB.width / 2,\n dy = textBB.height / 2;\n\n if(x < 0) dx *= -1;\n if(y < 0) dy *= -1;\n\n return {\n scale: 1,\n rCenter: 1,\n rotate: 0,\n x: dx + Math.abs(dy) * (dx > 0 ? 1 : -1) / 2,\n y: dy / (1 + x * x / (y * y)),\n outside: true\n };\n}\n\nfunction scootLabels(quadrants, trace) {\n var xHalf,\n yHalf,\n equatorFirst,\n farthestX,\n farthestY,\n xDiffSign,\n yDiffSign,\n thisQuad,\n oppositeQuad,\n wholeSide,\n i,\n thisQuadOutside,\n firstOppositeOutsidePt;\n\n function topFirst(a, b) { return a.pxmid[1] - b.pxmid[1]; }\n function bottomFirst(a, b) { return b.pxmid[1] - a.pxmid[1]; }\n\n function scootOneLabel(thisPt, prevPt) {\n if(!prevPt) prevPt = {};\n\n var prevOuterY = prevPt.labelExtraY + (yHalf ? prevPt.yLabelMax : prevPt.yLabelMin),\n thisInnerY = yHalf ? thisPt.yLabelMin : thisPt.yLabelMax,\n thisOuterY = yHalf ? thisPt.yLabelMax : thisPt.yLabelMin,\n thisSliceOuterY = thisPt.cyFinal + farthestY(thisPt.px0[1], thisPt.px1[1]),\n newExtraY = prevOuterY - thisInnerY,\n xBuffer,\n i,\n otherPt,\n otherOuterY,\n otherOuterX,\n newExtraX;\n // make sure this label doesn't overlap other labels\n // this *only* has us move these labels vertically\n if(newExtraY * yDiffSign > 0) thisPt.labelExtraY = newExtraY;\n\n // make sure this label doesn't overlap any slices\n if(!Array.isArray(trace.pull)) return; // this can only happen with array pulls\n\n for(i = 0; i < wholeSide.length; i++) {\n otherPt = wholeSide[i];\n\n // overlap can only happen if the other point is pulled more than this one\n if(otherPt === thisPt || ((trace.pull[thisPt.i] || 0) >= trace.pull[otherPt.i] || 0)) continue;\n\n if((thisPt.pxmid[1] - otherPt.pxmid[1]) * yDiffSign > 0) {\n // closer to the equator - by construction all of these happen first\n // move the text vertically to get away from these slices\n otherOuterY = otherPt.cyFinal + farthestY(otherPt.px0[1], otherPt.px1[1]);\n newExtraY = otherOuterY - thisInnerY - thisPt.labelExtraY;\n\n if(newExtraY * yDiffSign > 0) thisPt.labelExtraY += newExtraY;\n\n } else if((thisOuterY + thisPt.labelExtraY - thisSliceOuterY) * yDiffSign > 0) {\n // farther from the equator - happens after we've done all the\n // vertical moving we're going to do\n // move horizontally to get away from these more polar slices\n\n // if we're moving horz. based on a slice that's several slices away from this one\n // then we need some extra space for the lines to labels between them\n xBuffer = 3 * xDiffSign * Math.abs(i - wholeSide.indexOf(thisPt));\n\n otherOuterX = otherPt.cxFinal + farthestX(otherPt.px0[0], otherPt.px1[0]);\n newExtraX = otherOuterX + xBuffer - (thisPt.cxFinal + thisPt.pxmid[0]) - thisPt.labelExtraX;\n\n if(newExtraX * xDiffSign > 0) thisPt.labelExtraX += newExtraX;\n }\n }\n }\n\n for(yHalf = 0; yHalf < 2; yHalf++) {\n equatorFirst = yHalf ? topFirst : bottomFirst;\n farthestY = yHalf ? Math.max : Math.min;\n yDiffSign = yHalf ? 1 : -1;\n\n for(xHalf = 0; xHalf < 2; xHalf++) {\n farthestX = xHalf ? Math.max : Math.min;\n xDiffSign = xHalf ? 1 : -1;\n\n // first sort the array\n // note this is a copy of cd, so cd itself doesn't get sorted\n // but we can still modify points in place.\n thisQuad = quadrants[yHalf][xHalf];\n thisQuad.sort(equatorFirst);\n\n oppositeQuad = quadrants[1 - yHalf][xHalf];\n wholeSide = oppositeQuad.concat(thisQuad);\n\n thisQuadOutside = [];\n for(i = 0; i < thisQuad.length; i++) {\n if(thisQuad[i].yLabelMid !== undefined) thisQuadOutside.push(thisQuad[i]);\n }\n\n firstOppositeOutsidePt = false;\n for(i = 0; yHalf && i < oppositeQuad.length; i++) {\n if(oppositeQuad[i].yLabelMid !== undefined) {\n firstOppositeOutsidePt = oppositeQuad[i];\n break;\n }\n }\n\n // each needs to avoid the previous\n for(i = 0; i < thisQuadOutside.length; i++) {\n var prevPt = i && thisQuadOutside[i - 1];\n // bottom half needs to avoid the first label of the top half\n // top half we still need to call scootOneLabel on the first slice\n // so we can avoid other slices, but we don't pass a prevPt\n if(firstOppositeOutsidePt && !i) prevPt = firstOppositeOutsidePt;\n scootOneLabel(thisQuadOutside[i], prevPt);\n }\n }\n }\n}\n\nfunction scalePies(cdpie, plotSize) {\n var pieBoxWidth,\n pieBoxHeight,\n i,\n j,\n cd0,\n trace,\n tiltAxisRads,\n maxPull,\n scaleGroups = [],\n scaleGroup,\n minPxPerValUnit;\n\n // first figure out the center and maximum radius for each pie\n for(i = 0; i < cdpie.length; i++) {\n cd0 = cdpie[i][0];\n trace = cd0.trace;\n pieBoxWidth = plotSize.w * (trace.domain.x[1] - trace.domain.x[0]);\n pieBoxHeight = plotSize.h * (trace.domain.y[1] - trace.domain.y[0]);\n tiltAxisRads = trace.tiltaxis * Math.PI / 180;\n\n maxPull = trace.pull;\n if(Array.isArray(maxPull)) {\n maxPull = 0;\n for(j = 0; j < trace.pull.length; j++) {\n if(trace.pull[j] > maxPull) maxPull = trace.pull[j];\n }\n }\n\n cd0.r = Math.min(\n pieBoxWidth / maxExtent(trace.tilt, Math.sin(tiltAxisRads), trace.depth),\n pieBoxHeight / maxExtent(trace.tilt, Math.cos(tiltAxisRads), trace.depth)\n ) / (2 + 2 * maxPull);\n\n cd0.cx = plotSize.l + plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;\n cd0.cy = plotSize.t + plotSize.h * (2 - trace.domain.y[1] - trace.domain.y[0]) / 2;\n\n if(trace.scalegroup && scaleGroups.indexOf(trace.scalegroup) === -1) {\n scaleGroups.push(trace.scalegroup);\n }\n }\n\n // Then scale any pies that are grouped\n for(j = 0; j < scaleGroups.length; j++) {\n minPxPerValUnit = Infinity;\n scaleGroup = scaleGroups[j];\n\n for(i = 0; i < cdpie.length; i++) {\n cd0 = cdpie[i][0];\n if(cd0.trace.scalegroup === scaleGroup) {\n minPxPerValUnit = Math.min(minPxPerValUnit,\n cd0.r * cd0.r / cd0.vTotal);\n }\n }\n\n for(i = 0; i < cdpie.length; i++) {\n cd0 = cdpie[i][0];\n if(cd0.trace.scalegroup === scaleGroup) {\n cd0.r = Math.sqrt(minPxPerValUnit * cd0.vTotal);\n }\n }\n }\n\n}\n\nfunction setCoords(cd) {\n var cd0 = cd[0],\n trace = cd0.trace,\n tilt = trace.tilt,\n tiltAxisRads,\n tiltAxisSin,\n tiltAxisCos,\n tiltRads,\n crossTilt,\n inPlane,\n currentAngle = trace.rotation * Math.PI / 180,\n angleFactor = 2 * Math.PI / cd0.vTotal,\n firstPt = 'px0',\n lastPt = 'px1',\n i,\n cdi,\n currentCoords;\n\n if(trace.direction === 'counterclockwise') {\n for(i = 0; i < cd.length; i++) {\n if(!cd[i].hidden) break; // find the first non-hidden slice\n }\n if(i === cd.length) return; // all slices hidden\n\n currentAngle += angleFactor * cd[i].v;\n angleFactor *= -1;\n firstPt = 'px1';\n lastPt = 'px0';\n }\n\n if(tilt) {\n tiltRads = tilt * Math.PI / 180;\n tiltAxisRads = trace.tiltaxis * Math.PI / 180;\n crossTilt = Math.sin(tiltAxisRads) * Math.cos(tiltAxisRads);\n inPlane = 1 - Math.cos(tiltRads);\n tiltAxisSin = Math.sin(tiltAxisRads);\n tiltAxisCos = Math.cos(tiltAxisRads);\n }\n\n function getCoords(angle) {\n var xFlat = cd0.r * Math.sin(angle),\n yFlat = -cd0.r * Math.cos(angle);\n\n if(!tilt) return [xFlat, yFlat];\n\n return [\n xFlat * (1 - inPlane * tiltAxisSin * tiltAxisSin) + yFlat * crossTilt * inPlane,\n xFlat * crossTilt * inPlane + yFlat * (1 - inPlane * tiltAxisCos * tiltAxisCos),\n Math.sin(tiltRads) * (yFlat * tiltAxisCos - xFlat * tiltAxisSin)\n ];\n }\n\n currentCoords = getCoords(currentAngle);\n\n for(i = 0; i < cd.length; i++) {\n cdi = cd[i];\n if(cdi.hidden) continue;\n\n cdi[firstPt] = currentCoords;\n\n currentAngle += angleFactor * cdi.v / 2;\n cdi.pxmid = getCoords(currentAngle);\n cdi.midangle = currentAngle;\n\n currentAngle += angleFactor * cdi.v / 2;\n currentCoords = getCoords(currentAngle);\n\n cdi[lastPt] = currentCoords;\n\n cdi.largeArc = (cdi.v > cd0.vTotal / 2) ? 1 : 0;\n }\n}\n\nfunction maxExtent(tilt, tiltAxisFraction, depth) {\n if(!tilt) return 1;\n var sinTilt = Math.sin(tilt * Math.PI / 180);\n return Math.max(0.01, // don't let it go crazy if you tilt the pie totally on its side\n depth * sinTilt * Math.abs(tiltAxisFraction) +\n 2 * Math.sqrt(1 - sinTilt * sinTilt * tiltAxisFraction * tiltAxisFraction));\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/plot.js\n// module id = 517\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = require('d3');\n\nvar styleOne = require('./style_one');\n\nmodule.exports = function style(gd) {\n gd._fullLayout._pielayer.selectAll('.trace').each(function(cd) {\n var cd0 = cd[0],\n trace = cd0.trace,\n traceSelection = d3.select(this);\n\n traceSelection.style({opacity: trace.opacity});\n\n traceSelection.selectAll('.top path.surface').each(function(pt) {\n d3.select(this).call(styleOne, pt, trace);\n });\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/style.js\n// module id = 518\n// module chunks = 0","/**\n* Copyright 2012-2017, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = require('../../registry');\n\n\nexports.name = 'pie';\n\nexports.plot = function(gd) {\n var Pie = Registry.getModule('pie');\n var cdPie = getCdModule(gd.calcdata, Pie);\n\n if(cdPie.length) Pie.plot(gd, cdPie);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var hadPie = (oldFullLayout._has && oldFullLayout._has('pie'));\n var hasPie = (newFullLayout._has && newFullLayout._has('pie'));\n\n if(hadPie && !hasPie) {\n oldFullLayout._pielayer.selectAll('g.trace').remove();\n }\n};\n\nfunction getCdModule(calcdata, _module) {\n var cdModule = [];\n\n for(var i = 0; i < calcdata.length; i++) {\n var cd = calcdata[i];\n var trace = cd[0].trace;\n\n if((trace._module === _module) && (trace.visible === true)) {\n cdModule.push(cd);\n }\n }\n\n return cdModule;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/plotly.js/src/traces/pie/base_plot.js\n// module id = 519\n// module chunks = 0"],"sourceRoot":""}