<commit_before>window.SERIES_OPTS = [
    {val: 'bo1', label: 'Best of 1'},
    {val: 'bo3', label: 'Best of 3'},
    {val: 'bo5', label: 'Best of 5'}
]

window.MAPS = [
    {name: 'ladder', label: 'Ladder', maps: [
        {val: 'blz_ap', label: "Arid Plateau"},
        {val: 'blz_as', label: "Antiga Shipyard"},
        {val: 'blz_ev', label: "Entombed Valley"},
        {val: 'blz_me', label: "Metalopolis"},
        {val: 'blz_sp', label: "Shakuras Plateau"},
        {val: 'blz_tdale', label: "Tal'Darim Altar LE"},
        {val: 'blz_st', label: "The Shattered Temple"},
        {val: 'blz_xnc', label: "Xel'Naga Caverns"}
    ]},
    {name: 'mlg', label: 'MLG', maps: [
        {val: 'mlg_as', label: "MLG Antiga Shipyard"},
        {val: 'mlg_db', label: "MLG Daybreak"},
        {val: 'mlg_ds', label: "MLG Dual Sight"},
        {val: 'mlg_me', label: "MLG Metalopolis"},
        {val: 'mlg_sp', label: "MLG Shakuras Plateau"},
        {val: 'mlg_st', label: "MLG Shattered Temple"},
        {val: 'mlg_tdale', label: "MLG Tal'Darim Altar"},
        {val: 'mlg_te', label: "MLG Terminus"},
        {val: 'mlg_tb', label: "MLG Testbug"},
        {val: 'mlg_tp', label: "MLG Typhon Peaks"},
        {val: 'mlg_xnc', label: "MLG Xel'Naga Caverns"}
    ]},
    {name: 'gsl', label: 'GSL', maps: [
        {val: 'gsl_bsb', label: "GSL Bel'Shir Beach (Official)"},
        {val: 'gsl_bsbw', label: "GSL Bel'Shir Beach (Winter)"},
        {val: 'gsl_cbts', label: "GSL Calm Before The Storm"},
        {val: 'gsl_cfse', label: "GSL Crossfire SE (Official)"},
        {val: 'gsl_cr', label: "GSL Crevasse (Official)"},
        {val: 'gsl_db', label: "GSL Daybreak"},
        {val: 'gsl_ds', label: "GSL Dual Sight"},
        {val: 'gsl_mt', label: "GSL Metropolis"},
        {val: 'gsl_tre', label: "GSL Terminus RE"},
        {val: 'gsl_tse', label: "GSL Terminus SE (v1.1)"},
        {val: 'gsl_xnf', label: "GSL Xel'Naga Fortress (Official)"}
    ]},
    {name: 'blizzard', label: 'Blizzard', maps: [
        {val: 'blz_av', label: "Agria Valley"},
        {val: 'blz_ab', label: "Abyss"},
        {val: 'blz_ac', label: "Abyssal Caverns"},
        {val: 'blz_bwg', label: "Backwater Gulch"},
        {val: 'blz_bs', label: "Blistering Sands"},
        {val: 'blz_bg', label: "Burial Grounds"},
        {val: 'blz_cf', label: "Crossfire"},
        {val: 'blz_df', label: "Debris Field"},
        {val: 'blz_dq', label: "Delta Quadrant"},
        {val: 'blz_do', label: "Desert Oasis"},
        {val: 'blz_el', label: "Elysium"},
        {val: 'blz_fp', label: "Forbidden Planet"},
        {val: 'blz_iz', label: "Incineration Zone"},
        {val: 'blz_jb', label: "Jungle Basin"},
        {val: 'blz_jy', label: "Junk Yard"},
        {val: 'blz_kr', label: "<NAME>"},
        {val: 'blz_lt', label: "Lost Temple"},
        {val: 'blz_nc', label: "Neraz<NAME>"},
        {val: 'blz_ss', label: "Scrap Station"},
        {val: 'blz_sc', label: "Searing Crater"},
        {val: 'blz_slp', label: "Slag Pits"},
        {val: 'blz_sow', label: "Steps of War"},
        {val: 'blz_tr', label: "Tectonic Rift"},
        {val: 'blz_ter', label: "Terminus"},
        {val: 'blz_tp', label: "Typhon Peaks"},
        {val: 'blz_ws', label: "Worldship"}
    ]}
]

