(function (context, $) {

  "use strict";

  context.JK = context.JK || {};
  context.JK.StepConfigureVoiceChat = function (app) {

    var ASSIGNMENT = context.JK.ASSIGNMENT;
    var VOICE_CHAT = context.JK.VOICE_CHAT;
    var gearUtils = context.JK.GearUtils;
    var logger = context.JK.logger;

    var $step = null;
    var $reuseAudioInputRadio = null;
    var $useChatInputRadio = null;
    var $chatInputs = null;
    var $templateChatInput = null;
    var $selectedChatInput = null;// should only be used if isChatEnabled = true

    var voiceChatHelper = new context.JK.VoiceChatHelper(app);
    var firstTimeShown = false;

    function handleHelp() {
      return "https://jamkazam.desk.com/customer/portal/articles/1599963-first-time-setup---step-4---configure-voice-chat";
    }

    function newSession() {
      firstTimeShown = true;
    }

    function beforeShow() {
      var forceDisabledChat = firstTimeShown;

      voiceChatHelper.reset(forceDisabledChat);
      voiceChatHelper.beforeShow();
      firstTimeShown = false;
    }

    function beforeHide() {
      voiceChatHelper.beforeHide();
    }

    function handleNext() {
      return true;
    }

    function initialize(_$step) {
      $step = _$step;

      voiceChatHelper.initialize($step, 'configure_voice_gear_wizard', true, {vuType: "vertical", lightCount: 8, lightWidth: 3, lightHeight: 10}, 101);

    }

    this.handleHelp = handleHelp;
    this.handleNext = handleNext;
    this.newSession = newSession;
    this.beforeShow = beforeShow;
    this.beforeHide = beforeHide;
    this.initialize = initialize;

    return this;
  }
})(window, jQuery);