{"version":3,"sources":["/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/core/menus.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/abstract_button.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/abstract_icon.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/abstract_slider.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/autocomplete_input.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/button.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/checkbox_button_group.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/checkbox_group.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/date_picker.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/date_range_slider.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/date_slider.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/div.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/dropdown.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/index.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/input_widget.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/main.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/markup.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/multiselect.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/panel.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/paragraph.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/password_input.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/pretext.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/radio_button_group.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/radio_group.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/range_slider.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/selectbox.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/slider.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/tabs.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/text_input.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/toggle.js","/home/travis/build/bokeh/bokeh/bokehjs/build/js/tree/models/widgets/widget.js","/home/travis/build/bokeh/bokeh/bokehjs/node_modules/nouislider/distribute/nouislider.js","/home/travis/build/bokeh/bokeh/bokehjs/node_modules/pikaday/pikaday.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACrvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"generated.js","sourceRoot":"","sourcesContent":["/* core/menus */ function _(require, module, exports) {\n var signaling_1 = require(19) /* ./signaling */;\n exports.clear_menus = new signaling_1.Signal0({}, \"clear_menus\");\n document.addEventListener(\"click\", function () { return exports.clear_menus.emit(); });\n}\n","/* models/widgets/abstract_button */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var p = require(15) /* core/properties */;\n var dom_1 = require(5) /* core/dom */;\n var build_views_1 = require(4) /* core/build_views */;\n var widget_1 = require(440) /* ./widget */;\n var AbstractButtonView = /** @class */ (function (_super) {\n tslib_1.__extends(AbstractButtonView, _super);\n function AbstractButtonView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AbstractButtonView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.icon_views = {};\n this.render();\n };\n AbstractButtonView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n AbstractButtonView.prototype.remove = function () {\n build_views_1.remove_views(this.icon_views);\n _super.prototype.remove.call(this);\n };\n AbstractButtonView.prototype._render_button = function () {\n var children = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n children[_i] = arguments[_i];\n }\n return dom_1.button.apply(void 0, [{\n type: \"button\",\n disabled: this.model.disabled,\n class: [\"bk-bs-btn\", \"bk-bs-btn-\" + this.model.button_type],\n }].concat(children));\n };\n AbstractButtonView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n this.buttonEl = this._render_button(this.model.label);\n this.buttonEl.addEventListener(\"click\", function (event) { return _this._button_click(event); });\n this.el.appendChild(this.buttonEl);\n var icon = this.model.icon;\n if (icon != null) {\n build_views_1.build_views(this.icon_views, [icon], { parent: this });\n dom_1.prepend(this.buttonEl, this.icon_views[icon.id].el, dom_1.nbsp);\n }\n };\n AbstractButtonView.prototype._button_click = function (event) {\n event.preventDefault();\n this.change_input();\n };\n AbstractButtonView.prototype.change_input = function () {\n if (this.model.callback != null)\n this.model.callback.execute(this.model);\n };\n return AbstractButtonView;\n }(widget_1.WidgetView));\n exports.AbstractButtonView = AbstractButtonView;\n var AbstractButton = /** @class */ (function (_super) {\n tslib_1.__extends(AbstractButton, _super);\n function AbstractButton(attrs) {\n return _super.call(this, attrs) || this;\n }\n AbstractButton.initClass = function () {\n this.prototype.type = \"AbstractButton\";\n this.define({\n label: [p.String, \"Button\"],\n icon: [p.Instance],\n button_type: [p.String, \"default\"],\n callback: [p.Instance],\n });\n };\n return AbstractButton;\n }(widget_1.Widget));\n exports.AbstractButton = AbstractButton;\n AbstractButton.initClass();\n}\n","/* models/widgets/abstract_icon */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var widget_1 = require(440) /* ./widget */;\n var AbstractIconView = /** @class */ (function (_super) {\n tslib_1.__extends(AbstractIconView, _super);\n function AbstractIconView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return AbstractIconView;\n }(widget_1.WidgetView));\n exports.AbstractIconView = AbstractIconView;\n var AbstractIcon = /** @class */ (function (_super) {\n tslib_1.__extends(AbstractIcon, _super);\n function AbstractIcon(attrs) {\n return _super.call(this, attrs) || this;\n }\n AbstractIcon.initClass = function () {\n this.prototype.type = \"AbstractIcon\";\n };\n return AbstractIcon;\n }(widget_1.Widget));\n exports.AbstractIcon = AbstractIcon;\n AbstractIcon.initClass();\n}\n","/* models/widgets/abstract_slider */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var noUiSlider = require(431) /* nouislider */;\n var p = require(15) /* core/properties */;\n var dom_1 = require(5) /* core/dom */;\n var logging_1 = require(14) /* core/logging */;\n var array_1 = require(21) /* core/util/array */;\n var callback_1 = require(25) /* core/util/callback */;\n var widget_1 = require(440) /* ./widget */;\n var AbstractSliderView = /** @class */ (function (_super) {\n tslib_1.__extends(AbstractSliderView, _super);\n function AbstractSliderView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AbstractSliderView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n AbstractSliderView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n AbstractSliderView.prototype.render = function () {\n var _this = this;\n if (this.sliderEl == null) {\n // XXX: temporary workaround for _render_css()\n _super.prototype.render.call(this);\n }\n if (this.model.callback != null) {\n var callback = function () { return _this.model.callback.execute(_this.model); };\n switch (this.model.callback_policy) {\n case 'continuous': {\n this.callback_wrapper = callback;\n break;\n }\n case 'throttle': {\n this.callback_wrapper = callback_1.throttle(callback, this.model.callback_throttle);\n break;\n }\n }\n }\n var prefix = 'bk-noUi-';\n var _a = this._calc_to(), start = _a.start, end = _a.end, value = _a.value, step = _a.step;\n var tooltips; // XXX\n if (this.model.tooltips) {\n var formatter = {\n to: function (value) { return _this.model.pretty(value); },\n };\n tooltips = array_1.repeat(formatter, value.length);\n }\n else\n tooltips = false;\n this.el.classList.add(\"bk-slider\");\n if (this.sliderEl == null) {\n this.sliderEl = dom_1.div();\n this.el.appendChild(this.sliderEl);\n noUiSlider.create(this.sliderEl, {\n cssPrefix: prefix,\n range: { min: start, max: end },\n start: value,\n step: step,\n behaviour: this.model.behaviour,\n connect: this.model.connected,\n tooltips: tooltips,\n orientation: this.model.orientation,\n direction: this.model.direction,\n }); // XXX: bad typings; no cssPrefix\n this.sliderEl.noUiSlider.on('slide', function (_, __, values) { return _this._slide(values); });\n this.sliderEl.noUiSlider.on('change', function (_, __, values) { return _this._change(values); });\n // Add keyboard support\n var keypress = function (e) {\n var current = _this._calc_to();\n var value = current.value[0];\n switch (e.which) {\n case 37: {\n value = Math.max(value - step, start);\n break;\n }\n case 39: {\n value = Math.min(value + step, end);\n break;\n }\n default:\n return;\n }\n var pretty = _this.model.pretty(value);\n logging_1.logger.debug(\"[slider keypress] value = \" + pretty);\n _this.model.value = value;\n _this.sliderEl.noUiSlider.set(value);\n if (_this.valueEl != null)\n _this.valueEl.textContent = pretty;\n if (_this.callback_wrapper != null)\n _this.callback_wrapper();\n };\n var handle = this.sliderEl.querySelector(\".\" + prefix + \"handle\");\n handle.setAttribute('tabindex', '0');\n handle.addEventListener('keydown', keypress);\n var toggleTooltip_1 = function (i, show) {\n var handle = _this.sliderEl.querySelectorAll(\".\" + prefix + \"handle\")[i];\n var tooltip = handle.querySelector(\".\" + prefix + \"tooltip\");\n tooltip.style.display = show ? 'block' : '';\n };\n this.sliderEl.noUiSlider.on('start', function (_, i) { return toggleTooltip_1(i, true); });\n this.sliderEl.noUiSlider.on('end', function (_, i) { return toggleTooltip_1(i, false); });\n }\n else {\n this.sliderEl.noUiSlider.updateOptions({\n range: { min: start, max: end },\n start: value,\n step: step,\n });\n }\n if (this.titleEl != null)\n this.el.removeChild(this.titleEl);\n if (this.valueEl != null)\n this.el.removeChild(this.valueEl);\n if (this.model.title != null) {\n if (this.model.title.length != 0) {\n this.titleEl = dom_1.label({}, this.model.title + \":\");\n this.el.insertBefore(this.titleEl, this.sliderEl);\n }\n if (this.model.show_value) {\n var pretty = value.map(function (v) { return _this.model.pretty(v); }).join(\" .. \");\n this.valueEl = dom_1.div({ class: \"bk-slider-value\" }, pretty);\n this.el.insertBefore(this.valueEl, this.sliderEl);\n }\n }\n if (!this.model.disabled) {\n this.sliderEl.querySelector(\".\" + prefix + \"connect\")\n .style\n .backgroundColor = this.model.bar_color;\n }\n if (this.model.disabled)\n this.sliderEl.setAttribute('disabled', 'true');\n else\n this.sliderEl.removeAttribute('disabled');\n };\n AbstractSliderView.prototype._slide = function (values) {\n var _this = this;\n var value = this._calc_from(values);\n var pretty = values.map(function (v) { return _this.model.pretty(v); }).join(\" .. \");\n logging_1.logger.debug(\"[slider slide] value = \" + pretty);\n if (this.valueEl != null)\n this.valueEl.textContent = pretty;\n this.model.value = value;\n if (this.callback_wrapper != null)\n this.callback_wrapper();\n };\n AbstractSliderView.prototype._change = function (values) {\n var _this = this;\n var value = this._calc_from(values);\n var pretty = values.map(function (v) { return _this.model.pretty(v); }).join(\" .. \");\n logging_1.logger.debug(\"[slider change] value = \" + pretty);\n if (this.valueEl != null)\n this.valueEl.dataset.value = pretty;\n this.model.value = value;\n switch (this.model.callback_policy) {\n case 'mouseup':\n case 'throttle': {\n if (this.model.callback != null)\n this.model.callback.execute(this.model);\n break;\n }\n }\n };\n return AbstractSliderView;\n }(widget_1.WidgetView));\n exports.AbstractSliderView = AbstractSliderView;\n var AbstractSlider = /** @class */ (function (_super) {\n tslib_1.__extends(AbstractSlider, _super);\n function AbstractSlider(attrs) {\n var _this = _super.call(this, attrs) || this;\n _this.connected = false;\n return _this;\n }\n AbstractSlider.initClass = function () {\n this.prototype.type = \"AbstractSlider\";\n this.define({\n title: [p.String, \"\"],\n show_value: [p.Bool, true],\n start: [p.Any],\n end: [p.Any],\n value: [p.Any],\n step: [p.Number, 1],\n format: [p.String],\n orientation: [p.Orientation, \"horizontal\"],\n direction: [p.Any, \"ltr\"],\n tooltips: [p.Boolean, true],\n callback: [p.Instance],\n callback_throttle: [p.Number, 200],\n callback_policy: [p.String, \"throttle\"],\n bar_color: [p.Color, \"#e6e6e6\"],\n });\n };\n AbstractSlider.prototype._formatter = function (value, _format) {\n return \"\" + value;\n };\n AbstractSlider.prototype.pretty = function (value) {\n return this._formatter(value, this.format);\n };\n return AbstractSlider;\n }(widget_1.Widget));\n exports.AbstractSlider = AbstractSlider;\n AbstractSlider.initClass();\n}\n","/* models/widgets/autocomplete_input */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var text_input_1 = require(428) /* ./text_input */;\n var dom_1 = require(5) /* core/dom */;\n var menus_1 = require(400) /* core/menus */;\n var p = require(15) /* core/properties */;\n var AutocompleteInputView = /** @class */ (function (_super) {\n tslib_1.__extends(AutocompleteInputView, _super);\n function AutocompleteInputView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AutocompleteInputView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n menus_1.clear_menus.connect(function () { return _this._clear_menu(); });\n };\n AutocompleteInputView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n this.inputEl.classList.add(\"bk-autocomplete-input\");\n this.inputEl.addEventListener(\"keydown\", function (event) { return _this._keydown(event); });\n this.inputEl.addEventListener(\"keyup\", function (event) { return _this._keyup(event); });\n this.menuEl = dom_1.ul({ class: \"bk-bs-dropdown-menu\" });\n this.menuEl.addEventListener(\"click\", function (event) { return _this._item_click(event); });\n this.el.appendChild(this.menuEl);\n };\n AutocompleteInputView.prototype._render_items = function (completions) {\n dom_1.empty(this.menuEl);\n for (var _i = 0, completions_1 = completions; _i < completions_1.length; _i++) {\n var text = completions_1[_i];\n var itemEl = dom_1.li({}, dom_1.a({ data: { text: text } }, text));\n this.menuEl.appendChild(itemEl);\n }\n };\n AutocompleteInputView.prototype._open_menu = function () {\n this.el.classList.add(\"bk-bs-open\");\n };\n AutocompleteInputView.prototype._clear_menu = function () {\n this.el.classList.remove(\"bk-bs-open\");\n };\n AutocompleteInputView.prototype._item_click = function (event) {\n event.preventDefault();\n if (event.target != event.currentTarget) {\n var el = event.target;\n var text = el.dataset.text;\n this.model.value = text;\n //this.inputEl.value = text\n }\n };\n AutocompleteInputView.prototype._keydown = function (_event) { };\n AutocompleteInputView.prototype._keyup = function (event) {\n switch (event.keyCode) {\n case dom_1.Keys.Enter: {\n console.log(\"enter\");\n break;\n }\n case dom_1.Keys.Esc: {\n this._clear_menu();\n break;\n }\n case dom_1.Keys.Up:\n case dom_1.Keys.Down: {\n console.log(\"up/down\");\n break;\n }\n default: {\n var value = this.inputEl.value;\n if (value.length <= 1) {\n this._clear_menu();\n return;\n }\n var completions = [];\n for (var _i = 0, _a = this.model.completions; _i < _a.length; _i++) {\n var text = _a[_i];\n if (text.indexOf(value) != -1)\n completions.push(text);\n }\n if (completions.length == 0)\n this._clear_menu();\n else {\n this._render_items(completions);\n this._open_menu();\n }\n }\n }\n };\n return AutocompleteInputView;\n }(text_input_1.TextInputView));\n exports.AutocompleteInputView = AutocompleteInputView;\n var AutocompleteInput = /** @class */ (function (_super) {\n tslib_1.__extends(AutocompleteInput, _super);\n function AutocompleteInput(attrs) {\n return _super.call(this, attrs) || this;\n }\n AutocompleteInput.initClass = function () {\n this.prototype.type = \"AutocompleteInput\";\n this.prototype.default_view = AutocompleteInputView;\n this.define({\n completions: [p.Array, []],\n });\n this.internal({\n active: [p.Boolean, true],\n });\n };\n return AutocompleteInput;\n }(text_input_1.TextInput));\n exports.AutocompleteInput = AutocompleteInput;\n AutocompleteInput.initClass();\n}\n","/* models/widgets/button */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var p = require(15) /* core/properties */;\n var bokeh_events_1 = require(3) /* core/bokeh_events */;\n var abstract_button_1 = require(401) /* ./abstract_button */;\n var ButtonView = /** @class */ (function (_super) {\n tslib_1.__extends(ButtonView, _super);\n function ButtonView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ButtonView.prototype.change_input = function () {\n this.model.trigger_event(new bokeh_events_1.ButtonClick({}));\n this.model.clicks = this.model.clicks + 1;\n _super.prototype.change_input.call(this);\n };\n return ButtonView;\n }(abstract_button_1.AbstractButtonView));\n exports.ButtonView = ButtonView;\n var Button = /** @class */ (function (_super) {\n tslib_1.__extends(Button, _super);\n function Button(attrs) {\n return _super.call(this, attrs) || this;\n }\n Button.initClass = function () {\n this.prototype.type = \"Button\";\n this.prototype.default_view = ButtonView;\n this.define({\n clicks: [p.Number, 0],\n });\n bokeh_events_1.register_with_event(bokeh_events_1.ButtonClick, this);\n };\n return Button;\n }(abstract_button_1.AbstractButton));\n exports.Button = Button;\n Button.initClass();\n}\n","/* models/widgets/checkbox_button_group */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var dom_1 = require(5) /* core/dom */;\n var p = require(15) /* core/properties */;\n var array_1 = require(21) /* core/util/array */;\n var widget_1 = require(440) /* ./widget */;\n var CheckboxButtonGroupView = /** @class */ (function (_super) {\n tslib_1.__extends(CheckboxButtonGroupView, _super);\n function CheckboxButtonGroupView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CheckboxButtonGroupView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n CheckboxButtonGroupView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n CheckboxButtonGroupView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var divEl = dom_1.div({ class: \"bk-bs-btn-group\" });\n this.el.appendChild(divEl);\n var active = this.model.active;\n var labels = this.model.labels;\n var _loop_1 = function (i) {\n var inputEl = dom_1.input({ type: \"checkbox\", value: \"\" + i, checked: i in active });\n inputEl.addEventListener(\"change\", function () { return _this.model.change_input(i); });\n var labelEl = dom_1.label({ class: [\"bk-bs-btn\", \"bk-bs-btn-\" + this_1.model.button_type] }, inputEl, labels[i]);\n if (array_1.includes(active, i))\n labelEl.classList.add(\"bk-bs-active\");\n divEl.appendChild(labelEl);\n };\n var this_1 = this;\n for (var i = 0; i < labels.length; i++) {\n _loop_1(i);\n }\n };\n return CheckboxButtonGroupView;\n }(widget_1.WidgetView));\n exports.CheckboxButtonGroupView = CheckboxButtonGroupView;\n var CheckboxButtonGroup = /** @class */ (function (_super) {\n tslib_1.__extends(CheckboxButtonGroup, _super);\n function CheckboxButtonGroup(attrs) {\n return _super.call(this, attrs) || this;\n }\n CheckboxButtonGroup.prototype.change_input = function (i) {\n var active = array_1.copy(this.active);\n if (array_1.includes(active, i))\n array_1.removeBy(active, function (j) { return i == j; });\n else\n active.push(i);\n active.sort();\n this.active = active;\n if (this.callback != null)\n this.callback.execute(this);\n };\n CheckboxButtonGroup.initClass = function () {\n this.prototype.type = \"CheckboxButtonGroup\";\n this.prototype.default_view = CheckboxButtonGroupView;\n this.define({\n active: [p.Array, []],\n labels: [p.Array, []],\n button_type: [p.String, \"default\"],\n callback: [p.Instance],\n });\n };\n return CheckboxButtonGroup;\n }(widget_1.Widget));\n exports.CheckboxButtonGroup = CheckboxButtonGroup;\n CheckboxButtonGroup.initClass();\n}\n","/* models/widgets/checkbox_group */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var dom_1 = require(5) /* core/dom */;\n var p = require(15) /* core/properties */;\n var array_1 = require(21) /* core/util/array */;\n var widget_1 = require(440) /* ./widget */;\n var CheckboxGroupView = /** @class */ (function (_super) {\n tslib_1.__extends(CheckboxGroupView, _super);\n function CheckboxGroupView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CheckboxGroupView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n CheckboxGroupView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n CheckboxGroupView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var active = this.model.active;\n var labels = this.model.labels;\n for (var i = 0; i < labels.length; i++) {\n var text = labels[i];\n var inputEl = dom_1.input({ type: \"checkbox\", value: \"\" + i });\n inputEl.addEventListener(\"change\", function () { return _this.change_input(); });\n if (this.model.disabled)\n inputEl.disabled = true;\n if (array_1.includes(active, i))\n inputEl.checked = true;\n var labelEl = dom_1.label({}, inputEl, text);\n if (this.model.inline) {\n labelEl.classList.add(\"bk-bs-checkbox-inline\");\n this.el.appendChild(labelEl);\n }\n else {\n var divEl = dom_1.div({ class: \"bk-bs-checkbox\" }, labelEl);\n this.el.appendChild(divEl);\n }\n }\n };\n CheckboxGroupView.prototype.change_input = function () {\n var checkboxes = this.el.querySelectorAll(\"input\");\n var active = [];\n for (var i = 0; i < checkboxes.length; i++) {\n var checkbox = checkboxes[i];\n if (checkbox.checked)\n active.push(i);\n }\n this.model.active = active;\n if (this.model.callback != null)\n this.model.callback.execute(this.model);\n };\n return CheckboxGroupView;\n }(widget_1.WidgetView));\n exports.CheckboxGroupView = CheckboxGroupView;\n var CheckboxGroup = /** @class */ (function (_super) {\n tslib_1.__extends(CheckboxGroup, _super);\n function CheckboxGroup(attrs) {\n return _super.call(this, attrs) || this;\n }\n CheckboxGroup.initClass = function () {\n this.prototype.type = \"CheckboxGroup\";\n this.prototype.default_view = CheckboxGroupView;\n this.define({\n active: [p.Array, []],\n labels: [p.Array, []],\n inline: [p.Bool, false],\n callback: [p.Instance],\n });\n };\n return CheckboxGroup;\n }(widget_1.Widget));\n exports.CheckboxGroup = CheckboxGroup;\n CheckboxGroup.initClass();\n}\n","/* models/widgets/date_picker */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var input_widget_1 = require(414) /* ./input_widget */;\n var dom_1 = require(5) /* core/dom */;\n var p = require(15) /* core/properties */;\n var Pikaday = require(432) /* pikaday */;\n Pikaday.prototype.adjustPosition = function () {\n if (this._o.container)\n return;\n this.el.style.position = 'absolute';\n var field = this._o.trigger;\n var width = this.el.offsetWidth;\n var height = this.el.offsetHeight;\n var viewportWidth = window.innerWidth || document.documentElement.clientWidth;\n var viewportHeight = window.innerHeight || document.documentElement.clientHeight;\n var scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;\n var clientRect = field.getBoundingClientRect();\n var left = clientRect.left + window.pageXOffset;\n var top = clientRect.bottom + window.pageYOffset;\n // adjust left/top origin to bk-root\n left -= this.el.parentElement.offsetLeft;\n top -= this.el.parentElement.offsetTop;\n // default position is bottom & left\n if ((this._o.reposition && left + width > viewportWidth) ||\n (this._o.position.indexOf('right') > -1 && left - width + field.offsetWidth > 0))\n left = left - width + field.offsetWidth;\n if ((this._o.reposition && top + height > viewportHeight + scrollTop) ||\n (this._o.position.indexOf('top') > -1 && top - height - field.offsetHeight > 0))\n top = top - height - field.offsetHeight;\n this.el.style.left = left + 'px';\n this.el.style.top = top + 'px';\n };\n var DatePickerView = /** @class */ (function (_super) {\n tslib_1.__extends(DatePickerView, _super);\n function DatePickerView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DatePickerView.prototype.css_classes = function () {\n return _super.prototype.css_classes.call(this).concat(\"bk-widget-form-group\");\n };\n DatePickerView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n if (this._picker != null)\n this._picker.destroy();\n dom_1.empty(this.el);\n this.labelEl = dom_1.label({}, this.model.title);\n this.el.appendChild(this.labelEl);\n this.inputEl = dom_1.input({ type: \"text\", class: \"bk-widget-form-input\", disabled: this.model.disabled });\n this.el.appendChild(this.inputEl);\n this._picker = new Pikaday({\n field: this.inputEl,\n defaultDate: new Date(this.model.value),\n setDefaultDate: true,\n minDate: this.model.min_date != null ? new Date(this.model.min_date) : undefined,\n maxDate: this.model.max_date != null ? new Date(this.model.max_date) : undefined,\n onSelect: function (date) { return _this._on_select(date); },\n });\n // move date picker's element from body to bk-root\n this._root_element.appendChild(this._picker.el);\n };\n DatePickerView.prototype._on_select = function (date) {\n // Always use toDateString()!\n // toString() breaks the websocket #4965.\n // toISOString() returns the wrong day (IE on day earlier) #7048\n // XXX: this should be handled by the serializer\n this.model.value = date.toDateString();\n this.change_input();\n };\n return DatePickerView;\n }(input_widget_1.InputWidgetView));\n exports.DatePickerView = DatePickerView;\n var DatePicker = /** @class */ (function (_super) {\n tslib_1.__extends(DatePicker, _super);\n function DatePicker(attrs) {\n return _super.call(this, attrs) || this;\n }\n DatePicker.initClass = function () {\n this.prototype.type = \"DatePicker\";\n this.prototype.default_view = DatePickerView;\n this.define({\n // TODO (bev) types\n value: [p.Any, new Date().toDateString()],\n min_date: [p.Any],\n max_date: [p.Any],\n });\n };\n return DatePicker;\n }(input_widget_1.InputWidget));\n exports.DatePicker = DatePicker;\n DatePicker.initClass();\n}\n","/* models/widgets/date_range_slider */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var tz = require(390) /* timezone */;\n var abstract_slider_1 = require(403) /* ./abstract_slider */;\n var DateRangeSliderView = /** @class */ (function (_super) {\n tslib_1.__extends(DateRangeSliderView, _super);\n function DateRangeSliderView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DateRangeSliderView.prototype._calc_to = function () {\n return {\n start: this.model.start,\n end: this.model.end,\n value: this.model.value,\n step: this.model.step,\n };\n };\n DateRangeSliderView.prototype._calc_from = function (values) {\n return values;\n };\n return DateRangeSliderView;\n }(abstract_slider_1.AbstractSliderView));\n exports.DateRangeSliderView = DateRangeSliderView;\n var DateRangeSlider = /** @class */ (function (_super) {\n tslib_1.__extends(DateRangeSlider, _super);\n function DateRangeSlider(attrs) {\n var _this = _super.call(this, attrs) || this;\n _this.behaviour = \"drag\";\n _this.connected = [false, true, false];\n return _this;\n }\n DateRangeSlider.initClass = function () {\n this.prototype.type = \"DateRangeSlider\";\n this.prototype.default_view = DateRangeSliderView;\n this.override({\n format: \"%d %b %Y\",\n });\n };\n DateRangeSlider.prototype._formatter = function (value, format) {\n return tz(value, format);\n };\n return DateRangeSlider;\n }(abstract_slider_1.AbstractSlider));\n exports.DateRangeSlider = DateRangeSlider;\n DateRangeSlider.initClass();\n}\n","/* models/widgets/date_slider */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var tz = require(390) /* timezone */;\n var abstract_slider_1 = require(403) /* ./abstract_slider */;\n var DateSliderView = /** @class */ (function (_super) {\n tslib_1.__extends(DateSliderView, _super);\n function DateSliderView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DateSliderView.prototype._calc_to = function () {\n return {\n start: this.model.start,\n end: this.model.end,\n value: [this.model.value],\n step: this.model.step,\n };\n };\n DateSliderView.prototype._calc_from = function (_a) {\n var value = _a[0];\n return value;\n };\n return DateSliderView;\n }(abstract_slider_1.AbstractSliderView));\n exports.DateSliderView = DateSliderView;\n var DateSlider = /** @class */ (function (_super) {\n tslib_1.__extends(DateSlider, _super);\n function DateSlider(attrs) {\n var _this = _super.call(this, attrs) || this;\n _this.behaviour = \"tap\";\n _this.connected = [true, false];\n return _this;\n }\n DateSlider.initClass = function () {\n this.prototype.type = \"DateSlider\";\n this.prototype.default_view = DateSliderView;\n this.override({\n format: \"%d %b %Y\",\n });\n };\n DateSlider.prototype._formatter = function (value, format) {\n return tz(value, format);\n };\n return DateSlider;\n }(abstract_slider_1.AbstractSlider));\n exports.DateSlider = DateSlider;\n DateSlider.initClass();\n}\n","/* models/widgets/div */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var markup_1 = require(416) /* ./markup */;\n var dom_1 = require(5) /* core/dom */;\n var p = require(15) /* core/properties */;\n var DivView = /** @class */ (function (_super) {\n tslib_1.__extends(DivView, _super);\n function DivView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DivView.prototype.render = function () {\n _super.prototype.render.call(this);\n var content = dom_1.div();\n if (this.model.render_as_text)\n content.textContent = this.model.text;\n else\n content.innerHTML = this.model.text;\n this.markupEl.appendChild(content);\n };\n return DivView;\n }(markup_1.MarkupView));\n exports.DivView = DivView;\n var Div = /** @class */ (function (_super) {\n tslib_1.__extends(Div, _super);\n function Div(attrs) {\n return _super.call(this, attrs) || this;\n }\n Div.initClass = function () {\n this.prototype.type = \"Div\";\n this.prototype.default_view = DivView;\n this.define({\n render_as_text: [p.Bool, false],\n });\n };\n return Div;\n }(markup_1.Markup));\n exports.Div = Div;\n Div.initClass();\n}\n","/* models/widgets/dropdown */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var dom_1 = require(5) /* core/dom */;\n var menus_1 = require(400) /* core/menus */;\n var p = require(15) /* core/properties */;\n var abstract_button_1 = require(401) /* ./abstract_button */;\n var DropdownView = /** @class */ (function (_super) {\n tslib_1.__extends(DropdownView, _super);\n function DropdownView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DropdownView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n menus_1.clear_menus.connect(function () { return _this._clear_menu(); });\n };\n DropdownView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n if (!this.model.is_split_button) {\n this.el.classList.add(\"bk-bs-dropdown\");\n this.buttonEl.classList.add(\"bk-bs-dropdown-toggle\");\n this.buttonEl.appendChild(dom_1.span({ class: \"bk-bs-caret\" }));\n }\n else {\n this.el.classList.add(\"bk-bs-btn-group\");\n var caretEl = this._render_button(dom_1.span({ class: \"bk-bs-caret\" }));\n caretEl.classList.add(\"bk-bs-dropdown-toggle\");\n caretEl.addEventListener(\"click\", function (event) { return _this._caret_click(event); });\n this.el.appendChild(caretEl);\n }\n if (this.model.active)\n this.el.classList.add(\"bk-bs-open\");\n var items = [];\n for (var _i = 0, _a = this.model.menu; _i < _a.length; _i++) {\n var item = _a[_i];\n var itemEl = void 0;\n if (item != null) {\n var label = item[0], value = item[1];\n var link = dom_1.a({}, label);\n link.dataset.value = value;\n link.addEventListener(\"click\", function (event) { return _this._item_click(event); });\n itemEl = dom_1.li({}, link);\n }\n else\n itemEl = dom_1.li({ class: \"bk-bs-divider\" });\n items.push(itemEl);\n }\n var menuEl = dom_1.ul({ class: \"bk-bs-dropdown-menu\" }, items);\n this.el.appendChild(menuEl);\n };\n DropdownView.prototype._clear_menu = function () {\n this.model.active = false;\n };\n DropdownView.prototype._toggle_menu = function () {\n var active = this.model.active;\n menus_1.clear_menus.emit();\n if (!active)\n this.model.active = true;\n };\n DropdownView.prototype._button_click = function (event) {\n event.preventDefault();\n event.stopPropagation();\n if (!this.model.is_split_button)\n this._toggle_menu();\n else {\n this._clear_menu();\n this.set_value(this.model.default_value);\n }\n };\n DropdownView.prototype._caret_click = function (event) {\n event.preventDefault();\n event.stopPropagation();\n this._toggle_menu();\n };\n DropdownView.prototype._item_click = function (event) {\n event.preventDefault();\n this._clear_menu();\n this.set_value(event.currentTarget.dataset.value);\n };\n DropdownView.prototype.set_value = function (value) {\n this.buttonEl.value = this.model.value = value;\n this.change_input();\n };\n return DropdownView;\n }(abstract_button_1.AbstractButtonView));\n exports.DropdownView = DropdownView;\n var Dropdown = /** @class */ (function (_super) {\n tslib_1.__extends(Dropdown, _super);\n function Dropdown(attrs) {\n return _super.call(this, attrs) || this;\n }\n Dropdown.initClass = function () {\n this.prototype.type = \"Dropdown\";\n this.prototype.default_view = DropdownView;\n this.define({\n value: [p.String],\n default_value: [p.String],\n menu: [p.Array, []],\n });\n this.override({\n label: \"Dropdown\",\n });\n this.internal({\n active: [p.Boolean, false],\n });\n };\n Object.defineProperty(Dropdown.prototype, \"is_split_button\", {\n get: function () {\n return this.default_value != null;\n },\n enumerable: true,\n configurable: true\n });\n return Dropdown;\n }(abstract_button_1.AbstractButton));\n exports.Dropdown = Dropdown;\n Dropdown.initClass();\n}\n","/* models/widgets/index */ function _(require, module, exports) {\n var abstract_button_1 = require(401) /* ./abstract_button */;\n exports.AbstractButton = abstract_button_1.AbstractButton;\n var abstract_icon_1 = require(402) /* ./abstract_icon */;\n exports.AbstractIcon = abstract_icon_1.AbstractIcon;\n var autocomplete_input_1 = require(404) /* ./autocomplete_input */;\n exports.AutocompleteInput = autocomplete_input_1.AutocompleteInput;\n var button_1 = require(405) /* ./button */;\n exports.Button = button_1.Button;\n var checkbox_button_group_1 = require(406) /* ./checkbox_button_group */;\n exports.CheckboxButtonGroup = checkbox_button_group_1.CheckboxButtonGroup;\n var checkbox_group_1 = require(407) /* ./checkbox_group */;\n exports.CheckboxGroup = checkbox_group_1.CheckboxGroup;\n var date_picker_1 = require(408) /* ./date_picker */;\n exports.DatePicker = date_picker_1.DatePicker;\n var date_range_slider_1 = require(409) /* ./date_range_slider */;\n exports.DateRangeSlider = date_range_slider_1.DateRangeSlider;\n var date_slider_1 = require(410) /* ./date_slider */;\n exports.DateSlider = date_slider_1.DateSlider;\n var div_1 = require(411) /* ./div */;\n exports.Div = div_1.Div;\n var dropdown_1 = require(412) /* ./dropdown */;\n exports.Dropdown = dropdown_1.Dropdown;\n var input_widget_1 = require(414) /* ./input_widget */;\n exports.InputWidget = input_widget_1.InputWidget;\n var markup_1 = require(416) /* ./markup */;\n exports.Markup = markup_1.Markup;\n var multiselect_1 = require(417) /* ./multiselect */;\n exports.MultiSelect = multiselect_1.MultiSelect;\n var panel_1 = require(418) /* ./panel */;\n exports.Panel = panel_1.Panel;\n var paragraph_1 = require(419) /* ./paragraph */;\n exports.Paragraph = paragraph_1.Paragraph;\n var password_input_1 = require(420) /* ./password_input */;\n exports.PasswordInput = password_input_1.PasswordInput;\n var pretext_1 = require(421) /* ./pretext */;\n exports.PreText = pretext_1.PreText;\n var radio_button_group_1 = require(422) /* ./radio_button_group */;\n exports.RadioButtonGroup = radio_button_group_1.RadioButtonGroup;\n var radio_group_1 = require(423) /* ./radio_group */;\n exports.RadioGroup = radio_group_1.RadioGroup;\n var range_slider_1 = require(424) /* ./range_slider */;\n exports.RangeSlider = range_slider_1.RangeSlider;\n var selectbox_1 = require(425) /* ./selectbox */;\n exports.Select = selectbox_1.Select;\n var slider_1 = require(426) /* ./slider */;\n exports.Slider = slider_1.Slider;\n var tabs_1 = require(427) /* ./tabs */;\n exports.Tabs = tabs_1.Tabs;\n var text_input_1 = require(428) /* ./text_input */;\n exports.TextInput = text_input_1.TextInput;\n var toggle_1 = require(429) /* ./toggle */;\n exports.Toggle = toggle_1.Toggle;\n var widget_1 = require(440) /* ./widget */;\n exports.Widget = widget_1.Widget;\n}\n","/* models/widgets/input_widget */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var widget_1 = require(440) /* ./widget */;\n var p = require(15) /* core/properties */;\n var InputWidgetView = /** @class */ (function (_super) {\n tslib_1.__extends(InputWidgetView, _super);\n function InputWidgetView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InputWidgetView.prototype.change_input = function () {\n if (this.model.callback != null)\n this.model.callback.execute(this.model);\n };\n return InputWidgetView;\n }(widget_1.WidgetView));\n exports.InputWidgetView = InputWidgetView;\n var InputWidget = /** @class */ (function (_super) {\n tslib_1.__extends(InputWidget, _super);\n function InputWidget(attrs) {\n return _super.call(this, attrs) || this;\n }\n InputWidget.initClass = function () {\n this.prototype.type = \"InputWidget\";\n this.prototype.default_view = InputWidgetView;\n this.define({\n title: [p.String, ''],\n callback: [p.Instance],\n });\n };\n return InputWidget;\n }(widget_1.Widget));\n exports.InputWidget = InputWidget;\n InputWidget.initClass();\n}\n","/* models/widgets/main */ function _(require, module, exports) {\n var Widgets = require(413) /* ./index */;\n exports.Widgets = Widgets;\n var base_1 = require(0) /* ../../base */;\n base_1.register_models(Widgets);\n}\n","/* models/widgets/markup */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var p = require(15) /* core/properties */;\n var dom_1 = require(5) /* core/dom */;\n var widget_1 = require(440) /* ./widget */;\n var MarkupView = /** @class */ (function (_super) {\n tslib_1.__extends(MarkupView, _super);\n function MarkupView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MarkupView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n MarkupView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n MarkupView.prototype.render = function () {\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var style = tslib_1.__assign({ width: this.model.width + \"px\", height: this.model.height + \"px\" }, this.model.style);\n this.markupEl = dom_1.div({ style: style });\n this.el.appendChild(this.markupEl);\n };\n return MarkupView;\n }(widget_1.WidgetView));\n exports.MarkupView = MarkupView;\n var Markup = /** @class */ (function (_super) {\n tslib_1.__extends(Markup, _super);\n function Markup(attrs) {\n return _super.call(this, attrs) || this;\n }\n Markup.initClass = function () {\n this.prototype.type = \"Markup\";\n this.define({\n text: [p.String, ''],\n style: [p.Any, {}],\n });\n };\n return Markup;\n }(widget_1.Widget));\n exports.Markup = Markup;\n Markup.initClass();\n}\n","/* models/widgets/multiselect */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var dom_1 = require(5) /* core/dom */;\n var types_1 = require(44) /* core/util/types */;\n var data_structures_1 = require(29) /* core/util/data_structures */;\n var p = require(15) /* core/properties */;\n var input_widget_1 = require(414) /* ./input_widget */;\n var MultiSelectView = /** @class */ (function (_super) {\n tslib_1.__extends(MultiSelectView, _super);\n function MultiSelectView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MultiSelectView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n MultiSelectView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.properties.value.change, function () { return _this.render_selection(); });\n this.connect(this.model.properties.options.change, function () { return _this.render(); });\n this.connect(this.model.properties.name.change, function () { return _this.render(); });\n this.connect(this.model.properties.title.change, function () { return _this.render(); });\n this.connect(this.model.properties.size.change, function () { return _this.render(); });\n this.connect(this.model.properties.disabled.change, function () { return _this.render(); });\n };\n MultiSelectView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var labelEl = dom_1.label({ for: this.model.id }, this.model.title);\n this.el.appendChild(labelEl);\n var options = this.model.options.map(function (opt) {\n var value, _label;\n if (types_1.isString(opt))\n value = _label = opt;\n else\n value = opt[0], _label = opt[1];\n return dom_1.option({ value: value }, _label);\n });\n this.selectEl = dom_1.select({\n multiple: true,\n class: \"bk-widget-form-input\",\n id: this.model.id,\n name: this.model.name,\n disabled: this.model.disabled,\n }, options);\n this.selectEl.addEventListener(\"change\", function () { return _this.change_input(); });\n this.el.appendChild(this.selectEl);\n this.render_selection();\n };\n MultiSelectView.prototype.render_selection = function () {\n var selected = new data_structures_1.Set(this.model.value);\n for (var _i = 0, _a = Array.from(this.el.querySelectorAll('option')); _i < _a.length; _i++) {\n var el = _a[_i];\n el.selected = selected.has(el.value);\n }\n // Note that some browser implementations might not reduce\n // the number of visible options for size <= 3.\n this.selectEl.size = this.model.size;\n };\n MultiSelectView.prototype.change_input = function () {\n var is_focused = this.el.querySelector('select:focus') != null;\n var values = [];\n for (var _i = 0, _a = Array.from(this.el.querySelectorAll('option')); _i < _a.length; _i++) {\n var el = _a[_i];\n if (el.selected)\n values.push(el.value);\n }\n this.model.value = values;\n _super.prototype.change_input.call(this);\n // Restore focus back to the and one can seamlessly scroll\n // up/down.\n if (is_focused)\n this.selectEl.focus();\n };\n return MultiSelectView;\n }(input_widget_1.InputWidgetView));\n exports.MultiSelectView = MultiSelectView;\n var MultiSelect = /** @class */ (function (_super) {\n tslib_1.__extends(MultiSelect, _super);\n function MultiSelect(attrs) {\n return _super.call(this, attrs) || this;\n }\n MultiSelect.initClass = function () {\n this.prototype.type = \"MultiSelect\";\n this.prototype.default_view = MultiSelectView;\n this.define({\n value: [p.Array, []],\n options: [p.Array, []],\n size: [p.Number, 4],\n });\n };\n return MultiSelect;\n }(input_widget_1.InputWidget));\n exports.MultiSelect = MultiSelect;\n MultiSelect.initClass();\n}\n","/* models/widgets/panel */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var widget_1 = require(440) /* ./widget */;\n var p = require(15) /* core/properties */;\n var dom_1 = require(5) /* core/dom */;\n var PanelView = /** @class */ (function (_super) {\n tslib_1.__extends(PanelView, _super);\n function PanelView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PanelView.prototype.render = function () {\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n };\n return PanelView;\n }(widget_1.WidgetView));\n exports.PanelView = PanelView;\n var Panel = /** @class */ (function (_super) {\n tslib_1.__extends(Panel, _super);\n function Panel(attrs) {\n return _super.call(this, attrs) || this;\n }\n Panel.initClass = function () {\n this.prototype.type = \"Panel\";\n this.prototype.default_view = PanelView;\n this.define({\n title: [p.String, \"\"],\n child: [p.Instance],\n closable: [p.Bool, false],\n });\n };\n return Panel;\n }(widget_1.Widget));\n exports.Panel = Panel;\n Panel.initClass();\n}\n","/* models/widgets/paragraph */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var markup_1 = require(416) /* ./markup */;\n var dom_1 = require(5) /* core/dom */;\n var ParagraphView = /** @class */ (function (_super) {\n tslib_1.__extends(ParagraphView, _super);\n function ParagraphView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ParagraphView.prototype.render = function () {\n _super.prototype.render.call(this);\n // This overrides default user-agent styling and helps layout work\n var content = dom_1.p({ style: { margin: 0 } }, this.model.text);\n this.markupEl.appendChild(content);\n };\n return ParagraphView;\n }(markup_1.MarkupView));\n exports.ParagraphView = ParagraphView;\n var Paragraph = /** @class */ (function (_super) {\n tslib_1.__extends(Paragraph, _super);\n function Paragraph(attrs) {\n return _super.call(this, attrs) || this;\n }\n Paragraph.initClass = function () {\n this.prototype.type = \"Paragraph\";\n this.prototype.default_view = ParagraphView;\n };\n return Paragraph;\n }(markup_1.Markup));\n exports.Paragraph = Paragraph;\n Paragraph.initClass();\n}\n","/* models/widgets/password_input */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var text_input_1 = require(428) /* ./text_input */;\n var PasswordInputView = /** @class */ (function (_super) {\n tslib_1.__extends(PasswordInputView, _super);\n function PasswordInputView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PasswordInputView.prototype.render = function () {\n _super.prototype.render.call(this);\n this.inputEl.type = \"password\";\n };\n return PasswordInputView;\n }(text_input_1.TextInputView));\n exports.PasswordInputView = PasswordInputView;\n var PasswordInput = /** @class */ (function (_super) {\n tslib_1.__extends(PasswordInput, _super);\n function PasswordInput(attrs) {\n return _super.call(this, attrs) || this;\n }\n PasswordInput.initClass = function () {\n this.prototype.type = \"PasswordInput\";\n this.prototype.default_view = PasswordInputView;\n };\n return PasswordInput;\n }(text_input_1.TextInput));\n exports.PasswordInput = PasswordInput;\n PasswordInput.initClass();\n}\n","/* models/widgets/pretext */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var markup_1 = require(416) /* ./markup */;\n var dom_1 = require(5) /* core/dom */;\n var PreTextView = /** @class */ (function (_super) {\n tslib_1.__extends(PreTextView, _super);\n function PreTextView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PreTextView.prototype.render = function () {\n _super.prototype.render.call(this);\n var content = dom_1.pre({ style: { overflow: \"auto\" } }, this.model.text);\n this.markupEl.appendChild(content);\n };\n return PreTextView;\n }(markup_1.MarkupView));\n exports.PreTextView = PreTextView;\n var PreText = /** @class */ (function (_super) {\n tslib_1.__extends(PreText, _super);\n function PreText(attrs) {\n return _super.call(this, attrs) || this;\n }\n PreText.initClass = function () {\n this.prototype.type = \"PreText\";\n this.prototype.default_view = PreTextView;\n };\n return PreText;\n }(markup_1.Markup));\n exports.PreText = PreText;\n PreText.initClass();\n}\n","/* models/widgets/radio_button_group */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var dom_1 = require(5) /* core/dom */;\n var string_1 = require(38) /* core/util/string */;\n var p = require(15) /* core/properties */;\n var widget_1 = require(440) /* ./widget */;\n var RadioButtonGroupView = /** @class */ (function (_super) {\n tslib_1.__extends(RadioButtonGroupView, _super);\n function RadioButtonGroupView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RadioButtonGroupView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n RadioButtonGroupView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n RadioButtonGroupView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var divEl = dom_1.div({ class: \"bk-bs-btn-group\" });\n this.el.appendChild(divEl);\n var name = string_1.uniqueId();\n var active = this.model.active;\n var labels = this.model.labels;\n for (var i = 0; i < labels.length; i++) {\n var text = labels[i];\n var inputEl = dom_1.input({ type: \"radio\", name: name, value: \"\" + i, checked: i == active });\n inputEl.addEventListener(\"change\", function () { return _this.change_input(); });\n var labelEl = dom_1.label({ class: [\"bk-bs-btn\", \"bk-bs-btn-\" + this.model.button_type] }, inputEl, text);\n if (i == active)\n labelEl.classList.add(\"bk-bs-active\");\n divEl.appendChild(labelEl);\n }\n };\n RadioButtonGroupView.prototype.change_input = function () {\n var radios = this.el.querySelectorAll(\"input\");\n var active = [];\n for (var i = 0; i < radios.length; i++) {\n var radio = radios[i];\n if (radio.checked)\n active.push(i);\n }\n this.model.active = active[0];\n if (this.model.callback != null)\n this.model.callback.execute(this.model);\n };\n return RadioButtonGroupView;\n }(widget_1.WidgetView));\n exports.RadioButtonGroupView = RadioButtonGroupView;\n var RadioButtonGroup = /** @class */ (function (_super) {\n tslib_1.__extends(RadioButtonGroup, _super);\n function RadioButtonGroup(attrs) {\n return _super.call(this, attrs) || this;\n }\n RadioButtonGroup.initClass = function () {\n this.prototype.type = \"RadioButtonGroup\";\n this.prototype.default_view = RadioButtonGroupView;\n this.define({\n active: [p.Any, null],\n labels: [p.Array, []],\n button_type: [p.String, \"default\"],\n callback: [p.Instance],\n });\n };\n return RadioButtonGroup;\n }(widget_1.Widget));\n exports.RadioButtonGroup = RadioButtonGroup;\n RadioButtonGroup.initClass();\n}\n","/* models/widgets/radio_group */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var dom_1 = require(5) /* core/dom */;\n var string_1 = require(38) /* core/util/string */;\n var p = require(15) /* core/properties */;\n var widget_1 = require(440) /* ./widget */;\n var RadioGroupView = /** @class */ (function (_super) {\n tslib_1.__extends(RadioGroupView, _super);\n function RadioGroupView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RadioGroupView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n RadioGroupView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n RadioGroupView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var name = string_1.uniqueId();\n var active = this.model.active;\n var labels = this.model.labels;\n for (var i = 0; i < labels.length; i++) {\n var text = labels[i];\n var inputEl = dom_1.input({ type: \"radio\", name: name, value: \"\" + i });\n inputEl.addEventListener(\"change\", function () { return _this.change_input(); });\n if (this.model.disabled)\n inputEl.disabled = true;\n if (i == active)\n inputEl.checked = true;\n var labelEl = dom_1.label({}, inputEl, text);\n if (this.model.inline) {\n labelEl.classList.add(\"bk-bs-radio-inline\");\n this.el.appendChild(labelEl);\n }\n else {\n var divEl = dom_1.div({ class: \"bk-bs-radio\" }, labelEl);\n this.el.appendChild(divEl);\n }\n }\n };\n RadioGroupView.prototype.change_input = function () {\n var radios = this.el.querySelectorAll(\"input\");\n var active = [];\n for (var i = 0; i < radios.length; i++) {\n var radio = radios[i];\n if (radio.checked)\n active.push(i);\n }\n this.model.active = active[0];\n if (this.model.callback != null)\n this.model.callback.execute(this.model);\n };\n return RadioGroupView;\n }(widget_1.WidgetView));\n exports.RadioGroupView = RadioGroupView;\n var RadioGroup = /** @class */ (function (_super) {\n tslib_1.__extends(RadioGroup, _super);\n function RadioGroup(attrs) {\n return _super.call(this, attrs) || this;\n }\n RadioGroup.initClass = function () {\n this.prototype.type = \"RadioGroup\";\n this.prototype.default_view = RadioGroupView;\n this.define({\n active: [p.Any, null],\n labels: [p.Array, []],\n inline: [p.Bool, false],\n callback: [p.Instance],\n });\n };\n return RadioGroup;\n }(widget_1.Widget));\n exports.RadioGroup = RadioGroup;\n RadioGroup.initClass();\n}\n","/* models/widgets/range_slider */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var numbro = require(361) /* numbro */;\n var abstract_slider_1 = require(403) /* ./abstract_slider */;\n var RangeSliderView = /** @class */ (function (_super) {\n tslib_1.__extends(RangeSliderView, _super);\n function RangeSliderView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RangeSliderView.prototype._calc_to = function () {\n return {\n start: this.model.start,\n end: this.model.end,\n value: this.model.value,\n step: this.model.step,\n };\n };\n RangeSliderView.prototype._calc_from = function (values) {\n return values;\n };\n return RangeSliderView;\n }(abstract_slider_1.AbstractSliderView));\n exports.RangeSliderView = RangeSliderView;\n var RangeSlider = /** @class */ (function (_super) {\n tslib_1.__extends(RangeSlider, _super);\n function RangeSlider(attrs) {\n var _this = _super.call(this, attrs) || this;\n _this.behaviour = \"drag\";\n _this.connected = [false, true, false];\n return _this;\n }\n RangeSlider.initClass = function () {\n this.prototype.type = \"RangeSlider\";\n this.prototype.default_view = RangeSliderView;\n this.override({\n format: \"0[.]00\",\n });\n };\n RangeSlider.prototype._formatter = function (value, format) {\n return numbro.format(value, format);\n };\n return RangeSlider;\n }(abstract_slider_1.AbstractSlider));\n exports.RangeSlider = RangeSlider;\n RangeSlider.initClass();\n}\n","/* models/widgets/selectbox */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var dom_1 = require(5) /* core/dom */;\n var types_1 = require(44) /* core/util/types */;\n var logging_1 = require(14) /* core/logging */;\n var p = require(15) /* core/properties */;\n var input_widget_1 = require(414) /* ./input_widget */;\n var SelectView = /** @class */ (function (_super) {\n tslib_1.__extends(SelectView, _super);\n function SelectView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SelectView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n SelectView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n SelectView.prototype.build_options = function (values) {\n var _this = this;\n return values.map(function (el) {\n var value, _label;\n if (types_1.isString(el))\n value = _label = el;\n else\n value = el[0], _label = el[1];\n var selected = _this.model.value == value;\n return dom_1.option({ selected: selected, value: value }, _label);\n });\n };\n SelectView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var labelEl = dom_1.label({ for: this.model.id }, this.model.title);\n this.el.appendChild(labelEl);\n var contents;\n if (types_1.isArray(this.model.options))\n contents = this.build_options(this.model.options);\n else {\n contents = [];\n var options = this.model.options;\n for (var key in options) {\n var value = options[key];\n contents.push(dom_1.optgroup({ label: key }, this.build_options(value)));\n }\n }\n this.selectEl = dom_1.select({\n class: \"bk-widget-form-input\",\n id: this.model.id,\n name: this.model.name,\n disabled: this.model.disabled\n }, contents);\n this.selectEl.addEventListener(\"change\", function () { return _this.change_input(); });\n this.el.appendChild(this.selectEl);\n };\n SelectView.prototype.change_input = function () {\n var value = this.selectEl.value;\n logging_1.logger.debug(\"selectbox: value = \" + value);\n this.model.value = value;\n _super.prototype.change_input.call(this);\n };\n return SelectView;\n }(input_widget_1.InputWidgetView));\n exports.SelectView = SelectView;\n var Select = /** @class */ (function (_super) {\n tslib_1.__extends(Select, _super);\n function Select(attrs) {\n return _super.call(this, attrs) || this;\n }\n Select.initClass = function () {\n this.prototype.type = \"Select\";\n this.prototype.default_view = SelectView;\n this.define({\n value: [p.String, ''],\n options: [p.Any, []],\n });\n };\n return Select;\n }(input_widget_1.InputWidget));\n exports.Select = Select;\n Select.initClass();\n}\n","/* models/widgets/slider */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var numbro = require(361) /* numbro */;\n var abstract_slider_1 = require(403) /* ./abstract_slider */;\n var SliderView = /** @class */ (function (_super) {\n tslib_1.__extends(SliderView, _super);\n function SliderView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SliderView.prototype._calc_to = function () {\n return {\n start: this.model.start,\n end: this.model.end,\n value: [this.model.value],\n step: this.model.step,\n };\n };\n SliderView.prototype._calc_from = function (_a) {\n var value = _a[0];\n if (Number.isInteger(this.model.start) && Number.isInteger(this.model.end) && Number.isInteger(this.model.step))\n return Math.round(value);\n else\n return value;\n };\n return SliderView;\n }(abstract_slider_1.AbstractSliderView));\n exports.SliderView = SliderView;\n var Slider = /** @class */ (function (_super) {\n tslib_1.__extends(Slider, _super);\n function Slider(attrs) {\n var _this = _super.call(this, attrs) || this;\n _this.behaviour = \"tap\";\n _this.connected = [true, false];\n return _this;\n }\n Slider.initClass = function () {\n this.prototype.type = \"Slider\";\n this.prototype.default_view = SliderView;\n this.override({\n format: \"0[.]00\",\n });\n };\n Slider.prototype._formatter = function (value, format) {\n return numbro.format(value, format);\n };\n return Slider;\n }(abstract_slider_1.AbstractSlider));\n exports.Slider = Slider;\n Slider.initClass();\n}\n","/* models/widgets/tabs */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var dom_1 = require(5) /* core/dom */;\n var array_1 = require(21) /* core/util/array */;\n var p = require(15) /* core/properties */;\n var widget_1 = require(440) /* ./widget */;\n var TabsView = /** @class */ (function (_super) {\n tslib_1.__extends(TabsView, _super);\n function TabsView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TabsView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.properties.tabs.change, function () { return _this.rebuild_child_views(); });\n this.connect(this.model.properties.active.change, function () { return _this.render(); });\n };\n TabsView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var len = this.model.tabs.length;\n if (len == 0)\n return;\n else if (this.model.active >= len)\n this.model.active = len - 1;\n var tabs = this.model.tabs.map(function (tab, i) { return dom_1.li({}, dom_1.span({ data: { index: i } }, tab.title)); });\n tabs[this.model.active].classList.add(\"bk-bs-active\");\n var tabsEl = dom_1.ul({ class: [\"bk-bs-nav\", \"bk-bs-nav-tabs\"] }, tabs);\n this.el.appendChild(tabsEl);\n var panels = this.model.tabs.map(function (_tab) { return dom_1.div({ class: \"bk-bs-tab-pane\" }); });\n panels[this.model.active].classList.add(\"bk-bs-active\");\n var panelsEl = dom_1.div({ class: \"bk-bs-tab-content\" }, panels);\n this.el.appendChild(panelsEl);\n tabsEl.addEventListener(\"click\", function (event) {\n event.preventDefault();\n if (event.target != event.currentTarget) {\n var el = event.target;\n var old_active = _this.model.active;\n var new_active = parseInt(el.dataset.index);\n if (old_active != new_active) {\n tabs[old_active].classList.remove(\"bk-bs-active\");\n panels[old_active].classList.remove(\"bk-bs-active\");\n tabs[new_active].classList.add(\"bk-bs-active\");\n panels[new_active].classList.add(\"bk-bs-active\");\n _this.model.active = new_active;\n if (_this.model.callback != null)\n _this.model.callback.execute(_this.model);\n }\n }\n });\n for (var _i = 0, _a = array_1.zip(this.model.children, panels); _i < _a.length; _i++) {\n var _b = _a[_i], child = _b[0], panelEl = _b[1];\n panelEl.appendChild(this.child_views[child.id].el);\n }\n };\n return TabsView;\n }(widget_1.WidgetView));\n exports.TabsView = TabsView;\n var Tabs = /** @class */ (function (_super) {\n tslib_1.__extends(Tabs, _super);\n function Tabs(attrs) {\n return _super.call(this, attrs) || this;\n }\n Tabs.initClass = function () {\n this.prototype.type = \"Tabs\";\n this.prototype.default_view = TabsView;\n this.define({\n tabs: [p.Array, []],\n active: [p.Number, 0],\n callback: [p.Instance],\n });\n };\n Tabs.prototype.get_layoutable_children = function () {\n return this.children;\n };\n Object.defineProperty(Tabs.prototype, \"children\", {\n get: function () {\n return this.tabs.map(function (tab) { return tab.child; });\n },\n enumerable: true,\n configurable: true\n });\n return Tabs;\n }(widget_1.Widget));\n exports.Tabs = Tabs;\n Tabs.initClass();\n}\n","/* models/widgets/text_input */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var logging_1 = require(14) /* core/logging */;\n var p = require(15) /* core/properties */;\n var dom_1 = require(5) /* core/dom */;\n var input_widget_1 = require(414) /* ./input_widget */;\n var TextInputView = /** @class */ (function (_super) {\n tslib_1.__extends(TextInputView, _super);\n function TextInputView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TextInputView.prototype.initialize = function (options) {\n _super.prototype.initialize.call(this, options);\n this.render();\n };\n TextInputView.prototype.connect_signals = function () {\n var _this = this;\n _super.prototype.connect_signals.call(this);\n this.connect(this.model.change, function () { return _this.render(); });\n };\n TextInputView.prototype.css_classes = function () {\n return _super.prototype.css_classes.call(this).concat(\"bk-widget-form-group\");\n };\n TextInputView.prototype.render = function () {\n var _this = this;\n _super.prototype.render.call(this);\n dom_1.empty(this.el);\n var labelEl = dom_1.label({ for: this.model.id }, this.model.title);\n this.el.appendChild(labelEl);\n this.inputEl = dom_1.input({\n type: \"text\",\n class: \"bk-widget-form-input\",\n id: this.model.id,\n name: this.model.name,\n value: this.model.value,\n disabled: this.model.disabled,\n placeholder: this.model.placeholder,\n });\n this.inputEl.addEventListener(\"change\", function () { return _this.change_input(); });\n this.el.appendChild(this.inputEl);\n // TODO - This 35 is a hack we should be able to compute it\n if (this.model.height)\n this.inputEl.style.height = this.model.height - 35 + \"px\";\n };\n TextInputView.prototype.change_input = function () {\n var value = this.inputEl.value;\n logging_1.logger.debug(\"widget/text_input: value = \" + value);\n this.model.value = value;\n _super.prototype.change_input.call(this);\n };\n return TextInputView;\n }(input_widget_1.InputWidgetView));\n exports.TextInputView = TextInputView;\n var TextInput = /** @class */ (function (_super) {\n tslib_1.__extends(TextInput, _super);\n function TextInput(attrs) {\n return _super.call(this, attrs) || this;\n }\n TextInput.initClass = function () {\n this.prototype.type = \"TextInput\";\n this.prototype.default_view = TextInputView;\n this.define({\n value: [p.String, \"\"],\n placeholder: [p.String, \"\"],\n });\n };\n return TextInput;\n }(input_widget_1.InputWidget));\n exports.TextInput = TextInput;\n TextInput.initClass();\n}\n","/* models/widgets/toggle */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var abstract_button_1 = require(401) /* ./abstract_button */;\n var p = require(15) /* core/properties */;\n var ToggleView = /** @class */ (function (_super) {\n tslib_1.__extends(ToggleView, _super);\n function ToggleView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ToggleView.prototype.render = function () {\n _super.prototype.render.call(this);\n if (this.model.active)\n this.buttonEl.classList.add(\"bk-bs-active\");\n };\n ToggleView.prototype.change_input = function () {\n this.model.active = !this.model.active;\n _super.prototype.change_input.call(this);\n };\n return ToggleView;\n }(abstract_button_1.AbstractButtonView));\n exports.ToggleView = ToggleView;\n var Toggle = /** @class */ (function (_super) {\n tslib_1.__extends(Toggle, _super);\n function Toggle(attrs) {\n return _super.call(this, attrs) || this;\n }\n Toggle.initClass = function () {\n this.prototype.type = \"Toggle\";\n this.prototype.default_view = ToggleView;\n this.define({\n active: [p.Bool, false],\n });\n this.override({\n label: \"Toggle\",\n });\n };\n return Toggle;\n }(abstract_button_1.AbstractButton));\n exports.Toggle = Toggle;\n Toggle.initClass();\n}\n","/* models/widgets/widget */ function _(require, module, exports) {\n var tslib_1 = require(391) /* tslib */;\n var layout_dom_1 = require(157) /* ../layouts/layout_dom */;\n var WidgetView = /** @class */ (function (_super) {\n tslib_1.__extends(WidgetView, _super);\n function WidgetView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n WidgetView.prototype.css_classes = function () {\n return _super.prototype.css_classes.call(this).concat(\"bk-widget\");\n };\n WidgetView.prototype.render = function () {\n this._render_classes(); // XXX: because no super()\n // LayoutDOMView sets up lots of helpful things, but\n // it's render method is not suitable for widgets - who\n // should provide their own.\n if (this.model.height != null)\n this.el.style.height = this.model.height + \"px\";\n if (this.model.width != null)\n this.el.style.width = this.model.width + \"px\";\n };\n WidgetView.prototype.get_width = function () {\n throw new Error(\"unused\");\n };\n WidgetView.prototype.get_height = function () {\n throw new Error(\"unused\");\n };\n return WidgetView;\n }(layout_dom_1.LayoutDOMView));\n exports.WidgetView = WidgetView;\n var Widget = /** @class */ (function (_super) {\n tslib_1.__extends(Widget, _super);\n function Widget(attrs) {\n return _super.call(this, attrs) || this;\n }\n Widget.initClass = function () {\n this.prototype.type = \"Widget\";\n };\n return Widget;\n }(layout_dom_1.LayoutDOM));\n exports.Widget = Widget;\n Widget.initClass();\n}\n","/* nouislider/distribute/nouislider */ function _(require, module, exports) {\n /*! nouislider - 10.1.0 - 2017-07-28 17:11:18 */\n (function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n }\n else if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory();\n }\n else {\n // Browser globals\n window.noUiSlider = factory();\n }\n }(function () {\n 'use strict';\n var VERSION = '10.1.0';\n function isValidFormatter(entry) {\n return typeof entry === 'object' && typeof entry.to === 'function' && typeof entry.from === 'function';\n }\n function removeElement(el) {\n el.parentElement.removeChild(el);\n }\n // Bindable version\n function preventDefault(e) {\n e.preventDefault();\n }\n // Removes duplicates from an array.\n function unique(array) {\n return array.filter(function (a) {\n return !this[a] ? this[a] = true : false;\n }, {});\n }\n // Round a value to the closest 'to'.\n function closest(value, to) {\n return Math.round(value / to) * to;\n }\n // Current position of an element relative to the document.\n function offset(elem, orientation) {\n var rect = elem.getBoundingClientRect();\n var doc = elem.ownerDocument;\n var docElem = doc.documentElement;\n var pageOffset = getPageOffset(doc);\n // getBoundingClientRect contains left scroll in Chrome on Android.\n // I haven't found a feature detection that proves this. Worst case\n // scenario on mis-match: the 'tap' feature on horizontal sliders breaks.\n if (/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)) {\n pageOffset.x = 0;\n }\n return orientation ? (rect.top + pageOffset.y - docElem.clientTop) : (rect.left + pageOffset.x - docElem.clientLeft);\n }\n // Checks whether a value is numerical.\n function isNumeric(a) {\n return typeof a === 'number' && !isNaN(a) && isFinite(a);\n }\n // Sets a class and removes it after [duration] ms.\n function addClassFor(element, className, duration) {\n if (duration > 0) {\n addClass(element, className);\n setTimeout(function () {\n removeClass(element, className);\n }, duration);\n }\n }\n // Limits a value to 0 - 100\n function limit(a) {\n return Math.max(Math.min(a, 100), 0);\n }\n // Wraps a variable as an array, if it isn't one yet.\n // Note that an input array is returned by reference!\n function asArray(a) {\n return Array.isArray(a) ? a : [a];\n }\n // Counts decimals\n function countDecimals(numStr) {\n numStr = String(numStr);\n var pieces = numStr.split(\".\");\n return pieces.length > 1 ? pieces[1].length : 0;\n }\n // http://youmightnotneedjquery.com/#add_class\n function addClass(el, className) {\n if (el.classList) {\n el.classList.add(className);\n }\n else {\n el.className += ' ' + className;\n }\n }\n // http://youmightnotneedjquery.com/#remove_class\n function removeClass(el, className) {\n if (el.classList) {\n el.classList.remove(className);\n }\n else {\n el.className = el.className.replace(new RegExp('(^|\\\\b)' + className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\n }\n }\n // https://plainjs.com/javascript/attributes/adding-removing-and-testing-for-classes-9/\n function hasClass(el, className) {\n return el.classList ? el.classList.contains(className) : new RegExp('\\\\b' + className + '\\\\b').test(el.className);\n }\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY#Notes\n function getPageOffset(doc) {\n var supportPageOffset = window.pageXOffset !== undefined;\n var isCSS1Compat = ((doc.compatMode || \"\") === \"CSS1Compat\");\n var x = supportPageOffset ? window.pageXOffset : isCSS1Compat ? doc.documentElement.scrollLeft : doc.body.scrollLeft;\n var y = supportPageOffset ? window.pageYOffset : isCSS1Compat ? doc.documentElement.scrollTop : doc.body.scrollTop;\n return {\n x: x,\n y: y\n };\n }\n // we provide a function to compute constants instead\n // of accessing window.* as soon as the module needs it\n // so that we do not compute anything if not needed\n function getActions() {\n // Determine the events to bind. IE11 implements pointerEvents without\n // a prefix, which breaks compatibility with the IE10 implementation.\n return window.navigator.pointerEnabled ? {\n start: 'pointerdown',\n move: 'pointermove',\n end: 'pointerup'\n } : window.navigator.msPointerEnabled ? {\n start: 'MSPointerDown',\n move: 'MSPointerMove',\n end: 'MSPointerUp'\n } : {\n start: 'mousedown touchstart',\n move: 'mousemove touchmove',\n end: 'mouseup touchend'\n };\n }\n // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n // Issue #785\n function getSupportsPassive() {\n var supportsPassive = false;\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function () {\n supportsPassive = true;\n }\n });\n window.addEventListener('test', null, opts);\n }\n catch (e) { }\n return supportsPassive;\n }\n function getSupportsTouchActionNone() {\n return window.CSS && CSS.supports && CSS.supports('touch-action', 'none');\n }\n // Value calculation\n // Determine the size of a sub-range in relation to a full range.\n function subRangeRatio(pa, pb) {\n return (100 / (pb - pa));\n }\n // (percentage) How many percent is this value of this range?\n function fromPercentage(range, value) {\n return (value * 100) / (range[1] - range[0]);\n }\n // (percentage) Where is this value on this range?\n function toPercentage(range, value) {\n return fromPercentage(range, range[0] < 0 ?\n value + Math.abs(range[0]) :\n value - range[0]);\n }\n // (value) How much is this percentage on this range?\n function isPercentage(range, value) {\n return ((value * (range[1] - range[0])) / 100) + range[0];\n }\n // Range conversion\n function getJ(value, arr) {\n var j = 1;\n while (value >= arr[j]) {\n j += 1;\n }\n return j;\n }\n // (percentage) Input a value, find where, on a scale of 0-100, it applies.\n function toStepping(xVal, xPct, value) {\n if (value >= xVal.slice(-1)[0]) {\n return 100;\n }\n var j = getJ(value, xVal), va, vb, pa, pb;\n va = xVal[j - 1];\n vb = xVal[j];\n pa = xPct[j - 1];\n pb = xPct[j];\n return pa + (toPercentage([va, vb], value) / subRangeRatio(pa, pb));\n }\n // (value) Input a percentage, find where it is on the specified range.\n function fromStepping(xVal, xPct, value) {\n // There is no range group that fits 100\n if (value >= 100) {\n return xVal.slice(-1)[0];\n }\n var j = getJ(value, xPct), va, vb, pa, pb;\n va = xVal[j - 1];\n vb = xVal[j];\n pa = xPct[j - 1];\n pb = xPct[j];\n return isPercentage([va, vb], (value - pa) * subRangeRatio(pa, pb));\n }\n // (percentage) Get the step that applies at a certain value.\n function getStep(xPct, xSteps, snap, value) {\n if (value === 100) {\n return value;\n }\n var j = getJ(value, xPct), a, b;\n // If 'snap' is set, steps are used as fixed points on the slider.\n if (snap) {\n a = xPct[j - 1];\n b = xPct[j];\n // Find the closest position, a or b.\n if ((value - a) > ((b - a) / 2)) {\n return b;\n }\n return a;\n }\n if (!xSteps[j - 1]) {\n return value;\n }\n return xPct[j - 1] + closest(value - xPct[j - 1], xSteps[j - 1]);\n }\n // Entry parsing\n function handleEntryPoint(index, value, that) {\n var percentage;\n // Wrap numerical input in an array.\n if (typeof value === \"number\") {\n value = [value];\n }\n // Reject any invalid input, by testing whether value is an array.\n if (Object.prototype.toString.call(value) !== '[object Array]') {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'range' contains invalid value.\");\n }\n // Covert min/max syntax to 0 and 100.\n if (index === 'min') {\n percentage = 0;\n }\n else if (index === 'max') {\n percentage = 100;\n }\n else {\n percentage = parseFloat(index);\n }\n // Check for correct input.\n if (!isNumeric(percentage) || !isNumeric(value[0])) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'range' value isn't numeric.\");\n }\n // Store values.\n that.xPct.push(percentage);\n that.xVal.push(value[0]);\n // NaN will evaluate to false too, but to keep\n // logging clear, set step explicitly. Make sure\n // not to override the 'step' setting with false.\n if (!percentage) {\n if (!isNaN(value[1])) {\n that.xSteps[0] = value[1];\n }\n }\n else {\n that.xSteps.push(isNaN(value[1]) ? false : value[1]);\n }\n that.xHighestCompleteStep.push(0);\n }\n function handleStepPoint(i, n, that) {\n // Ignore 'false' stepping.\n if (!n) {\n return true;\n }\n // Factor to range ratio\n that.xSteps[i] = fromPercentage([\n that.xVal[i],\n that.xVal[i + 1]\n ], n) / subRangeRatio(that.xPct[i], that.xPct[i + 1]);\n var totalSteps = (that.xVal[i + 1] - that.xVal[i]) / that.xNumSteps[i];\n var highestStep = Math.ceil(Number(totalSteps.toFixed(3)) - 1);\n var step = that.xVal[i] + (that.xNumSteps[i] * highestStep);\n that.xHighestCompleteStep[i] = step;\n }\n // Interface\n function Spectrum(entry, snap, singleStep) {\n this.xPct = [];\n this.xVal = [];\n this.xSteps = [singleStep || false];\n this.xNumSteps = [false];\n this.xHighestCompleteStep = [];\n this.snap = snap;\n var index, ordered = [ /* [0, 'min'], [1, '50%'], [2, 'max'] */];\n // Map the object keys to an array.\n for (index in entry) {\n if (entry.hasOwnProperty(index)) {\n ordered.push([entry[index], index]);\n }\n }\n // Sort all entries by value (numeric sort).\n if (ordered.length && typeof ordered[0][0] === \"object\") {\n ordered.sort(function (a, b) { return a[0][0] - b[0][0]; });\n }\n else {\n ordered.sort(function (a, b) { return a[0] - b[0]; });\n }\n // Convert all entries to subranges.\n for (index = 0; index < ordered.length; index++) {\n handleEntryPoint(ordered[index][1], ordered[index][0], this);\n }\n // Store the actual step values.\n // xSteps is sorted in the same order as xPct and xVal.\n this.xNumSteps = this.xSteps.slice(0);\n // Convert all numeric steps to the percentage of the subrange they represent.\n for (index = 0; index < this.xNumSteps.length; index++) {\n handleStepPoint(index, this.xNumSteps[index], this);\n }\n }\n Spectrum.prototype.getMargin = function (value) {\n var step = this.xNumSteps[0];\n if (step && ((value / step) % 1) !== 0) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'limit', 'margin' and 'padding' must be divisible by step.\");\n }\n return this.xPct.length === 2 ? fromPercentage(this.xVal, value) : false;\n };\n Spectrum.prototype.toStepping = function (value) {\n value = toStepping(this.xVal, this.xPct, value);\n return value;\n };\n Spectrum.prototype.fromStepping = function (value) {\n return fromStepping(this.xVal, this.xPct, value);\n };\n Spectrum.prototype.getStep = function (value) {\n value = getStep(this.xPct, this.xSteps, this.snap, value);\n return value;\n };\n Spectrum.prototype.getNearbySteps = function (value) {\n var j = getJ(value, this.xPct);\n return {\n stepBefore: { startValue: this.xVal[j - 2], step: this.xNumSteps[j - 2], highestStep: this.xHighestCompleteStep[j - 2] },\n thisStep: { startValue: this.xVal[j - 1], step: this.xNumSteps[j - 1], highestStep: this.xHighestCompleteStep[j - 1] },\n stepAfter: { startValue: this.xVal[j - 0], step: this.xNumSteps[j - 0], highestStep: this.xHighestCompleteStep[j - 0] }\n };\n };\n Spectrum.prototype.countStepDecimals = function () {\n var stepDecimals = this.xNumSteps.map(countDecimals);\n return Math.max.apply(null, stepDecimals);\n };\n // Outside testing\n Spectrum.prototype.convert = function (value) {\n return this.getStep(this.toStepping(value));\n };\n /*\tEvery input option is tested and parsed. This'll prevent\n endless validation in internal methods. These tests are\n structured with an item for every option available. An\n option can be marked as required by setting the 'r' flag.\n The testing function is provided with three arguments:\n - The provided value for the option;\n - A reference to the options object;\n - The name for the option;\n \n The testing function returns false when an error is detected,\n or true when everything is OK. It can also modify the option\n object, to make sure all values can be correctly looped elsewhere. */\n var defaultFormatter = { 'to': function (value) {\n return value !== undefined && value.toFixed(2);\n }, 'from': Number };\n function validateFormat(entry) {\n // Any object with a to and from method is supported.\n if (isValidFormatter(entry)) {\n return true;\n }\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'format' requires 'to' and 'from' methods.\");\n }\n function testStep(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'step' is not numeric.\");\n }\n // The step option can still be used to set stepping\n // for linear sliders. Overwritten if set in 'range'.\n parsed.singleStep = entry;\n }\n function testRange(parsed, entry) {\n // Filter incorrect input.\n if (typeof entry !== 'object' || Array.isArray(entry)) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'range' is not an object.\");\n }\n // Catch missing start or end.\n if (entry.min === undefined || entry.max === undefined) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): Missing 'min' or 'max' in 'range'.\");\n }\n // Catch equal start or end.\n if (entry.min === entry.max) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'range' 'min' and 'max' cannot be equal.\");\n }\n parsed.spectrum = new Spectrum(entry, parsed.snap, parsed.singleStep);\n }\n function testStart(parsed, entry) {\n entry = asArray(entry);\n // Validate input. Values aren't tested, as the public .val method\n // will always provide a valid location.\n if (!Array.isArray(entry) || !entry.length) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'start' option is incorrect.\");\n }\n // Store the number of handles.\n parsed.handles = entry.length;\n // When the slider is initialized, the .val method will\n // be called with the start options.\n parsed.start = entry;\n }\n function testSnap(parsed, entry) {\n // Enforce 100% stepping within subranges.\n parsed.snap = entry;\n if (typeof entry !== 'boolean') {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'snap' option must be a boolean.\");\n }\n }\n function testAnimate(parsed, entry) {\n // Enforce 100% stepping within subranges.\n parsed.animate = entry;\n if (typeof entry !== 'boolean') {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'animate' option must be a boolean.\");\n }\n }\n function testAnimationDuration(parsed, entry) {\n parsed.animationDuration = entry;\n if (typeof entry !== 'number') {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'animationDuration' option must be a number.\");\n }\n }\n function testConnect(parsed, entry) {\n var connect = [false];\n var i;\n // Map legacy options\n if (entry === 'lower') {\n entry = [true, false];\n }\n else if (entry === 'upper') {\n entry = [false, true];\n }\n // Handle boolean options\n if (entry === true || entry === false) {\n for (i = 1; i < parsed.handles; i++) {\n connect.push(entry);\n }\n connect.push(false);\n }\n // Reject invalid input\n else if (!Array.isArray(entry) || !entry.length || entry.length !== parsed.handles + 1) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'connect' option doesn't match handle count.\");\n }\n else {\n connect = entry;\n }\n parsed.connect = connect;\n }\n function testOrientation(parsed, entry) {\n // Set orientation to an a numerical value for easy\n // array selection.\n switch (entry) {\n case 'horizontal':\n parsed.ort = 0;\n break;\n case 'vertical':\n parsed.ort = 1;\n break;\n default:\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'orientation' option is invalid.\");\n }\n }\n function testMargin(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'margin' option must be numeric.\");\n }\n // Issue #582\n if (entry === 0) {\n return;\n }\n parsed.margin = parsed.spectrum.getMargin(entry);\n if (!parsed.margin) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'margin' option is only supported on linear sliders.\");\n }\n }\n function testLimit(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'limit' option must be numeric.\");\n }\n parsed.limit = parsed.spectrum.getMargin(entry);\n if (!parsed.limit || parsed.handles < 2) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'limit' option is only supported on linear sliders with 2 or more handles.\");\n }\n }\n function testPadding(parsed, entry) {\n if (!isNumeric(entry)) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'padding' option must be numeric.\");\n }\n if (entry === 0) {\n return;\n }\n parsed.padding = parsed.spectrum.getMargin(entry);\n if (!parsed.padding) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'padding' option is only supported on linear sliders.\");\n }\n if (parsed.padding < 0) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'padding' option must be a positive number.\");\n }\n if (parsed.padding >= 50) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'padding' option must be less than half the range.\");\n }\n }\n function testDirection(parsed, entry) {\n // Set direction as a numerical value for easy parsing.\n // Invert connection for RTL sliders, so that the proper\n // handles get the connect/background classes.\n switch (entry) {\n case 'ltr':\n parsed.dir = 0;\n break;\n case 'rtl':\n parsed.dir = 1;\n break;\n default:\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'direction' option was not recognized.\");\n }\n }\n function testBehaviour(parsed, entry) {\n // Make sure the input is a string.\n if (typeof entry !== 'string') {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'behaviour' must be a string containing options.\");\n }\n // Check if the string contains any keywords.\n // None are required.\n var tap = entry.indexOf('tap') >= 0;\n var drag = entry.indexOf('drag') >= 0;\n var fixed = entry.indexOf('fixed') >= 0;\n var snap = entry.indexOf('snap') >= 0;\n var hover = entry.indexOf('hover') >= 0;\n if (fixed) {\n if (parsed.handles !== 2) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'fixed' behaviour must be used with 2 handles\");\n }\n // Use margin to enforce fixed state\n testMargin(parsed, parsed.start[1] - parsed.start[0]);\n }\n parsed.events = {\n tap: tap || snap,\n drag: drag,\n fixed: fixed,\n snap: snap,\n hover: hover\n };\n }\n function testMultitouch(parsed, entry) {\n parsed.multitouch = entry;\n if (typeof entry !== 'boolean') {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'multitouch' option must be a boolean.\");\n }\n }\n function testTooltips(parsed, entry) {\n if (entry === false) {\n return;\n }\n else if (entry === true) {\n parsed.tooltips = [];\n for (var i = 0; i < parsed.handles; i++) {\n parsed.tooltips.push(true);\n }\n }\n else {\n parsed.tooltips = asArray(entry);\n if (parsed.tooltips.length !== parsed.handles) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): must pass a formatter for all handles.\");\n }\n parsed.tooltips.forEach(function (formatter) {\n if (typeof formatter !== 'boolean' && (typeof formatter !== 'object' || typeof formatter.to !== 'function')) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'tooltips' must be passed a formatter or 'false'.\");\n }\n });\n }\n }\n function testAriaFormat(parsed, entry) {\n parsed.ariaFormat = entry;\n validateFormat(entry);\n }\n function testFormat(parsed, entry) {\n parsed.format = entry;\n validateFormat(entry);\n }\n function testCssPrefix(parsed, entry) {\n if (entry !== undefined && typeof entry !== 'string' && entry !== false) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'cssPrefix' must be a string or `false`.\");\n }\n parsed.cssPrefix = entry;\n }\n function testCssClasses(parsed, entry) {\n if (entry !== undefined && typeof entry !== 'object') {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'cssClasses' must be an object.\");\n }\n if (typeof parsed.cssPrefix === 'string') {\n parsed.cssClasses = {};\n for (var key in entry) {\n if (!entry.hasOwnProperty(key)) {\n continue;\n }\n parsed.cssClasses[key] = parsed.cssPrefix + entry[key];\n }\n }\n else {\n parsed.cssClasses = entry;\n }\n }\n function testUseRaf(parsed, entry) {\n if (entry === true || entry === false) {\n parsed.useRequestAnimationFrame = entry;\n }\n else {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'useRequestAnimationFrame' option should be true (default) or false.\");\n }\n }\n // Test all developer settings and parse to assumption-safe values.\n function testOptions(options) {\n // To prove a fix for #537, freeze options here.\n // If the object is modified, an error will be thrown.\n // Object.freeze(options);\n var parsed = {\n margin: 0,\n limit: 0,\n padding: 0,\n animate: true,\n animationDuration: 300,\n ariaFormat: defaultFormatter,\n format: defaultFormatter\n };\n // Tests are executed in the order they are presented here.\n var tests = {\n 'step': { r: false, t: testStep },\n 'start': { r: true, t: testStart },\n 'connect': { r: true, t: testConnect },\n 'direction': { r: true, t: testDirection },\n 'snap': { r: false, t: testSnap },\n 'animate': { r: false, t: testAnimate },\n 'animationDuration': { r: false, t: testAnimationDuration },\n 'range': { r: true, t: testRange },\n 'orientation': { r: false, t: testOrientation },\n 'margin': { r: false, t: testMargin },\n 'limit': { r: false, t: testLimit },\n 'padding': { r: false, t: testPadding },\n 'behaviour': { r: true, t: testBehaviour },\n 'multitouch': { r: true, t: testMultitouch },\n 'ariaFormat': { r: false, t: testAriaFormat },\n 'format': { r: false, t: testFormat },\n 'tooltips': { r: false, t: testTooltips },\n 'cssPrefix': { r: false, t: testCssPrefix },\n 'cssClasses': { r: false, t: testCssClasses },\n 'useRequestAnimationFrame': { r: false, t: testUseRaf }\n };\n var defaults = {\n 'connect': false,\n 'direction': 'ltr',\n 'behaviour': 'tap',\n 'multitouch': false,\n 'orientation': 'horizontal',\n 'cssPrefix': 'noUi-',\n 'cssClasses': {\n target: 'target',\n base: 'base',\n origin: 'origin',\n handle: 'handle',\n handleLower: 'handle-lower',\n handleUpper: 'handle-upper',\n horizontal: 'horizontal',\n vertical: 'vertical',\n background: 'background',\n connect: 'connect',\n ltr: 'ltr',\n rtl: 'rtl',\n draggable: 'draggable',\n drag: 'state-drag',\n tap: 'state-tap',\n active: 'active',\n tooltip: 'tooltip',\n pips: 'pips',\n pipsHorizontal: 'pips-horizontal',\n pipsVertical: 'pips-vertical',\n marker: 'marker',\n markerHorizontal: 'marker-horizontal',\n markerVertical: 'marker-vertical',\n markerNormal: 'marker-normal',\n markerLarge: 'marker-large',\n markerSub: 'marker-sub',\n value: 'value',\n valueHorizontal: 'value-horizontal',\n valueVertical: 'value-vertical',\n valueNormal: 'value-normal',\n valueLarge: 'value-large',\n valueSub: 'value-sub'\n },\n 'useRequestAnimationFrame': true\n };\n // AriaFormat defaults to regular format, if any.\n if (options.format && !options.ariaFormat) {\n options.ariaFormat = options.format;\n }\n // Run all options through a testing mechanism to ensure correct\n // input. It should be noted that options might get modified to\n // be handled properly. E.g. wrapping integers in arrays.\n Object.keys(tests).forEach(function (name) {\n // If the option isn't set, but it is required, throw an error.\n if (options[name] === undefined && defaults[name] === undefined) {\n if (tests[name].r) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n }\n return true;\n }\n tests[name].t(parsed, options[name] === undefined ? defaults[name] : options[name]);\n });\n // Forward pips options\n parsed.pips = options.pips;\n var styles = [['left', 'top'], ['right', 'bottom']];\n // Pre-define the styles.\n parsed.style = styles[parsed.dir][parsed.ort];\n parsed.styleOposite = styles[parsed.dir ? 0 : 1][parsed.ort];\n return parsed;\n }\n function closure(target, options, originalOptions) {\n var actions = getActions();\n var supportsTouchActionNone = getSupportsTouchActionNone();\n var supportsPassive = supportsTouchActionNone && getSupportsPassive();\n // All variables local to 'closure' are prefixed with 'scope_'\n var scope_Target = target;\n var scope_Locations = [];\n var scope_Base;\n var scope_Handles;\n var scope_HandleNumbers = [];\n var scope_ActiveHandlesCount = 0;\n var scope_Connects;\n var scope_Spectrum = options.spectrum;\n var scope_Values = [];\n var scope_Events = {};\n var scope_Self;\n var scope_Pips;\n var scope_Document = target.ownerDocument;\n var scope_DocumentElement = scope_Document.documentElement;\n var scope_Body = scope_Document.body;\n // Creates a node, adds it to target, returns the new node.\n function addNodeTo(target, className) {\n var div = scope_Document.createElement('div');\n if (className) {\n addClass(div, className);\n }\n target.appendChild(div);\n return div;\n }\n // Append a origin to the base\n function addOrigin(base, handleNumber) {\n var origin = addNodeTo(base, options.cssClasses.origin);\n var handle = addNodeTo(origin, options.cssClasses.handle);\n handle.setAttribute('data-handle', handleNumber);\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex\n // 0 = focusable and reachable\n handle.setAttribute('tabindex', '0');\n handle.setAttribute('role', 'slider');\n handle.setAttribute('aria-orientation', options.ort ? 'vertical' : 'horizontal');\n if (handleNumber === 0) {\n addClass(handle, options.cssClasses.handleLower);\n }\n else if (handleNumber === options.handles - 1) {\n addClass(handle, options.cssClasses.handleUpper);\n }\n return origin;\n }\n // Insert nodes for connect elements\n function addConnect(base, add) {\n if (!add) {\n return false;\n }\n return addNodeTo(base, options.cssClasses.connect);\n }\n // Add handles to the slider base.\n function addElements(connectOptions, base) {\n scope_Handles = [];\n scope_Connects = [];\n scope_Connects.push(addConnect(base, connectOptions[0]));\n // [::::O====O====O====]\n // connectOptions = [0, 1, 1, 1]\n for (var i = 0; i < options.handles; i++) {\n // Keep a list of all added handles.\n scope_Handles.push(addOrigin(base, i));\n scope_HandleNumbers[i] = i;\n scope_Connects.push(addConnect(base, connectOptions[i + 1]));\n }\n }\n // Initialize a single slider.\n function addSlider(target) {\n // Apply classes and data to the target.\n addClass(target, options.cssClasses.target);\n if (options.dir === 0) {\n addClass(target, options.cssClasses.ltr);\n }\n else {\n addClass(target, options.cssClasses.rtl);\n }\n if (options.ort === 0) {\n addClass(target, options.cssClasses.horizontal);\n }\n else {\n addClass(target, options.cssClasses.vertical);\n }\n scope_Base = addNodeTo(target, options.cssClasses.base);\n }\n function addTooltip(handle, handleNumber) {\n if (!options.tooltips[handleNumber]) {\n return false;\n }\n return addNodeTo(handle.firstChild, options.cssClasses.tooltip);\n }\n // The tooltips option is a shorthand for using the 'update' event.\n function tooltips() {\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n bindEvent('update', function (values, handleNumber, unencoded) {\n if (!tips[handleNumber]) {\n return;\n }\n var formattedValue = values[handleNumber];\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n tips[handleNumber].innerHTML = formattedValue;\n });\n }\n function aria() {\n bindEvent('update', function (values, handleNumber, unencoded, tap, positions) {\n // Update Aria Values for all handles, as a change in one changes min and max values for the next.\n scope_HandleNumbers.forEach(function (handleNumber) {\n var handle = scope_Handles[handleNumber];\n var min = checkHandlePosition(scope_Locations, handleNumber, 0, true, true, true);\n var max = checkHandlePosition(scope_Locations, handleNumber, 100, true, true, true);\n var now = positions[handleNumber];\n var text = options.ariaFormat.to(unencoded[handleNumber]);\n handle.children[0].setAttribute('aria-valuemin', min.toFixed(1));\n handle.children[0].setAttribute('aria-valuemax', max.toFixed(1));\n handle.children[0].setAttribute('aria-valuenow', now.toFixed(1));\n handle.children[0].setAttribute('aria-valuetext', text);\n });\n });\n }\n function getGroup(mode, values, stepped) {\n // Use the range.\n if (mode === 'range' || mode === 'steps') {\n return scope_Spectrum.xVal;\n }\n if (mode === 'count') {\n if (!values) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): 'values' required for mode 'count'.\");\n }\n // Divide 0 - 100 in 'count' parts.\n var spread = (100 / (values - 1));\n var v;\n var i = 0;\n values = [];\n // List these parts and have them handled as 'positions'.\n while ((v = i++ * spread) <= 100) {\n values.push(v);\n }\n mode = 'positions';\n }\n if (mode === 'positions') {\n // Map all percentages to on-range values.\n return values.map(function (value) {\n return scope_Spectrum.fromStepping(stepped ? scope_Spectrum.getStep(value) : value);\n });\n }\n if (mode === 'values') {\n // If the value must be stepped, it needs to be converted to a percentage first.\n if (stepped) {\n return values.map(function (value) {\n // Convert to percentage, apply step, return to value.\n return scope_Spectrum.fromStepping(scope_Spectrum.getStep(scope_Spectrum.toStepping(value)));\n });\n }\n // Otherwise, we can simply use the values.\n return values;\n }\n }\n function generateSpread(density, mode, group) {\n function safeIncrement(value, increment) {\n // Avoid floating point variance by dropping the smallest decimal places.\n return (value + increment).toFixed(7) / 1;\n }\n var indexes = {};\n var firstInRange = scope_Spectrum.xVal[0];\n var lastInRange = scope_Spectrum.xVal[scope_Spectrum.xVal.length - 1];\n var ignoreFirst = false;\n var ignoreLast = false;\n var prevPct = 0;\n // Create a copy of the group, sort it and filter away all duplicates.\n group = unique(group.slice().sort(function (a, b) { return a - b; }));\n // Make sure the range starts with the first element.\n if (group[0] !== firstInRange) {\n group.unshift(firstInRange);\n ignoreFirst = true;\n }\n // Likewise for the last one.\n if (group[group.length - 1] !== lastInRange) {\n group.push(lastInRange);\n ignoreLast = true;\n }\n group.forEach(function (current, index) {\n // Get the current step and the lower + upper positions.\n var step;\n var i;\n var q;\n var low = current;\n var high = group[index + 1];\n var newPct;\n var pctDifference;\n var pctPos;\n var type;\n var steps;\n var realSteps;\n var stepsize;\n // When using 'steps' mode, use the provided steps.\n // Otherwise, we'll step on to the next subrange.\n if (mode === 'steps') {\n step = scope_Spectrum.xNumSteps[index];\n }\n // Default to a 'full' step.\n if (!step) {\n step = high - low;\n }\n // Low can be 0, so test for false. If high is undefined,\n // we are at the last subrange. Index 0 is already handled.\n if (low === false || high === undefined) {\n return;\n }\n // Make sure step isn't 0, which would cause an infinite loop (#654)\n step = Math.max(step, 0.0000001);\n // Find all steps in the subrange.\n for (i = low; i <= high; i = safeIncrement(i, step)) {\n // Get the percentage value for the current step,\n // calculate the size for the subrange.\n newPct = scope_Spectrum.toStepping(i);\n pctDifference = newPct - prevPct;\n steps = pctDifference / density;\n realSteps = Math.round(steps);\n // This ratio represents the ammount of percentage-space a point indicates.\n // For a density 1 the points/percentage = 1. For density 2, that percentage needs to be re-devided.\n // Round the percentage offset to an even number, then divide by two\n // to spread the offset on both sides of the range.\n stepsize = pctDifference / realSteps;\n // Divide all points evenly, adding the correct number to this subrange.\n // Run up to <= so that 100% gets a point, event if ignoreLast is set.\n for (q = 1; q <= realSteps; q += 1) {\n // The ratio between the rounded value and the actual size might be ~1% off.\n // Correct the percentage offset by the number of points\n // per subrange. density = 1 will result in 100 points on the\n // full range, 2 for 50, 4 for 25, etc.\n pctPos = prevPct + (q * stepsize);\n indexes[pctPos.toFixed(5)] = ['x', 0];\n }\n // Determine the point type.\n type = (group.indexOf(i) > -1) ? 1 : (mode === 'steps' ? 2 : 0);\n // Enforce the 'ignoreFirst' option by overwriting the type for 0.\n if (!index && ignoreFirst) {\n type = 0;\n }\n if (!(i === high && ignoreLast)) {\n // Mark the 'type' of this point. 0 = plain, 1 = real value, 2 = step value.\n indexes[newPct.toFixed(5)] = [i, type];\n }\n // Update the percentage count.\n prevPct = newPct;\n }\n });\n return indexes;\n }\n function addMarking(spread, filterFunc, formatter) {\n var element = scope_Document.createElement('div');\n var valueSizeClasses = [\n options.cssClasses.valueNormal,\n options.cssClasses.valueLarge,\n options.cssClasses.valueSub\n ];\n var markerSizeClasses = [\n options.cssClasses.markerNormal,\n options.cssClasses.markerLarge,\n options.cssClasses.markerSub\n ];\n var valueOrientationClasses = [\n options.cssClasses.valueHorizontal,\n options.cssClasses.valueVertical\n ];\n var markerOrientationClasses = [\n options.cssClasses.markerHorizontal,\n options.cssClasses.markerVertical\n ];\n addClass(element, options.cssClasses.pips);\n addClass(element, options.ort === 0 ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical);\n function getClasses(type, source) {\n var a = source === options.cssClasses.value;\n var orientationClasses = a ? valueOrientationClasses : markerOrientationClasses;\n var sizeClasses = a ? valueSizeClasses : markerSizeClasses;\n return source + ' ' + orientationClasses[options.ort] + ' ' + sizeClasses[type];\n }\n function addSpread(offset, values) {\n // Apply the filter function, if it is set.\n values[1] = (values[1] && filterFunc) ? filterFunc(values[0], values[1]) : values[1];\n // Add a marker for every point\n var node = addNodeTo(element, false);\n node.className = getClasses(values[1], options.cssClasses.marker);\n node.style[options.style] = offset + '%';\n // Values are only appended for points marked '1' or '2'.\n if (values[1]) {\n node = addNodeTo(element, false);\n node.className = getClasses(values[1], options.cssClasses.value);\n node.style[options.style] = offset + '%';\n node.innerText = formatter.to(values[0]);\n }\n }\n // Append all points.\n Object.keys(spread).forEach(function (a) {\n addSpread(a, spread[a]);\n });\n return element;\n }\n function removePips() {\n if (scope_Pips) {\n removeElement(scope_Pips);\n scope_Pips = null;\n }\n }\n function pips(grid) {\n // Fix #669\n removePips();\n var mode = grid.mode;\n var density = grid.density || 1;\n var filter = grid.filter || false;\n var values = grid.values || false;\n var stepped = grid.stepped || false;\n var group = getGroup(mode, values, stepped);\n var spread = generateSpread(density, mode, group);\n var format = grid.format || {\n to: Math.round\n };\n scope_Pips = scope_Target.appendChild(addMarking(spread, filter, format));\n return scope_Pips;\n }\n // Shorthand for base dimensions.\n function baseSize() {\n var rect = scope_Base.getBoundingClientRect(), alt = 'offset' + ['Width', 'Height'][options.ort];\n return options.ort === 0 ? (rect.width || scope_Base[alt]) : (rect.height || scope_Base[alt]);\n }\n // Handler for attaching events trough a proxy.\n function attachEvent(events, element, callback, data) {\n // This function can be used to 'filter' events to the slider.\n // element is a node, not a nodeList\n var method = function (e) {\n if (scope_Target.hasAttribute('disabled')) {\n return false;\n }\n // Stop if an active 'tap' transition is taking place.\n if (hasClass(scope_Target, options.cssClasses.tap)) {\n return false;\n }\n e = fixEvent(e, data.pageOffset, data.target || element);\n // Handle reject of multitouch\n if (!e) {\n return false;\n }\n // Ignore right or middle clicks on start #454\n if (events === actions.start && e.buttons !== undefined && e.buttons > 1) {\n return false;\n }\n // Ignore right or middle clicks on start #454\n if (data.hover && e.buttons) {\n return false;\n }\n // 'supportsPassive' is only true if a browser also supports touch-action: none in CSS.\n // iOS safari does not, so it doesn't get to benefit from passive scrolling. iOS does support\n // touch-action: manipulation, but that allows panning, which breaks\n // sliders after zooming/on non-responsive pages.\n // See: https://bugs.webkit.org/show_bug.cgi?id=133112\n if (!supportsPassive) {\n e.preventDefault();\n }\n e.calcPoint = e.points[options.ort];\n // Call the event handler with the event [ and additional data ].\n callback(e, data);\n };\n var methods = [];\n // Bind a closure on the target for every event type.\n events.split(' ').forEach(function (eventName) {\n element.addEventListener(eventName, method, supportsPassive ? { passive: true } : false);\n methods.push([eventName, method]);\n });\n return methods;\n }\n // Provide a clean event with standardized offset values.\n function fixEvent(e, pageOffset, target) {\n // Filter the event to register the type, which can be\n // touch, mouse or pointer. Offset changes need to be\n // made on an event specific basis.\n var touch = e.type.indexOf('touch') === 0;\n var mouse = e.type.indexOf('mouse') === 0;\n var pointer = e.type.indexOf('pointer') === 0;\n var x;\n var y;\n // IE10 implemented pointer events with a prefix;\n if (e.type.indexOf('MSPointer') === 0) {\n pointer = true;\n }\n // In the event that multitouch is activated, the only thing one handle should be concerned\n // about is the touches that originated on top of it.\n if (touch && options.multitouch) {\n // Returns true if a touch originated on the target.\n var isTouchOnTarget = function (touch) {\n return touch.target === target || target.contains(touch.target);\n };\n // In the case of touchstart events, we need to make sure there is still no more than one\n // touch on the target so we look amongst all touches.\n if (e.type === 'touchstart') {\n var targetTouches = Array.prototype.filter.call(e.touches, isTouchOnTarget);\n // Do not support more than one touch per handle.\n if (targetTouches.length > 1) {\n return false;\n }\n x = targetTouches[0].pageX;\n y = targetTouches[0].pageY;\n }\n else {\n // In the other cases, find on changedTouches is enough.\n var targetTouch = Array.prototype.find.call(e.changedTouches, isTouchOnTarget);\n // Cancel if the target touch has not moved.\n if (!targetTouch) {\n return false;\n }\n x = targetTouch.pageX;\n y = targetTouch.pageY;\n }\n }\n else if (touch) {\n // Fix bug when user touches with two or more fingers on mobile devices.\n // It's useful when you have two or more sliders on one page,\n // that can be touched simultaneously.\n // #649, #663, #668\n if (e.touches.length > 1) {\n return false;\n }\n // noUiSlider supports one movement at a time,\n // so we can select the first 'changedTouch'.\n x = e.changedTouches[0].pageX;\n y = e.changedTouches[0].pageY;\n }\n pageOffset = pageOffset || getPageOffset(scope_Document);\n if (mouse || pointer) {\n x = e.clientX + pageOffset.x;\n y = e.clientY + pageOffset.y;\n }\n e.pageOffset = pageOffset;\n e.points = [x, y];\n e.cursor = mouse || pointer; // Fix #435\n return e;\n }\n // Translate a coordinate in the document to a percentage on the slider\n function calcPointToPercentage(calcPoint) {\n var location = calcPoint - offset(scope_Base, options.ort);\n var proposal = (location * 100) / baseSize();\n return options.dir ? 100 - proposal : proposal;\n }\n // Find handle closest to a certain percentage on the slider\n function getClosestHandle(proposal) {\n var closest = 100;\n var handleNumber = false;\n scope_Handles.forEach(function (handle, index) {\n // Disabled handles are ignored\n if (handle.hasAttribute('disabled')) {\n return;\n }\n var pos = Math.abs(scope_Locations[index] - proposal);\n if (pos < closest) {\n handleNumber = index;\n closest = pos;\n }\n });\n return handleNumber;\n }\n // Moves handle(s) by a percentage\n // (bool, % to move, [% where handle started, ...], [index in scope_Handles, ...])\n function moveHandles(upward, proposal, locations, handleNumbers) {\n var proposals = locations.slice();\n var b = [!upward, upward];\n var f = [upward, !upward];\n // Copy handleNumbers so we don't change the dataset\n handleNumbers = handleNumbers.slice();\n // Check to see which handle is 'leading'.\n // If that one can't move the second can't either.\n if (upward) {\n handleNumbers.reverse();\n }\n // Step 1: get the maximum percentage that any of the handles can move\n if (handleNumbers.length > 1) {\n handleNumbers.forEach(function (handleNumber, o) {\n var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false);\n // Stop if one of the handles can't move.\n if (to === false) {\n proposal = 0;\n }\n else {\n proposal = to - proposals[handleNumber];\n proposals[handleNumber] = to;\n }\n });\n }\n // If using one handle, check backward AND forward\n else {\n b = f = [true];\n }\n var state = false;\n // Step 2: Try to set the handles with the found percentage\n handleNumbers.forEach(function (handleNumber, o) {\n state = setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o]) || state;\n });\n // Step 3: If a handle moved, fire events\n if (state) {\n handleNumbers.forEach(function (handleNumber) {\n fireEvent('update', handleNumber);\n fireEvent('slide', handleNumber);\n });\n }\n }\n // External event handling\n function fireEvent(eventName, handleNumber, tap) {\n Object.keys(scope_Events).forEach(function (targetEvent) {\n var eventType = targetEvent.split('.')[0];\n if (eventName === eventType) {\n scope_Events[targetEvent].forEach(function (callback) {\n callback.call(\n // Use the slider public API as the scope ('this')\n scope_Self, \n // Return values as array, so arg_1[arg_2] is always valid.\n scope_Values.map(options.format.to), \n // Handle index, 0 or 1\n handleNumber, \n // Unformatted slider values\n scope_Values.slice(), \n // Event is fired by tap, true or false\n tap || false, \n // Left offset of the handle, in relation to the slider\n scope_Locations.slice());\n });\n }\n });\n }\n // Fire 'end' when a mouse or pen leaves the document.\n function documentLeave(event, data) {\n if (event.type === \"mouseout\" && event.target.nodeName === \"HTML\" && event.relatedTarget === null) {\n eventEnd(event, data);\n }\n }\n // Handle movement on document for handle and range drag.\n function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }\n // Unbind move events on document, call callbacks.\n function eventEnd(event, data) {\n // The handle is no longer active, so remove the class.\n if (data.handle) {\n removeClass(data.handle, options.cssClasses.active);\n scope_ActiveHandlesCount -= 1;\n }\n // Unbind the move and end events, which are added on 'start'.\n data.listeners.forEach(function (c) {\n scope_DocumentElement.removeEventListener(c[0], c[1]);\n });\n if (scope_ActiveHandlesCount === 0) {\n // Remove dragging class.\n removeClass(scope_Target, options.cssClasses.drag);\n setZindex();\n // Remove cursor styles and text-selection events bound to the body.\n if (event.cursor) {\n scope_Body.style.cursor = '';\n scope_Body.removeEventListener('selectstart', preventDefault);\n }\n }\n data.handleNumbers.forEach(function (handleNumber) {\n fireEvent('change', handleNumber);\n fireEvent('set', handleNumber);\n fireEvent('end', handleNumber);\n });\n }\n // Bind move events on document.\n function eventStart(event, data) {\n var handle;\n if (data.handleNumbers.length === 1) {\n var handleOrigin = scope_Handles[data.handleNumbers[0]];\n // Ignore 'disabled' handles\n if (handleOrigin.hasAttribute('disabled')) {\n return false;\n }\n handle = handleOrigin.children[0];\n scope_ActiveHandlesCount += 1;\n // Mark the handle as 'active' so it can be styled.\n addClass(handle, options.cssClasses.active);\n }\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n // Record the event listeners.\n var listeners = [];\n // Attach the move and end events.\n var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {\n // The event target has changed so we need to propagate the original one so that we keep\n // relying on it to extract target touches.\n target: event.target,\n handle: handle,\n listeners: listeners,\n startCalcPoint: event.calcPoint,\n baseSize: baseSize(),\n pageOffset: event.pageOffset,\n handleNumbers: data.handleNumbers,\n buttonsProperty: event.buttons,\n locations: scope_Locations.slice()\n });\n var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n handleNumbers: data.handleNumbers\n });\n var outEvent = attachEvent(\"mouseout\", scope_DocumentElement, documentLeave, {\n target: event.target,\n handle: handle,\n listeners: listeners,\n handleNumbers: data.handleNumbers\n });\n // We want to make sure we pushed the listeners in the listener list rather than creating\n // a new one as it has already been passed to the event handlers.\n listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));\n // Text selection isn't an issue on touch devices,\n // so adding cursor styles can be skipped.\n if (event.cursor) {\n // Prevent the 'I' cursor and extend the range-drag cursor.\n scope_Body.style.cursor = getComputedStyle(event.target).cursor;\n // Mark the target with a dragging state.\n if (scope_Handles.length > 1) {\n addClass(scope_Target, options.cssClasses.drag);\n }\n // Prevent text selection when dragging the handles.\n // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,\n // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,\n // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.\n // The 'cursor' flag is false.\n // See: http://caniuse.com/#search=selectstart\n scope_Body.addEventListener('selectstart', preventDefault, false);\n }\n data.handleNumbers.forEach(function (handleNumber) {\n fireEvent('start', handleNumber);\n });\n }\n // Move closest handle to tapped location.\n function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n setHandle(handleNumber, proposal, true, true);\n setZindex();\n fireEvent('slide', handleNumber, true);\n fireEvent('update', handleNumber, true);\n fireEvent('change', handleNumber, true);\n fireEvent('set', handleNumber, true);\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }\n // Fires a 'hover' event for a hovered mouse/pen position.\n function eventHover(event) {\n var proposal = calcPointToPercentage(event.calcPoint);\n var to = scope_Spectrum.getStep(proposal);\n var value = scope_Spectrum.fromStepping(to);\n Object.keys(scope_Events).forEach(function (targetEvent) {\n if ('hover' === targetEvent.split('.')[0]) {\n scope_Events[targetEvent].forEach(function (callback) {\n callback.call(scope_Self, value);\n });\n }\n });\n }\n // Attach events to several slider parts.\n function bindSliderEvents(behaviour) {\n // Attach the standard drag event to the handles.\n if (!behaviour.fixed) {\n scope_Handles.forEach(function (handle, index) {\n // These events are only bound to the visual handle\n // element, not the 'real' origin element.\n attachEvent(actions.start, handle.children[0], eventStart, {\n handleNumbers: [index]\n });\n });\n }\n // Attach the tap event to the slider base.\n if (behaviour.tap) {\n attachEvent(actions.start, scope_Base, eventTap, {});\n }\n // Fire hover events\n if (behaviour.hover) {\n attachEvent(actions.move, scope_Base, eventHover, { hover: true });\n }\n // Make the range draggable.\n if (behaviour.drag) {\n scope_Connects.forEach(function (connect, index) {\n if (connect === false || index === 0 || index === scope_Connects.length - 1) {\n return;\n }\n var handleBefore = scope_Handles[index - 1];\n var handleAfter = scope_Handles[index];\n var eventHolders = [connect];\n addClass(connect, options.cssClasses.draggable);\n // When the range is fixed, the entire range can\n // be dragged by the handles. The handle in the first\n // origin will propagate the start event upward,\n // but it needs to be bound manually on the other.\n if (behaviour.fixed) {\n eventHolders.push(handleBefore.children[0]);\n eventHolders.push(handleAfter.children[0]);\n }\n eventHolders.forEach(function (eventHolder) {\n attachEvent(actions.start, eventHolder, eventStart, {\n handles: [handleBefore, handleAfter],\n handleNumbers: [index - 1, index]\n });\n });\n });\n }\n }\n // Split out the handle positioning logic so the Move event can use it, too\n function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue) {\n // For sliders with multiple handles, limit movement to the other handle.\n // Apply the margin option by adding it to the handle positions.\n if (scope_Handles.length > 1) {\n if (lookBackward && handleNumber > 0) {\n to = Math.max(to, reference[handleNumber - 1] + options.margin);\n }\n if (lookForward && handleNumber < scope_Handles.length - 1) {\n to = Math.min(to, reference[handleNumber + 1] - options.margin);\n }\n }\n // The limit option has the opposite effect, limiting handles to a\n // maximum distance from another. Limit must be > 0, as otherwise\n // handles would be unmoveable.\n if (scope_Handles.length > 1 && options.limit) {\n if (lookBackward && handleNumber > 0) {\n to = Math.min(to, reference[handleNumber - 1] + options.limit);\n }\n if (lookForward && handleNumber < scope_Handles.length - 1) {\n to = Math.max(to, reference[handleNumber + 1] - options.limit);\n }\n }\n // The padding option keeps the handles a certain distance from the\n // edges of the slider. Padding must be > 0.\n if (options.padding) {\n if (handleNumber === 0) {\n to = Math.max(to, options.padding);\n }\n if (handleNumber === scope_Handles.length - 1) {\n to = Math.min(to, 100 - options.padding);\n }\n }\n to = scope_Spectrum.getStep(to);\n // Limit percentage to the 0 - 100 range\n to = limit(to);\n // Return false if handle can't move\n if (to === reference[handleNumber] && !getValue) {\n return false;\n }\n return to;\n }\n function toPct(pct) {\n return pct + '%';\n }\n // Updates scope_Locations and scope_Values, updates visual state\n function updateHandlePosition(handleNumber, to) {\n // Update locations.\n scope_Locations[handleNumber] = to;\n // Convert the value to the slider stepping/range.\n scope_Values[handleNumber] = scope_Spectrum.fromStepping(to);\n // Called synchronously or on the next animationFrame\n var stateUpdate = function () {\n scope_Handles[handleNumber].style[options.style] = toPct(to);\n updateConnect(handleNumber);\n updateConnect(handleNumber + 1);\n };\n // Set the handle to the new position.\n // Use requestAnimationFrame for efficient painting.\n // No significant effect in Chrome, Edge sees dramatic performace improvements.\n // Option to disable is useful for unit tests, and single-step debugging.\n if (window.requestAnimationFrame && options.useRequestAnimationFrame) {\n window.requestAnimationFrame(stateUpdate);\n }\n else {\n stateUpdate();\n }\n }\n function setZindex() {\n scope_HandleNumbers.forEach(function (handleNumber) {\n // Handles before the slider middle are stacked later = higher,\n // Handles after the middle later is lower\n // [[7] [8] .......... | .......... [5] [4]\n var dir = (scope_Locations[handleNumber] > 50 ? -1 : 1);\n var zIndex = 3 + (scope_Handles.length + (dir * handleNumber));\n scope_Handles[handleNumber].childNodes[0].style.zIndex = zIndex;\n });\n }\n // Test suggested values and apply margin, step.\n function setHandle(handleNumber, to, lookBackward, lookForward) {\n to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false);\n if (to === false) {\n return false;\n }\n updateHandlePosition(handleNumber, to);\n return true;\n }\n // Updates style attribute for connect nodes\n function updateConnect(index) {\n // Skip connects set to false\n if (!scope_Connects[index]) {\n return;\n }\n var l = 0;\n var h = 100;\n if (index !== 0) {\n l = scope_Locations[index - 1];\n }\n if (index !== scope_Connects.length - 1) {\n h = scope_Locations[index];\n }\n scope_Connects[index].style[options.style] = toPct(l);\n scope_Connects[index].style[options.styleOposite] = toPct(100 - h);\n }\n // ...\n function setValue(to, handleNumber) {\n // Setting with null indicates an 'ignore'.\n // Inputting 'false' is invalid.\n if (to === null || to === false) {\n return;\n }\n // If a formatted number was passed, attemt to decode it.\n if (typeof to === 'number') {\n to = String(to);\n }\n to = options.format.from(to);\n // Request an update for all links if the value was invalid.\n // Do so too if setting the handle fails.\n if (to !== false && !isNaN(to)) {\n setHandle(handleNumber, scope_Spectrum.toStepping(to), false, false);\n }\n }\n // Set the slider value.\n function valueSet(input, fireSetEvent) {\n var values = asArray(input);\n var isInit = scope_Locations[0] === undefined;\n // Event fires by default\n fireSetEvent = (fireSetEvent === undefined ? true : !!fireSetEvent);\n values.forEach(setValue);\n // Animation is optional.\n // Make sure the initial values were set before using animated placement.\n if (options.animate && !isInit) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n // Now that all base values are set, apply constraints\n scope_HandleNumbers.forEach(function (handleNumber) {\n setHandle(handleNumber, scope_Locations[handleNumber], true, false);\n });\n setZindex();\n scope_HandleNumbers.forEach(function (handleNumber) {\n fireEvent('update', handleNumber);\n // Fire the event only for handles that received a new value, as per #579\n if (values[handleNumber] !== null && fireSetEvent) {\n fireEvent('set', handleNumber);\n }\n });\n }\n // Reset slider to initial values\n function valueReset(fireSetEvent) {\n valueSet(options.start, fireSetEvent);\n }\n // Get the slider value.\n function valueGet() {\n var values = scope_Values.map(options.format.to);\n // If only one handle is used, return a single value.\n if (values.length === 1) {\n return values[0];\n }\n return values;\n }\n // Removes classes from the root and empties it.\n function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n delete scope_Target.noUiSlider;\n }\n // Get the current step size for the slider.\n function getCurrentStep() {\n // Check all locations, map them to their stepping point.\n // Get the step point, then find it in the input list.\n return scope_Locations.map(function (location, index) {\n var nearbySteps = scope_Spectrum.getNearbySteps(location);\n var value = scope_Values[index];\n var increment = nearbySteps.thisStep.step;\n var decrement = null;\n // If the next value in this step moves into the next step,\n // the increment is the start of the next step - the current value\n if (increment !== false) {\n if (value + increment > nearbySteps.stepAfter.startValue) {\n increment = nearbySteps.stepAfter.startValue - value;\n }\n }\n // If the value is beyond the starting point\n if (value > nearbySteps.thisStep.startValue) {\n decrement = nearbySteps.thisStep.step;\n }\n else if (nearbySteps.stepBefore.step === false) {\n decrement = false;\n }\n // If a handle is at the start of a step, it always steps back into the previous step first\n else {\n decrement = value - nearbySteps.stepBefore.highestStep;\n }\n // Now, if at the slider edges, there is not in/decrement\n if (location === 100) {\n increment = null;\n }\n else if (location === 0) {\n decrement = null;\n }\n // As per #391, the comparison for the decrement step can have some rounding issues.\n var stepDecimals = scope_Spectrum.countStepDecimals();\n // Round per #391\n if (increment !== null && increment !== false) {\n increment = Number(increment.toFixed(stepDecimals));\n }\n if (decrement !== null && decrement !== false) {\n decrement = Number(decrement.toFixed(stepDecimals));\n }\n return [decrement, increment];\n });\n }\n // Attach an event to this slider, possibly including a namespace\n function bindEvent(namespacedEvent, callback) {\n scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [];\n scope_Events[namespacedEvent].push(callback);\n // If the event bound is 'update,' fire it immediately for all handles.\n if (namespacedEvent.split('.')[0] === 'update') {\n scope_Handles.forEach(function (a, index) {\n fireEvent('update', index);\n });\n }\n }\n // Undo attachment of event\n function removeEvent(namespacedEvent) {\n var event = namespacedEvent && namespacedEvent.split('.')[0];\n var namespace = event && namespacedEvent.substring(event.length);\n Object.keys(scope_Events).forEach(function (bind) {\n var tEvent = bind.split('.')[0], tNamespace = bind.substring(tEvent.length);\n if ((!event || event === tEvent) && (!namespace || namespace === tNamespace)) {\n delete scope_Events[bind];\n }\n });\n }\n // Updateable: margin, limit, padding, step, range, animate, snap\n function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n var updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\n // Only change options that we're actually passed to update.\n updateAble.forEach(function (name) {\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n var newOptions = testOptions(originalOptions);\n // Load new options into the slider state\n updateAble.forEach(function (name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n scope_Spectrum = newOptions.spectrum;\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n }\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }\n // Throw an error if the slider was already initialized.\n if (scope_Target.noUiSlider) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): Slider was already initialized.\");\n }\n // Create the base element, initialise HTML and set classes.\n // Add handles and connect elements.\n addSlider(scope_Target);\n addElements(options.connect, scope_Base);\n scope_Self = {\n destroy: destroy,\n steps: getCurrentStep,\n on: bindEvent,\n off: removeEvent,\n get: valueGet,\n set: valueSet,\n reset: valueReset,\n // Exposed for unit testing, don't use this in your application.\n __moveHandles: function (a, b, c) { moveHandles(a, b, scope_Locations, c); },\n options: originalOptions,\n updateOptions: updateOptions,\n target: scope_Target,\n removePips: removePips,\n pips: pips // Issue #594\n };\n // Attach user events.\n bindSliderEvents(options.events);\n // Use the public value method to set the start values.\n valueSet(options.start);\n if (options.pips) {\n pips(options.pips);\n }\n if (options.tooltips) {\n tooltips();\n }\n aria();\n return scope_Self;\n }\n // Run the standard initializer\n function initialize(target, originalOptions) {\n if (!target || !target.nodeName) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): create requires a single element, got: \" + target);\n }\n // Test the options and create the slider environment;\n var options = testOptions(originalOptions, target);\n var api = closure(target, options, originalOptions);\n target.noUiSlider = api;\n return api;\n }\n // Use an object instead of a function for future expansibility;\n return {\n version: VERSION,\n create: initialize\n };\n }));\n}\n","/* pikaday/pikaday */ function _(require, module, exports) {\n /*!\n * Pikaday\n *\n * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday\n */\n (function (root, factory) {\n 'use strict';\n var moment;\n if (typeof exports === 'object') {\n // CommonJS module\n // Load moment.js as an optional dependency\n try {\n moment = require('moment');\n }\n catch (e) { }\n module.exports = factory(moment);\n }\n else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(function (req) {\n // Load moment.js as an optional dependency\n var id = 'moment';\n try {\n moment = req(id);\n }\n catch (e) { }\n return factory(moment);\n });\n }\n else {\n root.Pikaday = factory(root.moment);\n }\n }(this, function (moment) {\n 'use strict';\n /**\n * feature detection and helper functions\n */\n var hasMoment = typeof moment === 'function', hasEventListeners = !!window.addEventListener, document = window.document, sto = window.setTimeout, addEvent = function (el, e, callback, capture) {\n if (hasEventListeners) {\n el.addEventListener(e, callback, !!capture);\n }\n else {\n el.attachEvent('on' + e, callback);\n }\n }, removeEvent = function (el, e, callback, capture) {\n if (hasEventListeners) {\n el.removeEventListener(e, callback, !!capture);\n }\n else {\n el.detachEvent('on' + e, callback);\n }\n }, trim = function (str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n }, hasClass = function (el, cn) {\n return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;\n }, addClass = function (el, cn) {\n if (!hasClass(el, cn)) {\n el.className = (el.className === '') ? cn : el.className + ' ' + cn;\n }\n }, removeClass = function (el, cn) {\n el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));\n }, isArray = function (obj) {\n return (/Array/).test(Object.prototype.toString.call(obj));\n }, isDate = function (obj) {\n return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());\n }, isWeekend = function (date) {\n var day = date.getDay();\n return day === 0 || day === 6;\n }, isLeapYear = function (year) {\n // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n }, getDaysInMonth = function (year, month) {\n return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];\n }, setToStartOfDay = function (date) {\n if (isDate(date))\n date.setHours(0, 0, 0, 0);\n }, compareDates = function (a, b) {\n // weak date comparison (use setToStartOfDay(date) to ensure correct result)\n return a.getTime() === b.getTime();\n }, extend = function (to, from, overwrite) {\n var prop, hasProp;\n for (prop in from) {\n hasProp = to[prop] !== undefined;\n if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) {\n if (isDate(from[prop])) {\n if (overwrite) {\n to[prop] = new Date(from[prop].getTime());\n }\n }\n else if (isArray(from[prop])) {\n if (overwrite) {\n to[prop] = from[prop].slice(0);\n }\n }\n else {\n to[prop] = extend({}, from[prop], overwrite);\n }\n }\n else if (overwrite || !hasProp) {\n to[prop] = from[prop];\n }\n }\n return to;\n }, fireEvent = function (el, eventName, data) {\n var ev;\n if (document.createEvent) {\n ev = document.createEvent('HTMLEvents');\n ev.initEvent(eventName, true, false);\n ev = extend(ev, data);\n el.dispatchEvent(ev);\n }\n else if (document.createEventObject) {\n ev = document.createEventObject();\n ev = extend(ev, data);\n el.fireEvent('on' + eventName, ev);\n }\n }, adjustCalendar = function (calendar) {\n if (calendar.month < 0) {\n calendar.year -= Math.ceil(Math.abs(calendar.month) / 12);\n calendar.month += 12;\n }\n if (calendar.month > 11) {\n calendar.year += Math.floor(Math.abs(calendar.month) / 12);\n calendar.month -= 12;\n }\n return calendar;\n }, \n /**\n * defaults and localisation\n */\n defaults = {\n // bind the picker to a form field\n field: null,\n // automatically show/hide the picker on `field` focus (default `true` if `field` is set)\n bound: undefined,\n // position of the datepicker, relative to the field (default to bottom & left)\n // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)\n position: 'bottom left',\n // automatically fit in the viewport even if it means repositioning from the position option\n reposition: true,\n // the default output format for `.toString()` and `field` value\n format: 'YYYY-MM-DD',\n // the toString function which gets passed a current date object and format\n // and returns a string\n toString: null,\n // used to create date object from current input string\n parse: null,\n // the initial date to view when first opened\n defaultDate: null,\n // make the `defaultDate` the initial selected value\n setDefaultDate: false,\n // first day of week (0: Sunday, 1: Monday etc)\n firstDay: 0,\n // the default flag for moment's strict date parsing\n formatStrict: false,\n // the minimum/earliest date that can be selected\n minDate: null,\n // the maximum/latest date that can be selected\n maxDate: null,\n // number of years either side, or array of upper/lower range\n yearRange: 10,\n // show week numbers at head of row\n showWeekNumber: false,\n // Week picker mode\n pickWholeWeek: false,\n // used internally (don't config outside)\n minYear: 0,\n maxYear: 9999,\n minMonth: undefined,\n maxMonth: undefined,\n startRange: null,\n endRange: null,\n isRTL: false,\n // Additional text to append to the year in the calendar title\n yearSuffix: '',\n // Render the month after year in the calendar title\n showMonthAfterYear: false,\n // Render days of the calendar grid that fall in the next or previous month\n showDaysInNextAndPreviousMonths: false,\n // Allows user to select days that fall in the next or previous month\n enableSelectionDaysInNextAndPreviousMonths: false,\n // how many months are visible\n numberOfMonths: 1,\n // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)\n // only used for the first display or when a selected date is not visible\n mainCalendar: 'left',\n // Specify a DOM element to render the calendar in\n container: undefined,\n // Blur field when date is selected\n blurFieldOnSelect: true,\n // internationalization\n i18n: {\n previousMonth: 'Previous Month',\n nextMonth: 'Next Month',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n },\n // Theme Classname\n theme: null,\n // events array\n events: [],\n // callback function\n onSelect: null,\n onOpen: null,\n onClose: null,\n onDraw: null,\n // Enable keyboard input\n keyboardInput: true\n }, \n /**\n * templating functions to abstract HTML rendering\n */\n renderDayName = function (opts, day, abbr) {\n day += opts.firstDay;\n while (day >= 7) {\n day -= 7;\n }\n return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];\n }, renderDay = function (opts) {\n var arr = [];\n var ariaSelected = 'false';\n if (opts.isEmpty) {\n if (opts.showDaysInNextAndPreviousMonths) {\n arr.push('is-outside-current-month');\n if (!opts.enableSelectionDaysInNextAndPreviousMonths) {\n arr.push('is-selection-disabled');\n }\n }\n else {\n return '';\n }\n }\n if (opts.isDisabled) {\n arr.push('is-disabled');\n }\n if (opts.isToday) {\n arr.push('is-today');\n }\n if (opts.isSelected) {\n arr.push('is-selected');\n ariaSelected = 'true';\n }\n if (opts.hasEvent) {\n arr.push('has-event');\n }\n if (opts.isInRange) {\n arr.push('is-inrange');\n }\n if (opts.isStartRange) {\n arr.push('is-startrange');\n }\n if (opts.isEndRange) {\n arr.push('is-endrange');\n }\n return '' +\n '' +\n '';\n }, renderWeek = function (d, m, y) {\n // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified.\n var onejan = new Date(y, 0, 1), weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay() + 1) / 7);\n return '' + weekNum + '';\n }, renderRow = function (days, isRTL, pickWholeWeek, isRowSelected) {\n return '' + (isRTL ? days.reverse() : days).join('') + '';\n }, renderBody = function (rows) {\n return '' + rows.join('') + '';\n }, renderHead = function (opts) {\n var i, arr = [];\n if (opts.showWeekNumber) {\n arr.push('');\n }\n for (i = 0; i < 7; i++) {\n arr.push('' + renderDayName(opts, i, true) + '');\n }\n return '' + (opts.isRTL ? arr.reverse() : arr).join('') + '';\n }, renderTitle = function (instance, c, year, month, refYear, randId) {\n var i, j, arr, opts = instance._o, isMinYear = year === opts.minYear, isMaxYear = year === opts.maxYear, html = '
', monthHtml, yearHtml, prev = true, next = true;\n for (arr = [], i = 0; i < 12; i++) {\n arr.push('');\n }\n monthHtml = '
' + opts.i18n.months[month] + '
';\n if (isArray(opts.yearRange)) {\n i = opts.yearRange[0];\n j = opts.yearRange[1] + 1;\n }\n else {\n i = year - opts.yearRange;\n j = 1 + year + opts.yearRange;\n }\n for (arr = []; i < j && i <= opts.maxYear; i++) {\n if (i >= opts.minYear) {\n arr.push('');\n }\n }\n yearHtml = '
' + year + opts.yearSuffix + '
';\n if (opts.showMonthAfterYear) {\n html += yearHtml + monthHtml;\n }\n else {\n html += monthHtml + yearHtml;\n }\n if (isMinYear && (month === 0 || opts.minMonth >= month)) {\n prev = false;\n }\n if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {\n next = false;\n }\n if (c === 0) {\n html += '';\n }\n if (c === (instance._o.numberOfMonths - 1)) {\n html += '';\n }\n return html += '
';\n }, renderTable = function (opts, data, randId) {\n return '' + renderHead(opts) + renderBody(data) + '
';\n }, \n /**\n * Pikaday constructor\n */\n Pikaday = function (options) {\n var self = this, opts = self.config(options);\n self._onMouseDown = function (e) {\n if (!self._v) {\n return;\n }\n e = e || window.event;\n var target = e.target || e.srcElement;\n if (!target) {\n return;\n }\n if (!hasClass(target, 'is-disabled')) {\n if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty') && !hasClass(target.parentNode, 'is-disabled')) {\n self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));\n if (opts.bound) {\n sto(function () {\n self.hide();\n if (opts.blurFieldOnSelect && opts.field) {\n opts.field.blur();\n }\n }, 100);\n }\n }\n else if (hasClass(target, 'pika-prev')) {\n self.prevMonth();\n }\n else if (hasClass(target, 'pika-next')) {\n self.nextMonth();\n }\n }\n if (!hasClass(target, 'pika-select')) {\n // if this is touch event prevent mouse events emulation\n if (e.preventDefault) {\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n return false;\n }\n }\n else {\n self._c = true;\n }\n };\n self._onChange = function (e) {\n e = e || window.event;\n var target = e.target || e.srcElement;\n if (!target) {\n return;\n }\n if (hasClass(target, 'pika-select-month')) {\n self.gotoMonth(target.value);\n }\n else if (hasClass(target, 'pika-select-year')) {\n self.gotoYear(target.value);\n }\n };\n self._onKeyChange = function (e) {\n e = e || window.event;\n if (self.isVisible()) {\n switch (e.keyCode) {\n case 13:\n case 27:\n if (opts.field) {\n opts.field.blur();\n }\n break;\n case 37:\n e.preventDefault();\n self.adjustDate('subtract', 1);\n break;\n case 38:\n self.adjustDate('subtract', 7);\n break;\n case 39:\n self.adjustDate('add', 1);\n break;\n case 40:\n self.adjustDate('add', 7);\n break;\n }\n }\n };\n self._onInputChange = function (e) {\n var date;\n if (e.firedBy === self) {\n return;\n }\n if (opts.parse) {\n date = opts.parse(opts.field.value, opts.format);\n }\n else if (hasMoment) {\n date = moment(opts.field.value, opts.format, opts.formatStrict);\n date = (date && date.isValid()) ? date.toDate() : null;\n }\n else {\n date = new Date(Date.parse(opts.field.value));\n }\n if (isDate(date)) {\n self.setDate(date);\n }\n if (!self._v) {\n self.show();\n }\n };\n self._onInputFocus = function () {\n self.show();\n };\n self._onInputClick = function () {\n self.show();\n };\n self._onInputBlur = function () {\n // IE allows pika div to gain focus; catch blur the input field\n var pEl = document.activeElement;\n do {\n if (hasClass(pEl, 'pika-single')) {\n return;\n }\n } while ((pEl = pEl.parentNode));\n if (!self._c) {\n self._b = sto(function () {\n self.hide();\n }, 50);\n }\n self._c = false;\n };\n self._onClick = function (e) {\n e = e || window.event;\n var target = e.target || e.srcElement, pEl = target;\n if (!target) {\n return;\n }\n if (!hasEventListeners && hasClass(target, 'pika-select')) {\n if (!target.onchange) {\n target.setAttribute('onchange', 'return;');\n addEvent(target, 'change', self._onChange);\n }\n }\n do {\n if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) {\n return;\n }\n } while ((pEl = pEl.parentNode));\n if (self._v && target !== opts.trigger && pEl !== opts.trigger) {\n self.hide();\n }\n };\n self.el = document.createElement('div');\n self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : '');\n addEvent(self.el, 'mousedown', self._onMouseDown, true);\n addEvent(self.el, 'touchend', self._onMouseDown, true);\n addEvent(self.el, 'change', self._onChange);\n if (opts.keyboardInput) {\n addEvent(document, 'keydown', self._onKeyChange);\n }\n if (opts.field) {\n if (opts.container) {\n opts.container.appendChild(self.el);\n }\n else if (opts.bound) {\n document.body.appendChild(self.el);\n }\n else {\n opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);\n }\n addEvent(opts.field, 'change', self._onInputChange);\n if (!opts.defaultDate) {\n if (hasMoment && opts.field.value) {\n opts.defaultDate = moment(opts.field.value, opts.format).toDate();\n }\n else {\n opts.defaultDate = new Date(Date.parse(opts.field.value));\n }\n opts.setDefaultDate = true;\n }\n }\n var defDate = opts.defaultDate;\n if (isDate(defDate)) {\n if (opts.setDefaultDate) {\n self.setDate(defDate, true);\n }\n else {\n self.gotoDate(defDate);\n }\n }\n else {\n self.gotoDate(new Date());\n }\n if (opts.bound) {\n this.hide();\n self.el.className += ' is-bound';\n addEvent(opts.trigger, 'click', self._onInputClick);\n addEvent(opts.trigger, 'focus', self._onInputFocus);\n addEvent(opts.trigger, 'blur', self._onInputBlur);\n }\n else {\n this.show();\n }\n };\n /**\n * public Pikaday API\n */\n Pikaday.prototype = {\n /**\n * configure functionality\n */\n config: function (options) {\n if (!this._o) {\n this._o = extend({}, defaults, true);\n }\n var opts = extend(this._o, options, true);\n opts.isRTL = !!opts.isRTL;\n opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;\n opts.theme = (typeof opts.theme) === 'string' && opts.theme ? opts.theme : null;\n opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);\n opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;\n opts.disableWeekends = !!opts.disableWeekends;\n opts.disableDayFn = (typeof opts.disableDayFn) === 'function' ? opts.disableDayFn : null;\n var nom = parseInt(opts.numberOfMonths, 10) || 1;\n opts.numberOfMonths = nom > 4 ? 4 : nom;\n if (!isDate(opts.minDate)) {\n opts.minDate = false;\n }\n if (!isDate(opts.maxDate)) {\n opts.maxDate = false;\n }\n if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {\n opts.maxDate = opts.minDate = false;\n }\n if (opts.minDate) {\n this.setMinDate(opts.minDate);\n }\n if (opts.maxDate) {\n this.setMaxDate(opts.maxDate);\n }\n if (isArray(opts.yearRange)) {\n var fallback = new Date().getFullYear() - 10;\n opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;\n opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;\n }\n else {\n opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;\n if (opts.yearRange > 100) {\n opts.yearRange = 100;\n }\n }\n return opts;\n },\n /**\n * return a formatted string of the current selection (using Moment.js if available)\n */\n toString: function (format) {\n format = format || this._o.format;\n if (!isDate(this._d)) {\n return '';\n }\n if (this._o.toString) {\n return this._o.toString(this._d, format);\n }\n if (hasMoment) {\n return moment(this._d).format(format);\n }\n return this._d.toDateString();\n },\n /**\n * return a Moment.js object of the current selection (if available)\n */\n getMoment: function () {\n return hasMoment ? moment(this._d) : null;\n },\n /**\n * set the current selection from a Moment.js object (if available)\n */\n setMoment: function (date, preventOnSelect) {\n if (hasMoment && moment.isMoment(date)) {\n this.setDate(date.toDate(), preventOnSelect);\n }\n },\n /**\n * return a Date object of the current selection\n */\n getDate: function () {\n return isDate(this._d) ? new Date(this._d.getTime()) : null;\n },\n /**\n * set the current selection\n */\n setDate: function (date, preventOnSelect) {\n if (!date) {\n this._d = null;\n if (this._o.field) {\n this._o.field.value = '';\n fireEvent(this._o.field, 'change', { firedBy: this });\n }\n return this.draw();\n }\n if (typeof date === 'string') {\n date = new Date(Date.parse(date));\n }\n if (!isDate(date)) {\n return;\n }\n var min = this._o.minDate, max = this._o.maxDate;\n if (isDate(min) && date < min) {\n date = min;\n }\n else if (isDate(max) && date > max) {\n date = max;\n }\n this._d = new Date(date.getTime());\n setToStartOfDay(this._d);\n this.gotoDate(this._d);\n if (this._o.field) {\n this._o.field.value = this.toString();\n fireEvent(this._o.field, 'change', { firedBy: this });\n }\n if (!preventOnSelect && typeof this._o.onSelect === 'function') {\n this._o.onSelect.call(this, this.getDate());\n }\n },\n /**\n * change view to a specific date\n */\n gotoDate: function (date) {\n var newCalendar = true;\n if (!isDate(date)) {\n return;\n }\n if (this.calendars) {\n var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1), lastVisibleDate = new Date(this.calendars[this.calendars.length - 1].year, this.calendars[this.calendars.length - 1].month, 1), visibleDate = date.getTime();\n // get the end of the month\n lastVisibleDate.setMonth(lastVisibleDate.getMonth() + 1);\n lastVisibleDate.setDate(lastVisibleDate.getDate() - 1);\n newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);\n }\n if (newCalendar) {\n this.calendars = [{\n month: date.getMonth(),\n year: date.getFullYear()\n }];\n if (this._o.mainCalendar === 'right') {\n this.calendars[0].month += 1 - this._o.numberOfMonths;\n }\n }\n this.adjustCalendars();\n },\n adjustDate: function (sign, days) {\n var day = this.getDate() || new Date();\n var difference = parseInt(days) * 24 * 60 * 60 * 1000;\n var newDay;\n if (sign === 'add') {\n newDay = new Date(day.valueOf() + difference);\n }\n else if (sign === 'subtract') {\n newDay = new Date(day.valueOf() - difference);\n }\n this.setDate(newDay);\n },\n adjustCalendars: function () {\n this.calendars[0] = adjustCalendar(this.calendars[0]);\n for (var c = 1; c < this._o.numberOfMonths; c++) {\n this.calendars[c] = adjustCalendar({\n month: this.calendars[0].month + c,\n year: this.calendars[0].year\n });\n }\n this.draw();\n },\n gotoToday: function () {\n this.gotoDate(new Date());\n },\n /**\n * change view to a specific month (zero-index, e.g. 0: January)\n */\n gotoMonth: function (month) {\n if (!isNaN(month)) {\n this.calendars[0].month = parseInt(month, 10);\n this.adjustCalendars();\n }\n },\n nextMonth: function () {\n this.calendars[0].month++;\n this.adjustCalendars();\n },\n prevMonth: function () {\n this.calendars[0].month--;\n this.adjustCalendars();\n },\n /**\n * change view to a specific full year (e.g. \"2012\")\n */\n gotoYear: function (year) {\n if (!isNaN(year)) {\n this.calendars[0].year = parseInt(year, 10);\n this.adjustCalendars();\n }\n },\n /**\n * change the minDate\n */\n setMinDate: function (value) {\n if (value instanceof Date) {\n setToStartOfDay(value);\n this._o.minDate = value;\n this._o.minYear = value.getFullYear();\n this._o.minMonth = value.getMonth();\n }\n else {\n this._o.minDate = defaults.minDate;\n this._o.minYear = defaults.minYear;\n this._o.minMonth = defaults.minMonth;\n this._o.startRange = defaults.startRange;\n }\n this.draw();\n },\n /**\n * change the maxDate\n */\n setMaxDate: function (value) {\n if (value instanceof Date) {\n setToStartOfDay(value);\n this._o.maxDate = value;\n this._o.maxYear = value.getFullYear();\n this._o.maxMonth = value.getMonth();\n }\n else {\n this._o.maxDate = defaults.maxDate;\n this._o.maxYear = defaults.maxYear;\n this._o.maxMonth = defaults.maxMonth;\n this._o.endRange = defaults.endRange;\n }\n this.draw();\n },\n setStartRange: function (value) {\n this._o.startRange = value;\n },\n setEndRange: function (value) {\n this._o.endRange = value;\n },\n /**\n * refresh the HTML\n */\n draw: function (force) {\n if (!this._v && !force) {\n return;\n }\n var opts = this._o, minYear = opts.minYear, maxYear = opts.maxYear, minMonth = opts.minMonth, maxMonth = opts.maxMonth, html = '', randId;\n if (this._y <= minYear) {\n this._y = minYear;\n if (!isNaN(minMonth) && this._m < minMonth) {\n this._m = minMonth;\n }\n }\n if (this._y >= maxYear) {\n this._y = maxYear;\n if (!isNaN(maxMonth) && this._m > maxMonth) {\n this._m = maxMonth;\n }\n }\n randId = 'pika-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2);\n for (var c = 0; c < opts.numberOfMonths; c++) {\n html += '
' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId) + '
';\n }\n this.el.innerHTML = html;\n if (opts.bound) {\n if (opts.field.type !== 'hidden') {\n sto(function () {\n opts.trigger.focus();\n }, 1);\n }\n }\n if (typeof this._o.onDraw === 'function') {\n this._o.onDraw(this);\n }\n if (opts.bound) {\n // let the screen reader user know to use arrow keys\n opts.field.setAttribute('aria-label', 'Use the arrow keys to pick a date');\n }\n },\n adjustPosition: function () {\n var field, pEl, width, height, viewportWidth, viewportHeight, scrollTop, left, top, clientRect;\n if (this._o.container)\n return;\n this.el.style.position = 'absolute';\n field = this._o.trigger;\n pEl = field;\n width = this.el.offsetWidth;\n height = this.el.offsetHeight;\n viewportWidth = window.innerWidth || document.documentElement.clientWidth;\n viewportHeight = window.innerHeight || document.documentElement.clientHeight;\n scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;\n if (typeof field.getBoundingClientRect === 'function') {\n clientRect = field.getBoundingClientRect();\n left = clientRect.left + window.pageXOffset;\n top = clientRect.bottom + window.pageYOffset;\n }\n else {\n left = pEl.offsetLeft;\n top = pEl.offsetTop + pEl.offsetHeight;\n while ((pEl = pEl.offsetParent)) {\n left += pEl.offsetLeft;\n top += pEl.offsetTop;\n }\n }\n // default position is bottom & left\n if ((this._o.reposition && left + width > viewportWidth) ||\n (this._o.position.indexOf('right') > -1 &&\n left - width + field.offsetWidth > 0)) {\n left = left - width + field.offsetWidth;\n }\n if ((this._o.reposition && top + height > viewportHeight + scrollTop) ||\n (this._o.position.indexOf('top') > -1 &&\n top - height - field.offsetHeight > 0)) {\n top = top - height - field.offsetHeight;\n }\n this.el.style.left = left + 'px';\n this.el.style.top = top + 'px';\n },\n /**\n * render HTML for a particular month\n */\n render: function (year, month, randId) {\n var opts = this._o, now = new Date(), days = getDaysInMonth(year, month), before = new Date(year, month, 1).getDay(), data = [], row = [];\n setToStartOfDay(now);\n if (opts.firstDay > 0) {\n before -= opts.firstDay;\n if (before < 0) {\n before += 7;\n }\n }\n var previousMonth = month === 0 ? 11 : month - 1, nextMonth = month === 11 ? 0 : month + 1, yearOfPreviousMonth = month === 0 ? year - 1 : year, yearOfNextMonth = month === 11 ? year + 1 : year, daysInPreviousMonth = getDaysInMonth(yearOfPreviousMonth, previousMonth);\n var cells = days + before, after = cells;\n while (after > 7) {\n after -= 7;\n }\n cells += 7 - after;\n var isWeekSelected = false;\n for (var i = 0, r = 0; i < cells; i++) {\n var day = new Date(year, month, 1 + (i - before)), isSelected = isDate(this._d) ? compareDates(day, this._d) : false, isToday = compareDates(day, now), hasEvent = opts.events.indexOf(day.toDateString()) !== -1 ? true : false, isEmpty = i < before || i >= (days + before), dayNumber = 1 + (i - before), monthNumber = month, yearNumber = year, isStartRange = opts.startRange && compareDates(opts.startRange, day), isEndRange = opts.endRange && compareDates(opts.endRange, day), isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange, isDisabled = (opts.minDate && day < opts.minDate) ||\n (opts.maxDate && day > opts.maxDate) ||\n (opts.disableWeekends && isWeekend(day)) ||\n (opts.disableDayFn && opts.disableDayFn(day));\n if (isEmpty) {\n if (i < before) {\n dayNumber = daysInPreviousMonth + dayNumber;\n monthNumber = previousMonth;\n yearNumber = yearOfPreviousMonth;\n }\n else {\n dayNumber = dayNumber - days;\n monthNumber = nextMonth;\n yearNumber = yearOfNextMonth;\n }\n }\n var dayConfig = {\n day: dayNumber,\n month: monthNumber,\n year: yearNumber,\n hasEvent: hasEvent,\n isSelected: isSelected,\n isToday: isToday,\n isDisabled: isDisabled,\n isEmpty: isEmpty,\n isStartRange: isStartRange,\n isEndRange: isEndRange,\n isInRange: isInRange,\n showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths,\n enableSelectionDaysInNextAndPreviousMonths: opts.enableSelectionDaysInNextAndPreviousMonths\n };\n if (opts.pickWholeWeek && isSelected) {\n isWeekSelected = true;\n }\n row.push(renderDay(dayConfig));\n if (++r === 7) {\n if (opts.showWeekNumber) {\n row.unshift(renderWeek(i - before, month, year));\n }\n data.push(renderRow(row, opts.isRTL, opts.pickWholeWeek, isWeekSelected));\n row = [];\n r = 0;\n isWeekSelected = false;\n }\n }\n return renderTable(opts, data, randId);\n },\n isVisible: function () {\n return this._v;\n },\n show: function () {\n if (!this.isVisible()) {\n this._v = true;\n this.draw();\n removeClass(this.el, 'is-hidden');\n if (this._o.bound) {\n addEvent(document, 'click', this._onClick);\n this.adjustPosition();\n }\n if (typeof this._o.onOpen === 'function') {\n this._o.onOpen.call(this);\n }\n }\n },\n hide: function () {\n var v = this._v;\n if (v !== false) {\n if (this._o.bound) {\n removeEvent(document, 'click', this._onClick);\n }\n this.el.style.position = 'static'; // reset\n this.el.style.left = 'auto';\n this.el.style.top = 'auto';\n addClass(this.el, 'is-hidden');\n this._v = false;\n if (v !== undefined && typeof this._o.onClose === 'function') {\n this._o.onClose.call(this);\n }\n }\n },\n /**\n * GAME OVER\n */\n destroy: function () {\n var opts = this._o;\n this.hide();\n removeEvent(this.el, 'mousedown', this._onMouseDown, true);\n removeEvent(this.el, 'touchend', this._onMouseDown, true);\n removeEvent(this.el, 'change', this._onChange);\n if (opts.keyboardInput) {\n removeEvent(document, 'keydown', this._onKeyChange);\n }\n if (opts.field) {\n removeEvent(opts.field, 'change', this._onInputChange);\n if (opts.bound) {\n removeEvent(opts.trigger, 'click', this._onInputClick);\n removeEvent(opts.trigger, 'focus', this._onInputFocus);\n removeEvent(opts.trigger, 'blur', this._onInputBlur);\n }\n }\n if (this.el.parentNode) {\n this.el.parentNode.removeChild(this.el);\n }\n }\n };\n return Pikaday;\n }));\n}\n"]}