window.MAP_LABELS = {}
for map in _.flatten(_.pluck(MAPS, 'maps'))
    MAP_LABELS[map.val] = map.label

class window.CreateLobbyView extends View
    id: 'create-lobby-view'

    events:
        'click #create-lobby-btn': 'createLobby'
        'click #close-create-lobby-btn': 'close'
        'click #map-tabs li a': 'changeMapsTab'
        'change input[name="opp-races"]': 'changeOppRaces'
        'change input[name="opp-leagues"]': 'changeOppLeagues'
        'change input[name="maps"]': 'changeMaps'
        'change input[name="series"]': 'changeSeries'

    render: =>
        config = @app.getConfig()
        fields = this._render('split-checkbox-group',
            name: 'opp-leagues'
            label: "Opponent's league"
            checked: config.get('opp_leagues')
            opts: LEAGUE_OPTS
        )
        fields += this._render('checkbox-group',
            name: 'opp-races'
            label: "Opponent's race"
            checked: config.get('opp_races')
            opts: RACE_OPTS
        )
        fields += this._render('checkbox-group',
            name: 'series'
            label: 'Series type'
            checked: config.get('series')
            opts: SERIES_OPTS
        )
        fields += this._render('map-field',
            sections: MAPS
            checked: config.get('maps')
        )
        $(@el).html(this._render('create-lobby', {fields: fields}))

    close: =>
        @app.showLobby()

    validate: (vals, id, msg) =>
        if vals.length is 0
            this.$('#' + id + '-cg').addClass('error')
            this.$('#' + id + '-cg .input').append(
                this._render('form-error', {msg: msg}))
            return false
        return true

    validateOptions: =>
        this.$('.control-group').removeClass('error')
        this.$('.help-inline').remove()
        config = @app.getConfig()
        opts_valid = true
        opts_valid &= this.validate(config.get('opp_races'), 'opp-races',
            'Choose at least one race')
        opts_valid &= this.validate(config.get('opp_leagues'), 'opp-leagues',
            'Choose at least one league')
        opts_valid &= this.validate(config.get('series'), 'series',
            'Choose at least one series type')
        opts_valid &= this.validate(config.get('maps'), 'maps',
            'Choose at least one map')
        return opts_valid<commit_msg>Removed error messages from lobby creation<commit_after>window.SERIES_OPTS = [
    {val: 'bo1', label: 'Best of 1'},
    {val: 'bo3', label: 'Best of 3'},
    {val: 'bo5', label: 'Best of 5'}
]

window.MAPS = [
    {name: 'ladder', label: 'Ladder', maps: [
        {val: 'blz_ap', label: "Arid Plateau"},
        {val: 'blz_as', label: "Antiga Shipyard"},
        {val: 'blz_ev', label: "Entombed Valley"},
        {val: 'blz_me', label: "Metalopolis"},
        {val: 'blz_sp', label: "Shakuras Plateau"},
        {val: 'blz_tdale', label: "Tal'Darim Altar LE"},
        {val: 'blz_st', label: "The Shattered Temple"},
        {val: 'blz_xnc', label: "Xel'Naga Caverns"}
    ]},
    {name: 'mlg', label: 'MLG', maps: [
        {val: 'mlg_as', label: "MLG Antiga Shipyard"},
        {val: 'mlg_db', label: "MLG Daybreak"},
        {val: 'mlg_ds', label: "MLG Dual Sight"},
        {val: 'mlg_me', label: "MLG Metalopolis"},
        {val: 'mlg_sp', label: "MLG Shakuras Plateau"},
        {val: 'mlg_st', label: "MLG Shattered Temple"},
        {val: 'mlg_tdale', label: "MLG Tal'Darim Altar"},
        {val: 'mlg_te', label: "MLG Terminus"},
        {val: 'mlg_tb', label: "MLG Testbug"},
        {val: 'mlg_tp', label: "MLG Typhon Peaks"},
        {val: 'mlg_xnc', label: "MLG Xel'Naga Caverns"}
    ]},
    {name: 'gsl', label: 'GSL', maps: [
        {val: 'gsl_bsb', label: "GSL Bel'Shir Beach (Official)"},
        {val: 'gsl_bsbw', label: "GSL Bel'Shir Beach (Winter)"},
        {val: 'gsl_cbts', label: "GSL Calm Before The Storm"},
        {val: 'gsl_cfse', label: "GSL Crossfire SE (Official)"},
        {val: 'gsl_cr', label: "GSL Crevasse (Official)"},
        {val: 'gsl_db', label: "GSL Daybreak"},
        {val: 'gsl_ds', label: "GSL Dual Sight"},
        {val: 'gsl_mt', label: "GSL Metropolis"},
        {val: 'gsl_tre', label: "GSL Terminus RE"},
        {val: 'gsl_tse', label: "GSL Terminus SE (v1.1)"},
        {val: 'gsl_xnf', label: "GSL Xel'Naga Fortress (Official)"}
    ]},
    {name: 'blizzard', label: 'Blizzard', maps: [
        {val: 'blz_av', label: "Agria Valley"},
        {val: 'blz_ab', label: "Abyss"},
        {val: 'blz_ac', label: "Abyssal Caverns"},
        {val: 'blz_bwg', label: "Backwater Gulch"},
        {val: 'blz_bs', label: "Blistering Sands"},
        {val: 'blz_bg', label: "Burial Grounds"},
        {val: 'blz_cf', label: "Crossfire"},
        {val: 'blz_df', label: "Debris Field"},
        {val: 'blz_dq', label: "Delta Quadrant"},
        {val: 'blz_do', label: "Desert Oasis"},
        {val: 'blz_el', label: "Elysium"},
        {val: 'blz_fp', label: "Forbidden Planet"},
        {val: 'blz_iz', label: "Incineration Zone"},
        {val: 'blz_jb', label: "Jungle Basin"},
        {val: 'blz_jy', label: "Junk Yard"},
        {val: 'blz_kr', label: "Kulas Ravine"},
        {val: 'blz_lt', label: "Lost Temple"},
        {val: 'blz_nc', label: "Nerazim Crypt"},
        {val: 'blz_ss', label: "Scrap Station"},
        {val: 'blz_sc', label: "Searing Crater"},
        {val: 'blz_slp', label: "Slag Pits"},
        {val: 'blz_sow', label: "Steps of War"},
        {val: 'blz_tr', label: "Tectonic Rift"},
        {val: 'blz_ter', label: "Terminus"},
        {val: 'blz_tp', label: "Typhon Peaks"},
        {val: 'blz_ws', label: "Worldship"}
    ]}
]

window.MAP_LABELS = {}
for map in _.flatten(_.pluck(MAPS, 'maps'))
    MAP_LABELS[map.val] = map.label

class window.CreateLobbyView extends View
    id: 'create-lobby-view'

    events:
        'click #create-lobby-btn': 'createLobby'
        'click #close-create-lobby-btn': 'close'
        'click #map-tabs li a': 'changeMapsTab'
        'change input[name="opp-races"]': 'changeOppRaces'
        'change input[name="opp-leagues"]': 'changeOppLeagues'
        'change input[name="maps"]': 'changeMaps'
        'change input[name="series"]': 'changeSeries'

    render: =>
        config = @app.getConfig()
        fields = this._render('split-checkbox-group',
            name: 'opp-leagues'
            label: "Opponent's league"
            checked: config.get('opp_leagues')
            opts: LEAGUE_OPTS
        )
        fields += this._render('checkbox-group',
            name: 'opp-races'
            label: "Opponent's race"
            checked: config.get('opp_races')
            opts: RACE_OPTS
        )
        fields += this._render('checkbox-group',
            name: 'series'
            label: 'Series type'
            checked: config.get('series')
            opts: SERIES_OPTS
        )
        fields += this._render('map-field',
            sections: MAPS
            checked: config.get('maps')
        )
        $(@el).html(this._render('create-lobby', {fields: fields}))

    close: =>
        @app.showLobby()

    validate: (vals, id) =>
        if vals.length is 0
            this.$('#' + id + '-cg').addClass('error')
            return false
        return true

    validateOptions: =>
        this.$('.control-group').removeClass('error')
        this.$('.help-inline').remove()
        config = @app.getConfig()
        opts_valid = true
        opts_valid &= this.validate(config.get('opp_races'), 'opp-races')
        opts_valid &= this.validate(config.get('opp_leagues'), 'opp-leagues')
        opts_valid &= this.validate(config.get('series'), 'series')
        opts_valid &= this.validate(config.get('maps'), 'maps')
        return opts_valid
{'fraction_non_alphanumeric': 0.1836235038084875, 'fraction_numerical': 0.001632208922742111, 'mean_word_length': 2.5135393437400446, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4420345', 'n_tokens_mistral': 4030, 'n_tokens_neox': 3931, 'n_words': 951}